From ad4d185772594d0cafa9aeb81fc2a2b2dfca70ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zaporski?= Date: Tue, 28 Apr 2026 16:17:14 +0200 Subject: [PATCH 1/3] Update sorbet, tapioca and other gems --- .rubocop.yml | 6 + .ruby-version | 2 +- Gemfile | 16 +- Gemfile.lock | 130 +- lib/shale/builder.rb | 2 +- shale-builder.gemspec | 2 +- sorbet/config | 1 + sorbet/rbi/annotations/minitest.rbi | 4 - ...emodel@8.0.3.rbi => activemodel@8.1.3.rbi} | 2529 ++-- ...port@8.0.3.rbi => activesupport@8.1.3.rbi} | 9364 ++++++------- ...enchmark@0.4.1.rbi => benchmark@0.5.0.rbi} | 124 +- sorbet/rbi/gems/booleans@0.1.1.rbi | 24 - sorbet/rbi/gems/booleans@0.1.3.rbi | 31 + .../{byebug@11.1.3.rbi => byebug@13.0.0.rbi} | 0 sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi | 11657 ---------------- sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi | 10640 ++++++++++++++ ...ol@2.5.4.rbi => connection_pool@3.0.2.rbi} | 0 sorbet/rbi/gems/i18n@1.14.7.rbi | 9 - sorbet/rbi/gems/i18n@1.14.8.rbi | 2255 +++ sorbet/rbi/gems/io-console@0.8.2.rbi | 9 + .../gems/{json@2.15.1.rbi => json@2.19.4.rbi} | 532 +- ...minitest@5.17.0.rbi => minitest@6.0.5.rbi} | 0 sorbet/rbi/gems/parallel@1.27.0.rbi | 291 - sorbet/rbi/gems/parallel@2.1.0.rbi | 321 + .../gems/{prism@1.5.2.rbi => prism@1.9.0.rbi} | 0 .../gems/{rake@13.0.6.rbi => rake@13.4.2.rbi} | 0 .../gems/{rbi@0.3.7.rbi => rbi@0.3.10.rbi} | 4509 ++---- .../rbi/gems/{rbs@3.9.5.rbi => rbs@4.0.2.rbi} | 0 sorbet/rbi/gems/reline@0.6.3.rbi | 9 + sorbet/rbi/gems/require-hooks@0.3.0.rbi | 120 + sorbet/rbi/gems/rexml@3.4.4.rbi | 4905 +++++++ sorbet/rbi/gems/rubydex@0.1.0.beta13.rbi | 651 + sorbet/rbi/gems/spoom@1.6.1.rbi | 7274 ---------- sorbet/rbi/gems/spoom@1.7.13.rbi | 6151 ++++++++ ...tapioca@0.16.11.rbi => tapioca@0.19.1.rbi} | 2399 ++-- .../gems/{thor@1.4.0.rbi => thor@1.5.0.rbi} | 1933 +-- sorbet/rbi/gems/tsort@0.2.0.rbi | 389 + sorbet/rbi/gems/unicode-emoji@4.1.0.rbi | 251 - sorbet/rbi/gems/unicode-emoji@4.2.0.rbi | 332 + .../rbi/gems/{uri@1.0.4.rbi => uri@1.1.1.rbi} | 741 +- test/shale/builder_test.rb | 14 +- 41 files changed, 35836 insertions(+), 31791 deletions(-) rename sorbet/rbi/gems/{activemodel@8.0.3.rbi => activemodel@8.1.3.rbi} (71%) rename sorbet/rbi/gems/{activesupport@8.0.3.rbi => activesupport@8.1.3.rbi} (63%) rename sorbet/rbi/gems/{benchmark@0.4.1.rbi => benchmark@0.5.0.rbi} (88%) delete mode 100644 sorbet/rbi/gems/booleans@0.1.1.rbi create mode 100644 sorbet/rbi/gems/booleans@0.1.3.rbi rename sorbet/rbi/gems/{byebug@11.1.3.rbi => byebug@13.0.0.rbi} (100%) delete mode 100644 sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi create mode 100644 sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi rename sorbet/rbi/gems/{connection_pool@2.5.4.rbi => connection_pool@3.0.2.rbi} (100%) delete mode 100644 sorbet/rbi/gems/i18n@1.14.7.rbi create mode 100644 sorbet/rbi/gems/i18n@1.14.8.rbi create mode 100644 sorbet/rbi/gems/io-console@0.8.2.rbi rename sorbet/rbi/gems/{json@2.15.1.rbi => json@2.19.4.rbi} (85%) rename sorbet/rbi/gems/{minitest@5.17.0.rbi => minitest@6.0.5.rbi} (100%) delete mode 100644 sorbet/rbi/gems/parallel@1.27.0.rbi create mode 100644 sorbet/rbi/gems/parallel@2.1.0.rbi rename sorbet/rbi/gems/{prism@1.5.2.rbi => prism@1.9.0.rbi} (100%) rename sorbet/rbi/gems/{rake@13.0.6.rbi => rake@13.4.2.rbi} (100%) rename sorbet/rbi/gems/{rbi@0.3.7.rbi => rbi@0.3.10.rbi} (53%) rename sorbet/rbi/gems/{rbs@3.9.5.rbi => rbs@4.0.2.rbi} (100%) create mode 100644 sorbet/rbi/gems/reline@0.6.3.rbi create mode 100644 sorbet/rbi/gems/require-hooks@0.3.0.rbi create mode 100644 sorbet/rbi/gems/rexml@3.4.4.rbi create mode 100644 sorbet/rbi/gems/rubydex@0.1.0.beta13.rbi delete mode 100644 sorbet/rbi/gems/spoom@1.6.1.rbi create mode 100644 sorbet/rbi/gems/spoom@1.7.13.rbi rename sorbet/rbi/gems/{tapioca@0.16.11.rbi => tapioca@0.19.1.rbi} (53%) rename sorbet/rbi/gems/{thor@1.4.0.rbi => thor@1.5.0.rbi} (66%) create mode 100644 sorbet/rbi/gems/tsort@0.2.0.rbi delete mode 100644 sorbet/rbi/gems/unicode-emoji@4.1.0.rbi create mode 100644 sorbet/rbi/gems/unicode-emoji@4.2.0.rbi rename sorbet/rbi/gems/{uri@1.0.4.rbi => uri@1.1.1.rbi} (78%) diff --git a/.rubocop.yml b/.rubocop.yml index 599c301..3c5e341 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -32,3 +32,9 @@ Sorbet/ForbidTHelpers: Style/DocumentDynamicEvalDefinition: Enabled: false + +Style/HashLookupMethod: + Enabled: false + +Style/OneClassPerFile: + Enabled: false diff --git a/.ruby-version b/.ruby-version index 4f5e697..7921bd0 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.5 +3.4.8 diff --git a/Gemfile b/Gemfile index b4c5c38..521b9e6 100644 --- a/Gemfile +++ b/Gemfile @@ -5,16 +5,16 @@ source 'https://rubygems.org' # Specify your gem's dependencies in diggable.gemspec gemspec -gem 'activemodel', '~> 8.0' # validations +gem 'activemodel', '~> 8.1' # validations gem 'base64', '~> 0.3' # Base64 -gem 'byebug', '~> 11.1' # debugger -gem 'minitest', '~> 5.0' # test framework +gem 'byebug', '~> 13.0' # debugger +gem 'minitest', '~> 6.0' # test framework gem 'mutex_m', '~> 0.3' # Mutexes gem 'racc', '~> 1.8' # parser -gem 'rake', '~> 13.0' # automation tasks -gem 'rubocop', '~> 1.81' # ruby linter +gem 'rake', '~> 13.4' # automation tasks +gem 'rubocop', '~> 1.86' # ruby linter gem 'rubocop-espago', '~> 1.2' # Espago rubocop config -gem 'rubocop-sorbet', '~> 0.11' # sorbet rubocop config +gem 'rubocop-sorbet', '~> 0.12' # sorbet rubocop config gem 'shoulda-context', '~> 2.0' # more pleasant test syntax -gem 'sorbet', '>= 0.5' # static typechecker -gem 'tapioca', '> 0.13' # RBI generator for sorbet +gem 'sorbet', '>= 0.6' # static typechecker +gem 'tapioca', '> 0.19' # RBI generator for sorbet diff --git a/Gemfile.lock b/Gemfile.lock index 5d4ae3d..ab60dee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,21 +4,21 @@ PATH shale-builder (0.9.3) booleans (>= 0.1) shale (< 2.0) - sorbet-runtime (> 0.5) + sorbet-runtime (> 0.6) GEM remote: https://rubygems.org/ specs: - activemodel (8.0.3) - activesupport (= 8.0.3) - activesupport (8.0.3) + activemodel (8.1.3) + activesupport (= 8.1.3) + activesupport (8.1.3) base64 - benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + json logger (>= 1.4.2) minitest (>= 5.1) securerandom (>= 0.3) @@ -26,96 +26,110 @@ GEM uri (>= 0.13.1) ast (2.4.3) base64 (0.3.0) - benchmark (0.4.1) - bigdecimal (3.2.3) - booleans (0.1.1) - byebug (11.1.3) - concurrent-ruby (1.3.5) - connection_pool (2.5.4) + benchmark (0.5.0) + bigdecimal (4.1.2) + booleans (0.1.3) + sorbet-runtime (>= 0.5) + byebug (13.0.0) + reline (>= 0.6.0) + concurrent-ruby (1.3.6) + connection_pool (3.0.2) drb (2.2.3) erubi (1.13.1) - i18n (1.14.7) + i18n (1.14.8) concurrent-ruby (~> 1.0) - json (2.15.1) + io-console (0.8.2) + json (2.19.4) language_server-protocol (3.17.0.5) lint_roller (1.1.0) logger (1.7.0) - minitest (5.17.0) + minitest (6.0.5) + drb (~> 2.0) + prism (~> 1.5) mutex_m (0.3.0) netrc (0.11.0) - parallel (1.27.0) - parser (3.3.9.0) + parallel (2.1.0) + parser (3.3.11.1) ast (~> 2.4.1) racc - prism (1.5.2) + prism (1.9.0) racc (1.8.1) rainbow (3.1.1) - rake (13.0.6) - rbi (0.3.7) + rake (13.4.2) + rbi (0.3.10) prism (~> 1.0) - rbs (>= 3.4.4) - rbs (3.9.5) + rbs (>= 4.0.1) + rbs (4.0.2) logger - regexp_parser (2.11.3) - rubocop (1.81.1) + prism (>= 1.6.0) + tsort + regexp_parser (2.12.0) + reline (0.6.3) + io-console (~> 0.5) + require-hooks (0.3.0) + rexml (3.4.4) + rubocop (1.86.1) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) - parallel (~> 1.10) + parallel (>= 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.47.1, < 2.0) + rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.47.1) + rubocop-ast (1.49.1) parser (>= 3.3.7.2) - prism (~> 1.4) + prism (~> 1.7) rubocop-espago (1.2.0) rubocop - rubocop-sorbet (0.11.0) + rubocop-sorbet (0.12.0) lint_roller rubocop (>= 1.75.2) ruby-progressbar (1.13.0) + rubydex (0.1.0.beta13-arm64-darwin) + rubydex (0.1.0.beta13-x86_64-linux) securerandom (0.4.1) shale (1.2.2) bigdecimal shoulda-context (2.0.0) - sorbet (0.6.12642) - sorbet-static (= 0.6.12642) - sorbet-runtime (0.6.12642) - sorbet-static (0.6.12642-universal-darwin) - sorbet-static (0.6.12642-x86_64-linux) - sorbet-static-and-runtime (0.6.12642) - sorbet (= 0.6.12642) - sorbet-runtime (= 0.6.12642) - spoom (1.6.1) + sorbet (0.6.13169) + sorbet-static (= 0.6.13169) + sorbet-runtime (0.6.13169) + sorbet-static (0.6.13169-universal-darwin) + sorbet-static (0.6.13169-x86_64-linux) + sorbet-static-and-runtime (0.6.13169) + sorbet (= 0.6.13169) + sorbet-runtime (= 0.6.13169) + spoom (1.7.13) erubi (>= 1.10.0) prism (>= 0.28.0) - rbi (>= 0.2.3) + rbi (>= 0.3.3) + rbs (>= 4.0.0.dev.5) + rexml (>= 3.2.6) sorbet-static-and-runtime (>= 0.5.10187) thor (>= 0.19.2) - tapioca (0.16.11) + tapioca (0.19.1) benchmark bundler (>= 2.2.25) netrc (>= 0.11.0) parallel (>= 1.21.0) - rbi (~> 0.2) - sorbet-static-and-runtime (>= 0.5.11087) - spoom (>= 1.2.0) + rbi (>= 0.3.7) + require-hooks (>= 0.2.2) + rubydex (>= 0.1.0.beta10) + sorbet-static-and-runtime (>= 0.6.12698) + spoom (>= 1.7.9) thor (>= 1.2.0) - yard-sorbet - thor (1.4.0) + tsort + thor (1.5.0) + tsort (0.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (3.2.0) unicode-emoji (~> 4.1) - unicode-emoji (4.1.0) - uri (1.0.4) - yard (0.9.37) - yard-sorbet (0.9.0) - sorbet-runtime - yard + unicode-emoji (4.2.0) + uri (1.1.1) PLATFORMS arm64-darwin-20 @@ -124,20 +138,20 @@ PLATFORMS x86_64-linux DEPENDENCIES - activemodel (~> 8.0) + activemodel (~> 8.1) base64 (~> 0.3) - byebug (~> 11.1) - minitest (~> 5.0) + byebug (~> 13.0) + minitest (~> 6.0) mutex_m (~> 0.3) racc (~> 1.8) - rake (~> 13.0) - rubocop (~> 1.81) + rake (~> 13.4) + rubocop (~> 1.86) rubocop-espago (~> 1.2) - rubocop-sorbet (~> 0.11) + rubocop-sorbet (~> 0.12) shale-builder! shoulda-context (~> 2.0) - sorbet (>= 0.5) - tapioca (> 0.13) + sorbet (>= 0.6) + tapioca (> 0.19) BUNDLED WITH 2.7.2 diff --git a/lib/shale/builder.rb b/lib/shale/builder.rb index fbab343..c908337 100644 --- a/lib/shale/builder.rb +++ b/lib/shale/builder.rb @@ -72,7 +72,7 @@ module ClassMethods extend T::Generic abstract! - has_attached_class! + has_attached_class!(:out) #: (Class subclass) -> void def inherited(subclass) diff --git a/shale-builder.gemspec b/shale-builder.gemspec index c3ce5f2..d6c6d34 100644 --- a/shale-builder.gemspec +++ b/shale-builder.gemspec @@ -33,6 +33,6 @@ Gem::Specification.new do |spec| # Uncomment to register a new dependency of your gem spec.add_dependency 'booleans', '>= 0.1' spec.add_dependency 'shale', '< 2.0' - spec.add_dependency 'sorbet-runtime', '> 0.5' + spec.add_dependency 'sorbet-runtime', '> 0.6' spec.metadata['rubygems_mfa_required'] = 'true' end diff --git a/sorbet/config b/sorbet/config index 54aa8d6..746dc6a 100644 --- a/sorbet/config +++ b/sorbet/config @@ -2,5 +2,6 @@ . --enable-experimental-requires-ancestor --enable-experimental-rbs-comments +--parser=prism --ignore=tmp/ --ignore=vendor/ diff --git a/sorbet/rbi/annotations/minitest.rbi b/sorbet/rbi/annotations/minitest.rbi index a7059f0..6404733 100644 --- a/sorbet/rbi/annotations/minitest.rbi +++ b/sorbet/rbi/annotations/minitest.rbi @@ -60,10 +60,6 @@ module Minitest::Assertions sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } def assert_same(exp, act, msg = nil); end - # @version < 6.0.0 - sig { params(send_ary: T::Array[T.anything], m: T.anything).returns(T::Boolean) } - def assert_send(send_ary, m = nil); end - sig { params(block: T.proc.void).returns(T::Boolean) } def assert_silent(&block); end diff --git a/sorbet/rbi/gems/activemodel@8.0.3.rbi b/sorbet/rbi/gems/activemodel@8.1.3.rbi similarity index 71% rename from sorbet/rbi/gems/activemodel@8.0.3.rbi rename to sorbet/rbi/gems/activemodel@8.1.3.rbi index 6ee921f..fc67912 100644 --- a/sorbet/rbi/gems/activemodel@8.0.3.rbi +++ b/sorbet/rbi/gems/activemodel@8.1.3.rbi @@ -7,25 +7,25 @@ # :include: ../README.rdoc # -# source://activemodel//lib/active_model/gem_version.rb#3 +# pkg:gem/activemodel#lib/active_model/gem_version.rb:3 module ActiveModel extend ::ActiveSupport::Autoload class << self - # source://activemodel//lib/active_model/deprecator.rb#4 + # pkg:gem/activemodel#lib/active_model/deprecator.rb:4 def deprecator; end - # source://activemodel//lib/active_model.rb#76 + # pkg:gem/activemodel#lib/active_model.rb:82 def eager_load!; end # Returns the currently loaded version of \Active \Model as a +Gem::Version+. # - # source://activemodel//lib/active_model/gem_version.rb#5 + # pkg:gem/activemodel#lib/active_model/gem_version.rb:5 def gem_version; end # Returns the currently loaded version of \Active \Model as a +Gem::Version+. # - # source://activemodel//lib/active_model/version.rb#7 + # pkg:gem/activemodel#lib/active_model/version.rb:7 def version; end end end @@ -86,7 +86,7 @@ end # refer to the specific modules included in +ActiveModel::API+ # (see below). # -# source://activemodel//lib/active_model/api.rb#59 +# pkg:gem/activemodel#lib/active_model/api.rb:59 module ActiveModel::API include ::ActiveModel::ForbiddenAttributesProtection include ::ActiveModel::AttributeAssignment @@ -117,7 +117,7 @@ module ActiveModel::API # person.name # => "bob" # person.age # => "18" # - # source://activemodel//lib/active_model/api.rb#80 + # pkg:gem/activemodel#lib/active_model/api.rb:80 def initialize(attributes = T.unsafe(nil)); end # Indicates if the model is persisted. Default is +false+. @@ -130,9 +130,7 @@ module ActiveModel::API # person = Person.new(id: 1, name: 'bob') # person.persisted? # => false # - # @return [Boolean] - # - # source://activemodel//lib/active_model/api.rb#95 + # pkg:gem/activemodel#lib/active_model/api.rb:95 def persisted?; end module GeneratedClassMethods @@ -154,293 +152,251 @@ module ActiveModel::API end end -# source://activemodel//lib/active_model/access.rb#7 +# pkg:gem/activemodel#lib/active_model/access.rb:7 module ActiveModel::Access - # source://activemodel//lib/active_model/access.rb#8 + # pkg:gem/activemodel#lib/active_model/access.rb:8 def slice(*methods); end - # source://activemodel//lib/active_model/access.rb#12 + # pkg:gem/activemodel#lib/active_model/access.rb:12 def values_at(*methods); end end -# source://activemodel//lib/active_model/attribute.rb#6 +# pkg:gem/activemodel#lib/active_model/attribute.rb:6 class ActiveModel::Attribute # This method should not be called directly. # Use #from_database or #from_user # - # @return [Attribute] a new instance of Attribute - # - # source://activemodel//lib/active_model/attribute.rb#33 + # pkg:gem/activemodel#lib/active_model/attribute.rb:33 def initialize(name, value_before_type_cast, type, original_attribute = T.unsafe(nil), value = T.unsafe(nil)); end - # source://activemodel//lib/active_model/attribute.rb#115 + # pkg:gem/activemodel#lib/active_model/attribute.rb:123 def ==(other); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute.rb#107 + # pkg:gem/activemodel#lib/active_model/attribute.rb:115 def came_from_user?; end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute.rb#66 + # pkg:gem/activemodel#lib/active_model/attribute.rb:66 def changed?; end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute.rb#70 + # pkg:gem/activemodel#lib/active_model/attribute.rb:70 def changed_in_place?; end - # source://activemodel//lib/active_model/attribute.rb#135 + # pkg:gem/activemodel#lib/active_model/attribute.rb:99 + def dup_or_share; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:143 def encode_with(coder); end - # source://activemodel//lib/active_model/attribute.rb#115 + # pkg:gem/activemodel#lib/active_model/attribute.rb:129 def eql?(other); end - # source://activemodel//lib/active_model/attribute.rb#74 + # pkg:gem/activemodel#lib/active_model/attribute.rb:74 def forgetting_assignment; end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute.rb#111 + # pkg:gem/activemodel#lib/active_model/attribute.rb:119 def has_been_read?; end - # source://activemodel//lib/active_model/attribute.rb#123 + # pkg:gem/activemodel#lib/active_model/attribute.rb:131 def hash; end - # source://activemodel//lib/active_model/attribute.rb#127 + # pkg:gem/activemodel#lib/active_model/attribute.rb:135 def init_with(coder); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute.rb#103 + # pkg:gem/activemodel#lib/active_model/attribute.rb:111 def initialized?; end - # Returns the value of attribute name. - # - # source://activemodel//lib/active_model/attribute.rb#29 + # pkg:gem/activemodel#lib/active_model/attribute.rb:29 def name; end - # source://activemodel//lib/active_model/attribute.rb#47 + # pkg:gem/activemodel#lib/active_model/attribute.rb:47 def original_value; end - # source://activemodel//lib/active_model/attribute.rb#143 + # pkg:gem/activemodel#lib/active_model/attribute.rb:151 def original_value_for_database; end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute.rb#62 + # pkg:gem/activemodel#lib/active_model/attribute.rb:62 def serializable?(&block); end - # Returns the value of attribute type. - # - # source://activemodel//lib/active_model/attribute.rb#29 + # pkg:gem/activemodel#lib/active_model/attribute.rb:29 def type; end - # @raise [NotImplementedError] - # - # source://activemodel//lib/active_model/attribute.rb#99 + # pkg:gem/activemodel#lib/active_model/attribute.rb:107 def type_cast(*_arg0); end - # source://activemodel//lib/active_model/attribute.rb#41 - def value(&_); end + # pkg:gem/activemodel#lib/active_model/attribute.rb:41 + def value(&_arg0); end - # Returns the value of attribute value_before_type_cast. - # - # source://activemodel//lib/active_model/attribute.rb#29 + # pkg:gem/activemodel#lib/active_model/attribute.rb:29 def value_before_type_cast; end - # source://activemodel//lib/active_model/attribute.rb#55 + # pkg:gem/activemodel#lib/active_model/attribute.rb:55 def value_for_database; end - # source://activemodel//lib/active_model/attribute.rb#87 + # pkg:gem/activemodel#lib/active_model/attribute.rb:87 def with_cast_value(value); end - # source://activemodel//lib/active_model/attribute.rb#91 + # pkg:gem/activemodel#lib/active_model/attribute.rb:91 def with_type(type); end - # source://activemodel//lib/active_model/attribute/user_provided_default.rb#7 + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:7 def with_user_default(value); end - # source://activemodel//lib/active_model/attribute.rb#83 + # pkg:gem/activemodel#lib/active_model/attribute.rb:83 def with_value_from_database(value); end - # source://activemodel//lib/active_model/attribute.rb#78 + # pkg:gem/activemodel#lib/active_model/attribute.rb:78 def with_value_from_user(value); end private - # source://activemodel//lib/active_model/attribute.rb#169 + # pkg:gem/activemodel#lib/active_model/attribute.rb:177 def _original_value_for_database; end - # source://activemodel//lib/active_model/attribute.rb#165 + # pkg:gem/activemodel#lib/active_model/attribute.rb:173 def _value_for_database; end - # Returns the value of attribute original_attribute. - # - # source://activemodel//lib/active_model/attribute.rb#152 + # pkg:gem/activemodel#lib/active_model/attribute.rb:161 def assigned?; end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute.rb#161 + # pkg:gem/activemodel#lib/active_model/attribute.rb:169 def changed_from_assignment?; end - # source://activemodel//lib/active_model/attribute.rb#155 + # pkg:gem/activemodel#lib/active_model/attribute.rb:163 def initialize_dup(other); end - # Returns the value of attribute original_attribute. - # - # source://activemodel//lib/active_model/attribute.rb#152 + # pkg:gem/activemodel#lib/active_model/attribute.rb:160 def original_attribute; end class << self - # source://activemodel//lib/active_model/attribute.rb#8 + # pkg:gem/activemodel#lib/active_model/attribute.rb:8 def from_database(name, value_before_type_cast, type, value = T.unsafe(nil)); end - # source://activemodel//lib/active_model/attribute.rb#12 + # pkg:gem/activemodel#lib/active_model/attribute.rb:12 def from_user(name, value_before_type_cast, type, original_attribute = T.unsafe(nil)); end - # source://activemodel//lib/active_model/attribute.rb#20 + # pkg:gem/activemodel#lib/active_model/attribute.rb:20 def null(name); end - # source://activemodel//lib/active_model/attribute.rb#24 + # pkg:gem/activemodel#lib/active_model/attribute.rb:24 def uninitialized(name, type); end - # source://activemodel//lib/active_model/attribute.rb#16 + # pkg:gem/activemodel#lib/active_model/attribute.rb:16 def with_cast_value(name, value_before_type_cast, type); end end end -# source://activemodel//lib/active_model/attribute.rb#173 +# pkg:gem/activemodel#lib/active_model/attribute.rb:181 class ActiveModel::Attribute::FromDatabase < ::ActiveModel::Attribute - # source://activemodel//lib/active_model/attribute.rb#178 + # pkg:gem/activemodel#lib/active_model/attribute.rb:186 def forgetting_assignment; end - # source://activemodel//lib/active_model/attribute.rb#174 + # pkg:gem/activemodel#lib/active_model/attribute.rb:182 def type_cast(value); end private - # source://activemodel//lib/active_model/attribute.rb#192 + # pkg:gem/activemodel#lib/active_model/attribute.rb:200 def _original_value_for_database; end end -# source://activemodel//lib/active_model/attribute.rb#197 +# pkg:gem/activemodel#lib/active_model/attribute.rb:205 class ActiveModel::Attribute::FromUser < ::ActiveModel::Attribute - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute.rb#202 + # pkg:gem/activemodel#lib/active_model/attribute.rb:210 def came_from_user?; end - # source://activemodel//lib/active_model/attribute.rb#198 + # pkg:gem/activemodel#lib/active_model/attribute.rb:206 def type_cast(value); end private - # source://activemodel//lib/active_model/attribute.rb#207 + # pkg:gem/activemodel#lib/active_model/attribute.rb:215 def _value_for_database; end end -# source://activemodel//lib/active_model/attribute.rb#222 +# pkg:gem/activemodel#lib/active_model/attribute.rb:230 class ActiveModel::Attribute::Null < ::ActiveModel::Attribute - # @return [Null] a new instance of Null - # - # source://activemodel//lib/active_model/attribute.rb#223 + # pkg:gem/activemodel#lib/active_model/attribute.rb:231 def initialize(name); end - # source://activemodel//lib/active_model/attribute.rb#227 + # pkg:gem/activemodel#lib/active_model/attribute.rb:235 def type_cast(*_arg0); end - # @raise [ActiveModel::MissingAttributeError] - # - # source://activemodel//lib/active_model/attribute.rb#235 + # pkg:gem/activemodel#lib/active_model/attribute.rb:247 def with_cast_value(value); end - # source://activemodel//lib/active_model/attribute.rb#231 + # pkg:gem/activemodel#lib/active_model/attribute.rb:239 def with_type(type); end - # @raise [ActiveModel::MissingAttributeError] - # - # source://activemodel//lib/active_model/attribute.rb#235 + # pkg:gem/activemodel#lib/active_model/attribute.rb:243 def with_value_from_database(value); end - # @raise [ActiveModel::MissingAttributeError] - # - # source://activemodel//lib/active_model/attribute.rb#235 + # pkg:gem/activemodel#lib/active_model/attribute.rb:246 def with_value_from_user(value); end end -# source://activemodel//lib/active_model/attribute.rb#242 +# pkg:gem/activemodel#lib/active_model/attribute.rb:250 class ActiveModel::Attribute::Uninitialized < ::ActiveModel::Attribute - # @return [Uninitialized] a new instance of Uninitialized - # - # source://activemodel//lib/active_model/attribute.rb#245 + # pkg:gem/activemodel#lib/active_model/attribute.rb:253 def initialize(name, type); end - # source://activemodel//lib/active_model/attribute.rb#266 + # pkg:gem/activemodel#lib/active_model/attribute.rb:274 def forgetting_assignment; end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute.rb#262 + # pkg:gem/activemodel#lib/active_model/attribute.rb:270 def initialized?; end - # source://activemodel//lib/active_model/attribute.rb#255 + # pkg:gem/activemodel#lib/active_model/attribute.rb:263 def original_value; end - # source://activemodel//lib/active_model/attribute.rb#249 + # pkg:gem/activemodel#lib/active_model/attribute.rb:257 def value; end - # source://activemodel//lib/active_model/attribute.rb#259 + # pkg:gem/activemodel#lib/active_model/attribute.rb:267 def value_for_database; end - # source://activemodel//lib/active_model/attribute.rb#270 + # pkg:gem/activemodel#lib/active_model/attribute.rb:278 def with_type(type); end end -# source://activemodel//lib/active_model/attribute.rb#243 +# pkg:gem/activemodel#lib/active_model/attribute.rb:251 ActiveModel::Attribute::Uninitialized::UNINITIALIZED_ORIGINAL_VALUE = T.let(T.unsafe(nil), Object) -# source://activemodel//lib/active_model/attribute/user_provided_default.rb#11 +# pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:11 class ActiveModel::Attribute::UserProvidedDefault < ::ActiveModel::Attribute::FromUser - # @return [UserProvidedDefault] a new instance of UserProvidedDefault - # - # source://activemodel//lib/active_model/attribute/user_provided_default.rb#12 + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:12 def initialize(name, value, type, database_default); end - # source://activemodel//lib/active_model/attribute/user_provided_default.rb#29 + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:29 + def dup_or_share; end + + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:39 def marshal_dump; end - # source://activemodel//lib/active_model/attribute/user_provided_default.rb#40 + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:50 def marshal_load(values); end - # source://activemodel//lib/active_model/attribute/user_provided_default.rb#17 + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:17 def value_before_type_cast; end - # source://activemodel//lib/active_model/attribute/user_provided_default.rb#25 + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:25 def with_type(type); end private - # Returns the value of attribute user_provided_value. - # - # source://activemodel//lib/active_model/attribute/user_provided_default.rb#52 + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:62 def user_provided_value; end end -# source://activemodel//lib/active_model/attribute.rb#212 +# pkg:gem/activemodel#lib/active_model/attribute.rb:220 class ActiveModel::Attribute::WithCastValue < ::ActiveModel::Attribute - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute.rb#217 + # pkg:gem/activemodel#lib/active_model/attribute.rb:225 def changed_in_place?; end - # source://activemodel//lib/active_model/attribute.rb#213 + # pkg:gem/activemodel#lib/active_model/attribute.rb:221 def type_cast(value); end end -# source://activemodel//lib/active_model/attribute_assignment.rb#6 +# pkg:gem/activemodel#lib/active_model/attribute_assignment.rb:6 module ActiveModel::AttributeAssignment include ::ActiveModel::ForbiddenAttributesProtection @@ -464,7 +420,7 @@ module ActiveModel::AttributeAssignment # cat.name # => 'Gorby' # cat.status # => 'sleeping' # - # source://activemodel//lib/active_model/attribute_assignment.rb#28 + # pkg:gem/activemodel#lib/active_model/attribute_assignment.rb:28 def assign_attributes(new_attributes); end # Like `BasicObject#method_missing`, `#attribute_writer_missing` is invoked @@ -485,40 +441,18 @@ module ActiveModel::AttributeAssignment # rectangle = Rectangle.new # rectangle.assign_attributes(height: 10) # => Logs "Tried to assign to unknown attribute 'height'" # - # @raise [UnknownAttributeError] - # - # source://activemodel//lib/active_model/attribute_assignment.rb#56 + # pkg:gem/activemodel#lib/active_model/attribute_assignment.rb:56 def attribute_writer_missing(name, value); end - # Allows you to set all the attributes by passing in a hash of attributes with - # keys matching the attribute names. - # - # If the passed hash responds to permitted? method and the return value - # of this method is +false+ an ActiveModel::ForbiddenAttributesError - # exception is raised. - # - # class Cat - # include ActiveModel::AttributeAssignment - # attr_accessor :name, :status - # end - # - # cat = Cat.new - # cat.assign_attributes(name: "Gorby", status: "yawning") - # cat.name # => 'Gorby' - # cat.status # => 'yawning' - # cat.assign_attributes(status: "sleeping") - # cat.name # => 'Gorby' - # cat.status # => 'sleeping' - # - # source://activemodel//lib/active_model/attribute_assignment.rb#28 + # pkg:gem/activemodel#lib/active_model/attribute_assignment.rb:37 def attributes=(new_attributes); end private - # source://activemodel//lib/active_model/attribute_assignment.rb#67 + # pkg:gem/activemodel#lib/active_model/attribute_assignment.rb:67 def _assign_attribute(k, v); end - # source://activemodel//lib/active_model/attribute_assignment.rb#61 + # pkg:gem/activemodel#lib/active_model/attribute_assignment.rb:61 def _assign_attributes(attributes); end end @@ -569,7 +503,7 @@ end # end # end # -# source://activemodel//lib/active_model/attribute_methods.rb#64 +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:64 module ActiveModel::AttributeMethods extend ::ActiveSupport::Concern include GeneratedInstanceMethods @@ -582,7 +516,7 @@ module ActiveModel::AttributeMethods # attribute method. If so, we tell +attribute_missing+ to dispatch the # attribute. This method can be overloaded to customize the behavior. # - # source://activemodel//lib/active_model/attribute_methods.rb#520 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:520 def attribute_missing(match, *_arg1, **_arg2, &_arg3); end # Allows access to the object attributes, which are held in the hash @@ -596,38 +530,34 @@ module ActiveModel::AttributeMethods # class belonging to the +clients+ table with a +master_id+ foreign key # can instantiate master through Client#master. # - # source://activemodel//lib/active_model/attribute_methods.rb#507 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:507 def method_missing(method, *_arg1, **_arg2, &_arg3); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_methods.rb#528 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:528 def respond_to?(method, include_private_methods = T.unsafe(nil)); end # A +Person+ instance with a +name+ attribute can ask # person.respond_to?(:name), person.respond_to?(:name=), # and person.respond_to?(:name?) which will all return +true+. + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:527 def respond_to_without_attributes?(*_arg0); end private - # source://activemodel//lib/active_model/attribute_methods.rb#556 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:556 def _read_attribute(attr); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_methods.rb#541 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:541 def attribute_method?(attr_name); end # Returns a struct representing the matching attribute method. # The struct's attributes are prefix, base and suffix. # - # source://activemodel//lib/active_model/attribute_methods.rb#547 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:547 def matched_attribute_method(method_name); end - # @raise [ActiveModel::MissingAttributeError] - # - # source://activemodel//lib/active_model/attribute_methods.rb#552 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:552 def missing_attribute(attr_name, stack); end module GeneratedClassMethods @@ -647,7 +577,7 @@ module ActiveModel::AttributeMethods end end -# source://activemodel//lib/active_model/attribute_methods.rb#560 +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:560 module ActiveModel::AttributeMethods::AttrNames class << self # We want to generate the methods via module_eval rather than @@ -665,18 +595,18 @@ module ActiveModel::AttributeMethods::AttrNames # Making it frozen means that it doesn't get duped when used to # key the @attributes in read_attribute. # - # source://activemodel//lib/active_model/attribute_methods.rb#577 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:577 def define_attribute_accessor_method(owner, attr_name, writer: T.unsafe(nil)); end end end -# source://activemodel//lib/active_model/attribute_methods.rb#561 +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:561 ActiveModel::AttributeMethods::AttrNames::DEF_SAFE_NAME = T.let(T.unsafe(nil), Regexp) -# source://activemodel//lib/active_model/attribute_methods.rb#68 +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:68 ActiveModel::AttributeMethods::CALL_COMPILABLE_REGEXP = T.let(T.unsafe(nil), Regexp) -# source://activemodel//lib/active_model/attribute_methods.rb#75 +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:75 module ActiveModel::AttributeMethods::ClassMethods # Allows you to make aliases for attributes. # @@ -702,25 +632,23 @@ module ActiveModel::AttributeMethods::ClassMethods # person.name_short? # => true # person.nickname_short? # => true # - # source://activemodel//lib/active_model/attribute_methods.rb#203 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:203 def alias_attribute(new_name, old_name); end - # source://activemodel//lib/active_model/attribute_methods.rb#226 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:226 def alias_attribute_method_definition(code_generator, pattern, new_name, old_name); end - # source://activemodel//lib/active_model/attribute_methods.rb#382 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:382 def aliases_by_attribute_name; end # Returns the original name for the alias +name+ # - # source://activemodel//lib/active_model/attribute_methods.rb#245 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:245 def attribute_alias(name); end # Is +new_name+ an alias? # - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_methods.rb#240 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:240 def attribute_alias?(new_name); end # Declares a method available for all attributes with the given prefix @@ -754,7 +682,7 @@ module ActiveModel::AttributeMethods::ClassMethods # person.reset_name_to_default! # person.name # => 'Default Name' # - # source://activemodel//lib/active_model/attribute_methods.rb#175 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:175 def attribute_method_affix(*affixes); end # Declares a method available for all attributes with the given prefix. @@ -788,7 +716,7 @@ module ActiveModel::AttributeMethods::ClassMethods # person.clear_name # person.name # => nil # - # source://activemodel//lib/active_model/attribute_methods.rb#106 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:106 def attribute_method_prefix(*prefixes, parameters: T.unsafe(nil)); end # Declares a method available for all attributes with the given suffix. @@ -821,7 +749,7 @@ module ActiveModel::AttributeMethods::ClassMethods # person.name # => "Bob" # person.name_short? # => true # - # source://activemodel//lib/active_model/attribute_methods.rb#140 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:140 def attribute_method_suffix(*suffixes, parameters: T.unsafe(nil)); end # Declares an attribute that should be prefixed and suffixed by @@ -853,10 +781,10 @@ module ActiveModel::AttributeMethods::ClassMethods # person.name # => "Bob" # person.name_short? # => true # - # source://activemodel//lib/active_model/attribute_methods.rb#311 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:311 def define_attribute_method(attr_name, _owner: T.unsafe(nil), as: T.unsafe(nil)); end - # source://activemodel//lib/active_model/attribute_methods.rb#320 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:320 def define_attribute_method_pattern(pattern, attr_name, owner:, as:, override: T.unsafe(nil)); end # Declares the attributes that should be prefixed and suffixed by @@ -883,13 +811,13 @@ module ActiveModel::AttributeMethods::ClassMethods # end # end # - # source://activemodel//lib/active_model/attribute_methods.rb#272 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:272 def define_attribute_methods(*attr_names); end - # source://activemodel//lib/active_model/attribute_methods.rb#211 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:211 def eagerly_generate_alias_attribute_methods(new_name, old_name); end - # source://activemodel//lib/active_model/attribute_methods.rb#217 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:217 def generate_alias_attribute_methods(code_generator, new_name, old_name); end # Removes all the previously dynamically defined methods from the class, including alias attribute methods. @@ -918,7 +846,7 @@ module ActiveModel::AttributeMethods::ClassMethods # person.name_short? # => NoMethodError # person.first_name # => NoMethodError # - # source://activemodel//lib/active_model/attribute_methods.rb#375 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:375 def undefine_attribute_methods; end private @@ -933,487 +861,439 @@ module ActiveModel::AttributeMethods::ClassMethods # significantly (in our case our test suite finishes 10% faster with # this cache). # - # source://activemodel//lib/active_model/attribute_methods.rb#417 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:417 def attribute_method_patterns_cache; end - # source://activemodel//lib/active_model/attribute_methods.rb#421 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:421 def attribute_method_patterns_matching(method_name); end - # source://activemodel//lib/active_model/attribute_methods.rb#445 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:445 def build_mangled_name(name); end - # source://activemodel//lib/active_model/attribute_methods.rb#455 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:455 def define_call(code_generator, name, target_name, mangled_name, parameters, call_args, namespace:, as:); end # Define a method `name` in `mod` that dispatches to `send` # using the given `extra` args. This falls back on `send` # if the called name cannot be compiled. # - # source://activemodel//lib/active_model/attribute_methods.rb#430 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:430 def define_proxy_call(code_generator, name, proxy_target, parameters, *call_args, namespace:, as: T.unsafe(nil)); end - # source://activemodel//lib/active_model/attribute_methods.rb#400 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:400 def generated_attribute_methods; end - # source://activemodel//lib/active_model/attribute_methods.rb#387 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:387 def inherited(base); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_methods.rb#404 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:404 def instance_method_already_implemented?(method_name); end - # source://activemodel//lib/active_model/attribute_methods.rb#396 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:396 def resolve_attribute_name(name); end end -# source://activemodel//lib/active_model/attribute_methods.rb#471 +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:471 class ActiveModel::AttributeMethods::ClassMethods::AttributeMethodPattern - # @return [AttributeMethodPattern] a new instance of AttributeMethodPattern - # - # source://activemodel//lib/active_model/attribute_methods.rb#476 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:476 def initialize(prefix: T.unsafe(nil), suffix: T.unsafe(nil), parameters: T.unsafe(nil)); end - # source://activemodel//lib/active_model/attribute_methods.rb#485 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:485 def match(method_name); end - # source://activemodel//lib/active_model/attribute_methods.rb#491 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:491 def method_name(attr_name); end - # Returns the value of attribute parameters. - # - # source://activemodel//lib/active_model/attribute_methods.rb#472 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:472 def parameters; end - # Returns the value of attribute prefix. - # - # source://activemodel//lib/active_model/attribute_methods.rb#472 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:472 def prefix; end - # Returns the value of attribute proxy_target. - # - # source://activemodel//lib/active_model/attribute_methods.rb#472 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:472 def proxy_target; end - # Returns the value of attribute suffix. - # - # source://activemodel//lib/active_model/attribute_methods.rb#472 + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:472 def suffix; end end -# source://activemodel//lib/active_model/attribute_methods.rb#474 +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:474 class ActiveModel::AttributeMethods::ClassMethods::AttributeMethodPattern::AttributeMethod < ::Struct - # Returns the value of attribute attr_name - # - # @return [Object] the current value of attr_name + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:474 def attr_name; end - # Sets the attribute attr_name - # - # @param value [Object] the value to set the attribute attr_name to. - # @return [Object] the newly set value + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:474 def attr_name=(_); end - # Returns the value of attribute proxy_target - # - # @return [Object] the current value of proxy_target + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:474 def proxy_target; end - # Sets the attribute proxy_target - # - # @param value [Object] the value to set the attribute proxy_target to. - # @return [Object] the newly set value + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:474 def proxy_target=(_); end class << self + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:474 def [](*_arg0); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:474 def inspect; end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:474 def keyword_init?; end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:474 def members; end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:474 def new(*_arg0); end end end -# source://activemodel//lib/active_model/attribute_methods.rb#67 +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:67 ActiveModel::AttributeMethods::NAME_COMPILABLE_REGEXP = T.let(T.unsafe(nil), Regexp) -# source://activemodel//lib/active_model/attribute_mutation_tracker.rb#7 +# pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:7 class ActiveModel::AttributeMutationTracker - # @return [AttributeMutationTracker] a new instance of AttributeMutationTracker - # - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#10 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:10 def initialize(attributes); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#40 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:40 def any_changes?; end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#34 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:34 def change_to_attribute(attr_name); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#44 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:44 def changed?(attr_name, from: T.unsafe(nil), to: T.unsafe(nil)); end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#14 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:14 def changed_attribute_names; end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#50 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:50 def changed_in_place?(attr_name); end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#18 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:18 def changed_values; end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#26 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:26 def changes; end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#63 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:63 def force_change(attr_name); end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#54 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:54 def forget_change(attr_name); end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#59 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:59 def original_value(attr_name); end private - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#74 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:74 def attr_names; end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#78 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:78 def attribute_changed?(attr_name); end - # Returns the value of attribute attributes. - # - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#68 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:68 def attributes; end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#82 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:82 def fetch_value(attr_name); end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#70 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:70 def forced_changes; end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#86 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:86 def type_cast(attr_name, value); end end -# source://activemodel//lib/active_model/attribute_mutation_tracker.rb#8 +# pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:8 ActiveModel::AttributeMutationTracker::OPTION_NOT_GIVEN = T.let(T.unsafe(nil), Object) -# source://activemodel//lib/active_model/attribute_registration.rb#8 +# pkg:gem/activemodel#lib/active_model/attribute_registration.rb:8 module ActiveModel::AttributeRegistration extend ::ActiveSupport::Concern mixes_in_class_methods ::ActiveModel::AttributeRegistration::ClassMethods end -# source://activemodel//lib/active_model/attribute_registration.rb#11 +# pkg:gem/activemodel#lib/active_model/attribute_registration.rb:11 module ActiveModel::AttributeRegistration::ClassMethods - # source://activemodel//lib/active_model/attribute_registration.rb#31 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:31 def _default_attributes; end - # source://activemodel//lib/active_model/attribute_registration.rb#12 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:12 def attribute(name, type = T.unsafe(nil), default: T.unsafe(nil), **options); end - # source://activemodel//lib/active_model/attribute_registration.rb#37 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:37 def attribute_types; end - # source://activemodel//lib/active_model/attribute_registration.rb#23 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:23 def decorate_attributes(names = T.unsafe(nil), &decorator); end - # source://activemodel//lib/active_model/attribute_registration.rb#43 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:43 def type_for_attribute(attribute_name, &block); end private - # source://activemodel//lib/active_model/attribute_registration.rb#81 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:81 def apply_pending_attribute_modifications(attribute_set); end # Hook for other modules to override. The attribute type is passed # through this method immediately after it is resolved, before any type # decorations are applied. # - # source://activemodel//lib/active_model/attribute_registration.rb#112 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:112 def hook_attribute_type(attribute, type); end - # source://activemodel//lib/active_model/attribute_registration.rb#77 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:77 def pending_attribute_modifications; end - # source://activemodel//lib/active_model/attribute_registration.rb#91 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:91 def reset_default_attributes; end - # source://activemodel//lib/active_model/attribute_registration.rb#96 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:96 def reset_default_attributes!; end - # source://activemodel//lib/active_model/attribute_registration.rb#101 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:101 def resolve_attribute_name(name); end - # source://activemodel//lib/active_model/attribute_registration.rb#105 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:105 def resolve_type_name(name, **options); end end -# source://activemodel//lib/active_model/attribute_registration.rb#67 +# pkg:gem/activemodel#lib/active_model/attribute_registration.rb:67 class ActiveModel::AttributeRegistration::ClassMethods::PendingDecorator < ::Struct - # source://activemodel//lib/active_model/attribute_registration.rb#68 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:68 def apply_to(attribute_set); end - # Returns the value of attribute decorator - # - # @return [Object] the current value of decorator + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:67 def decorator; end - # Sets the attribute decorator - # - # @param value [Object] the value to set the attribute decorator to. - # @return [Object] the newly set value + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:67 def decorator=(_); end - # Returns the value of attribute names - # - # @return [Object] the current value of names + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:67 def names; end - # Sets the attribute names - # - # @param value [Object] the value to set the attribute names to. - # @return [Object] the newly set value + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:67 def names=(_); end class << self + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:67 def [](*_arg0); end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:67 def inspect; end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:67 def keyword_init?; end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:67 def members; end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:67 def new(*_arg0); end end end -# source://activemodel//lib/active_model/attribute_registration.rb#61 +# pkg:gem/activemodel#lib/active_model/attribute_registration.rb:61 class ActiveModel::AttributeRegistration::ClassMethods::PendingDefault < ::Struct - # source://activemodel//lib/active_model/attribute_registration.rb#62 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:62 def apply_to(attribute_set); end - # Returns the value of attribute default - # - # @return [Object] the current value of default + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:61 def default; end - # Sets the attribute default - # - # @param value [Object] the value to set the attribute default to. - # @return [Object] the newly set value + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:61 def default=(_); end - # Returns the value of attribute name - # - # @return [Object] the current value of name + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:61 def name; end - # Sets the attribute name - # - # @param value [Object] the value to set the attribute name to. - # @return [Object] the newly set value + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:61 def name=(_); end class << self + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:61 def [](*_arg0); end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:61 def inspect; end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:61 def keyword_init?; end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:61 def members; end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:61 def new(*_arg0); end end end -# source://activemodel//lib/active_model/attribute_registration.rb#54 +# pkg:gem/activemodel#lib/active_model/attribute_registration.rb:54 class ActiveModel::AttributeRegistration::ClassMethods::PendingType < ::Struct - # source://activemodel//lib/active_model/attribute_registration.rb#55 + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:55 def apply_to(attribute_set); end - # Returns the value of attribute name - # - # @return [Object] the current value of name + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:54 def name; end - # Sets the attribute name - # - # @param value [Object] the value to set the attribute name to. - # @return [Object] the newly set value + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:54 def name=(_); end - # Returns the value of attribute type - # - # @return [Object] the current value of type + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:54 def type; end - # Sets the attribute type - # - # @param value [Object] the value to set the attribute type to. - # @return [Object] the newly set value + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:54 def type=(_); end class << self + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:54 def [](*_arg0); end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:54 def inspect; end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:54 def keyword_init?; end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:54 def members; end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:54 def new(*_arg0); end end end -# source://activemodel//lib/active_model/attribute_set/builder.rb#6 +# pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:6 class ActiveModel::AttributeSet - # @return [AttributeSet] a new instance of AttributeSet - # - # source://activemodel//lib/active_model/attribute_set.rb#12 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:12 def initialize(attributes); end - # source://activemodel//lib/active_model/attribute_set.rb#106 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:106 def ==(other); end - # source://activemodel//lib/active_model/attribute_set.rb#16 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:16 def [](name); end - # source://activemodel//lib/active_model/attribute_set.rb#20 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:20 def []=(name, value); end - # source://activemodel//lib/active_model/attribute_set.rb#93 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:93 def accessed; end - # source://activemodel//lib/active_model/attribute_set.rb#24 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:24 def cast_types; end - # source://activemodel//lib/active_model/attribute_set.rb#73 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:73 def deep_dup; end - # source://activemodel//lib/active_model/attribute_set.rb#10 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:10 def each_value(*_arg0, **_arg1, &_arg2); end - # source://activemodel//lib/active_model/attribute_set.rb#10 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:10 def except(*_arg0, **_arg1, &_arg2); end - # source://activemodel//lib/active_model/attribute_set.rb#10 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:10 def fetch(*_arg0, **_arg1, &_arg2); end - # source://activemodel//lib/active_model/attribute_set.rb#50 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:50 def fetch_value(name, &block); end - # source://activemodel//lib/active_model/attribute_set.rb#68 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:68 def freeze; end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_set.rb#41 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:44 def include?(name); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_set.rb#41 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:41 def key?(name); end - # source://activemodel//lib/active_model/attribute_set.rb#46 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:46 def keys; end - # source://activemodel//lib/active_model/attribute_set.rb#97 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:97 def map(&block); end - # source://activemodel//lib/active_model/attribute_set.rb#87 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:87 def reset(key); end - # source://activemodel//lib/active_model/attribute_set.rb#102 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:102 def reverse_merge!(target_attributes); end - # source://activemodel//lib/active_model/attribute_set.rb#36 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:39 def to_h; end - # source://activemodel//lib/active_model/attribute_set.rb#36 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:36 def to_hash; end - # source://activemodel//lib/active_model/attribute_set.rb#28 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:28 def values_before_type_cast; end - # source://activemodel//lib/active_model/attribute_set.rb#32 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:32 def values_for_database; end - # source://activemodel//lib/active_model/attribute_set.rb#64 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:64 def write_cast_value(name, value); end - # source://activemodel//lib/active_model/attribute_set.rb#54 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:54 def write_from_database(name, value); end - # @raise [FrozenError] - # - # source://activemodel//lib/active_model/attribute_set.rb#58 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:58 def write_from_user(name, value); end protected - # Returns the value of attribute attributes. - # - # source://activemodel//lib/active_model/attribute_set.rb#111 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:111 def attributes; end private - # source://activemodel//lib/active_model/attribute_set.rb#114 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:114 def default_attribute(name); end - # source://activemodel//lib/active_model/attribute_set.rb#82 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:82 def initialize_clone(_); end - # source://activemodel//lib/active_model/attribute_set.rb#77 + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:77 def initialize_dup(_); end end -# source://activemodel//lib/active_model/attribute_set/builder.rb#7 +# pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:7 class ActiveModel::AttributeSet::Builder - # @return [Builder] a new instance of Builder - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#10 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:10 def initialize(types, default_attributes = T.unsafe(nil)); end - # source://activemodel//lib/active_model/attribute_set/builder.rb#15 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:15 def build_from_database(values = T.unsafe(nil), additional_types = T.unsafe(nil)); end - # Returns the value of attribute default_attributes. - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#8 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:8 def default_attributes; end - # Returns the value of attribute types. - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#8 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:8 def types; end end # Attempts to do more intelligent YAML dumping of an # ActiveModel::AttributeSet to reduce the size of the resulting string # -# source://activemodel//lib/active_model/attribute_set/yaml_encoder.rb#7 +# pkg:gem/activemodel#lib/active_model/attribute_set/yaml_encoder.rb:7 class ActiveModel::AttributeSet::YAMLEncoder - # @return [YAMLEncoder] a new instance of YAMLEncoder - # - # source://activemodel//lib/active_model/attribute_set/yaml_encoder.rb#8 + # pkg:gem/activemodel#lib/active_model/attribute_set/yaml_encoder.rb:8 def initialize(default_types); end - # source://activemodel//lib/active_model/attribute_set/yaml_encoder.rb#22 + # pkg:gem/activemodel#lib/active_model/attribute_set/yaml_encoder.rb:22 def decode(coder); end - # source://activemodel//lib/active_model/attribute_set/yaml_encoder.rb#12 + # pkg:gem/activemodel#lib/active_model/attribute_set/yaml_encoder.rb:12 def encode(attribute_set, coder); end private - # Returns the value of attribute default_types. - # - # source://activemodel//lib/active_model/attribute_set/yaml_encoder.rb#37 + # pkg:gem/activemodel#lib/active_model/attribute_set/yaml_encoder.rb:37 def default_types; end end @@ -1444,9 +1324,10 @@ end # person.name # => "Volmer" # person.active # => true # -# source://activemodel//lib/active_model/attributes.rb#30 +# pkg:gem/activemodel#lib/active_model/attributes.rb:30 module ActiveModel::Attributes extend ::ActiveSupport::Concern + extend ::ActiveSupport::Autoload include GeneratedInstanceMethods include ::ActiveModel::AttributeRegistration include ::ActiveModel::AttributeMethods @@ -1456,7 +1337,7 @@ module ActiveModel::Attributes mixes_in_class_methods ::ActiveModel::AttributeMethods::ClassMethods mixes_in_class_methods ::ActiveModel::Attributes::ClassMethods - # source://activemodel//lib/active_model/attributes.rb#106 + # pkg:gem/activemodel#lib/active_model/attributes.rb:106 def initialize(*_arg0); end # Returns an array of attribute names as strings. @@ -1471,7 +1352,7 @@ module ActiveModel::Attributes # person = Person.new # person.attribute_names # => ["name", "age"] # - # source://activemodel//lib/active_model/attributes.rb#146 + # pkg:gem/activemodel#lib/active_model/attributes.rb:146 def attribute_names; end # Returns a hash of all the attributes with their names as keys and the @@ -1490,24 +1371,24 @@ module ActiveModel::Attributes # # person.attributes # => { "name" => "Francesco", "age" => 22} # - # source://activemodel//lib/active_model/attributes.rb#131 + # pkg:gem/activemodel#lib/active_model/attributes.rb:131 def attributes; end - # source://activemodel//lib/active_model/attributes.rb#150 + # pkg:gem/activemodel#lib/active_model/attributes.rb:150 def freeze; end private - # source://activemodel//lib/active_model/attributes.rb#156 + # pkg:gem/activemodel#lib/active_model/attributes.rb:156 def _write_attribute(attr_name, value); end - # source://activemodel//lib/active_model/attributes.rb#161 + # pkg:gem/activemodel#lib/active_model/attributes.rb:161 def attribute(attr_name); end - # source://activemodel//lib/active_model/attributes.rb#156 + # pkg:gem/activemodel#lib/active_model/attributes.rb:159 def attribute=(attr_name, value); end - # source://activemodel//lib/active_model/attributes.rb#111 + # pkg:gem/activemodel#lib/active_model/attributes.rb:111 def initialize_dup(other); end module GeneratedClassMethods @@ -1527,7 +1408,7 @@ module ActiveModel::Attributes end end -# source://activemodel//lib/active_model/attributes.rb#39 +# pkg:gem/activemodel#lib/active_model/attributes.rb:39 module ActiveModel::Attributes::ClassMethods # :call-seq: attribute(name, cast_type = nil, default: nil, **options) # @@ -1548,7 +1429,7 @@ module ActiveModel::Attributes::ClassMethods # person.name # => "Volmer" # person.active # => true # - # source://activemodel//lib/active_model/attributes.rb#59 + # pkg:gem/activemodel#lib/active_model/attributes.rb:59 def attribute(name, *_arg1, **_arg2, &_arg3); end # Returns an array of attribute names as strings. @@ -1562,28 +1443,241 @@ module ActiveModel::Attributes::ClassMethods # # Person.attribute_names # => ["name", "age"] # - # source://activemodel//lib/active_model/attributes.rb#74 + # pkg:gem/activemodel#lib/active_model/attributes.rb:74 def attribute_names; end private - # source://activemodel//lib/active_model/attributes.rb#92 + # pkg:gem/activemodel#lib/active_model/attributes.rb:92 def define_method_attribute=(canonical_name, owner:, as: T.unsafe(nil)); end end +# pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:5 +module ActiveModel::Attributes::Normalization + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveModel::AttributeMethods + include ::ActiveModel::Dirty + include ::ActiveSupport::Callbacks + include ::ActiveModel::Validations::Callbacks + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::Attributes::Normalization::ClassMethods + mixes_in_class_methods ::ActiveModel::AttributeMethods::ClassMethods + mixes_in_class_methods ::ActiveModel::Validations::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + + # Normalizes a specified attribute using its declared normalizations. + # + # ==== Examples + # + # class User + # include ActiveModel::Attributes + # include ActiveModel::Attributes::Normalization + # + # attribute :email, :string + # + # normalizes :email, with: -> email { email.strip.downcase } + # end + # + # legacy_user = User.load_from_legacy_data(...) + # legacy_user.email # => " CRUISE-CONTROL@EXAMPLE.COM\n" + # legacy_user.normalize_attribute(:email) + # legacy_user.email # => "cruise-control@example.com" + # + # ==== Behavior with Active Record + # + # To prevent confusion, normalization will not be applied + # when the attribute is fetched from the database. This means that if a + # record was persisted before the normalization was declared, the record's + # attribute will not be normalized until either it is assigned a new + # value, or it is explicitly migrated via Normalization#normalize_attribute. + # + # Be aware that if your app was created before Rails 7.1, and your app + # marshals instances of the targeted model (for example, when caching), + # then you should set ActiveRecord.marshalling_format_version to +7.1+ or + # higher via either config.load_defaults 7.1 or + # config.active_record.marshalling_format_version = 7.1. + # Otherwise, +Marshal+ may attempt to serialize the normalization +Proc+ + # and raise +TypeError+. + # + # class User < ActiveRecord::Base + # normalizes :email, with: -> email { email.strip.downcase } + # normalizes :phone, with: -> phone { phone.delete("^0-9").delete_prefix("1") } + # end + # + # user = User.create(email: " CRUISE-CONTROL@EXAMPLE.COM\n") + # user.email # => "cruise-control@example.com" + # + # user = User.find_by(email: "\tCRUISE-CONTROL@EXAMPLE.COM ") + # user.email # => "cruise-control@example.com" + # user.email_before_type_cast # => "cruise-control@example.com" + # + # User.where(email: "\tCRUISE-CONTROL@EXAMPLE.COM ").count # => 1 + # User.where(["email = ?", "\tCRUISE-CONTROL@EXAMPLE.COM "]).count # => 0 + # + # User.exists?(email: "\tCRUISE-CONTROL@EXAMPLE.COM ") # => true + # User.exists?(["email = ?", "\tCRUISE-CONTROL@EXAMPLE.COM "]) # => false + # + # User.normalize_value_for(:phone, "+1 (555) 867-5309") # => "5558675309" + # + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:70 + def normalize_attribute(name); end + + private + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:140 + def normalize_changed_in_place_attributes; end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + def normalized_attributes; end + def normalized_attributes=(value); end + def normalized_attributes?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + def normalized_attributes; end + def normalized_attributes=(value); end + def normalized_attributes?; end + end +end + +# pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:75 +module ActiveModel::Attributes::Normalization::ClassMethods + # Normalizes a given +value+ using normalizations declared for +name+. + # + # ==== Examples + # + # class User + # include ActiveModel::Attributes + # include ActiveModel::Attributes::Normalization + # + # attribute :email, :string + # + # normalizes :email, with: -> email { email.strip.downcase } + # end + # + # User.normalize_value_for(:email, " CRUISE-CONTROL@EXAMPLE.COM\n") + # # => "cruise-control@example.com" + # + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:134 + def normalize_value_for(name, value); end + + # Declares a normalization for one or more attributes. The normalization + # is applied when the attribute is assigned or validated. + # + # Because the normalization may be applied multiple times, it should be + # _idempotent_. In other words, applying the normalization more than once + # should have the same result as applying it only once. + # + # By default, the normalization will not be applied to +nil+ values. This + # behavior can be changed with the +:apply_to_nil+ option. + # + # ==== Options + # + # * +:with+ - Any callable object that accepts the attribute's value as + # its sole argument, and returns it normalized. + # * +:apply_to_nil+ - Whether to apply the normalization to +nil+ values. + # Defaults to +false+. + # + # ==== Examples + # + # class User + # include ActiveModel::Attributes + # include ActiveModel::Attributes::Normalization + # + # attribute :email, :string + # attribute :phone, :string + # + # normalizes :email, with: -> email { email.strip.downcase } + # normalizes :phone, with: -> phone { phone.delete("^0-9").delete_prefix("1") } + # end + # + # user = User.new + # user.email = " CRUISE-CONTROL@EXAMPLE.COM\n" + # user.email # => "cruise-control@example.com" + # + # User.normalize_value_for(:phone, "+1 (555) 867-5309") # => "5558675309" + # + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:111 + def normalizes(*names, with:, apply_to_nil: T.unsafe(nil)); end +end + +# pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:146 +class ActiveModel::Attributes::Normalization::NormalizedValueType + include ::ActiveModel::Type::SerializeCastValue + extend ::ActiveModel::Type::SerializeCastValue::ClassMethods + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:152 + def initialize(cast_type:, normalizer:, normalize_nil:); end + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:171 + def ==(other); end + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:159 + def cast(value); end + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:149 + def cast_type; end + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:177 + def eql?(other); end + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:179 + def hash; end + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:183 + def inspect; end + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:149 + def normalize_nil; end + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:150 + def normalize_nil?; end + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:149 + def normalizer; end + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:163 + def serialize(value); end + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:167 + def serialize_cast_value(value); end + + private + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:189 + def instance_variables_to_inspect; end + + # pkg:gem/activemodel#lib/active_model/attributes/normalization.rb:191 + def normalize(value); end +end + # +BlockValidator+ is a special +EachValidator+ which receives a block on initialization # and call this block for each attribute being validated. +validates_each+ uses this validator. # -# source://activemodel//lib/active_model/validator.rb#179 +# pkg:gem/activemodel#lib/active_model/validator.rb:179 class ActiveModel::BlockValidator < ::ActiveModel::EachValidator - # @return [BlockValidator] a new instance of BlockValidator - # - # source://activemodel//lib/active_model/validator.rb#180 + # pkg:gem/activemodel#lib/active_model/validator.rb:180 def initialize(options, &block); end private - # source://activemodel//lib/active_model/validator.rb#186 + # pkg:gem/activemodel#lib/active_model/validator.rb:186 def validate_each(record, attribute, value); end end @@ -1645,7 +1739,7 @@ end # # NOTE: Defining the same callback multiple times will overwrite previous callback definitions. # -# source://activemodel//lib/active_model/callbacks.rb#65 +# pkg:gem/activemodel#lib/active_model/callbacks.rb:65 module ActiveModel::Callbacks # +define_model_callbacks+ accepts the same options +define_callbacks+ does, # in case you want to overwrite a default. Besides that, it also accepts an @@ -1685,22 +1779,22 @@ module ActiveModel::Callbacks # NOTE: +method_name+ passed to +define_model_callbacks+ must not end with # !, ? or =. # - # source://activemodel//lib/active_model/callbacks.rb#109 + # pkg:gem/activemodel#lib/active_model/callbacks.rb:109 def define_model_callbacks(*callbacks); end private - # source://activemodel//lib/active_model/callbacks.rb#143 + # pkg:gem/activemodel#lib/active_model/callbacks.rb:143 def _define_after_model_callback(klass, callback); end - # source://activemodel//lib/active_model/callbacks.rb#136 + # pkg:gem/activemodel#lib/active_model/callbacks.rb:136 def _define_around_model_callback(klass, callback); end - # source://activemodel//lib/active_model/callbacks.rb#129 + # pkg:gem/activemodel#lib/active_model/callbacks.rb:129 def _define_before_model_callback(klass, callback); end class << self - # source://activemodel//lib/active_model/callbacks.rb#66 + # pkg:gem/activemodel#lib/active_model/callbacks.rb:66 def extended(base); end end end @@ -1726,7 +1820,7 @@ end # cm.to_param # => nil # cm.to_partial_path # => "contact_messages/contact_message" # -# source://activemodel//lib/active_model/conversion.rb#24 +# pkg:gem/activemodel#lib/active_model/conversion.rb:24 module ActiveModel::Conversion extend ::ActiveSupport::Concern include GeneratedInstanceMethods @@ -1749,7 +1843,7 @@ module ActiveModel::Conversion # person = Person.new(1) # person.to_key # => [1] # - # source://activemodel//lib/active_model/conversion.rb#67 + # pkg:gem/activemodel#lib/active_model/conversion.rb:67 def to_key; end # If your object is already designed to implement all of the \Active \Model @@ -1767,7 +1861,7 @@ module ActiveModel::Conversion # define :to_model yourself returning a proxy object that wraps # your object with \Active \Model compliant methods. # - # source://activemodel//lib/active_model/conversion.rb#49 + # pkg:gem/activemodel#lib/active_model/conversion.rb:49 def to_model; end # Returns a +string+ representing the object's key suitable for use in URLs, @@ -1789,7 +1883,7 @@ module ActiveModel::Conversion # person = Person.new(1) # person.to_param # => "1" # - # source://activemodel//lib/active_model/conversion.rb#90 + # pkg:gem/activemodel#lib/active_model/conversion.rb:90 def to_param; end # Returns a +string+ identifying the path associated with the object. @@ -1802,7 +1896,7 @@ module ActiveModel::Conversion # person = Person.new # person.to_partial_path # => "people/person" # - # source://activemodel//lib/active_model/conversion.rb#103 + # pkg:gem/activemodel#lib/active_model/conversion.rb:103 def to_partial_path; end module GeneratedClassMethods @@ -1816,12 +1910,12 @@ module ActiveModel::Conversion end end -# source://activemodel//lib/active_model/conversion.rb#107 +# pkg:gem/activemodel#lib/active_model/conversion.rb:107 module ActiveModel::Conversion::ClassMethods # Provide a class level cache for #to_partial_path. This is an # internal method and should not be accessed directly. # - # source://activemodel//lib/active_model/conversion.rb#110 + # pkg:gem/activemodel#lib/active_model/conversion.rb:110 def _to_partial_path; end end @@ -1943,7 +2037,7 @@ end # Methods can be invoked as +name_changed?+ or by passing an argument to the # generic method attribute_changed?("name"). # -# source://activemodel//lib/active_model/dirty.rb#123 +# pkg:gem/activemodel#lib/active_model/dirty.rb:123 module ActiveModel::Dirty extend ::ActiveSupport::Concern include GeneratedInstanceMethods @@ -1952,36 +2046,30 @@ module ActiveModel::Dirty mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActiveModel::AttributeMethods::ClassMethods - # source://activemodel//lib/active_model/dirty.rb#264 + # pkg:gem/activemodel#lib/active_model/dirty.rb:264 def as_json(options = T.unsafe(nil)); end # Dispatch target for {*_changed?}[rdoc-ref:#*_changed?] attribute methods. # - # @return [Boolean] - # - # source://activemodel//lib/active_model/dirty.rb#300 + # pkg:gem/activemodel#lib/active_model/dirty.rb:300 def attribute_changed?(attr_name, **options); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/dirty.rb#367 + # pkg:gem/activemodel#lib/active_model/dirty.rb:367 def attribute_changed_in_place?(attr_name); end # Dispatch target for {*_previously_changed?}[rdoc-ref:#*_previously_changed?] attribute methods. # - # @return [Boolean] - # - # source://activemodel//lib/active_model/dirty.rb#310 + # pkg:gem/activemodel#lib/active_model/dirty.rb:310 def attribute_previously_changed?(attr_name, **options); end # Dispatch target for {*_previously_was}[rdoc-ref:#*_previously_was] attribute methods. # - # source://activemodel//lib/active_model/dirty.rb#315 + # pkg:gem/activemodel#lib/active_model/dirty.rb:315 def attribute_previously_was(attr_name); end # Dispatch target for {*_was}[rdoc-ref:#*_was] attribute methods. # - # source://activemodel//lib/active_model/dirty.rb#305 + # pkg:gem/activemodel#lib/active_model/dirty.rb:305 def attribute_was(attr_name); end # Returns an array with the name of the attributes with unsaved changes. @@ -1990,7 +2078,7 @@ module ActiveModel::Dirty # person.name = 'bob' # person.changed # => ["name"] # - # source://activemodel//lib/active_model/dirty.rb#295 + # pkg:gem/activemodel#lib/active_model/dirty.rb:295 def changed; end # Returns +true+ if any of the attributes has unsaved changes, +false+ otherwise. @@ -1999,9 +2087,7 @@ module ActiveModel::Dirty # person.name = 'bob' # person.changed? # => true # - # @return [Boolean] - # - # source://activemodel//lib/active_model/dirty.rb#286 + # pkg:gem/activemodel#lib/active_model/dirty.rb:286 def changed?; end # Returns a hash of the attributes with unsaved changes indicating their original @@ -2011,7 +2097,7 @@ module ActiveModel::Dirty # person.name = 'robert' # person.changed_attributes # => {"name" => "bob"} # - # source://activemodel//lib/active_model/dirty.rb#343 + # pkg:gem/activemodel#lib/active_model/dirty.rb:343 def changed_attributes; end # Returns a hash of changed attributes indicating their original @@ -2021,24 +2107,24 @@ module ActiveModel::Dirty # person.name = 'bob' # person.changes # => { "name" => ["bill", "bob"] } # - # source://activemodel//lib/active_model/dirty.rb#353 + # pkg:gem/activemodel#lib/active_model/dirty.rb:353 def changes; end # Clears dirty data and moves +changes+ to +previous_changes+ and # +mutations_from_database+ to +mutations_before_last_save+ respectively. # - # source://activemodel//lib/active_model/dirty.rb#272 + # pkg:gem/activemodel#lib/active_model/dirty.rb:272 def changes_applied; end - # source://activemodel//lib/active_model/dirty.rb#331 + # pkg:gem/activemodel#lib/active_model/dirty.rb:331 def clear_attribute_changes(attr_names); end # Clears all dirty data: current changes and previous changes. # - # source://activemodel//lib/active_model/dirty.rb#325 + # pkg:gem/activemodel#lib/active_model/dirty.rb:325 def clear_changes_information; end - # source://activemodel//lib/active_model/dirty.rb#253 + # pkg:gem/activemodel#lib/active_model/dirty.rb:253 def init_attributes(other); end # Returns a hash of attributes that were changed before the model was saved. @@ -2048,52 +2134,52 @@ module ActiveModel::Dirty # person.save # person.previous_changes # => {"name" => ["bob", "robert"]} # - # source://activemodel//lib/active_model/dirty.rb#363 + # pkg:gem/activemodel#lib/active_model/dirty.rb:363 def previous_changes; end # Restore all previous data of the provided attributes. # - # source://activemodel//lib/active_model/dirty.rb#320 + # pkg:gem/activemodel#lib/active_model/dirty.rb:320 def restore_attributes(attr_names = T.unsafe(nil)); end private # Dispatch target for *_change attribute methods. # - # source://activemodel//lib/active_model/dirty.rb#399 + # pkg:gem/activemodel#lib/active_model/dirty.rb:399 def attribute_change(attr_name); end # Dispatch target for *_previous_change attribute methods. # - # source://activemodel//lib/active_model/dirty.rb#404 + # pkg:gem/activemodel#lib/active_model/dirty.rb:404 def attribute_previous_change(attr_name); end # Dispatch target for *_will_change! attribute methods. # - # source://activemodel//lib/active_model/dirty.rb#409 + # pkg:gem/activemodel#lib/active_model/dirty.rb:409 def attribute_will_change!(attr_name); end - # source://activemodel//lib/active_model/dirty.rb#378 + # pkg:gem/activemodel#lib/active_model/dirty.rb:378 def clear_attribute_change(attr_name); end - # source://activemodel//lib/active_model/dirty.rb#390 + # pkg:gem/activemodel#lib/active_model/dirty.rb:390 def forget_attribute_assignments; end - # source://activemodel//lib/active_model/dirty.rb#372 + # pkg:gem/activemodel#lib/active_model/dirty.rb:372 def init_internals; end - # source://activemodel//lib/active_model/dirty.rb#248 + # pkg:gem/activemodel#lib/active_model/dirty.rb:248 def initialize_dup(other); end - # source://activemodel//lib/active_model/dirty.rb#394 + # pkg:gem/activemodel#lib/active_model/dirty.rb:394 def mutations_before_last_save; end - # source://activemodel//lib/active_model/dirty.rb#382 + # pkg:gem/activemodel#lib/active_model/dirty.rb:382 def mutations_from_database; end # Dispatch target for restore_*! attribute methods. # - # source://activemodel//lib/active_model/dirty.rb#414 + # pkg:gem/activemodel#lib/active_model/dirty.rb:414 def restore_attribute!(attr_name); end module GeneratedClassMethods @@ -2121,48 +2207,41 @@ end # # All \Active \Model validations are built on top of this validator. # -# source://activemodel//lib/active_model/validator.rb#134 +# pkg:gem/activemodel#lib/active_model/validator.rb:134 class ActiveModel::EachValidator < ::ActiveModel::Validator # Returns a new validator instance. All options will be available via the # +options+ reader, however the :attributes option will be removed # and instead be made available through the +attributes+ reader. # - # @raise [ArgumentError] - # @return [EachValidator] a new instance of EachValidator - # - # source://activemodel//lib/active_model/validator.rb#140 + # pkg:gem/activemodel#lib/active_model/validator.rb:140 def initialize(options); end - # Returns the value of attribute attributes. - # - # source://activemodel//lib/active_model/validator.rb#135 + # pkg:gem/activemodel#lib/active_model/validator.rb:135 def attributes; end # Hook method that gets called by the initializer allowing verification # that the arguments supplied are valid. You could for example raise an # +ArgumentError+ when invalid options are supplied. # - # source://activemodel//lib/active_model/validator.rb#168 + # pkg:gem/activemodel#lib/active_model/validator.rb:168 def check_validity!; end # Performs validation on the supplied record. By default this will call # +validate_each+ to determine validity therefore subclasses should # override +validate_each+ with validation logic. # - # source://activemodel//lib/active_model/validator.rb#150 + # pkg:gem/activemodel#lib/active_model/validator.rb:150 def validate(record); end # Override this method in subclasses with the validation logic, adding # errors to the records +errors+ array where necessary. # - # @raise [NotImplementedError] - # - # source://activemodel//lib/active_model/validator.rb#161 + # pkg:gem/activemodel#lib/active_model/validator.rb:161 def validate_each(record, attribute, value); end private - # source://activemodel//lib/active_model/validator.rb#172 + # pkg:gem/activemodel#lib/active_model/validator.rb:172 def prepare_value_for_validation(value, record, attr_name); end end @@ -2170,33 +2249,25 @@ end # # Represents one single error # -# source://activemodel//lib/active_model/error.rb#9 +# pkg:gem/activemodel#lib/active_model/error.rb:8 class ActiveModel::Error - # @return [Error] a new instance of Error - # - # source://activemodel//lib/active_model/error.rb#103 + # pkg:gem/activemodel#lib/active_model/error.rb:102 def initialize(base, attribute, type = T.unsafe(nil), **options); end - # source://activemodel//lib/active_model/error.rb#190 + # pkg:gem/activemodel#lib/active_model/error.rb:189 def ==(other); end # The attribute of +base+ which the error belongs to # - # source://activemodel//lib/active_model/error.rb#121 + # pkg:gem/activemodel#lib/active_model/error.rb:120 def attribute; end # The object which the error belongs to # - # source://activemodel//lib/active_model/error.rb#119 + # pkg:gem/activemodel#lib/active_model/error.rb:118 def base; end - # Returns the error details. - # - # error = ActiveModel::Error.new(person, :name, :too_short, count: 5) - # error.details - # # => { error: :too_short, count: 5 } - # - # source://activemodel//lib/active_model/error.rb#149 + # pkg:gem/activemodel#lib/active_model/error.rb:151 def detail; end # Returns the error details. @@ -2205,10 +2276,10 @@ class ActiveModel::Error # error.details # # => { error: :too_short, count: 5 } # - # source://activemodel//lib/active_model/error.rb#149 + # pkg:gem/activemodel#lib/active_model/error.rb:148 def details; end - # source://activemodel//lib/active_model/error.rb#190 + # pkg:gem/activemodel#lib/active_model/error.rb:192 def eql?(other); end # Returns the full error message. @@ -2217,31 +2288,29 @@ class ActiveModel::Error # error.full_message # # => "Name is too short (minimum is 5 characters)" # - # source://activemodel//lib/active_model/error.rb#159 + # pkg:gem/activemodel#lib/active_model/error.rb:158 def full_message; end - # source://activemodel//lib/active_model/error.rb#195 + # pkg:gem/activemodel#lib/active_model/error.rb:194 def hash; end - # source://activemodel//lib/active_model/error.rb#13 + # pkg:gem/activemodel#lib/active_model/error.rb:12 def i18n_customize_full_message; end - # source://activemodel//lib/active_model/error.rb#13 + # pkg:gem/activemodel#lib/active_model/error.rb:12 def i18n_customize_full_message=(_arg0); end - # source://activemodel//lib/active_model/error.rb#13 + # pkg:gem/activemodel#lib/active_model/error.rb:12 def i18n_customize_full_message?; end - # source://activemodel//lib/active_model/error.rb#199 + # pkg:gem/activemodel#lib/active_model/error.rb:198 def inspect; end # See if error matches provided +attribute+, +type+, and +options+. # # Omitted params are not checked for a match. # - # @return [Boolean] - # - # source://activemodel//lib/active_model/error.rb#166 + # pkg:gem/activemodel#lib/active_model/error.rb:165 def match?(attribute, type = T.unsafe(nil), **options); end # Returns the error message. @@ -2250,18 +2319,18 @@ class ActiveModel::Error # error.message # # => "is too short (minimum is 5 characters)" # - # source://activemodel//lib/active_model/error.rb#135 + # pkg:gem/activemodel#lib/active_model/error.rb:134 def message; end # The options provided when calling errors#add # - # source://activemodel//lib/active_model/error.rb#128 + # pkg:gem/activemodel#lib/active_model/error.rb:127 def options; end # The raw value provided as the second parameter when calling # errors#add # - # source://activemodel//lib/active_model/error.rb#126 + # pkg:gem/activemodel#lib/active_model/error.rb:125 def raw_type; end # See if error matches provided +attribute+, +type+, and +options+ exactly. @@ -2269,56 +2338,54 @@ class ActiveModel::Error # All params must be equal to Error's own attributes to be considered a # strict match. # - # @return [Boolean] - # - # source://activemodel//lib/active_model/error.rb#184 + # pkg:gem/activemodel#lib/active_model/error.rb:183 def strict_match?(attribute, type, **options); end # The type of error, defaults to +:invalid+ unless specified # - # source://activemodel//lib/active_model/error.rb#123 + # pkg:gem/activemodel#lib/active_model/error.rb:122 def type; end protected - # source://activemodel//lib/active_model/error.rb#204 + # pkg:gem/activemodel#lib/active_model/error.rb:203 def attributes_for_hash; end private - # source://activemodel//lib/active_model/error.rb#111 + # pkg:gem/activemodel#lib/active_model/error.rb:110 def initialize_dup(other); end class << self - # source://activemodel//lib/active_model/error.rb#15 + # pkg:gem/activemodel#lib/active_model/error.rb:14 def full_message(attribute, message, base); end - # source://activemodel//lib/active_model/error.rb#64 + # pkg:gem/activemodel#lib/active_model/error.rb:63 def generate_message(attribute, type, base, options); end - # source://activemodel//lib/active_model/error.rb#13 + # pkg:gem/activemodel#lib/active_model/error.rb:12 def i18n_customize_full_message; end - # source://activemodel//lib/active_model/error.rb#13 + # pkg:gem/activemodel#lib/active_model/error.rb:12 def i18n_customize_full_message=(value); end - # source://activemodel//lib/active_model/error.rb#13 + # pkg:gem/activemodel#lib/active_model/error.rb:12 def i18n_customize_full_message?; end private - # source://activesupport/8.0.3/lib/active_support/class_attribute.rb#15 + # pkg:gem/activemodel#lib/active_model/error.rb:12 def __class_attr_i18n_customize_full_message; end - # source://activesupport/8.0.3/lib/active_support/class_attribute.rb#17 + # pkg:gem/activemodel#lib/active_model/error.rb:12 def __class_attr_i18n_customize_full_message=(new_value); end end end -# source://activemodel//lib/active_model/error.rb#10 +# pkg:gem/activemodel#lib/active_model/error.rb:9 ActiveModel::Error::CALLBACKS_OPTIONS = T.let(T.unsafe(nil), Array) -# source://activemodel//lib/active_model/error.rb#11 +# pkg:gem/activemodel#lib/active_model/error.rb:10 ActiveModel::Error::MESSAGE_OPTIONS = T.let(T.unsafe(nil), Array) # = Active \Model \Errors @@ -2372,10 +2439,9 @@ ActiveModel::Error::MESSAGE_OPTIONS = T.let(T.unsafe(nil), Array) # person.errors.full_messages # => ["name cannot be nil"] # # etc.. # -# source://activemodel//lib/active_model/errors.rb#61 +# pkg:gem/activemodel#lib/active_model/errors.rb:60 class ActiveModel::Errors include ::Enumerable - extend ::Forwardable # Pass in the instance of the object that is using the errors object. # @@ -2385,9 +2451,7 @@ class ActiveModel::Errors # end # end # - # @return [Errors] a new instance of Errors - # - # source://activemodel//lib/active_model/errors.rb#117 + # pkg:gem/activemodel#lib/active_model/errors.rb:114 def initialize(base); end # When passed a symbol or a name of a method, returns an array of errors @@ -2396,7 +2460,7 @@ class ActiveModel::Errors # person.errors[:name] # => ["cannot be nil"] # person.errors['name'] # => ["cannot be nil"] # - # source://activemodel//lib/active_model/errors.rb#229 + # pkg:gem/activemodel#lib/active_model/errors.rb:226 def [](attribute); end # Adds a new error of +type+ on +attribute+. @@ -2449,7 +2513,7 @@ class ActiveModel::Errors # person.errors.details # # => {:base=>[{error: :name_or_email_blank}]} # - # source://activemodel//lib/active_model/errors.rb#342 + # pkg:gem/activemodel#lib/active_model/errors.rb:339 def add(attribute, type = T.unsafe(nil), **options); end # Returns +true+ if an error matches provided +attribute+ and +type+, @@ -2469,9 +2533,7 @@ class ActiveModel::Errors # person.errors.added? :name, :too_long # => false # person.errors.added? :name, "is too long" # => false # - # @return [Boolean] - # - # source://activemodel//lib/active_model/errors.rb#372 + # pkg:gem/activemodel#lib/active_model/errors.rb:369 def added?(attribute, type = T.unsafe(nil), options = T.unsafe(nil)); end # Returns a Hash that can be used as the JSON representation for this @@ -2481,7 +2543,7 @@ class ActiveModel::Errors # person.errors.as_json # => {:name=>["cannot be nil"]} # person.errors.as_json(full_messages: true) # => {:name=>["name cannot be nil"]} # - # source://activemodel//lib/active_model/errors.rb#247 + # pkg:gem/activemodel#lib/active_model/errors.rb:244 def as_json(options = T.unsafe(nil)); end # Returns all error attribute names @@ -2489,11 +2551,11 @@ class ActiveModel::Errors # person.errors.messages # => {:name=>["cannot be nil", "must be specified"]} # person.errors.attribute_names # => [:name] # - # source://activemodel//lib/active_model/errors.rb#237 + # pkg:gem/activemodel#lib/active_model/errors.rb:234 def attribute_names; end - # source://forwardable/1.3.3/forwardable.rb#231 - def clear(*args, **_arg1, &block); end + # pkg:gem/activemodel#lib/active_model/errors.rb:100 + def clear(*_arg0, **_arg1, &_arg2); end # Copies the errors from other. # For copying errors but keep @base as is. @@ -2506,7 +2568,7 @@ class ActiveModel::Errors # # person.errors.copy!(other) # - # source://activemodel//lib/active_model/errors.rb#138 + # pkg:gem/activemodel#lib/active_model/errors.rb:135 def copy!(other); end # Delete messages for +key+. Returns the deleted messages. @@ -2515,31 +2577,31 @@ class ActiveModel::Errors # person.errors.delete(:name) # => ["cannot be nil"] # person.errors[:name] # => [] # - # source://activemodel//lib/active_model/errors.rb#215 + # pkg:gem/activemodel#lib/active_model/errors.rb:212 def delete(attribute, type = T.unsafe(nil), **options); end # Returns a Hash of attributes with an array of their error details. # - # source://activemodel//lib/active_model/errors.rb#276 + # pkg:gem/activemodel#lib/active_model/errors.rb:273 def details; end - # source://forwardable/1.3.3/forwardable.rb#231 - def each(*args, **_arg1, &block); end + # pkg:gem/activemodel#lib/active_model/errors.rb:100 + def each(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3/forwardable.rb#231 - def empty?(*args, **_arg1, &block); end + # pkg:gem/activemodel#lib/active_model/errors.rb:100 + def empty?(*_arg0, **_arg1, &_arg2); end # The actual array of +Error+ objects # This method is aliased to objects. # - # source://activemodel//lib/active_model/errors.rb#107 + # pkg:gem/activemodel#lib/active_model/errors.rb:104 def errors; end # Returns a full message for a given attribute. # # person.errors.full_message(:name, 'is invalid') # => "Name is invalid" # - # source://activemodel//lib/active_model/errors.rb#451 + # pkg:gem/activemodel#lib/active_model/errors.rb:448 def full_message(attribute, message); end # Returns all the full error messages in an array. @@ -2553,7 +2615,7 @@ class ActiveModel::Errors # person.errors.full_messages # # => ["Name is too short (minimum is 5 characters)", "Name can't be blank", "Email can't be blank"] # - # source://activemodel//lib/active_model/errors.rb#415 + # pkg:gem/activemodel#lib/active_model/errors.rb:412 def full_messages; end # Returns all the full error messages for a given attribute in an array. @@ -2567,7 +2629,7 @@ class ActiveModel::Errors # person.errors.full_messages_for(:name) # # => ["Name is too short (minimum is 5 characters)", "Name can't be blank"] # - # source://activemodel//lib/active_model/errors.rb#430 + # pkg:gem/activemodel#lib/active_model/errors.rb:427 def full_messages_for(attribute); end # Translates an error message in its default scope @@ -2595,7 +2657,7 @@ class ActiveModel::Errors # * errors.attributes.title.blank # * errors.messages.blank # - # source://activemodel//lib/active_model/errors.rb#479 + # pkg:gem/activemodel#lib/active_model/errors.rb:476 def generate_message(attribute, type = T.unsafe(nil), options = T.unsafe(nil)); end # Returns a Hash of attributes with an array of their Error objects. @@ -2603,19 +2665,10 @@ class ActiveModel::Errors # person.errors.group_by_attribute # # => {:name=>[<#ActiveModel::Error>, <#ActiveModel::Error>]} # - # source://activemodel//lib/active_model/errors.rb#289 + # pkg:gem/activemodel#lib/active_model/errors.rb:286 def group_by_attribute; end - # Returns +true+ if the error messages include an error for the given key - # +attribute+, +false+ otherwise. - # - # person.errors.messages # => {:name=>["cannot be nil"]} - # person.errors.include?(:name) # => true - # person.errors.include?(:age) # => false - # - # @return [Boolean] - # - # source://activemodel//lib/active_model/errors.rb#202 + # pkg:gem/activemodel#lib/active_model/errors.rb:204 def has_key?(attribute); end # Imports one error. @@ -2628,7 +2681,7 @@ class ActiveModel::Errors # * +:attribute+ - Override the attribute the error belongs to. # * +:type+ - Override type of the error. # - # source://activemodel//lib/active_model/errors.rb#154 + # pkg:gem/activemodel#lib/active_model/errors.rb:151 def import(error, override_options = T.unsafe(nil)); end # Returns +true+ if the error messages include an error for the given key @@ -2638,24 +2691,13 @@ class ActiveModel::Errors # person.errors.include?(:name) # => true # person.errors.include?(:age) # => false # - # @return [Boolean] - # - # source://activemodel//lib/active_model/errors.rb#202 + # pkg:gem/activemodel#lib/active_model/errors.rb:199 def include?(attribute); end - # source://activemodel//lib/active_model/errors.rb#483 + # pkg:gem/activemodel#lib/active_model/errors.rb:480 def inspect; end - # Returns +true+ if the error messages include an error for the given key - # +attribute+, +false+ otherwise. - # - # person.errors.messages # => {:name=>["cannot be nil"]} - # person.errors.include?(:name) # => true - # person.errors.include?(:age) # => false - # - # @return [Boolean] - # - # source://activemodel//lib/active_model/errors.rb#202 + # pkg:gem/activemodel#lib/active_model/errors.rb:205 def key?(attribute); end # Merges the errors from other, @@ -2669,12 +2711,12 @@ class ActiveModel::Errors # # person.errors.merge!(other) # - # source://activemodel//lib/active_model/errors.rb#174 + # pkg:gem/activemodel#lib/active_model/errors.rb:171 def merge!(other); end # Returns a Hash of attributes with an array of their error messages. # - # source://activemodel//lib/active_model/errors.rb#268 + # pkg:gem/activemodel#lib/active_model/errors.rb:265 def messages; end # Returns all the error messages for a given attribute in an array. @@ -2688,13 +2730,10 @@ class ActiveModel::Errors # person.errors.messages_for(:name) # # => ["is too short (minimum is 5 characters)", "can't be blank"] # - # source://activemodel//lib/active_model/errors.rb#444 + # pkg:gem/activemodel#lib/active_model/errors.rb:441 def messages_for(attribute); end - # The actual array of +Error+ objects - # This method is aliased to objects. - # - # source://activemodel//lib/active_model/errors.rb#107 + # pkg:gem/activemodel#lib/active_model/errors.rb:105 def objects; end # Returns +true+ if an error on the attribute with the given type is @@ -2709,26 +2748,13 @@ class ActiveModel::Errors # person.errors.of_kind? :name, :not_too_long # => false # person.errors.of_kind? :name, "is too long" # => false # - # @return [Boolean] - # - # source://activemodel//lib/active_model/errors.rb#395 + # pkg:gem/activemodel#lib/active_model/errors.rb:392 def of_kind?(attribute, type = T.unsafe(nil)); end - # source://forwardable/1.3.3/forwardable.rb#231 - def size(*args, **_arg1, &block); end + # pkg:gem/activemodel#lib/active_model/errors.rb:100 + def size(*_arg0, **_arg1, &_arg2); end - # Returns all the full error messages in an array. - # - # class Person - # validates_presence_of :name, :address, :email - # validates_length_of :name, in: 5..30 - # end - # - # person = Person.create(address: '123 First St.') - # person.errors.full_messages - # # => ["Name is too short (minimum is 5 characters)", "Name can't be blank", "Email can't be blank"] - # - # source://activemodel//lib/active_model/errors.rb#415 + # pkg:gem/activemodel#lib/active_model/errors.rb:415 def to_a; end # Returns a Hash of attributes with their error messages. If +full_messages+ @@ -2737,11 +2763,11 @@ class ActiveModel::Errors # person.errors.to_hash # => {:name=>["cannot be nil"]} # person.errors.to_hash(true) # => {:name=>["name cannot be nil"]} # - # source://activemodel//lib/active_model/errors.rb#256 + # pkg:gem/activemodel#lib/active_model/errors.rb:253 def to_hash(full_messages = T.unsafe(nil)); end - # source://forwardable/1.3.3/forwardable.rb#231 - def uniq!(*args, **_arg1, &block); end + # pkg:gem/activemodel#lib/active_model/errors.rb:100 + def uniq!(*_arg0, **_arg1, &_arg2); end # Search for errors matching +attribute+, +type+, or +options+. # @@ -2751,19 +2777,19 @@ class ActiveModel::Errors # person.errors.where(:name, :too_short) # => all name errors being too short # person.errors.where(:name, :too_short, minimum: 2) # => all name errors being too short and minimum is 2 # - # source://activemodel//lib/active_model/errors.rb#189 + # pkg:gem/activemodel#lib/active_model/errors.rb:186 def where(attribute, type = T.unsafe(nil), **options); end private - # source://activemodel//lib/active_model/errors.rb#122 + # pkg:gem/activemodel#lib/active_model/errors.rb:119 def initialize_dup(other); end - # source://activemodel//lib/active_model/errors.rb#490 + # pkg:gem/activemodel#lib/active_model/errors.rb:487 def normalize_arguments(attribute, type, **options); end end -# source://activemodel//lib/active_model/errors.rb#265 +# pkg:gem/activemodel#lib/active_model/errors.rb:262 ActiveModel::Errors::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) # = Active \Model \ForbiddenAttributesError @@ -2781,206 +2807,172 @@ ActiveModel::Errors::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) # Person.new(params) # # => # # -# source://activemodel//lib/active_model/forbidden_attributes_protection.rb#18 +# pkg:gem/activemodel#lib/active_model/forbidden_attributes_protection.rb:18 class ActiveModel::ForbiddenAttributesError < ::StandardError; end -# source://activemodel//lib/active_model/forbidden_attributes_protection.rb#21 +# pkg:gem/activemodel#lib/active_model/forbidden_attributes_protection.rb:21 module ActiveModel::ForbiddenAttributesProtection private - # source://activemodel//lib/active_model/forbidden_attributes_protection.rb#23 + # pkg:gem/activemodel#lib/active_model/forbidden_attributes_protection.rb:23 def sanitize_for_mass_assignment(attributes); end - # source://activemodel//lib/active_model/forbidden_attributes_protection.rb#23 + # pkg:gem/activemodel#lib/active_model/forbidden_attributes_protection.rb:31 def sanitize_forbidden_attributes(attributes); end end -# source://activemodel//lib/active_model/attribute_mutation_tracker.rb#91 +# pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:91 class ActiveModel::ForcedMutationTracker < ::ActiveModel::AttributeMutationTracker - # @return [ForcedMutationTracker] a new instance of ForcedMutationTracker - # - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#92 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:92 def initialize(attributes); end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#101 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:101 def change_to_attribute(attr_name); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#97 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:97 def changed_in_place?(attr_name); end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#125 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:125 def finalize_changes; end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#121 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:121 def force_change(attr_name); end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#109 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:109 def forget_change(attr_name); end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#113 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:113 def original_value(attr_name); end private - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#132 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:132 def attr_names; end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#136 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:136 def attribute_changed?(attr_name); end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#144 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:144 def clone_value(attr_name); end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#140 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:140 def fetch_value(attr_name); end - # Returns the value of attribute finalized_changes. - # - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#130 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:130 def finalized_changes; end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#151 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:151 def type_cast(attr_name, value); end end -# source://activemodel//lib/active_model/attribute_set/builder.rb#94 +# pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:94 class ActiveModel::LazyAttributeHash - # @return [LazyAttributeHash] a new instance of LazyAttributeHash - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#97 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:97 def initialize(types, values, additional_types, default_attributes, delegate_hash = T.unsafe(nil)); end - # source://activemodel//lib/active_model/attribute_set/builder.rb#134 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:134 def ==(other); end - # source://activemodel//lib/active_model/attribute_set/builder.rb#110 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:110 def [](key); end - # source://activemodel//lib/active_model/attribute_set/builder.rb#114 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:114 def []=(key, value); end - # source://activemodel//lib/active_model/attribute_set/builder.rb#118 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:118 def deep_dup; end - # source://activemodel//lib/active_model/attribute_set/builder.rb#129 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:129 def each_key(&block); end - # source://activemodel//lib/active_model/attribute_set/builder.rb#95 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:95 def each_value(*_arg0, **_arg1, &_arg2); end - # source://activemodel//lib/active_model/attribute_set/builder.rb#95 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:95 def except(*_arg0, **_arg1, &_arg2); end - # source://activemodel//lib/active_model/attribute_set/builder.rb#95 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:95 def fetch(*_arg0, **_arg1, &_arg2); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#106 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:106 def key?(key); end - # source://activemodel//lib/active_model/attribute_set/builder.rb#142 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:142 def marshal_dump; end - # source://activemodel//lib/active_model/attribute_set/builder.rb#146 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:146 def marshal_load(values); end - # source://activemodel//lib/active_model/attribute_set/builder.rb#95 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:95 def transform_values(*_arg0, **_arg1, &_arg2); end protected - # source://activemodel//lib/active_model/attribute_set/builder.rb#151 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:151 def materialize; end private - # Returns the value of attribute additional_types. - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#163 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:163 def additional_types; end - # source://activemodel//lib/active_model/attribute_set/builder.rb#165 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:165 def assign_default_value(name); end - # Returns the value of attribute default_attributes. - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#163 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:163 def default_attributes; end - # Returns the value of attribute delegate_hash. - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#163 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:163 def delegate_hash; end - # source://activemodel//lib/active_model/attribute_set/builder.rb#124 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:124 def initialize_dup(_); end - # Returns the value of attribute types. - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#163 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:163 def types; end - # Returns the value of attribute values. - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#163 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:163 def values; end end -# source://activemodel//lib/active_model/attribute_set/builder.rb#21 +# pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:21 class ActiveModel::LazyAttributeSet < ::ActiveModel::AttributeSet - # @return [LazyAttributeSet] a new instance of LazyAttributeSet - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#22 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:22 def initialize(values, types, additional_types, default_attributes, attributes = T.unsafe(nil)); end - # source://activemodel//lib/active_model/attribute_set/builder.rb#41 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:41 def fetch_value(name, &block); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#32 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:32 def key?(name); end - # source://activemodel//lib/active_model/attribute_set/builder.rb#36 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:36 def keys; end protected - # source://activemodel//lib/active_model/attribute_set/builder.rb#61 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:61 def attributes; end private - # Returns the value of attribute additional_types. - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#71 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:71 def additional_types; end - # source://activemodel//lib/active_model/attribute_set/builder.rb#73 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:73 def default_attribute(name, value_present = T.unsafe(nil), value = T.unsafe(nil)); end - # Returns the value of attribute default_attributes. - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#71 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:71 def default_attributes; end - # Returns the value of attribute types. - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#71 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:71 def types; end - # Returns the value of attribute values. - # - # source://activemodel//lib/active_model/attribute_set/builder.rb#71 + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:71 def values; end end -# source://activemodel//lib/active_model/lint.rb#4 +# pkg:gem/activemodel#lib/active_model/lint.rb:4 module ActiveModel::Lint; end # == Active \Model \Lint \Tests @@ -3003,7 +2995,7 @@ module ActiveModel::Lint; end # to to_model. It is perfectly fine for to_model to return # +self+. # -# source://activemodel//lib/active_model/lint.rb#24 +# pkg:gem/activemodel#lib/active_model/lint.rb:24 module ActiveModel::Lint::Tests # Passes if the object's model responds to errors and if calling # [](attribute) on the result of this method returns an array. @@ -3015,7 +3007,7 @@ module ActiveModel::Lint::Tests # If localization is used, the strings should be localized for the current # locale. If no error is present, the method should return an empty array. # - # source://activemodel//lib/active_model/lint.rb#102 + # pkg:gem/activemodel#lib/active_model/lint.rb:102 def test_errors_aref; end # Passes if the object's model responds to model_name both as @@ -3025,7 +3017,7 @@ module ActiveModel::Lint::Tests # # Check ActiveModel::Naming for more information. # - # source://activemodel//lib/active_model/lint.rb#81 + # pkg:gem/activemodel#lib/active_model/lint.rb:81 def test_model_naming; end # Passes if the object's model responds to persisted? and if @@ -3036,9 +3028,7 @@ module ActiveModel::Lint::Tests # will route to the create action. If it is persisted, a form for the # object will route to the update action. # - # @return [Boolean] - # - # source://activemodel//lib/active_model/lint.rb#70 + # pkg:gem/activemodel#lib/active_model/lint.rb:70 def test_persisted?; end # Passes if the object's model responds to to_key and if calling @@ -3048,7 +3038,7 @@ module ActiveModel::Lint::Tests # to_key returns an Enumerable of all (primary) key attributes # of the model, and is used to a generate unique DOM id for the object. # - # source://activemodel//lib/active_model/lint.rb#31 + # pkg:gem/activemodel#lib/active_model/lint.rb:31 def test_to_key; end # Passes if the object's model responds to to_param and if @@ -3061,7 +3051,7 @@ module ActiveModel::Lint::Tests # tests for this behavior in lint because it doesn't make sense to force # any of the possible implementation strategies on the implementer. # - # source://activemodel//lib/active_model/lint.rb#46 + # pkg:gem/activemodel#lib/active_model/lint.rb:46 def test_to_param; end # Passes if the object's model responds to to_partial_path and if @@ -3070,15 +3060,18 @@ module ActiveModel::Lint::Tests # to_partial_path is used for looking up partials. For example, # a BlogPost model might return "blog_posts/blog_post". # - # source://activemodel//lib/active_model/lint.rb#58 + # pkg:gem/activemodel#lib/active_model/lint.rb:58 def test_to_partial_path; end private - # source://activemodel//lib/active_model/lint.rb#113 + # pkg:gem/activemodel#lib/active_model/lint.rb:117 def assert_boolean(result, name); end - # source://activemodel//lib/active_model/lint.rb#108 + # pkg:gem/activemodel#lib/active_model/lint.rb:108 + def def_method(receiver, name, &block); end + + # pkg:gem/activemodel#lib/active_model/lint.rb:112 def model; end end @@ -3092,7 +3085,7 @@ end # user.pets.select(:id).first.user_id # # => ActiveModel::MissingAttributeError: missing attribute 'user_id' for Pet # -# source://activemodel//lib/active_model/attribute_methods.rb#15 +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:15 class ActiveModel::MissingAttributeError < ::NoMethodError; end # = Active \Model \Basic \Model @@ -3134,7 +3127,7 @@ class ActiveModel::MissingAttributeError < ::NoMethodError; end # refer to the specific modules included in +ActiveModel::Model+ # (see below). # -# source://activemodel//lib/active_model/model.rb#42 +# pkg:gem/activemodel#lib/active_model/model.rb:42 module ActiveModel::Model include ::ActiveModel::Access extend ::ActiveSupport::Concern @@ -3173,7 +3166,7 @@ module ActiveModel::Model end end -# source://activemodel//lib/active_model/naming.rb#9 +# pkg:gem/activemodel#lib/active_model/naming.rb:8 class ActiveModel::Name include ::Comparable @@ -3190,60 +3183,43 @@ class ActiveModel::Name # ActiveModel::Name.new(Foo::Bar).to_s # # => "Foo::Bar" # - # @raise [ArgumentError] - # @return [Name] a new instance of Name - # - # source://activemodel//lib/active_model/naming.rb#166 + # pkg:gem/activemodel#lib/active_model/naming.rb:165 def initialize(klass, namespace = T.unsafe(nil), name = T.unsafe(nil), locale = T.unsafe(nil)); end - # source://activemodel//lib/active_model/naming.rb#151 + # pkg:gem/activemodel#lib/active_model/naming.rb:150 def !~(*_arg0, **_arg1, &_arg2); end - # source://activemodel//lib/active_model/naming.rb#151 + # pkg:gem/activemodel#lib/active_model/naming.rb:150 def <=>(*_arg0, **_arg1, &_arg2); end - # source://activemodel//lib/active_model/naming.rb#151 + # pkg:gem/activemodel#lib/active_model/naming.rb:150 def ==(arg); end - # source://activemodel//lib/active_model/naming.rb#151 + # pkg:gem/activemodel#lib/active_model/naming.rb:150 def ===(arg); end - # source://activemodel//lib/active_model/naming.rb#151 + # pkg:gem/activemodel#lib/active_model/naming.rb:150 def =~(*_arg0, **_arg1, &_arg2); end - # source://activemodel//lib/active_model/naming.rb#151 + # pkg:gem/activemodel#lib/active_model/naming.rb:150 def as_json(*_arg0, **_arg1, &_arg2); end - # Returns the value of attribute collection. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:15 def cache_key; end - # Returns the value of attribute collection. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def collection; end - # Sets the attribute collection - # - # @param value the value to set the attribute collection to. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def collection=(_arg0); end - # Returns the value of attribute element. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def element; end - # Sets the attribute element - # - # @param value the value to set the attribute element to. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def element=(_arg0); end - # source://activemodel//lib/active_model/naming.rb#151 + # pkg:gem/activemodel#lib/active_model/naming.rb:150 def eql?(*_arg0, **_arg1, &_arg2); end # Transform the model name into a more human format, using I18n. By default, @@ -3257,120 +3233,76 @@ class ActiveModel::Name # # Specify +options+ with additional translating options. # - # source://activemodel//lib/active_model/naming.rb#197 + # pkg:gem/activemodel#lib/active_model/naming.rb:196 def human(options = T.unsafe(nil)); end - # Returns the value of attribute i18n_key. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def i18n_key; end - # Sets the attribute i18n_key - # - # @param value the value to set the attribute i18n_key to. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def i18n_key=(_arg0); end - # source://activemodel//lib/active_model/naming.rb#151 + # pkg:gem/activemodel#lib/active_model/naming.rb:150 def match?(*_arg0, **_arg1, &_arg2); end - # Returns the value of attribute name. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def name; end - # Sets the attribute name - # - # @param value the value to set the attribute name to. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def name=(_arg0); end - # Returns the value of attribute param_key. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def param_key; end - # Sets the attribute param_key - # - # @param value the value to set the attribute param_key to. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def param_key=(_arg0); end - # Returns the value of attribute plural. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def plural; end - # Sets the attribute plural - # - # @param value the value to set the attribute plural to. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def plural=(_arg0); end - # Returns the value of attribute route_key. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def route_key; end - # Sets the attribute route_key - # - # @param value the value to set the attribute route_key to. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def route_key=(_arg0); end - # Returns the value of attribute singular. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def singular; end - # Sets the attribute singular - # - # @param value the value to set the attribute singular to. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def singular=(_arg0); end - # Returns the value of attribute singular_route_key. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def singular_route_key; end - # Sets the attribute singular_route_key - # - # @param value the value to set the attribute singular_route_key to. - # - # source://activemodel//lib/active_model/naming.rb#12 + # pkg:gem/activemodel#lib/active_model/naming.rb:11 def singular_route_key=(_arg0); end - # source://activemodel//lib/active_model/naming.rb#151 + # pkg:gem/activemodel#lib/active_model/naming.rb:150 def to_s(*_arg0, **_arg1, &_arg2); end - # source://activemodel//lib/active_model/naming.rb#151 + # pkg:gem/activemodel#lib/active_model/naming.rb:150 def to_str(*_arg0, **_arg1, &_arg2); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/naming.rb#209 + # pkg:gem/activemodel#lib/active_model/naming.rb:208 def uncountable?; end private - # source://activemodel//lib/active_model/naming.rb#216 + # pkg:gem/activemodel#lib/active_model/naming.rb:215 def _singularize(string); end - # source://activemodel//lib/active_model/naming.rb#220 + # pkg:gem/activemodel#lib/active_model/naming.rb:219 def i18n_keys; end - # source://activemodel//lib/active_model/naming.rb#228 + # pkg:gem/activemodel#lib/active_model/naming.rb:227 def i18n_scope; end end -# source://activemodel//lib/active_model/naming.rb#214 +# pkg:gem/activemodel#lib/active_model/naming.rb:213 ActiveModel::Name::MISSING_TRANSLATION = T.let(T.unsafe(nil), Integer) # = Active \Model \Naming @@ -3393,7 +3325,7 @@ ActiveModel::Name::MISSING_TRANSLATION = T.let(T.unsafe(nil), Integer) # is required to pass the \Active \Model Lint test. So either extending the # provided method below, or rolling your own is required. # -# source://activemodel//lib/active_model/naming.rb#252 +# pkg:gem/activemodel#lib/active_model/naming.rb:251 module ActiveModel::Naming # Returns an ActiveModel::Name object for module. It can be # used to retrieve all kinds of naming-related information @@ -3408,16 +3340,16 @@ module ActiveModel::Naming # Person.model_name.singular # => "person" # Person.model_name.plural # => "people" # - # source://activemodel//lib/active_model/naming.rb#270 + # pkg:gem/activemodel#lib/active_model/naming.rb:269 def model_name; end private - # source://activemodel//lib/active_model/naming.rb#352 + # pkg:gem/activemodel#lib/active_model/naming.rb:351 def inherited(base); end class << self - # source://activemodel//lib/active_model/naming.rb#253 + # pkg:gem/activemodel#lib/active_model/naming.rb:252 def extended(base); end # Returns string to use for params names. It differs for @@ -3429,7 +3361,7 @@ module ActiveModel::Naming # # For shared engine: # ActiveModel::Naming.param_key(Blog::Post) # => "blog_post" # - # source://activemodel//lib/active_model/naming.rb#338 + # pkg:gem/activemodel#lib/active_model/naming.rb:337 def param_key(record_or_class); end # Returns the plural class name of a record or class. @@ -3437,7 +3369,7 @@ module ActiveModel::Naming # ActiveModel::Naming.plural(post) # => "posts" # ActiveModel::Naming.plural(Highrise::Person) # => "highrise_people" # - # source://activemodel//lib/active_model/naming.rb#283 + # pkg:gem/activemodel#lib/active_model/naming.rb:282 def plural(record_or_class); end # Returns string to use while generating route names. It differs for @@ -3452,7 +3384,7 @@ module ActiveModel::Naming # The route key also considers if the noun is uncountable and, in # such cases, automatically appends _index. # - # source://activemodel//lib/active_model/naming.rb#326 + # pkg:gem/activemodel#lib/active_model/naming.rb:325 def route_key(record_or_class); end # Returns the singular class name of a record or class. @@ -3460,7 +3392,7 @@ module ActiveModel::Naming # ActiveModel::Naming.singular(post) # => "post" # ActiveModel::Naming.singular(Highrise::Person) # => "highrise_person" # - # source://activemodel//lib/active_model/naming.rb#291 + # pkg:gem/activemodel#lib/active_model/naming.rb:290 def singular(record_or_class); end # Returns string to use while generating route names. It differs for @@ -3472,7 +3404,7 @@ module ActiveModel::Naming # # For shared engine: # ActiveModel::Naming.singular_route_key(Blog::Post) # => "blog_post" # - # source://activemodel//lib/active_model/naming.rb#311 + # pkg:gem/activemodel#lib/active_model/naming.rb:310 def singular_route_key(record_or_class); end # Identifies whether the class name of a record or class is uncountable. @@ -3480,76 +3412,65 @@ module ActiveModel::Naming # ActiveModel::Naming.uncountable?(Sheep) # => true # ActiveModel::Naming.uncountable?(Post) # => false # - # @return [Boolean] - # - # source://activemodel//lib/active_model/naming.rb#299 + # pkg:gem/activemodel#lib/active_model/naming.rb:298 def uncountable?(record_or_class); end private - # source://activemodel//lib/active_model/naming.rb#342 + # pkg:gem/activemodel#lib/active_model/naming.rb:341 def model_name_from_record_or_class(record_or_class); end end end -# source://activemodel//lib/active_model/nested_error.rb#7 +# pkg:gem/activemodel#lib/active_model/nested_error.rb:6 class ActiveModel::NestedError < ::ActiveModel::Error - extend ::Forwardable - - # @return [NestedError] a new instance of NestedError - # - # source://activemodel//lib/active_model/nested_error.rb#8 + # pkg:gem/activemodel#lib/active_model/nested_error.rb:7 def initialize(base, inner_error, override_options = T.unsafe(nil)); end - # Returns the value of attribute inner_error. - # - # source://activemodel//lib/active_model/nested_error.rb#17 + # pkg:gem/activemodel#lib/active_model/nested_error.rb:16 def inner_error; end - # source://forwardable/1.3.3/forwardable.rb#231 - def message(*args, **_arg1, &block); end + # pkg:gem/activemodel#lib/active_model/nested_error.rb:18 + def message(*_arg0, **_arg1, &_arg2); end end -# source://activemodel//lib/active_model/attribute_mutation_tracker.rb#156 +# pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:156 class ActiveModel::NullMutationTracker include ::Singleton::SingletonInstanceMethods include ::Singleton extend ::Singleton::SingletonClassMethods - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#174 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:174 def any_changes?; end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#171 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:171 def change_to_attribute(attr_name); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#178 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:178 def changed?(attr_name, **_arg1); end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#159 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:159 def changed_attribute_names; end - # @return [Boolean] - # - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#182 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:182 def changed_in_place?(attr_name); end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#163 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:163 def changed_values; end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#167 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:167 def changes; end - # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#186 + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:186 def original_value(attr_name); end class << self private + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:157 def allocate; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:157 def new(*_arg0); end end end @@ -3558,25 +3479,25 @@ end # # Raised when attribute values are out of range. # -# source://activemodel//lib/active_model/errors.rb#523 +# pkg:gem/activemodel#lib/active_model/errors.rb:520 class ActiveModel::RangeError < ::RangeError; end -# source://activemodel//lib/active_model/secure_password.rb#4 +# pkg:gem/activemodel#lib/active_model/secure_password.rb:6 module ActiveModel::SecurePassword extend ::ActiveSupport::Concern mixes_in_class_methods ::ActiveModel::SecurePassword::ClassMethods class << self - # source://activemodel//lib/active_model/secure_password.rb#13 + # pkg:gem/activemodel#lib/active_model/secure_password.rb:17 def min_cost; end - # source://activemodel//lib/active_model/secure_password.rb#13 + # pkg:gem/activemodel#lib/active_model/secure_password.rb:17 def min_cost=(_arg0); end end end -# source://activemodel//lib/active_model/secure_password.rb#17 +# pkg:gem/activemodel#lib/active_model/secure_password.rb:21 module ActiveModel::SecurePassword::ClassMethods # Adds methods to set and authenticate against a BCrypt password. # This mechanism requires you to have a +XXX_digest+ attribute, @@ -3602,10 +3523,15 @@ module ActiveModel::SecurePassword::ClassMethods # validations: false as an argument. This allows complete # customizability of validation behavior. # - # Finally, a password reset token that's valid for 15 minutes after issue - # is automatically configured when +reset_token+ is set to true (which it is by default) + # A password reset token (valid for 15 minutes by default) is automatically + # configured when +reset_token+ is set to true (which it is by default) # and the object responds to +generates_token_for+ (which Active Records do). # + # Finally, the reset token expiry can be customized by passing a hash to + # +has_secure_password+: + # + # has_secure_password reset_token: { expires_in: 1.hour } + # # To use +has_secure_password+, add bcrypt (~> 3.1.7) to your Gemfile: # # gem "bcrypt", "~> 3.1.7" @@ -3677,15 +3603,16 @@ module ActiveModel::SecurePassword::ClassMethods # # raises ActiveSupport::MessageVerifier::InvalidSignature since the token is expired # User.find_by_password_reset_token!(token) # - # source://activemodel//lib/active_model/secure_password.rb#116 + # pkg:gem/activemodel#lib/active_model/secure_password.rb:125 def has_secure_password(attribute = T.unsafe(nil), validations: T.unsafe(nil), reset_token: T.unsafe(nil)); end end -# source://activemodel//lib/active_model/secure_password.rb#182 +# pkg:gem/activemodel#lib/active_model/secure_password.rb:14 +ActiveModel::SecurePassword::DEFAULT_RESET_TOKEN_EXPIRES_IN = T.let(T.unsafe(nil), ActiveSupport::Duration) + +# pkg:gem/activemodel#lib/active_model/secure_password.rb:196 class ActiveModel::SecurePassword::InstanceMethodsOnActivation < ::Module - # @return [InstanceMethodsOnActivation] a new instance of InstanceMethodsOnActivation - # - # source://activemodel//lib/active_model/secure_password.rb#183 + # pkg:gem/activemodel#lib/active_model/secure_password.rb:197 def initialize(attribute, reset_token:); end end @@ -3693,7 +3620,7 @@ end # password of length more than 72 bytes it ignores extra characters. # Hence need to put a restriction on password length. # -# source://activemodel//lib/active_model/secure_password.rb#10 +# pkg:gem/activemodel#lib/active_model/secure_password.rb:12 ActiveModel::SecurePassword::MAX_PASSWORD_LENGTH_ALLOWED = T.let(T.unsafe(nil), Integer) # = Active \Model \Serialization @@ -3760,7 +3687,7 @@ ActiveModel::SecurePassword::MAX_PASSWORD_LENGTH_ALLOWED = T.let(T.unsafe(nil), # person.serializable_hash(include: :address) # person.serializable_hash(include: { address: { only: 'city' }}) # -# source://activemodel//lib/active_model/serialization.rb#69 +# pkg:gem/activemodel#lib/active_model/serialization.rb:69 module ActiveModel::Serialization # Hook method defining how an attribute value should be retrieved for # serialization. By default this is assumed to be an instance named after @@ -3778,6 +3705,8 @@ module ActiveModel::Serialization # @data[key] # end # end + # + # pkg:gem/activemodel#lib/active_model/serialization.rb:167 def read_attribute_for_serialization(*_arg0); end # Returns a serialized hash of your object. @@ -3836,12 +3765,12 @@ module ActiveModel::Serialization # user.serializable_hash(include: { notes: { only: 'title' }}) # # => {"name" => "Napoleon", "notes" => [{"title"=>"Battle of Austerlitz"}]} # - # source://activemodel//lib/active_model/serialization.rb#125 + # pkg:gem/activemodel#lib/active_model/serialization.rb:125 def serializable_hash(options = T.unsafe(nil)); end private - # source://activemodel//lib/active_model/serialization.rb#170 + # pkg:gem/activemodel#lib/active_model/serialization.rb:170 def attribute_names_for_serialization; end # Add associations specified via the :include option. @@ -3851,21 +3780,21 @@ module ActiveModel::Serialization # +records+ - the association record(s) to be serialized # +opts+ - options for the association records # - # source://activemodel//lib/active_model/serialization.rb#184 + # pkg:gem/activemodel#lib/active_model/serialization.rb:184 def serializable_add_includes(options = T.unsafe(nil)); end - # source://activemodel//lib/active_model/serialization.rb#174 + # pkg:gem/activemodel#lib/active_model/serialization.rb:174 def serializable_attributes(attribute_names); end end -# source://activemodel//lib/active_model.rb#68 +# pkg:gem/activemodel#lib/active_model.rb:74 module ActiveModel::Serializers extend ::ActiveSupport::Autoload end # = Active \Model \JSON \Serializer # -# source://activemodel//lib/active_model/serializers/json.rb#8 +# pkg:gem/activemodel#lib/active_model/serializers/json.rb:8 module ActiveModel::Serializers::JSON include ::ActiveModel::Serialization extend ::ActiveSupport::Concern @@ -3953,7 +3882,7 @@ module ActiveModel::Serializers::JSON # # { "comments" => [ { "body" => "Don't think too hard" } ], # # "title" => "So I was thinking" } ] } # - # source://activemodel//lib/active_model/serializers/json.rb#96 + # pkg:gem/activemodel#lib/active_model/serializers/json.rb:96 def as_json(options = T.unsafe(nil)); end # Sets the model +attributes+ from a JSON string. Returns +self+. @@ -3991,7 +3920,7 @@ module ActiveModel::Serializers::JSON # person.age # => 22 # person.awesome # => true # - # source://activemodel//lib/active_model/serializers/json.rb#146 + # pkg:gem/activemodel#lib/active_model/serializers/json.rb:146 def from_json(json, include_root = T.unsafe(nil)); end module GeneratedClassMethods @@ -4024,7 +3953,7 @@ end # person.valid? # # => ActiveModel::StrictValidationFailed: Name can't be blank # -# source://activemodel//lib/active_model/errors.rb#517 +# pkg:gem/activemodel#lib/active_model/errors.rb:514 class ActiveModel::StrictValidationFailed < ::StandardError; end # = Active \Model \Translation @@ -4046,7 +3975,7 @@ class ActiveModel::StrictValidationFailed < ::StandardError; end # class-based +i18n_scope+ and +lookup_ancestors+ to find translations in # parent classes. # -# source://activemodel//lib/active_model/translation.rb#22 +# pkg:gem/activemodel#lib/active_model/translation.rb:22 module ActiveModel::Translation include ::ActiveModel::Naming @@ -4057,12 +3986,12 @@ module ActiveModel::Translation # # Specify +options+ with additional translating options. # - # source://activemodel//lib/active_model/translation.rb#48 + # pkg:gem/activemodel#lib/active_model/translation.rb:48 def human_attribute_name(attribute, options = T.unsafe(nil)); end # Returns the +i18n_scope+ for the class. Override if you want custom lookup. # - # source://activemodel//lib/active_model/translation.rb#28 + # pkg:gem/activemodel#lib/active_model/translation.rb:28 def i18n_scope; end # When localizing a string, it goes through the lookup returned by this @@ -4070,40 +3999,40 @@ module ActiveModel::Translation # ActiveModel::Errors#full_messages and # ActiveModel::Translation#human_attribute_name. # - # source://activemodel//lib/active_model/translation.rb#36 + # pkg:gem/activemodel#lib/active_model/translation.rb:36 def lookup_ancestors; end class << self - # source://activemodel//lib/active_model/translation.rb#25 + # pkg:gem/activemodel#lib/active_model/translation.rb:25 def raise_on_missing_translations; end - # source://activemodel//lib/active_model/translation.rb#25 + # pkg:gem/activemodel#lib/active_model/translation.rb:25 def raise_on_missing_translations=(_arg0); end end end -# source://activemodel//lib/active_model/translation.rb#40 +# pkg:gem/activemodel#lib/active_model/translation.rb:40 ActiveModel::Translation::MISSING_TRANSLATION = T.let(T.unsafe(nil), Integer) -# source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#4 +# pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:4 module ActiveModel::Type class << self - # source://activemodel//lib/active_model/type.rb#38 + # pkg:gem/activemodel#lib/active_model/type.rb:38 def default_value; end - # source://activemodel//lib/active_model/type.rb#34 + # pkg:gem/activemodel#lib/active_model/type.rb:34 def lookup(*_arg0, **_arg1, &_arg2); end # Add a new type to the registry, allowing it to be referenced as a # symbol by {attribute}[rdoc-ref:Attributes::ClassMethods#attribute]. # - # source://activemodel//lib/active_model/type.rb#30 + # pkg:gem/activemodel#lib/active_model/type.rb:30 def register(type_name, klass = T.unsafe(nil), &block); end - # source://activemodel//lib/active_model/type.rb#26 + # pkg:gem/activemodel#lib/active_model/type.rb:26 def registry; end - # source://activemodel//lib/active_model/type.rb#26 + # pkg:gem/activemodel#lib/active_model/type.rb:26 def registry=(_arg0); end end end @@ -4127,14 +4056,20 @@ end # All casting and serialization are performed in the same way as the # standard ActiveModel::Type::Integer type. # -# source://activemodel//lib/active_model/type/big_integer.rb#25 +# pkg:gem/activemodel#lib/active_model/type/big_integer.rb:25 class ActiveModel::Type::BigInteger < ::ActiveModel::Type::Integer - # source://activemodel//lib/active_model/type/big_integer.rb#26 + # pkg:gem/activemodel#lib/active_model/type/big_integer.rb:47 + def serializable?(value, &_arg1); end + + # pkg:gem/activemodel#lib/active_model/type/big_integer.rb:26 + def serialize(value); end + + # pkg:gem/activemodel#lib/active_model/type/big_integer.rb:43 def serialize_cast_value(value); end private - # source://activemodel//lib/active_model/type/big_integer.rb#31 + # pkg:gem/activemodel#lib/active_model/type/big_integer.rb:52 def max_value; end end @@ -4145,45 +4080,39 @@ end # # Non-string values are coerced to strings using their +to_s+ method. # -# source://activemodel//lib/active_model/type/binary.rb#11 +# pkg:gem/activemodel#lib/active_model/type/binary.rb:11 class ActiveModel::Type::Binary < ::ActiveModel::Type::Value - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/binary.rb#16 + # pkg:gem/activemodel#lib/active_model/type/binary.rb:16 def binary?; end - # source://activemodel//lib/active_model/type/binary.rb#20 + # pkg:gem/activemodel#lib/active_model/type/binary.rb:20 def cast(value); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/binary.rb#35 + # pkg:gem/activemodel#lib/active_model/type/binary.rb:35 def changed_in_place?(raw_old_value, value); end - # source://activemodel//lib/active_model/type/binary.rb#30 + # pkg:gem/activemodel#lib/active_model/type/binary.rb:30 def serialize(value); end - # source://activemodel//lib/active_model/type/binary.rb#12 + # pkg:gem/activemodel#lib/active_model/type/binary.rb:12 def type; end end -# source://activemodel//lib/active_model/type/binary.rb#40 +# pkg:gem/activemodel#lib/active_model/type/binary.rb:40 class ActiveModel::Type::Binary::Data - # @return [Data] a new instance of Data - # - # source://activemodel//lib/active_model/type/binary.rb#41 + # pkg:gem/activemodel#lib/active_model/type/binary.rb:41 def initialize(value); end - # source://activemodel//lib/active_model/type/binary.rb#56 + # pkg:gem/activemodel#lib/active_model/type/binary.rb:56 def ==(other); end - # source://activemodel//lib/active_model/type/binary.rb#52 + # pkg:gem/activemodel#lib/active_model/type/binary.rb:52 def hex; end - # source://activemodel//lib/active_model/type/binary.rb#47 + # pkg:gem/activemodel#lib/active_model/type/binary.rb:47 def to_s; end - # source://activemodel//lib/active_model/type/binary.rb#47 + # pkg:gem/activemodel#lib/active_model/type/binary.rb:50 def to_str; end end @@ -4197,24 +4126,26 @@ end # - Empty strings are coerced to +nil+. # - All other values will be coerced to +true+. # -# source://activemodel//lib/active_model/type/boolean.rb#14 +# pkg:gem/activemodel#lib/active_model/type/boolean.rb:14 class ActiveModel::Type::Boolean < ::ActiveModel::Type::Value - # source://activemodel//lib/active_model/type/boolean.rb#30 + include ::ActiveModel::Type::Helpers::Immutable + + # pkg:gem/activemodel#lib/active_model/type/boolean.rb:31 def serialize(value); end - # source://activemodel//lib/active_model/type/boolean.rb#34 + # pkg:gem/activemodel#lib/active_model/type/boolean.rb:35 def serialize_cast_value(value); end - # source://activemodel//lib/active_model/type/boolean.rb#26 + # pkg:gem/activemodel#lib/active_model/type/boolean.rb:27 def type; end private - # source://activemodel//lib/active_model/type/boolean.rb#39 + # pkg:gem/activemodel#lib/active_model/type/boolean.rb:40 def cast_value(value); end end -# source://activemodel//lib/active_model/type/boolean.rb#15 +# pkg:gem/activemodel#lib/active_model/type/boolean.rb:16 ActiveModel::Type::Boolean::FALSE_VALUES = T.let(T.unsafe(nil), Set) # = Active Model \Date \Type @@ -4239,36 +4170,37 @@ ActiveModel::Type::Boolean::FALSE_VALUES = T.let(T.unsafe(nil), Set) # String values are parsed using the ISO 8601 date format. Any other values # are cast using their +to_date+ method, if it exists. # -# source://activemodel//lib/active_model/type/date.rb#26 +# pkg:gem/activemodel#lib/active_model/type/date.rb:26 class ActiveModel::Type::Date < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Immutable include ::ActiveModel::Type::Helpers::Timezone include ::ActiveModel::Type::Helpers::AcceptsMultiparameterTime::InstanceMethods - # source://activemodel//lib/active_model/type/date.rb#30 + # pkg:gem/activemodel#lib/active_model/type/date.rb:31 def type; end - # source://activemodel//lib/active_model/type/date.rb#34 + # pkg:gem/activemodel#lib/active_model/type/date.rb:35 def type_cast_for_schema(value); end private - # source://activemodel//lib/active_model/type/date.rb#39 + # pkg:gem/activemodel#lib/active_model/type/date.rb:40 def cast_value(value); end - # source://activemodel//lib/active_model/type/date.rb#57 + # pkg:gem/activemodel#lib/active_model/type/date.rb:58 def fallback_string_to_date(string); end - # source://activemodel//lib/active_model/type/date.rb#51 + # pkg:gem/activemodel#lib/active_model/type/date.rb:52 def fast_string_to_date(string); end - # source://activemodel//lib/active_model/type/date.rb#66 + # pkg:gem/activemodel#lib/active_model/type/date.rb:67 def new_date(year, mon, mday); end - # source://activemodel//lib/active_model/type/date.rb#72 + # pkg:gem/activemodel#lib/active_model/type/date.rb:73 def value_from_multiparameter_assignment(*_arg0); end end -# source://activemodel//lib/active_model/type/date.rb#50 +# pkg:gem/activemodel#lib/active_model/type/date.rb:51 ActiveModel::Type::Date::ISO_DATE = T.let(T.unsafe(nil), Regexp) # = Active Model \DateTime \Type @@ -4309,30 +4241,33 @@ ActiveModel::Type::Date::ISO_DATE = T.let(T.unsafe(nil), Regexp) # attribute :start, :datetime, precision: 4 # end # -# source://activemodel//lib/active_model/type/date_time.rb#42 +# pkg:gem/activemodel#lib/active_model/type/date_time.rb:42 class ActiveModel::Type::DateTime < ::ActiveModel::Type::Value include ::ActiveModel::Type::Helpers::Timezone include ::ActiveModel::Type::Helpers::AcceptsMultiparameterTime::InstanceMethods include ::ActiveModel::Type::Helpers::TimeValue - # source://activemodel//lib/active_model/type/date_time.rb#49 + # pkg:gem/activemodel#lib/active_model/type/date_time.rb:53 + def mutable?; end + + # pkg:gem/activemodel#lib/active_model/type/date_time.rb:49 def type; end private - # source://activemodel//lib/active_model/type/date_time.rb#54 + # pkg:gem/activemodel#lib/active_model/type/date_time.rb:62 def cast_value(value); end - # source://activemodel//lib/active_model/type/date_time.rb#67 + # pkg:gem/activemodel#lib/active_model/type/date_time.rb:75 def fallback_string_to_time(string); end # '0.123456' -> 123456 # '1.123456' -> 123456 # - # source://activemodel//lib/active_model/type/date_time.rb#63 + # pkg:gem/activemodel#lib/active_model/type/date_time.rb:71 def microseconds(time); end - # source://activemodel//lib/active_model/type/date_time.rb#79 + # pkg:gem/activemodel#lib/active_model/type/date_time.rb:87 def value_from_multiparameter_assignment(values_hash); end end @@ -4375,32 +4310,33 @@ end # attribute :weight, :decimal, precision: 24 # end # -# source://activemodel//lib/active_model/type/decimal.rb#45 +# pkg:gem/activemodel#lib/active_model/type/decimal.rb:45 class ActiveModel::Type::Decimal < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Immutable include ::ActiveModel::Type::Helpers::Numeric - # source://activemodel//lib/active_model/type/decimal.rb#49 + # pkg:gem/activemodel#lib/active_model/type/decimal.rb:50 def type; end - # source://activemodel//lib/active_model/type/decimal.rb#53 + # pkg:gem/activemodel#lib/active_model/type/decimal.rb:54 def type_cast_for_schema(value); end private - # source://activemodel//lib/active_model/type/decimal.rb#98 + # pkg:gem/activemodel#lib/active_model/type/decimal.rb:99 def apply_scale(value); end - # source://activemodel//lib/active_model/type/decimal.rb#58 + # pkg:gem/activemodel#lib/active_model/type/decimal.rb:59 def cast_value(value); end - # source://activemodel//lib/active_model/type/decimal.rb#82 + # pkg:gem/activemodel#lib/active_model/type/decimal.rb:83 def convert_float_to_big_decimal(value); end - # source://activemodel//lib/active_model/type/decimal.rb#90 + # pkg:gem/activemodel#lib/active_model/type/decimal.rb:91 def float_precision; end end -# source://activemodel//lib/active_model/type/decimal.rb#47 +# pkg:gem/activemodel#lib/active_model/type/decimal.rb:48 ActiveModel::Type::Decimal::BIGDECIMAL_PRECISION = T.let(T.unsafe(nil), Integer) # = Active Model \Float \Type @@ -4433,148 +4369,138 @@ ActiveModel::Type::Decimal::BIGDECIMAL_PRECISION = T.let(T.unsafe(nil), Integer) # - "-Infinity" is cast to -Float::INFINITY. # - "NaN" is cast to +Float::NAN+. # -# source://activemodel//lib/active_model/type/float.rb#36 +# pkg:gem/activemodel#lib/active_model/type/float.rb:36 class ActiveModel::Type::Float < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Immutable include ::ActiveModel::Type::Helpers::Numeric - # source://activemodel//lib/active_model/type/float.rb#39 + # pkg:gem/activemodel#lib/active_model/type/float.rb:40 def type; end - # source://activemodel//lib/active_model/type/float.rb#43 + # pkg:gem/activemodel#lib/active_model/type/float.rb:44 def type_cast_for_schema(value); end private - # source://activemodel//lib/active_model/type/float.rb#53 + # pkg:gem/activemodel#lib/active_model/type/float.rb:54 def cast_value(value); end end -# source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#5 +# pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:5 module ActiveModel::Type::Helpers; end -# source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#6 +# pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:6 class ActiveModel::Type::Helpers::AcceptsMultiparameterTime < ::Module - # @return [AcceptsMultiparameterTime] a new instance of AcceptsMultiparameterTime - # - # source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#37 + # pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:37 def initialize(defaults: T.unsafe(nil)); end end -# source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#7 +# pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:7 module ActiveModel::Type::Helpers::AcceptsMultiparameterTime::InstanceMethods - # source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#24 + # pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:24 def assert_valid_value(value); end - # source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#16 + # pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:16 def cast(value); end - # source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#8 + # pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:8 def serialize(value); end - # source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#12 + # pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:12 def serialize_cast_value(value); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#32 + # pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:32 def value_constructed_by_mass_assignment?(value); end end -# source://activemodel//lib/active_model/type/helpers/mutable.rb#6 +# pkg:gem/activemodel#lib/active_model/type/helpers/immutable.rb:6 +module ActiveModel::Type::Helpers::Immutable + # pkg:gem/activemodel#lib/active_model/type/helpers/immutable.rb:7 + def mutable?; end +end + +# pkg:gem/activemodel#lib/active_model/type/helpers/mutable.rb:6 module ActiveModel::Type::Helpers::Mutable - # source://activemodel//lib/active_model/type/helpers/mutable.rb#7 + # pkg:gem/activemodel#lib/active_model/type/helpers/mutable.rb:7 def cast(value); end # +raw_old_value+ will be the `_before_type_cast` version of the # value (likely a string). +new_value+ will be the current, type # cast value. # - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/helpers/mutable.rb#14 + # pkg:gem/activemodel#lib/active_model/type/helpers/mutable.rb:14 def changed_in_place?(raw_old_value, new_value); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/helpers/mutable.rb#18 + # pkg:gem/activemodel#lib/active_model/type/helpers/mutable.rb:18 def mutable?; end end -# source://activemodel//lib/active_model/type/helpers/numeric.rb#6 +# pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:6 module ActiveModel::Type::Helpers::Numeric - # source://activemodel//lib/active_model/type/helpers/numeric.rb#15 + # pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:15 def cast(value); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/helpers/numeric.rb#31 + # pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:31 def changed?(old_value, _new_value, new_value_before_type_cast); end - # source://activemodel//lib/active_model/type/helpers/numeric.rb#7 + # pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:7 def serialize(value); end - # source://activemodel//lib/active_model/type/helpers/numeric.rb#11 + # pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:11 def serialize_cast_value(value); end private - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/helpers/numeric.rb#37 + # pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:37 def equal_nan?(old_value, new_value); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/helpers/numeric.rb#49 + # pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:49 def non_numeric_string?(value); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/helpers/numeric.rb#44 + # pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:44 def number_to_non_number?(old_value, new_value_before_type_cast); end end -# source://activemodel//lib/active_model/type/helpers/numeric.rb#56 +# pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:56 ActiveModel::Type::Helpers::Numeric::NUMERIC_REGEX = T.let(T.unsafe(nil), Regexp) -# source://activemodel//lib/active_model/type/helpers/time_value.rb#9 +# pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:9 module ActiveModel::Type::Helpers::TimeValue - # source://activemodel//lib/active_model/type/helpers/time_value.rb#24 + # pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:24 def apply_seconds_precision(value); end - # source://activemodel//lib/active_model/type/helpers/time_value.rb#10 + # pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:10 def serialize_cast_value(value); end - # source://activemodel//lib/active_model/type/helpers/time_value.rb#38 + # pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:38 def type_cast_for_schema(value); end - # source://activemodel//lib/active_model/type/helpers/time_value.rb#42 + # pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:42 def user_input_in_time_zone(value); end private + # Early 3.2.x had a bug # BUG: Wrapping the Time object with Time.at because Time.new with `in:` in Ruby 3.2.0 # used to return an invalid Time object # see: https://bugs.ruby-lang.org/issues/19292 # - # source://activemodel//lib/active_model/type/helpers/time_value.rb#88 + # pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:88 def fast_string_to_time(string); end - # source://activemodel//lib/active_model/type/helpers/time_value.rb#47 + # pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:47 def new_time(year, mon, mday, hour, min, sec, microsec, offset = T.unsafe(nil)); end end -# source://activemodel//lib/active_model/type/helpers/time_value.rb#64 +# pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:64 ActiveModel::Type::Helpers::TimeValue::ISO_DATETIME = T.let(T.unsafe(nil), Regexp) -# source://activemodel//lib/active_model/type/helpers/timezone.rb#8 +# pkg:gem/activemodel#lib/active_model/type/helpers/timezone.rb:8 module ActiveModel::Type::Helpers::Timezone - # source://activemodel//lib/active_model/type/helpers/timezone.rb#17 + # pkg:gem/activemodel#lib/active_model/type/helpers/timezone.rb:17 def default_timezone; end - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/helpers/timezone.rb#9 + # pkg:gem/activemodel#lib/active_model/type/helpers/timezone.rb:9 def is_utc?; end end @@ -4611,25 +4537,25 @@ end # # person.active # => "aye" # -# source://activemodel//lib/active_model/type/immutable_string.rb#37 +# pkg:gem/activemodel#lib/active_model/type/immutable_string.rb:37 class ActiveModel::Type::ImmutableString < ::ActiveModel::Type::Value - # @return [ImmutableString] a new instance of ImmutableString - # - # source://activemodel//lib/active_model/type/immutable_string.rb#38 + include ::ActiveModel::Type::Helpers::Immutable + + # pkg:gem/activemodel#lib/active_model/type/immutable_string.rb:40 def initialize(**args); end - # source://activemodel//lib/active_model/type/immutable_string.rb#48 + # pkg:gem/activemodel#lib/active_model/type/immutable_string.rb:50 def serialize(value); end - # source://activemodel//lib/active_model/type/immutable_string.rb#57 + # pkg:gem/activemodel#lib/active_model/type/immutable_string.rb:59 def serialize_cast_value(value); end - # source://activemodel//lib/active_model/type/immutable_string.rb#44 + # pkg:gem/activemodel#lib/active_model/type/immutable_string.rb:46 def type; end private - # source://activemodel//lib/active_model/type/immutable_string.rb#62 + # pkg:gem/activemodel#lib/active_model/type/immutable_string.rb:64 def cast_value(value); end end @@ -4673,125 +4599,104 @@ end # attribute :age, :integer, limit: 6 # end # -# source://activemodel//lib/active_model/type/integer.rb#44 +# pkg:gem/activemodel#lib/active_model/type/integer.rb:44 class ActiveModel::Type::Integer < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Immutable include ::ActiveModel::Type::Helpers::Numeric - # @return [Integer] a new instance of Integer - # - # source://activemodel//lib/active_model/type/integer.rb#51 + # pkg:gem/activemodel#lib/active_model/type/integer.rb:52 def initialize(**_arg0); end - # source://activemodel//lib/active_model/type/integer.rb#60 + # pkg:gem/activemodel#lib/active_model/type/integer.rb:62 def deserialize(value); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/integer.rb#74 + # pkg:gem/activemodel#lib/active_model/type/integer.rb:96 def serializable?(value); end - # source://activemodel//lib/active_model/type/integer.rb#65 + # pkg:gem/activemodel#lib/active_model/type/integer.rb:67 def serialize(value); end - # source://activemodel//lib/active_model/type/integer.rb#70 + # pkg:gem/activemodel#lib/active_model/type/integer.rb:88 def serialize_cast_value(value); end - # source://activemodel//lib/active_model/type/integer.rb#56 + # pkg:gem/activemodel#lib/active_model/type/integer.rb:58 def type; end private - # source://activemodel//lib/active_model/type/integer.rb#108 + # pkg:gem/activemodel#lib/active_model/type/integer.rb:124 def _limit; end - # source://activemodel//lib/active_model/type/integer.rb#89 + # pkg:gem/activemodel#lib/active_model/type/integer.rb:112 def cast_value(value); end - # source://activemodel//lib/active_model/type/integer.rb#93 - def ensure_in_range(value); end - - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/integer.rb#85 - def in_range?(value); end - - # source://activemodel//lib/active_model/type/integer.rb#100 + # pkg:gem/activemodel#lib/active_model/type/integer.rb:116 def max_value; end - # source://activemodel//lib/active_model/type/integer.rb#104 + # pkg:gem/activemodel#lib/active_model/type/integer.rb:120 def min_value; end - # Returns the value of attribute range. - # - # source://activemodel//lib/active_model/type/integer.rb#83 - def range; end + # pkg:gem/activemodel#lib/active_model/type/integer.rb:104 + def out_of_range?(value); end end # Column storage size in bytes. # 4 bytes means an integer as opposed to smallint etc. # -# source://activemodel//lib/active_model/type/integer.rb#49 +# pkg:gem/activemodel#lib/active_model/type/integer.rb:50 ActiveModel::Type::Integer::DEFAULT_LIMIT = T.let(T.unsafe(nil), Integer) -# source://activemodel//lib/active_model/type/registry.rb#5 +# pkg:gem/activemodel#lib/active_model/type/registry.rb:5 class ActiveModel::Type::Registry - # @return [Registry] a new instance of Registry - # - # source://activemodel//lib/active_model/type/registry.rb#6 + # pkg:gem/activemodel#lib/active_model/type/registry.rb:6 def initialize; end - # source://activemodel//lib/active_model/type/registry.rb#23 + # pkg:gem/activemodel#lib/active_model/type/registry.rb:23 def lookup(symbol, *_arg1, **_arg2, &_arg3); end - # source://activemodel//lib/active_model/type/registry.rb#15 + # pkg:gem/activemodel#lib/active_model/type/registry.rb:15 def register(type_name, klass = T.unsafe(nil), &block); end private - # source://activemodel//lib/active_model/type/registry.rb#10 + # pkg:gem/activemodel#lib/active_model/type/registry.rb:10 def initialize_copy(other); end - # Returns the value of attribute registrations. - # - # source://activemodel//lib/active_model/type/registry.rb#34 + # pkg:gem/activemodel#lib/active_model/type/registry.rb:34 def registrations; end end -# source://activemodel//lib/active_model/type/serialize_cast_value.rb#5 +# pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:5 module ActiveModel::Type::SerializeCastValue extend ::ActiveSupport::Concern include ::ActiveModel::Type::SerializeCastValue::DefaultImplementation mixes_in_class_methods ::ActiveModel::Type::SerializeCastValue::ClassMethods - # source://activemodel//lib/active_model/type/serialize_cast_value.rb#41 + # pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:41 def initialize(*_arg0, **_arg1, &_arg2); end - # source://activemodel//lib/active_model/type/serialize_cast_value.rb#37 + # pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:37 def itself_if_serialize_cast_value_compatible; end class << self - # @private - # - # source://activemodel//lib/active_model/type/serialize_cast_value.rb#21 + # pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:21 def included(klass); end - # source://activemodel//lib/active_model/type/serialize_cast_value.rb#25 + # pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:25 def serialize(type, value); end end end -# source://activemodel//lib/active_model/type/serialize_cast_value.rb#8 +# pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:8 module ActiveModel::Type::SerializeCastValue::ClassMethods - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/serialize_cast_value.rb#9 + # pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:9 def serialize_cast_value_compatible?; end end -# source://activemodel//lib/active_model/type/serialize_cast_value.rb#15 +# pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:15 module ActiveModel::Type::SerializeCastValue::DefaultImplementation - # source://activemodel//lib/active_model/type/serialize_cast_value.rb#16 + # pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:16 def serialize_cast_value(value); end end @@ -4804,19 +4709,20 @@ end # However, it accounts for mutable strings, so dirty tracking can properly # check if a string has changed. # -# source://activemodel//lib/active_model/type/string.rb#15 +# pkg:gem/activemodel#lib/active_model/type/string.rb:15 class ActiveModel::Type::String < ::ActiveModel::Type::ImmutableString - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/string.rb#16 + # pkg:gem/activemodel#lib/active_model/type/string.rb:16 def changed_in_place?(raw_old_value, new_value); end - # source://activemodel//lib/active_model/type/string.rb#22 + # pkg:gem/activemodel#lib/active_model/type/string.rb:22 + def mutable?; end + + # pkg:gem/activemodel#lib/active_model/type/string.rb:26 def to_immutable_string; end private - # source://activemodel//lib/active_model/type/string.rb#33 + # pkg:gem/activemodel#lib/active_model/type/string.rb:37 def cast_value(value); end end @@ -4854,21 +4760,21 @@ end # attribute :start, :time, precision: 4 # end # -# source://activemodel//lib/active_model/type/time.rb#38 +# pkg:gem/activemodel#lib/active_model/type/time.rb:38 class ActiveModel::Type::Time < ::ActiveModel::Type::Value include ::ActiveModel::Type::Helpers::Timezone include ::ActiveModel::Type::Helpers::AcceptsMultiparameterTime::InstanceMethods include ::ActiveModel::Type::Helpers::TimeValue - # source://activemodel//lib/active_model/type/time.rb#45 + # pkg:gem/activemodel#lib/active_model/type/time.rb:45 def type; end - # source://activemodel//lib/active_model/type/time.rb#49 + # pkg:gem/activemodel#lib/active_model/type/time.rb:49 def user_input_in_time_zone(value); end private - # source://activemodel//lib/active_model/type/time.rb#69 + # pkg:gem/activemodel#lib/active_model/type/time.rb:69 def cast_value(value); end end @@ -4877,7 +4783,7 @@ end # The base class for all attribute types. This class also serves as the # default type for attributes that do not specify a type. # -# source://activemodel//lib/active_model/type/value.rb#9 +# pkg:gem/activemodel#lib/active_model/type/value.rb:9 class ActiveModel::Type::Value include ::ActiveModel::Type::SerializeCastValue include ::ActiveModel::Type::SerializeCastValue::DefaultImplementation @@ -4888,28 +4794,22 @@ class ActiveModel::Type::Value # these settings. It uses them for equality comparison and hash key # generation only. # - # @return [Value] a new instance of Value - # - # source://activemodel//lib/active_model/type/value.rb#17 + # pkg:gem/activemodel#lib/active_model/type/value.rb:17 def initialize(precision: T.unsafe(nil), limit: T.unsafe(nil), scale: T.unsafe(nil)); end - # source://activemodel//lib/active_model/type/value.rb#121 + # pkg:gem/activemodel#lib/active_model/type/value.rb:121 def ==(other); end - # @raise [NoMethodError] - # - # source://activemodel//lib/active_model/type/value.rb#144 + # pkg:gem/activemodel#lib/active_model/type/value.rb:144 def as_json(*_arg0); end - # source://activemodel//lib/active_model/type/value.rb#133 + # pkg:gem/activemodel#lib/active_model/type/value.rb:133 def assert_valid_value(_); end # These predicates are not documented, as I need to look further into # their use, and see if they can be removed entirely. # - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/value.rb#77 + # pkg:gem/activemodel#lib/active_model/type/value.rb:77 def binary?; end # Type casts a value from user input (e.g. from a setter). This value may @@ -4923,16 +4823,14 @@ class ActiveModel::Type::Value # # +value+ The raw input, as provided to the attribute setter. # - # source://activemodel//lib/active_model/type/value.rb#57 + # pkg:gem/activemodel#lib/active_model/type/value.rb:57 def cast(value); end # Determines whether a value has changed for dirty checking. +old_value+ # and +new_value+ will always be type-cast. Types should not need to # override this method. # - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/value.rb#84 + # pkg:gem/activemodel#lib/active_model/type/value.rb:84 def changed?(old_value, new_value, _new_value_before_type_cast); end # Determines whether the mutable value has been modified since it was @@ -4953,9 +4851,7 @@ class ActiveModel::Type::Value # # +new_value+ The current value, after type casting. # - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/value.rb#105 + # pkg:gem/activemodel#lib/active_model/type/value.rb:105 def changed_in_place?(raw_old_value, new_value); end # Converts a value from database input to the appropriate ruby type. The @@ -4965,41 +4861,31 @@ class ActiveModel::Type::Value # # +value+ The raw input, as provided from the database. # - # source://activemodel//lib/active_model/type/value.rb#43 + # pkg:gem/activemodel#lib/active_model/type/value.rb:43 def deserialize(value); end - # source://activemodel//lib/active_model/type/value.rb#121 + # pkg:gem/activemodel#lib/active_model/type/value.rb:127 def eql?(other); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/value.rb#113 + # pkg:gem/activemodel#lib/active_model/type/value.rb:113 def force_equality?(_value); end - # source://activemodel//lib/active_model/type/value.rb#129 + # pkg:gem/activemodel#lib/active_model/type/value.rb:129 def hash; end - # Returns the value of attribute limit. - # - # source://activemodel//lib/active_model/type/value.rb#11 + # pkg:gem/activemodel#lib/active_model/type/value.rb:11 def limit; end - # source://activemodel//lib/active_model/type/value.rb#117 + # pkg:gem/activemodel#lib/active_model/type/value.rb:117 def map(value, &_arg1); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/value.rb#140 + # pkg:gem/activemodel#lib/active_model/type/value.rb:140 def mutable?; end - # Returns the value of attribute precision. - # - # source://activemodel//lib/active_model/type/value.rb#11 + # pkg:gem/activemodel#lib/active_model/type/value.rb:11 def precision; end - # Returns the value of attribute scale. - # - # source://activemodel//lib/active_model/type/value.rb#11 + # pkg:gem/activemodel#lib/active_model/type/value.rb:11 def scale; end # Returns true if this type can convert +value+ to a type that is usable @@ -5007,39 +4893,33 @@ class ActiveModel::Type::Value # value parameter is a Ruby boolean, but may return +false+ if the value # parameter is some other object. # - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/value.rb#28 - def serializable?(value, &_); end + # pkg:gem/activemodel#lib/active_model/type/value.rb:28 + def serializable?(value, &_arg1); end # Casts a value from the ruby type to a type that the database knows how # to understand. The returned value from this method should be a # +String+, +Numeric+, +Date+, +Time+, +Symbol+, +true+, +false+, or # +nil+. # - # source://activemodel//lib/active_model/type/value.rb#65 + # pkg:gem/activemodel#lib/active_model/type/value.rb:65 def serialize(value); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/value.rb#136 + # pkg:gem/activemodel#lib/active_model/type/value.rb:136 def serialized?; end # Returns the unique type name as a Symbol. Subclasses should override # this method. # - # source://activemodel//lib/active_model/type/value.rb#34 + # pkg:gem/activemodel#lib/active_model/type/value.rb:34 def type; end # Type casts a value for schema dumping. This method is private, as we are # hoping to remove it entirely. # - # source://activemodel//lib/active_model/type/value.rb#71 + # pkg:gem/activemodel#lib/active_model/type/value.rb:71 def type_cast_for_schema(value); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/type/value.rb#109 + # pkg:gem/activemodel#lib/active_model/type/value.rb:109 def value_constructed_by_mass_assignment?(_value); end private @@ -5048,7 +4928,7 @@ class ActiveModel::Type::Value # behavior for user and database inputs. Called by Value#cast for # values except +nil+. # - # source://activemodel//lib/active_model/type/value.rb#152 + # pkg:gem/activemodel#lib/active_model/type/value.rb:152 def cast_value(value); end end @@ -5065,54 +4945,42 @@ end # person.assign_attributes(name: 'Gorby') # # => ActiveModel::UnknownAttributeError: unknown attribute 'name' for Person. # -# source://activemodel//lib/active_model/errors.rb#538 +# pkg:gem/activemodel#lib/active_model/errors.rb:535 class ActiveModel::UnknownAttributeError < ::NoMethodError - # @return [UnknownAttributeError] a new instance of UnknownAttributeError - # - # source://activemodel//lib/active_model/errors.rb#541 + # pkg:gem/activemodel#lib/active_model/errors.rb:538 def initialize(record, attribute); end - # Returns the value of attribute attribute. - # - # source://activemodel//lib/active_model/errors.rb#539 + # pkg:gem/activemodel#lib/active_model/errors.rb:536 def attribute; end - # Returns the value of attribute record. - # - # source://activemodel//lib/active_model/errors.rb#539 + # pkg:gem/activemodel#lib/active_model/errors.rb:536 def record; end end -# source://activemodel//lib/active_model/gem_version.rb#9 +# pkg:gem/activemodel#lib/active_model/gem_version.rb:9 module ActiveModel::VERSION; end -# source://activemodel//lib/active_model/gem_version.rb#10 +# pkg:gem/activemodel#lib/active_model/gem_version.rb:10 ActiveModel::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) -# source://activemodel//lib/active_model/gem_version.rb#11 +# pkg:gem/activemodel#lib/active_model/gem_version.rb:11 ActiveModel::VERSION::MINOR = T.let(T.unsafe(nil), Integer) -# source://activemodel//lib/active_model/gem_version.rb#13 +# pkg:gem/activemodel#lib/active_model/gem_version.rb:13 ActiveModel::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) -# source://activemodel//lib/active_model/gem_version.rb#15 +# pkg:gem/activemodel#lib/active_model/gem_version.rb:15 ActiveModel::VERSION::STRING = T.let(T.unsafe(nil), String) -# source://activemodel//lib/active_model/gem_version.rb#12 +# pkg:gem/activemodel#lib/active_model/gem_version.rb:12 ActiveModel::VERSION::TINY = T.let(T.unsafe(nil), Integer) -# source://activemodel//lib/active_model/validations.rb#505 +# pkg:gem/activemodel#lib/active_model/validations.rb:491 class ActiveModel::ValidationContext - # Returns the value of attribute context. - # - # source://activemodel//lib/active_model/validations.rb#506 + # pkg:gem/activemodel#lib/active_model/validations.rb:492 def context; end - # Sets the attribute context - # - # @param value the value to set the attribute context to. - # - # source://activemodel//lib/active_model/validations.rb#506 + # pkg:gem/activemodel#lib/active_model/validations.rb:492 def context=(_arg0); end end @@ -5127,16 +4995,12 @@ end # puts invalid.model.errors # end # -# source://activemodel//lib/active_model/validations.rb#495 +# pkg:gem/activemodel#lib/active_model/validations.rb:481 class ActiveModel::ValidationError < ::StandardError - # @return [ValidationError] a new instance of ValidationError - # - # source://activemodel//lib/active_model/validations.rb#498 + # pkg:gem/activemodel#lib/active_model/validations.rb:484 def initialize(model); end - # Returns the value of attribute model. - # - # source://activemodel//lib/active_model/validations.rb#496 + # pkg:gem/activemodel#lib/active_model/validations.rb:482 def model; end end @@ -5172,7 +5036,7 @@ end # method to your instances initialized with a new ActiveModel::Errors # object, so there is no need for you to do this manually. # -# source://activemodel//lib/active_model/validations.rb#37 +# pkg:gem/activemodel#lib/active_model/validations.rb:37 module ActiveModel::Validations extend ::ActiveSupport::Concern include GeneratedInstanceMethods @@ -5201,10 +5065,10 @@ module ActiveModel::Validations # person.valid? # => false # person.errors # => # # - # source://activemodel//lib/active_model/validations.rb#330 + # pkg:gem/activemodel#lib/active_model/validations.rb:330 def errors; end - # source://activemodel//lib/active_model/validations.rb#374 + # pkg:gem/activemodel#lib/active_model/validations.rb:374 def freeze; end # Performs the opposite of valid?. Returns +true+ if errors were @@ -5237,9 +5101,7 @@ module ActiveModel::Validations # person.invalid? # => false # person.invalid?(:new) # => true # - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations.rb#410 + # pkg:gem/activemodel#lib/active_model/validations.rb:410 def invalid?(context = T.unsafe(nil)); end # Hook method defining how an attribute value should be retrieved. By default @@ -5258,6 +5120,8 @@ module ActiveModel::Validations # @data[key] # end # end + # + # pkg:gem/activemodel#lib/active_model/validations.rb:439 def read_attribute_for_validation(*_arg0); end # Runs all the specified validations and returns +true+ if no errors were @@ -5290,44 +5154,10 @@ module ActiveModel::Validations # person.valid? # => true # person.valid?(:new) # => false # - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations.rb#363 + # pkg:gem/activemodel#lib/active_model/validations.rb:363 def valid?(context = T.unsafe(nil)); end - # Runs all the specified validations and returns +true+ if no errors were - # added otherwise +false+. - # - # class Person - # include ActiveModel::Validations - # - # attr_accessor :name - # validates_presence_of :name - # end - # - # person = Person.new - # person.name = '' - # person.valid? # => false - # person.name = 'david' - # person.valid? # => true - # - # Context can optionally be supplied to define which callbacks to test - # against (the context is defined on the validations using :on). - # - # class Person - # include ActiveModel::Validations - # - # attr_accessor :name - # validates_presence_of :name, on: :new - # end - # - # person = Person.new - # person.valid? # => true - # person.valid?(:new) # => false - # - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations.rb#363 + # pkg:gem/activemodel#lib/active_model/validations.rb:372 def validate(context = T.unsafe(nil)); end # Runs all the validations within the specified context. Returns +true+ if @@ -5336,7 +5166,7 @@ module ActiveModel::Validations # Validations with no :on option will run no matter the context. Validations with # some :on option will only run in the specified context. # - # source://activemodel//lib/active_model/validations.rb#419 + # pkg:gem/activemodel#lib/active_model/validations.rb:419 def validate!(context = T.unsafe(nil)); end # Passes the record off to the class or classes specified and allows them @@ -5376,50 +5206,34 @@ module ActiveModel::Validations # to the class and available as +options+, please refer to the # class version of this method for more information. # - # source://activemodel//lib/active_model/validations/with.rb#144 + # pkg:gem/activemodel#lib/active_model/validations/with.rb:144 def validates_with(*args, &block); end # Returns the context when running validations. # - # This is useful when running validations except a certain context (opposite to the +on+ option). - # - # class Person - # include ActiveModel::Validations - # - # attr_accessor :name - # validates :name, presence: true, if: -> { validation_context != :custom } - # end - # - # person = Person.new - # person.valid? #=> false - # person.valid?(:new) #=> false - # person.valid?(:custom) #=> true - # - # source://activemodel//lib/active_model/validations.rb#456 + # pkg:gem/activemodel#lib/active_model/validations.rb:442 def validation_context; end private - # source://activemodel//lib/active_model/validations.rb#465 + # pkg:gem/activemodel#lib/active_model/validations.rb:451 def context_for_validation; end - # source://activemodel//lib/active_model/validations.rb#469 + # pkg:gem/activemodel#lib/active_model/validations.rb:455 def init_internals; end # Clean the +Errors+ object if instance is duped. # - # source://activemodel//lib/active_model/validations.rb#312 + # pkg:gem/activemodel#lib/active_model/validations.rb:312 def initialize_dup(other); end - # @raise [ValidationError] - # - # source://activemodel//lib/active_model/validations.rb#480 + # pkg:gem/activemodel#lib/active_model/validations.rb:466 def raise_validation_error; end - # source://activemodel//lib/active_model/validations.rb#475 + # pkg:gem/activemodel#lib/active_model/validations.rb:461 def run_validations!; end - # source://activemodel//lib/active_model/validations.rb#461 + # pkg:gem/activemodel#lib/active_model/validations.rb:447 def validation_context=(context); end module GeneratedClassMethods @@ -5439,59 +5253,49 @@ end # == \Active \Model Absence Validator # -# source://activemodel//lib/active_model/validations/absence.rb#6 +# pkg:gem/activemodel#lib/active_model/validations/absence.rb:6 class ActiveModel::Validations::AbsenceValidator < ::ActiveModel::EachValidator - # source://activemodel//lib/active_model/validations/absence.rb#7 + # pkg:gem/activemodel#lib/active_model/validations/absence.rb:7 def validate_each(record, attr_name, value); end end -# source://activemodel//lib/active_model/validations/acceptance.rb#5 +# pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:5 class ActiveModel::Validations::AcceptanceValidator < ::ActiveModel::EachValidator - # @return [AcceptanceValidator] a new instance of AcceptanceValidator - # - # source://activemodel//lib/active_model/validations/acceptance.rb#6 + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:6 def initialize(options); end - # source://activemodel//lib/active_model/validations/acceptance.rb#11 + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:11 def validate_each(record, attribute, value); end private - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations/acceptance.rb#23 + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:23 def acceptable_option?(value); end - # source://activemodel//lib/active_model/validations/acceptance.rb#18 + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:18 def setup!(klass); end end -# source://activemodel//lib/active_model/validations/acceptance.rb#27 +# pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:27 class ActiveModel::Validations::AcceptanceValidator::LazilyDefineAttributes < ::Module - # @return [LazilyDefineAttributes] a new instance of LazilyDefineAttributes - # - # source://activemodel//lib/active_model/validations/acceptance.rb#28 + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:28 def initialize(attributes); end - # source://activemodel//lib/active_model/validations/acceptance.rb#73 + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:73 def ==(other); end - # source://activemodel//lib/active_model/validations/acceptance.rb#56 + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:56 def define_on(klass); end - # source://activemodel//lib/active_model/validations/acceptance.rb#32 + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:32 def included(klass); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations/acceptance.rb#51 + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:51 def matches?(method_name); end protected - # Returns the value of attribute attributes. - # - # source://activemodel//lib/active_model/validations/acceptance.rb#78 + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:78 def attributes; end end @@ -5513,7 +5317,7 @@ end # Like other before_* callbacks if +before_validation+ throws # +:abort+ then valid? will not be called. # -# source://activemodel//lib/active_model/validations/callbacks.rb#22 +# pkg:gem/activemodel#lib/active_model/validations/callbacks.rb:22 module ActiveModel::Validations::Callbacks extend ::ActiveSupport::Concern include GeneratedInstanceMethods @@ -5528,7 +5332,7 @@ module ActiveModel::Validations::Callbacks # Override run_validations! to include callbacks. # - # source://activemodel//lib/active_model/validations/callbacks.rb#114 + # pkg:gem/activemodel#lib/active_model/validations/callbacks.rb:124 def run_validations!; end module GeneratedClassMethods @@ -5541,7 +5345,7 @@ module ActiveModel::Validations::Callbacks end end -# source://activemodel//lib/active_model/validations/callbacks.rb#32 +# pkg:gem/activemodel#lib/active_model/validations/callbacks.rb:32 module ActiveModel::Validations::Callbacks::ClassMethods # Defines a callback that will get called right after validation. # @@ -5569,7 +5373,7 @@ module ActiveModel::Validations::Callbacks::ClassMethods # person.valid? # => true # person.status # => true # - # source://activemodel//lib/active_model/validations/callbacks.rb#88 + # pkg:gem/activemodel#lib/active_model/validations/callbacks.rb:88 def after_validation(*args, &block); end # Defines a callback that will get called right before validation. @@ -5595,16 +5399,16 @@ module ActiveModel::Validations::Callbacks::ClassMethods # person.valid? # => true # person.name # => "bob" # - # source://activemodel//lib/active_model/validations/callbacks.rb#55 + # pkg:gem/activemodel#lib/active_model/validations/callbacks.rb:55 def before_validation(*args, &block); end private - # source://activemodel//lib/active_model/validations/callbacks.rb#99 + # pkg:gem/activemodel#lib/active_model/validations/callbacks.rb:99 def set_options_for_callback(options); end end -# source://activemodel//lib/active_model/validations.rb#53 +# pkg:gem/activemodel#lib/active_model/validations.rb:53 module ActiveModel::Validations::ClassMethods # Returns +true+ if +attribute+ is an attribute method, +false+ otherwise. # @@ -5617,9 +5421,7 @@ module ActiveModel::Validations::ClassMethods # User.attribute_method?(:name) # => true # User.attribute_method?(:age) # => false # - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations.rb#284 + # pkg:gem/activemodel#lib/active_model/validations.rb:284 def attribute_method?(attribute); end # Clears all of the validators and validations. @@ -5660,12 +5462,12 @@ module ActiveModel::Validations::ClassMethods # # Person._validate_callbacks.empty? # => true # - # source://activemodel//lib/active_model/validations.rb#248 + # pkg:gem/activemodel#lib/active_model/validations.rb:248 def clear_validators!; end # Copy validators on inheritance. # - # source://activemodel//lib/active_model/validations.rb#289 + # pkg:gem/activemodel#lib/active_model/validations.rb:289 def inherited(base); end # Adds a validation method or block to the class. This is useful when @@ -5735,7 +5537,7 @@ module ActiveModel::Validations::ClassMethods # # NOTE: Calling +validate+ multiple times on the same method will overwrite previous definitions. # - # source://activemodel//lib/active_model/validations.rb#162 + # pkg:gem/activemodel#lib/active_model/validations.rb:162 def validate(*args, &block); end # This method is a shortcut to all default validators and any custom @@ -5842,9 +5644,7 @@ module ActiveModel::Validations::ClassMethods # # validates :password, presence: { if: :password_required?, message: 'is forgotten.' }, confirmation: true # - # @raise [ArgumentError] - # - # source://activemodel//lib/active_model/validations/validates.rb#111 + # pkg:gem/activemodel#lib/active_model/validations/validates.rb:111 def validates(*attributes); end # This method is used to define validations that cannot be corrected by end @@ -5866,7 +5666,7 @@ module ActiveModel::Validations::ClassMethods # person.valid? # # => ActiveModel::StrictValidationFailed: Name can't be blank # - # source://activemodel//lib/active_model/validations/validates.rb#153 + # pkg:gem/activemodel#lib/active_model/validations/validates.rb:153 def validates!(*attributes); end # Validates each attribute against a block. @@ -5905,7 +5705,7 @@ module ActiveModel::Validations::ClassMethods # method, proc, or string should return or evaluate to a +true+ or +false+ # value. # - # source://activemodel//lib/active_model/validations.rb#89 + # pkg:gem/activemodel#lib/active_model/validations.rb:89 def validates_each(*attr_names, &block); end # Passes the record off to the class or classes specified and allows them @@ -5977,7 +5777,7 @@ module ActiveModel::Validations::ClassMethods # end # end # - # source://activemodel//lib/active_model/validations/with.rb#88 + # pkg:gem/activemodel#lib/active_model/validations/with.rb:88 def validates_with(*args, &block); end # List all validators that are being used to validate the model using @@ -5998,7 +5798,7 @@ module ActiveModel::Validations::ClassMethods # # # # # ] # - # source://activemodel//lib/active_model/validations.rb#206 + # pkg:gem/activemodel#lib/active_model/validations.rb:206 def validators; end # List all validators that are being used to validate a specific attribute. @@ -6017,42 +5817,40 @@ module ActiveModel::Validations::ClassMethods # # #, # # ] # - # source://activemodel//lib/active_model/validations.rb#268 + # pkg:gem/activemodel#lib/active_model/validations.rb:268 def validators_on(*attributes); end private - # source://activemodel//lib/active_model/validations/validates.rb#166 + # pkg:gem/activemodel#lib/active_model/validations/validates.rb:166 def _parse_validates_options(options); end # When creating custom validators, it might be useful to be able to specify # additional default keys. This can be done by overwriting this method. # - # source://activemodel//lib/active_model/validations/validates.rb#162 + # pkg:gem/activemodel#lib/active_model/validations/validates.rb:162 def _validates_default_keys; end - # source://activemodel//lib/active_model/validations.rb#298 + # pkg:gem/activemodel#lib/active_model/validations.rb:298 def predicate_for_validation_context(context); end end -# source://activemodel//lib/active_model/validations.rb#93 +# pkg:gem/activemodel#lib/active_model/validations.rb:93 ActiveModel::Validations::ClassMethods::VALID_OPTIONS_FOR_VALIDATE = T.let(T.unsafe(nil), Array) -# source://activemodel//lib/active_model/validations/clusivity.rb#8 +# pkg:gem/activemodel#lib/active_model/validations/clusivity.rb:8 module ActiveModel::Validations::Clusivity include ::ActiveModel::Validations::ResolveValue - # source://activemodel//lib/active_model/validations/clusivity.rb#14 + # pkg:gem/activemodel#lib/active_model/validations/clusivity.rb:14 def check_validity!; end private - # source://activemodel//lib/active_model/validations/clusivity.rb#31 + # pkg:gem/activemodel#lib/active_model/validations/clusivity.rb:31 def delimiter; end - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations/clusivity.rb#21 + # pkg:gem/activemodel#lib/active_model/validations/clusivity.rb:21 def include?(record, value); end # After Ruby 2.2, Range#include? on non-number-or-time-ish ranges checks all @@ -6061,89 +5859,83 @@ module ActiveModel::Validations::Clusivity # endpoints, which is fast but is only accurate on Numeric, Time, Date, # or DateTime ranges. # - # source://activemodel//lib/active_model/validations/clusivity.rb#40 + # pkg:gem/activemodel#lib/active_model/validations/clusivity.rb:40 def inclusion_method(enumerable); end end -# source://activemodel//lib/active_model/validations/clusivity.rb#11 +# pkg:gem/activemodel#lib/active_model/validations/clusivity.rb:11 ActiveModel::Validations::Clusivity::ERROR_MESSAGE = T.let(T.unsafe(nil), String) -# source://activemodel//lib/active_model/validations/comparability.rb#5 +# pkg:gem/activemodel#lib/active_model/validations/comparability.rb:5 module ActiveModel::Validations::Comparability - # source://activemodel//lib/active_model/validations/comparability.rb#10 + # pkg:gem/activemodel#lib/active_model/validations/comparability.rb:10 def error_options(value, option_value); end end -# source://activemodel//lib/active_model/validations/comparability.rb#6 +# pkg:gem/activemodel#lib/active_model/validations/comparability.rb:6 ActiveModel::Validations::Comparability::COMPARE_CHECKS = T.let(T.unsafe(nil), Hash) -# source://activemodel//lib/active_model/validations/comparison.rb#8 +# pkg:gem/activemodel#lib/active_model/validations/comparison.rb:8 class ActiveModel::Validations::ComparisonValidator < ::ActiveModel::EachValidator include ::ActiveModel::Validations::Comparability include ::ActiveModel::Validations::ResolveValue - # source://activemodel//lib/active_model/validations/comparison.rb#12 + # pkg:gem/activemodel#lib/active_model/validations/comparison.rb:12 def check_validity!; end - # source://activemodel//lib/active_model/validations/comparison.rb#19 + # pkg:gem/activemodel#lib/active_model/validations/comparison.rb:19 def validate_each(record, attr_name, value); end end -# source://activemodel//lib/active_model/validations/confirmation.rb#5 +# pkg:gem/activemodel#lib/active_model/validations/confirmation.rb:5 class ActiveModel::Validations::ConfirmationValidator < ::ActiveModel::EachValidator - # @return [ConfirmationValidator] a new instance of ConfirmationValidator - # - # source://activemodel//lib/active_model/validations/confirmation.rb#6 + # pkg:gem/activemodel#lib/active_model/validations/confirmation.rb:6 def initialize(options); end - # source://activemodel//lib/active_model/validations/confirmation.rb#11 + # pkg:gem/activemodel#lib/active_model/validations/confirmation.rb:11 def validate_each(record, attribute, value); end private - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations/confirmation.rb#31 + # pkg:gem/activemodel#lib/active_model/validations/confirmation.rb:31 def confirmation_value_equal?(record, attribute, value, confirmed); end - # source://activemodel//lib/active_model/validations/confirmation.rb#21 + # pkg:gem/activemodel#lib/active_model/validations/confirmation.rb:21 def setup!(klass); end end -# source://activemodel//lib/active_model/validations/exclusion.rb#7 +# pkg:gem/activemodel#lib/active_model/validations/exclusion.rb:7 class ActiveModel::Validations::ExclusionValidator < ::ActiveModel::EachValidator include ::ActiveModel::Validations::ResolveValue include ::ActiveModel::Validations::Clusivity - # source://activemodel//lib/active_model/validations/exclusion.rb#10 + # pkg:gem/activemodel#lib/active_model/validations/exclusion.rb:10 def validate_each(record, attribute, value); end end -# source://activemodel//lib/active_model/validations/format.rb#7 +# pkg:gem/activemodel#lib/active_model/validations/format.rb:7 class ActiveModel::Validations::FormatValidator < ::ActiveModel::EachValidator include ::ActiveModel::Validations::ResolveValue - # source://activemodel//lib/active_model/validations/format.rb#20 + # pkg:gem/activemodel#lib/active_model/validations/format.rb:20 def check_validity!; end - # source://activemodel//lib/active_model/validations/format.rb#10 + # pkg:gem/activemodel#lib/active_model/validations/format.rb:10 def validate_each(record, attribute, value); end private - # source://activemodel//lib/active_model/validations/format.rb#34 + # pkg:gem/activemodel#lib/active_model/validations/format.rb:34 def check_options_validity(name); end - # source://activemodel//lib/active_model/validations/format.rb#30 + # pkg:gem/activemodel#lib/active_model/validations/format.rb:30 def record_error(record, attribute, name, value); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations/format.rb#48 + # pkg:gem/activemodel#lib/active_model/validations/format.rb:48 def regexp_using_multiline_anchors?(regexp); end end -# source://activemodel//lib/active_model/validations/absence.rb#12 +# pkg:gem/activemodel#lib/active_model/validations/absence.rb:12 module ActiveModel::Validations::HelperMethods # Validates that the specified attributes are blank (as defined by # Object#present?). @@ -6161,7 +5953,7 @@ module ActiveModel::Validations::HelperMethods # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. # See ActiveModel::Validations::ClassMethods#validates for more information. # - # source://activemodel//lib/active_model/validations/absence.rb#28 + # pkg:gem/activemodel#lib/active_model/validations/absence.rb:28 def validates_absence_of(*attr_names); end # Encapsulates the pattern of wanting to validate the acceptance of a @@ -6190,7 +5982,7 @@ module ActiveModel::Validations::HelperMethods # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. # See ActiveModel::Validations::ClassMethods#validates for more information. # - # source://activemodel//lib/active_model/validations/acceptance.rb#108 + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:108 def validates_acceptance_of(*attr_names); end # Validates the value of a specified attribute fulfills all @@ -6242,7 +6034,7 @@ module ActiveModel::Validations::HelperMethods # validates_comparison_of :preferred_name, other_than: :given_name, allow_nil: true # end # - # source://activemodel//lib/active_model/validations/comparison.rb#85 + # pkg:gem/activemodel#lib/active_model/validations/comparison.rb:85 def validates_comparison_of(*attr_names); end # Encapsulates the pattern of wanting to validate a password or email @@ -6280,7 +6072,7 @@ module ActiveModel::Validations::HelperMethods # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. # See ActiveModel::Validations::ClassMethods#validates for more information. # - # source://activemodel//lib/active_model/validations/confirmation.rb#75 + # pkg:gem/activemodel#lib/active_model/validations/confirmation.rb:75 def validates_confirmation_of(*attr_names); end # Validates that the value of the specified attribute is not in a @@ -6310,7 +6102,7 @@ module ActiveModel::Validations::HelperMethods # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. # See ActiveModel::Validations::ClassMethods#validates for more information. # - # source://activemodel//lib/active_model/validations/exclusion.rb#44 + # pkg:gem/activemodel#lib/active_model/validations/exclusion.rb:44 def validates_exclusion_of(*attr_names); end # Validates whether the value of the specified attribute is of the correct @@ -6366,7 +6158,7 @@ module ActiveModel::Validations::HelperMethods # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. # See ActiveModel::Validations::ClassMethods#validates for more information. # - # source://activemodel//lib/active_model/validations/format.rb#107 + # pkg:gem/activemodel#lib/active_model/validations/format.rb:107 def validates_format_of(*attr_names); end # Validates whether the value of the specified attribute is available in a @@ -6394,7 +6186,7 @@ module ActiveModel::Validations::HelperMethods # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. # See ActiveModel::Validations::ClassMethods#validates for more information. # - # source://activemodel//lib/active_model/validations/inclusion.rb#42 + # pkg:gem/activemodel#lib/active_model/validations/inclusion.rb:42 def validates_inclusion_of(*attr_names); end # Validates that the specified attributes match the length restrictions @@ -6446,7 +6238,7 @@ module ActiveModel::Validations::HelperMethods # +:if+, +:unless+, +:on+, and +:strict+. # See ActiveModel::Validations::ClassMethods#validates for more information. # - # source://activemodel//lib/active_model/validations/length.rb#123 + # pkg:gem/activemodel#lib/active_model/validations/length.rb:123 def validates_length_of(*attr_names); end # Validates whether the value of the specified attribute is numeric by @@ -6517,7 +6309,7 @@ module ActiveModel::Validations::HelperMethods # validates_numericality_of :width, greater_than: :minimum_weight # end # - # source://activemodel//lib/active_model/validations/numericality.rb#217 + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:217 def validates_numericality_of(*attr_names); end # Validates that the specified attributes are not blank (as defined by @@ -6543,195 +6335,132 @@ module ActiveModel::Validations::HelperMethods # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. # See ActiveModel::Validations::ClassMethods#validates for more information. # - # source://activemodel//lib/active_model/validations/presence.rb#34 + # pkg:gem/activemodel#lib/active_model/validations/presence.rb:34 def validates_presence_of(*attr_names); end - # Validates that the specified attributes match the length restrictions - # supplied. Only one constraint option can be used at a time apart from - # +:minimum+ and +:maximum+ that can be combined together: - # - # class Person < ActiveRecord::Base - # validates_length_of :first_name, maximum: 30 - # validates_length_of :last_name, maximum: 30, message: "less than 30 if you don't mind" - # validates_length_of :fax, in: 7..32, allow_nil: true - # validates_length_of :phone, in: 7..32, allow_blank: true - # validates_length_of :user_name, within: 6..20, too_long: 'pick a shorter name', too_short: 'pick a longer name' - # validates_length_of :zip_code, minimum: 5, too_short: 'please enter at least 5 characters' - # validates_length_of :smurf_leader, is: 4, message: "papa is spelled with 4 characters... don't play me." - # validates_length_of :words_in_essay, minimum: 100, too_short: 'Your essay must be at least 100 words.' - # - # private - # def words_in_essay - # essay.scan(/\w+/) - # end - # end - # - # Constraint options: - # - # * :minimum - The minimum size of the attribute. - # * :maximum - The maximum size of the attribute. Allows +nil+ by - # default if not used with +:minimum+. - # * :is - The exact size of the attribute. - # * :within - A range specifying the minimum and maximum size of - # the attribute. - # * :in - A synonym (or alias) for :within. - # - # Other options: - # - # * :allow_nil - Attribute may be +nil+; skip validation. - # * :allow_blank - Attribute may be blank; skip validation. - # * :too_long - The error message if the attribute goes over the - # maximum (default is: "is too long (maximum is %{count} characters)"). - # * :too_short - The error message if the attribute goes under the - # minimum (default is: "is too short (minimum is %{count} characters)"). - # * :wrong_length - The error message if using the :is - # method and the attribute is the wrong size (default is: "is the wrong - # length (should be %{count} characters)"). - # * :message - The error message to use for a :minimum, - # :maximum, or :is violation. An alias of the appropriate - # too_long/too_short/wrong_length message. - # - # There is also a list of default options supported by every validator: - # +:if+, +:unless+, +:on+, and +:strict+. - # See ActiveModel::Validations::ClassMethods#validates for more information. - # - # source://activemodel//lib/active_model/validations/length.rb#123 + # pkg:gem/activemodel#lib/active_model/validations/length.rb:127 def validates_size_of(*attr_names); end private - # source://activemodel//lib/active_model/validations/helper_methods.rb#7 + # pkg:gem/activemodel#lib/active_model/validations/helper_methods.rb:7 def _merge_attributes(attr_names); end end -# source://activemodel//lib/active_model/validations/inclusion.rb#7 +# pkg:gem/activemodel#lib/active_model/validations/inclusion.rb:7 class ActiveModel::Validations::InclusionValidator < ::ActiveModel::EachValidator include ::ActiveModel::Validations::ResolveValue include ::ActiveModel::Validations::Clusivity - # source://activemodel//lib/active_model/validations/inclusion.rb#10 + # pkg:gem/activemodel#lib/active_model/validations/inclusion.rb:10 def validate_each(record, attribute, value); end end -# source://activemodel//lib/active_model/validations/length.rb#7 +# pkg:gem/activemodel#lib/active_model/validations/length.rb:7 class ActiveModel::Validations::LengthValidator < ::ActiveModel::EachValidator include ::ActiveModel::Validations::ResolveValue - # @return [LengthValidator] a new instance of LengthValidator - # - # source://activemodel//lib/active_model/validations/length.rb#15 + # pkg:gem/activemodel#lib/active_model/validations/length.rb:15 def initialize(options); end - # source://activemodel//lib/active_model/validations/length.rb#29 + # pkg:gem/activemodel#lib/active_model/validations/length.rb:29 def check_validity!; end - # source://activemodel//lib/active_model/validations/length.rb#47 + # pkg:gem/activemodel#lib/active_model/validations/length.rb:47 def validate_each(record, attribute, value); end private - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations/length.rb#69 + # pkg:gem/activemodel#lib/active_model/validations/length.rb:69 def skip_nil_check?(key); end end -# source://activemodel//lib/active_model/validations/length.rb#11 +# pkg:gem/activemodel#lib/active_model/validations/length.rb:11 ActiveModel::Validations::LengthValidator::CHECKS = T.let(T.unsafe(nil), Hash) -# source://activemodel//lib/active_model/validations/length.rb#10 +# pkg:gem/activemodel#lib/active_model/validations/length.rb:10 ActiveModel::Validations::LengthValidator::MESSAGES = T.let(T.unsafe(nil), Hash) -# source://activemodel//lib/active_model/validations/length.rb#13 +# pkg:gem/activemodel#lib/active_model/validations/length.rb:13 ActiveModel::Validations::LengthValidator::RESERVED_OPTIONS = T.let(T.unsafe(nil), Array) -# source://activemodel//lib/active_model/validations/numericality.rb#9 +# pkg:gem/activemodel#lib/active_model/validations/numericality.rb:9 class ActiveModel::Validations::NumericalityValidator < ::ActiveModel::EachValidator include ::ActiveModel::Validations::Comparability include ::ActiveModel::Validations::ResolveValue - # source://activemodel//lib/active_model/validations/numericality.rb#22 + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:22 def check_validity!; end - # source://activemodel//lib/active_model/validations/numericality.rb#36 + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:36 def validate_each(record, attr_name, value, precision: T.unsafe(nil), scale: T.unsafe(nil)); end private - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations/numericality.rb#118 + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:118 def allow_only_integer?(record); end - # source://activemodel//lib/active_model/validations/numericality.rb#112 + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:112 def filtered_options(value); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations/numericality.rb#108 + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:108 def is_hexadecimal_literal?(raw_value); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations/numericality.rb#104 + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:104 def is_integer?(raw_value); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations/numericality.rb#94 + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:94 def is_number?(raw_value, precision, scale); end - # source://activemodel//lib/active_model/validations/numericality.rb#68 + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:68 def option_as_number(record, option_value, precision, scale); end - # source://activemodel//lib/active_model/validations/numericality.rb#72 + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:72 def parse_as_number(raw_value, precision, scale); end - # source://activemodel//lib/active_model/validations/numericality.rb#86 + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:86 def parse_float(raw_value, precision, scale); end - # source://activemodel//lib/active_model/validations/numericality.rb#122 + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:122 def prepare_value_for_validation(value, record, attr_name); end - # @return [Boolean] - # - # source://activemodel//lib/active_model/validations/numericality.rb#143 + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:143 def record_attribute_changed_in_place?(record, attr_name); end - # source://activemodel//lib/active_model/validations/numericality.rb#90 + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:90 def round(raw_value, scale); end end -# source://activemodel//lib/active_model/validations/numericality.rb#20 +# pkg:gem/activemodel#lib/active_model/validations/numericality.rb:20 ActiveModel::Validations::NumericalityValidator::HEXADECIMAL_REGEX = T.let(T.unsafe(nil), Regexp) -# source://activemodel//lib/active_model/validations/numericality.rb#18 +# pkg:gem/activemodel#lib/active_model/validations/numericality.rb:18 ActiveModel::Validations::NumericalityValidator::INTEGER_REGEX = T.let(T.unsafe(nil), Regexp) -# source://activemodel//lib/active_model/validations/numericality.rb#14 +# pkg:gem/activemodel#lib/active_model/validations/numericality.rb:14 ActiveModel::Validations::NumericalityValidator::NUMBER_CHECKS = T.let(T.unsafe(nil), Hash) -# source://activemodel//lib/active_model/validations/numericality.rb#13 +# pkg:gem/activemodel#lib/active_model/validations/numericality.rb:13 ActiveModel::Validations::NumericalityValidator::RANGE_CHECKS = T.let(T.unsafe(nil), Hash) -# source://activemodel//lib/active_model/validations/numericality.rb#16 +# pkg:gem/activemodel#lib/active_model/validations/numericality.rb:16 ActiveModel::Validations::NumericalityValidator::RESERVED_OPTIONS = T.let(T.unsafe(nil), Array) -# source://activemodel//lib/active_model/validations/presence.rb#5 +# pkg:gem/activemodel#lib/active_model/validations/presence.rb:5 class ActiveModel::Validations::PresenceValidator < ::ActiveModel::EachValidator - # source://activemodel//lib/active_model/validations/presence.rb#6 + # pkg:gem/activemodel#lib/active_model/validations/presence.rb:6 def validate_each(record, attr_name, value); end end -# source://activemodel//lib/active_model/validations/resolve_value.rb#5 +# pkg:gem/activemodel#lib/active_model/validations/resolve_value.rb:5 module ActiveModel::Validations::ResolveValue - # source://activemodel//lib/active_model/validations/resolve_value.rb#6 + # pkg:gem/activemodel#lib/active_model/validations/resolve_value.rb:6 def resolve_value(record, value); end end -# source://activemodel//lib/active_model/validations/with.rb#7 +# pkg:gem/activemodel#lib/active_model/validations/with.rb:7 class ActiveModel::Validations::WithValidator < ::ActiveModel::EachValidator - # source://activemodel//lib/active_model/validations/with.rb#8 + # pkg:gem/activemodel#lib/active_model/validations/with.rb:8 def validate_each(record, attr, val); end end @@ -6826,13 +6555,11 @@ end # end # end # -# source://activemodel//lib/active_model/validator.rb#96 +# pkg:gem/activemodel#lib/active_model/validator.rb:96 class ActiveModel::Validator # Accepts options that will be made available through the +options+ reader. # - # @return [Validator] a new instance of Validator - # - # source://activemodel//lib/active_model/validator.rb#108 + # pkg:gem/activemodel#lib/active_model/validator.rb:108 def initialize(options = T.unsafe(nil)); end # Returns the kind for this validator. @@ -6840,20 +6567,16 @@ class ActiveModel::Validator # PresenceValidator.new(attributes: [:username]).kind # => :presence # AcceptanceValidator.new(attributes: [:terms]).kind # => :acceptance # - # source://activemodel//lib/active_model/validator.rb#116 + # pkg:gem/activemodel#lib/active_model/validator.rb:116 def kind; end - # Returns the value of attribute options. - # - # source://activemodel//lib/active_model/validator.rb#97 + # pkg:gem/activemodel#lib/active_model/validator.rb:97 def options; end # Override this method in subclasses with validation logic, adding errors # to the records +errors+ array where necessary. # - # @raise [NotImplementedError] - # - # source://activemodel//lib/active_model/validator.rb#122 + # pkg:gem/activemodel#lib/active_model/validator.rb:122 def validate(record); end class << self @@ -6862,7 +6585,7 @@ class ActiveModel::Validator # PresenceValidator.kind # => :presence # AcceptanceValidator.kind # => :acceptance # - # source://activemodel//lib/active_model/validator.rb#103 + # pkg:gem/activemodel#lib/active_model/validator.rb:103 def kind; end end end diff --git a/sorbet/rbi/gems/activesupport@8.0.3.rbi b/sorbet/rbi/gems/activesupport@8.1.3.rbi similarity index 63% rename from sorbet/rbi/gems/activesupport@8.0.3.rbi rename to sorbet/rbi/gems/activesupport@8.1.3.rbi index b4f3c13..1ea1951 100644 --- a/sorbet/rbi/gems/activesupport@8.0.3.rbi +++ b/sorbet/rbi/gems/activesupport@8.1.3.rbi @@ -6,111 +6,169 @@ # :include: ../README.rdoc +# -- +# The JSON gem adds a few modules to Ruby core classes containing :to_json definition, overwriting +# their default behavior. That said, we need to define the basic to_json method in all of them, +# otherwise they will always use to_json gem implementation, which is backwards incompatible in +# several cases (for instance, the JSON implementation for Hash does not work) with inheritance. +# +# On the other hand, we should avoid conflict with ::JSON.{generate,dump}(obj). Unfortunately, the +# JSON gem's encoder relies on its own to_json implementation to encode objects. Since it always +# passes a ::JSON::State object as the only argument to to_json, we can detect that and forward the +# calls to the original to_json method. +# +# It should be noted that when using ::JSON.{generate,dump} directly, ActiveSupport's encoder is +# bypassed completely. This means that as_json won't be invoked and the JSON gem will simply +# ignore any options it does not natively understand. This also means that ::JSON.{generate,dump} +# should give exactly the same results with or without Active Support. +# :markup: markdown +# -- +# Defines the standard inflection rules. These are the starting point for +# new projects and are not considered complete. The current set of inflection +# rules is frozen. This means, we do not change them to become more complete. +# This is a safety measure to keep existing applications from breaking. +# ++ # -# source://activesupport//lib/active_support/deep_mergeable.rb#3 +# pkg:gem/activesupport#lib/active_support/delegation.rb:3 module ActiveSupport extend ::ActiveSupport::LazyLoadHooks extend ::ActiveSupport::Autoload - # source://activesupport//lib/active_support/json/decoding.rb#9 + # pkg:gem/activesupport#lib/active_support.rb:114 + def filter_parameters; end + + # pkg:gem/activesupport#lib/active_support.rb:114 + def filter_parameters=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:106 + def parallelize_test_databases; end + + # pkg:gem/activesupport#lib/active_support.rb:106 + def parallelize_test_databases=(val); end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 def parse_json_times; end - # source://activesupport//lib/active_support/json/decoding.rb#9 + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 def parse_json_times=(val); end - # source://activesupport//lib/active_support.rb#100 + # pkg:gem/activesupport#lib/active_support.rb:104 def test_order; end - # source://activesupport//lib/active_support.rb#100 + # pkg:gem/activesupport#lib/active_support.rb:104 def test_order=(val); end - # source://activesupport//lib/active_support.rb#101 + # pkg:gem/activesupport#lib/active_support.rb:105 def test_parallelization_threshold; end - # source://activesupport//lib/active_support.rb#101 + # pkg:gem/activesupport#lib/active_support.rb:105 def test_parallelization_threshold=(val); end class << self - # source://activesupport//lib/active_support.rb#106 + # pkg:gem/activesupport#lib/active_support.rb:116 def cache_format_version; end - # source://activesupport//lib/active_support.rb#110 + # pkg:gem/activesupport#lib/active_support.rb:120 def cache_format_version=(value); end - # source://activesupport//lib/active_support/deprecator.rb#4 + # pkg:gem/activesupport#lib/active_support/deprecator.rb:4 def deprecator; end - # source://activesupport//lib/active_support.rb#94 + # pkg:gem/activesupport#lib/active_support.rb:98 def eager_load!; end - # source://activesupport//lib/active_support.rb#104 + # pkg:gem/activesupport#lib/active_support.rb:109 def error_reporter; end - # source://activesupport//lib/active_support.rb#104 + # pkg:gem/activesupport#lib/active_support.rb:109 def error_reporter=(_arg0); end - # source://activesupport//lib/active_support/json/encoding.rb#8 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 def escape_html_entities_in_json(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/json/encoding.rb#8 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 def escape_html_entities_in_json=(arg); end + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def escape_js_separators_in_json(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def escape_js_separators_in_json=(arg); end + + # pkg:gem/activesupport#lib/active_support.rb:112 + def event_reporter; end + + # pkg:gem/activesupport#lib/active_support.rb:112 + def event_reporter=(_arg0); end + + # pkg:gem/activesupport#lib/active_support.rb:114 + def filter_parameters; end + + # pkg:gem/activesupport#lib/active_support.rb:114 + def filter_parameters=(val); end + # Returns the currently loaded version of Active Support as a +Gem::Version+. # - # source://activesupport//lib/active_support/gem_version.rb#5 + # pkg:gem/activesupport#lib/active_support/gem_version.rb:5 def gem_version; end - # source://activesupport//lib/active_support/json/encoding.rb#8 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 def json_encoder(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/json/encoding.rb#8 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 def json_encoder=(arg); end - # source://activesupport//lib/active_support/json/decoding.rb#9 + # pkg:gem/activesupport#lib/active_support.rb:106 + def parallelize_test_databases; end + + # pkg:gem/activesupport#lib/active_support.rb:106 + def parallelize_test_databases=(val); end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 def parse_json_times; end - # source://activesupport//lib/active_support/json/decoding.rb#9 + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 def parse_json_times=(val); end - # source://activesupport//lib/active_support.rb#100 + # pkg:gem/activesupport#lib/active_support.rb:104 def test_order; end - # source://activesupport//lib/active_support.rb#100 + # pkg:gem/activesupport#lib/active_support.rb:104 def test_order=(val); end - # source://activesupport//lib/active_support.rb#101 + # pkg:gem/activesupport#lib/active_support.rb:105 def test_parallelization_threshold; end - # source://activesupport//lib/active_support.rb#101 + # pkg:gem/activesupport#lib/active_support.rb:105 def test_parallelization_threshold=(val); end - # source://activesupport//lib/active_support/json/encoding.rb#8 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 def time_precision(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/json/encoding.rb#8 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 def time_precision=(arg); end - # source://activesupport//lib/active_support.rb#114 + # pkg:gem/activesupport#lib/active_support.rb:124 def to_time_preserves_timezone; end - # source://activesupport//lib/active_support.rb#118 + # pkg:gem/activesupport#lib/active_support.rb:131 def to_time_preserves_timezone=(value); end - # source://activesupport//lib/active_support/json/encoding.rb#8 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 def use_standard_json_time_format(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/json/encoding.rb#8 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 def use_standard_json_time_format=(arg); end - # source://activesupport//lib/active_support.rb#134 + # pkg:gem/activesupport#lib/active_support.rb:139 def utc_to_local_returns_utc_offset_times; end - # source://activesupport//lib/active_support.rb#138 + # pkg:gem/activesupport#lib/active_support.rb:143 def utc_to_local_returns_utc_offset_times=(value); end # Returns the currently loaded version of Active Support as a +Gem::Version+. # - # source://activesupport//lib/active_support/version.rb#7 + # pkg:gem/activesupport#lib/active_support/version.rb:7 def version; end end end @@ -123,7 +181,7 @@ end # module and invoke the +action+ class macro to define the action. An action # needs a name and a block to execute. # -# source://activesupport//lib/active_support/actionable_error.rb#11 +# pkg:gem/activesupport#lib/active_support/actionable_error.rb:11 module ActiveSupport::ActionableError extend ::ActiveSupport::Concern include GeneratedInstanceMethods @@ -132,10 +190,10 @@ module ActiveSupport::ActionableError mixes_in_class_methods ::ActiveSupport::ActionableError::ClassMethods class << self - # source://activesupport//lib/active_support/actionable_error.rb#20 + # pkg:gem/activesupport#lib/active_support/actionable_error.rb:20 def actions(error); end - # source://activesupport//lib/active_support/actionable_error.rb#29 + # pkg:gem/activesupport#lib/active_support/actionable_error.rb:29 def dispatch(error, name); end end @@ -152,7 +210,7 @@ module ActiveSupport::ActionableError end end -# source://activesupport//lib/active_support/actionable_error.rb#35 +# pkg:gem/activesupport#lib/active_support/actionable_error.rb:35 module ActiveSupport::ActionableError::ClassMethods # Defines an action that can resolve the error. # @@ -164,11 +222,11 @@ module ActiveSupport::ActionableError::ClassMethods # end # end # - # source://activesupport//lib/active_support/actionable_error.rb#45 + # pkg:gem/activesupport#lib/active_support/actionable_error.rb:45 def action(name, &block); end end -# source://activesupport//lib/active_support/actionable_error.rb#14 +# pkg:gem/activesupport#lib/active_support/actionable_error.rb:14 class ActiveSupport::ActionableError::NonActionable < ::StandardError; end # = \Array Inquirer @@ -182,7 +240,7 @@ class ActiveSupport::ActionableError::NonActionable < ::StandardError; end # variants.tablet? # => true # variants.desktop? # => false # -# source://activesupport//lib/active_support/array_inquirer.rb#14 +# pkg:gem/activesupport#lib/active_support/array_inquirer.rb:14 class ActiveSupport::ArrayInquirer < ::Array # Passes each element of +candidates+ collection to ArrayInquirer collection. # The method returns true if any element from the ArrayInquirer collection @@ -197,19 +255,15 @@ class ActiveSupport::ArrayInquirer < ::Array # variants.any?('phone', 'desktop') # => true # variants.any?(:desktop, :watch) # => false # - # @return [Boolean] - # - # source://activesupport//lib/active_support/array_inquirer.rb#27 + # pkg:gem/activesupport#lib/active_support/array_inquirer.rb:27 def any?(*candidates); end private - # source://activesupport//lib/active_support/array_inquirer.rb#42 + # pkg:gem/activesupport#lib/active_support/array_inquirer.rb:42 def method_missing(name, *_arg1, **_arg2, &_arg3); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/array_inquirer.rb#38 + # pkg:gem/activesupport#lib/active_support/array_inquirer.rb:38 def respond_to_missing?(name, include_private = T.unsafe(nil)); end end @@ -237,21 +291,21 @@ end # # MyLib.eager_load! # -# source://activesupport//lib/active_support/dependencies/autoload.rb#29 +# pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:29 module ActiveSupport::Autoload - # source://activesupport//lib/active_support/dependencies/autoload.rb#30 + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:30 def autoload(const_name, path = T.unsafe(nil)); end - # source://activesupport//lib/active_support/dependencies/autoload.rb#51 + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:51 def autoload_at(path); end - # source://activesupport//lib/active_support/dependencies/autoload.rb#44 + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:44 def autoload_under(path); end - # source://activesupport//lib/active_support/dependencies/autoload.rb#58 + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:58 def eager_autoload; end - # source://activesupport//lib/active_support/dependencies/autoload.rb#65 + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:65 def eager_load!; end end @@ -286,11 +340,9 @@ end # # Inspired by the Quiet Backtrace gem by thoughtbot. # -# source://activesupport//lib/active_support/backtrace_cleaner.rb#34 +# pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:34 class ActiveSupport::BacktraceCleaner - # @return [BacktraceCleaner] a new instance of BacktraceCleaner - # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#35 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:35 def initialize; end # Adds a filter from the block provided. Each line in the backtrace will be @@ -300,7 +352,7 @@ class ActiveSupport::BacktraceCleaner # root = "#{Rails.root}/" # backtrace_cleaner.add_filter { |line| line.delete_prefix(root) } # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#83 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:154 def add_filter(&block); end # Adds a silencer from the block provided. If the silencer returns +true+ @@ -309,72 +361,105 @@ class ActiveSupport::BacktraceCleaner # # Will reject all lines that include the word "puma", like "/gems/puma/server.rb" or "/app/my_puma_server/rb" # backtrace_cleaner.add_silencer { |line| /puma/.match?(line) } # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#92 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:163 def add_silencer(&block); end # Returns the backtrace after all filters and silencers have been run # against it. Filters run first, then silencers. # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#45 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:45 def clean(backtrace, kind = T.unsafe(nil)); end # Returns the frame with all filters applied. # returns +nil+ if the frame was silenced. # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#61 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:73 def clean_frame(frame, kind = T.unsafe(nil)); end - # Returns the backtrace after all filters and silencers have been run - # against it. Filters run first, then silencers. + # Given an array of Thread::Backtrace::Location objects, returns an array + # with the clean ones: # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#45 + # clean_locations = backtrace_cleaner.clean_locations(caller_locations) + # + # Filters and silencers receive strings as usual. However, the +path+ + # attributes of the locations in the returned array are the original, + # unfiltered ones, since locations are immutable. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:67 + def clean_locations(locations, kind = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:57 def filter(backtrace, kind = T.unsafe(nil)); end + # Returns the first clean frame of the caller's backtrace, or +nil+. + # + # Frames are strings. + # Returns the first clean frame of the caller's backtrace, or +nil+. + # + # Frames are strings. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:129 + def first_clean_frame(kind = T.unsafe(nil)); end + + # Returns the first clean location of the caller's call stack, or +nil+. + # + # Locations are Thread::Backtrace::Location objects. Since they are + # immutable, their +path+ attributes are the original ones, but filters + # are applied internally so silencers can still rely on them. + # Returns the first clean location of the caller's call stack, or +nil+. + # + # Locations are Thread::Backtrace::Location objects. Since they are + # immutable, their +path+ attributes are the original ones, but filters + # are applied internally so silencers can still rely on them. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:141 + def first_clean_location(kind = T.unsafe(nil)); end + # Removes all filters, but leaves in the silencers. Useful if you suddenly # need to see entire filepaths in the backtrace that you had already # filtered out. # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#106 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:177 def remove_filters!; end # Removes all silencers, but leaves in the filters. Useful if your # context of debugging suddenly expands as you suspect a bug in one of # the libraries you use. # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#99 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:170 def remove_silencers!; end private - # source://activesupport//lib/active_support/backtrace_cleaner.rb#127 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:198 def add_core_silencer; end - # source://activesupport//lib/active_support/backtrace_cleaner.rb#118 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:189 def add_gem_filter; end - # source://activesupport//lib/active_support/backtrace_cleaner.rb#131 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:202 def add_gem_silencer; end - # source://activesupport//lib/active_support/backtrace_cleaner.rb#135 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:206 def add_stdlib_silencer; end - # source://activesupport//lib/active_support/backtrace_cleaner.rb#139 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:210 def filter_backtrace(backtrace); end - # source://activesupport//lib/active_support/backtrace_cleaner.rb#113 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:184 def initialize_copy(_other); end - # source://activesupport//lib/active_support/backtrace_cleaner.rb#155 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:226 def noise(backtrace); end - # source://activesupport//lib/active_support/backtrace_cleaner.rb#147 + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:218 def silence(backtrace); end end -# source://activesupport//lib/active_support/backtrace_cleaner.rb#111 +# pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:182 ActiveSupport::BacktraceCleaner::FORMATTED_GEMS_PATTERN = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/benchmark.rb#4 +# pkg:gem/activesupport#lib/active_support/benchmark.rb:4 module ActiveSupport::Benchmark class << self # Benchmark realtime in the specified time unit. By default, @@ -388,14 +473,14 @@ module ActiveSupport::Benchmark # # `unit` can be any of the values accepted by Ruby's `Process.clock_gettime`. # - # source://activesupport//lib/active_support/benchmark.rb#15 + # pkg:gem/activesupport#lib/active_support/benchmark.rb:15 def realtime(unit = T.unsafe(nil), &block); end end end # = \Benchmarkable # -# source://activesupport//lib/active_support/benchmarkable.rb#7 +# pkg:gem/activesupport#lib/active_support/benchmarkable.rb:7 module ActiveSupport::Benchmarkable # Allows you to measure the execution time of a block in a template and # records the result to the log. Wrap this block around expensive operations @@ -427,13 +512,13 @@ module ActiveSupport::Benchmarkable # <%= expensive_and_chatty_files_operation %> # <% end %> # - # source://activesupport//lib/active_support/benchmarkable.rb#37 + # pkg:gem/activesupport#lib/active_support/benchmarkable.rb:37 def benchmark(message = T.unsafe(nil), options = T.unsafe(nil), &block); end end -# source://activesupport//lib/active_support/core_ext/big_decimal/conversions.rb#7 +# pkg:gem/activesupport#lib/active_support/core_ext/big_decimal/conversions.rb:7 module ActiveSupport::BigDecimalWithDefaultFormat - # source://activesupport//lib/active_support/core_ext/big_decimal/conversions.rb#8 + # pkg:gem/activesupport#lib/active_support/core_ext/big_decimal/conversions.rb:8 def to_s(format = T.unsafe(nil)); end end @@ -508,20 +593,18 @@ end # puts logger.broadcasts # => [MyLogger, MyLogger] # logger.loggable? # [true, true] # -# source://activesupport//lib/active_support/broadcast_logger.rb#74 +# pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:74 class ActiveSupport::BroadcastLogger include ::ActiveSupport::LoggerSilence include ::ActiveSupport::LoggerThreadSafeLevel - # @return [BroadcastLogger] a new instance of BroadcastLogger - # - # source://activesupport//lib/active_support/broadcast_logger.rb#81 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:81 def initialize(*loggers); end - # source://activesupport//lib/active_support/broadcast_logger.rb#128 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 def <<(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/broadcast_logger.rb#128 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 def add(*_arg0, **_arg1, &_arg2); end # Add logger(s) to the broadcast. @@ -529,123 +612,111 @@ class ActiveSupport::BroadcastLogger # broadcast_logger = ActiveSupport::BroadcastLogger.new # broadcast_logger.broadcast_to(Logger.new(STDOUT), Logger.new(STDERR)) # - # source://activesupport//lib/active_support/broadcast_logger.rb#92 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:92 def broadcast_to(*loggers); end # Returns all the logger that are part of this broadcast. # - # source://activesupport//lib/active_support/broadcast_logger.rb#78 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:78 def broadcasts; end - # source://activesupport//lib/active_support/broadcast_logger.rb#128 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 def close(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/broadcast_logger.rb#128 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 def debug(*_arg0, **_arg1, &_arg2); end # Sets the log level to +Logger::DEBUG+ for the whole broadcast. # - # source://activesupport//lib/active_support/broadcast_logger.rb#146 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:146 def debug!; end # True if the log level allows entries with severity +Logger::DEBUG+ to be written # to at least one broadcast. False otherwise. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/broadcast_logger.rb#141 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:141 def debug?; end - # source://activesupport//lib/active_support/broadcast_logger.rb#128 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 def error(*_arg0, **_arg1, &_arg2); end # Sets the log level to +Logger::ERROR+ for the whole broadcast. # - # source://activesupport//lib/active_support/broadcast_logger.rb#179 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:179 def error!; end # True if the log level allows entries with severity +Logger::ERROR+ to be written # to at least one broadcast. False otherwise. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/broadcast_logger.rb#174 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:174 def error?; end - # source://activesupport//lib/active_support/broadcast_logger.rb#128 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 def fatal(*_arg0, **_arg1, &_arg2); end # Sets the log level to +Logger::FATAL+ for the whole broadcast. # - # source://activesupport//lib/active_support/broadcast_logger.rb#190 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:190 def fatal!; end # True if the log level allows entries with severity +Logger::FATAL+ to be written # to at least one broadcast. False otherwise. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/broadcast_logger.rb#185 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:185 def fatal?; end - # source://activesupport//lib/active_support/broadcast_logger.rb#128 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 def formatter(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/broadcast_logger.rb#128 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 def formatter=(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/broadcast_logger.rb#128 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 def info(*_arg0, **_arg1, &_arg2); end # Sets the log level to +Logger::INFO+ for the whole broadcast. # - # source://activesupport//lib/active_support/broadcast_logger.rb#157 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:157 def info!; end # True if the log level allows entries with severity +Logger::INFO+ to be written # to at least one broadcast. False otherwise. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/broadcast_logger.rb#152 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:152 def info?; end # Returns the lowest level of all the loggers in the broadcast. # - # source://activesupport//lib/active_support/broadcast_logger.rb#135 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:135 def level; end - # source://activesupport//lib/active_support/broadcast_logger.rb#128 + # Returns the lowest level of all the loggers in the broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 def level=(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/broadcast_logger.rb#113 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:113 def local_level; end - # source://activesupport//lib/active_support/broadcast_logger.rb#107 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:107 def local_level=(level); end - # source://activesupport//lib/active_support/broadcast_logger.rb#128 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 def log(*_arg0, **_arg1, &_arg2); end - # Returns the value of attribute progname. - # - # source://activesupport//lib/active_support/broadcast_logger.rb#79 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:79 def progname; end - # Sets the attribute progname - # - # @param value the value to set the attribute progname to. - # - # source://activesupport//lib/active_support/broadcast_logger.rb#79 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:79 def progname=(_arg0); end - # source://activesupport//lib/active_support/broadcast_logger.rb#128 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 def sev_threshold=(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/logger_silence.rb#12 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 def silencer; end - # source://activesupport//lib/active_support/logger_silence.rb#12 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 def silencer=(val); end # Remove a logger from the broadcast. When a logger is removed, messages sent to @@ -656,59 +727,55 @@ class ActiveSupport::BroadcastLogger # # broadcast_logger.stop_broadcasting_to(sink) # - # source://activesupport//lib/active_support/broadcast_logger.rb#103 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:103 def stop_broadcasting_to(logger); end - # source://activesupport//lib/active_support/broadcast_logger.rb#128 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 def unknown(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/broadcast_logger.rb#128 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 def warn(*_arg0, **_arg1, &_arg2); end # Sets the log level to +Logger::WARN+ for the whole broadcast. # - # source://activesupport//lib/active_support/broadcast_logger.rb#168 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:168 def warn!; end # True if the log level allows entries with severity +Logger::WARN+ to be written # to at least one broadcast. False otherwise. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/broadcast_logger.rb#163 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:163 def warn?; end private - # source://activesupport//lib/active_support/broadcast_logger.rb#202 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:202 def dispatch(method, *args, **kwargs, &block); end - # source://activesupport//lib/active_support/broadcast_logger.rb#194 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:194 def initialize_copy(other); end - # source://activesupport//lib/active_support/broadcast_logger.rb#222 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:222 def method_missing(name, *_arg1, **_arg2, &_arg3); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/broadcast_logger.rb#234 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:234 def respond_to_missing?(method, include_all); end class << self - # source://activesupport//lib/active_support/logger_silence.rb#12 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 def silencer; end - # source://activesupport//lib/active_support/logger_silence.rb#12 + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 def silencer=(val); end end end -# source://activesupport//lib/active_support/broadcast_logger.rb#121 +# pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:121 ActiveSupport::BroadcastLogger::LOGGER_METHODS = T.let(T.unsafe(nil), Array) # See ActiveSupport::Cache::Store for documentation. # -# source://activesupport//lib/active_support/cache/entry.rb#6 +# pkg:gem/activesupport#lib/active_support/cache/entry.rb:6 module ActiveSupport::Cache class << self # Expands out the +key+ argument into a key that can be used for the @@ -724,19 +791,13 @@ module ActiveSupport::Cache # # The +key+ argument can also respond to +cache_key+ or +to_param+. # - # source://activesupport//lib/active_support/cache.rb#112 + # pkg:gem/activesupport#lib/active_support/cache.rb:113 def expand_cache_key(key, namespace = T.unsafe(nil)); end - # Returns the value of attribute format_version. - # - # source://activesupport//lib/active_support/cache.rb#59 + # pkg:gem/activesupport#lib/active_support/cache.rb:60 def format_version; end - # Sets the attribute format_version - # - # @param value the value to set the attribute format_version to. - # - # source://activesupport//lib/active_support/cache.rb#59 + # pkg:gem/activesupport#lib/active_support/cache.rb:60 def format_version=(_arg0); end # Creates a new Store object according to the given options. @@ -765,125 +826,115 @@ module ActiveSupport::Cache # ActiveSupport::Cache.lookup_store(MyOwnCacheStore.new) # # => returns MyOwnCacheStore.new # - # source://activesupport//lib/active_support/cache.rb#86 + # pkg:gem/activesupport#lib/active_support/cache.rb:87 def lookup_store(store = T.unsafe(nil), *parameters); end private - # source://activesupport//lib/active_support/cache.rb#124 + # pkg:gem/activesupport#lib/active_support/cache.rb:125 def retrieve_cache_key(key); end # Obtains the specified cache store class, given the name of the +store+. # Raises an error when the store class cannot be found. # - # source://activesupport//lib/active_support/cache.rb#136 + # pkg:gem/activesupport#lib/active_support/cache.rb:137 def retrieve_store_class(store); end end end -# source://activesupport//lib/active_support/cache/coder.rb#7 +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:7 class ActiveSupport::Cache::Coder - # @return [Coder] a new instance of Coder - # - # source://activesupport//lib/active_support/cache/coder.rb#8 + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:8 def initialize(serializer, compressor, legacy_serializer: T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/coder.rb#14 + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:14 def dump(entry); end - # source://activesupport//lib/active_support/cache/coder.rb#20 + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:20 def dump_compressed(entry, threshold); end - # source://activesupport//lib/active_support/cache/coder.rb#48 + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:48 def load(dumped); end private - # source://activesupport//lib/active_support/cache/coder.rb#136 + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:136 def dump_version(version); end - # source://activesupport//lib/active_support/cache/coder.rb#144 + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:144 def load_version(dumped_version); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/coder.rb#121 + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:121 def signature?(dumped); end - # source://activesupport//lib/active_support/cache/coder.rb#129 + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:129 def try_compress(string, threshold); end - # source://activesupport//lib/active_support/cache/coder.rb#125 + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:125 def type_for_string(value); end end -# source://activesupport//lib/active_support/cache/coder.rb#76 +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:76 ActiveSupport::Cache::Coder::COMPRESSED_FLAG = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/cache/coder.rb#98 +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:98 class ActiveSupport::Cache::Coder::LazyEntry < ::ActiveSupport::Cache::Entry - # @return [LazyEntry] a new instance of LazyEntry - # - # source://activesupport//lib/active_support/cache/coder.rb#99 + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:99 def initialize(serializer, compressor, payload, **options); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/coder.rb#114 + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:114 def mismatched?(version); end - # source://activesupport//lib/active_support/cache/coder.rb#106 + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:106 def value; end end -# source://activesupport//lib/active_support/cache/coder.rb#84 +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:84 ActiveSupport::Cache::Coder::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/cache/coder.rb#68 +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:68 ActiveSupport::Cache::Coder::OBJECT_DUMP_TYPE = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/cache/coder.rb#80 +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:80 ActiveSupport::Cache::Coder::PACKED_EXPIRES_AT_TEMPLATE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/cache/coder.rb#78 +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:78 ActiveSupport::Cache::Coder::PACKED_TEMPLATE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/cache/coder.rb#79 +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:79 ActiveSupport::Cache::Coder::PACKED_TYPE_TEMPLATE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/cache/coder.rb#82 +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:82 ActiveSupport::Cache::Coder::PACKED_VERSION_INDEX = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/cache/coder.rb#81 +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:81 ActiveSupport::Cache::Coder::PACKED_VERSION_LENGTH_TEMPLATE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/cache/coder.rb#66 +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:66 ActiveSupport::Cache::Coder::SIGNATURE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/cache/coder.rb#96 +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:96 ActiveSupport::Cache::Coder::STRING_DESERIALIZERS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/cache/coder.rb#70 +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:70 ActiveSupport::Cache::Coder::STRING_ENCODINGS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/cache/coder.rb#86 +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:86 class ActiveSupport::Cache::Coder::StringDeserializer - # @return [StringDeserializer] a new instance of StringDeserializer - # - # source://activesupport//lib/active_support/cache/coder.rb#87 + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:87 def initialize(encoding); end - # source://activesupport//lib/active_support/cache/coder.rb#91 + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:91 def load(payload); end end -# source://activesupport//lib/active_support/cache.rb#46 +# pkg:gem/activesupport#lib/active_support/cache.rb:47 ActiveSupport::Cache::DEFAULT_COMPRESS_LIMIT = T.let(T.unsafe(nil), Integer) # Raised by coders when the cache entry can't be deserialized. # This error is treated as a cache miss. # -# source://activesupport//lib/active_support/cache.rb#50 +# pkg:gem/activesupport#lib/active_support/cache.rb:51 class ActiveSupport::Cache::DeserializationError < ::StandardError; end # This class is used to represent cache entries. Cache entries have a value, an optional @@ -894,81 +945,69 @@ class ActiveSupport::Cache::DeserializationError < ::StandardError; end # Since cache entries in most instances will be serialized, the internals of this class are highly optimized # using short instance variable names that are lazily defined. # -# source://activesupport//lib/active_support/cache/entry.rb#14 +# pkg:gem/activesupport#lib/active_support/cache/entry.rb:14 class ActiveSupport::Cache::Entry # Creates a new cache entry for the specified value. Options supported are # +:compressed+, +:version+, +:expires_at+ and +:expires_in+. # - # @return [Entry] a new instance of Entry - # - # source://activesupport//lib/active_support/cache/entry.rb#25 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:25 def initialize(value, compressed: T.unsafe(nil), version: T.unsafe(nil), expires_in: T.unsafe(nil), expires_at: T.unsafe(nil), **_arg5); end # Returns the size of the cached value. This could be less than # value.bytesize if the data is compressed. # - # source://activesupport//lib/active_support/cache/entry.rb#61 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:61 def bytesize; end - # source://activesupport//lib/active_support/cache/entry.rb#76 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:76 def compressed(compress_threshold); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/entry.rb#72 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:72 def compressed?; end # Duplicates the value in a class. This is used by cache implementations that don't natively # serialize entries to protect against accidental cache modifications. # - # source://activesupport//lib/active_support/cache/entry.rb#106 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:106 def dup_value!; end # Checks if the entry is expired. The +expires_in+ parameter can override # the value set when the entry was created. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/entry.rb#43 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:43 def expired?; end - # source://activesupport//lib/active_support/cache/entry.rb#47 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:47 def expires_at; end - # source://activesupport//lib/active_support/cache/entry.rb#51 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:51 def expires_at=(value); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/entry.rb#100 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:100 def local?; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/entry.rb#37 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:37 def mismatched?(version); end - # source://activesupport//lib/active_support/cache/entry.rb#116 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:116 def pack; end - # source://activesupport//lib/active_support/cache/entry.rb#33 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:33 def value; end - # Returns the value of attribute version. - # - # source://activesupport//lib/active_support/cache/entry.rb#21 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:21 def version; end private - # source://activesupport//lib/active_support/cache/entry.rb#127 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:127 def marshal_load(payload); end - # source://activesupport//lib/active_support/cache/entry.rb#123 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:123 def uncompress(value); end class << self - # source://activesupport//lib/active_support/cache/entry.rb#16 + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:16 def unpack(members); end end end @@ -977,28 +1016,24 @@ end # # A cache store implementation which stores everything on the filesystem. # -# source://activesupport//lib/active_support/cache/file_store.rb#12 +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:12 class ActiveSupport::Cache::FileStore < ::ActiveSupport::Cache::Store - # @return [FileStore] a new instance of FileStore - # - # source://activesupport//lib/active_support/cache/file_store.rb#20 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:20 def initialize(cache_path, **options); end - # Returns the value of attribute cache_path. - # - # source://activesupport//lib/active_support/cache/file_store.rb#13 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:13 def cache_path; end # Preemptively iterates through all stored keys and removes the ones which have expired. # - # source://activesupport//lib/active_support/cache/file_store.rb#40 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:40 def cleanup(options = T.unsafe(nil)); end # Deletes all items from the cache. In this case it deletes all the entries in the specified # file store directory except for .keep or .gitkeep. Be careful which directory is specified in your # config file when using +FileStore+ because everything in that directory will be deleted. # - # source://activesupport//lib/active_support/cache/file_store.rb#33 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:33 def clear(options = T.unsafe(nil)); end # Decrement a cached integer value. Returns the updated value. @@ -1012,10 +1047,10 @@ class ActiveSupport::Cache::FileStore < ::ActiveSupport::Cache::Store # cache.write("baz", 5) # cache.decrement("baz") # => 4 # - # source://activesupport//lib/active_support/cache/file_store.rb#80 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:80 def decrement(name, amount = T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/cache/file_store.rb#89 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:89 def delete_matched(matcher, options = T.unsafe(nil)); end # Increment a cached integer value. Returns the updated value. @@ -1030,87 +1065,85 @@ class ActiveSupport::Cache::FileStore < ::ActiveSupport::Cache::Store # cache.write("baz", 5) # cache.increment("baz") # => 6 # - # source://activesupport//lib/active_support/cache/file_store.rb#60 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:60 def increment(name, amount = T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/cache/file_store.rb#101 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:101 def inspect; end private # Delete empty directories in the cache. # - # source://activesupport//lib/active_support/cache/file_store.rb#195 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:195 def delete_empty_directories(dir); end - # source://activesupport//lib/active_support/cache/file_store.rb#131 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:131 def delete_entry(key, **options); end # Make sure a file path's directories exist. # - # source://activesupport//lib/active_support/cache/file_store.rb#204 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:204 def ensure_cache_path(path); end # Translate a file path into a key. # - # source://activesupport//lib/active_support/cache/file_store.rb#189 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:189 def file_path_key(path); end # Lock a file for a block so only one process can modify it at a time. # - # source://activesupport//lib/active_support/cache/file_store.rb#148 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:148 def lock_file(file_name, &block); end # Modifies the amount of an integer value that is stored in the cache. # If the key is not found it is created and set to +amount+. # - # source://activesupport//lib/active_support/cache/file_store.rb#222 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:222 def modify_value(name, amount, options); end # Translate a key into a file path. # - # source://activesupport//lib/active_support/cache/file_store.rb#162 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:162 def normalize_key(key, options); end - # source://activesupport//lib/active_support/cache/file_store.rb#106 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:106 def read_entry(key, **options); end - # source://activesupport//lib/active_support/cache/file_store.rb#113 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:113 def read_serialized_entry(key, **_arg1); end - # source://activesupport//lib/active_support/cache/file_store.rb#208 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:208 def search_dir(dir, &callback); end - # source://activesupport//lib/active_support/cache/file_store.rb#120 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:120 def write_entry(key, entry, **options); end - # source://activesupport//lib/active_support/cache/file_store.rb#124 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:124 def write_serialized_entry(key, payload, **options); end class << self # Advertise cache versioning support. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/file_store.rb#26 + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:26 def supports_cache_versioning?; end end end -# source://activesupport//lib/active_support/cache/file_store.rb#15 +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:15 ActiveSupport::Cache::FileStore::DIR_FORMATTER = T.let(T.unsafe(nil), String) -# max filename size on file system is 255, minus room for timestamp, pid, and random characters appended by Tempfile (used by atomic write) -# -# source://activesupport//lib/active_support/cache/file_store.rb#16 +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:16 ActiveSupport::Cache::FileStore::FILENAME_MAX_SIZE = T.let(T.unsafe(nil), Integer) -# max is 1024, plus some room +# max filename size on file system is 255, minus room for timestamp, pid, and random characters appended by Tempfile (used by atomic write) # -# source://activesupport//lib/active_support/cache/file_store.rb#17 +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:17 ActiveSupport::Cache::FileStore::FILEPATH_MAX_SIZE = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/cache/file_store.rb#18 +# max is 1024, plus some room +# +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:18 ActiveSupport::Cache::FileStore::GITKEEP_FILES = T.let(T.unsafe(nil), Array) # = Memory \Cache \Store @@ -1135,21 +1168,21 @@ ActiveSupport::Cache::FileStore::GITKEEP_FILES = T.let(T.unsafe(nil), Array) # # +MemoryStore+ is thread-safe. # -# source://activesupport//lib/active_support/cache/memory_store.rb#28 +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:28 class ActiveSupport::Cache::MemoryStore < ::ActiveSupport::Cache::Store - # @return [MemoryStore] a new instance of MemoryStore - # - # source://activesupport//lib/active_support/cache/memory_store.rb#73 + include ::ActiveSupport::Cache::Strategy::LocalCache + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:75 def initialize(options = T.unsafe(nil)); end # Preemptively iterates through all stored keys and removes the ones which have expired. # - # source://activesupport//lib/active_support/cache/memory_store.rb#101 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:103 def cleanup(options = T.unsafe(nil)); end # Delete all data stored in a given cache store. # - # source://activesupport//lib/active_support/cache/memory_store.rb#93 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:95 def clear(options = T.unsafe(nil)); end # Decrement a cached integer value. Returns the updated value. @@ -1163,12 +1196,12 @@ class ActiveSupport::Cache::MemoryStore < ::ActiveSupport::Cache::Store # cache.write("baz", 5) # cache.decrement("baz") # => 4 # - # source://activesupport//lib/active_support/cache/memory_store.rb#166 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:168 def decrement(name, amount = T.unsafe(nil), **options); end # Deletes cache entries if the cache key matches a given pattern. # - # source://activesupport//lib/active_support/cache/memory_store.rb#173 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:175 def delete_matched(matcher, options = T.unsafe(nil)); end # Increment a cached integer value. Returns the updated value. @@ -1183,87 +1216,83 @@ class ActiveSupport::Cache::MemoryStore < ::ActiveSupport::Cache::Store # cache.write("baz", 5) # cache.increment("baz") # => 6 # - # source://activesupport//lib/active_support/cache/memory_store.rb#149 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:151 def increment(name, amount = T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/cache/memory_store.rb#185 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:187 def inspect; end # To ensure entries fit within the specified memory prune the cache by removing the least # recently accessed entries. # - # source://activesupport//lib/active_support/cache/memory_store.rb#114 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:116 def prune(target_size, max_time = T.unsafe(nil)); end # Returns true if the cache is currently being pruned. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/memory_store.rb#133 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:135 def pruning?; end # Synchronize calls to the cache. This should be called wherever the underlying cache implementation # is not thread safe. # - # source://activesupport//lib/active_support/cache/memory_store.rb#191 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:193 def synchronize(&block); end private - # source://activesupport//lib/active_support/cache/memory_store.rb#198 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:200 def cached_size(key, payload); end - # source://activesupport//lib/active_support/cache/memory_store.rb#231 - def delete_entry(key, **options); end + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:233 + def delete_entry(key, **_arg1); end # Modifies the amount of an integer value that is stored in the cache. # If the key is not found it is created and set to +amount+. # - # source://activesupport//lib/active_support/cache/memory_store.rb#241 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:243 def modify_value(name, amount, **options); end - # source://activesupport//lib/active_support/cache/memory_store.rb#202 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:204 def read_entry(key, **options); end - # source://activesupport//lib/active_support/cache/memory_store.rb#214 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:216 def write_entry(key, entry, **options); end class << self # Advertise cache versioning support. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/memory_store.rb#88 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:90 def supports_cache_versioning?; end end end -# source://activesupport//lib/active_support/cache/memory_store.rb#29 +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:31 module ActiveSupport::Cache::MemoryStore::DupCoder extend ::ActiveSupport::Cache::MemoryStore::DupCoder - # source://activesupport//lib/active_support/cache/memory_store.rb#32 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:34 def dump(entry); end - # source://activesupport//lib/active_support/cache/memory_store.rb#40 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:42 def dump_compressed(entry, threshold); end - # source://activesupport//lib/active_support/cache/memory_store.rb#45 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:47 def load(entry); end private - # source://activesupport//lib/active_support/cache/memory_store.rb#56 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:58 def dump_value(value); end - # source://activesupport//lib/active_support/cache/memory_store.rb#64 + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:66 def load_value(string); end end -# source://activesupport//lib/active_support/cache/memory_store.rb#54 +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:56 ActiveSupport::Cache::MemoryStore::DupCoder::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/cache/memory_store.rb#196 +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:198 ActiveSupport::Cache::MemoryStore::PER_ENTRY_OVERHEAD = T.let(T.unsafe(nil), Integer) # = Null \Cache \Store @@ -1276,171 +1305,159 @@ ActiveSupport::Cache::MemoryStore::PER_ENTRY_OVERHEAD = T.let(T.unsafe(nil), Int # be cached inside blocks that utilize this strategy. See # ActiveSupport::Cache::Strategy::LocalCache for more details. # -# source://activesupport//lib/active_support/cache/null_store.rb#14 +# pkg:gem/activesupport#lib/active_support/cache/null_store.rb:14 class ActiveSupport::Cache::NullStore < ::ActiveSupport::Cache::Store include ::ActiveSupport::Cache::Strategy::LocalCache - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#85 + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:25 def cleanup(options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#79 + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:22 def clear(options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#104 + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:31 def decrement(name, amount = T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#91 + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:34 def delete_matched(matcher, options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#97 + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:28 def increment(name, amount = T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/cache/null_store.rb#37 + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:37 def inspect; end private - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#198 + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:57 def delete_entry(key, **_arg1); end - # source://activesupport//lib/active_support/cache/null_store.rb#42 + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:42 def read_entry(key, **s); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#146 + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:46 def read_serialized_entry(key, raw: T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/cache/null_store.rb#49 + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:49 def write_entry(key, entry, **_arg2); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#189 + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:53 def write_serialized_entry(key, payload, **_arg2); end class << self # Advertise cache versioning support. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/null_store.rb#18 + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:18 def supports_cache_versioning?; end end end # Mapping of canonical option names to aliases that a store will recognize. # -# source://activesupport//lib/active_support/cache.rb#42 +# pkg:gem/activesupport#lib/active_support/cache.rb:43 ActiveSupport::Cache::OPTION_ALIASES = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#8 +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:8 module ActiveSupport::Cache::SerializerWithFallback - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#17 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:17 def load(dumped); end private - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#39 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:39 def marshal_load(payload); end class << self - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#9 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:9 def [](format); end end end -# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#66 +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:66 module ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback include ::ActiveSupport::Cache::SerializerWithFallback extend ::ActiveSupport::Cache::SerializerWithFallback extend ::ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#88 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:88 def _load(marked); end - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#73 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:73 def dump(entry); end - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#77 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:77 def dump_compressed(entry, threshold); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#94 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:94 def dumped?(dumped); end end -# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#71 +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:71 ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback::MARK_COMPRESSED = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#70 +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:70 ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback::MARK_UNCOMPRESSED = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#99 +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:99 module ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback include ::ActiveSupport::Cache::SerializerWithFallback extend ::ActiveSupport::Cache::SerializerWithFallback extend ::ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#109 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:109 def _load(dumped); end - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#105 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:105 def dump(value); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#113 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:113 def dumped?(dumped); end end -# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#103 +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:103 ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#118 +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:118 module ActiveSupport::Cache::SerializerWithFallback::MessagePackWithFallback include ::ActiveSupport::Cache::SerializerWithFallback extend ::ActiveSupport::Cache::SerializerWithFallback extend ::ActiveSupport::Cache::SerializerWithFallback::MessagePackWithFallback - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#126 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:126 def _load(dumped); end - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#122 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:122 def dump(value); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#130 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:130 def dumped?(dumped); end private - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#135 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:135 def available?; end end -# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#45 +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:45 module ActiveSupport::Cache::SerializerWithFallback::PassthroughWithFallback include ::ActiveSupport::Cache::SerializerWithFallback extend ::ActiveSupport::Cache::SerializerWithFallback extend ::ActiveSupport::Cache::SerializerWithFallback::PassthroughWithFallback - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#57 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:57 def _load(entry); end - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#49 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:49 def dump(entry); end - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#53 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:53 def dump_compressed(entry, threshold); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#61 + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:61 def dumped?(dumped); end end -# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#144 +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:144 ActiveSupport::Cache::SerializerWithFallback::SERIALIZERS = T.let(T.unsafe(nil), Hash) # = Active Support \Cache \Store @@ -1485,7 +1502,7 @@ ActiveSupport::Cache::SerializerWithFallback::SERIALIZERS = T.let(T.unsafe(nil), # cache.namespace = -> { @last_mod_time } # Set the namespace to a variable # @last_mod_time = Time.now # Invalidate the entire cache by changing namespace # -# source://activesupport//lib/active_support/cache.rb#189 +# pkg:gem/activesupport#lib/active_support/cache.rb:190 class ActiveSupport::Cache::Store # Creates a new cache. # @@ -1559,9 +1576,7 @@ class ActiveSupport::Cache::Store # Any other specified options are treated as default options for the # relevant cache operations, such as #read, #write, and #fetch. # - # @return [Store] a new instance of Store - # - # source://activesupport//lib/active_support/cache.rb#296 + # pkg:gem/activesupport#lib/active_support/cache.rb:300 def initialize(options = T.unsafe(nil)); end # Cleans up the cache by removing expired entries. @@ -1570,9 +1585,7 @@ class ActiveSupport::Cache::Store # # Some implementations may not support this method. # - # @raise [NotImplementedError] - # - # source://activesupport//lib/active_support/cache.rb#750 + # pkg:gem/activesupport#lib/active_support/cache.rb:785 def cleanup(options = T.unsafe(nil)); end # Clears the entire cache. Be careful with this method since it could @@ -1582,9 +1595,7 @@ class ActiveSupport::Cache::Store # # Some implementations may not support this method. # - # @raise [NotImplementedError] - # - # source://activesupport//lib/active_support/cache.rb#760 + # pkg:gem/activesupport#lib/active_support/cache.rb:795 def clear(options = T.unsafe(nil)); end # Decrements an integer value in the cache. @@ -1593,9 +1604,7 @@ class ActiveSupport::Cache::Store # # Some implementations may not support this method. # - # @raise [NotImplementedError] - # - # source://activesupport//lib/active_support/cache.rb#741 + # pkg:gem/activesupport#lib/active_support/cache.rb:750 def decrement(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end # Deletes an entry in the cache. Returns +true+ if an entry is deleted @@ -1603,7 +1612,7 @@ class ActiveSupport::Cache::Store # # Options are passed to the underlying cache implementation. # - # source://activesupport//lib/active_support/cache.rb#677 + # pkg:gem/activesupport#lib/active_support/cache.rb:686 def delete(name, options = T.unsafe(nil)); end # Deletes all entries with keys matching the pattern. @@ -1612,9 +1621,7 @@ class ActiveSupport::Cache::Store # # Some implementations may not support this method. # - # @raise [NotImplementedError] - # - # source://activesupport//lib/active_support/cache.rb#723 + # pkg:gem/activesupport#lib/active_support/cache.rb:732 def delete_matched(matcher, options = T.unsafe(nil)); end # Deletes multiple entries in the cache. Returns the number of deleted @@ -1622,16 +1629,14 @@ class ActiveSupport::Cache::Store # # Options are passed to the underlying cache implementation. # - # source://activesupport//lib/active_support/cache.rb#690 + # pkg:gem/activesupport#lib/active_support/cache.rb:699 def delete_multi(names, options = T.unsafe(nil)); end # Returns +true+ if the cache contains an entry for the given key. # # Options are passed to the underlying cache implementation. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/cache.rb#704 + # pkg:gem/activesupport#lib/active_support/cache.rb:713 def exist?(name, options = T.unsafe(nil)); end # Fetches data from the cache, using the given key. If there is data in @@ -1749,7 +1754,7 @@ class ActiveSupport::Cache::Store # token # end # - # source://activesupport//lib/active_support/cache.rb#445 + # pkg:gem/activesupport#lib/active_support/cache.rb:452 def fetch(name, options = T.unsafe(nil), &block); end # Fetches data from the cache, using the given keys. If there is data in @@ -1782,9 +1787,7 @@ class ActiveSupport::Cache::Store # cache.read("fizz") # # => nil # - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/cache.rb#596 + # pkg:gem/activesupport#lib/active_support/cache.rb:603 def fetch_multi(*names); end # Increments an integer value in the cache. @@ -1793,34 +1796,41 @@ class ActiveSupport::Cache::Store # # Some implementations may not support this method. # - # @raise [NotImplementedError] - # - # source://activesupport//lib/active_support/cache.rb#732 + # pkg:gem/activesupport#lib/active_support/cache.rb:741 def increment(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache.rb#190 + # pkg:gem/activesupport#lib/active_support/cache.rb:197 def logger; end - # source://activesupport//lib/active_support/cache.rb#190 + # pkg:gem/activesupport#lib/active_support/cache.rb:197 def logger=(val); end # Silences the logger within a block. # - # source://activesupport//lib/active_support/cache.rb#323 + # pkg:gem/activesupport#lib/active_support/cache.rb:330 def mute; end - # source://activesupport//lib/active_support/cache.rb#714 - def new_entry(value, options = T.unsafe(nil)); end + # Get the current namespace + # + # pkg:gem/activesupport#lib/active_support/cache.rb:800 + def namespace; end - # Returns the value of attribute options. + # Set the current namespace. Note, this will be ignored if custom + # options are passed to cache wills with a namespace key. # - # source://activesupport//lib/active_support/cache.rb#193 + # pkg:gem/activesupport#lib/active_support/cache.rb:806 + def namespace=(namespace); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:723 + def new_entry(value, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:200 def options; end - # source://activesupport//lib/active_support/cache.rb#191 + # pkg:gem/activesupport#lib/active_support/cache.rb:198 def raise_on_invalid_cache_expiration_time; end - # source://activesupport//lib/active_support/cache.rb#191 + # pkg:gem/activesupport#lib/active_support/cache.rb:198 def raise_on_invalid_cache_expiration_time=(val); end # Reads data from the cache, using the given key. If there is data in @@ -1840,9 +1850,21 @@ class ActiveSupport::Cache::Store # # Other options will be handled by the specific cache store implementation. # - # source://activesupport//lib/active_support/cache.rb#499 + # pkg:gem/activesupport#lib/active_support/cache.rb:506 def read(name, options = T.unsafe(nil)); end + # Reads a counter that was set by #increment / #decrement. + # + # cache.write_counter("foo", 1) + # cache.read_counter("foo") # => 1 + # cache.increment("foo") + # cache.read_counter("foo") # => 2 + # + # Options are passed to the underlying cache implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:762 + def read_counter(name, **options); end + # Reads multiple values at once from the cache. Options can be passed # in the last argument. # @@ -1850,22 +1872,18 @@ class ActiveSupport::Cache::Store # # Returns a hash mapping the names provided to the values found. # - # source://activesupport//lib/active_support/cache.rb#537 + # pkg:gem/activesupport#lib/active_support/cache.rb:544 def read_multi(*names); end - # Returns the value of attribute silence. - # - # source://activesupport//lib/active_support/cache.rb#193 + # pkg:gem/activesupport#lib/active_support/cache.rb:200 def silence; end # Silences the logger. # - # source://activesupport//lib/active_support/cache.rb#317 + # pkg:gem/activesupport#lib/active_support/cache.rb:324 def silence!; end - # Returns the value of attribute silence. - # - # source://activesupport//lib/active_support/cache.rb#193 + # pkg:gem/activesupport#lib/active_support/cache.rb:201 def silence?; end # Writes the value to the cache with the key. The value must be supported @@ -1903,64 +1921,79 @@ class ActiveSupport::Cache::Store # version, the read will be treated as a cache miss. This feature is # used to support recyclable cache keys. # + # * +:unless_exist+ - Prevents overwriting an existing cache entry. + # # Other options will be handled by the specific cache store implementation. # - # source://activesupport//lib/active_support/cache.rb#663 + # pkg:gem/activesupport#lib/active_support/cache.rb:672 def write(name, value, options = T.unsafe(nil)); end + # Writes a counter that can then be modified by #increment / #decrement. + # + # cache.write_counter("foo", 1) + # cache.read_counter("foo") # => 1 + # cache.increment("foo") + # cache.read_counter("foo") # => 2 + # + # Options are passed to the underlying cache implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:775 + def write_counter(name, value, **options); end + # Cache Storage API to write multiple values at once. # - # source://activesupport//lib/active_support/cache.rb#552 + # pkg:gem/activesupport#lib/active_support/cache.rb:559 def write_multi(hash, options = T.unsafe(nil)); end private - # source://activesupport//lib/active_support/cache.rb#1011 + # pkg:gem/activesupport#lib/active_support/cache.rb:1074 def _instrument(operation, multi: T.unsafe(nil), options: T.unsafe(nil), **payload, &block); end - # source://activesupport//lib/active_support/cache.rb#765 + # pkg:gem/activesupport#lib/active_support/cache.rb:811 def default_serializer; end # Deletes an entry from the cache implementation. Subclasses must # implement this method. # - # @raise [NotImplementedError] - # - # source://activesupport//lib/active_support/cache.rb#851 + # pkg:gem/activesupport#lib/active_support/cache.rb:897 def delete_entry(key, **options); end # Deletes multiples entries in the cache implementation. Subclasses MAY # implement this method. # - # source://activesupport//lib/active_support/cache.rb#857 + # pkg:gem/activesupport#lib/active_support/cache.rb:903 def delete_multi_entries(entries, **options); end - # source://activesupport//lib/active_support/cache.rb#816 + # pkg:gem/activesupport#lib/active_support/cache.rb:862 def deserialize_entry(payload, **_arg1); end + # pkg:gem/activesupport#lib/active_support/cache.rb:984 + def expand_and_namespace_key(key, options = T.unsafe(nil)); end + # Expands key to be a consistent string value. Invokes +cache_key+ if # object responds to +cache_key+. Otherwise, +to_param+ method will be # called. If the key is a Hash, then keys will be sorted alphabetically. # - # source://activesupport//lib/active_support/cache.rb#974 + # pkg:gem/activesupport#lib/active_support/cache.rb:1037 def expanded_key(key); end - # source://activesupport//lib/active_support/cache.rb#995 + # pkg:gem/activesupport#lib/active_support/cache.rb:1058 def expanded_version(key); end - # source://activesupport//lib/active_support/cache.rb#1048 + # pkg:gem/activesupport#lib/active_support/cache.rb:1111 def get_entry_value(entry, name, options); end - # source://activesupport//lib/active_support/cache.rb#1032 + # pkg:gem/activesupport#lib/active_support/cache.rb:1095 def handle_expired_entry(entry, key, options); end - # source://activesupport//lib/active_support/cache.rb#891 + # pkg:gem/activesupport#lib/active_support/cache.rb:937 def handle_invalid_expires_in(message); end - # source://activesupport//lib/active_support/cache.rb#1003 + # pkg:gem/activesupport#lib/active_support/cache.rb:1066 def instrument(operation, key, options = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/cache.rb#1007 + # pkg:gem/activesupport#lib/active_support/cache.rb:1070 def instrument_multi(operation, keys, options = T.unsafe(nil), &block); end # Adds the namespace defined in the options to a pattern designed to @@ -1968,12 +2001,12 @@ class ActiveSupport::Cache::Store # this method to translate a pattern that matches names into one that # matches namespaced keys. # - # source://activesupport//lib/active_support/cache.rb#780 + # pkg:gem/activesupport#lib/active_support/cache.rb:826 def key_matcher(pattern, options); end # Merges the default options with ones specific to a method call. # - # source://activesupport//lib/active_support/cache.rb#862 + # pkg:gem/activesupport#lib/active_support/cache.rb:908 def merged_options(call_options); end # Prefix the key with a namespace string: @@ -1986,84 +2019,91 @@ class ActiveSupport::Cache::Store # namespace_key 'foo', namespace: -> { 'cache' } # # => 'cache:foo' # - # source://activesupport//lib/active_support/cache.rb#949 + # pkg:gem/activesupport#lib/active_support/cache.rb:1012 def namespace_key(key, call_options = T.unsafe(nil)); end - # Expands and namespaces the cache key. + # Expands, namespaces and truncates the cache key. # Raises an exception when the key is +nil+ or an empty string. # May be overridden by cache stores to do additional normalization. # - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/cache.rb#933 + # pkg:gem/activesupport#lib/active_support/cache.rb:979 def normalize_key(key, options = T.unsafe(nil)); end # Normalize aliased options to their canonical form # - # source://activesupport//lib/active_support/cache.rb#902 + # pkg:gem/activesupport#lib/active_support/cache.rb:948 def normalize_options(options); end - # source://activesupport//lib/active_support/cache.rb#991 + # pkg:gem/activesupport#lib/active_support/cache.rb:1054 def normalize_version(key, options = T.unsafe(nil)); end # Reads an entry from the cache implementation. Subclasses must implement # this method. # - # @raise [NotImplementedError] - # - # source://activesupport//lib/active_support/cache.rb#797 + # pkg:gem/activesupport#lib/active_support/cache.rb:843 def read_entry(key, **options); end # Reads multiple entries from the cache implementation. Subclasses MAY # implement this method. # - # source://activesupport//lib/active_support/cache.rb#824 + # pkg:gem/activesupport#lib/active_support/cache.rb:870 def read_multi_entries(names, **options); end - # source://activesupport//lib/active_support/cache.rb#1053 + # pkg:gem/activesupport#lib/active_support/cache.rb:1116 def save_block_result_to_cache(name, key, options); end - # source://activesupport//lib/active_support/cache.rb#807 + # pkg:gem/activesupport#lib/active_support/cache.rb:853 def serialize_entry(entry, **options); end - # source://activesupport//lib/active_support/cache.rb#913 + # pkg:gem/activesupport#lib/active_support/cache.rb:991 + def truncate_key(key); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:959 def validate_options(options); end # Writes an entry to the cache implementation. Subclasses must implement # this method. # - # @raise [NotImplementedError] - # - # source://activesupport//lib/active_support/cache.rb#803 + # pkg:gem/activesupport#lib/active_support/cache.rb:849 def write_entry(key, entry, **options); end # Writes multiple entries to the cache implementation. Subclasses MAY # implement this method. # - # source://activesupport//lib/active_support/cache.rb#843 + # pkg:gem/activesupport#lib/active_support/cache.rb:889 def write_multi_entries(hash, **options); end class << self - # source://activesupport//lib/active_support/cache.rb#190 + # pkg:gem/activesupport#lib/active_support/cache.rb:197 def logger; end - # source://activesupport//lib/active_support/cache.rb#190 + # pkg:gem/activesupport#lib/active_support/cache.rb:197 def logger=(val); end - # source://activesupport//lib/active_support/cache.rb#191 + # pkg:gem/activesupport#lib/active_support/cache.rb:198 def raise_on_invalid_cache_expiration_time; end - # source://activesupport//lib/active_support/cache.rb#191 + # pkg:gem/activesupport#lib/active_support/cache.rb:198 def raise_on_invalid_cache_expiration_time=(val); end private - # source://activesupport//lib/active_support/cache.rb#201 + # pkg:gem/activesupport#lib/active_support/cache.rb:205 def retrieve_pool_options(options); end end end -# source://activesupport//lib/active_support/cache.rb#52 +# Default +ConnectionPool+ options +# +# pkg:gem/activesupport#lib/active_support/cache.rb:192 +ActiveSupport::Cache::Store::DEFAULT_POOL_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Keys are truncated with the Active Support digest if they exceed the limit. +# +# pkg:gem/activesupport#lib/active_support/cache.rb:195 +ActiveSupport::Cache::Store::MAX_KEY_SIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/cache.rb:53 module ActiveSupport::Cache::Strategy; end # = Local \Cache \Strategy @@ -2072,77 +2112,89 @@ module ActiveSupport::Cache::Strategy; end # duration of a block. Repeated calls to the cache for the same key will hit the # in-memory cache for faster access. # -# source://activesupport//lib/active_support/cache/strategy/local_cache.rb#13 +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:13 module ActiveSupport::Cache::Strategy::LocalCache - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#85 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:98 def cleanup(options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#79 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:92 def clear(options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#104 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:117 def decrement(name, amount = T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#91 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:104 def delete_matched(matcher, options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#111 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:124 def fetch_multi(*names, &block); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#97 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:110 def increment(name, amount = T.unsafe(nil), **options); end + # The current local cache. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:82 + def local_cache; end + # Middleware class can be inserted as a Rack handler to be local cache for the # duration of request. # - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#73 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:88 def middleware; end + # Set a new local cache. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:72 + def new_local_cache; end + + # Unset the current local cache. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:77 + def unset_local_cache; end + # Use a local cache for the duration of block. # - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#67 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:67 def with_local_cache(&block); end private - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#221 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:230 def bypass_local_cache(&block); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#198 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:211 def delete_entry(key, **_arg1); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#217 - def local_cache; end - - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#213 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:226 def local_cache_key; end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#160 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:173 def read_multi_entries(names, **options); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#146 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:159 def read_serialized_entry(key, raw: T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#225 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:234 def use_temporary_local_cache(temporary_cache); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#203 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:216 def write_cache_value(name, value, **options); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#189 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:202 def write_serialized_entry(key, payload, **_arg2); end end # Class for storing and registering the local caches. # -# source://activesupport//lib/active_support/cache/strategy/local_cache.rb#17 +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:17 module ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry extend ::ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#20 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:20 def cache_for(local_cache_key); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#25 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:25 def set_cache_for(local_cache_key, value); end end @@ -2151,36 +2203,34 @@ end # Simple memory backed cache. This cache is not thread safe and is intended only # for serving as a temporary memory cache for a single thread. # -# source://activesupport//lib/active_support/cache/strategy/local_cache.rb#35 +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:35 class ActiveSupport::Cache::Strategy::LocalCache::LocalStore - # @return [LocalStore] a new instance of LocalStore - # - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#36 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:36 def initialize; end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#40 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:40 def clear(options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#57 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:57 def delete_entry(key); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#61 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:61 def fetch_entry(key); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#44 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:44 def read_entry(key); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#48 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:48 def read_multi_entries(keys); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#52 + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:52 def write_entry(key, entry); end end # These options mean something to all cache implementations. Individual cache # implementations may support additional options. # -# source://activesupport//lib/active_support/cache.rb#26 +# pkg:gem/activesupport#lib/active_support/cache.rb:26 ActiveSupport::Cache::UNIVERSAL_OPTIONS = T.let(T.unsafe(nil), Array) # Enables the dynamic configuration of Cache entry options while ensuring @@ -2188,37 +2238,35 @@ ActiveSupport::Cache::UNIVERSAL_OPTIONS = T.let(T.unsafe(nil), Array) # ActiveSupport::Cache::Store#fetch, the second argument will be an # instance of +WriteOptions+. # -# source://activesupport//lib/active_support/cache.rb#1069 +# pkg:gem/activesupport#lib/active_support/cache.rb:1132 class ActiveSupport::Cache::WriteOptions - # @return [WriteOptions] a new instance of WriteOptions - # - # source://activesupport//lib/active_support/cache.rb#1070 + # pkg:gem/activesupport#lib/active_support/cache.rb:1133 def initialize(options); end - # source://activesupport//lib/active_support/cache.rb#1094 + # pkg:gem/activesupport#lib/active_support/cache.rb:1157 def expires_at; end # Sets the Cache entry's +expires_at+ value. If an +expires_in+ option was # previously set, this will unset it since +expires_at+ and +expires_in+ # cannot both be set. # - # source://activesupport//lib/active_support/cache.rb#1101 + # pkg:gem/activesupport#lib/active_support/cache.rb:1164 def expires_at=(expires_at); end - # source://activesupport//lib/active_support/cache.rb#1082 + # pkg:gem/activesupport#lib/active_support/cache.rb:1145 def expires_in; end # Sets the Cache entry's +expires_in+ value. If an +expires_at+ option was # previously set, this will unset it since +expires_in+ and +expires_at+ # cannot both be set. # - # source://activesupport//lib/active_support/cache.rb#1089 + # pkg:gem/activesupport#lib/active_support/cache.rb:1152 def expires_in=(expires_in); end - # source://activesupport//lib/active_support/cache.rb#1074 + # pkg:gem/activesupport#lib/active_support/cache.rb:1137 def version; end - # source://activesupport//lib/active_support/cache.rb#1078 + # pkg:gem/activesupport#lib/active_support/cache.rb:1141 def version=(version); end end @@ -2228,16 +2276,14 @@ end # re-executing the key generation process when it's called using the same +salt+ and # +key_size+. # -# source://activesupport//lib/active_support/key_generator.rb#55 +# pkg:gem/activesupport#lib/active_support/key_generator.rb:55 class ActiveSupport::CachingKeyGenerator - # @return [CachingKeyGenerator] a new instance of CachingKeyGenerator - # - # source://activesupport//lib/active_support/key_generator.rb#56 + # pkg:gem/activesupport#lib/active_support/key_generator.rb:56 def initialize(key_generator); end # Returns a derived key suitable for use. # - # source://activesupport//lib/active_support/key_generator.rb#62 + # pkg:gem/activesupport#lib/active_support/key_generator.rb:62 def generate_key(*args); end end @@ -2295,7 +2341,7 @@ end # - save # saved # -# source://activesupport//lib/active_support/callbacks.rb#64 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:65 module ActiveSupport::Callbacks extend ::ActiveSupport::Concern include GeneratedInstanceMethods @@ -2327,7 +2373,7 @@ module ActiveSupport::Callbacks # smoothly through and into the supplied block, we want as little evidence # as possible that we were here. # - # source://activesupport//lib/active_support/callbacks.rb#96 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:97 def run_callbacks(kind, type = T.unsafe(nil)); end private @@ -2336,7 +2382,7 @@ module ActiveSupport::Callbacks # This can be overridden in ActiveSupport::Callbacks implementors in order # to provide better debugging/logging. # - # source://activesupport//lib/active_support/callbacks.rb#149 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:150 def halted_callback_hook(filter, name); end module GeneratedClassMethods @@ -2349,13 +2395,13 @@ module ActiveSupport::Callbacks end end -# source://activesupport//lib/active_support/callbacks.rb#72 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:73 ActiveSupport::Callbacks::CALLBACK_FILTER_TYPES = T.let(T.unsafe(nil), Array) # A future invocation of user-supplied code (either as a callback, # or a condition filter). # -# source://activesupport//lib/active_support/callbacks.rb#336 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:337 module ActiveSupport::Callbacks::CallTemplate class << self # Filters support: @@ -2367,69 +2413,59 @@ module ActiveSupport::Callbacks::CallTemplate # All of these objects are converted into a CallTemplate and handled # the same after this point. # - # source://activesupport//lib/active_support/callbacks.rb#494 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:495 def build(filter, callback); end end end -# source://activesupport//lib/active_support/callbacks.rb#395 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:396 class ActiveSupport::Callbacks::CallTemplate::InstanceExec0 - # @return [InstanceExec0] a new instance of InstanceExec0 - # - # source://activesupport//lib/active_support/callbacks.rb#396 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:397 def initialize(block); end - # source://activesupport//lib/active_support/callbacks.rb#400 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:401 def expand(target, value, block); end - # source://activesupport//lib/active_support/callbacks.rb#410 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:411 def inverted_lambda; end - # source://activesupport//lib/active_support/callbacks.rb#404 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:405 def make_lambda; end end -# source://activesupport//lib/active_support/callbacks.rb#417 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:418 class ActiveSupport::Callbacks::CallTemplate::InstanceExec1 - # @return [InstanceExec1] a new instance of InstanceExec1 - # - # source://activesupport//lib/active_support/callbacks.rb#418 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:419 def initialize(block); end - # source://activesupport//lib/active_support/callbacks.rb#422 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:423 def expand(target, value, block); end - # source://activesupport//lib/active_support/callbacks.rb#432 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:433 def inverted_lambda; end - # source://activesupport//lib/active_support/callbacks.rb#426 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:427 def make_lambda; end end -# source://activesupport//lib/active_support/callbacks.rb#439 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:440 class ActiveSupport::Callbacks::CallTemplate::InstanceExec2 - # @return [InstanceExec2] a new instance of InstanceExec2 - # - # source://activesupport//lib/active_support/callbacks.rb#440 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:441 def initialize(block); end - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/callbacks.rb#444 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:445 def expand(target, value, block); end - # source://activesupport//lib/active_support/callbacks.rb#456 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:457 def inverted_lambda; end - # source://activesupport//lib/active_support/callbacks.rb#449 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:450 def make_lambda; end end -# source://activesupport//lib/active_support/callbacks.rb#337 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:338 class ActiveSupport::Callbacks::CallTemplate::MethodCall - # @return [MethodCall] a new instance of MethodCall - # - # source://activesupport//lib/active_support/callbacks.rb#338 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:339 def initialize(method); end # Return the parts needed to make this call, with the given @@ -2446,256 +2482,218 @@ class ActiveSupport::Callbacks::CallTemplate::MethodCall # The actual invocation is left up to the caller to minimize # call stack pollution. # - # source://activesupport//lib/active_support/callbacks.rb#355 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:356 def expand(target, value, block); end - # source://activesupport//lib/active_support/callbacks.rb#365 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:366 def inverted_lambda; end - # source://activesupport//lib/active_support/callbacks.rb#359 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:360 def make_lambda; end end -# source://activesupport//lib/active_support/callbacks.rb#372 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:373 class ActiveSupport::Callbacks::CallTemplate::ObjectCall - # @return [ObjectCall] a new instance of ObjectCall - # - # source://activesupport//lib/active_support/callbacks.rb#373 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:374 def initialize(target, method); end - # source://activesupport//lib/active_support/callbacks.rb#378 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:379 def expand(target, value, block); end - # source://activesupport//lib/active_support/callbacks.rb#388 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:389 def inverted_lambda; end - # source://activesupport//lib/active_support/callbacks.rb#382 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:383 def make_lambda; end end -# source://activesupport//lib/active_support/callbacks.rb#464 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:465 class ActiveSupport::Callbacks::CallTemplate::ProcCall - # @return [ProcCall] a new instance of ProcCall - # - # source://activesupport//lib/active_support/callbacks.rb#465 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:466 def initialize(target); end - # source://activesupport//lib/active_support/callbacks.rb#469 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:470 def expand(target, value, block); end - # source://activesupport//lib/active_support/callbacks.rb#479 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:480 def inverted_lambda; end - # source://activesupport//lib/active_support/callbacks.rb#473 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:474 def make_lambda; end end -# source://activesupport//lib/active_support/callbacks.rb#230 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:231 class ActiveSupport::Callbacks::Callback - # @return [Callback] a new instance of Callback - # - # source://activesupport//lib/active_support/callbacks.rb#245 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:246 def initialize(name, filter, kind, options, chain_config); end # Wraps code with filter # - # source://activesupport//lib/active_support/callbacks.rb#299 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:300 def apply(callback_sequence); end - # Returns the value of attribute chain_config. - # - # source://activesupport//lib/active_support/callbacks.rb#243 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:244 def chain_config; end - # source://activesupport//lib/active_support/callbacks.rb#281 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:282 def compiled; end - # source://activesupport//lib/active_support/callbacks.rb#303 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:304 def current_scopes; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/callbacks.rb#272 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:273 def duplicates?(other); end - # Returns the value of attribute filter. - # - # source://activesupport//lib/active_support/callbacks.rb#243 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:244 def filter; end - # Returns the value of attribute kind. - # - # source://activesupport//lib/active_support/callbacks.rb#242 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:243 def kind; end - # Sets the attribute kind - # - # @param value the value to set the attribute kind to. - # - # source://activesupport//lib/active_support/callbacks.rb#242 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:243 def kind=(_arg0); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/callbacks.rb#268 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:269 def matches?(_kind, _filter); end - # source://activesupport//lib/active_support/callbacks.rb#256 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:257 def merge_conditional_options(chain, if_option:, unless_option:); end - # Returns the value of attribute name. - # - # source://activesupport//lib/active_support/callbacks.rb#242 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:243 def name; end - # Sets the attribute name - # - # @param value the value to set the attribute name to. - # - # source://activesupport//lib/active_support/callbacks.rb#242 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:243 def name=(_arg0); end private - # source://activesupport//lib/active_support/callbacks.rb#311 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:312 def check_conditionals(conditionals); end - # source://activesupport//lib/active_support/callbacks.rb#326 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:327 def conditions_lambdas; end class << self - # source://activesupport//lib/active_support/callbacks.rb#231 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:232 def build(chain, filter, kind, options); end end end -# source://activesupport//lib/active_support/callbacks.rb#308 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:309 ActiveSupport::Callbacks::Callback::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/callbacks.rb#567 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:568 class ActiveSupport::Callbacks::CallbackChain include ::Enumerable - # @return [CallbackChain] a new instance of CallbackChain - # - # source://activesupport//lib/active_support/callbacks.rb#572 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:573 def initialize(name, config); end - # source://activesupport//lib/active_support/callbacks.rb#632 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:633 def append(*callbacks); end - # source://activesupport//lib/active_support/callbacks.rb#600 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:601 def clear; end - # source://activesupport//lib/active_support/callbacks.rb#614 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:615 def compile(type); end - # Returns the value of attribute config. - # - # source://activesupport//lib/active_support/callbacks.rb#570 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:571 def config; end - # source://activesupport//lib/active_support/callbacks.rb#594 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:595 def delete(o); end - # source://activesupport//lib/active_support/callbacks.rb#584 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:585 def each(&block); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/callbacks.rb#586 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:587 def empty?; end - # source://activesupport//lib/active_support/callbacks.rb#585 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:586 def index(o); end - # source://activesupport//lib/active_support/callbacks.rb#588 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:589 def insert(index, o); end - # Returns the value of attribute name. - # - # source://activesupport//lib/active_support/callbacks.rb#570 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:571 def name; end - # source://activesupport//lib/active_support/callbacks.rb#636 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:637 def prepend(*callbacks); end protected - # Returns the value of attribute chain. - # - # source://activesupport//lib/active_support/callbacks.rb#641 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:642 def chain; end private - # source://activesupport//lib/active_support/callbacks.rb#644 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:645 def append_one(callback); end - # source://activesupport//lib/active_support/callbacks.rb#664 - def default_terminator; end - - # source://activesupport//lib/active_support/callbacks.rb#607 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:608 def initialize_copy(other); end - # source://activesupport//lib/active_support/callbacks.rb#651 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:652 def prepend_one(callback); end - # source://activesupport//lib/active_support/callbacks.rb#658 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:659 def remove_duplicates(callback); end end +# pkg:gem/activesupport#lib/active_support/callbacks.rb:675 +ActiveSupport::Callbacks::CallbackChain::DEFAULT_TERMINATOR = T.let(T.unsafe(nil), ActiveSupport::Callbacks::CallbackChain::DefaultTerminator) + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:665 +class ActiveSupport::Callbacks::CallbackChain::DefaultTerminator + # pkg:gem/activesupport#lib/active_support/callbacks.rb:666 + def call(target, result_lambda); end +end + # Execute before and after filters in a sequence instead of # chaining them with nested lambda calls, see: # https://github.com/rails/rails/issues/18011 # -# source://activesupport//lib/active_support/callbacks.rb#518 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:519 class ActiveSupport::Callbacks::CallbackSequence - # @return [CallbackSequence] a new instance of CallbackSequence - # - # source://activesupport//lib/active_support/callbacks.rb#519 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:520 def initialize(nested = T.unsafe(nil), call_template = T.unsafe(nil), user_conditions = T.unsafe(nil)); end - # source://activesupport//lib/active_support/callbacks.rb#534 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:535 def after(after); end - # source://activesupport//lib/active_support/callbacks.rb#540 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:541 def around(call_template, user_conditions); end - # source://activesupport//lib/active_support/callbacks.rb#528 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:529 def before(before); end - # source://activesupport//lib/active_support/callbacks.rb#554 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:555 def expand_call_template(arg, block); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/callbacks.rb#550 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:551 def final?; end - # source://activesupport//lib/active_support/callbacks.rb#562 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:563 def invoke_after(arg); end - # source://activesupport//lib/active_support/callbacks.rb#558 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:559 def invoke_before(arg); end - # Returns the value of attribute nested. - # - # source://activesupport//lib/active_support/callbacks.rb#548 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:549 def nested; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/callbacks.rb#544 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:545 def skip?(arg); end end -# source://activesupport//lib/active_support/callbacks.rb#676 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:678 module ActiveSupport::Callbacks::ClassMethods # This is used internally to append, prepend and skip callbacks to the # CallbackChain. # - # source://activesupport//lib/active_support/callbacks.rb#686 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:688 def __update_callbacks(name); end # Define sets of events in the object life cycle that support callbacks. @@ -2777,15 +2775,15 @@ module ActiveSupport::Callbacks::ClassMethods # Calling +define_callbacks+ multiple times with the same +names+ will # overwrite previous callbacks registered with #set_callback. # - # source://activesupport//lib/active_support/callbacks.rb#901 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:903 def define_callbacks(*names); end - # source://activesupport//lib/active_support/callbacks.rb#677 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:679 def normalize_callback_params(filters, block); end # Remove all set callbacks for the given event. # - # source://activesupport//lib/active_support/callbacks.rb#811 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:813 def reset_callbacks(name); end # Install a callback for the given event. @@ -2833,7 +2831,7 @@ module ActiveSupport::Callbacks::ClassMethods # * :prepend - If +true+, the callback will be prepended to the # existing chain rather than appended. # - # source://activesupport//lib/active_support/callbacks.rb#737 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:739 def set_callback(name, *filter_list, &block); end # Skip a previously set callback. Like #set_callback, :if or @@ -2872,211 +2870,175 @@ module ActiveSupport::Callbacks::ClassMethods # An ArgumentError will be raised if the callback has not # already been set (unless the :raise option is set to false). # - # source://activesupport//lib/active_support/callbacks.rb#786 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:788 def skip_callback(name, *filter_list, &block); end protected - # source://activesupport//lib/active_support/callbacks.rb#932 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:939 def get_callbacks(name); end - # source://activesupport//lib/active_support/callbacks.rb#936 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:943 def set_callbacks(name, callbacks); end end -# source://activesupport//lib/active_support/callbacks.rb#152 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:153 module ActiveSupport::Callbacks::Conditionals; end -# source://activesupport//lib/active_support/callbacks.rb#153 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:154 class ActiveSupport::Callbacks::Conditionals::Value - # @return [Value] a new instance of Value - # - # source://activesupport//lib/active_support/callbacks.rb#154 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:155 def initialize(&block); end - # source://activesupport//lib/active_support/callbacks.rb#157 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:158 def call(target, value); end end -# source://activesupport//lib/active_support/callbacks.rb#161 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:162 module ActiveSupport::Callbacks::Filters; end -# source://activesupport//lib/active_support/callbacks.rb#193 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:194 class ActiveSupport::Callbacks::Filters::After - # @return [After] a new instance of After - # - # source://activesupport//lib/active_support/callbacks.rb#195 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:196 def initialize(user_callback, user_conditions, chain_config); end - # source://activesupport//lib/active_support/callbacks.rb#213 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:214 def apply(callback_sequence); end - # source://activesupport//lib/active_support/callbacks.rb#201 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:202 def call(env); end - # Returns the value of attribute halting. - # - # source://activesupport//lib/active_support/callbacks.rb#194 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:195 def halting; end - # Returns the value of attribute user_callback. - # - # source://activesupport//lib/active_support/callbacks.rb#194 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:195 def user_callback; end - # Returns the value of attribute user_conditions. - # - # source://activesupport//lib/active_support/callbacks.rb#194 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:195 def user_conditions; end end -# source://activesupport//lib/active_support/callbacks.rb#218 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:219 class ActiveSupport::Callbacks::Filters::Around - # @return [Around] a new instance of Around - # - # source://activesupport//lib/active_support/callbacks.rb#219 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:220 def initialize(user_callback, user_conditions); end - # source://activesupport//lib/active_support/callbacks.rb#224 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:225 def apply(callback_sequence); end end -# source://activesupport//lib/active_support/callbacks.rb#164 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:165 class ActiveSupport::Callbacks::Filters::Before - # @return [Before] a new instance of Before - # - # source://activesupport//lib/active_support/callbacks.rb#165 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:166 def initialize(user_callback, user_conditions, chain_config, filter, name); end - # source://activesupport//lib/active_support/callbacks.rb#188 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:189 def apply(callback_sequence); end - # source://activesupport//lib/active_support/callbacks.rb#172 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:173 def call(env); end - # Returns the value of attribute filter. - # - # source://activesupport//lib/active_support/callbacks.rb#170 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 def filter; end - # Returns the value of attribute halted_lambda. - # - # source://activesupport//lib/active_support/callbacks.rb#170 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 def halted_lambda; end - # Returns the value of attribute name. - # - # source://activesupport//lib/active_support/callbacks.rb#170 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 def name; end - # Returns the value of attribute user_callback. - # - # source://activesupport//lib/active_support/callbacks.rb#170 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 def user_callback; end - # Returns the value of attribute user_conditions. - # - # source://activesupport//lib/active_support/callbacks.rb#170 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 def user_conditions; end end -# source://activesupport//lib/active_support/callbacks.rb#162 +# pkg:gem/activesupport#lib/active_support/callbacks.rb:163 class ActiveSupport::Callbacks::Filters::Environment < ::Struct - # Returns the value of attribute halted - # - # @return [Object] the current value of halted + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 def halted; end - # Sets the attribute halted - # - # @param value [Object] the value to set the attribute halted to. - # @return [Object] the newly set value + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 def halted=(_); end - # Returns the value of attribute target - # - # @return [Object] the current value of target + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 def target; end - # Sets the attribute target - # - # @param value [Object] the value to set the attribute target to. - # @return [Object] the newly set value + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 def target=(_); end - # Returns the value of attribute value - # - # @return [Object] the current value of value + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 def value; end - # Sets the attribute value - # - # @param value [Object] the value to set the attribute value to. - # @return [Object] the newly set value + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 def value=(_); end class << self + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 def inspect; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 def members; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 def new(*_arg0); end end end -# source://activesupport//lib/active_support/class_attribute.rb#4 +# pkg:gem/activesupport#lib/active_support/class_attribute.rb:4 module ActiveSupport::ClassAttribute class << self - # source://activesupport//lib/active_support/class_attribute.rb#6 + # pkg:gem/activesupport#lib/active_support/class_attribute.rb:6 def redefine(owner, name, namespaced_name, value); end - # source://activesupport//lib/active_support/class_attribute.rb#26 + # pkg:gem/activesupport#lib/active_support/class_attribute.rb:26 def redefine_method(owner, name, private: T.unsafe(nil), &block); end end end -# source://activesupport//lib/active_support/code_generator.rb#4 +# pkg:gem/activesupport#lib/active_support/code_generator.rb:4 class ActiveSupport::CodeGenerator - # @return [CodeGenerator] a new instance of CodeGenerator - # - # source://activesupport//lib/active_support/code_generator.rb#53 + # pkg:gem/activesupport#lib/active_support/code_generator.rb:53 def initialize(owner, path, line); end - # @yield [@sources] - # - # source://activesupport//lib/active_support/code_generator.rb#61 + # pkg:gem/activesupport#lib/active_support/code_generator.rb:61 def class_eval; end - # source://activesupport//lib/active_support/code_generator.rb#65 + # pkg:gem/activesupport#lib/active_support/code_generator.rb:65 def define_cached_method(canonical_name, namespace:, as: T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/code_generator.rb#69 + # pkg:gem/activesupport#lib/active_support/code_generator.rb:69 def execute; end class << self - # source://activesupport//lib/active_support/code_generator.rb#41 + # pkg:gem/activesupport#lib/active_support/code_generator.rb:41 def batch(owner, path, line); end end end -# source://activesupport//lib/active_support/code_generator.rb#5 +# pkg:gem/activesupport#lib/active_support/code_generator.rb:5 class ActiveSupport::CodeGenerator::MethodSet - # @return [MethodSet] a new instance of MethodSet - # - # source://activesupport//lib/active_support/code_generator.rb#8 + # pkg:gem/activesupport#lib/active_support/code_generator.rb:8 def initialize(namespace); end - # source://activesupport//lib/active_support/code_generator.rb#28 + # pkg:gem/activesupport#lib/active_support/code_generator.rb:28 def apply(owner, path, line); end - # source://activesupport//lib/active_support/code_generator.rb#15 + # pkg:gem/activesupport#lib/active_support/code_generator.rb:15 def define_cached_method(canonical_name, as: T.unsafe(nil)); end end -# source://activesupport//lib/active_support/code_generator.rb#6 +# pkg:gem/activesupport#lib/active_support/code_generator.rb:6 ActiveSupport::CodeGenerator::MethodSet::METHOD_CACHES = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/core_ext/range/compare_range.rb#4 +# pkg:gem/activesupport#lib/active_support/core_ext/range/compare_range.rb:4 module ActiveSupport::CompareWithRange # Extends the default Range#=== to support range comparisons. # (1..5) === (1..5) # => true @@ -3090,7 +3052,7 @@ module ActiveSupport::CompareWithRange # # The given range must be fully bounded, with both start and end. # - # source://activesupport//lib/active_support/core_ext/range/compare_range.rb#16 + # pkg:gem/activesupport#lib/active_support/core_ext/range/compare_range.rb:16 def ===(value); end # Extends the default Range#include? to support range comparisons. @@ -3105,9 +3067,7 @@ module ActiveSupport::CompareWithRange # # The given range must be fully bounded, with both start and end. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/range/compare_range.rb#41 + # pkg:gem/activesupport#lib/active_support/core_ext/range/compare_range.rb:41 def include?(value); end end @@ -3220,9 +3180,9 @@ end # # prepend is also used for any dependencies. # -# source://activesupport//lib/active_support/concern.rb#112 +# pkg:gem/activesupport#lib/active_support/concern.rb:112 module ActiveSupport::Concern - # source://activesupport//lib/active_support/concern.rb#129 + # pkg:gem/activesupport#lib/active_support/concern.rb:129 def append_features(base); end # Define class methods from given block. @@ -3246,62 +3206,56 @@ module ActiveSupport::Concern # Buzz.foo # => "foo" # Buzz.bar # => private method 'bar' called for Buzz:Class(NoMethodError) # - # source://activesupport//lib/active_support/concern.rb#209 + # pkg:gem/activesupport#lib/active_support/concern.rb:209 def class_methods(&class_methods_module_definition); end # Evaluate given block in context of base class, # so that you can write class macros here. # When you define more than one +included+ block, it raises an exception. # - # source://activesupport//lib/active_support/concern.rb#158 + # pkg:gem/activesupport#lib/active_support/concern.rb:158 def included(base = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/concern.rb#142 + # pkg:gem/activesupport#lib/active_support/concern.rb:142 def prepend_features(base); end # Evaluate given block in context of base class, # so that you can write class macros here. # When you define more than one +prepended+ block, it raises an exception. # - # source://activesupport//lib/active_support/concern.rb#175 + # pkg:gem/activesupport#lib/active_support/concern.rb:175 def prepended(base = T.unsafe(nil), &block); end class << self - # source://activesupport//lib/active_support/concern.rb#125 + # pkg:gem/activesupport#lib/active_support/concern.rb:125 def extended(base); end end end -# source://activesupport//lib/active_support/concern.rb#113 +# pkg:gem/activesupport#lib/active_support/concern.rb:113 class ActiveSupport::Concern::MultipleIncludedBlocks < ::StandardError - # @return [MultipleIncludedBlocks] a new instance of MultipleIncludedBlocks - # - # source://activesupport//lib/active_support/concern.rb#114 + # pkg:gem/activesupport#lib/active_support/concern.rb:114 def initialize; end end -# source://activesupport//lib/active_support/concern.rb#119 +# pkg:gem/activesupport#lib/active_support/concern.rb:119 class ActiveSupport::Concern::MultiplePrependBlocks < ::StandardError - # @return [MultiplePrependBlocks] a new instance of MultiplePrependBlocks - # - # source://activesupport//lib/active_support/concern.rb#120 + # pkg:gem/activesupport#lib/active_support/concern.rb:120 def initialize; end end -# source://activesupport//lib/active_support/concurrency/share_lock.rb#6 +# pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:6 module ActiveSupport::Concurrency; end # A share/exclusive lock, otherwise known as a read/write lock. # # https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock # -# source://activesupport//lib/active_support/concurrency/share_lock.rb#10 +# pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:10 class ActiveSupport::Concurrency::ShareLock include ::MonitorMixin - # @return [ShareLock] a new instance of ShareLock - # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#49 + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:49 def initialize; end # Execute the supplied block while holding the Exclusive lock. If @@ -3311,19 +3265,19 @@ class ActiveSupport::Concurrency::ShareLock # # See +start_exclusive+ for other options. # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#147 + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:147 def exclusive(purpose: T.unsafe(nil), compatible: T.unsafe(nil), after_compatible: T.unsafe(nil), no_wait: T.unsafe(nil)); end # We track Thread objects, instead of just using counters, because # we need exclusive locks to be reentrant, and we need to be able # to upgrade share locks to exclusive. # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#17 + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:17 def raw_state; end # Execute the supplied block while holding the Share lock. # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#158 + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:158 def sharing; end # Returns false if +no_wait+ is set and the lock is not @@ -3341,48 +3295,42 @@ class ActiveSupport::Concurrency::ShareLock # +purpose+ matching, it is possible to yield only to other # threads whose activity will not interfere. # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#75 + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:75 def start_exclusive(purpose: T.unsafe(nil), compatible: T.unsafe(nil), no_wait: T.unsafe(nil)); end - # source://activesupport//lib/active_support/concurrency/share_lock.rb#113 + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:113 def start_sharing; end # Relinquish the exclusive lock. Must only be called by the thread # that called start_exclusive (and currently holds the lock). # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#95 + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:95 def stop_exclusive(compatible: T.unsafe(nil)); end - # source://activesupport//lib/active_support/concurrency/share_lock.rb#130 + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:130 def stop_sharing; end # Temporarily give up all held Share locks while executing the # supplied block, allowing any +compatible+ exclusive lock request # to proceed. # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#170 + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:170 def yield_shares(purpose: T.unsafe(nil), compatible: T.unsafe(nil), block_share: T.unsafe(nil)); end private # Must be called within synchronize # - # @return [Boolean] - # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#203 + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:203 def busy_for_exclusive?(purpose); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#208 + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:208 def busy_for_sharing?(purpose); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#213 + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:213 def eligible_waiters?(compatible); end - # source://activesupport//lib/active_support/concurrency/share_lock.rb#217 + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:217 def wait_for(method, &block); end end @@ -3391,7 +3339,7 @@ end # Configurable provides a config method to store and retrieve # configuration options as an OrderedOptions. # -# source://activesupport//lib/active_support/configurable.rb#11 +# pkg:gem/activesupport#lib/active_support/configurable.rb:17 module ActiveSupport::Configurable extend ::ActiveSupport::Concern @@ -3413,18 +3361,46 @@ module ActiveSupport::Configurable # user.config.allowed_access # => true # user.config.level # => 1 # - # source://activesupport//lib/active_support/configurable.rb#155 + # pkg:gem/activesupport#lib/active_support/configurable.rb:189 def config; end end -# source://activesupport//lib/active_support/configurable.rb#29 +# pkg:gem/activesupport#lib/active_support/configurable.rb:35 module ActiveSupport::Configurable::ClassMethods - # source://activesupport//lib/active_support/configurable.rb#30 + # Reads and writes attributes from a configuration OrderedOptions. + # + # require "active_support/configurable" + # + # class User + # include ActiveSupport::Configurable + # end + # + # User.config.allowed_access = true + # User.config.level = 1 + # + # User.config.allowed_access # => true + # User.config.level # => 1 + # + # pkg:gem/activesupport#lib/active_support/configurable.rb:49 def config; end - # @yield [config] + # Configure values from within the passed block. + # + # require "active_support/configurable" + # + # class User + # include ActiveSupport::Configurable + # end + # + # User.allowed_access # => nil + # + # User.configure do |config| + # config.allowed_access = true + # end + # + # User.allowed_access # => true # - # source://activesupport//lib/active_support/configurable.rb#39 + # pkg:gem/activesupport#lib/active_support/configurable.rb:73 def configure; end private @@ -3498,22 +3474,22 @@ module ActiveSupport::Configurable::ClassMethods # User.allowed_access # => false # User.hair_colors # => [:brown, :black, :blonde, :red] # - # source://activesupport//lib/active_support/configurable.rb#111 + # pkg:gem/activesupport#lib/active_support/configurable.rb:145 def config_accessor(*names, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end - # source://activesupport//lib/active_support/configurable.rb#132 + # pkg:gem/activesupport#lib/active_support/configurable.rb:166 def inherited(subclass); end end -# source://activesupport//lib/active_support/configurable.rb#14 +# pkg:gem/activesupport#lib/active_support/configurable.rb:20 class ActiveSupport::Configurable::Configuration < ::ActiveSupport::InheritableOptions - # source://activesupport//lib/active_support/configurable.rb#15 + # pkg:gem/activesupport#lib/active_support/configurable.rb:21 def compile_methods!; end class << self # Compiles reader methods so we don't have to go through method_missing. # - # source://activesupport//lib/active_support/configurable.rb#20 + # pkg:gem/activesupport#lib/active_support/configurable.rb:26 def compile_methods!(keys); end end end @@ -3524,80 +3500,186 @@ end # Warns in case of YAML confusing characters, like invisible # non-breaking spaces. # -# source://activesupport//lib/active_support/configuration_file.rb#9 +# pkg:gem/activesupport#lib/active_support/configuration_file.rb:9 class ActiveSupport::ConfigurationFile - # @return [ConfigurationFile] a new instance of ConfigurationFile - # - # source://activesupport//lib/active_support/configuration_file.rb#12 + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:12 def initialize(content_path); end - # source://activesupport//lib/active_support/configuration_file.rb#21 + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:21 def parse(context: T.unsafe(nil), **options); end private - # source://activesupport//lib/active_support/configuration_file.rb#44 + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:44 def read(content_path); end - # source://activesupport//lib/active_support/configuration_file.rb#54 + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:54 def render(context); end class << self - # source://activesupport//lib/active_support/configuration_file.rb#17 + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:17 def parse(content_path, **options); end end end -# source://activesupport//lib/active_support/configuration_file.rb#10 +# pkg:gem/activesupport#lib/active_support/configuration_file.rb:10 class ActiveSupport::ConfigurationFile::FormatError < ::StandardError; end -# source://activesupport//lib/active_support/core_ext/erb/util.rb#6 -module ActiveSupport::CoreExt; end +# Provides a DSL for declaring a continuous integration workflow that can be run either locally or in the cloud. +# Each step is timed, reports success/error, and is aggregated into a collective report that reports total runtime, +# as well as whether the entire run was successful or not. +# +# Example: +# +# ActiveSupport::ContinuousIntegration.run do +# step "Setup", "bin/setup --skip-server" +# step "Style: Ruby", "bin/rubocop" +# step "Security: Gem audit", "bin/bundler-audit" +# step "Tests: Rails", "bin/rails test test:system" +# +# if success? +# step "Signoff: Ready for merge and deploy", "gh signoff" +# else +# failure "Skipping signoff; CI failed.", "Fix the issues and try again." +# end +# end +# +# Starting with Rails 8.1, a default `bin/ci` and `config/ci.rb` file are created to provide out-of-the-box CI. +# +# pkg:gem/activesupport#lib/active_support/continuous_integration.rb:24 +class ActiveSupport::ContinuousIntegration + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:64 + def initialize; end -# source://activesupport//lib/active_support/core_ext/erb/util.rb#7 -module ActiveSupport::CoreExt::ERBUtil - # A utility method for escaping HTML tag characters. - # This method is also aliased as h. + # Echo text to the terminal in the color corresponding to the type of the text. # - # puts html_escape('is a > 0 & a < 10?') - # # => is a > 0 & a < 10? + # Examples: # - # source://activesupport//lib/active_support/core_ext/erb/util.rb#25 - def h(s); end + # echo "This is going to be green!", type: :success + # echo "This is going to be red!", type: :error + # + # See ActiveSupport::ContinuousIntegration::COLORS for a complete list of options. + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:111 + def echo(text, type:); end - # A utility method for escaping HTML tag characters. - # This method is also aliased as h. + # Display an error heading with the title and optional subtitle to reflect that the run failed. # - # puts html_escape('is a > 0 & a < 10?') - # # => is a > 0 & a < 10? + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:86 + def failure(title, subtitle = T.unsafe(nil)); end + + # Display a colorized heading followed by an optional subtitle. # - # source://activesupport//lib/active_support/core_ext/erb/util.rb#25 - def html_escape(s); end + # Examples: + # + # heading "Smoke Testing", "End-to-end tests verifying key functionality", padding: false + # heading "Skipping video encoding tests", "Install FFmpeg to run these tests", type: :error + # + # See ActiveSupport::ContinuousIntegration::COLORS for a complete list of options. + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:98 + def heading(heading, subtitle = T.unsafe(nil), type: T.unsafe(nil), padding: T.unsafe(nil)); end - # HTML escapes strings but doesn't wrap them with an ActiveSupport::SafeBuffer. - # This method is not for public consumption! Seriously! + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:116 + def report(title, &block); end + + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:33 + def results; end + + # Declare a step with a title and a command. The command can either be given as a single string or as multiple + # strings that will be passed to `system` as individual arguments (and therefore correctly escaped for paths etc). # - # source://activesupport//lib/active_support/core_ext/erb/util.rb#10 - def unwrapped_html_escape(s); end -end + # Examples: + # + # step "Setup", "bin/setup" + # step "Single test", "bin/rails", "test", "--name", "test_that_is_one" + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:75 + def step(title, *command); end -# source://activesupport//lib/active_support/core_ext/erb/util.rb#31 -module ActiveSupport::CoreExt::ERBUtilPrivate - include ::ActiveSupport::CoreExt::ERBUtil + # Returns true if all steps were successful. + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:81 + def success?; end private - # source://activesupport//lib/active_support/core_ext/erb/util.rb#25 - def h(s); end - - # source://activesupport//lib/active_support/core_ext/erb/util.rb#25 - def html_escape(s); end + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:141 + def colorize(text, type); end - # source://activesupport//lib/active_support/core_ext/erb/util.rb#10 - def unwrapped_html_escape(s); end -end + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:134 + def timing; end -# = Current Attributes + class << self + # Perform a CI run. Execute each step, show their results and runtime, and exit with a non-zero status if there are any failures. + # + # Pass an optional title, subtitle, and a block that declares the steps to be executed. + # + # Sets the CI environment variable to "true" to allow for conditional behavior in the app, like enabling eager loading and disabling logging. + # + # Example: + # + # ActiveSupport::ContinuousIntegration.run do + # step "Setup", "bin/setup --skip-server" + # step "Style: Ruby", "bin/rubocop" + # step "Security: Gem audit", "bin/bundler-audit" + # step "Tests: Rails", "bin/rails test test:system" + # + # if success? + # step "Signoff: Ready for merge and deploy", "gh signoff" + # else + # failure "Skipping signoff; CI failed.", "Fix the issues and try again." + # end + # end + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:55 + def run(title = T.unsafe(nil), subtitle = T.unsafe(nil), &block); end + end +end + +# pkg:gem/activesupport#lib/active_support/continuous_integration.rb:25 +ActiveSupport::ContinuousIntegration::COLORS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:6 +module ActiveSupport::CoreExt; end + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:7 +module ActiveSupport::CoreExt::ERBUtil + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:28 + def h(s); end + + # HTML escapes strings but doesn't wrap them with an ActiveSupport::SafeBuffer. + # This method is not for public consumption! Seriously! + # A utility method for escaping HTML tag characters. + # This method is also aliased as h. + # + # puts html_escape('is a > 0 & a < 10?') + # # => is a > 0 & a < 10? + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:10 + def html_escape(s); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:18 + def unwrapped_html_escape(s); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:31 +module ActiveSupport::CoreExt::ERBUtilPrivate + include ::ActiveSupport::CoreExt::ERBUtil + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:33 + def h(s); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:33 + def html_escape(s); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:33 + def unwrapped_html_escape(s); end +end + +# = Current Attributes # # Abstract super class that provides a thread-isolated attributes singleton, which resets automatically # before and after each request. This allows you to keep all the per-request attributes easily @@ -3681,47 +3763,42 @@ end # The attributes stuck in Current should be used by more or less all actions on all requests. If you start # sticking controller-specific attributes in there, you're going to create a mess. # -# source://activesupport//lib/active_support/current_attributes.rb#92 +# pkg:gem/activesupport#lib/active_support/current_attributes.rb:93 class ActiveSupport::CurrentAttributes include ::ActiveSupport::Callbacks extend ::ActiveSupport::Callbacks::ClassMethods extend ::ActiveSupport::DescendantsTracker - # @return [CurrentAttributes] a new instance of CurrentAttributes - # - # source://activesupport//lib/active_support/current_attributes.rb#206 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 def initialize; end - # source://activesupport//lib/active_support/callbacks.rb#69 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 def __callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#924 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 def _reset_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#912 - def _run_reset_callbacks(&block); end + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 + def _run_reset_callbacks; end - # Returns the value of attribute attributes. - # - # source://activesupport//lib/active_support/current_attributes.rb#204 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 + def _run_reset_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 def attributes; end - # Sets the attribute attributes - # - # @param value the value to set the attribute attributes to. - # - # source://activesupport//lib/active_support/current_attributes.rb#204 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 def attributes=(_arg0); end - # source://activesupport//lib/active_support/current_attributes.rb#202 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 def defaults; end - # source://activesupport//lib/active_support/current_attributes.rb#202 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 def defaults?; end # Reset all attributes. Should be called before and after actions, when used as a per-request singleton. # - # source://activesupport//lib/active_support/current_attributes.rb#225 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 def reset; end # Expose one or more attributes within a block. Old values are returned after the block concludes. @@ -3735,30 +3812,28 @@ class ActiveSupport::CurrentAttributes # end # end # - # source://activesupport//lib/active_support/current_attributes.rb#220 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 def set(attributes, &block); end private - # source://activesupport//lib/active_support/current_attributes.rb#232 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 def resolve_defaults; end class << self - # source://activesupport//lib/active_support/callbacks.rb#69 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 def __callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#69 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 def __callbacks=(value); end - # source://activesupport//lib/active_support/callbacks.rb#916 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 def _reset_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#920 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 def _reset_callbacks=(value); end - # Calls this callback after #reset is called on the instance. Used for resetting external collaborators, like Time.zone. - # - # source://activesupport//lib/active_support/current_attributes.rb#149 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:153 def after_reset(*methods, &block); end # Declares one or more attributes that will be given both class and instance accessor methods. @@ -3770,99 +3845,105 @@ class ActiveSupport::CurrentAttributes # constructed. Otherwise, the value will be duplicated with +#dup+. # Default values are re-assigned when the attributes are reset. # - # source://activesupport//lib/active_support/current_attributes.rb#114 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:115 def attribute(*names, default: T.unsafe(nil)); end - # source://activesupport//lib/active_support/current_attributes.rb#198 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:197 def attributes(&_arg0); end - # source://activesupport//lib/active_support/current_attributes.rb#198 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:197 def attributes=(arg); end # Calls this callback before #reset is called on the instance. Used for resetting external collaborators that depend on current values. # - # source://activesupport//lib/active_support/current_attributes.rb#144 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:145 def before_reset(*methods, &block); end - # source://activesupport//lib/active_support/current_attributes.rb#160 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:157 def clear_all; end - # source://activesupport//lib/active_support/current_attributes.rb#202 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 def defaults; end - # source://activesupport//lib/active_support/current_attributes.rb#202 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 def defaults=(value); end - # source://activesupport//lib/active_support/current_attributes.rb#202 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 def defaults?; end # Returns singleton instance for this class in this thread. If none exists, one is created. # - # source://activesupport//lib/active_support/current_attributes.rb#102 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:103 def instance; end - # source://activesupport//lib/active_support/current_attributes.rb#154 + # Reset all attributes. Should be called before and after actions, when used as a per-request singleton. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:155 def reset(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/current_attributes.rb#156 - def reset_all; end - # Calls this callback after #reset is called on the instance. Used for resetting external collaborators, like Time.zone. # - # source://activesupport//lib/active_support/current_attributes.rb#149 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:150 def resets(*methods, &block); end - # source://activesupport//lib/active_support/current_attributes.rb#154 + # Expose one or more attributes within a block. Old values are returned after the block concludes. + # Example demonstrating the common use of needing to set Current attributes outside the request-cycle: + # + # class Chat::PublicationJob < ApplicationJob + # def perform(attributes, room_number, creator) + # Current.set(person: creator) do + # Chat::Publisher.publish(attributes: attributes, room_number: room_number) + # end + # end + # end + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:155 def set(*_arg0, **_arg1, &_arg2); end private - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 def __class_attr___callbacks; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 def __class_attr___callbacks=(new_value); end - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 def __class_attr_defaults; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 def __class_attr_defaults=(new_value); end - # source://activesupport//lib/active_support/current_attributes.rb#170 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:169 def current_instances; end - # source://activesupport//lib/active_support/current_attributes.rb#174 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:173 def current_instances_key; end - # source://activesupport//lib/active_support/current_attributes.rb#166 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:165 def generated_attribute_methods; end - # @private - # - # source://activesupport//lib/active_support/current_attributes.rb#186 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:185 def method_added(name); end - # source://activesupport//lib/active_support/current_attributes.rb#178 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:177 def method_missing(name, *_arg1, **_arg2, &_arg3); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/current_attributes.rb#182 + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:181 def respond_to_missing?(name, _); end end end -# source://activesupport//lib/active_support/current_attributes.rb#96 +# pkg:gem/activesupport#lib/active_support/current_attributes.rb:97 ActiveSupport::CurrentAttributes::INVALID_ATTRIBUTE_NAMES = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/current_attributes.rb#98 +# pkg:gem/activesupport#lib/active_support/current_attributes.rb:99 ActiveSupport::CurrentAttributes::NOT_SET = T.let(T.unsafe(nil), Object) # Provides +deep_merge+ and +deep_merge!+ methods. Expects the including class # to provide a merge!(other, &block) method. # -# source://activesupport//lib/active_support/deep_mergeable.rb#6 +# pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:6 module ActiveSupport::DeepMergeable # Returns a new instance with the values from +other+ merged recursively. # @@ -3886,83 +3967,81 @@ module ActiveSupport::DeepMergeable # end # # => { a: 100, b: 450, c: { c1: 300 } } # - # source://activesupport//lib/active_support/deep_mergeable.rb#29 + # pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:29 def deep_merge(other, &block); end # Same as #deep_merge, but modifies +self+. # - # source://activesupport//lib/active_support/deep_mergeable.rb#34 + # pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:34 def deep_merge!(other, &block); end # Returns true if +other+ can be deep merged into +self+. Classes may # override this method to restrict or expand the domain of deep mergeable # values. Defaults to checking that +other+ is of type +self.class+. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/deep_mergeable.rb#49 + # pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:49 def deep_merge?(other); end end -# source://activesupport//lib/active_support/delegation.rb#14 +# pkg:gem/activesupport#lib/active_support/delegation.rb:14 module ActiveSupport::Delegation class << self - # source://activesupport//lib/active_support/delegation.rb#21 + # pkg:gem/activesupport#lib/active_support/delegation.rb:21 def generate(owner, methods, location: T.unsafe(nil), to: T.unsafe(nil), prefix: T.unsafe(nil), allow_nil: T.unsafe(nil), nilable: T.unsafe(nil), private: T.unsafe(nil), as: T.unsafe(nil), signature: T.unsafe(nil)); end - # source://activesupport//lib/active_support/delegation.rb#150 + # pkg:gem/activesupport#lib/active_support/delegation.rb:150 def generate_method_missing(owner, target, allow_nil: T.unsafe(nil)); end end end -# source://activesupport//lib/active_support/delegation.rb#18 +# pkg:gem/activesupport#lib/active_support/delegation.rb:18 ActiveSupport::Delegation::RESERVED_METHOD_NAMES = T.let(T.unsafe(nil), Set) -# source://activesupport//lib/active_support/delegation.rb#15 +# pkg:gem/activesupport#lib/active_support/delegation.rb:15 ActiveSupport::Delegation::RUBY_RESERVED_KEYWORDS = T.let(T.unsafe(nil), Array) # Error generated by +delegate+ when a method is called on +nil+ and +allow_nil+ # option is not used. # -# source://activesupport//lib/active_support/delegation.rb#6 +# pkg:gem/activesupport#lib/active_support/delegation.rb:6 class ActiveSupport::DelegationError < ::NoMethodError class << self - # source://activesupport//lib/active_support/delegation.rb#8 + # pkg:gem/activesupport#lib/active_support/delegation.rb:8 def nil_target(method_name, target); end end end -# source://activesupport//lib/active_support/dependencies/interlock.rb#6 +# pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:6 module ActiveSupport::Dependencies class << self - # source://activesupport//lib/active_support/dependencies.rb#61 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:66 def _autoloaded_tracked_classes; end - # source://activesupport//lib/active_support/dependencies.rb#61 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:66 def _autoloaded_tracked_classes=(_arg0); end - # source://activesupport//lib/active_support/dependencies.rb#55 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:60 def _eager_load_paths; end - # source://activesupport//lib/active_support/dependencies.rb#55 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:60 def _eager_load_paths=(_arg0); end - # source://activesupport//lib/active_support/dependencies.rb#48 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:53 def autoload_once_paths; end - # source://activesupport//lib/active_support/dependencies.rb#48 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:53 def autoload_once_paths=(_arg0); end - # source://activesupport//lib/active_support/dependencies.rb#42 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:47 def autoload_paths; end - # source://activesupport//lib/active_support/dependencies.rb#42 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:47 def autoload_paths=(_arg0); end - # source://activesupport//lib/active_support/dependencies.rb#68 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:73 def autoloader; end - # source://activesupport//lib/active_support/dependencies.rb#68 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:73 def autoloader=(_arg0); end # Private method that reloads constants autoloaded by the main autoloader. @@ -3971,85 +4050,81 @@ module ActiveSupport::Dependencies # reload. That involves more things, like deleting unloaded classes from the # internal state of the descendants tracker, or reloading routes. # - # source://activesupport//lib/active_support/dependencies.rb#75 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:80 def clear; end # Private method that helps configuring the autoloaders. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/dependencies.rb#93 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:98 def eager_load?(path); end - # source://activesupport//lib/active_support/dependencies.rb#9 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:9 def interlock; end - # source://activesupport//lib/active_support/dependencies.rb#9 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:9 def interlock=(_arg0); end # Execute the supplied block while holding an exclusive lock, # preventing any other thread from being inside a #run_interlock # block at the same time. # - # source://activesupport//lib/active_support/dependencies.rb#23 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:23 def load_interlock(&block); end # Execute the supplied block without interference from any # concurrent loads. # - # source://activesupport//lib/active_support/dependencies.rb#16 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:16 def run_interlock(&block); end # Private method used by require_dependency. # - # source://activesupport//lib/active_support/dependencies.rb#83 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:88 def search_for_file(relpath); end # Execute the supplied block while holding an exclusive lock, # preventing any other thread from being inside a #run_interlock # block at the same time. # - # source://activesupport//lib/active_support/dependencies.rb#30 + # pkg:gem/activesupport#lib/active_support/dependencies.rb:35 def unload_interlock(&block); end end end -# source://activesupport//lib/active_support/dependencies/interlock.rb#7 +# pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:7 class ActiveSupport::Dependencies::Interlock - # @return [Interlock] a new instance of Interlock - # - # source://activesupport//lib/active_support/dependencies/interlock.rb#8 + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:8 def initialize; end - # source://activesupport//lib/active_support/dependencies/interlock.rb#32 + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:37 def done_running; end - # source://activesupport//lib/active_support/dependencies/interlock.rb#24 + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:29 def done_unloading; end - # source://activesupport//lib/active_support/dependencies/interlock.rb#12 + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:12 def loading(&block); end - # source://activesupport//lib/active_support/dependencies/interlock.rb#40 + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:45 def permit_concurrent_loads(&block); end - # source://activesupport//lib/active_support/dependencies/interlock.rb#44 + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:50 def raw_state(&block); end - # source://activesupport//lib/active_support/dependencies/interlock.rb#36 + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:41 def running(&block); end - # source://activesupport//lib/active_support/dependencies/interlock.rb#28 + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:33 def start_running; end - # source://activesupport//lib/active_support/dependencies/interlock.rb#20 + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:25 def start_unloading; end - # source://activesupport//lib/active_support/dependencies/interlock.rb#16 + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:21 def unloading(&block); end end -# source://activesupport//lib/active_support/dependencies/require_dependency.rb#3 +# pkg:gem/activesupport#lib/active_support/dependencies/require_dependency.rb:3 module ActiveSupport::Dependencies::RequireDependency # Warning: This method is obsolete. The semantics of the autoloader # match Ruby's and you do not need to be defensive with load order anymore. @@ -4059,7 +4134,7 @@ module ActiveSupport::Dependencies::RequireDependency # should call +require_dependency+ where needed in case the runtime mode is # +:classic+. # - # source://activesupport//lib/active_support/dependencies/require_dependency.rb#11 + # pkg:gem/activesupport#lib/active_support/dependencies/require_dependency.rb:11 def require_dependency(filename); end end @@ -4093,7 +4168,7 @@ end # # in config/environments/test.rb # config.active_support.deprecation = :raise # -# source://activesupport//lib/active_support/deprecation.rb#33 +# pkg:gem/activesupport#lib/active_support/deprecation.rb:33 class ActiveSupport::Deprecation include ::ActiveSupport::Deprecation::Behavior include ::ActiveSupport::Deprecation::Reporting @@ -4105,23 +4180,21 @@ class ActiveSupport::Deprecation # # ActiveSupport::Deprecation.new('2.0', 'MyLibrary') # - # @return [Deprecation] a new instance of Deprecation - # - # source://activesupport//lib/active_support/deprecation.rb#71 + # pkg:gem/activesupport#lib/active_support/deprecation.rb:71 def initialize(deprecation_horizon = T.unsafe(nil), gem_name = T.unsafe(nil)); end # The version number in which the deprecated behavior will be removed, by default. # - # source://activesupport//lib/active_support/deprecation.rb#65 + # pkg:gem/activesupport#lib/active_support/deprecation.rb:65 def deprecation_horizon; end # The version number in which the deprecated behavior will be removed, by default. # - # source://activesupport//lib/active_support/deprecation.rb#65 + # pkg:gem/activesupport#lib/active_support/deprecation.rb:65 def deprecation_horizon=(_arg0); end class << self - # source://activesupport//lib/active_support/deprecation.rb#60 + # pkg:gem/activesupport#lib/active_support/deprecation.rb:60 def _instance; end end end @@ -4140,11 +4213,11 @@ end # Setting behaviors only affects deprecations that happen after boot time. # For more information you can read the documentation of the #behavior= method. # -# source://activesupport//lib/active_support/deprecation/behaviors.rb#69 +# pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:69 module ActiveSupport::Deprecation::Behavior # Returns the current behavior or if one isn't set, defaults to +:stderr+. # - # source://activesupport//lib/active_support/deprecation/behaviors.rb#74 + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:74 def behavior; end # Sets the behavior to the specified value. Can be a single value, array, @@ -4176,22 +4249,22 @@ module ActiveSupport::Deprecation::Behavior # all deprecation behaviors. This is similar to the +:silence+ option but # more performant. # - # source://activesupport//lib/active_support/deprecation/behaviors.rb#111 + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:111 def behavior=(behavior); end # Whether to print a backtrace along with the warning. # - # source://activesupport//lib/active_support/deprecation/behaviors.rb#71 + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:71 def debug; end # Whether to print a backtrace along with the warning. # - # source://activesupport//lib/active_support/deprecation/behaviors.rb#71 + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:71 def debug=(_arg0); end # Returns the current behavior for disallowed deprecations or if one isn't set, defaults to +:raise+. # - # source://activesupport//lib/active_support/deprecation/behaviors.rb#79 + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:79 def disallowed_behavior; end # Sets the behavior for disallowed deprecations (those configured by @@ -4199,29 +4272,27 @@ module ActiveSupport::Deprecation::Behavior # value. As with #behavior=, this can be a single value, array, or an # object that responds to +call+. # - # source://activesupport//lib/active_support/deprecation/behaviors.rb#119 + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:119 def disallowed_behavior=(behavior); end private - # source://activesupport//lib/active_support/deprecation/behaviors.rb#124 + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:124 def arity_coerce(behavior); end - # source://activesupport//lib/active_support/deprecation/behaviors.rb#143 + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:143 def arity_of_callable(callable); end end # Default warning behaviors per Rails.env. # -# source://activesupport//lib/active_support/deprecation/behaviors.rb#13 +# pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:13 ActiveSupport::Deprecation::DEFAULT_BEHAVIORS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/deprecation/constant_accessor.rb#5 +# pkg:gem/activesupport#lib/active_support/deprecation/constant_accessor.rb:5 module ActiveSupport::Deprecation::DeprecatedConstantAccessor class << self - # @private - # - # source://activesupport//lib/active_support/deprecation/constant_accessor.rb#6 + # pkg:gem/activesupport#lib/active_support/deprecation/constant_accessor.rb:6 def included(base); end end end @@ -4242,14 +4313,12 @@ end # (Backtrace information…) # ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"] # -# source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#120 +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:120 class ActiveSupport::Deprecation::DeprecatedConstantProxy < ::Module - # @return [DeprecatedConstantProxy] a new instance of DeprecatedConstantProxy - # - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#128 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:128 def initialize(old_const, new_const, deprecator, message: T.unsafe(nil)); end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#158 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:158 def append_features(base); end # Returns the class of the new constant. @@ -4258,46 +4327,46 @@ class ActiveSupport::Deprecation::DeprecatedConstantProxy < ::Module # PLANETS = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('PLANETS', 'PLANETS_POST_2006') # PLANETS.class # => Array # - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#154 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:154 def class; end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#168 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:168 def extended(base); end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#147 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:147 def hash(*_arg0, **_arg1, &_arg2); end # Don't give a deprecation warning on inspect since test/unit and error # logs rely on it for diagnostics. # - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#141 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:141 def inspect; end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#147 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:147 def instance_methods(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#147 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:147 def name(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#163 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:163 def prepend_features(base); end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#147 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:147 def respond_to?(*_arg0, **_arg1, &_arg2); end private - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#178 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:178 def const_missing(name); end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#183 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:183 def method_missing(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#174 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:174 def target; end class << self - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#121 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:121 def new(*args, **options, &block); end end end @@ -4335,19 +4404,17 @@ end # example.request.to_s # # => "special_request" # -# source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#87 +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:87 class ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy < ::ActiveSupport::Deprecation::DeprecationProxy - # @return [DeprecatedInstanceVariableProxy] a new instance of DeprecatedInstanceVariableProxy - # - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#88 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:88 def initialize(instance, method, var = T.unsafe(nil), deprecator:); end private - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#96 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:96 def target; end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#100 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:100 def warn(callstack, called, args); end end @@ -4362,37 +4429,35 @@ end # (Backtrace) # # => "#" # -# source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#38 +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:38 class ActiveSupport::Deprecation::DeprecatedObjectProxy < ::ActiveSupport::Deprecation::DeprecationProxy - # @return [DeprecatedObjectProxy] a new instance of DeprecatedObjectProxy - # - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#39 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:39 def initialize(object, message, deprecator); end private - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#46 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:46 def target; end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#50 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:50 def warn(callstack, called, args); end end -# source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#5 +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:5 class ActiveSupport::Deprecation::DeprecationProxy # Don't give a deprecation warning on inspect since test/unit and error # logs rely on it for diagnostics. # - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#17 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:17 def inspect; end private - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#22 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:22 def method_missing(called, *args, &block); end class << self - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#6 + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:6 def new(*args, **kwargs, &block); end end end @@ -4402,16 +4467,14 @@ end # #silence method silences all deprecators in the collection for the # duration of a given block. # -# source://activesupport//lib/active_support/deprecation/deprecators.rb#9 +# pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:9 class ActiveSupport::Deprecation::Deprecators - # @return [Deprecators] a new instance of Deprecators - # - # source://activesupport//lib/active_support/deprecation/deprecators.rb#10 + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:10 def initialize; end # Returns a deprecator added to this collection via #[]=. # - # source://activesupport//lib/active_support/deprecation/deprecators.rb#16 + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:16 def [](name); end # Adds a given +deprecator+ to this collection. The deprecator will be @@ -4428,7 +4491,7 @@ class ActiveSupport::Deprecation::Deprecators # deprecators[:foo].debug # => true # foo_deprecator.debug # => true # - # source://activesupport//lib/active_support/deprecation/deprecators.rb#34 + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:34 def []=(name, deprecator); end # Sets the deprecation warning behavior for all deprecators in this @@ -4436,12 +4499,12 @@ class ActiveSupport::Deprecation::Deprecators # # See ActiveSupport::Deprecation#behavior=. # - # source://activesupport//lib/active_support/deprecation/deprecators.rb#60 + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:60 def behavior=(behavior); end # Sets the debug flag for all deprecators in this collection. # - # source://activesupport//lib/active_support/deprecation/deprecators.rb#52 + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:52 def debug=(debug); end # Sets the disallowed deprecation warning behavior for all deprecators in @@ -4449,7 +4512,7 @@ class ActiveSupport::Deprecation::Deprecators # # See ActiveSupport::Deprecation#disallowed_behavior=. # - # source://activesupport//lib/active_support/deprecation/deprecators.rb#68 + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:68 def disallowed_behavior=(disallowed_behavior); end # Sets the disallowed deprecation warnings for all deprecators in this @@ -4457,13 +4520,13 @@ class ActiveSupport::Deprecation::Deprecators # # See ActiveSupport::Deprecation#disallowed_warnings=. # - # source://activesupport//lib/active_support/deprecation/deprecators.rb#76 + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:76 def disallowed_warnings=(disallowed_warnings); end # Iterates over all deprecators in this collection. If no block is given, # returns an +Enumerator+. # - # source://activesupport//lib/active_support/deprecation/deprecators.rb#41 + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:41 def each(&block); end # Silences all deprecators in this collection for the duration of the @@ -4471,31 +4534,44 @@ class ActiveSupport::Deprecation::Deprecators # # See ActiveSupport::Deprecation#silence. # - # source://activesupport//lib/active_support/deprecation/deprecators.rb#84 + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:84 def silence(&block); end # Sets the silenced flag for all deprecators in this collection. # - # source://activesupport//lib/active_support/deprecation/deprecators.rb#47 + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:47 def silenced=(silenced); end private - # source://activesupport//lib/active_support/deprecation/deprecators.rb#97 + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:97 def apply_options(deprecator); end - # source://activesupport//lib/active_support/deprecation/deprecators.rb#92 + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:92 def set_option(name, value); end end -# source://activesupport//lib/active_support/deprecation/disallowed.rb#5 +# pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:5 module ActiveSupport::Deprecation::Disallowed # Returns the configured criteria used to identify deprecation messages # which should be treated as disallowed. + # Sets the criteria used to identify deprecation messages which should be + # disallowed. Can be an array containing strings, symbols, or regular + # expressions. (Symbols are treated as strings.) These are compared against + # the text of the generated deprecation warning. + # + # Additionally the scalar symbol +:all+ may be used to treat all + # deprecations as disallowed. + # + # Deprecations matching a substring or regular expression will be handled + # using the configured Behavior#disallowed_behavior rather than + # Behavior#behavior. # - # source://activesupport//lib/active_support/deprecation/disallowed.rb#21 + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:21 def disallowed_warnings; end + # Returns the configured criteria used to identify deprecation messages + # which should be treated as disallowed. # Sets the criteria used to identify deprecation messages which should be # disallowed. Can be an array containing strings, symbols, or regular # expressions. (Symbols are treated as strings.) These are compared against @@ -4508,26 +4584,22 @@ module ActiveSupport::Deprecation::Disallowed # using the configured Behavior#disallowed_behavior rather than # Behavior#behavior. # - # source://activesupport//lib/active_support/deprecation/disallowed.rb#17 + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:17 def disallowed_warnings=(_arg0); end private - # @return [Boolean] - # - # source://activesupport//lib/active_support/deprecation/disallowed.rb#26 + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:26 def deprecation_disallowed?(message); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/deprecation/disallowed.rb#39 + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:39 def explicitly_allowed?(message); end end -# source://activesupport//lib/active_support/deprecation.rb#57 +# pkg:gem/activesupport#lib/active_support/deprecation.rb:57 ActiveSupport::Deprecation::MUTEX = T.let(T.unsafe(nil), Thread::Mutex) -# source://activesupport//lib/active_support/deprecation/method_wrappers.rb#8 +# pkg:gem/activesupport#lib/active_support/deprecation/method_wrappers.rb:8 module ActiveSupport::Deprecation::MethodWrapper # Declare that a method has been deprecated. # @@ -4556,11 +4628,11 @@ module ActiveSupport::Deprecation::MethodWrapper # # DEPRECATION WARNING: ccc is deprecated and will be removed from MyGem next-release (use Bar#ccc instead). (called from irb_binding at (irb):12) # # => nil # - # source://activesupport//lib/active_support/deprecation/method_wrappers.rb#35 + # pkg:gem/activesupport#lib/active_support/deprecation/method_wrappers.rb:35 def deprecate_methods(target_module, *method_names); end end -# source://activesupport//lib/active_support/deprecation/reporting.rb#7 +# pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:7 module ActiveSupport::Deprecation::Reporting # Allow previously disallowed deprecation warnings within the block. # allowed_warnings can be an array containing strings, symbols, or regular @@ -4592,26 +4664,26 @@ module ActiveSupport::Deprecation::Reporting # end # # => ActiveSupport::DeprecationException for dev/test, nil for production # - # source://activesupport//lib/active_support/deprecation/reporting.rb#89 + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:89 def allow(allowed_warnings = T.unsafe(nil), if: T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/deprecation/reporting.rb#48 + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:48 def begin_silence; end - # source://activesupport//lib/active_support/deprecation/reporting.rb#99 + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:99 def deprecation_warning(deprecated_method_name, message = T.unsafe(nil), caller_backtrace = T.unsafe(nil)); end - # source://activesupport//lib/active_support/deprecation/reporting.rb#52 + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:52 def end_silence; end # Name of gem where method is deprecated # - # source://activesupport//lib/active_support/deprecation/reporting.rb#11 + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:11 def gem_name; end # Name of gem where method is deprecated # - # source://activesupport//lib/active_support/deprecation/reporting.rb#11 + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:11 def gem_name=(_arg0); end # Silence deprecation warnings within the block. @@ -4625,15 +4697,17 @@ module ActiveSupport::Deprecation::Reporting # end # # => nil # - # source://activesupport//lib/active_support/deprecation/reporting.rb#41 + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:41 def silence(&block); end - # source://activesupport//lib/active_support/deprecation/reporting.rb#56 + # Whether to print a message (silent mode) + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:56 def silenced; end # Whether to print a message (silent mode) # - # source://activesupport//lib/active_support/deprecation/reporting.rb#9 + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:9 def silenced=(_arg0); end # Outputs a deprecation warning to the output configured by @@ -4642,7 +4716,7 @@ module ActiveSupport::Deprecation::Reporting # ActiveSupport::Deprecation.new.warn('something broke!') # # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)" # - # source://activesupport//lib/active_support/deprecation/reporting.rb#18 + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:18 def warn(message = T.unsafe(nil), callstack = T.unsafe(nil)); end private @@ -4656,34 +4730,32 @@ module ActiveSupport::Deprecation::Reporting # deprecated_method_warning(:method_name, "Optional message") # # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon} (Optional message)" # - # source://activesupport//lib/active_support/deprecation/reporting.rb#115 + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:115 def deprecated_method_warning(method_name, message = T.unsafe(nil)); end - # source://activesupport//lib/active_support/deprecation/reporting.rb#129 + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:129 def deprecation_caller_message(callstack); end - # source://activesupport//lib/active_support/deprecation/reporting.rb#124 + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:124 def deprecation_message(callstack, message = T.unsafe(nil)); end - # source://activesupport//lib/active_support/deprecation/reporting.rb#140 + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:140 def extract_callstack(callstack); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/deprecation/reporting.rb#155 + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:157 def ignored_callstack?(path); end end -# source://activesupport//lib/active_support/deprecation/reporting.rb#153 +# pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:154 ActiveSupport::Deprecation::Reporting::LIB_DIR = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/deprecation/reporting.rb#152 +# pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:152 ActiveSupport::Deprecation::Reporting::RAILS_GEM_ROOT = T.let(T.unsafe(nil), String) # Raised when ActiveSupport::Deprecation::Behavior#behavior is set with :raise. # You would set :raise, as a behavior to raise errors and proactively report exceptions from deprecations. # -# source://activesupport//lib/active_support/deprecation/behaviors.rb#8 +# pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:8 class ActiveSupport::DeprecationException < ::StandardError; end # = Active Support Descendants Tracker @@ -4695,64 +4767,65 @@ class ActiveSupport::DeprecationException < ::StandardError; end # so if you know your code won't be executed on older rubies, including # +ActiveSupport::DescendantsTracker+ does not provide any benefit. # -# source://activesupport//lib/active_support/descendants_tracker.rb#14 +# pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:14 module ActiveSupport::DescendantsTracker - # source://activesupport//lib/active_support/descendants_tracker.rb#107 + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:107 def descendants; end class << self - # source://activesupport//lib/active_support/descendants_tracker.rb#78 + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:78 def clear(classes); end - # source://activesupport//lib/active_support/descendants_tracker.rb#102 + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:102 def descendants(klass); end - # source://activesupport//lib/active_support/descendants_tracker.rb#69 + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:69 def disable_clear!; end - # source://activesupport//lib/active_support/descendants_tracker.rb#89 + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:89 def reject!(classes); end - # source://activesupport//lib/active_support/descendants_tracker.rb#98 + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:98 def subclasses(klass); end end end -# source://activesupport//lib/active_support/descendants_tracker.rb#58 +# pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:58 module ActiveSupport::DescendantsTracker::ReloadedClassesFiltering - # source://activesupport//lib/active_support/descendants_tracker.rb#63 + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:63 def descendants; end - # source://activesupport//lib/active_support/descendants_tracker.rb#59 + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:59 def subclasses; end end +# On MRI `ObjectSpace::WeakMap` keys are weak references. +# So we can simply use WeakMap as a `Set`. # On TruffleRuby `ObjectSpace::WeakMap` keys are strong references. # So we use `object_id` as a key and the actual object as a value. # # JRuby for now doesn't have Class#descendant, but when it will, it will likely # have the same WeakMap semantic than Truffle so we future proof this as much as possible. # -# source://activesupport//lib/active_support/descendants_tracker.rb#20 +# pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:20 class ActiveSupport::DescendantsTracker::WeakSet < ::ObjectSpace::WeakMap - # source://activesupport//lib/active_support/descendants_tracker.rb#23 + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:23 def <<(object); end + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:21 def to_a; end end -# source://activesupport//lib/active_support/digest.rb#6 +# pkg:gem/activesupport#lib/active_support/digest.rb:6 class ActiveSupport::Digest class << self - # source://activesupport//lib/active_support/digest.rb#8 + # pkg:gem/activesupport#lib/active_support/digest.rb:8 def hash_digest_class; end - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/digest.rb#12 + # pkg:gem/activesupport#lib/active_support/digest.rb:12 def hash_digest_class=(klass); end - # source://activesupport//lib/active_support/digest.rb#17 + # pkg:gem/activesupport#lib/active_support/digest.rb:17 def hexdigest(arg); end end end @@ -4764,203 +4837,163 @@ end # # 1.month.ago # equivalent to Time.now.advance(months: -1) # -# source://activesupport//lib/active_support/duration.rb#14 +# pkg:gem/activesupport#lib/active_support/duration.rb:14 class ActiveSupport::Duration - # @return [Duration] a new instance of Duration - # - # source://activesupport//lib/active_support/duration.rb#226 + # pkg:gem/activesupport#lib/active_support/duration.rb:226 def initialize(value, parts, variable = T.unsafe(nil)); end # Returns the modulo of this Duration by another Duration or Numeric. # Numeric values are treated as seconds. # - # source://activesupport//lib/active_support/duration.rb#312 + # pkg:gem/activesupport#lib/active_support/duration.rb:312 def %(other); end # Multiplies this Duration by a Numeric and returns a new Duration. # - # source://activesupport//lib/active_support/duration.rb#287 + # pkg:gem/activesupport#lib/active_support/duration.rb:287 def *(other); end # Adds another Duration or a Numeric to this Duration. Numeric values # are treated as seconds. # - # source://activesupport//lib/active_support/duration.rb#268 + # pkg:gem/activesupport#lib/active_support/duration.rb:268 def +(other); end - # source://activesupport//lib/active_support/duration.rb#326 + # pkg:gem/activesupport#lib/active_support/duration.rb:326 def +@; end # Subtracts another Duration or a Numeric from this Duration. Numeric # values are treated as seconds. # - # source://activesupport//lib/active_support/duration.rb#282 + # pkg:gem/activesupport#lib/active_support/duration.rb:282 def -(other); end - # source://activesupport//lib/active_support/duration.rb#322 + # pkg:gem/activesupport#lib/active_support/duration.rb:322 def -@; end # Divides this Duration by a Numeric and returns a new Duration. # - # source://activesupport//lib/active_support/duration.rb#298 + # pkg:gem/activesupport#lib/active_support/duration.rb:298 def /(other); end # Compares one Duration with another or a Numeric to this Duration. # Numeric values are treated as seconds. # - # source://activesupport//lib/active_support/duration.rb#258 + # pkg:gem/activesupport#lib/active_support/duration.rb:258 def <=>(other); end # Returns +true+ if +other+ is also a Duration instance with the # same +value+, or if other == value. # - # source://activesupport//lib/active_support/duration.rb#341 + # pkg:gem/activesupport#lib/active_support/duration.rb:341 def ==(other); end - # source://activesupport//lib/active_support/duration.rb#481 + # pkg:gem/activesupport#lib/active_support/duration.rb:481 def _parts; end - # source://activesupport//lib/active_support/duration.rb#224 + # pkg:gem/activesupport#lib/active_support/duration.rb:224 def abs(&_arg0); end - # Calculates a new Time or Date that is as far in the future - # as this Duration represents. - # - # source://activesupport//lib/active_support/duration.rb#436 + # pkg:gem/activesupport#lib/active_support/duration.rb:440 def after(time = T.unsafe(nil)); end # Calculates a new Time or Date that is as far in the past # as this Duration represents. # - # source://activesupport//lib/active_support/duration.rb#444 + # pkg:gem/activesupport#lib/active_support/duration.rb:444 def ago(time = T.unsafe(nil)); end - # source://activesupport//lib/active_support/duration.rb#459 + # pkg:gem/activesupport#lib/active_support/duration.rb:459 def as_json(options = T.unsafe(nil)); end - # Calculates a new Time or Date that is as far in the past - # as this Duration represents. - # - # source://activesupport//lib/active_support/duration.rb#444 + # pkg:gem/activesupport#lib/active_support/duration.rb:448 def before(time = T.unsafe(nil)); end - # source://activesupport//lib/active_support/duration.rb#245 + # pkg:gem/activesupport#lib/active_support/duration.rb:245 def coerce(other); end - # source://activesupport//lib/active_support/duration.rb#467 + # pkg:gem/activesupport#lib/active_support/duration.rb:467 def encode_with(coder); end # Returns +true+ if +other+ is also a Duration instance, which has the # same parts as this one. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/duration.rb#426 + # pkg:gem/activesupport#lib/active_support/duration.rb:426 def eql?(other); end - # Calculates a new Time or Date that is as far in the future - # as this Duration represents. - # - # source://activesupport//lib/active_support/duration.rb#436 + # pkg:gem/activesupport#lib/active_support/duration.rb:439 def from_now(time = T.unsafe(nil)); end - # source://activesupport//lib/active_support/duration.rb#430 + # pkg:gem/activesupport#lib/active_support/duration.rb:430 def hash; end # Returns the amount of days a duration covers as a float # # 12.hours.in_days # => 0.5 # - # source://activesupport//lib/active_support/duration.rb#399 + # pkg:gem/activesupport#lib/active_support/duration.rb:399 def in_days; end # Returns the amount of hours a duration covers as a float # # 1.day.in_hours # => 24.0 # - # source://activesupport//lib/active_support/duration.rb#392 + # pkg:gem/activesupport#lib/active_support/duration.rb:392 def in_hours; end # Returns the amount of minutes a duration covers as a float # # 1.day.in_minutes # => 1440.0 # - # source://activesupport//lib/active_support/duration.rb#385 + # pkg:gem/activesupport#lib/active_support/duration.rb:385 def in_minutes; end # Returns the amount of months a duration covers as a float # # 9.weeks.in_months # => 2.07 # - # source://activesupport//lib/active_support/duration.rb#413 + # pkg:gem/activesupport#lib/active_support/duration.rb:413 def in_months; end - # Returns the number of seconds that this Duration represents. - # - # 1.minute.to_i # => 60 - # 1.hour.to_i # => 3600 - # 1.day.to_i # => 86400 - # - # Note that this conversion makes some assumptions about the - # duration of some periods, e.g. months are always 1/12 of year - # and years are 365.2425 days: - # - # # equivalent to (1.year / 12).to_i - # 1.month.to_i # => 2629746 - # - # # equivalent to 365.2425.days.to_i - # 1.year.to_i # => 31556952 - # - # In such cases, Ruby's core - # Date[https://docs.ruby-lang.org/en/master/Date.html] and - # Time[https://docs.ruby-lang.org/en/master/Time.html] should be used for precision - # date and time arithmetic. - # - # source://activesupport//lib/active_support/duration.rb#377 + # pkg:gem/activesupport#lib/active_support/duration.rb:380 def in_seconds; end # Returns the amount of weeks a duration covers as a float # # 2.months.in_weeks # => 8.696 # - # source://activesupport//lib/active_support/duration.rb#406 + # pkg:gem/activesupport#lib/active_support/duration.rb:406 def in_weeks; end # Returns the amount of years a duration covers as a float # # 30.days.in_years # => 0.082 # - # source://activesupport//lib/active_support/duration.rb#420 + # pkg:gem/activesupport#lib/active_support/duration.rb:420 def in_years; end - # source://activesupport//lib/active_support/duration.rb#463 + # pkg:gem/activesupport#lib/active_support/duration.rb:463 def init_with(coder); end - # source://activesupport//lib/active_support/duration.rb#450 + # pkg:gem/activesupport#lib/active_support/duration.rb:450 def inspect; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/duration.rb#335 + # pkg:gem/activesupport#lib/active_support/duration.rb:335 def instance_of?(klass); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/duration.rb#330 + # pkg:gem/activesupport#lib/active_support/duration.rb:330 def is_a?(klass); end # Build ISO 8601 Duration string for this duration. # The +precision+ parameter can be used to limit seconds' precision of duration. # - # source://activesupport//lib/active_support/duration.rb#473 + # pkg:gem/activesupport#lib/active_support/duration.rb:473 def iso8601(precision: T.unsafe(nil)); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/duration.rb#330 + # pkg:gem/activesupport#lib/active_support/duration.rb:333 def kind_of?(klass); end - # source://activesupport//lib/active_support/duration.rb#224 + # pkg:gem/activesupport#lib/active_support/duration.rb:224 def negative?(&_arg0); end # Returns a copy of the parts hash that defines the duration. @@ -4968,19 +5001,19 @@ class ActiveSupport::Duration # 5.minutes.parts # => {:minutes=>5} # 3.years.parts # => {:years=>3} # - # source://activesupport//lib/active_support/duration.rb#241 + # pkg:gem/activesupport#lib/active_support/duration.rb:241 def parts; end - # source://activesupport//lib/active_support/duration.rb#224 + # pkg:gem/activesupport#lib/active_support/duration.rb:224 def positive?(&_arg0); end # Calculates a new Time or Date that is as far in the future # as this Duration represents. # - # source://activesupport//lib/active_support/duration.rb#436 + # pkg:gem/activesupport#lib/active_support/duration.rb:436 def since(time = T.unsafe(nil)); end - # source://activesupport//lib/active_support/duration.rb#224 + # pkg:gem/activesupport#lib/active_support/duration.rb:224 def to_f(&_arg0); end # Returns the number of seconds that this Duration represents. @@ -5004,7 +5037,7 @@ class ActiveSupport::Duration # Time[https://docs.ruby-lang.org/en/master/Time.html] should be used for precision # date and time arithmetic. # - # source://activesupport//lib/active_support/duration.rb#377 + # pkg:gem/activesupport#lib/active_support/duration.rb:377 def to_i; end # Returns the amount of seconds a duration covers as a string. @@ -5012,48 +5045,37 @@ class ActiveSupport::Duration # # 1.day.to_s # => "86400" # - # source://activesupport//lib/active_support/duration.rb#353 + # pkg:gem/activesupport#lib/active_support/duration.rb:353 def to_s; end - # Calculates a new Time or Date that is as far in the past - # as this Duration represents. - # - # source://activesupport//lib/active_support/duration.rb#444 + # pkg:gem/activesupport#lib/active_support/duration.rb:447 def until(time = T.unsafe(nil)); end - # Returns the value of attribute value. - # - # source://activesupport//lib/active_support/duration.rb#133 + # pkg:gem/activesupport#lib/active_support/duration.rb:133 def value; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/duration.rb#477 + # pkg:gem/activesupport#lib/active_support/duration.rb:477 def variable?; end - # source://activesupport//lib/active_support/duration.rb#224 + # pkg:gem/activesupport#lib/active_support/duration.rb:224 def zero?(&_arg0); end private - # source://activesupport//lib/active_support/duration.rb#516 + # pkg:gem/activesupport#lib/active_support/duration.rb:516 def method_missing(*_arg0, **_arg1, &_arg2); end - # @raise [TypeError] - # - # source://activesupport//lib/active_support/duration.rb#520 + # pkg:gem/activesupport#lib/active_support/duration.rb:520 def raise_type_error(other); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/duration.rb#512 + # pkg:gem/activesupport#lib/active_support/duration.rb:512 def respond_to_missing?(method, _); end - # source://activesupport//lib/active_support/duration.rb#486 + # pkg:gem/activesupport#lib/active_support/duration.rb:486 def sum(sign, time = T.unsafe(nil)); end class << self - # source://activesupport//lib/active_support/duration.rb#149 + # pkg:gem/activesupport#lib/active_support/duration.rb:149 def ===(other); end # Creates a new Duration from a seconds value that is converted @@ -5062,19 +5084,19 @@ class ActiveSupport::Duration # ActiveSupport::Duration.build(31556952).parts # => {:years=>1} # ActiveSupport::Duration.build(2716146).parts # => {:months=>1, :days=>1} # - # source://activesupport//lib/active_support/duration.rb#189 + # pkg:gem/activesupport#lib/active_support/duration.rb:189 def build(value); end - # source://activesupport//lib/active_support/duration.rb#167 + # pkg:gem/activesupport#lib/active_support/duration.rb:167 def days(value); end - # source://activesupport//lib/active_support/duration.rb#163 + # pkg:gem/activesupport#lib/active_support/duration.rb:163 def hours(value); end - # source://activesupport//lib/active_support/duration.rb#159 + # pkg:gem/activesupport#lib/active_support/duration.rb:159 def minutes(value); end - # source://activesupport//lib/active_support/duration.rb#175 + # pkg:gem/activesupport#lib/active_support/duration.rb:175 def months(value); end # Creates a new Duration from string formatted according to ISO 8601 Duration. @@ -5083,21 +5105,21 @@ class ActiveSupport::Duration # This method allows negative parts to be present in pattern. # If invalid string is provided, it will raise +ActiveSupport::Duration::ISO8601Parser::ParsingError+. # - # source://activesupport//lib/active_support/duration.rb#144 + # pkg:gem/activesupport#lib/active_support/duration.rb:144 def parse(iso8601duration); end - # source://activesupport//lib/active_support/duration.rb#155 + # pkg:gem/activesupport#lib/active_support/duration.rb:155 def seconds(value); end - # source://activesupport//lib/active_support/duration.rb#171 + # pkg:gem/activesupport#lib/active_support/duration.rb:171 def weeks(value); end - # source://activesupport//lib/active_support/duration.rb#179 + # pkg:gem/activesupport#lib/active_support/duration.rb:179 def years(value); end private - # source://activesupport//lib/active_support/duration.rb#217 + # pkg:gem/activesupport#lib/active_support/duration.rb:217 def calculate_total_seconds(parts); end end end @@ -5108,309 +5130,285 @@ end # # This parser allows negative parts to be present in pattern. # -# source://activesupport//lib/active_support/duration/iso8601_parser.rb#12 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:12 class ActiveSupport::Duration::ISO8601Parser - # @return [ISO8601Parser] a new instance of ISO8601Parser - # - # source://activesupport//lib/active_support/duration/iso8601_parser.rb#34 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:34 def initialize(string); end - # Returns the value of attribute mode. - # - # source://activesupport//lib/active_support/duration/iso8601_parser.rb#32 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 def mode; end - # Sets the attribute mode - # - # @param value the value to set the attribute mode to. - # - # source://activesupport//lib/active_support/duration/iso8601_parser.rb#32 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 def mode=(_arg0); end - # source://activesupport//lib/active_support/duration/iso8601_parser.rb#41 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:41 def parse!; end - # Returns the value of attribute parts. - # - # source://activesupport//lib/active_support/duration/iso8601_parser.rb#31 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:31 def parts; end - # Returns the value of attribute scanner. - # - # source://activesupport//lib/active_support/duration/iso8601_parser.rb#31 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:31 def scanner; end - # Returns the value of attribute sign. - # - # source://activesupport//lib/active_support/duration/iso8601_parser.rb#32 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 def sign; end - # Sets the attribute sign - # - # @param value the value to set the attribute sign to. - # - # source://activesupport//lib/active_support/duration/iso8601_parser.rb#32 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 def sign=(_arg0); end private - # @return [Boolean] - # - # source://activesupport//lib/active_support/duration/iso8601_parser.rb#83 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:83 def finished?; end # Parses number which can be a float with either comma or period. # - # source://activesupport//lib/active_support/duration/iso8601_parser.rb#88 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:88 def number; end - # @raise [ParsingError] - # - # source://activesupport//lib/active_support/duration/iso8601_parser.rb#96 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:96 def raise_parsing_error(reason = T.unsafe(nil)); end - # source://activesupport//lib/active_support/duration/iso8601_parser.rb#92 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:92 def scan(pattern); end # Checks for various semantic errors as stated in ISO 8601 standard. # - # source://activesupport//lib/active_support/duration/iso8601_parser.rb#101 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:101 def validate!; end end -# source://activesupport//lib/active_support/duration/iso8601_parser.rb#17 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:17 ActiveSupport::Duration::ISO8601Parser::COMMA = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/duration/iso8601_parser.rb#22 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:22 ActiveSupport::Duration::ISO8601Parser::DATE_COMPONENT = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/duration/iso8601_parser.rb#28 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:28 ActiveSupport::Duration::ISO8601Parser::DATE_COMPONENTS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/duration/iso8601_parser.rb#20 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:20 ActiveSupport::Duration::ISO8601Parser::DATE_MARKER = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/duration/iso8601_parser.rb#25 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:25 ActiveSupport::Duration::ISO8601Parser::DATE_TO_PART = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/duration/iso8601_parser.rb#16 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:16 ActiveSupport::Duration::ISO8601Parser::PERIOD = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/duration/iso8601_parser.rb#15 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:15 ActiveSupport::Duration::ISO8601Parser::PERIOD_OR_COMMA = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/duration/iso8601_parser.rb#13 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:13 class ActiveSupport::Duration::ISO8601Parser::ParsingError < ::ArgumentError; end -# source://activesupport//lib/active_support/duration/iso8601_parser.rb#19 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:19 ActiveSupport::Duration::ISO8601Parser::SIGN_MARKER = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/duration/iso8601_parser.rb#23 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:23 ActiveSupport::Duration::ISO8601Parser::TIME_COMPONENT = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/duration/iso8601_parser.rb#29 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:29 ActiveSupport::Duration::ISO8601Parser::TIME_COMPONENTS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/duration/iso8601_parser.rb#21 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:21 ActiveSupport::Duration::ISO8601Parser::TIME_MARKER = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/duration/iso8601_parser.rb#26 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:26 ActiveSupport::Duration::ISO8601Parser::TIME_TO_PART = T.let(T.unsafe(nil), Hash) # Serializes duration to string according to ISO 8601 Duration format. # -# source://activesupport//lib/active_support/duration/iso8601_serializer.rb#6 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:6 class ActiveSupport::Duration::ISO8601Serializer - # @return [ISO8601Serializer] a new instance of ISO8601Serializer - # - # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#9 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:9 def initialize(duration, precision: T.unsafe(nil)); end # Builds and returns output string. # - # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#15 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:15 def serialize; end private - # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#55 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:55 def format_seconds(seconds); end # Return pair of duration's parts and whole duration sign. # Parts are summarized (as they can become repetitive due to addition, etc). # Zero parts are removed as not significant. # - # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#38 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:38 def normalize; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#51 + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:51 def week_mixed_with_date?(parts); end end -# source://activesupport//lib/active_support/duration/iso8601_serializer.rb#7 +# pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:7 ActiveSupport::Duration::ISO8601Serializer::DATE_COMPONENTS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/duration.rb#130 +# pkg:gem/activesupport#lib/active_support/duration.rb:130 ActiveSupport::Duration::PARTS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/duration.rb#120 +# length of a gregorian year (365.2425 days) +# +# pkg:gem/activesupport#lib/active_support/duration.rb:120 ActiveSupport::Duration::PARTS_IN_SECONDS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/duration.rb#115 +# pkg:gem/activesupport#lib/active_support/duration.rb:115 ActiveSupport::Duration::SECONDS_PER_DAY = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/duration.rb#114 +# pkg:gem/activesupport#lib/active_support/duration.rb:114 ActiveSupport::Duration::SECONDS_PER_HOUR = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/duration.rb#113 +# pkg:gem/activesupport#lib/active_support/duration.rb:113 ActiveSupport::Duration::SECONDS_PER_MINUTE = T.let(T.unsafe(nil), Integer) -# 1/12 of a gregorian year -# -# source://activesupport//lib/active_support/duration.rb#117 +# pkg:gem/activesupport#lib/active_support/duration.rb:117 ActiveSupport::Duration::SECONDS_PER_MONTH = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/duration.rb#116 +# pkg:gem/activesupport#lib/active_support/duration.rb:116 ActiveSupport::Duration::SECONDS_PER_WEEK = T.let(T.unsafe(nil), Integer) -# length of a gregorian year (365.2425 days) +# 1/12 of a gregorian year # -# source://activesupport//lib/active_support/duration.rb#118 +# pkg:gem/activesupport#lib/active_support/duration.rb:118 ActiveSupport::Duration::SECONDS_PER_YEAR = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/duration.rb#15 +# pkg:gem/activesupport#lib/active_support/duration.rb:15 class ActiveSupport::Duration::Scalar < ::Numeric - # @return [Scalar] a new instance of Scalar - # - # source://activesupport//lib/active_support/duration.rb#19 + # pkg:gem/activesupport#lib/active_support/duration.rb:19 def initialize(value); end - # source://activesupport//lib/active_support/duration.rb#85 + # pkg:gem/activesupport#lib/active_support/duration.rb:85 def %(other); end - # source://activesupport//lib/active_support/duration.rb#66 + # pkg:gem/activesupport#lib/active_support/duration.rb:66 def *(other); end - # source://activesupport//lib/active_support/duration.rb#41 + # pkg:gem/activesupport#lib/active_support/duration.rb:41 def +(other); end - # source://activesupport//lib/active_support/duration.rb#53 + # pkg:gem/activesupport#lib/active_support/duration.rb:53 def -(other); end - # source://activesupport//lib/active_support/duration.rb#27 + # pkg:gem/activesupport#lib/active_support/duration.rb:27 def -@; end - # source://activesupport//lib/active_support/duration.rb#77 + # pkg:gem/activesupport#lib/active_support/duration.rb:77 def /(other); end - # source://activesupport//lib/active_support/duration.rb#31 + # pkg:gem/activesupport#lib/active_support/duration.rb:31 def <=>(other); end - # source://activesupport//lib/active_support/duration.rb#23 + # pkg:gem/activesupport#lib/active_support/duration.rb:23 def coerce(other); end - # source://activesupport//lib/active_support/duration.rb#17 + # pkg:gem/activesupport#lib/active_support/duration.rb:17 def to_f(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/duration.rb#17 + # pkg:gem/activesupport#lib/active_support/duration.rb:17 def to_i(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/duration.rb#17 + # pkg:gem/activesupport#lib/active_support/duration.rb:17 def to_s(*_arg0, **_arg1, &_arg2); end - # Returns the value of attribute value. - # - # source://activesupport//lib/active_support/duration.rb#16 + # pkg:gem/activesupport#lib/active_support/duration.rb:16 def value; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/duration.rb#93 + # pkg:gem/activesupport#lib/active_support/duration.rb:93 def variable?; end private - # source://activesupport//lib/active_support/duration.rb#98 + # pkg:gem/activesupport#lib/active_support/duration.rb:98 def calculate(op, other); end - # @raise [TypeError] - # - # source://activesupport//lib/active_support/duration.rb#108 + # pkg:gem/activesupport#lib/active_support/duration.rb:108 def raise_type_error(other); end end -# source://activesupport//lib/active_support/duration.rb#131 +# pkg:gem/activesupport#lib/active_support/duration.rb:131 ActiveSupport::Duration::VARIABLE_PARTS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/core_ext/range/each.rb#6 -module ActiveSupport::EachTimeWithZone - # source://activesupport//lib/active_support/core_ext/range/each.rb#7 - def each(&block); end +# pkg:gem/activesupport#lib/active_support/editor.rb:6 +class ActiveSupport::Editor + # pkg:gem/activesupport#lib/active_support/editor.rb:48 + def initialize(url_pattern); end - # source://activesupport//lib/active_support/core_ext/range/each.rb#12 - def step(n = T.unsafe(nil), &block); end + # pkg:gem/activesupport#lib/active_support/editor.rb:52 + def url_for(path, line); end - private + class << self + # Returns the current editor pattern if it is known. + # First check for the `RAILS_EDITOR` environment variable, and if it's + # missing, check for the `EDITOR` environment variable. + # + # pkg:gem/activesupport#lib/active_support/editor.rb:28 + def current; end - # @raise [TypeError] - # - # source://activesupport//lib/active_support/core_ext/range/each.rb#18 - def ensure_iteration_allowed; end + # pkg:gem/activesupport#lib/active_support/editor.rb:39 + def find(name); end + + # Registers a URL pattern for opening file in a given editor. + # This allows Rails to generate clickable links to control known editors. + # + # Example: + # + # ActiveSupport::Editor.register("myeditor", "myeditor://%s:%d") + # + # pkg:gem/activesupport#lib/active_support/editor.rb:17 + def register(name, url_pattern, aliases: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/editor.rb:43 + def reset; end + end end -# source://activesupport//lib/active_support/core_ext/enumerable.rb#4 +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:4 module ActiveSupport::EnumerableCoreExt; end -# source://activesupport//lib/active_support/core_ext/enumerable.rb#5 +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:5 module ActiveSupport::EnumerableCoreExt::Constants private - # source://activesupport//lib/active_support/core_ext/enumerable.rb#7 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:7 def const_missing(name); end end -# HACK: For performance reasons, Enumerable shouldn't have any constants of its own. -# So we move SoleItemExpectedError into ActiveSupport::EnumerableCoreExt. -# -# source://activesupport//lib/active_support/core_ext/enumerable.rb#25 +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:25 ActiveSupport::EnumerableCoreExt::SoleItemExpectedError = Enumerable::SoleItemExpectedError -# source://activesupport//lib/active_support/environment_inquirer.rb#7 +# pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:9 class ActiveSupport::EnvironmentInquirer < ::ActiveSupport::StringInquirer - # @raise [ArgumentError] - # @return [EnvironmentInquirer] a new instance of EnvironmentInquirer - # - # source://activesupport//lib/active_support/environment_inquirer.rb#15 + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:15 def initialize(env); end - # source://activesupport//lib/active_support/environment_inquirer.rb#29 + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:28 def development?; end # Returns true if we're in the development or test environment. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/environment_inquirer.rb#36 + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:36 def local?; end - # source://activesupport//lib/active_support/environment_inquirer.rb#29 + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:28 def production?; end - # source://activesupport//lib/active_support/environment_inquirer.rb#29 + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:28 def test?; end end # Optimization for the three default environments, so this inquirer doesn't need to rely on # the slower delegation through method_missing that StringInquirer would normally entail. # -# source://activesupport//lib/active_support/environment_inquirer.rb#10 +# pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:10 ActiveSupport::EnvironmentInquirer::DEFAULT_ENVIRONMENTS = T.let(T.unsafe(nil), Array) # Environments that'll respond true for #local? # -# source://activesupport//lib/active_support/environment_inquirer.rb#13 +# pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:13 ActiveSupport::EnvironmentInquirer::LOCAL_ENVIRONMENTS = T.let(T.unsafe(nil), Array) # = Active Support \Error Reporter @@ -5435,23 +5433,30 @@ ActiveSupport::EnvironmentInquirer::LOCAL_ENVIRONMENTS = T.let(T.unsafe(nil), Ar # # maybe_tags = Rails.error.handle(Redis::BaseError) { redis.get("tags") } # -# source://activesupport//lib/active_support/error_reporter.rb#26 +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:26 class ActiveSupport::ErrorReporter - # @return [ErrorReporter] a new instance of ErrorReporter - # - # source://activesupport//lib/active_support/error_reporter.rb#35 + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:35 def initialize(*subscribers, logger: T.unsafe(nil)); end - # Returns the value of attribute debug_mode. + # Add a middleware to modify the error context before it is sent to subscribers. # - # source://activesupport//lib/active_support/error_reporter.rb#31 - def debug_mode; end - - # Sets the attribute debug_mode + # Middleware is added to a stack of callables run on an error's execution context + # before passing to subscribers. Allows creation of entries in error context that + # are shared by all subscribers. + # + # A context middleware receives the same parameters as #report. + # It must return a hash - the middleware stack returns the hash after it has + # run through all middlewares. A middleware can mutate or replace the hash. # - # @param value the value to set the attribute debug_mode to. + # Rails.error.add_middleware(-> (error, context) { context.merge({ foo: :bar }) }) # - # source://activesupport//lib/active_support/error_reporter.rb#31 + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:218 + def add_middleware(middleware); end + + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:31 + def debug_mode; end + + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:31 def debug_mode=(_arg0); end # Prevent a subscriber from being notified of errors for the @@ -5460,7 +5465,7 @@ class ActiveSupport::ErrorReporter # This can be helpful for error reporting service integrations, when they wish # to handle any errors higher in the stack. # - # source://activesupport//lib/active_support/error_reporter.rb#185 + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:186 def disable(subscriber); end # Evaluates the given block, reporting and swallowing any unhandled error. @@ -5501,19 +5506,13 @@ class ActiveSupport::ErrorReporter # source of the error. Subscribers can use this value to ignore certain # errors. Defaults to "application". # - # source://activesupport//lib/active_support/error_reporter.rb#78 + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:79 def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil)); end - # Returns the value of attribute logger. - # - # source://activesupport//lib/active_support/error_reporter.rb#31 + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:31 def logger; end - # Sets the attribute logger - # - # @param value the value to set the attribute logger to. - # - # source://activesupport//lib/active_support/error_reporter.rb#31 + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:31 def logger=(_arg0); end # Evaluates the given block, reporting and re-raising any unhandled error. @@ -5545,7 +5544,7 @@ class ActiveSupport::ErrorReporter # source of the error. Subscribers can use this value to ignore certain # errors. Defaults to "application". # - # source://activesupport//lib/active_support/error_reporter.rb#114 + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:115 def record(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end # Report an error directly to subscribers. You can use this method when the @@ -5560,7 +5559,7 @@ class ActiveSupport::ErrorReporter # Otherwise you can use #unexpected to report an error which does accept a # string argument. # - # source://activesupport//lib/active_support/error_reporter.rb#216 + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:233 def report(error, handled: T.unsafe(nil), severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end # Update the execution context that is accessible to error subscribers. Any @@ -5569,7 +5568,7 @@ class ActiveSupport::ErrorReporter # # Rails.error.set_context(section: "checkout", user_id: @user.id) # - # source://activesupport//lib/active_support/error_reporter.rb#201 + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:202 def set_context(*_arg0, **_arg1, &_arg2); end # Register a new error subscriber. The subscriber must respond to @@ -5578,7 +5577,7 @@ class ActiveSupport::ErrorReporter # # The +report+ method should never raise an error. # - # source://activesupport//lib/active_support/error_reporter.rb#161 + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:162 def subscribe(subscriber); end # Either report the given error when in production, or raise it when in development or test. @@ -5604,7 +5603,7 @@ class ActiveSupport::ErrorReporter # # ... # end # - # source://activesupport//lib/active_support/error_reporter.rb#145 + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:146 def unexpected(error, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end # Unregister an error subscriber. Accepts either a subscriber or a class. @@ -5616,141 +5615,660 @@ class ActiveSupport::ErrorReporter # # or # Rails.error.unsubscribe(MyErrorSubscriber) # - # source://activesupport//lib/active_support/error_reporter.rb#176 + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:177 def unsubscribe(subscriber); end private - # source://activesupport//lib/active_support/error_reporter.rb#252 + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:278 def ensure_backtrace(error); end end -# source://activesupport//lib/active_support/error_reporter.rb#29 +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:29 ActiveSupport::ErrorReporter::DEFAULT_RESCUE = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/error_reporter.rb#28 +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:28 ActiveSupport::ErrorReporter::DEFAULT_SOURCE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/error_reporter.rb#27 +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:298 +class ActiveSupport::ErrorReporter::ErrorContextMiddlewareStack + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:299 + def initialize; end + + # Run all middlewares in the stack + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:313 + def execute(error, handled:, severity:, context:, source:); end + + # Add a middleware to the error context stack. + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:304 + def use(middleware); end +end + +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:27 ActiveSupport::ErrorReporter::SEVERITIES = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/error_reporter.rb#33 +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:33 class ActiveSupport::ErrorReporter::UnexpectedError < ::Exception; end -# source://activesupport//lib/active_support/execution_context.rb#4 -module ActiveSupport::ExecutionContext +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:49 +class ActiveSupport::EventContext class << self - # source://activesupport//lib/active_support/execution_context.rb#34 - def []=(key, value); end - - # source://activesupport//lib/active_support/execution_context.rb#7 - def after_change(&block); end - - # source://activesupport//lib/active_support/execution_context.rb#43 + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:65 def clear; end - # Updates the execution context. If a block is given, it resets the provided keys to their - # previous value once the block exits. - # - # source://activesupport//lib/active_support/execution_context.rb#13 - def set(**options); end - - # source://activesupport//lib/active_support/execution_context.rb#39 - def to_h; end - - private + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:54 + def context; end - # source://activesupport//lib/active_support/execution_context.rb#48 - def store; end + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:58 + def set_context(context_hash); end end end -# source://activesupport//lib/active_support/execution_wrapper.rb#7 -class ActiveSupport::ExecutionWrapper - include ::ActiveSupport::Callbacks - extend ::ActiveSupport::Callbacks::ClassMethods - extend ::ActiveSupport::DescendantsTracker - - # source://activesupport//lib/active_support/callbacks.rb#69 - def __callbacks; end - - # source://activesupport//lib/active_support/callbacks.rb#924 - def _complete_callbacks; end - - # source://activesupport//lib/active_support/callbacks.rb#924 - def _run_callbacks; end - - # source://activesupport//lib/active_support/callbacks.rb#912 - def _run_complete_callbacks(&block); end - - # source://activesupport//lib/active_support/callbacks.rb#912 - def _run_run_callbacks(&block); end - - # source://activesupport//lib/active_support/execution_wrapper.rb#141 - def complete; end - - # Complete this in-flight execution. This method *must* be called - # exactly once on the result of any call to +run!+. - # - # Where possible, prefer +wrap+. - # - # source://activesupport//lib/active_support/execution_wrapper.rb#135 - def complete!; end - - # source://activesupport//lib/active_support/execution_wrapper.rb#127 - def run; end - - # source://activesupport//lib/active_support/execution_wrapper.rb#122 - def run!; end - - private - - # source://activesupport//lib/active_support/execution_wrapper.rb#146 - def hook_state; end - - class << self - # source://activesupport//lib/active_support/callbacks.rb#69 - def __callbacks; end - - # source://activesupport//lib/active_support/callbacks.rb#69 - def __callbacks=(value); end - - # source://activesupport//lib/active_support/callbacks.rb#916 - def _complete_callbacks; end - - # source://activesupport//lib/active_support/callbacks.rb#920 - def _complete_callbacks=(value); end - - # source://activesupport//lib/active_support/callbacks.rb#916 - def _run_callbacks; end +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:50 +ActiveSupport::EventContext::EMPTY_CONTEXT = T.let(T.unsafe(nil), Hash) - # source://activesupport//lib/active_support/callbacks.rb#920 - def _run_callbacks=(value); end - - # @return [Boolean] - # - # source://activesupport//lib/active_support/execution_wrapper.rb#118 - def active?; end - - # source://activesupport//lib/active_support/execution_wrapper.rb#114 - def active_key; end - - # source://activesupport//lib/active_support/execution_wrapper.rb#110 - def error_reporter; end +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:51 +ActiveSupport::EventContext::FIBER_KEY = T.let(T.unsafe(nil), Symbol) - # source://activesupport//lib/active_support/execution_wrapper.rb#100 - def perform; end - - # Register an object to be invoked during both the +run+ and - # +complete+ steps. - # - # +hook.complete+ will be passed the value returned from +hook.run+, - # and will only be invoked if +run+ has previously been called. - # (Mostly, this means it won't be invoked if an exception occurs in +# = Active Support \Event Reporter +# +# +ActiveSupport::EventReporter+ provides an interface for reporting structured events to subscribers. +# +# To report an event, you can use the +notify+ method: +# +# Rails.event.notify("user_created", { id: 123 }) +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# The +notify+ API can receive either an event name and a payload hash, or an event object. Names are coerced to strings. +# +# === Event Objects +# +# If an event object is passed to the +notify+ API, it will be passed through to subscribers as-is, and the name of the +# object's class will be used as the event name. +# +# class UserCreatedEvent +# def initialize(id:, name:) +# @id = id +# @name = name +# end +# +# def serialize +# { +# id: @id, +# name: @name +# } +# end +# end +# +# Rails.event.notify(UserCreatedEvent.new(id: 123, name: "John Doe")) +# # Emits event: +# # { +# # name: "UserCreatedEvent", +# # payload: #, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# An event is any Ruby object representing a schematized event. While payload hashes allow arbitrary, +# implicitly-structured data, event objects are intended to enforce a particular schema. +# +# Subscribers are responsible for serializing event objects. +# +# === Subscribers +# +# Subscribers must implement the +emit+ method, which will be called with the event hash. +# +# The event hash has the following keys: +# +# name: String (The name of the event) +# payload: Hash, Object (The payload of the event, or the event object itself) +# tags: Hash (The tags of the event) +# context: Hash (The context of the event) +# timestamp: Float (The timestamp of the event, in nanoseconds) +# source_location: Hash (The source location of the event, containing the filepath, lineno, and label) +# +# Subscribers are responsible for encoding events to their desired format before emitting them to their +# target destination, such as a streaming platform, a log device, or an alerting service. +# +# class JSONEventSubscriber +# def emit(event) +# json_data = JSON.generate(event) +# LogExporter.export(json_data) +# end +# end +# +# class LogSubscriber +# def emit(event) +# payload = event[:payload].map { |key, value| "#{key}=#{value}" }.join(" ") +# source_location = event[:source_location] +# log = "[#{event[:name]}] #{payload} at #{source_location[:filepath]}:#{source_location[:lineno]}" +# Rails.logger.info(log) +# end +# end +# +# Note that event objects are passed through to subscribers as-is, and may need to be serialized before being encoded: +# +# class UserCreatedEvent +# def initialize(id:, name:) +# @id = id +# @name = name +# end +# +# def serialize +# { +# id: @id, +# name: @name +# } +# end +# end +# +# class LogSubscriber +# def emit(event) +# payload = event[:payload] +# json_data = JSON.generate(payload.serialize) +# LogExporter.export(json_data) +# end +# end +# +# ==== Filtered Subscriptions +# +# Subscribers can be configured with an optional filter proc to only receive a subset of events: +# +# # Only receive events with names starting with "user." +# Rails.event.subscribe(user_subscriber) { |event| event[:name].start_with?("user.") } +# +# # Only receive events with specific payload types +# Rails.event.subscribe(audit_subscriber) { |event| event[:payload].is_a?(AuditEvent) } +# +# === Debug Events +# +# You can use the +debug+ method to report an event that will only be reported if the +# event reporter is in debug mode: +# +# Rails.event.debug("my_debug_event", { foo: "bar" }) +# +# === Tags +# +# To add additional context to an event, separate from the event payload, you can add +# tags via the +tagged+ method: +# +# Rails.event.tagged("graphql") do +# Rails.event.notify("user_created", { id: 123 }) +# end +# +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # tags: { graphql: true }, +# # context: {}, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# === Context Store +# +# You may want to attach metadata to every event emitted by the reporter. While tags +# provide domain-specific context for a series of events, context is scoped to the job / request +# and should be used for metadata associated with the execution context. +# Context can be set via the +set_context+ method: +# +# Rails.event.set_context(request_id: "abcd123", user_agent: "TestAgent") +# Rails.event.notify("user_created", { id: 123 }) +# +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # tags: {}, +# # context: { request_id: "abcd123", user_agent: "TestAgent" }, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# Context is reset automatically before and after each request. +# +# A custom context store can be configured via +config.active_support.event_reporter_context_store+. +# +# # config/application.rb +# config.active_support.event_reporter_context_store = CustomContextStore +# +# class CustomContextStore +# class << self +# def context +# # Return the context. +# end +# +# def set_context(context_hash) +# # Append context_hash to the existing context store. +# end +# +# def clear +# # Delete the stored context. +# end +# end +# end +# +# The Event Reporter standardizes on symbol keys for all payload data, tags, and context store entries. +# String keys are automatically converted to symbols for consistency. +# +# Rails.event.notify("user.created", { "id" => 123 }) +# # Emits event: +# # { +# # name: "user.created", +# # payload: { id: 123 }, +# # } +# +# === Security +# +# When reporting events, Hash-based payloads are automatically filtered to remove sensitive data based on {Rails.application.filter_parameters}[https://guides.rubyonrails.org/configuring.html#config-filter-parameters]. +# +# If an {event object}[rdoc-ref:EventReporter@Event+Objects] is given instead, subscribers will need to filter sensitive data themselves, e.g. with ActiveSupport::ParameterFilter. +# +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:271 +class ActiveSupport::EventReporter + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:286 + def initialize(*subscribers, raise_on_error: T.unsafe(nil)); end + + # Clears all context data. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:525 + def clear_context; end + + # Returns the current context data. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:530 + def context; end + + # Report an event only when in debug mode. For example: + # + # Rails.event.debug("sql.query", { sql: "SELECT * FROM users" }) + # + # ==== Arguments + # + # * +:payload+ - The event payload when using string/symbol event names. + # + # * +:caller_depth+ - The stack depth to use for source location (default: 1). + # + # * +:kwargs+ - Additional payload data when using string/symbol event names. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:435 + def debug(name_or_object, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:276 + def debug_mode=(_arg0); end + + # Check if debug mode is currently enabled. Debug mode is enabled on the reporter + # via +with_debug+, and in local environments. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:420 + def debug_mode?; end + + # Reports an event to all registered subscribers. An event name and payload can be provided: + # + # Rails.event.notify("user.created", { id: 123 }) + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: {}, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # Alternatively, an event object can be provided: + # + # Rails.event.notify(UserCreatedEvent.new(id: 123)) + # # Emits event: + # # { + # # name: "UserCreatedEvent", + # # payload: #, + # # tags: {}, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # ==== Arguments + # + # * +:payload+ - The event payload when using string/symbol event names. + # + # * +:caller_depth+ - The stack depth to use for source location (default: 1). + # + # * +:kwargs+ - Additional payload data when using string/symbol event names. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:363 + def notify(name_or_object, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # Sets whether to raise an error if a subscriber raises an error during + # event emission, or when unexpected arguments are passed to +notify+. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:274 + def raise_on_error=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:534 + def reload_payload_filter; end + + # Sets context data that will be included with all events emitted by the reporter. + # Context data should be scoped to the job or request, and is reset automatically + # before and after each request and job. + # + # Rails.event.set_context(user_agent: "TestAgent") + # Rails.event.set_context(job_id: "abc123") + # Rails.event.tagged("graphql") do + # Rails.event.notify("user_created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user_created", + # # payload: { id: 123 }, + # # tags: { graphql: true }, + # # context: { user_agent: "TestAgent", job_id: "abc123" }, + # # timestamp: 1738964843208679035 + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:520 + def set_context(context); end + + # Registers a new event subscriber. The subscriber must respond to + # + # emit(event: Hash) + # + # The event hash will have the following keys: + # + # name: String (The name of the event) + # payload: Hash, Object (The payload of the event, or the event object itself) + # tags: Hash (The tags of the event) + # context: Hash (The context of the event) + # timestamp: Float (The timestamp of the event, in nanoseconds) + # source_location: Hash (The source location of the event, containing the filepath, lineno, and label) + # + # An optional filter proc can be provided to only receive a subset of events: + # + # Rails.event.subscribe(subscriber) { |event| event[:name].start_with?("user.") } + # Rails.event.subscribe(subscriber) { |event| event[:payload].is_a?(UserEvent) } + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:311 + def subscribe(subscriber, &filter); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:278 + def subscribers; end + + # Add tags to events to supply additional context. Tags operate in a stack-oriented manner, + # so all events emitted within the block inherit the same set of tags. For example: + # + # Rails.event.tagged("graphql") do + # Rails.event.notify("user.created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { graphql: true }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # Tags can be provided as arguments or as keyword arguments, and can be nested: + # + # Rails.event.tagged("graphql") do + # # Other code here... + # Rails.event.tagged(section: "admin") do + # Rails.event.notify("user.created", { id: 123 }) + # end + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { section: "admin", graphql: true }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # The +tagged+ API can also receive a tag object: + # + # graphql_tag = GraphqlTag.new(operation_name: "user_created", operation_type: "mutation") + # Rails.event.tagged(graphql_tag) do + # Rails.event.notify("user.created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { "GraphqlTag": # }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:497 + def tagged(*args, **kwargs, &block); end + + # Unregister an event subscriber. Accepts either a subscriber or a class. + # + # subscriber = MyEventSubscriber.new + # Rails.event.subscribe(subscriber) + # + # Rails.event.unsubscribe(subscriber) + # # or + # Rails.event.unsubscribe(MyEventSubscriber) + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:326 + def unsubscribe(subscriber); end + + # Temporarily enables debug mode for the duration of the block. + # Calls to +debug+ will only be reported if debug mode is enabled. + # + # Rails.event.with_debug do + # Rails.event.debug("sql.query", { sql: "SELECT * FROM users" }) + # end + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:410 + def with_debug; end + + private + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:544 + def context_store; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:579 + def handle_unexpected_args(name_or_object, payload, kwargs); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:548 + def payload_filter; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:540 + def raise_on_error?; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:555 + def resolve_name(name_or_object); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:564 + def resolve_payload(name_or_object, payload, **kwargs); end + + class << self + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:281 + def context_store; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:281 + def context_store=(_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/execution_context.rb:4 +module ActiveSupport::ExecutionContext + class << self + # pkg:gem/activesupport#lib/active_support/execution_context.rb:76 + def []=(key, value); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:47 + def after_change(&block); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:103 + def clear; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:111 + def current_attributes_instances; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:107 + def flush; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:45 + def nestable; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:45 + def nestable=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:94 + def pop; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:85 + def push; end + + # Updates the execution context. If a block is given, it resets the provided keys to their + # previous value once the block exits. + # + # pkg:gem/activesupport#lib/active_support/execution_context.rb:53 + def set(**options); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:81 + def to_h; end + + private + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:116 + def record; end + end +end + +# pkg:gem/activesupport#lib/active_support/execution_context.rb:5 +class ActiveSupport::ExecutionContext::Record + # pkg:gem/activesupport#lib/active_support/execution_context.rb:8 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:6 + def current_attributes_instances; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:27 + def flush; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:21 + def pop; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:14 + def push; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:6 + def store; end +end + +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:7 +class ActiveSupport::ExecutionWrapper + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _complete_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _run_complete_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _run_complete_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_run_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_run_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:141 + def complete; end + + # Complete this in-flight execution. This method *must* be called + # exactly once on the result of any call to +run!+. + # + # Where possible, prefer +wrap+. + # + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:135 + def complete!; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:127 + def run; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:122 + def run!; end + + private + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:146 + def hook_state; end + + class << self + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 + def __callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _complete_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _complete_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:118 + def active?; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:114 + def active_key; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:110 + def error_reporter; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:100 + def perform; end + + # Register an object to be invoked during both the +run+ and + # +complete+ steps. + # + # +hook.complete+ will be passed the value returned from +hook.run+, + # and will only be invoked if +run+ has previously been called. + # (Mostly, this means it won't be invoked if an exception occurs in # a preceding +to_run+ block; all ordinary +to_complete+ blocks are # invoked in that situation.) # - # source://activesupport//lib/active_support/execution_wrapper.rb#50 + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:50 def register_hook(hook, outer: T.unsafe(nil)); end # Run this execution. @@ -5760,87 +6278,95 @@ class ActiveSupport::ExecutionWrapper # # Where possible, prefer +wrap+. # - # source://activesupport//lib/active_support/execution_wrapper.rb#66 + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:66 def run!(reset: T.unsafe(nil)); end - # source://activesupport//lib/active_support/execution_wrapper.rb#21 + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:21 def to_complete(*args, &block); end - # source://activesupport//lib/active_support/execution_wrapper.rb#17 + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:17 def to_run(*args, &block); end # Perform the work in the supplied block as an execution. # - # source://activesupport//lib/active_support/execution_wrapper.rb#86 + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:86 def wrap(source: T.unsafe(nil)); end private - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 def __class_attr___callbacks; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 def __class_attr___callbacks=(new_value); end end end -# source://activesupport//lib/active_support/execution_wrapper.rb#32 +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 class ActiveSupport::ExecutionWrapper::CompleteHook < ::Struct - # source://activesupport//lib/active_support/execution_wrapper.rb#33 + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:39 def after(target); end - # source://activesupport//lib/active_support/execution_wrapper.rb#33 + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:33 def before(target); end - # Returns the value of attribute hook - # - # @return [Object] the current value of hook + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 def hook; end - # Sets the attribute hook - # - # @param value [Object] the value to set the attribute hook to. - # @return [Object] the newly set value + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 def hook=(_); end class << self + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 def inspect; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 def members; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 def new(*_arg0); end end end -# source://activesupport//lib/active_support/execution_wrapper.rb#10 +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:10 ActiveSupport::ExecutionWrapper::Null = T.let(T.unsafe(nil), Object) -# source://activesupport//lib/active_support/execution_wrapper.rb#25 +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 class ActiveSupport::ExecutionWrapper::RunHook < ::Struct - # source://activesupport//lib/active_support/execution_wrapper.rb#26 + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:26 def before(target); end - # Returns the value of attribute hook - # - # @return [Object] the current value of hook + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 def hook; end - # Sets the attribute hook - # - # @param value [Object] the value to set the attribute hook to. - # @return [Object] the newly set value + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 def hook=(_); end class << self + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 def inspect; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 def members; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 def new(*_arg0); end end end -# source://activesupport//lib/active_support/executor.rb#6 +# pkg:gem/activesupport#lib/active_support/executor.rb:6 class ActiveSupport::Executor < ::ActiveSupport::ExecutionWrapper; end # = \File Update Checker @@ -5873,7 +6399,7 @@ class ActiveSupport::Executor < ::ActiveSupport::ExecutionWrapper; end # i18n_reloader.execute_if_updated # end # -# source://activesupport//lib/active_support/file_update_checker.rb#35 +# pkg:gem/activesupport#lib/active_support/file_update_checker.rb:35 class ActiveSupport::FileUpdateChecker # It accepts two parameters on initialization. The first is an array # of files and the second is an optional hash of directories. The hash must @@ -5884,40 +6410,36 @@ class ActiveSupport::FileUpdateChecker # changes. The array of files and list of directories cannot be changed # after FileUpdateChecker has been initialized. # - # @return [FileUpdateChecker] a new instance of FileUpdateChecker - # - # source://activesupport//lib/active_support/file_update_checker.rb#44 + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:44 def initialize(files, dirs = T.unsafe(nil), &block); end # Executes the given block and updates the latest watched files and # timestamp. # - # source://activesupport//lib/active_support/file_update_checker.rb#82 + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:85 def execute; end # Execute the block given if updated. # - # source://activesupport//lib/active_support/file_update_checker.rb#92 + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:95 def execute_if_updated; end # Check if any of the entries were updated. If so, the watched and/or # updated_at values are cached until the block is executed via +execute+ # or +execute_if_updated+. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/file_update_checker.rb#63 + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:66 def updated?; end private - # source://activesupport//lib/active_support/file_update_checker.rb#158 + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:160 def compile_ext(array); end - # source://activesupport//lib/active_support/file_update_checker.rb#144 + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:147 def compile_glob(hash); end - # source://activesupport//lib/active_support/file_update_checker.rb#154 + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:156 def escape(key); end # This method returns the maximum mtime of the files in +paths+, or +nil+ @@ -5928,36 +6450,36 @@ class ActiveSupport::FileUpdateChecker # healthy to consider this edge case because with mtimes in the future # reloading is not triggered. # - # source://activesupport//lib/active_support/file_update_checker.rb#122 + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:125 def max_mtime(paths); end - # source://activesupport//lib/active_support/file_update_checker.rb#111 + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:114 def updated_at(paths); end - # source://activesupport//lib/active_support/file_update_checker.rb#103 + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:106 def watched; end end -# source://activesupport//lib/active_support/fork_tracker.rb#4 +# pkg:gem/activesupport#lib/active_support/fork_tracker.rb:4 module ActiveSupport::ForkTracker class << self - # source://activesupport//lib/active_support/fork_tracker.rb#31 + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:31 def after_fork(&block); end - # source://activesupport//lib/active_support/fork_tracker.rb#19 + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:19 def after_fork_callback; end - # source://activesupport//lib/active_support/fork_tracker.rb#27 + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:27 def hook!; end - # source://activesupport//lib/active_support/fork_tracker.rb#36 + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:36 def unregister(callback); end end end -# source://activesupport//lib/active_support/fork_tracker.rb#5 +# pkg:gem/activesupport#lib/active_support/fork_tracker.rb:5 module ActiveSupport::ForkTracker::CoreExt - # source://activesupport//lib/active_support/fork_tracker.rb#6 + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:6 def _fork; end end @@ -5972,29 +6494,27 @@ end # ActiveSupport::Gzip.decompress(gzip) # # => "compress me!" # -# source://activesupport//lib/active_support/gzip.rb#17 +# pkg:gem/activesupport#lib/active_support/gzip.rb:17 module ActiveSupport::Gzip class << self # Compresses a string using gzip. # - # source://activesupport//lib/active_support/gzip.rb#32 + # pkg:gem/activesupport#lib/active_support/gzip.rb:32 def compress(source, level = T.unsafe(nil), strategy = T.unsafe(nil)); end # Decompresses a gzipped string. # - # source://activesupport//lib/active_support/gzip.rb#27 + # pkg:gem/activesupport#lib/active_support/gzip.rb:27 def decompress(source); end end end -# source://activesupport//lib/active_support/gzip.rb#18 +# pkg:gem/activesupport#lib/active_support/gzip.rb:18 class ActiveSupport::Gzip::Stream < ::StringIO - # @return [Stream] a new instance of Stream - # - # source://activesupport//lib/active_support/gzip.rb#19 + # pkg:gem/activesupport#lib/active_support/gzip.rb:19 def initialize(*_arg0); end - # source://activesupport//lib/active_support/gzip.rb#23 + # pkg:gem/activesupport#lib/active_support/gzip.rb:23 def close; end end @@ -6045,11 +6565,9 @@ end # # which will, in turn, require this file. # -# source://activesupport//lib/active_support/hash_with_indifferent_access.rb#55 +# pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:55 class ActiveSupport::HashWithIndifferentAccess < ::Hash - # @return [HashWithIndifferentAccess] a new instance of HashWithIndifferentAccess - # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#70 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:70 def initialize(constructor = T.unsafe(nil)); end # Same as Hash#[] where the key passed as argument can be @@ -6062,7 +6580,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # counters[:foo] # => 1 # counters[:zoo] # => nil # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#168 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:184 def [](key); end # Assigns a new value to the hash: @@ -6072,7 +6590,10 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # # This value can be later fetched using either +:key+ or 'key'. # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#98 + # If the value is a Hash or contains one or multiple Hashes, they will be + # converted to +HashWithIndifferentAccess+. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:101 def []=(key, value); end # Same as Hash#assoc where the key passed as argument can be @@ -6085,13 +6606,13 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # counters.assoc(:foo) # => ["foo", 1] # counters.assoc(:zoo) # => nil # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#181 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:197 def assoc(key); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#374 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:390 def compact; end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#318 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:334 def deep_symbolize_keys; end # Same as Hash#default where the key passed as argument can be @@ -6105,12 +6626,12 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash.default('foo') # => 'foo' # hash.default(:foo) # => 'foo' # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#223 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:239 def default(key = T.unsafe(nil)); end # Removes the specified key from the hash. # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#301 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:317 def delete(key); end # Same as Hash#dig where the key passed as argument can be @@ -6123,7 +6644,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # counters.dig(:foo, :bar) # => 1 # counters.dig(:zoo) # => nil # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#208 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:224 def dig(*args); end # Returns a shallow copy of the hash. @@ -6135,7 +6656,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash[:a][:c] # => "c" # dup[:a][:c] # => "c" # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#264 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:280 def dup; end # Returns a hash with indifferent access that includes everything except given keys. @@ -6143,15 +6664,13 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash.except(:a, "b") # => {c: 10}.with_indifferent_access # hash # => { a: "x", b: "y", c: 10 }.with_indifferent_access # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#309 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:325 def except(*keys); end # Returns +true+ so that Array#extract_options! finds members of # this class. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#58 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:58 def extractable_options?; end # Same as Hash#fetch where the key passed as argument can be @@ -6165,7 +6684,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # counters.fetch(:bar) { |key| 0 } # => 0 # counters.fetch(:zoo) # => KeyError: key not found: "zoo" # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#195 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:211 def fetch(key, *extras); end # Returns an array of the values at the specified indices, but also @@ -6178,103 +6697,48 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash.fetch_values('a', 'c') { |key| 'z' } # => ["x", "z"] # hash.fetch_values('a', 'c') # => KeyError: key not found: "c" # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#251 - def fetch_values(*indices, &block); end - - # Checks the hash for a key matching the argument passed in: - # - # hash = ActiveSupport::HashWithIndifferentAccess.new - # hash['key'] = 'value' - # hash.key?(:key) # => true - # hash.key?('key') # => true - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#151 - def has_key?(key); end - - # Checks the hash for a key matching the argument passed in: - # - # hash = ActiveSupport::HashWithIndifferentAccess.new - # hash['key'] = 'value' - # hash.key?(:key) # => true - # hash.key?('key') # => true - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#151 - def include?(key); end - - # Checks the hash for a key matching the argument passed in: - # - # hash = ActiveSupport::HashWithIndifferentAccess.new - # hash['key'] = 'value' - # hash.key?(:key) # => true - # hash.key?('key') # => true - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#151 - def key?(key); end - - # Checks the hash for a key matching the argument passed in: - # - # hash = ActiveSupport::HashWithIndifferentAccess.new - # hash['key'] = 'value' - # hash.key?(:key) # => true - # hash.key?('key') # => true - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#151 - def member?(key); end - - # This method has the same semantics of +update+, except it does not - # modify the receiver but rather returns a new hash with indifferent - # access with the result of the merge. - # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#271 - def merge(*hashes, &block); end - - # Updates the receiver in-place, merging in the hashes passed as arguments: - # - # hash_1 = ActiveSupport::HashWithIndifferentAccess.new - # hash_1[:key] = 'value' - # - # hash_2 = ActiveSupport::HashWithIndifferentAccess.new - # hash_2[:key] = 'New Value!' - # - # hash_1.update(hash_2) # => {"key"=>"New Value!"} - # - # hash = ActiveSupport::HashWithIndifferentAccess.new - # hash.update({ "a" => 1 }, { "b" => 2 }) # => { "a" => 1, "b" => 2 } - # - # The arguments can be either an - # +ActiveSupport::HashWithIndifferentAccess+ or a regular +Hash+. - # In either case the merge respects the semantics of indifferent access. - # - # If the argument is a regular hash with keys +:key+ and "key" only one - # of the values end up in the receiver, but which one is unspecified. + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:267 + def fetch_values(*indices, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:172 + def has_key?(key); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:171 + def include?(key); end + + # Checks the hash for a key matching the argument passed in: # - # When given a block, the value for duplicated keys will be determined - # by the result of invoking the block with the duplicated key, the value - # in the receiver, and the value in +other_hash+. The rules for duplicated - # keys follow the semantics of indifferent access: + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash['key'] = 'value' + # hash.key?(:key) # => true + # hash.key?('key') # => true # - # hash_1[:key] = 10 - # hash_2['key'] = 12 - # hash_1.update(hash_2) { |key, old, new| old + new } # => {"key"=>22} + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:167 + def key?(key); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:173 + def member?(key); end + + # This method has the same semantics of +update+, except it does not + # modify the receiver but rather returns a new hash with indifferent + # access with the result of the merge. # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#132 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:287 + def merge(*hashes, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:159 def merge!(*other_hashes, &block); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#66 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:66 def nested_under_indifferent_access; end + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:90 def regular_update(*_arg0); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:89 def regular_writer(_arg0, _arg1); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#326 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:342 def reject(*args, &block); end # Replaces the contents of this hash with other_hash. @@ -6282,7 +6746,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # h = { "a" => 100, "b" => 200 } # h.replace({ "c" => 300, "d" => 400 }) # => {"c"=>300, "d"=>400} # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#296 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:312 def replace(other_hash); end # Like +merge+ but the other way around: Merges the receiver into the @@ -6292,21 +6756,21 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash['a'] = nil # hash.reverse_merge(a: 0, b: 1) # => {"a"=>nil, "b"=>1} # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#281 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:297 def reverse_merge(other_hash); end # Same semantics as +reverse_merge+ but modifies the receiver in-place. # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#287 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:303 def reverse_merge!(other_hash); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#321 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:337 def select(*args, &block); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#364 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:380 def slice(*keys); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#369 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:385 def slice!(*keys); end # Assigns a new value to the hash: @@ -6316,33 +6780,37 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # # This value can be later fetched using either +:key+ or 'key'. # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#98 - def store(key, value); end + # If the value is a Hash or contains one or multiple Hashes, they will be + # converted to +HashWithIndifferentAccess+. unless `convert_value: false` + # is set. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:115 + def store(key, value, convert_value: T.unsafe(nil)); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#316 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:332 def symbolize_keys; end # Convert to a regular hash with string keys. # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#379 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:395 def to_hash; end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#316 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:333 def to_options; end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#319 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:335 def to_options!; end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#385 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:401 def to_proc; end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#338 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:354 def transform_keys(hash = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#350 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:366 def transform_keys!(hash = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#331 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:347 def transform_values(&block); end # Updates the receiver in-place, merging in the hashes passed as arguments: @@ -6374,7 +6842,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash_2['key'] = 12 # hash_1.update(hash_2) { |key, old, new| old + new } # => {"key"=>22} # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#132 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:148 def update(*other_hashes, &block); end # Returns an array of the values at the specified indices: @@ -6384,59 +6852,48 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash[:b] = 'y' # hash.values_at('a', 'b') # => ["x", "y"] # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#237 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:253 def values_at(*keys); end - # Like +merge+ but the other way around: Merges the receiver into the - # argument and returns a new hash with indifferent access as result: - # - # hash = ActiveSupport::HashWithIndifferentAccess.new - # hash['a'] = nil - # hash.reverse_merge(a: 0, b: 1) # => {"a"=>nil, "b"=>1} - # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#281 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:300 def with_defaults(other_hash); end - # Same semantics as +reverse_merge+ but modifies the receiver in-place. - # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#287 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:306 def with_defaults!(other_hash); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#62 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:62 def with_indifferent_access; end - # Returns a hash with indifferent access that includes everything except given keys. - # hash = { a: "x", b: "y", c: 10 }.with_indifferent_access - # hash.except(:a, "b") # => {c: 10}.with_indifferent_access - # hash # => { a: "x", b: "y", c: 10 }.with_indifferent_access - # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#309 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:328 def without(*keys); end private - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#390 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:406 + def cast(other); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:410 def convert_key(key); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#394 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:414 def convert_value(value, conversion: T.unsafe(nil)); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#407 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:427 def convert_value_to_hash(value); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#418 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:438 def copy_defaults(target); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#427 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:447 def update_with_single_argument(other_hash, block); end class << self - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#85 + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:85 def [](*args); end end end -# source://activesupport//lib/active_support/hash_with_indifferent_access.rb#336 +# pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:352 ActiveSupport::HashWithIndifferentAccess::NOT_GIVEN = T.let(T.unsafe(nil), Object) # = Active Support \Inflector @@ -6452,7 +6909,7 @@ ActiveSupport::HashWithIndifferentAccess::NOT_GIVEN = T.let(T.unsafe(nil), Objec # require it for your application or wish to define rules for languages other # than English, please correct or add them yourself (explained below). # -# source://activesupport//lib/active_support/inflector/inflections.rb#7 +# pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:8 module ActiveSupport::Inflector extend ::ActiveSupport::Inflector @@ -6473,7 +6930,7 @@ module ActiveSupport::Inflector # # camelize(underscore('SSLError')) # => "SslError" # - # source://activesupport//lib/active_support/inflector/methods.rb#70 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:70 def camelize(term, uppercase_first_letter = T.unsafe(nil)); end # Creates a class name from a plural table name like \Rails does for table @@ -6487,7 +6944,7 @@ module ActiveSupport::Inflector # # classify('calculus') # => "Calculu" # - # source://activesupport//lib/active_support/inflector/methods.rb#218 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:218 def classify(table_name); end # Tries to find a constant with the name specified in the argument string. @@ -6509,14 +6966,14 @@ module ActiveSupport::Inflector # NameError is raised when the name is not in CamelCase or the constant is # unknown. # - # source://activesupport//lib/active_support/inflector/methods.rb#289 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:289 def constantize(camel_cased_word); end # Replaces underscores with dashes in the string. # # dasherize('puni_puni') # => "puni-puni" # - # source://activesupport//lib/active_support/inflector/methods.rb#226 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:226 def dasherize(underscored_word); end # Removes the rightmost segment from the constant expression in the string. @@ -6529,7 +6986,7 @@ module ActiveSupport::Inflector # # See also #demodulize. # - # source://activesupport//lib/active_support/inflector/methods.rb#256 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:256 def deconstantize(path); end # Removes the module part from the expression in the string. @@ -6541,7 +6998,7 @@ module ActiveSupport::Inflector # # See also #deconstantize. # - # source://activesupport//lib/active_support/inflector/methods.rb#238 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:238 def demodulize(path); end # Converts the first character in the string to lowercase. @@ -6550,7 +7007,7 @@ module ActiveSupport::Inflector # downcase_first('I') # => "i" # downcase_first('') # => "" # - # source://activesupport//lib/active_support/inflector/methods.rb#175 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:175 def downcase_first(string); end # Creates a foreign key name from a class name. @@ -6561,7 +7018,7 @@ module ActiveSupport::Inflector # foreign_key('Message', false) # => "messageid" # foreign_key('Admin::Post') # => "post_id" # - # source://activesupport//lib/active_support/inflector/methods.rb#267 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:267 def foreign_key(class_name, separate_class_name_and_id_with_underscore = T.unsafe(nil)); end # Tweaks an attribute name for display to end users. @@ -6577,7 +7034,7 @@ module ActiveSupport::Inflector # The capitalization of the first word can be turned off by setting the # +:capitalize+ option to false (default is true). # - # The trailing '_id' can be kept and capitalized by setting the + # The trailing '_id' can be kept by setting the # optional parameter +keep_id_suffix+ to true (default is false). # # humanize('employee_salary') # => "Employee salary" @@ -6590,7 +7047,7 @@ module ActiveSupport::Inflector # # humanize('ssl_error') # => "SSL error" # - # source://activesupport//lib/active_support/inflector/methods.rb#135 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:135 def humanize(lower_case_and_underscored_word, capitalize: T.unsafe(nil), keep_id_suffix: T.unsafe(nil)); end # Yields a singleton instance of Inflector::Inflections so you can specify @@ -6602,7 +7059,7 @@ module ActiveSupport::Inflector # inflect.uncountable 'rails' # end # - # source://activesupport//lib/active_support/inflector/inflections.rb#265 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:283 def inflections(locale = T.unsafe(nil)); end # Returns the suffix that should be added to a number to denote the position @@ -6615,7 +7072,7 @@ module ActiveSupport::Inflector # ordinal(-11) # => "th" # ordinal(-1021) # => "st" # - # source://activesupport//lib/active_support/inflector/methods.rb#334 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:334 def ordinal(number); end # Turns a number into an ordinal string used to denote the position in an @@ -6628,7 +7085,7 @@ module ActiveSupport::Inflector # ordinalize(-11) # => "-11th" # ordinalize(-1021) # => "-1021st" # - # source://activesupport//lib/active_support/inflector/methods.rb#347 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:347 def ordinalize(number); end # Replaces special characters in a string so that it may be used as part of @@ -6658,7 +7115,7 @@ module ActiveSupport::Inflector # By default, this parameter is set to nil and it will use # the configured I18n.locale. # - # source://activesupport//lib/active_support/inflector/transliterate.rb#123 + # pkg:gem/activesupport#lib/active_support/inflector/transliterate.rb:123 def parameterize(string, separator: T.unsafe(nil), preserve_case: T.unsafe(nil), locale: T.unsafe(nil)); end # Returns the plural form of the word in the string. @@ -6674,7 +7131,7 @@ module ActiveSupport::Inflector # pluralize('CamelOctopus') # => "CamelOctopi" # pluralize('ley', :es) # => "leyes" # - # source://activesupport//lib/active_support/inflector/methods.rb#33 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:33 def pluralize(word, locale = T.unsafe(nil)); end # Tries to find a constant with the name specified in the argument string. @@ -6700,7 +7157,7 @@ module ActiveSupport::Inflector # safe_constantize('UnknownModule') # => nil # safe_constantize('UnknownModule::Foo::Bar') # => nil # - # source://activesupport//lib/active_support/inflector/methods.rb#315 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:315 def safe_constantize(camel_cased_word); end # The reverse of #pluralize, returns the singular form of a word in a @@ -6717,7 +7174,7 @@ module ActiveSupport::Inflector # singularize('CamelOctopi') # => "CamelOctopus" # singularize('leyes', :es) # => "ley" # - # source://activesupport//lib/active_support/inflector/methods.rb#50 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:50 def singularize(word, locale = T.unsafe(nil)); end # Creates the name of a table like \Rails does for models to table names. @@ -6727,7 +7184,7 @@ module ActiveSupport::Inflector # tableize('ham_and_egg') # => "ham_and_eggs" # tableize('fancyCategory') # => "fancy_categories" # - # source://activesupport//lib/active_support/inflector/methods.rb#204 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:204 def tableize(class_name); end # Capitalizes all the words and replaces some characters in the string to @@ -6744,7 +7201,7 @@ module ActiveSupport::Inflector # titleize('raiders_of_the_lost_ark') # => "Raiders Of The Lost Ark" # titleize('string_ending_with_id', keep_id_suffix: true) # => "String Ending With Id" # - # source://activesupport//lib/active_support/inflector/methods.rb#192 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:192 def titleize(word, keep_id_suffix: T.unsafe(nil)); end # Replaces non-ASCII characters with an ASCII approximation, or if none @@ -6802,9 +7259,7 @@ module ActiveSupport::Inflector # Transliteration is restricted to UTF-8, US-ASCII, and GB18030 strings. # Other encodings will raise an ArgumentError. # - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/inflector/transliterate.rb#64 + # pkg:gem/activesupport#lib/active_support/inflector/transliterate.rb:64 def transliterate(string, replacement = T.unsafe(nil), locale: T.unsafe(nil)); end # Makes an underscored, lowercase form from the expression in the string. @@ -6819,7 +7274,7 @@ module ActiveSupport::Inflector # # camelize(underscore('SSLError')) # => "SslError" # - # source://activesupport//lib/active_support/inflector/methods.rb#99 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:99 def underscore(camel_cased_word); end # Converts the first character in the string to uppercase. @@ -6828,7 +7283,7 @@ module ActiveSupport::Inflector # upcase_first('w') # => "W" # upcase_first('') # => "" # - # source://activesupport//lib/active_support/inflector/methods.rb#166 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:166 def upcase_first(string); end private @@ -6841,7 +7296,7 @@ module ActiveSupport::Inflector # apply_inflections('post', inflections.plurals, :en) # => "posts" # apply_inflections('posts', inflections.singulars, :en) # => "post" # - # source://activesupport//lib/active_support/inflector/methods.rb#376 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:376 def apply_inflections(word, rules, locale = T.unsafe(nil)); end # Mounts a regular expression, returned as a string to ease interpolation, @@ -6850,11 +7305,11 @@ module ActiveSupport::Inflector # const_regexp("Foo::Bar::Baz") # => "Foo(::Bar(::Baz)?)?" # const_regexp("::") # => "::" # - # source://activesupport//lib/active_support/inflector/methods.rb#357 + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:357 def const_regexp(camel_cased_word); end end -# source://activesupport//lib/active_support/inflector/transliterate.rb#8 +# pkg:gem/activesupport#lib/active_support/inflector/transliterate.rb:8 ActiveSupport::Inflector::ALLOWED_ENCODINGS_FOR_TRANSLITERATE = T.let(T.unsafe(nil), Array) # = Active Support \Inflections @@ -6878,11 +7333,9 @@ ActiveSupport::Inflector::ALLOWED_ENCODINGS_FOR_TRANSLITERATE = T.let(T.unsafe(n # singularization rules that is runs. This guarantees that your rules run # before any of the rules that may already have been loaded. # -# source://activesupport//lib/active_support/inflector/inflections.rb#30 +# pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:31 class ActiveSupport::Inflector::Inflections - # @return [Inflections] a new instance of Inflections - # - # source://activesupport//lib/active_support/inflector/inflections.rb#80 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:97 def initialize; end # Specifies a new acronym. An acronym must be specified as it will appear @@ -6935,18 +7388,16 @@ class ActiveSupport::Inflector::Inflections # underscore 'McDonald' # => 'mcdonald' # camelize 'mcdonald' # => 'McDonald' # - # source://activesupport//lib/active_support/inflector/inflections.rb#142 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:159 def acronym(word); end - # Returns the value of attribute acronyms. - # - # source://activesupport//lib/active_support/inflector/inflections.rb#76 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 def acronyms; end - # source://activesupport//lib/active_support/inflector/inflections.rb#78 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:95 def acronyms_camelize_regex; end - # source://activesupport//lib/active_support/inflector/inflections.rb#78 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:95 def acronyms_underscore_regex; end # Clears the loaded inflections within a given scope (default is @@ -6957,7 +7408,7 @@ class ActiveSupport::Inflector::Inflections # clear :all # clear :plurals # - # source://activesupport//lib/active_support/inflector/inflections.rb#231 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:248 def clear(scope = T.unsafe(nil)); end # Specifies a humanized form of a string by a regular expression rule or @@ -6969,12 +7420,10 @@ class ActiveSupport::Inflector::Inflections # human /_cnt$/i, '\1_count' # human 'legacy_col_person_name', 'Name' # - # source://activesupport//lib/active_support/inflector/inflections.rb#220 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:237 def human(rule, replacement); end - # Returns the value of attribute humans. - # - # source://activesupport//lib/active_support/inflector/inflections.rb#76 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 def humans; end # Specifies a new irregular that applies to both pluralization and @@ -6985,7 +7434,7 @@ class ActiveSupport::Inflector::Inflections # irregular 'cactus', 'cacti' # irregular 'person', 'people' # - # source://activesupport//lib/active_support/inflector/inflections.rb#174 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:191 def irregular(singular, plural); end # Specifies a new pluralization rule and its replacement. The rule can @@ -6993,12 +7442,10 @@ class ActiveSupport::Inflector::Inflections # always be a string that may include references to the matched data from # the rule. # - # source://activesupport//lib/active_support/inflector/inflections.rb#151 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:168 def plural(rule, replacement); end - # Returns the value of attribute plurals. - # - # source://activesupport//lib/active_support/inflector/inflections.rb#76 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 def plurals; end # Specifies a new singularization rule and its replacement. The rule can @@ -7006,12 +7453,10 @@ class ActiveSupport::Inflector::Inflections # always be a string that may include references to the matched data from # the rule. # - # source://activesupport//lib/active_support/inflector/inflections.rb#161 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:178 def singular(rule, replacement); end - # Returns the value of attribute singulars. - # - # source://activesupport//lib/active_support/inflector/inflections.rb#76 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 def singulars; end # Specifies words that are uncountable and should not be inflected. @@ -7020,58 +7465,73 @@ class ActiveSupport::Inflector::Inflections # uncountable 'money', 'information' # uncountable %w( money information rice ) # - # source://activesupport//lib/active_support/inflector/inflections.rb#208 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:225 def uncountable(*words); end - # Returns the value of attribute uncountables. - # - # source://activesupport//lib/active_support/inflector/inflections.rb#76 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 def uncountables; end private - # source://activesupport//lib/active_support/inflector/inflections.rb#250 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:267 def define_acronym_regex_patterns; end # Private, for the test suite. # - # source://activesupport//lib/active_support/inflector/inflections.rb#86 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:103 def initialize_dup(orig); end class << self - # source://activesupport//lib/active_support/inflector/inflections.rb#65 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:77 def instance(locale = T.unsafe(nil)); end - # source://activesupport//lib/active_support/inflector/inflections.rb#69 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:83 def instance_or_fallback(locale); end end end -# source://activesupport//lib/active_support/inflector/inflections.rb#33 -class ActiveSupport::Inflector::Inflections::Uncountables < ::Array - # @return [Uncountables] a new instance of Uncountables - # - # source://activesupport//lib/active_support/inflector/inflections.rb#34 +# pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:35 +class ActiveSupport::Inflector::Inflections::Uncountables + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:40 def initialize; end - # source://activesupport//lib/active_support/inflector/inflections.rb#44 - def <<(*word); end + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:50 + def <<(word); end - # source://activesupport//lib/active_support/inflector/inflections.rb#48 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def ==(arg); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:61 def add(words); end - # source://activesupport//lib/active_support/inflector/inflections.rb#39 + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:45 def delete(entry); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/inflector/inflections.rb#55 - def uncountable?(str); end + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def each(*_arg0, **_arg1, &_arg2); end - private + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def empty?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:57 + def flatten; end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def pop(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def to_a(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def to_ary(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def to_s(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/inflector/inflections.rb#60 - def to_regex(string); end + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:68 + def uncountable?(str); end end # = Inheritable Options @@ -7091,102 +7551,83 @@ end # h.girl # => 'Mary' # h.boy # => 'John' # -# source://activesupport//lib/active_support/ordered_options.rb#89 +# pkg:gem/activesupport#lib/active_support/ordered_options.rb:89 class ActiveSupport::InheritableOptions < ::ActiveSupport::OrderedOptions - # @return [InheritableOptions] a new instance of InheritableOptions - # - # source://activesupport//lib/active_support/ordered_options.rb#90 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:90 def initialize(parent = T.unsafe(nil)); end - # source://activesupport//lib/active_support/ordered_options.rb#107 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:107 def ==(other); end - # source://activesupport//lib/active_support/ordered_options.rb#142 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:142 def each(&block); end - # source://activesupport//lib/active_support/ordered_options.rb#134 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:134 def inheritable_copy; end - # source://activesupport//lib/active_support/ordered_options.rb#111 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:111 def inspect; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/ordered_options.rb#126 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:126 def key?(key); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/ordered_options.rb#130 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:130 def overridden?(key); end - # source://activesupport//lib/active_support/ordered_options.rb#119 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:119 def pretty_print(pp); end - # source://activesupport//lib/active_support/ordered_options.rb#138 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:138 def to_a; end - # source://activesupport//lib/active_support/ordered_options.rb#103 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:103 def to_h; end - # source://activesupport//lib/active_support/ordered_options.rb#115 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:115 def to_s; end private + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:123 def own_key?(_arg0); end end -# source://activesupport//lib/active_support/isolated_execution_state.rb#4 +# pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:4 module ActiveSupport::IsolatedExecutionState class << self - # source://activesupport//lib/active_support/isolated_execution_state.rb#35 + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:31 def [](key); end - # source://activesupport//lib/active_support/isolated_execution_state.rb#39 + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:37 def []=(key, value); end - # source://activesupport//lib/active_support/isolated_execution_state.rb#51 + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:50 def clear; end - # source://activesupport//lib/active_support/isolated_execution_state.rb#55 + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:54 def context; end - # source://activesupport//lib/active_support/isolated_execution_state.rb#47 + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:46 def delete(key); end - # Returns the value of attribute isolation_level. - # - # source://activesupport//lib/active_support/isolated_execution_state.rb#11 + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:11 def isolation_level; end - # source://activesupport//lib/active_support/isolated_execution_state.rb#13 + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:13 def isolation_level=(level); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/isolated_execution_state.rb#43 + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:42 def key?(key); end - # Returns the value of attribute scope. - # - # source://activesupport//lib/active_support/isolated_execution_state.rb#11 + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:11 def scope; end - # source://activesupport//lib/active_support/isolated_execution_state.rb#59 - def share_with(other); end - - # source://activesupport//lib/active_support/isolated_execution_state.rb#31 - def unique_id; end - - private - - # source://activesupport//lib/active_support/isolated_execution_state.rb#67 - def state; end + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:58 + def share_with(other, except: T.unsafe(nil), &block); end end end -# source://activesupport//lib/active_support/json/decoding.rb#11 +# pkg:gem/activesupport#lib/active_support/json/decoding.rb:11 module ActiveSupport::JSON class << self # Parses a JSON string (JavaScript Object Notation) into a Ruby object. @@ -7197,34 +7638,10 @@ module ActiveSupport::JSON # ActiveSupport::JSON.decode("2.39") # # => 2.39 # - # source://activesupport//lib/active_support/json/decoding.rb#24 - def decode(json); end + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:24 + def decode(json, options = T.unsafe(nil)); end - # Dumps objects in JSON (JavaScript Object Notation). - # See http://www.json.org for more info. - # - # ActiveSupport::JSON.encode({ team: 'rails', players: '36' }) - # # => "{\"team\":\"rails\",\"players\":\"36\"}" - # - # Generates JSON that is safe to include in JavaScript as it escapes - # U+2028 (Line Separator) and U+2029 (Paragraph Separator): - # - # ActiveSupport::JSON.encode({ key: "\u2028" }) - # # => "{\"key\":\"\\u2028\"}" - # - # By default, it also generates JSON that is safe to include in HTML, as - # it escapes <, >, and &: - # - # ActiveSupport::JSON.encode({ key: "<>&" }) - # # => "{\"key\":\"\\u003c\\u003e\\u0026\"}" - # - # This can be changed with the +escape_html_entities+ option, or the - # global escape_html_entities_in_json configuration option. - # - # ActiveSupport::JSON.encode({ key: "<>&" }, escape_html_entities: false) - # # => "{\"key\":\"<>&\"}" - # - # source://activesupport//lib/active_support/json/encoding.rb#40 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:56 def dump(value, options = T.unsafe(nil)); end # Dumps objects in JSON (JavaScript Object Notation). @@ -7233,8 +7650,8 @@ module ActiveSupport::JSON # ActiveSupport::JSON.encode({ team: 'rails', players: '36' }) # # => "{\"team\":\"rails\",\"players\":\"36\"}" # - # Generates JSON that is safe to include in JavaScript as it escapes - # U+2028 (Line Separator) and U+2029 (Paragraph Separator): + # By default, it generates JSON that is safe to include in JavaScript, as + # it escapes U+2028 (Line Separator) and U+2029 (Paragraph Separator): # # ActiveSupport::JSON.encode({ key: "\u2028" }) # # => "{\"key\":\"\\u2028\"}" @@ -7245,25 +7662,23 @@ module ActiveSupport::JSON # ActiveSupport::JSON.encode({ key: "<>&" }) # # => "{\"key\":\"\\u003c\\u003e\\u0026\"}" # - # This can be changed with the +escape_html_entities+ option, or the + # This behavior can be changed with the +escape_html_entities+ option, or the # global escape_html_entities_in_json configuration option. # # ActiveSupport::JSON.encode({ key: "<>&" }, escape_html_entities: false) # # => "{\"key\":\"<>&\"}" # - # source://activesupport//lib/active_support/json/encoding.rb#40 - def encode(value, options = T.unsafe(nil)); end - - # Parses a JSON string (JavaScript Object Notation) into a Ruby object. - # See http://www.json.org for more info. + # For performance reasons, you can set the +escape+ option to false, + # which will skip all escaping: # - # ActiveSupport::JSON.decode("{\"team\":\"rails\",\"players\":\"36\"}") - # # => {"team" => "rails", "players" => "36"} - # ActiveSupport::JSON.decode("2.39") - # # => 2.39 + # ActiveSupport::JSON.encode({ key: "\u2028<>&" }, escape: false) + # # => "{\"key\":\"\u2028<>&\"}" # - # source://activesupport//lib/active_support/json/decoding.rb#24 - def load(json); end + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:47 + def encode(value, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:33 + def load(json, options = T.unsafe(nil)); end # Returns the class of the error that will be raised when there is an # error in decoding JSON. Using this method means you won't directly @@ -7276,92 +7691,135 @@ module ActiveSupport::JSON # Rails.logger.warn("Attempted to decode invalid JSON: #{some_string}") # end # - # source://activesupport//lib/active_support/json/decoding.rb#45 + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:45 def parse_error; end private - # source://activesupport//lib/active_support/json/decoding.rb#50 + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:50 def convert_dates_from(data); end end end -# source://activesupport//lib/active_support/json/decoding.rb#14 +# pkg:gem/activesupport#lib/active_support/json/decoding.rb:14 ActiveSupport::JSON::DATETIME_REGEX = T.let(T.unsafe(nil), Regexp) # matches YAML-formatted dates # -# source://activesupport//lib/active_support/json/decoding.rb#13 +# pkg:gem/activesupport#lib/active_support/json/decoding.rb:13 ActiveSupport::JSON::DATE_REGEX = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/json/encoding.rb#46 +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:59 module ActiveSupport::JSON::Encoding class << self + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:241 + def encode_without_escape(value); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:237 + def encode_without_options(value); end + # If true, encode >, <, & as escaped unicode sequences (e.g. > as \u003e) # as a safety measure. # - # source://activesupport//lib/active_support/json/encoding.rb#121 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:214 def escape_html_entities_in_json; end # If true, encode >, <, & as escaped unicode sequences (e.g. > as \u003e) # as a safety measure. # - # source://activesupport//lib/active_support/json/encoding.rb#121 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:214 def escape_html_entities_in_json=(_arg0); end - # Sets the encoder used by \Rails to encode Ruby objects into JSON strings - # in +Object#to_json+ and +ActiveSupport::JSON.encode+. + # If true, encode LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) + # as escaped unicode sequences ('\u2028' and '\u2029'). + # Historically these characters were not valid inside JavaScript strings + # but that changed in ECMAScript 2019. As such it's no longer a concern in + # modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset. # - # source://activesupport//lib/active_support/json/encoding.rb#129 - def json_encoder; end + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:221 + def escape_js_separators_in_json; end + + # If true, encode LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) + # as escaped unicode sequences ('\u2028' and '\u2029'). + # Historically these characters were not valid inside JavaScript strings + # but that changed in ECMAScript 2019. As such it's no longer a concern in + # modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:221 + def escape_js_separators_in_json=(_arg0); end # Sets the encoder used by \Rails to encode Ruby objects into JSON strings # in +Object#to_json+ and +ActiveSupport::JSON.encode+. # - # source://activesupport//lib/active_support/json/encoding.rb#129 - def json_encoder=(_arg0); end + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:229 + def json_encoder; end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:231 + def json_encoder=(encoder); end # Sets the precision of encoded time values. # Defaults to 3 (equivalent to millisecond precision) # - # source://activesupport//lib/active_support/json/encoding.rb#125 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:225 def time_precision; end # Sets the precision of encoded time values. # Defaults to 3 (equivalent to millisecond precision) # - # source://activesupport//lib/active_support/json/encoding.rb#125 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:225 def time_precision=(_arg0); end # If true, use ISO 8601 format for dates and times. Otherwise, fall back # to the Active Support legacy format. # - # source://activesupport//lib/active_support/json/encoding.rb#117 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:210 def use_standard_json_time_format; end # If true, use ISO 8601 format for dates and times. Otherwise, fall back # to the Active Support legacy format. # - # source://activesupport//lib/active_support/json/encoding.rb#117 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:210 def use_standard_json_time_format=(_arg0); end end end -# source://activesupport//lib/active_support/json/encoding.rb#47 -class ActiveSupport::JSON::Encoding::JSONGemEncoder - # @return [JSONGemEncoder] a new instance of JSONGemEncoder - # - # source://activesupport//lib/active_support/json/encoding.rb#50 +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:63 +ActiveSupport::JSON::Encoding::ESCAPED_CHARS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:72 +ActiveSupport::JSON::Encoding::FULL_ESCAPE_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:71 +ActiveSupport::JSON::Encoding::HTML_ENTITIES_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:150 +class ActiveSupport::JSON::Encoding::JSONGemCoderEncoder + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:173 def initialize(options = T.unsafe(nil)); end # Encode the given object into a JSON string # - # source://activesupport//lib/active_support/json/encoding.rb#55 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:185 def encode(value); end +end - # Returns the value of attribute options. +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:152 +ActiveSupport::JSON::Encoding::JSONGemCoderEncoder::CODER = T.let(T.unsafe(nil), JSON::Coder) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:151 +ActiveSupport::JSON::Encoding::JSONGemCoderEncoder::JSON_NATIVE_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:75 +class ActiveSupport::JSON::Encoding::JSONGemEncoder + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:78 + def initialize(options = T.unsafe(nil)); end + + # Encode the given object into a JSON string # - # source://activesupport//lib/active_support/json/encoding.rb#48 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:83 + def encode(value); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:76 def options; end private @@ -7380,15 +7838,24 @@ class ActiveSupport::JSON::Encoding::JSONGemEncoder # to +object.as_json+, not any of this method's recursive +#as_json+ # calls. # - # source://activesupport//lib/active_support/json/encoding.rb#88 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:118 def jsonify(value); end # Encode a "jsonified" Ruby data structure using the JSON gem # - # source://activesupport//lib/active_support/json/encoding.rb#109 + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:143 def stringify(jsonified); end end +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:73 +ActiveSupport::JSON::Encoding::JS_SEPARATORS_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:60 +ActiveSupport::JSON::Encoding::U2028 = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:61 +ActiveSupport::JSON::Encoding::U2029 = T.let(T.unsafe(nil), String) + # = Key Generator # # KeyGenerator is a simple wrapper around OpenSSL's implementation of PBKDF2. @@ -7396,28 +7863,26 @@ end # This lets \Rails applications have a single secure secret, but avoid reusing that # key in multiple incompatible contexts. # -# source://activesupport//lib/active_support/key_generator.rb#13 +# pkg:gem/activesupport#lib/active_support/key_generator.rb:13 class ActiveSupport::KeyGenerator - # @return [KeyGenerator] a new instance of KeyGenerator - # - # source://activesupport//lib/active_support/key_generator.rb#28 + # pkg:gem/activesupport#lib/active_support/key_generator.rb:28 def initialize(secret, options = T.unsafe(nil)); end # Returns a derived key suitable for use. The default +key_size+ is chosen # to be compatible with the default settings of ActiveSupport::MessageVerifier. # i.e. OpenSSL::Digest::SHA1#block_length # - # source://activesupport//lib/active_support/key_generator.rb#41 + # pkg:gem/activesupport#lib/active_support/key_generator.rb:41 def generate_key(salt, key_size = T.unsafe(nil)); end - # source://activesupport//lib/active_support/key_generator.rb#45 + # pkg:gem/activesupport#lib/active_support/key_generator.rb:45 def inspect; end class << self - # source://activesupport//lib/active_support/key_generator.rb#23 + # pkg:gem/activesupport#lib/active_support/key_generator.rb:23 def hash_digest_class; end - # source://activesupport//lib/active_support/key_generator.rb#15 + # pkg:gem/activesupport#lib/active_support/key_generator.rb:15 def hash_digest_class=(klass); end end end @@ -7462,7 +7927,7 @@ end # end # end # -# source://activesupport//lib/active_support/lazy_load_hooks.rb#43 +# pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:43 module ActiveSupport::LazyLoadHooks # Declares a block that will be executed when a \Rails component is fully # loaded. If the component has already loaded, the block is executed @@ -7473,7 +7938,7 @@ module ActiveSupport::LazyLoadHooks # * :yield - Yields the object that run_load_hooks to +block+. # * :run_once - Given +block+ will run only once. # - # source://activesupport//lib/active_support/lazy_load_hooks.rb#60 + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:60 def on_load(name, options = T.unsafe(nil), &block); end # Executes all blocks registered to +name+ via on_load, using +base+ as the @@ -7484,19 +7949,19 @@ module ActiveSupport::LazyLoadHooks # In the case of the above example, it will execute all hooks registered # for +:active_record+ within the class +ActiveRecord::Base+. # - # source://activesupport//lib/active_support/lazy_load_hooks.rb#75 + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:75 def run_load_hooks(name, base = T.unsafe(nil)); end private - # source://activesupport//lib/active_support/lazy_load_hooks.rb#91 + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:91 def execute_hook(name, base, options, block); end - # source://activesupport//lib/active_support/lazy_load_hooks.rb#83 + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:83 def with_execution_control(name, block, once); end class << self - # source://activesupport//lib/active_support/lazy_load_hooks.rb#44 + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:44 def extended(base); end end end @@ -7556,52 +8021,45 @@ end # that all logs are flushed, and it is called in Rails::Rack::Logger after a # request finishes. # -# source://activesupport//lib/active_support/log_subscriber.rb#64 +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:64 class ActiveSupport::LogSubscriber < ::ActiveSupport::Subscriber - # @return [LogSubscriber] a new instance of LogSubscriber - # - # source://activesupport//lib/active_support/log_subscriber.rb#133 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:133 def initialize; end - # source://activesupport//lib/active_support/log_subscriber.rb#146 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:146 def call(event); end - # source://activesupport//lib/active_support/log_subscriber.rb#83 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:83 def colorize_logging; end - # source://activesupport//lib/active_support/log_subscriber.rb#83 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:83 def colorize_logging=(val); end - # source://activesupport//lib/active_support/log_subscriber.rb#163 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 def debug(progname = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/log_subscriber.rb#163 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 def error(progname = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/log_subscriber.rb#158 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:152 def event_levels=(_arg0); end - # source://activesupport//lib/active_support/log_subscriber.rb#163 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 def fatal(progname = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/log_subscriber.rb#163 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 def info(progname = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/log_subscriber.rb#138 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:138 def logger; end - # source://activesupport//lib/active_support/log_subscriber.rb#152 - def publish_event(event); end - - # @return [Boolean] - # - # source://activesupport//lib/active_support/log_subscriber.rb#142 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:142 def silenced?(event); end - # source://activesupport//lib/active_support/log_subscriber.rb#163 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 def unknown(progname = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/log_subscriber.rb#163 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 def warn(progname = T.unsafe(nil), &block); end private @@ -7610,119 +8068,113 @@ class ActiveSupport::LogSubscriber < ::ActiveSupport::Subscriber # by specifying bold, italic, or underline options. Inspired by Highline, # this method will automatically clear formatting at the end of the returned String. # - # source://activesupport//lib/active_support/log_subscriber.rb#172 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:166 def color(text, color, mode_options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/log_subscriber.rb#186 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:180 def log_exception(name, e); end - # source://activesupport//lib/active_support/log_subscriber.rb#180 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:174 def mode_from(options); end class << self - # source://activesupport//lib/active_support/log_subscriber.rb#99 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:99 def attach_to(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/log_subscriber.rb#83 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:83 def colorize_logging; end - # source://activesupport//lib/active_support/log_subscriber.rb#83 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:83 def colorize_logging=(val); end # Flush all log_subscribers' logger. # - # source://activesupport//lib/active_support/log_subscriber.rb#112 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:112 def flush_all!; end - # source://activesupport//lib/active_support/log_subscriber.rb#84 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 def log_levels; end - # source://activesupport//lib/active_support/log_subscriber.rb#84 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 def log_levels=(value); end - # source://activesupport//lib/active_support/log_subscriber.rb#84 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 def log_levels?; end - # source://activesupport//lib/active_support/log_subscriber.rb#107 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:107 def log_subscribers; end - # source://activesupport//lib/active_support/log_subscriber.rb#93 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:93 def logger; end - # Sets the attribute logger - # - # @param value the value to set the attribute logger to. - # - # source://activesupport//lib/active_support/log_subscriber.rb#105 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:105 def logger=(_arg0); end private - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 def __class_attr_log_levels; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 def __class_attr_log_levels=(new_value); end - # source://activesupport//lib/active_support/log_subscriber.rb#117 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:117 def fetch_public_methods(subscriber, inherit_all); end - # source://activesupport//lib/active_support/log_subscriber.rb#121 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:121 def set_event_levels; end - # source://activesupport//lib/active_support/log_subscriber.rb#127 + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:127 def subscribe_log_level(method, level); end end end # ANSI sequence colors # -# source://activesupport//lib/active_support/log_subscriber.rb#74 +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:74 ActiveSupport::LogSubscriber::BLACK = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/log_subscriber.rb#78 +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:78 ActiveSupport::LogSubscriber::BLUE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/log_subscriber.rb#80 +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:80 ActiveSupport::LogSubscriber::CYAN = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/log_subscriber.rb#76 +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:76 ActiveSupport::LogSubscriber::GREEN = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/log_subscriber.rb#86 +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:86 ActiveSupport::LogSubscriber::LEVEL_CHECKS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/log_subscriber.rb#79 +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:79 ActiveSupport::LogSubscriber::MAGENTA = T.let(T.unsafe(nil), String) # ANSI sequence modes # -# source://activesupport//lib/active_support/log_subscriber.rb#66 +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:66 ActiveSupport::LogSubscriber::MODES = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/log_subscriber.rb#75 +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:75 ActiveSupport::LogSubscriber::RED = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/log_subscriber.rb#81 +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:81 ActiveSupport::LogSubscriber::WHITE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/log_subscriber.rb#77 +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:77 ActiveSupport::LogSubscriber::YELLOW = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/logger.rb#8 +# pkg:gem/activesupport#lib/active_support/logger.rb:8 class ActiveSupport::Logger < ::Logger include ::ActiveSupport::LoggerSilence include ::ActiveSupport::LoggerThreadSafeLevel - # @return [Logger] a new instance of Logger - # - # source://activesupport//lib/active_support/logger.rb#33 + # pkg:gem/activesupport#lib/active_support/logger.rb:33 def initialize(*args, **kwargs); end - # source://activesupport//lib/active_support/logger_silence.rb#12 + # pkg:gem/activesupport#lib/active_support/logger.rb:9 def silencer; end - # source://activesupport//lib/active_support/logger_silence.rb#12 + # pkg:gem/activesupport#lib/active_support/logger.rb:9 def silencer=(val); end class << self @@ -7736,69 +8188,65 @@ class ActiveSupport::Logger < ::Logger # ActiveSupport::Logger.logger_outputs_to?(logger, '/var/log/rails.log') # # => true # - # @return [Boolean] - # - # source://activesupport//lib/active_support/logger.rb#20 + # pkg:gem/activesupport#lib/active_support/logger.rb:20 def logger_outputs_to?(logger, *sources); end - # source://activesupport//lib/active_support/logger.rb#47 + # pkg:gem/activesupport#lib/active_support/logger.rb:47 def normalize_sources(sources); end - # source://activesupport//lib/active_support/logger_silence.rb#12 + # pkg:gem/activesupport#lib/active_support/logger.rb:9 def silencer; end - # source://activesupport//lib/active_support/logger_silence.rb#12 + # pkg:gem/activesupport#lib/active_support/logger.rb:9 def silencer=(val); end end end # Simple formatter which only displays the message. # -# source://activesupport//lib/active_support/logger.rb#39 +# pkg:gem/activesupport#lib/active_support/logger.rb:39 class ActiveSupport::Logger::SimpleFormatter < ::Logger::Formatter # This method is invoked when a log event occurs # - # source://activesupport//lib/active_support/logger.rb#41 + # pkg:gem/activesupport#lib/active_support/logger.rb:41 def call(severity, timestamp, progname, msg); end end -# source://activesupport//lib/active_support/logger_silence.rb#8 +# pkg:gem/activesupport#lib/active_support/logger_silence.rb:8 module ActiveSupport::LoggerSilence extend ::ActiveSupport::Concern include ::ActiveSupport::LoggerThreadSafeLevel # Silences the logger for the duration of the block. # - # source://activesupport//lib/active_support/logger_silence.rb#17 + # pkg:gem/activesupport#lib/active_support/logger_silence.rb:17 def silence(severity = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/logger_thread_safe_level.rb#7 +# pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:7 module ActiveSupport::LoggerThreadSafeLevel extend ::ActiveSupport::Concern - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#10 + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:10 def initialize(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#35 + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:35 def level; end - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#15 + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:15 def local_level; end - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#19 + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:19 def local_level=(level); end # Change the thread-local level for the duration of the given block. # - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#40 + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:40 def log_at(level); end private - # Returns the value of attribute local_level_key. - # - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#48 + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:48 def local_level_key; end end @@ -7882,7 +8330,7 @@ end # # crypt.rotate old_secret, cipher: "aes-256-cbc" # -# source://activesupport//lib/active_support/message_encryptor.rb#90 +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:90 class ActiveSupport::MessageEncryptor < ::ActiveSupport::Messages::Codec include ::ActiveSupport::Messages::Rotator @@ -7949,12 +8397,10 @@ class ActiveSupport::MessageEncryptor < ::ActiveSupport::Messages::Codec # If you don't pass a truthy value, the default is set using # +config.active_support.use_message_serializer_for_metadata+. # - # @return [MessageEncryptor] a new instance of MessageEncryptor - # - # source://activesupport//lib/active_support/messages/rotator.rb#6 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:183 def initialize(*args, on_rotation: T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/message_encryptor.rb#256 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:256 def create_message(value, **options); end # Decrypt and verify a message. We need to verify the message in order to @@ -7974,7 +8420,7 @@ class ActiveSupport::MessageEncryptor < ::ActiveSupport::Messages::Codec # encryptor.decrypt_and_verify(message) # => "bye" # encryptor.decrypt_and_verify(message, purpose: "greeting") # => nil # - # source://activesupport//lib/active_support/message_encryptor.rb#241 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:241 def decrypt_and_verify(message, **options); end # Encrypt and sign a message. We need to sign the message in order to avoid @@ -8005,105 +8451,101 @@ class ActiveSupport::MessageEncryptor < ::ActiveSupport::Messages::Codec # specified when verifying the message; otherwise, verification will fail. # (See #decrypt_and_verify.) # - # source://activesupport//lib/active_support/message_encryptor.rb#220 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:220 def encrypt_and_sign(value, **options); end - # source://activesupport//lib/active_support/message_encryptor.rb#264 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:264 def inspect; end - # source://activesupport//lib/active_support/messages/rotator.rb#28 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:260 def read_message(message, on_rotation: T.unsafe(nil), **options); end private - # Returns the value of attribute aead_mode. - # - # source://activesupport//lib/active_support/message_encryptor.rb#371 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:371 def aead_mode; end - # Returns the value of attribute aead_mode. - # - # source://activesupport//lib/active_support/message_encryptor.rb#371 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:372 def aead_mode?; end - # source://activesupport//lib/active_support/message_encryptor.rb#295 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:295 def decrypt(encrypted_message); end - # source://activesupport//lib/active_support/message_encryptor.rb#277 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:277 def encrypt(data); end - # source://activesupport//lib/active_support/message_encryptor.rb#340 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:340 def extract_part(encrypted_message, rindex, length); end - # source://activesupport//lib/active_support/message_encryptor.rb#350 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:350 def extract_parts(encrypted_message); end - # source://activesupport//lib/active_support/message_encryptor.rb#336 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:336 def join_parts(parts); end - # source://activesupport//lib/active_support/message_encryptor.rb#320 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:320 def length_after_encode(length_before_encode); end - # source://activesupport//lib/active_support/message_encryptor.rb#332 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:332 def length_of_encoded_auth_tag; end - # source://activesupport//lib/active_support/message_encryptor.rb#328 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:328 def length_of_encoded_iv; end - # source://activesupport//lib/active_support/message_encryptor.rb#367 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:367 def new_cipher; end - # source://activesupport//lib/active_support/message_encryptor.rb#269 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:269 def sign(data); end - # source://activesupport//lib/active_support/message_encryptor.rb#273 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:273 def verify(data); end class << self - # source://activesupport//lib/active_support/message_encryptor.rb#96 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:96 def default_cipher; end # Given a cipher, returns the key length of the cipher to help generate the key of desired size # - # source://activesupport//lib/active_support/message_encryptor.rb#252 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:252 def key_len(cipher = T.unsafe(nil)); end - # source://activesupport//lib/active_support/message_encryptor.rb#93 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:93 def use_authenticated_message_encryption; end - # source://activesupport//lib/active_support/message_encryptor.rb#93 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:93 def use_authenticated_message_encryption=(val); end end end -# source://activesupport//lib/active_support/message_encryptor.rb#118 +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:118 ActiveSupport::MessageEncryptor::AUTH_TAG_LENGTH = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/message_encryptor.rb#115 +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:115 class ActiveSupport::MessageEncryptor::InvalidMessage < ::StandardError; end -# source://activesupport//lib/active_support/message_encryptor.rb#105 +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:105 module ActiveSupport::MessageEncryptor::NullSerializer class << self - # source://activesupport//lib/active_support/message_encryptor.rb#110 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:110 def dump(value); end - # source://activesupport//lib/active_support/message_encryptor.rb#106 + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:106 def load(value); end end end -# source://activesupport//lib/active_support/message_encryptor.rb#116 +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:116 ActiveSupport::MessageEncryptor::OpenSSLCipherError = OpenSSL::Cipher::CipherError -# source://activesupport//lib/active_support/message_encryptor.rb#119 +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:119 ActiveSupport::MessageEncryptor::SEPARATOR = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/message_encryptors.rb#6 +# pkg:gem/activesupport#lib/active_support/message_encryptors.rb:6 class ActiveSupport::MessageEncryptors < ::ActiveSupport::Messages::RotationCoordinator private - # source://activesupport//lib/active_support/message_encryptors.rb#135 + # pkg:gem/activesupport#lib/active_support/message_encryptors.rb:187 def build(salt, secret_generator:, secret_generator_options:, **options); end end @@ -8207,7 +8649,7 @@ end # # verifier.rotate(old_secret, digest: "SHA256", serializer: Marshal) # -# source://activesupport//lib/active_support/message_verifier.rb#110 +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:110 class ActiveSupport::MessageVerifier < ::ActiveSupport::Messages::Codec include ::ActiveSupport::Messages::Rotator @@ -8261,13 +8703,10 @@ class ActiveSupport::MessageVerifier < ::ActiveSupport::Messages::Codec # If you don't pass a truthy value, the default is set using # +config.active_support.use_message_serializer_for_metadata+. # - # @raise [ArgumentError] - # @return [MessageVerifier] a new instance of MessageVerifier - # - # source://activesupport//lib/active_support/messages/rotator.rb#6 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:167 def initialize(*args, on_rotation: T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/message_verifier.rb#310 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:310 def create_message(value, **options); end # Generates a signed message for the provided value. @@ -8305,13 +8744,13 @@ class ActiveSupport::MessageVerifier < ::ActiveSupport::Messages::Codec # specified when verifying the message; otherwise, verification will fail. # (See #verified and #verify.) # - # source://activesupport//lib/active_support/message_verifier.rb#306 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:306 def generate(value, **options); end - # source://activesupport//lib/active_support/message_verifier.rb#318 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:318 def inspect; end - # source://activesupport//lib/active_support/messages/rotator.rb#28 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:314 def read_message(message, on_rotation: T.unsafe(nil), **options); end # Checks if a signed message could have been generated by signing an object @@ -8324,9 +8763,7 @@ class ActiveSupport::MessageVerifier < ::ActiveSupport::Messages::Codec # tampered_message = signed_message.chop # editing the message invalidates the signature # verifier.valid_message?(tampered_message) # => false # - # @return [Boolean] - # - # source://activesupport//lib/active_support/message_verifier.rb#183 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:183 def valid_message?(message); end # Decodes the signed message using the +MessageVerifier+'s secret. @@ -8366,7 +8803,7 @@ class ActiveSupport::MessageVerifier < ::ActiveSupport::Messages::Codec # verifier.verified(message) # => "bye" # verifier.verified(message, purpose: "greeting") # => nil # - # source://activesupport//lib/active_support/message_verifier.rb#224 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:224 def verified(message, **options); end # Decodes the signed message using the +MessageVerifier+'s secret. @@ -8397,327 +8834,298 @@ class ActiveSupport::MessageVerifier < ::ActiveSupport::Messages::Codec # verifier.verify(message) # => "bye" # verifier.verify(message, purpose: "greeting") # => raises InvalidSignature # - # source://activesupport//lib/active_support/message_verifier.rb#262 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:262 def verify(message, **options); end private - # source://activesupport//lib/active_support/message_verifier.rb#323 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:323 def decode(encoded, url_safe: T.unsafe(nil)); end - # source://activesupport//lib/active_support/message_verifier.rb#356 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:356 def digest_length_in_hex; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/message_verifier.rb#373 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:373 def digest_matches_data?(digest, data); end - # source://activesupport//lib/active_support/message_verifier.rb#335 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:335 def extract_encoded(signed); end - # source://activesupport//lib/active_support/message_verifier.rb#352 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:352 def generate_digest(data); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/message_verifier.rb#364 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:364 def separator_at?(signed_message, index); end - # source://activesupport//lib/active_support/message_verifier.rb#368 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:368 def separator_index_for(signed_message); end - # source://activesupport//lib/active_support/message_verifier.rb#330 + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:330 def sign_encoded(encoded); end end -# source://activesupport//lib/active_support/message_verifier.rb#113 +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:113 class ActiveSupport::MessageVerifier::InvalidSignature < ::StandardError; end -# source://activesupport//lib/active_support/message_verifier.rb#115 +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:115 ActiveSupport::MessageVerifier::SEPARATOR = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/message_verifier.rb#116 +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:116 ActiveSupport::MessageVerifier::SEPARATOR_LENGTH = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/message_verifiers.rb#6 +# pkg:gem/activesupport#lib/active_support/message_verifiers.rb:6 class ActiveSupport::MessageVerifiers < ::ActiveSupport::Messages::RotationCoordinator private - # source://activesupport//lib/active_support/message_verifiers.rb#133 + # pkg:gem/activesupport#lib/active_support/message_verifiers.rb:185 def build(salt, secret_generator:, secret_generator_options:, **options); end end -# source://activesupport//lib/active_support/messages/rotator.rb#4 +# pkg:gem/activesupport#lib/active_support/messages/rotator.rb:4 module ActiveSupport::Messages; end -# source://activesupport//lib/active_support/messages/codec.rb#9 +# pkg:gem/activesupport#lib/active_support/messages/codec.rb:9 class ActiveSupport::Messages::Codec include ::ActiveSupport::Messages::Metadata - # @return [Codec] a new instance of Codec - # - # source://activesupport//lib/active_support/messages/codec.rb#15 + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:15 def initialize(**options); end private - # source://activesupport//lib/active_support/messages/codec.rb#45 + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:45 def catch_and_ignore(throwable, &block); end - # source://activesupport//lib/active_support/messages/codec.rb#52 + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:52 def catch_and_raise(throwable, as: T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/messages/codec.rb#29 + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:29 def decode(encoded, url_safe: T.unsafe(nil)); end - # source://activesupport//lib/active_support/messages/codec.rb#39 + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:39 def deserialize(serialized); end - # source://activesupport//lib/active_support/messages/codec.rb#25 + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:25 def encode(data, url_safe: T.unsafe(nil)); end - # source://activesupport//lib/active_support/messages/codec.rb#35 + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:35 def serialize(data); end - # Returns the value of attribute serializer. - # - # source://activesupport//lib/active_support/messages/codec.rb#23 + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:23 def serializer; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/messages/codec.rb#60 + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:60 def use_message_serializer_for_metadata?; end class << self - # source://activesupport//lib/active_support/messages/codec.rb#12 + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:12 def default_serializer; end - # source://activesupport//lib/active_support/messages/codec.rb#12 + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:12 def default_serializer=(value); end private - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:12 def __class_attr_default_serializer; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:12 def __class_attr_default_serializer=(new_value); end end end -# source://activesupport//lib/active_support/messages/metadata.rb#9 +# pkg:gem/activesupport#lib/active_support/messages/metadata.rb:9 module ActiveSupport::Messages::Metadata private - # source://activesupport//lib/active_support/messages/metadata.rb#128 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:128 def deserialize_from_json(serialized); end - # source://activesupport//lib/active_support/messages/metadata.rb#141 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:141 def deserialize_from_json_safe_string(string); end - # source://activesupport//lib/active_support/messages/metadata.rb#43 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:43 def deserialize_with_metadata(message, **expected_metadata); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/messages/metadata.rb#96 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:96 def dual_serialized_metadata_envelope_json?(string); end - # source://activesupport//lib/active_support/messages/metadata.rb#78 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:78 def extract_from_metadata_envelope(envelope, purpose: T.unsafe(nil)); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/messages/metadata.rb#92 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:92 def metadata_envelope?(object); end - # source://activesupport//lib/active_support/messages/metadata.rb#114 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:114 def parse_expiry(expires_at); end - # source://activesupport//lib/active_support/messages/metadata.rb#100 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:100 def pick_expiry(expires_at, expires_in); end - # source://activesupport//lib/active_support/messages/metadata.rb#124 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:124 def serialize_to_json(data); end - # source://activesupport//lib/active_support/messages/metadata.rb#137 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:137 def serialize_to_json_safe_string(data); end - # source://activesupport//lib/active_support/messages/metadata.rb#30 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:30 def serialize_with_metadata(data, **metadata); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/messages/metadata.rb#60 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:60 def use_message_serializer_for_metadata?; end - # source://activesupport//lib/active_support/messages/metadata.rb#64 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:64 def wrap_in_metadata_envelope(hash, expires_at: T.unsafe(nil), expires_in: T.unsafe(nil), purpose: T.unsafe(nil)); end - # source://activesupport//lib/active_support/messages/metadata.rb#71 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:71 def wrap_in_metadata_legacy_envelope(hash, expires_at: T.unsafe(nil), expires_in: T.unsafe(nil), purpose: T.unsafe(nil)); end class << self - # source://activesupport//lib/active_support/messages/metadata.rb#10 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:10 def use_message_serializer_for_metadata; end - # source://activesupport//lib/active_support/messages/metadata.rb#10 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:10 def use_message_serializer_for_metadata=(_arg0); end end end -# source://activesupport//lib/active_support/messages/metadata.rb#12 +# pkg:gem/activesupport#lib/active_support/messages/metadata.rb:12 ActiveSupport::Messages::Metadata::ENVELOPE_SERIALIZERS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/messages/metadata.rb#19 +# pkg:gem/activesupport#lib/active_support/messages/metadata.rb:19 ActiveSupport::Messages::Metadata::TIMESTAMP_SERIALIZERS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/messages/rotation_coordinator.rb#7 +# pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:7 class ActiveSupport::Messages::RotationCoordinator - # @raise [ArgumentError] - # @return [RotationCoordinator] a new instance of RotationCoordinator - # - # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#10 + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:10 def initialize(&secret_generator); end - # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#18 + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:18 def [](salt); end - # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#22 + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:22 def []=(salt, codec); end - # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#39 + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:48 def clear_rotations; end - # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#45 + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:54 def on_rotation(&callback); end - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#26 + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:35 + def prepend(**options, &block); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:26 def rotate(**options, &block); end - # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#35 + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:44 def rotate_defaults; end - # Returns the value of attribute transitional. - # - # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#8 + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:8 def transitional; end - # Sets the attribute transitional - # - # @param value the value to set the attribute transitional to. - # - # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#8 + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:8 def transitional=(_arg0); end private - # @raise [NotImplementedError] - # - # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#88 + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:97 def build(salt, secret_generator:, secret_generator_options:, **options); end - # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#76 + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:85 def build_with_rotations(salt); end - # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#51 + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:60 def changing_configuration!; end - # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#62 + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:71 def normalize_options(options); end end -# source://activesupport//lib/active_support/messages/rotator.rb#5 +# pkg:gem/activesupport#lib/active_support/messages/rotator.rb:5 module ActiveSupport::Messages::Rotator - # source://activesupport//lib/active_support/messages/rotator.rb#6 + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:6 def initialize(*args, on_rotation: T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/messages/rotator.rb#23 + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:23 def fall_back_to(fallback); end - # source://activesupport//lib/active_support/messages/rotator.rb#18 + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:18 def on_rotation(&on_rotation); end - # source://activesupport//lib/active_support/messages/rotator.rb#28 + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:28 def read_message(message, on_rotation: T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/messages/rotator.rb#14 + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:14 def rotate(*args, **options); end private - # source://activesupport//lib/active_support/messages/rotator.rb#49 + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:54 def build_rotation(*args, **options); end - # source://activesupport//lib/active_support/messages/rotator.rb#53 + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:58 def catch_rotation_error(&block); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:48 + def initialize_dup(*_arg0); end end -# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#8 +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:8 module ActiveSupport::Messages::SerializerWithFallback - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#17 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:17 def load(dumped); end private - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#33 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:33 def detect_format(dumped); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#44 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:44 def fallback?(format); end class << self - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#9 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:9 def [](format); end end end -# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#48 +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:48 module ActiveSupport::Messages::SerializerWithFallback::AllowMarshal private - # @return [Boolean] - # - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#50 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:50 def fallback?(format); end end -# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#78 +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:78 module ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback include ::ActiveSupport::Messages::SerializerWithFallback extend ::ActiveSupport::Messages::SerializerWithFallback extend ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#90 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:90 def _load(dumped); end - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#86 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:86 def dump(object); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#96 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:96 def dumped?(dumped); end - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#82 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:82 def format; end private - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#101 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:101 def detect_format(dumped); end end -# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#94 +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:94 ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback::JSON_START_WITH = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#107 +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:107 module ActiveSupport::Messages::SerializerWithFallback::JsonWithFallbackAllowMarshal include ::ActiveSupport::Messages::SerializerWithFallback include ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback @@ -8728,59 +9136,53 @@ module ActiveSupport::Messages::SerializerWithFallback::JsonWithFallbackAllowMar extend ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallbackAllowMarshal end -# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#55 +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:55 module ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback include ::ActiveSupport::Messages::SerializerWithFallback extend ::ActiveSupport::Messages::SerializerWithFallback extend ::ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#67 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:67 def _load(dumped); end - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#63 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:63 def dump(object); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#73 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:73 def dumped?(dumped); end - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#59 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:59 def format; end end -# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#71 +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:71 ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#113 +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:113 module ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback include ::ActiveSupport::Messages::SerializerWithFallback extend ::ActiveSupport::Messages::SerializerWithFallback extend ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#125 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:125 def _load(dumped); end - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#121 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:121 def dump(object); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#129 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:129 def dumped?(dumped); end - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#117 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:117 def format; end private - # @return [Boolean] - # - # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#134 + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:134 def available?; end end -# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#143 +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:143 module ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallbackAllowMarshal include ::ActiveSupport::Messages::SerializerWithFallback include ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback @@ -8791,15 +9193,15 @@ module ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallbackA extend ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallbackAllowMarshal end -# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#149 +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:149 ActiveSupport::Messages::SerializerWithFallback::SERIALIZERS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/multibyte.rb#4 +# pkg:gem/activesupport#lib/active_support/multibyte.rb:4 module ActiveSupport::Multibyte class << self # Returns the current proxy class. # - # source://activesupport//lib/active_support/multibyte.rb#19 + # pkg:gem/activesupport#lib/active_support/multibyte.rb:23 def proxy_class; end # The proxy class returned when calling mb_chars. You can use this accessor @@ -8809,7 +9211,7 @@ module ActiveSupport::Multibyte # # ActiveSupport::Multibyte.proxy_class = CharsForUTF32 # - # source://activesupport//lib/active_support/multibyte.rb#14 + # pkg:gem/activesupport#lib/active_support/multibyte.rb:14 def proxy_class=(klass); end end end @@ -8852,27 +9254,25 @@ end # # ActiveSupport::Multibyte.proxy_class = CharsForUTF32 # -# source://activesupport//lib/active_support/multibyte/chars.rb#47 +# pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:47 class ActiveSupport::Multibyte::Chars include ::Comparable # Creates a new Chars instance by wrapping _string_. # - # @return [Chars] a new instance of Chars - # - # source://activesupport//lib/active_support/multibyte/chars.rb#56 - def initialize(string); end + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:56 + def initialize(string, deprecation: T.unsafe(nil)); end - # source://activesupport//lib/active_support/multibyte/chars.rb#53 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 def <=>(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/multibyte/chars.rb#53 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 def =~(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/multibyte/chars.rb#53 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 def acts_like_string?(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/multibyte/chars.rb#164 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:171 def as_json(options = T.unsafe(nil)); end # Performs composition on all the characters. @@ -8880,7 +9280,7 @@ class ActiveSupport::Multibyte::Chars # 'é'.length # => 1 # 'é'.mb_chars.compose.to_s.length # => 1 # - # source://activesupport//lib/active_support/multibyte/chars.rb#143 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:150 def compose; end # Performs canonical decomposition on all the characters. @@ -8888,7 +9288,7 @@ class ActiveSupport::Multibyte::Chars # 'é'.length # => 1 # 'é'.mb_chars.decompose.to_s.length # => 2 # - # source://activesupport//lib/active_support/multibyte/chars.rb#135 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:142 def decompose; end # Returns the number of grapheme clusters in the string. @@ -8896,7 +9296,7 @@ class ActiveSupport::Multibyte::Chars # 'क्षि'.mb_chars.length # => 4 # 'क्षि'.mb_chars.grapheme_length # => 2 # - # source://activesupport//lib/active_support/multibyte/chars.rb#151 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:158 def grapheme_length; end # Limits the byte size of the string to a number of bytes without breaking @@ -8905,25 +9305,25 @@ class ActiveSupport::Multibyte::Chars # # 'こんにちは'.mb_chars.limit(7).to_s # => "こん" # - # source://activesupport//lib/active_support/multibyte/chars.rb#118 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:125 def limit(limit); end - # source://activesupport//lib/active_support/multibyte/chars.rb#53 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 def match?(*_arg0, **_arg1, &_arg2); end # Forward all undefined methods to the wrapped string. # - # source://activesupport//lib/active_support/multibyte/chars.rb#65 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:72 def method_missing(method, *_arg1, **_arg2, &_arg3); end # Reverses all characters in the string. # # 'Café'.mb_chars.reverse.to_s # => 'éfaC' # - # source://activesupport//lib/active_support/multibyte/chars.rb#109 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:116 def reverse; end - # source://activesupport//lib/active_support/multibyte/chars.rb#169 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:176 def reverse!(*args); end # Works like String#slice!, but returns an instance of @@ -8936,7 +9336,7 @@ class ActiveSupport::Multibyte::Chars # string.mb_chars.slice!(0..3) # => # # string # => 'me' # - # source://activesupport//lib/active_support/multibyte/chars.rb#99 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:106 def slice!(*args); end # Works just like String#split, with the exception that the items @@ -8945,7 +9345,7 @@ class ActiveSupport::Multibyte::Chars # # 'Café périferôl'.mb_chars.split(/é/).map { |part| part.upcase.to_s } # => ["CAF", " P", "RIFERÔL"] # - # source://activesupport//lib/active_support/multibyte/chars.rb#86 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:93 def split(*args); end # Replaces all ISO-8859-1 or CP1252 characters by their UTF-8 equivalent @@ -8954,18 +9354,13 @@ class ActiveSupport::Multibyte::Chars # Passing +true+ will forcibly tidy all bytes, assuming that the string's # encoding is entirely CP1252 or ISO-8859-1. # - # source://activesupport//lib/active_support/multibyte/chars.rb#160 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:167 def tidy_bytes(force = T.unsafe(nil)); end - # source://activesupport//lib/active_support/multibyte/chars.rb#169 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:176 def tidy_bytes!(*args); end - # Capitalizes the first letter of every word, when possible. - # - # "ÉL QUE SE ENTERÓ".mb_chars.titleize.to_s # => "Él Que Se Enteró" - # "日本語".mb_chars.titleize.to_s # => "日本語" - # - # source://activesupport//lib/active_support/multibyte/chars.rb#126 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:136 def titlecase; end # Capitalizes the first letter of every word, when possible. @@ -8973,51 +9368,43 @@ class ActiveSupport::Multibyte::Chars # "ÉL QUE SE ENTERÓ".mb_chars.titleize.to_s # => "Él Que Se Enteró" # "日本語".mb_chars.titleize.to_s # => "日本語" # - # source://activesupport//lib/active_support/multibyte/chars.rb#126 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:133 def titleize; end - # Returns the value of attribute wrapped_string. - # - # source://activesupport//lib/active_support/multibyte/chars.rb#49 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:50 def to_s; end - # Returns the value of attribute wrapped_string. - # - # source://activesupport//lib/active_support/multibyte/chars.rb#49 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:51 def to_str; end - # Returns the value of attribute wrapped_string. - # - # source://activesupport//lib/active_support/multibyte/chars.rb#49 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:49 def wrapped_string; end private - # source://activesupport//lib/active_support/multibyte/chars.rb#176 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:183 def chars(string); end # Returns +true+ if _obj_ responds to the given method. Private methods # are included in the search only if the optional second parameter # evaluates to +true+. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/multibyte/chars.rb#77 + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:84 def respond_to_missing?(method, include_private); end end -# source://activesupport//lib/active_support/multibyte/unicode.rb#5 +# pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:5 module ActiveSupport::Multibyte::Unicode extend ::ActiveSupport::Multibyte::Unicode # Compose decomposed characters to the composed form. # - # source://activesupport//lib/active_support/multibyte/unicode.rb#21 + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:21 def compose(codepoints); end # Decompose composed characters to the decomposed form. # - # source://activesupport//lib/active_support/multibyte/unicode.rb#12 + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:12 def decompose(type, codepoints); end # Replaces all ISO-8859-1 or CP1252 characters by their UTF-8 equivalent @@ -9026,18 +9413,18 @@ module ActiveSupport::Multibyte::Unicode # Passing +true+ will forcibly tidy all bytes, assuming that the string's # encoding is entirely CP1252 or ISO-8859-1. # - # source://activesupport//lib/active_support/multibyte/unicode.rb#30 + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:30 def tidy_bytes(string, force = T.unsafe(nil)); end private - # source://activesupport//lib/active_support/multibyte/unicode.rb#37 + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:37 def recode_windows1252_chars(string); end end # The Unicode version that is supported by the implementation # -# source://activesupport//lib/active_support/multibyte/unicode.rb#9 +# pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:9 ActiveSupport::Multibyte::Unicode::UNICODE_VERSION = T.let(T.unsafe(nil), String) # = \Notifications @@ -9229,13 +9616,13 @@ ActiveSupport::Multibyte::Unicode::UNICODE_VERSION = T.let(T.unsafe(nil), String # Notifications ships with a queue implementation that consumes and publishes events # to all log subscribers. You can use any queue implementation you want. # -# source://activesupport//lib/active_support/notifications/instrumenter.rb#7 +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:7 module ActiveSupport::Notifications class << self - # source://activesupport//lib/active_support/notifications.rb#208 + # pkg:gem/activesupport#lib/active_support/notifications.rb:208 def instrument(name, payload = T.unsafe(nil)); end - # source://activesupport//lib/active_support/notifications.rb#269 + # pkg:gem/activesupport#lib/active_support/notifications.rb:269 def instrumenter; end # Performs the same functionality as #subscribe, but the +start+ and @@ -9245,25 +9632,19 @@ module ActiveSupport::Notifications # duration is important. For example, computing elapsed time between # two events. # - # source://activesupport//lib/active_support/notifications.rb#254 + # pkg:gem/activesupport#lib/active_support/notifications.rb:254 def monotonic_subscribe(pattern = T.unsafe(nil), callback = T.unsafe(nil), &block); end - # Returns the value of attribute notifier. - # - # source://activesupport//lib/active_support/notifications.rb#198 + # pkg:gem/activesupport#lib/active_support/notifications.rb:198 def notifier; end - # Sets the attribute notifier - # - # @param value the value to set the attribute notifier to. - # - # source://activesupport//lib/active_support/notifications.rb#198 + # pkg:gem/activesupport#lib/active_support/notifications.rb:198 def notifier=(_arg0); end - # source://activesupport//lib/active_support/notifications.rb#200 + # pkg:gem/activesupport#lib/active_support/notifications.rb:200 def publish(name, *args); end - # source://activesupport//lib/active_support/notifications.rb#204 + # pkg:gem/activesupport#lib/active_support/notifications.rb:204 def publish_event(event); end # Subscribe to a given event name with the passed +block+. @@ -9294,39 +9675,37 @@ module ActiveSupport::Notifications # ActiveSupport::Notifications.subscribe(:render) {|event| ...} # #=> ArgumentError (pattern must be specified as a String, Regexp or empty) # - # source://activesupport//lib/active_support/notifications.rb#244 + # pkg:gem/activesupport#lib/active_support/notifications.rb:244 def subscribe(pattern = T.unsafe(nil), callback = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/notifications.rb#258 + # pkg:gem/activesupport#lib/active_support/notifications.rb:258 def subscribed(callback, pattern = T.unsafe(nil), monotonic: T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/notifications.rb#265 + # pkg:gem/activesupport#lib/active_support/notifications.rb:265 def unsubscribe(subscriber_or_name); end private - # source://activesupport//lib/active_support/notifications.rb#274 + # pkg:gem/activesupport#lib/active_support/notifications.rb:274 def registry; end end end -# source://activesupport//lib/active_support/notifications/instrumenter.rb#106 +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:106 class ActiveSupport::Notifications::Event - # @return [Event] a new instance of Event - # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#110 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:110 def initialize(name, start, ending, transaction_id, payload); end # Returns the number of allocations made between the call to #start! and # the call to #finish!. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#176 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:176 def allocations; end # Returns the CPU time (in milliseconds) passed between the call to # #start! and the call to #finish!. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#163 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:163 def cpu_time; end # Returns the difference in milliseconds between when the execution of the @@ -9342,76 +9721,66 @@ class ActiveSupport::Notifications::Event # # @event.duration # => 1000.138 # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#198 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:198 def duration; end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#128 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:128 def end; end # Record information at the time this event finishes # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#154 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:154 def finish!; end # Returns the time spent in GC (in milliseconds) between the call to #start! # and the call to #finish! # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#182 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:182 def gc_time; end - # Returns the idle time time (in milliseconds) passed between the call to + # Returns the idle time (in milliseconds) passed between the call to # #start! and the call to #finish!. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#169 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:169 def idle_time; end - # Returns the value of attribute name. - # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#107 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:107 def name; end - # Returns the value of attribute payload. - # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#108 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:108 def payload; end - # Sets the attribute payload - # - # @param value the value to set the attribute payload to. - # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#108 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:108 def payload=(_arg0); end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#132 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:132 def record; end # Record information at the time this event starts # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#146 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:146 def start!; end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#124 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:124 def time; end - # Returns the value of attribute transaction_id. - # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#107 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:107 def transaction_id; end private - # source://activesupport//lib/active_support/notifications/instrumenter.rb#203 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:203 def now; end # Likely on JRuby, TruffleRuby # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#230 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:230 def now_allocations; end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#210 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:210 def now_cpu; end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#220 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:220 def now_gc; end end @@ -9420,104 +9789,101 @@ end # # This class is thread safe. All methods are reentrant. # -# source://activesupport//lib/active_support/notifications/fanout.rb#49 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:55 class ActiveSupport::Notifications::Fanout include ::ActiveSupport::Notifications::FanoutIteration - # @return [Fanout] a new instance of Fanout - # - # source://activesupport//lib/active_support/notifications/fanout.rb#50 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:56 def initialize; end - # source://activesupport//lib/active_support/notifications/fanout.rb#297 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:319 def all_listeners_for(name); end - # source://activesupport//lib/active_support/notifications/fanout.rb#272 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:286 def build_handle(name, id, payload); end - # source://activesupport//lib/active_support/notifications/fanout.rb#101 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:106 def clear_cache(key = T.unsafe(nil)); end - # source://activesupport//lib/active_support/notifications/fanout.rb#283 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:305 def finish(name, id, payload, listeners = T.unsafe(nil)); end - # source://activesupport//lib/active_support/notifications/fanout.rb#187 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:190 + def group_listeners(listeners); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:196 def groups_for(name); end - # source://activesupport//lib/active_support/notifications/fanout.rb#59 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:64 def inspect; end - # source://activesupport//lib/active_support/notifications/fanout.rb#306 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:328 def listeners_for(name); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/notifications/fanout.rb#310 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:332 def listening?(name); end - # source://activesupport//lib/active_support/notifications/fanout.rb#289 - def publish(name, *args); end + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:311 + def publish(name, *_arg1, **_arg2, &_arg3); end - # source://activesupport//lib/active_support/notifications/fanout.rb#293 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:315 def publish_event(event); end - # source://activesupport//lib/active_support/notifications/fanout.rb#276 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:298 def start(name, id, payload); end - # source://activesupport//lib/active_support/notifications/fanout.rb#64 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:69 def subscribe(pattern = T.unsafe(nil), callable = T.unsafe(nil), monotonic: T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/notifications/fanout.rb#81 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:86 def unsubscribe(subscriber_or_name); end # This is a sync queue, so there is no waiting. # - # source://activesupport//lib/active_support/notifications/fanout.rb#315 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:337 def wait; end end -# source://activesupport//lib/active_support/notifications/fanout.rb#113 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:116 class ActiveSupport::Notifications::Fanout::BaseGroup include ::ActiveSupport::Notifications::FanoutIteration - # @return [BaseGroup] a new instance of BaseGroup - # - # source://activesupport//lib/active_support/notifications/fanout.rb#116 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:119 def initialize(listeners, name, id, payload); end - # source://activesupport//lib/active_support/notifications/fanout.rb#120 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:123 def each(&block); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#125 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:128 class ActiveSupport::Notifications::Fanout::BaseTimeGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup - # source://activesupport//lib/active_support/notifications/fanout.rb#130 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:133 def finish(name, id, payload); end - # source://activesupport//lib/active_support/notifications/fanout.rb#126 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:129 def start(name, id, payload); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#166 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:169 class ActiveSupport::Notifications::Fanout::EventObjectGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup - # source://activesupport//lib/active_support/notifications/fanout.rb#172 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:175 def finish(name, id, payload); end - # source://activesupport//lib/active_support/notifications/fanout.rb#167 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:170 def start(name, id, payload); end private - # source://activesupport//lib/active_support/notifications/fanout.rb#182 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:185 def build_event(name, id, payload); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#152 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:155 class ActiveSupport::Notifications::Fanout::EventedGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup - # source://activesupport//lib/active_support/notifications/fanout.rb#159 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:162 def finish(name, id, payload); end - # source://activesupport//lib/active_support/notifications/fanout.rb#153 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:156 def start(name, id, payload); end end @@ -9536,189 +9902,177 @@ end # handle.finish # end # -# source://activesupport//lib/active_support/notifications/fanout.rb#227 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:230 class ActiveSupport::Notifications::Fanout::Handle include ::ActiveSupport::Notifications::FanoutIteration - # @return [Handle] a new instance of Handle - # - # source://activesupport//lib/active_support/notifications/fanout.rb#230 - def initialize(notifier, name, id, payload); end + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:233 + def initialize(notifier, name, id, groups, payload); end - # source://activesupport//lib/active_support/notifications/fanout.rb#249 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:250 def finish; end - # source://activesupport//lib/active_support/notifications/fanout.rb#253 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:254 def finish_with_values(name, id, payload); end - # source://activesupport//lib/active_support/notifications/fanout.rb#240 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:241 def start; end private - # source://activesupport//lib/active_support/notifications/fanout.rb#263 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:264 def ensure_state!(expected); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#138 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:141 class ActiveSupport::Notifications::Fanout::MonotonicTimedGroup < ::ActiveSupport::Notifications::Fanout::BaseTimeGroup private - # source://activesupport//lib/active_support/notifications/fanout.rb#140 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:143 def now; end end -# source://activesupport//lib/active_support/notifications/fanout.rb#318 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:271 +module ActiveSupport::Notifications::Fanout::NullHandle + extend ::ActiveSupport::Notifications::Fanout::NullHandle + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:277 + def finish; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:280 + def finish_with_values(_name, _id, _payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:274 + def start; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:340 module ActiveSupport::Notifications::Fanout::Subscribers class << self - # source://activesupport//lib/active_support/notifications/fanout.rb#319 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:341 def new(pattern, listener, monotonic); end end end -# source://activesupport//lib/active_support/notifications/fanout.rb#433 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:455 class ActiveSupport::Notifications::Fanout::Subscribers::EventObject < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented - # source://activesupport//lib/active_support/notifications/fanout.rb#434 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:456 def group_class; end - # source://activesupport//lib/active_support/notifications/fanout.rb#438 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:460 def publish_event(event); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#375 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:397 class ActiveSupport::Notifications::Fanout::Subscribers::Evented - # @return [Evented] a new instance of Evented - # - # source://activesupport//lib/active_support/notifications/fanout.rb#378 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:400 def initialize(pattern, delegate); end - # Returns the value of attribute delegate. - # - # source://activesupport//lib/active_support/notifications/fanout.rb#376 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:398 def delegate; end - # source://activesupport//lib/active_support/notifications/fanout.rb#386 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:408 def group_class; end - # Returns the value of attribute pattern. - # - # source://activesupport//lib/active_support/notifications/fanout.rb#376 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:398 def pattern; end - # source://activesupport//lib/active_support/notifications/fanout.rb#390 - def publish(name, *args); end + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:412 + def publish(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/notifications/fanout.rb#396 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:418 def publish_event(event); end - # Returns the value of attribute silenceable. - # - # source://activesupport//lib/active_support/notifications/fanout.rb#376 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:398 def silenceable; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/notifications/fanout.rb#404 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:426 def silenced?(name); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/notifications/fanout.rb#408 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:430 def subscribed_to?(name); end - # source://activesupport//lib/active_support/notifications/fanout.rb#412 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:434 def unsubscribe!(name); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#338 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:360 class ActiveSupport::Notifications::Fanout::Subscribers::Matcher - # @return [Matcher] a new instance of Matcher - # - # source://activesupport//lib/active_support/notifications/fanout.rb#351 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:373 def initialize(pattern); end - # source://activesupport//lib/active_support/notifications/fanout.rb#360 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:382 def ===(name); end - # Returns the value of attribute exclusions. - # - # source://activesupport//lib/active_support/notifications/fanout.rb#339 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:361 def exclusions; end - # Returns the value of attribute pattern. - # - # source://activesupport//lib/active_support/notifications/fanout.rb#339 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:361 def pattern; end - # source://activesupport//lib/active_support/notifications/fanout.rb#356 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:378 def unsubscribe!(name); end class << self - # source://activesupport//lib/active_support/notifications/fanout.rb#341 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:363 def wrap(pattern); end end end -# source://activesupport//lib/active_support/notifications/fanout.rb#364 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:386 class ActiveSupport::Notifications::Fanout::Subscribers::Matcher::AllMessages - # source://activesupport//lib/active_support/notifications/fanout.rb#365 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:387 def ===(name); end - # source://activesupport//lib/active_support/notifications/fanout.rb#369 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:391 def unsubscribe!(*_arg0); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#427 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:449 class ActiveSupport::Notifications::Fanout::Subscribers::MonotonicTimed < ::ActiveSupport::Notifications::Fanout::Subscribers::Timed - # source://activesupport//lib/active_support/notifications/fanout.rb#428 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:450 def group_class; end end -# source://activesupport//lib/active_support/notifications/fanout.rb#417 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:439 class ActiveSupport::Notifications::Fanout::Subscribers::Timed < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented - # source://activesupport//lib/active_support/notifications/fanout.rb#418 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:440 def group_class; end - # source://activesupport//lib/active_support/notifications/fanout.rb#422 - def publish(name, *args); end + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:444 + def publish(*_arg0, **_arg1, &_arg2); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#145 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:148 class ActiveSupport::Notifications::Fanout::TimedGroup < ::ActiveSupport::Notifications::Fanout::BaseTimeGroup private - # source://activesupport//lib/active_support/notifications/fanout.rb#147 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:150 def now; end end -# source://activesupport//lib/active_support/notifications/fanout.rb#18 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:18 module ActiveSupport::Notifications::FanoutIteration private - # source://activesupport//lib/active_support/notifications/fanout.rb#20 - def iterate_guarding_exceptions(collection); end + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:20 + def iterate_guarding_exceptions(collection, &block); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#8 +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:8 class ActiveSupport::Notifications::InstrumentationSubscriberError < ::RuntimeError - # @return [InstrumentationSubscriberError] a new instance of InstrumentationSubscriberError - # - # source://activesupport//lib/active_support/notifications/fanout.rb#11 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:11 def initialize(exceptions); end - # Returns the value of attribute exceptions. - # - # source://activesupport//lib/active_support/notifications/fanout.rb#9 + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:9 def exceptions; end end # Instrumenters are stored in a thread local. # -# source://activesupport//lib/active_support/notifications/instrumenter.rb#9 +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:9 class ActiveSupport::Notifications::Instrumenter - # @return [Instrumenter] a new instance of Instrumenter - # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#12 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:12 def initialize(notifier); end # Returns a "handle" for an event with the given +name+ and +payload+. @@ -9732,20 +10086,18 @@ class ActiveSupport::Notifications::Instrumenter # # See ActiveSupport::Notifications::Fanout::Handle. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#78 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:78 def build_handle(name, payload); end # Send a finish notification with +name+ and +payload+. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#92 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:92 def finish(name, payload); end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#96 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:96 def finish_with_state(listeners_state, name, payload); end - # Returns the value of attribute id. - # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#10 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:10 def id; end # Given a block, instrument it by measuring the time taken to execute @@ -9753,51 +10105,47 @@ class ActiveSupport::Notifications::Instrumenter # notifier. Notice that events get sent even if an error occurs in the # passed-in block. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#54 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:54 def instrument(name, payload = T.unsafe(nil)); end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#82 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:82 def new_event(name, payload = T.unsafe(nil)); end # Send a start notification with +name+ and +payload+. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#87 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:87 def start(name, payload); end private - # source://activesupport//lib/active_support/notifications/instrumenter.rb#101 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:101 def unique_id; end end -# source://activesupport//lib/active_support/notifications/instrumenter.rb#21 +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:21 class ActiveSupport::Notifications::Instrumenter::LegacyHandle - # @return [LegacyHandle] a new instance of LegacyHandle - # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#34 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:34 def initialize(notifier, name, id, payload); end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#45 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:45 def finish; end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#41 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:41 def start; end end -# source://activesupport//lib/active_support/notifications/instrumenter.rb#22 +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:22 class ActiveSupport::Notifications::Instrumenter::LegacyHandle::Wrapper - # @return [Wrapper] a new instance of Wrapper - # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#23 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:23 def initialize(notifier); end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#27 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:27 def build_handle(name, id, payload); end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#31 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:31 def finish(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#31 + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:31 def start(*_arg0, **_arg1, &_arg2); end end @@ -9824,7 +10172,7 @@ end # end # end # -# source://activesupport//lib/active_support/number_helper.rb#26 +# pkg:gem/activesupport#lib/active_support/number_helper.rb:26 module ActiveSupport::NumberHelper extend ::ActiveSupport::Autoload extend ::ActiveSupport::NumberHelper @@ -9898,7 +10246,7 @@ module ActiveSupport::NumberHelper # number_to_currency(1234567890.50, strip_insignificant_zeros: true) # # => "$1,234,567,890.5" # - # source://activesupport//lib/active_support/number_helper.rb#161 + # pkg:gem/activesupport#lib/active_support/number_helper.rb:161 def number_to_currency(number, options = T.unsafe(nil)); end # Formats +number+ by grouping thousands with a delimiter. @@ -9938,7 +10286,7 @@ module ActiveSupport::NumberHelper # number_to_delimited("123456.78", delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/) # # => "1,23,456.78" # - # source://activesupport//lib/active_support/number_helper.rb#264 + # pkg:gem/activesupport#lib/active_support/number_helper.rb:264 def number_to_delimited(number, options = T.unsafe(nil)); end # Formats +number+ into a more human-friendly representation. Useful for @@ -10039,7 +10387,7 @@ module ActiveSupport::NumberHelper # number_to_human(0.1, units: :distance) # => "10 centimeters" # number_to_human(0.01, units: :distance) # => "1 centimeter" # - # source://activesupport//lib/active_support/number_helper.rb#475 + # pkg:gem/activesupport#lib/active_support/number_helper.rb:475 def number_to_human(number, options = T.unsafe(nil)); end # Formats +number+ as bytes into a more human-friendly representation. @@ -10091,7 +10439,7 @@ module ActiveSupport::NumberHelper # Whether to remove insignificant zeros after the decimal separator. # Defaults to true. # - # source://activesupport//lib/active_support/number_helper.rb#373 + # pkg:gem/activesupport#lib/active_support/number_helper.rb:373 def number_to_human_size(number, options = T.unsafe(nil)); end # Formats +number+ as a percentage string. @@ -10152,7 +10500,7 @@ module ActiveSupport::NumberHelper # number_to_percentage(100, format: "%n %") # # => "100.000 %" # - # source://activesupport//lib/active_support/number_helper.rb#223 + # pkg:gem/activesupport#lib/active_support/number_helper.rb:223 def number_to_percentage(number, options = T.unsafe(nil)); end # Formats +number+ into a phone number. @@ -10200,7 +10548,7 @@ module ActiveSupport::NumberHelper # number_to_phone(75561234567, pattern: /(\d{1,4})(\d{4})(\d{4})$/, area_code: true) # # => "(755) 6123-4567" # - # source://activesupport//lib/active_support/number_helper.rb#88 + # pkg:gem/activesupport#lib/active_support/number_helper.rb:88 def number_to_phone(number, options = T.unsafe(nil)); end # Formats +number+ to a specific level of precision. @@ -10255,377 +10603,359 @@ module ActiveSupport::NumberHelper # number_to_rounded(12.34, strip_insignificant_zeros: true) # => "12.34" # number_to_rounded(12.3456, strip_insignificant_zeros: true) # => "12.346" # - # source://activesupport//lib/active_support/number_helper.rb#320 + # pkg:gem/activesupport#lib/active_support/number_helper.rb:320 def number_to_rounded(number, options = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/number_helper/number_converter.rb#12 +# pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:12 class ActiveSupport::NumberHelper::NumberConverter - # @return [NumberConverter] a new instance of NumberConverter - # - # source://activesupport//lib/active_support/number_helper/number_converter.rb#124 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:124 def initialize(number, options); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#130 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:130 def execute; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 def namespace; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 def namespace=(_arg0); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 def namespace?; end - # Returns the value of attribute number. - # - # source://activesupport//lib/active_support/number_helper/number_converter.rb#19 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:19 def number; end - # Returns the value of attribute opts. - # - # source://activesupport//lib/active_support/number_helper/number_converter.rb#19 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:19 def opts; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 def validate_float; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 def validate_float=(_arg0); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 def validate_float?; end private - # source://activesupport//lib/active_support/number_helper/number_converter.rb#149 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:149 def default_format_options; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#174 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:174 def default_value(key); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#145 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:145 def format_options; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#155 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:155 def i18n_format_options; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#141 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:141 def options; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#170 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:170 def translate_in_locale(key, **i18n_options); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#166 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:166 def translate_number_value_with_default(key, **i18n_options); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#178 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:178 def valid_bigdecimal; end class << self - # source://activesupport//lib/active_support/number_helper/number_converter.rb#120 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:120 def convert(number, options); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 def namespace; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 def namespace=(value); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 def namespace?; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 def validate_float; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 def validate_float=(value); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 def validate_float?; end private - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 def __class_attr_namespace; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 def __class_attr_namespace=(new_value); end - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 def __class_attr_validate_float; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 def __class_attr_validate_float=(new_value); end end end -# source://activesupport//lib/active_support/number_helper/number_converter.rb#21 +# pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:21 ActiveSupport::NumberHelper::NumberConverter::DEFAULTS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/number_helper/number_to_currency_converter.rb#7 +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:7 class ActiveSupport::NumberHelper::NumberToCurrencyConverter < ::ActiveSupport::NumberHelper::NumberConverter - # source://activesupport//lib/active_support/number_helper/number_to_currency_converter.rb#10 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:10 def convert; end private - # source://activesupport//lib/active_support/number_helper/number_to_currency_converter.rb#38 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:38 def i18n_opts; end - # source://activesupport//lib/active_support/number_helper/number_to_currency_converter.rb#29 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:29 def options; end class << self private - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:8 def __class_attr_namespace; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:8 def __class_attr_namespace=(new_value); end end end -# source://activesupport//lib/active_support/number_helper/number_to_delimited_converter.rb#7 +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:7 class ActiveSupport::NumberHelper::NumberToDelimitedConverter < ::ActiveSupport::NumberHelper::NumberConverter - # source://activesupport//lib/active_support/number_helper/number_to_delimited_converter.rb#12 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:12 def convert; end private - # source://activesupport//lib/active_support/number_helper/number_to_delimited_converter.rb#25 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:40 def delimiter_pattern; end - # source://activesupport//lib/active_support/number_helper/number_to_delimited_converter.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:17 def parts; end class << self private - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:8 def __class_attr_validate_float; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:8 def __class_attr_validate_float=(new_value); end end end -# source://activesupport//lib/active_support/number_helper/number_to_delimited_converter.rb#10 +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:10 ActiveSupport::NumberHelper::NumberToDelimitedConverter::DEFAULT_DELIMITER_REGEX = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#7 +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:7 class ActiveSupport::NumberHelper::NumberToHumanConverter < ::ActiveSupport::NumberHelper::NumberConverter - # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#15 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:15 def convert; end private - # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#50 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:50 def calculate_exponent(units); end - # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#38 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:38 def determine_unit(units, exponent); end - # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#34 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:34 def format; end - # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#55 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:55 def unit_exponents(units); end class << self private - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:12 def __class_attr_namespace; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:12 def __class_attr_namespace=(new_value); end - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:13 def __class_attr_validate_float; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:13 def __class_attr_validate_float=(new_value); end end end -# source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#8 +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:8 ActiveSupport::NumberHelper::NumberToHumanConverter::DECIMAL_UNITS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#10 +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:10 ActiveSupport::NumberHelper::NumberToHumanConverter::INVERTED_DECIMAL_UNITS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#7 +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:7 class ActiveSupport::NumberHelper::NumberToHumanSizeConverter < ::ActiveSupport::NumberHelper::NumberConverter - # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#13 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:13 def convert; end private - # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#55 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:55 def base; end - # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#31 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:31 def conversion_format; end - # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#44 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:44 def exponent; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#51 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:51 def smaller_than_base?; end - # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#39 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:39 def storage_unit_key; end - # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#35 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:35 def unit; end class << self private - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:10 def __class_attr_namespace; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:10 def __class_attr_namespace=(new_value); end - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:11 def __class_attr_validate_float; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:11 def __class_attr_validate_float=(new_value); end end end -# source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#8 +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:8 ActiveSupport::NumberHelper::NumberToHumanSizeConverter::STORAGE_UNITS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/number_helper/number_to_percentage_converter.rb#7 +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:7 class ActiveSupport::NumberHelper::NumberToPercentageConverter < ::ActiveSupport::NumberHelper::NumberConverter - # source://activesupport//lib/active_support/number_helper/number_to_percentage_converter.rb#10 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:10 def convert; end class << self private - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:8 def __class_attr_namespace; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:8 def __class_attr_namespace=(new_value); end end end -# source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#8 +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:8 class ActiveSupport::NumberHelper::NumberToPhoneConverter < ::ActiveSupport::NumberHelper::NumberConverter - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#9 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:9 def convert; end private - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#16 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:16 def convert_to_phone_number(number); end - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#24 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:24 def convert_with_area_code(number); end - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#31 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:31 def convert_without_area_code(number); end - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#47 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:47 def country_code(code); end - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#43 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:43 def delimiter; end - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#51 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:51 def phone_ext(ext); end - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#55 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:55 def regexp_pattern(default_pattern); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#39 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:39 def start_with_delimiter?(number); end end -# source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#7 +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:7 class ActiveSupport::NumberHelper::NumberToRoundedConverter < ::ActiveSupport::NumberHelper::NumberConverter - # source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#11 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:11 def convert; end private - # source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#49 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:49 def format_number(number); end - # source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#45 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:45 def strip_insignificant_zeros; end class << self private - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:8 def __class_attr_namespace; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:8 def __class_attr_namespace=(new_value); end - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:9 def __class_attr_validate_float; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:9 def __class_attr_validate_float=(new_value); end end end -# source://activesupport//lib/active_support/number_helper/rounding_helper.rb#5 +# pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:5 class ActiveSupport::NumberHelper::RoundingHelper - # @return [RoundingHelper] a new instance of RoundingHelper - # - # source://activesupport//lib/active_support/number_helper/rounding_helper.rb#8 + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:8 def initialize(options); end - # source://activesupport//lib/active_support/number_helper/rounding_helper.rb#20 + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:20 def digit_count(number); end - # Returns the value of attribute options. - # - # source://activesupport//lib/active_support/number_helper/rounding_helper.rb#6 + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:6 def options; end - # source://activesupport//lib/active_support/number_helper/rounding_helper.rb#12 + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:12 def round(number); end private - # source://activesupport//lib/active_support/number_helper/rounding_helper.rb#37 + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:37 def absolute_precision(number); end - # source://activesupport//lib/active_support/number_helper/rounding_helper.rb#26 + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:26 def convert_to_decimal(number); end end -# source://activesupport//lib/active_support/option_merger.rb#6 +# pkg:gem/activesupport#lib/active_support/option_merger.rb:6 class ActiveSupport::OptionMerger - # @return [OptionMerger] a new instance of OptionMerger - # - # source://activesupport//lib/active_support/option_merger.rb#11 + # pkg:gem/activesupport#lib/active_support/option_merger.rb:11 def initialize(context, options); end private - # source://activesupport//lib/active_support/option_merger.rb#16 + # pkg:gem/activesupport#lib/active_support/option_merger.rb:16 def method_missing(method, *arguments, &block); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/option_merger.rb#34 + # pkg:gem/activesupport#lib/active_support/option_merger.rb:34 def respond_to_missing?(*_arg0, **_arg1, &_arg2); end end @@ -10644,28 +10974,26 @@ end # +ActiveSupport::OrderedHash+ is namespaced to prevent conflicts # with other implementations. # -# source://activesupport//lib/active_support/ordered_hash.rb#24 +# pkg:gem/activesupport#lib/active_support/ordered_hash.rb:24 class ActiveSupport::OrderedHash < ::Hash - # source://activesupport//lib/active_support/ordered_hash.rb#29 + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:29 def encode_with(coder); end # Returns true to make sure that this hash is extractable via Array#extract_options! # - # @return [Boolean] - # - # source://activesupport//lib/active_support/ordered_hash.rb#46 + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:46 def extractable_options?; end - # source://activesupport//lib/active_support/ordered_hash.rb#41 + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:41 def nested_under_indifferent_access; end - # source://activesupport//lib/active_support/ordered_hash.rb#37 + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:37 def reject(*args, &block); end - # source://activesupport//lib/active_support/ordered_hash.rb#33 + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:33 def select(*args, &block); end - # source://activesupport//lib/active_support/ordered_hash.rb#25 + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:25 def to_yaml_type; end end @@ -10696,68 +11024,132 @@ end # # h.dog! # => raises KeyError: :dog is blank # -# source://activesupport//lib/active_support/ordered_options.rb#33 +# pkg:gem/activesupport#lib/active_support/ordered_options.rb:33 class ActiveSupport::OrderedOptions < ::Hash - # source://activesupport//lib/active_support/ordered_options.rb#41 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:41 def [](key); end - # source://activesupport//lib/active_support/ordered_options.rb#37 + # make it protected + # + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:37 def []=(key, value); end - # source://activesupport//lib/active_support/ordered_options.rb#45 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:45 def dig(key, *identifiers); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/ordered_options.rb#64 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:64 def extractable_options?; end - # source://activesupport//lib/active_support/ordered_options.rb#68 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:68 def inspect; end - # source://activesupport//lib/active_support/ordered_options.rb#49 + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:49 def method_missing(method, *args); end protected - # preserve the original #[] method - def _get(_arg0); end + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:34 + def _get(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:60 + def respond_to_missing?(name, include_private); end +end + +# = Active Support Parameter Filter +# +# +ParameterFilter+ replaces values in a Hash-like object if their +# keys match one of the specified filters. +# +# Matching based on nested keys is possible by using dot notation, e.g. +# "credit_card.number". +# +# If a proc is given as a filter, each key and value of the Hash-like +# and of any nested Hashes will be passed to it. The value or key can +# then be mutated as desired using methods such as String#replace. +# +# # Replaces values with "[FILTERED]" for keys that match /password/i. +# ActiveSupport::ParameterFilter.new([:password]) +# +# # Replaces values with "[FILTERED]" for keys that match /foo|bar/i. +# ActiveSupport::ParameterFilter.new([:foo, "bar"]) +# +# # Replaces values for the exact key "pin" and for keys that begin with +# # "pin_". Does not match keys that otherwise include "pin" as a +# # substring, such as "shipping_id". +# ActiveSupport::ParameterFilter.new([/\Apin\z/, /\Apin_/]) +# +# # Replaces the value for :code in `{ credit_card: { code: "xxxx" } }`. +# # Does not change `{ file: { code: "xxxx" } }`. +# ActiveSupport::ParameterFilter.new(["credit_card.code"]) +# +# # Reverses values for keys that match /secret/i. +# ActiveSupport::ParameterFilter.new([-> (k, v) do +# v.reverse! if /secret/i.match?(k) +# end]) +# +# pkg:gem/activesupport#lib/active_support/parameter_filter.rb:39 +class ActiveSupport::ParameterFilter + # Create instance with given filters. Supported type of filters are +String+, +Regexp+, and +Proc+. + # Other types of filters are treated as +String+ using +to_s+. + # For +Proc+ filters, key, value, and optional original hash is passed to block arguments. + # + # ==== Options + # + # * :mask - A replaced object when filtered. Defaults to "[FILTERED]". + # + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:77 + def initialize(filters = T.unsafe(nil), mask: T.unsafe(nil)); end + + # Mask value of +params+ if key matches one of filters. + # + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:83 + def filter(params); end + + # Returns filtered value for given key. For +Proc+ filters, third block argument is not populated. + # + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:88 + def filter_param(key, value); end + + private + + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:125 + def call(params, full_parent_key = T.unsafe(nil), original_params = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:93 + def compile_filters!(filters); end - private + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:135 + def value_for_key(key, value, full_parent_key = T.unsafe(nil), original_params = T.unsafe(nil)); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/ordered_options.rb#60 - def respond_to_missing?(name, include_private); end + class << self + # Precompiles an array of filters that otherwise would be passed directly to + # #initialize. Depending on the quantity and types of filters, + # precompilation can improve filtering performance, especially in the case + # where the ParameterFilter instance itself cannot be retained (but the + # precompiled filters can be retained). + # + # filters = [/foo/, :bar, "nested.baz", /nested\.qux/] + # + # precompiled = ActiveSupport::ParameterFilter.precompile_filters(filters) + # # => [/(?-mix:foo)|(?i:bar)/, /(?i:nested\.baz)|(?-mix:nested\.qux)/] + # + # ActiveSupport::ParameterFilter.new(precompiled) + # + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:55 + def precompile_filters(filters); end + end end +# pkg:gem/activesupport#lib/active_support/parameter_filter.rb:40 +ActiveSupport::ParameterFilter::FILTERED = T.let(T.unsafe(nil), String) + # = \Range With Format # -# source://activesupport//lib/active_support/core_ext/range/conversions.rb#5 +# pkg:gem/activesupport#lib/active_support/core_ext/range/conversions.rb:5 module ActiveSupport::RangeWithFormat - # Convert range to a formatted string. See RANGE_FORMATS for predefined formats. - # - # This method is aliased to to_formatted_s. - # - # range = (1..100) # => 1..100 - # - # range.to_s # => "1..100" - # range.to_fs(:db) # => "BETWEEN '1' AND '100'" - # - # range = (1..) # => 1.. - # range.to_fs(:db) # => ">= '1'" - # - # range = (..100) # => ..100 - # range.to_fs(:db) # => "<= '100'" - # - # == Adding your own range formats to to_fs - # You can add your own formats to the Range::RANGE_FORMATS hash. - # Use the format name as the hash key and a Proc instance. - # - # # config/initializers/range_formats.rb - # Range::RANGE_FORMATS[:short] = ->(start, stop) { "Between #{start.to_fs(:db)} and #{stop.to_fs(:db)}" } - # - # source://activesupport//lib/active_support/core_ext/range/conversions.rb#51 + # pkg:gem/activesupport#lib/active_support/core_ext/range/conversions.rb:58 def to_formatted_s(format = T.unsafe(nil)); end # Convert range to a formatted string. See RANGE_FORMATS for predefined formats. @@ -10782,11 +11174,11 @@ module ActiveSupport::RangeWithFormat # # config/initializers/range_formats.rb # Range::RANGE_FORMATS[:short] = ->(start, stop) { "Between #{start.to_fs(:db)} and #{stop.to_fs(:db)}" } # - # source://activesupport//lib/active_support/core_ext/range/conversions.rb#51 + # pkg:gem/activesupport#lib/active_support/core_ext/range/conversions.rb:51 def to_fs(format = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/range/conversions.rb#6 +# pkg:gem/activesupport#lib/active_support/core_ext/range/conversions.rb:6 ActiveSupport::RangeWithFormat::RANGE_FORMATS = T.let(T.unsafe(nil), Hash) # = Active Support \Reloader @@ -10810,149 +11202,156 @@ ActiveSupport::RangeWithFormat::RANGE_FORMATS = T.let(T.unsafe(nil), Hash) # after_class_unload -- Run immediately after the classes are # unloaded. # -# source://activesupport//lib/active_support/reloader.rb#28 +# pkg:gem/activesupport#lib/active_support/reloader.rb:28 class ActiveSupport::Reloader < ::ActiveSupport::ExecutionWrapper - # @return [Reloader] a new instance of Reloader - # - # source://activesupport//lib/active_support/reloader.rb#99 + # pkg:gem/activesupport#lib/active_support/reloader.rb:99 def initialize; end - # source://activesupport//lib/active_support/callbacks.rb#924 + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 def _class_unload_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#924 + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 def _prepare_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#912 - def _run_class_unload_callbacks(&block); end + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _run_class_unload_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _run_class_unload_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _run_prepare_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#912 - def _run_prepare_callbacks(&block); end + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _run_prepare_callbacks!(&block); end - # source://activesupport//lib/active_support/reloader.rb#85 + # pkg:gem/activesupport#lib/active_support/reloader.rb:48 + def _run_run_callbacks(&block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 def check; end - # source://activesupport//lib/active_support/reloader.rb#85 + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 def check=(_arg0); end - # source://activesupport//lib/active_support/reloader.rb#85 + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 def check?; end - # source://activesupport//lib/active_support/reloader.rb#126 + # pkg:gem/activesupport#lib/active_support/reloader.rb:126 def class_unload!(&block); end - # source://activesupport//lib/active_support/reloader.rb#131 + # pkg:gem/activesupport#lib/active_support/reloader.rb:131 def complete!; end - # source://activesupport//lib/active_support/reloader.rb#84 + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 def executor; end - # source://activesupport//lib/active_support/reloader.rb#84 + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 def executor=(_arg0); end - # source://activesupport//lib/active_support/reloader.rb#84 + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 def executor?; end # Release the unload lock if it has been previously obtained # - # source://activesupport//lib/active_support/reloader.rb#114 + # pkg:gem/activesupport#lib/active_support/reloader.rb:114 def release_unload_lock!; end # Acquire the ActiveSupport::Dependencies::Interlock unload lock, # ensuring it will be released automatically # - # source://activesupport//lib/active_support/reloader.rb#106 + # pkg:gem/activesupport#lib/active_support/reloader.rb:106 def require_unload_lock!; end - # source://activesupport//lib/active_support/reloader.rb#121 + # pkg:gem/activesupport#lib/active_support/reloader.rb:121 def run!; end class << self - # source://activesupport//lib/active_support/callbacks.rb#916 + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 def _class_unload_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#920 + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 def _class_unload_callbacks=(value); end - # source://activesupport//lib/active_support/callbacks.rb#916 + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 def _prepare_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#920 + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 def _prepare_callbacks=(value); end # Registers a callback that will run immediately after the classes are unloaded. # - # source://activesupport//lib/active_support/reloader.rb#44 + # pkg:gem/activesupport#lib/active_support/reloader.rb:44 def after_class_unload(*args, &block); end # Registers a callback that will run immediately before the classes are unloaded. # - # source://activesupport//lib/active_support/reloader.rb#39 + # pkg:gem/activesupport#lib/active_support/reloader.rb:39 def before_class_unload(*args, &block); end - # source://activesupport//lib/active_support/reloader.rb#85 + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 def check; end - # source://activesupport//lib/active_support/reloader.rb#87 + # pkg:gem/activesupport#lib/active_support/reloader.rb:87 def check!; end - # source://activesupport//lib/active_support/reloader.rb#85 + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 def check=(value); end - # source://activesupport//lib/active_support/reloader.rb#85 + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 def check?; end - # source://activesupport//lib/active_support/reloader.rb#84 + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 def executor; end - # source://activesupport//lib/active_support/reloader.rb#84 + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 def executor=(value); end - # source://activesupport//lib/active_support/reloader.rb#84 + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 def executor?; end - # source://activesupport//lib/active_support/reloader.rb#95 + # pkg:gem/activesupport#lib/active_support/reloader.rb:95 def prepare!; end # Initiate a manual reload # - # source://activesupport//lib/active_support/reloader.rb#51 + # pkg:gem/activesupport#lib/active_support/reloader.rb:51 def reload!; end - # source://activesupport//lib/active_support/reloader.rb#91 + # pkg:gem/activesupport#lib/active_support/reloader.rb:91 def reloaded!; end - # source://activesupport//lib/active_support/reloader.rb#62 + # pkg:gem/activesupport#lib/active_support/reloader.rb:62 def run!(reset: T.unsafe(nil)); end # Registers a callback that will run once at application startup and every time the code is reloaded. # - # source://activesupport//lib/active_support/reloader.rb#34 + # pkg:gem/activesupport#lib/active_support/reloader.rb:34 def to_prepare(*args, &block); end # Run the supplied block as a work unit, reloading code as needed # - # source://activesupport//lib/active_support/reloader.rb#71 + # pkg:gem/activesupport#lib/active_support/reloader.rb:71 def wrap(**kwargs); end private - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 def __class_attr___callbacks; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 def __class_attr___callbacks=(new_value); end - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 def __class_attr_check; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 def __class_attr_check=(new_value); end - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 def __class_attr_executor; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 def __class_attr_executor=(new_value); end end end @@ -10961,7 +11360,7 @@ end # # Rescuable module adds support for easier exception handling. # -# source://activesupport//lib/active_support/rescuable.rb#11 +# pkg:gem/activesupport#lib/active_support/rescuable.rb:11 module ActiveSupport::Rescuable extend ::ActiveSupport::Concern include GeneratedInstanceMethods @@ -10972,13 +11371,13 @@ module ActiveSupport::Rescuable # Internal handler lookup. Delegates to class method. Some libraries call # this directly, so keeping it around for compatibility. # - # source://activesupport//lib/active_support/rescuable.rb#172 + # pkg:gem/activesupport#lib/active_support/rescuable.rb:172 def handler_for_rescue(exception); end # Delegates to the class method, but uses the instance as the subject for # rescue_from handlers (method calls, +instance_exec+ blocks). # - # source://activesupport//lib/active_support/rescuable.rb#166 + # pkg:gem/activesupport#lib/active_support/rescuable.rb:166 def rescue_with_handler(exception); end module GeneratedClassMethods @@ -10994,9 +11393,9 @@ module ActiveSupport::Rescuable end end -# source://activesupport//lib/active_support/rescuable.rb#18 +# pkg:gem/activesupport#lib/active_support/rescuable.rb:18 module ActiveSupport::Rescuable::ClassMethods - # source://activesupport//lib/active_support/rescuable.rb#105 + # pkg:gem/activesupport#lib/active_support/rescuable.rb:105 def handler_for_rescue(exception, object: T.unsafe(nil)); end # Registers exception classes with a handler to be called by rescue_with_handler. @@ -11034,7 +11433,7 @@ module ActiveSupport::Rescuable::ClassMethods # # Exceptions raised inside exception handlers are not propagated up. # - # source://activesupport//lib/active_support/rescuable.rb#53 + # pkg:gem/activesupport#lib/active_support/rescuable.rb:53 def rescue_from(*klasses, with: T.unsafe(nil), &block); end # Matches an exception to a handler based on the exception class. @@ -11052,252 +11451,253 @@ module ActiveSupport::Rescuable::ClassMethods # # Returns the exception if it was handled and +nil+ if it was not. # - # source://activesupport//lib/active_support/rescuable.rb#90 + # pkg:gem/activesupport#lib/active_support/rescuable.rb:90 def rescue_with_handler(exception, object: T.unsafe(nil), visited_exceptions: T.unsafe(nil)); end private - # source://activesupport//lib/active_support/rescuable.rb#139 + # pkg:gem/activesupport#lib/active_support/rescuable.rb:139 def constantize_rescue_handler_class(class_or_name); end - # source://activesupport//lib/active_support/rescuable.rb#124 + # pkg:gem/activesupport#lib/active_support/rescuable.rb:124 def find_rescue_handler(exception); end end -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#19 +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:19 class ActiveSupport::SafeBuffer < ::String - # @return [SafeBuffer] a new instance of SafeBuffer - # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#70 - def initialize(str = T.unsafe(nil)); end + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:70 + def initialize(_str = T.unsafe(nil)); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#123 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:124 def %(args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#116 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:115 def *(_); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#112 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:111 def +(other); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#80 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:85 def <<(value); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#38 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:38 def [](*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#104 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:103 def []=(arg1, arg2, arg3 = T.unsafe(nil)); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#88 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:147 + def as_json(*_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:87 def bytesplice(*args, value); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def capitalize(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def capitalize!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def chomp(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def chomp!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def chop(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def chop!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#59 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:59 def chr; end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#80 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:79 def concat(value); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def delete(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def delete!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def delete_prefix(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def delete_prefix!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def delete_suffix(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def delete_suffix!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def downcase(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def downcase!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#146 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:155 def encode_with(coder); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#167 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:175 def gsub(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#178 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:175 def gsub!(*args, &block); end - # Returns the value of attribute html_safe. - # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#134 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:139 def html_safe?; end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#92 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:91 def insert(index, value); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def lstrip(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def lstrip!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def next(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def next!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#96 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:95 def prepend(value); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#100 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:99 def replace(value); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def reverse(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def reverse!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def rstrip(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def rstrip!(*args); end - # @raise [SafeConcatError] - # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#65 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:65 def safe_concat(value); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def scrub(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def scrub!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#38 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:49 def slice(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#51 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:51 def slice!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def squeeze(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def squeeze!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def strip(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def strip!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#167 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:175 def sub(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#178 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:175 def sub!(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def succ(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def succ!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def swapcase(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def swapcase!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#142 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:151 def to_param; end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#138 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:143 def to_s; end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def tr(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def tr!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def tr_s(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def tr_s!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def unicode_normalize(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def unicode_normalize!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def upcase(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 def upcase!(*args); end + protected + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:202 + def mark_unsafe!; end + private - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#193 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:207 def explicit_html_escape_interpolated_argument(arg); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#197 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:211 def implicit_html_escape_interpolated_argument(arg); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#75 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:74 def initialize_copy(other); end + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:28 def original_concat(*_arg0); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#205 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:219 def set_block_back_references(block, match_data); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#211 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:225 def string_into_safe_buffer(new_string, is_html_safe); end end # Raised when ActiveSupport::SafeBuffer#safe_concat is called on unsafe buffers. # -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#32 +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:32 class ActiveSupport::SafeBuffer::SafeConcatError < ::StandardError - # @return [SafeConcatError] a new instance of SafeConcatError - # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#33 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:33 def initialize; end end -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#20 +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:20 ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#26 +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:26 ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS_WITH_BACKREF = T.let(T.unsafe(nil), Array) # = Secure Compare Rotator @@ -11326,32 +11726,28 @@ ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS_WITH_BACKREF = T.let(T.unsafe(n # end # end # -# source://activesupport//lib/active_support/secure_compare_rotator.rb#32 +# pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:32 class ActiveSupport::SecureCompareRotator include ::ActiveSupport::SecurityUtils - # @return [SecureCompareRotator] a new instance of SecureCompareRotator - # - # source://activesupport//lib/active_support/secure_compare_rotator.rb#37 + # pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:37 def initialize(value, on_rotation: T.unsafe(nil)); end - # source://activesupport//lib/active_support/secure_compare_rotator.rb#43 + # pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:43 def rotate(previous_value); end - # source://activesupport//lib/active_support/secure_compare_rotator.rb#47 + # pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:47 def secure_compare!(other_value, on_rotation: T.unsafe(nil)); end end -# source://activesupport//lib/active_support/secure_compare_rotator.rb#35 +# pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:35 class ActiveSupport::SecureCompareRotator::InvalidMatch < ::StandardError; end -# source://activesupport//lib/active_support/security_utils.rb#4 +# pkg:gem/activesupport#lib/active_support/security_utils.rb:4 module ActiveSupport::SecurityUtils private - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/security_utils.rb#11 + # pkg:gem/activesupport#lib/active_support/security_utils.rb:11 def fixed_length_secure_compare(a, b); end # Secure string comparison for strings of variable length. @@ -11361,13 +11757,11 @@ module ActiveSupport::SecurityUtils # the secret length. This should be considered when using secure_compare # to compare weak, short secrets to user input. # - # source://activesupport//lib/active_support/security_utils.rb#33 + # pkg:gem/activesupport#lib/active_support/security_utils.rb:33 def secure_compare(a, b); end class << self - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/security_utils.rb#11 + # pkg:gem/activesupport#lib/active_support/security_utils.rb:25 def fixed_length_secure_compare(a, b); end # Secure string comparison for strings of variable length. @@ -11377,7 +11771,7 @@ module ActiveSupport::SecurityUtils # the secret length. This should be considered when using secure_compare # to compare weak, short secrets to user input. # - # source://activesupport//lib/active_support/security_utils.rb#33 + # pkg:gem/activesupport#lib/active_support/security_utils.rb:36 def secure_compare(a, b); end end end @@ -11400,19 +11794,111 @@ end # vehicle.car? # => true # vehicle.bike? # => false # -# source://activesupport//lib/active_support/string_inquirer.rb#21 +# pkg:gem/activesupport#lib/active_support/string_inquirer.rb:21 class ActiveSupport::StringInquirer < ::String private - # source://activesupport//lib/active_support/string_inquirer.rb#27 + # pkg:gem/activesupport#lib/active_support/string_inquirer.rb:27 def method_missing(method_name, *_arg1, **_arg2, &_arg3); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/string_inquirer.rb#23 + # pkg:gem/activesupport#lib/active_support/string_inquirer.rb:23 def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end end +# = Active Support Structured Event \Subscriber +# +# +ActiveSupport::StructuredEventSubscriber+ consumes ActiveSupport::Notifications +# in order to emit structured events via +Rails.event+. +# +# An example would be the Action Controller structured event subscriber, responsible for +# emitting request processing events: +# +# module ActionController +# class StructuredEventSubscriber < ActiveSupport::StructuredEventSubscriber +# attach_to :action_controller +# +# def start_processing(event) +# emit_event("controller.request_started", +# controller: event.payload[:controller], +# action: event.payload[:action], +# format: event.payload[:format] +# ) +# end +# end +# end +# +# After configured, whenever a "start_processing.action_controller" notification is published, +# it will properly dispatch the event (+ActiveSupport::Notifications::Event+) to the +start_processing+ method. +# The subscriber can then emit a structured event via the +emit_event+ method. +# +# pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:31 +class ActiveSupport::StructuredEventSubscriber < ::ActiveSupport::Subscriber + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:56 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:88 + def call(event); end + + # Like +emit_event+, but only emits when the event reporter is in debug mode + # + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:82 + def emit_debug_event(name, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # Emit a structured event via Rails.event.notify. + # + # ==== Arguments + # + # * +name+ - The event name as a string or symbol + # * +payload+ - The event payload as a hash or object + # * +caller_depth+ - Stack depth for source location (default: 1) + # * +kwargs+ - Additional payload data merged with the payload hash + # + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:75 + def emit_event(name, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:61 + def silenced?(event); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:65 + def silenced_events=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:95 + def handle_event_error(name, error); end + + class << self + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:37 + def attach_to(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def debug_methods; end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def debug_methods=(value); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def debug_methods?; end + + private + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def __class_attr_debug_methods; end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def __class_attr_debug_methods=(new_value); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:50 + def debug_only(method); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:44 + def set_silenced_events; end + end +end + +# pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:34 +ActiveSupport::StructuredEventSubscriber::DEBUG_CHECK = T.let(T.unsafe(nil), Proc) + # = Active Support \Subscriber # # +ActiveSupport::Subscriber+ is an object set to consume @@ -11440,85 +11926,92 @@ end # # ActiveRecord::StatsSubscriber.detach_from(:active_record) # -# source://activesupport//lib/active_support/subscriber.rb#32 +# pkg:gem/activesupport#lib/active_support/subscriber.rb:32 class ActiveSupport::Subscriber - # @return [Subscriber] a new instance of Subscriber - # - # source://activesupport//lib/active_support/subscriber.rb#131 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:70 def initialize; end - # source://activesupport//lib/active_support/subscriber.rb#136 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:70 def call(event); end - # source://activesupport//lib/active_support/subscriber.rb#129 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:70 def patterns; end - # source://activesupport//lib/active_support/subscriber.rb#141 - def publish_event(event); end - class << self # Attach the subscriber to a namespace. # - # source://activesupport//lib/active_support/subscriber.rb#35 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:35 def attach_to(namespace, subscriber = T.unsafe(nil), notifier = T.unsafe(nil), inherit_all: T.unsafe(nil)); end # Detach the subscriber from a namespace. # - # source://activesupport//lib/active_support/subscriber.rb#50 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:50 def detach_from(namespace, notifier = T.unsafe(nil)); end # Adds event subscribers for all new methods added to the class. # - # source://activesupport//lib/active_support/subscriber.rb#69 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:69 def method_added(event); end - # source://activesupport//lib/active_support/subscriber.rb#79 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:79 def subscribers; end private - # source://activesupport//lib/active_support/subscriber.rb#86 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:86 def add_event_subscriber(event); end - # source://activesupport//lib/active_support/subscriber.rb#124 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:124 def fetch_public_methods(subscriber, inherit_all); end - # source://activesupport//lib/active_support/subscriber.rb#108 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:108 def find_attached_subscriber; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/subscriber.rb#112 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:112 def invalid_event?(event); end - # Returns the value of attribute namespace. - # - # source://activesupport//lib/active_support/subscriber.rb#84 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:84 def namespace; end - # Returns the value of attribute notifier. - # - # source://activesupport//lib/active_support/subscriber.rb#84 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:84 def notifier; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/subscriber.rb#120 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:120 def pattern_subscribed?(pattern); end - # source://activesupport//lib/active_support/subscriber.rb#116 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:116 def prepare_pattern(event); end - # source://activesupport//lib/active_support/subscriber.rb#97 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:97 def remove_event_subscriber(event); end - # Returns the value of attribute subscriber. - # - # source://activesupport//lib/active_support/subscriber.rb#84 + # pkg:gem/activesupport#lib/active_support/subscriber.rb:84 def subscriber; end end end +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:6 +class ActiveSupport::TagStack + class << self + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:11 + def tags; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:15 + def with_tags(*args, **kwargs); end + + private + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:30 + def resolve_tags(args, kwargs); end + end +end + +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:7 +ActiveSupport::TagStack::EMPTY_TAGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:8 +ActiveSupport::TagStack::FIBER_KEY = T.let(T.unsafe(nil), Symbol) + # = Active Support Tagged Logging # # Wraps any standard Logger object to provide tagging capabilities. @@ -11541,111 +12034,99 @@ end # it easy to stamp log lines with subdomains, request ids, and anything else # to aid debugging of multi-user production applications. # -# source://activesupport//lib/active_support/tagged_logging.rb#29 +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:29 module ActiveSupport::TaggedLogging - # source://activesupport//lib/active_support/tagged_logging.rb#139 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:139 def clear_tags!(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/tagged_logging.rb#152 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:152 def flush; end - # source://activesupport//lib/active_support/tagged_logging.rb#139 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:139 def pop_tags(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/tagged_logging.rb#139 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:139 def push_tags(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/tagged_logging.rb#141 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:141 def tagged(*tags); end class << self # Returns an `ActiveSupport::Logger` that has already been wrapped with tagged logging concern. # - # source://activesupport//lib/active_support/tagged_logging.rb#117 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:117 def logger(*args, **kwargs); end - # source://activesupport//lib/active_support/tagged_logging.rb#121 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:121 def new(logger); end end end -# source://activesupport//lib/active_support/tagged_logging.rb#30 +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:30 module ActiveSupport::TaggedLogging::Formatter # This method is invoked when a log event occurs. # - # source://activesupport//lib/active_support/tagged_logging.rb#32 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:32 def call(severity, timestamp, progname, msg); end - # source://activesupport//lib/active_support/tagged_logging.rb#51 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:51 def clear_tags!; end - # source://activesupport//lib/active_support/tagged_logging.rb#61 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:61 def current_tags; end - # source://activesupport//lib/active_support/tagged_logging.rb#47 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:47 def pop_tags(count = T.unsafe(nil)); end - # source://activesupport//lib/active_support/tagged_logging.rb#43 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:43 def push_tags(*tags); end - # source://activesupport//lib/active_support/tagged_logging.rb#55 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:55 def tag_stack; end - # source://activesupport//lib/active_support/tagged_logging.rb#36 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:36 def tagged(*tags); end - # source://activesupport//lib/active_support/tagged_logging.rb#65 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:65 def tags_text; end end -# source://activesupport//lib/active_support/tagged_logging.rb#108 +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:108 module ActiveSupport::TaggedLogging::LocalTagStorage - # Returns the value of attribute tag_stack. - # - # source://activesupport//lib/active_support/tagged_logging.rb#109 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:109 def tag_stack; end - # Sets the attribute tag_stack - # - # @param value the value to set the attribute tag_stack to. - # - # source://activesupport//lib/active_support/tagged_logging.rb#109 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:109 def tag_stack=(_arg0); end class << self - # @private - # - # source://activesupport//lib/active_support/tagged_logging.rb#111 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:111 def extended(base); end end end -# source://activesupport//lib/active_support/tagged_logging.rb#70 +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:70 class ActiveSupport::TaggedLogging::TagStack - # @return [TagStack] a new instance of TagStack - # - # source://activesupport//lib/active_support/tagged_logging.rb#73 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:73 def initialize; end - # source://activesupport//lib/active_support/tagged_logging.rb#91 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:91 def clear; end - # source://activesupport//lib/active_support/tagged_logging.rb#96 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:96 def format_message(message); end - # source://activesupport//lib/active_support/tagged_logging.rb#86 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:86 def pop_tags(count); end - # source://activesupport//lib/active_support/tagged_logging.rb#78 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:78 def push_tags(tags); end - # Returns the value of attribute tags. - # - # source://activesupport//lib/active_support/tagged_logging.rb#71 + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:71 def tags; end end -# source://activesupport//lib/active_support/test_case.rb#21 +# pkg:gem/activesupport#lib/active_support/test_case.rb:23 class ActiveSupport::TestCase < ::Minitest::Test include ::ActiveSupport::Testing::SetupAndTeardown include ::ActiveSupport::Testing::TestsWithoutAssertions @@ -11653,6 +12134,8 @@ class ActiveSupport::TestCase < ::Minitest::Test include ::ActiveSupport::Callbacks include ::ActiveSupport::Testing::Assertions include ::ActiveSupport::Testing::ErrorReporterAssertions + include ::ActiveSupport::Testing::EventReporterAssertions + include ::ActiveSupport::Testing::NotificationAssertions include ::ActiveSupport::Testing::Deprecation include ::ActiveSupport::Testing::ConstantStubbing include ::ActiveSupport::Testing::TimeHelpers @@ -11662,108 +12145,130 @@ class ActiveSupport::TestCase < ::Minitest::Test extend ::ActiveSupport::Testing::SetupAndTeardown::ClassMethods extend ::ActiveSupport::Testing::Declarative - # source://activesupport//lib/active_support/callbacks.rb#69 + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 def __callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#912 - def _run_setup_callbacks(&block); end + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _run_setup_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _run_setup_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _run_teardown_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#912 - def _run_teardown_callbacks(&block); end + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _run_teardown_callbacks!(&block); end - # source://activesupport//lib/active_support/callbacks.rb#924 + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 def _setup_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#924 + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 def _teardown_callbacks; end - # source://minitest/5.17.0/lib/minitest/assertions.rb#709 + # pkg:gem/activesupport#lib/active_support/test_case.rb:302 def assert_no_match(matcher, obj, msg = T.unsafe(nil)); end - # source://minitest/5.17.0/lib/minitest/assertions.rb#638 + # pkg:gem/activesupport#lib/active_support/test_case.rb:225 def assert_not_empty(obj, msg = T.unsafe(nil)); end - # source://minitest/5.17.0/lib/minitest/assertions.rb#649 + # pkg:gem/activesupport#lib/active_support/test_case.rb:236 def assert_not_equal(exp, act, msg = T.unsafe(nil)); end - # source://minitest/5.17.0/lib/minitest/assertions.rb#661 + # pkg:gem/activesupport#lib/active_support/test_case.rb:247 def assert_not_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end - # source://minitest/5.17.0/lib/minitest/assertions.rb#673 - def assert_not_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end + # pkg:gem/activesupport#lib/active_support/test_case.rb:258 + def assert_not_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end - # source://minitest/5.17.0/lib/minitest/assertions.rb#680 - def assert_not_includes(collection, obj, msg = T.unsafe(nil)); end + # pkg:gem/activesupport#lib/active_support/test_case.rb:269 + def assert_not_includes(obj, sub, msg = T.unsafe(nil)); end - # source://minitest/5.17.0/lib/minitest/assertions.rb#691 + # pkg:gem/activesupport#lib/active_support/test_case.rb:280 def assert_not_instance_of(cls, obj, msg = T.unsafe(nil)); end - # source://minitest/5.17.0/lib/minitest/assertions.rb#701 + # pkg:gem/activesupport#lib/active_support/test_case.rb:291 def assert_not_kind_of(cls, obj, msg = T.unsafe(nil)); end - # source://minitest/5.17.0/lib/minitest/assertions.rb#719 + # pkg:gem/activesupport#lib/active_support/test_case.rb:313 def assert_not_nil(obj, msg = T.unsafe(nil)); end - # source://minitest/5.17.0/lib/minitest/assertions.rb#730 + # pkg:gem/activesupport#lib/active_support/test_case.rb:324 def assert_not_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end - # source://minitest/5.17.0/lib/minitest/assertions.rb#753 + # pkg:gem/activesupport#lib/active_support/test_case.rb:335 def assert_not_predicate(o1, op, msg = T.unsafe(nil)); end - # source://minitest/5.17.0/lib/minitest/assertions.rb#761 - def assert_not_respond_to(obj, meth, msg = T.unsafe(nil)); end + # pkg:gem/activesupport#lib/active_support/test_case.rb:346 + def assert_not_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end - # source://minitest/5.17.0/lib/minitest/assertions.rb#770 + # pkg:gem/activesupport#lib/active_support/test_case.rb:357 def assert_not_same(exp, act, msg = T.unsafe(nil)); end - # source://activesupport//lib/active_support/testing/file_fixtures.rb#20 + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 def file_fixture_path; end - # source://activesupport//lib/active_support/testing/file_fixtures.rb#20 + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 def file_fixture_path?; end - # source://activesupport//lib/active_support/test_case.rb#300 + # pkg:gem/activesupport#lib/active_support/test_case.rb:361 def inspect; end - # source://minitest/5.17.0/lib/minitest.rb#304 + # pkg:gem/activesupport#lib/active_support/test_case.rb:196 def method_name; end + # Returns the current parallel worker ID if tests are running in parallel + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:199 + def parallel_worker_id; end + class << self - # source://activesupport//lib/active_support/callbacks.rb#69 + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 def __callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#69 + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 def __callbacks=(value); end - # source://activesupport//lib/active_support/callbacks.rb#916 + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 def _setup_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#920 + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 def _setup_callbacks=(value); end - # source://activesupport//lib/active_support/callbacks.rb#916 + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 def _teardown_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#920 + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 def _teardown_callbacks=(value); end - # source://activesupport//lib/active_support/testing/file_fixtures.rb#20 + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 def file_fixture_path; end - # source://activesupport//lib/active_support/testing/file_fixtures.rb#20 + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 def file_fixture_path=(value); end - # source://activesupport//lib/active_support/testing/file_fixtures.rb#20 + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 def file_fixture_path?; end + # Returns the current parallel worker ID if tests are running in parallel, + # nil otherwise. + # + # ActiveSupport::TestCase.parallel_worker_id # => 2 + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:34 + def parallel_worker_id; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:38 + def parallel_worker_id=(value); end + # Parallelizes the test suite. # # Takes a +workers+ argument that controls how many times the process # is forked. For each process a new database will be created suffixed # with the worker number. # - # test-database-0 - # test-database-1 + # test-database_0 + # test-database_1 # # If ENV["PARALLEL_WORKERS"] is set the workers argument will be ignored # and the environment variable will be used instead. This is useful for CI @@ -11790,10 +12295,33 @@ class ActiveSupport::TestCase < ::Minitest::Test # number of tests to run is above the +threshold+ param. The default value is # 50, and it's configurable via +config.active_support.test_parallelization_threshold+. # - # source://activesupport//lib/active_support/test_case.rb#81 - def parallelize(workers: T.unsafe(nil), with: T.unsafe(nil), threshold: T.unsafe(nil)); end + # If you want to skip Rails default creation of one database per process in favor of + # writing your own implementation, you can set +parallelize_databases+, or configure it + # via +config.active_support.parallelize_test_databases+. + # + # parallelize(workers: :number_of_processors, parallelize_databases: false) + # + # Note that your test suite may deadlock if you attempt to use only one database + # with multiple processes. + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:113 + def parallelize(workers: T.unsafe(nil), with: T.unsafe(nil), threshold: T.unsafe(nil), parallelize_databases: T.unsafe(nil)); end + + # Before fork hook for parallel testing. This can be used to run anything + # before the processes are forked. + # + # In your +test_helper.rb+ add the following: + # + # class ActiveSupport::TestCase + # parallelize_before_fork do + # # run this before fork + # end + # end + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:138 + def parallelize_before_fork(&block); end - # Set up hook for parallel testing. This can be used if you have multiple + # Setup hook for parallel testing. This can be used if you have multiple # databases or any behavior that needs to be run after the process is forked # but before the tests run. # @@ -11807,7 +12335,7 @@ class ActiveSupport::TestCase < ::Minitest::Test # end # end # - # source://activesupport//lib/active_support/test_case.rb#101 + # pkg:gem/activesupport#lib/active_support/test_case.rb:155 def parallelize_setup(&block); end # Clean up hook for parallel testing. This can be used to drop databases @@ -11824,7 +12352,7 @@ class ActiveSupport::TestCase < ::Minitest::Test # end # end # - # source://activesupport//lib/active_support/test_case.rb#118 + # pkg:gem/activesupport#lib/active_support/test_case.rb:172 def parallelize_teardown(&block); end # Returns the order in which test cases are run. @@ -11834,7 +12362,7 @@ class ActiveSupport::TestCase < ::Minitest::Test # Possible values are +:random+, +:parallel+, +:alpha+, +:sorted+. # Defaults to +:random+. # - # source://activesupport//lib/active_support/test_case.rb#44 + # pkg:gem/activesupport#lib/active_support/test_case.rb:61 def test_order; end # Sets the order in which test cases are run. @@ -11847,32 +12375,32 @@ class ActiveSupport::TestCase < ::Minitest::Test # * +:sorted+ (to run tests alphabetically by method name) # * +:alpha+ (equivalent to +:sorted+) # - # source://activesupport//lib/active_support/test_case.rb#34 + # pkg:gem/activesupport#lib/active_support/test_case.rb:51 def test_order=(new_order); end private - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 def __class_attr___callbacks; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 def __class_attr___callbacks=(new_value); end - # source://activesupport//lib/active_support/class_attribute.rb#15 + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 def __class_attr_file_fixture_path; end - # source://activesupport//lib/active_support/class_attribute.rb#17 + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 def __class_attr_file_fixture_path=(new_value); end end end -# source://activesupport//lib/active_support/test_case.rb#22 +# pkg:gem/activesupport#lib/active_support/test_case.rb:24 ActiveSupport::TestCase::Assertion = Minitest::Assertion -# source://activesupport//lib/active_support/testing/tagged_logging.rb#4 +# pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:4 module ActiveSupport::Testing; end -# source://activesupport//lib/active_support/testing/assertions.rb#7 +# pkg:gem/activesupport#lib/active_support/testing/assertions.rb:7 module ActiveSupport::Testing::Assertions # Assertion that the result of evaluating an expression is changed before # and after invoking the passed in block. @@ -11897,19 +12425,31 @@ module ActiveSupport::Testing::Assertions # # The keyword arguments +:from+ and +:to+ can be given to specify the # expected initial value and the expected value after the block was - # executed. + # executed. The comparison is done using case equality (===), which means + # you can specify patterns or classes: # + # # Exact value match # assert_changes :@object, from: nil, to: :foo do # @object = :foo # end # + # # Case equality + # assert_changes -> { user.token }, to: /\w{32}/ do + # user.generate_token + # end + # + # # Type check + # assert_changes -> { current_error }, from: nil, to: RuntimeError do + # raise "Oops" + # end + # # An error message can be specified. # # assert_changes -> { Status.all_good? }, 'Expected the status to be bad' do # post :create, params: { status: { incident: true } } # end # - # source://activesupport//lib/active_support/testing/assertions.rb#195 + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:212 def assert_changes(expression, message = T.unsafe(nil), from: T.unsafe(nil), to: T.unsafe(nil), &block); end # Test numeric difference between the return value of an expression as a @@ -11932,19 +12472,19 @@ module ActiveSupport::Testing::Assertions # post :delete, params: { id: ... } # end # - # An array of expressions can also be passed in and evaluated. + # An array of expressions can be passed in and evaluated. # # assert_difference [ 'Article.count', 'Post.count' ], 2 do # post :create, params: { article: {...} } # end # - # A hash of expressions/numeric differences can also be passed in and evaluated. + # A hash of expressions/numeric differences can be passed in and evaluated. # - # assert_difference ->{ Article.count } => 1, ->{ Notification.count } => 2 do + # assert_difference({ 'Article.count' => 1, 'Notification.count' => 2 }) do # post :create, params: { article: {...} } # end # - # A lambda or a list of lambdas can be passed in and evaluated: + # A lambda, a list of lambdas or a hash of lambdas/numeric differences can be passed in and evaluated: # # assert_difference ->{ Article.count }, 2 do # post :create, params: { article: {...} } @@ -11954,13 +12494,17 @@ module ActiveSupport::Testing::Assertions # post :create, params: { article: {...} } # end # + # assert_difference ->{ Article.count } => 1, ->{ Notification.count } => 2 do + # post :create, params: { article: {...} } + # end + # # An error message can be specified. # # assert_difference 'Article.count', -1, 'An Article should be destroyed' do # post :delete, params: { id: ... } # end # - # source://activesupport//lib/active_support/testing/assertions.rb#101 + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:105 def assert_difference(expression, *args, &block); end # Assertion that the result of evaluating an expression is not changed before @@ -11971,19 +12515,31 @@ module ActiveSupport::Testing::Assertions # end # # Provide the optional keyword argument +:from+ to specify the expected - # initial value. + # initial value. The comparison is done using case equality (===), which means + # you can specify patterns or classes: # + # # Exact value match # assert_no_changes -> { Status.all_good? }, from: true do # post :create, params: { status: { ok: true } } # end # + # # Case equality + # assert_no_changes -> { user.token }, from: /\w{32}/ do + # user.touch + # end + # + # # Type check + # assert_no_changes -> { current_error }, from: RuntimeError do + # retry_operation + # end + # # An error message can be specified. # # assert_no_changes -> { Status.all_good? }, 'Expected the status to be good' do # post :create, params: { status: { ok: false } } # end # - # source://activesupport//lib/active_support/testing/assertions.rb#252 + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:281 def assert_no_changes(expression, message = T.unsafe(nil), from: T.unsafe(nil), &block); end # Assertion that the numeric result of evaluating an expression is not @@ -12011,7 +12567,7 @@ module ActiveSupport::Testing::Assertions # post :create, params: { article: invalid_attributes } # end # - # source://activesupport//lib/active_support/testing/assertions.rb#157 + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:162 def assert_no_difference(expression, message = T.unsafe(nil), &block); end # Asserts that an expression is not truthy. Passes if +object+ is +nil+ or @@ -12026,7 +12582,7 @@ module ActiveSupport::Testing::Assertions # # assert_not foo, 'foo should be false' # - # source://activesupport//lib/active_support/testing/assertions.rb#21 + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:21 def assert_not(object, message = T.unsafe(nil)); end # Assertion that the block should not raise an exception. @@ -12037,18 +12593,10 @@ module ActiveSupport::Testing::Assertions # perform_service(param: 'no_exception') # end # - # source://activesupport//lib/active_support/testing/assertions.rb#48 + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:48 def assert_nothing_raised; end - # Asserts that a block raises one of +exp+. This is an enhancement of the - # standard Minitest assertion method with the ability to test error - # messages. - # - # assert_raises(ArgumentError, match: /incorrect param/i) do - # perform_service(param: 'exception') - # end - # - # source://activesupport//lib/active_support/testing/assertions.rb#34 + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:39 def assert_raise(*exp, match: T.unsafe(nil), &block); end # Asserts that a block raises one of +exp+. This is an enhancement of the @@ -12059,19 +12607,19 @@ module ActiveSupport::Testing::Assertions # perform_service(param: 'exception') # end # - # source://activesupport//lib/active_support/testing/assertions.rb#34 + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:34 def assert_raises(*exp, match: T.unsafe(nil), &block); end private - # source://activesupport//lib/active_support/testing/assertions.rb#286 + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:316 def _assert_nothing_raised_or_warn(assertion, &block); end - # source://activesupport//lib/active_support/testing/assertions.rb#301 + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:331 def _callable_to_source_string(callable); end end -# source://activesupport//lib/active_support/testing/assertions.rb#8 +# pkg:gem/activesupport#lib/active_support/testing/assertions.rb:8 ActiveSupport::Testing::Assertions::UNTRACKED = T.let(T.unsafe(nil), Object) # Resolves a constant from a minitest spec name. @@ -12099,20 +12647,20 @@ ActiveSupport::Testing::Assertions::UNTRACKED = T.let(T.unsafe(nil), Object) # Class === constant && constant < ::ActionController::Metal # end # -# source://activesupport//lib/active_support/testing/constant_lookup.rb#32 +# pkg:gem/activesupport#lib/active_support/testing/constant_lookup.rb:32 module ActiveSupport::Testing::ConstantLookup extend ::ActiveSupport::Concern mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods end -# source://activesupport//lib/active_support/testing/constant_lookup.rb#35 +# pkg:gem/activesupport#lib/active_support/testing/constant_lookup.rb:35 module ActiveSupport::Testing::ConstantLookup::ClassMethods - # source://activesupport//lib/active_support/testing/constant_lookup.rb#36 + # pkg:gem/activesupport#lib/active_support/testing/constant_lookup.rb:36 def determine_constant_from_test_name(test_name); end end -# source://activesupport//lib/active_support/testing/constant_stubbing.rb#5 +# pkg:gem/activesupport#lib/active_support/testing/constant_stubbing.rb:5 module ActiveSupport::Testing::ConstantStubbing # Changes the value of a constant for the duration of a block. Example: # @@ -12137,11 +12685,11 @@ module ActiveSupport::Testing::ConstantStubbing # (like separate test suites running in parallel) that all depend on the same constant, it's possible # divergent stubbing will trample on each other. # - # source://activesupport//lib/active_support/testing/constant_stubbing.rb#28 + # pkg:gem/activesupport#lib/active_support/testing/constant_stubbing.rb:28 def stub_const(mod, constant, new_value, exists: T.unsafe(nil)); end end -# source://activesupport//lib/active_support/testing/declarative.rb#5 +# pkg:gem/activesupport#lib/active_support/testing/declarative.rb:5 module ActiveSupport::Testing::Declarative # Helper to define a test method using a String. Under the hood, it replaces # spaces with underscores and defines the test method. @@ -12150,11 +12698,11 @@ module ActiveSupport::Testing::Declarative # ... # end # - # source://activesupport//lib/active_support/testing/declarative.rb#13 + # pkg:gem/activesupport#lib/active_support/testing/declarative.rb:13 def test(name, &block); end end -# source://activesupport//lib/active_support/testing/deprecation.rb#7 +# pkg:gem/activesupport#lib/active_support/testing/deprecation.rb:7 module ActiveSupport::Testing::Deprecation # :call-seq: # assert_deprecated(deprecator, &block) @@ -12178,7 +12726,7 @@ module ActiveSupport::Testing::Deprecation # CustomDeprecator.warn "foo should no longer be used" # end # - # source://activesupport//lib/active_support/testing/deprecation.rb#30 + # pkg:gem/activesupport#lib/active_support/testing/deprecation.rb:30 def assert_deprecated(match = T.unsafe(nil), deprecator = T.unsafe(nil), &block); end # Asserts that no deprecation warnings are emitted by the given deprecator during the execution of the yielded block. @@ -12191,7 +12739,7 @@ module ActiveSupport::Testing::Deprecation # CustomDeprecator.warn "message" # passes assertion, different deprecator # end # - # source://activesupport//lib/active_support/testing/deprecation.rb#55 + # pkg:gem/activesupport#lib/active_support/testing/deprecation.rb:55 def assert_not_deprecated(deprecator, &block); end # Returns the return value of the block and an array of all the deprecation warnings emitted by the given @@ -12203,11 +12751,11 @@ module ActiveSupport::Testing::Deprecation # :result # end # => [:result, ["message"]] # - # source://activesupport//lib/active_support/testing/deprecation.rb#69 + # pkg:gem/activesupport#lib/active_support/testing/deprecation.rb:69 def collect_deprecations(deprecator); end end -# source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#5 +# pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:5 module ActiveSupport::Testing::ErrorReporterAssertions # Assertion that the block should cause at least one exception to be reported # to +Rails.error+. @@ -12221,115 +12769,240 @@ module ActiveSupport::Testing::ErrorReporterAssertions # To test further details about the reported exception, you can use the return # value. # - # report = assert_error_reported(IOError) do - # # ... + # report = assert_error_reported(IOError) do + # # ... + # end + # assert_equal "Oops", report.error.message + # assert_equal "admin", report.context[:section] + # assert_equal :warning, report.severity + # assert_predicate report, :handled? + # + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:88 + def assert_error_reported(error_class = T.unsafe(nil), &block); end + + # Assertion that the block should not cause an exception to be reported + # to +Rails.error+. + # + # Passes if evaluated code in the yielded block reports no exception. + # + # assert_no_error_reported do + # perform_service(param: 'no_exception') + # end + # + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:62 + def assert_no_error_reported(&block); end + + # Captures reported errors from within the block that match the given + # error class. + # + # reports = capture_error_reports(IOError) do + # Rails.error.report(IOError.new("Oops")) + # Rails.error.report(IOError.new("Oh no")) + # Rails.error.report(StandardError.new) + # end + # + # assert_equal 2, reports.size + # assert_equal "Oops", reports.first.error.message + # assert_equal "Oh no", reports.last.error.message + # + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:118 + def capture_error_reports(error_class = T.unsafe(nil), &block); end +end + +# pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:6 +module ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector + class << self + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:16 + def record; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:29 + def report(error, **kwargs); end + + private + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:38 + def subscribe; end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 +class ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector::Report < ::Struct + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def context; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def context=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def error; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def error=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def handled; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def handled=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:12 + def handled?; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def severity; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def severity=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def source; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def source=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def members; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def new(*_arg0); end + end +end + +# Provides test helpers for asserting on ActiveSupport::EventReporter events. +# +# pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:6 +module ActiveSupport::Testing::EventReporterAssertions + # Asserts that the block causes an event with the given name to be reported + # to +Rails.event+. + # + # Passes if the evaluated code in the yielded block reports a matching event. + # + # assert_event_reported("user.created") do + # Rails.event.notify("user.created", { id: 123 }) + # end + # + # To test further details about the reported event, you can specify payload and tag matchers. + # + # assert_event_reported("user.created", + # payload: { id: 123, name: "John Doe" }, + # tags: { request_id: /[0-9]+/ } + # ) do + # Rails.event.tagged(request_id: "123") do + # Rails.event.notify("user.created", { id: 123, name: "John Doe" }) + # end + # end + # + # The matchers support partial matching - only the specified keys need to match. + # + # assert_event_reported("user.created", payload: { id: 123 }) do + # Rails.event.notify("user.created", { id: 123, name: "John Doe" }) + # end + # + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:142 + def assert_event_reported(name, payload: T.unsafe(nil), tags: T.unsafe(nil), &block); end + + # Asserts that the provided events were reported, regardless of order. + # + # assert_events_reported([ + # { name: "user.created", payload: { id: 123 } }, + # { name: "email.sent", payload: { to: "user@example.com" } } + # ]) do + # create_user_and_send_welcome_email + # end + # + # Supports the same payload and tag matching as +assert_event_reported+. + # + # assert_events_reported([ + # { + # name: "process.started", + # payload: { id: 123 }, + # tags: { request_id: /[0-9]+/ } + # }, + # { name: "process.completed" } + # ]) do + # Rails.event.tagged(request_id: "456") do + # start_and_complete_process(123) + # end + # end + # + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:184 + def assert_events_reported(expected_events, &block); end + + # Asserts that the block does not cause an event to be reported to +Rails.event+. + # + # If no name is provided, passes if evaluated code in the yielded block reports no events. + # + # assert_no_event_reported do + # service_that_does_not_report_events.perform + # end + # + # If a name is provided, passes if evaluated code in the yielded block reports no events + # with that name. + # + # assert_no_event_reported("user.created") do + # service_that_does_not_report_events.perform # end - # assert_equal "Oops", report.error.message - # assert_equal "admin", report.context[:section] - # assert_equal :warning, report.severity - # assert_predicate report, :handled? # - # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#88 - def assert_error_reported(error_class = T.unsafe(nil), &block); end + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:101 + def assert_no_event_reported(name = T.unsafe(nil), payload: T.unsafe(nil), tags: T.unsafe(nil), &block); end - # Assertion that the block should not cause an exception to be reported - # to +Rails.error+. - # - # Passes if evaluated code in the yielded block reports no exception. + # Allows debug events to be reported to +Rails.event+ for the duration of a given block. # - # assert_no_error_reported do - # perform_service(param: 'no_exception') + # with_debug_event_reporting do + # service_that_reports_debug_events.perform # end # - # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#62 - def assert_no_error_reported(&block); end + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:222 + def with_debug_event_reporting(&block); end end -# source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#6 -module ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector +# pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:7 +module ActiveSupport::Testing::EventReporterAssertions::EventCollector class << self - # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#16 - def record; end + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:46 + def emit(event); end - # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#29 - def report(error, **kwargs); end + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:53 + def record; end private - # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#38 + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:81 + def event_recorders; end + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:66 def subscribe; end end end -# source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 -class ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector::Report < ::Struct - # Returns the value of attribute context - # - # @return [Object] the current value of context - def context; end - - # Sets the attribute context - # - # @param value [Object] the value to set the attribute context to. - # @return [Object] the newly set value - def context=(_); end - - # Returns the value of attribute error - # - # @return [Object] the current value of error - def error; end - - # Sets the attribute error - # - # @param value [Object] the value to set the attribute error to. - # @return [Object] the newly set value - def error=(_); end - - # Returns the value of attribute handled - # - # @return [Object] the current value of handled - def handled; end - - # Sets the attribute handled - # - # @param value [Object] the value to set the attribute handled to. - # @return [Object] the newly set value - def handled=(_); end - - # Returns the value of attribute handled - # - # @return [Object] the current value of handled - def handled?; end +# pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:11 +class ActiveSupport::Testing::EventReporterAssertions::EventCollector::Event + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:14 + def initialize(event_data); end - # Returns the value of attribute severity - # - # @return [Object] the current value of severity - def severity; end + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:12 + def event_data; end - # Sets the attribute severity - # - # @param value [Object] the value to set the attribute severity to. - # @return [Object] the newly set value - def severity=(_); end + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:18 + def inspect; end - # Returns the value of attribute source - # - # @return [Object] the current value of source - def source; end + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:22 + def matches?(name, payload, tags); end - # Sets the attribute source - # - # @param value [Object] the value to set the attribute source to. - # @return [Object] the newly set value - def source=(_); end + private - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:34 + def matches_hash?(expected_hash, event_key); end end # Adds simple access to sample files called file fixtures. @@ -12342,7 +13015,7 @@ end # file_fixture("example.txt").read # get the file's content # file_fixture("example.mp3").size # get the file size # -# source://activesupport//lib/active_support/testing/file_fixtures.rb#16 +# pkg:gem/activesupport#lib/active_support/testing/file_fixtures.rb:16 module ActiveSupport::Testing::FileFixtures extend ::ActiveSupport::Concern include GeneratedInstanceMethods @@ -12353,7 +13026,7 @@ module ActiveSupport::Testing::FileFixtures # # Raises +ArgumentError+ if +fixture_name+ can't be found. # - # source://activesupport//lib/active_support/testing/file_fixtures.rb#26 + # pkg:gem/activesupport#lib/active_support/testing/file_fixtures.rb:26 def file_fixture(fixture_name); end module GeneratedClassMethods @@ -12368,243 +13041,303 @@ module ActiveSupport::Testing::FileFixtures end end -# source://activesupport//lib/active_support/testing/isolation.rb#7 +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:7 module ActiveSupport::Testing::Isolation include ::ActiveSupport::Testing::Isolation::Forking - # source://activesupport//lib/active_support/testing/isolation.rb#20 + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:20 def run; end class << self - # @return [Boolean] - # - # source://activesupport//lib/active_support/testing/isolation.rb#16 + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:16 def forking_env?; end - # source://activesupport//lib/active_support/testing/isolation.rb#10 + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:10 def included(klass); end end end -# source://activesupport//lib/active_support/testing/isolation.rb#35 +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:35 module ActiveSupport::Testing::Isolation::Forking - # source://activesupport//lib/active_support/testing/isolation.rb#36 + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:36 def run_in_isolation(&blk); end end -# source://activesupport//lib/active_support/testing/isolation.rb#73 +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:73 module ActiveSupport::Testing::Isolation::Subprocess # Complicated H4X to get this working in Windows / JRuby with # no forking. # - # source://activesupport//lib/active_support/testing/isolation.rb#78 + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:78 def run_in_isolation(&blk); end end -# source://activesupport//lib/active_support/testing/isolation.rb#74 +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:74 ActiveSupport::Testing::Isolation::Subprocess::ORIG_ARGV = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/testing/isolation.rb#8 +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:8 class ActiveSupport::Testing::Isolation::SubprocessCrashed < ::StandardError; end -# source://activesupport//lib/active_support/testing/parallelization/server.rb#8 -class ActiveSupport::Testing::Parallelization - # @return [Parallelization] a new instance of Parallelization +# pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:5 +module ActiveSupport::Testing::NotificationAssertions + # Assert no notifications were emitted for a given +pattern+. + # + # You can assert no notifications were emitted by passing a pattern, which accepts + # either a string or regexp, and a block. While the block is executed, if no + # matching notifications are emitted, the assertion will pass. + # + # assert_no_notifications("post.submitted") do + # post.destroy # => emits non-matching notification + # end + # + # pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:66 + def assert_no_notifications(pattern = T.unsafe(nil), &block); end + + # Assert a notification was emitted with a given +pattern+ and optional +payload+. # - # source://activesupport//lib/active_support/testing/parallelization.rb#28 + # You can assert that a notification was emitted by passing a pattern, which accepts + # either a string or regexp, an optional payload, and a block. While the block + # is executed, if a matching notification is emitted, the assertion will pass + # and the notification will be returned. + # + # Note that the payload is matched as a subset, meaning that the notification must + # contain at least the specified keys and values, but may contain additional ones. + # + # assert_notification("post.submitted", title: "Cool Post") do + # post.submit(title: "Cool Post", body: "Cool Body") # => emits matching notification + # end + # + # Using the returned notification, you can make more customized assertions. + # + # notification = assert_notification("post.submitted", title: "Cool Post") do + # ActiveSupport::Notifications.instrument("post.submitted", title: "Cool Post", body: Body.new("Cool Body")) + # end + # + # assert_instance_of(Body, notification.payload[:body]) + # + # pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:28 + def assert_notification(pattern, payload = T.unsafe(nil), &block); end + + # Assert the number of notifications emitted with a given +pattern+. + # + # You can assert the number of notifications emitted by passing a pattern, which accepts + # either a string or regexp, a count, and a block. While the block is executed, + # the number of matching notifications emitted will be counted. After the block's + # execution completes, the assertion will pass if the count matches. + # + # assert_notifications_count("post.submitted", 1) do + # post.submit(title: "Cool Post") # => emits matching notification + # end + # + # pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:51 + def assert_notifications_count(pattern, count, &block); end + + # Capture emitted notifications, optionally filtered by a +pattern+. + # + # You can capture emitted notifications, optionally filtered by a pattern, + # which accepts either a string or regexp, and a block. + # + # notifications = capture_notifications("post.submitted") do + # post.submit(title: "Cool Post") # => emits matching notification + # end + # + # pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:85 + def capture_notifications(pattern = T.unsafe(nil), &block); end +end + +# pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:8 +class ActiveSupport::Testing::Parallelization + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:36 def initialize(worker_count); end - # source://activesupport//lib/active_support/testing/parallelization.rb#41 + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:54 def <<(work); end - # source://activesupport//lib/active_support/testing/parallelization.rb#18 + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:26 def after_fork_hooks; end - # source://activesupport//lib/active_support/testing/parallelization.rb#26 + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:43 + def before_fork; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:18 + def before_fork_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:34 def run_cleanup_hooks; end - # source://activesupport//lib/active_support/testing/parallelization.rb#49 + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:62 def shutdown; end - # source://activesupport//lib/active_support/testing/parallelization.rb#45 + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:58 def size; end - # source://activesupport//lib/active_support/testing/parallelization.rb#35 + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:47 def start; end class << self - # source://activesupport//lib/active_support/testing/parallelization.rb#14 + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:22 def after_fork_hook(&blk); end - # source://activesupport//lib/active_support/testing/parallelization.rb#18 + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:26 def after_fork_hooks; end - # source://activesupport//lib/active_support/testing/parallelization.rb#22 + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:14 + def before_fork_hook(&blk); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:18 + def before_fork_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:30 def run_cleanup_hook(&blk); end - # source://activesupport//lib/active_support/testing/parallelization.rb#26 + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:34 def run_cleanup_hooks; end end end -# source://activesupport//lib/active_support/testing/parallelization/server.rb#9 +# pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 class ActiveSupport::Testing::Parallelization::PrerecordResultClass < ::Struct - # Returns the value of attribute name - # - # @return [Object] the current value of name + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 def name; end - # Sets the attribute name - # - # @param value [Object] the value to set the attribute name to. - # @return [Object] the newly set value + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 def name=(_); end class << self + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 def inspect; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 def members; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 def new(*_arg0); end end end -# source://activesupport//lib/active_support/testing/parallelization/server.rb#11 +# pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:11 class ActiveSupport::Testing::Parallelization::Server include ::DRb::DRbUndumped - # @return [Server] a new instance of Server - # - # source://activesupport//lib/active_support/testing/parallelization/server.rb#14 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:14 def initialize; end - # source://activesupport//lib/active_support/testing/parallelization/server.rb#31 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:32 def <<(o); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/testing/parallelization/server.rb#51 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:64 def active_workers?; end - # source://activesupport//lib/active_support/testing/parallelization/server.rb#55 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:68 def interrupt; end - # source://activesupport//lib/active_support/testing/parallelization/server.rb#36 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:37 def pop; end - # @raise [DRb::DRbConnError] - # - # source://activesupport//lib/active_support/testing/parallelization/server.rb#20 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:21 def record(reporter, result); end - # source://activesupport//lib/active_support/testing/parallelization/server.rb#59 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:54 + def remove_dead_workers(dead_pids); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:72 def shutdown; end - # source://activesupport//lib/active_support/testing/parallelization/server.rb#43 - def start_worker(worker_id); end + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:44 + def start_worker(worker_id, worker_pid); end - # source://activesupport//lib/active_support/testing/parallelization/server.rb#47 - def stop_worker(worker_id); end + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:49 + def stop_worker(worker_id, worker_pid); end end -# source://activesupport//lib/active_support/testing/parallelization/worker.rb#6 +# pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:6 class ActiveSupport::Testing::Parallelization::Worker - # @return [Worker] a new instance of Worker - # - # source://activesupport//lib/active_support/testing/parallelization/worker.rb#7 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:7 def initialize(number, url); end - # source://activesupport//lib/active_support/testing/parallelization/worker.rb#80 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:84 def after_fork; end - # source://activesupport//lib/active_support/testing/parallelization/worker.rb#42 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:42 def perform_job(job); end - # source://activesupport//lib/active_support/testing/parallelization/worker.rb#86 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:92 def run_cleanup; end - # source://activesupport//lib/active_support/testing/parallelization/worker.rb#56 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:60 def safe_record(reporter, result); end - # source://activesupport//lib/active_support/testing/parallelization/worker.rb#14 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:14 def start; end - # source://activesupport//lib/active_support/testing/parallelization/worker.rb#36 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:36 def work_from_queue; end private - # source://activesupport//lib/active_support/testing/parallelization/worker.rb#93 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:99 def add_setup_exception(result); end - # source://activesupport//lib/active_support/testing/parallelization/worker.rb#97 + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:103 def set_process_title(status); end end -# source://activesupport//lib/active_support/testing/parallelize_executor.rb#5 +# pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:5 class ActiveSupport::Testing::ParallelizeExecutor - # @return [ParallelizeExecutor] a new instance of ParallelizeExecutor - # - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#8 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:8 def initialize(size:, with:, threshold: T.unsafe(nil)); end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#22 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:22 def <<(work); end - # Returns the value of attribute parallelize_with. - # - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#6 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:6 def parallelize_with; end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#26 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:26 def shutdown; end - # Returns the value of attribute size. - # - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#6 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:6 def size; end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#15 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:15 def start; end - # Returns the value of attribute threshold. - # - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#6 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:6 def threshold; end private - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#35 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:35 def build_parallel_executor; end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#72 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:72 def execution_info; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#60 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:60 def many_workers?; end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#31 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:31 def parallel_executor; end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#47 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:47 def parallelize; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#52 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:52 def parallelized?; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#56 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:56 def should_parallelize?; end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#68 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:68 def show_execution_info; end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#64 + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:64 def tests_count; end end @@ -12622,40 +13355,38 @@ end # end # end # -# source://activesupport//lib/active_support/testing/setup_and_teardown.rb#20 +# pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:20 module ActiveSupport::Testing::SetupAndTeardown - # source://activesupport//lib/active_support/testing/setup_and_teardown.rb#44 + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:44 def after_teardown; end - # source://activesupport//lib/active_support/testing/setup_and_teardown.rb#39 + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:39 def before_setup; end class << self - # source://activesupport//lib/active_support/testing/setup_and_teardown.rb#21 + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:21 def prepended(klass); end end end -# source://activesupport//lib/active_support/testing/setup_and_teardown.rb#27 +# pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:27 module ActiveSupport::Testing::SetupAndTeardown::ClassMethods # Add a callback, which runs before TestCase#setup. # - # source://activesupport//lib/active_support/testing/setup_and_teardown.rb#29 + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:29 def setup(*args, &block); end # Add a callback, which runs after TestCase#teardown. # - # source://activesupport//lib/active_support/testing/setup_and_teardown.rb#34 + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:34 def teardown(*args, &block); end end # Manages stubs for TimeHelpers # -# source://activesupport//lib/active_support/testing/time_helpers.rb#9 +# pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:9 class ActiveSupport::Testing::SimpleStubs - # @return [SimpleStubs] a new instance of SimpleStubs - # - # source://activesupport//lib/active_support/testing/time_helpers.rb#12 + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:12 def initialize; end # Stubs object.method_name with the given block @@ -12666,75 +13397,67 @@ class ActiveSupport::Testing::SimpleStubs # simple_stubs.stub_object(Time, :now) { at(target.to_i) } # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 # - # source://activesupport//lib/active_support/testing/time_helpers.rb#23 + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:23 def stub_object(object, method_name, &block); end # Returns true if any stubs are set, false if there are none # - # @return [Boolean] - # - # source://activesupport//lib/active_support/testing/time_helpers.rb#53 + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:53 def stubbed?; end # Returns the Stub for object#method_name # (nil if it is not stubbed) # - # source://activesupport//lib/active_support/testing/time_helpers.rb#48 + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:48 def stubbing(object, method_name); end # Remove all object-method stubs held by this instance # - # source://activesupport//lib/active_support/testing/time_helpers.rb#37 + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:37 def unstub_all!; end private # Restores the original object.method described by the Stub # - # source://activesupport//lib/active_support/testing/time_helpers.rb#59 + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:59 def unstub_object(stub); end end -# source://activesupport//lib/active_support/testing/time_helpers.rb#10 +# pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 class ActiveSupport::Testing::SimpleStubs::Stub < ::Struct - # Returns the value of attribute method_name - # - # @return [Object] the current value of method_name + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 def method_name; end - # Sets the attribute method_name - # - # @param value [Object] the value to set the attribute method_name to. - # @return [Object] the newly set value + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 def method_name=(_); end - # Returns the value of attribute object - # - # @return [Object] the current value of object + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 def object; end - # Sets the attribute object - # - # @param value [Object] the value to set the attribute object to. - # @return [Object] the newly set value + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 def object=(_); end - # Returns the value of attribute original_method - # - # @return [Object] the current value of original_method + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 def original_method; end - # Sets the attribute original_method - # - # @param value [Object] the value to set the attribute original_method to. - # @return [Object] the newly set value + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 def original_method=(_); end class << self + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 def inspect; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 def members; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 def new(*_arg0); end end end @@ -12742,17 +13465,17 @@ end # Logs a "PostsControllerTest: test name" heading before each test to # make test.log easier to search and follow along with. # -# source://activesupport//lib/active_support/testing/tagged_logging.rb#7 +# pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:7 module ActiveSupport::Testing::TaggedLogging - # source://activesupport//lib/active_support/testing/tagged_logging.rb#10 + # pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:10 def before_setup; end - # source://activesupport//lib/active_support/testing/tagged_logging.rb#8 + # pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:8 def tagged_logger=(_arg0); end private - # source://activesupport//lib/active_support/testing/tagged_logging.rb#22 + # pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:22 def tagged_logger; end end @@ -12760,25 +13483,29 @@ end # # This is helpful in detecting broken tests that do not perform intended assertions. # -# source://activesupport//lib/active_support/testing/tests_without_assertions.rb#8 +# pkg:gem/activesupport#lib/active_support/testing/tests_without_assertions.rb:8 module ActiveSupport::Testing::TestsWithoutAssertions - # source://activesupport//lib/active_support/testing/tests_without_assertions.rb#9 + # pkg:gem/activesupport#lib/active_support/testing/tests_without_assertions.rb:9 def after_teardown; end end # Contains helpers that help you test passage of time. # -# source://activesupport//lib/active_support/testing/time_helpers.rb#68 +# pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:68 module ActiveSupport::Testing::TimeHelpers - # source://activesupport//lib/active_support/testing/time_helpers.rb#69 + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:69 def after_teardown; end - # Calls +travel_to+ with +Time.now+. Forwards optional with_usec argument. + # Calls +travel_to+ with +date_or_time+, which defaults to +Time.now+. + # Forwards optional with_usec argument. # # Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00 # freeze_time # sleep(1) # Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00 + # freeze_time Time.current + 1.day + # sleep(1) + # Time.current # => Mon, 10 Jul 2017 15:34:49 EST -05:00 # # This method also accepts a block, which will return the current time back to its original # state at the end of the block: @@ -12790,8 +13517,8 @@ module ActiveSupport::Testing::TimeHelpers # end # Time.current # => Sun, 09 Jul 2017 15:34:50 EST -05:00 # - # source://activesupport//lib/active_support/testing/time_helpers.rb#257 - def freeze_time(with_usec: T.unsafe(nil), &block); end + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:261 + def freeze_time(date_or_time = T.unsafe(nil), with_usec: T.unsafe(nil), &block); end # Changes current time to the time in the future or in the past by a given time difference by # stubbing +Time.now+, +Date.today+, and +DateTime.now+. The stubs are automatically removed @@ -12817,7 +13544,7 @@ module ActiveSupport::Testing::TimeHelpers # end # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 # - # source://activesupport//lib/active_support/testing/time_helpers.rb#97 + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:97 def travel(duration, with_usec: T.unsafe(nil), &block); end # Returns the current time back to its original state, by removing the stubs added by @@ -12844,7 +13571,7 @@ module ActiveSupport::Testing::TimeHelpers # # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 # - # source://activesupport//lib/active_support/testing/time_helpers.rb#231 + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:231 def travel_back; end # Changes current time to the given time by stubbing +Time.now+, +Time.new+, @@ -12880,51 +13607,21 @@ module ActiveSupport::Testing::TimeHelpers # end # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 # - # source://activesupport//lib/active_support/testing/time_helpers.rb#133 + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:133 def travel_to(date_or_time, with_usec: T.unsafe(nil)); end - # Returns the current time back to its original state, by removing the stubs added by - # +travel+, +travel_to+, and +freeze_time+. - # - # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 - # - # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) - # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 - # - # travel_back - # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 - # - # This method also accepts a block, which brings the stubs back at the end of the block: - # - # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 - # - # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) - # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 - # - # travel_back do - # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 - # end - # - # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 - # - # source://activesupport//lib/active_support/testing/time_helpers.rb#231 + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:239 def unfreeze_time; end private - # Returns the value of attribute in_block. - # - # source://activesupport//lib/active_support/testing/time_helpers.rb#266 + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:270 def in_block; end - # Sets the attribute in_block - # - # @param value the value to set the attribute in_block to. - # - # source://activesupport//lib/active_support/testing/time_helpers.rb#266 + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:270 def in_block=(_arg0); end - # source://activesupport//lib/active_support/testing/time_helpers.rb#262 + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:266 def simple_stubs; end end @@ -12962,14 +13659,12 @@ end # t.is_a?(Time) # => true # t.is_a?(ActiveSupport::TimeWithZone) # => true # -# source://activesupport//lib/active_support/time_with_zone.rb#44 +# pkg:gem/activesupport#lib/active_support/time_with_zone.rb:44 class ActiveSupport::TimeWithZone include ::DateAndTime::Compatibility include ::Comparable - # @return [TimeWithZone] a new instance of TimeWithZone - # - # source://activesupport//lib/active_support/time_with_zone.rb#51 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:51 def initialize(utc_time, time_zone, local_time = T.unsafe(nil), period = T.unsafe(nil)); end # Adds an interval of time to the current object's time and returns that @@ -12989,7 +13684,7 @@ class ActiveSupport::TimeWithZone # now + 24.hours # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 # now + 1.day # => Mon, 03 Nov 2014 01:26:28.725182881 EST -05:00 # - # source://activesupport//lib/active_support/time_with_zone.rb#298 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:314 def +(other); end # Subtracts an interval of time and returns a new TimeWithZone object unless @@ -13015,19 +13710,17 @@ class ActiveSupport::TimeWithZone # # Time.zone.now - 1.day.ago # => 86399.999967 # - # source://activesupport//lib/active_support/time_with_zone.rb#341 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:349 def -(other); end # Use the time in UTC for comparisons. # - # source://activesupport//lib/active_support/time_with_zone.rb#231 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:247 def <=>(other); end # So that +self+ acts_like?(:time). # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#504 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:506 def acts_like_time?; end # Uses Date to provide precise Time calculations for years, months, and days @@ -13052,9 +13745,10 @@ class ActiveSupport::TimeWithZone # now.advance(months: 1) # => Tue, 02 Dec 2014 01:26:28.558049687 EST -05:00 # now.advance(years: 1) # => Mon, 02 Nov 2015 01:26:28.558049687 EST -05:00 # - # source://activesupport//lib/active_support/time_with_zone.rb#430 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:438 def advance(options); end + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:251 def after?(_arg0); end # Subtracts an interval of time from the current object's time and returns @@ -13075,7 +13769,7 @@ class ActiveSupport::TimeWithZone # now.ago(24.hours) # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 # now.ago(1.day) # => Sun, 02 Nov 2014 00:26:28.725182881 EDT -04:00 # - # source://activesupport//lib/active_support/time_with_zone.rb#369 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:377 def ago(other); end # Coerces time to a string for JSON encoding. The default format is ISO 8601. @@ -13091,24 +13785,21 @@ class ActiveSupport::TimeWithZone # Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").as_json # # => "2005/02/01 05:15:10 -1000" # - # source://activesupport//lib/active_support/time_with_zone.rb#166 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:182 def as_json(options = T.unsafe(nil)); end + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:250 def before?(_arg0); end # Returns true if the current object's time is within the specified # +min+ and +max+ time. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#239 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:255 def between?(min, max); end # An instance of ActiveSupport::TimeWithZone is never blank # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#515 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:517 def blank?; end # Returns a new +ActiveSupport::TimeWithZone+ where one or more of the elements have @@ -13129,15 +13820,13 @@ class ActiveSupport::TimeWithZone # t.change(offset: "-10:00") # => Fri, 14 Apr 2017 11:45:15.116992711 HST -10:00 # t.change(zone: "Hawaii") # => Fri, 14 Apr 2017 11:45:15.116992711 HST -10:00 # - # source://activesupport//lib/active_support/time_with_zone.rb#390 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:398 def change(options); end - # Returns a Time instance of the simultaneous time in the UTC timezone. - # - # source://activesupport//lib/active_support/time_with_zone.rb#63 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:72 def comparable_time; end - # source://activesupport//lib/active_support/time_with_zone.rb#442 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 def day; end # Returns true if the current time is within Daylight Savings \Time for the @@ -13147,19 +13836,15 @@ class ActiveSupport::TimeWithZone # Time.zone.parse("2012-5-30").dst? # => true # Time.zone.parse("2012-11-30").dst? # => false # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#94 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:100 def dst?; end - # source://activesupport//lib/active_support/time_with_zone.rb#178 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:194 def encode_with(coder); end # Returns +true+ if +other+ is equal to current object. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#274 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:290 def eql?(other); end # Returns a formatted string of the offset from UTC, or an alternative @@ -13171,65 +13856,42 @@ class ActiveSupport::TimeWithZone # Time.zone = 'UTC' # => "UTC" # Time.zone.now.formatted_offset(true, "0") # => "0" # - # source://activesupport//lib/active_support/time_with_zone.rb#125 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:131 def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end - # source://activesupport//lib/active_support/time_with_zone.rb#523 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:525 def freeze; end # Returns true if the current object's time is in the future. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#269 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:285 def future?; end - # Returns a Time instance of the simultaneous time in the UTC timezone. - # - # source://activesupport//lib/active_support/time_with_zone.rb#63 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:73 def getgm; end - # Returns a Time instance of the simultaneous time in the system timezone. - # - # source://activesupport//lib/active_support/time_with_zone.rb#83 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:92 def getlocal(utc_offset = T.unsafe(nil)); end - # Returns a Time instance of the simultaneous time in the UTC timezone. - # - # source://activesupport//lib/active_support/time_with_zone.rb#63 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:74 def getutc; end - # Returns true if the current time zone is set to UTC. - # - # Time.zone = 'UTC' # => 'UTC' - # Time.zone.now.utc? # => true - # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' - # Time.zone.now.utc? # => false - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#105 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:114 def gmt?; end - # Returns the offset from current time to UTC time in seconds. - # - # source://activesupport//lib/active_support/time_with_zone.rb#111 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:120 def gmt_offset; end - # Returns a Time instance of the simultaneous time in the UTC timezone. - # - # source://activesupport//lib/active_support/time_with_zone.rb#63 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:75 def gmtime; end - # Returns the offset from current time to UTC time in seconds. - # - # source://activesupport//lib/active_support/time_with_zone.rb#111 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:121 def gmtoff; end - # source://activesupport//lib/active_support/time_with_zone.rb#278 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:294 def hash; end - # source://activesupport//lib/active_support/time_with_zone.rb#442 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 def hour; end # Returns a string of the object's date and time in the format used by @@ -13237,149 +13899,96 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.httpdate # => "Tue, 01 Jan 2013 04:39:43 GMT" # - # source://activesupport//lib/active_support/time_with_zone.rb#186 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:202 def httpdate; end - # Adds an interval of time to the current object's time and returns that - # value as a new TimeWithZone object. - # - # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' - # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 - # now + 1000 # => Sun, 02 Nov 2014 01:43:08.725182881 EDT -04:00 - # - # If we're adding a Duration of variable length (i.e., years, months, days), - # move forward from #time, otherwise move forward from #utc, for accuracy - # when moving across DST boundaries. - # - # For instance, a time + 24.hours will advance exactly 24 hours, while a - # time + 1.day will advance 23-25 hours, depending on the day. - # - # now + 24.hours # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 - # now + 1.day # => Mon, 03 Nov 2014 01:26:28.725182881 EST -05:00 - # - # source://activesupport//lib/active_support/time_with_zone.rb#298 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:324 def in(other); end # Returns the simultaneous time in Time.zone, or the specified zone. # - # source://activesupport//lib/active_support/time_with_zone.rb#77 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:83 def in_time_zone(new_zone = T.unsafe(nil)); end - # source://activesupport//lib/active_support/time_with_zone.rb#174 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:190 def init_with(coder); end # Returns a string of the object's date, time, zone, and offset from UTC. # # Time.zone.now.inspect # => "2024-11-13 07:00:10.528054960 UTC +00:00" # - # source://activesupport//lib/active_support/time_with_zone.rb#140 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:146 def inspect; end # Say we're a Time to thwart type checking. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#509 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:511 def is_a?(klass); end - # Returns true if the current time is within Daylight Savings \Time for the - # specified time zone. - # - # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' - # Time.zone.parse("2012-5-30").dst? # => true - # Time.zone.parse("2012-11-30").dst? # => false - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#94 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:103 def isdst; end - # Returns a string of the object's date and time in the ISO 8601 standard - # format. - # - # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05:00" - # - # source://activesupport//lib/active_support/time_with_zone.rb#148 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:167 def iso8601(fraction_digits = T.unsafe(nil)); end - # Say we're a Time to thwart type checking. - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#509 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:514 def kind_of?(klass); end # Returns a Time instance of the simultaneous time in the system timezone. # - # source://activesupport//lib/active_support/time_with_zone.rb#83 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:89 def localtime(utc_offset = T.unsafe(nil)); end - # source://activesupport//lib/active_support/time_with_zone.rb#529 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:531 def marshal_dump; end - # source://activesupport//lib/active_support/time_with_zone.rb#533 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:535 def marshal_load(variables); end - # source://activesupport//lib/active_support/time_with_zone.rb#442 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 def mday; end # Send the missing method to +time+ instance, and wrap result in a new # TimeWithZone with the existing +time_zone+. # - # source://activesupport//lib/active_support/time_with_zone.rb#553 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:555 def method_missing(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/time_with_zone.rb#442 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 def min; end - # source://activesupport//lib/active_support/time_with_zone.rb#442 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 def mon; end - # source://activesupport//lib/active_support/time_with_zone.rb#442 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 def month; end - # Returns true if the current object's time falls within - # the next day (tomorrow). - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#256 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:275 def next_day?; end - # source://activesupport//lib/active_support/time_with_zone.rb#442 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 def nsec; end # Returns true if the current object's time is in the past. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#244 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:260 def past?; end # Returns the underlying +TZInfo::TimezonePeriod+. # - # source://activesupport//lib/active_support/time_with_zone.rb#72 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:78 def period; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#519 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:521 def present?; end - # Returns true if the current object's time falls within - # the previous day (yesterday). - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#263 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:282 def prev_day?; end # respond_to_missing? is not called in some cases, such as when type conversion is # performed with Kernel#String # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#539 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:541 def respond_to?(sym, include_priv = T.unsafe(nil)); end # Returns a string of the object's date and time in the RFC 2822 standard @@ -13387,62 +13996,33 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.rfc2822 # => "Tue, 01 Jan 2013 04:51:39 +0000" # - # source://activesupport//lib/active_support/time_with_zone.rb#194 - def rfc2822; end - - # Returns a string of the object's date and time in the ISO 8601 standard - # format. - # - # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05:00" - # - # source://activesupport//lib/active_support/time_with_zone.rb#148 - def rfc3339(fraction_digits = T.unsafe(nil)); end - - # Returns a string of the object's date and time in the RFC 2822 standard - # format. - # - # Time.zone.now.rfc2822 # => "Tue, 01 Jan 2013 04:51:39 +0000" - # - # source://activesupport//lib/active_support/time_with_zone.rb#194 - def rfc822; end - - # source://activesupport//lib/active_support/time_with_zone.rb#442 - def sec; end - - # Adds an interval of time to the current object's time and returns that - # value as a new TimeWithZone object. - # - # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' - # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 - # now + 1000 # => Sun, 02 Nov 2014 01:43:08.725182881 EDT -04:00 - # - # If we're adding a Duration of variable length (i.e., years, months, days), - # move forward from #time, otherwise move forward from #utc, for accuracy - # when moving across DST boundaries. - # - # For instance, a time + 24.hours will advance exactly 24 hours, while a - # time + 1.day will advance 23-25 hours, depending on the day. - # - # now + 24.hours # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 - # now + 1.day # => Mon, 03 Nov 2014 01:26:28.725182881 EST -05:00 - # - # source://activesupport//lib/active_support/time_with_zone.rb#298 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:210 + def rfc2822; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:168 + def rfc3339(fraction_digits = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:213 + def rfc822; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def sec; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:323 def since(other); end # Replaces %Z directive with +zone before passing to Time#strftime, # so that zone information is correct. # - # source://activesupport//lib/active_support/time_with_zone.rb#225 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:241 def strftime(format); end # Returns a Time instance that represents the time in +time_zone+. # - # source://activesupport//lib/active_support/time_with_zone.rb#58 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:64 def time; end - # Returns the value of attribute time_zone. - # - # source://activesupport//lib/active_support/time_with_zone.rb#49 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:49 def time_zone; end # Returns Array of parts of Time in sequence of @@ -13451,10 +14031,10 @@ class ActiveSupport::TimeWithZone # now = Time.zone.now # => Tue, 18 Aug 2015 02:29:27.485278555 UTC +00:00 # now.to_a # => [27, 29, 2, 18, 8, 2015, 2, 230, false, "UTC"] # - # source://activesupport//lib/active_support/time_with_zone.rb#453 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:461 def to_a; end - # source://activesupport//lib/active_support/time_with_zone.rb#442 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 def to_date; end # Returns an instance of DateTime with the timezone's UTC offset @@ -13462,7 +14042,7 @@ class ActiveSupport::TimeWithZone # Time.zone.now.to_datetime # => Tue, 18 Aug 2015 02:32:20 +0000 # Time.current.in_time_zone('Hawaii').to_datetime # => Mon, 17 Aug 2015 16:32:20 -1000 # - # source://activesupport//lib/active_support/time_with_zone.rb#486 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:494 def to_datetime; end # Returns the object's date and time as a floating-point number of seconds @@ -13470,19 +14050,10 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.to_f # => 1417709320.285418 # - # source://activesupport//lib/active_support/time_with_zone.rb#461 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:469 def to_f; end - # Returns a string of the object's date and time. - # - # This method is aliased to to_formatted_s. - # - # Accepts an optional format: - # * :default - default value, mimics Ruby Time#to_s format. - # * :db - format outputs time in UTC :db time. See Time#to_fs(:db). - # * Any key in +Time::DATE_FORMATS+ can be used. See active_support/core_ext/time/conversions.rb. - # - # source://activesupport//lib/active_support/time_with_zone.rb#212 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:237 def to_formatted_s(format = T.unsafe(nil)); end # Returns a string of the object's date and time. @@ -13494,7 +14065,7 @@ class ActiveSupport::TimeWithZone # * :db - format outputs time in UTC :db time. See Time#to_fs(:db). # * Any key in +Time::DATE_FORMATS+ can be used. See active_support/core_ext/time/conversions.rb. # - # source://activesupport//lib/active_support/time_with_zone.rb#212 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:228 def to_fs(format = T.unsafe(nil)); end # Returns the object's date and time as an integer number of seconds @@ -13502,7 +14073,7 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.to_i # => 1417709320 # - # source://activesupport//lib/active_support/time_with_zone.rb#469 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:477 def to_i; end # Returns the object's date and time as a rational number of seconds @@ -13510,51 +14081,42 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.to_r # => (708854548642709/500000) # - # source://activesupport//lib/active_support/time_with_zone.rb#478 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:486 def to_r; end # Returns a string of the object's date and time. # - # source://activesupport//lib/active_support/time_with_zone.rb#200 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:216 def to_s; end # Returns an instance of +Time+, either with the same timezone as +self+, # with the same UTC offset as +self+ or in the local system timezone # depending on the setting of +ActiveSupport.to_time_preserves_timezone+. # - # source://activesupport//lib/active_support/time_with_zone.rb#493 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:501 def to_time; end # Returns true if the current object's time falls within # the current day. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#250 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:266 def today?; end # Returns true if the current object's time falls within # the next day (tomorrow). # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#256 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:272 def tomorrow?; end - # Returns the object's date and time as an integer number of seconds - # since the Epoch (January 1, 1970 00:00 UTC). - # - # Time.zone.now.to_i # => 1417709320 - # - # source://activesupport//lib/active_support/time_with_zone.rb#469 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:480 def tv_sec; end - # source://activesupport//lib/active_support/time_with_zone.rb#442 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 def usec; end # Returns a Time instance of the simultaneous time in the UTC timezone. # - # source://activesupport//lib/active_support/time_with_zone.rb#63 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:69 def utc; end # Returns true if the current time zone is set to UTC. @@ -13564,17 +14126,15 @@ class ActiveSupport::TimeWithZone # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' # Time.zone.now.utc? # => false # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#105 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:111 def utc?; end # Returns the offset from current time to UTC time in seconds. # - # source://activesupport//lib/active_support/time_with_zone.rb#111 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:117 def utc_offset; end - # source://activesupport//lib/active_support/time_with_zone.rb#442 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 def wday; end # Returns a string of the object's date and time in the ISO 8601 standard @@ -13582,21 +14142,19 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05:00" # - # source://activesupport//lib/active_support/time_with_zone.rb#148 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:154 def xmlschema(fraction_digits = T.unsafe(nil)); end - # source://activesupport//lib/active_support/time_with_zone.rb#442 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 def yday; end - # source://activesupport//lib/active_support/time_with_zone.rb#442 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 def year; end # Returns true if the current object's time falls within # the previous day (yesterday). # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#263 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:279 def yesterday?; end # Returns the time zone abbreviation. @@ -13604,41 +14162,37 @@ class ActiveSupport::TimeWithZone # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" # Time.zone.now.zone # => "EST" # - # source://activesupport//lib/active_support/time_with_zone.rb#133 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:139 def zone; end private - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#589 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:593 def duration_of_variable_length?(obj); end - # source://activesupport//lib/active_support/time_with_zone.rb#570 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:574 def get_period_and_ensure_valid_local_time(period); end - # source://activesupport//lib/active_support/time_with_zone.rb#562 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:564 def incorporate_utc_offset(time, offset); end # Ensure proxy class responds to all methods that underlying time instance # responds to. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/time_with_zone.rb#547 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:549 def respond_to_missing?(sym, include_priv); end - # source://activesupport//lib/active_support/time_with_zone.rb#583 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:587 def transfer_time_values_to_utc_constructor(time); end - # source://activesupport//lib/active_support/time_with_zone.rb#593 + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:597 def wrap_with_time_zone(time); end end -# source://activesupport//lib/active_support/time_with_zone.rb#45 +# pkg:gem/activesupport#lib/active_support/time_with_zone.rb:45 ActiveSupport::TimeWithZone::PRECISIONS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/time_with_zone.rb#560 +# pkg:gem/activesupport#lib/active_support/time_with_zone.rb:562 ActiveSupport::TimeWithZone::SECONDS_PER_DAY = T.let(T.unsafe(nil), Integer) # = Active Support \Time Zone @@ -13666,30 +14220,28 @@ ActiveSupport::TimeWithZone::SECONDS_PER_DAY = T.let(T.unsafe(nil), Integer) # Time.zone.name # => "Eastern Time (US & Canada)" # Time.zone.now # => Sun, 18 May 2008 14:30:44 EDT -04:00 # -# source://activesupport//lib/active_support/values/time_zone.rb#31 +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:31 class ActiveSupport::TimeZone include ::Comparable # :stopdoc: # - # @return [TimeZone] a new instance of TimeZone - # - # source://activesupport//lib/active_support/values/time_zone.rb#309 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:310 def initialize(name, utc_offset = T.unsafe(nil), tzinfo = T.unsafe(nil)); end # Compare this time zone to the parameter. The two are compared first on # their offsets, and then by name. # - # source://activesupport//lib/active_support/values/time_zone.rb#333 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:340 def <=>(zone); end # Compare #name and TZInfo identifier to a supplied regexp, returning +true+ # if a match is found. # - # source://activesupport//lib/active_support/values/time_zone.rb#342 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:349 def =~(re); end - # source://activesupport//lib/active_support/values/time_zone.rb#567 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:574 def abbr(time); end # \Method for creating new ActiveSupport::TimeWithZone instance in time zone @@ -13704,15 +14256,13 @@ class ActiveSupport::TimeZone # Time.zone = 'Hawaii' # => "Hawaii" # Time.at(946684800, 123456.789).nsec # => 123456789 # - # source://activesupport//lib/active_support/values/time_zone.rb#379 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:386 def at(*args); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/values/time_zone.rb#571 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:578 def dst?(time); end - # source://activesupport//lib/active_support/values/time_zone.rb#579 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:586 def encode_with(coder); end # Returns a formatted string of the offset from UTC, or an alternative @@ -13722,10 +14272,10 @@ class ActiveSupport::TimeZone # zone.formatted_offset # => "-06:00" # zone.formatted_offset(false) # => "-0600" # - # source://activesupport//lib/active_support/values/time_zone.rb#327 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:334 def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end - # source://activesupport//lib/active_support/values/time_zone.rb#575 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:582 def init_with(coder); end # \Method for creating new ActiveSupport::TimeWithZone instance in time zone @@ -13742,7 +14292,7 @@ class ActiveSupport::TimeZone # If the string is invalid then an +ArgumentError+ will be raised unlike +parse+ # which usually returns +nil+ when given an invalid date string. # - # source://activesupport//lib/active_support/values/time_zone.rb#396 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:403 def iso8601(str); end # \Method for creating new ActiveSupport::TimeWithZone instance in time zone @@ -13751,26 +14301,22 @@ class ActiveSupport::TimeZone # Time.zone = 'Hawaii' # => "Hawaii" # Time.zone.local(2007, 2, 1, 15, 30, 45) # => Thu, 01 Feb 2007 15:30:45 HST -10:00 # - # source://activesupport//lib/active_support/values/time_zone.rb#363 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:370 def local(*args); end # Adjust the given time to the simultaneous time in UTC. Returns a # Time.utc() instance. # - # source://activesupport//lib/active_support/values/time_zone.rb#551 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:558 def local_to_utc(time, dst = T.unsafe(nil)); end # Compare #name and TZInfo identifier to a supplied regexp, returning +true+ # if a match is found. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/values/time_zone.rb#348 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:355 def match?(re); end - # Returns the value of attribute name. - # - # source://activesupport//lib/active_support/values/time_zone.rb#296 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:297 def name; end # Returns an ActiveSupport::TimeWithZone instance representing the current @@ -13779,7 +14325,7 @@ class ActiveSupport::TimeZone # Time.zone = 'Hawaii' # => "Hawaii" # Time.zone.now # => Wed, 23 Jan 2008 20:24:27 HST -10:00 # - # source://activesupport//lib/active_support/values/time_zone.rb#516 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:523 def now; end # \Method for creating new ActiveSupport::TimeWithZone instance in time zone @@ -13801,16 +14347,16 @@ class ActiveSupport::TimeZone # # If the string is invalid then an +ArgumentError+ could be raised. # - # source://activesupport//lib/active_support/values/time_zone.rb#453 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:460 def parse(str, now = T.unsafe(nil)); end - # source://activesupport//lib/active_support/values/time_zone.rb#559 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:566 def period_for_local(time, dst = T.unsafe(nil)); end - # source://activesupport//lib/active_support/values/time_zone.rb#555 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:562 def period_for_utc(time); end - # source://activesupport//lib/active_support/values/time_zone.rb#563 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:570 def periods_for_local(time); end # \Method for creating new ActiveSupport::TimeWithZone instance in time zone @@ -13826,11 +14372,15 @@ class ActiveSupport::TimeZone # Time.zone = 'Hawaii' # => "Hawaii" # Time.zone.rfc3339('1999-12-31') # => ArgumentError: invalid date # - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/values/time_zone.rb#469 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:476 def rfc3339(str); end + # Returns a standard time zone name defined by IANA + # https://www.iana.org/time-zones + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:319 + def standard_name; end + # Parses +str+ according to +format+ and returns an ActiveSupport::TimeWithZone. # # Assumes that +str+ is a time in the time zone +self+, @@ -13852,32 +14402,30 @@ class ActiveSupport::TimeZone # # Time.zone.strptime('Mar 2000', '%b %Y') # => Wed, 01 Mar 2000 00:00:00 HST -10:00 # - # source://activesupport//lib/active_support/values/time_zone.rb#507 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:514 def strptime(str, format, now = T.unsafe(nil)); end # Returns a textual representation of this time zone. # - # source://activesupport//lib/active_support/values/time_zone.rb#354 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:361 def to_s; end # Returns the current date in this time zone. # - # source://activesupport//lib/active_support/values/time_zone.rb#521 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:528 def today; end # Returns the next date in this time zone. # - # source://activesupport//lib/active_support/values/time_zone.rb#526 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:533 def tomorrow; end - # Returns the value of attribute tzinfo. - # - # source://activesupport//lib/active_support/values/time_zone.rb#297 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:298 def tzinfo; end # Returns the offset of this time zone from UTC in seconds. # - # source://activesupport//lib/active_support/values/time_zone.rb#317 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:324 def utc_offset; end # Adjust the given time to the simultaneous time in the time zone @@ -13888,22 +14436,20 @@ class ActiveSupport::TimeZone # As of tzinfo 2, utc_to_local returns a Time with a non-zero utc_offset. # See the +utc_to_local_returns_utc_offset_times+ config for more info. # - # source://activesupport//lib/active_support/values/time_zone.rb#542 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:549 def utc_to_local(time); end # Returns the previous date in this time zone. # - # source://activesupport//lib/active_support/values/time_zone.rb#531 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:538 def yesterday; end private - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/values/time_zone.rb#585 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:592 def parts_to_time(parts, now); end - # source://activesupport//lib/active_support/values/time_zone.rb#610 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:617 def time_now; end class << self @@ -13913,35 +14459,36 @@ class ActiveSupport::TimeZone # timezone to find. (The first one with that offset will be returned.) # Returns +nil+ if no such time zone is known to the system. # - # source://activesupport//lib/active_support/values/time_zone.rb#232 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:233 def [](arg); end # Returns an array of all TimeZone objects. There are multiple # TimeZone objects per time zone, in many cases, to make it easier # for users to find their own time zone. # - # source://activesupport//lib/active_support/values/time_zone.rb#223 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:224 def all; end - # source://activesupport//lib/active_support/values/time_zone.rb#265 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:266 def clear; end # A convenience method for returning a collection of TimeZone objects # for time zones in the country specified by its ISO 3166-1 Alpha2 code. # - # source://activesupport//lib/active_support/values/time_zone.rb#260 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:261 def country_zones(country_code); end + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:212 def create(*_arg0); end - # source://activesupport//lib/active_support/values/time_zone.rb#207 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:208 def find_tzinfo(name); end # Returns a TimeZone instance with the given name, or +nil+ if no # such TimeZone instance exists. (This exists to support the use of # this class with the +composed_of+ macro.) # - # source://activesupport//lib/active_support/values/time_zone.rb#216 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:217 def new(name); end # Assumes self represents an offset from UTC in seconds (as returned from @@ -13949,67 +14496,67 @@ class ActiveSupport::TimeZone # # ActiveSupport::TimeZone.seconds_to_utc_offset(-21_600) # => "-06:00" # - # source://activesupport//lib/active_support/values/time_zone.rb#199 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:200 def seconds_to_utc_offset(seconds, colon = T.unsafe(nil)); end # A convenience method for returning a collection of TimeZone objects # for time zones in the USA. # - # source://activesupport//lib/active_support/values/time_zone.rb#254 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:255 def us_zones; end private - # source://activesupport//lib/active_support/values/time_zone.rb#273 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:274 def load_country_zones(code); end - # source://activesupport//lib/active_support/values/time_zone.rb#287 + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:288 def zones_map; end end end # Keys are \Rails TimeZone names, values are TZInfo identifiers. # -# source://activesupport//lib/active_support/values/time_zone.rb#33 +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:33 ActiveSupport::TimeZone::MAPPING = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/values/time_zone.rb#188 +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:189 ActiveSupport::TimeZone::UTC_OFFSET_WITHOUT_COLON = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/values/time_zone.rb#187 +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:188 ActiveSupport::TimeZone::UTC_OFFSET_WITH_COLON = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/core_ext/object/json.rb#35 +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:35 module ActiveSupport::ToJsonWithActiveSupportEncoder - # source://activesupport//lib/active_support/core_ext/object/json.rb#36 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:36 def to_json(options = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/object/try.rb#6 +# pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:6 module ActiveSupport::Tryable - # source://activesupport//lib/active_support/core_ext/object/try.rb#7 + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:7 def try(*args, **_arg1, &block); end - # source://activesupport//lib/active_support/core_ext/object/try.rb#20 + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:20 def try!(*args, **_arg1, &block); end end -# source://activesupport//lib/active_support/gem_version.rb#9 +# pkg:gem/activesupport#lib/active_support/gem_version.rb:9 module ActiveSupport::VERSION; end -# source://activesupport//lib/active_support/gem_version.rb#10 +# pkg:gem/activesupport#lib/active_support/gem_version.rb:10 ActiveSupport::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/gem_version.rb#11 +# pkg:gem/activesupport#lib/active_support/gem_version.rb:11 ActiveSupport::VERSION::MINOR = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/gem_version.rb#13 +# pkg:gem/activesupport#lib/active_support/gem_version.rb:13 ActiveSupport::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) -# source://activesupport//lib/active_support/gem_version.rb#15 +# pkg:gem/activesupport#lib/active_support/gem_version.rb:15 ActiveSupport::VERSION::STRING = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/gem_version.rb#12 +# pkg:gem/activesupport#lib/active_support/gem_version.rb:12 ActiveSupport::VERSION::TINY = T.let(T.unsafe(nil), Integer) # = \XmlMini @@ -14018,95 +14565,89 @@ ActiveSupport::VERSION::TINY = T.let(T.unsafe(nil), Integer) # gem "libxml-ruby" # XmlMini.backend = 'LibXML' # -# source://activesupport//lib/active_support/xml_mini.rb#17 +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:17 module ActiveSupport::XmlMini extend ::ActiveSupport::XmlMini - # source://activesupport//lib/active_support/xml_mini.rb#101 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:102 def backend; end - # source://activesupport//lib/active_support/xml_mini.rb#105 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:106 def backend=(name); end - # Returns the value of attribute depth. - # - # source://activesupport//lib/active_support/xml_mini.rb#96 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:97 def depth; end - # Sets the attribute depth - # - # @param value the value to set the attribute depth to. - # - # source://activesupport//lib/active_support/xml_mini.rb#96 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:97 def depth=(_arg0); end - # source://activesupport//lib/active_support/xml_mini.rb#99 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:100 def parse(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/xml_mini.rb#152 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:153 def rename_key(key, options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/xml_mini.rb#119 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:120 def to_tag(key, value, options); end - # source://activesupport//lib/active_support/xml_mini.rb#111 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:112 def with_backend(name); end private - # source://activesupport//lib/active_support/xml_mini.rb#163 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:164 def _dasherize(key); end - # source://activesupport//lib/active_support/xml_mini.rb#169 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:170 def _parse_binary(bin, entity); end - # source://activesupport//lib/active_support/xml_mini.rb#180 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:181 def _parse_file(file, entity); end - # source://activesupport//lib/active_support/xml_mini.rb#188 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:189 def _parse_hex_binary(bin); end - # source://activesupport//lib/active_support/xml_mini.rb#200 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:201 def cast_backend_name_to_module(name); end - # source://activesupport//lib/active_support/xml_mini.rb#192 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:193 def current_thread_backend; end - # source://activesupport//lib/active_support/xml_mini.rb#196 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:197 def current_thread_backend=(name); end end -# source://activesupport//lib/active_support/xml_mini.rb#34 +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:34 ActiveSupport::XmlMini::DEFAULT_ENCODINGS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/xml_mini.rb#56 +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:56 ActiveSupport::XmlMini::FORMATTING = T.let(T.unsafe(nil), Hash) # This module decorates files deserialized using Hash.from_xml with # the original_filename and content_type methods. # -# source://activesupport//lib/active_support/xml_mini.rb#22 +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:22 module ActiveSupport::XmlMini::FileLike - # source://activesupport//lib/active_support/xml_mini.rb#29 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:29 def content_type; end - # source://activesupport//lib/active_support/xml_mini.rb#23 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:23 def content_type=(_arg0); end - # source://activesupport//lib/active_support/xml_mini.rb#25 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:25 def original_filename; end - # source://activesupport//lib/active_support/xml_mini.rb#23 + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:23 def original_filename=(_arg0); end end -# source://activesupport//lib/active_support/xml_mini.rb#67 +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:66 ActiveSupport::XmlMini::PARSING = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/xml_mini.rb#39 +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:39 ActiveSupport::XmlMini::TYPE_NAMES = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/xml_mini/rexml.rb#8 +# pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:8 module ActiveSupport::XmlMini_REXML extend ::ActiveSupport::XmlMini_REXML @@ -14118,7 +14659,7 @@ module ActiveSupport::XmlMini_REXML # data:: # XML Document string or IO to parse # - # source://activesupport//lib/active_support/xml_mini/rexml.rb#20 + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:20 def parse(data); end private @@ -14128,7 +14669,7 @@ module ActiveSupport::XmlMini_REXML # element:: # The document element to be collapsed. # - # source://activesupport//lib/active_support/xml_mini/rexml.rb#63 + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:63 def collapse(element, depth); end # Determines if a document element has text content @@ -14136,9 +14677,7 @@ module ActiveSupport::XmlMini_REXML # element:: # XML element to be checked. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/xml_mini/rexml.rb#133 + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:133 def empty_content?(element); end # Converts the attributes array of an XML element into a hash. @@ -14147,7 +14686,7 @@ module ActiveSupport::XmlMini_REXML # element:: # XML element to extract attributes from. # - # source://activesupport//lib/active_support/xml_mini/rexml.rb#123 + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:123 def get_attributes(element); end # Adds a new key/value pair to an existing Hash. If the key to be added @@ -14162,7 +14701,7 @@ module ActiveSupport::XmlMini_REXML # value:: # Value to be associated with key. # - # source://activesupport//lib/active_support/xml_mini/rexml.rb#103 + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:103 def merge!(hash, key, value); end # Convert an XML element and merge into the hash @@ -14172,9 +14711,7 @@ module ActiveSupport::XmlMini_REXML # element:: # XML element to merge into hash # - # @raise [REXML::ParseException] - # - # source://activesupport//lib/active_support/xml_mini/rexml.rb#54 + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:54 def merge_element!(hash, element, depth); end # Merge all the texts of an element into the hash @@ -14184,23 +14721,33 @@ module ActiveSupport::XmlMini_REXML # element:: # XML element whose texts are to me merged into the hash # - # source://activesupport//lib/active_support/xml_mini/rexml.rb#81 + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:81 def merge_texts!(hash, element); end - # source://activesupport//lib/active_support/xml_mini/rexml.rb#41 + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:41 def require_rexml; end end -# source://activesupport//lib/active_support/xml_mini/rexml.rb#11 +# pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:11 ActiveSupport::XmlMini_REXML::CONTENT_KEY = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/core_ext/object/blank.rb#95 +# pkg:gem/activesupport#lib/active_support/core_ext/array/extract.rb:3 class Array include ::Enumerable - # source://activesupport//lib/active_support/core_ext/object/json.rb#164 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:164 def as_json(options = T.unsafe(nil)); end + # An array is blank if it's empty: + # + # [].blank? # => true + # [1,2,3].blank? # => false + # + # @return [true, false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:102 + def blank?; end + # Removes all blank elements from the +Array+ in place and returns self. # Uses Object#blank? for determining if an item is blank. # @@ -14208,7 +14755,7 @@ class Array # a.compact_blank! # # => [1, 2, true] # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#275 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:275 def compact_blank!; end # Returns a deep copy of array. @@ -14220,9 +14767,19 @@ class Array # array[1][2] # => nil # dup[1][2] # => 4 # - # source://activesupport//lib/active_support/core_ext/object/deep_dup.rb#29 + # pkg:gem/activesupport#lib/active_support/core_ext/object/deep_dup.rb:29 def deep_dup; end + # Removes and returns the elements for which the block returns a true value. + # If no block is given, an Enumerator is returned instead. + # + # numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + # odd_numbers = numbers.extract! { |number| number.odd? } # => [1, 3, 5, 7, 9] + # numbers # => [0, 2, 4, 6, 8] + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/extract.rb:10 + def extract!; end + # Extracts options from a set of arguments. Removes and returns the last # element in the array if it's a hash, otherwise returns a blank hash. # @@ -14233,24 +14790,13 @@ class Array # options(1, 2) # => {} # options(1, 2, a: :b) # => {:a=>:b} # - # source://activesupport//lib/active_support/core_ext/array/extract_options.rb#24 + # pkg:gem/activesupport#lib/active_support/core_ext/array/extract_options.rb:24 def extract_options!; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#104 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:104 def present?; end - # Extends Array#to_s to convert a collection of elements into a - # comma separated id list if :db argument is given as the format. - # - # This method is aliased to to_formatted_s. - # - # Blog.all.to_fs(:db) # => "1,2,3" - # Blog.none.to_fs(:db) # => "null" - # [1,2].to_fs # => "[1, 2]" - # - # source://activesupport//lib/active_support/core_ext/array/conversions.rb#94 + # pkg:gem/activesupport#lib/active_support/core_ext/array/conversions.rb:106 def to_formatted_s(format = T.unsafe(nil)); end # Extends Array#to_s to convert a collection of elements into a @@ -14262,13 +14808,13 @@ class Array # Blog.none.to_fs(:db) # => "null" # [1,2].to_fs # => "[1, 2]" # - # source://activesupport//lib/active_support/core_ext/array/conversions.rb#94 + # pkg:gem/activesupport#lib/active_support/core_ext/array/conversions.rb:94 def to_fs(format = T.unsafe(nil)); end # Calls to_param on all its elements and joins the result with # slashes. This is used by url_for in Action Pack. # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#43 + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:48 def to_param; end # Converts an array into a string suitable for use as a URL query string, @@ -14276,7 +14822,7 @@ class Array # # ['Rails', 'coding'].to_query('hobbies') # => "hobbies%5B%5D=Rails&hobbies%5B%5D=coding" # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#51 + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:56 def to_query(key); end # Converts the array to a comma-separated sentence where the last element is @@ -14331,7 +14877,7 @@ class Array # ['uno', 'dos', 'tres'].to_sentence(locale: :es) # # => "uno o dos o al menos tres" # - # source://activesupport//lib/active_support/core_ext/array/conversions.rb#60 + # pkg:gem/activesupport#lib/active_support/core_ext/array/conversions.rb:60 def to_sentence(options = T.unsafe(nil)); end # Returns a string that represents the array in XML by invoking +to_xml+ @@ -14409,11 +14955,11 @@ class Array # # # - # source://activesupport//lib/active_support/core_ext/array/conversions.rb#183 + # pkg:gem/activesupport#lib/active_support/core_ext/array/conversions.rb:183 def to_xml(options = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/object/json.rb#124 +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:124 class BigDecimal < ::Numeric include ::ActiveSupport::BigDecimalWithDefaultFormat @@ -14427,14 +14973,11 @@ class BigDecimal < ::Numeric # BigDecimal, it still has the chance to post-process the string and get the # real value. # - # source://activesupport//lib/active_support/core_ext/object/json.rb#134 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:134 def as_json(options = T.unsafe(nil)); end - - # source://activesupport//lib/active_support/core_ext/big_decimal/conversions.rb#8 - def to_s(format = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/class/attribute.rb#6 +# pkg:gem/activesupport#lib/active_support/core_ext/class/attribute.rb:6 class Class < ::Module include ::ActiveSupport::DescendantsTracker::ReloadedClassesFiltering @@ -14518,7 +15061,7 @@ class Class < ::Module # # class_attribute :settings, default: {} # - # source://activesupport//lib/active_support/core_ext/class/attribute.rb#86 + # pkg:gem/activesupport#lib/active_support/core_ext/class/attribute.rb:86 def class_attribute(*attrs, instance_accessor: T.unsafe(nil), instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_predicate: T.unsafe(nil), default: T.unsafe(nil)); end # Returns an array with all classes that are < than its receiver. @@ -14535,36 +15078,39 @@ class Class < ::Module # class D < C; end # C.descendants # => [B, A, D] # - # source://activesupport//lib/active_support/descendants_tracker.rb#63 + # pkg:gem/activesupport#lib/active_support/core_ext/class/subclasses.rb:19 def descendants; end - # source://activesupport//lib/active_support/descendants_tracker.rb#59 + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:59 def subclasses; end end -# source://activesupport//lib/active_support/core_ext/object/json.rb#68 +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:68 class Data - # source://activesupport//lib/active_support/core_ext/object/json.rb#69 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:69 def as_json(options = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/date/zones.rb#6 +# pkg:gem/activesupport#lib/active_support/core_ext/date/zones.rb:6 class Date include ::Comparable include ::DateAndTime::Zones include ::DateAndTime::Calculations - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#90 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:98 def +(other); end - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#100 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:108 def -(other); end - # Allow Date to be compared with Time by converting to DateTime and relying on the <=> from there. - # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#152 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:160 def <=>(other); end + # Duck-types as a Date-like class. See Object#acts_like?. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/acts_like.rb:7 + def acts_like_date?; end + # Provides precise Date calculations for years, months, and days. The +options+ parameter takes a hash with # any of these keys: :years, :months, :weeks, :days. # @@ -14582,51 +15128,39 @@ class Date # Date.new(2004, 9, 30).advance(days: 1).advance(months: 1) # # => Mon, 01 Nov 2004 # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#127 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:127 def advance(options); end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) # and then subtracts the specified number of seconds. # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#55 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:55 def ago(seconds); end - # source://activesupport//lib/active_support/core_ext/object/json.rb#211 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:211 def as_json(options = T.unsafe(nil)); end - # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) - # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#67 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:72 def at_beginning_of_day; end - # Converts Date to a Time (or DateTime if necessary) with the time portion set to the end of the day (23:59:59) - # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#85 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:88 def at_end_of_day; end - # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#75 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:80 def at_midday; end - # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#75 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:82 def at_middle_of_day; end - # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) - # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#67 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:71 def at_midnight; end - # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#75 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:81 def at_noon; end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#67 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:67 def beginning_of_day; end # Returns a new Date where one or more of the elements have been changed according to the +options+ parameter. @@ -14635,94 +15169,69 @@ class Date # Date.new(2007, 5, 12).change(day: 1) # => Date.new(2007, 5, 1) # Date.new(2007, 5, 12).change(year: 2005, month: 1) # => Date.new(2005, 1, 12) # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#143 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:143 def change(options); end # Allow Date to be compared with Time by converting to DateTime and relying on the <=> from there. # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#152 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:152 def compare_with_coercion(other); end + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:159 + def compare_without_coercion(_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:66 + def default_inspect; end + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the end of the day (23:59:59) # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#85 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:85 def end_of_day; end - # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) - # and then adds the specified number of seconds - # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#61 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:64 def in(seconds); end - # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005" - # - # source://activesupport//lib/active_support/core_ext/date/conversions.rb#63 + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:67 def inspect; end - # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#75 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:78 def midday; end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#75 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:75 def middle_of_day; end - # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) - # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#67 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:70 def midnight; end - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#100 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:100 def minus_with_duration(other); end - # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#75 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:107 + def minus_without_duration(_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:79 def noon; end - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#90 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:90 def plus_with_duration(other); end + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:97 + def plus_without_duration(_arg0); end + # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005" # - # source://activesupport//lib/active_support/core_ext/date/conversions.rb#63 + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:63 def readable_inspect; end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) # and then adds the specified number of seconds # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#61 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:61 def since(seconds); end - # Convert to a formatted string. See DATE_FORMATS for predefined formats. - # - # This method is aliased to to_formatted_s. - # - # date = Date.new(2007, 11, 10) # => Sat, 10 Nov 2007 - # - # date.to_fs(:db) # => "2007-11-10" - # date.to_formatted_s(:db) # => "2007-11-10" - # - # date.to_fs(:short) # => "10 Nov" - # date.to_fs(:number) # => "20071110" - # date.to_fs(:long) # => "November 10, 2007" - # date.to_fs(:long_ordinal) # => "November 10th, 2007" - # date.to_fs(:rfc822) # => "10 Nov 2007" - # date.to_fs(:rfc2822) # => "10 Nov 2007" - # date.to_fs(:iso8601) # => "2007-11-10" - # - # == Adding your own date formats to to_fs - # You can add your own formats to the Date::DATE_FORMATS hash. - # Use the format name as the hash key and either a strftime string - # or Proc instance that takes a date argument as the value. - # - # # config/initializers/date_formats.rb - # Date::DATE_FORMATS[:month_and_year] = '%B %Y' - # Date::DATE_FORMATS[:short_ordinal] = ->(date) { date.strftime("%B #{date.day.ordinalize}") } - # - # source://activesupport//lib/active_support/core_ext/date/conversions.rb#49 + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:60 def to_formatted_s(format = T.unsafe(nil)); end # Convert to a formatted string. See DATE_FORMATS for predefined formats. @@ -14751,7 +15260,7 @@ class Date # Date::DATE_FORMATS[:month_and_year] = '%B %Y' # Date::DATE_FORMATS[:short_ordinal] = ->(date) { date.strftime("%B #{date.day.ordinalize}") } # - # source://activesupport//lib/active_support/core_ext/date/conversions.rb#49 + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:49 def to_fs(format = T.unsafe(nil)); end # Converts a Date instance to a Time, where the time is set to the beginning of the day. @@ -14767,9 +15276,7 @@ class Date # NOTE: The +:local+ timezone is Ruby's *process* timezone, i.e. ENV['TZ']. # If the application's timezone is needed, then use +in_time_zone+ instead. # - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/core_ext/date/conversions.rb#83 + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:69 def to_time(form = T.unsafe(nil)); end # Returns a string which represents the time in used time zone as DateTime @@ -14778,7 +15285,7 @@ class Date # date = Date.new(2015, 05, 23) # => Sat, 23 May 2015 # date.xmlschema # => "2015-05-23T00:00:00+04:00" # - # source://activesupport//lib/active_support/core_ext/date/conversions.rb#95 + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:88 def xmlschema; end class << self @@ -14786,7 +15293,7 @@ class Date # If Date.beginning_of_week has not been set for the current request, returns the week start specified in config.beginning_of_week. # If no +config.beginning_of_week+ was specified, returns +:monday+. # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#19 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:19 def beginning_of_week; end # Sets Date.beginning_of_week to a week start (e.g. +:monday+) for current request/thread. @@ -14794,171 +15301,103 @@ class Date # This method accepts any of the following day symbols: # +:monday+, +:tuesday+, +:wednesday+, +:thursday+, +:friday+, +:saturday+, +:sunday+ # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#27 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:27 def beginning_of_week=(week_start); end - # Returns the value of attribute beginning_of_week_default. - # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#14 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:14 def beginning_of_week_default; end - # Sets the attribute beginning_of_week_default - # - # @param value the value to set the attribute beginning_of_week_default to. - # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#14 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:14 def beginning_of_week_default=(_arg0); end # Returns Time.zone.today when Time.zone or config.time_zone are set, otherwise just returns Date.today. # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#48 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:48 def current; end # Returns week start day symbol (e.g. +:monday+), or raises an +ArgumentError+ for invalid day symbol. # - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#32 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:32 def find_beginning_of_week!(week_start); end # Returns a new Date representing the date 1 day after today (i.e. tomorrow's date). # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#43 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:43 def tomorrow; end # Returns a new Date representing the date 1 day ago (i.e. yesterday's date). # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#38 + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:38 def yesterday; end end end -# source://activesupport//lib/active_support/core_ext/date/conversions.rb#9 +# pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:9 Date::DATE_FORMATS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#6 +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:6 module DateAndTime; end -# source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#7 +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:7 module DateAndTime::Calculations # Returns true if the date/time falls after date_or_time. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#72 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:72 def after?(date_or_time); end # Returns a Range representing the whole day of the current date/time. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#310 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:310 def all_day; end # Returns a Range representing the whole month of the current date/time. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#321 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:321 def all_month; end # Returns a Range representing the whole quarter of the current date/time. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#326 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:326 def all_quarter; end # Returns a Range representing the whole week of the current date/time. # Week starts on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#316 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:316 def all_week(start_day = T.unsafe(nil)); end # Returns a Range representing the whole year of the current date/time. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#331 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:331 def all_year; end - # Returns a new date/time at the start of the month. - # - # today = Date.today # => Thu, 18 Jun 2015 - # today.beginning_of_month # => Mon, 01 Jun 2015 - # - # +DateTime+ objects will have a time set to 0:00. - # - # now = DateTime.current # => Thu, 18 Jun 2015 15:23:13 +0000 - # now.beginning_of_month # => Mon, 01 Jun 2015 00:00:00 +0000 - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#125 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:128 def at_beginning_of_month; end - # Returns a new date/time at the start of the quarter. - # - # today = Date.today # => Fri, 10 Jul 2015 - # today.beginning_of_quarter # => Wed, 01 Jul 2015 - # - # +DateTime+ objects will have a time set to 0:00. - # - # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 - # now.beginning_of_quarter # => Wed, 01 Jul 2015 00:00:00 +0000 - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#139 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:143 def at_beginning_of_quarter; end - # Returns a new date/time representing the start of this week on the given day. - # Week is assumed to start on +start_day+, default is - # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. - # +DateTime+ objects have their time set to 0:00. - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#267 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:271 def at_beginning_of_week(start_day = T.unsafe(nil)); end - # Returns a new date/time at the beginning of the year. - # - # today = Date.today # => Fri, 10 Jul 2015 - # today.beginning_of_year # => Thu, 01 Jan 2015 - # - # +DateTime+ objects will have a time set to 0:00. - # - # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 - # now.beginning_of_year # => Thu, 01 Jan 2015 00:00:00 +0000 - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#179 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:182 def at_beginning_of_year; end - # Returns a new date/time representing the end of the month. - # DateTime objects will have a time set to 23:59:59. - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#296 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:300 def at_end_of_month; end - # Returns a new date/time at the end of the quarter. - # - # today = Date.today # => Fri, 10 Jul 2015 - # today.end_of_quarter # => Wed, 30 Sep 2015 - # - # +DateTime+ objects will have a time set to 23:59:59. - # - # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 - # now.end_of_quarter # => Wed, 30 Sep 2015 23:59:59 +0000 - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#154 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:158 def at_end_of_quarter; end - # Returns a new date/time representing the end of this week on the given day. - # Week is assumed to start on +start_day+, default is - # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. - # DateTime objects have their time set to 23:59:59. - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#283 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:286 def at_end_of_week(start_day = T.unsafe(nil)); end - # Returns a new date/time representing the end of the year. - # DateTime objects will have a time set to 23:59:59. - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#304 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:307 def at_end_of_year; end # Returns true if the date/time falls before date_or_time. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#67 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:67 def before?(date_or_time); end # Returns a new date/time at the start of the month. @@ -14971,7 +15410,7 @@ module DateAndTime::Calculations # now = DateTime.current # => Thu, 18 Jun 2015 15:23:13 +0000 # now.beginning_of_month # => Mon, 01 Jun 2015 00:00:00 +0000 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#125 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:125 def beginning_of_month; end # Returns a new date/time at the start of the quarter. @@ -14984,7 +15423,7 @@ module DateAndTime::Calculations # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 # now.beginning_of_quarter # => Wed, 01 Jul 2015 00:00:00 +0000 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#139 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:139 def beginning_of_quarter; end # Returns a new date/time representing the start of this week on the given day. @@ -14992,7 +15431,7 @@ module DateAndTime::Calculations # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. # +DateTime+ objects have their time set to 0:00. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#267 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:267 def beginning_of_week(start_day = T.unsafe(nil)); end # Returns a new date/time at the beginning of the year. @@ -15005,30 +15444,30 @@ module DateAndTime::Calculations # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 # now.beginning_of_year # => Thu, 01 Jan 2015 00:00:00 +0000 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#179 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:179 def beginning_of_year; end # Returns a new date/time the specified number of days ago. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#77 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:77 def days_ago(days); end # Returns a new date/time the specified number of days in the future. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#82 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:82 def days_since(days); end # Returns the number of days to the start of the week on the given day. # Week is assumed to start on +start_day+, default is # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#258 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:258 def days_to_week_start(start_day = T.unsafe(nil)); end # Returns a new date/time representing the end of the month. # DateTime objects will have a time set to 23:59:59. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#296 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:296 def end_of_month; end # Returns a new date/time at the end of the quarter. @@ -15041,7 +15480,7 @@ module DateAndTime::Calculations # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 # now.end_of_quarter # => Wed, 30 Sep 2015 23:59:59 +0000 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#154 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:154 def end_of_quarter; end # Returns a new date/time representing the end of this week on the given day. @@ -15049,71 +15488,56 @@ module DateAndTime::Calculations # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. # DateTime objects have their time set to 23:59:59. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#283 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:283 def end_of_week(start_day = T.unsafe(nil)); end # Returns a new date/time representing the end of the year. # DateTime objects will have a time set to 23:59:59. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#304 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:304 def end_of_year; end # Returns true if the date/time is in the future. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#52 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:52 def future?; end # Short-hand for months_ago(1). # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#240 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:240 def last_month; end - # Short-hand for months_ago(3). - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#245 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:248 def last_quarter; end - # Returns a new date/time representing the given day in the previous week. - # Week is assumed to start on +start_day+, default is - # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. - # DateTime objects have their time set to 0:00 unless +same_time+ is true. - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#223 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:227 def last_week(start_day = T.unsafe(nil), same_time: T.unsafe(nil)); end - # Returns a new date/time representing the previous weekday. - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#230 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:237 def last_weekday; end # Short-hand for years_ago(1). # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#251 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:251 def last_year; end # Returns Monday of this week assuming that week starts on Monday. # +DateTime+ objects have their time set to 0:00. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#275 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:275 def monday; end # Returns a new date/time the specified number of months ago. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#97 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:97 def months_ago(months); end # Returns a new date/time the specified number of months in the future. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#102 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:102 def months_since(months); end - # Returns true if the date/time is tomorrow. - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#35 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:38 def next_day?; end # Returns a new date/time representing the next occurrence of the specified day of week. @@ -15122,12 +15546,12 @@ module DateAndTime::Calculations # today.next_occurring(:monday) # => Mon, 18 Dec 2017 # today.next_occurring(:thursday) # => Thu, 21 Dec 2017 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#340 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:340 def next_occurring(day_of_week); end # Short-hand for months_since(3). # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#215 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:215 def next_quarter; end # Returns a new date/time representing the given day in the next week. @@ -15147,40 +15571,30 @@ module DateAndTime::Calculations # now = DateTime.current # => Thu, 07 May 2015 13:31:16 +0000 # now.next_week # => Mon, 11 May 2015 00:00:00 +0000 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#200 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:200 def next_week(given_day_in_next_week = T.unsafe(nil), same_time: T.unsafe(nil)); end # Returns a new date/time representing the next weekday. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#206 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:206 def next_weekday; end # Returns true if the date/time does not fall on a Saturday or Sunday. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#62 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:62 def on_weekday?; end # Returns true if the date/time falls on a Saturday or Sunday. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#57 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:57 def on_weekend?; end # Returns true if the date/time is in the past. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#47 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:47 def past?; end - # Returns true if the date/time is yesterday. - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#41 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:44 def prev_day?; end # Returns a new date/time representing the previous occurrence of the specified day of week. @@ -15189,12 +15603,12 @@ module DateAndTime::Calculations # today.prev_occurring(:monday) # => Mon, 11 Dec 2017 # today.prev_occurring(:thursday) # => Thu, 07 Dec 2017 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#351 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:351 def prev_occurring(day_of_week); end # Short-hand for months_ago(3). # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#245 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:245 def prev_quarter; end # Returns a new date/time representing the given day in the previous week. @@ -15202,12 +15616,12 @@ module DateAndTime::Calculations # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. # DateTime objects have their time set to 0:00 unless +same_time+ is true. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#223 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:223 def prev_week(start_day = T.unsafe(nil), same_time: T.unsafe(nil)); end # Returns a new date/time representing the previous weekday. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#230 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:230 def prev_weekday; end # Returns the quarter for a date/time. @@ -15217,117 +15631,96 @@ module DateAndTime::Calculations # Date.new(2010, 9, 15).quarter # => 3 # Date.new(2010, 12, 25).quarter # => 4 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#166 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:166 def quarter; end # Returns Sunday of this week assuming that week starts on Monday. # +DateTime+ objects have their time set to 23:59:59. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#290 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:290 def sunday; end # Returns true if the date/time is today. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#30 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:30 def today?; end # Returns a new date/time representing tomorrow. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#25 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:25 def tomorrow; end # Returns true if the date/time is tomorrow. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#35 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:35 def tomorrow?; end # Returns a new date/time the specified number of weeks ago. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#87 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:87 def weeks_ago(weeks); end # Returns a new date/time the specified number of weeks in the future. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#92 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:92 def weeks_since(weeks); end # Returns a new date/time the specified number of years ago. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#107 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:107 def years_ago(years); end # Returns a new date/time the specified number of years in the future. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#112 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:112 def years_since(years); end # Returns a new date/time representing yesterday. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#20 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:20 def yesterday; end # Returns true if the date/time is yesterday. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#41 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:41 def yesterday?; end private - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#370 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:370 def copy_time_to(other); end - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#366 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:366 def days_span(day); end - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#358 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:358 def first_hour(date_or_time); end - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#362 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:362 def last_hour(date_or_time); end end -# source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#8 +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:8 DateAndTime::Calculations::DAYS_INTO_WEEK = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#17 +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:17 DateAndTime::Calculations::WEEKEND_DAYS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#7 +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:7 module DateAndTime::Compatibility - # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#39 - def preserve_timezone; end - - # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#56 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:21 def utc_to_local_returns_utc_offset_times; end class << self - # -- - # This re-implements the behaviour of the mattr_reader, instead - # of prepending on to it, to avoid overcomplicating a module that - # is in turn included in several places. This will all go away in - # Rails 8.0 anyway. - # - # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#24 - def preserve_timezone; end - - # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#15 - def preserve_timezone=(val); end - - # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#56 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:21 def utc_to_local_returns_utc_offset_times; end - # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#56 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:21 def utc_to_local_returns_utc_offset_times=(val); end end end -# source://activesupport//lib/active_support/core_ext/date_and_time/zones.rb#4 +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/zones.rb:4 module DateAndTime::Zones # Returns the simultaneous time in Time.zone if a zone is given or # if Time.zone_default is set. Otherwise, it returns the current time. @@ -15345,21 +15738,21 @@ module DateAndTime::Zones # Time.utc(2000).in_time_zone('Alaska') # => Fri, 31 Dec 1999 15:00:00 AKST -09:00 # Date.new(2000).in_time_zone('Alaska') # => Sat, 01 Jan 2000 00:00:00 AKST -09:00 # - # source://activesupport//lib/active_support/core_ext/date_and_time/zones.rb#20 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/zones.rb:20 def in_time_zone(zone = T.unsafe(nil)); end private - # source://activesupport//lib/active_support/core_ext/date_and_time/zones.rb#32 + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/zones.rb:32 def time_with_zone(time, zone); end end -# source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#5 +# pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:5 class DateTime < ::Date # Layers additional behavior on DateTime#<=> so that Time and # ActiveSupport::TimeWithZone instances can be compared with a DateTime. # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#208 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:208 def <=>(other); end # Uses Date to provide precise Time calculations for years, months, and days. @@ -15371,81 +15764,61 @@ class DateTime < ::Date # largest to smallest. This order can affect the result around the end of a # month. # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#82 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:82 def advance(options); end # Returns a new DateTime representing the time a number of seconds ago. # Do not use this method in combination with x.months, use months_ago instead! # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#109 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:109 def ago(seconds); end - # source://activesupport//lib/active_support/core_ext/object/json.rb#221 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:221 def as_json(options = T.unsafe(nil)); end - # Returns a new DateTime representing the start of the day (0:00). - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#122 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:127 def at_beginning_of_day; end - # Returns a new DateTime representing the start of the hour (hh:00:00). - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#146 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:149 def at_beginning_of_hour; end - # Returns a new DateTime representing the start of the minute (hh:mm:00). - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#158 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:161 def at_beginning_of_minute; end - # Returns a new DateTime representing the end of the day (23:59:59). - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#140 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:143 def at_end_of_day; end - # Returns a new DateTime representing the end of the hour (hh:59:59). - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#152 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:155 def at_end_of_hour; end - # Returns a new DateTime representing the end of the minute (hh:mm:59). - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#164 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:167 def at_end_of_minute; end - # Returns a new DateTime representing the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#130 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:135 def at_midday; end - # Returns a new DateTime representing the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#130 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:137 def at_middle_of_day; end - # Returns a new DateTime representing the start of the day (0:00). - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#122 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:126 def at_midnight; end - # Returns a new DateTime representing the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#130 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:136 def at_noon; end # Returns a new DateTime representing the start of the day (0:00). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#122 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:122 def beginning_of_day; end # Returns a new DateTime representing the start of the hour (hh:00:00). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#146 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:146 def beginning_of_hour; end # Returns a new DateTime representing the start of the minute (hh:mm:00). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#158 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:158 def beginning_of_minute; end # Returns a new DateTime where one or more of the elements have been changed @@ -15460,24 +15833,25 @@ class DateTime < ::Date # DateTime.new(2012, 8, 29, 22, 35, 0).change(year: 1981, day: 1) # => DateTime.new(1981, 8, 1, 22, 35, 0) # DateTime.new(2012, 8, 29, 22, 35, 0).change(year: 1981, hour: 0) # => DateTime.new(1981, 8, 29, 0, 0, 0) # - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#51 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:51 def change(options); end + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:61 + def default_inspect; end + # Returns a new DateTime representing the end of the day (23:59:59). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#140 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:140 def end_of_day; end # Returns a new DateTime representing the end of the hour (hh:59:59). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#152 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:152 def end_of_hour; end # Returns a new DateTime representing the end of the minute (hh:mm:59). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#164 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:164 def end_of_minute; end # Returns a formatted string of the offset from UTC, or an alternative @@ -15487,83 +15861,54 @@ class DateTime < ::Date # datetime.formatted_offset # => "-06:00" # datetime.formatted_offset(false) # => "-0600" # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#53 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:53 def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end - # Returns a Time instance of the simultaneous time in the UTC timezone. - # - # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)) # => Mon, 21 Feb 2005 10:11:12 -0600 - # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#184 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:192 def getgm; end - # Returns a Time instance of the simultaneous time in the system timezone. - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#170 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:178 def getlocal(utc_offset = T.unsafe(nil)); end - # Returns a Time instance of the simultaneous time in the UTC timezone. - # - # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)) # => Mon, 21 Feb 2005 10:11:12 -0600 - # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#184 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:193 def getutc; end - - # Returns a Time instance of the simultaneous time in the UTC timezone. - # - # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)) # => Mon, 21 Feb 2005 10:11:12 -0600 - # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#184 - def gmtime; end - - # Returns a new DateTime representing the time a number of seconds since the - # instance time. Do not use this method in combination with x.months, use - # months_since instead! - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#116 + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:194 + def gmtime; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:119 def in(seconds); end - # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005 14:30:00 +0000". - # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#58 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:62 def inspect; end # Returns a Time instance of the simultaneous time in the system timezone. # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#170 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:170 def localtime(utc_offset = T.unsafe(nil)); end - # Returns a new DateTime representing the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#130 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:133 def midday; end # Returns a new DateTime representing the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#130 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:130 def middle_of_day; end - # Returns a new DateTime representing the start of the day (0:00). - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#122 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:125 def midnight; end - # Returns a new DateTime representing the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#130 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:134 def noon; end # Returns the fraction of a second as nanoseconds # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#96 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:96 def nsec; end # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005 14:30:00 +0000". # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#58 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:58 def readable_inspect; end # Returns the number of seconds since 00:00:00. @@ -15572,7 +15917,7 @@ class DateTime < ::Date # DateTime.new(2012, 8, 29, 12, 34, 56).seconds_since_midnight # => 45296 # DateTime.new(2012, 8, 29, 23, 59, 59).seconds_since_midnight # => 86399 # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#20 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:20 def seconds_since_midnight; end # Returns the number of seconds until 23:59:59. @@ -15581,57 +15926,29 @@ class DateTime < ::Date # DateTime.new(2012, 8, 29, 12, 34, 56).seconds_until_end_of_day # => 41103 # DateTime.new(2012, 8, 29, 23, 59, 59).seconds_until_end_of_day # => 0 # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#29 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:29 def seconds_until_end_of_day; end # Returns a new DateTime representing the time a number of seconds since the # instance time. Do not use this method in combination with x.months, use # months_since instead! # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#116 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:116 def since(seconds); end # Returns the fraction of a second as a +Rational+ # # DateTime.new(2012, 8, 29, 0, 0, 0.5).subsec # => (1/2) # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#36 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:36 def subsec; end # Converts +self+ to a floating-point number of seconds, including fractional microseconds, since the Unix epoch. # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#81 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:81 def to_f; end - # Convert to a formatted string. See Time::DATE_FORMATS for predefined formats. - # - # This method is aliased to to_formatted_s. - # - # ==== Examples - # - # datetime = DateTime.civil(2007, 12, 4, 0, 0, 0, 0) # => Tue, 04 Dec 2007 00:00:00 +0000 - # - # datetime.to_fs(:db) # => "2007-12-04 00:00:00" - # datetime.to_formatted_s(:db) # => "2007-12-04 00:00:00" - # datetime.to_fs(:number) # => "20071204000000" - # datetime.to_fs(:short) # => "04 Dec 00:00" - # datetime.to_fs(:long) # => "December 04, 2007 00:00" - # datetime.to_fs(:long_ordinal) # => "December 4th, 2007 00:00" - # datetime.to_fs(:rfc822) # => "Tue, 04 Dec 2007 00:00:00 +0000" - # datetime.to_fs(:iso8601) # => "2007-12-04T00:00:00+00:00" - # - # ==== Adding your own datetime formats to +to_fs+ - # - # DateTime formats are shared with Time. You can add your own to the - # Time::DATE_FORMATS hash. Use the format name as the hash key and - # either a strftime string or Proc instance that takes a time or - # datetime argument as the value. - # - # # config/initializers/time_formats.rb - # Time::DATE_FORMATS[:month_and_year] = '%B %Y' - # Time::DATE_FORMATS[:short_ordinal] = lambda { |time| time.strftime("%B #{time.day.ordinalize}") } - # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#37 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:44 def to_formatted_s(format = T.unsafe(nil)); end # Convert to a formatted string. See Time::DATE_FORMATS for predefined formats. @@ -15662,17 +15979,17 @@ class DateTime < ::Date # Time::DATE_FORMATS[:month_and_year] = '%B %Y' # Time::DATE_FORMATS[:short_ordinal] = lambda { |time| time.strftime("%B #{time.day.ordinalize}") } # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#37 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:37 def to_fs(format = T.unsafe(nil)); end # Converts +self+ to an integer number of seconds since the Unix epoch. # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#86 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:86 def to_i; end # Returns the fraction of a second as microseconds # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#91 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:91 def usec; end # Returns a Time instance of the simultaneous time in the UTC timezone. @@ -15680,27 +15997,25 @@ class DateTime < ::Date # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)) # => Mon, 21 Feb 2005 10:11:12 -0600 # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#184 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:184 def utc; end # Returns +true+ if offset == 0. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#197 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:197 def utc?; end # Returns the offset value in seconds. # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#202 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:202 def utc_offset; end private - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#101 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:101 def offset_in_seconds; end - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#105 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:105 def seconds_since_unix_epoch; end class << self @@ -15712,34 +16027,24 @@ class DateTime < ::Date # DateTime.civil_from_format :local, 2012, 12, 17 # # => Mon, 17 Dec 2012 00:00:00 +0000 # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#71 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:71 def civil_from_format(utc_or_local, year, month = T.unsafe(nil), day = T.unsafe(nil), hour = T.unsafe(nil), min = T.unsafe(nil), sec = T.unsafe(nil)); end # Returns Time.zone.now.to_datetime when Time.zone or # config.time_zone are set, otherwise returns # Time.now.to_datetime. # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#10 + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:10 def current; end end end -# source://activesupport//lib/active_support/core_ext/object/try.rb#117 +# pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:117 class Delegator < ::BasicObject include ::ActiveSupport::Tryable end -module ERB::Escape - private - - def html_escape(_arg0); end - - class << self - def html_escape(_arg0); end - end -end - -# source://activesupport//lib/active_support/core_ext/erb/util.rb#39 +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:39 module ERB::Util include ::ActiveSupport::CoreExt::ERBUtil include ::ActiveSupport::CoreExt::ERBUtilPrivate @@ -15755,7 +16060,7 @@ module ERB::Util # html_escape_once('<< Accept & Checkout') # # => "<< Accept & Checkout" # - # source://activesupport//lib/active_support/core_ext/erb/util.rb#63 + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:63 def html_escape_once(s); end # A utility method for escaping HTML entities in JSON strings. Specifically, the @@ -15814,7 +16119,7 @@ module ERB::Util # JSON gem, do not provide this kind of protection by default; also some gems # might override +to_json+ to bypass Active Support's encoder). # - # source://activesupport//lib/active_support/core_ext/erb/util.rb#124 + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:124 def json_escape(s); end # A utility method for escaping XML names of tags and names of attributes. @@ -15824,16 +16129,10 @@ module ERB::Util # # It follows the requirements of the specification: https://www.w3.org/TR/REC-xml/#NT-Name # - # source://activesupport//lib/active_support/core_ext/erb/util.rb#142 + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:142 def xml_name_escape(name); end class << self - # source://activesupport//lib/active_support/core_ext/erb/util.rb#25 - def h(s); end - - # source://activesupport//lib/active_support/core_ext/erb/util.rb#25 - def html_escape(s); end - # A utility method for escaping HTML without affecting existing escaped entities. # # html_escape_once('1 < 2 & 3') @@ -15842,7 +16141,7 @@ module ERB::Util # html_escape_once('<< Accept & Checkout') # # => "<< Accept & Checkout" # - # source://activesupport//lib/active_support/core_ext/erb/util.rb#63 + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:67 def html_escape_once(s); end # A utility method for escaping HTML entities in JSON strings. Specifically, the @@ -15901,16 +16200,16 @@ module ERB::Util # JSON gem, do not provide this kind of protection by default; also some gems # might override +to_json+ to bypass Active Support's encoder). # - # source://activesupport//lib/active_support/core_ext/erb/util.rb#124 + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:134 def json_escape(s); end # Tokenizes a line of ERB. This is really just for error reporting and # nobody should use it. # - # source://activesupport//lib/active_support/core_ext/erb/util.rb#161 + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:161 def tokenize(source); end - # source://activesupport//lib/active_support/core_ext/erb/util.rb#10 + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:10 def unwrapped_html_escape(s); end # A utility method for escaping XML names of tags and names of attributes. @@ -15920,43 +16219,43 @@ module ERB::Util # # It follows the requirements of the specification: https://www.w3.org/TR/REC-xml/#NT-Name # - # source://activesupport//lib/active_support/core_ext/erb/util.rb#142 + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:157 def xml_name_escape(name); end end end -# source://activesupport//lib/active_support/core_ext/erb/util.rb#40 +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:40 ERB::Util::HTML_ESCAPE = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/core_ext/erb/util.rb#41 +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:41 ERB::Util::HTML_ESCAPE_ONCE_REGEXP = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/core_ext/erb/util.rb#49 +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:49 ERB::Util::INVALID_TAG_NAME_FOLLOWING_REGEXP = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/core_ext/erb/util.rb#47 +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:47 ERB::Util::INVALID_TAG_NAME_START_REGEXP = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/core_ext/erb/util.rb#50 +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:50 ERB::Util::SAFE_XML_TAG_NAME_REGEXP = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/core_ext/erb/util.rb#48 +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:48 ERB::Util::TAG_NAME_FOLLOWING_CODEPOINTS = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/core_ext/erb/util.rb#51 +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:51 ERB::Util::TAG_NAME_REPLACEMENT_CHAR = T.let(T.unsafe(nil), String) # Following XML requirements: https://www.w3.org/TR/REC-xml/#NT-Name # -# source://activesupport//lib/active_support/core_ext/erb/util.rb#44 +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:44 ERB::Util::TAG_NAME_START_CODEPOINTS = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/core_ext/object/json.rb#145 +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:18 module Enumerable include ::ActiveSupport::ToJsonWithActiveSupportEncoder extend ::ActiveSupport::EnumerableCoreExt::Constants - # source://activesupport//lib/active_support/core_ext/object/json.rb#146 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:146 def as_json(options = T.unsafe(nil)); end # Returns a new +Array+ without the blank items. @@ -15973,15 +16272,13 @@ module Enumerable # { a: "", b: 1, c: nil, d: [], e: false, f: true }.compact_blank # # => { b: 1, f: true } # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#184 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:184 def compact_blank; end # The negative of the Enumerable#include?. Returns +true+ if the # collection does not include the object. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#118 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:118 def exclude?(object); end # Returns a copy of the enumerable excluding the specified elements. @@ -15995,7 +16292,7 @@ module Enumerable # {foo: 1, bar: 2, baz: 3}.excluding :bar # # => {foo: 1, baz: 3} # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#132 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:132 def excluding(*elements); end # Returns a new +Array+ where the order has been set to that provided in the +series+, based on the +key+ of the @@ -16008,7 +16305,7 @@ module Enumerable # If the Enumerable has additional elements that aren't named in the +series+, these are not included in the result, unless # the +filter+ option is set to +false+. # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#197 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:197 def in_order_of(key, series, filter: T.unsafe(nil)); end # Returns a new array that includes the passed elements. @@ -16019,7 +16316,7 @@ module Enumerable # ["David", "Rafael"].including %w[ Aaron Todd ] # # => ["David", "Rafael", "Aaron", "Todd"] # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#112 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:112 def including(*elements); end # Convert an enumerable to a hash, using the block result as the key and the @@ -16031,7 +16328,7 @@ module Enumerable # people.index_by { |person| "#{person.first_name} #{person.last_name}" } # # => { "Chade- Fowlersburg-e" => , "David Heinemeier Hansson" => , ...} # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#52 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:52 def index_by; end # Convert an enumerable to a hash, using the element as the key and the block @@ -16048,7 +16345,7 @@ module Enumerable # %i( created_at updated_at ).index_with(Time.now) # # => { created_at: 2020-03-09 22:31:47, updated_at: 2020-03-09 22:31:47 } # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#75 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:75 def index_with(default = T.unsafe(nil)); end # Returns +true+ if the enumerable has more than 1 element. Functionally @@ -16056,9 +16353,7 @@ module Enumerable # much like any?, so people.many? { |p| p.age > 26 } returns +true+ # if more than one person is over 26. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#93 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:93 def many?; end # Calculates the maximum from the extracted elements. @@ -16066,7 +16361,7 @@ module Enumerable # payments = [Payment.new(5), Payment.new(15), Payment.new(10)] # payments.maximum(:price) # => 15 # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#40 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:40 def maximum(key); end # Calculates the minimum from the extracted elements. @@ -16074,7 +16369,7 @@ module Enumerable # payments = [Payment.new(5), Payment.new(15), Payment.new(10)] # payments.minimum(:price) # => 5 # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#32 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:32 def minimum(key); end # Extract the given key from the first element in the enumerable. @@ -16085,7 +16380,7 @@ module Enumerable # [{ id: 1, name: "David" }, { id: 2, name: "Rafael" }].pick(:id, :name) # # => [1, "David"] # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#161 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:161 def pick(*keys); end # Extract the given key from each element in the enumerable. @@ -16096,7 +16391,7 @@ module Enumerable # [{ id: 1, name: "David" }, { id: 2, name: "Rafael" }].pluck(:id, :name) # # => [[1, "David"], [2, "Rafael"]] # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#145 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:145 def pluck(*keys); end # Returns the sole item in the enumerable. If there are no items, or more @@ -16106,39 +16401,28 @@ module Enumerable # Set.new.sole # => Enumerable::SoleItemExpectedError: no item found # { a: 1, b: 2 }.sole # => Enumerable::SoleItemExpectedError: multiple items found # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#211 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:211 def sole; end - # Returns a copy of the enumerable excluding the specified elements. - # - # ["David", "Rafael", "Aaron", "Todd"].excluding "Aaron", "Todd" - # # => ["David", "Rafael"] - # - # ["David", "Rafael", "Aaron", "Todd"].excluding %w[ Aaron Todd ] - # # => ["David", "Rafael"] - # - # {foo: 1, bar: 2, baz: 3}.excluding :bar - # # => {foo: 1, baz: 3} - # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#132 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:136 def without(*elements); end end # Error generated by +sole+ when called on an enumerable that doesn't have # exactly one item. # -# source://activesupport//lib/active_support/core_ext/enumerable.rb#21 +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:21 class Enumerable::SoleItemExpectedError < ::StandardError; end -# source://activesupport//lib/active_support/core_ext/object/json.rb#256 +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:263 class Exception - # source://activesupport//lib/active_support/core_ext/object/json.rb#257 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:264 def as_json(options = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/object/blank.rb#65 +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:65 class FalseClass - # source://activesupport//lib/active_support/core_ext/object/json.rb#87 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:87 def as_json(options = T.unsafe(nil)); end # +false+ is blank: @@ -16147,21 +16431,19 @@ class FalseClass # # @return [true] # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#71 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:71 def blank?; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#75 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:75 def present?; end # Returns +self+. # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#35 + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:40 def to_param; end end -# source://activesupport//lib/active_support/core_ext/file/atomic.rb#5 +# pkg:gem/activesupport#lib/active_support/core_ext/file/atomic.rb:5 class File < ::IO class << self # Write to a file atomically. Useful for situations where you don't @@ -16180,31 +16462,31 @@ class File < ::IO # file.write('hello') # end # - # source://activesupport//lib/active_support/core_ext/file/atomic.rb#21 + # pkg:gem/activesupport#lib/active_support/core_ext/file/atomic.rb:21 def atomic_write(file_name, temp_dir = T.unsafe(nil)); end # Private utility method. # - # source://activesupport//lib/active_support/core_ext/file/atomic.rb#56 + # pkg:gem/activesupport#lib/active_support/core_ext/file/atomic.rb:56 def probe_stat_in(dir); end end end -# source://activesupport//lib/active_support/core_ext/object/json.rb#116 +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:116 class Float < ::Numeric # Encoding Infinity or NaN to JSON should return "null". The default returns # "Infinity" or "NaN" which are not valid JSON. # - # source://activesupport//lib/active_support/core_ext/object/json.rb#119 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:119 def as_json(options = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/hash/deep_merge.rb#5 +# pkg:gem/activesupport#lib/active_support/core_ext/hash/deep_merge.rb:5 class Hash include ::Enumerable include ::ActiveSupport::DeepMergeable - # source://activesupport//lib/active_support/core_ext/object/json.rb#175 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:175 def as_json(options = T.unsafe(nil)); end # Validates all keys in a hash match *valid_keys, raising @@ -16217,12 +16499,22 @@ class Hash # { name: 'Rob', age: '28' }.assert_valid_keys('name', 'age') # => raises "ArgumentError: Unknown key: :name. Valid keys are: 'name', 'age'" # { name: 'Rob', age: '28' }.assert_valid_keys(:name, :age) # => passes, raises nothing # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#48 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:48 def assert_valid_keys(*valid_keys); end + # A hash is blank if it's empty: + # + # {}.blank? # => true + # { key: 'value' }.blank? # => false + # + # @return [true, false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:116 + def blank?; end + # Hash#reject has its own definition, so this needs one too. # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#234 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:234 def compact_blank; end # Removes all blank values from the +Hash+ in place and returns self. @@ -16232,7 +16524,7 @@ class Hash # h.compact_blank! # # => { b: 1, f: true } # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#244 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:244 def compact_blank!; end # Returns a deep copy of hash. @@ -16244,12 +16536,10 @@ class Hash # hash[:a][:c] # => nil # dup[:a][:c] # => "c" # - # source://activesupport//lib/active_support/core_ext/object/deep_dup.rb#43 + # pkg:gem/activesupport#lib/active_support/core_ext/object/deep_dup.rb:43 def deep_dup; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/hash/deep_merge.rb#40 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/deep_merge.rb:40 def deep_merge?(other); end # Returns a new hash with all keys converted to strings. @@ -16261,14 +16551,14 @@ class Hash # hash.deep_stringify_keys # # => {"person"=>{"name"=>"Rob", "age"=>"28"}} # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#84 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:84 def deep_stringify_keys; end # Destructively converts all keys to strings. # This includes the keys from the root hash and from all # nested hashes and arrays. # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#91 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:91 def deep_stringify_keys!; end # Returns a new hash with all keys converted to symbols, as long as @@ -16280,14 +16570,14 @@ class Hash # hash.deep_symbolize_keys # # => {:person=>{:name=>"Rob", :age=>"28"}} # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#103 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:103 def deep_symbolize_keys; end # Destructively converts all keys to symbols, as long as they respond # to +to_sym+. This includes the keys from the root hash and from all # nested hashes and arrays. # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#110 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:110 def deep_symbolize_keys!; end # Returns a new hash with all keys converted by the block operation. @@ -16299,14 +16589,14 @@ class Hash # hash.deep_transform_keys{ |key| key.to_s.upcase } # # => {"PERSON"=>{"NAME"=>"Rob", "AGE"=>"28"}} # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#65 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:65 def deep_transform_keys(&block); end # Destructively converts all keys by using the block operation. # This includes the keys from the root hash and from all # nested hashes and arrays. # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#72 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:72 def deep_transform_keys!(&block); end # Removes the given keys from hash and returns it. @@ -16314,7 +16604,7 @@ class Hash # hash.except!(:c) # => { a: true, b: false } # hash # => { a: true, b: false } # - # source://activesupport//lib/active_support/core_ext/hash/except.rb#8 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/except.rb:8 def except!(*keys); end # Removes and returns the key/value pairs matching the given keys. @@ -16323,7 +16613,7 @@ class Hash # hash.extract!(:a, :b) # => {:a=>1, :b=>2} # hash # => {:c=>3, :d=>4} # - # source://activesupport//lib/active_support/core_ext/hash/slice.rb#24 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/slice.rb:24 def extract!(*keys); end # By default, only instances of Hash itself are extractable. @@ -16332,14 +16622,9 @@ class Hash # is extractable, Array#extract_options! pops it from # the Array when it is the last element of the Array. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/array/extract_options.rb#9 + # pkg:gem/activesupport#lib/active_support/core_ext/array/extract_options.rb:9 def extractable_options?; end - # Returns an ActiveSupport::HashWithIndifferentAccess out of its receiver: - # - # { a: 1 }.with_indifferent_access['a'] # => 1 # Called when object is nested under an object that receives # #with_indifferent_access. This method will be called on the current object # by the enclosing object and is aliased to #with_indifferent_access by @@ -16351,12 +16636,10 @@ class Hash # { a: b }.with_indifferent_access['a'] # calls b.nested_under_indifferent_access # # => {"b"=>1} # - # source://activesupport//lib/active_support/core_ext/hash/indifferent_access.rb#9 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/indifferent_access.rb:23 def nested_under_indifferent_access; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#118 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:118 def present?; end # Merges the caller into +other_hash+. For example, @@ -16370,17 +16653,15 @@ class Hash # This is particularly useful for initializing an options hash # with default values. # - # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#14 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:14 def reverse_merge(other_hash); end # Destructive +reverse_merge+. # - # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#20 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:20 def reverse_merge!(other_hash); end - # Destructive +reverse_merge+. - # - # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#20 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:23 def reverse_update(other_hash); end # Replaces the hash with only the given keys. @@ -16390,7 +16671,7 @@ class Hash # hash.slice!(:a, :b) # => {:c=>3, :d=>4} # hash # => {:a=>1, :b=>2} # - # source://activesupport//lib/active_support/core_ext/hash/slice.rb#10 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/slice.rb:10 def slice!(*keys); end # Returns a new hash with all keys converted to strings. @@ -16400,13 +16681,13 @@ class Hash # hash.stringify_keys # # => {"name"=>"Rob", "age"=>"28"} # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#10 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:10 def stringify_keys; end # Destructively converts all keys to strings. Same as # +stringify_keys+, but modifies +self+. # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#16 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:16 def stringify_keys!; end # Returns a new hash with all keys converted to symbols, as long as @@ -16417,47 +16698,22 @@ class Hash # hash.symbolize_keys # # => {:name=>"Rob", :age=>"28"} # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#27 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:27 def symbolize_keys; end # Destructively converts all keys to symbols, as long as they respond # to +to_sym+. Same as +symbolize_keys+, but modifies +self+. # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#34 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:34 def symbolize_keys!; end - # Returns a new hash with all keys converted to symbols, as long as - # they respond to +to_sym+. - # - # hash = { 'name' => 'Rob', 'age' => '28' } - # - # hash.symbolize_keys - # # => {:name=>"Rob", :age=>"28"} - # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#27 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:30 def to_options; end - # Destructively converts all keys to symbols, as long as they respond - # to +to_sym+. Same as +symbolize_keys+, but modifies +self+. - # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#34 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:37 def to_options!; end - # Returns a string representation of the receiver suitable for use as a URL - # query string: - # - # {name: 'David', nationality: 'Danish'}.to_query - # # => "name=David&nationality=Danish" - # - # An optional namespace can be passed to enclose key names: - # - # {name: 'David', nationality: 'Danish'}.to_query('user') - # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" - # - # The string pairs "key=value" that conform the query string - # are sorted lexicographically in ascending order. - # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#76 + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:92 def to_param(namespace = T.unsafe(nil)); end # Returns a string representation of the receiver suitable for use as a URL @@ -16474,57 +16730,44 @@ class Hash # The string pairs "key=value" that conform the query string # are sorted lexicographically in ascending order. # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#76 + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:81 def to_query(namespace = T.unsafe(nil)); end - # Merges the caller into +other_hash+. For example, - # - # options = options.reverse_merge(size: 25, velocity: 10) - # - # is equivalent to - # - # options = { size: 25, velocity: 10 }.merge(options) - # - # This is particularly useful for initializing an options hash - # with default values. - # - # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#14 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:17 def with_defaults(other_hash); end - # Destructive +reverse_merge+. - # - # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#20 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:24 def with_defaults!(other_hash); end # Returns an ActiveSupport::HashWithIndifferentAccess out of its receiver: # # { a: 1 }.with_indifferent_access['a'] # => 1 # - # source://activesupport//lib/active_support/core_ext/hash/indifferent_access.rb#9 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/indifferent_access.rb:9 def with_indifferent_access; end private # Support methods for deep transforming nested hashes and arrays. # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#116 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:116 def _deep_transform_keys_in_object(object, &block); end - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#129 + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:129 def _deep_transform_keys_in_object!(object, &block); end end # :stopdoc: # -# source://activesupport//lib/active_support/hash_with_indifferent_access.rb#444 +# pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:464 HashWithIndifferentAccess = ActiveSupport::HashWithIndifferentAccess -# source://activesupport//lib/active_support/core_ext/object/json.rb#151 +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:151 class IO include ::Enumerable include ::File::Constants - # source://activesupport//lib/active_support/core_ext/object/json.rb#152 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:152 def as_json(options = T.unsafe(nil)); end end @@ -16608,16 +16851,6 @@ IO::Buffer::PRIVATE = T.let(T.unsafe(nil), Integer) IO::Buffer::READONLY = T.let(T.unsafe(nil), Integer) IO::Buffer::SHARED = T.let(T.unsafe(nil), Integer) -class IO::ConsoleMode - def echo=(_arg0); end - def raw(*_arg0); end - def raw!(*_arg0); end - - private - - def initialize_copy(_arg0); end -end - class IO::EAGAINWaitReadable < ::Errno::EAGAIN include ::IO::WaitReadable end @@ -16641,14 +16874,16 @@ IO::READABLE = T.let(T.unsafe(nil), Integer) IO::WRITABLE = T.let(T.unsafe(nil), Integer) class Integer < ::Numeric; end -# source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#3 +# pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:3 module Kernel + include ::Booleans::KernelExtension + private # Sets $VERBOSE to +true+ for the duration of the block and back to its # original value afterwards. # - # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#20 + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:20 def enable_warnings(&block); end # Sets $VERBOSE to +nil+ for the duration of the block and back to its original @@ -16660,7 +16895,7 @@ module Kernel # # noisy_call # warning voiced # - # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#14 + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:14 def silence_warnings(&block); end # Blocks and ignores any exception passed as argument if raised within the block. @@ -16672,20 +16907,20 @@ module Kernel # # puts 'This code gets executed and nothing related to ZeroDivisionError was seen' # - # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#41 + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:41 def suppress(*exception_classes); end # Sets $VERBOSE for the duration of the block and back to its original # value afterwards. # - # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#26 + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:26 def with_warnings(flag); end class << self # Sets $VERBOSE to +true+ for the duration of the block and back to its # original value afterwards. # - # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#20 + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:20 def enable_warnings(&block); end # Sets $VERBOSE to +nil+ for the duration of the block and back to its original @@ -16697,7 +16932,7 @@ module Kernel # # noisy_call # warning voiced # - # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#14 + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:14 def silence_warnings(&block); end # Blocks and ignores any exception passed as argument if raised within the block. @@ -16709,233 +16944,73 @@ module Kernel # # puts 'This code gets executed and nothing related to ZeroDivisionError was seen' # - # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#41 + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:41 def suppress(*exception_classes); end # Sets $VERBOSE for the duration of the block and back to its original # value afterwards. # - # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#26 + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:26 def with_warnings(flag); end end end +# == Attribute Accessors +# +# Extends the module object with class/module and instance accessors for +# class/module attributes, just like the native attr* accessors for instance +# attributes. # == Attribute Accessors per Thread # # Extends the module object with class/module and instance accessors for # class/module attributes, just like the native attr* accessors for instance # attributes, but does so on a per-thread basis. # -# So the values are scoped within the Thread.current space under the class name -# of the module. -# -# Note that it can also be scoped per-fiber if +Rails.application.config.active_support.isolation_level+ -# is set to +:fiber+. -# -# source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#8 -class Module - # A module may or may not have a name. - # - # module M; end - # M.name # => "M" - # - # m = Module.new - # m.name # => nil - # - # +anonymous?+ method returns true if module does not have a name, false otherwise: - # - # Module.new.anonymous? # => true - # - # module M; end - # M.anonymous? # => false - # - # A module gets a name when it is first assigned to a constant. Either - # via the +module+ or +class+ keyword or by an explicit assignment: - # - # m = Module.new # creates an anonymous module - # m.anonymous? # => true - # M = m # m gets a name here as a side-effect - # m.name # => "M" - # m.anonymous? # => false - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/module/anonymous.rb#27 - def anonymous?; end - - # source://activesupport//lib/active_support/core_ext/object/json.rb#53 - def as_json(options = T.unsafe(nil)); end - - # Defines both class and instance accessors for class attributes. - # All class and instance methods created will be public, even if - # this method is called with a private or protected access modifier. - # - # module HairColors - # mattr_accessor :hair_colors - # end - # - # class Person - # include HairColors - # end - # - # HairColors.hair_colors = [:brown, :black, :blonde, :red] - # HairColors.hair_colors # => [:brown, :black, :blonde, :red] - # Person.new.hair_colors # => [:brown, :black, :blonde, :red] - # - # If a subclass changes the value then that would also change the value for - # parent class. Similarly if parent class changes the value then that would - # change the value of subclasses too. - # - # class Citizen < Person - # end - # - # Citizen.new.hair_colors << :blue - # Person.new.hair_colors # => [:brown, :black, :blonde, :red, :blue] - # - # To omit the instance writer method, pass instance_writer: false. - # To omit the instance reader method, pass instance_reader: false. - # - # module HairColors - # mattr_accessor :hair_colors, instance_writer: false, instance_reader: false - # end - # - # class Person - # include HairColors - # end - # - # Person.new.hair_colors = [:brown] # => NoMethodError - # Person.new.hair_colors # => NoMethodError - # - # Or pass instance_accessor: false, to omit both instance methods. - # - # module HairColors - # mattr_accessor :hair_colors, instance_accessor: false - # end - # - # class Person - # include HairColors - # end - # - # Person.new.hair_colors = [:brown] # => NoMethodError - # Person.new.hair_colors # => NoMethodError - # - # You can set a default value for the attribute. - # - # module HairColors - # mattr_accessor :hair_colors, default: [:brown, :black, :blonde, :red] - # mattr_accessor(:hair_styles) { [:long, :short] } - # end - # - # class Person - # include HairColors - # end - # - # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] - # Person.class_variable_get("@@hair_styles") # => [:long, :short] - # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#208 - def cattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), &blk); end - - # Defines a class attribute and creates a class and instance reader methods. - # The underlying class variable is set to +nil+, if it is not previously - # defined. All class and instance methods created will be public, even if - # this method is called with a private or protected access modifier. - # - # module HairColors - # mattr_reader :hair_colors - # end - # - # HairColors.hair_colors # => nil - # HairColors.class_variable_set("@@hair_colors", [:brown, :black]) - # HairColors.hair_colors # => [:brown, :black] - # - # The attribute name must be a valid method name in Ruby. - # - # module Foo - # mattr_reader :"1_Badname" - # end - # # => NameError: invalid attribute name: 1_Badname - # - # To omit the instance reader method, pass - # instance_reader: false or instance_accessor: false. - # - # module HairColors - # mattr_reader :hair_colors, instance_reader: false - # end +# So the values are scoped within the Thread.current space under the class name +# of the module. +# +# Note that it can also be scoped per-fiber if +Rails.application.config.active_support.isolation_level+ +# is set to +:fiber+. +# +# pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:3 +class Module + # A module may or may not have a name. # - # class Person - # include HairColors - # end + # module M; end + # M.name # => "M" # - # Person.new.hair_colors # => NoMethodError + # m = Module.new + # m.name # => nil # - # You can set a default value for the attribute. + # +anonymous?+ method returns true if module does not have a name, false otherwise: # - # module HairColors - # mattr_reader :hair_colors, default: [:brown, :black, :blonde, :red] - # mattr_reader(:hair_styles) { [:long, :short] } - # end + # Module.new.anonymous? # => true # - # class Person - # include HairColors - # end + # module M; end + # M.anonymous? # => false # - # Person.new.hair_colors # => [:brown, :black, :blonde, :red] - # Person.new.hair_styles # => [:long, :short] + # A module gets a name when it is first assigned to a constant. Either + # via the +module+ or +class+ keyword or by an explicit assignment: # - # @raise [TypeError] + # m = Module.new # creates an anonymous module + # m.anonymous? # => true + # M = m # m gets a name here as a side-effect + # m.name # => "M" + # m.anonymous? # => false # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#55 + # pkg:gem/activesupport#lib/active_support/core_ext/module/anonymous.rb:27 + def anonymous?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:53 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:213 + def cattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), &blk); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:75 def cattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end - # Defines a class attribute and creates a class and instance writer methods to - # allow assignment to the attribute. All class and instance methods created - # will be public, even if this method is called with a private or protected - # access modifier. - # - # module HairColors - # mattr_writer :hair_colors - # end - # - # class Person - # include HairColors - # end - # - # HairColors.hair_colors = [:brown, :black] - # Person.class_variable_get("@@hair_colors") # => [:brown, :black] - # Person.new.hair_colors = [:blonde, :red] - # HairColors.class_variable_get("@@hair_colors") # => [:blonde, :red] - # - # To omit the instance writer method, pass - # instance_writer: false or instance_accessor: false. - # - # module HairColors - # mattr_writer :hair_colors, instance_writer: false - # end - # - # class Person - # include HairColors - # end - # - # Person.new.hair_colors = [:blonde, :red] # => NoMethodError - # - # You can set a default value for the attribute. - # - # module HairColors - # mattr_writer :hair_colors, default: [:brown, :black, :blonde, :red] - # mattr_writer(:hair_styles) { [:long, :short] } - # end - # - # class Person - # include HairColors - # end - # - # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] - # Person.class_variable_get("@@hair_styles") # => [:long, :short] - # - # @raise [TypeError] - # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#121 + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:140 def cattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end # Returns a copy of module or class if it's anonymous. If it's @@ -16945,7 +17020,7 @@ class Module # klass = Class.new # klass.deep_dup == klass # => false # - # source://activesupport//lib/active_support/core_ext/object/deep_dup.rb#64 + # pkg:gem/activesupport#lib/active_support/core_ext/object/deep_dup.rb:64 def deep_dup; end # Provides a +delegate+ class method to easily expose contained objects' @@ -17102,7 +17177,7 @@ class Module # # The target method must be public, otherwise it will raise +NoMethodError+. # - # source://activesupport//lib/active_support/core_ext/module/delegation.rb#160 + # pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:160 def delegate(*methods, to: T.unsafe(nil), prefix: T.unsafe(nil), allow_nil: T.unsafe(nil), private: T.unsafe(nil)); end # When building decorators, a common pattern may emerge: @@ -17152,10 +17227,10 @@ class Module # Marshal.dump(object), should the delegation target method # of object add or remove instance variables. # - # source://activesupport//lib/active_support/core_ext/module/delegation.rb#218 + # pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:218 def delegate_missing_to(target, allow_nil: T.unsafe(nil)); end - # deprecate :foo, deprecator: MyLib.deprecator + # deprecate :foo, deprecator: MyLib.deprecator # deprecate :foo, bar: "warning!", deprecator: MyLib.deprecator # # A deprecator is typically an instance of ActiveSupport::Deprecation, but you can also pass any object that responds @@ -17169,7 +17244,7 @@ class Module # end # end # - # source://activesupport//lib/active_support/core_ext/module/deprecation.rb#17 + # pkg:gem/activesupport#lib/active_support/core_ext/module/deprecation.rb:17 def deprecate(*method_names, deprecator:, **options); end # Defines both class and instance accessors for class attributes. @@ -17239,7 +17314,7 @@ class Module # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] # Person.class_variable_get("@@hair_styles") # => [:long, :short] # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#208 + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:208 def mattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), &blk); end # Defines a class attribute and creates a class and instance reader methods. @@ -17289,9 +17364,7 @@ class Module # Person.new.hair_colors # => [:brown, :black, :blonde, :red] # Person.new.hair_styles # => [:long, :short] # - # @raise [TypeError] - # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#55 + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:55 def mattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end # Defines a class attribute and creates a class and instance writer methods to @@ -17339,12 +17412,10 @@ class Module # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] # Person.class_variable_get("@@hair_styles") # => [:long, :short] # - # @raise [TypeError] - # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#121 + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:121 def mattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end - # source://activesupport//lib/active_support/core_ext/module/redefine_method.rb#30 + # pkg:gem/activesupport#lib/active_support/core_ext/module/redefine_method.rb:30 def method_visibility(method); end # Returns the module which contains this one according to its name. @@ -17363,14 +17434,14 @@ class Module # M.module_parent # => Object # Module.new.module_parent # => Object # - # source://activesupport//lib/active_support/core_ext/module/introspection.rb#37 + # pkg:gem/activesupport#lib/active_support/core_ext/module/introspection.rb:37 def module_parent; end # Returns the name of the module containing this one. # # M::N.module_parent_name # => "M" # - # source://activesupport//lib/active_support/core_ext/module/introspection.rb#9 + # pkg:gem/activesupport#lib/active_support/core_ext/module/introspection.rb:9 def module_parent_name; end # Returns all the parents of this module according to its name, ordered from @@ -17386,40 +17457,40 @@ class Module # M::N.module_parents # => [M, Object] # X.module_parents # => [M, Object] # - # source://activesupport//lib/active_support/core_ext/module/introspection.rb#53 + # pkg:gem/activesupport#lib/active_support/core_ext/module/introspection.rb:53 def module_parents; end # Replaces the existing method definition, if there is one, with the passed # block as its body. # - # source://activesupport//lib/active_support/core_ext/module/redefine_method.rb#17 + # pkg:gem/activesupport#lib/active_support/core_ext/module/redefine_method.rb:17 def redefine_method(method, &block); end # Replaces the existing singleton method definition, if there is one, with # the passed block as its body. # - # source://activesupport//lib/active_support/core_ext/module/redefine_method.rb#26 + # pkg:gem/activesupport#lib/active_support/core_ext/module/redefine_method.rb:26 def redefine_singleton_method(method, &block); end # Removes the named method, if it exists. # - # source://activesupport//lib/active_support/core_ext/module/remove_method.rb#7 + # pkg:gem/activesupport#lib/active_support/core_ext/module/remove_method.rb:7 def remove_possible_method(method); end # Removes the named singleton method, if it exists. # - # source://activesupport//lib/active_support/core_ext/module/remove_method.rb#14 + # pkg:gem/activesupport#lib/active_support/core_ext/module/remove_method.rb:14 def remove_possible_singleton_method(method); end # Marks the named method as intended to be redefined, if it exists. # Suppresses the Ruby method redefinition warning. Prefer # #redefine_method where possible. # - # source://activesupport//lib/active_support/core_ext/module/redefine_method.rb#7 + # pkg:gem/activesupport#lib/active_support/core_ext/module/redefine_method.rb:7 def silence_redefinition_of_method(method); end end -# source://activesupport//lib/active_support/core_ext/module/delegation.rb#5 +# pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:5 Module::DelegationError = ActiveSupport::DelegationError class NameError < ::StandardError @@ -17427,9 +17498,9 @@ class NameError < ::StandardError include ::DidYouMean::Correctable end -# source://activesupport//lib/active_support/core_ext/object/blank.rb#50 +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:50 class NilClass - # source://activesupport//lib/active_support/core_ext/object/json.rb#93 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:93 def as_json(options = T.unsafe(nil)); end # +nil+ is blank: @@ -17438,19 +17509,22 @@ class NilClass # # @return [true] # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#56 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:56 def blank?; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#60 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:60 def present?; end # Returns +self+. # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#21 + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:26 def to_param; end + # Returns a CGI-escaped +key+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:21 + def to_query(key); end + # Calling +try+ on +nil+ always returns +nil+. # It becomes especially helpful when navigating through associations that may return +nil+. # @@ -17462,22 +17536,22 @@ class NilClass # With +try+ # @person.try(:children).try(:first).try(:name) # - # source://activesupport//lib/active_support/core_ext/object/try.rb#148 + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:148 def try(*_arg0, &_arg1); end # Calling +try!+ on +nil+ always returns +nil+. # # nil.try!(:name) # => nil # - # source://activesupport//lib/active_support/core_ext/object/try.rb#155 + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:155 def try!(*_arg0, &_arg1); end end -# source://activesupport//lib/active_support/core_ext/object/blank.rb#170 +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:170 class Numeric include ::Comparable - # source://activesupport//lib/active_support/core_ext/object/json.rb#111 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:111 def as_json(options = T.unsafe(nil)); end # No number is blank: @@ -17487,151 +17561,184 @@ class Numeric # # @return [false] # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#177 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:177 def blank?; end - # Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes - # - # 2.bytes # => 2 - # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#15 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:18 def byte; end # Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes # # 2.bytes # => 2 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#15 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:15 def bytes; end - # Returns the number of bytes equivalent to the exabytes provided. + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:40 + def day; end + + # Returns a Duration instance matching the number of days provided. # - # 2.exabytes # => 2_305_843_009_213_693_952 + # 2.days # => 2 days # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#63 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:37 + def days; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:66 def exabyte; end # Returns the number of bytes equivalent to the exabytes provided. # # 2.exabytes # => 2_305_843_009_213_693_952 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#63 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:63 def exabytes; end - # Returns the number of bytes equivalent to the gigabytes provided. + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:56 + def fortnight; end + + # Returns a Duration instance matching the number of fortnights provided. # - # 2.gigabytes # => 2_147_483_648 + # 2.fortnights # => 4 weeks # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#39 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:53 + def fortnights; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:42 def gigabyte; end # Returns the number of bytes equivalent to the gigabytes provided. # # 2.gigabytes # => 2_147_483_648 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#39 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:39 def gigabytes; end - # @return [Boolean] + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:32 + def hour; end + + # Returns a Duration instance matching the number of hours provided. # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#13 + # 2.hours # => 2 hours + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:29 + def hours; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:13 def html_safe?; end - # Returns the number of bytes equivalent to the kilobytes provided. + # Returns the number of milliseconds equivalent to the seconds provided. + # Used with the standard time durations. # - # 2.kilobytes # => 2048 + # 2.in_milliseconds # => 2000 + # 1.hour.in_milliseconds # => 3600000 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#23 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:63 + def in_milliseconds; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:26 def kilobyte; end # Returns the number of bytes equivalent to the kilobytes provided. # # 2.kilobytes # => 2048 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#23 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:23 def kilobytes; end - # Returns the number of bytes equivalent to the megabytes provided. - # - # 2.megabytes # => 2_097_152 - # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#31 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:34 def megabyte; end # Returns the number of bytes equivalent to the megabytes provided. # # 2.megabytes # => 2_097_152 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#31 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:31 def megabytes; end - # Returns the number of bytes equivalent to the petabytes provided. + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:24 + def minute; end + + # Returns a Duration instance matching the number of minutes provided. # - # 2.petabytes # => 2_251_799_813_685_248 + # 2.minutes # => 2 minutes # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#55 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:21 + def minutes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:58 def petabyte; end # Returns the number of bytes equivalent to the petabytes provided. # # 2.petabytes # => 2_251_799_813_685_248 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#55 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:55 def petabytes; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#181 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:181 def present?; end - # Returns the number of bytes equivalent to the terabytes provided. + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:16 + def second; end + + # Returns a Duration instance matching the number of seconds provided. # - # 2.terabytes # => 2_199_023_255_552 + # 2.seconds # => 2 seconds # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#47 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:13 + def seconds; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:50 def terabyte; end # Returns the number of bytes equivalent to the terabytes provided. # # 2.terabytes # => 2_199_023_255_552 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#47 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:47 def terabytes; end - # Returns the number of bytes equivalent to the zettabytes provided. + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:48 + def week; end + + # Returns a Duration instance matching the number of weeks provided. # - # 2.zettabytes # => 2_361_183_241_434_822_606_848 + # 2.weeks # => 2 weeks # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#71 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:45 + def weeks; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:74 def zettabyte; end # Returns the number of bytes equivalent to the zettabytes provided. # # 2.zettabytes # => 2_361_183_241_434_822_606_848 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#71 + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:71 def zettabytes; end end -# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#9 +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:9 Numeric::EXABYTE = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#6 +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:6 Numeric::GIGABYTE = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#4 +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:4 Numeric::KILOBYTE = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#5 +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:5 Numeric::MEGABYTE = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#8 +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:8 Numeric::PETABYTE = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#7 +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:7 Numeric::TERABYTE = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#10 +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:10 Numeric::ZETTABYTE = T.let(T.unsafe(nil), Integer) # -- @@ -17653,9 +17760,10 @@ Numeric::ZETTABYTE = T.let(T.unsafe(nil), Integer) # using that rescue idiom. # ++ # -# source://activesupport//lib/active_support/core_ext/object/blank.rb#5 +# pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:21 class Object < ::BasicObject include ::ActiveSupport::Dependencies::RequireDependency + include ::Booleans::KernelExtension include ::Kernel include ::PP::ObjectMixin include ::ActiveSupport::Tryable @@ -17690,12 +17798,10 @@ class Object < ::BasicObject # # Stringish.new.acts_like?(:string) # => true # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/object/acts_like.rb#33 + # pkg:gem/activesupport#lib/active_support/core_ext/object/acts_like.rb:33 def acts_like?(duck); end - # source://activesupport//lib/active_support/core_ext/object/json.rb#59 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:59 def as_json(options = T.unsafe(nil)); end # An object is blank if it's false, empty, or a whitespace string. @@ -17711,7 +17817,7 @@ class Object < ::BasicObject # # @return [true, false] # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#18 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:18 def blank?; end # Returns a deep copy of object if it's duplicable. If it's @@ -17724,7 +17830,7 @@ class Object < ::BasicObject # object.instance_variable_defined?(:@a) # => false # dup.instance_variable_defined?(:@a) # => true # - # source://activesupport//lib/active_support/core_ext/object/deep_dup.rb#15 + # pkg:gem/activesupport#lib/active_support/core_ext/object/deep_dup.rb:15 def deep_dup; end # Can you safely dup this object? @@ -17732,14 +17838,10 @@ class Object < ::BasicObject # False for method objects; # true otherwise. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/object/duplicable.rb#26 + # pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:26 def duplicable?; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#7 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:7 def html_safe?; end # Returns true if this object is included in the argument. @@ -17754,9 +17856,7 @@ class Object < ::BasicObject # For non +Range+ arguments, this will throw an +ArgumentError+ if the argument # doesn't respond to +#include?+. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/object/inclusion.rb#15 + # pkg:gem/activesupport#lib/active_support/core_ext/object/inclusion.rb:15 def in?(another_object); end # Returns a hash with string keys that maps instance variable names without "@" to their @@ -17770,7 +17870,7 @@ class Object < ::BasicObject # # C.new(0, 1).instance_values # => {"x" => 0, "y" => 1} # - # source://activesupport//lib/active_support/core_ext/object/instance_variables.rb#14 + # pkg:gem/activesupport#lib/active_support/core_ext/object/instance_variables.rb:14 def instance_values; end # Returns an array of instance variable names as strings including "@". @@ -17783,7 +17883,7 @@ class Object < ::BasicObject # # C.new(0, 1).instance_variable_names # => ["@y", "@x"] # - # source://activesupport//lib/active_support/core_ext/object/instance_variables.rb#29 + # pkg:gem/activesupport#lib/active_support/core_ext/object/instance_variables.rb:29 def instance_variable_names; end # Returns the receiver if it's present otherwise returns +nil+. @@ -17803,7 +17903,7 @@ class Object < ::BasicObject # # @return [Object] # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#45 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:45 def presence; end # Returns the receiver if it's included in the argument otherwise returns +nil+. @@ -17815,25 +17915,25 @@ class Object < ::BasicObject # # @return [Object] # - # source://activesupport//lib/active_support/core_ext/object/inclusion.rb#34 + # pkg:gem/activesupport#lib/active_support/core_ext/object/inclusion.rb:34 def presence_in(another_object); end # An object is present if it's not blank. # # @return [true, false] # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#25 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:25 def present?; end # Alias of to_s. # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#8 + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:8 def to_param; end # Converts an object into a string suitable for use as a URL query string, # using the given key as the param name. # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#14 + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:14 def to_query(key); end # Set and restore public attributes around a block. @@ -17859,13 +17959,13 @@ class Object < ::BasicObject # It can be used on any object as long as both the reader and writer methods # are public. # - # source://activesupport//lib/active_support/core_ext/object/with.rb#26 + # pkg:gem/activesupport#lib/active_support/core_ext/object/with.rb:26 def with(**attributes); end end -# source://activesupport//lib/active_support/core_ext/object/json.rb#236 +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:236 class Pathname - # source://activesupport//lib/active_support/core_ext/object/json.rb#237 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:237 def as_json(options = T.unsafe(nil)); end end @@ -17873,36 +17973,35 @@ module Process extend ::ActiveSupport::ForkTracker::CoreExt class << self - # source://activesupport//lib/active_support/fork_tracker.rb#6 + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:6 def _fork; end end end -# source://activesupport//lib/active_support/core_ext/object/json.rb#250 +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:257 class Process::Status - # source://activesupport//lib/active_support/core_ext/object/json.rb#251 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:258 def as_json(options = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/object/json.rb#157 +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:250 class Range include ::ActiveSupport::RangeWithFormat include ::ActiveSupport::CompareWithRange - include ::ActiveSupport::EachTimeWithZone include ::Enumerable - # source://activesupport//lib/active_support/core_ext/range/compare_range.rb#16 + # pkg:gem/activesupport#lib/active_support/core_ext/range/compare_range.rb:16 def ===(value); end - # source://activesupport//lib/active_support/core_ext/object/json.rb#158 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:158 def as_json(options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/core_ext/range/each.rb#7 - def each(&block); end - - # source://activesupport//lib/active_support/core_ext/range/compare_range.rb#41 + # pkg:gem/activesupport#lib/active_support/core_ext/range/compare_range.rb:41 def include?(value); end + # pkg:gem/activesupport#lib/active_support/core_ext/range/overlap.rb:39 + def overlaps?(_arg0); end + # Returns the sole item in the range. If there are no items, or more # than one item, raises Enumerable::SoleItemExpectedError. # @@ -17910,26 +18009,23 @@ class Range # (2..1).sole # => Enumerable::SoleItemExpectedError: no item found # (..1).sole # => Enumerable::SoleItemExpectedError: infinite range cannot represent a sole item # - # source://activesupport//lib/active_support/core_ext/range/sole.rb#10 + # pkg:gem/activesupport#lib/active_support/core_ext/range/sole.rb:10 def sole; end - # source://activesupport//lib/active_support/core_ext/range/each.rb#12 - def step(n = T.unsafe(nil), &block); end - # Optimize range sum to use arithmetic progression if a block is not given and # we have a range of numeric values. # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#253 + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:253 def sum(initial_value = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/object/json.rb#139 +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:139 class Regexp - # source://activesupport//lib/active_support/core_ext/object/json.rb#140 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:140 def as_json(options = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/object/duplicable.rb#62 +# pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:62 module Singleton mixes_in_class_methods ::Singleton::SingletonClassMethods @@ -17937,9 +18033,7 @@ module Singleton # # Class.new.include(Singleton).instance.dup # TypeError (can't dup instance of singleton # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/object/duplicable.rb#66 + # pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:66 def duplicable?; end end @@ -17948,18 +18042,16 @@ end # # 'ScaleScore'.tableize # => "scale_scores" # -# source://activesupport//lib/active_support/core_ext/object/blank.rb#135 +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:135 class String include ::Comparable # Enables more predictable duck-typing on String-like classes. See Object#acts_like?. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/string/behavior.rb#5 + # pkg:gem/activesupport#lib/active_support/core_ext/string/behavior.rb:5 def acts_like_string?; end - # source://activesupport//lib/active_support/core_ext/object/json.rb#99 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:99 def as_json(options = T.unsafe(nil)); end # If you pass a single integer, returns a substring of one character at that @@ -17988,7 +18080,7 @@ class String # str.at("lo") # => "lo" # str.at("ol") # => nil # - # source://activesupport//lib/active_support/core_ext/string/access.rb#29 + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:29 def at(position); end # A string is blank if it's empty or contains whitespaces only: @@ -18004,22 +18096,10 @@ class String # # @return [true, false] # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#153 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:153 def blank?; end - # By default, +camelize+ converts strings to UpperCamelCase. If the argument to camelize - # is set to :lower then camelize produces lowerCamelCase. - # - # +camelize+ will also convert '/' to '::' which is useful for converting paths to namespaces. - # - # 'active_record'.camelize # => "ActiveRecord" - # 'active_record'.camelize(:lower) # => "activeRecord" - # 'active_record/errors'.camelize # => "ActiveRecord::Errors" - # 'active_record/errors'.camelize(:lower) # => "activeRecord::Errors" - # - # See ActiveSupport::Inflector.camelize. - # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#101 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:111 def camelcase(first_letter = T.unsafe(nil)); end # By default, +camelize+ converts strings to UpperCamelCase. If the argument to camelize @@ -18034,7 +18114,7 @@ class String # # See ActiveSupport::Inflector.camelize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#101 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:101 def camelize(first_letter = T.unsafe(nil)); end # Creates a class name from a plural table name like \Rails does for table names to models. @@ -18046,7 +18126,7 @@ class String # # See ActiveSupport::Inflector.classify. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#239 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:239 def classify; end # +constantize+ tries to find a declared constant with the name specified @@ -18059,7 +18139,7 @@ class String # # See ActiveSupport::Inflector.constantize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#73 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:73 def constantize; end # Replaces underscores with dashes in the string. @@ -18068,7 +18148,7 @@ class String # # See ActiveSupport::Inflector.dasherize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#148 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:148 def dasherize; end # Removes the rightmost segment from the constant expression in the string. @@ -18083,7 +18163,7 @@ class String # # See also +demodulize+. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#177 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:177 def deconstantize; end # Removes the module part from the constant expression in the string. @@ -18097,7 +18177,7 @@ class String # # See also +deconstantize+. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#162 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:162 def demodulize; end # Converts the first character to lowercase. @@ -18108,7 +18188,7 @@ class String # # See ActiveSupport::Inflector.downcase_first. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#284 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:284 def downcase_first; end # Returns the first character. If a limit is supplied, returns a substring @@ -18122,7 +18202,7 @@ class String # str.first(0) # => "" # str.first(6) # => "hello" # - # source://activesupport//lib/active_support/core_ext/string/access.rb#78 + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:78 def first(limit = T.unsafe(nil)); end # Creates a foreign key name from a class name. @@ -18135,7 +18215,7 @@ class String # # See ActiveSupport::Inflector.foreign_key. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#297 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:297 def foreign_key(separate_class_name_and_id_with_underscore = T.unsafe(nil)); end # Returns a substring from the given position to the end of the string. @@ -18152,7 +18232,7 @@ class String # str.from(0).to(-1) # => "hello" # str.from(1).to(-2) # => "ell" # - # source://activesupport//lib/active_support/core_ext/string/access.rb#46 + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:46 def from(position); end # Marks a string as trusted safe. It will be inserted into HTML with no @@ -18161,7 +18241,7 @@ class String # +raw+ helper in views. It is recommended that you use +sanitize+ instead of # this method. It should never be called on user input. # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#225 + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:241 def html_safe; end # Capitalizes the first word, turns underscores into spaces, and (by default) strips a @@ -18172,7 +18252,7 @@ class String # optional parameter +capitalize+ to false. # By default, this parameter is true. # - # The trailing '_id' can be kept and capitalized by setting the + # The trailing '_id' can be kept by setting the # optional parameter +keep_id_suffix+ to true. # By default, this parameter is false. # @@ -18184,13 +18264,13 @@ class String # # See ActiveSupport::Inflector.humanize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#262 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:262 def humanize(capitalize: T.unsafe(nil), keep_id_suffix: T.unsafe(nil)); end # Converts String to a TimeWithZone in the current zone if Time.zone or Time.zone_default # is set, otherwise converts String to a Time via String#to_time # - # source://activesupport//lib/active_support/core_ext/string/zones.rb#9 + # pkg:gem/activesupport#lib/active_support/core_ext/string/zones.rb:9 def in_time_zone(zone = T.unsafe(nil)); end # Returns +true+ if string has utf_8 encoding. @@ -18201,9 +18281,7 @@ class String # utf_8_str.is_utf8? # => true # iso_str.is_utf8? # => false # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/string/multibyte.rb#48 + # pkg:gem/activesupport#lib/active_support/core_ext/string/multibyte.rb:57 def is_utf8?; end # Returns the last character of the string. If a limit is supplied, returns a substring @@ -18217,7 +18295,7 @@ class String # str.last(0) # => "" # str.last(6) # => "hello" # - # source://activesupport//lib/active_support/core_ext/string/access.rb#92 + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:92 def last(limit = T.unsafe(nil)); end # == Multibyte proxy @@ -18252,7 +18330,7 @@ class String # For more information about the methods defined on the Chars proxy see ActiveSupport::Multibyte::Chars. For # information about how to change the default Multibyte behavior see ActiveSupport::Multibyte. # - # source://activesupport//lib/active_support/core_ext/string/multibyte.rb#37 + # pkg:gem/activesupport#lib/active_support/core_ext/string/multibyte.rb:37 def mb_chars; end # Replaces special characters in a string so that it may be used as part of a 'pretty' URL. @@ -18290,7 +18368,7 @@ class String # # See ActiveSupport::Inflector.parameterize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#215 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:215 def parameterize(separator: T.unsafe(nil), preserve_case: T.unsafe(nil), locale: T.unsafe(nil)); end # Returns the plural form of the word in the string. @@ -18317,12 +18395,10 @@ class String # # See ActiveSupport::Inflector.pluralize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#35 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:35 def pluralize(count = T.unsafe(nil), locale = T.unsafe(nil)); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#165 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:165 def present?; end # Returns a new string with all occurrences of the patterns removed. @@ -18331,7 +18407,7 @@ class String # str.remove(" test", /bar/) # => "foo " # str # => "foo bar test" # - # source://activesupport//lib/active_support/core_ext/string/filters.rb#32 + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:32 def remove(*patterns); end # Alters the string by removing all occurrences of the patterns. @@ -18339,7 +18415,7 @@ class String # str.remove!(" test", /bar/) # => "foo " # str # => "foo " # - # source://activesupport//lib/active_support/core_ext/string/filters.rb#40 + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:40 def remove!(*patterns); end # +safe_constantize+ tries to find a declared constant with the name specified @@ -18352,7 +18428,7 @@ class String # # See ActiveSupport::Inflector.safe_constantize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#86 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:86 def safe_constantize; end # The reverse of +pluralize+, returns the singular form of a word in a string. @@ -18372,7 +18448,7 @@ class String # # See ActiveSupport::Inflector.singularize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#60 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:60 def singularize(locale = T.unsafe(nil)); end # Returns the string, first removing all whitespace on both ends of @@ -18385,7 +18461,7 @@ class String # string }.squish # => "Multi-line string" # " foo bar \n \t boo".squish # => "foo bar boo" # - # source://activesupport//lib/active_support/core_ext/string/filters.rb#13 + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:13 def squish; end # Performs a destructive squish. See String#squish. @@ -18393,7 +18469,7 @@ class String # str.squish! # => "foo bar boo" # str # => "foo bar boo" # - # source://activesupport//lib/active_support/core_ext/string/filters.rb#21 + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:21 def squish!; end # Creates the name of a table like \Rails does for models to table names. This method @@ -18405,24 +18481,10 @@ class String # # See ActiveSupport::Inflector.tableize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#227 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:227 def tableize; end - # Capitalizes all the words and replaces some characters in the string to create - # a nicer looking title. +titleize+ is meant for creating pretty output. It is not - # used in the \Rails internals. - # - # The trailing '_id','Id'.. can be kept and capitalized by setting the - # optional parameter +keep_id_suffix+ to true. - # By default, this parameter is false. - # - # 'man from the boondocks'.titleize # => "Man From The Boondocks" - # 'x-men: the last stand'.titleize # => "X Men: The Last Stand" - # 'string_ending_with_id'.titleize(keep_id_suffix: true) # => "String Ending With Id" - # - # See ActiveSupport::Inflector.titleize. - # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#126 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:129 def titlecase(keep_id_suffix: T.unsafe(nil)); end # Capitalizes all the words and replaces some characters in the string to create @@ -18439,7 +18501,7 @@ class String # # See ActiveSupport::Inflector.titleize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#126 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:126 def titleize(keep_id_suffix: T.unsafe(nil)); end # Returns a substring from the beginning of the string to the given position. @@ -18456,7 +18518,7 @@ class String # str.from(0).to(-1) # => "hello" # str.from(1).to(-2) # => "ell" # - # source://activesupport//lib/active_support/core_ext/string/access.rb#63 + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:63 def to(position); end # Converts a string to a Date value. @@ -18466,7 +18528,7 @@ class String # "2012-12-13".to_date # => Thu, 13 Dec 2012 # "12/13/2012".to_date # => ArgumentError: invalid date # - # source://activesupport//lib/active_support/core_ext/string/conversions.rb#47 + # pkg:gem/activesupport#lib/active_support/core_ext/string/conversions.rb:47 def to_date; end # Converts a string to a DateTime value. @@ -18476,7 +18538,7 @@ class String # "2012-12-13 12:50".to_datetime # => Thu, 13 Dec 2012 12:50:00 +0000 # "12/13/2012".to_datetime # => ArgumentError: invalid date # - # source://activesupport//lib/active_support/core_ext/string/conversions.rb#57 + # pkg:gem/activesupport#lib/active_support/core_ext/string/conversions.rb:57 def to_datetime; end # Converts a string to a Time value. @@ -18495,7 +18557,7 @@ class String # "12/13/2012".to_time # => ArgumentError: argument out of range # "1604326192".to_time # => ArgumentError: argument out of range # - # source://activesupport//lib/active_support/core_ext/string/conversions.rb#22 + # pkg:gem/activesupport#lib/active_support/core_ext/string/conversions.rb:22 def to_time(form = T.unsafe(nil)); end # Truncates a given +text+ to length truncate_to if +text+ is longer than truncate_to: @@ -18521,7 +18583,7 @@ class String # 'And they found that many people were sleeping better.'.truncate(4, omission: '... (continued)') # # => "... (continued)" # - # source://activesupport//lib/active_support/core_ext/string/filters.rb#70 + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:70 def truncate(truncate_to, options = T.unsafe(nil)); end # Truncates +text+ to at most truncate_to bytes in length without @@ -18541,7 +18603,7 @@ class String # # Raises +ArgumentError+ when the bytesize of :omission exceeds truncate_to. # - # source://activesupport//lib/active_support/core_ext/string/filters.rb#101 + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:101 def truncate_bytes(truncate_to, omission: T.unsafe(nil)); end # Truncates a given +text+ after a given number of words (words_count): @@ -18559,7 +18621,7 @@ class String # 'And they found that many people were sleeping better.'.truncate_words(5, omission: '... (continued)') # # => "And they found that many... (continued)" # - # source://activesupport//lib/active_support/core_ext/string/filters.rb#142 + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:142 def truncate_words(words_count, options = T.unsafe(nil)); end # The reverse of +camelize+. Makes an underscored, lowercase form from the expression in the string. @@ -18571,7 +18633,7 @@ class String # # See ActiveSupport::Inflector.underscore. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#139 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:139 def underscore; end # Converts the first character to uppercase. @@ -18582,72 +18644,69 @@ class String # # See ActiveSupport::Inflector.upcase_first. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#273 + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:273 def upcase_first; end end -# source://activesupport//lib/active_support/core_ext/object/blank.rb#136 +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:136 String::BLANK_RE = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/core_ext/object/blank.rb#137 +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:137 String::ENCODED_BLANKS = T.let(T.unsafe(nil), Concurrent::Map) -# source://activesupport//lib/active_support/core_ext/object/json.rb#74 +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:74 class Struct include ::Enumerable - # source://activesupport//lib/active_support/core_ext/object/json.rb#75 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:75 def as_json(options = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/object/blank.rb#123 +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:123 class Symbol include ::Comparable - # source://activesupport//lib/active_support/core_ext/object/json.rb#105 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:105 def as_json(options = T.unsafe(nil)); end - # @return [Boolean] + # A Symbol is blank if it's empty: # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#130 + # :''.blank? # => true + # :symbol.blank? # => false + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:128 + def blank?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:130 def present?; end end class Thread - # source://activesupport//lib/active_support/isolated_execution_state.rb#7 + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:7 def active_support_execution_state; end - # source://activesupport//lib/active_support/isolated_execution_state.rb#7 + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:7 def active_support_execution_state=(_arg0); end end -# source://activesupport//lib/active_support/core_ext/object/blank.rb#186 +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:186 class Time include ::Comparable include ::DateAndTime::Zones include ::DateAndTime::Calculations - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#297 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:298 def +(other); end - # Time#- can also be used to determine the number of seconds between two Time instances. - # We're layering on additional behavior so that ActiveSupport::TimeWithZone instances - # are coerced into values that Time#- will recognize - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#320 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:308 def -(other); end - # Layers additional behavior on Time#<=> so that DateTime and ActiveSupport::TimeWithZone instances - # can be chronologically compared with a Time - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#329 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:338 def <=>(other); end # Duck-types as a Time-like class. See Object#acts_like?. # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/time/acts_like.rb#7 + # pkg:gem/activesupport#lib/active_support/core_ext/time/acts_like.rb:7 def acts_like_time?; end # Uses Date to provide precise Time calculations for years, months, and days @@ -18666,80 +18725,60 @@ class Time # largest to smallest. This order can affect the result around the end of a # month. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#194 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:194 def advance(options); end # Returns a new Time representing the time a number of seconds ago, this is basically a wrapper around the Numeric extension # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#220 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:220 def ago(seconds); end - # source://activesupport//lib/active_support/core_ext/object/json.rb#201 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:201 def as_json(options = T.unsafe(nil)); end - # Returns a new Time representing the start of the day (0:00) - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#238 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:236 def at_beginning_of_day; end - # Returns a new Time representing the start of the hour (x:00) - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#267 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:263 def at_beginning_of_hour; end - # Returns a new Time representing the start of the minute (x:xx:00) - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#283 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:279 def at_beginning_of_minute; end - # Returns a new Time representing the end of the day, 23:59:59.999999 - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#256 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:257 def at_end_of_day; end - # Returns a new Time representing the end of the hour, x:59:59.999999 - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#273 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:273 def at_end_of_hour; end - # Returns a new Time representing the end of the minute, x:xx:59.999999 - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#289 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:288 def at_end_of_minute; end - # Returns a new Time representing the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#246 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:244 def at_midday; end - # Returns a new Time representing the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#246 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:246 def at_middle_of_day; end - # Returns a new Time representing the start of the day (0:00) - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#238 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:235 def at_midnight; end - # Returns a new Time representing the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#246 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:245 def at_noon; end # Returns a new Time representing the start of the day (0:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#238 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:231 def beginning_of_day; end # Returns a new Time representing the start of the hour (x:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#267 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:260 def beginning_of_hour; end # Returns a new Time representing the start of the minute (x:xx:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#283 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:276 def beginning_of_minute; end # No Time is blank: @@ -18748,7 +18787,7 @@ class Time # # @return [false] # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#192 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:192 def blank?; end # Returns a new Time where one or more of the elements have been changed according @@ -18764,134 +18803,136 @@ class Time # Time.new(2012, 8, 29, 22, 35, 0).change(year: 1981, day: 1) # => Time.new(1981, 8, 1, 22, 35, 0) # Time.new(2012, 8, 29, 22, 35, 0).change(year: 1981, hour: 0) # => Time.new(1981, 8, 29, 0, 0, 0) # - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#123 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:123 def change(options); end # Layers additional behavior on Time#<=> so that DateTime and ActiveSupport::TimeWithZone instances # can be chronologically compared with a Time # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#329 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:322 def compare_with_coercion(other); end + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:337 + def compare_without_coercion(_arg0); end + # Returns a new Time representing the end of the day, 23:59:59.999999 # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#256 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:249 def end_of_day; end # Returns a new Time representing the end of the hour, x:59:59.999999 # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#273 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:266 def end_of_hour; end # Returns a new Time representing the end of the minute, x:xx:59.999999 # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#289 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:282 def end_of_minute; end - # Layers additional behavior on Time#eql? so that ActiveSupport::TimeWithZone instances - # can be eql? to an equivalent Time - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#349 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:348 def eql?(other); end # Layers additional behavior on Time#eql? so that ActiveSupport::TimeWithZone instances # can be eql? to an equivalent Time # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#349 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:342 def eql_with_coercion(other); end + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:347 + def eql_without_coercion(_arg0); end + # Returns a formatted string of the offset from UTC, or an alternative # string if the time zone is already UTC. # # Time.local(2000).formatted_offset # => "-06:00" # Time.local(2000).formatted_offset(false) # => "-0600" # - # source://activesupport//lib/active_support/core_ext/time/conversions.rb#69 + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:69 def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end - # Returns a new Time representing the time a number of seconds since the instance time - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#225 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:228 def in(seconds); end - # Returns a new Time representing the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#246 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:242 def midday; end # Returns a new Time representing the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#246 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:239 def middle_of_day; end - # Returns a new Time representing the start of the day (0:00) - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#238 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:234 def midnight; end # Time#- can also be used to determine the number of seconds between two Time instances. # We're layering on additional behavior so that ActiveSupport::TimeWithZone instances # are coerced into values that Time#- will recognize # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#320 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:313 def minus_with_coercion(other); end - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#307 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:300 def minus_with_duration(other); end - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#307 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:317 def minus_without_coercion(other); end + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:307 + def minus_without_duration(_arg0); end + # Returns a new time the specified number of days in the future. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#363 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:356 def next_day(days = T.unsafe(nil)); end # Returns a new time the specified number of months in the future. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#373 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:366 def next_month(months = T.unsafe(nil)); end # Returns a new time the specified number of years in the future. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#383 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:376 def next_year(years = T.unsafe(nil)); end - # Returns a new Time representing the middle of the day (12:00) - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#246 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:243 def noon; end - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#297 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:290 def plus_with_duration(other); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#196 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:297 + def plus_without_duration(_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:196 def present?; end # Returns a new time the specified number of days ago. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#358 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:351 def prev_day(days = T.unsafe(nil)); end # Returns a new time the specified number of months ago. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#368 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:361 def prev_month(months = T.unsafe(nil)); end # Returns a new time the specified number of years ago. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#378 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:371 def prev_year(years = T.unsafe(nil)); end + # Aliased to +xmlschema+ for compatibility with +DateTime+ + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:74 + def rfc3339(*_arg0); end + # Returns the fraction of a second as a +Rational+ # # Time.new(2012, 8, 29, 0, 0, 0.5).sec_fraction # => (1/2) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#107 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:107 def sec_fraction; end # Returns the number of seconds since 00:00:00. @@ -18900,7 +18941,7 @@ class Time # Time.new(2012, 8, 29, 12, 34, 56).seconds_since_midnight # => 45296.0 # Time.new(2012, 8, 29, 23, 59, 59).seconds_since_midnight # => 86399.0 # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#91 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:91 def seconds_since_midnight; end # Returns the number of seconds until 23:59:59. @@ -18909,42 +18950,15 @@ class Time # Time.new(2012, 8, 29, 12, 34, 56).seconds_until_end_of_day # => 41103 # Time.new(2012, 8, 29, 23, 59, 59).seconds_until_end_of_day # => 0 # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#100 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:100 def seconds_until_end_of_day; end # Returns a new Time representing the time a number of seconds since the instance time # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#225 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:225 def since(seconds); end - # Converts to a formatted string. See DATE_FORMATS for built-in formats. - # - # This method is aliased to to_formatted_s. - # - # time = Time.now # => 2007-01-18 06:10:17 -06:00 - # - # time.to_fs(:time) # => "06:10" - # time.to_formatted_s(:time) # => "06:10" - # - # time.to_fs(:db) # => "2007-01-18 06:10:17" - # time.to_fs(:number) # => "20070118061017" - # time.to_fs(:short) # => "18 Jan 06:10" - # time.to_fs(:long) # => "January 18, 2007 06:10" - # time.to_fs(:long_ordinal) # => "January 18th, 2007 06:10" - # time.to_fs(:rfc822) # => "Thu, 18 Jan 2007 06:10:17 -0600" - # time.to_fs(:rfc2822) # => "Thu, 18 Jan 2007 06:10:17 -0600" - # time.to_fs(:iso8601) # => "2007-01-18T06:10:17-06:00" - # - # == Adding your own time formats to +to_fs+ - # You can add your own formats to the Time::DATE_FORMATS hash. - # Use the format name as the hash key and either a strftime string - # or Proc instance that takes a time argument as the value. - # - # # config/initializers/time_formats.rb - # Time::DATE_FORMATS[:month_and_year] = '%B %Y' - # Time::DATE_FORMATS[:short_ordinal] = ->(time) { time.strftime("%B #{time.day.ordinalize}") } - # - # source://activesupport//lib/active_support/core_ext/time/conversions.rb#55 + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:62 def to_formatted_s(format = T.unsafe(nil)); end # Converts to a formatted string. See DATE_FORMATS for built-in formats. @@ -18974,42 +18988,42 @@ class Time # Time::DATE_FORMATS[:month_and_year] = '%B %Y' # Time::DATE_FORMATS[:short_ordinal] = ->(time) { time.strftime("%B #{time.day.ordinalize}") } # - # source://activesupport//lib/active_support/core_ext/time/conversions.rb#55 + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:55 def to_fs(format = T.unsafe(nil)); end class << self # Overriding case equality method so that it returns true for ActiveSupport::TimeWithZone instances # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#18 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:18 def ===(other); end - # Layers additional behavior on Time.at so that ActiveSupport::TimeWithZone and DateTime - # instances can be used when called with a single argument - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#45 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:60 def at(time_or_number, *args, **_arg2); end # Layers additional behavior on Time.at so that ActiveSupport::TimeWithZone and DateTime # instances can be used when called with a single argument # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#45 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:45 def at_with_coercion(time_or_number, *args, **_arg2); end + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:59 + def at_without_coercion(time, subsec = T.unsafe(nil), unit = T.unsafe(nil), in: T.unsafe(nil)); end + # Returns Time.zone.now when Time.zone or config.time_zone are set, otherwise just returns Time.now. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#39 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:39 def current; end # Returns the number of days in the given month. # If no year is specified, it will use the current year. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#24 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:24 def days_in_month(month, year = T.unsafe(nil)); end # Returns the number of days in the given year. # If no year is specified, it will use the current year. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#34 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:34 def days_in_year(year = T.unsafe(nil)); end # Returns a TimeZone instance matching the time zone provided. @@ -19019,7 +19033,7 @@ class Time # Time.find_zone "America/New_York" # => # # Time.find_zone "NOT-A-TIMEZONE" # => nil # - # source://activesupport//lib/active_support/core_ext/time/zones.rb#93 + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:93 def find_zone(time_zone); end # Returns a TimeZone instance matching the time zone provided. @@ -19033,7 +19047,7 @@ class Time # Time.find_zone! false # => false # Time.find_zone! "NOT-A-TIMEZONE" # => ArgumentError: Invalid Timezone: NOT-A-TIMEZONE # - # source://activesupport//lib/active_support/core_ext/time/zones.rb#81 + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:81 def find_zone!(time_zone); end # Creates a +Time+ instance from an RFC 3339 string. @@ -19044,9 +19058,7 @@ class Time # # Time.rfc3339('1999-12-31') # => ArgumentError: invalid date # - # @raise [ArgumentError] - # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#69 + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:69 def rfc3339(str); end # Allows override of Time.zone locally inside supplied block; @@ -19066,13 +19078,13 @@ class Time # attributes that have been read before the block will remain in # the application's default timezone. # - # source://activesupport//lib/active_support/core_ext/time/zones.rb#61 + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:61 def use_zone(time_zone); end # Returns the TimeZone for the current request, if this has been set (via Time.zone=). # If Time.zone has not been set for the current request, returns the TimeZone specified in config.time_zone. # - # source://activesupport//lib/active_support/core_ext/time/zones.rb#14 + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:14 def zone; end # Sets Time.zone to a TimeZone object for the current request/thread. @@ -19099,32 +19111,26 @@ class Time # end # end # - # source://activesupport//lib/active_support/core_ext/time/zones.rb#41 + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:41 def zone=(time_zone); end - # Returns the value of attribute zone_default. - # - # source://activesupport//lib/active_support/core_ext/time/zones.rb#10 + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:10 def zone_default; end - # Sets the attribute zone_default - # - # @param value the value to set the attribute zone_default to. - # - # source://activesupport//lib/active_support/core_ext/time/zones.rb#10 + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:10 def zone_default=(_arg0); end end end -# source://activesupport//lib/active_support/core_ext/time/calculations.rb#14 +# pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:14 Time::COMMON_YEAR_DAYS_IN_MONTH = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/core_ext/time/conversions.rb#8 +# pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:8 Time::DATE_FORMATS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/core_ext/object/blank.rb#80 +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:80 class TrueClass - # source://activesupport//lib/active_support/core_ext/object/json.rb#81 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:81 def as_json(options = T.unsafe(nil)); end # +true+ is not blank: @@ -19133,22 +19139,20 @@ class TrueClass # # @return [false] # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#86 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:86 def blank?; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#90 + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:90 def present?; end # Returns +self+. # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#28 + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:33 def to_param; end end -# source://activesupport//lib/active_support/core_ext/object/json.rb#230 +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:230 class URI::Generic - # source://activesupport//lib/active_support/core_ext/object/json.rb#231 + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:231 def as_json(options = T.unsafe(nil)); end end diff --git a/sorbet/rbi/gems/benchmark@0.4.1.rbi b/sorbet/rbi/gems/benchmark@0.5.0.rbi similarity index 88% rename from sorbet/rbi/gems/benchmark@0.4.1.rbi rename to sorbet/rbi/gems/benchmark@0.5.0.rbi index 467f27b..1c75f8e 100644 --- a/sorbet/rbi/gems/benchmark@0.4.1.rbi +++ b/sorbet/rbi/gems/benchmark@0.5.0.rbi @@ -109,7 +109,7 @@ # >total: 2.880000 0.000000 2.880000 ( 2.883764) # >avg: 0.960000 0.000000 0.960000 ( 0.961255) # -# source://benchmark//lib/benchmark.rb#123 +# pkg:gem/benchmark#lib/benchmark.rb:123 module Benchmark private @@ -154,7 +154,7 @@ module Benchmark # >total: 2.930000 0.000000 2.930000 ( 2.932889) # >avg: 0.976667 0.000000 0.976667 ( 0.977630) # - # source://benchmark//lib/benchmark.rb#171 + # pkg:gem/benchmark#lib/benchmark.rb:171 def benchmark(caption = T.unsafe(nil), label_width = T.unsafe(nil), format = T.unsafe(nil), *labels); end # A simple interface to the #benchmark method, #bm generates sequential @@ -177,7 +177,7 @@ module Benchmark # times: 0.960000 0.000000 0.960000 ( 0.960423) # upto: 0.950000 0.000000 0.950000 ( 0.954864) # - # source://benchmark//lib/benchmark.rb#216 + # pkg:gem/benchmark#lib/benchmark.rb:216 def bm(label_width = T.unsafe(nil), *labels, &blk); end # Sometimes benchmark results are skewed because code executed @@ -217,7 +217,7 @@ module Benchmark # #bmbm yields a Benchmark::Job object and returns an array of # Benchmark::Tms objects. # - # source://benchmark//lib/benchmark.rb#258 + # pkg:gem/benchmark#lib/benchmark.rb:258 def bmbm(width = T.unsafe(nil)); end # Returns the time used to execute the given block as a @@ -236,16 +236,25 @@ module Benchmark # # 0.220000 0.000000 0.220000 ( 0.227313) # - # source://benchmark//lib/benchmark.rb#303 + # pkg:gem/benchmark#lib/benchmark.rb:303 def measure(label = T.unsafe(nil)); end + # Returns the elapsed real time used to execute the given block. + # The unit of time is milliseconds. + # + # Benchmark.ms { "a" * 1_000_000_000 } + # #=> 509.8029999935534 + # + # pkg:gem/benchmark#lib/benchmark.rb:335 + def ms; end + # Returns the elapsed real time used to execute the given block. # The unit of time is seconds. # # Benchmark.realtime { "a" * 1_000_000_000 } # #=> 0.5098029999935534 # - # source://benchmark//lib/benchmark.rb#322 + # pkg:gem/benchmark#lib/benchmark.rb:322 def realtime; end class << self @@ -290,7 +299,7 @@ module Benchmark # >total: 2.930000 0.000000 2.930000 ( 2.932889) # >avg: 0.976667 0.000000 0.976667 ( 0.977630) # - # source://benchmark//lib/benchmark.rb#171 + # pkg:gem/benchmark#lib/benchmark.rb:341 def benchmark(caption = T.unsafe(nil), label_width = T.unsafe(nil), format = T.unsafe(nil), *labels); end # A simple interface to the #benchmark method, #bm generates sequential @@ -313,7 +322,7 @@ module Benchmark # times: 0.960000 0.000000 0.960000 ( 0.960423) # upto: 0.950000 0.000000 0.950000 ( 0.954864) # - # source://benchmark//lib/benchmark.rb#216 + # pkg:gem/benchmark#lib/benchmark.rb:341 def bm(label_width = T.unsafe(nil), *labels, &blk); end # Sometimes benchmark results are skewed because code executed @@ -353,7 +362,7 @@ module Benchmark # #bmbm yields a Benchmark::Job object and returns an array of # Benchmark::Tms objects. # - # source://benchmark//lib/benchmark.rb#258 + # pkg:gem/benchmark#lib/benchmark.rb:341 def bmbm(width = T.unsafe(nil)); end # Returns the time used to execute the given block as a @@ -372,16 +381,25 @@ module Benchmark # # 0.220000 0.000000 0.220000 ( 0.227313) # - # source://benchmark//lib/benchmark.rb#303 + # pkg:gem/benchmark#lib/benchmark.rb:341 def measure(label = T.unsafe(nil)); end + # Returns the elapsed real time used to execute the given block. + # The unit of time is milliseconds. + # + # Benchmark.ms { "a" * 1_000_000_000 } + # #=> 509.8029999935534 + # + # pkg:gem/benchmark#lib/benchmark.rb:341 + def ms; end + # Returns the elapsed real time used to execute the given block. # The unit of time is seconds. # # Benchmark.realtime { "a" * 1_000_000_000 } # #=> 0.5098029999935534 # - # source://benchmark//lib/benchmark.rb#322 + # pkg:gem/benchmark#lib/benchmark.rb:341 def realtime; end end end @@ -389,7 +407,7 @@ end # A Job is a sequence of labelled blocks to be processed by the # Benchmark.bmbm method. It is of little direct interest to the user. # -# source://benchmark//lib/benchmark.rb#334 +# pkg:gem/benchmark#lib/benchmark.rb:347 class Benchmark::Job # Returns an initialized Job instance. # Usually, one doesn't call this method directly, as new @@ -397,40 +415,32 @@ class Benchmark::Job # +width+ is a initial value for the label offset used in formatting; # the #bmbm method passes its +width+ argument to this constructor. # - # @return [Job] a new instance of Job - # - # source://benchmark//lib/benchmark.rb#342 + # pkg:gem/benchmark#lib/benchmark.rb:355 def initialize(width); end # Registers the given label and block pair in the job list. # - # @raise [ArgumentError] - # - # source://benchmark//lib/benchmark.rb#350 + # pkg:gem/benchmark#lib/benchmark.rb:363 def item(label = T.unsafe(nil), &blk); end # An array of 2-element arrays, consisting of label and block pairs. # - # source://benchmark//lib/benchmark.rb#362 + # pkg:gem/benchmark#lib/benchmark.rb:375 def list; end - # Registers the given label and block pair in the job list. - # - # @raise [ArgumentError] - # - # source://benchmark//lib/benchmark.rb#350 + # pkg:gem/benchmark#lib/benchmark.rb:372 def report(label = T.unsafe(nil), &blk); end # Length of the widest label in the #list. # - # source://benchmark//lib/benchmark.rb#365 + # pkg:gem/benchmark#lib/benchmark.rb:378 def width; end end # This class is used by the Benchmark.benchmark and Benchmark.bm methods. # It is of little direct interest to the user. # -# source://benchmark//lib/benchmark.rb#372 +# pkg:gem/benchmark#lib/benchmark.rb:385 class Benchmark::Report # Returns an initialized Report instance. # Usually, one doesn't call this method directly, as new @@ -438,60 +448,52 @@ class Benchmark::Report # +width+ and +format+ are the label offset and # format string used by Tms#format. # - # @return [Report] a new instance of Report - # - # source://benchmark//lib/benchmark.rb#380 + # pkg:gem/benchmark#lib/benchmark.rb:393 def initialize(width = T.unsafe(nil), format = T.unsafe(nil)); end # An array of Benchmark::Tms objects representing each item. # - # source://benchmark//lib/benchmark.rb#399 + # pkg:gem/benchmark#lib/benchmark.rb:412 def format; end # Prints the +label+ and measured time for the block, # formatted by +format+. See Tms#format for the # formatting rules. # - # source://benchmark//lib/benchmark.rb#389 + # pkg:gem/benchmark#lib/benchmark.rb:402 def item(label = T.unsafe(nil), *format, &blk); end # An array of Benchmark::Tms objects representing each item. # - # source://benchmark//lib/benchmark.rb#399 + # pkg:gem/benchmark#lib/benchmark.rb:412 def list; end - # Prints the +label+ and measured time for the block, - # formatted by +format+. See Tms#format for the - # formatting rules. - # - # source://benchmark//lib/benchmark.rb#389 + # pkg:gem/benchmark#lib/benchmark.rb:409 def report(label = T.unsafe(nil), *format, &blk); end # An array of Benchmark::Tms objects representing each item. # - # source://benchmark//lib/benchmark.rb#399 + # pkg:gem/benchmark#lib/benchmark.rb:412 def width; end end # A data object, representing the times associated with a benchmark # measurement. # -# source://benchmark//lib/benchmark.rb#408 +# pkg:gem/benchmark#lib/benchmark.rb:421 class Benchmark::Tms # Returns an initialized Tms object which has # +utime+ as the user CPU time, +stime+ as the system CPU time, # +cutime+ as the children's user CPU time, +cstime+ as the children's # system CPU time, +real+ as the elapsed real time and +label+ as the label. # - # @return [Tms] a new instance of Tms - # - # source://benchmark//lib/benchmark.rb#443 + # pkg:gem/benchmark#lib/benchmark.rb:456 def initialize(utime = T.unsafe(nil), stime = T.unsafe(nil), cutime = T.unsafe(nil), cstime = T.unsafe(nil), real = T.unsafe(nil), label = T.unsafe(nil)); end # Returns a new Tms object obtained by memberwise multiplication # of the individual times for this Tms object by +x+. # - # source://benchmark//lib/benchmark.rb#491 + # pkg:gem/benchmark#lib/benchmark.rb:504 def *(x); end # Returns a new Tms object obtained by memberwise summation @@ -499,27 +501,27 @@ class Benchmark::Tms # Tms object. # This method and #/() are useful for taking statistics. # - # source://benchmark//lib/benchmark.rb#478 + # pkg:gem/benchmark#lib/benchmark.rb:491 def +(other); end # Returns a new Tms object obtained by memberwise subtraction # of the individual times for the +other+ Tms object from those of this # Tms object. # - # source://benchmark//lib/benchmark.rb#485 + # pkg:gem/benchmark#lib/benchmark.rb:498 def -(other); end # Returns a new Tms object obtained by memberwise division # of the individual times for this Tms object by +x+. # This method and #+() are useful for taking statistics. # - # source://benchmark//lib/benchmark.rb#498 + # pkg:gem/benchmark#lib/benchmark.rb:511 def /(x); end # Returns a new Tms object whose times are the sum of the times for this # Tms object, plus the time required to execute the code block (+blk+). # - # source://benchmark//lib/benchmark.rb#452 + # pkg:gem/benchmark#lib/benchmark.rb:465 def add(&blk); end # An in-place version of #add. @@ -527,17 +529,17 @@ class Benchmark::Tms # for this Tms object, plus the time required to execute # the code block (+blk+). # - # source://benchmark//lib/benchmark.rb#462 + # pkg:gem/benchmark#lib/benchmark.rb:475 def add!(&blk); end # System CPU time of children # - # source://benchmark//lib/benchmark.rb#426 + # pkg:gem/benchmark#lib/benchmark.rb:439 def cstime; end # User CPU time of children # - # source://benchmark//lib/benchmark.rb#423 + # pkg:gem/benchmark#lib/benchmark.rb:436 def cutime; end # Returns the contents of this Tms object as @@ -556,22 +558,22 @@ class Benchmark::Tms # If +format+ is not given, FORMAT is used as default value, detailing the # user, system, total and real elapsed time. # - # source://benchmark//lib/benchmark.rb#517 + # pkg:gem/benchmark#lib/benchmark.rb:530 def format(format = T.unsafe(nil), *args); end # Label # - # source://benchmark//lib/benchmark.rb#435 + # pkg:gem/benchmark#lib/benchmark.rb:448 def label; end # Elapsed real time # - # source://benchmark//lib/benchmark.rb#429 + # pkg:gem/benchmark#lib/benchmark.rb:442 def real; end # System CPU time # - # source://benchmark//lib/benchmark.rb#420 + # pkg:gem/benchmark#lib/benchmark.rb:433 def stime; end # Returns a new 6-element array, consisting of the @@ -579,27 +581,27 @@ class Benchmark::Tms # user CPU time, children's system CPU time and elapsed # real time. # - # source://benchmark//lib/benchmark.rb#542 + # pkg:gem/benchmark#lib/benchmark.rb:555 def to_a; end # Returns a hash containing the same data as `to_a`. # - # source://benchmark//lib/benchmark.rb#549 + # pkg:gem/benchmark#lib/benchmark.rb:562 def to_h; end # Same as #format. # - # source://benchmark//lib/benchmark.rb#532 + # pkg:gem/benchmark#lib/benchmark.rb:545 def to_s; end # Total time, that is +utime+ + +stime+ + +cutime+ + +cstime+ # - # source://benchmark//lib/benchmark.rb#432 + # pkg:gem/benchmark#lib/benchmark.rb:445 def total; end # User CPU time # - # source://benchmark//lib/benchmark.rb#417 + # pkg:gem/benchmark#lib/benchmark.rb:430 def utime; end protected @@ -611,9 +613,9 @@ class Benchmark::Tms # +op+ can be a mathematical operation such as +, -, # *, / # - # source://benchmark//lib/benchmark.rb#570 + # pkg:gem/benchmark#lib/benchmark.rb:583 def memberwise(op, x); end end -# source://benchmark//lib/benchmark.rb#125 +# pkg:gem/benchmark#lib/benchmark.rb:125 Benchmark::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/booleans@0.1.1.rbi b/sorbet/rbi/gems/booleans@0.1.1.rbi deleted file mode 100644 index 6f865cb..0000000 --- a/sorbet/rbi/gems/booleans@0.1.1.rbi +++ /dev/null @@ -1,24 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `booleans` gem. -# Please instead update this file by running `bin/tapioca gem booleans`. - - -# source://booleans//lib/booleans/version.rb#3 -module Booleans; end - -# @return [String] -# -# source://booleans//lib/booleans/version.rb#5 -Booleans::VERSION = T.let(T.unsafe(nil), String) - -class Object < ::BasicObject - include ::Kernel - include ::PP::ObjectMixin - - private - - # source://booleans//lib/booleans.rb#12 - def Boolean(val); end -end diff --git a/sorbet/rbi/gems/booleans@0.1.3.rbi b/sorbet/rbi/gems/booleans@0.1.3.rbi new file mode 100644 index 0000000..15452c2 --- /dev/null +++ b/sorbet/rbi/gems/booleans@0.1.3.rbi @@ -0,0 +1,31 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `booleans` gem. +# Please instead update this file by running `bin/tapioca gem booleans`. + + +# pkg:gem/booleans#lib/booleans/version.rb:3 +module Booleans; end + +# Add the Boolean method to Kernel +# +# pkg:gem/booleans#lib/booleans/kernel_extension.rb:6 +module Booleans::KernelExtension + # Convert a Ruby value to `true` or `false` + # according to the truthiness of the value. + # + # Most Ruby objects get converted to `true` with the + # exception of: `nil` and `false`. + # + # pkg:gem/booleans#lib/booleans/kernel_extension.rb:15 + sig { params(val: T.anything).returns(T::Boolean) } + def Boolean(val); end +end + +# pkg:gem/booleans#lib/booleans/version.rb:4 +Booleans::VERSION = T.let(T.unsafe(nil), String) + +module Kernel + include ::Booleans::KernelExtension +end diff --git a/sorbet/rbi/gems/byebug@11.1.3.rbi b/sorbet/rbi/gems/byebug@13.0.0.rbi similarity index 100% rename from sorbet/rbi/gems/byebug@11.1.3.rbi rename to sorbet/rbi/gems/byebug@13.0.0.rbi diff --git a/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi b/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi deleted file mode 100644 index 6fea642..0000000 --- a/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi +++ /dev/null @@ -1,11657 +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`. - - -# {include:file:README.md} -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/version.rb#1 -module Concurrent - extend ::Concurrent::Utility::EngineDetector - extend ::Concurrent::Utility::NativeExtensionLoader - extend ::Concurrent::Concern::Logging - extend ::Concurrent::Concern::Deprecation - - private - - # Abort a currently running transaction - see `Concurrent::atomically`. - # - # @raise [Transaction::AbortError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#139 - def abort_transaction; end - - # Run a block that reads and writes `TVar`s as a single atomic transaction. - # With respect to the value of `TVar` objects, the transaction is atomic, in - # that it either happens or it does not, consistent, in that the `TVar` - # objects involved will never enter an illegal state, and isolated, in that - # transactions never interfere with each other. You may recognise these - # properties from database transactions. - # - # There are some very important and unusual semantics that you must be aware of: - # - # * Most importantly, the block that you pass to atomically may be executed - # more than once. In most cases your code should be free of - # side-effects, except for via TVar. - # - # * If an exception escapes an atomically block it will abort the transaction. - # - # * It is undefined behaviour to use callcc or Fiber with atomically. - # - # * If you create a new thread within an atomically, it will not be part of - # the transaction. Creating a thread counts as a side-effect. - # - # Transactions within transactions are flattened to a single transaction. - # - # @example - # a = new TVar(100_000) - # b = new TVar(100) - # - # Concurrent::atomically do - # a.value -= 10 - # b.value += 10 - # end - # @raise [ArgumentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#82 - def atomically; end - - # @raise [ArgumentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#56 - def call_dataflow(method, executor, *inputs, &block); end - - # Dataflow allows you to create a task that will be scheduled when all of its data dependencies are available. - # {include:file:docs-source/dataflow.md} - # - # @param inputs [Future] zero or more `Future` operations that this dataflow depends upon - # @raise [ArgumentError] if no block is given - # @raise [ArgumentError] if any of the inputs are not `IVar`s - # @return [Object] the result of all the operations - # @yield The operation to perform once all the dependencies are met - # @yieldparam inputs [Future] each of the `Future` inputs to the dataflow - # @yieldreturn [Object] the result of the block operation - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#34 - def dataflow(*inputs, &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#44 - def dataflow!(*inputs, &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#39 - def dataflow_with(executor, *inputs, &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#49 - def dataflow_with!(executor, *inputs, &block); end - - # Leave a transaction without committing or aborting - see `Concurrent::atomically`. - # - # @raise [Transaction::LeaveError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#144 - def leave_transaction; end - - # Returns the current time as tracked by the application monotonic clock. - # - # @param unit [Symbol] the time unit to be returned, can be either - # :float_second, :float_millisecond, :float_microsecond, :second, - # :millisecond, :microsecond, or :nanosecond default to :float_second. - # @return [Float] The current monotonic time since some unspecified - # starting point - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/monotonic_time.rb#15 - def monotonic_time(unit = T.unsafe(nil)); end - - class << self - # Abort a currently running transaction - see `Concurrent::atomically`. - # - # @raise [Transaction::AbortError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#139 - def abort_transaction; end - - # Run a block that reads and writes `TVar`s as a single atomic transaction. - # With respect to the value of `TVar` objects, the transaction is atomic, in - # that it either happens or it does not, consistent, in that the `TVar` - # objects involved will never enter an illegal state, and isolated, in that - # transactions never interfere with each other. You may recognise these - # properties from database transactions. - # - # There are some very important and unusual semantics that you must be aware of: - # - # * Most importantly, the block that you pass to atomically may be executed - # more than once. In most cases your code should be free of - # side-effects, except for via TVar. - # - # * If an exception escapes an atomically block it will abort the transaction. - # - # * It is undefined behaviour to use callcc or Fiber with atomically. - # - # * If you create a new thread within an atomically, it will not be part of - # the transaction. Creating a thread counts as a side-effect. - # - # Transactions within transactions are flattened to a single transaction. - # - # @example - # a = new TVar(100_000) - # b = new TVar(100) - # - # Concurrent::atomically do - # a.value -= 10 - # b.value += 10 - # end - # @raise [ArgumentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#82 - def atomically; end - - # Number of processors cores available for process scheduling. - # This method takes in account the CPU quota if the process is inside a cgroup with a - # dedicated CPU quota (typically Docker). - # Otherwise it returns the same value as #processor_count but as a Float. - # - # For performance reasons the calculated value will be memoized on the first - # call. - # - # @return [Float] number of available processors - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#194 - def available_processor_count; end - - # @raise [ArgumentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#56 - def call_dataflow(method, executor, *inputs, &block); end - - # The maximum number of processors cores available for process scheduling. - # Returns `nil` if there is no enforced limit, or a `Float` if the - # process is inside a cgroup with a dedicated CPU quota (typically Docker). - # - # Note that nothing prevents setting a CPU quota higher than the actual number of - # cores on the system. - # - # For performance reasons the calculated value will be memoized on the first - # call. - # - # @return [nil, Float] Maximum number of available processors as set by a cgroup CPU quota, or nil if none set - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#209 - def cpu_quota; end - - # The CPU shares requested by the process. For performance reasons the calculated - # value will be memoized on the first call. - # - # @return [Float, nil] CPU shares requested by the process, or nil if not set - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#217 - def cpu_shares; end - - # Create a simple logger with provided level and output. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#38 - def create_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end - - # Create a stdlib logger with provided level and output. - # If you use this deprecated method you might need to add logger to your Gemfile to avoid warnings from Ruby 3.3.5+. - # - # @deprecated - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#73 - def create_stdlib_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end - - # Dataflow allows you to create a task that will be scheduled when all of its data dependencies are available. - # {include:file:docs-source/dataflow.md} - # - # @param inputs [Future] zero or more `Future` operations that this dataflow depends upon - # @raise [ArgumentError] if no block is given - # @raise [ArgumentError] if any of the inputs are not `IVar`s - # @return [Object] the result of all the operations - # @yield The operation to perform once all the dependencies are met - # @yieldparam inputs [Future] each of the `Future` inputs to the dataflow - # @yieldreturn [Object] the result of the block operation - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#34 - def dataflow(*inputs, &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#44 - def dataflow!(*inputs, &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#39 - def dataflow_with(executor, *inputs, &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#49 - def dataflow_with!(executor, *inputs, &block); end - - # Disables AtExit handlers including pool auto-termination handlers. - # When disabled it will be the application programmer's responsibility - # to ensure that the handlers are shutdown properly prior to application - # exit by calling `AtExit.run` method. - # - # @deprecated Has no effect since it is no longer needed, see https://github.com/ruby-concurrency/concurrent-ruby/pull/841. - # @note this option should be needed only because of `at_exit` ordering - # issues which may arise when running some of the testing frameworks. - # E.g. Minitest's test-suite runs itself in `at_exit` callback which - # executes after the pools are already terminated. Then auto termination - # needs to be disabled and called manually after test-suite ends. - # @note This method should *never* be called - # from within a gem. It should *only* be used from within the main - # application and even then it should be used only when necessary. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#48 - def disable_at_exit_handlers!; end - - # General access point to global executors. - # - # @param executor_identifier [Symbol, Executor] symbols: - # - :fast - {Concurrent.global_fast_executor} - # - :io - {Concurrent.global_io_executor} - # - :immediate - {Concurrent.global_immediate_executor} - # @return [Executor] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#83 - def executor(executor_identifier); end - - # Global thread pool optimized for short, fast *operations*. - # - # @return [ThreadPoolExecutor] the thread pool - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#55 - def global_fast_executor; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#66 - def global_immediate_executor; end - - # Global thread pool optimized for long, blocking (IO) *tasks*. - # - # @return [ThreadPoolExecutor] the thread pool - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#62 - def global_io_executor; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#114 - def global_logger; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#118 - def global_logger=(value); end - - # Global thread pool user for global *timers*. - # - # @return [Concurrent::TimerSet] the thread pool - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#73 - def global_timer_set; end - - # Leave a transaction without committing or aborting - see `Concurrent::atomically`. - # - # @raise [Transaction::LeaveError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#144 - def leave_transaction; end - - # Returns the current time as tracked by the application monotonic clock. - # - # @param unit [Symbol] the time unit to be returned, can be either - # :float_second, :float_millisecond, :float_microsecond, :second, - # :millisecond, :microsecond, or :nanosecond default to :float_second. - # @return [Float] The current monotonic time since some unspecified - # starting point - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/monotonic_time.rb#15 - def monotonic_time(unit = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb#7 - def mutex_owned_per_thread?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#87 - def new_fast_executor(opts = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#98 - def new_io_executor(opts = T.unsafe(nil)); end - - # Number of physical processor cores on the current system. For performance - # reasons the calculated value will be memoized on the first call. - # - # On Windows the Win32 API will be queried for the `NumberOfCores from - # Win32_Processor`. This will return the total number "of cores for the - # current instance of the processor." On Unix-like operating systems either - # the `hwprefs` or `sysctl` utility will be called in a subshell and the - # returned value will be used. In the rare case where none of these methods - # work or an exception is raised the function will simply return 1. - # - # @return [Integer] number physical processor cores on the current system - # @see https://github.com/grosser/parallel/blob/4fc8b89d08c7091fe0419ca8fba1ec3ce5a8d185/lib/parallel.rb - # @see http://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx - # @see http://www.unix.com/man-page/osx/1/HWPREFS/ - # @see http://linux.die.net/man/8/sysctl - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#181 - def physical_processor_count; end - - # Number of processors seen by the OS and used for process scheduling. For - # performance reasons the calculated value will be memoized on the first - # call. - # - # When running under JRuby the Java runtime call - # `java.lang.Runtime.getRuntime.availableProcessors` will be used. According - # to the Java documentation this "value may change during a particular - # invocation of the virtual machine... [applications] should therefore - # occasionally poll this property." We still memoize this value once under - # JRuby. - # - # Otherwise Ruby's Etc.nprocessors will be used. - # - # @return [Integer] number of processors seen by the OS or Java runtime - # @see http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#availableProcessors() - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#160 - def processor_count; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#142 - def processor_counter; end - - # Use logger created by #create_simple_logger to log concurrent-ruby messages. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#66 - def use_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end - - # Use logger created by #create_stdlib_logger to log concurrent-ruby messages. - # - # @deprecated - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#101 - def use_stdlib_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#38 -class Concurrent::AbstractExchanger < ::Concurrent::Synchronization::Object - # @return [AbstractExchanger] a new instance of AbstractExchanger - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#44 - def initialize; end - - # Waits for another thread to arrive at this exchange point (unless the - # current thread is interrupted), and then transfers the given object to - # it, receiving its object in return. The timeout value indicates the - # approximate number of seconds the method should block while waiting - # for the exchange. When the timeout value is `nil` the method will - # block indefinitely. - # - # - # In some edge cases when a `timeout` is given a return value of `nil` may be - # ambiguous. Specifically, if `nil` is a valid value in the exchange it will - # be impossible to tell whether `nil` is the actual return value or if it - # signifies timeout. When `nil` is a valid value in the exchange consider - # using {#exchange!} or {#try_exchange} instead. - # - # @param value [Object] the value to exchange with another thread - # @param timeout [Numeric, nil] in seconds, `nil` blocks indefinitely - # @return [Object] the value exchanged by the other thread or `nil` on timeout - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#69 - def exchange(value, timeout = T.unsafe(nil)); end - - # Waits for another thread to arrive at this exchange point (unless the - # current thread is interrupted), and then transfers the given object to - # it, receiving its object in return. The timeout value indicates the - # approximate number of seconds the method should block while waiting - # for the exchange. When the timeout value is `nil` the method will - # block indefinitely. - # - # - # On timeout a {Concurrent::TimeoutError} exception will be raised. - # - # @param value [Object] the value to exchange with another thread - # @param timeout [Numeric, nil] in seconds, `nil` blocks indefinitely - # @raise [Concurrent::TimeoutError] on timeout - # @return [Object] the value exchanged by the other thread - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#80 - def exchange!(value, timeout = T.unsafe(nil)); end - - # Waits for another thread to arrive at this exchange point (unless the - # current thread is interrupted), and then transfers the given object to - # it, receiving its object in return. The timeout value indicates the - # approximate number of seconds the method should block while waiting - # for the exchange. When the timeout value is `nil` the method will - # block indefinitely. - # - # - # The return value will be a {Concurrent::Maybe} set to `Just` on success or - # `Nothing` on timeout. - # - # @example - # - # exchanger = Concurrent::Exchanger.new - # - # result = exchanger.exchange(:foo, 0.5) - # - # if result.just? - # puts result.value #=> :bar - # else - # puts 'timeout' - # end - # @param value [Object] the value to exchange with another thread - # @param timeout [Numeric, nil] in seconds, `nil` blocks indefinitely - # @return [Concurrent::Maybe] on success a `Just` maybe will be returned with - # the item exchanged by the other thread as `#value`; on timeout a - # `Nothing` maybe will be returned with {Concurrent::TimeoutError} as `#reason` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#109 - def try_exchange(value, timeout = T.unsafe(nil)); end - - private - - # Waits for another thread to arrive at this exchange point (unless the - # current thread is interrupted), and then transfers the given object to - # it, receiving its object in return. The timeout value indicates the - # approximate number of seconds the method should block while waiting - # for the exchange. When the timeout value is `nil` the method will - # block indefinitely. - # - # @param value [Object] the value to exchange with another thread - # @param timeout [Numeric, nil] in seconds, `nil` blocks indefinitely - # @raise [NotImplementedError] - # @return [Object, CANCEL] the value exchanged by the other thread; {CANCEL} on timeout - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#122 - def do_exchange(value, timeout); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#41 -Concurrent::AbstractExchanger::CANCEL = T.let(T.unsafe(nil), Object) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#10 -class Concurrent::AbstractExecutorService < ::Concurrent::Synchronization::LockableObject - include ::Concurrent::Concern::Logging - include ::Concurrent::ExecutorService - include ::Concurrent::Concern::Deprecation - - # Create a new thread pool. - # - # @return [AbstractExecutorService] a new instance of AbstractExecutorService - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#23 - def initialize(opts = T.unsafe(nil), &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#72 - def auto_terminate=(value); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#67 - def auto_terminate?; end - - # Returns the value of attribute fallback_policy. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#18 - def fallback_policy; end - - # @raise [NotImplementedError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#42 - def kill; end - - # Returns the value of attribute name. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#20 - def name; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#52 - def running?; end - - # @raise [NotImplementedError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#37 - def shutdown; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#62 - def shutdown?; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#57 - def shuttingdown?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#32 - def to_s; end - - # @raise [NotImplementedError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#47 - def wait_for_termination(timeout = T.unsafe(nil)); end - - private - - # Returns an action which executes the `fallback_policy` once the queue - # size reaches `max_queue`. The reason for the indirection of an action - # is so that the work can be deferred outside of synchronization. - # - # @param args [Array] the arguments to the task which is being handled. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#85 - def fallback_action(*args); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#126 - def ns_auto_terminate?; end - - # @raise [NotImplementedError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#106 - def ns_execute(*args, &task); end - - # Callback method called when the executor has been killed. - # The default behavior is to do nothing. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#122 - def ns_kill_execution; end - - # Callback method called when an orderly shutdown has completed. - # The default behavior is to signal all waiting threads. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#114 - def ns_shutdown_execution; end -end - -# The set of possible fallback policies that may be set at thread pool creation. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#15 -Concurrent::AbstractExecutorService::FALLBACK_POLICIES = T.let(T.unsafe(nil), Array) - -# An abstract implementation of local storage, with sub-classes for -# per-thread and per-fiber locals. -# -# Each execution context (EC, thread or fiber) has a lazily initialized array -# of local variable values. Each time a new local variable is created, we -# allocate an "index" for it. -# -# For example, if the allocated index is 1, that means slot #1 in EVERY EC's -# locals array will be used for the value of that variable. -# -# The good thing about using a per-EC structure to hold values, rather than -# a global, is that no synchronization is needed when reading and writing -# those values (since the structure is only ever accessed by a single -# thread). -# -# Of course, when a local variable is GC'd, 1) we need to recover its index -# for use by other new local variables (otherwise the locals arrays could -# get bigger and bigger with time), and 2) we need to null out all the -# references held in the now-unused slots (both to avoid blocking GC of those -# objects, and also to prevent "stale" values from being passed on to a new -# local when the index is reused). -# -# Because we need to null out freed slots, we need to keep references to -# ALL the locals arrays, so we can null out the appropriate slots in all of -# them. This is why we need to use a finalizer to clean up the locals array -# when the EC goes out of scope. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#35 -class Concurrent::AbstractLocals - # @return [AbstractLocals] a new instance of AbstractLocals - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#36 - def initialize; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#89 - def fetch(index); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#71 - def free_index(index); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#55 - def next_index(local); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#102 - def set(index, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#43 - def synchronize; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#48 - def weak_synchronize; end - - private - - # When the local goes out of scope, clean up that slot across all locals currently assigned. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#112 - def local_finalizer(index); end - - # Returns the locals for the current scope, or nil if none exist. - # - # @raise [NotImplementedError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#128 - def locals; end - - # Returns the locals for the current scope, creating them if necessary. - # - # @raise [NotImplementedError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#133 - def locals!; end - - # When a thread/fiber goes out of scope, remove the array from @all_arrays. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#119 - def thread_fiber_finalizer(array_object_id); end -end - -# `Agent` is inspired by Clojure's [agent](http://clojure.org/agents) -# function. An agent is a shared, mutable variable providing independent, -# uncoordinated, *asynchronous* change of individual values. Best used when -# the value will undergo frequent, complex updates. Suitable when the result -# of an update does not need to be known immediately. `Agent` is (mostly) -# functionally equivalent to Clojure's agent, except where the runtime -# prevents parity. -# -# Agents are reactive, not autonomous - there is no imperative message loop -# and no blocking receive. The state of an Agent should be itself immutable -# and the `#value` of an Agent is always immediately available for reading by -# any thread without any messages, i.e. observation does not require -# cooperation or coordination. -# -# Agent action dispatches are made using the various `#send` methods. These -# methods always return immediately. At some point later, in another thread, -# the following will happen: -# -# 1. The given `action` will be applied to the state of the Agent and the -# `args`, if any were supplied. -# 2. The return value of `action` will be passed to the validator lambda, -# if one has been set on the Agent. -# 3. If the validator succeeds or if no validator was given, the return value -# of the given `action` will become the new `#value` of the Agent. See -# `#initialize` for details. -# 4. If any observers were added to the Agent, they will be notified. See -# `#add_observer` for details. -# 5. If during the `action` execution any other dispatches are made (directly -# or indirectly), they will be held until after the `#value` of the Agent -# has been changed. -# -# If any exceptions are thrown by an action function, no nested dispatches -# will occur, and the exception will be cached in the Agent itself. When an -# Agent has errors cached, any subsequent interactions will immediately throw -# an exception, until the agent's errors are cleared. Agent errors can be -# examined with `#error` and the agent restarted with `#restart`. -# -# The actions of all Agents get interleaved amongst threads in a thread pool. -# At any point in time, at most one action for each Agent is being executed. -# Actions dispatched to an agent from another single agent or thread will -# occur in the order they were sent, potentially interleaved with actions -# dispatched to the same agent from other sources. The `#send` method should -# be used for actions that are CPU limited, while the `#send_off` method is -# appropriate for actions that may block on IO. -# -# Unlike in Clojure, `Agent` cannot participate in `Concurrent::TVar` transactions. -# -# ## Example -# -# ``` -# def next_fibonacci(set = nil) -# return [0, 1] if set.nil? -# set + [set[-2..-1].reduce{|sum,x| sum + x }] -# end -# -# # create an agent with an initial value -# agent = Concurrent::Agent.new(next_fibonacci) -# -# # send a few update requests -# 5.times do -# agent.send{|set| next_fibonacci(set) } -# end -# -# # wait for them to complete -# agent.await -# -# # get the current value -# agent.value #=> [0, 1, 1, 2, 3, 5, 8] -# ``` -# -# ## Observation -# -# Agents support observers through the {Concurrent::Observable} mixin module. -# Notification of observers occurs every time an action dispatch returns and -# the new value is successfully validated. Observation will *not* occur if the -# action raises an exception, if validation fails, or when a {#restart} occurs. -# -# When notified the observer will receive three arguments: `time`, `old_value`, -# and `new_value`. The `time` argument is the time at which the value change -# occurred. The `old_value` is the value of the Agent when the action began -# processing. The `new_value` is the value to which the Agent was set when the -# action completed. Note that `old_value` and `new_value` may be the same. -# This is not an error. It simply means that the action returned the same -# value. -# -# ## Nested Actions -# -# It is possible for an Agent action to post further actions back to itself. -# The nested actions will be enqueued normally then processed *after* the -# outer action completes, in the order they were sent, possibly interleaved -# with action dispatches from other threads. Nested actions never deadlock -# with one another and a failure in a nested action will never affect the -# outer action. -# -# Nested actions can be called using the Agent reference from the enclosing -# scope or by passing the reference in as a "send" argument. Nested actions -# cannot be post using `self` from within the action block/proc/lambda; `self` -# in this context will not reference the Agent. The preferred method for -# dispatching nested actions is to pass the Agent as an argument. This allows -# Ruby to more effectively manage the closing scope. -# -# Prefer this: -# -# ``` -# agent = Concurrent::Agent.new(0) -# agent.send(agent) do |value, this| -# this.send {|v| v + 42 } -# 3.14 -# end -# agent.value #=> 45.14 -# ``` -# -# Over this: -# -# ``` -# agent = Concurrent::Agent.new(0) -# agent.send do |value| -# agent.send {|v| v + 42 } -# 3.14 -# end -# ``` -# -# -# **NOTE** Never, *under any circumstances*, call any of the "await" methods -# ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action -# block/proc/lambda. The call will block the Agent and will always fail. -# Calling either {#await} or {#wait} (with a timeout of `nil`) will -# hopelessly deadlock the Agent with no possibility of recovery. -# -# @see http://clojure.org/Agents Clojure Agents -# @see http://clojure.org/state Values and Change - Clojure's approach to Identity and State -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#145 -class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject - include ::Concurrent::Concern::Observable - - # Create a new `Agent` with the given initial value and options. - # - # The `:validator` option must be `nil` or a side-effect free proc/lambda - # which takes one argument. On any intended value change the validator, if - # provided, will be called. If the new value is invalid the validator should - # return `false` or raise an error. - # - # The `:error_handler` option must be `nil` or a proc/lambda which takes two - # arguments. When an action raises an error or validation fails, either by - # returning false or raising an error, the error handler will be called. The - # arguments to the error handler will be a reference to the agent itself and - # the error object which was raised. - # - # The `:error_mode` may be either `:continue` (the default if an error - # handler is given) or `:fail` (the default if error handler nil or not - # given). - # - # If an action being run by the agent throws an error or doesn't pass - # validation the error handler, if present, will be called. After the - # handler executes if the error mode is `:continue` the Agent will continue - # as if neither the action that caused the error nor the error itself ever - # happened. - # - # If the mode is `:fail` the Agent will become {#failed?} and will stop - # accepting new action dispatches. Any previously queued actions will be - # held until {#restart} is called. The {#value} method will still work, - # returning the value of the Agent before the error. - # - # @option opts - # @option opts - # @option opts - # @param initial [Object] the initial value - # @param opts [Hash] the configuration options - # @return [Agent] a new instance of Agent - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#220 - def initialize(initial, opts = T.unsafe(nil)); end - - # Dispatches an action to the Agent and returns immediately. Subsequently, - # in a thread from a thread pool, the {#value} will be set to the return - # value of the action. Appropriate for actions that may block on IO. - # - # @param action [Proc] the action dispatch to be enqueued - # @return [Concurrent::Agent] self - # @see #send_off - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#331 - def <<(action); end - - # Blocks the current thread (indefinitely!) until all actions dispatched - # thus far, from this thread or nested by the Agent, have occurred. Will - # block when {#failed?}. Will never return if a failed Agent is {#restart} - # with `:clear_actions` true. - # - # Returns a reference to `self` to support method chaining: - # - # ``` - # current_value = agent.await.value - # ``` - # - # - # **NOTE** Never, *under any circumstances*, call any of the "await" methods - # ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action - # block/proc/lambda. The call will block the Agent and will always fail. - # Calling either {#await} or {#wait} (with a timeout of `nil`) will - # hopelessly deadlock the Agent with no possibility of recovery. - # - # @return [Boolean] self - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#350 - def await; end - - # Blocks the current thread until all actions dispatched thus far, from this - # thread or nested by the Agent, have occurred, or the timeout (in seconds) - # has elapsed. - # - # - # **NOTE** Never, *under any circumstances*, call any of the "await" methods - # ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action - # block/proc/lambda. The call will block the Agent and will always fail. - # Calling either {#await} or {#wait} (with a timeout of `nil`) will - # hopelessly deadlock the Agent with no possibility of recovery. - # - # @param timeout [Float] the maximum number of seconds to wait - # @return [Boolean] true if all actions complete before timeout else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#363 - def await_for(timeout); end - - # Blocks the current thread until all actions dispatched thus far, from this - # thread or nested by the Agent, have occurred, or the timeout (in seconds) - # has elapsed. - # - # - # **NOTE** Never, *under any circumstances*, call any of the "await" methods - # ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action - # block/proc/lambda. The call will block the Agent and will always fail. - # Calling either {#await} or {#wait} (with a timeout of `nil`) will - # hopelessly deadlock the Agent with no possibility of recovery. - # - # @param timeout [Float] the maximum number of seconds to wait - # @raise [Concurrent::TimeoutError] when timeout is reached - # @return [Boolean] true if all actions complete before timeout - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#377 - def await_for!(timeout); end - - # The current value (state) of the Agent, irrespective of any pending or - # in-progress actions. The value is always available and is non-blocking. - # - # @return [Object] the current value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#229 - def deref; end - - # When {#failed?} and {#error_mode} is `:fail`, returns the error object - # which caused the failure, else `nil`. When {#error_mode} is `:continue` - # will *always* return `nil`. - # - # @return [nil, Error] the error which caused the failure when {#failed?} - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#240 - def error; end - - # The error mode this Agent is operating in. See {#initialize} for details. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#184 - def error_mode; end - - # Is the Agent in a failed state? - # - # @return [Boolean] - # @see #restart - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#402 - def failed?; end - - # Dispatches an action to the Agent and returns immediately. Subsequently, - # in a thread from a thread pool, the {#value} will be set to the return - # value of the action. Action dispatches are only allowed when the Agent - # is not {#failed?}. - # - # The action must be a block/proc/lambda which takes 1 or more arguments. - # The first argument is the current {#value} of the Agent. Any arguments - # passed to the send method via the `args` parameter will be passed to the - # action as the remaining arguments. The action must return the new value - # of the Agent. - # - # * {#send} and {#send!} should be used for actions that are CPU limited - # * {#send_off}, {#send_off!}, and {#<<} are appropriate for actions that - # may block on IO - # * {#send_via} and {#send_via!} are used when a specific executor is to - # be used for the action - # - # @param args [Array] zero or more arguments to be passed to - # the action - # @param action [Proc] the action dispatch to be enqueued - # @return [Boolean] true if the action is successfully enqueued, false if - # the Agent is {#failed?} - # @yield [agent, value, *args] process the old value and return the new - # @yieldparam value [Object] the current {#value} of the Agent - # @yieldparam args [Array] zero or more arguments to pass to the - # action - # @yieldreturn [Object] the new value of the Agent - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#294 - def post(*args, &action); end - - # When {#failed?} and {#error_mode} is `:fail`, returns the error object - # which caused the failure, else `nil`. When {#error_mode} is `:continue` - # will *always* return `nil`. - # - # @return [nil, Error] the error which caused the failure when {#failed?} - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#240 - def reason; end - - # When an Agent is {#failed?}, changes the Agent {#value} to `new_value` - # then un-fails the Agent so that action dispatches are allowed again. If - # the `:clear_actions` option is give and true, any actions queued on the - # Agent that were being held while it was failed will be discarded, - # otherwise those held actions will proceed. The `new_value` must pass the - # validator if any, or `restart` will raise an exception and the Agent will - # remain failed with its old {#value} and {#error}. Observers, if any, will - # not be notified of the new state. - # - # @option opts - # @param new_value [Object] the new value for the Agent once restarted - # @param opts [Hash] the configuration options - # @raise [Concurrent:AgentError] when not failed - # @return [Boolean] true - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#424 - def restart(new_value, opts = T.unsafe(nil)); end - - # Dispatches an action to the Agent and returns immediately. Subsequently, - # in a thread from a thread pool, the {#value} will be set to the return - # value of the action. Action dispatches are only allowed when the Agent - # is not {#failed?}. - # - # The action must be a block/proc/lambda which takes 1 or more arguments. - # The first argument is the current {#value} of the Agent. Any arguments - # passed to the send method via the `args` parameter will be passed to the - # action as the remaining arguments. The action must return the new value - # of the Agent. - # - # * {#send} and {#send!} should be used for actions that are CPU limited - # * {#send_off}, {#send_off!}, and {#<<} are appropriate for actions that - # may block on IO - # * {#send_via} and {#send_via!} are used when a specific executor is to - # be used for the action - # - # @param args [Array] zero or more arguments to be passed to - # the action - # @param action [Proc] the action dispatch to be enqueued - # @return [Boolean] true if the action is successfully enqueued, false if - # the Agent is {#failed?} - # @yield [agent, value, *args] process the old value and return the new - # @yieldparam value [Object] the current {#value} of the Agent - # @yieldparam args [Array] zero or more arguments to pass to the - # action - # @yieldreturn [Object] the new value of the Agent - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#278 - def send(*args, &action); end - - # Dispatches an action to the Agent and returns immediately. Subsequently, - # in a thread from a thread pool, the {#value} will be set to the return - # value of the action. Action dispatches are only allowed when the Agent - # is not {#failed?}. - # - # The action must be a block/proc/lambda which takes 1 or more arguments. - # The first argument is the current {#value} of the Agent. Any arguments - # passed to the send method via the `args` parameter will be passed to the - # action as the remaining arguments. The action must return the new value - # of the Agent. - # - # * {#send} and {#send!} should be used for actions that are CPU limited - # * {#send_off}, {#send_off!}, and {#<<} are appropriate for actions that - # may block on IO - # * {#send_via} and {#send_via!} are used when a specific executor is to - # be used for the action - # - # @param args [Array] zero or more arguments to be passed to - # the action - # @param action [Proc] the action dispatch to be enqueued - # @raise [Concurrent::Agent::Error] if the Agent is {#failed?} - # @return [Boolean] true if the action is successfully enqueued - # @yield [agent, value, *args] process the old value and return the new - # @yieldparam value [Object] the current {#value} of the Agent - # @yieldparam args [Array] zero or more arguments to pass to the - # action - # @yieldreturn [Object] the new value of the Agent - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#287 - def send!(*args, &action); end - - # Dispatches an action to the Agent and returns immediately. Subsequently, - # in a thread from a thread pool, the {#value} will be set to the return - # value of the action. Action dispatches are only allowed when the Agent - # is not {#failed?}. - # - # The action must be a block/proc/lambda which takes 1 or more arguments. - # The first argument is the current {#value} of the Agent. Any arguments - # passed to the send method via the `args` parameter will be passed to the - # action as the remaining arguments. The action must return the new value - # of the Agent. - # - # * {#send} and {#send!} should be used for actions that are CPU limited - # * {#send_off}, {#send_off!}, and {#<<} are appropriate for actions that - # may block on IO - # * {#send_via} and {#send_via!} are used when a specific executor is to - # be used for the action - # - # @param args [Array] zero or more arguments to be passed to - # the action - # @param action [Proc] the action dispatch to be enqueued - # @return [Boolean] true if the action is successfully enqueued, false if - # the Agent is {#failed?} - # @yield [agent, value, *args] process the old value and return the new - # @yieldparam value [Object] the current {#value} of the Agent - # @yieldparam args [Array] zero or more arguments to pass to the - # action - # @yieldreturn [Object] the new value of the Agent - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#294 - def send_off(*args, &action); end - - # Dispatches an action to the Agent and returns immediately. Subsequently, - # in a thread from a thread pool, the {#value} will be set to the return - # value of the action. Action dispatches are only allowed when the Agent - # is not {#failed?}. - # - # The action must be a block/proc/lambda which takes 1 or more arguments. - # The first argument is the current {#value} of the Agent. Any arguments - # passed to the send method via the `args` parameter will be passed to the - # action as the remaining arguments. The action must return the new value - # of the Agent. - # - # * {#send} and {#send!} should be used for actions that are CPU limited - # * {#send_off}, {#send_off!}, and {#<<} are appropriate for actions that - # may block on IO - # * {#send_via} and {#send_via!} are used when a specific executor is to - # be used for the action - # - # @param args [Array] zero or more arguments to be passed to - # the action - # @param action [Proc] the action dispatch to be enqueued - # @raise [Concurrent::Agent::Error] if the Agent is {#failed?} - # @return [Boolean] true if the action is successfully enqueued - # @yield [agent, value, *args] process the old value and return the new - # @yieldparam value [Object] the current {#value} of the Agent - # @yieldparam args [Array] zero or more arguments to pass to the - # action - # @yieldreturn [Object] the new value of the Agent - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#302 - def send_off!(*args, &action); end - - # Dispatches an action to the Agent and returns immediately. Subsequently, - # in a thread from a thread pool, the {#value} will be set to the return - # value of the action. Action dispatches are only allowed when the Agent - # is not {#failed?}. - # - # The action must be a block/proc/lambda which takes 1 or more arguments. - # The first argument is the current {#value} of the Agent. Any arguments - # passed to the send method via the `args` parameter will be passed to the - # action as the remaining arguments. The action must return the new value - # of the Agent. - # - # * {#send} and {#send!} should be used for actions that are CPU limited - # * {#send_off}, {#send_off!}, and {#<<} are appropriate for actions that - # may block on IO - # * {#send_via} and {#send_via!} are used when a specific executor is to - # be used for the action - # - # @param args [Array] zero or more arguments to be passed to - # the action - # @param action [Proc] the action dispatch to be enqueued - # @param executor [Concurrent::ExecutorService] the executor on which the - # action is to be dispatched - # @return [Boolean] true if the action is successfully enqueued, false if - # the Agent is {#failed?} - # @yield [agent, value, *args] process the old value and return the new - # @yieldparam value [Object] the current {#value} of the Agent - # @yieldparam args [Array] zero or more arguments to pass to the - # action - # @yieldreturn [Object] the new value of the Agent - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#311 - def send_via(executor, *args, &action); end - - # Dispatches an action to the Agent and returns immediately. Subsequently, - # in a thread from a thread pool, the {#value} will be set to the return - # value of the action. Action dispatches are only allowed when the Agent - # is not {#failed?}. - # - # The action must be a block/proc/lambda which takes 1 or more arguments. - # The first argument is the current {#value} of the Agent. Any arguments - # passed to the send method via the `args` parameter will be passed to the - # action as the remaining arguments. The action must return the new value - # of the Agent. - # - # * {#send} and {#send!} should be used for actions that are CPU limited - # * {#send_off}, {#send_off!}, and {#<<} are appropriate for actions that - # may block on IO - # * {#send_via} and {#send_via!} are used when a specific executor is to - # be used for the action - # - # @param args [Array] zero or more arguments to be passed to - # the action - # @param action [Proc] the action dispatch to be enqueued - # @param executor [Concurrent::ExecutorService] the executor on which the - # action is to be dispatched - # @raise [Concurrent::Agent::Error] if the Agent is {#failed?} - # @return [Boolean] true if the action is successfully enqueued - # @yield [agent, value, *args] process the old value and return the new - # @yieldparam value [Object] the current {#value} of the Agent - # @yieldparam args [Array] zero or more arguments to pass to the - # action - # @yieldreturn [Object] the new value of the Agent - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#319 - def send_via!(executor, *args, &action); end - - # Is the Agent in a failed state? - # - # @return [Boolean] - # @see #restart - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#402 - def stopped?; end - - # The current value (state) of the Agent, irrespective of any pending or - # in-progress actions. The value is always available and is non-blocking. - # - # @return [Object] the current value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#229 - def value; end - - # Blocks the current thread until all actions dispatched thus far, from this - # thread or nested by the Agent, have occurred, or the timeout (in seconds) - # has elapsed. Will block indefinitely when timeout is nil or not given. - # - # Provided mainly for consistency with other classes in this library. Prefer - # the various `await` methods instead. - # - # - # **NOTE** Never, *under any circumstances*, call any of the "await" methods - # ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action - # block/proc/lambda. The call will block the Agent and will always fail. - # Calling either {#await} or {#wait} (with a timeout of `nil`) will - # hopelessly deadlock the Agent with no possibility of recovery. - # - # @param timeout [Float] the maximum number of seconds to wait - # @return [Boolean] true if all actions complete before timeout else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#393 - def wait(timeout = T.unsafe(nil)); end - - private - - # @raise [ArgumentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#510 - def enqueue_action_job(action, args, executor); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#516 - def enqueue_await_job(latch); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#543 - def execute_next_job; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#576 - def handle_error(error); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#529 - def ns_enqueue_job(job, index = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#584 - def ns_find_last_job_for_thread; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#490 - def ns_initialize(initial, opts); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#539 - def ns_post_next_job; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#570 - def ns_validate(value); end - - class << self - # Blocks the current thread (indefinitely!) until all actions dispatched - # thus far to all the given Agents, from this thread or nested by the - # given Agents, have occurred. Will block when any of the agents are - # failed. Will never return if a failed Agent is restart with - # `:clear_actions` true. - # - # - # **NOTE** Never, *under any circumstances*, call any of the "await" methods - # ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action - # block/proc/lambda. The call will block the Agent and will always fail. - # Calling either {#await} or {#wait} (with a timeout of `nil`) will - # hopelessly deadlock the Agent with no possibility of recovery. - # - # @param agents [Array] the Agents on which to wait - # @return [Boolean] true - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#449 - def await(*agents); end - - # Blocks the current thread until all actions dispatched thus far to all - # the given Agents, from this thread or nested by the given Agents, have - # occurred, or the timeout (in seconds) has elapsed. - # - # - # **NOTE** Never, *under any circumstances*, call any of the "await" methods - # ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action - # block/proc/lambda. The call will block the Agent and will always fail. - # Calling either {#await} or {#wait} (with a timeout of `nil`) will - # hopelessly deadlock the Agent with no possibility of recovery. - # - # @param timeout [Float] the maximum number of seconds to wait - # @param agents [Array] the Agents on which to wait - # @return [Boolean] true if all actions complete before timeout else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#463 - def await_for(timeout, *agents); end - - # Blocks the current thread until all actions dispatched thus far to all - # the given Agents, from this thread or nested by the given Agents, have - # occurred, or the timeout (in seconds) has elapsed. - # - # - # **NOTE** Never, *under any circumstances*, call any of the "await" methods - # ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action - # block/proc/lambda. The call will block the Agent and will always fail. - # Calling either {#await} or {#wait} (with a timeout of `nil`) will - # hopelessly deadlock the Agent with no possibility of recovery. - # - # @param timeout [Float] the maximum number of seconds to wait - # @param agents [Array] the Agents on which to wait - # @raise [Concurrent::TimeoutError] when timeout is reached - # @return [Boolean] true if all actions complete before timeout - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#482 - def await_for!(timeout, *agents); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#154 -Concurrent::Agent::AWAIT_ACTION = T.let(T.unsafe(nil), Proc) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#151 -Concurrent::Agent::AWAIT_FLAG = T.let(T.unsafe(nil), Object) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#157 -Concurrent::Agent::DEFAULT_ERROR_HANDLER = T.let(T.unsafe(nil), Proc) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#160 -Concurrent::Agent::DEFAULT_VALIDATOR = T.let(T.unsafe(nil), Proc) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#148 -Concurrent::Agent::ERROR_MODES = T.let(T.unsafe(nil), Array) - -# Raised during action processing or any other time in an Agent's lifecycle. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#167 -class Concurrent::Agent::Error < ::StandardError - # @return [Error] a new instance of Error - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#168 - def initialize(message = T.unsafe(nil)); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 -class Concurrent::Agent::Job < ::Struct - # Returns the value of attribute action - # - # @return [Object] the current value of action - def action; end - - # Sets the attribute action - # - # @param value [Object] the value to set the attribute action to. - # @return [Object] the newly set value - def action=(_); end - - # Returns the value of attribute args - # - # @return [Object] the current value of args - def args; end - - # Sets the attribute args - # - # @param value [Object] the value to set the attribute args to. - # @return [Object] the newly set value - def args=(_); end - - # Returns the value of attribute caller - # - # @return [Object] the current value of caller - def caller; end - - # Sets the attribute caller - # - # @param value [Object] the value to set the attribute caller to. - # @return [Object] the newly set value - def caller=(_); end - - # Returns the value of attribute executor - # - # @return [Object] the current value of executor - def executor; end - - # Sets the attribute executor - # - # @param value [Object] the value to set the attribute executor to. - # @return [Object] the newly set value - def executor=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# Raised when a new value obtained during action processing or at `#restart` -# fails validation. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#176 -class Concurrent::Agent::ValidationError < ::Concurrent::Agent::Error - # @return [ValidationError] a new instance of ValidationError - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#177 - def initialize(message = T.unsafe(nil)); end -end - -# A thread-safe subclass of Array. This version locks against the object -# itself for every method call, ensuring only one thread can be reading -# or writing at a time. This includes iteration methods like `#each`. -# -# @note `a += b` is **not** a **thread-safe** operation on -# `Concurrent::Array`. It reads array `a`, then it creates new `Concurrent::Array` -# which is concatenation of `a` and `b`, then it writes the concatenation to `a`. -# The read and write are independent operations they do not form a single atomic -# operation therefore when two `+=` operations are executed concurrently updates -# may be lost. Use `#concat` instead. -# @see http://ruby-doc.org/core/Array.html Ruby standard library `Array` -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/array.rb#53 -class Concurrent::Array < ::Array; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/array.rb#22 -Concurrent::ArrayImplementation = Array - -# A mixin module that provides simple asynchronous behavior to a class, -# turning it into a simple actor. Loosely based on Erlang's -# [gen_server](http://www.erlang.org/doc/man/gen_server.html), but without -# supervision or linking. -# -# A more feature-rich {Concurrent::Actor} is also available when the -# capabilities of `Async` are too limited. -# -# ```cucumber -# Feature: -# As a stateful, plain old Ruby class -# I want safe, asynchronous behavior -# So my long-running methods don't block the main thread -# ``` -# -# The `Async` module is a way to mix simple yet powerful asynchronous -# capabilities into any plain old Ruby object or class, turning each object -# into a simple Actor. Method calls are processed on a background thread. The -# caller is free to perform other actions while processing occurs in the -# background. -# -# Method calls to the asynchronous object are made via two proxy methods: -# `async` (alias `cast`) and `await` (alias `call`). These proxy methods post -# the method call to the object's background thread and return a "future" -# which will eventually contain the result of the method call. -# -# This behavior is loosely patterned after Erlang's `gen_server` behavior. -# When an Erlang module implements the `gen_server` behavior it becomes -# inherently asynchronous. The `start` or `start_link` function spawns a -# process (similar to a thread but much more lightweight and efficient) and -# returns the ID of the process. Using the process ID, other processes can -# send messages to the `gen_server` via the `cast` and `call` methods. Unlike -# Erlang's `gen_server`, however, `Async` classes do not support linking or -# supervision trees. -# -# ## Basic Usage -# -# When this module is mixed into a class, objects of the class become inherently -# asynchronous. Each object gets its own background thread on which to post -# asynchronous method calls. Asynchronous method calls are executed in the -# background one at a time in the order they are received. -# -# To create an asynchronous class, simply mix in the `Concurrent::Async` module: -# -# ``` -# class Hello -# include Concurrent::Async -# -# def hello(name) -# "Hello, #{name}!" -# end -# end -# ``` -# -# Mixing this module into a class provides each object two proxy methods: -# `async` and `await`. These methods are thread safe with respect to the -# enclosing object. The former proxy allows methods to be called -# asynchronously by posting to the object's internal thread. The latter proxy -# allows a method to be called synchronously but does so safely with respect -# to any pending asynchronous method calls and ensures proper ordering. Both -# methods return a {Concurrent::IVar} which can be inspected for the result -# of the proxied method call. Calling a method with `async` will return a -# `:pending` `IVar` whereas `await` will return a `:complete` `IVar`. -# -# ``` -# class Echo -# include Concurrent::Async -# -# def echo(msg) -# print "#{msg}\n" -# end -# end -# -# horn = Echo.new -# horn.echo('zero') # synchronous, not thread-safe -# # returns the actual return value of the method -# -# horn.async.echo('one') # asynchronous, non-blocking, thread-safe -# # returns an IVar in the :pending state -# -# horn.await.echo('two') # synchronous, blocking, thread-safe -# # returns an IVar in the :complete state -# ``` -# -# ## Let It Fail -# -# The `async` and `await` proxy methods have built-in error protection based -# on Erlang's famous "let it fail" philosophy. Instance methods should not be -# programmed defensively. When an exception is raised by a delegated method -# the proxy will rescue the exception, expose it to the caller as the `reason` -# attribute of the returned future, then process the next method call. -# -# ## Calling Methods Internally -# -# External method calls should *always* use the `async` and `await` proxy -# methods. When one method calls another method, the `async` proxy should -# rarely be used and the `await` proxy should *never* be used. -# -# When an object calls one of its own methods using the `await` proxy the -# second call will be enqueued *behind* the currently running method call. -# Any attempt to wait on the result will fail as the second call will never -# run until after the current call completes. -# -# Calling a method using the `await` proxy from within a method that was -# itself called using `async` or `await` will irreversibly deadlock the -# object. Do *not* do this, ever. -# -# ## Instance Variables and Attribute Accessors -# -# Instance variables do not need to be thread-safe so long as they are private. -# Asynchronous method calls are processed in the order they are received and -# are processed one at a time. Therefore private instance variables can only -# be accessed by one thread at a time. This is inherently thread-safe. -# -# When using private instance variables within asynchronous methods, the best -# practice is to read the instance variable into a local variable at the start -# of the method then update the instance variable at the *end* of the method. -# This way, should an exception be raised during method execution the internal -# state of the object will not have been changed. -# -# ### Reader Attributes -# -# The use of `attr_reader` is discouraged. Internal state exposed externally, -# when necessary, should be done through accessor methods. The instance -# variables exposed by these methods *must* be thread-safe, or they must be -# called using the `async` and `await` proxy methods. These two approaches are -# subtly different. -# -# When internal state is accessed via the `async` and `await` proxy methods, -# the returned value represents the object's state *at the time the call is -# processed*, which may *not* be the state of the object at the time the call -# is made. -# -# To get the state *at the current* time, irrespective of an enqueued method -# calls, a reader method must be called directly. This is inherently unsafe -# unless the instance variable is itself thread-safe, preferably using one -# of the thread-safe classes within this library. Because the thread-safe -# classes within this library are internally-locking or non-locking, they can -# be safely used from within asynchronous methods without causing deadlocks. -# -# Generally speaking, the best practice is to *not* expose internal state via -# reader methods. The best practice is to simply use the method's return value. -# -# ### Writer Attributes -# -# Writer attributes should never be used with asynchronous classes. Changing -# the state externally, even when done in the thread-safe way, is not logically -# consistent. Changes to state need to be timed with respect to all asynchronous -# method calls which my be in-process or enqueued. The only safe practice is to -# pass all necessary data to each method as arguments and let the method update -# the internal state as necessary. -# -# ## Class Constants, Variables, and Methods -# -# ### Class Constants -# -# Class constants do not need to be thread-safe. Since they are read-only and -# immutable they may be safely read both externally and from within -# asynchronous methods. -# -# ### Class Variables -# -# Class variables should be avoided. Class variables represent shared state. -# Shared state is anathema to concurrency. Should there be a need to share -# state using class variables they *must* be thread-safe, preferably -# using the thread-safe classes within this library. When updating class -# variables, never assign a new value/object to the variable itself. Assignment -# is not thread-safe in Ruby. Instead, use the thread-safe update functions -# of the variable itself to change the value. -# -# The best practice is to *never* use class variables with `Async` classes. -# -# ### Class Methods -# -# Class methods which are pure functions are safe. Class methods which modify -# class variables should be avoided, for all the reasons listed above. -# -# ## An Important Note About Thread Safe Guarantees -# -# > Thread safe guarantees can only be made when asynchronous method calls -# > are not mixed with direct method calls. Use only direct method calls -# > when the object is used exclusively on a single thread. Use only -# > `async` and `await` when the object is shared between threads. Once you -# > call a method using `async` or `await`, you should no longer call methods -# > directly on the object. Use `async` and `await` exclusively from then on. -# -# @example -# -# class Echo -# include Concurrent::Async -# -# def echo(msg) -# print "#{msg}\n" -# end -# end -# -# horn = Echo.new -# horn.echo('zero') # synchronous, not thread-safe -# # returns the actual return value of the method -# -# horn.async.echo('one') # asynchronous, non-blocking, thread-safe -# # returns an IVar in the :pending state -# -# horn.await.echo('two') # synchronous, blocking, thread-safe -# # returns an IVar in the :complete state -# @see Concurrent::Actor -# @see https://en.wikipedia.org/wiki/Actor_model "Actor Model" at Wikipedia -# @see http://www.erlang.org/doc/man/gen_server.html Erlang gen_server -# @see http://c2.com/cgi/wiki?LetItCrash "Let It Crash" at http://c2.com/ -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#217 -module Concurrent::Async - mixes_in_class_methods ::Concurrent::Async::ClassMethods - - # Causes the chained method call to be performed asynchronously on the - # object's thread. The delegated method will return a future in the - # `:pending` state and the method call will have been scheduled on the - # object's thread. The final disposition of the method call can be obtained - # by inspecting the returned future. - # - # @note The method call is guaranteed to be thread safe with respect to - # all other method calls against the same object that are called with - # either `async` or `await`. The mutable nature of Ruby references - # (and object orientation in general) prevent any other thread safety - # guarantees. Do NOT mix direct method calls with delegated method calls. - # Use *only* delegated method calls when sharing the object between threads. - # @raise [NameError] the object does not respond to the requested method - # @raise [ArgumentError] the given `args` do not match the arity of - # the requested method - # @return [Concurrent::IVar] the pending result of the asynchronous operation - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#412 - def async; end - - # Causes the chained method call to be performed synchronously on the - # current thread. The delegated will return a future in either the - # `:fulfilled` or `:rejected` state and the delegated method will have - # completed. The final disposition of the delegated method can be obtained - # by inspecting the returned future. - # - # @note The method call is guaranteed to be thread safe with respect to - # all other method calls against the same object that are called with - # either `async` or `await`. The mutable nature of Ruby references - # (and object orientation in general) prevent any other thread safety - # guarantees. Do NOT mix direct method calls with delegated method calls. - # Use *only* delegated method calls when sharing the object between threads. - # @raise [NameError] the object does not respond to the requested method - # @raise [ArgumentError] the given `args` do not match the arity of the - # requested method - # @return [Concurrent::IVar] the completed result of the synchronous operation - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#430 - def await; end - - # Causes the chained method call to be performed synchronously on the - # current thread. The delegated will return a future in either the - # `:fulfilled` or `:rejected` state and the delegated method will have - # completed. The final disposition of the delegated method can be obtained - # by inspecting the returned future. - # - # @note The method call is guaranteed to be thread safe with respect to - # all other method calls against the same object that are called with - # either `async` or `await`. The mutable nature of Ruby references - # (and object orientation in general) prevent any other thread safety - # guarantees. Do NOT mix direct method calls with delegated method calls. - # Use *only* delegated method calls when sharing the object between threads. - # @raise [NameError] the object does not respond to the requested method - # @raise [ArgumentError] the given `args` do not match the arity of the - # requested method - # @return [Concurrent::IVar] the completed result of the synchronous operation - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#430 - def call; end - - # Causes the chained method call to be performed asynchronously on the - # object's thread. The delegated method will return a future in the - # `:pending` state and the method call will have been scheduled on the - # object's thread. The final disposition of the method call can be obtained - # by inspecting the returned future. - # - # @note The method call is guaranteed to be thread safe with respect to - # all other method calls against the same object that are called with - # either `async` or `await`. The mutable nature of Ruby references - # (and object orientation in general) prevent any other thread safety - # guarantees. Do NOT mix direct method calls with delegated method calls. - # Use *only* delegated method calls when sharing the object between threads. - # @raise [NameError] the object does not respond to the requested method - # @raise [ArgumentError] the given `args` do not match the arity of - # the requested method - # @return [Concurrent::IVar] the pending result of the asynchronous operation - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#412 - def cast; end - - # Initialize the internal serializer and other stnchronization mechanisms. - # - # @note This method *must* be called immediately upon object construction. - # This is the only way thread-safe initialization can be guaranteed. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#441 - def init_synchronization; end - - class << self - # @private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#262 - def included(base); end - - # Check for the presence of a method on an object and determine if a given - # set of arguments matches the required arity. - # - # @note This check is imperfect because of the way Ruby reports the arity of - # methods with a variable number of arguments. It is possible to determine - # if too few arguments are given but impossible to determine if too many - # arguments are given. This check may also fail to recognize dynamic behavior - # of the object, such as methods simulated with `method_missing`. - # @param obj [Object] the object to check against - # @param method [Symbol] the method to check the object for - # @param args [Array] zero or more arguments for the arity check - # @raise [NameError] the object does not respond to `method` method - # @raise [ArgumentError] the given `args` do not match the arity of `method` - # @see http://www.ruby-doc.org/core-2.1.1/Method.html#method-i-arity Method#arity - # @see http://ruby-doc.org/core-2.1.0/Object.html#method-i-respond_to-3F Object#respond_to? - # @see http://www.ruby-doc.org/core-2.1.0/BasicObject.html#method-i-method_missing BasicObject#method_missing - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#250 - def validate_argc(obj, method, *args); end - end -end - -# Delegates asynchronous, thread-safe method calls to the wrapped object. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#282 -class Concurrent::Async::AsyncDelegator < ::Concurrent::Synchronization::LockableObject - # Create a new delegator object wrapping the given delegate. - # - # @param delegate [Object] the object to wrap and delegate method calls to - # @return [AsyncDelegator] a new instance of AsyncDelegator - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#288 - def initialize(delegate); end - - # Delegates method calls to the wrapped object. - # - # @param method [Symbol] the method being called - # @param args [Array] zero or more arguments to the method - # @raise [NameError] the object does not respond to `method` method - # @raise [ArgumentError] the given `args` do not match the arity of `method` - # @return [IVar] the result of the method call - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#305 - def method_missing(method, *args, &block); end - - # Perform all enqueued tasks. - # - # This method must be called from within the executor. It must not be - # called while already running. It will loop until the queue is empty. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#330 - def perform; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#348 - def reset_if_forked; end - - private - - # Check whether the method is responsive - # - # @param method [Symbol] the method being called - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#322 - def respond_to_missing?(method, include_private = T.unsafe(nil)); end -end - -# Delegates synchronous, thread-safe method calls to the wrapped object. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#360 -class Concurrent::Async::AwaitDelegator - # Create a new delegator object wrapping the given delegate. - # - # @param delegate [AsyncDelegator] the object to wrap and delegate method calls to - # @return [AwaitDelegator] a new instance of AwaitDelegator - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#365 - def initialize(delegate); end - - # Delegates method calls to the wrapped object. - # - # @param method [Symbol] the method being called - # @param args [Array] zero or more arguments to the method - # @raise [NameError] the object does not respond to `method` method - # @raise [ArgumentError] the given `args` do not match the arity of `method` - # @return [IVar] the result of the method call - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#378 - def method_missing(method, *args, &block); end - - private - - # Check whether the method is responsive - # - # @param method [Symbol] the method being called - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#387 - def respond_to_missing?(method, include_private = T.unsafe(nil)); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#269 -module Concurrent::Async::ClassMethods - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#270 - def new(*args, **_arg1, &block); end -end - -# Atoms provide a way to manage shared, synchronous, independent state. -# -# An atom is initialized with an initial value and an optional validation -# proc. At any time the value of the atom can be synchronously and safely -# changed. If a validator is given at construction then any new value -# will be checked against the validator and will be rejected if the -# validator returns false or raises an exception. -# -# There are two ways to change the value of an atom: {#compare_and_set} and -# {#swap}. The former will set the new value if and only if it validates and -# the current value matches the new value. The latter will atomically set the -# new value to the result of running the given block if and only if that -# value validates. -# -# ## Example -# -# ``` -# def next_fibonacci(set = nil) -# return [0, 1] if set.nil? -# set + [set[-2..-1].reduce{|sum,x| sum + x }] -# end -# -# # create an atom with an initial value -# atom = Concurrent::Atom.new(next_fibonacci) -# -# # send a few update requests -# 5.times do -# atom.swap{|set| next_fibonacci(set) } -# end -# -# # get the current value -# atom.value #=> [0, 1, 1, 2, 3, 5, 8] -# ``` -# -# ## Observation -# -# Atoms support observers through the {Concurrent::Observable} mixin module. -# Notification of observers occurs every time the value of the Atom changes. -# When notified the observer will receive three arguments: `time`, `old_value`, -# and `new_value`. The `time` argument is the time at which the value change -# occurred. The `old_value` is the value of the Atom when the change began -# The `new_value` is the value to which the Atom was set when the change -# completed. Note that `old_value` and `new_value` may be the same. This is -# not an error. It simply means that the change operation returned the same -# value. -# -# Unlike in Clojure, `Atom` cannot participate in {Concurrent::TVar} transactions. -# -# -# ## Thread-safe Variable Classes -# -# Each of the thread-safe variable classes is designed to solve a different -# problem. In general: -# -# * *{Concurrent::Agent}:* Shared, mutable variable providing independent, -# uncoordinated, *asynchronous* change of individual values. Best used when -# the value will undergo frequent, complex updates. Suitable when the result -# of an update does not need to be known immediately. -# * *{Concurrent::Atom}:* Shared, mutable variable providing independent, -# uncoordinated, *synchronous* change of individual values. Best used when -# the value will undergo frequent reads but only occasional, though complex, -# updates. Suitable when the result of an update must be known immediately. -# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated -# atomically. Updates are synchronous but fast. Best used when updates a -# simple set operations. Not suitable when updates are complex. -# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar -# but optimized for the given data type. -# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used -# when two or more threads need to exchange data. The threads will pair then -# block on each other until the exchange is complete. -# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread -# must give a value to another, which must take the value. The threads will -# block on each other until the exchange is complete. -# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which -# holds a different value for each thread which has access. Often used as -# an instance variable in objects which must maintain different state -# for different threads. -# * *{Concurrent::TVar}:* Shared, mutable variables which provide -# *coordinated*, *synchronous*, change of *many* stated. Used when multiple -# value must change together, in an all-or-nothing transaction. -# -# @see http://clojure.org/atoms Clojure Atoms -# @see http://clojure.org/state Values and Change - Clojure's approach to Identity and State -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#95 -class Concurrent::Atom < ::Concurrent::Synchronization::Object - include ::Concurrent::Concern::Observable - extend ::Concurrent::Synchronization::SafeInitialization - - # Create a new atom with the given initial value. - # - # @option opts - # @param value [Object] The initial value - # @param opts [Hash] The options used to configure the atom - # @raise [ArgumentError] if the validator is not a `Proc` (when given) - # @return [Atom] a new instance of Atom - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#121 - def initialize(value, opts = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#137 - def __initialize_atomic_fields__; end - - # Atomically sets the value of atom to the new value if and only if the - # current value of the atom is identical to the old value and the new - # value successfully validates against the (optional) validator given - # at construction. - # - # @param old_value [Object] The expected current value. - # @param new_value [Object] The intended new value. - # @return [Boolean] True if the value is changed else false. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#181 - def compare_and_set(old_value, new_value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#93 - def deref; end - - # Atomically sets the value of atom to the new value without regard for the - # current value so long as the new value successfully validates against the - # (optional) validator given at construction. - # - # @param new_value [Object] The intended new value. - # @return [Object] The final value of the atom after all operations and - # validations are complete. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#198 - def reset(new_value); end - - # Atomically swaps the value of atom using the given block. The current - # value will be passed to the block, as will any arguments passed as - # arguments to the function. The new value will be validated against the - # (optional) validator proc given at construction. If validation fails the - # value will not be changed. - # - # Internally, {#swap} reads the current value, applies the block to it, and - # attempts to compare-and-set it in. Since another thread may have changed - # the value in the intervening time, it may have to retry, and does so in a - # spin loop. The net effect is that the value will always be the result of - # the application of the supplied block to a current value, atomically. - # However, because the block might be called multiple times, it must be free - # of side effects. - # - # @note The given block may be called multiple times, and thus should be free - # of side effects. - # @param args [Object] Zero or more arguments passed to the block. - # @raise [ArgumentError] When no block is given. - # @return [Object] The final value of the atom after all operations and - # validations are complete. - # @yield [value, args] Calculates a new value for the atom based on the - # current value and any supplied arguments. - # @yieldparam value [Object] The current value of the atom. - # @yieldparam args [Object] All arguments passed to the function, in order. - # @yieldreturn [Object] The intended new value of the atom. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#157 - def swap(*args); end - - # The current value of the atom. - # - # @return [Object] The current value. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#93 - def value; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#105 - def compare_and_set_value(expected, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#101 - def swap_value(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#109 - def update_value(&block); end - - # Is the new value valid? - # - # @param new_value [Object] The intended new value. - # @return [Boolean] false if the validator function returns false or raises - # an exception else true - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#216 - def valid?(new_value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#97 - def value=(value); end -end - -# A boolean value that can be updated atomically. Reads and writes to an atomic -# boolean and thread-safe and guaranteed to succeed. Reads and writes may block -# briefly but no explicit locking is required. -# -# -# ## Thread-safe Variable Classes -# -# Each of the thread-safe variable classes is designed to solve a different -# problem. In general: -# -# * *{Concurrent::Agent}:* Shared, mutable variable providing independent, -# uncoordinated, *asynchronous* change of individual values. Best used when -# the value will undergo frequent, complex updates. Suitable when the result -# of an update does not need to be known immediately. -# * *{Concurrent::Atom}:* Shared, mutable variable providing independent, -# uncoordinated, *synchronous* change of individual values. Best used when -# the value will undergo frequent reads but only occasional, though complex, -# updates. Suitable when the result of an update must be known immediately. -# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated -# atomically. Updates are synchronous but fast. Best used when updates a -# simple set operations. Not suitable when updates are complex. -# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar -# but optimized for the given data type. -# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used -# when two or more threads need to exchange data. The threads will pair then -# block on each other until the exchange is complete. -# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread -# must give a value to another, which must take the value. The threads will -# block on each other until the exchange is complete. -# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which -# holds a different value for each thread which has access. Often used as -# an instance variable in objects which must maintain different state -# for different threads. -# * *{Concurrent::TVar}:* Shared, mutable variables which provide -# *coordinated*, *synchronous*, change of *many* stated. Used when multiple -# value must change together, in an all-or-nothing transaction. -# Performance: -# -# ``` -# Testing with ruby 2.1.2 -# Testing with Concurrent::MutexAtomicBoolean... -# 2.790000 0.000000 2.790000 ( 2.791454) -# Testing with Concurrent::CAtomicBoolean... -# 0.740000 0.000000 0.740000 ( 0.740206) -# -# Testing with jruby 1.9.3 -# Testing with Concurrent::MutexAtomicBoolean... -# 5.240000 2.520000 7.760000 ( 3.683000) -# Testing with Concurrent::JavaAtomicBoolean... -# 3.340000 0.010000 3.350000 ( 0.855000) -# ``` -# -# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicBoolean.html java.util.concurrent.atomic.AtomicBoolean -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb#119 -class Concurrent::AtomicBoolean < ::Concurrent::MutexAtomicBoolean - # @return [String] Short string representation. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb#121 - def inspect; end - - # @return [String] Short string representation. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb#121 - def to_s; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb#82 -Concurrent::AtomicBooleanImplementation = Concurrent::MutexAtomicBoolean - -# Define update methods that use direct paths -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb#9 -module Concurrent::AtomicDirectUpdate - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb#15 - def try_update; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb#24 - def try_update!; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb#10 - def update; end -end - -# A numeric value that can be updated atomically. Reads and writes to an atomic -# fixnum and thread-safe and guaranteed to succeed. Reads and writes may block -# briefly but no explicit locking is required. -# -# -# ## Thread-safe Variable Classes -# -# Each of the thread-safe variable classes is designed to solve a different -# problem. In general: -# -# * *{Concurrent::Agent}:* Shared, mutable variable providing independent, -# uncoordinated, *asynchronous* change of individual values. Best used when -# the value will undergo frequent, complex updates. Suitable when the result -# of an update does not need to be known immediately. -# * *{Concurrent::Atom}:* Shared, mutable variable providing independent, -# uncoordinated, *synchronous* change of individual values. Best used when -# the value will undergo frequent reads but only occasional, though complex, -# updates. Suitable when the result of an update must be known immediately. -# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated -# atomically. Updates are synchronous but fast. Best used when updates a -# simple set operations. Not suitable when updates are complex. -# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar -# but optimized for the given data type. -# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used -# when two or more threads need to exchange data. The threads will pair then -# block on each other until the exchange is complete. -# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread -# must give a value to another, which must take the value. The threads will -# block on each other until the exchange is complete. -# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which -# holds a different value for each thread which has access. Often used as -# an instance variable in objects which must maintain different state -# for different threads. -# * *{Concurrent::TVar}:* Shared, mutable variables which provide -# *coordinated*, *synchronous*, change of *many* stated. Used when multiple -# value must change together, in an all-or-nothing transaction. -# Performance: -# -# ``` -# Testing with ruby 2.1.2 -# Testing with Concurrent::MutexAtomicFixnum... -# 3.130000 0.000000 3.130000 ( 3.136505) -# Testing with Concurrent::CAtomicFixnum... -# 0.790000 0.000000 0.790000 ( 0.785550) -# -# Testing with jruby 1.9.3 -# Testing with Concurrent::MutexAtomicFixnum... -# 5.460000 2.460000 7.920000 ( 3.715000) -# Testing with Concurrent::JavaAtomicFixnum... -# 4.520000 0.030000 4.550000 ( 1.187000) -# ``` -# -# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicLong.html java.util.concurrent.atomic.AtomicLong -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb#136 -class Concurrent::AtomicFixnum < ::Concurrent::MutexAtomicFixnum - # @return [String] Short string representation. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb#138 - def inspect; end - - # @return [String] Short string representation. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb#138 - def to_s; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb#99 -Concurrent::AtomicFixnumImplementation = Concurrent::MutexAtomicFixnum - -# An atomic reference which maintains an object reference along with a mark bit -# that can be updated atomically. -# -# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicMarkableReference.html java.util.concurrent.atomic.AtomicMarkableReference -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#10 -class Concurrent::AtomicMarkableReference < ::Concurrent::Synchronization::Object - extend ::Concurrent::Synchronization::SafeInitialization - - # @return [AtomicMarkableReference] a new instance of AtomicMarkableReference - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#15 - def initialize(value = T.unsafe(nil), mark = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#137 - def __initialize_atomic_fields__; end - - # Atomically sets the value and mark to the given updated value and - # mark given both: - # - the current value == the expected value && - # - the current mark == the expected mark - # - # that the actual value was not equal to the expected value or the - # actual mark was not equal to the expected mark - # - # @param expected_val [Object] the expected value - # @param new_val [Object] the new value - # @param expected_mark [Boolean] the expected mark - # @param new_mark [Boolean] the new mark - # @return [Boolean] `true` if successful. A `false` return indicates - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#33 - def compare_and_set(expected_val, new_val, expected_mark, new_mark); end - - # Atomically sets the value and mark to the given updated value and - # mark given both: - # - the current value == the expected value && - # - the current mark == the expected mark - # - # that the actual value was not equal to the expected value or the - # actual mark was not equal to the expected mark - # - # @param expected_val [Object] the expected value - # @param new_val [Object] the new value - # @param expected_mark [Boolean] the expected mark - # @param new_mark [Boolean] the new mark - # @return [Boolean] `true` if successful. A `false` return indicates - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#33 - def compare_and_swap(expected_val, new_val, expected_mark, new_mark); end - - # Gets the current reference and marked values. - # - # @return [Array] the current reference and marked values - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#64 - def get; end - - # Gets the current marked value - # - # @return [Boolean] the current marked value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#78 - def mark; end - - # Gets the current marked value - # - # @return [Boolean] the current marked value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#78 - def marked?; end - - # _Unconditionally_ sets to the given value of both the reference and - # the mark. - # - # @param new_val [Object] the new value - # @param new_mark [Boolean] the new mark - # @return [Array] both the new value and the new mark - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#91 - def set(new_val, new_mark); end - - # Pass the current value to the given block, replacing it with the - # block's result. Simply return nil if update fails. - # - # the update failed - # - # @return [Array] the new value and marked state, or nil if - # @yield [Object] Calculate a new value and marked state for the atomic - # reference using given (old) value and (old) marked - # @yieldparam old_val [Object] the starting value of the atomic reference - # @yieldparam old_mark [Boolean] the starting state of marked - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#152 - def try_update; end - - # Pass the current value to the given block, replacing it - # with the block's result. Raise an exception if the update - # fails. - # - # @raise [Concurrent::ConcurrentUpdateError] if the update fails - # @return [Array] the new value and marked state - # @yield [Object] Calculate a new value and marked state for the atomic - # reference using given (old) value and (old) marked - # @yieldparam old_val [Object] the starting value of the atomic reference - # @yieldparam old_mark [Boolean] the starting state of marked - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#128 - def try_update!; end - - # Pass the current value and marked state to the given block, replacing it - # with the block's results. May retry if the value changes during the - # block's execution. - # - # @return [Array] the new value and new mark - # @yield [Object] Calculate a new value and marked state for the atomic - # reference using given (old) value and (old) marked - # @yieldparam old_val [Object] the starting value of the atomic reference - # @yieldparam old_mark [Boolean] the starting state of marked - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#105 - def update; end - - # Gets the current value of the reference - # - # @return [Object] the current value of the reference - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#71 - def value; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#105 - def compare_and_set_reference(expected, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#163 - def immutable_array(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#93 - def reference; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#97 - def reference=(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#101 - def swap_reference(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#109 - def update_reference(&block); end -end - -# Special "compare and set" handling of numeric values. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb#7 -module Concurrent::AtomicNumericCompareAndSetWrapper - # Atomically sets the value to the given updated value if - # the current value == the expected value. - # - # that the actual value was not equal to the expected value. - # - # @param old_value [Object] the expected value - # @param new_value [Object] the new value - # @return [Boolean] `true` if successful. A `false` return indicates - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb#10 - def compare_and_set(old_value, new_value); end -end - -# An object reference that may be updated atomically. All read and write -# operations have java volatile semantic. -# -# -# ## Thread-safe Variable Classes -# -# Each of the thread-safe variable classes is designed to solve a different -# problem. In general: -# -# * *{Concurrent::Agent}:* Shared, mutable variable providing independent, -# uncoordinated, *asynchronous* change of individual values. Best used when -# the value will undergo frequent, complex updates. Suitable when the result -# of an update does not need to be known immediately. -# * *{Concurrent::Atom}:* Shared, mutable variable providing independent, -# uncoordinated, *synchronous* change of individual values. Best used when -# the value will undergo frequent reads but only occasional, though complex, -# updates. Suitable when the result of an update must be known immediately. -# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated -# atomically. Updates are synchronous but fast. Best used when updates a -# simple set operations. Not suitable when updates are complex. -# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar -# but optimized for the given data type. -# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used -# when two or more threads need to exchange data. The threads will pair then -# block on each other until the exchange is complete. -# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread -# must give a value to another, which must take the value. The threads will -# block on each other until the exchange is complete. -# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which -# holds a different value for each thread which has access. Often used as -# an instance variable in objects which must maintain different state -# for different threads. -# * *{Concurrent::TVar}:* Shared, mutable variables which provide -# *coordinated*, *synchronous*, change of *many* stated. Used when multiple -# value must change together, in an all-or-nothing transaction. -# -# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicReference.html -# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/package-summary.html -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#126 -class Concurrent::AtomicReference < ::Concurrent::MutexAtomicReference - # @return [String] Short string representation. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#129 - def inspect; end - - # @return [String] Short string representation. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#129 - def to_s; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#18 -Concurrent::AtomicReferenceImplementation = Concurrent::MutexAtomicReference - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#30 -class Concurrent::CRubySet < ::Set - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#18 - def initialize(*args, &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def &(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def +(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def -(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def <(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def <<(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def <=(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def <=>(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def ==(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def ===(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def >(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def >=(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def ^(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def add(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def add?(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def classify(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def clear(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def collect!(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def compare_by_identity(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def compare_by_identity?(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def delete(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def delete?(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def delete_if(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def difference(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def disjoint?(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def divide(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def each(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def empty?(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def eql?(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def filter!(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def flatten(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def flatten!(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def flatten_merge(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def freeze(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def hash(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def include?(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def inspect(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def intersect?(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def intersection(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def join(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def keep_if(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def length(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def map!(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def member?(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def merge(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def pretty_print(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def pretty_print_cycle(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def proper_subset?(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def proper_superset?(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def reject!(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def replace(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def reset(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def select!(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def size(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def subset?(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def subtract(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def superset?(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def to_a(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def to_s(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def to_set(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def union(*args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#32 - def |(*args); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#23 - def initialize_copy(other); end -end - -# A thread pool that dynamically grows and shrinks to fit the current workload. -# New threads are created as needed, existing threads are reused, and threads -# that remain idle for too long are killed and removed from the pool. These -# pools are particularly suited to applications that perform a high volume of -# short-lived tasks. -# -# On creation a `CachedThreadPool` has zero running threads. New threads are -# created on the pool as new operations are `#post`. The size of the pool -# will grow until `#max_length` threads are in the pool or until the number -# of threads exceeds the number of running and pending operations. When a new -# operation is post to the pool the first available idle thread will be tasked -# with the new operation. -# -# Should a thread crash for any reason the thread will immediately be removed -# from the pool. Similarly, threads which remain idle for an extended period -# of time will be killed and reclaimed. Thus these thread pools are very -# efficient at reclaiming unused resources. -# -# The API and behavior of this class are based on Java's `CachedThreadPool` -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb#27 -class Concurrent::CachedThreadPool < ::Concurrent::ThreadPoolExecutor - # Create a new thread pool. - # - # @option opts - # @param opts [Hash] the options defining pool behavior. - # @raise [ArgumentError] if `fallback_policy` is not a known policy - # @return [CachedThreadPool] a new instance of CachedThreadPool - # @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newCachedThreadPool-- - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb#39 - def initialize(opts = T.unsafe(nil)); end - - private - - # Create a new thread pool. - # - # @option opts - # @param opts [Hash] the options defining pool behavior. - # @raise [ArgumentError] if `fallback_policy` is not a known policy - # @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newCachedThreadPool-- - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb#51 - def ns_initialize(opts); end -end - -# Raised when an asynchronous operation is cancelled before execution. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#9 -class Concurrent::CancelledOperationError < ::Concurrent::Error; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb#4 -module Concurrent::Collection; end - -# A thread safe observer set implemented using copy-on-read approach: -# observers are added and removed from a thread safe collection; every time -# a notification is required the internal data structure is copied to -# prevent concurrency issues -# -# @api private -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb#12 -class Concurrent::Collection::CopyOnNotifyObserverSet < ::Concurrent::Synchronization::LockableObject - # @api private - # @return [CopyOnNotifyObserverSet] a new instance of CopyOnNotifyObserverSet - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb#14 - def initialize; end - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb#20 - def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb#55 - def count_observers; end - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb#39 - def delete_observer(observer); end - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb#47 - def delete_observers; end - - # Notifies all registered observers with optional args and deletes them. - # - # @api private - # @param args [Object] arguments to be passed to each observer - # @return [CopyOnWriteObserverSet] self - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb#72 - def notify_and_delete_observers(*args, &block); end - - # Notifies all registered observers with optional args - # - # @api private - # @param args [Object] arguments to be passed to each observer - # @return [CopyOnWriteObserverSet] self - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb#62 - def notify_observers(*args, &block); end - - protected - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb#80 - def ns_initialize; end - - private - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb#86 - def duplicate_and_clear_observers; end - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb#94 - def duplicate_observers; end - - # @api private - # @raise [ArgumentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb#98 - def notify_to(observers, *args); end -end - -# A thread safe observer set implemented using copy-on-write approach: -# every time an observer is added or removed the whole internal data structure is -# duplicated and replaced with a new one. -# -# @api private -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb#11 -class Concurrent::Collection::CopyOnWriteObserverSet < ::Concurrent::Synchronization::LockableObject - # @api private - # @return [CopyOnWriteObserverSet] a new instance of CopyOnWriteObserverSet - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb#13 - def initialize; end - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb#19 - def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb#56 - def count_observers; end - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb#40 - def delete_observer(observer); end - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb#50 - def delete_observers; end - - # Notifies all registered observers with optional args and deletes them. - # - # @api private - # @param args [Object] arguments to be passed to each observer - # @return [CopyOnWriteObserverSet] self - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb#72 - def notify_and_delete_observers(*args, &block); end - - # Notifies all registered observers with optional args - # - # @api private - # @param args [Object] arguments to be passed to each observer - # @return [CopyOnWriteObserverSet] self - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb#63 - def notify_observers(*args, &block); end - - protected - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb#80 - def ns_initialize; end - - private - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb#102 - def clear_observers_and_return_old; end - - # @api private - # @raise [ArgumentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb#86 - def notify_to(observers, *args); end - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb#94 - def observers; end - - # @api private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb#98 - def observers=(new_set); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#10 -Concurrent::Collection::MapImplementation = Concurrent::Collection::MriMapBackend - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#10 -class Concurrent::Collection::MriMapBackend < ::Concurrent::Collection::NonConcurrentMapBackend - # @return [MriMapBackend] a new instance of MriMapBackend - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#12 - def initialize(options = T.unsafe(nil), &default_proc); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#17 - def []=(key, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#61 - def clear; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#33 - def compute(key); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#21 - def compute_if_absent(key); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#29 - def compute_if_present(key); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#53 - def delete(key); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#57 - def delete_pair(key, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#49 - def get_and_set(key, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#37 - def merge_pair(key, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#45 - def replace_if_exists(key, new_value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#41 - def replace_pair(key, old_value, new_value); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#9 -class Concurrent::Collection::NonConcurrentMapBackend - # WARNING: all public methods of the class must operate on the @backend - # directly without calling each other. This is important because of the - # SynchronizedMapBackend which uses a non-reentrant mutex for performance - # reasons. - # - # @return [NonConcurrentMapBackend] a new instance of NonConcurrentMapBackend - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#15 - def initialize(options = T.unsafe(nil), &default_proc); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#21 - def [](key); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#25 - def []=(key, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#94 - def clear; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#59 - def compute(key); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#29 - def compute_if_absent(key); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#53 - def compute_if_present(key); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#81 - def delete(key); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#85 - def delete_pair(key, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#99 - def each_pair; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#71 - def get_and_set(key, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#110 - def get_or_default(key, default_value); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#77 - def key?(key); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#63 - def merge_pair(key, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#46 - def replace_if_exists(key, new_value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#37 - def replace_pair(key, old_value, new_value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#106 - def size; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#130 - def dupped_backend; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#124 - def initialize_copy(other); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#134 - def pair?(key, expected_value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#116 - def set_backend(default_proc); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#138 - def store_computed_value(key, new_value); end -end - -# A queue collection in which the elements are sorted based on their -# comparison (spaceship) operator `<=>`. Items are added to the queue -# at a position relative to their priority. On removal the element -# with the "highest" priority is removed. By default the sort order is -# from highest to lowest, but a lowest-to-highest sort order can be -# set on construction. -# -# The API is based on the `Queue` class from the Ruby standard library. -# -# The pure Ruby implementation, `RubyNonConcurrentPriorityQueue` uses a heap algorithm -# stored in an array. The algorithm is based on the work of Robert Sedgewick -# and Kevin Wayne. -# -# The JRuby native implementation is a thin wrapper around the standard -# library `java.util.NonConcurrentPriorityQueue`. -# -# When running under JRuby the class `NonConcurrentPriorityQueue` extends `JavaNonConcurrentPriorityQueue`. -# When running under all other interpreters it extends `RubyNonConcurrentPriorityQueue`. -# -# @note This implementation is *not* thread safe. -# @see http://en.wikipedia.org/wiki/Priority_queue -# @see http://ruby-doc.org/stdlib-2.0.0/libdoc/thread/rdoc/Queue.html -# @see http://algs4.cs.princeton.edu/24pq/index.php#2.6 -# @see http://algs4.cs.princeton.edu/24pq/MaxPQ.java.html -# @see http://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb#50 -class Concurrent::Collection::NonConcurrentPriorityQueue < ::Concurrent::Collection::RubyNonConcurrentPriorityQueue - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#78 - def <<(item); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#65 - def deq; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#78 - def enq(item); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#48 - def has_priority?(item); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#65 - def shift; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#54 - def size; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb#10 -Concurrent::Collection::NonConcurrentPriorityQueueImplementation = Concurrent::Collection::RubyNonConcurrentPriorityQueue - -# A queue collection in which the elements are sorted based on their -# comparison (spaceship) operator `<=>`. Items are added to the queue -# at a position relative to their priority. On removal the element -# with the "highest" priority is removed. By default the sort order is -# from highest to lowest, but a lowest-to-highest sort order can be -# set on construction. -# -# The API is based on the `Queue` class from the Ruby standard library. -# -# The pure Ruby implementation, `RubyNonConcurrentPriorityQueue` uses a heap algorithm -# stored in an array. The algorithm is based on the work of Robert Sedgewick -# and Kevin Wayne. -# -# The JRuby native implementation is a thin wrapper around the standard -# library `java.util.NonConcurrentPriorityQueue`. -# -# When running under JRuby the class `NonConcurrentPriorityQueue` extends `JavaNonConcurrentPriorityQueue`. -# When running under all other interpreters it extends `RubyNonConcurrentPriorityQueue`. -# -# @note This implementation is *not* thread safe. -# @see http://en.wikipedia.org/wiki/Priority_queue -# @see http://ruby-doc.org/stdlib-2.0.0/libdoc/thread/rdoc/Queue.html -# @see http://algs4.cs.princeton.edu/24pq/index.php#2.6 -# @see http://algs4.cs.princeton.edu/24pq/MaxPQ.java.html -# @see http://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#8 -class Concurrent::Collection::RubyNonConcurrentPriorityQueue - # Create a new priority queue with no items. - # - # @option opts - # @param opts [Hash] the options for creating the queue - # @return [RubyNonConcurrentPriorityQueue] a new instance of RubyNonConcurrentPriorityQueue - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#11 - def initialize(opts = T.unsafe(nil)); end - - # Inserts the specified element into this priority queue. - # - # @param item [Object] the item to insert onto the queue - # @raise [ArgumentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#78 - def <<(item); end - - # Removes all of the elements from this priority queue. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#18 - def clear; end - - # Deletes all items from `self` that are equal to `item`. - # - # @param item [Object] the item to be removed from the queue - # @return [Object] true if the item is found else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#25 - def delete(item); end - - # Retrieves and removes the head of this queue, or returns `nil` if this - # queue is empty. - # - # @return [Object] the head of the queue or `nil` when empty - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#65 - def deq; end - - # Returns `true` if `self` contains no elements. - # - # @return [Boolean] true if there are no items in the queue else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#43 - def empty?; end - - # Inserts the specified element into this priority queue. - # - # @param item [Object] the item to insert onto the queue - # @raise [ArgumentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#78 - def enq(item); end - - # Returns `true` if the given item is present in `self` (that is, if any - # element == `item`), otherwise returns false. - # - # @param item [Object] the item to search for - # @return [Boolean] true if the item is found else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#48 - def has_priority?(item); end - - # Returns `true` if the given item is present in `self` (that is, if any - # element == `item`), otherwise returns false. - # - # @param item [Object] the item to search for - # @return [Boolean] true if the item is found else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#48 - def include?(item); end - - # The current length of the queue. - # - # @return [Fixnum] the number of items in the queue - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#54 - def length; end - - # Retrieves, but does not remove, the head of this queue, or returns `nil` - # if this queue is empty. - # - # @return [Object] the head of the queue or `nil` when empty - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#60 - def peek; end - - # Retrieves and removes the head of this queue, or returns `nil` if this - # queue is empty. - # - # @return [Object] the head of the queue or `nil` when empty - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#65 - def pop; end - - # Inserts the specified element into this priority queue. - # - # @param item [Object] the item to insert onto the queue - # @raise [ArgumentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#78 - def push(item); end - - # Retrieves and removes the head of this queue, or returns `nil` if this - # queue is empty. - # - # @return [Object] the head of the queue or `nil` when empty - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#65 - def shift; end - - # The current length of the queue. - # - # @return [Fixnum] the number of items in the queue - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#54 - def size; end - - private - - # Are the items at the given indexes ordered based on the priority - # order specified at construction? - # - # @param x [Integer] the first index from which to retrieve a comparable value - # @param y [Integer] the second index from which to retrieve a comparable value - # @return [Boolean] true if the two elements are in the correct priority order - # else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#119 - def ordered?(x, y); end - - # Percolate down to maintain heap invariant. - # - # @param k [Integer] the index at which to start the percolation - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#128 - def sink(k); end - - # Exchange the values at the given indexes within the internal array. - # - # @param x [Integer] the first index to swap - # @param y [Integer] the second index to swap - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#103 - def swap(x, y); end - - # Percolate up to maintain heap invariant. - # - # @param k [Integer] the index at which to start the percolation - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#147 - def swim(k); end - - class << self - # @!macro priority_queue_method_from_list - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#89 - def from_list(list, opts = T.unsafe(nil)); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#2 -module Concurrent::Concern; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/deprecation.rb#8 -module Concurrent::Concern::Deprecation - include ::Concurrent::Concern::Logging - extend ::Concurrent::Concern::Logging - extend ::Concurrent::Concern::Deprecation - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/deprecation.rb#12 - def deprecated(message, strip = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/deprecation.rb#27 - def deprecated_method(old_name, new_name); end -end - -# Object references in Ruby are mutable. This can lead to serious problems when -# the `#value` of a concurrent object is a mutable reference. Which is always the -# case unless the value is a `Fixnum`, `Symbol`, or similar "primitive" data type. -# Most classes in this library that expose a `#value` getter method do so using the -# `Dereferenceable` mixin module. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#11 -module Concurrent::Concern::Dereferenceable - # Return the value this object represents after applying the options specified - # by the `#set_deref_options` method. - # - # @return [Object] the current value of the object - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#21 - def deref; end - - # Return the value this object represents after applying the options specified - # by the `#set_deref_options` method. - # - # @return [Object] the current value of the object - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#21 - def value; end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#63 - def apply_deref_options(value); end - - # Set the options which define the operations #value performs before - # returning data to the caller (dereferencing). - # - # @note Most classes that include this module will call `#set_deref_options` - # from within the constructor, thus allowing these options to be set at - # object creation. - # @option opts - # @option opts - # @option opts - # @param opts [Hash] the options defining dereference behavior. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#54 - def ns_set_deref_options(opts); end - - # Set the options which define the operations #value performs before - # returning data to the caller (dereferencing). - # - # @note Most classes that include this module will call `#set_deref_options` - # from within the constructor, thus allowing these options to be set at - # object creation. - # @option opts - # @option opts - # @option opts - # @param opts [Hash] the options defining dereference behavior. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#48 - def set_deref_options(opts = T.unsafe(nil)); end - - # Set the internal value of this object - # - # @param value [Object] the new value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#31 - def value=(value); end -end - -# Include where logging is needed -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#9 -module Concurrent::Concern::Logging - # Logs through {Concurrent.global_logger}, it can be overridden by setting @logger - # - # @param level [Integer] one of Concurrent::Concern::Logging constants - # @param progname [String] e.g. a path of an Actor - # @param message [String, nil] when nil block is used to generate the message - # @yieldreturn [String] a message - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#19 - def log(level, progname, message = T.unsafe(nil), &block); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11 -Concurrent::Concern::Logging::DEBUG = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11 -Concurrent::Concern::Logging::ERROR = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11 -Concurrent::Concern::Logging::FATAL = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11 -Concurrent::Concern::Logging::INFO = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#12 -Concurrent::Concern::Logging::SEV_LABEL = T.let(T.unsafe(nil), Array) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11 -Concurrent::Concern::Logging::UNKNOWN = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11 -Concurrent::Concern::Logging::WARN = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#10 -module Concurrent::Concern::Obligation - include ::Concurrent::Concern::Dereferenceable - - # Has the obligation completed processing? - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#49 - def complete?; end - - # @example allows Obligation to be risen - # rejected_ivar = Ivar.new.fail - # raise rejected_ivar - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#126 - def exception(*args); end - - # Has the obligation been fulfilled? - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#20 - def fulfilled?; end - - # Is the obligation still awaiting completion of processing? - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#56 - def incomplete?; end - - # Wait until obligation is complete or the timeout is reached. Will re-raise - # any exceptions raised during processing (but will not raise an exception - # on timeout). - # - # @param timeout [Numeric] the maximum time in seconds to wait. - # @raise [Exception] raises the reason when rejected - # @return [Obligation] self - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#86 - def no_error!(timeout = T.unsafe(nil)); end - - # Is obligation completion still pending? - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#35 - def pending?; end - - # Has the obligation been fulfilled? - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#20 - def realized?; end - - # If an exception was raised during processing this will return the - # exception object. Will return `nil` when the state is pending or if - # the obligation has been successfully fulfilled. - # - # @return [Exception] the exception raised during processing or `nil` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#119 - def reason; end - - # Has the obligation been rejected? - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#28 - def rejected?; end - - # The current state of the obligation. - # - # @return [Symbol] the current state - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#110 - def state; end - - # Is the obligation still unscheduled? - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#42 - def unscheduled?; end - - # The current value of the obligation. Will be `nil` while the state is - # pending or the operation has been rejected. - # - # @param timeout [Numeric] the maximum time in seconds to wait. - # @return [Object] see Dereferenceable#deref - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#65 - def value(timeout = T.unsafe(nil)); end - - # The current value of the obligation. Will be `nil` while the state is - # pending or the operation has been rejected. Will re-raise any exceptions - # raised during processing (but will not raise an exception on timeout). - # - # @param timeout [Numeric] the maximum time in seconds to wait. - # @raise [Exception] raises the reason when rejected - # @return [Object] see Dereferenceable#deref - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#98 - def value!(timeout = T.unsafe(nil)); end - - # Wait until obligation is complete or the timeout has been reached. - # - # @param timeout [Numeric] the maximum time in seconds to wait. - # @return [Obligation] self - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#74 - def wait(timeout = T.unsafe(nil)); end - - # Wait until obligation is complete or the timeout is reached. Will re-raise - # any exceptions raised during processing (but will not raise an exception - # on timeout). - # - # @param timeout [Numeric] the maximum time in seconds to wait. - # @raise [Exception] raises the reason when rejected - # @return [Obligation] self - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#86 - def wait!(timeout = T.unsafe(nil)); end - - protected - - # Atomic compare and set operation - # State is set to `next_state` only if `current state == expected_current`. - # - # @param next_state [Symbol] - # @param expected_current [Symbol] - # @return [Boolean] true is state is changed, false otherwise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#174 - def compare_and_set_state(next_state, *expected_current); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#145 - def event; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#134 - def get_arguments_from(opts = T.unsafe(nil)); end - - # Executes the block within mutex if current state is included in expected_states - # - # @return block value if executed, false otherwise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#190 - def if_state(*expected_states); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#139 - def init_obligation; end - - # Am I in the current state? - # - # @param expected [Symbol] The state to check against - # @return [Boolean] true if in the expected state else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#210 - def ns_check_state?(expected); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#215 - def ns_set_state(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#150 - def set_state(success, value, reason); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#161 - def state=(value); end -end - -# The [observer pattern](http://en.wikipedia.org/wiki/Observer_pattern) is one -# of the most useful design patterns. -# -# The workflow is very simple: -# - an `observer` can register itself to a `subject` via a callback -# - many `observers` can be registered to the same `subject` -# - the `subject` notifies all registered observers when its status changes -# - an `observer` can deregister itself when is no more interested to receive -# event notifications -# -# In a single threaded environment the whole pattern is very easy: the -# `subject` can use a simple data structure to manage all its subscribed -# `observer`s and every `observer` can react directly to every event without -# caring about synchronization. -# -# In a multi threaded environment things are more complex. The `subject` must -# synchronize the access to its data structure and to do so currently we're -# using two specialized ObserverSet: {Concurrent::Concern::CopyOnWriteObserverSet} -# and {Concurrent::Concern::CopyOnNotifyObserverSet}. -# -# When implementing and `observer` there's a very important rule to remember: -# **there are no guarantees about the thread that will execute the callback** -# -# Let's take this example -# ``` -# class Observer -# def initialize -# @count = 0 -# end -# -# def update -# @count += 1 -# end -# end -# -# obs = Observer.new -# [obj1, obj2, obj3, obj4].each { |o| o.add_observer(obs) } -# # execute [obj1, obj2, obj3, obj4] -# ``` -# -# `obs` is wrong because the variable `@count` can be accessed by different -# threads at the same time, so it should be synchronized (using either a Mutex -# or an AtomicFixum) -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/observable.rb#50 -module Concurrent::Concern::Observable - # Adds an observer to this set. If a block is passed, the observer will be - # created by this method and no other params should be passed. - # - # @param observer [Object] the observer to add - # @param func [Symbol] the function to call on the observer during notification. - # Default is :update - # @return [Object] the added observer - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/observable.rb#61 - def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end - - # Return the number of observers associated with this object. - # - # @return [Integer] the observers count - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/observable.rb#101 - def count_observers; end - - # Remove `observer` as an observer on this object so that it will no - # longer receive notifications. - # - # @param observer [Object] the observer to remove - # @return [Object] the deleted observer - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/observable.rb#82 - def delete_observer(observer); end - - # Remove all observers associated with this object. - # - # @return [Observable] self - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/observable.rb#91 - def delete_observers; end - - # As `#add_observer` but can be used for chaining. - # - # @param observer [Object] the observer to add - # @param func [Symbol] the function to call on the observer during notification. - # @return [Observable] self - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/observable.rb#70 - def with_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end - - protected - - # Returns the value of attribute observers. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/observable.rb#107 - def observers; end - - # Sets the attribute observers - # - # @param value the value to set the attribute observers to. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/observable.rb#107 - def observers=(_arg0); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#70 -class Concurrent::ConcurrentUpdateError < ::ThreadError; end - -# frozen pre-allocated backtrace to speed ConcurrentUpdateError -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#72 -Concurrent::ConcurrentUpdateError::CONC_UP_ERR_BACKTRACE = T.let(T.unsafe(nil), Array) - -# Raised when errors occur during configuration. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#6 -class Concurrent::ConfigurationError < ::Concurrent::Error; end - -# A synchronization object that allows one thread to wait on multiple other threads. -# The thread that will wait creates a `CountDownLatch` and sets the initial value -# (normally equal to the number of other threads). The initiating thread passes the -# latch to the other threads then waits for the other threads by calling the `#wait` -# method. Each of the other threads calls `#count_down` when done with its work. -# When the latch counter reaches zero the waiting thread is unblocked and continues -# with its work. A `CountDownLatch` can be used only once. Its value cannot be reset. -# -# @example Waiter and Decrementer -# latch = Concurrent::CountDownLatch.new(3) -# -# waiter = Thread.new do -# latch.wait() -# puts ("Waiter released") -# end -# -# decrementer = Thread.new do -# sleep(1) -# latch.count_down -# puts latch.count -# -# sleep(1) -# latch.count_down -# puts latch.count -# -# sleep(1) -# latch.count_down -# puts latch.count -# end -# -# [waiter, decrementer].each(&:join) -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb#98 -class Concurrent::CountDownLatch < ::Concurrent::MutexCountDownLatch; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb#56 -Concurrent::CountDownLatchImplementation = Concurrent::MutexCountDownLatch - -# A synchronization aid that allows a set of threads to all wait for each -# other to reach a common barrier point. -# -# @example -# barrier = Concurrent::CyclicBarrier.new(3) -# jobs = Array.new(3) { |i| -> { sleep i; p done: i } } -# process = -> (i) do -# # waiting to start at the same time -# barrier.wait -# # execute job -# jobs[i].call -# # wait for others to finish -# barrier.wait -# end -# threads = 2.times.map do |i| -# Thread.new(i, &process) -# end -# -# # use main as well -# process.call 2 -# -# # here we can be sure that all jobs are processed -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#27 -class Concurrent::CyclicBarrier < ::Concurrent::Synchronization::LockableObject - # Create a new `CyclicBarrier` that waits for `parties` threads - # - # @param parties [Fixnum] the number of parties - # @raise [ArgumentError] if `parties` is not an integer or is less than zero - # @return [CyclicBarrier] a new instance of CyclicBarrier - # @yield an optional block that will be executed that will be executed after - # the last thread arrives and before the others are released - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#40 - def initialize(parties, &block); end - - # A barrier can be broken when: - # - a thread called the `reset` method while at least one other thread was waiting - # - at least one thread timed out on `wait` method - # - # A broken barrier can be restored using `reset` it's safer to create a new one - # - # @return [Boolean] true if the barrier is broken otherwise false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#105 - def broken?; end - - # @return [Fixnum] the number of threads currently waiting on the barrier - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#54 - def number_waiting; end - - # @return [Fixnum] the number of threads needed to pass the barrier - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#49 - def parties; end - - # resets the barrier to its initial state - # If there is at least one waiting thread, it will be woken up, the `wait` - # method will return false and the barrier will be broken - # If the barrier is broken, this method restores it to the original state - # - # @return [nil] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#95 - def reset; end - - # Blocks on the barrier until the number of waiting threads is equal to - # `parties` or until `timeout` is reached or `reset` is called - # If a block has been passed to the constructor, it will be executed once by - # the last arrived thread before releasing the others - # - # @param timeout [Fixnum] the number of seconds to wait for the counter or - # `nil` to block indefinitely - # @return [Boolean] `true` if the `count` reaches zero else false on - # `timeout` or on `reset` or if the barrier is broken - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#66 - def wait(timeout = T.unsafe(nil)); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#111 - def ns_generation_done(generation, status, continue = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#122 - def ns_initialize(parties, &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#117 - def ns_next_generation; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#30 -class Concurrent::CyclicBarrier::Generation < ::Struct - # Returns the value of attribute status - # - # @return [Object] the current value of status - def status; end - - # Sets the attribute status - # - # @param value [Object] the value to set the attribute status to. - # @return [Object] the newly set value - def status=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# Lazy evaluation of a block yielding an immutable result. Useful for -# expensive operations that may never be needed. It may be non-blocking, -# supports the `Concern::Obligation` interface, and accepts the injection of -# custom executor upon which to execute the block. Processing of -# block will be deferred until the first time `#value` is called. -# At that time the caller can choose to return immediately and let -# the block execute asynchronously, block indefinitely, or block -# with a timeout. -# -# When a `Delay` is created its state is set to `pending`. The value and -# reason are both `nil`. The first time the `#value` method is called the -# enclosed operation will be run and the calling thread will block. Other -# threads attempting to call `#value` will block as well. Once the operation -# is complete the *value* will be set to the result of the operation or the -# *reason* will be set to the raised exception, as appropriate. All threads -# blocked on `#value` will return. Subsequent calls to `#value` will immediately -# return the cached value. The operation will only be run once. This means that -# any side effects created by the operation will only happen once as well. -# -# `Delay` includes the `Concurrent::Concern::Dereferenceable` mixin to support thread -# safety of the reference returned by `#value`. -# -# @note The default behavior of `Delay` is to block indefinitely when -# calling either `value` or `wait`, executing the delayed operation on -# the current thread. This makes the `timeout` value completely -# irrelevant. To enable non-blocking behavior, use the `executor` -# constructor option. This will cause the delayed operation to be -# execute on the given executor, allowing the call to timeout. -# @see Concurrent::Concern::Dereferenceable -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#44 -class Concurrent::Delay < ::Concurrent::Synchronization::LockableObject - include ::Concurrent::Concern::Dereferenceable - include ::Concurrent::Concern::Obligation - - # Create a new `Delay` in the `:pending` state. - # - # @raise [ArgumentError] if no block is given - # @return [Delay] a new instance of Delay - # @yield the delayed operation to perform - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#62 - def initialize(opts = T.unsafe(nil), &block); end - - # Reconfigures the block returning the value if still `#incomplete?` - # - # @return [true, false] if success - # @yield the delayed operation to perform - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#146 - def reconfigure(&block); end - - # Return the value this object represents after applying the options - # specified by the `#set_deref_options` method. If the delayed operation - # raised an exception this method will return nil. The exception object - # can be accessed via the `#reason` method. - # - # @note The default behavior of `Delay` is to block indefinitely when - # calling either `value` or `wait`, executing the delayed operation on - # the current thread. This makes the `timeout` value completely - # irrelevant. To enable non-blocking behavior, use the `executor` - # constructor option. This will cause the delayed operation to be - # execute on the given executor, allowing the call to timeout. - # @param timeout [Numeric] the maximum number of seconds to wait - # @return [Object] the current value of the object - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#77 - def value(timeout = T.unsafe(nil)); end - - # Return the value this object represents after applying the options - # specified by the `#set_deref_options` method. If the delayed operation - # raised an exception, this method will raise that exception (even when) - # the operation has already been executed). - # - # @note The default behavior of `Delay` is to block indefinitely when - # calling either `value` or `wait`, executing the delayed operation on - # the current thread. This makes the `timeout` value completely - # irrelevant. To enable non-blocking behavior, use the `executor` - # constructor option. This will cause the delayed operation to be - # execute on the given executor, allowing the call to timeout. - # @param timeout [Numeric] the maximum number of seconds to wait - # @raise [Exception] when `#rejected?` raises `#reason` - # @return [Object] the current value of the object - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#113 - def value!(timeout = T.unsafe(nil)); end - - # Return the value this object represents after applying the options - # specified by the `#set_deref_options` method. - # - # @note The default behavior of `Delay` is to block indefinitely when - # calling either `value` or `wait`, executing the delayed operation on - # the current thread. This makes the `timeout` value completely - # irrelevant. To enable non-blocking behavior, use the `executor` - # constructor option. This will cause the delayed operation to be - # execute on the given executor, allowing the call to timeout. - # @param timeout [Integer] (nil) the maximum number of seconds to wait for - # the value to be computed. When `nil` the caller will block indefinitely. - # @return [Object] self - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#132 - def wait(timeout = T.unsafe(nil)); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#160 - def ns_initialize(opts, &block); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#173 - def execute_task_once; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#7 -class Concurrent::DependencyCounter - # @return [DependencyCounter] a new instance of DependencyCounter - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#9 - def initialize(count, &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#14 - def update(time, value, reason); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#3 -class Concurrent::Error < ::StandardError; end - -# Old school kernel-style event reminiscent of Win32 programming in C++. -# -# When an `Event` is created it is in the `unset` state. Threads can choose to -# `#wait` on the event, blocking until released by another thread. When one -# thread wants to alert all blocking threads it calls the `#set` method which -# will then wake up all listeners. Once an `Event` has been set it remains set. -# New threads calling `#wait` will return immediately. An `Event` may be -# `#reset` at any time once it has been set. -# -# @example -# event = Concurrent::Event.new -# -# t1 = Thread.new do -# puts "t1 is waiting" -# event.wait(1) -# puts "event occurred" -# end -# -# t2 = Thread.new do -# puts "t2 calling set" -# event.set -# end -# -# [t1, t2].each(&:join) -# -# # prints: -# # t1 is waiting -# # t2 calling set -# # event occurred -# @see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682655.aspx -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#36 -class Concurrent::Event < ::Concurrent::Synchronization::LockableObject - # Creates a new `Event` in the unset state. Threads calling `#wait` on the - # `Event` will block. - # - # @return [Event] a new instance of Event - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#40 - def initialize; end - - # Reset a previously set event back to the `unset` state. - # Has no effect if the `Event` has not yet been set. - # - # @return [Boolean] should always return `true` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#68 - def reset; end - - # Trigger the event, setting the state to `set` and releasing all threads - # waiting on the event. Has no effect if the `Event` has already been set. - # - # @return [Boolean] should always return `true` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#56 - def set; end - - # Is the object in the set state? - # - # @return [Boolean] indicating whether or not the `Event` has been set - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#48 - def set?; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#60 - def try?; end - - # Wait a given number of seconds for the `Event` to be set by another - # thread. Will wait forever when no `timeout` value is given. Returns - # immediately if the `Event` has already been set. - # - # @return [Boolean] true if the `Event` was set before timeout else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#83 - def wait(timeout = T.unsafe(nil)); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#104 - def ns_initialize; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#96 - def ns_set; end -end - -# A synchronization point at which threads can pair and swap elements within -# pairs. Each thread presents some object on entry to the exchange method, -# matches with a partner thread, and receives its partner's object on return. -# -# -# ## Thread-safe Variable Classes -# -# Each of the thread-safe variable classes is designed to solve a different -# problem. In general: -# -# * *{Concurrent::Agent}:* Shared, mutable variable providing independent, -# uncoordinated, *asynchronous* change of individual values. Best used when -# the value will undergo frequent, complex updates. Suitable when the result -# of an update does not need to be known immediately. -# * *{Concurrent::Atom}:* Shared, mutable variable providing independent, -# uncoordinated, *synchronous* change of individual values. Best used when -# the value will undergo frequent reads but only occasional, though complex, -# updates. Suitable when the result of an update must be known immediately. -# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated -# atomically. Updates are synchronous but fast. Best used when updates a -# simple set operations. Not suitable when updates are complex. -# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar -# but optimized for the given data type. -# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used -# when two or more threads need to exchange data. The threads will pair then -# block on each other until the exchange is complete. -# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread -# must give a value to another, which must take the value. The threads will -# block on each other until the exchange is complete. -# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which -# holds a different value for each thread which has access. Often used as -# an instance variable in objects which must maintain different state -# for different threads. -# * *{Concurrent::TVar}:* Shared, mutable variables which provide -# *coordinated*, *synchronous*, change of *many* stated. Used when multiple -# value must change together, in an all-or-nothing transaction. -# This implementation is very simple, using only a single slot for each -# exchanger (unlike more advanced implementations which use an "arena"). -# This approach will work perfectly fine when there are only a few threads -# accessing a single `Exchanger`. Beyond a handful of threads the performance -# will degrade rapidly due to contention on the single slot, but the algorithm -# will remain correct. -# -# @example -# -# exchanger = Concurrent::Exchanger.new -# -# threads = [ -# Thread.new { puts "first: " << exchanger.exchange('foo', 1) }, #=> "first: bar" -# Thread.new { puts "second: " << exchanger.exchange('bar', 1) } #=> "second: foo" -# ] -# threads.each {|t| t.join(2) } -# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Exchanger.html java.util.concurrent.Exchanger -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#336 -class Concurrent::Exchanger < ::Concurrent::RubyExchanger; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#327 -Concurrent::ExchangerImplementation = Concurrent::RubyExchanger - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/executor_service.rb#157 -module Concurrent::ExecutorService - include ::Concurrent::Concern::Logging - - # Submit a task to the executor for asynchronous processing. - # - # @param task [Proc] the asynchronous task to perform - # @return [self] returns itself - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/executor_service.rb#166 - def <<(task); end - - # Does the task queue have a maximum size? - # - # @note Always returns `false` - # @return [Boolean] True if the task queue has a maximum size else false. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/executor_service.rb#174 - def can_overflow?; end - - # Submit a task to the executor for asynchronous processing. - # - # @param args [Array] zero or more arguments to be passed to the task - # @raise [ArgumentError] if no task is given - # @return [Boolean] `true` if the task is queued, `false` if the executor - # is not running - # @yield the asynchronous task to perform - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/executor_service.rb#161 - def post(*args, &task); end - - # Does this executor guarantee serialization of its operations? - # - # @note Always returns `false` - # @return [Boolean] True if the executor guarantees that all operations - # will be post in the order they are received and no two operations may - # occur simultaneously. Else false. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/executor_service.rb#181 - def serialized?; end -end - -# A `FiberLocalVar` is a variable where the value is different for each fiber. -# Each variable may have a default value, but when you modify the variable only -# the current fiber will ever see that change. -# -# This is similar to Ruby's built-in fiber-local variables (`Thread.current[:name]`), -# but with these major advantages: -# * `FiberLocalVar` has its own identity, it doesn't need a Symbol. -# * Each Ruby's built-in fiber-local variable leaks some memory forever (it's a Symbol held forever on the fiber), -# so it's only OK to create a small amount of them. -# `FiberLocalVar` has no such issue and it is fine to create many of them. -# * Ruby's built-in fiber-local variables leak forever the value set on each fiber (unless set to nil explicitly). -# `FiberLocalVar` automatically removes the mapping for each fiber once the `FiberLocalVar` instance is GC'd. -# -# @example -# v = FiberLocalVar.new(14) -# v.value #=> 14 -# v.value = 2 -# v.value #=> 2 -# @example -# v = FiberLocalVar.new(14) -# -# Fiber.new do -# v.value #=> 14 -# v.value = 1 -# v.value #=> 1 -# end.resume -# -# Fiber.new do -# v.value #=> 14 -# v.value = 2 -# v.value #=> 2 -# end.resume -# -# v.value #=> 14 -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#41 -class Concurrent::FiberLocalVar - # Creates a fiber local variable. - # - # @param default [Object] the default value when otherwise unset - # @param default_block [Proc] Optional block that gets called to obtain the - # default value for each fiber - # @return [FiberLocalVar] a new instance of FiberLocalVar - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#49 - def initialize(default = T.unsafe(nil), &default_block); end - - # Bind the given value to fiber local storage during - # execution of the given block. - # - # @param value [Object] the value to bind - # @return [Object] the value - # @yield the operation to be performed with the bound variable - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#86 - def bind(value); end - - # Returns the value in the current fiber's copy of this fiber-local variable. - # - # @return [Object] the current value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#68 - def value; end - - # Sets the current fiber's copy of this fiber-local variable to the specified value. - # - # @param value [Object] the value to set - # @return [Object] the new value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#76 - def value=(value); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#101 - def default; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#42 -Concurrent::FiberLocalVar::LOCALS = T.let(T.unsafe(nil), Concurrent::FiberLocals) - -# An array-backed storage of indexed variables per fiber. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#166 -class Concurrent::FiberLocals < ::Concurrent::AbstractLocals - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#167 - def locals; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#171 - def locals!; end -end - -# A thread pool that reuses a fixed number of threads operating off an unbounded queue. -# At any point, at most `num_threads` will be active processing tasks. When all threads are busy new -# tasks `#post` to the thread pool are enqueued until a thread becomes available. -# Should a thread crash for any reason the thread will immediately be removed -# from the pool and replaced. -# -# The API and behavior of this class are based on Java's `FixedThreadPool` -# -# **Thread Pool Options** -# -# Thread pools support several configuration options: -# -# * `idletime`: The number of seconds that a thread may be idle before being reclaimed. -# * `name`: The name of the executor (optional). Printed in the executor's `#to_s` output and -# a `-worker-` name is given to its threads if supported by used Ruby -# implementation. `` is uniq for each thread. -# * `max_queue`: The maximum number of tasks that may be waiting in the work queue at -# any one time. When the queue size reaches `max_queue` and no new threads can be created, -# subsequent tasks will be rejected in accordance with the configured `fallback_policy`. -# * `auto_terminate`: When true (default), the threads started will be marked as daemon. -# * `fallback_policy`: The policy defining how rejected tasks are handled. -# -# Three fallback policies are supported: -# -# * `:abort`: Raise a `RejectedExecutionError` exception and discard the task. -# * `:discard`: Discard the task and return false. -# * `:caller_runs`: Execute the task on the calling thread. -# -# **Shutting Down Thread Pools** -# -# Killing a thread pool while tasks are still being processed, either by calling -# the `#kill` method or at application exit, will have unpredictable results. There -# is no way for the thread pool to know what resources are being used by the -# in-progress tasks. When those tasks are killed the impact on those resources -# cannot be predicted. The *best* practice is to explicitly shutdown all thread -# pools using the provided methods: -# -# * Call `#shutdown` to initiate an orderly termination of all in-progress tasks -# * Call `#wait_for_termination` with an appropriate timeout interval an allow -# the orderly shutdown to complete -# * Call `#kill` *only when* the thread pool fails to shutdown in the allotted time -# -# On some runtime platforms (most notably the JVM) the application will not -# exit until all thread pools have been shutdown. To prevent applications from -# "hanging" on exit, all threads can be marked as daemon according to the -# `:auto_terminate` option. -# -# ```ruby -# pool1 = Concurrent::FixedThreadPool.new(5) # threads will be marked as daemon -# pool2 = Concurrent::FixedThreadPool.new(5, auto_terminate: false) # mark threads as non-daemon -# ``` -# -# @note Failure to properly shutdown a thread pool can lead to unpredictable results. -# Please read *Shutting Down Thread Pools* for more information. -# @see http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html Java Tutorials: Thread Pools -# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html Java Executors class -# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html Java ExecutorService interface -# @see https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean- -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb#201 -class Concurrent::FixedThreadPool < ::Concurrent::ThreadPoolExecutor - # Create a new thread pool. - # - # @option opts - # @param num_threads [Integer] the number of threads to allocate - # @param opts [Hash] the options defining pool behavior. - # @raise [ArgumentError] if `num_threads` is less than or equal to zero - # @raise [ArgumentError] if `fallback_policy` is not a known policy - # @return [FixedThreadPool] a new instance of FixedThreadPool - # @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool-int- - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb#215 - def initialize(num_threads, opts = T.unsafe(nil)); end -end - -# {include:file:docs-source/future.md} -# -# @see http://ruby-doc.org/stdlib-2.1.1/libdoc/observer/rdoc/Observable.html Ruby Observable module -# @see http://clojuredocs.org/clojure_core/clojure.core/future Clojure's future function -# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html java.util.concurrent.Future -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#21 -class Concurrent::Future < ::Concurrent::IVar - # Create a new `Future` in the `:unscheduled` state. - # - # @option opts - # @param opts [Hash] a customizable set of options - # @raise [ArgumentError] if no block is given - # @return [Future] a new instance of Future - # @yield the asynchronous operation to perform - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#33 - def initialize(opts = T.unsafe(nil), &block); end - - # Attempt to cancel the operation if it has not already processed. - # The operation can only be cancelled while still `pending`. It cannot - # be cancelled once it has begun processing or has completed. - # - # @return [Boolean] was the operation successfully cancelled. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#99 - def cancel; end - - # Has the operation been successfully cancelled? - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#111 - def cancelled?; end - - # Execute an `:unscheduled` `Future`. Immediately sets the state to `:pending` and - # passes the block to a new thread/thread pool for eventual execution. - # Does nothing if the `Future` is in any state other than `:unscheduled`. - # - # @example Instance and execute in separate steps - # future = Concurrent::Future.new{ sleep(1); 42 } - # future.state #=> :unscheduled - # future.execute - # future.state #=> :pending - # @example Instance and execute in one line - # future = Concurrent::Future.new{ sleep(1); 42 }.execute - # future.state #=> :pending - # @return [Future] a reference to `self` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#53 - def execute; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#82 - def set(value = T.unsafe(nil), &block); end - - # Wait the given number of seconds for the operation to complete. - # On timeout attempt to cancel the operation. - # - # @param timeout [Numeric] the maximum time in seconds to wait. - # @return [Boolean] true if the operation completed before the timeout - # else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#121 - def wait_or_cancel(timeout); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#133 - def ns_initialize(value, opts); end - - class << self - # Create a new `Future` object with the given block, execute it, and return the - # `:pending` object. - # - # @example - # future = Concurrent::Future.execute{ sleep(1); 42 } - # future.state #=> :pending - # @option opts - # @param opts [Hash] a customizable set of options - # @raise [ArgumentError] if no block is given - # @return [Future] the newly created `Future` in the `:pending` state - # @yield the asynchronous operation to perform - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#77 - def execute(opts = T.unsafe(nil), &block); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#18 -Concurrent::GLOBAL_FAST_EXECUTOR = T.let(T.unsafe(nil), Concurrent::Delay) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#30 -Concurrent::GLOBAL_IMMEDIATE_EXECUTOR = T.let(T.unsafe(nil), Concurrent::ImmediateExecutor) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#22 -Concurrent::GLOBAL_IO_EXECUTOR = T.let(T.unsafe(nil), Concurrent::Delay) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#111 -Concurrent::GLOBAL_LOGGER = T.let(T.unsafe(nil), Concurrent::AtomicReference) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#26 -Concurrent::GLOBAL_TIMER_SET = T.let(T.unsafe(nil), Concurrent::Delay) - -# A thread-safe subclass of Hash. This version locks against the object -# itself for every method call, ensuring only one thread can be reading -# or writing at a time. This includes iteration methods like `#each`, -# which takes the lock repeatedly when reading an item. -# -# @see http://ruby-doc.org/core/Hash.html Ruby standard library `Hash` -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/hash.rb#49 -class Concurrent::Hash < ::Hash; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/hash.rb#16 -Concurrent::HashImplementation = Hash - -# An `IVar` is like a future that you can assign. As a future is a value that -# is being computed that you can wait on, an `IVar` is a value that is waiting -# to be assigned, that you can wait on. `IVars` are single assignment and -# deterministic. -# -# Then, express futures as an asynchronous computation that assigns an `IVar`. -# The `IVar` becomes the primitive on which [futures](Future) and -# [dataflow](Dataflow) are built. -# -# An `IVar` is a single-element container that is normally created empty, and -# can only be set once. The I in `IVar` stands for immutable. Reading an -# `IVar` normally blocks until it is set. It is safe to set and read an `IVar` -# from different threads. -# -# If you want to have some parallel task set the value in an `IVar`, you want -# a `Future`. If you want to create a graph of parallel tasks all executed -# when the values they depend on are ready you want `dataflow`. `IVar` is -# generally a low-level primitive. -# -# ## Examples -# -# Create, set and get an `IVar` -# -# ```ruby -# ivar = Concurrent::IVar.new -# ivar.set 14 -# ivar.value #=> 14 -# ivar.set 2 # would now be an error -# ``` -# -# ## See Also -# -# 1. For the theory: Arvind, R. Nikhil, and K. Pingali. -# [I-Structures: Data structures for parallel computing](http://dl.acm.org/citation.cfm?id=69562). -# In Proceedings of Workshop on Graph Reduction, 1986. -# 2. For recent application: -# [DataDrivenFuture in Habanero Java from Rice](http://www.cs.rice.edu/~vs3/hjlib/doc/edu/rice/hj/api/HjDataDrivenFuture.html). -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#48 -class Concurrent::IVar < ::Concurrent::Synchronization::LockableObject - include ::Concurrent::Concern::Dereferenceable - include ::Concurrent::Concern::Obligation - include ::Concurrent::Concern::Observable - - # Create a new `IVar` in the `:pending` state with the (optional) initial value. - # - # @option opts - # @option opts - # @option opts - # @param value [Object] the initial value - # @param opts [Hash] the options to create a message with - # @return [IVar] a new instance of IVar - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#62 - def initialize(value = T.unsafe(nil), opts = T.unsafe(nil), &block); end - - # Add an observer on this object that will receive notification on update. - # - # Upon completion the `IVar` will notify all observers in a thread-safe way. - # The `func` method of the observer will be called with three arguments: the - # `Time` at which the `Future` completed the asynchronous operation, the - # final `value` (or `nil` on rejection), and the final `reason` (or `nil` on - # fulfillment). - # - # @param observer [Object] the object that will be notified of changes - # @param func [Symbol] symbol naming the method to call when this - # `Observable` has changes` - # @raise [ArgumentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#81 - def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end - - # Set the `IVar` to failed due to some error and wake or notify all threads waiting on it. - # - # @param reason [Object] for the failure - # @raise [Concurrent::MultipleAssignmentError] if the `IVar` has already - # been set or otherwise completed - # @return [IVar] self - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#135 - def fail(reason = T.unsafe(nil)); end - - # Set the `IVar` to a value and wake or notify all threads waiting on it. - # - # @param value [Object] the value to store in the `IVar` - # @raise [ArgumentError] if both a value and a block are given - # @raise [Concurrent::MultipleAssignmentError] if the `IVar` has already - # been set or otherwise completed - # @return [IVar] self - # @yield A block operation to use for setting the value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#113 - def set(value = T.unsafe(nil)); end - - # Attempt to set the `IVar` with the given value or block. Return a - # boolean indicating the success or failure of the set operation. - # - # @param value [Object] the value to store in the `IVar` - # @raise [ArgumentError] if both a value and a block are given - # @raise [Concurrent::MultipleAssignmentError] if the `IVar` has already - # been set or otherwise completed - # @return [Boolean] true if the value was set else false - # @yield A block operation to use for setting the value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#145 - def try_set(value = T.unsafe(nil), &block); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#202 - def check_for_block_or_value!(block_given, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#177 - def complete(success, value, reason); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#184 - def complete_without_notification(success, value, reason); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#190 - def notify_observers(value, reason); end - - # @raise [MultipleAssignmentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#195 - def ns_complete_without_notification(success, value, reason); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#155 - def ns_initialize(value, opts); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#168 - def safe_execute(task, args = T.unsafe(nil)); end -end - -# Raised when an operation is attempted which is not legal given the -# receiver's current state -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#20 -class Concurrent::IllegalOperationError < ::Concurrent::Error; end - -# An executor service which runs all operations on the current thread, -# blocking as necessary. Operations are performed in the order they are -# received and no two operations can be performed simultaneously. -# -# This executor service exists mainly for testing an debugging. When used -# it immediately runs every `#post` operation on the current thread, blocking -# that thread until the operation is complete. This can be very beneficial -# during testing because it makes all operations deterministic. -# -# @note Intended for use primarily in testing and debugging. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#17 -class Concurrent::ImmediateExecutor < ::Concurrent::AbstractExecutorService - include ::Concurrent::SerialExecutorService - - # Creates a new executor - # - # @return [ImmediateExecutor] a new instance of ImmediateExecutor - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#21 - def initialize; end - - # Submit a task to the executor for asynchronous processing. - # - # @param task [Proc] the asynchronous task to perform - # @return [self] returns itself - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#34 - def <<(task); end - - # Begin an orderly shutdown. Tasks already in the queue will be executed, - # but no new tasks will be accepted. Has no additional effect if the - # thread pool is not running. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#55 - def kill; end - - # Submit a task to the executor for asynchronous processing. - # - # @param args [Array] zero or more arguments to be passed to the task - # @raise [ArgumentError] if no task is given - # @return [Boolean] `true` if the task is queued, `false` if the executor - # is not running - # @yield the asynchronous task to perform - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#26 - def post(*args, &task); end - - # Is the executor running? - # - # @return [Boolean] `true` when running, `false` when shutting down or shutdown - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#40 - def running?; end - - # Begin an orderly shutdown. Tasks already in the queue will be executed, - # but no new tasks will be accepted. Has no additional effect if the - # thread pool is not running. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#55 - def shutdown; end - - # Is the executor shutdown? - # - # @return [Boolean] `true` when shutdown, `false` when shutting down or running - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#50 - def shutdown?; end - - # Is the executor shuttingdown? - # - # @return [Boolean] `true` when not running and not shutdown, else `false` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#45 - def shuttingdown?; end - - # Block until executor shutdown is complete or until `timeout` seconds have - # passed. - # - # @note Does not initiate shutdown or termination. Either `shutdown` or `kill` - # must be called before this method (or on another thread). - # @param timeout [Integer] the maximum number of seconds to wait for shutdown to complete - # @return [Boolean] `true` if shutdown complete or false on `timeout` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#62 - def wait_for_termination(timeout = T.unsafe(nil)); end -end - -# Raised when an attempt is made to violate an immutability guarantee. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#16 -class Concurrent::ImmutabilityError < ::Concurrent::Error; end - -# A thread-safe, immutable variation of Ruby's standard `Struct`. -# -# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct` -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#9 -module Concurrent::ImmutableStruct - include ::Concurrent::Synchronization::AbstractStruct - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#51 - def ==(other); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#46 - def [](member); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#56 - def each(&block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#62 - def each_pair(&block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#29 - def inspect; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#36 - def merge(other, &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#68 - def select(&block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#17 - def to_a; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#41 - def to_h; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#29 - def to_s; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#17 - def values; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#24 - def values_at(*indexes); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#76 - def initialize_copy(original); end - - class << self - # @private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#12 - def included(base); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#82 - def new(*args, &block); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#92 -Concurrent::ImmutableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) - -# An executor service which runs all operations on a new thread, blocking -# until it completes. Operations are performed in the order they are received -# and no two operations can be performed simultaneously. -# -# This executor service exists mainly for testing an debugging. When used it -# immediately runs every `#post` operation on a new thread, blocking the -# current thread until the operation is complete. This is similar to how the -# ImmediateExecutor works, but the operation has the full stack of the new -# thread at its disposal. This can be helpful when the operations will spawn -# more operations on the same executor and so on - such a situation might -# overflow the single stack in case of an ImmediateExecutor, which is -# inconsistent with how it would behave for a threaded executor. -# -# @note Intended for use primarily in testing and debugging. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb#19 -class Concurrent::IndirectImmediateExecutor < ::Concurrent::ImmediateExecutor - # Creates a new executor - # - # @return [IndirectImmediateExecutor] a new instance of IndirectImmediateExecutor - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb#21 - def initialize; end - - # Submit a task to the executor for asynchronous processing. - # - # @param args [Array] zero or more arguments to be passed to the task - # @raise [ArgumentError] if no task is given - # @return [Boolean] `true` if the task is queued, `false` if the executor - # is not running - # @yield the asynchronous task to perform - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb#27 - def post(*args, &task); end -end - -# Raised when an object's methods are called when it has not been -# properly initialized. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#24 -class Concurrent::InitializationError < ::Concurrent::Error; end - -# Raised when a lifecycle method (such as `stop`) is called in an improper -# sequence or when the object is in an inappropriate state. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#13 -class Concurrent::LifecycleError < ::Concurrent::Error; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#6 -class Concurrent::LockFreeStack < ::Concurrent::Synchronization::Object - include ::Enumerable - extend ::Concurrent::Synchronization::SafeInitialization - - # @param head [Node] - # @return [LockFreeStack] a new instance of LockFreeStack - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#51 - def initialize(head = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#137 - def __initialize_atomic_fields__; end - - # @return [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#118 - def clear; end - - # @return [self] - # @yield over the cleared stack - # @yieldparam value [Object] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#142 - def clear_each(&block); end - - # @param head [Node] - # @return [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#128 - def clear_if(head); end - - # @param head [Node] - # @return [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#99 - def compare_and_clear(head); end - - # @param head [Node] - # @return [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#85 - def compare_and_pop(head); end - - # @param head [Node] - # @param value [Object] - # @return [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#65 - def compare_and_push(head, value); end - - # @param head [Node] - # @return [self] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#107 - def each(head = T.unsafe(nil)); end - - # @param head [Node] - # @return [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#58 - def empty?(head = T.unsafe(nil)); end - - # @return [String] Short string representation. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#154 - def inspect; end - - # @return [Node] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#79 - def peek; end - - # @return [Object] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#90 - def pop; end - - # @param value [Object] - # @return [self] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#71 - def push(value); end - - # @param head [Node] - # @param new_head [Node] - # @return [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#135 - def replace_if(head, new_head); end - - # @return [String] Short string representation. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#154 - def to_s; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#105 - def compare_and_set_head(expected, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#93 - def head; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#97 - def head=(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#101 - def swap_head(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#109 - def update_head(&block); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#41 - def of1(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#46 - def of2(value1, value2); end - end -end - -# The singleton for empty node -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#32 -Concurrent::LockFreeStack::EMPTY = T.let(T.unsafe(nil), Concurrent::LockFreeStack::Node) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#10 -class Concurrent::LockFreeStack::Node - # @return [Node] a new instance of Node - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#23 - def initialize(value, next_node); end - - # @return [Node] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#14 - def next_node; end - - # @return [Object] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#17 - def value; end - - # allow to nil-ify to free GC when the entry is no longer relevant, not synchronised - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#21 - def value=(_arg0); end - - class << self - def [](*_arg0); end - end -end - -# Either {FiberLocalVar} or {ThreadLocalVar} depending on whether Mutex (and Monitor) -# are held, respectively, per Fiber or per Thread. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb#21 -Concurrent::LockLocalVar = Concurrent::FiberLocalVar - -# An `MVar` is a synchronized single element container. They are empty or -# contain one item. Taking a value from an empty `MVar` blocks, as does -# putting a value into a full one. You can either think of them as blocking -# queue of length one, or a special kind of mutable variable. -# -# On top of the fundamental `#put` and `#take` operations, we also provide a -# `#mutate` that is atomic with respect to operations on the same instance. -# These operations all support timeouts. -# -# We also support non-blocking operations `#try_put!` and `#try_take!`, a -# `#set!` that ignores existing values, a `#value` that returns the value -# without removing it or returns `MVar::EMPTY`, and a `#modify!` that yields -# `MVar::EMPTY` if the `MVar` is empty and can be used to set `MVar::EMPTY`. -# You shouldn't use these operations in the first instance. -# -# `MVar` is a [Dereferenceable](Dereferenceable). -# -# `MVar` is related to M-structures in Id, `MVar` in Haskell and `SyncVar` in Scala. -# -# Note that unlike the original Haskell paper, our `#take` is blocking. This is how -# Haskell and Scala do it today. -# -# ## See Also -# -# 1. P. Barth, R. Nikhil, and Arvind. [M-Structures: Extending a parallel, non- strict, functional language with state](http://dl.acm.org/citation.cfm?id=652538). In Proceedings of the 5th -# ACM Conference on Functional Programming Languages and Computer Architecture (FPCA), 1991. -# -# 2. S. Peyton Jones, A. Gordon, and S. Finne. [Concurrent Haskell](http://dl.acm.org/citation.cfm?id=237794). -# In Proceedings of the 23rd Symposium on Principles of Programming Languages -# (PoPL), 1996. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#38 -class Concurrent::MVar < ::Concurrent::Synchronization::Object - include ::Concurrent::Concern::Dereferenceable - extend ::Concurrent::Synchronization::SafeInitialization - - # Create a new `MVar`, either empty or with an initial value. - # - # @param opts [Hash] the options controlling how the future will be processed - # @return [MVar] a new instance of MVar - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#54 - def initialize(value = T.unsafe(nil), opts = T.unsafe(nil)); end - - # acquires lock on the from an `MVAR`, yields the value to provided block, - # and release lock. A timeout can be set to limit the time spent blocked, - # in which case it returns `TIMEOUT` if the time is exceeded. - # - # @return [Object] the value returned by the block, or `TIMEOUT` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#86 - def borrow(timeout = T.unsafe(nil)); end - - # Returns if the `MVar` is currently empty. - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#195 - def empty?; end - - # Returns if the `MVar` currently contains a value. - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#200 - def full?; end - - # Atomically `take`, yield the value to a block for transformation, and then - # `put` the transformed value. Returns the transformed value. A timeout can - # be set to limit the time spent blocked, in which case it returns `TIMEOUT` - # if the time is exceeded. - # - # @raise [ArgumentError] - # @return [Object] the transformed value, or `TIMEOUT` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#123 - def modify(timeout = T.unsafe(nil)); end - - # Non-blocking version of `modify` that will yield with `EMPTY` if there is no value yet. - # - # @raise [ArgumentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#179 - def modify!; end - - # Put a value into an `MVar`, blocking if there is already a value until - # it is empty. A timeout can be set to limit the time spent blocked, in - # which case it returns `TIMEOUT` if the time is exceeded. - # - # @return [Object] the value that was put, or `TIMEOUT` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#103 - def put(value, timeout = T.unsafe(nil)); end - - # Non-blocking version of `put` that will overwrite an existing value. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#169 - def set!(value); end - - # Remove the value from an `MVar`, leaving it empty, and blocking if there - # isn't a value. A timeout can be set to limit the time spent blocked, in - # which case it returns `TIMEOUT` if the time is exceeded. - # - # @return [Object] the value that was taken, or `TIMEOUT` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#66 - def take(timeout = T.unsafe(nil)); end - - # Non-blocking version of `put`, that returns whether or not it was successful. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#156 - def try_put!(value); end - - # Non-blocking version of `take`, that returns `EMPTY` instead of blocking. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#142 - def try_take!; end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#206 - def synchronize(&block); end - - private - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#212 - def unlocked_empty?; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#216 - def unlocked_full?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#224 - def wait_for_empty(timeout); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#220 - def wait_for_full(timeout); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#228 - def wait_while(condition, timeout); end -end - -# Unique value that represents that an `MVar` was empty -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#43 -Concurrent::MVar::EMPTY = T.let(T.unsafe(nil), Object) - -# Unique value that represents that an `MVar` timed out before it was able -# to produce a value. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#47 -Concurrent::MVar::TIMEOUT = T.let(T.unsafe(nil), Object) - -# `Concurrent::Map` is a hash-like object and should have much better performance -# characteristics, especially under high concurrency, than `Concurrent::Hash`. -# However, `Concurrent::Map `is not strictly semantically equivalent to a ruby `Hash` -# -- for instance, it does not necessarily retain ordering by insertion time as `Hash` -# does. For most uses it should do fine though, and we recommend you consider -# `Concurrent::Map` instead of `Concurrent::Hash` for your concurrency-safe hash needs. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#39 -class Concurrent::Map < ::Concurrent::Collection::MriMapBackend - # Iterates over each key value pair. - # This method is atomic. - # - # @note Atomic methods taking a block do not allow the `self` instance - # to be used within the block. Doing so will cause a deadlock. - # @return [self] - # @yield for each key value pair in the map - # @yieldparam key [Object] - # @yieldparam value [Object] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#274 - def each; end - - # Iterates over each key. - # This method is atomic. - # - # @note Atomic methods taking a block do not allow the `self` instance - # to be used within the block. Doing so will cause a deadlock. - # @return [self] - # @yield for each key in the map - # @yieldparam key [Object] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#255 - def each_key; end - - # Iterates over each key value pair. - # This method is atomic. - # - # @note Atomic methods taking a block do not allow the `self` instance - # to be used within the block. Doing so will cause a deadlock. - # @return [self] - # @yield for each key value pair in the map - # @yieldparam key [Object] - # @yieldparam value [Object] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#274 - def each_pair; end - - # Iterates over each value. - # This method is atomic. - # - # @note Atomic methods taking a block do not allow the `self` instance - # to be used within the block. Doing so will cause a deadlock. - # @return [self] - # @yield for each value in the map - # @yieldparam value [Object] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#264 - def each_value; end - - # Is map empty? - # - # @return [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#291 - def empty?; end - - # Get a value with key, or default_value when key is absent, - # or fail when no default_value is given. - # - # @note The "fetch-then-act" methods of `Map` are not atomic. `Map` is intended - # to be use as a concurrency primitive with strong happens-before - # guarantees. It is not intended to be used as a high-level abstraction - # supporting complex operations. All read and write operations are - # thread safe, but no guarantees are made regarding race conditions - # between the fetch operation and yielding to the block. Additionally, - # this method does not support recursion. This is due to internal - # constraints that are very unlikely to change in the near future. - # @param key [Object] - # @param default_value [Object] - # @raise [KeyError] when key is missing and no default_value is provided - # @return [Object] the value or default value - # @yield default value for a key - # @yieldparam key [Object] - # @yieldreturn [Object] default value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#183 - def fetch(key, default_value = T.unsafe(nil)); end - - # Fetch value with key, or store default value when key is absent, - # or fail when no default_value is given. This is a two step operation, - # therefore not atomic. The store can overwrite other concurrently - # stored value. - # - # @param key [Object] - # @param default_value [Object] - # @return [Object] the value or default value - # @yield default value for a key - # @yieldparam key [Object] - # @yieldreturn [Object] default value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#205 - def fetch_or_store(key, default_value = T.unsafe(nil)); end - - # Get a value with key - # - # @param key [Object] - # @return [Object] the value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#21 - def get(key); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#321 - def inspect; end - - # Find key of a value. - # - # @param value [Object] - # @return [Object, nil] key or nil when not found - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#284 - def key(value); end - - # All keys - # - # @return [::Array] keys - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#236 - def keys; end - - # @raise [TypeError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#305 - def marshal_dump; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#313 - def marshal_load(hash); end - - # Set a value with key - # - # @param key [Object] - # @param value [Object] - # @return [Object] the new value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#17 - def put(key, value); end - - # Insert value into map with key if key is absent in one atomic step. - # - # @param key [Object] - # @param value [Object] - # @return [Object, nil] the previous value when key was present or nil when there was no key - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#215 - def put_if_absent(key, value); end - - # Is the value stored in the map. Iterates over all values. - # - # @param value [Object] - # @return [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#227 - def value?(value); end - - # All values - # - # @return [::Array] values - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#244 - def values; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#331 - def initialize_copy(other); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#336 - def populate_from(hash); end - - # @raise [KeyError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#327 - def raise_fetch_no_key; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#341 - def validate_options_hash!(options); end -end - -# Raised when an object with a start/stop lifecycle has been started an -# excessive number of times. Often used in conjunction with a restart -# policy or strategy. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#29 -class Concurrent::MaxRestartFrequencyError < ::Concurrent::Error; end - -# A `Maybe` encapsulates an optional value. A `Maybe` either contains a value -# of (represented as `Just`), or it is empty (represented as `Nothing`). Using -# `Maybe` is a good way to deal with errors or exceptional cases without -# resorting to drastic measures such as exceptions. -# -# `Maybe` is a replacement for the use of `nil` with better type checking. -# -# For compatibility with {Concurrent::Concern::Obligation} the predicate and -# accessor methods are aliased as `fulfilled?`, `rejected?`, `value`, and -# `reason`. -# -# ## Motivation -# -# A common pattern in languages with pattern matching, such as Erlang and -# Haskell, is to return *either* a value *or* an error from a function -# Consider this Erlang code: -# -# ```erlang -# case file:consult("data.dat") of -# {ok, Terms} -> do_something_useful(Terms); -# {error, Reason} -> lager:error(Reason) -# end. -# ``` -# -# In this example the standard library function `file:consult` returns a -# [tuple](http://erlang.org/doc/reference_manual/data_types.html#id69044) -# with two elements: an [atom](http://erlang.org/doc/reference_manual/data_types.html#id64134) -# (similar to a ruby symbol) and a variable containing ancillary data. On -# success it returns the atom `ok` and the data from the file. On failure it -# returns `error` and a string with an explanation of the problem. With this -# pattern there is no ambiguity regarding success or failure. If the file is -# empty the return value cannot be misinterpreted as an error. And when an -# error occurs the return value provides useful information. -# -# In Ruby we tend to return `nil` when an error occurs or else we raise an -# exception. Both of these idioms are problematic. Returning `nil` is -# ambiguous because `nil` may also be a valid value. It also lacks -# information pertaining to the nature of the error. Raising an exception -# is both expensive and usurps the normal flow of control. All of these -# problems can be solved with the use of a `Maybe`. -# -# A `Maybe` is unambiguous with regard to whether or not it contains a value. -# When `Just` it contains a value, when `Nothing` it does not. When `Just` -# the value it contains may be `nil`, which is perfectly valid. When -# `Nothing` the reason for the lack of a value is contained as well. The -# previous Erlang example can be duplicated in Ruby in a principled way by -# having functions return `Maybe` objects: -# -# ```ruby -# result = MyFileUtils.consult("data.dat") # returns a Maybe -# if result.just? -# do_something_useful(result.value) # or result.just -# else -# logger.error(result.reason) # or result.nothing -# end -# ``` -# -# @example Returning a Maybe from a Function -# module MyFileUtils -# def self.consult(path) -# file = File.open(path, 'r') -# Concurrent::Maybe.just(file.read) -# rescue => ex -# return Concurrent::Maybe.nothing(ex) -# ensure -# file.close if file -# end -# end -# -# maybe = MyFileUtils.consult('bogus.file') -# maybe.just? #=> false -# maybe.nothing? #=> true -# maybe.reason #=> # -# -# maybe = MyFileUtils.consult('README.md') -# maybe.just? #=> true -# maybe.nothing? #=> false -# maybe.value #=> "# Concurrent Ruby\n[![Gem Version..." -# @example Using Maybe with a Block -# result = Concurrent::Maybe.from do -# Client.find(10) # Client is an ActiveRecord model -# end -# -# # -- if the record was found -# result.just? #=> true -# result.value #=> # -# -# # -- if the record was not found -# result.just? #=> false -# result.reason #=> ActiveRecord::RecordNotFound -# @example Using Maybe with the Null Object Pattern -# # In a Rails controller... -# result = ClientService.new(10).find # returns a Maybe -# render json: result.or(NullClient.new) -# @see https://hackage.haskell.org/package/base-4.2.0.1/docs/Data-Maybe.html Haskell Data.Maybe -# @see https://github.com/purescript/purescript-maybe/blob/master/docs/Data.Maybe.md PureScript Data.Maybe -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#104 -class Concurrent::Maybe < ::Concurrent::Synchronization::Object - include ::Comparable - extend ::Concurrent::Synchronization::SafeInitialization - - # Create a new `Maybe` with the given attributes. - # - # @param just [Object] The value when `Just` else `NONE`. - # @param nothing [Exception, Object] The exception when `Nothing` else `NONE`. - # @return [Maybe] The new `Maybe`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#224 - def initialize(just, nothing); end - - # Comparison operator. - # - # @return [Integer] 0 if self and other are both `Nothing`; - # -1 if self is `Nothing` and other is `Just`; - # 1 if self is `Just` and other is nothing; - # `self.just <=> other.just` if both self and other are `Just`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#199 - def <=>(other); end - - # Is this `Maybe` a `Just` (successfully fulfilled with a value)? - # - # @return [Boolean] True if `Just` or false if `Nothing`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#176 - def fulfilled?; end - - # The value of a `Maybe` when `Just`. Will be `NONE` when `Nothing`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#114 - def just; end - - # Is this `Maybe` a `Just` (successfully fulfilled with a value)? - # - # @return [Boolean] True if `Just` or false if `Nothing`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#176 - def just?; end - - # The reason for the `Maybe` when `Nothing`. Will be `NONE` when `Just`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#117 - def nothing; end - - # Is this `Maybe` a `nothing` (rejected with an exception upon fulfillment)? - # - # @return [Boolean] True if `Nothing` or false if `Just`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#184 - def nothing?; end - - # Return either the value of self or the given default value. - # - # @return [Object] The value of self when `Just`; else the given default. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#210 - def or(other); end - - # The reason for the `Maybe` when `Nothing`. Will be `NONE` when `Just`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#117 - def reason; end - - # Is this `Maybe` a `nothing` (rejected with an exception upon fulfillment)? - # - # @return [Boolean] True if `Nothing` or false if `Just`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#184 - def rejected?; end - - # The value of a `Maybe` when `Just`. Will be `NONE` when `Nothing`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#114 - def value; end - - class << self - # Create a new `Maybe` using the given block. - # - # Runs the given block passing all function arguments to the block as block - # arguments. If the block runs to completion without raising an exception - # a new `Just` is created with the value set to the return value of the - # block. If the block raises an exception a new `Nothing` is created with - # the reason being set to the raised exception. - # - # @param args [Array] Zero or more arguments to pass to the block. - # @raise [ArgumentError] when no block given. - # @return [Maybe] The newly created object. - # @yield The block from which to create a new `Maybe`. - # @yieldparam args [Array] Zero or more block arguments passed as - # arguments to the function. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#137 - def from(*args); end - - # Create a new `Just` with the given value. - # - # @param value [Object] The value to set for the new `Maybe` object. - # @return [Maybe] The newly created object. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#152 - def just(value); end - - # Create a new `Nothing` with the given (optional) reason. - # - # @param error [Exception] The reason to set for the new `Maybe` object. - # When given a string a new `StandardError` will be created with the - # argument as the message. When no argument is given a new - # `StandardError` with an empty message will be created. - # @return [Maybe] The newly created object. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#164 - def nothing(error = T.unsafe(nil)); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb#29 - def new(*args, &block); end - end -end - -# Indicates that the given attribute has not been set. -# When `Just` the {#nothing} getter will return `NONE`. -# When `Nothing` the {#just} getter will return `NONE`. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#111 -Concurrent::Maybe::NONE = T.let(T.unsafe(nil), Object) - -# Raised when an attempt is made to modify an immutable object -# (such as an `IVar`) after its final state has been set. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#33 -class Concurrent::MultipleAssignmentError < ::Concurrent::Error - # @return [MultipleAssignmentError] a new instance of MultipleAssignmentError - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#36 - def initialize(message = T.unsafe(nil), inspection_data = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#41 - def inspect; end - - # Returns the value of attribute inspection_data. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#34 - def inspection_data; end -end - -# Aggregates multiple exceptions. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#58 -class Concurrent::MultipleErrors < ::Concurrent::Error - # @return [MultipleErrors] a new instance of MultipleErrors - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#61 - def initialize(errors, message = T.unsafe(nil)); end - - # Returns the value of attribute errors. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#59 - def errors; end -end - -# An thread-safe variation of Ruby's standard `Struct`. Values can be set at -# construction or safely changed at any time during the object's lifecycle. -# -# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct` -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#10 -module Concurrent::MutableStruct - include ::Concurrent::Synchronization::AbstractStruct - - # Equality - # - # @return [Boolean] true if other has the same struct subclass and has - # equal member values (according to `Object#==`) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#128 - def ==(other); end - - # Attribute Reference - # - # @param member [Symbol, String, Integer] the string or symbol name of the member - # for which to obtain the value or the member's index - # @raise [NameError] if the member does not exist - # @raise [IndexError] if the index is out of range. - # @return [Object] the value of the given struct member or the member at the given index. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#118 - def [](member); end - - # Attribute Assignment - # - # Sets the value of the given struct member or the member at the given index. - # - # @param member [Symbol, String, Integer] the string or symbol name of the member - # for which to obtain the value or the member's index - # @raise [NameError] if the name does not exist - # @raise [IndexError] if the index is out of range. - # @return [Object] the value of the given struct member or the member at the given index. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#185 - def []=(member, value); end - - # Yields the value of each struct member in order. If no block is given - # an enumerator is returned. - # - # @yield the operation to be performed on each struct member - # @yieldparam value [Object] each struct value (in order) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#139 - def each(&block); end - - # Yields the name and value of each struct member in order. If no block is - # given an enumerator is returned. - # - # @yield the operation to be performed on each struct member/value pair - # @yieldparam member [Object] each struct member (in order) - # @yieldparam value [Object] each struct value (in order) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#152 - def each_pair(&block); end - - # Describe the contents of this struct in a string. - # - # @return [String] the contents of this struct in a string - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#72 - def inspect; end - - # Returns a new struct containing the contents of `other` and the contents - # of `self`. If no block is specified, the value for entries with duplicate - # keys will be that of `other`. Otherwise the value for each duplicate key - # is determined by calling the block with the key, its value in `self` and - # its value in `other`. - # - # @param other [Hash] the hash from which to set the new values - # @raise [ArgumentError] of given a member that is not defined in the struct - # @return [Synchronization::AbstractStruct] a new struct with the new values - # @yield an options block for resolving duplicate keys - # @yieldparam member [String, Symbol] the name of the member which is duplicated - # @yieldparam selfvalue [Object] the value of the member in `self` - # @yieldparam othervalue [Object] the value of the member in `other` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#94 - def merge(other, &block); end - - # Yields each member value from the struct to the block and returns an Array - # containing the member values from the struct for which the given block - # returns a true value (equivalent to `Enumerable#select`). - # - # @return [Array] an array containing each value for which the block returns true - # @yield the operation to be performed on each struct member - # @yieldparam value [Object] each struct value (in order) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#167 - def select(&block); end - - # Returns the values for this struct as an Array. - # - # @return [Array] the values for this struct - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#51 - def to_a; end - - # Returns a hash containing the names and values for the struct’s members. - # - # @return [Hash] the names and values for the struct’s members - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#103 - def to_h; end - - # Describe the contents of this struct in a string. - # - # @return [String] the contents of this struct in a string - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#72 - def to_s; end - - # Returns the values for this struct as an Array. - # - # @return [Array] the values for this struct - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#51 - def values; end - - # Returns the struct member values for each selector as an Array. - # - # A selector may be either an Integer offset or a Range of offsets (as in `Array#values_at`). - # - # @param indexes [Fixnum, Range] the index(es) from which to obatin the values (in order) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#63 - def values_at(*indexes); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#202 - def initialize_copy(original); end - - class << self - # Factory for creating new struct classes. - # - # ``` - # new([class_name] [, member_name]+>) -> StructClass click to toggle source - # new([class_name] [, member_name]+>) {|StructClass| block } -> StructClass - # new(value, ...) -> obj - # StructClass[value, ...] -> obj - # ``` - # - # The first two forms are used to create a new struct subclass `class_name` - # that can contain a value for each member_name . This subclass can be - # used to create instances of the structure like any other Class . - # - # If the `class_name` is omitted an anonymous struct class will be created. - # Otherwise, the name of this struct will appear as a constant in the struct class, - # so it must be unique for all structs under this base class and must start with a - # capital letter. Assigning a struct class to a constant also gives the class - # the name of the constant. - # - # If a block is given it will be evaluated in the context of `StructClass`, passing - # the created class as a parameter. This is the recommended way to customize a struct. - # Subclassing an anonymous struct creates an extra anonymous class that will never be used. - # - # The last two forms create a new instance of a struct subclass. The number of value - # parameters must be less than or equal to the number of attributes defined for the - # struct. Unset parameters default to nil. Passing more parameters than number of attributes - # will raise an `ArgumentError`. - # - # @see http://ruby-doc.org/core/Struct.html#method-c-new Ruby standard library `Struct#new` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#210 - def new(*args, &block); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#220 -Concurrent::MutableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) - -# A boolean value that can be updated atomically. Reads and writes to an atomic -# boolean and thread-safe and guaranteed to succeed. Reads and writes may block -# briefly but no explicit locking is required. -# -# -# ## Thread-safe Variable Classes -# -# Each of the thread-safe variable classes is designed to solve a different -# problem. In general: -# -# * *{Concurrent::Agent}:* Shared, mutable variable providing independent, -# uncoordinated, *asynchronous* change of individual values. Best used when -# the value will undergo frequent, complex updates. Suitable when the result -# of an update does not need to be known immediately. -# * *{Concurrent::Atom}:* Shared, mutable variable providing independent, -# uncoordinated, *synchronous* change of individual values. Best used when -# the value will undergo frequent reads but only occasional, though complex, -# updates. Suitable when the result of an update must be known immediately. -# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated -# atomically. Updates are synchronous but fast. Best used when updates a -# simple set operations. Not suitable when updates are complex. -# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar -# but optimized for the given data type. -# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used -# when two or more threads need to exchange data. The threads will pair then -# block on each other until the exchange is complete. -# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread -# must give a value to another, which must take the value. The threads will -# block on each other until the exchange is complete. -# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which -# holds a different value for each thread which has access. Often used as -# an instance variable in objects which must maintain different state -# for different threads. -# * *{Concurrent::TVar}:* Shared, mutable variables which provide -# *coordinated*, *synchronous*, change of *many* stated. Used when multiple -# value must change together, in an all-or-nothing transaction. -# Performance: -# -# ``` -# Testing with ruby 2.1.2 -# Testing with Concurrent::MutexAtomicBoolean... -# 2.790000 0.000000 2.790000 ( 2.791454) -# Testing with Concurrent::CAtomicBoolean... -# 0.740000 0.000000 0.740000 ( 0.740206) -# -# Testing with jruby 1.9.3 -# Testing with Concurrent::MutexAtomicBoolean... -# 5.240000 2.520000 7.760000 ( 3.683000) -# Testing with Concurrent::JavaAtomicBoolean... -# 3.340000 0.010000 3.350000 ( 0.855000) -# ``` -# -# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicBoolean.html java.util.concurrent.atomic.AtomicBoolean -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#8 -class Concurrent::MutexAtomicBoolean - extend ::Concurrent::Synchronization::SafeInitialization - - # Creates a new `AtomicBoolean` with the given initial value. - # - # @param initial [Boolean] the initial value - # @return [MutexAtomicBoolean] a new instance of MutexAtomicBoolean - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#12 - def initialize(initial = T.unsafe(nil)); end - - # Is the current value `false` - # - # @return [Boolean] true if the current value is `false`, else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#34 - def false?; end - - # Explicitly sets the value to false. - # - # @return [Boolean] true if value has changed, otherwise false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#44 - def make_false; end - - # Explicitly sets the value to true. - # - # @return [Boolean] true if value has changed, otherwise false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#39 - def make_true; end - - # Is the current value `true` - # - # @return [Boolean] true if the current value is `true`, else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#29 - def true?; end - - # Retrieves the current `Boolean` value. - # - # @return [Boolean] the current value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#19 - def value; end - - # Explicitly sets the value. - # - # @param value [Boolean] the new value to be set - # @return [Boolean] the current value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#24 - def value=(value); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#51 - def synchronize; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#62 - def ns_make_value(value); end -end - -# A numeric value that can be updated atomically. Reads and writes to an atomic -# fixnum and thread-safe and guaranteed to succeed. Reads and writes may block -# briefly but no explicit locking is required. -# -# -# ## Thread-safe Variable Classes -# -# Each of the thread-safe variable classes is designed to solve a different -# problem. In general: -# -# * *{Concurrent::Agent}:* Shared, mutable variable providing independent, -# uncoordinated, *asynchronous* change of individual values. Best used when -# the value will undergo frequent, complex updates. Suitable when the result -# of an update does not need to be known immediately. -# * *{Concurrent::Atom}:* Shared, mutable variable providing independent, -# uncoordinated, *synchronous* change of individual values. Best used when -# the value will undergo frequent reads but only occasional, though complex, -# updates. Suitable when the result of an update must be known immediately. -# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated -# atomically. Updates are synchronous but fast. Best used when updates a -# simple set operations. Not suitable when updates are complex. -# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar -# but optimized for the given data type. -# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used -# when two or more threads need to exchange data. The threads will pair then -# block on each other until the exchange is complete. -# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread -# must give a value to another, which must take the value. The threads will -# block on each other until the exchange is complete. -# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which -# holds a different value for each thread which has access. Often used as -# an instance variable in objects which must maintain different state -# for different threads. -# * *{Concurrent::TVar}:* Shared, mutable variables which provide -# *coordinated*, *synchronous*, change of *many* stated. Used when multiple -# value must change together, in an all-or-nothing transaction. -# Performance: -# -# ``` -# Testing with ruby 2.1.2 -# Testing with Concurrent::MutexAtomicFixnum... -# 3.130000 0.000000 3.130000 ( 3.136505) -# Testing with Concurrent::CAtomicFixnum... -# 0.790000 0.000000 0.790000 ( 0.785550) -# -# Testing with jruby 1.9.3 -# Testing with Concurrent::MutexAtomicFixnum... -# 5.460000 2.460000 7.920000 ( 3.715000) -# Testing with Concurrent::JavaAtomicFixnum... -# 4.520000 0.030000 4.550000 ( 1.187000) -# ``` -# -# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicLong.html java.util.concurrent.atomic.AtomicLong -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#9 -class Concurrent::MutexAtomicFixnum - extend ::Concurrent::Synchronization::SafeInitialization - - # Creates a new `AtomicFixnum` with the given initial value. - # - # @param initial [Fixnum] the initial value - # @raise [ArgumentError] if the initial value is not a `Fixnum` - # @return [MutexAtomicFixnum] a new instance of MutexAtomicFixnum - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#13 - def initialize(initial = T.unsafe(nil)); end - - # Atomically sets the value to the given updated value if the current - # value == the expected value. - # - # @param expect [Fixnum] the expected value - # @param update [Fixnum] the new value - # @return [Boolean] true if the value was updated else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#44 - def compare_and_set(expect, update); end - - # Decreases the current value by the given amount (defaults to 1). - # - # @param delta [Fixnum] the amount by which to decrease the current value - # @return [Fixnum] the current value after decrementation - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#37 - def decrement(delta = T.unsafe(nil)); end - - # Decreases the current value by the given amount (defaults to 1). - # - # @param delta [Fixnum] the amount by which to decrease the current value - # @return [Fixnum] the current value after decrementation - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#37 - def down(delta = T.unsafe(nil)); end - - # Increases the current value by the given amount (defaults to 1). - # - # @param delta [Fixnum] the amount by which to increase the current value - # @return [Fixnum] the current value after incrementation - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#30 - def increment(delta = T.unsafe(nil)); end - - # Increases the current value by the given amount (defaults to 1). - # - # @param delta [Fixnum] the amount by which to increase the current value - # @return [Fixnum] the current value after incrementation - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#30 - def up(delta = T.unsafe(nil)); end - - # Pass the current value to the given block, replacing it - # with the block's result. May retry if the value changes - # during the block's execution. - # - # @return [Object] the new value - # @yield [Object] Calculate a new value for the atomic reference using - # given (old) value - # @yieldparam old_value [Object] the starting value of the atomic reference - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#56 - def update; end - - # Retrieves the current `Fixnum` value. - # - # @return [Fixnum] the current value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#20 - def value; end - - # Explicitly sets the value. - # - # @param value [Fixnum] the new value to be set - # @raise [ArgumentError] if the new value is not a `Fixnum` - # @return [Fixnum] the current value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#25 - def value=(value); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#65 - def synchronize; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#76 - def ns_set(value); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#9 -class Concurrent::MutexAtomicReference - include ::Concurrent::AtomicDirectUpdate - include ::Concurrent::AtomicNumericCompareAndSetWrapper - extend ::Concurrent::Synchronization::SafeInitialization - - # @param value [Object] The initial value. - # @return [MutexAtomicReference] a new instance of MutexAtomicReference - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#16 - def initialize(value = T.unsafe(nil)); end - - # Atomically sets the value to the given updated value if - # the current value == the expected value. - # - # that the actual value was not equal to the expected value. - # - # @param old_value [Object] the expected value - # @param new_value [Object] the new value - # @return [Boolean] `true` if successful. A `false` return indicates - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#45 - def _compare_and_set(old_value, new_value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb#10 - def compare_and_swap(old_value, new_value); end - - # Gets the current value. - # - # @return [Object] the current value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#23 - def get; end - - # Atomically sets to the given value and returns the old value. - # - # @param new_value [Object] the new value - # @return [Object] the old value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#35 - def get_and_set(new_value); end - - # Sets to the given value. - # - # @param new_value [Object] the new value - # @return [Object] the new value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#29 - def set(new_value); end - - # Atomically sets to the given value and returns the old value. - # - # @param new_value [Object] the new value - # @return [Object] the old value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#35 - def swap(new_value); end - - # Gets the current value. - # - # @return [Object] the current value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#23 - def value; end - - # Sets to the given value. - # - # @param new_value [Object] the new value - # @return [Object] the new value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#29 - def value=(new_value); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#59 - def synchronize; end -end - -# A synchronization object that allows one thread to wait on multiple other threads. -# The thread that will wait creates a `CountDownLatch` and sets the initial value -# (normally equal to the number of other threads). The initiating thread passes the -# latch to the other threads then waits for the other threads by calling the `#wait` -# method. Each of the other threads calls `#count_down` when done with its work. -# When the latch counter reaches zero the waiting thread is unblocked and continues -# with its work. A `CountDownLatch` can be used only once. Its value cannot be reset. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb#9 -class Concurrent::MutexCountDownLatch < ::Concurrent::Synchronization::LockableObject - # Create a new `CountDownLatch` with the initial `count`. - # - # @param count [new] the initial count - # @raise [ArgumentError] if `count` is not an integer or is less than zero - # @return [MutexCountDownLatch] a new instance of MutexCountDownLatch - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb#12 - def initialize(count = T.unsafe(nil)); end - - # The current value of the counter. - # - # @return [Fixnum] the current value of the counter - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb#34 - def count; end - - # Signal the latch to decrement the counter. Will signal all blocked threads when - # the `count` reaches zero. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb#26 - def count_down; end - - # Block on the latch until the counter reaches zero or until `timeout` is reached. - # - # @param timeout [Fixnum] the number of seconds to wait for the counter or `nil` - # to block indefinitely - # @return [Boolean] `true` if the `count` reaches zero else false on `timeout` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb#21 - def wait(timeout = T.unsafe(nil)); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb#40 - def ns_initialize(count); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#9 -class Concurrent::MutexSemaphore < ::Concurrent::Synchronization::LockableObject - # @return [MutexSemaphore] a new instance of MutexSemaphore - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#12 - def initialize(count); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#20 - def acquire(permits = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#38 - def available_permits; end - - # Acquires and returns all permits that are immediately available. - # - # @return [Integer] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#47 - def drain_permits; end - - # Shrinks the number of available permits by the indicated reduction. - # - # @param reduction [Fixnum] Number of permits to remove. - # @raise [ArgumentError] if `reduction` is not an integer or is negative - # @raise [ArgumentError] if `@free` - `@reduction` is less than zero - # @return [nil] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#99 - def reduce_permits(reduction); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#77 - def release(permits = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#54 - def try_acquire(permits = T.unsafe(nil), timeout = T.unsafe(nil)); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#110 - def ns_initialize(count); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#117 - def try_acquire_now(permits); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#127 - def try_acquire_timed(permits, timeout); end -end - -# Various classes within allows for +nil+ values to be stored, -# so a special +NULL+ token is required to indicate the "nil-ness". -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/constants.rb#6 -Concurrent::NULL = T.let(T.unsafe(nil), Object) - -# Suppresses all output when used for logging. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#108 -Concurrent::NULL_LOGGER = T.let(T.unsafe(nil), Proc) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/options.rb#6 -module Concurrent::Options - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/options.rb#27 - def executor(executor_identifier); end - - # Get the requested `Executor` based on the values set in the options hash. - # - # @option opts - # @param opts [Hash] the options defining the requested executor - # @return [Executor, nil] the requested thread pool, or nil when no option specified - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/options.rb#19 - def executor_from_options(opts = T.unsafe(nil)); end - end -end - -# Promises are inspired by the JavaScript [Promises/A](http://wiki.commonjs.org/wiki/Promises/A) -# and [Promises/A+](http://promises-aplus.github.io/promises-spec/) specifications. -# -# > A promise represents the eventual value returned from the single -# > completion of an operation. -# -# Promises are similar to futures and share many of the same behaviours. -# Promises are far more robust, however. Promises can be chained in a tree -# structure where each promise may have zero or more children. Promises are -# chained using the `then` method. The result of a call to `then` is always -# another promise. Promises are resolved asynchronously (with respect to the -# main thread) but in a strict order: parents are guaranteed to be resolved -# before their children, children before their younger siblings. The `then` -# method takes two parameters: an optional block to be executed upon parent -# resolution and an optional callable to be executed upon parent failure. The -# result of each promise is passed to each of its children upon resolution. -# When a promise is rejected all its children will be summarily rejected and -# will receive the reason. -# -# Promises have several possible states: *:unscheduled*, *:pending*, -# *:processing*, *:rejected*, or *:fulfilled*. These are also aggregated as -# `#incomplete?` and `#complete?`. When a Promise is created it is set to -# *:unscheduled*. Once the `#execute` method is called the state becomes -# *:pending*. Once a job is pulled from the thread pool's queue and is given -# to a thread for processing (often immediately upon `#post`) the state -# becomes *:processing*. The future will remain in this state until processing -# is complete. A future that is in the *:unscheduled*, *:pending*, or -# *:processing* is considered `#incomplete?`. A `#complete?` Promise is either -# *:rejected*, indicating that an exception was thrown during processing, or -# *:fulfilled*, indicating success. If a Promise is *:fulfilled* its `#value` -# will be updated to reflect the result of the operation. If *:rejected* the -# `reason` will be updated with a reference to the thrown exception. The -# predicate methods `#unscheduled?`, `#pending?`, `#rejected?`, and -# `#fulfilled?` can be called at any time to obtain the state of the Promise, -# as can the `#state` method, which returns a symbol. -# -# Retrieving the value of a promise is done through the `value` (alias: -# `deref`) method. Obtaining the value of a promise is a potentially blocking -# operation. When a promise is *rejected* a call to `value` will return `nil` -# immediately. When a promise is *fulfilled* a call to `value` will -# immediately return the current value. When a promise is *pending* a call to -# `value` will block until the promise is either *rejected* or *fulfilled*. A -# *timeout* value can be passed to `value` to limit how long the call will -# block. If `nil` the call will block indefinitely. If `0` the call will not -# block. Any other integer or float value will indicate the maximum number of -# seconds to block. -# -# Promises run on the global thread pool. -# -# ### Examples -# -# Start by requiring promises -# -# ```ruby -# require 'concurrent/promise' -# ``` -# -# Then create one -# -# ```ruby -# p = Concurrent::Promise.execute do -# # do something -# 42 -# end -# ``` -# -# Promises can be chained using the `then` method. The `then` method accepts a -# block and an executor, to be executed on fulfillment, and a callable argument to be executed -# on rejection. The result of the each promise is passed as the block argument -# to chained promises. -# -# ```ruby -# p = Concurrent::Promise.new{10}.then{|x| x * 2}.then{|result| result - 10 }.execute -# ``` -# -# And so on, and so on, and so on... -# -# ```ruby -# p = Concurrent::Promise.fulfill(20). -# then{|result| result - 10 }. -# then{|result| result * 3 }. -# then(executor: different_executor){|result| result % 5 }.execute -# ``` -# -# The initial state of a newly created Promise depends on the state of its parent: -# - if parent is *unscheduled* the child will be *unscheduled* -# - if parent is *pending* the child will be *pending* -# - if parent is *fulfilled* the child will be *pending* -# - if parent is *rejected* the child will be *pending* (but will ultimately be *rejected*) -# -# Promises are executed asynchronously from the main thread. By the time a -# child Promise finishes initialization it may be in a different state than its -# parent (by the time a child is created its parent may have completed -# execution and changed state). Despite being asynchronous, however, the order -# of execution of Promise objects in a chain (or tree) is strictly defined. -# -# There are multiple ways to create and execute a new `Promise`. Both ways -# provide identical behavior: -# -# ```ruby -# # create, operate, then execute -# p1 = Concurrent::Promise.new{ "Hello World!" } -# p1.state #=> :unscheduled -# p1.execute -# -# # create and immediately execute -# p2 = Concurrent::Promise.new{ "Hello World!" }.execute -# -# # execute during creation -# p3 = Concurrent::Promise.execute{ "Hello World!" } -# ``` -# -# Once the `execute` method is called a `Promise` becomes `pending`: -# -# ```ruby -# p = Concurrent::Promise.execute{ "Hello, world!" } -# p.state #=> :pending -# p.pending? #=> true -# ``` -# -# Wait a little bit, and the promise will resolve and provide a value: -# -# ```ruby -# p = Concurrent::Promise.execute{ "Hello, world!" } -# sleep(0.1) -# -# p.state #=> :fulfilled -# p.fulfilled? #=> true -# p.value #=> "Hello, world!" -# ``` -# -# If an exception occurs, the promise will be rejected and will provide -# a reason for the rejection: -# -# ```ruby -# p = Concurrent::Promise.execute{ raise StandardError.new("Here comes the Boom!") } -# sleep(0.1) -# -# p.state #=> :rejected -# p.rejected? #=> true -# p.reason #=> "#" -# ``` -# -# #### Rejection -# -# When a promise is rejected all its children will be rejected and will -# receive the rejection `reason` as the rejection callable parameter: -# -# ```ruby -# p = Concurrent::Promise.execute { Thread.pass; raise StandardError } -# -# c1 = p.then(-> reason { 42 }) -# c2 = p.then(-> reason { raise 'Boom!' }) -# -# c1.wait.state #=> :fulfilled -# c1.value #=> 45 -# c2.wait.state #=> :rejected -# c2.reason #=> # -# ``` -# -# Once a promise is rejected it will continue to accept children that will -# receive immediately rejection (they will be executed asynchronously). -# -# #### Aliases -# -# The `then` method is the most generic alias: it accepts a block to be -# executed upon parent fulfillment and a callable to be executed upon parent -# rejection. At least one of them should be passed. The default block is `{ -# |result| result }` that fulfills the child with the parent value. The -# default callable is `{ |reason| raise reason }` that rejects the child with -# the parent reason. -# -# - `on_success { |result| ... }` is the same as `then {|result| ... }` -# - `rescue { |reason| ... }` is the same as `then(Proc.new { |reason| ... } )` -# - `rescue` is aliased by `catch` and `on_error` -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#190 -class Concurrent::Promise < ::Concurrent::IVar - # Initialize a new Promise with the provided options. - # - # @option opts - # @option opts - # @option opts - # @option opts - # @param opts [Hash] a customizable set of options - # @raise [ArgumentError] if no block is given - # @return [Promise] a new instance of Promise - # @see http://wiki.commonjs.org/wiki/Promises/A - # @see http://promises-aplus.github.io/promises-spec/ - # @yield The block operation to be performed asynchronously. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#210 - def initialize(opts = T.unsafe(nil), &block); end - - # Chain onto this promise an action to be undertaken on failure - # (rejection). - # - # @return [Promise] self - # @yield The block to execute - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#360 - def catch(&block); end - - # Execute an `:unscheduled` `Promise`. Immediately sets the state to `:pending` and - # passes the block to a new thread/thread pool for eventual execution. - # Does nothing if the `Promise` is in any state other than `:unscheduled`. - # - # @return [Promise] a reference to `self` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#246 - def execute; end - - # Set the `IVar` to failed due to some error and wake or notify all threads waiting on it. - # - # @param reason [Object] for the failure - # @raise [Concurrent::MultipleAssignmentError] if the `IVar` has already - # been set or otherwise completed - # @raise [Concurrent::PromiseExecutionError] if not the root promise - # @return [IVar] self - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#278 - def fail(reason = T.unsafe(nil)); end - - # Yield the successful result to the block that returns a promise. If that - # promise is also successful the result is the result of the yielded promise. - # If either part fails the whole also fails. - # - # @example - # Promise.execute { 1 }.flat_map { |v| Promise.execute { v + 2 } }.value! #=> 3 - # @return [Promise] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#375 - def flat_map(&block); end - - # Chain onto this promise an action to be undertaken on failure - # (rejection). - # - # @return [Promise] self - # @yield The block to execute - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#360 - def on_error(&block); end - - # Chain onto this promise an action to be undertaken on success - # (fulfillment). - # - # @raise [ArgumentError] - # @return [Promise] self - # @yield The block to execute - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#349 - def on_success(&block); end - - # Chain onto this promise an action to be undertaken on failure - # (rejection). - # - # @return [Promise] self - # @yield The block to execute - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#360 - def rescue(&block); end - - # Set the `IVar` to a value and wake or notify all threads waiting on it. - # - # @param value [Object] the value to store in the `IVar` - # @raise [ArgumentError] if both a value and a block are given - # @raise [Concurrent::MultipleAssignmentError] if the `IVar` has already - # been set or otherwise completed - # @raise [Concurrent::PromiseExecutionError] if not the root promise - # @return [IVar] self - # @yield A block operation to use for setting the value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#262 - def set(value = T.unsafe(nil), &block); end - - # Chain a new promise off the current promise. - # - # @overload then - # @overload then - # @raise [ArgumentError] - # @return [Promise] the new promise - # @yield The block operation to be performed asynchronously. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#314 - def then(*args, &block); end - - # Builds a promise that produces the result of self and others in an Array - # and fails if any of them fails. - # - # @overload zip - # @overload zip - # @return [Promise] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#440 - def zip(*others); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#551 - def complete(success, value, reason); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#545 - def notify_child(child); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#481 - def ns_initialize(value, opts); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#533 - def on_fulfill(result); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#539 - def on_reject(reason); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#562 - def realize(task); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#528 - def root?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#520 - def set_pending; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#570 - def set_state!(success, value, reason); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#576 - def synchronized_set_state!(success, value, reason); end - - class << self - # Aggregate a collection of zero or more promises under a composite promise, - # execute the aggregated promises and collect them into a standard Ruby array, - # call the given Ruby `Ennnumerable` predicate (such as `any?`, `all?`, `none?`, - # or `one?`) on the collection checking for the success or failure of each, - # then executing the composite's `#then` handlers if the predicate returns - # `true` or executing the composite's `#rescue` handlers if the predicate - # returns false. - # - # - # The returned promise will not yet have been executed. Additional `#then` - # and `#rescue` handlers may still be provided. Once the returned promise - # is execute the aggregate promises will be also be executed (if they have - # not been executed already). The results of the aggregate promises will - # be checked upon completion. The necessary `#then` and `#rescue` blocks - # on the aggregating promise will then be executed as appropriate. If the - # `#rescue` handlers are executed the raises exception will be - # `Concurrent::PromiseExecutionError`. - # - # @param promises [Array] Zero or more promises to aggregate - # @return [Promise] an unscheduled (not executed) promise that aggregates - # the promises given as arguments - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#505 - def aggregate(method, *promises); end - - # Aggregates a collection of promises and executes the `then` condition - # if all aggregated promises succeed. Executes the `rescue` handler with - # a `Concurrent::PromiseExecutionError` if any of the aggregated promises - # fail. Upon execution will execute any of the aggregate promises that - # were not already executed. - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#464 - def all?(*promises); end - - # Aggregates a collection of promises and executes the `then` condition - # if any aggregated promises succeed. Executes the `rescue` handler with - # a `Concurrent::PromiseExecutionError` if any of the aggregated promises - # fail. Upon execution will execute any of the aggregate promises that - # were not already executed. - # - # - # The returned promise will not yet have been executed. Additional `#then` - # and `#rescue` handlers may still be provided. Once the returned promise - # is execute the aggregate promises will be also be executed (if they have - # not been executed already). The results of the aggregate promises will - # be checked upon completion. The necessary `#then` and `#rescue` blocks - # on the aggregating promise will then be executed as appropriate. If the - # `#rescue` handlers are executed the raises exception will be - # `Concurrent::PromiseExecutionError`. - # - # @param promises [Array] Zero or more promises to aggregate - # @return [Promise] an unscheduled (not executed) promise that aggregates - # the promises given as arguments - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#475 - def any?(*promises); end - - # Create a new `Promise` object with the given block, execute it, and return the - # `:pending` object. - # - # @example - # promise = Concurrent::Promise.execute{ sleep(1); 42 } - # promise.state #=> :pending - # @option opts - # @option opts - # @option opts - # @option opts - # @param opts [Hash] a customizable set of options - # @raise [ArgumentError] if no block is given - # @return [Promise] the newly created `Promise` in the `:pending` state - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#296 - def execute(opts = T.unsafe(nil), &block); end - - # Create a new `Promise` and fulfill it immediately. - # - # @option opts - # @option opts - # @option opts - # @option opts - # @param opts [Hash] a customizable set of options - # @raise [ArgumentError] if no block is given - # @return [Promise] the newly created `Promise` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#224 - def fulfill(value, opts = T.unsafe(nil)); end - - # Create a new `Promise` and reject it immediately. - # - # @option opts - # @option opts - # @option opts - # @option opts - # @param opts [Hash] a customizable set of options - # @raise [ArgumentError] if no block is given - # @return [Promise] the newly created `Promise` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#237 - def reject(reason, opts = T.unsafe(nil)); end - - # Builds a promise that produces the result of promises in an Array - # and fails if any of them fails. - # - # @overload zip - # @overload zip - # @return [Promise] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#409 - def zip(*promises); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#11 -class Concurrent::PromiseExecutionError < ::StandardError; end - -# {include:file:docs-source/promises-main.md} -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#13 -module Concurrent::Promises - extend ::Concurrent::Promises::FactoryMethods::Configuration - extend ::Concurrent::Promises::FactoryMethods -end - -# @abstract -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2047 -class Concurrent::Promises::AbstractAnyPromise < ::Concurrent::Promises::BlockedPromise; end - -# Common ancestor of {Event} and {Future} classes, many shared methods are defined here. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#513 -class Concurrent::Promises::AbstractEventFuture < ::Concurrent::Synchronization::Object - include ::Concurrent::Promises::InternalStates - extend ::Concurrent::Synchronization::SafeInitialization - - # @return [AbstractEventFuture] a new instance of AbstractEventFuture - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#522 - def initialize(promise, default_executor); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#137 - def __initialize_atomic_fields__; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#738 - def add_callback_clear_delayed_node(node); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#733 - def add_callback_notify_blocked(promise, index); end - - # For inspection. - # - # @return [Array] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#702 - def blocks; end - - # For inspection. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#710 - def callbacks; end - - # Shortcut of {#chain_on} with default `:io` executor supplied. - # - # @return [Future] - # @see #chain_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#596 - def chain(*args, &task); end - - # Chains the task to be executed asynchronously on executor after it is resolved. - # - # @overload an_event.chain_on - # @overload a_future.chain_on - # @param executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. The task is executed on it, default executor remains unchanged. - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yield section). - # @return [Future] - # @yieldreturn will become result of the returned Future. - # Its returned value becomes {Future#value} fulfilling it, - # raised exception becomes {Future#reason} rejecting it. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#614 - def chain_on(executor, *args, &task); end - - # Resolves the resolvable when receiver is resolved. - # - # @param resolvable [Resolvable] - # @return [self] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#629 - def chain_resolvable(resolvable); end - - # Returns default executor. - # - # @return [Executor] default executor - # @see #with_default_executor - # @see FactoryMethods#future_on - # @see FactoryMethods#resolvable_future - # @see FactoryMethods#any_fulfilled_future_on - # @see similar - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#590 - def default_executor; end - - # @return [String] Short string representation. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#619 - def inspect; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#93 - def internal_state; end - - # Shortcut of {#on_resolution_using} with default `:io` executor supplied. - # - # @return [self] - # @see #on_resolution_using - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#637 - def on_resolution(*args, &callback); end - - # Stores the callback to be executed synchronously on resolving thread after it is - # resolved. - # - # @overload an_event.on_resolution! - # @overload a_future.on_resolution! - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yield section). - # @return [self] - # @yieldreturn is forgotten. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#655 - def on_resolution!(*args, &callback); end - - # Stores the callback to be executed asynchronously on executor after it is resolved. - # - # @overload an_event.on_resolution_using - # @overload a_future.on_resolution_using - # @param executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. The task is executed on it, default executor remains unchanged. - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yield section). - # @return [self] - # @yieldreturn is forgotten. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#673 - def on_resolution_using(executor, *args, &callback); end - - # Is it in pending state? - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#549 - def pending?; end - - # For inspection. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#716 - def promise; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#688 - def resolve_with(state, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end - - # Is it in resolved state? - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#555 - def resolved?; end - - # Returns its state. - # - # @overload an_event.state - # @overload a_future.state - # @return [Symbol] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#543 - def state; end - - # Resolves the resolvable when receiver is resolved. - # - # @param resolvable [Resolvable] - # @return [self] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#629 - def tangle(resolvable); end - - # @return [String] Short string representation. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#619 - def to_s; end - - # Propagates touch. Requests all the delayed futures, which it depends on, to be - # executed. This method is called by any other method requiring resolved state, like {#wait}. - # - # @return [self] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#562 - def touch; end - - # For inspection. - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#722 - def touched?; end - - # Wait (block the Thread) until receiver is {#resolved?}. - # Calls {Concurrent::AbstractEventFuture#touch}. - # - # @note This function potentially blocks current thread until the Future is resolved. - # Be careful it can deadlock. Try to chain instead. - # @param timeout [Numeric] the maximum time in second to wait. - # @return [self, true, false] self implies timeout was not used, true implies timeout was used - # and it was resolved, false implies it was not resolved within timeout. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#578 - def wait(timeout = T.unsafe(nil)); end - - # For inspection. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#728 - def waiting_threads; end - - # Crates new object with same class with the executor set as its new default executor. - # Any futures depending on it will use the new default executor. - # - # @abstract - # @raise [NotImplementedError] - # @return [AbstractEventFuture] - # @see Event#with_default_executor - # @see Future#with_default_executor - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#683 - def with_default_executor(executor); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#743 - def with_hidden_resolvable; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#750 - def add_callback(method, *args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#812 - def async_callback_on_resolution(state, executor, args, callback); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#796 - def call_callback(method, state, args); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#800 - def call_callbacks(state); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#763 - def callback_clear_delayed_node(state, node); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#818 - def callback_notify_blocked(state, promise, index); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#105 - def compare_and_set_internal_state(expected, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#97 - def internal_state=(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#101 - def swap_internal_state(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#109 - def update_internal_state(&block); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#768 - def wait_until_resolved(timeout); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#808 - def with_async(executor, *args, &block); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1796 -class Concurrent::Promises::AbstractFlatPromise < ::Concurrent::Promises::BlockedPromise - # @return [AbstractFlatPromise] a new instance of AbstractFlatPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1798 - def initialize(delayed_because, blockers_count, event_or_future); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1808 - def touch; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1828 - def add_delayed_of(future); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1820 - def on_resolvable(resolved_future, index); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1824 - def resolvable?(countdown, future, index); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1816 - def touched?; end -end - -# @abstract -# @private -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1549 -class Concurrent::Promises::AbstractPromise < ::Concurrent::Synchronization::Object - include ::Concurrent::Promises::InternalStates - extend ::Concurrent::Synchronization::SafeInitialization - - # @return [AbstractPromise] a new instance of AbstractPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1553 - def initialize(future); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1564 - def default_executor; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1581 - def delayed_because; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1558 - def event; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1558 - def future; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1575 - def inspect; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1568 - def state; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1575 - def to_s; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1572 - def touch; end - - private - - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1592 - def evaluate_to(*args, block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1587 - def resolve_with(new_state, raise_on_reassign = T.unsafe(nil)); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2084 -class Concurrent::Promises::AnyFulfilledFuturePromise < ::Concurrent::Promises::AnyResolvedFuturePromise - private - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2088 - def resolvable?(countdown, event_or_future, index); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2050 -class Concurrent::Promises::AnyResolvedEventPromise < ::Concurrent::Promises::AbstractAnyPromise - # @return [AnyResolvedEventPromise] a new instance of AnyResolvedEventPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2054 - def initialize(delayed, blockers_count, default_executor); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2062 - def on_resolvable(resolved_future, index); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2058 - def resolvable?(countdown, future, index); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2067 -class Concurrent::Promises::AnyResolvedFuturePromise < ::Concurrent::Promises::AbstractAnyPromise - # @return [AnyResolvedFuturePromise] a new instance of AnyResolvedFuturePromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2071 - def initialize(delayed, blockers_count, default_executor); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2079 - def on_resolvable(resolved_future, index); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2075 - def resolvable?(countdown, future, index); end -end - -# @abstract -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1619 -class Concurrent::Promises::BlockedPromise < ::Concurrent::Promises::InnerPromise - # @return [BlockedPromise] a new instance of BlockedPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1661 - def initialize(delayed, blockers_count, future); end - - # for inspection only - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1683 - def blocked_by; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1674 - def delayed_because; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1667 - def on_blocker_resolution(future, index); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1678 - def touch; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1691 - def clear_and_propagate_touch(stack_or_element = T.unsafe(nil)); end - - # @raise [NotImplementedError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1710 - def on_resolvable(resolved_future, index); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1706 - def process_on_blocker_resolution(future, index); end - - # @return [true, false] if resolvable - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1702 - def resolvable?(countdown, future, index); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1652 - def add_delayed(delayed1, delayed2); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1645 - def new_blocked_by(blockers, *args, &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1623 - def new_blocked_by1(blocker, *args, &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1630 - def new_blocked_by2(blocker1, blocker2, *args, &block); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb#29 - def new(*args, &block); end - end -end - -# @abstract -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1716 -class Concurrent::Promises::BlockedTaskPromise < ::Concurrent::Promises::BlockedPromise - # @raise [ArgumentError] - # @return [BlockedTaskPromise] a new instance of BlockedTaskPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1717 - def initialize(delayed, blockers_count, default_executor, executor, args, &task); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1725 - def executor; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1766 -class Concurrent::Promises::ChainPromise < ::Concurrent::Promises::BlockedTaskPromise - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1769 - def on_resolvable(resolved_future, index); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2095 -class Concurrent::Promises::DelayPromise < ::Concurrent::Promises::InnerPromise - # @return [DelayPromise] a new instance of DelayPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2097 - def initialize(default_executor); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2108 - def delayed_because; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2104 - def touch; end -end - -# Represents an event which will happen in future (will be resolved). The event is either -# pending or resolved. It should be always resolved. Use {Future} to communicate rejections and -# cancellation. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#826 -class Concurrent::Promises::Event < ::Concurrent::Promises::AbstractEventFuture - # Creates a new event or a future which will be resolved when receiver and other are. - # Returns an event if receiver and other are events, otherwise returns a future. - # If just one of the parties is Future then the result - # of the returned future is equal to the result of the supplied future. If both are futures - # then the result is as described in {FactoryMethods#zip_futures_on}. - # - # @return [Future, Event] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#839 - def &(other); end - - # Creates a new event which will be resolved when the first of receiver, `event_or_future` - # resolves. - # - # @return [Event] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#853 - def any(event_or_future); end - - # Creates new event dependent on receiver which will not evaluate until touched, see {#touch}. - # In other words, it inserts delay into the chain of Futures making rest of it lazy evaluated. - # - # @return [Event] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#863 - def delay; end - - # Creates new event dependent on receiver scheduled to execute on/in intended_time. - # In time is interpreted from the moment the receiver is resolved, therefore it inserts - # delay into the chain. - # - # @param intended_time [Numeric, Time] `Numeric` means to run in `intended_time` seconds. - # `Time` means to run on `intended_time`. - # @return [Event] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#875 - def schedule(intended_time); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#596 - def then(*args, &task); end - - # Returns self, since this is event - # - # @return [Event] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#893 - def to_event; end - - # Converts event to a future. The future is fulfilled when the event is resolved, the future may never fail. - # - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#885 - def to_future; end - - # Crates new object with same class with the executor set as its new default executor. - # Any futures depending on it will use the new default executor. - # - # @return [Event] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#899 - def with_default_executor(executor); end - - # Creates a new event or a future which will be resolved when receiver and other are. - # Returns an event if receiver and other are events, otherwise returns a future. - # If just one of the parties is Future then the result - # of the returned future is equal to the result of the supplied future. If both are futures - # then the result is as described in {FactoryMethods#zip_futures_on}. - # - # @return [Future, Event] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#839 - def zip(other); end - - # Creates a new event which will be resolved when the first of receiver, `event_or_future` - # resolves. - # - # @return [Event] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#853 - def |(event_or_future); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#910 - def callback_on_resolution(state, args, callback); end - - # @raise [Concurrent::MultipleAssignmentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#905 - def rejected_resolution(raise_on_reassign, state); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1972 -class Concurrent::Promises::EventWrapperPromise < ::Concurrent::Promises::BlockedPromise - # @return [EventWrapperPromise] a new instance of EventWrapperPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1973 - def initialize(delayed, blockers_count, default_executor); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1979 - def on_resolvable(resolved_future, index); end -end - -# Container of all {Future}, {Event} factory methods. They are never constructed directly with -# new. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#46 -module Concurrent::Promises::FactoryMethods - include ::Concurrent::Promises::FactoryMethods::Configuration - extend ::Concurrent::ReInclude - extend ::Concurrent::Promises::FactoryMethods::Configuration - extend ::Concurrent::Promises::FactoryMethods - - # Shortcut of {#any_resolved_future_on} with default `:io` executor supplied. - # - # @return [Future] - # @see #any_resolved_future_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#278 - def any(*futures_and_or_events); end - - # Shortcut of {#any_event_on} with default `:io` executor supplied. - # - # @return [Event] - # @see #any_event_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#319 - def any_event(*futures_and_or_events); end - - # Creates a new event which becomes resolved after the first futures_and_or_events resolves. - # If resolved it does not propagate {Concurrent::AbstractEventFuture#touch}, leaving delayed - # futures un-executed if they are not required any more. - # - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @param futures_and_or_events [AbstractEventFuture] - # @return [Event] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#329 - def any_event_on(default_executor, *futures_and_or_events); end - - # Shortcut of {#any_fulfilled_future_on} with default `:io` executor supplied. - # - # @return [Future] - # @see #any_fulfilled_future_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#300 - def any_fulfilled_future(*futures_and_or_events); end - - # Creates a new future which is resolved after the first futures_and_or_events is fulfilled. - # Its result equals the result of the first resolved future or if all futures_and_or_events reject, - # it has reason of the last rejected future. - # If resolved it does not propagate {Concurrent::AbstractEventFuture#touch}, leaving delayed - # futures un-executed if they are not required any more. - # If event is supplied, which does not have value and can be only resolved, it's - # represented as `:fulfilled` with value `nil`. - # - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @param futures_and_or_events [AbstractEventFuture] - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#313 - def any_fulfilled_future_on(default_executor, *futures_and_or_events); end - - # Shortcut of {#any_resolved_future_on} with default `:io` executor supplied. - # - # @return [Future] - # @see #any_resolved_future_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#278 - def any_resolved_future(*futures_and_or_events); end - - # Creates a new future which is resolved after the first futures_and_or_events is resolved. - # Its result equals the result of the first resolved future. - # If resolved it does not propagate {Concurrent::AbstractEventFuture#touch}, leaving delayed - # futures un-executed if they are not required any more. - # If event is supplied, which does not have value and can be only resolved, it's - # represented as `:fulfilled` with value `nil`. - # - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @param futures_and_or_events [AbstractEventFuture] - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#294 - def any_resolved_future_on(default_executor, *futures_and_or_events); end - - # Shortcut of {#delay_on} with default `:io` executor supplied. - # - # @return [Future, Event] - # @see #delay_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#190 - def delay(*args, &task); end - - # Creates a new event or future which is resolved only after it is touched, - # see {Concurrent::AbstractEventFuture#touch}. - # - # @overload delay_on - # @overload delay_on - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#207 - def delay_on(default_executor, *args, &task); end - - # Creates a resolved future which will be fulfilled with the given value. - # - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @param value [Object] - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#127 - def fulfilled_future(value, default_executor = T.unsafe(nil)); end - - # Shortcut of {#future_on} with default `:io` executor supplied. - # - # @return [Future] - # @see #future_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#94 - def future(*args, &task); end - - # Constructs a new Future which will be resolved after block is evaluated on default executor. - # Evaluation begins immediately. - # - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yield section). - # @return [Future] - # @yield [*args] to the task. - # @yieldreturn will become result of the returned Future. - # Its returned value becomes {Future#value} fulfilling it, - # raised exception becomes {Future#reason} rejecting it. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#106 - def future_on(default_executor, *args, &task); end - - # General constructor. Behaves differently based on the argument's type. It's provided for convenience - # but it's better to be explicit. - # - # @overload make_future - # @overload make_future - # @overload make_future - # @overload make_future - # @overload make_future - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @return [Event, Future] - # @see rejected_future, resolved_event, fulfilled_future - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#174 - def make_future(argument = T.unsafe(nil), default_executor = T.unsafe(nil)); end - - # Creates a resolved future which will be rejected with the given reason. - # - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @param reason [Object] - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#136 - def rejected_future(reason, default_executor = T.unsafe(nil)); end - - # Shortcut of {#resolvable_event_on} with default `:io` executor supplied. - # - # @return [ResolvableEvent] - # @see #resolvable_event_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#63 - def resolvable_event; end - - # Creates a resolvable event, user is responsible for resolving the event once - # by calling {Promises::ResolvableEvent#resolve}. - # - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @return [ResolvableEvent] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#72 - def resolvable_event_on(default_executor = T.unsafe(nil)); end - - # Shortcut of {#resolvable_future_on} with default `:io` executor supplied. - # - # @return [ResolvableFuture] - # @see #resolvable_future_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#78 - def resolvable_future; end - - # Creates resolvable future, user is responsible for resolving the future once by - # {Promises::ResolvableFuture#resolve}, {Promises::ResolvableFuture#fulfill}, - # or {Promises::ResolvableFuture#reject} - # - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @return [ResolvableFuture] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#88 - def resolvable_future_on(default_executor = T.unsafe(nil)); end - - # Creates resolved event. - # - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @return [Event] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#144 - def resolved_event(default_executor = T.unsafe(nil)); end - - # Creates a resolved future with will be either fulfilled with the given value or rejected with - # the given reason. - # - # @param fulfilled [true, false] - # @param value [Object] - # @param reason [Object] - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#118 - def resolved_future(fulfilled, value, reason, default_executor = T.unsafe(nil)); end - - # Shortcut of {#schedule_on} with default `:io` executor supplied. - # - # @return [Future, Event] - # @see #schedule_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#214 - def schedule(intended_time, *args, &task); end - - # Creates a new event or future which is resolved in intended_time. - # - # @overload schedule_on - # @overload schedule_on - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @param intended_time [Numeric, Time] `Numeric` means to run in `intended_time` seconds. - # `Time` means to run on `intended_time`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#233 - def schedule_on(default_executor, intended_time, *args, &task); end - - # Shortcut of {#zip_futures_on} with default `:io` executor supplied. - # - # @return [Future] - # @see #zip_futures_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#240 - def zip(*futures_and_or_events); end - - # Shortcut of {#zip_events_on} with default `:io` executor supplied. - # - # @return [Event] - # @see #zip_events_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#262 - def zip_events(*futures_and_or_events); end - - # Creates a new event which is resolved after all futures_and_or_events are resolved. - # (Future is resolved when fulfilled or rejected.) - # - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @param futures_and_or_events [AbstractEventFuture] - # @return [Event] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#272 - def zip_events_on(default_executor, *futures_and_or_events); end - - # Shortcut of {#zip_futures_on} with default `:io` executor supplied. - # - # @return [Future] - # @see #zip_futures_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#240 - def zip_futures(*futures_and_or_events); end - - # Creates a new future which is resolved after all futures_and_or_events are resolved. - # Its value is an array of zipped future values. Its reason is an array of reasons for rejection. - # If there is an error it rejects. - # If event is supplied, which does not have value and can be only resolved, it's - # represented as `:fulfilled` with value `nil`. - # - # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. Default executor propagates to chained futures unless overridden with - # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @param futures_and_or_events [AbstractEventFuture] - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#254 - def zip_futures_on(default_executor, *futures_and_or_events); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#50 -module Concurrent::Promises::FactoryMethods::Configuration - # @return [Executor, :io, :fast] the executor which is used when none is supplied - # to a factory method. The method can be overridden in the receivers of - # `include FactoryMethod` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#54 - def default_executor; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1840 -class Concurrent::Promises::FlatEventPromise < ::Concurrent::Promises::AbstractFlatPromise - # @return [FlatEventPromise] a new instance of FlatEventPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1844 - def initialize(delayed, blockers_count, default_executor); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1848 - def process_on_blocker_resolution(future, index); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1873 -class Concurrent::Promises::FlatFuturePromise < ::Concurrent::Promises::AbstractFlatPromise - # @raise [ArgumentError] - # @return [FlatFuturePromise] a new instance of FlatFuturePromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1877 - def initialize(delayed, blockers_count, levels, default_executor); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1884 - def process_on_blocker_resolution(future, index); end -end - -# Represents a value which will become available in future. May reject with a reason instead, -# e.g. when the tasks raises an exception. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#917 -class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture - # Creates a new event or a future which will be resolved when receiver and other are. - # Returns an event if receiver and other are events, otherwise returns a future. - # If just one of the parties is Future then the result - # of the returned future is equal to the result of the supplied future. If both are futures - # then the result is as described in {FactoryMethods#zip_futures_on}. - # - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1070 - def &(other); end - - # Creates a new event which will be resolved when the first of receiver, `event_or_future` - # resolves. Returning future will have value nil if event_or_future is event and resolves - # first. - # - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1085 - def any(event_or_future); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1215 - def apply(args, block); end - - # Creates new future dependent on receiver which will not evaluate until touched, see {#touch}. - # In other words, it inserts delay into the chain of Futures making rest of it lazy evaluated. - # - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1095 - def delay; end - - # Allows rejected Future to be risen with `raise` method. - # If the reason is not an exception `Runtime.new(reason)` is returned. - # - # @example - # raise Promises.rejected_future(StandardError.new("boom")) - # raise Promises.rejected_future("or just boom") - # @raise [Concurrent::Error] when raising not rejected future - # @return [Exception] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1013 - def exception(*args); end - - # Creates new future which will have result of the future returned by receiver. If receiver - # rejects it will have its rejection. - # - # @param level [Integer] how many levels of futures should flatten - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1120 - def flat(level = T.unsafe(nil)); end - - # Creates new event which will be resolved when the returned event by receiver is. - # Be careful if the receiver rejects it will just resolve since Event does not hold reason. - # - # @return [Event] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1130 - def flat_event; end - - # Creates new future which will have result of the future returned by receiver. If receiver - # rejects it will have its rejection. - # - # @param level [Integer] how many levels of futures should flatten - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1120 - def flat_future(level = T.unsafe(nil)); end - - # Is it in fulfilled state? - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#921 - def fulfilled?; end - - # @return [String] Short string representation. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1235 - def inspect; end - - # Shortcut of {#on_fulfillment_using} with default `:io` executor supplied. - # - # @return [self] - # @see #on_fulfillment_using - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1136 - def on_fulfillment(*args, &callback); end - - # Stores the callback to be executed synchronously on resolving thread after it is - # fulfilled. Does nothing on rejection. - # - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yield section). - # @return [self] - # @yield [value, *args] to the callback. - # @yieldreturn is forgotten. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1147 - def on_fulfillment!(*args, &callback); end - - # Stores the callback to be executed asynchronously on executor after it is - # fulfilled. Does nothing on rejection. - # - # @param executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. The task is executed on it, default executor remains unchanged. - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yield section). - # @return [self] - # @yield [value, *args] to the callback. - # @yieldreturn is forgotten. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1159 - def on_fulfillment_using(executor, *args, &callback); end - - # Shortcut of {#on_rejection_using} with default `:io` executor supplied. - # - # @return [self] - # @see #on_rejection_using - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1165 - def on_rejection(*args, &callback); end - - # Stores the callback to be executed synchronously on resolving thread after it is - # rejected. Does nothing on fulfillment. - # - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yield section). - # @return [self] - # @yield [reason, *args] to the callback. - # @yieldreturn is forgotten. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1176 - def on_rejection!(*args, &callback); end - - # Stores the callback to be executed asynchronously on executor after it is - # rejected. Does nothing on fulfillment. - # - # @param executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. The task is executed on it, default executor remains unchanged. - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yield section). - # @return [self] - # @yield [reason, *args] to the callback. - # @yieldreturn is forgotten. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1188 - def on_rejection_using(executor, *args, &callback); end - - # Returns reason of future's rejection. - # Calls {Concurrent::AbstractEventFuture#touch}. - # - # @note This function potentially blocks current thread until the Future is resolved. - # Be careful it can deadlock. Try to chain instead. - # @note Make sure returned `nil` is not confused with timeout, no value when rejected, - # no reason when fulfilled, etc. - # Use more exact methods if needed, like {#wait}, {#value!}, {#result}, etc. - # @param timeout [Numeric] the maximum time in second to wait. - # @param timeout_value [Object] a value returned by the method when it times out - # @return [Object, timeout_value] the reason, or timeout_value on timeout, or nil on fulfillment. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#966 - def reason(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end - - # Is it in rejected state? - # - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#928 - def rejected?; end - - # Shortcut of {#rescue_on} with default `:io` executor supplied. - # - # @return [Future] - # @see #rescue_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1052 - def rescue(*args, &task); end - - # Chains the task to be executed asynchronously on executor after it rejects. Does not run - # the task if it fulfills. It will resolve though, triggering any dependent futures. - # - # @param executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. The task is executed on it, default executor remains unchanged. - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yield section). - # @return [Future] - # @yield [reason, *args] to the task. - # @yieldreturn will become result of the returned Future. - # Its returned value becomes {Future#value} fulfilling it, - # raised exception becomes {Future#reason} rejecting it. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1064 - def rescue_on(executor, *args, &task); end - - # Returns triplet fulfilled?, value, reason. - # Calls {Concurrent::AbstractEventFuture#touch}. - # - # @note This function potentially blocks current thread until the Future is resolved. - # Be careful it can deadlock. Try to chain instead. - # @param timeout [Numeric] the maximum time in second to wait. - # @return [Array(Boolean, Object, Object), nil] triplet of fulfilled?, value, reason, or nil - # on timeout. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#981 - def result(timeout = T.unsafe(nil)); end - - # Allows to use futures as green threads. The receiver has to evaluate to a future which - # represents what should be done next. It basically flattens indefinitely until non Future - # values is returned which becomes result of the returned future. Any encountered exception - # will become reason of the returned future. - # - # @example - # body = lambda do |v| - # v += 1 - # v < 5 ? Promises.future(v, &body) : v - # end - # Promises.future(0, &body).run.value! # => 5 - # @param run_test [#call(value)] an object which when called returns either Future to keep running with - # or nil, then the run completes with the value. - # The run_test can be used to extract the Future from deeper structure, - # or to distinguish Future which is a resulting value from a future - # which is suppose to continue running. - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1210 - def run(run_test = T.unsafe(nil)); end - - # Creates new event dependent on receiver scheduled to execute on/in intended_time. - # In time is interpreted from the moment the receiver is resolved, therefore it inserts - # delay into the chain. - # - # @param intended_time [Numeric, Time] `Numeric` means to run in `intended_time` seconds. - # `Time` means to run on `intended_time`. - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1102 - def schedule(intended_time); end - - # Shortcut of {#then_on} with default `:io` executor supplied. - # - # @return [Future] - # @see #then_on - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1034 - def then(*args, &task); end - - # Chains the task to be executed asynchronously on executor after it fulfills. Does not run - # the task if it rejects. It will resolve though, triggering any dependent futures. - # - # @param executor [Executor, :io, :fast] Instance of an executor or a name of the - # global executor. The task is executed on it, default executor remains unchanged. - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yield section). - # @return [Future] - # @yield [value, *args] to the task. - # @yieldreturn will become result of the returned Future. - # Its returned value becomes {Future#value} fulfilling it, - # raised exception becomes {Future#reason} rejecting it. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1046 - def then_on(executor, *args, &task); end - - # Converts future to event which is resolved when future is resolved by fulfillment or rejection. - # - # @return [Event] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1222 - def to_event; end - - # Returns self, since this is a future - # - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1230 - def to_future; end - - # @return [String] Short string representation. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1235 - def to_s; end - - # Return value of the future. - # Calls {Concurrent::AbstractEventFuture#touch}. - # - # @note This function potentially blocks current thread until the Future is resolved. - # Be careful it can deadlock. Try to chain instead. - # @note Make sure returned `nil` is not confused with timeout, no value when rejected, - # no reason when fulfilled, etc. - # Use more exact methods if needed, like {#wait}, {#value!}, {#result}, etc. - # @param timeout [Numeric] the maximum time in second to wait. - # @param timeout_value [Object] a value returned by the method when it times out - # @return [Object, nil, timeout_value] the value of the Future when fulfilled, - # timeout_value on timeout, - # nil on rejection. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#950 - def value(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end - - # Return value of the future. - # Calls {Concurrent::AbstractEventFuture#touch}. - # - # @note This function potentially blocks current thread until the Future is resolved. - # Be careful it can deadlock. Try to chain instead. - # @note Make sure returned `nil` is not confused with timeout, no value when rejected, - # no reason when fulfilled, etc. - # Use more exact methods if needed, like {#wait}, {#value!}, {#result}, etc. - # @param timeout [Numeric] the maximum time in second to wait. - # @param timeout_value [Object] a value returned by the method when it times out - # @raise [Exception] {#reason} on rejection - # @return [Object, nil, timeout_value] the value of the Future when fulfilled, - # or nil on rejection, - # or timeout_value on timeout. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#997 - def value!(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end - - # Wait (block the Thread) until receiver is {#resolved?}. - # Calls {Concurrent::AbstractEventFuture#touch}. - # - # @note This function potentially blocks current thread until the Future is resolved. - # Be careful it can deadlock. Try to chain instead. - # @param timeout [Numeric] the maximum time in second to wait. - # @raise [Exception] {#reason} on rejection - # @return [self, true, false] self implies timeout was not used, true implies timeout was used - # and it was resolved, false implies it was not resolved within timeout. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#987 - def wait!(timeout = T.unsafe(nil)); end - - # Crates new object with same class with the executor set as its new default executor. - # Any futures depending on it will use the new default executor. - # - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1111 - def with_default_executor(executor); end - - # Creates a new event or a future which will be resolved when receiver and other are. - # Returns an event if receiver and other are events, otherwise returns a future. - # If just one of the parties is Future then the result - # of the returned future is equal to the result of the supplied future. If both are futures - # then the result is as described in {FactoryMethods#zip_futures_on}. - # - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1070 - def zip(other); end - - # Creates a new event which will be resolved when the first of receiver, `event_or_future` - # resolves. Returning future will have value nil if event_or_future is event and resolves - # first. - # - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1085 - def |(event_or_future); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1272 - def async_callback_on_fulfillment(state, executor, args, callback); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1278 - def async_callback_on_rejection(state, executor, args, callback); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1284 - def callback_on_fulfillment(state, args, callback); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1288 - def callback_on_rejection(state, args, callback); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1292 - def callback_on_resolution(state, args, callback); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1251 - def rejected_resolution(raise_on_reassign, state); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1247 - def run_test(v); end - - # @raise [self] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1266 - def wait_until_resolved!(timeout = T.unsafe(nil)); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1984 -class Concurrent::Promises::FutureWrapperPromise < ::Concurrent::Promises::BlockedPromise - # @return [FutureWrapperPromise] a new instance of FutureWrapperPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1985 - def initialize(delayed, blockers_count, default_executor); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1991 - def on_resolvable(resolved_future, index); end -end - -# will be immediately resolved -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1783 -class Concurrent::Promises::ImmediateEventPromise < ::Concurrent::Promises::InnerPromise - # @return [ImmediateEventPromise] a new instance of ImmediateEventPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1784 - def initialize(default_executor); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1789 -class Concurrent::Promises::ImmediateFuturePromise < ::Concurrent::Promises::InnerPromise - # @return [ImmediateFuturePromise] a new instance of ImmediateFuturePromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1790 - def initialize(default_executor, fulfilled, value, reason); end -end - -# @abstract -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1615 -class Concurrent::Promises::InnerPromise < ::Concurrent::Promises::AbstractPromise; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#338 -module Concurrent::Promises::InternalStates; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#397 -class Concurrent::Promises::InternalStates::Fulfilled < ::Concurrent::Promises::InternalStates::ResolvedWithResult - # @return [Fulfilled] a new instance of Fulfilled - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#399 - def initialize(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#407 - def apply(args, block); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#403 - def fulfilled?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#415 - def reason; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#419 - def to_sym; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#411 - def value; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#425 -class Concurrent::Promises::InternalStates::FulfilledArray < ::Concurrent::Promises::InternalStates::Fulfilled - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#426 - def apply(args, block); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#488 -Concurrent::Promises::InternalStates::PENDING = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Pending) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#459 -class Concurrent::Promises::InternalStates::PartiallyRejected < ::Concurrent::Promises::InternalStates::ResolvedWithResult - # @return [PartiallyRejected] a new instance of PartiallyRejected - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#460 - def initialize(value, reason); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#482 - def apply(args, block); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#466 - def fulfilled?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#478 - def reason; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#470 - def to_sym; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#474 - def value; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#351 -class Concurrent::Promises::InternalStates::Pending < ::Concurrent::Promises::InternalStates::State - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#352 - def resolved?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#356 - def to_sym; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#490 -Concurrent::Promises::InternalStates::RESERVED = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Reserved) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#492 -Concurrent::Promises::InternalStates::RESOLVED = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Fulfilled) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#432 -class Concurrent::Promises::InternalStates::Rejected < ::Concurrent::Promises::InternalStates::ResolvedWithResult - # @return [Rejected] a new instance of Rejected - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#433 - def initialize(reason); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#453 - def apply(args, block); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#437 - def fulfilled?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#445 - def reason; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#449 - def to_sym; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#441 - def value; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#362 -class Concurrent::Promises::InternalStates::Reserved < ::Concurrent::Promises::InternalStates::Pending; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#366 -class Concurrent::Promises::InternalStates::ResolvedWithResult < ::Concurrent::Promises::InternalStates::State - # @raise [NotImplementedError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#391 - def apply; end - - # @raise [NotImplementedError] - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#379 - def fulfilled?; end - - # @raise [NotImplementedError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#387 - def reason; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#367 - def resolved?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#375 - def result; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#371 - def to_sym; end - - # @raise [NotImplementedError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#383 - def value; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#340 -class Concurrent::Promises::InternalStates::State - # @raise [NotImplementedError] - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#341 - def resolved?; end - - # @raise [NotImplementedError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#345 - def to_sym; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1748 -class Concurrent::Promises::RescuePromise < ::Concurrent::Promises::BlockedTaskPromise - # @return [RescuePromise] a new instance of RescuePromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1751 - def initialize(delayed, blockers_count, default_executor, executor, args, &task); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1755 - def on_resolvable(resolved_future, index); end -end - -# Marker module of Future, Event resolved manually. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1299 -module Concurrent::Promises::Resolvable - include ::Concurrent::Promises::InternalStates -end - -# A Event which can be resolved by user. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1304 -class Concurrent::Promises::ResolvableEvent < ::Concurrent::Promises::Event - include ::Concurrent::Promises::Resolvable - - # Makes the event resolved, which triggers all dependent futures. - # - # @param raise_on_reassign [Boolean] should method raise exception if already resolved - # @param reserved [true, false] Set to true if the resolvable is {#reserve}d by you, - # marks resolution of reserved resolvable events and futures explicitly. - # Advanced feature, ignore unless you use {Resolvable#reserve} from edge. - # @return [self, false] false is returned when raise_on_reassign is false and the receiver - # is already resolved. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1324 - def resolve(raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end - - # Behaves as {AbstractEventFuture#wait} but has one additional optional argument - # resolve_on_timeout. - # - # @param resolve_on_timeout [true, false] If it times out and the argument is true it will also resolve the event. - # @return [self, true, false] - # @see AbstractEventFuture#wait - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1342 - def wait(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end - - # Creates new event wrapping receiver, effectively hiding the resolve method. - # - # @return [Event] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1331 - def with_hidden_resolvable; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1600 -class Concurrent::Promises::ResolvableEventPromise < ::Concurrent::Promises::AbstractPromise - # @return [ResolvableEventPromise] a new instance of ResolvableEventPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1601 - def initialize(default_executor); end -end - -# A Future which can be resolved by user. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1354 -class Concurrent::Promises::ResolvableFuture < ::Concurrent::Promises::Future - include ::Concurrent::Promises::Resolvable - - # Evaluates the block and sets its result as future's value fulfilling, if the block raises - # an exception the future rejects with it. - # - # @return [self] - # @yield [*args] to the block. - # @yieldreturn [Object] value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1395 - def evaluate_to(*args, &block); end - - # Evaluates the block and sets its result as future's value fulfilling, if the block raises - # an exception the future rejects with it. - # - # @raise [Exception] also raise reason on rejection. - # @return [self] - # @yield [*args] to the block. - # @yieldreturn [Object] value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1406 - def evaluate_to!(*args, &block); end - - # Makes the future fulfilled with `value`, - # which triggers all dependent futures. - # - # @param value [Object] - # @param raise_on_reassign [Boolean] should method raise exception if already resolved - # @param reserved [true, false] Set to true if the resolvable is {#reserve}d by you, - # marks resolution of reserved resolvable events and futures explicitly. - # Advanced feature, ignore unless you use {Resolvable#reserve} from edge. - # @return [self, false] false is returned when raise_on_reassign is false and the receiver - # is already resolved. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1375 - def fulfill(value, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end - - # Behaves as {Future#reason} but has one additional optional argument - # resolve_on_timeout. - # - # @param resolve_on_timeout [::Array(true, Object, nil), ::Array(false, nil, Exception), nil] If it times out and the argument is not nil it will also resolve the future - # to the provided resolution. - # @return [Exception, timeout_value, nil] - # @see Future#reason - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1503 - def reason(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end - - # Makes the future rejected with `reason`, - # which triggers all dependent futures. - # - # @param reason [Object] - # @param raise_on_reassign [Boolean] should method raise exception if already resolved - # @param reserved [true, false] Set to true if the resolvable is {#reserve}d by you, - # marks resolution of reserved resolvable events and futures explicitly. - # Advanced feature, ignore unless you use {Resolvable#reserve} from edge. - # @return [self, false] false is returned when raise_on_reassign is false and the receiver - # is already resolved. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1385 - def reject(reason, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end - - # Makes the future resolved with result of triplet `fulfilled?`, `value`, `reason`, - # which triggers all dependent futures. - # - # @param fulfilled [true, false] - # @param value [Object] - # @param reason [Object] - # @param raise_on_reassign [Boolean] should method raise exception if already resolved - # @param reserved [true, false] Set to true if the resolvable is {#reserve}d by you, - # marks resolution of reserved resolvable events and futures explicitly. - # Advanced feature, ignore unless you use {Resolvable#reserve} from edge. - # @return [self, false] false is returned when raise_on_reassign is false and the receiver - # is already resolved. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1365 - def resolve(fulfilled = T.unsafe(nil), value = T.unsafe(nil), reason = T.unsafe(nil), raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end - - # Behaves as {Future#result} but has one additional optional argument - # resolve_on_timeout. - # - # @param resolve_on_timeout [::Array(true, Object, nil), ::Array(false, nil, Exception), nil] If it times out and the argument is not nil it will also resolve the future - # to the provided resolution. - # @return [::Array(Boolean, Object, Exception), nil] - # @see Future#result - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1524 - def result(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end - - # Behaves as {Future#value} but has one additional optional argument - # resolve_on_timeout. - # - # @param resolve_on_timeout [::Array(true, Object, nil), ::Array(false, nil, Exception), nil] If it times out and the argument is not nil it will also resolve the future - # to the provided resolution. - # @return [Object, timeout_value, nil] - # @see Future#value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1459 - def value(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end - - # Behaves as {Future#value!} but has one additional optional argument - # resolve_on_timeout. - # - # @param resolve_on_timeout [::Array(true, Object, nil), ::Array(false, nil, Exception), nil] If it times out and the argument is not nil it will also resolve the future - # to the provided resolution. - # @raise [Exception] {#reason} on rejection - # @return [Object, timeout_value, nil] - # @see Future#value! - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1481 - def value!(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end - - # Behaves as {AbstractEventFuture#wait} but has one additional optional argument - # resolve_on_timeout. - # - # @param resolve_on_timeout [::Array(true, Object, nil), ::Array(false, nil, Exception), nil] If it times out and the argument is not nil it will also resolve the future - # to the provided resolution. - # @return [self, true, false] - # @see AbstractEventFuture#wait - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1421 - def wait(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end - - # Behaves as {Future#wait!} but has one additional optional argument - # resolve_on_timeout. - # - # @param resolve_on_timeout [::Array(true, Object, nil), ::Array(false, nil, Exception), nil] If it times out and the argument is not nil it will also resolve the future - # to the provided resolution. - # @raise [Exception] {#reason} on rejection - # @return [self, true, false] - # @see Future#wait! - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1438 - def wait!(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end - - # Creates new future wrapping receiver, effectively hiding the resolve method and similar. - # - # @return [Future] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1542 - def with_hidden_resolvable; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1606 -class Concurrent::Promises::ResolvableFuturePromise < ::Concurrent::Promises::AbstractPromise - # @return [ResolvableFuturePromise] a new instance of ResolvableFuturePromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1607 - def initialize(default_executor); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1592 - def evaluate_to(*args, block); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1909 -class Concurrent::Promises::RunFuturePromise < ::Concurrent::Promises::AbstractFlatPromise - # @return [RunFuturePromise] a new instance of RunFuturePromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1913 - def initialize(delayed, blockers_count, default_executor, run_test); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1918 - def process_on_blocker_resolution(future, index); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2114 -class Concurrent::Promises::ScheduledPromise < ::Concurrent::Promises::InnerPromise - # @return [ScheduledPromise] a new instance of ScheduledPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2125 - def initialize(default_executor, intended_time); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2119 - def inspect; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2115 - def intended_time; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1730 -class Concurrent::Promises::ThenPromise < ::Concurrent::Promises::BlockedTaskPromise - # @return [ThenPromise] a new instance of ThenPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1733 - def initialize(delayed, blockers_count, default_executor, executor, args, &task); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1737 - def on_resolvable(resolved_future, index); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1940 -class Concurrent::Promises::ZipEventEventPromise < ::Concurrent::Promises::BlockedPromise - # @return [ZipEventEventPromise] a new instance of ZipEventEventPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1941 - def initialize(delayed, blockers_count, default_executor); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1947 - def on_resolvable(resolved_future, index); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2031 -class Concurrent::Promises::ZipEventsPromise < ::Concurrent::Promises::BlockedPromise - # @return [ZipEventsPromise] a new instance of ZipEventsPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2035 - def initialize(delayed, blockers_count, default_executor); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2041 - def on_resolvable(resolved_future, index); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1952 -class Concurrent::Promises::ZipFutureEventPromise < ::Concurrent::Promises::BlockedPromise - # @return [ZipFutureEventPromise] a new instance of ZipFutureEventPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1953 - def initialize(delayed, blockers_count, default_executor); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1967 - def on_resolvable(resolved_future, index); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1960 - def process_on_blocker_resolution(future, index); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1996 -class Concurrent::Promises::ZipFuturesPromise < ::Concurrent::Promises::BlockedPromise - # @return [ZipFuturesPromise] a new instance of ZipFuturesPromise - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2000 - def initialize(delayed, blockers_count, default_executor); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2013 - def on_resolvable(resolved_future, index); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2007 - def process_on_blocker_resolution(future, index); end -end - -# Methods form module A included to a module B, which is already included into class C, -# will not be visible in the C class. If this module is extended to B then A's methods -# are correctly made visible to C. -# -# @example -# module A -# def a -# :a -# end -# end -# -# module B1 -# end -# -# class C1 -# include B1 -# end -# -# module B2 -# extend Concurrent::ReInclude -# end -# -# class C2 -# include B2 -# end -# -# B1.send :include, A -# B2.send :include, A -# -# C1.new.respond_to? :a # => false -# C2.new.respond_to? :a # => true -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/re_include.rb#36 -module Concurrent::ReInclude - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/re_include.rb#44 - def extended(base); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/re_include.rb#50 - def include(*modules); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/re_include.rb#38 - def included(base); end -end - -# Ruby read-write lock implementation -# -# Allows any number of concurrent readers, but only one concurrent writer -# (And if the "write" lock is taken, any readers who come along will have to wait) -# -# If readers are already active when a writer comes along, the writer will wait for -# all the readers to finish before going ahead. -# Any additional readers that come when the writer is already waiting, will also -# wait (so writers are not starved). -# -# This implementation is based on `java.util.concurrent.ReentrantReadWriteLock`. -# -# @example -# lock = Concurrent::ReadWriteLock.new -# lock.with_read_lock { data.retrieve } -# lock.with_write_lock { data.modify! } -# @note Do **not** try to acquire the write lock while already holding a read lock -# **or** try to acquire the write lock while you already have it. -# This will lead to deadlock -# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html java.util.concurrent.ReentrantReadWriteLock -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#31 -class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object - extend ::Concurrent::Synchronization::SafeInitialization - - # Create a new `ReadWriteLock` in the unlocked state. - # - # @return [ReadWriteLock] a new instance of ReadWriteLock - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#59 - def initialize; end - - # Acquire a read lock. If a write lock has been acquired will block until - # it is released. Will not block if other read locks have been acquired. - # - # @raise [Concurrent::ResourceLimitError] if the maximum number of readers - # is exceeded. - # @return [Boolean] true if the lock is successfully acquired - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#111 - def acquire_read_lock; end - - # Acquire a write lock. Will block and wait for all active readers and writers. - # - # @raise [Concurrent::ResourceLimitError] if the maximum number of writers - # is exceeded. - # @return [Boolean] true if the lock is successfully acquired - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#160 - def acquire_write_lock; end - - # Queries whether any threads are waiting to acquire the read or write lock. - # - # @return [Boolean] true if any threads are waiting for a lock else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#214 - def has_waiters?; end - - # Release a previously acquired read lock. - # - # @return [Boolean] true if the lock is successfully released - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#140 - def release_read_lock; end - - # Release a previously acquired write lock. - # - # @return [Boolean] true if the lock is successfully released - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#196 - def release_write_lock; end - - # Execute a block operation within a read lock. - # - # @raise [ArgumentError] when no block is given. - # @raise [Concurrent::ResourceLimitError] if the maximum number of readers - # is exceeded. - # @return [Object] the result of the block operation. - # @yield the task to be performed within the lock. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#75 - def with_read_lock; end - - # Execute a block operation within a write lock. - # - # @raise [ArgumentError] when no block is given. - # @raise [Concurrent::ResourceLimitError] if the maximum number of readers - # is exceeded. - # @return [Object] the result of the block operation. - # @yield the task to be performed within the lock. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#94 - def with_write_lock; end - - # Queries if the write lock is held by any thread. - # - # @return [Boolean] true if the write lock is held else false` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#207 - def write_locked?; end - - private - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#246 - def max_readers?(c = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#251 - def max_writers?(c = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#221 - def running_readers(c = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#226 - def running_readers?(c = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#231 - def running_writer?(c = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#241 - def waiting_writer?(c = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#236 - def waiting_writers(c = T.unsafe(nil)); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#40 -Concurrent::ReadWriteLock::MAX_READERS = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#43 -Concurrent::ReadWriteLock::MAX_WRITERS = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#37 -Concurrent::ReadWriteLock::RUNNING_WRITER = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#34 -Concurrent::ReadWriteLock::WAITING_WRITER = T.let(T.unsafe(nil), Integer) - -# Re-entrant read-write lock implementation -# -# Allows any number of concurrent readers, but only one concurrent writer -# (And while the "write" lock is taken, no read locks can be obtained either. -# Hence, the write lock can also be called an "exclusive" lock.) -# -# If another thread has taken a read lock, any thread which wants a write lock -# will block until all the readers release their locks. However, once a thread -# starts waiting to obtain a write lock, any additional readers that come along -# will also wait (so writers are not starved). -# -# A thread can acquire both a read and write lock at the same time. A thread can -# also acquire a read lock OR a write lock more than once. Only when the read (or -# write) lock is released as many times as it was acquired, will the thread -# actually let it go, allowing other threads which might have been waiting -# to proceed. Therefore the lock can be upgraded by first acquiring -# read lock and then write lock and that the lock can be downgraded by first -# having both read and write lock a releasing just the write lock. -# -# If both read and write locks are acquired by the same thread, it is not strictly -# necessary to release them in the same order they were acquired. In other words, -# the following code is legal: -# -# This implementation was inspired by `java.util.concurrent.ReentrantReadWriteLock`. -# -# @example -# lock = Concurrent::ReentrantReadWriteLock.new -# lock.acquire_write_lock -# lock.acquire_read_lock -# lock.release_write_lock -# # At this point, the current thread is holding only a read lock, not a write -# # lock. So other threads can take read locks, but not a write lock. -# lock.release_read_lock -# # Now the current thread is not holding either a read or write lock, so -# # another thread could potentially acquire a write lock. -# @example -# lock = Concurrent::ReentrantReadWriteLock.new -# lock.with_read_lock { data.retrieve } -# lock.with_write_lock { data.modify! } -# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html java.util.concurrent.ReentrantReadWriteLock -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#53 -class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object - extend ::Concurrent::Synchronization::SafeInitialization - - # Create a new `ReentrantReadWriteLock` in the unlocked state. - # - # @return [ReentrantReadWriteLock] a new instance of ReentrantReadWriteLock - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#109 - def initialize; end - - # Acquire a read lock. If a write lock is held by another thread, will block - # until it is released. - # - # @raise [Concurrent::ResourceLimitError] if the maximum number of readers - # is exceeded. - # @return [Boolean] true if the lock is successfully acquired - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#162 - def acquire_read_lock; end - - # Acquire a write lock. Will block and wait for all active readers and writers. - # - # @raise [Concurrent::ResourceLimitError] if the maximum number of writers - # is exceeded. - # @return [Boolean] true if the lock is successfully acquired - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#257 - def acquire_write_lock; end - - # Release a previously acquired read lock. - # - # @return [Boolean] true if the lock is successfully released - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#236 - def release_read_lock; end - - # Release a previously acquired write lock. - # - # @return [Boolean] true if the lock is successfully released - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#329 - def release_write_lock; end - - # Try to acquire a read lock and return true if we succeed. If it cannot be - # acquired immediately, return false. - # - # @return [Boolean] true if the lock is successfully acquired - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#215 - def try_read_lock; end - - # Try to acquire a write lock and return true if we succeed. If it cannot be - # acquired immediately, return false. - # - # @return [Boolean] true if the lock is successfully acquired - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#310 - def try_write_lock; end - - # Execute a block operation within a read lock. - # - # @raise [ArgumentError] when no block is given. - # @raise [Concurrent::ResourceLimitError] if the maximum number of readers - # is exceeded. - # @return [Object] the result of the block operation. - # @yield the task to be performed within the lock. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#126 - def with_read_lock; end - - # Execute a block operation within a write lock. - # - # @raise [ArgumentError] when no block is given. - # @raise [Concurrent::ResourceLimitError] if the maximum number of readers - # is exceeded. - # @return [Object] the result of the block operation. - # @yield the task to be performed within the lock. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#145 - def with_write_lock; end - - private - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#370 - def max_readers?(c = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#375 - def max_writers?(c = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#345 - def running_readers(c = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#350 - def running_readers?(c = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#355 - def running_writer?(c = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#365 - def waiting_or_running_writer?(c = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#360 - def waiting_writers(c = T.unsafe(nil)); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#94 -Concurrent::ReentrantReadWriteLock::MAX_READERS = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#96 -Concurrent::ReentrantReadWriteLock::MAX_WRITERS = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#84 -Concurrent::ReentrantReadWriteLock::READER_BITS = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#102 -Concurrent::ReentrantReadWriteLock::READ_LOCK_MASK = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#92 -Concurrent::ReentrantReadWriteLock::RUNNING_WRITER = T.let(T.unsafe(nil), Integer) - -# Used with @Counter: -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#90 -Concurrent::ReentrantReadWriteLock::WAITING_WRITER = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#86 -Concurrent::ReentrantReadWriteLock::WRITER_BITS = T.let(T.unsafe(nil), Integer) - -# Used with @HeldCount: -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#100 -Concurrent::ReentrantReadWriteLock::WRITE_LOCK_HELD = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#104 -Concurrent::ReentrantReadWriteLock::WRITE_LOCK_MASK = T.let(T.unsafe(nil), Integer) - -# Raised by an `Executor` when it is unable to process a given task, -# possibly because of a reject policy or other internal error. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#48 -class Concurrent::RejectedExecutionError < ::Concurrent::Error; end - -# Raised when any finite resource, such as a lock counter, exceeds its -# maximum limit/threshold. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#52 -class Concurrent::ResourceLimitError < ::Concurrent::Error; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#129 -class Concurrent::RubyExchanger < ::Concurrent::AbstractExchanger - extend ::Concurrent::Synchronization::SafeInitialization - - # @return [RubyExchanger] a new instance of RubyExchanger - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#159 - def initialize; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#137 - def __initialize_atomic_fields__; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#105 - def compare_and_set_slot(expected, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#93 - def slot; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#97 - def slot=(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#101 - def swap_slot(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#109 - def update_slot(&block); end - - private - - # Waits for another thread to arrive at this exchange point (unless the - # current thread is interrupted), and then transfers the given object to - # it, receiving its object in return. The timeout value indicates the - # approximate number of seconds the method should block while waiting - # for the exchange. When the timeout value is `nil` the method will - # block indefinitely. - # - # @param value [Object] the value to exchange with another thread - # @param timeout [Numeric, nil] in seconds, `nil` blocks indefinitely - # @return [Object, CANCEL] the value exchanged by the other thread; {CANCEL} on timeout - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#170 - def do_exchange(value, timeout); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#138 -class Concurrent::RubyExchanger::Node < ::Concurrent::Synchronization::Object - extend ::Concurrent::Synchronization::SafeInitialization - - # @return [Node] a new instance of Node - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#142 - def initialize(item); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#137 - def __initialize_atomic_fields__; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#105 - def compare_and_set_value(expected, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#153 - def item; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#149 - def latch; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#101 - def swap_value(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#109 - def update_value(&block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#93 - def value; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#97 - def value=(value); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#8 -class Concurrent::RubyExecutorService < ::Concurrent::AbstractExecutorService - # @return [RubyExecutorService] a new instance of RubyExecutorService - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#11 - def initialize(*args, &block); end - - # Begin an immediate shutdown. In-progress tasks will be allowed to - # complete but enqueued tasks will be dismissed and no new tasks - # will be accepted. Has no additional effect if the thread pool is - # not running. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#42 - def kill; end - - # Submit a task to the executor for asynchronous processing. - # - # @param args [Array] zero or more arguments to be passed to the task - # @raise [ArgumentError] if no task is given - # @return [Boolean] `true` if the task is queued, `false` if the executor - # is not running - # @yield the asynchronous task to perform - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#17 - def post(*args, &task); end - - # Begin an orderly shutdown. Tasks already in the queue will be executed, - # but no new tasks will be accepted. Has no additional effect if the - # thread pool is not running. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#33 - def shutdown; end - - # Block until executor shutdown is complete or until `timeout` seconds have - # passed. - # - # @note Does not initiate shutdown or termination. Either `shutdown` or `kill` - # must be called before this method (or on another thread). - # @param timeout [Integer] the maximum number of seconds to wait for shutdown to complete - # @return [Boolean] `true` if shutdown complete or false on `timeout` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#52 - def wait_for_termination(timeout = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#70 - def ns_running?; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#78 - def ns_shutdown?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#66 - def ns_shutdown_execution; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#74 - def ns_shuttingdown?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#58 - def stop_event; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#62 - def stopped_event; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb#8 -class Concurrent::RubySingleThreadExecutor < ::Concurrent::RubyThreadPoolExecutor - # @return [RubySingleThreadExecutor] a new instance of RubySingleThreadExecutor - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb#11 - def initialize(opts = T.unsafe(nil)); end -end - -# **Thread Pool Options** -# -# Thread pools support several configuration options: -# -# * `idletime`: The number of seconds that a thread may be idle before being reclaimed. -# * `name`: The name of the executor (optional). Printed in the executor's `#to_s` output and -# a `-worker-` name is given to its threads if supported by used Ruby -# implementation. `` is uniq for each thread. -# * `max_queue`: The maximum number of tasks that may be waiting in the work queue at -# any one time. When the queue size reaches `max_queue` and no new threads can be created, -# subsequent tasks will be rejected in accordance with the configured `fallback_policy`. -# * `auto_terminate`: When true (default), the threads started will be marked as daemon. -# * `fallback_policy`: The policy defining how rejected tasks are handled. -# -# Three fallback policies are supported: -# -# * `:abort`: Raise a `RejectedExecutionError` exception and discard the task. -# * `:discard`: Discard the task and return false. -# * `:caller_runs`: Execute the task on the calling thread. -# -# **Shutting Down Thread Pools** -# -# Killing a thread pool while tasks are still being processed, either by calling -# the `#kill` method or at application exit, will have unpredictable results. There -# is no way for the thread pool to know what resources are being used by the -# in-progress tasks. When those tasks are killed the impact on those resources -# cannot be predicted. The *best* practice is to explicitly shutdown all thread -# pools using the provided methods: -# -# * Call `#shutdown` to initiate an orderly termination of all in-progress tasks -# * Call `#wait_for_termination` with an appropriate timeout interval an allow -# the orderly shutdown to complete -# * Call `#kill` *only when* the thread pool fails to shutdown in the allotted time -# -# On some runtime platforms (most notably the JVM) the application will not -# exit until all thread pools have been shutdown. To prevent applications from -# "hanging" on exit, all threads can be marked as daemon according to the -# `:auto_terminate` option. -# -# ```ruby -# pool1 = Concurrent::FixedThreadPool.new(5) # threads will be marked as daemon -# pool2 = Concurrent::FixedThreadPool.new(5, auto_terminate: false) # mark threads as non-daemon -# ``` -# -# @note Failure to properly shutdown a thread pool can lead to unpredictable results. -# Please read *Shutting Down Thread Pools* for more information. -# @see http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html Java Tutorials: Thread Pools -# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html Java Executors class -# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html Java ExecutorService interface -# @see https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean- -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#12 -class Concurrent::RubyThreadPoolExecutor < ::Concurrent::RubyExecutorService - # @return [RubyThreadPoolExecutor] a new instance of RubyThreadPoolExecutor - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#45 - def initialize(opts = T.unsafe(nil)); end - - # The number of threads that are actively executing tasks. - # - # @return [Integer] The number of threads that are actively executing tasks. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#65 - def active_count; end - - # Does the task queue have a maximum size? - # - # @return [Boolean] True if the task queue has a maximum size else false. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#72 - def can_overflow?; end - - # The number of tasks that have been completed by the pool since construction. - # - # @return [Integer] The number of tasks that have been completed by the pool since construction. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#60 - def completed_task_count; end - - # The number of seconds that a thread may be idle before being reclaimed. - # - # @return [Integer] The number of seconds that a thread may be idle before being reclaimed. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#36 - def idletime; end - - # The largest number of threads that have been created in the pool since construction. - # - # @return [Integer] The largest number of threads that have been created in the pool since construction. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#50 - def largest_length; end - - # The number of threads currently in the pool. - # - # @return [Integer] The number of threads currently in the pool. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#77 - def length; end - - # The maximum number of threads that may be created in the pool. - # - # @return [Integer] The maximum number of threads that may be created in the pool. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#30 - def max_length; end - - # The maximum number of tasks that may be waiting in the work queue at any one time. - # When the queue size reaches `max_queue` subsequent tasks will be rejected in - # accordance with the configured `fallback_policy`. - # - # @return [Integer] The maximum number of tasks that may be waiting in the work queue at any one time. - # When the queue size reaches `max_queue` subsequent tasks will be rejected in - # accordance with the configured `fallback_policy`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#39 - def max_queue; end - - # The minimum number of threads that may be retained in the pool. - # - # @return [Integer] The minimum number of threads that may be retained in the pool. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#33 - def min_length; end - - # Prune the thread pool of unneeded threads - # - # What is being pruned is controlled by the min_threads and idletime - # parameters passed at pool creation time - # - # This is a no-op on some pool implementation (e.g. the Java one). The Ruby - # pool will auto-prune each time a new job is posted. You will need to call - # this method explicitly in case your application post jobs in bursts (a - # lot of jobs and then nothing for long periods) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#118 - def prune_pool; end - - # The number of tasks in the queue awaiting execution. - # - # @return [Integer] The number of tasks in the queue awaiting execution. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#82 - def queue_length; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#103 - def ready_worker(worker, last_message); end - - # Number of tasks that may be enqueued before reaching `max_queue` and rejecting - # new tasks. A value of -1 indicates that the queue may grow without bound. - # - # @return [Integer] Number of tasks that may be enqueued before reaching `max_queue` and rejecting - # new tasks. A value of -1 indicates that the queue may grow without bound. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#87 - def remaining_capacity; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#98 - def remove_busy_worker(worker); end - - # The number of tasks that have been scheduled for execution on the pool since construction. - # - # @return [Integer] The number of tasks that have been scheduled for execution on the pool since construction. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#55 - def scheduled_task_count; end - - # Whether or not a value of 0 for :max_queue option means the queue must perform direct hand-off or rather unbounded queue. - # - # @return [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#42 - def synchronous; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#108 - def worker_died(worker); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#113 - def worker_task_completed; end - - private - - # creates new worker which has to receive work to do after it's added - # - # @return [nil, Worker] nil of max capacity is reached - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#241 - def ns_add_busy_worker; end - - # tries to assign task to a worker, tries to get one from @ready or to create new one - # - # @return [true, false] if task is assigned to a worker - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#201 - def ns_assign_worker(*args, &task); end - - # tries to enqueue task - # - # @return [true, false] if enqueued - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#219 - def ns_enqueue(*args, &task); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#160 - def ns_execute(*args, &task); end - - # @raise [ArgumentError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#125 - def ns_initialize(opts); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#189 - def ns_kill_execution; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#155 - def ns_limited_queue?; end - - # try oldest worker if it is idle for enough time, it's returned back at the start - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#280 - def ns_prune_pool; end - - # handle ready worker, giving it new job or assigning back to @ready - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#253 - def ns_ready_worker(worker, last_message, success = T.unsafe(nil)); end - - # removes a worker which is not in not tracked in @ready - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#271 - def ns_remove_busy_worker(worker); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#296 - def ns_reset_if_forked; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#174 - def ns_shutdown_execution; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#231 - def ns_worker_died(worker); end -end - -# Default maximum number of threads that will be created in the pool. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#15 -Concurrent::RubyThreadPoolExecutor::DEFAULT_MAX_POOL_SIZE = T.let(T.unsafe(nil), Integer) - -# Default maximum number of tasks that may be added to the task queue. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#21 -Concurrent::RubyThreadPoolExecutor::DEFAULT_MAX_QUEUE_SIZE = T.let(T.unsafe(nil), Integer) - -# Default minimum number of threads that will be retained in the pool. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#18 -Concurrent::RubyThreadPoolExecutor::DEFAULT_MIN_POOL_SIZE = T.let(T.unsafe(nil), Integer) - -# Default value of the :synchronous option. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#27 -Concurrent::RubyThreadPoolExecutor::DEFAULT_SYNCHRONOUS = T.let(T.unsafe(nil), FalseClass) - -# Default maximum number of seconds a thread in the pool may remain idle -# before being reclaimed. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#24 -Concurrent::RubyThreadPoolExecutor::DEFAULT_THREAD_IDLETIMEOUT = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#310 -class Concurrent::RubyThreadPoolExecutor::Worker - include ::Concurrent::Concern::Logging - - # @return [Worker] a new instance of Worker - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#313 - def initialize(pool, id); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#324 - def <<(message); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#332 - def kill; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#328 - def stop; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#338 - def create_worker(queue, pool, idletime); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#358 - def run_task(pool, task, args); end -end - -# A simple utility class that executes a callable and returns and array of three elements: -# success - indicating if the callable has been executed without errors -# value - filled by the callable result if it has been executed without errors, nil otherwise -# reason - the error risen by the callable if it has been executed with errors, nil otherwise -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb#9 -class Concurrent::SafeTaskExecutor < ::Concurrent::Synchronization::LockableObject - # @return [SafeTaskExecutor] a new instance of SafeTaskExecutor - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb#11 - def initialize(task, opts = T.unsafe(nil)); end - - # @return [Array] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb#18 - def execute(*args); end -end - -# `ScheduledTask` is a close relative of `Concurrent::Future` but with one -# important difference: A `Future` is set to execute as soon as possible -# whereas a `ScheduledTask` is set to execute after a specified delay. This -# implementation is loosely based on Java's -# [ScheduledExecutorService](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledExecutorService.html). -# It is a more feature-rich variant of {Concurrent.timer}. -# -# The *intended* schedule time of task execution is set on object construction -# with the `delay` argument. The delay is a numeric (floating point or integer) -# representing a number of seconds in the future. Any other value or a numeric -# equal to or less than zero will result in an exception. The *actual* schedule -# time of task execution is set when the `execute` method is called. -# -# The constructor can also be given zero or more processing options. Currently -# the only supported options are those recognized by the -# [Dereferenceable](Dereferenceable) module. -# -# The final constructor argument is a block representing the task to be performed. -# If no block is given an `ArgumentError` will be raised. -# -# **States** -# -# `ScheduledTask` mixes in the [Obligation](Obligation) module thus giving it -# "future" behavior. This includes the expected lifecycle states. `ScheduledTask` -# has one additional state, however. While the task (block) is being executed the -# state of the object will be `:processing`. This additional state is necessary -# because it has implications for task cancellation. -# -# **Cancellation** -# -# A `:pending` task can be cancelled using the `#cancel` method. A task in any -# other state, including `:processing`, cannot be cancelled. The `#cancel` -# method returns a boolean indicating the success of the cancellation attempt. -# A cancelled `ScheduledTask` cannot be restarted. It is immutable. -# -# **Obligation and Observation** -# -# The result of a `ScheduledTask` can be obtained either synchronously or -# asynchronously. `ScheduledTask` mixes in both the [Obligation](Obligation) -# module and the -# [Observable](http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html) -# module from the Ruby standard library. With one exception `ScheduledTask` -# behaves identically to [Future](Observable) with regard to these modules. -# -# @example Basic usage -# -# require 'concurrent/scheduled_task' -# require 'csv' -# require 'open-uri' -# -# class Ticker -# def get_year_end_closing(symbol, year, api_key) -# uri = "https://www.alphavantage.co/query?function=TIME_SERIES_MONTHLY&symbol=#{symbol}&apikey=#{api_key}&datatype=csv" -# data = [] -# csv = URI.parse(uri).read -# if csv.include?('call frequency') -# return :rate_limit_exceeded -# end -# CSV.parse(csv, headers: true) do |row| -# data << row['close'].to_f if row['timestamp'].include?(year.to_s) -# end -# year_end = data.first -# year_end -# rescue => e -# p e -# end -# end -# -# api_key = ENV['ALPHAVANTAGE_KEY'] -# abort(error_message) unless api_key -# -# # Future -# price = Concurrent::Future.execute{ Ticker.new.get_year_end_closing('TWTR', 2013, api_key) } -# price.state #=> :pending -# price.pending? #=> true -# price.value(0) #=> nil (does not block) -# -# sleep(1) # do other stuff -# -# price.value #=> 63.65 (after blocking if necessary) -# price.state #=> :fulfilled -# price.fulfilled? #=> true -# price.value #=> 63.65 -# @example Successful task execution -# -# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' } -# task.state #=> :unscheduled -# task.execute -# task.state #=> pending -# -# # wait for it... -# sleep(3) -# -# task.unscheduled? #=> false -# task.pending? #=> false -# task.fulfilled? #=> true -# task.rejected? #=> false -# task.value #=> 'What does the fox say?' -# @example One line creation and execution -# -# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' }.execute -# task.state #=> pending -# -# task = Concurrent::ScheduledTask.execute(2){ 'What do you get when you multiply 6 by 9?' } -# task.state #=> pending -# @example Failed task execution -# -# task = Concurrent::ScheduledTask.execute(2){ raise StandardError.new('Call me maybe?') } -# task.pending? #=> true -# -# # wait for it... -# sleep(3) -# -# task.unscheduled? #=> false -# task.pending? #=> false -# task.fulfilled? #=> false -# task.rejected? #=> true -# task.value #=> nil -# task.reason #=> # -# @example Task execution with observation -# -# observer = Class.new{ -# def update(time, value, reason) -# puts "The task completed at #{time} with value '#{value}'" -# end -# }.new -# -# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' } -# task.add_observer(observer) -# task.execute -# task.pending? #=> true -# -# # wait for it... -# sleep(3) -# -# #>> The task completed at 2013-11-07 12:26:09 -0500 with value 'What does the fox say?' -# @see Concurrent.timer -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#158 -class Concurrent::ScheduledTask < ::Concurrent::IVar - include ::Comparable - - # Schedule a task for execution at a specified future time. - # - # @option opts - # @param delay [Float] the number of seconds to wait for before executing the task - # @param opts [Hash] a customizable set of options - # @raise [ArgumentError] When no block is given - # @raise [ArgumentError] When given a time that is in the past - # @return [ScheduledTask] a new instance of ScheduledTask - # @yield the task to be performed - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#178 - def initialize(delay, opts = T.unsafe(nil), &task); end - - # Comparator which orders by schedule time. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#213 - def <=>(other); end - - # Cancel this task and prevent it from executing. A task can only be - # cancelled if it is pending or unscheduled. - # - # @return [Boolean] true if successfully cancelled else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#235 - def cancel; end - - # Has the task been cancelled? - # - # @return [Boolean] true if the task is in the given state else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#220 - def cancelled?; end - - # Execute an `:unscheduled` `ScheduledTask`. Immediately sets the state to `:pending` - # and starts counting down toward execution. Does nothing if the `ScheduledTask` is - # in any state other than `:unscheduled`. - # - # @return [ScheduledTask] a reference to `self` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#273 - def execute; end - - # The executor on which to execute the task. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#163 - def executor; end - - # The `delay` value given at instantiation. - # - # @return [Float] the initial delay. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#199 - def initial_delay; end - - # Execute the task. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#297 - def process_task; end - - # In the task execution in progress? - # - # @return [Boolean] true if the task is in the given state else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#227 - def processing?; end - - # Reschedule the task using the given delay and the current time. - # A task can only be reset while it is `:pending`. - # - # @param delay [Float] the number of seconds to wait for before executing the task - # @raise [ArgumentError] When given a time that is in the past - # @return [Boolean] true if successfully rescheduled else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#262 - def reschedule(delay); end - - # Reschedule the task using the original delay and the current time. - # A task can only be reset while it is `:pending`. - # - # @return [Boolean] true if successfully rescheduled else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#250 - def reset; end - - # The monotonic time at which the the task is scheduled to be executed. - # - # @return [Float] the schedule time or nil if `unscheduled` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#206 - def schedule_time; end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#135 - def fail(reason = T.unsafe(nil)); end - - # Reschedule the task using the given delay and the current time. - # A task can only be reset while it is `:pending`. - # - # @param delay [Float] the number of seconds to wait for before executing the task - # @return [Boolean] true if successfully rescheduled else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#326 - def ns_reschedule(delay); end - - # Schedule the task using the given delay and the current time. - # - # @param delay [Float] the number of seconds to wait for before executing the task - # @return [Boolean] true if successfully rescheduled else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#312 - def ns_schedule(delay); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#113 - def set(value = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#145 - def try_set(value = T.unsafe(nil), &block); end - - class << self - # Create a new `ScheduledTask` object with the given block, execute it, and return the - # `:pending` object. - # - # @param delay [Float] the number of seconds to wait for before executing the task - # @raise [ArgumentError] if no block is given - # @return [ScheduledTask] the newly created `ScheduledTask` in the `:pending` state - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#290 - def execute(delay, opts = T.unsafe(nil), &task); end - end -end - -# A counting semaphore. Conceptually, a semaphore maintains a set of -# permits. Each {#acquire} blocks if necessary until a permit is -# available, and then takes it. Each {#release} adds a permit, potentially -# releasing a blocking acquirer. -# However, no actual permit objects are used; the Semaphore just keeps a -# count of the number available and acts accordingly. -# Alternatively, permits may be acquired within a block, and automatically -# released after the block finishes executing. -# -# @example -# semaphore = Concurrent::Semaphore.new(2) -# -# t1 = Thread.new do -# semaphore.acquire -# puts "Thread 1 acquired semaphore" -# end -# -# t2 = Thread.new do -# semaphore.acquire -# puts "Thread 2 acquired semaphore" -# end -# -# t3 = Thread.new do -# semaphore.acquire -# puts "Thread 3 acquired semaphore" -# end -# -# t4 = Thread.new do -# sleep(2) -# puts "Thread 4 releasing semaphore" -# semaphore.release -# end -# -# [t1, t2, t3, t4].each(&:join) -# -# # prints: -# # Thread 3 acquired semaphore -# # Thread 2 acquired semaphore -# # Thread 4 releasing semaphore -# # Thread 1 acquired semaphore -# @example -# semaphore = Concurrent::Semaphore.new(1) -# -# puts semaphore.available_permits -# semaphore.acquire do -# puts semaphore.available_permits -# end -# puts semaphore.available_permits -# -# # prints: -# # 1 -# # 0 -# # 1 -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/semaphore.rb#161 -class Concurrent::Semaphore < ::Concurrent::MutexSemaphore; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/semaphore.rb#96 -Concurrent::SemaphoreImplementation = Concurrent::MutexSemaphore - -# Indicates that the including `ExecutorService` guarantees -# that all operations will occur in the order they are post and that no -# two operations may occur simultaneously. This module provides no -# functionality and provides no guarantees. That is the responsibility -# of the including class. This module exists solely to allow the including -# object to be interrogated for its serialization status. -# -# @example -# class Foo -# include Concurrent::SerialExecutor -# end -# -# foo = Foo.new -# -# foo.is_a? Concurrent::ExecutorService #=> true -# foo.is_a? Concurrent::SerialExecutor #=> true -# foo.serialized? #=> true -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb#24 -module Concurrent::SerialExecutorService - include ::Concurrent::Concern::Logging - include ::Concurrent::ExecutorService - - # Does this executor guarantee serialization of its operations? - # - # @note Always returns `true` - # @return [Boolean] True if the executor guarantees that all operations - # will be post in the order they are received and no two operations may - # occur simultaneously. Else false. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb#30 - def serialized?; end -end - -# Ensures passed jobs in a serialized order never running at the same time. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#8 -class Concurrent::SerializedExecution < ::Concurrent::Synchronization::LockableObject - include ::Concurrent::Concern::Logging - - # @return [SerializedExecution] a new instance of SerializedExecution - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#11 - def initialize; end - - # Submit a task to the executor for asynchronous processing. - # - # @param executor [Executor] to be used for this job - # @param args [Array] zero or more arguments to be passed to the task - # @raise [ArgumentError] if no task is given - # @return [Boolean] `true` if the task is queued, `false` if the executor - # is not running - # @yield the asynchronous task to perform - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#34 - def post(executor, *args, &task); end - - # As {#post} but allows to submit multiple tasks at once, it's guaranteed that they will not - # be interleaved by other tasks. - # - # @param posts [Array, Proc)>] array of triplets where - # first is a {ExecutorService}, second is array of args for task, third is a task (Proc) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#44 - def posts(posts); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#75 - def call_job(job); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#70 - def ns_initialize; end - - # ensures next job is executed if any is stashed - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#95 - def work(job); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16 -class Concurrent::SerializedExecution::Job < ::Struct - # Returns the value of attribute args - # - # @return [Object] the current value of args - def args; end - - # Sets the attribute args - # - # @param value [Object] the value to set the attribute args to. - # @return [Object] the newly set value - def args=(_); end - - # Returns the value of attribute block - # - # @return [Object] the current value of block - def block; end - - # Sets the attribute block - # - # @param value [Object] the value to set the attribute block to. - # @return [Object] the newly set value - def block=(_); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#17 - def call; end - - # Returns the value of attribute executor - # - # @return [Object] the current value of executor - def executor; end - - # Sets the attribute executor - # - # @param value [Object] the value to set the attribute executor to. - # @return [Object] the newly set value - def executor=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# A wrapper/delegator for any `ExecutorService` that -# guarantees serialized execution of tasks. -# -# @see [SimpleDelegator](http://www.ruby-doc.org/stdlib-2.1.2/libdoc/delegate/rdoc/SimpleDelegator.html) -# @see Concurrent::SerializedExecution -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb#12 -class Concurrent::SerializedExecutionDelegator < ::SimpleDelegator - include ::Concurrent::Concern::Logging - include ::Concurrent::ExecutorService - include ::Concurrent::SerialExecutorService - - # @return [SerializedExecutionDelegator] a new instance of SerializedExecutionDelegator - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb#15 - def initialize(executor); end - - # Submit a task to the executor for asynchronous processing. - # - # @param args [Array] zero or more arguments to be passed to the task - # @raise [ArgumentError] if no task is given - # @return [Boolean] `true` if the task is queued, `false` if the executor - # is not running - # @yield the asynchronous task to perform - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb#22 - def post(*args, &task); end -end - -# A thread-safe subclass of Set. This version locks against the object -# itself for every method call, ensuring only one thread can be reading -# or writing at a time. This includes iteration methods like `#each`. -# -# @note `a += b` is **not** a **thread-safe** operation on -# `Concurrent::Set`. It reads Set `a`, then it creates new `Concurrent::Set` -# which is union of `a` and `b`, then it writes the union to `a`. -# The read and write are independent operations they do not form a single atomic -# operation therefore when two `+=` operations are executed concurrently updates -# may be lost. Use `#merge` instead. -# @see http://ruby-doc.org/stdlib-2.4.0/libdoc/set/rdoc/Set.html Ruby standard library `Set` -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#61 -class Concurrent::Set < ::Concurrent::CRubySet; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#23 -Concurrent::SetImplementation = Concurrent::CRubySet - -# An thread-safe, write-once variation of Ruby's standard `Struct`. -# Each member can have its value set at most once, either at construction -# or any time thereafter. Attempting to assign a value to a member -# that has already been set will result in a `Concurrent::ImmutabilityError`. -# -# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct` -# @see http://en.wikipedia.org/wiki/Final_(Java) Java `final` keyword -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#14 -module Concurrent::SettableStruct - include ::Concurrent::Synchronization::AbstractStruct - - # Equality - # - # @return [Boolean] true if other has the same struct subclass and has - # equal member values (according to `Object#==`) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#50 - def ==(other); end - - # Attribute Reference - # - # @param member [Symbol, String, Integer] the string or symbol name of the member - # for which to obtain the value or the member's index - # @raise [NameError] if the member does not exist - # @raise [IndexError] if the index is out of range. - # @return [Object] the value of the given struct member or the member at the given index. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#45 - def [](member); end - - # Attribute Assignment - # - # Sets the value of the given struct member or the member at the given index. - # - # @param member [Symbol, String, Integer] the string or symbol name of the member - # for which to obtain the value or the member's index - # @raise [NameError] if the name does not exist - # @raise [IndexError] if the index is out of range. - # @raise [Concurrent::ImmutabilityError] if the given member has already been set - # @return [Object] the value of the given struct member or the member at the given index. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#75 - def []=(member, value); end - - # Yields the value of each struct member in order. If no block is given - # an enumerator is returned. - # - # @yield the operation to be performed on each struct member - # @yieldparam value [Object] each struct value (in order) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#55 - def each(&block); end - - # Yields the name and value of each struct member in order. If no block is - # given an enumerator is returned. - # - # @yield the operation to be performed on each struct member/value pair - # @yieldparam member [Object] each struct member (in order) - # @yieldparam value [Object] each struct value (in order) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#61 - def each_pair(&block); end - - # Describe the contents of this struct in a string. - # - # @return [String] the contents of this struct in a string - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#29 - def inspect; end - - # Returns a new struct containing the contents of `other` and the contents - # of `self`. If no block is specified, the value for entries with duplicate - # keys will be that of `other`. Otherwise the value for each duplicate key - # is determined by calling the block with the key, its value in `self` and - # its value in `other`. - # - # @param other [Hash] the hash from which to set the new values - # @raise [ArgumentError] of given a member that is not defined in the struct - # @return [Synchronization::AbstractStruct] a new struct with the new values - # @yield an options block for resolving duplicate keys - # @yieldparam member [String, Symbol] the name of the member which is duplicated - # @yieldparam selfvalue [Object] the value of the member in `self` - # @yieldparam othervalue [Object] the value of the member in `other` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#35 - def merge(other, &block); end - - # Yields each member value from the struct to the block and returns an Array - # containing the member values from the struct for which the given block - # returns a true value (equivalent to `Enumerable#select`). - # - # @return [Array] an array containing each value for which the block returns true - # @yield the operation to be performed on each struct member - # @yieldparam value [Object] each struct value (in order) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#67 - def select(&block); end - - # Returns the values for this struct as an Array. - # - # @return [Array] the values for this struct - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#18 - def to_a; end - - # Returns a hash containing the names and values for the struct’s members. - # - # @return [Hash] the names and values for the struct’s members - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#40 - def to_h; end - - # Describe the contents of this struct in a string. - # - # @return [String] the contents of this struct in a string - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#29 - def to_s; end - - # Returns the values for this struct as an Array. - # - # @return [Array] the values for this struct - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#18 - def values; end - - # Returns the struct member values for each selector as an Array. - # - # A selector may be either an Integer offset or a Range of offsets (as in `Array#values_at`). - # - # @param indexes [Fixnum, Range] the index(es) from which to obatin the values (in order) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#24 - def values_at(*indexes); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#97 - def initialize_copy(original); end - - class << self - # Factory for creating new struct classes. - # - # ``` - # new([class_name] [, member_name]+>) -> StructClass click to toggle source - # new([class_name] [, member_name]+>) {|StructClass| block } -> StructClass - # new(value, ...) -> obj - # StructClass[value, ...] -> obj - # ``` - # - # The first two forms are used to create a new struct subclass `class_name` - # that can contain a value for each member_name . This subclass can be - # used to create instances of the structure like any other Class . - # - # If the `class_name` is omitted an anonymous struct class will be created. - # Otherwise, the name of this struct will appear as a constant in the struct class, - # so it must be unique for all structs under this base class and must start with a - # capital letter. Assigning a struct class to a constant also gives the class - # the name of the constant. - # - # If a block is given it will be evaluated in the context of `StructClass`, passing - # the created class as a parameter. This is the recommended way to customize a struct. - # Subclassing an anonymous struct creates an extra anonymous class that will never be used. - # - # The last two forms create a new instance of a struct subclass. The number of value - # parameters must be less than or equal to the number of attributes defined for the - # struct. Unset parameters default to nil. Passing more parameters than number of attributes - # will raise an `ArgumentError`. - # - # @see http://ruby-doc.org/core/Struct.html#method-c-new Ruby standard library `Struct#new` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#105 - def new(*args, &block); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#115 -Concurrent::SettableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) - -# An executor service in which every operation spawns a new, -# independently operating thread. -# -# This is perhaps the most inefficient executor service in this -# library. It exists mainly for testing an debugging. Thread creation -# and management is expensive in Ruby and this executor performs no -# resource pooling. This can be very beneficial during testing and -# debugging because it decouples the using code from the underlying -# executor implementation. In production this executor will likely -# lead to suboptimal performance. -# -# @note Intended for use primarily in testing and debugging. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#21 -class Concurrent::SimpleExecutorService < ::Concurrent::RubyExecutorService - # Submit a task to the executor for asynchronous processing. - # - # @param task [Proc] the asynchronous task to perform - # @return [self] returns itself - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#56 - def <<(task); end - - # Begin an immediate shutdown. In-progress tasks will be allowed to - # complete but enqueued tasks will be dismissed and no new tasks - # will be accepted. Has no additional effect if the thread pool is - # not running. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#84 - def kill; end - - # Submit a task to the executor for asynchronous processing. - # - # @param args [Array] zero or more arguments to be passed to the task - # @raise [ArgumentError] if no task is given - # @return [Boolean] `true` if the task is queued, `false` if the executor - # is not running - # @yield the asynchronous task to perform - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#40 - def post(*args, &task); end - - # Is the executor running? - # - # @return [Boolean] `true` when running, `false` when shutting down or shutdown - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#62 - def running?; end - - # Begin an orderly shutdown. Tasks already in the queue will be executed, - # but no new tasks will be accepted. Has no additional effect if the - # thread pool is not running. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#77 - def shutdown; end - - # Is the executor shutdown? - # - # @return [Boolean] `true` when shutdown, `false` when shutting down or running - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#72 - def shutdown?; end - - # Is the executor shuttingdown? - # - # @return [Boolean] `true` when not running and not shutdown, else `false` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#67 - def shuttingdown?; end - - # Block until executor shutdown is complete or until `timeout` seconds have - # passed. - # - # @note Does not initiate shutdown or termination. Either `shutdown` or `kill` - # must be called before this method (or on another thread). - # @param timeout [Integer] the maximum number of seconds to wait for shutdown to complete - # @return [Boolean] `true` if shutdown complete or false on `timeout` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#91 - def wait_for_termination(timeout = T.unsafe(nil)); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#97 - def ns_initialize(*args); end - - class << self - # Submit a task to the executor for asynchronous processing. - # - # @param task [Proc] the asynchronous task to perform - # @return [self] returns itself - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#34 - def <<(task); end - - # Submit a task to the executor for asynchronous processing. - # - # @param args [Array] zero or more arguments to be passed to the task - # @raise [ArgumentError] if no task is given - # @return [Boolean] `true` if the task is queued, `false` if the executor - # is not running - # @yield the asynchronous task to perform - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#24 - def post(*args); end - end -end - -# A thread pool with a single thread an unlimited queue. Should the thread -# die for any reason it will be removed and replaced, thus ensuring that -# the executor will always remain viable and available to process jobs. -# -# A common pattern for background processing is to create a single thread -# on which an infinite loop is run. The thread's loop blocks on an input -# source (perhaps blocking I/O or a queue) and processes each input as it -# is received. This pattern has several issues. The thread itself is highly -# susceptible to errors during processing. Also, the thread itself must be -# constantly monitored and restarted should it die. `SingleThreadExecutor` -# encapsulates all these behaviors. The task processor is highly resilient -# to errors from within tasks. Also, should the thread die it will -# automatically be restarted. -# -# The API and behavior of this class are based on Java's `SingleThreadExecutor`. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb#37 -class Concurrent::SingleThreadExecutor < ::Concurrent::RubySingleThreadExecutor; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb#10 -Concurrent::SingleThreadExecutorImplementation = Concurrent::RubySingleThreadExecutor - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#2 -module Concurrent::Synchronization - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/full_memory_barrier.rb#7 - def full_memory_barrier; end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#9 -class Concurrent::Synchronization::AbstractLockableObject < ::Concurrent::Synchronization::Object - protected - - # Broadcast to all waiting threads. - # - # @note only to be used inside synchronized block - # @note to provide direct access to this method in a descendant add method - # ``` - # def broadcast - # synchronize { ns_broadcast } - # end - # ``` - # @raise [NotImplementedError] - # @return [self] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#96 - def ns_broadcast; end - - # Signal one waiting thread. - # - # @note only to be used inside synchronized block - # @note to provide direct access to this method in a descendant add method - # ``` - # def signal - # synchronize { ns_signal } - # end - # ``` - # @raise [NotImplementedError] - # @return [self] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#81 - def ns_signal; end - - # Wait until another thread calls #signal or #broadcast, - # spurious wake-ups can happen. - # - # @note only to be used inside synchronized block - # @note to provide direct access to this method in a descendant add method - # ``` - # def wait(timeout = nil) - # synchronize { ns_wait(timeout) } - # end - # ``` - # @param timeout [Numeric, nil] in seconds, `nil` means no timeout - # @raise [NotImplementedError] - # @return [self] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#66 - def ns_wait(timeout = T.unsafe(nil)); end - - # Wait until condition is met or timeout passes, - # protects against spurious wake-ups. - # - # @note only to be used inside synchronized block - # @note to provide direct access to this method in a descendant add method - # ``` - # def wait_until(timeout = nil, &condition) - # synchronize { ns_wait_until(timeout, &condition) } - # end - # ``` - # @param timeout [Numeric, nil] in seconds, `nil` means no timeout - # @return [true, false] if condition met - # @yield condition to be met - # @yieldreturn [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#37 - def ns_wait_until(timeout = T.unsafe(nil), &condition); end - - # @note can by made public in descendants if required by `public :synchronize` - # @raise [NotImplementedError] - # @yield runs the block synchronized against this object, - # equivalent of java's `synchronize(this) {}` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#18 - def synchronize; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#6 -class Concurrent::Synchronization::AbstractObject - # @return [AbstractObject] a new instance of AbstractObject - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#7 - def initialize; end - - # @abstract - # @raise [NotImplementedError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#13 - def full_memory_barrier; end - - class << self - # @raise [NotImplementedError] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#17 - def attr_volatile(*names); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#6 -module Concurrent::Synchronization::AbstractStruct - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#9 - def initialize(*values); end - - # Returns the number of struct members. - # - # @return [Fixnum] the number of struct members - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#19 - def length; end - - # Returns the struct members as an array of symbols. - # - # @return [Array] the struct members as an array of symbols - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#29 - def members; end - - # Returns the number of struct members. - # - # @return [Fixnum] the number of struct members - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#19 - def size; end - - protected - - # Yields the value of each struct member in order. If no block is given - # an enumerator is returned. - # - # @yield the operation to be performed on each struct member - # @yieldparam value [Object] each struct value (in order) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#82 - def ns_each; end - - # Yields the name and value of each struct member in order. If no block is - # given an enumerator is returned. - # - # @yield the operation to be performed on each struct member/value pair - # @yieldparam member [Object] each struct member (in order) - # @yieldparam value [Object] each struct value (in order) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#89 - def ns_each_pair; end - - # Equality - # - # @return [Boolean] true if other has the same struct subclass and has - # equal member values (according to `Object#==`) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#75 - def ns_equality(other); end - - # Attribute Reference - # - # @param member [Symbol, String, Integer] the string or symbol name of the member - # for which to obtain the value or the member's index - # @raise [NameError] if the member does not exist - # @raise [IndexError] if the index is out of range. - # @return [Object] the value of the given struct member or the member at the given index. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#59 - def ns_get(member); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#119 - def ns_initialize_copy; end - - # Describe the contents of this struct in a string. - # - # @return [String] the contents of this struct in a string - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#105 - def ns_inspect; end - - # Returns a new struct containing the contents of `other` and the contents - # of `self`. If no block is specified, the value for entries with duplicate - # keys will be that of `other`. Otherwise the value for each duplicate key - # is determined by calling the block with the key, its value in `self` and - # its value in `other`. - # - # @param other [Hash] the hash from which to set the new values - # @raise [ArgumentError] of given a member that is not defined in the struct - # @return [Synchronization::AbstractStruct] a new struct with the new values - # @yield an options block for resolving duplicate keys - # @yieldparam member [String, Symbol] the name of the member which is duplicated - # @yieldparam selfvalue [Object] the value of the member in `self` - # @yieldparam othervalue [Object] the value of the member in `other` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#114 - def ns_merge(other, &block); end - - # Yields each member value from the struct to the block and returns an Array - # containing the member values from the struct for which the given block - # returns a true value (equivalent to `Enumerable#select`). - # - # @return [Array] an array containing each value for which the block returns true - # @yield the operation to be performed on each struct member - # @yieldparam value [Object] each struct value (in order) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#98 - def ns_select; end - - # Returns a hash containing the names and values for the struct’s members. - # - # @return [Hash] the names and values for the struct’s members - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#52 - def ns_to_h; end - - # Returns the values for this struct as an Array. - # - # @return [Array] the values for this struct - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#38 - def ns_values; end - - # Returns the struct member values for each selector as an Array. - # - # A selector may be either an Integer offset or a Range of offsets (as in `Array#values_at`). - # - # @param indexes [Fixnum, Range] the index(es) from which to obatin the values (in order) - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#45 - def ns_values_at(indexes); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#130 - def pr_underscore(clazz); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#141 - def define_struct_class(parent, base, name, members, &block); end - end -end - -# TODO (pitr-ch 04-Dec-2016): should be in edge -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#8 -class Concurrent::Synchronization::Condition < ::Concurrent::Synchronization::LockableObject - # @return [Condition] a new instance of Condition - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#18 - def initialize(lock); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#47 - def broadcast; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#51 - def ns_broadcast; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#43 - def ns_signal; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#27 - def ns_wait(timeout = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#35 - def ns_wait_until(timeout = T.unsafe(nil), &condition); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#39 - def signal; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#23 - def wait(timeout = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#31 - def wait_until(timeout = T.unsafe(nil), &condition); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb#29 - def private_new(*args, &block); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb#29 - def new(*args, &block); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#8 -module Concurrent::Synchronization::ConditionSignalling - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#16 - def ns_broadcast; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#11 - def ns_signal; end -end - -# TODO (pitr-ch 04-Dec-2016): should be in edge -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#8 -class Concurrent::Synchronization::Lock < ::Concurrent::Synchronization::LockableObject - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#31 - def broadcast; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#16 - def ns_broadcast; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#11 - def ns_signal; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#52 - def ns_wait(timeout = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#37 - def ns_wait_until(timeout = T.unsafe(nil), &condition); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#25 - def signal; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#44 - def synchronize; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#13 - def wait(timeout = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#19 - def wait_until(timeout = T.unsafe(nil), &condition); end -end - -# Safe synchronization under any Ruby implementation. -# It provides methods like {#synchronize}, {#wait}, {#signal} and {#broadcast}. -# Provides a single layer which can improve its implementation over time without changes needed to -# the classes using it. Use {Synchronization::Object} not this abstract class. -# -# @note this object does not support usage together with -# [`Thread#wakeup`](http://ruby-doc.org/core/Thread.html#method-i-wakeup) -# and [`Thread#raise`](http://ruby-doc.org/core/Thread.html#method-i-raise). -# `Thread#sleep` and `Thread#wakeup` will work as expected but mixing `Synchronization::Object#wait` and -# `Thread#wakeup` will not work on all platforms. -# -# @see Event implementation as an example of this class use -# -# @example simple -# class AnClass < Synchronization::Object -# def initialize -# super -# synchronize { @value = 'asd' } -# end -# -# def value -# synchronize { @value } -# end -# end -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb#50 -class Concurrent::Synchronization::LockableObject < ::Concurrent::Synchronization::MutexLockableObject - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#57 - def new_condition; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb#11 -Concurrent::Synchronization::LockableObjectImplementation = Concurrent::Synchronization::MutexLockableObject - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#60 -class Concurrent::Synchronization::MonitorLockableObject < ::Concurrent::Synchronization::AbstractLockableObject - include ::Concurrent::Synchronization::ConditionSignalling - extend ::Concurrent::Synchronization::SafeInitialization - - # @return [MonitorLockableObject] a new instance of MonitorLockableObject - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#65 - def initialize; end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#83 - def ns_wait(timeout = T.unsafe(nil)); end - - # TODO may be a problem with lock.synchronize { lock.wait } - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#79 - def synchronize; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#71 - def initialize_copy(other); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#25 -class Concurrent::Synchronization::MutexLockableObject < ::Concurrent::Synchronization::AbstractLockableObject - include ::Concurrent::Synchronization::ConditionSignalling - extend ::Concurrent::Synchronization::SafeInitialization - - # @return [MutexLockableObject] a new instance of MutexLockableObject - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#30 - def initialize; end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#52 - def ns_wait(timeout = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#44 - def synchronize; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#36 - def initialize_copy(other); end -end - -# Abstract object providing final, volatile, ans CAS extensions to build other concurrent abstractions. -# - final instance variables see {Object.safe_initialization!} -# - volatile instance variables see {Object.attr_volatile} -# - volatile instance variables see {Object.attr_atomic} -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#15 -class Concurrent::Synchronization::Object < ::Concurrent::Synchronization::AbstractObject - include ::Concurrent::Synchronization::Volatile - extend ::Concurrent::Synchronization::Volatile::ClassMethods - - # Has to be called by children. - # - # @return [Object] a new instance of Object - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#28 - def initialize; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#146 - def __initialize_atomic_fields__; end - - class << self - # @return [true, false] is the attribute with name atomic? - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#125 - def atomic_attribute?(name); end - - # @param inherited [true, false] should inherited volatile with CAS fields be returned? - # @return [::Array] Returns defined volatile with CAS fields on this class. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#119 - def atomic_attributes(inherited = T.unsafe(nil)); end - - # Creates methods for reading and writing to a instance variable with - # volatile (Java) semantic as {.attr_volatile} does. - # The instance variable should be accessed only through generated methods. - # This method generates following methods: `value`, `value=(new_value) #=> new_value`, - # `swap_value(new_value) #=> old_value`, - # `compare_and_set_value(expected, value) #=> true || false`, `update_value(&block)`. - # - # @param names [::Array] of the instance variables to be volatile with CAS. - # @return [::Array] names of defined method names. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#84 - def attr_atomic(*names); end - - # For testing purposes, quite slow. Injects assert code to new method which will raise if class instance contains - # any instance variables with CamelCase names and isn't {.safe_initialization?}. - # - # @raise when offend found - # @return [true] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#45 - def ensure_safe_initialization_when_final_fields_are_present; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#33 - def safe_initialization!; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#37 - def safe_initialization?; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#131 - def define_initialize_atomic_fields; end - end -end - -# By extending this module, a class and all its children are marked to be constructed safely. Meaning that -# all writes (ivar initializations) are made visible to all readers of newly constructed object. It ensures -# same behaviour as Java's final fields. -# -# Due to using Kernel#extend, the module is not included again if already present in the ancestors, -# which avoids extra overhead. -# -# @example -# class AClass < Concurrent::Synchronization::Object -# extend Concurrent::Synchronization::SafeInitialization -# -# def initialize -# @AFinalValue = 'value' # published safely, #foo will never return nil -# end -# -# def foo -# @AFinalValue -# end -# end -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb#28 -module Concurrent::Synchronization::SafeInitialization - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb#29 - def new(*args, &block); end -end - -# Volatile adds the attr_volatile class method when included. -# -# foo = Foo.new -# foo.bar -# => 1 -# foo.bar = 2 -# => 2 -# -# @example -# class Foo -# include Concurrent::Synchronization::Volatile -# -# attr_volatile :bar -# -# def initialize -# self.bar = 1 -# end -# end -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#28 -module Concurrent::Synchronization::Volatile - mixes_in_class_methods ::Concurrent::Synchronization::Volatile::ClassMethods - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#33 - def full_memory_barrier; end - - class << self - # @private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#29 - def included(base); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#37 -module Concurrent::Synchronization::Volatile::ClassMethods - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#39 - def attr_volatile(*names); end -end - -# This class provides a trivial way to synchronize all calls to a given object -# by wrapping it with a `Delegator` that performs `Monitor#enter/exit` calls -# around the delegated `#send`. Example: -# -# array = [] # not thread-safe on many impls -# array = SynchronizedDelegator.new([]) # thread-safe -# -# A simple `Monitor` provides a very coarse-grained way to synchronize a given -# object, in that it will cause synchronization for methods that have no need -# for it, but this is a trivial way to get thread-safety where none may exist -# currently on some implementations. -# -# This class is currently being considered for inclusion into stdlib, via -# https://bugs.ruby-lang.org/issues/8556 -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#21 -class Concurrent::SynchronizedDelegator < ::SimpleDelegator - # @return [SynchronizedDelegator] a new instance of SynchronizedDelegator - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#31 - def initialize(obj); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#36 - def method_missing(method, *args, &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#22 - def setup; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#27 - def teardown; end -end - -# A `TVar` is a transactional variable - a single-element container that -# is used as part of a transaction - see `Concurrent::atomically`. -# -# -# ## Thread-safe Variable Classes -# -# Each of the thread-safe variable classes is designed to solve a different -# problem. In general: -# -# * *{Concurrent::Agent}:* Shared, mutable variable providing independent, -# uncoordinated, *asynchronous* change of individual values. Best used when -# the value will undergo frequent, complex updates. Suitable when the result -# of an update does not need to be known immediately. -# * *{Concurrent::Atom}:* Shared, mutable variable providing independent, -# uncoordinated, *synchronous* change of individual values. Best used when -# the value will undergo frequent reads but only occasional, though complex, -# updates. Suitable when the result of an update must be known immediately. -# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated -# atomically. Updates are synchronous but fast. Best used when updates a -# simple set operations. Not suitable when updates are complex. -# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar -# but optimized for the given data type. -# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used -# when two or more threads need to exchange data. The threads will pair then -# block on each other until the exchange is complete. -# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread -# must give a value to another, which must take the value. The threads will -# block on each other until the exchange is complete. -# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which -# holds a different value for each thread which has access. Often used as -# an instance variable in objects which must maintain different state -# for different threads. -# * *{Concurrent::TVar}:* Shared, mutable variables which provide -# *coordinated*, *synchronous*, change of *many* stated. Used when multiple -# value must change together, in an all-or-nothing transaction. -# {include:file:docs-source/tvar.md} -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#12 -class Concurrent::TVar < ::Concurrent::Synchronization::Object - extend ::Concurrent::Synchronization::SafeInitialization - - # Create a new `TVar` with an initial value. - # - # @return [TVar] a new instance of TVar - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#16 - def initialize(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#46 - def unsafe_lock; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#36 - def unsafe_value; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#41 - def unsafe_value=(value); end - - # Get the value of a `TVar`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#22 - def value; end - - # Set the value of a `TVar`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#29 - def value=(value); end -end - -# A `ThreadLocalVar` is a variable where the value is different for each thread. -# Each variable may have a default value, but when you modify the variable only -# the current thread will ever see that change. -# -# This is similar to Ruby's built-in thread-local variables (`Thread#thread_variable_get`), -# but with these major advantages: -# * `ThreadLocalVar` has its own identity, it doesn't need a Symbol. -# * Each Ruby's built-in thread-local variable leaks some memory forever (it's a Symbol held forever on the thread), -# so it's only OK to create a small amount of them. -# `ThreadLocalVar` has no such issue and it is fine to create many of them. -# * Ruby's built-in thread-local variables leak forever the value set on each thread (unless set to nil explicitly). -# `ThreadLocalVar` automatically removes the mapping for each thread once the `ThreadLocalVar` instance is GC'd. -# -# -# ## Thread-safe Variable Classes -# -# Each of the thread-safe variable classes is designed to solve a different -# problem. In general: -# -# * *{Concurrent::Agent}:* Shared, mutable variable providing independent, -# uncoordinated, *asynchronous* change of individual values. Best used when -# the value will undergo frequent, complex updates. Suitable when the result -# of an update does not need to be known immediately. -# * *{Concurrent::Atom}:* Shared, mutable variable providing independent, -# uncoordinated, *synchronous* change of individual values. Best used when -# the value will undergo frequent reads but only occasional, though complex, -# updates. Suitable when the result of an update must be known immediately. -# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated -# atomically. Updates are synchronous but fast. Best used when updates a -# simple set operations. Not suitable when updates are complex. -# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar -# but optimized for the given data type. -# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used -# when two or more threads need to exchange data. The threads will pair then -# block on each other until the exchange is complete. -# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread -# must give a value to another, which must take the value. The threads will -# block on each other until the exchange is complete. -# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which -# holds a different value for each thread which has access. Often used as -# an instance variable in objects which must maintain different state -# for different threads. -# * *{Concurrent::TVar}:* Shared, mutable variables which provide -# *coordinated*, *synchronous*, change of *many* stated. Used when multiple -# value must change together, in an all-or-nothing transaction. -# -# @example -# v = ThreadLocalVar.new(14) -# v.value #=> 14 -# v.value = 2 -# v.value #=> 2 -# @example -# v = ThreadLocalVar.new(14) -# -# t1 = Thread.new do -# v.value #=> 14 -# v.value = 1 -# v.value #=> 1 -# end -# -# t2 = Thread.new do -# v.value #=> 14 -# v.value = 2 -# v.value #=> 2 -# end -# -# v.value #=> 14 -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#43 -class Concurrent::ThreadLocalVar - # Creates a thread local variable. - # - # @param default [Object] the default value when otherwise unset - # @param default_block [Proc] Optional block that gets called to obtain the - # default value for each thread - # @return [ThreadLocalVar] a new instance of ThreadLocalVar - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#51 - def initialize(default = T.unsafe(nil), &default_block); end - - # Bind the given value to thread local storage during - # execution of the given block. - # - # @param value [Object] the value to bind - # @return [Object] the value - # @yield the operation to be performed with the bound variable - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#88 - def bind(value); end - - # Returns the value in the current thread's copy of this thread-local variable. - # - # @return [Object] the current value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#70 - def value; end - - # Sets the current thread's copy of this thread-local variable to the specified value. - # - # @param value [Object] the value to set - # @return [Object] the new value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#78 - def value=(value); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#103 - def default; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#44 -Concurrent::ThreadLocalVar::LOCALS = T.let(T.unsafe(nil), Concurrent::ThreadLocals) - -# An array-backed storage of indexed variables per thread. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#141 -class Concurrent::ThreadLocals < ::Concurrent::AbstractLocals - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#142 - def locals; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#146 - def locals!; end -end - -# An abstraction composed of one or more threads and a task queue. Tasks -# (blocks or `proc` objects) are submitted to the pool and added to the queue. -# The threads in the pool remove the tasks and execute them in the order -# they were received. -# -# A `ThreadPoolExecutor` will automatically adjust the pool size according -# to the bounds set by `min-threads` and `max-threads`. When a new task is -# submitted and fewer than `min-threads` threads are running, a new thread -# is created to handle the request, even if other worker threads are idle. -# If there are more than `min-threads` but less than `max-threads` threads -# running, a new thread will be created only if the queue is full. -# -# Threads that are idle for too long will be garbage collected, down to the -# configured minimum options. Should a thread crash it, too, will be garbage collected. -# -# `ThreadPoolExecutor` is based on the Java class of the same name. From -# the official Java documentation; -# -# > Thread pools address two different problems: they usually provide -# > improved performance when executing large numbers of asynchronous tasks, -# > due to reduced per-task invocation overhead, and they provide a means -# > of bounding and managing the resources, including threads, consumed -# > when executing a collection of tasks. Each ThreadPoolExecutor also -# > maintains some basic statistics, such as the number of completed tasks. -# > -# > To be useful across a wide range of contexts, this class provides many -# > adjustable parameters and extensibility hooks. However, programmers are -# > urged to use the more convenient Executors factory methods -# > [CachedThreadPool] (unbounded thread pool, with automatic thread reclamation), -# > [FixedThreadPool] (fixed size thread pool) and [SingleThreadExecutor] (single -# > background thread), that preconfigure settings for the most common usage -# > scenarios. -# -# **Thread Pool Options** -# -# Thread pools support several configuration options: -# -# * `idletime`: The number of seconds that a thread may be idle before being reclaimed. -# * `name`: The name of the executor (optional). Printed in the executor's `#to_s` output and -# a `-worker-` name is given to its threads if supported by used Ruby -# implementation. `` is uniq for each thread. -# * `max_queue`: The maximum number of tasks that may be waiting in the work queue at -# any one time. When the queue size reaches `max_queue` and no new threads can be created, -# subsequent tasks will be rejected in accordance with the configured `fallback_policy`. -# * `auto_terminate`: When true (default), the threads started will be marked as daemon. -# * `fallback_policy`: The policy defining how rejected tasks are handled. -# -# Three fallback policies are supported: -# -# * `:abort`: Raise a `RejectedExecutionError` exception and discard the task. -# * `:discard`: Discard the task and return false. -# * `:caller_runs`: Execute the task on the calling thread. -# -# **Shutting Down Thread Pools** -# -# Killing a thread pool while tasks are still being processed, either by calling -# the `#kill` method or at application exit, will have unpredictable results. There -# is no way for the thread pool to know what resources are being used by the -# in-progress tasks. When those tasks are killed the impact on those resources -# cannot be predicted. The *best* practice is to explicitly shutdown all thread -# pools using the provided methods: -# -# * Call `#shutdown` to initiate an orderly termination of all in-progress tasks -# * Call `#wait_for_termination` with an appropriate timeout interval an allow -# the orderly shutdown to complete -# * Call `#kill` *only when* the thread pool fails to shutdown in the allotted time -# -# On some runtime platforms (most notably the JVM) the application will not -# exit until all thread pools have been shutdown. To prevent applications from -# "hanging" on exit, all threads can be marked as daemon according to the -# `:auto_terminate` option. -# -# ```ruby -# pool1 = Concurrent::FixedThreadPool.new(5) # threads will be marked as daemon -# pool2 = Concurrent::FixedThreadPool.new(5, auto_terminate: false) # mark threads as non-daemon -# ``` -# -# @note Failure to properly shutdown a thread pool can lead to unpredictable results. -# Please read *Shutting Down Thread Pools* for more information. -# @see http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html Java Tutorials: Thread Pools -# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html Java Executors class -# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html Java ExecutorService interface -# @see https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean- -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/thread_pool_executor.rb#56 -class Concurrent::ThreadPoolExecutor < ::Concurrent::RubyThreadPoolExecutor; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/thread_pool_executor.rb#10 -Concurrent::ThreadPoolExecutorImplementation = Concurrent::RubyThreadPoolExecutor - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util.rb#4 -module Concurrent::ThreadSafe; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util.rb#7 -module Concurrent::ThreadSafe::Util - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#16 - def make_synchronized_on_cruby(klass); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#41 - def make_synchronized_on_truffleruby(klass); end - end -end - -# TODO (pitr-ch 15-Oct-2016): migrate to Utility::ProcessorCounter -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util.rb#13 -Concurrent::ThreadSafe::Util::CPU_COUNT = T.let(T.unsafe(nil), Integer) - -# TODO (pitr-ch 15-Oct-2016): migrate to Utility::NativeInteger -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util.rb#10 -Concurrent::ThreadSafe::Util::FIXNUM_BIT_SIZE = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util.rb#11 -Concurrent::ThreadSafe::Util::MAX_INT = T.let(T.unsafe(nil), Integer) - -# Raised when an operation times out. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#55 -class Concurrent::TimeoutError < ::Concurrent::Error; end - -# Executes a collection of tasks, each after a given delay. A master task -# monitors the set and schedules each task for execution at the appropriate -# time. Tasks are run on the global thread pool or on the supplied executor. -# Each task is represented as a `ScheduledTask`. -# -# @see Concurrent::ScheduledTask -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#19 -class Concurrent::TimerSet < ::Concurrent::RubyExecutorService - # Create a new set of timed tasks. - # - # @option opts - # @param opts [Hash] the options used to specify the executor on which to perform actions - # @return [TimerSet] a new instance of TimerSet - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#30 - def initialize(opts = T.unsafe(nil)); end - - # Begin an immediate shutdown. In-progress tasks will be allowed to - # complete but enqueued tasks will be dismissed and no new tasks - # will be accepted. Has no additional effect if the thread pool is - # not running. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#62 - def kill; end - - # Post a task to be execute run after a given delay (in seconds). If the - # delay is less than 1/100th of a second the task will be immediately post - # to the executor. - # - # @param delay [Float] the number of seconds to wait for before executing the task. - # @param args [Array] the arguments passed to the task on execution. - # @raise [ArgumentError] if the intended execution time is not in the future. - # @raise [ArgumentError] if no block is given. - # @return [Concurrent::ScheduledTask, false] IVar representing the task if the post - # is successful; false after shutdown. - # @yield the task to be performed. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#48 - def post(delay, *args, &task); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/executor_service.rb#166 - def <<(task); end - - # Initialize the object. - # - # @param opts [Hash] the options to create the object with. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#74 - def ns_initialize(opts); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#94 - def ns_post_task(task); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#129 - def ns_reset_if_forked; end - - # `ExecutorService` callback called during shutdown. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#122 - def ns_shutdown_execution; end - - # Post the task to the internal queue. - # - # @note This is intended as a callback method from ScheduledTask - # only. It is not intended to be used directly. Post a task - # by using the `SchedulesTask#execute` method. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#89 - def post_task(task); end - - # Run a loop and execute tasks in the scheduled order and at the approximate - # scheduled time. If no tasks remain the thread will exit gracefully so that - # garbage collection can occur. If there are no ready tasks it will sleep - # for up to 60 seconds waiting for the next scheduled task. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#143 - def process_tasks; end - - # Remove the given task from the queue. - # - # @note This is intended as a callback method from `ScheduledTask` - # only. It is not intended to be used directly. Cancel a task - # by using the `ScheduledTask#cancel` method. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#115 - def remove_task(task); end -end - -# A very common concurrency pattern is to run a thread that performs a task at -# regular intervals. The thread that performs the task sleeps for the given -# interval then wakes up and performs the task. Lather, rinse, repeat... This -# pattern causes two problems. First, it is difficult to test the business -# logic of the task because the task itself is tightly coupled with the -# concurrency logic. Second, an exception raised while performing the task can -# cause the entire thread to abend. In a long-running application where the -# task thread is intended to run for days/weeks/years a crashed task thread -# can pose a significant problem. `TimerTask` alleviates both problems. -# -# When a `TimerTask` is launched it starts a thread for monitoring the -# execution interval. The `TimerTask` thread does not perform the task, -# however. Instead, the TimerTask launches the task on a separate thread. -# Should the task experience an unrecoverable crash only the task thread will -# crash. This makes the `TimerTask` very fault tolerant. Additionally, the -# `TimerTask` thread can respond to the success or failure of the task, -# performing logging or ancillary operations. -# -# One other advantage of `TimerTask` is that it forces the business logic to -# be completely decoupled from the concurrency logic. The business logic can -# be tested separately then passed to the `TimerTask` for scheduling and -# running. -# -# A `TimerTask` supports two different types of interval calculations. -# A fixed delay will always wait the same amount of time between the -# completion of one task and the start of the next. A fixed rate will -# attempt to maintain a constant rate of execution regardless of the -# duration of the task. For example, if a fixed rate task is scheduled -# to run every 60 seconds but the task itself takes 10 seconds to -# complete, the next task will be scheduled to run 50 seconds after -# the start of the previous task. If the task takes 70 seconds to -# complete, the next task will be start immediately after the previous -# task completes. Tasks will not be executed concurrently. -# -# In some cases it may be necessary for a `TimerTask` to affect its own -# execution cycle. To facilitate this, a reference to the TimerTask instance -# is passed as an argument to the provided block every time the task is -# executed. -# -# The `TimerTask` class includes the `Dereferenceable` mixin module so the -# result of the last execution is always available via the `#value` method. -# Dereferencing options can be passed to the `TimerTask` during construction or -# at any later time using the `#set_deref_options` method. -# -# `TimerTask` supports notification through the Ruby standard library -# {http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html -# Observable} module. On execution the `TimerTask` will notify the observers -# with three arguments: time of execution, the result of the block (or nil on -# failure), and any raised exceptions (or nil on success). -# -# @example Basic usage -# task = Concurrent::TimerTask.new{ puts 'Boom!' } -# task.execute -# -# task.execution_interval #=> 60 (default) -# -# # wait 60 seconds... -# #=> 'Boom!' -# -# task.shutdown #=> true -# @example Configuring `:execution_interval` -# task = Concurrent::TimerTask.new(execution_interval: 5) do -# puts 'Boom!' -# end -# -# task.execution_interval #=> 5 -# @example Immediate execution with `:run_now` -# task = Concurrent::TimerTask.new(run_now: true){ puts 'Boom!' } -# task.execute -# -# #=> 'Boom!' -# @example Configuring `:interval_type` with either :fixed_delay or :fixed_rate, default is :fixed_delay -# task = Concurrent::TimerTask.new(execution_interval: 5, interval_type: :fixed_rate) do -# puts 'Boom!' -# end -# task.interval_type #=> :fixed_rate -# @example Last `#value` and `Dereferenceable` mixin -# task = Concurrent::TimerTask.new( -# dup_on_deref: true, -# execution_interval: 5 -# ){ Time.now } -# -# task.execute -# Time.now #=> 2013-11-07 18:06:50 -0500 -# sleep(10) -# task.value #=> 2013-11-07 18:06:55 -0500 -# @example Controlling execution from within the block -# timer_task = Concurrent::TimerTask.new(execution_interval: 1) do |task| -# task.execution_interval.to_i.times{ print 'Boom! ' } -# print "\n" -# task.execution_interval += 1 -# if task.execution_interval > 5 -# puts 'Stopping...' -# task.shutdown -# end -# end -# -# timer_task.execute -# #=> Boom! -# #=> Boom! Boom! -# #=> Boom! Boom! Boom! -# #=> Boom! Boom! Boom! Boom! -# #=> Boom! Boom! Boom! Boom! Boom! -# #=> Stopping... -# @example Observation -# class TaskObserver -# def update(time, result, ex) -# if result -# print "(#{time}) Execution successfully returned #{result}\n" -# else -# print "(#{time}) Execution failed with error #{ex}\n" -# end -# end -# end -# -# task = Concurrent::TimerTask.new(execution_interval: 1){ 42 } -# task.add_observer(TaskObserver.new) -# task.execute -# sleep 4 -# -# #=> (2013-10-13 19:08:58 -0400) Execution successfully returned 42 -# #=> (2013-10-13 19:08:59 -0400) Execution successfully returned 42 -# #=> (2013-10-13 19:09:00 -0400) Execution successfully returned 42 -# task.shutdown -# -# task = Concurrent::TimerTask.new(execution_interval: 1){ sleep } -# task.add_observer(TaskObserver.new) -# task.execute -# -# #=> (2013-10-13 19:07:25 -0400) Execution timed out -# #=> (2013-10-13 19:07:27 -0400) Execution timed out -# #=> (2013-10-13 19:07:29 -0400) Execution timed out -# task.shutdown -# -# task = Concurrent::TimerTask.new(execution_interval: 1){ raise StandardError } -# task.add_observer(TaskObserver.new) -# task.execute -# -# #=> (2013-10-13 19:09:37 -0400) Execution failed with error StandardError -# #=> (2013-10-13 19:09:38 -0400) Execution failed with error StandardError -# #=> (2013-10-13 19:09:39 -0400) Execution failed with error StandardError -# task.shutdown -# @see http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html -# @see http://docs.oracle.com/javase/7/docs/api/java/util/TimerTask.html -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#165 -class Concurrent::TimerTask < ::Concurrent::RubyExecutorService - include ::Concurrent::Concern::Dereferenceable - include ::Concurrent::Concern::Observable - - # Create a new TimerTask with the given task and configuration. - # - # @option opts - # @option opts - # @option opts - # @param opts [Hash] the options defining task execution. - # @raise ArgumentError when no block is given. - # @return [TimerTask] the new `TimerTask` - # @yield to the block after :execution_interval seconds have passed since - # the last yield - # @yieldparam task a reference to the `TimerTask` instance so that the - # block can control its own lifecycle. Necessary since `self` will - # refer to the execution context of the block rather than the running - # `TimerTask`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#209 - def initialize(opts = T.unsafe(nil), &task); end - - # Execute a previously created `TimerTask`. - # - # @example Instance and execute in separate steps - # task = Concurrent::TimerTask.new(execution_interval: 10){ print "Hello World\n" } - # task.running? #=> false - # task.execute - # task.running? #=> true - # @example Instance and execute in one line - # task = Concurrent::TimerTask.new(execution_interval: 10){ print "Hello World\n" }.execute - # task.running? #=> true - # @return [TimerTask] a reference to `self` - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#235 - def execute; end - - # @return [Fixnum] Number of seconds after the task completes before the - # task is performed again. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#259 - def execution_interval; end - - # @return [Fixnum] Number of seconds after the task completes before the - # task is performed again. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#266 - def execution_interval=(value); end - - # @return [Symbol] method to calculate the interval between executions - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#276 - def interval_type; end - - # Is the executor running? - # - # @return [Boolean] `true` when running, `false` when shutting down or shutdown - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#218 - def running?; end - - # @return [Fixnum] Number of seconds the task can run before it is - # considered to have failed. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#281 - def timeout_interval; end - - # @return [Fixnum] Number of seconds the task can run before it is - # considered to have failed. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#288 - def timeout_interval=(value); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/executor_service.rb#166 - def <<(task); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#352 - def calculate_next_interval(start_time); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#336 - def execute_task(completion); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#296 - def ns_initialize(opts, &task); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#324 - def ns_kill_execution; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#318 - def ns_shutdown_execution; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#17 - def post(*args, &task); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#330 - def schedule_next_task(interval = T.unsafe(nil)); end - - class << self - # Create and execute a new `TimerTask`. - # - # @example - # task = Concurrent::TimerTask.execute(execution_interval: 10){ print "Hello World\n" } - # task.running? #=> true - # @option opts - # @option opts - # @option opts - # @param opts [Hash] the options defining task execution. - # @raise ArgumentError when no block is given. - # @return [TimerTask] the new `TimerTask` - # @yield to the block after :execution_interval seconds have passed since - # the last yield - # @yieldparam task a reference to the `TimerTask` instance so that the - # block can control its own lifecycle. Necessary since `self` will - # refer to the execution context of the block rather than the running - # `TimerTask`. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#252 - def execute(opts = T.unsafe(nil), &task); end - end -end - -# Default `:interval_type` -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#181 -Concurrent::TimerTask::DEFAULT_INTERVAL_TYPE = T.let(T.unsafe(nil), Symbol) - -# Default `:execution_interval` in seconds. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#170 -Concurrent::TimerTask::EXECUTION_INTERVAL = T.let(T.unsafe(nil), Integer) - -# Maintain the interval between the end of one execution and the start of the next execution. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#173 -Concurrent::TimerTask::FIXED_DELAY = T.let(T.unsafe(nil), Symbol) - -# Maintain the interval between the start of one execution and the start of the next. -# If execution time exceeds the interval, the next execution will start immediately -# after the previous execution finishes. Executions will not run concurrently. -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#178 -Concurrent::TimerTask::FIXED_RATE = T.let(T.unsafe(nil), Symbol) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#153 -class Concurrent::Transaction - # @return [Transaction] a new instance of Transaction - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#162 - def initialize; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#192 - def abort; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#196 - def commit; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#177 - def open(tvar); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#166 - def read(tvar); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#206 - def unlock; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#171 - def write(tvar, value); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#212 - def current; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#216 - def current=(transaction); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#155 -Concurrent::Transaction::ABORTED = T.let(T.unsafe(nil), Object) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#159 -class Concurrent::Transaction::AbortError < ::StandardError; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#160 -class Concurrent::Transaction::LeaveError < ::StandardError; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157 -class Concurrent::Transaction::OpenEntry < ::Struct - # Returns the value of attribute modified - # - # @return [Object] the current value of modified - def modified; end - - # Sets the attribute modified - # - # @param value [Object] the value to set the attribute modified to. - # @return [Object] the newly set value - def modified=(_); end - - # Returns the value of attribute value - # - # @return [Object] the current value of value - def value; end - - # Sets the attribute value - # - # @param value [Object] the value to set the attribute value to. - # @return [Object] the newly set value - def value=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# A fixed size array with volatile (synchronized, thread safe) getters/setters. -# Mixes in Ruby's `Enumerable` module for enhanced search, sort, and traversal. -# -# @example -# tuple = Concurrent::Tuple.new(16) -# -# tuple.set(0, :foo) #=> :foo | volatile write -# tuple.get(0) #=> :foo | volatile read -# tuple.compare_and_set(0, :foo, :bar) #=> true | strong CAS -# tuple.cas(0, :foo, :baz) #=> false | strong CAS -# tuple.get(0) #=> :bar | volatile read -# @see https://en.wikipedia.org/wiki/Tuple Tuple entry at Wikipedia -# @see http://www.erlang.org/doc/reference_manual/data_types.html#id70396 Erlang Tuple -# @see http://ruby-doc.org/core-2.2.2/Enumerable.html Enumerable -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#20 -class Concurrent::Tuple - include ::Enumerable - - # Create a new tuple of the given size. - # - # @param size [Integer] the number of elements in the tuple - # @return [Tuple] a new instance of Tuple - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#29 - def initialize(size); end - - # Set the value at the given index to the new value if and only if the current - # value matches the given old value. - # - # @param i [Integer] the index for the element to set - # @param old_value [Object] the value to compare against the current value - # @param new_value [Object] the value to set at the given index - # @return [Boolean] true if the value at the given element was set else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#69 - def cas(i, old_value, new_value); end - - # Set the value at the given index to the new value if and only if the current - # value matches the given old value. - # - # @param i [Integer] the index for the element to set - # @param old_value [Object] the value to compare against the current value - # @param new_value [Object] the value to set at the given index - # @return [Boolean] true if the value at the given element was set else false - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#69 - def compare_and_set(i, old_value, new_value); end - - # Calls the given block once for each element in self, passing that element as a parameter. - # - # @yieldparam ref [Object] the `Concurrent::AtomicReference` object at the current index - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#78 - def each; end - - # Get the value of the element at the given index. - # - # @param i [Integer] the index from which to retrieve the value - # @return [Object] the value at the given index or nil if the index is out of bounds - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#43 - def get(i); end - - # Set the element at the given index to the given value - # - # @param i [Integer] the index for the element to set - # @param value [Object] the value to set at the given index - # @return [Object] the new value of the element at the given index or nil if the index is out of bounds - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#55 - def set(i, value); end - - # The (fixed) size of the tuple. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#24 - def size; end - - # Get the value of the element at the given index. - # - # @param i [Integer] the index from which to retrieve the value - # @return [Object] the value at the given index or nil if the index is out of bounds - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#43 - def volatile_get(i); end - - # Set the element at the given index to the given value - # - # @param i [Integer] the index for the element to set - # @param value [Object] the value to set at the given index - # @return [Object] the new value of the element at the given index or nil if the index is out of bounds - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#55 - def volatile_set(i, value); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#3 -module Concurrent::Utility; end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#6 -module Concurrent::Utility::EngineDetector - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#7 - def on_cruby?; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#11 - def on_jruby?; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#27 - def on_linux?; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#23 - def on_osx?; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#15 - def on_truffleruby?; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#19 - def on_windows?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#31 - def ruby_version(version = T.unsafe(nil), comparison, major, minor, patch); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#9 -module Concurrent::Utility::NativeExtensionLoader - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#11 - def allow_c_extensions?; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#15 - def c_extensions_loaded?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#19 - def load_native_extensions; end - - private - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#50 - def java_extensions_loaded?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#38 - def load_error_path(error); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#46 - def set_c_extensions_loaded; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#54 - def set_java_extensions_loaded; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#58 - def try_load_c_extension(path); end -end - -# @private -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#5 -module Concurrent::Utility::NativeInteger - extend ::Concurrent::Utility::NativeInteger - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#24 - def ensure_integer(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#31 - def ensure_integer_and_bounds(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#17 - def ensure_lower_bound(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#37 - def ensure_positive(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#44 - def ensure_positive_and_no_zero(value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#10 - def ensure_upper_bound(value); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#8 -Concurrent::Utility::NativeInteger::MAX_VALUE = T.let(T.unsafe(nil), Integer) - -# http://stackoverflow.com/questions/535721/ruby-max-integer -# -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#7 -Concurrent::Utility::NativeInteger::MIN_VALUE = T.let(T.unsafe(nil), Integer) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#10 -class Concurrent::Utility::ProcessorCounter - # @return [ProcessorCounter] a new instance of ProcessorCounter - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#11 - def initialize; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#26 - def available_processor_count; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#41 - def cpu_quota; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#45 - def cpu_shares; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#22 - def physical_processor_count; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#18 - def processor_count; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#104 - def compute_cpu_quota; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#124 - def compute_cpu_shares; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#59 - def compute_physical_processor_count; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#51 - def compute_processor_count; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#99 - def run(command); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/version.rb#2 -Concurrent::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi b/sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi new file mode 100644 index 0000000..92ac3ef --- /dev/null +++ b/sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi @@ -0,0 +1,10640 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `concurrent-ruby` gem. +# Please instead update this file by running `bin/tapioca gem concurrent-ruby`. + + +# {include:file:README.md} +# load native parts first +# load native parts first +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/version.rb:1 +module Concurrent + extend ::Concurrent::Utility::EngineDetector + extend ::Concurrent::Utility::NativeExtensionLoader + extend ::Concurrent::Concern::Logging + extend ::Concurrent::Concern::Deprecation + + private + + # Abort a currently running transaction - see `Concurrent::atomically`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:139 + def abort_transaction; end + + # Run a block that reads and writes `TVar`s as a single atomic transaction. + # With respect to the value of `TVar` objects, the transaction is atomic, in + # that it either happens or it does not, consistent, in that the `TVar` + # objects involved will never enter an illegal state, and isolated, in that + # transactions never interfere with each other. You may recognise these + # properties from database transactions. + # + # There are some very important and unusual semantics that you must be aware of: + # + # * Most importantly, the block that you pass to atomically may be executed + # more than once. In most cases your code should be free of + # side-effects, except for via TVar. + # + # * If an exception escapes an atomically block it will abort the transaction. + # + # * It is undefined behaviour to use callcc or Fiber with atomically. + # + # * If you create a new thread within an atomically, it will not be part of + # the transaction. Creating a thread counts as a side-effect. + # + # Transactions within transactions are flattened to a single transaction. + # + # @example + # a = new TVar(100_000) + # b = new TVar(100) + # + # Concurrent::atomically do + # a.value -= 10 + # b.value += 10 + # end + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:82 + def atomically; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:56 + def call_dataflow(method, executor, *inputs, &block); end + + # Dataflow allows you to create a task that will be scheduled when all of its data dependencies are available. + # {include:file:docs-source/dataflow.md} + # + # @param [Future] inputs zero or more `Future` operations that this dataflow depends upon + # + # @yield The operation to perform once all the dependencies are met + # @yieldparam [Future] inputs each of the `Future` inputs to the dataflow + # @yieldreturn [Object] the result of the block operation + # + # @return [Object] the result of all the operations + # + # @raise [ArgumentError] if no block is given + # @raise [ArgumentError] if any of the inputs are not `IVar`s + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:34 + def dataflow(*inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:44 + def dataflow!(*inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:39 + def dataflow_with(executor, *inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:49 + def dataflow_with!(executor, *inputs, &block); end + + # Leave a transaction without committing or aborting - see `Concurrent::atomically`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:144 + def leave_transaction; end + + # @!macro monotonic_get_time + # + # Returns the current time as tracked by the application monotonic clock. + # + # @param [Symbol] unit the time unit to be returned, can be either + # :float_second, :float_millisecond, :float_microsecond, :second, + # :millisecond, :microsecond, or :nanosecond default to :float_second. + # + # @return [Float] The current monotonic time since some unspecified + # starting point + # + # @!macro monotonic_clock_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/monotonic_time.rb:15 + def monotonic_time(unit = T.unsafe(nil)); end + + class << self + # Abort a currently running transaction - see `Concurrent::atomically`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:148 + def abort_transaction; end + + # Run a block that reads and writes `TVar`s as a single atomic transaction. + # With respect to the value of `TVar` objects, the transaction is atomic, in + # that it either happens or it does not, consistent, in that the `TVar` + # objects involved will never enter an illegal state, and isolated, in that + # transactions never interfere with each other. You may recognise these + # properties from database transactions. + # + # There are some very important and unusual semantics that you must be aware of: + # + # * Most importantly, the block that you pass to atomically may be executed + # more than once. In most cases your code should be free of + # side-effects, except for via TVar. + # + # * If an exception escapes an atomically block it will abort the transaction. + # + # * It is undefined behaviour to use callcc or Fiber with atomically. + # + # * If you create a new thread within an atomically, it will not be part of + # the transaction. Creating a thread counts as a side-effect. + # + # Transactions within transactions are flattened to a single transaction. + # + # @example + # a = new TVar(100_000) + # b = new TVar(100) + # + # Concurrent::atomically do + # a.value -= 10 + # b.value += 10 + # end + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:148 + def atomically; end + + # Number of processors cores available for process scheduling. + # This method takes in account the CPU quota if the process is inside a cgroup with a + # dedicated CPU quota (typically Docker). + # Otherwise it returns the same value as #processor_count but as a Float. + # + # For performance reasons the calculated value will be memoized on the first + # call. + # + # @return [Float] number of available processors + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:194 + def available_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:80 + def call_dataflow(method, executor, *inputs, &block); end + + # The maximum number of processors cores available for process scheduling. + # Returns `nil` if there is no enforced limit, or a `Float` if the + # process is inside a cgroup with a dedicated CPU quota (typically Docker). + # + # Note that nothing prevents setting a CPU quota higher than the actual number of + # cores on the system. + # + # For performance reasons the calculated value will be memoized on the first + # call. + # + # @return [nil, Float] Maximum number of available processors as set by a cgroup CPU quota, or nil if none set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:209 + def cpu_quota; end + + # The CPU shares requested by the process. For performance reasons the calculated + # value will be memoized on the first call. + # + # @return [Float, nil] CPU shares requested by the process, or nil if not set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:217 + def cpu_shares; end + + # Create a simple logger with provided level and output. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:38 + def create_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end + + # Create a stdlib logger with provided level and output. + # If you use this deprecated method you might need to add logger to your Gemfile to avoid warnings from Ruby 3.3.5+. + # @deprecated + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:73 + def create_stdlib_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end + + # Dataflow allows you to create a task that will be scheduled when all of its data dependencies are available. + # {include:file:docs-source/dataflow.md} + # + # @param [Future] inputs zero or more `Future` operations that this dataflow depends upon + # + # @yield The operation to perform once all the dependencies are met + # @yieldparam [Future] inputs each of the `Future` inputs to the dataflow + # @yieldreturn [Object] the result of the block operation + # + # @return [Object] the result of all the operations + # + # @raise [ArgumentError] if no block is given + # @raise [ArgumentError] if any of the inputs are not `IVar`s + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:37 + def dataflow(*inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:47 + def dataflow!(*inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:42 + def dataflow_with(executor, *inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:52 + def dataflow_with!(executor, *inputs, &block); end + + # Disables AtExit handlers including pool auto-termination handlers. + # When disabled it will be the application programmer's responsibility + # to ensure that the handlers are shutdown properly prior to application + # exit by calling `AtExit.run` method. + # + # @note this option should be needed only because of `at_exit` ordering + # issues which may arise when running some of the testing frameworks. + # E.g. Minitest's test-suite runs itself in `at_exit` callback which + # executes after the pools are already terminated. Then auto termination + # needs to be disabled and called manually after test-suite ends. + # @note This method should *never* be called + # from within a gem. It should *only* be used from within the main + # application and even then it should be used only when necessary. + # @deprecated Has no effect since it is no longer needed, see https://github.com/ruby-concurrency/concurrent-ruby/pull/841. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:48 + def disable_at_exit_handlers!; end + + # General access point to global executors. + # @param [Symbol, Executor] executor_identifier symbols: + # - :fast - {Concurrent.global_fast_executor} + # - :io - {Concurrent.global_io_executor} + # - :immediate - {Concurrent.global_immediate_executor} + # @return [Executor] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:83 + def executor(executor_identifier); end + + # Global thread pool optimized for short, fast *operations*. + # + # @return [ThreadPoolExecutor] the thread pool + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:55 + def global_fast_executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:66 + def global_immediate_executor; end + + # Global thread pool optimized for long, blocking (IO) *tasks*. + # + # @return [ThreadPoolExecutor] the thread pool + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:62 + def global_io_executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:114 + def global_logger; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:118 + def global_logger=(value); end + + # Global thread pool user for global *timers*. + # + # @return [Concurrent::TimerSet] the thread pool + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:73 + def global_timer_set; end + + # Leave a transaction without committing or aborting - see `Concurrent::atomically`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:148 + def leave_transaction; end + + # @!macro monotonic_get_time + # + # Returns the current time as tracked by the application monotonic clock. + # + # @param [Symbol] unit the time unit to be returned, can be either + # :float_second, :float_millisecond, :float_microsecond, :second, + # :millisecond, :microsecond, or :nanosecond default to :float_second. + # + # @return [Float] The current monotonic time since some unspecified + # starting point + # + # @!macro monotonic_clock_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/monotonic_time.rb:18 + def monotonic_time(unit = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:7 + def mutex_owned_per_thread?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:87 + def new_fast_executor(opts = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:98 + def new_io_executor(opts = T.unsafe(nil)); end + + # Number of physical processor cores on the current system. For performance + # reasons the calculated value will be memoized on the first call. + # + # On Windows the Win32 API will be queried for the `NumberOfCores from + # Win32_Processor`. This will return the total number "of cores for the + # current instance of the processor." On Unix-like operating systems either + # the `hwprefs` or `sysctl` utility will be called in a subshell and the + # returned value will be used. In the rare case where none of these methods + # work or an exception is raised the function will simply return 1. + # + # @return [Integer] number physical processor cores on the current system + # + # @see https://github.com/grosser/parallel/blob/4fc8b89d08c7091fe0419ca8fba1ec3ce5a8d185/lib/parallel.rb + # + # @see http://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx + # @see http://www.unix.com/man-page/osx/1/HWPREFS/ + # @see http://linux.die.net/man/8/sysctl + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:181 + def physical_processor_count; end + + # Number of processors seen by the OS and used for process scheduling. For + # performance reasons the calculated value will be memoized on the first + # call. + # + # When running under JRuby the Java runtime call + # `java.lang.Runtime.getRuntime.availableProcessors` will be used. According + # to the Java documentation this "value may change during a particular + # invocation of the virtual machine... [applications] should therefore + # occasionally poll this property." We still memoize this value once under + # JRuby. + # + # Otherwise Ruby's Etc.nprocessors will be used. + # + # @return [Integer] number of processors seen by the OS or Java runtime + # + # @see http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#availableProcessors() + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:160 + def processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:142 + def processor_counter; end + + # Use logger created by #create_simple_logger to log concurrent-ruby messages. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:66 + def use_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end + + # Use logger created by #create_stdlib_logger to log concurrent-ruby messages. + # @deprecated + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:101 + def use_stdlib_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end + end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:38 +class Concurrent::AbstractExchanger < ::Concurrent::Synchronization::Object + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:44 + def initialize; end + + # @!macro exchanger_method_do_exchange + # + # Waits for another thread to arrive at this exchange point (unless the + # current thread is interrupted), and then transfers the given object to + # it, receiving its object in return. The timeout value indicates the + # approximate number of seconds the method should block while waiting + # for the exchange. When the timeout value is `nil` the method will + # block indefinitely. + # + # @param [Object] value the value to exchange with another thread + # @param [Numeric, nil] timeout in seconds, `nil` blocks indefinitely + # + # @!macro exchanger_method_exchange + # + # In some edge cases when a `timeout` is given a return value of `nil` may be + # ambiguous. Specifically, if `nil` is a valid value in the exchange it will + # be impossible to tell whether `nil` is the actual return value or if it + # signifies timeout. When `nil` is a valid value in the exchange consider + # using {#exchange!} or {#try_exchange} instead. + # + # @return [Object] the value exchanged by the other thread or `nil` on timeout + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:69 + def exchange(value, timeout = T.unsafe(nil)); end + + # @!macro exchanger_method_do_exchange + # @!macro exchanger_method_exchange_bang + # + # On timeout a {Concurrent::TimeoutError} exception will be raised. + # + # @return [Object] the value exchanged by the other thread + # @raise [Concurrent::TimeoutError] on timeout + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:80 + def exchange!(value, timeout = T.unsafe(nil)); end + + # @!macro exchanger_method_do_exchange + # @!macro exchanger_method_try_exchange + # + # The return value will be a {Concurrent::Maybe} set to `Just` on success or + # `Nothing` on timeout. + # + # @return [Concurrent::Maybe] on success a `Just` maybe will be returned with + # the item exchanged by the other thread as `#value`; on timeout a + # `Nothing` maybe will be returned with {Concurrent::TimeoutError} as `#reason` + # + # @example + # + # exchanger = Concurrent::Exchanger.new + # + # result = exchanger.exchange(:foo, 0.5) + # + # if result.just? + # puts result.value #=> :bar + # else + # puts 'timeout' + # end + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:109 + def try_exchange(value, timeout = T.unsafe(nil)); end + + private + + # @!macro exchanger_method_do_exchange + # + # @return [Object, CANCEL] the value exchanged by the other thread; {CANCEL} on timeout + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:122 + def do_exchange(value, timeout); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:41 +Concurrent::AbstractExchanger::CANCEL = T.let(T.unsafe(nil), Object) + +# @!macro abstract_executor_service_public_api +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:10 +class Concurrent::AbstractExecutorService < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Logging + include ::Concurrent::ExecutorService + include ::Concurrent::Concern::Deprecation + + # Create a new thread pool. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:23 + def initialize(opts = T.unsafe(nil), &block); end + + # @!macro executor_service_method_auto_terminate_setter + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:72 + def auto_terminate=(value); end + + # @!macro executor_service_method_auto_terminate_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:67 + def auto_terminate?; end + + # @!macro executor_service_attr_reader_fallback_policy + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:18 + def fallback_policy; end + + # @!macro executor_service_method_kill + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:42 + def kill; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:20 + def name; end + + # @!macro executor_service_method_running_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:52 + def running?; end + + # @!macro executor_service_method_shutdown + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:37 + def shutdown; end + + # @!macro executor_service_method_shutdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:62 + def shutdown?; end + + # @!macro executor_service_method_shuttingdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:57 + def shuttingdown?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:32 + def to_s; end + + # @!macro executor_service_method_wait_for_termination + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:47 + def wait_for_termination(timeout = T.unsafe(nil)); end + + private + + # Returns an action which executes the `fallback_policy` once the queue + # size reaches `max_queue`. The reason for the indirection of an action + # is so that the work can be deferred outside of synchronization. + # + # @param [Array] args the arguments to the task which is being handled. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:85 + def fallback_action(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:126 + def ns_auto_terminate?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:106 + def ns_execute(*args, &task); end + + # @!macro executor_service_method_ns_kill_execution + # + # Callback method called when the executor has been killed. + # The default behavior is to do nothing. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:122 + def ns_kill_execution; end + + # @!macro executor_service_method_ns_shutdown_execution + # + # Callback method called when an orderly shutdown has completed. + # The default behavior is to signal all waiting threads. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:114 + def ns_shutdown_execution; end +end + +# The set of possible fallback policies that may be set at thread pool creation. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:15 +Concurrent::AbstractExecutorService::FALLBACK_POLICIES = T.let(T.unsafe(nil), Array) + +# @!visibility private +# @!macro internal_implementation_note +# +# An abstract implementation of local storage, with sub-classes for +# per-thread and per-fiber locals. +# +# Each execution context (EC, thread or fiber) has a lazily initialized array +# of local variable values. Each time a new local variable is created, we +# allocate an "index" for it. +# +# For example, if the allocated index is 1, that means slot #1 in EVERY EC's +# locals array will be used for the value of that variable. +# +# The good thing about using a per-EC structure to hold values, rather than +# a global, is that no synchronization is needed when reading and writing +# those values (since the structure is only ever accessed by a single +# thread). +# +# Of course, when a local variable is GC'd, 1) we need to recover its index +# for use by other new local variables (otherwise the locals arrays could +# get bigger and bigger with time), and 2) we need to null out all the +# references held in the now-unused slots (both to avoid blocking GC of those +# objects, and also to prevent "stale" values from being passed on to a new +# local when the index is reused). +# +# Because we need to null out freed slots, we need to keep references to +# ALL the locals arrays, so we can null out the appropriate slots in all of +# them. This is why we need to use a finalizer to clean up the locals array +# when the EC goes out of scope. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:35 +class Concurrent::AbstractLocals + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:36 + def initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:89 + def fetch(index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:71 + def free_index(index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:55 + def next_index(local); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:102 + def set(index, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:43 + def synchronize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:48 + def weak_synchronize; end + + private + + # When the local goes out of scope, clean up that slot across all locals currently assigned. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:112 + def local_finalizer(index); end + + # Returns the locals for the current scope, or nil if none exist. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:128 + def locals; end + + # Returns the locals for the current scope, creating them if necessary. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:133 + def locals!; end + + # When a thread/fiber goes out of scope, remove the array from @all_arrays. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:119 + def thread_fiber_finalizer(array_object_id); end +end + +# `Agent` is inspired by Clojure's [agent](http://clojure.org/agents) +# function. An agent is a shared, mutable variable providing independent, +# uncoordinated, *asynchronous* change of individual values. Best used when +# the value will undergo frequent, complex updates. Suitable when the result +# of an update does not need to be known immediately. `Agent` is (mostly) +# functionally equivalent to Clojure's agent, except where the runtime +# prevents parity. +# +# Agents are reactive, not autonomous - there is no imperative message loop +# and no blocking receive. The state of an Agent should be itself immutable +# and the `#value` of an Agent is always immediately available for reading by +# any thread without any messages, i.e. observation does not require +# cooperation or coordination. +# +# Agent action dispatches are made using the various `#send` methods. These +# methods always return immediately. At some point later, in another thread, +# the following will happen: +# +# 1. The given `action` will be applied to the state of the Agent and the +# `args`, if any were supplied. +# 2. The return value of `action` will be passed to the validator lambda, +# if one has been set on the Agent. +# 3. If the validator succeeds or if no validator was given, the return value +# of the given `action` will become the new `#value` of the Agent. See +# `#initialize` for details. +# 4. If any observers were added to the Agent, they will be notified. See +# `#add_observer` for details. +# 5. If during the `action` execution any other dispatches are made (directly +# or indirectly), they will be held until after the `#value` of the Agent +# has been changed. +# +# If any exceptions are thrown by an action function, no nested dispatches +# will occur, and the exception will be cached in the Agent itself. When an +# Agent has errors cached, any subsequent interactions will immediately throw +# an exception, until the agent's errors are cleared. Agent errors can be +# examined with `#error` and the agent restarted with `#restart`. +# +# The actions of all Agents get interleaved amongst threads in a thread pool. +# At any point in time, at most one action for each Agent is being executed. +# Actions dispatched to an agent from another single agent or thread will +# occur in the order they were sent, potentially interleaved with actions +# dispatched to the same agent from other sources. The `#send` method should +# be used for actions that are CPU limited, while the `#send_off` method is +# appropriate for actions that may block on IO. +# +# Unlike in Clojure, `Agent` cannot participate in `Concurrent::TVar` transactions. +# +# ## Example +# +# ``` +# def next_fibonacci(set = nil) +# return [0, 1] if set.nil? +# set + [set[-2..-1].reduce{|sum,x| sum + x }] +# end +# +# # create an agent with an initial value +# agent = Concurrent::Agent.new(next_fibonacci) +# +# # send a few update requests +# 5.times do +# agent.send{|set| next_fibonacci(set) } +# end +# +# # wait for them to complete +# agent.await +# +# # get the current value +# agent.value #=> [0, 1, 1, 2, 3, 5, 8] +# ``` +# +# ## Observation +# +# Agents support observers through the {Concurrent::Observable} mixin module. +# Notification of observers occurs every time an action dispatch returns and +# the new value is successfully validated. Observation will *not* occur if the +# action raises an exception, if validation fails, or when a {#restart} occurs. +# +# When notified the observer will receive three arguments: `time`, `old_value`, +# and `new_value`. The `time` argument is the time at which the value change +# occurred. The `old_value` is the value of the Agent when the action began +# processing. The `new_value` is the value to which the Agent was set when the +# action completed. Note that `old_value` and `new_value` may be the same. +# This is not an error. It simply means that the action returned the same +# value. +# +# ## Nested Actions +# +# It is possible for an Agent action to post further actions back to itself. +# The nested actions will be enqueued normally then processed *after* the +# outer action completes, in the order they were sent, possibly interleaved +# with action dispatches from other threads. Nested actions never deadlock +# with one another and a failure in a nested action will never affect the +# outer action. +# +# Nested actions can be called using the Agent reference from the enclosing +# scope or by passing the reference in as a "send" argument. Nested actions +# cannot be post using `self` from within the action block/proc/lambda; `self` +# in this context will not reference the Agent. The preferred method for +# dispatching nested actions is to pass the Agent as an argument. This allows +# Ruby to more effectively manage the closing scope. +# +# Prefer this: +# +# ``` +# agent = Concurrent::Agent.new(0) +# agent.send(agent) do |value, this| +# this.send {|v| v + 42 } +# 3.14 +# end +# agent.value #=> 45.14 +# ``` +# +# Over this: +# +# ``` +# agent = Concurrent::Agent.new(0) +# agent.send do |value| +# agent.send {|v| v + 42 } +# 3.14 +# end +# ``` +# +# @!macro agent_await_warning +# +# **NOTE** Never, *under any circumstances*, call any of the "await" methods +# ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action +# block/proc/lambda. The call will block the Agent and will always fail. +# Calling either {#await} or {#wait} (with a timeout of `nil`) will +# hopelessly deadlock the Agent with no possibility of recovery. +# +# @!macro thread_safe_variable_comparison +# +# @see http://clojure.org/Agents Clojure Agents +# @see http://clojure.org/state Values and Change - Clojure's approach to Identity and State +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:145 +class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Observable + + # Create a new `Agent` with the given initial value and options. + # + # The `:validator` option must be `nil` or a side-effect free proc/lambda + # which takes one argument. On any intended value change the validator, if + # provided, will be called. If the new value is invalid the validator should + # return `false` or raise an error. + # + # The `:error_handler` option must be `nil` or a proc/lambda which takes two + # arguments. When an action raises an error or validation fails, either by + # returning false or raising an error, the error handler will be called. The + # arguments to the error handler will be a reference to the agent itself and + # the error object which was raised. + # + # The `:error_mode` may be either `:continue` (the default if an error + # handler is given) or `:fail` (the default if error handler nil or not + # given). + # + # If an action being run by the agent throws an error or doesn't pass + # validation the error handler, if present, will be called. After the + # handler executes if the error mode is `:continue` the Agent will continue + # as if neither the action that caused the error nor the error itself ever + # happened. + # + # If the mode is `:fail` the Agent will become {#failed?} and will stop + # accepting new action dispatches. Any previously queued actions will be + # held until {#restart} is called. The {#value} method will still work, + # returning the value of the Agent before the error. + # + # @param [Object] initial the initial value + # @param [Hash] opts the configuration options + # + # @option opts [Symbol] :error_mode either `:continue` or `:fail` + # @option opts [nil, Proc] :error_handler the (optional) error handler + # @option opts [nil, Proc] :validator the (optional) validation procedure + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:220 + def initialize(initial, opts = T.unsafe(nil)); end + + # Dispatches an action to the Agent and returns immediately. Subsequently, + # in a thread from a thread pool, the {#value} will be set to the return + # value of the action. Appropriate for actions that may block on IO. + # + # @param [Proc] action the action dispatch to be enqueued + # @return [Concurrent::Agent] self + # @see #send_off + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:331 + def <<(action); end + + # Blocks the current thread (indefinitely!) until all actions dispatched + # thus far, from this thread or nested by the Agent, have occurred. Will + # block when {#failed?}. Will never return if a failed Agent is {#restart} + # with `:clear_actions` true. + # + # Returns a reference to `self` to support method chaining: + # + # ``` + # current_value = agent.await.value + # ``` + # + # @return [Boolean] self + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:350 + def await; end + + # Blocks the current thread until all actions dispatched thus far, from this + # thread or nested by the Agent, have occurred, or the timeout (in seconds) + # has elapsed. + # + # @param [Float] timeout the maximum number of seconds to wait + # @return [Boolean] true if all actions complete before timeout else false + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:363 + def await_for(timeout); end + + # Blocks the current thread until all actions dispatched thus far, from this + # thread or nested by the Agent, have occurred, or the timeout (in seconds) + # has elapsed. + # + # @param [Float] timeout the maximum number of seconds to wait + # @return [Boolean] true if all actions complete before timeout + # + # @raise [Concurrent::TimeoutError] when timeout is reached + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:377 + def await_for!(timeout); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:233 + def deref; end + + # When {#failed?} and {#error_mode} is `:fail`, returns the error object + # which caused the failure, else `nil`. When {#error_mode} is `:continue` + # will *always* return `nil`. + # + # @return [nil, Error] the error which caused the failure when {#failed?} + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:240 + def error; end + + # The error mode this Agent is operating in. See {#initialize} for details. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:184 + def error_mode; end + + # Is the Agent in a failed state? + # + # @see #restart + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:402 + def failed?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:298 + def post(*args, &action); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:244 + def reason; end + + # When an Agent is {#failed?}, changes the Agent {#value} to `new_value` + # then un-fails the Agent so that action dispatches are allowed again. If + # the `:clear_actions` option is give and true, any actions queued on the + # Agent that were being held while it was failed will be discarded, + # otherwise those held actions will proceed. The `new_value` must pass the + # validator if any, or `restart` will raise an exception and the Agent will + # remain failed with its old {#value} and {#error}. Observers, if any, will + # not be notified of the new state. + # + # @param [Object] new_value the new value for the Agent once restarted + # @param [Hash] opts the configuration options + # @option opts [Symbol] :clear_actions true if all enqueued but unprocessed + # actions should be discarded on restart, else false (default: false) + # @return [Boolean] true + # + # @raise [Concurrent:AgentError] when not failed + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:424 + def restart(new_value, opts = T.unsafe(nil)); end + + # @!macro agent_send + # + # Dispatches an action to the Agent and returns immediately. Subsequently, + # in a thread from a thread pool, the {#value} will be set to the return + # value of the action. Action dispatches are only allowed when the Agent + # is not {#failed?}. + # + # The action must be a block/proc/lambda which takes 1 or more arguments. + # The first argument is the current {#value} of the Agent. Any arguments + # passed to the send method via the `args` parameter will be passed to the + # action as the remaining arguments. The action must return the new value + # of the Agent. + # + # * {#send} and {#send!} should be used for actions that are CPU limited + # * {#send_off}, {#send_off!}, and {#<<} are appropriate for actions that + # may block on IO + # * {#send_via} and {#send_via!} are used when a specific executor is to + # be used for the action + # + # @param [Array] args zero or more arguments to be passed to + # the action + # @param [Proc] action the action dispatch to be enqueued + # + # @yield [agent, value, *args] process the old value and return the new + # @yieldparam [Object] value the current {#value} of the Agent + # @yieldparam [Array] args zero or more arguments to pass to the + # action + # @yieldreturn [Object] the new value of the Agent + # + # @!macro send_return + # @return [Boolean] true if the action is successfully enqueued, false if + # the Agent is {#failed?} + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:278 + def send(*args, &action); end + + # @!macro agent_send + # + # @!macro send_bang_return_and_raise + # @return [Boolean] true if the action is successfully enqueued + # @raise [Concurrent::Agent::Error] if the Agent is {#failed?} + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:287 + def send!(*args, &action); end + + # @!macro agent_send + # @!macro send_return + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:294 + def send_off(*args, &action); end + + # @!macro agent_send + # @!macro send_bang_return_and_raise + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:302 + def send_off!(*args, &action); end + + # @!macro agent_send + # @!macro send_return + # @param [Concurrent::ExecutorService] executor the executor on which the + # action is to be dispatched + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:311 + def send_via(executor, *args, &action); end + + # @!macro agent_send + # @!macro send_bang_return_and_raise + # @param [Concurrent::ExecutorService] executor the executor on which the + # action is to be dispatched + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:319 + def send_via!(executor, *args, &action); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:406 + def stopped?; end + + # The current value (state) of the Agent, irrespective of any pending or + # in-progress actions. The value is always available and is non-blocking. + # + # @return [Object] the current value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:229 + def value; end + + # Blocks the current thread until all actions dispatched thus far, from this + # thread or nested by the Agent, have occurred, or the timeout (in seconds) + # has elapsed. Will block indefinitely when timeout is nil or not given. + # + # Provided mainly for consistency with other classes in this library. Prefer + # the various `await` methods instead. + # + # @param [Float] timeout the maximum number of seconds to wait + # @return [Boolean] true if all actions complete before timeout else false + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:393 + def wait(timeout = T.unsafe(nil)); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:510 + def enqueue_action_job(action, args, executor); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:516 + def enqueue_await_job(latch); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:543 + def execute_next_job; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:576 + def handle_error(error); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:529 + def ns_enqueue_job(job, index = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:584 + def ns_find_last_job_for_thread; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:490 + def ns_initialize(initial, opts); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:539 + def ns_post_next_job; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:570 + def ns_validate(value); end + + class << self + # Blocks the current thread (indefinitely!) until all actions dispatched + # thus far to all the given Agents, from this thread or nested by the + # given Agents, have occurred. Will block when any of the agents are + # failed. Will never return if a failed Agent is restart with + # `:clear_actions` true. + # + # @param [Array] agents the Agents on which to wait + # @return [Boolean] true + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:449 + def await(*agents); end + + # Blocks the current thread until all actions dispatched thus far to all + # the given Agents, from this thread or nested by the given Agents, have + # occurred, or the timeout (in seconds) has elapsed. + # + # @param [Float] timeout the maximum number of seconds to wait + # @param [Array] agents the Agents on which to wait + # @return [Boolean] true if all actions complete before timeout else false + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:463 + def await_for(timeout, *agents); end + + # Blocks the current thread until all actions dispatched thus far to all + # the given Agents, from this thread or nested by the given Agents, have + # occurred, or the timeout (in seconds) has elapsed. + # + # @param [Float] timeout the maximum number of seconds to wait + # @param [Array] agents the Agents on which to wait + # @return [Boolean] true if all actions complete before timeout + # + # @raise [Concurrent::TimeoutError] when timeout is reached + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:482 + def await_for!(timeout, *agents); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:154 +Concurrent::Agent::AWAIT_ACTION = T.let(T.unsafe(nil), Proc) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:151 +Concurrent::Agent::AWAIT_FLAG = T.let(T.unsafe(nil), Object) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:157 +Concurrent::Agent::DEFAULT_ERROR_HANDLER = T.let(T.unsafe(nil), Proc) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:160 +Concurrent::Agent::DEFAULT_VALIDATOR = T.let(T.unsafe(nil), Proc) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:148 +Concurrent::Agent::ERROR_MODES = T.let(T.unsafe(nil), Array) + +# Raised during action processing or any other time in an Agent's lifecycle. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:167 +class Concurrent::Agent::Error < ::StandardError + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:168 + def initialize(message = T.unsafe(nil)); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 +class Concurrent::Agent::Job < ::Struct + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def action; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def action=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def args; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def args=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def caller; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def caller=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def executor=(_); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def [](*_arg0); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def keyword_init?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def new(*_arg0); end + end +end + +# Raised when a new value obtained during action processing or at `#restart` +# fails validation. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:176 +class Concurrent::Agent::ValidationError < ::Concurrent::Agent::Error + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:177 + def initialize(message = T.unsafe(nil)); end +end + +# @!macro concurrent_array +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/array.rb:53 +class Concurrent::Array < ::Array; end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/array.rb:22 +Concurrent::ArrayImplementation = Array + +# A mixin module that provides simple asynchronous behavior to a class, +# turning it into a simple actor. Loosely based on Erlang's +# [gen_server](http://www.erlang.org/doc/man/gen_server.html), but without +# supervision or linking. +# +# A more feature-rich {Concurrent::Actor} is also available when the +# capabilities of `Async` are too limited. +# +# ```cucumber +# Feature: +# As a stateful, plain old Ruby class +# I want safe, asynchronous behavior +# So my long-running methods don't block the main thread +# ``` +# +# The `Async` module is a way to mix simple yet powerful asynchronous +# capabilities into any plain old Ruby object or class, turning each object +# into a simple Actor. Method calls are processed on a background thread. The +# caller is free to perform other actions while processing occurs in the +# background. +# +# Method calls to the asynchronous object are made via two proxy methods: +# `async` (alias `cast`) and `await` (alias `call`). These proxy methods post +# the method call to the object's background thread and return a "future" +# which will eventually contain the result of the method call. +# +# This behavior is loosely patterned after Erlang's `gen_server` behavior. +# When an Erlang module implements the `gen_server` behavior it becomes +# inherently asynchronous. The `start` or `start_link` function spawns a +# process (similar to a thread but much more lightweight and efficient) and +# returns the ID of the process. Using the process ID, other processes can +# send messages to the `gen_server` via the `cast` and `call` methods. Unlike +# Erlang's `gen_server`, however, `Async` classes do not support linking or +# supervision trees. +# +# ## Basic Usage +# +# When this module is mixed into a class, objects of the class become inherently +# asynchronous. Each object gets its own background thread on which to post +# asynchronous method calls. Asynchronous method calls are executed in the +# background one at a time in the order they are received. +# +# To create an asynchronous class, simply mix in the `Concurrent::Async` module: +# +# ``` +# class Hello +# include Concurrent::Async +# +# def hello(name) +# "Hello, #{name}!" +# end +# end +# ``` +# +# Mixing this module into a class provides each object two proxy methods: +# `async` and `await`. These methods are thread safe with respect to the +# enclosing object. The former proxy allows methods to be called +# asynchronously by posting to the object's internal thread. The latter proxy +# allows a method to be called synchronously but does so safely with respect +# to any pending asynchronous method calls and ensures proper ordering. Both +# methods return a {Concurrent::IVar} which can be inspected for the result +# of the proxied method call. Calling a method with `async` will return a +# `:pending` `IVar` whereas `await` will return a `:complete` `IVar`. +# +# ``` +# class Echo +# include Concurrent::Async +# +# def echo(msg) +# print "#{msg}\n" +# end +# end +# +# horn = Echo.new +# horn.echo('zero') # synchronous, not thread-safe +# # returns the actual return value of the method +# +# horn.async.echo('one') # asynchronous, non-blocking, thread-safe +# # returns an IVar in the :pending state +# +# horn.await.echo('two') # synchronous, blocking, thread-safe +# # returns an IVar in the :complete state +# ``` +# +# ## Let It Fail +# +# The `async` and `await` proxy methods have built-in error protection based +# on Erlang's famous "let it fail" philosophy. Instance methods should not be +# programmed defensively. When an exception is raised by a delegated method +# the proxy will rescue the exception, expose it to the caller as the `reason` +# attribute of the returned future, then process the next method call. +# +# ## Calling Methods Internally +# +# External method calls should *always* use the `async` and `await` proxy +# methods. When one method calls another method, the `async` proxy should +# rarely be used and the `await` proxy should *never* be used. +# +# When an object calls one of its own methods using the `await` proxy the +# second call will be enqueued *behind* the currently running method call. +# Any attempt to wait on the result will fail as the second call will never +# run until after the current call completes. +# +# Calling a method using the `await` proxy from within a method that was +# itself called using `async` or `await` will irreversibly deadlock the +# object. Do *not* do this, ever. +# +# ## Instance Variables and Attribute Accessors +# +# Instance variables do not need to be thread-safe so long as they are private. +# Asynchronous method calls are processed in the order they are received and +# are processed one at a time. Therefore private instance variables can only +# be accessed by one thread at a time. This is inherently thread-safe. +# +# When using private instance variables within asynchronous methods, the best +# practice is to read the instance variable into a local variable at the start +# of the method then update the instance variable at the *end* of the method. +# This way, should an exception be raised during method execution the internal +# state of the object will not have been changed. +# +# ### Reader Attributes +# +# The use of `attr_reader` is discouraged. Internal state exposed externally, +# when necessary, should be done through accessor methods. The instance +# variables exposed by these methods *must* be thread-safe, or they must be +# called using the `async` and `await` proxy methods. These two approaches are +# subtly different. +# +# When internal state is accessed via the `async` and `await` proxy methods, +# the returned value represents the object's state *at the time the call is +# processed*, which may *not* be the state of the object at the time the call +# is made. +# +# To get the state *at the current* time, irrespective of an enqueued method +# calls, a reader method must be called directly. This is inherently unsafe +# unless the instance variable is itself thread-safe, preferably using one +# of the thread-safe classes within this library. Because the thread-safe +# classes within this library are internally-locking or non-locking, they can +# be safely used from within asynchronous methods without causing deadlocks. +# +# Generally speaking, the best practice is to *not* expose internal state via +# reader methods. The best practice is to simply use the method's return value. +# +# ### Writer Attributes +# +# Writer attributes should never be used with asynchronous classes. Changing +# the state externally, even when done in the thread-safe way, is not logically +# consistent. Changes to state need to be timed with respect to all asynchronous +# method calls which my be in-process or enqueued. The only safe practice is to +# pass all necessary data to each method as arguments and let the method update +# the internal state as necessary. +# +# ## Class Constants, Variables, and Methods +# +# ### Class Constants +# +# Class constants do not need to be thread-safe. Since they are read-only and +# immutable they may be safely read both externally and from within +# asynchronous methods. +# +# ### Class Variables +# +# Class variables should be avoided. Class variables represent shared state. +# Shared state is anathema to concurrency. Should there be a need to share +# state using class variables they *must* be thread-safe, preferably +# using the thread-safe classes within this library. When updating class +# variables, never assign a new value/object to the variable itself. Assignment +# is not thread-safe in Ruby. Instead, use the thread-safe update functions +# of the variable itself to change the value. +# +# The best practice is to *never* use class variables with `Async` classes. +# +# ### Class Methods +# +# Class methods which are pure functions are safe. Class methods which modify +# class variables should be avoided, for all the reasons listed above. +# +# ## An Important Note About Thread Safe Guarantees +# +# > Thread safe guarantees can only be made when asynchronous method calls +# > are not mixed with direct method calls. Use only direct method calls +# > when the object is used exclusively on a single thread. Use only +# > `async` and `await` when the object is shared between threads. Once you +# > call a method using `async` or `await`, you should no longer call methods +# > directly on the object. Use `async` and `await` exclusively from then on. +# +# @example +# +# class Echo +# include Concurrent::Async +# +# def echo(msg) +# print "#{msg}\n" +# end +# end +# +# horn = Echo.new +# horn.echo('zero') # synchronous, not thread-safe +# # returns the actual return value of the method +# +# horn.async.echo('one') # asynchronous, non-blocking, thread-safe +# # returns an IVar in the :pending state +# +# horn.await.echo('two') # synchronous, blocking, thread-safe +# # returns an IVar in the :complete state +# +# @see Concurrent::Actor +# @see https://en.wikipedia.org/wiki/Actor_model "Actor Model" at Wikipedia +# @see http://www.erlang.org/doc/man/gen_server.html Erlang gen_server +# @see http://c2.com/cgi/wiki?LetItCrash "Let It Crash" at http://c2.com/ +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:217 +module Concurrent::Async + mixes_in_class_methods ::Concurrent::Async::ClassMethods + + # Causes the chained method call to be performed asynchronously on the + # object's thread. The delegated method will return a future in the + # `:pending` state and the method call will have been scheduled on the + # object's thread. The final disposition of the method call can be obtained + # by inspecting the returned future. + # + # @!macro async_thread_safety_warning + # @note The method call is guaranteed to be thread safe with respect to + # all other method calls against the same object that are called with + # either `async` or `await`. The mutable nature of Ruby references + # (and object orientation in general) prevent any other thread safety + # guarantees. Do NOT mix direct method calls with delegated method calls. + # Use *only* delegated method calls when sharing the object between threads. + # + # @return [Concurrent::IVar] the pending result of the asynchronous operation + # + # @raise [NameError] the object does not respond to the requested method + # @raise [ArgumentError] the given `args` do not match the arity of + # the requested method + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:412 + def async; end + + # Causes the chained method call to be performed synchronously on the + # current thread. The delegated will return a future in either the + # `:fulfilled` or `:rejected` state and the delegated method will have + # completed. The final disposition of the delegated method can be obtained + # by inspecting the returned future. + # + # @!macro async_thread_safety_warning + # + # @return [Concurrent::IVar] the completed result of the synchronous operation + # + # @raise [NameError] the object does not respond to the requested method + # @raise [ArgumentError] the given `args` do not match the arity of the + # requested method + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:430 + def await; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:433 + def call; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:415 + def cast; end + + # Initialize the internal serializer and other stnchronization mechanisms. + # + # @note This method *must* be called immediately upon object construction. + # This is the only way thread-safe initialization can be guaranteed. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:441 + def init_synchronization; end + + class << self + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:262 + def included(base); end + + # Check for the presence of a method on an object and determine if a given + # set of arguments matches the required arity. + # + # @param [Object] obj the object to check against + # @param [Symbol] method the method to check the object for + # @param [Array] args zero or more arguments for the arity check + # + # @raise [NameError] the object does not respond to `method` method + # @raise [ArgumentError] the given `args` do not match the arity of `method` + # + # @note This check is imperfect because of the way Ruby reports the arity of + # methods with a variable number of arguments. It is possible to determine + # if too few arguments are given but impossible to determine if too many + # arguments are given. This check may also fail to recognize dynamic behavior + # of the object, such as methods simulated with `method_missing`. + # + # @see http://www.ruby-doc.org/core-2.1.1/Method.html#method-i-arity Method#arity + # @see http://ruby-doc.org/core-2.1.0/Object.html#method-i-respond_to-3F Object#respond_to? + # @see http://www.ruby-doc.org/core-2.1.0/BasicObject.html#method-i-method_missing BasicObject#method_missing + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:250 + def validate_argc(obj, method, *args); end + end +end + +# Delegates asynchronous, thread-safe method calls to the wrapped object. +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:282 +class Concurrent::Async::AsyncDelegator < ::Concurrent::Synchronization::LockableObject + # Create a new delegator object wrapping the given delegate. + # + # @param [Object] delegate the object to wrap and delegate method calls to + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:288 + def initialize(delegate); end + + # Delegates method calls to the wrapped object. + # + # @param [Symbol] method the method being called + # @param [Array] args zero or more arguments to the method + # + # @return [IVar] the result of the method call + # + # @raise [NameError] the object does not respond to `method` method + # @raise [ArgumentError] the given `args` do not match the arity of `method` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:305 + def method_missing(method, *args, &block); end + + # Perform all enqueued tasks. + # + # This method must be called from within the executor. It must not be + # called while already running. It will loop until the queue is empty. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:330 + def perform; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:348 + def reset_if_forked; end + + private + + # Check whether the method is responsive + # + # @param [Symbol] method the method being called + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:322 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end +end + +# Delegates synchronous, thread-safe method calls to the wrapped object. +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:360 +class Concurrent::Async::AwaitDelegator + # Create a new delegator object wrapping the given delegate. + # + # @param [AsyncDelegator] delegate the object to wrap and delegate method calls to + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:365 + def initialize(delegate); end + + # Delegates method calls to the wrapped object. + # + # @param [Symbol] method the method being called + # @param [Array] args zero or more arguments to the method + # + # @return [IVar] the result of the method call + # + # @raise [NameError] the object does not respond to `method` method + # @raise [ArgumentError] the given `args` do not match the arity of `method` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:378 + def method_missing(method, *args, &block); end + + private + + # Check whether the method is responsive + # + # @param [Symbol] method the method being called + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:387 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:269 +module Concurrent::Async::ClassMethods + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:270 + def new(*args, **_arg1, &block); end +end + +# Atoms provide a way to manage shared, synchronous, independent state. +# +# An atom is initialized with an initial value and an optional validation +# proc. At any time the value of the atom can be synchronously and safely +# changed. If a validator is given at construction then any new value +# will be checked against the validator and will be rejected if the +# validator returns false or raises an exception. +# +# There are two ways to change the value of an atom: {#compare_and_set} and +# {#swap}. The former will set the new value if and only if it validates and +# the current value matches the new value. The latter will atomically set the +# new value to the result of running the given block if and only if that +# value validates. +# +# ## Example +# +# ``` +# def next_fibonacci(set = nil) +# return [0, 1] if set.nil? +# set + [set[-2..-1].reduce{|sum,x| sum + x }] +# end +# +# # create an atom with an initial value +# atom = Concurrent::Atom.new(next_fibonacci) +# +# # send a few update requests +# 5.times do +# atom.swap{|set| next_fibonacci(set) } +# end +# +# # get the current value +# atom.value #=> [0, 1, 1, 2, 3, 5, 8] +# ``` +# +# ## Observation +# +# Atoms support observers through the {Concurrent::Observable} mixin module. +# Notification of observers occurs every time the value of the Atom changes. +# When notified the observer will receive three arguments: `time`, `old_value`, +# and `new_value`. The `time` argument is the time at which the value change +# occurred. The `old_value` is the value of the Atom when the change began +# The `new_value` is the value to which the Atom was set when the change +# completed. Note that `old_value` and `new_value` may be the same. This is +# not an error. It simply means that the change operation returned the same +# value. +# +# Unlike in Clojure, `Atom` cannot participate in {Concurrent::TVar} transactions. +# +# @!macro thread_safe_variable_comparison +# +# @see http://clojure.org/atoms Clojure Atoms +# @see http://clojure.org/state Values and Change - Clojure's approach to Identity and State +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:95 +class Concurrent::Atom < ::Concurrent::Synchronization::Object + include ::Concurrent::Concern::Observable + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new atom with the given initial value. + # + # @param [Object] value The initial value + # @param [Hash] opts The options used to configure the atom + # @option opts [Proc] :validator (nil) Optional proc used to validate new + # values. It must accept one and only one argument which will be the + # intended new value. The validator will return true if the new value + # is acceptable else return false (preferably) or raise an exception. + # + # @!macro deref_options + # + # @raise [ArgumentError] if the validator is not a `Proc` (when given) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:121 + def initialize(value, opts = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def __initialize_atomic_fields__; end + + # Atomically sets the value of atom to the new value if and only if the + # current value of the atom is identical to the old value and the new + # value successfully validates against the (optional) validator given + # at construction. + # + # @param [Object] old_value The expected current value. + # @param [Object] new_value The intended new value. + # + # @return [Boolean] True if the value is changed else false. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:181 + def compare_and_set(old_value, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:102 + def deref; end + + # Atomically sets the value of atom to the new value without regard for the + # current value so long as the new value successfully validates against the + # (optional) validator given at construction. + # + # @param [Object] new_value The intended new value. + # + # @return [Object] The final value of the atom after all operations and + # validations are complete. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:198 + def reset(new_value); end + + # Atomically swaps the value of atom using the given block. The current + # value will be passed to the block, as will any arguments passed as + # arguments to the function. The new value will be validated against the + # (optional) validator proc given at construction. If validation fails the + # value will not be changed. + # + # Internally, {#swap} reads the current value, applies the block to it, and + # attempts to compare-and-set it in. Since another thread may have changed + # the value in the intervening time, it may have to retry, and does so in a + # spin loop. The net effect is that the value will always be the result of + # the application of the supplied block to a current value, atomically. + # However, because the block might be called multiple times, it must be free + # of side effects. + # + # @note The given block may be called multiple times, and thus should be free + # of side effects. + # + # @param [Object] args Zero or more arguments passed to the block. + # + # @yield [value, args] Calculates a new value for the atom based on the + # current value and any supplied arguments. + # @yieldparam value [Object] The current value of the atom. + # @yieldparam args [Object] All arguments passed to the function, in order. + # @yieldreturn [Object] The intended new value of the atom. + # + # @return [Object] The final value of the atom after all operations and + # validations are complete. + # + # @raise [ArgumentError] When no block is given. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:157 + def swap(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def value; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def compare_and_set_value(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def swap_value(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def update_value(&block); end + + # Is the new value valid? + # + # @param [Object] new_value The intended new value. + # @return [Boolean] false if the validator function returns false or raises + # an exception else true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:216 + def valid?(new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def value=(value); end +end + +# @!macro atomic_boolean +# +# A boolean value that can be updated atomically. Reads and writes to an atomic +# boolean and thread-safe and guaranteed to succeed. Reads and writes may block +# briefly but no explicit locking is required. +# +# @!macro thread_safe_variable_comparison +# +# Performance: +# +# ``` +# Testing with ruby 2.1.2 +# Testing with Concurrent::MutexAtomicBoolean... +# 2.790000 0.000000 2.790000 ( 2.791454) +# Testing with Concurrent::CAtomicBoolean... +# 0.740000 0.000000 0.740000 ( 0.740206) +# +# Testing with jruby 1.9.3 +# Testing with Concurrent::MutexAtomicBoolean... +# 5.240000 2.520000 7.760000 ( 3.683000) +# Testing with Concurrent::JavaAtomicBoolean... +# 3.340000 0.010000 3.350000 ( 0.855000) +# ``` +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicBoolean.html java.util.concurrent.atomic.AtomicBoolean +# +# @!macro atomic_boolean_public_api +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb:119 +class Concurrent::AtomicBoolean < ::Concurrent::MutexAtomicBoolean + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb:125 + def inspect; end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb:121 + def to_s; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb:82 +Concurrent::AtomicBooleanImplementation = Concurrent::MutexAtomicBoolean + +# Define update methods that use direct paths +# +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb:9 +module Concurrent::AtomicDirectUpdate + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb:15 + def try_update; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb:24 + def try_update!; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb:10 + def update; end +end + +# @!macro atomic_fixnum +# +# A numeric value that can be updated atomically. Reads and writes to an atomic +# fixnum and thread-safe and guaranteed to succeed. Reads and writes may block +# briefly but no explicit locking is required. +# +# @!macro thread_safe_variable_comparison +# +# Performance: +# +# ``` +# Testing with ruby 2.1.2 +# Testing with Concurrent::MutexAtomicFixnum... +# 3.130000 0.000000 3.130000 ( 3.136505) +# Testing with Concurrent::CAtomicFixnum... +# 0.790000 0.000000 0.790000 ( 0.785550) +# +# Testing with jruby 1.9.3 +# Testing with Concurrent::MutexAtomicFixnum... +# 5.460000 2.460000 7.920000 ( 3.715000) +# Testing with Concurrent::JavaAtomicFixnum... +# 4.520000 0.030000 4.550000 ( 1.187000) +# ``` +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicLong.html java.util.concurrent.atomic.AtomicLong +# +# @!macro atomic_fixnum_public_api +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb:136 +class Concurrent::AtomicFixnum < ::Concurrent::MutexAtomicFixnum + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb:142 + def inspect; end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb:138 + def to_s; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb:99 +Concurrent::AtomicFixnumImplementation = Concurrent::MutexAtomicFixnum + +# An atomic reference which maintains an object reference along with a mark bit +# that can be updated atomically. +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicMarkableReference.html +# java.util.concurrent.atomic.AtomicMarkableReference +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:10 +class Concurrent::AtomicMarkableReference < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:15 + def initialize(value = T.unsafe(nil), mark = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def __initialize_atomic_fields__; end + + # Atomically sets the value and mark to the given updated value and + # mark given both: + # - the current value == the expected value && + # - the current mark == the expected mark + # + # @param [Object] expected_val the expected value + # @param [Object] new_val the new value + # @param [Boolean] expected_mark the expected mark + # @param [Boolean] new_mark the new mark + # + # @return [Boolean] `true` if successful. A `false` return indicates + # that the actual value was not equal to the expected value or the + # actual mark was not equal to the expected mark + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:33 + def compare_and_set(expected_val, new_val, expected_mark, new_mark); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:59 + def compare_and_swap(expected_val, new_val, expected_mark, new_mark); end + + # Gets the current reference and marked values. + # + # @return [Array] the current reference and marked values + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:64 + def get; end + + # Gets the current marked value + # + # @return [Boolean] the current marked value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:78 + def mark; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:82 + def marked?; end + + # _Unconditionally_ sets to the given value of both the reference and + # the mark. + # + # @param [Object] new_val the new value + # @param [Boolean] new_mark the new mark + # + # @return [Array] both the new value and the new mark + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:91 + def set(new_val, new_mark); end + + # Pass the current value to the given block, replacing it with the + # block's result. Simply return nil if update fails. + # + # @yield [Object] Calculate a new value and marked state for the atomic + # reference using given (old) value and (old) marked + # @yieldparam [Object] old_val the starting value of the atomic reference + # @yieldparam [Boolean] old_mark the starting state of marked + # + # @return [Array] the new value and marked state, or nil if + # the update failed + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:152 + def try_update; end + + # Pass the current value to the given block, replacing it + # with the block's result. Raise an exception if the update + # fails. + # + # @yield [Object] Calculate a new value and marked state for the atomic + # reference using given (old) value and (old) marked + # @yieldparam [Object] old_val the starting value of the atomic reference + # @yieldparam [Boolean] old_mark the starting state of marked + # + # @return [Array] the new value and marked state + # + # @raise [Concurrent::ConcurrentUpdateError] if the update fails + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:128 + def try_update!; end + + # Pass the current value and marked state to the given block, replacing it + # with the block's results. May retry if the value changes during the + # block's execution. + # + # @yield [Object] Calculate a new value and marked state for the atomic + # reference using given (old) value and (old) marked + # @yieldparam [Object] old_val the starting value of the atomic reference + # @yieldparam [Boolean] old_mark the starting state of marked + # + # @return [Array] the new value and new mark + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:105 + def update; end + + # Gets the current value of the reference + # + # @return [Object] the current value of the reference + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:71 + def value; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def compare_and_set_reference(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:163 + def immutable_array(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def reference; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def reference=(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def swap_reference(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def update_reference(&block); end +end + +# Special "compare and set" handling of numeric values. +# +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb:7 +module Concurrent::AtomicNumericCompareAndSetWrapper + # @!macro atomic_reference_method_compare_and_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb:10 + def compare_and_set(old_value, new_value); end +end + +# An object reference that may be updated atomically. All read and write +# operations have java volatile semantic. +# +# @!macro thread_safe_variable_comparison +# +# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicReference.html +# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/package-summary.html +# +# @!method initialize(value = nil) +# @!macro atomic_reference_method_initialize +# @param [Object] value The initial value. +# +# @!method get +# @!macro atomic_reference_method_get +# Gets the current value. +# @return [Object] the current value +# +# @!method set(new_value) +# @!macro atomic_reference_method_set +# Sets to the given value. +# @param [Object] new_value the new value +# @return [Object] the new value +# +# @!method get_and_set(new_value) +# @!macro atomic_reference_method_get_and_set +# Atomically sets to the given value and returns the old value. +# @param [Object] new_value the new value +# @return [Object] the old value +# +# @!method compare_and_set(old_value, new_value) +# @!macro atomic_reference_method_compare_and_set +# +# Atomically sets the value to the given updated value if +# the current value == the expected value. +# +# @param [Object] old_value the expected value +# @param [Object] new_value the new value +# +# @return [Boolean] `true` if successful. A `false` return indicates +# that the actual value was not equal to the expected value. +# +# @!method update +# Pass the current value to the given block, replacing it +# with the block's result. May retry if the value changes +# during the block's execution. +# +# @yield [Object] Calculate a new value for the atomic reference using +# given (old) value +# @yieldparam [Object] old_value the starting value of the atomic reference +# @return [Object] the new value +# +# @!method try_update +# Pass the current value to the given block, replacing it +# with the block's result. Return nil if the update fails. +# +# @yield [Object] Calculate a new value for the atomic reference using +# given (old) value +# @yieldparam [Object] old_value the starting value of the atomic reference +# @note This method was altered to avoid raising an exception by default. +# Instead, this method now returns `nil` in case of failure. For more info, +# please see: https://github.com/ruby-concurrency/concurrent-ruby/pull/336 +# @return [Object] the new value, or nil if update failed +# +# @!method try_update! +# Pass the current value to the given block, replacing it +# with the block's result. Raise an exception if the update +# fails. +# +# @yield [Object] Calculate a new value for the atomic reference using +# given (old) value +# @yieldparam [Object] old_value the starting value of the atomic reference +# @note This behavior mimics the behavior of the original +# `AtomicReference#try_update` API. The reason this was changed was to +# avoid raising exceptions (which are inherently slow) by default. For more +# info: https://github.com/ruby-concurrency/concurrent-ruby/pull/336 +# @return [Object] the new value +# @raise [Concurrent::ConcurrentUpdateError] if the update fails +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:126 +class Concurrent::AtomicReference < ::Concurrent::MutexAtomicReference + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:133 + def inspect; end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:129 + def to_s; end +end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:18 +Concurrent::AtomicReferenceImplementation = Concurrent::MutexAtomicReference + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:30 +class Concurrent::CRubySet < ::Set + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def initialize(*args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def &(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def +(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def -(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def <(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def <<(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def <=(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def <=>(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def ==(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def ===(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def >(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def >=(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def ^(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def add(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def add?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def classify(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def clear(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def collect!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def compare_by_identity(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def compare_by_identity?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def delete(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def delete?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def delete_if(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def difference(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def disjoint?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def divide(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def each(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def empty?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def eql?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def filter!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def flatten(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def flatten!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def flatten_merge(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def freeze(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def hash(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def include?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def inspect(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def intersect?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def intersection(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def join(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def keep_if(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def length(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def map!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def member?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def merge(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def pretty_print(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def pretty_print_cycle(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def proper_subset?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def proper_superset?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def reject!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def replace(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def reset(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def select!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def size(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def subset?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def subtract(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def superset?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def to_a(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def to_s(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def to_set(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def union(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def |(*args); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def initialize_copy(other); end +end + +# A thread pool that dynamically grows and shrinks to fit the current workload. +# New threads are created as needed, existing threads are reused, and threads +# that remain idle for too long are killed and removed from the pool. These +# pools are particularly suited to applications that perform a high volume of +# short-lived tasks. +# +# On creation a `CachedThreadPool` has zero running threads. New threads are +# created on the pool as new operations are `#post`. The size of the pool +# will grow until `#max_length` threads are in the pool or until the number +# of threads exceeds the number of running and pending operations. When a new +# operation is post to the pool the first available idle thread will be tasked +# with the new operation. +# +# Should a thread crash for any reason the thread will immediately be removed +# from the pool. Similarly, threads which remain idle for an extended period +# of time will be killed and reclaimed. Thus these thread pools are very +# efficient at reclaiming unused resources. +# +# The API and behavior of this class are based on Java's `CachedThreadPool` +# +# @!macro thread_pool_options +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb:27 +class Concurrent::CachedThreadPool < ::Concurrent::ThreadPoolExecutor + # @!macro cached_thread_pool_method_initialize + # + # Create a new thread pool. + # + # @param [Hash] opts the options defining pool behavior. + # @option opts [Symbol] :fallback_policy (`:abort`) the fallback policy + # + # @raise [ArgumentError] if `fallback_policy` is not a known policy + # + # @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newCachedThreadPool-- + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb:39 + def initialize(opts = T.unsafe(nil)); end + + private + + # @!macro cached_thread_pool_method_initialize + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb:51 + def ns_initialize(opts); end +end + +# Raised when an asynchronous operation is cancelled before execution. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:9 +class Concurrent::CancelledOperationError < ::Concurrent::Error; end + +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/timeout_queue.rb:2 +module Concurrent::Collection; end + +# A thread safe observer set implemented using copy-on-read approach: +# observers are added and removed from a thread safe collection; every time +# a notification is required the internal data structure is copied to +# prevent concurrency issues +# +# @api private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:12 +class Concurrent::Collection::CopyOnNotifyObserverSet < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:14 + def initialize; end + + # @!macro observable_add_observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:20 + def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + # @!macro observable_count_observers + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:55 + def count_observers; end + + # @!macro observable_delete_observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:39 + def delete_observer(observer); end + + # @!macro observable_delete_observers + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:47 + def delete_observers; end + + # Notifies all registered observers with optional args and deletes them. + # + # @param [Object] args arguments to be passed to each observer + # @return [CopyOnWriteObserverSet] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:72 + def notify_and_delete_observers(*args, &block); end + + # Notifies all registered observers with optional args + # @param [Object] args arguments to be passed to each observer + # @return [CopyOnWriteObserverSet] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:62 + def notify_observers(*args, &block); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:80 + def ns_initialize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:86 + def duplicate_and_clear_observers; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:94 + def duplicate_observers; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:98 + def notify_to(observers, *args); end +end + +# A thread safe observer set implemented using copy-on-write approach: +# every time an observer is added or removed the whole internal data structure is +# duplicated and replaced with a new one. +# +# @api private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:11 +class Concurrent::Collection::CopyOnWriteObserverSet < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:13 + def initialize; end + + # @!macro observable_add_observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:19 + def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + # @!macro observable_count_observers + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:56 + def count_observers; end + + # @!macro observable_delete_observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:40 + def delete_observer(observer); end + + # @!macro observable_delete_observers + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:50 + def delete_observers; end + + # Notifies all registered observers with optional args and deletes them. + # + # @param [Object] args arguments to be passed to each observer + # @return [CopyOnWriteObserverSet] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:72 + def notify_and_delete_observers(*args, &block); end + + # Notifies all registered observers with optional args + # @param [Object] args arguments to be passed to each observer + # @return [CopyOnWriteObserverSet] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:63 + def notify_observers(*args, &block); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:80 + def ns_initialize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:102 + def clear_observers_and_return_old; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:86 + def notify_to(observers, *args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:94 + def observers; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:98 + def observers=(new_set); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:10 +Concurrent::Collection::MapImplementation = Concurrent::Collection::MriMapBackend + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:10 +class Concurrent::Collection::MriMapBackend < ::Concurrent::Collection::NonConcurrentMapBackend + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:12 + def initialize(options = T.unsafe(nil), &default_proc); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:17 + def []=(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:61 + def clear; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:33 + def compute(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:21 + def compute_if_absent(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:29 + def compute_if_present(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:53 + def delete(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:57 + def delete_pair(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:49 + def get_and_set(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:37 + def merge_pair(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:45 + def replace_if_exists(key, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:41 + def replace_pair(key, old_value, new_value); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:9 +class Concurrent::Collection::NonConcurrentMapBackend + # WARNING: all public methods of the class must operate on the @backend + # directly without calling each other. This is important because of the + # SynchronizedMapBackend which uses a non-reentrant mutex for performance + # reasons. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:15 + def initialize(options = T.unsafe(nil), &default_proc); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:21 + def [](key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:25 + def []=(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:94 + def clear; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:59 + def compute(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:29 + def compute_if_absent(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:53 + def compute_if_present(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:81 + def delete(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:85 + def delete_pair(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:99 + def each_pair; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:71 + def get_and_set(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:110 + def get_or_default(key, default_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:77 + def key?(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:63 + def merge_pair(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:46 + def replace_if_exists(key, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:37 + def replace_pair(key, old_value, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:106 + def size; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:130 + def dupped_backend; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:124 + def initialize_copy(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:134 + def pair?(key, expected_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:116 + def set_backend(default_proc); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:138 + def store_computed_value(key, new_value); end +end + +# @!macro priority_queue +# +# A queue collection in which the elements are sorted based on their +# comparison (spaceship) operator `<=>`. Items are added to the queue +# at a position relative to their priority. On removal the element +# with the "highest" priority is removed. By default the sort order is +# from highest to lowest, but a lowest-to-highest sort order can be +# set on construction. +# +# The API is based on the `Queue` class from the Ruby standard library. +# +# The pure Ruby implementation, `RubyNonConcurrentPriorityQueue` uses a heap algorithm +# stored in an array. The algorithm is based on the work of Robert Sedgewick +# and Kevin Wayne. +# +# The JRuby native implementation is a thin wrapper around the standard +# library `java.util.NonConcurrentPriorityQueue`. +# +# When running under JRuby the class `NonConcurrentPriorityQueue` extends `JavaNonConcurrentPriorityQueue`. +# When running under all other interpreters it extends `RubyNonConcurrentPriorityQueue`. +# +# @note This implementation is *not* thread safe. +# +# @see http://en.wikipedia.org/wiki/Priority_queue +# @see http://ruby-doc.org/stdlib-2.0.0/libdoc/thread/rdoc/Queue.html +# +# @see http://algs4.cs.princeton.edu/24pq/index.php#2.6 +# @see http://algs4.cs.princeton.edu/24pq/MaxPQ.java.html +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:50 +class Concurrent::Collection::NonConcurrentPriorityQueue < ::Concurrent::Collection::RubyNonConcurrentPriorityQueue + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:59 + def <<(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:56 + def deq; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:60 + def enq(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:52 + def has_priority?(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:57 + def shift; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:54 + def size; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:10 +Concurrent::Collection::NonConcurrentPriorityQueueImplementation = Concurrent::Collection::RubyNonConcurrentPriorityQueue + +# @!macro priority_queue +# +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:8 +class Concurrent::Collection::RubyNonConcurrentPriorityQueue + # @!macro priority_queue_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:11 + def initialize(opts = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:85 + def <<(item); end + + # @!macro priority_queue_method_clear + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:18 + def clear; end + + # @!macro priority_queue_method_delete + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:25 + def delete(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:74 + def deq; end + + # @!macro priority_queue_method_empty + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:43 + def empty?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:86 + def enq(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:51 + def has_priority?(item); end + + # @!macro priority_queue_method_include + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:48 + def include?(item); end + + # @!macro priority_queue_method_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:54 + def length; end + + # @!macro priority_queue_method_peek + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:60 + def peek; end + + # @!macro priority_queue_method_pop + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:65 + def pop; end + + # @!macro priority_queue_method_push + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:78 + def push(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:75 + def shift; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:57 + def size; end + + private + + # Are the items at the given indexes ordered based on the priority + # order specified at construction? + # + # @param [Integer] x the first index from which to retrieve a comparable value + # @param [Integer] y the second index from which to retrieve a comparable value + # + # @return [Boolean] true if the two elements are in the correct priority order + # else false + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:119 + def ordered?(x, y); end + + # Percolate down to maintain heap invariant. + # + # @param [Integer] k the index at which to start the percolation + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:128 + def sink(k); end + + # Exchange the values at the given indexes within the internal array. + # + # @param [Integer] x the first index to swap + # @param [Integer] y the second index to swap + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:103 + def swap(x, y); end + + # Percolate up to maintain heap invariant. + # + # @param [Integer] k the index at which to start the percolation + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:147 + def swim(k); end + + class << self + # @!macro priority_queue_method_from_list + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:89 + def from_list(list, opts = T.unsafe(nil)); end + end +end + +# @!visibility private +# @!macro timeout_queue +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/timeout_queue.rb:15 +class Concurrent::Collection::TimeoutQueue < ::Thread::Queue; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/timeout_queue.rb:5 +Concurrent::Collection::TimeoutQueueImplementation = Thread::Queue + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:2 +module Concurrent::Concern; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/deprecation.rb:8 +module Concurrent::Concern::Deprecation + include ::Concurrent::Concern::Logging + extend ::Concurrent::Concern::Logging + extend ::Concurrent::Concern::Deprecation + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/deprecation.rb:12 + def deprecated(message, strip = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/deprecation.rb:27 + def deprecated_method(old_name, new_name); end +end + +# Object references in Ruby are mutable. This can lead to serious problems when +# the `#value` of a concurrent object is a mutable reference. Which is always the +# case unless the value is a `Fixnum`, `Symbol`, or similar "primitive" data type. +# Most classes in this library that expose a `#value` getter method do so using the +# `Dereferenceable` mixin module. +# +# @!macro copy_options +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:11 +module Concurrent::Concern::Dereferenceable + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:24 + def deref; end + + # Return the value this object represents after applying the options specified + # by the `#set_deref_options` method. + # + # @return [Object] the current value of the object + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:21 + def value; end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:63 + def apply_deref_options(value); end + + # @!macro dereferenceable_set_deref_options + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:54 + def ns_set_deref_options(opts); end + + # @!macro dereferenceable_set_deref_options + # Set the options which define the operations #value performs before + # returning data to the caller (dereferencing). + # + # @note Most classes that include this module will call `#set_deref_options` + # from within the constructor, thus allowing these options to be set at + # object creation. + # + # @param [Hash] opts the options defining dereference behavior. + # @option opts [String] :dup_on_deref (false) call `#dup` before returning the data + # @option opts [String] :freeze_on_deref (false) call `#freeze` before returning the data + # @option opts [String] :copy_on_deref (nil) call the given `Proc` passing + # the internal value and returning the value returned from the proc + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:48 + def set_deref_options(opts = T.unsafe(nil)); end + + # Set the internal value of this object + # + # @param [Object] value the new value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:31 + def value=(value); end +end + +# Include where logging is needed +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:9 +module Concurrent::Concern::Logging + # Logs through {Concurrent.global_logger}, it can be overridden by setting @logger + # @param [Integer] level one of Concurrent::Concern::Logging constants + # @param [String] progname e.g. a path of an Actor + # @param [String, nil] message when nil block is used to generate the message + # @yieldreturn [String] a message + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:19 + def log(level, progname, message = T.unsafe(nil), &block); end +end + +# The same as Logger::Severity but we copy it here to avoid a dependency on the logger gem just for these 7 constants +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::DEBUG = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::ERROR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::FATAL = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::INFO = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:12 +Concurrent::Concern::Logging::SEV_LABEL = T.let(T.unsafe(nil), Array) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::UNKNOWN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::WARN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:10 +module Concurrent::Concern::Obligation + include ::Concurrent::Concern::Dereferenceable + + # Has the obligation completed processing? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:49 + def complete?; end + + # @example allows Obligation to be risen + # rejected_ivar = Ivar.new.fail + # raise rejected_ivar + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:126 + def exception(*args); end + + # Has the obligation been fulfilled? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:20 + def fulfilled?; end + + # Is the obligation still awaiting completion of processing? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:56 + def incomplete?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:89 + def no_error!(timeout = T.unsafe(nil)); end + + # Is obligation completion still pending? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:35 + def pending?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:23 + def realized?; end + + # If an exception was raised during processing this will return the + # exception object. Will return `nil` when the state is pending or if + # the obligation has been successfully fulfilled. + # + # @return [Exception] the exception raised during processing or `nil` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:119 + def reason; end + + # Has the obligation been rejected? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:28 + def rejected?; end + + # The current state of the obligation. + # + # @return [Symbol] the current state + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:110 + def state; end + + # Is the obligation still unscheduled? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:42 + def unscheduled?; end + + # The current value of the obligation. Will be `nil` while the state is + # pending or the operation has been rejected. + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Object] see Dereferenceable#deref + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:65 + def value(timeout = T.unsafe(nil)); end + + # The current value of the obligation. Will be `nil` while the state is + # pending or the operation has been rejected. Will re-raise any exceptions + # raised during processing (but will not raise an exception on timeout). + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Object] see Dereferenceable#deref + # @raise [Exception] raises the reason when rejected + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:98 + def value!(timeout = T.unsafe(nil)); end + + # Wait until obligation is complete or the timeout has been reached. + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Obligation] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:74 + def wait(timeout = T.unsafe(nil)); end + + # Wait until obligation is complete or the timeout is reached. Will re-raise + # any exceptions raised during processing (but will not raise an exception + # on timeout). + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Obligation] self + # @raise [Exception] raises the reason when rejected + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:86 + def wait!(timeout = T.unsafe(nil)); end + + protected + + # Atomic compare and set operation + # State is set to `next_state` only if `current state == expected_current`. + # + # @param [Symbol] next_state + # @param [Symbol] expected_current + # + # @return [Boolean] true is state is changed, false otherwise + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:174 + def compare_and_set_state(next_state, *expected_current); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:145 + def event; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:134 + def get_arguments_from(opts = T.unsafe(nil)); end + + # Executes the block within mutex if current state is included in expected_states + # + # @return block value if executed, false otherwise + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:190 + def if_state(*expected_states); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:139 + def init_obligation; end + + # Am I in the current state? + # + # @param [Symbol] expected The state to check against + # @return [Boolean] true if in the expected state else false + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:210 + def ns_check_state?(expected); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:215 + def ns_set_state(value); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:150 + def set_state(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:161 + def state=(value); end +end + +# The [observer pattern](http://en.wikipedia.org/wiki/Observer_pattern) is one +# of the most useful design patterns. +# +# The workflow is very simple: +# - an `observer` can register itself to a `subject` via a callback +# - many `observers` can be registered to the same `subject` +# - the `subject` notifies all registered observers when its status changes +# - an `observer` can deregister itself when is no more interested to receive +# event notifications +# +# In a single threaded environment the whole pattern is very easy: the +# `subject` can use a simple data structure to manage all its subscribed +# `observer`s and every `observer` can react directly to every event without +# caring about synchronization. +# +# In a multi threaded environment things are more complex. The `subject` must +# synchronize the access to its data structure and to do so currently we're +# using two specialized ObserverSet: {Concurrent::Concern::CopyOnWriteObserverSet} +# and {Concurrent::Concern::CopyOnNotifyObserverSet}. +# +# When implementing and `observer` there's a very important rule to remember: +# **there are no guarantees about the thread that will execute the callback** +# +# Let's take this example +# ``` +# class Observer +# def initialize +# @count = 0 +# end +# +# def update +# @count += 1 +# end +# end +# +# obs = Observer.new +# [obj1, obj2, obj3, obj4].each { |o| o.add_observer(obs) } +# # execute [obj1, obj2, obj3, obj4] +# ``` +# +# `obs` is wrong because the variable `@count` can be accessed by different +# threads at the same time, so it should be synchronized (using either a Mutex +# or an AtomicFixum) +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:50 +module Concurrent::Concern::Observable + # @!macro observable_add_observer + # + # Adds an observer to this set. If a block is passed, the observer will be + # created by this method and no other params should be passed. + # + # @param [Object] observer the observer to add + # @param [Symbol] func the function to call on the observer during notification. + # Default is :update + # @return [Object] the added observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:61 + def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + # @!macro observable_count_observers + # + # Return the number of observers associated with this object. + # + # @return [Integer] the observers count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:101 + def count_observers; end + + # @!macro observable_delete_observer + # + # Remove `observer` as an observer on this object so that it will no + # longer receive notifications. + # + # @param [Object] observer the observer to remove + # @return [Object] the deleted observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:82 + def delete_observer(observer); end + + # @!macro observable_delete_observers + # + # Remove all observers associated with this object. + # + # @return [Observable] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:91 + def delete_observers; end + + # As `#add_observer` but can be used for chaining. + # + # @param [Object] observer the observer to add + # @param [Symbol] func the function to call on the observer during notification. + # @return [Observable] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:70 + def with_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:107 + def observers; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:107 + def observers=(_arg0); end +end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:70 +class Concurrent::ConcurrentUpdateError < ::ThreadError; end + +# frozen pre-allocated backtrace to speed ConcurrentUpdateError +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:72 +Concurrent::ConcurrentUpdateError::CONC_UP_ERR_BACKTRACE = T.let(T.unsafe(nil), Array) + +# Raised when errors occur during configuration. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:6 +class Concurrent::ConfigurationError < ::Concurrent::Error; end + +# @!macro count_down_latch +# +# A synchronization object that allows one thread to wait on multiple other threads. +# The thread that will wait creates a `CountDownLatch` and sets the initial value +# (normally equal to the number of other threads). The initiating thread passes the +# latch to the other threads then waits for the other threads by calling the `#wait` +# method. Each of the other threads calls `#count_down` when done with its work. +# When the latch counter reaches zero the waiting thread is unblocked and continues +# with its work. A `CountDownLatch` can be used only once. Its value cannot be reset. +# +# @!macro count_down_latch_public_api +# @example Waiter and Decrementer +# latch = Concurrent::CountDownLatch.new(3) +# +# waiter = Thread.new do +# latch.wait() +# puts ("Waiter released") +# end +# +# decrementer = Thread.new do +# sleep(1) +# latch.count_down +# puts latch.count +# +# sleep(1) +# latch.count_down +# puts latch.count +# +# sleep(1) +# latch.count_down +# puts latch.count +# end +# +# [waiter, decrementer].each(&:join) +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb:98 +class Concurrent::CountDownLatch < ::Concurrent::MutexCountDownLatch; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb:56 +Concurrent::CountDownLatchImplementation = Concurrent::MutexCountDownLatch + +# A synchronization aid that allows a set of threads to all wait for each +# other to reach a common barrier point. +# @example +# barrier = Concurrent::CyclicBarrier.new(3) +# jobs = Array.new(3) { |i| -> { sleep i; p done: i } } +# process = -> (i) do +# # waiting to start at the same time +# barrier.wait +# # execute job +# jobs[i].call +# # wait for others to finish +# barrier.wait +# end +# threads = 2.times.map do |i| +# Thread.new(i, &process) +# end +# +# # use main as well +# process.call 2 +# +# # here we can be sure that all jobs are processed +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:27 +class Concurrent::CyclicBarrier < ::Concurrent::Synchronization::LockableObject + # Create a new `CyclicBarrier` that waits for `parties` threads + # + # @param [Fixnum] parties the number of parties + # @yield an optional block that will be executed that will be executed after + # the last thread arrives and before the others are released + # + # @raise [ArgumentError] if `parties` is not an integer or is less than zero + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:40 + def initialize(parties, &block); end + + # A barrier can be broken when: + # - a thread called the `reset` method while at least one other thread was waiting + # - at least one thread timed out on `wait` method + # + # A broken barrier can be restored using `reset` it's safer to create a new one + # @return [Boolean] true if the barrier is broken otherwise false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:105 + def broken?; end + + # @return [Fixnum] the number of threads currently waiting on the barrier + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:54 + def number_waiting; end + + # @return [Fixnum] the number of threads needed to pass the barrier + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:49 + def parties; end + + # resets the barrier to its initial state + # If there is at least one waiting thread, it will be woken up, the `wait` + # method will return false and the barrier will be broken + # If the barrier is broken, this method restores it to the original state + # + # @return [nil] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:95 + def reset; end + + # Blocks on the barrier until the number of waiting threads is equal to + # `parties` or until `timeout` is reached or `reset` is called + # If a block has been passed to the constructor, it will be executed once by + # the last arrived thread before releasing the others + # @param [Fixnum] timeout the number of seconds to wait for the counter or + # `nil` to block indefinitely + # @return [Boolean] `true` if the `count` reaches zero else false on + # `timeout` or on `reset` or if the barrier is broken + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:66 + def wait(timeout = T.unsafe(nil)); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:111 + def ns_generation_done(generation, status, continue = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:122 + def ns_initialize(parties, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:117 + def ns_next_generation; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 +class Concurrent::CyclicBarrier::Generation < ::Struct + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def status; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def status=(_); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def [](*_arg0); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def keyword_init?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def new(*_arg0); end + end +end + +# Lazy evaluation of a block yielding an immutable result. Useful for +# expensive operations that may never be needed. It may be non-blocking, +# supports the `Concern::Obligation` interface, and accepts the injection of +# custom executor upon which to execute the block. Processing of +# block will be deferred until the first time `#value` is called. +# At that time the caller can choose to return immediately and let +# the block execute asynchronously, block indefinitely, or block +# with a timeout. +# +# When a `Delay` is created its state is set to `pending`. The value and +# reason are both `nil`. The first time the `#value` method is called the +# enclosed operation will be run and the calling thread will block. Other +# threads attempting to call `#value` will block as well. Once the operation +# is complete the *value* will be set to the result of the operation or the +# *reason* will be set to the raised exception, as appropriate. All threads +# blocked on `#value` will return. Subsequent calls to `#value` will immediately +# return the cached value. The operation will only be run once. This means that +# any side effects created by the operation will only happen once as well. +# +# `Delay` includes the `Concurrent::Concern::Dereferenceable` mixin to support thread +# safety of the reference returned by `#value`. +# +# @!macro copy_options +# +# @!macro delay_note_regarding_blocking +# @note The default behavior of `Delay` is to block indefinitely when +# calling either `value` or `wait`, executing the delayed operation on +# the current thread. This makes the `timeout` value completely +# irrelevant. To enable non-blocking behavior, use the `executor` +# constructor option. This will cause the delayed operation to be +# execute on the given executor, allowing the call to timeout. +# +# @see Concurrent::Concern::Dereferenceable +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:44 +class Concurrent::Delay < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Dereferenceable + include ::Concurrent::Concern::Obligation + + # Create a new `Delay` in the `:pending` state. + # + # @!macro executor_and_deref_options + # + # @yield the delayed operation to perform + # + # @raise [ArgumentError] if no block is given + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:62 + def initialize(opts = T.unsafe(nil), &block); end + + # Reconfigures the block returning the value if still `#incomplete?` + # + # @yield the delayed operation to perform + # @return [true, false] if success + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:146 + def reconfigure(&block); end + + # Return the value this object represents after applying the options + # specified by the `#set_deref_options` method. If the delayed operation + # raised an exception this method will return nil. The exception object + # can be accessed via the `#reason` method. + # + # @param [Numeric] timeout the maximum number of seconds to wait + # @return [Object] the current value of the object + # + # @!macro delay_note_regarding_blocking + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:77 + def value(timeout = T.unsafe(nil)); end + + # Return the value this object represents after applying the options + # specified by the `#set_deref_options` method. If the delayed operation + # raised an exception, this method will raise that exception (even when) + # the operation has already been executed). + # + # @param [Numeric] timeout the maximum number of seconds to wait + # @return [Object] the current value of the object + # @raise [Exception] when `#rejected?` raises `#reason` + # + # @!macro delay_note_regarding_blocking + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:113 + def value!(timeout = T.unsafe(nil)); end + + # Return the value this object represents after applying the options + # specified by the `#set_deref_options` method. + # + # @param [Integer] timeout (nil) the maximum number of seconds to wait for + # the value to be computed. When `nil` the caller will block indefinitely. + # + # @return [Object] self + # + # @!macro delay_note_regarding_blocking + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:132 + def wait(timeout = T.unsafe(nil)); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:160 + def ns_initialize(opts, &block); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:173 + def execute_task_once; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:7 +class Concurrent::DependencyCounter + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:9 + def initialize(count, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:14 + def update(time, value, reason); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:3 +class Concurrent::Error < ::StandardError; end + +# Old school kernel-style event reminiscent of Win32 programming in C++. +# +# When an `Event` is created it is in the `unset` state. Threads can choose to +# `#wait` on the event, blocking until released by another thread. When one +# thread wants to alert all blocking threads it calls the `#set` method which +# will then wake up all listeners. Once an `Event` has been set it remains set. +# New threads calling `#wait` will return immediately. An `Event` may be +# `#reset` at any time once it has been set. +# +# @see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682655.aspx +# @example +# event = Concurrent::Event.new +# +# t1 = Thread.new do +# puts "t1 is waiting" +# event.wait(1) +# puts "event occurred" +# end +# +# t2 = Thread.new do +# puts "t2 calling set" +# event.set +# end +# +# [t1, t2].each(&:join) +# +# # prints: +# # t1 is waiting +# # t2 calling set +# # event occurred +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:36 +class Concurrent::Event < ::Concurrent::Synchronization::LockableObject + # Creates a new `Event` in the unset state. Threads calling `#wait` on the + # `Event` will block. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:40 + def initialize; end + + # Reset a previously set event back to the `unset` state. + # Has no effect if the `Event` has not yet been set. + # + # @return [Boolean] should always return `true` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:68 + def reset; end + + # Trigger the event, setting the state to `set` and releasing all threads + # waiting on the event. Has no effect if the `Event` has already been set. + # + # @return [Boolean] should always return `true` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:56 + def set; end + + # Is the object in the set state? + # + # @return [Boolean] indicating whether or not the `Event` has been set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:48 + def set?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:60 + def try?; end + + # Wait a given number of seconds for the `Event` to be set by another + # thread. Will wait forever when no `timeout` value is given. Returns + # immediately if the `Event` has already been set. + # + # @return [Boolean] true if the `Event` was set before timeout else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:83 + def wait(timeout = T.unsafe(nil)); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:104 + def ns_initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:96 + def ns_set; end +end + +# @!macro exchanger +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:336 +class Concurrent::Exchanger < ::Concurrent::RubyExchanger; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:327 +Concurrent::ExchangerImplementation = Concurrent::RubyExchanger + +# @!macro executor_service_public_api +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:157 +module Concurrent::ExecutorService + include ::Concurrent::Concern::Logging + + # @!macro executor_service_method_left_shift + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:166 + def <<(task); end + + # @!macro executor_service_method_can_overflow_question + # + # @note Always returns `false` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:174 + def can_overflow?; end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:161 + def post(*args, &task); end + + # @!macro executor_service_method_serialized_question + # + # @note Always returns `false` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:181 + def serialized?; end +end + +# A `FiberLocalVar` is a variable where the value is different for each fiber. +# Each variable may have a default value, but when you modify the variable only +# the current fiber will ever see that change. +# +# This is similar to Ruby's built-in fiber-local variables (`Thread.current[:name]`), +# but with these major advantages: +# * `FiberLocalVar` has its own identity, it doesn't need a Symbol. +# * Each Ruby's built-in fiber-local variable leaks some memory forever (it's a Symbol held forever on the fiber), +# so it's only OK to create a small amount of them. +# `FiberLocalVar` has no such issue and it is fine to create many of them. +# * Ruby's built-in fiber-local variables leak forever the value set on each fiber (unless set to nil explicitly). +# `FiberLocalVar` automatically removes the mapping for each fiber once the `FiberLocalVar` instance is GC'd. +# +# @example +# v = FiberLocalVar.new(14) +# v.value #=> 14 +# v.value = 2 +# v.value #=> 2 +# +# @example +# v = FiberLocalVar.new(14) +# +# Fiber.new do +# v.value #=> 14 +# v.value = 1 +# v.value #=> 1 +# end.resume +# +# Fiber.new do +# v.value #=> 14 +# v.value = 2 +# v.value #=> 2 +# end.resume +# +# v.value #=> 14 +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:41 +class Concurrent::FiberLocalVar + # Creates a fiber local variable. + # + # @param [Object] default the default value when otherwise unset + # @param [Proc] default_block Optional block that gets called to obtain the + # default value for each fiber + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:49 + def initialize(default = T.unsafe(nil), &default_block); end + + # Bind the given value to fiber local storage during + # execution of the given block. + # + # @param [Object] value the value to bind + # @yield the operation to be performed with the bound variable + # @return [Object] the value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:86 + def bind(value); end + + # Returns the value in the current fiber's copy of this fiber-local variable. + # + # @return [Object] the current value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:68 + def value; end + + # Sets the current fiber's copy of this fiber-local variable to the specified value. + # + # @param [Object] value the value to set + # @return [Object] the new value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:76 + def value=(value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:101 + def default; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:42 +Concurrent::FiberLocalVar::LOCALS = T.let(T.unsafe(nil), Concurrent::FiberLocals) + +# @!visibility private +# @!macro internal_implementation_note +# An array-backed storage of indexed variables per fiber. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:166 +class Concurrent::FiberLocals < ::Concurrent::AbstractLocals + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:167 + def locals; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:171 + def locals!; end +end + +# @!macro fixed_thread_pool +# +# A thread pool that reuses a fixed number of threads operating off an unbounded queue. +# At any point, at most `num_threads` will be active processing tasks. When all threads are busy new +# tasks `#post` to the thread pool are enqueued until a thread becomes available. +# Should a thread crash for any reason the thread will immediately be removed +# from the pool and replaced. +# +# The API and behavior of this class are based on Java's `FixedThreadPool` +# +# @!macro thread_pool_options +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb:199 +class Concurrent::FixedThreadPool < ::Concurrent::ThreadPoolExecutor + # @!macro fixed_thread_pool_method_initialize + # + # Create a new thread pool. + # + # @param [Integer] num_threads the number of threads to allocate + # @param [Hash] opts the options defining pool behavior. + # @option opts [Symbol] :fallback_policy (`:abort`) the fallback policy + # + # @raise [ArgumentError] if `num_threads` is less than or equal to zero + # @raise [ArgumentError] if `fallback_policy` is not a known policy + # + # @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool-int- + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb:213 + def initialize(num_threads, opts = T.unsafe(nil)); end +end + +# {include:file:docs-source/future.md} +# +# @!macro copy_options +# +# @see http://ruby-doc.org/stdlib-2.1.1/libdoc/observer/rdoc/Observable.html Ruby Observable module +# @see http://clojuredocs.org/clojure_core/clojure.core/future Clojure's future function +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html java.util.concurrent.Future +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:21 +class Concurrent::Future < ::Concurrent::IVar + # Create a new `Future` in the `:unscheduled` state. + # + # @yield the asynchronous operation to perform + # + # @!macro executor_and_deref_options + # + # @option opts [object, Array] :args zero or more arguments to be passed the task + # block on execution + # + # @raise [ArgumentError] if no block is given + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:33 + def initialize(opts = T.unsafe(nil), &block); end + + # Attempt to cancel the operation if it has not already processed. + # The operation can only be cancelled while still `pending`. It cannot + # be cancelled once it has begun processing or has completed. + # + # @return [Boolean] was the operation successfully cancelled. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:99 + def cancel; end + + # Has the operation been successfully cancelled? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:111 + def cancelled?; end + + # Execute an `:unscheduled` `Future`. Immediately sets the state to `:pending` and + # passes the block to a new thread/thread pool for eventual execution. + # Does nothing if the `Future` is in any state other than `:unscheduled`. + # + # @return [Future] a reference to `self` + # + # @example Instance and execute in separate steps + # future = Concurrent::Future.new{ sleep(1); 42 } + # future.state #=> :unscheduled + # future.execute + # future.state #=> :pending + # + # @example Instance and execute in one line + # future = Concurrent::Future.new{ sleep(1); 42 }.execute + # future.state #=> :pending + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:53 + def execute; end + + # @!macro ivar_set_method + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:82 + def set(value = T.unsafe(nil), &block); end + + # Wait the given number of seconds for the operation to complete. + # On timeout attempt to cancel the operation. + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Boolean] true if the operation completed before the timeout + # else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:121 + def wait_or_cancel(timeout); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:133 + def ns_initialize(value, opts); end + + class << self + # Create a new `Future` object with the given block, execute it, and return the + # `:pending` object. + # + # @yield the asynchronous operation to perform + # + # @!macro executor_and_deref_options + # + # @option opts [object, Array] :args zero or more arguments to be passed the task + # block on execution + # + # @raise [ArgumentError] if no block is given + # + # @return [Future] the newly created `Future` in the `:pending` state + # + # @example + # future = Concurrent::Future.execute{ sleep(1); 42 } + # future.state #=> :pending + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:77 + def execute(opts = T.unsafe(nil), &block); end + end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:18 +Concurrent::GLOBAL_FAST_EXECUTOR = T.let(T.unsafe(nil), Concurrent::Delay) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:30 +Concurrent::GLOBAL_IMMEDIATE_EXECUTOR = T.let(T.unsafe(nil), Concurrent::ImmediateExecutor) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:22 +Concurrent::GLOBAL_IO_EXECUTOR = T.let(T.unsafe(nil), Concurrent::Delay) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:111 +Concurrent::GLOBAL_LOGGER = T.let(T.unsafe(nil), Concurrent::AtomicReference) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:26 +Concurrent::GLOBAL_TIMER_SET = T.let(T.unsafe(nil), Concurrent::Delay) + +# @!macro concurrent_hash +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/hash.rb:49 +class Concurrent::Hash < ::Hash; end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/hash.rb:16 +Concurrent::HashImplementation = Hash + +# An `IVar` is like a future that you can assign. As a future is a value that +# is being computed that you can wait on, an `IVar` is a value that is waiting +# to be assigned, that you can wait on. `IVars` are single assignment and +# deterministic. +# +# Then, express futures as an asynchronous computation that assigns an `IVar`. +# The `IVar` becomes the primitive on which [futures](Future) and +# [dataflow](Dataflow) are built. +# +# An `IVar` is a single-element container that is normally created empty, and +# can only be set once. The I in `IVar` stands for immutable. Reading an +# `IVar` normally blocks until it is set. It is safe to set and read an `IVar` +# from different threads. +# +# If you want to have some parallel task set the value in an `IVar`, you want +# a `Future`. If you want to create a graph of parallel tasks all executed +# when the values they depend on are ready you want `dataflow`. `IVar` is +# generally a low-level primitive. +# +# ## Examples +# +# Create, set and get an `IVar` +# +# ```ruby +# ivar = Concurrent::IVar.new +# ivar.set 14 +# ivar.value #=> 14 +# ivar.set 2 # would now be an error +# ``` +# +# ## See Also +# +# 1. For the theory: Arvind, R. Nikhil, and K. Pingali. +# [I-Structures: Data structures for parallel computing](http://dl.acm.org/citation.cfm?id=69562). +# In Proceedings of Workshop on Graph Reduction, 1986. +# 2. For recent application: +# [DataDrivenFuture in Habanero Java from Rice](http://www.cs.rice.edu/~vs3/hjlib/doc/edu/rice/hj/api/HjDataDrivenFuture.html). +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:48 +class Concurrent::IVar < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Dereferenceable + include ::Concurrent::Concern::Obligation + include ::Concurrent::Concern::Observable + + # Create a new `IVar` in the `:pending` state with the (optional) initial value. + # + # @param [Object] value the initial value + # @param [Hash] opts the options to create a message with + # @option opts [String] :dup_on_deref (false) call `#dup` before returning + # the data + # @option opts [String] :freeze_on_deref (false) call `#freeze` before + # returning the data + # @option opts [String] :copy_on_deref (nil) call the given `Proc` passing + # the internal value and returning the value returned from the proc + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:62 + def initialize(value = T.unsafe(nil), opts = T.unsafe(nil), &block); end + + # Add an observer on this object that will receive notification on update. + # + # Upon completion the `IVar` will notify all observers in a thread-safe way. + # The `func` method of the observer will be called with three arguments: the + # `Time` at which the `Future` completed the asynchronous operation, the + # final `value` (or `nil` on rejection), and the final `reason` (or `nil` on + # fulfillment). + # + # @param [Object] observer the object that will be notified of changes + # @param [Symbol] func symbol naming the method to call when this + # `Observable` has changes` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:81 + def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + # @!macro ivar_fail_method + # Set the `IVar` to failed due to some error and wake or notify all threads waiting on it. + # + # @param [Object] reason for the failure + # @raise [Concurrent::MultipleAssignmentError] if the `IVar` has already + # been set or otherwise completed + # @return [IVar] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:135 + def fail(reason = T.unsafe(nil)); end + + # @!macro ivar_set_method + # Set the `IVar` to a value and wake or notify all threads waiting on it. + # + # @!macro ivar_set_parameters_and_exceptions + # @param [Object] value the value to store in the `IVar` + # @yield A block operation to use for setting the value + # @raise [ArgumentError] if both a value and a block are given + # @raise [Concurrent::MultipleAssignmentError] if the `IVar` has already + # been set or otherwise completed + # + # @return [IVar] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:113 + def set(value = T.unsafe(nil)); end + + # Attempt to set the `IVar` with the given value or block. Return a + # boolean indicating the success or failure of the set operation. + # + # @!macro ivar_set_parameters_and_exceptions + # + # @return [Boolean] true if the value was set else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:145 + def try_set(value = T.unsafe(nil), &block); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:202 + def check_for_block_or_value!(block_given, value); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:177 + def complete(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:184 + def complete_without_notification(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:190 + def notify_observers(value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:195 + def ns_complete_without_notification(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:155 + def ns_initialize(value, opts); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:168 + def safe_execute(task, args = T.unsafe(nil)); end +end + +# Raised when an operation is attempted which is not legal given the +# receiver's current state +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:20 +class Concurrent::IllegalOperationError < ::Concurrent::Error; end + +# An executor service which runs all operations on the current thread, +# blocking as necessary. Operations are performed in the order they are +# received and no two operations can be performed simultaneously. +# +# This executor service exists mainly for testing an debugging. When used +# it immediately runs every `#post` operation on the current thread, blocking +# that thread until the operation is complete. This can be very beneficial +# during testing because it makes all operations deterministic. +# +# @note Intended for use primarily in testing and debugging. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:17 +class Concurrent::ImmediateExecutor < ::Concurrent::AbstractExecutorService + include ::Concurrent::SerialExecutorService + + # Creates a new executor + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:21 + def initialize; end + + # @!macro executor_service_method_left_shift + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:34 + def <<(task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:59 + def kill; end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:26 + def post(*args, &task); end + + # @!macro executor_service_method_running_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:40 + def running?; end + + # @!macro executor_service_method_shutdown + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:55 + def shutdown; end + + # @!macro executor_service_method_shutdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:50 + def shutdown?; end + + # @!macro executor_service_method_shuttingdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:45 + def shuttingdown?; end + + # @!macro executor_service_method_wait_for_termination + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:62 + def wait_for_termination(timeout = T.unsafe(nil)); end +end + +# Raised when an attempt is made to violate an immutability guarantee. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:16 +class Concurrent::ImmutabilityError < ::Concurrent::Error; end + +# A thread-safe, immutable variation of Ruby's standard `Struct`. +# +# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct` +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:9 +module Concurrent::ImmutableStruct + include ::Concurrent::Synchronization::AbstractStruct + + # @!macro struct_equality + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:51 + def ==(other); end + + # @!macro struct_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:46 + def [](member); end + + # @!macro struct_each + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:56 + def each(&block); end + + # @!macro struct_each_pair + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:62 + def each_pair(&block); end + + # @!macro struct_inspect + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:29 + def inspect; end + + # @!macro struct_merge + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:36 + def merge(other, &block); end + + # @!macro struct_select + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:68 + def select(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:21 + def to_a; end + + # @!macro struct_to_h + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:41 + def to_h; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:33 + def to_s; end + + # @!macro struct_values + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:17 + def values; end + + # @!macro struct_values_at + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:24 + def values_at(*indexes); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:76 + def initialize_copy(original); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:12 + def included(base); end + + # @!macro struct_new + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:82 + def new(*args, &block); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:92 +Concurrent::ImmutableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) + +# An executor service which runs all operations on a new thread, blocking +# until it completes. Operations are performed in the order they are received +# and no two operations can be performed simultaneously. +# +# This executor service exists mainly for testing an debugging. When used it +# immediately runs every `#post` operation on a new thread, blocking the +# current thread until the operation is complete. This is similar to how the +# ImmediateExecutor works, but the operation has the full stack of the new +# thread at its disposal. This can be helpful when the operations will spawn +# more operations on the same executor and so on - such a situation might +# overflow the single stack in case of an ImmediateExecutor, which is +# inconsistent with how it would behave for a threaded executor. +# +# @note Intended for use primarily in testing and debugging. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb:19 +class Concurrent::IndirectImmediateExecutor < ::Concurrent::ImmediateExecutor + # Creates a new executor + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb:21 + def initialize; end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb:27 + def post(*args, &task); end +end + +# Raised when an object's methods are called when it has not been +# properly initialized. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:24 +class Concurrent::InitializationError < ::Concurrent::Error; end + +# Raised when a lifecycle method (such as `stop`) is called in an improper +# sequence or when the object is in an inappropriate state. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:13 +class Concurrent::LifecycleError < ::Concurrent::Error; end + +# @!macro warn.edge +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:6 +class Concurrent::LockFreeStack < ::Concurrent::Synchronization::Object + include ::Enumerable + extend ::Concurrent::Synchronization::SafeInitialization + + # @param [Node] head + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:51 + def initialize(head = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def __initialize_atomic_fields__; end + + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:118 + def clear; end + + # @return [self] + # @yield over the cleared stack + # @yieldparam [Object] value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:142 + def clear_each(&block); end + + # @param [Node] head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:128 + def clear_if(head); end + + # @param [Node] head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:99 + def compare_and_clear(head); end + + # @param [Node] head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:85 + def compare_and_pop(head); end + + # @param [Node] head + # @param [Object] value + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:65 + def compare_and_push(head, value); end + + # @param [Node] head + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:107 + def each(head = T.unsafe(nil)); end + + # @param [Node] head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:58 + def empty?(head = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:158 + def inspect; end + + # @return [Node] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:79 + def peek; end + + # @return [Object] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:90 + def pop; end + + # @param [Object] value + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:71 + def push(value); end + + # @param [Node] head + # @param [Node] new_head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:135 + def replace_if(head, new_head); end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:154 + def to_s; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def compare_and_set_head(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def head; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def head=(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def swap_head(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def update_head(&block); end + + class << self + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:41 + def of1(value); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:46 + def of2(value1, value2); end + end +end + +# The singleton for empty node +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:32 +Concurrent::LockFreeStack::EMPTY = T.let(T.unsafe(nil), Concurrent::LockFreeStack::Node) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:10 +class Concurrent::LockFreeStack::Node + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:23 + def initialize(value, next_node); end + + # @return [Node] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:14 + def next_node; end + + # @return [Object] + # @!visibility private + # allow to nil-ify to free GC when the entry is no longer relevant, not synchronised + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:17 + def value; end + + # @return [Object] + # @!visibility private + # allow to nil-ify to free GC when the entry is no longer relevant, not synchronised + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:21 + def value=(_arg0); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:28 + def [](*_arg0); end + end +end + +# Either {FiberLocalVar} or {ThreadLocalVar} depending on whether Mutex (and Monitor) +# are held, respectively, per Fiber or per Thread. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:22 +Concurrent::LockLocalVar = Concurrent::FiberLocalVar + +# An `MVar` is a synchronized single element container. They are empty or +# contain one item. Taking a value from an empty `MVar` blocks, as does +# putting a value into a full one. You can either think of them as blocking +# queue of length one, or a special kind of mutable variable. +# +# On top of the fundamental `#put` and `#take` operations, we also provide a +# `#modify` that is atomic with respect to operations on the same instance. +# These operations all support timeouts. +# +# We also support non-blocking operations `#try_put!` and `#try_take!`, a +# `#set!` that ignores existing values, a `#value` that returns the value +# without removing it or returns `MVar::EMPTY`, and a `#modify!` that yields +# `MVar::EMPTY` if the `MVar` is empty and can be used to set `MVar::EMPTY`. +# You shouldn't use these operations in the first instance. +# +# `MVar` is a [Dereferenceable](Dereferenceable). +# +# `MVar` is related to M-structures in Id, `MVar` in Haskell and `SyncVar` in Scala. +# +# Note that unlike the original Haskell paper, our `#take` is blocking. This is how +# Haskell and Scala do it today. +# +# @!macro copy_options +# +# ## See Also +# +# 1. P. Barth, R. Nikhil, and Arvind. [M-Structures: Extending a parallel, non- strict, functional language with state](http://dl.acm.org/citation.cfm?id=652538). In Proceedings of the 5th +# ACM Conference on Functional Programming Languages and Computer Architecture (FPCA), 1991. +# +# 2. S. Peyton Jones, A. Gordon, and S. Finne. [Concurrent Haskell](http://dl.acm.org/citation.cfm?id=237794). +# In Proceedings of the 23rd Symposium on Principles of Programming Languages +# (PoPL), 1996. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:38 +class Concurrent::MVar < ::Concurrent::Synchronization::Object + include ::Concurrent::Concern::Dereferenceable + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `MVar`, either empty or with an initial value. + # + # @param [Hash] opts the options controlling how the future will be processed + # + # @!macro deref_options + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:54 + def initialize(value = T.unsafe(nil), opts = T.unsafe(nil)); end + + # acquires lock on the from an `MVAR`, yields the value to provided block, + # and release lock. A timeout can be set to limit the time spent blocked, + # in which case it returns `TIMEOUT` if the time is exceeded. + # @return [Object] the value returned by the block, or `TIMEOUT` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:86 + def borrow(timeout = T.unsafe(nil)); end + + # Returns if the `MVar` is currently empty. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:195 + def empty?; end + + # Returns if the `MVar` currently contains a value. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:200 + def full?; end + + # Atomically `take`, yield the value to a block for transformation, and then + # `put` the transformed value. Returns the pre-transform value. A timeout can + # be set to limit the time spent blocked, in which case it returns `TIMEOUT` + # if the time is exceeded. + # @return [Object] the pre-transform value, or `TIMEOUT` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:123 + def modify(timeout = T.unsafe(nil)); end + + # Non-blocking version of `modify` that will yield with `EMPTY` if there is no value yet. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:179 + def modify!; end + + # Put a value into an `MVar`, blocking if there is already a value until + # it is empty. A timeout can be set to limit the time spent blocked, in + # which case it returns `TIMEOUT` if the time is exceeded. + # @return [Object] the value that was put, or `TIMEOUT` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:103 + def put(value, timeout = T.unsafe(nil)); end + + # Non-blocking version of `put` that will overwrite an existing value. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:169 + def set!(value); end + + # Remove the value from an `MVar`, leaving it empty, and blocking if there + # isn't a value. A timeout can be set to limit the time spent blocked, in + # which case it returns `TIMEOUT` if the time is exceeded. + # @return [Object] the value that was taken, or `TIMEOUT` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:66 + def take(timeout = T.unsafe(nil)); end + + # Non-blocking version of `put`, that returns whether or not it was successful. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:156 + def try_put!(value); end + + # Non-blocking version of `take`, that returns `EMPTY` instead of blocking. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:142 + def try_take!; end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:206 + def synchronize(&block); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:212 + def unlocked_empty?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:216 + def unlocked_full?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:224 + def wait_for_empty(timeout); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:220 + def wait_for_full(timeout); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:228 + def wait_while(condition, timeout); end +end + +# Unique value that represents that an `MVar` was empty +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:43 +Concurrent::MVar::EMPTY = T.let(T.unsafe(nil), Object) + +# Unique value that represents that an `MVar` timed out before it was able +# to produce a value. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:47 +Concurrent::MVar::TIMEOUT = T.let(T.unsafe(nil), Object) + +# `Concurrent::Map` is a hash-like object and should have much better performance +# characteristics, especially under high concurrency, than `Concurrent::Hash`. +# However, `Concurrent::Map `is not strictly semantically equivalent to a ruby `Hash` +# -- for instance, it does not necessarily retain ordering by insertion time as `Hash` +# does. For most uses it should do fine though, and we recommend you consider +# `Concurrent::Map` instead of `Concurrent::Hash` for your concurrency-safe hash needs. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:39 +class Concurrent::Map < ::Concurrent::Collection::MriMapBackend + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:279 + def each; end + + # Iterates over each key. + # @yield for each key in the map + # @yieldparam key [Object] + # @return [self] + # @!macro map.atomic_method_with_block + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:255 + def each_key; end + + # Iterates over each key value pair. + # @yield for each key value pair in the map + # @yieldparam key [Object] + # @yieldparam value [Object] + # @return [self] + # @!macro map.atomic_method_with_block + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:274 + def each_pair; end + + # Iterates over each value. + # @yield for each value in the map + # @yieldparam value [Object] + # @return [self] + # @!macro map.atomic_method_with_block + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:264 + def each_value; end + + # Is map empty? + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:291 + def empty?; end + + # Get a value with key, or default_value when key is absent, + # or fail when no default_value is given. + # @param [Object] key + # @param [Object] default_value + # @yield default value for a key + # @yieldparam key [Object] + # @yieldreturn [Object] default value + # @return [Object] the value or default value + # @raise [KeyError] when key is missing and no default_value is provided + # @!macro map_method_not_atomic + # @note The "fetch-then-act" methods of `Map` are not atomic. `Map` is intended + # to be use as a concurrency primitive with strong happens-before + # guarantees. It is not intended to be used as a high-level abstraction + # supporting complex operations. All read and write operations are + # thread safe, but no guarantees are made regarding race conditions + # between the fetch operation and yielding to the block. Additionally, + # this method does not support recursion. This is due to internal + # constraints that are very unlikely to change in the near future. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:183 + def fetch(key, default_value = T.unsafe(nil)); end + + # Fetch value with key, or store default value when key is absent, + # or fail when no default_value is given. This is a two step operation, + # therefore not atomic. The store can overwrite other concurrently + # stored value. + # @param [Object] key + # @param [Object] default_value + # @yield default value for a key + # @yieldparam key [Object] + # @yieldreturn [Object] default value + # @return [Object] the value or default value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:205 + def fetch_or_store(key, default_value = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:162 + def get(key); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:321 + def inspect; end + + # Find key of a value. + # @param [Object] value + # @return [Object, nil] key or nil when not found + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:284 + def key(value); end + + # All keys + # @return [::Array] keys + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:236 + def keys; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:305 + def marshal_dump; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:313 + def marshal_load(hash); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:163 + def put(key, value); end + + # Insert value into map with key if key is absent in one atomic step. + # @param [Object] key + # @param [Object] value + # @return [Object, nil] the previous value when key was present or nil when there was no key + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:215 + def put_if_absent(key, value); end + + # Is the value stored in the map. Iterates over all values. + # @param [Object] value + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:227 + def value?(value); end + + # All values + # @return [::Array] values + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:244 + def values; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:331 + def initialize_copy(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:336 + def populate_from(hash); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:327 + def raise_fetch_no_key; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:341 + def validate_options_hash!(options); end +end + +# Raised when an object with a start/stop lifecycle has been started an +# excessive number of times. Often used in conjunction with a restart +# policy or strategy. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:29 +class Concurrent::MaxRestartFrequencyError < ::Concurrent::Error; end + +# A `Maybe` encapsulates an optional value. A `Maybe` either contains a value +# of (represented as `Just`), or it is empty (represented as `Nothing`). Using +# `Maybe` is a good way to deal with errors or exceptional cases without +# resorting to drastic measures such as exceptions. +# +# `Maybe` is a replacement for the use of `nil` with better type checking. +# +# For compatibility with {Concurrent::Concern::Obligation} the predicate and +# accessor methods are aliased as `fulfilled?`, `rejected?`, `value`, and +# `reason`. +# +# ## Motivation +# +# A common pattern in languages with pattern matching, such as Erlang and +# Haskell, is to return *either* a value *or* an error from a function +# Consider this Erlang code: +# +# ```erlang +# case file:consult("data.dat") of +# {ok, Terms} -> do_something_useful(Terms); +# {error, Reason} -> lager:error(Reason) +# end. +# ``` +# +# In this example the standard library function `file:consult` returns a +# [tuple](http://erlang.org/doc/reference_manual/data_types.html#id69044) +# with two elements: an [atom](http://erlang.org/doc/reference_manual/data_types.html#id64134) +# (similar to a ruby symbol) and a variable containing ancillary data. On +# success it returns the atom `ok` and the data from the file. On failure it +# returns `error` and a string with an explanation of the problem. With this +# pattern there is no ambiguity regarding success or failure. If the file is +# empty the return value cannot be misinterpreted as an error. And when an +# error occurs the return value provides useful information. +# +# In Ruby we tend to return `nil` when an error occurs or else we raise an +# exception. Both of these idioms are problematic. Returning `nil` is +# ambiguous because `nil` may also be a valid value. It also lacks +# information pertaining to the nature of the error. Raising an exception +# is both expensive and usurps the normal flow of control. All of these +# problems can be solved with the use of a `Maybe`. +# +# A `Maybe` is unambiguous with regard to whether or not it contains a value. +# When `Just` it contains a value, when `Nothing` it does not. When `Just` +# the value it contains may be `nil`, which is perfectly valid. When +# `Nothing` the reason for the lack of a value is contained as well. The +# previous Erlang example can be duplicated in Ruby in a principled way by +# having functions return `Maybe` objects: +# +# ```ruby +# result = MyFileUtils.consult("data.dat") # returns a Maybe +# if result.just? +# do_something_useful(result.value) # or result.just +# else +# logger.error(result.reason) # or result.nothing +# end +# ``` +# +# @example Returning a Maybe from a Function +# module MyFileUtils +# def self.consult(path) +# file = File.open(path, 'r') +# Concurrent::Maybe.just(file.read) +# rescue => ex +# return Concurrent::Maybe.nothing(ex) +# ensure +# file.close if file +# end +# end +# +# maybe = MyFileUtils.consult('bogus.file') +# maybe.just? #=> false +# maybe.nothing? #=> true +# maybe.reason #=> # +# +# maybe = MyFileUtils.consult('README.md') +# maybe.just? #=> true +# maybe.nothing? #=> false +# maybe.value #=> "# Concurrent Ruby\n[![Gem Version..." +# +# @example Using Maybe with a Block +# result = Concurrent::Maybe.from do +# Client.find(10) # Client is an ActiveRecord model +# end +# +# # -- if the record was found +# result.just? #=> true +# result.value #=> # +# +# # -- if the record was not found +# result.just? #=> false +# result.reason #=> ActiveRecord::RecordNotFound +# +# @example Using Maybe with the Null Object Pattern +# # In a Rails controller... +# result = ClientService.new(10).find # returns a Maybe +# render json: result.or(NullClient.new) +# +# @see https://hackage.haskell.org/package/base-4.2.0.1/docs/Data-Maybe.html Haskell Data.Maybe +# @see https://github.com/purescript/purescript-maybe/blob/master/docs/Data.Maybe.md PureScript Data.Maybe +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:104 +class Concurrent::Maybe < ::Concurrent::Synchronization::Object + include ::Comparable + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `Maybe` with the given attributes. + # + # @param [Object] just The value when `Just` else `NONE`. + # @param [Exception, Object] nothing The exception when `Nothing` else `NONE`. + # + # @return [Maybe] The new `Maybe`. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:224 + def initialize(just, nothing); end + + # Comparison operator. + # + # @return [Integer] 0 if self and other are both `Nothing`; + # -1 if self is `Nothing` and other is `Just`; + # 1 if self is `Just` and other is nothing; + # `self.just <=> other.just` if both self and other are `Just`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:199 + def <=>(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:179 + def fulfilled?; end + + # The value of a `Maybe` when `Just`. Will be `NONE` when `Nothing`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:114 + def just; end + + # Is this `Maybe` a `Just` (successfully fulfilled with a value)? + # + # @return [Boolean] True if `Just` or false if `Nothing`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:176 + def just?; end + + # The reason for the `Maybe` when `Nothing`. Will be `NONE` when `Just`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:117 + def nothing; end + + # Is this `Maybe` a `nothing` (rejected with an exception upon fulfillment)? + # + # @return [Boolean] True if `Nothing` or false if `Just`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:184 + def nothing?; end + + # Return either the value of self or the given default value. + # + # @return [Object] The value of self when `Just`; else the given default. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:210 + def or(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:191 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:187 + def rejected?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:189 + def value; end + + class << self + # Create a new `Maybe` using the given block. + # + # Runs the given block passing all function arguments to the block as block + # arguments. If the block runs to completion without raising an exception + # a new `Just` is created with the value set to the return value of the + # block. If the block raises an exception a new `Nothing` is created with + # the reason being set to the raised exception. + # + # @param [Array] args Zero or more arguments to pass to the block. + # @yield The block from which to create a new `Maybe`. + # @yieldparam [Array] args Zero or more block arguments passed as + # arguments to the function. + # + # @return [Maybe] The newly created object. + # + # @raise [ArgumentError] when no block given. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:137 + def from(*args); end + + # Create a new `Just` with the given value. + # + # @param [Object] value The value to set for the new `Maybe` object. + # + # @return [Maybe] The newly created object. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:152 + def just(value); end + + # Create a new `Nothing` with the given (optional) reason. + # + # @param [Exception] error The reason to set for the new `Maybe` object. + # When given a string a new `StandardError` will be created with the + # argument as the message. When no argument is given a new + # `StandardError` with an empty message will be created. + # + # @return [Maybe] The newly created object. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:164 + def nothing(error = T.unsafe(nil)); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:119 + def new(*args, &block); end + end +end + +# Indicates that the given attribute has not been set. +# When `Just` the {#nothing} getter will return `NONE`. +# When `Nothing` the {#just} getter will return `NONE`. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:111 +Concurrent::Maybe::NONE = T.let(T.unsafe(nil), Object) + +# Raised when an attempt is made to modify an immutable object +# (such as an `IVar`) after its final state has been set. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:33 +class Concurrent::MultipleAssignmentError < ::Concurrent::Error + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:36 + def initialize(message = T.unsafe(nil), inspection_data = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:41 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:34 + def inspection_data; end +end + +# Aggregates multiple exceptions. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:58 +class Concurrent::MultipleErrors < ::Concurrent::Error + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:61 + def initialize(errors, message = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:59 + def errors; end +end + +# An thread-safe variation of Ruby's standard `Struct`. Values can be set at +# construction or safely changed at any time during the object's lifecycle. +# +# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct` +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:10 +module Concurrent::MutableStruct + include ::Concurrent::Synchronization::AbstractStruct + + # @!macro struct_equality + # + # Equality + # + # @return [Boolean] true if other has the same struct subclass and has + # equal member values (according to `Object#==`) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:128 + def ==(other); end + + # @!macro struct_get + # + # Attribute Reference + # + # @param [Symbol, String, Integer] member the string or symbol name of the member + # for which to obtain the value or the member's index + # + # @return [Object] the value of the given struct member or the member at the given index. + # + # @raise [NameError] if the member does not exist + # @raise [IndexError] if the index is out of range. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:118 + def [](member); end + + # @!macro struct_set + # + # Attribute Assignment + # + # Sets the value of the given struct member or the member at the given index. + # + # @param [Symbol, String, Integer] member the string or symbol name of the member + # for which to obtain the value or the member's index + # + # @return [Object] the value of the given struct member or the member at the given index. + # + # @raise [NameError] if the name does not exist + # @raise [IndexError] if the index is out of range. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:185 + def []=(member, value); end + + # @!macro struct_each + # + # Yields the value of each struct member in order. If no block is given + # an enumerator is returned. + # + # @yield the operation to be performed on each struct member + # @yieldparam [Object] value each struct value (in order) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:139 + def each(&block); end + + # @!macro struct_each_pair + # + # Yields the name and value of each struct member in order. If no block is + # given an enumerator is returned. + # + # @yield the operation to be performed on each struct member/value pair + # @yieldparam [Object] member each struct member (in order) + # @yieldparam [Object] value each struct value (in order) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:152 + def each_pair(&block); end + + # @!macro struct_inspect + # + # Describe the contents of this struct in a string. + # + # @return [String] the contents of this struct in a string + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:72 + def inspect; end + + # @!macro struct_merge + # + # Returns a new struct containing the contents of `other` and the contents + # of `self`. If no block is specified, the value for entries with duplicate + # keys will be that of `other`. Otherwise the value for each duplicate key + # is determined by calling the block with the key, its value in `self` and + # its value in `other`. + # + # @param [Hash] other the hash from which to set the new values + # @yield an options block for resolving duplicate keys + # @yieldparam [String, Symbol] member the name of the member which is duplicated + # @yieldparam [Object] selfvalue the value of the member in `self` + # @yieldparam [Object] othervalue the value of the member in `other` + # + # @return [Synchronization::AbstractStruct] a new struct with the new values + # + # @raise [ArgumentError] of given a member that is not defined in the struct + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:94 + def merge(other, &block); end + + # @!macro struct_select + # + # Yields each member value from the struct to the block and returns an Array + # containing the member values from the struct for which the given block + # returns a true value (equivalent to `Enumerable#select`). + # + # @yield the operation to be performed on each struct member + # @yieldparam [Object] value each struct value (in order) + # + # @return [Array] an array containing each value for which the block returns true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:167 + def select(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:54 + def to_a; end + + # @!macro struct_to_h + # + # Returns a hash containing the names and values for the struct’s members. + # + # @return [Hash] the names and values for the struct’s members + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:103 + def to_h; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:75 + def to_s; end + + # @!macro struct_values + # + # Returns the values for this struct as an Array. + # + # @return [Array] the values for this struct + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:51 + def values; end + + # @!macro struct_values_at + # + # Returns the struct member values for each selector as an Array. + # + # A selector may be either an Integer offset or a Range of offsets (as in `Array#values_at`). + # + # @param [Fixnum, Range] indexes the index(es) from which to obatin the values (in order) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:63 + def values_at(*indexes); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:202 + def initialize_copy(original); end + + class << self + # @!macro struct_new + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:210 + def new(*args, &block); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:220 +Concurrent::MutableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) + +# @!macro atomic_boolean +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:8 +class Concurrent::MutexAtomicBoolean + extend ::Concurrent::Synchronization::SafeInitialization + + # @!macro atomic_boolean_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:12 + def initialize(initial = T.unsafe(nil)); end + + # @!macro atomic_boolean_method_false_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:34 + def false?; end + + # @!macro atomic_boolean_method_make_false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:44 + def make_false; end + + # @!macro atomic_boolean_method_make_true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:39 + def make_true; end + + # @!macro atomic_boolean_method_true_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:29 + def true?; end + + # @!macro atomic_boolean_method_value_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:19 + def value; end + + # @!macro atomic_boolean_method_value_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:24 + def value=(value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:51 + def synchronize; end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:62 + def ns_make_value(value); end +end + +# @!macro atomic_fixnum +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:9 +class Concurrent::MutexAtomicFixnum + extend ::Concurrent::Synchronization::SafeInitialization + + # @!macro atomic_fixnum_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:13 + def initialize(initial = T.unsafe(nil)); end + + # @!macro atomic_fixnum_method_compare_and_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:44 + def compare_and_set(expect, update); end + + # @!macro atomic_fixnum_method_decrement + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:37 + def decrement(delta = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:41 + def down(delta = T.unsafe(nil)); end + + # @!macro atomic_fixnum_method_increment + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:30 + def increment(delta = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:34 + def up(delta = T.unsafe(nil)); end + + # @!macro atomic_fixnum_method_update + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:56 + def update; end + + # @!macro atomic_fixnum_method_value_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:20 + def value; end + + # @!macro atomic_fixnum_method_value_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:25 + def value=(value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:65 + def synchronize; end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:76 + def ns_set(value); end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:9 +class Concurrent::MutexAtomicReference + include ::Concurrent::AtomicDirectUpdate + include ::Concurrent::AtomicNumericCompareAndSetWrapper + extend ::Concurrent::Synchronization::SafeInitialization + + # @!macro atomic_reference_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:16 + def initialize(value = T.unsafe(nil)); end + + # @!macro atomic_reference_method_compare_and_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:45 + def _compare_and_set(old_value, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:13 + def compare_and_swap(old_value, new_value); end + + # @!macro atomic_reference_method_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:23 + def get; end + + # @!macro atomic_reference_method_get_and_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:35 + def get_and_set(new_value); end + + # @!macro atomic_reference_method_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:29 + def set(new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:42 + def swap(new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:26 + def value; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:32 + def value=(new_value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:59 + def synchronize; end +end + +# @!macro count_down_latch +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:9 +class Concurrent::MutexCountDownLatch < ::Concurrent::Synchronization::LockableObject + # @!macro count_down_latch_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:12 + def initialize(count = T.unsafe(nil)); end + + # @!macro count_down_latch_method_count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:34 + def count; end + + # @!macro count_down_latch_method_count_down + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:26 + def count_down; end + + # @!macro count_down_latch_method_wait + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:21 + def wait(timeout = T.unsafe(nil)); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:40 + def ns_initialize(count); end +end + +# @!macro semaphore +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:9 +class Concurrent::MutexSemaphore < ::Concurrent::Synchronization::LockableObject + # @!macro semaphore_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:12 + def initialize(count); end + + # @!macro semaphore_method_acquire + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:20 + def acquire(permits = T.unsafe(nil)); end + + # @!macro semaphore_method_available_permits + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:38 + def available_permits; end + + # @!macro semaphore_method_drain_permits + # + # Acquires and returns all permits that are immediately available. + # + # @return [Integer] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:47 + def drain_permits; end + + # Shrinks the number of available permits by the indicated reduction. + # + # @param [Fixnum] reduction Number of permits to remove. + # + # @raise [ArgumentError] if `reduction` is not an integer or is negative + # + # @raise [ArgumentError] if `@free` - `@reduction` is less than zero + # + # @return [nil] + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:99 + def reduce_permits(reduction); end + + # @!macro semaphore_method_release + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:77 + def release(permits = T.unsafe(nil)); end + + # @!macro semaphore_method_try_acquire + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:54 + def try_acquire(permits = T.unsafe(nil), timeout = T.unsafe(nil)); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:110 + def ns_initialize(count); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:117 + def try_acquire_now(permits); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:127 + def try_acquire_timed(permits, timeout); end +end + +# Various classes within allows for +nil+ values to be stored, +# so a special +NULL+ token is required to indicate the "nil-ness". +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/constants.rb:6 +Concurrent::NULL = T.let(T.unsafe(nil), Object) + +# Suppresses all output when used for logging. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:108 +Concurrent::NULL_LOGGER = T.let(T.unsafe(nil), Proc) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/options.rb:6 +module Concurrent::Options + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/options.rb:27 + def executor(executor_identifier); end + + # Get the requested `Executor` based on the values set in the options hash. + # + # @param [Hash] opts the options defining the requested executor + # @option opts [Executor] :executor when set use the given `Executor` instance. + # Three special values are also supported: `:fast` returns the global fast executor, + # `:io` returns the global io executor, and `:immediate` returns a new + # `ImmediateExecutor` object. + # + # @return [Executor, nil] the requested thread pool, or nil when no option specified + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/options.rb:19 + def executor_from_options(opts = T.unsafe(nil)); end + end +end + +# Promises are inspired by the JavaScript [Promises/A](http://wiki.commonjs.org/wiki/Promises/A) +# and [Promises/A+](http://promises-aplus.github.io/promises-spec/) specifications. +# +# > A promise represents the eventual value returned from the single +# > completion of an operation. +# +# Promises are similar to futures and share many of the same behaviours. +# Promises are far more robust, however. Promises can be chained in a tree +# structure where each promise may have zero or more children. Promises are +# chained using the `then` method. The result of a call to `then` is always +# another promise. Promises are resolved asynchronously (with respect to the +# main thread) but in a strict order: parents are guaranteed to be resolved +# before their children, children before their younger siblings. The `then` +# method takes two parameters: an optional block to be executed upon parent +# resolution and an optional callable to be executed upon parent failure. The +# result of each promise is passed to each of its children upon resolution. +# When a promise is rejected all its children will be summarily rejected and +# will receive the reason. +# +# Promises have several possible states: *:unscheduled*, *:pending*, +# *:processing*, *:rejected*, or *:fulfilled*. These are also aggregated as +# `#incomplete?` and `#complete?`. When a Promise is created it is set to +# *:unscheduled*. Once the `#execute` method is called the state becomes +# *:pending*. Once a job is pulled from the thread pool's queue and is given +# to a thread for processing (often immediately upon `#post`) the state +# becomes *:processing*. The future will remain in this state until processing +# is complete. A future that is in the *:unscheduled*, *:pending*, or +# *:processing* is considered `#incomplete?`. A `#complete?` Promise is either +# *:rejected*, indicating that an exception was thrown during processing, or +# *:fulfilled*, indicating success. If a Promise is *:fulfilled* its `#value` +# will be updated to reflect the result of the operation. If *:rejected* the +# `reason` will be updated with a reference to the thrown exception. The +# predicate methods `#unscheduled?`, `#pending?`, `#rejected?`, and +# `#fulfilled?` can be called at any time to obtain the state of the Promise, +# as can the `#state` method, which returns a symbol. +# +# Retrieving the value of a promise is done through the `value` (alias: +# `deref`) method. Obtaining the value of a promise is a potentially blocking +# operation. When a promise is *rejected* a call to `value` will return `nil` +# immediately. When a promise is *fulfilled* a call to `value` will +# immediately return the current value. When a promise is *pending* a call to +# `value` will block until the promise is either *rejected* or *fulfilled*. A +# *timeout* value can be passed to `value` to limit how long the call will +# block. If `nil` the call will block indefinitely. If `0` the call will not +# block. Any other integer or float value will indicate the maximum number of +# seconds to block. +# +# Promises run on the global thread pool. +# +# @!macro copy_options +# +# ### Examples +# +# Start by requiring promises +# +# ```ruby +# require 'concurrent/promise' +# ``` +# +# Then create one +# +# ```ruby +# p = Concurrent::Promise.execute do +# # do something +# 42 +# end +# ``` +# +# Promises can be chained using the `then` method. The `then` method accepts a +# block and an executor, to be executed on fulfillment, and a callable argument to be executed +# on rejection. The result of the each promise is passed as the block argument +# to chained promises. +# +# ```ruby +# p = Concurrent::Promise.new{10}.then{|x| x * 2}.then{|result| result - 10 }.execute +# ``` +# +# And so on, and so on, and so on... +# +# ```ruby +# p = Concurrent::Promise.fulfill(20). +# then{|result| result - 10 }. +# then{|result| result * 3 }. +# then(executor: different_executor){|result| result % 5 }.execute +# ``` +# +# The initial state of a newly created Promise depends on the state of its parent: +# - if parent is *unscheduled* the child will be *unscheduled* +# - if parent is *pending* the child will be *pending* +# - if parent is *fulfilled* the child will be *pending* +# - if parent is *rejected* the child will be *pending* (but will ultimately be *rejected*) +# +# Promises are executed asynchronously from the main thread. By the time a +# child Promise finishes initialization it may be in a different state than its +# parent (by the time a child is created its parent may have completed +# execution and changed state). Despite being asynchronous, however, the order +# of execution of Promise objects in a chain (or tree) is strictly defined. +# +# There are multiple ways to create and execute a new `Promise`. Both ways +# provide identical behavior: +# +# ```ruby +# # create, operate, then execute +# p1 = Concurrent::Promise.new{ "Hello World!" } +# p1.state #=> :unscheduled +# p1.execute +# +# # create and immediately execute +# p2 = Concurrent::Promise.new{ "Hello World!" }.execute +# +# # execute during creation +# p3 = Concurrent::Promise.execute{ "Hello World!" } +# ``` +# +# Once the `execute` method is called a `Promise` becomes `pending`: +# +# ```ruby +# p = Concurrent::Promise.execute{ "Hello, world!" } +# p.state #=> :pending +# p.pending? #=> true +# ``` +# +# Wait a little bit, and the promise will resolve and provide a value: +# +# ```ruby +# p = Concurrent::Promise.execute{ "Hello, world!" } +# sleep(0.1) +# +# p.state #=> :fulfilled +# p.fulfilled? #=> true +# p.value #=> "Hello, world!" +# ``` +# +# If an exception occurs, the promise will be rejected and will provide +# a reason for the rejection: +# +# ```ruby +# p = Concurrent::Promise.execute{ raise StandardError.new("Here comes the Boom!") } +# sleep(0.1) +# +# p.state #=> :rejected +# p.rejected? #=> true +# p.reason #=> "#" +# ``` +# +# #### Rejection +# +# When a promise is rejected all its children will be rejected and will +# receive the rejection `reason` as the rejection callable parameter: +# +# ```ruby +# p = Concurrent::Promise.execute { Thread.pass; raise StandardError } +# +# c1 = p.then(-> reason { 42 }) +# c2 = p.then(-> reason { raise 'Boom!' }) +# +# c1.wait.state #=> :fulfilled +# c1.value #=> 42 +# c2.wait.state #=> :rejected +# c2.reason #=> # +# ``` +# +# Once a promise is rejected it will continue to accept children that will +# receive immediately rejection (they will be executed asynchronously). +# +# #### Aliases +# +# The `then` method is the most generic alias: it accepts a block to be +# executed upon parent fulfillment and a callable to be executed upon parent +# rejection. At least one of them should be passed. The default block is `{ +# |result| result }` that fulfills the child with the parent value. The +# default callable is `{ |reason| raise reason }` that rejects the child with +# the parent reason. +# +# - `on_success { |result| ... }` is the same as `then {|result| ... }` +# - `rescue { |reason| ... }` is the same as `then(Proc.new { |reason| ... } )` +# - `rescue` is aliased by `catch` and `on_error` +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:190 +class Concurrent::Promise < ::Concurrent::IVar + # Initialize a new Promise with the provided options. + # + # @!macro executor_and_deref_options + # + # @!macro promise_init_options + # + # @option opts [Promise] :parent the parent `Promise` when building a chain/tree + # @option opts [Proc] :on_fulfill fulfillment handler + # @option opts [Proc] :on_reject rejection handler + # @option opts [object, Array] :args zero or more arguments to be passed + # the task block on execution + # + # @yield The block operation to be performed asynchronously. + # + # @raise [ArgumentError] if no block is given + # + # @see http://wiki.commonjs.org/wiki/Promises/A + # @see http://promises-aplus.github.io/promises-spec/ + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:210 + def initialize(opts = T.unsafe(nil), &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:364 + def catch(&block); end + + # Execute an `:unscheduled` `Promise`. Immediately sets the state to `:pending` and + # passes the block to a new thread/thread pool for eventual execution. + # Does nothing if the `Promise` is in any state other than `:unscheduled`. + # + # @return [Promise] a reference to `self` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:246 + def execute; end + + # @!macro ivar_fail_method + # + # @raise [Concurrent::PromiseExecutionError] if not the root promise + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:278 + def fail(reason = T.unsafe(nil)); end + + # Yield the successful result to the block that returns a promise. If that + # promise is also successful the result is the result of the yielded promise. + # If either part fails the whole also fails. + # + # @example + # Promise.execute { 1 }.flat_map { |v| Promise.execute { v + 2 } }.value! #=> 3 + # + # @return [Promise] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:375 + def flat_map(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:365 + def on_error(&block); end + + # Chain onto this promise an action to be undertaken on success + # (fulfillment). + # + # @yield The block to execute + # + # @return [Promise] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:349 + def on_success(&block); end + + # Chain onto this promise an action to be undertaken on failure + # (rejection). + # + # @yield The block to execute + # + # @return [Promise] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:360 + def rescue(&block); end + + # @!macro ivar_set_method + # + # @raise [Concurrent::PromiseExecutionError] if not the root promise + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:262 + def set(value = T.unsafe(nil), &block); end + + # Chain a new promise off the current promise. + # + # @return [Promise] the new promise + # @yield The block operation to be performed asynchronously. + # @overload then(rescuer, executor, &block) + # @param [Proc] rescuer An optional rescue block to be executed if the + # promise is rejected. + # @param [ThreadPool] executor An optional thread pool executor to be used + # in the new Promise + # @overload then(rescuer, executor: executor, &block) + # @param [Proc] rescuer An optional rescue block to be executed if the + # promise is rejected. + # @param [ThreadPool] executor An optional thread pool executor to be used + # in the new Promise + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:314 + def then(*args, &block); end + + # Builds a promise that produces the result of self and others in an Array + # and fails if any of them fails. + # + # @overload zip(*promises) + # @param [Array] others + # + # @overload zip(*promises, opts) + # @param [Array] others + # @param [Hash] opts the configuration options + # @option opts [Executor] :executor (ImmediateExecutor.new) when set use the given `Executor` instance. + # @option opts [Boolean] :execute (true) execute promise before returning + # + # @return [Promise] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:440 + def zip(*others); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:551 + def complete(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:545 + def notify_child(child); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:481 + def ns_initialize(value, opts); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:533 + def on_fulfill(result); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:539 + def on_reject(reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:562 + def realize(task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:528 + def root?; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:520 + def set_pending; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:570 + def set_state!(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:576 + def synchronized_set_state!(success, value, reason); end + + class << self + # Aggregate a collection of zero or more promises under a composite promise, + # execute the aggregated promises and collect them into a standard Ruby array, + # call the given Ruby `Ennnumerable` predicate (such as `any?`, `all?`, `none?`, + # or `one?`) on the collection checking for the success or failure of each, + # then executing the composite's `#then` handlers if the predicate returns + # `true` or executing the composite's `#rescue` handlers if the predicate + # returns false. + # + # @!macro promise_self_aggregate + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:505 + def aggregate(method, *promises); end + + # Aggregates a collection of promises and executes the `then` condition + # if all aggregated promises succeed. Executes the `rescue` handler with + # a `Concurrent::PromiseExecutionError` if any of the aggregated promises + # fail. Upon execution will execute any of the aggregate promises that + # were not already executed. + # + # @!macro promise_self_aggregate + # + # The returned promise will not yet have been executed. Additional `#then` + # and `#rescue` handlers may still be provided. Once the returned promise + # is execute the aggregate promises will be also be executed (if they have + # not been executed already). The results of the aggregate promises will + # be checked upon completion. The necessary `#then` and `#rescue` blocks + # on the aggregating promise will then be executed as appropriate. If the + # `#rescue` handlers are executed the raises exception will be + # `Concurrent::PromiseExecutionError`. + # + # @param [Array] promises Zero or more promises to aggregate + # @return [Promise] an unscheduled (not executed) promise that aggregates + # the promises given as arguments + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:464 + def all?(*promises); end + + # Aggregates a collection of promises and executes the `then` condition + # if any aggregated promises succeed. Executes the `rescue` handler with + # a `Concurrent::PromiseExecutionError` if any of the aggregated promises + # fail. Upon execution will execute any of the aggregate promises that + # were not already executed. + # + # @!macro promise_self_aggregate + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:475 + def any?(*promises); end + + # Create a new `Promise` object with the given block, execute it, and return the + # `:pending` object. + # + # @!macro executor_and_deref_options + # + # @!macro promise_init_options + # + # @return [Promise] the newly created `Promise` in the `:pending` state + # + # @raise [ArgumentError] if no block is given + # + # @example + # promise = Concurrent::Promise.execute{ sleep(1); 42 } + # promise.state #=> :pending + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:296 + def execute(opts = T.unsafe(nil), &block); end + + # Create a new `Promise` and fulfill it immediately. + # + # @!macro executor_and_deref_options + # + # @!macro promise_init_options + # + # @raise [ArgumentError] if no block is given + # + # @return [Promise] the newly created `Promise` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:224 + def fulfill(value, opts = T.unsafe(nil)); end + + # Create a new `Promise` and reject it immediately. + # + # @!macro executor_and_deref_options + # + # @!macro promise_init_options + # + # @raise [ArgumentError] if no block is given + # + # @return [Promise] the newly created `Promise` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:237 + def reject(reason, opts = T.unsafe(nil)); end + + # Builds a promise that produces the result of promises in an Array + # and fails if any of them fails. + # + # @overload zip(*promises) + # @param [Array] promises + # + # @overload zip(*promises, opts) + # @param [Array] promises + # @param [Hash] opts the configuration options + # @option opts [Executor] :executor (ImmediateExecutor.new) when set use the given `Executor` instance. + # @option opts [Boolean] :execute (true) execute promise before returning + # + # @return [Promise] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:409 + def zip(*promises); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:11 +class Concurrent::PromiseExecutionError < ::StandardError; end + +# {include:file:docs-source/promises-main.md} +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:13 +module Concurrent::Promises + extend ::Concurrent::Promises::FactoryMethods::Configuration + extend ::Concurrent::Promises::FactoryMethods +end + +# @abstract +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2047 +class Concurrent::Promises::AbstractAnyPromise < ::Concurrent::Promises::BlockedPromise; end + +# Common ancestor of {Event} and {Future} classes, many shared methods are defined here. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:513 +class Concurrent::Promises::AbstractEventFuture < ::Concurrent::Synchronization::Object + include ::Concurrent::Promises::InternalStates + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:522 + def initialize(promise, default_executor); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def __initialize_atomic_fields__; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:738 + def add_callback_clear_delayed_node(node); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:733 + def add_callback_notify_blocked(promise, index); end + + # For inspection. + # @!visibility private + # @return [Array] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:702 + def blocks; end + + # For inspection. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:710 + def callbacks; end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:596 + def chain(*args, &task); end + + # Chains the task to be executed asynchronously on executor after it is resolved. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @return [Future] + # @!macro promise.param.task-future + # + # @overload an_event.chain_on(executor, *args, &task) + # @yield [*args] to the task. + # @overload a_future.chain_on(executor, *args, &task) + # @yield [fulfilled, value, reason, *args] to the task. + # @yieldparam [true, false] fulfilled + # @yieldparam [Object] value + # @yieldparam [Object] reason + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:614 + def chain_on(executor, *args, &task); end + + # Resolves the resolvable when receiver is resolved. + # + # @param [Resolvable] resolvable + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:629 + def chain_resolvable(resolvable); end + + # Returns default executor. + # @return [Executor] default executor + # @see #with_default_executor + # @see FactoryMethods#future_on + # @see FactoryMethods#resolvable_future + # @see FactoryMethods#any_fulfilled_future_on + # @see similar + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:590 + def default_executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:623 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def internal_state; end + + # @!macro promises.shortcut.using + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:637 + def on_resolution(*args, &callback); end + + # Stores the callback to be executed synchronously on resolving thread after it is + # resolved. + # + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # + # @overload an_event.on_resolution!(*args, &callback) + # @yield [*args] to the callback. + # @overload a_future.on_resolution!(*args, &callback) + # @yield [fulfilled, value, reason, *args] to the callback. + # @yieldparam [true, false] fulfilled + # @yieldparam [Object] value + # @yieldparam [Object] reason + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:655 + def on_resolution!(*args, &callback); end + + # Stores the callback to be executed asynchronously on executor after it is resolved. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # + # @overload an_event.on_resolution_using(executor, *args, &callback) + # @yield [*args] to the callback. + # @overload a_future.on_resolution_using(executor, *args, &callback) + # @yield [fulfilled, value, reason, *args] to the callback. + # @yieldparam [true, false] fulfilled + # @yieldparam [Object] value + # @yieldparam [Object] reason + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:673 + def on_resolution_using(executor, *args, &callback); end + + # Is it in pending state? + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:549 + def pending?; end + + # For inspection. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:716 + def promise; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:688 + def resolve_with(state, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Is it in resolved state? + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:555 + def resolved?; end + + # Returns its state. + # @return [Symbol] + # + # @overload an_event.state + # @return [:pending, :resolved] + # @overload a_future.state + # Both :fulfilled, :rejected implies :resolved. + # @return [:pending, :fulfilled, :rejected] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:543 + def state; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:633 + def tangle(resolvable); end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:619 + def to_s; end + + # Propagates touch. Requests all the delayed futures, which it depends on, to be + # executed. This method is called by any other method requiring resolved state, like {#wait}. + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:562 + def touch; end + + # For inspection. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:722 + def touched?; end + + # @!macro promises.method.wait + # Wait (block the Thread) until receiver is {#resolved?}. + # @!macro promises.touches + # + # @!macro promises.warn.blocks + # @!macro promises.param.timeout + # @return [self, true, false] self implies timeout was not used, true implies timeout was used + # and it was resolved, false implies it was not resolved within timeout. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:578 + def wait(timeout = T.unsafe(nil)); end + + # For inspection. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:728 + def waiting_threads; end + + # @!macro promises.method.with_default_executor + # Crates new object with same class with the executor set as its new default executor. + # Any futures depending on it will use the new default executor. + # @!macro promises.shortcut.event-future + # @abstract + # @return [AbstractEventFuture] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:683 + def with_default_executor(executor); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:743 + def with_hidden_resolvable; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:750 + def add_callback(method, *args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:812 + def async_callback_on_resolution(state, executor, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:796 + def call_callback(method, state, args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:800 + def call_callbacks(state); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:763 + def callback_clear_delayed_node(state, node); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:818 + def callback_notify_blocked(state, promise, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def compare_and_set_internal_state(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def internal_state=(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def swap_internal_state(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def update_internal_state(&block); end + + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:768 + def wait_until_resolved(timeout); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:808 + def with_async(executor, *args, &block); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1796 +class Concurrent::Promises::AbstractFlatPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1798 + def initialize(delayed_because, blockers_count, event_or_future); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1808 + def touch; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1828 + def add_delayed_of(future); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1820 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1824 + def resolvable?(countdown, future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1816 + def touched?; end +end + +# @abstract +# @private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1549 +class Concurrent::Promises::AbstractPromise < ::Concurrent::Synchronization::Object + include ::Concurrent::Promises::InternalStates + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1553 + def initialize(future); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1564 + def default_executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1581 + def delayed_because; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1562 + def event; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1558 + def future; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1579 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1568 + def state; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1575 + def to_s; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1572 + def touch; end + + private + + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1592 + def evaluate_to(*args, block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1587 + def resolve_with(new_state, raise_on_reassign = T.unsafe(nil)); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2084 +class Concurrent::Promises::AnyFulfilledFuturePromise < ::Concurrent::Promises::AnyResolvedFuturePromise + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2088 + def resolvable?(countdown, event_or_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2050 +class Concurrent::Promises::AnyResolvedEventPromise < ::Concurrent::Promises::AbstractAnyPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2054 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2062 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2058 + def resolvable?(countdown, future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2067 +class Concurrent::Promises::AnyResolvedFuturePromise < ::Concurrent::Promises::AbstractAnyPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2071 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2079 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2075 + def resolvable?(countdown, future, index); end +end + +# @abstract +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1619 +class Concurrent::Promises::BlockedPromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1661 + def initialize(delayed, blockers_count, future); end + + # for inspection only + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1683 + def blocked_by; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1674 + def delayed_because; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1667 + def on_blocker_resolution(future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1678 + def touch; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1691 + def clear_and_propagate_touch(stack_or_element = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1710 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1706 + def process_on_blocker_resolution(future, index); end + + # @return [true,false] if resolvable + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1702 + def resolvable?(countdown, future, index); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1652 + def add_delayed(delayed1, delayed2); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1645 + def new_blocked_by(blockers, *args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1623 + def new_blocked_by1(blocker, *args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1630 + def new_blocked_by2(blocker1, blocker2, *args, &block); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1621 + def new(*args, &block); end + end +end + +# @abstract +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1716 +class Concurrent::Promises::BlockedTaskPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1717 + def initialize(delayed, blockers_count, default_executor, executor, args, &task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1725 + def executor; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1766 +class Concurrent::Promises::ChainPromise < ::Concurrent::Promises::BlockedTaskPromise + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1769 + def on_resolvable(resolved_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2095 +class Concurrent::Promises::DelayPromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2097 + def initialize(default_executor); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2108 + def delayed_because; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2104 + def touch; end +end + +# Represents an event which will happen in future (will be resolved). The event is either +# pending or resolved. It should be always resolved. Use {Future} to communicate rejections and +# cancellation. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:826 +class Concurrent::Promises::Event < ::Concurrent::Promises::AbstractEventFuture + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:847 + def &(other); end + + # Creates a new event which will be resolved when the first of receiver, `event_or_future` + # resolves. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:853 + def any(event_or_future); end + + # Creates new event dependent on receiver which will not evaluate until touched, see {#touch}. + # In other words, it inserts delay into the chain of Futures making rest of it lazy evaluated. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:863 + def delay; end + + # @!macro promise.method.schedule + # Creates new event dependent on receiver scheduled to execute on/in intended_time. + # In time is interpreted from the moment the receiver is resolved, therefore it inserts + # delay into the chain. + # + # @!macro promises.param.intended_time + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:875 + def schedule(intended_time); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:828 + def then(*args, &task); end + + # Returns self, since this is event + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:893 + def to_event; end + + # Converts event to a future. The future is fulfilled when the event is resolved, the future may never fail. + # + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:885 + def to_future; end + + # @!macro promises.method.with_default_executor + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:899 + def with_default_executor(executor); end + + # @!macro promises.method.zip + # Creates a new event or a future which will be resolved when receiver and other are. + # Returns an event if receiver and other are events, otherwise returns a future. + # If just one of the parties is Future then the result + # of the returned future is equal to the result of the supplied future. If both are futures + # then the result is as described in {FactoryMethods#zip_futures_on}. + # + # @return [Future, Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:839 + def zip(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:857 + def |(event_or_future); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:910 + def callback_on_resolution(state, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:905 + def rejected_resolution(raise_on_reassign, state); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1972 +class Concurrent::Promises::EventWrapperPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1973 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1979 + def on_resolvable(resolved_future, index); end +end + +# Container of all {Future}, {Event} factory methods. They are never constructed directly with +# new. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:46 +module Concurrent::Promises::FactoryMethods + include ::Concurrent::Promises::FactoryMethods::Configuration + extend ::Concurrent::ReInclude + extend ::Concurrent::Promises::FactoryMethods::Configuration + extend ::Concurrent::Promises::FactoryMethods + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:282 + def any(*futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:319 + def any_event(*futures_and_or_events); end + + # Creates a new event which becomes resolved after the first futures_and_or_events resolves. + # @!macro promises.any-touch + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:329 + def any_event_on(default_executor, *futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:300 + def any_fulfilled_future(*futures_and_or_events); end + + # Creates a new future which is resolved after the first futures_and_or_events is fulfilled. + # Its result equals the result of the first resolved future or if all futures_and_or_events reject, + # it has reason of the last rejected future. + # @!macro promises.any-touch + # @!macro promises.event-conversion + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:313 + def any_fulfilled_future_on(default_executor, *futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:278 + def any_resolved_future(*futures_and_or_events); end + + # Creates a new future which is resolved after the first futures_and_or_events is resolved. + # Its result equals the result of the first resolved future. + # @!macro promises.any-touch + # If resolved it does not propagate {Concurrent::AbstractEventFuture#touch}, leaving delayed + # futures un-executed if they are not required any more. + # @!macro promises.event-conversion + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:294 + def any_resolved_future_on(default_executor, *futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Future, Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:190 + def delay(*args, &task); end + + # Creates a new event or future which is resolved only after it is touched, + # see {Concurrent::AbstractEventFuture#touch}. + # + # @!macro promises.param.default_executor + # @overload delay_on(default_executor, *args, &task) + # If task is provided it returns a {Future} representing the result of the task. + # @!macro promises.param.args + # @yield [*args] to the task. + # @!macro promise.param.task-future + # @return [Future] + # @overload delay_on(default_executor) + # If no task is provided, it returns an {Event} + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:207 + def delay_on(default_executor, *args, &task); end + + # Creates a resolved future which will be fulfilled with the given value. + # + # @!macro promises.param.default_executor + # @param [Object] value + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:127 + def fulfilled_future(value, default_executor = T.unsafe(nil)); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:94 + def future(*args, &task); end + + # Constructs a new Future which will be resolved after block is evaluated on default executor. + # Evaluation begins immediately. + # + # @!macro promises.param.default_executor + # @!macro promises.param.args + # @yield [*args] to the task. + # @!macro promise.param.task-future + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:106 + def future_on(default_executor, *args, &task); end + + # General constructor. Behaves differently based on the argument's type. It's provided for convenience + # but it's better to be explicit. + # + # @see rejected_future, resolved_event, fulfilled_future + # @!macro promises.param.default_executor + # @return [Event, Future] + # + # @overload make_future(nil, default_executor = self.default_executor) + # @param [nil] nil + # @return [Event] resolved event. + # + # @overload make_future(a_future, default_executor = self.default_executor) + # @param [Future] a_future + # @return [Future] a future which will be resolved when a_future is. + # + # @overload make_future(an_event, default_executor = self.default_executor) + # @param [Event] an_event + # @return [Event] an event which will be resolved when an_event is. + # + # @overload make_future(exception, default_executor = self.default_executor) + # @param [Exception] exception + # @return [Future] a rejected future with the exception as its reason. + # + # @overload make_future(value, default_executor = self.default_executor) + # @param [Object] value when none of the above overloads fits + # @return [Future] a fulfilled future with the value. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:174 + def make_future(argument = T.unsafe(nil), default_executor = T.unsafe(nil)); end + + # Creates a resolved future which will be rejected with the given reason. + # + # @!macro promises.param.default_executor + # @param [Object] reason + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:136 + def rejected_future(reason, default_executor = T.unsafe(nil)); end + + # @!macro promises.shortcut.on + # @return [ResolvableEvent] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:63 + def resolvable_event; end + + # Creates a resolvable event, user is responsible for resolving the event once + # by calling {Promises::ResolvableEvent#resolve}. + # + # @!macro promises.param.default_executor + # @return [ResolvableEvent] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:72 + def resolvable_event_on(default_executor = T.unsafe(nil)); end + + # @!macro promises.shortcut.on + # @return [ResolvableFuture] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:78 + def resolvable_future; end + + # Creates resolvable future, user is responsible for resolving the future once by + # {Promises::ResolvableFuture#resolve}, {Promises::ResolvableFuture#fulfill}, + # or {Promises::ResolvableFuture#reject} + # + # @!macro promises.param.default_executor + # @return [ResolvableFuture] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:88 + def resolvable_future_on(default_executor = T.unsafe(nil)); end + + # Creates resolved event. + # + # @!macro promises.param.default_executor + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:144 + def resolved_event(default_executor = T.unsafe(nil)); end + + # Creates a resolved future with will be either fulfilled with the given value or rejected with + # the given reason. + # + # @param [true, false] fulfilled + # @param [Object] value + # @param [Object] reason + # @!macro promises.param.default_executor + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:118 + def resolved_future(fulfilled, value, reason, default_executor = T.unsafe(nil)); end + + # @!macro promises.shortcut.on + # @return [Future, Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:214 + def schedule(intended_time, *args, &task); end + + # Creates a new event or future which is resolved in intended_time. + # + # @!macro promises.param.default_executor + # @!macro promises.param.intended_time + # @param [Numeric, Time] intended_time `Numeric` means to run in `intended_time` seconds. + # `Time` means to run on `intended_time`. + # @overload schedule_on(default_executor, intended_time, *args, &task) + # If task is provided it returns a {Future} representing the result of the task. + # @!macro promises.param.args + # @yield [*args] to the task. + # @!macro promise.param.task-future + # @return [Future] + # @overload schedule_on(default_executor, intended_time) + # If no task is provided, it returns an {Event} + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:233 + def schedule_on(default_executor, intended_time, *args, &task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:258 + def zip(*futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:262 + def zip_events(*futures_and_or_events); end + + # Creates a new event which is resolved after all futures_and_or_events are resolved. + # (Future is resolved when fulfilled or rejected.) + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:272 + def zip_events_on(default_executor, *futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:240 + def zip_futures(*futures_and_or_events); end + + # Creates a new future which is resolved after all futures_and_or_events are resolved. + # Its value is an array of zipped future values. Its reason is an array of reasons for rejection. + # If there is an error it rejects. + # @!macro promises.event-conversion + # If event is supplied, which does not have value and can be only resolved, it's + # represented as `:fulfilled` with value `nil`. + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:254 + def zip_futures_on(default_executor, *futures_and_or_events); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:50 +module Concurrent::Promises::FactoryMethods::Configuration + # @return [Executor, :io, :fast] the executor which is used when none is supplied + # to a factory method. The method can be overridden in the receivers of + # `include FactoryMethod` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:54 + def default_executor; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1840 +class Concurrent::Promises::FlatEventPromise < ::Concurrent::Promises::AbstractFlatPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1844 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1848 + def process_on_blocker_resolution(future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1873 +class Concurrent::Promises::FlatFuturePromise < ::Concurrent::Promises::AbstractFlatPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1877 + def initialize(delayed, blockers_count, levels, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1884 + def process_on_blocker_resolution(future, index); end +end + +# Represents a value which will become available in future. May reject with a reason instead, +# e.g. when the tasks raises an exception. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:917 +class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1078 + def &(other); end + + # Creates a new event which will be resolved when the first of receiver, `event_or_future` + # resolves. Returning future will have value nil if event_or_future is event and resolves + # first. + # + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1085 + def any(event_or_future); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1215 + def apply(args, block); end + + # Creates new future dependent on receiver which will not evaluate until touched, see {#touch}. + # In other words, it inserts delay into the chain of Futures making rest of it lazy evaluated. + # + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1095 + def delay; end + + # Allows rejected Future to be risen with `raise` method. + # If the reason is not an exception `Runtime.new(reason)` is returned. + # + # @example + # raise Promises.rejected_future(StandardError.new("boom")) + # raise Promises.rejected_future("or just boom") + # @raise [Concurrent::Error] when raising not rejected future + # @return [Exception] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1013 + def exception(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1124 + def flat(level = T.unsafe(nil)); end + + # Creates new event which will be resolved when the returned event by receiver is. + # Be careful if the receiver rejects it will just resolve since Event does not hold reason. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1130 + def flat_event; end + + # Creates new future which will have result of the future returned by receiver. If receiver + # rejects it will have its rejection. + # + # @param [Integer] level how many levels of futures should flatten + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1120 + def flat_future(level = T.unsafe(nil)); end + + # Is it in fulfilled state? + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:921 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1243 + def inspect; end + + # @!macro promises.shortcut.using + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1136 + def on_fulfillment(*args, &callback); end + + # Stores the callback to be executed synchronously on resolving thread after it is + # fulfilled. Does nothing on rejection. + # + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # @yield [value, *args] to the callback. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1147 + def on_fulfillment!(*args, &callback); end + + # Stores the callback to be executed asynchronously on executor after it is + # fulfilled. Does nothing on rejection. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # @yield [value, *args] to the callback. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1159 + def on_fulfillment_using(executor, *args, &callback); end + + # @!macro promises.shortcut.using + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1165 + def on_rejection(*args, &callback); end + + # Stores the callback to be executed synchronously on resolving thread after it is + # rejected. Does nothing on fulfillment. + # + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # @yield [reason, *args] to the callback. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1176 + def on_rejection!(*args, &callback); end + + # Stores the callback to be executed asynchronously on executor after it is + # rejected. Does nothing on fulfillment. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # @yield [reason, *args] to the callback. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1188 + def on_rejection_using(executor, *args, &callback); end + + # Returns reason of future's rejection. + # @!macro promises.touches + # + # @!macro promises.warn.blocks + # @!macro promises.warn.nil + # @!macro promises.param.timeout + # @!macro promises.param.timeout_value + # @return [Object, timeout_value] the reason, or timeout_value on timeout, or nil on fulfillment. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:966 + def reason(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end + + # Is it in rejected state? + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:928 + def rejected?; end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1052 + def rescue(*args, &task); end + + # Chains the task to be executed asynchronously on executor after it rejects. Does not run + # the task if it fulfills. It will resolve though, triggering any dependent futures. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.task-future + # @return [Future] + # @yield [reason, *args] to the task. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1064 + def rescue_on(executor, *args, &task); end + + # Returns triplet fulfilled?, value, reason. + # @!macro promises.touches + # + # @!macro promises.warn.blocks + # @!macro promises.param.timeout + # @return [Array(Boolean, Object, Object), nil] triplet of fulfilled?, value, reason, or nil + # on timeout. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:981 + def result(timeout = T.unsafe(nil)); end + + # Allows to use futures as green threads. The receiver has to evaluate to a future which + # represents what should be done next. It basically flattens indefinitely until non Future + # values is returned which becomes result of the returned future. Any encountered exception + # will become reason of the returned future. + # + # @return [Future] + # @param [#call(value)] run_test + # an object which when called returns either Future to keep running with + # or nil, then the run completes with the value. + # The run_test can be used to extract the Future from deeper structure, + # or to distinguish Future which is a resulting value from a future + # which is suppose to continue running. + # @example + # body = lambda do |v| + # v += 1 + # v < 5 ? Promises.future(v, &body) : v + # end + # Promises.future(0, &body).run.value! # => 5 + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1210 + def run(run_test = T.unsafe(nil)); end + + # @!macro promise.method.schedule + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1102 + def schedule(intended_time); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1034 + def then(*args, &task); end + + # Chains the task to be executed asynchronously on executor after it fulfills. Does not run + # the task if it rejects. It will resolve though, triggering any dependent futures. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.task-future + # @return [Future] + # @yield [value, *args] to the task. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1046 + def then_on(executor, *args, &task); end + + # Converts future to event which is resolved when future is resolved by fulfillment or rejection. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1222 + def to_event; end + + # Returns self, since this is a future + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1230 + def to_future; end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1235 + def to_s; end + + # @!macro promises.method.value + # Return value of the future. + # @!macro promises.touches + # + # @!macro promises.warn.blocks + # @!macro promises.warn.nil + # @!macro promises.param.timeout + # @!macro promises.param.timeout_value + # @param [Object] timeout_value a value returned by the method when it times out + # @return [Object, nil, timeout_value] the value of the Future when fulfilled, + # timeout_value on timeout, + # nil on rejection. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:950 + def value(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end + + # @!macro promises.method.value + # @return [Object, nil, timeout_value] the value of the Future when fulfilled, + # or nil on rejection, + # or timeout_value on timeout. + # @raise [Exception] {#reason} on rejection + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:997 + def value!(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end + + # @!macro promises.method.wait + # @raise [Exception] {#reason} on rejection + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:987 + def wait!(timeout = T.unsafe(nil)); end + + # @!macro promises.method.with_default_executor + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1111 + def with_default_executor(executor); end + + # @!macro promises.method.zip + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1070 + def zip(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1089 + def |(event_or_future); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1272 + def async_callback_on_fulfillment(state, executor, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1278 + def async_callback_on_rejection(state, executor, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1284 + def callback_on_fulfillment(state, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1288 + def callback_on_rejection(state, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1292 + def callback_on_resolution(state, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1251 + def rejected_resolution(raise_on_reassign, state); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1247 + def run_test(v); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1266 + def wait_until_resolved!(timeout = T.unsafe(nil)); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1984 +class Concurrent::Promises::FutureWrapperPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1985 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1991 + def on_resolvable(resolved_future, index); end +end + +# will be immediately resolved +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1783 +class Concurrent::Promises::ImmediateEventPromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1784 + def initialize(default_executor); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1789 +class Concurrent::Promises::ImmediateFuturePromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1790 + def initialize(default_executor, fulfilled, value, reason); end +end + +# @abstract +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1615 +class Concurrent::Promises::InnerPromise < ::Concurrent::Promises::AbstractPromise; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:338 +module Concurrent::Promises::InternalStates; end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:397 +class Concurrent::Promises::InternalStates::Fulfilled < ::Concurrent::Promises::InternalStates::ResolvedWithResult + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:399 + def initialize(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:407 + def apply(args, block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:403 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:415 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:419 + def to_sym; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:411 + def value; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:425 +class Concurrent::Promises::InternalStates::FulfilledArray < ::Concurrent::Promises::InternalStates::Fulfilled + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:426 + def apply(args, block); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:488 +Concurrent::Promises::InternalStates::PENDING = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Pending) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:459 +class Concurrent::Promises::InternalStates::PartiallyRejected < ::Concurrent::Promises::InternalStates::ResolvedWithResult + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:460 + def initialize(value, reason); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:482 + def apply(args, block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:466 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:478 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:470 + def to_sym; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:474 + def value; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:351 +class Concurrent::Promises::InternalStates::Pending < ::Concurrent::Promises::InternalStates::State + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:352 + def resolved?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:356 + def to_sym; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:490 +Concurrent::Promises::InternalStates::RESERVED = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Reserved) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:492 +Concurrent::Promises::InternalStates::RESOLVED = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Fulfilled) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:432 +class Concurrent::Promises::InternalStates::Rejected < ::Concurrent::Promises::InternalStates::ResolvedWithResult + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:433 + def initialize(reason); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:453 + def apply(args, block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:437 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:445 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:449 + def to_sym; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:441 + def value; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:362 +class Concurrent::Promises::InternalStates::Reserved < ::Concurrent::Promises::InternalStates::Pending; end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:366 +class Concurrent::Promises::InternalStates::ResolvedWithResult < ::Concurrent::Promises::InternalStates::State + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:391 + def apply; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:379 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:387 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:367 + def resolved?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:375 + def result; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:371 + def to_sym; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:383 + def value; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:340 +class Concurrent::Promises::InternalStates::State + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:341 + def resolved?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:345 + def to_sym; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1748 +class Concurrent::Promises::RescuePromise < ::Concurrent::Promises::BlockedTaskPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1751 + def initialize(delayed, blockers_count, default_executor, executor, args, &task); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1755 + def on_resolvable(resolved_future, index); end +end + +# Marker module of Future, Event resolved manually. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1299 +module Concurrent::Promises::Resolvable + include ::Concurrent::Promises::InternalStates +end + +# A Event which can be resolved by user. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1304 +class Concurrent::Promises::ResolvableEvent < ::Concurrent::Promises::Event + include ::Concurrent::Promises::Resolvable + + # Makes the event resolved, which triggers all dependent futures. + # + # @!macro promise.param.raise_on_reassign + # @!macro promise.param.reserved + # @param [true, false] reserved + # Set to true if the resolvable is {#reserve}d by you, + # marks resolution of reserved resolvable events and futures explicitly. + # Advanced feature, ignore unless you use {Resolvable#reserve} from edge. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1324 + def resolve(raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Behaves as {AbstractEventFuture#wait} but has one additional optional argument + # resolve_on_timeout. + # + # @param [true, false] resolve_on_timeout + # If it times out and the argument is true it will also resolve the event. + # @return [self, true, false] + # @see AbstractEventFuture#wait + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1342 + def wait(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Creates new event wrapping receiver, effectively hiding the resolve method. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1331 + def with_hidden_resolvable; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1600 +class Concurrent::Promises::ResolvableEventPromise < ::Concurrent::Promises::AbstractPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1601 + def initialize(default_executor); end +end + +# A Future which can be resolved by user. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1354 +class Concurrent::Promises::ResolvableFuture < ::Concurrent::Promises::Future + include ::Concurrent::Promises::Resolvable + + # Evaluates the block and sets its result as future's value fulfilling, if the block raises + # an exception the future rejects with it. + # + # @yield [*args] to the block. + # @yieldreturn [Object] value + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1395 + def evaluate_to(*args, &block); end + + # Evaluates the block and sets its result as future's value fulfilling, if the block raises + # an exception the future rejects with it. + # + # @yield [*args] to the block. + # @yieldreturn [Object] value + # @return [self] + # @raise [Exception] also raise reason on rejection. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1406 + def evaluate_to!(*args, &block); end + + # Makes the future fulfilled with `value`, + # which triggers all dependent futures. + # + # @param [Object] value + # @!macro promise.param.raise_on_reassign + # @!macro promise.param.reserved + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1375 + def fulfill(value, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Behaves as {Future#reason} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [Exception, timeout_value, nil] + # @see Future#reason + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1503 + def reason(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Makes the future rejected with `reason`, + # which triggers all dependent futures. + # + # @param [Object] reason + # @!macro promise.param.raise_on_reassign + # @!macro promise.param.reserved + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1385 + def reject(reason, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Makes the future resolved with result of triplet `fulfilled?`, `value`, `reason`, + # which triggers all dependent futures. + # + # @param [true, false] fulfilled + # @param [Object] value + # @param [Object] reason + # @!macro promise.param.raise_on_reassign + # @!macro promise.param.reserved + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1365 + def resolve(fulfilled = T.unsafe(nil), value = T.unsafe(nil), reason = T.unsafe(nil), raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Behaves as {Future#result} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [::Array(Boolean, Object, Exception), nil] + # @see Future#result + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1524 + def result(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Behaves as {Future#value} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [Object, timeout_value, nil] + # @see Future#value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1459 + def value(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Behaves as {Future#value!} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [Object, timeout_value, nil] + # @raise [Exception] {#reason} on rejection + # @see Future#value! + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1481 + def value!(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Behaves as {AbstractEventFuture#wait} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [self, true, false] + # @see AbstractEventFuture#wait + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1421 + def wait(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Behaves as {Future#wait!} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [self, true, false] + # @raise [Exception] {#reason} on rejection + # @see Future#wait! + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1438 + def wait!(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Creates new future wrapping receiver, effectively hiding the resolve method and similar. + # + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1542 + def with_hidden_resolvable; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1606 +class Concurrent::Promises::ResolvableFuturePromise < ::Concurrent::Promises::AbstractPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1607 + def initialize(default_executor); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1611 + def evaluate_to(*args, block); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1909 +class Concurrent::Promises::RunFuturePromise < ::Concurrent::Promises::AbstractFlatPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1913 + def initialize(delayed, blockers_count, default_executor, run_test); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1918 + def process_on_blocker_resolution(future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2114 +class Concurrent::Promises::ScheduledPromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2125 + def initialize(default_executor, intended_time); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2119 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2115 + def intended_time; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1730 +class Concurrent::Promises::ThenPromise < ::Concurrent::Promises::BlockedTaskPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1733 + def initialize(delayed, blockers_count, default_executor, executor, args, &task); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1737 + def on_resolvable(resolved_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1940 +class Concurrent::Promises::ZipEventEventPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1941 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1947 + def on_resolvable(resolved_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2031 +class Concurrent::Promises::ZipEventsPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2035 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2041 + def on_resolvable(resolved_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1952 +class Concurrent::Promises::ZipFutureEventPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1953 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1967 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1960 + def process_on_blocker_resolution(future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1996 +class Concurrent::Promises::ZipFuturesPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2000 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2013 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2007 + def process_on_blocker_resolution(future, index); end +end + +# Methods form module A included to a module B, which is already included into class C, +# will not be visible in the C class. If this module is extended to B then A's methods +# are correctly made visible to C. +# +# @example +# module A +# def a +# :a +# end +# end +# +# module B1 +# end +# +# class C1 +# include B1 +# end +# +# module B2 +# extend Concurrent::ReInclude +# end +# +# class C2 +# include B2 +# end +# +# B1.send :include, A +# B2.send :include, A +# +# C1.new.respond_to? :a # => false +# C2.new.respond_to? :a # => true +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/re_include.rb:36 +module Concurrent::ReInclude + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/re_include.rb:44 + def extended(base); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/re_include.rb:50 + def include(*modules); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/re_include.rb:38 + def included(base); end +end + +# Ruby read-write lock implementation +# +# Allows any number of concurrent readers, but only one concurrent writer +# (And if the "write" lock is taken, any readers who come along will have to wait) +# +# If readers are already active when a writer comes along, the writer will wait for +# all the readers to finish before going ahead. +# Any additional readers that come when the writer is already waiting, will also +# wait (so writers are not starved). +# +# This implementation is based on `java.util.concurrent.ReentrantReadWriteLock`. +# +# @example +# lock = Concurrent::ReadWriteLock.new +# lock.with_read_lock { data.retrieve } +# lock.with_write_lock { data.modify! } +# +# @note Do **not** try to acquire the write lock while already holding a read lock +# **or** try to acquire the write lock while you already have it. +# This will lead to deadlock +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html java.util.concurrent.ReentrantReadWriteLock +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:31 +class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `ReadWriteLock` in the unlocked state. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:59 + def initialize; end + + # Acquire a read lock. If a write lock has been acquired will block until + # it is released. Will not block if other read locks have been acquired. + # + # @return [Boolean] true if the lock is successfully acquired + # + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:111 + def acquire_read_lock; end + + # Acquire a write lock. Will block and wait for all active readers and writers. + # + # @return [Boolean] true if the lock is successfully acquired + # + # @raise [Concurrent::ResourceLimitError] if the maximum number of writers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:160 + def acquire_write_lock; end + + # Queries whether any threads are waiting to acquire the read or write lock. + # + # @return [Boolean] true if any threads are waiting for a lock else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:214 + def has_waiters?; end + + # Release a previously acquired read lock. + # + # @return [Boolean] true if the lock is successfully released + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:140 + def release_read_lock; end + + # Release a previously acquired write lock. + # + # @return [Boolean] true if the lock is successfully released + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:196 + def release_write_lock; end + + # Execute a block operation within a read lock. + # + # @yield the task to be performed within the lock. + # + # @return [Object] the result of the block operation. + # + # @raise [ArgumentError] when no block is given. + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:75 + def with_read_lock; end + + # Execute a block operation within a write lock. + # + # @yield the task to be performed within the lock. + # + # @return [Object] the result of the block operation. + # + # @raise [ArgumentError] when no block is given. + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:94 + def with_write_lock; end + + # Queries if the write lock is held by any thread. + # + # @return [Boolean] true if the write lock is held else false` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:207 + def write_locked?; end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:246 + def max_readers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:251 + def max_writers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:221 + def running_readers(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:226 + def running_readers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:231 + def running_writer?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:241 + def waiting_writer?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:236 + def waiting_writers(c = T.unsafe(nil)); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:40 +Concurrent::ReadWriteLock::MAX_READERS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:43 +Concurrent::ReadWriteLock::MAX_WRITERS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:37 +Concurrent::ReadWriteLock::RUNNING_WRITER = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:34 +Concurrent::ReadWriteLock::WAITING_WRITER = T.let(T.unsafe(nil), Integer) + +# Re-entrant read-write lock implementation +# +# Allows any number of concurrent readers, but only one concurrent writer +# (And while the "write" lock is taken, no read locks can be obtained either. +# Hence, the write lock can also be called an "exclusive" lock.) +# +# If another thread has taken a read lock, any thread which wants a write lock +# will block until all the readers release their locks. However, once a thread +# starts waiting to obtain a write lock, any additional readers that come along +# will also wait (so writers are not starved). +# +# A thread can acquire both a read and write lock at the same time. A thread can +# also acquire a read lock OR a write lock more than once. Only when the read (or +# write) lock is released as many times as it was acquired, will the thread +# actually let it go, allowing other threads which might have been waiting +# to proceed. Therefore the lock can be upgraded by first acquiring +# read lock and then write lock and that the lock can be downgraded by first +# having both read and write lock a releasing just the write lock. +# +# If both read and write locks are acquired by the same thread, it is not strictly +# necessary to release them in the same order they were acquired. In other words, +# the following code is legal: +# +# @example +# lock = Concurrent::ReentrantReadWriteLock.new +# lock.acquire_write_lock +# lock.acquire_read_lock +# lock.release_write_lock +# # At this point, the current thread is holding only a read lock, not a write +# # lock. So other threads can take read locks, but not a write lock. +# lock.release_read_lock +# # Now the current thread is not holding either a read or write lock, so +# # another thread could potentially acquire a write lock. +# +# This implementation was inspired by `java.util.concurrent.ReentrantReadWriteLock`. +# +# @example +# lock = Concurrent::ReentrantReadWriteLock.new +# lock.with_read_lock { data.retrieve } +# lock.with_write_lock { data.modify! } +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html java.util.concurrent.ReentrantReadWriteLock +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:53 +class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `ReentrantReadWriteLock` in the unlocked state. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:109 + def initialize; end + + # Acquire a read lock. If a write lock is held by another thread, will block + # until it is released. + # + # @return [Boolean] true if the lock is successfully acquired + # + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:162 + def acquire_read_lock; end + + # Acquire a write lock. Will block and wait for all active readers and writers. + # + # @return [Boolean] true if the lock is successfully acquired + # + # @raise [Concurrent::ResourceLimitError] if the maximum number of writers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:257 + def acquire_write_lock; end + + # Release a previously acquired read lock. + # + # @return [Boolean] true if the lock is successfully released + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:236 + def release_read_lock; end + + # Release a previously acquired write lock. + # + # @return [Boolean] true if the lock is successfully released + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:329 + def release_write_lock; end + + # Try to acquire a read lock and return true if we succeed. If it cannot be + # acquired immediately, return false. + # + # @return [Boolean] true if the lock is successfully acquired + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:215 + def try_read_lock; end + + # Try to acquire a write lock and return true if we succeed. If it cannot be + # acquired immediately, return false. + # + # @return [Boolean] true if the lock is successfully acquired + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:310 + def try_write_lock; end + + # Execute a block operation within a read lock. + # + # @yield the task to be performed within the lock. + # + # @return [Object] the result of the block operation. + # + # @raise [ArgumentError] when no block is given. + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:126 + def with_read_lock; end + + # Execute a block operation within a write lock. + # + # @yield the task to be performed within the lock. + # + # @return [Object] the result of the block operation. + # + # @raise [ArgumentError] when no block is given. + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:145 + def with_write_lock; end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:370 + def max_readers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:375 + def max_writers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:345 + def running_readers(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:350 + def running_readers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:355 + def running_writer?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:365 + def waiting_or_running_writer?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:360 + def waiting_writers(c = T.unsafe(nil)); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:94 +Concurrent::ReentrantReadWriteLock::MAX_READERS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:96 +Concurrent::ReentrantReadWriteLock::MAX_WRITERS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:84 +Concurrent::ReentrantReadWriteLock::READER_BITS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:102 +Concurrent::ReentrantReadWriteLock::READ_LOCK_MASK = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:92 +Concurrent::ReentrantReadWriteLock::RUNNING_WRITER = T.let(T.unsafe(nil), Integer) + +# Used with @Counter: +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:90 +Concurrent::ReentrantReadWriteLock::WAITING_WRITER = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:86 +Concurrent::ReentrantReadWriteLock::WRITER_BITS = T.let(T.unsafe(nil), Integer) + +# Used with @HeldCount: +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:100 +Concurrent::ReentrantReadWriteLock::WRITE_LOCK_HELD = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:104 +Concurrent::ReentrantReadWriteLock::WRITE_LOCK_MASK = T.let(T.unsafe(nil), Integer) + +# Raised by an `Executor` when it is unable to process a given task, +# possibly because of a reject policy or other internal error. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:48 +class Concurrent::RejectedExecutionError < ::Concurrent::Error; end + +# Raised when any finite resource, such as a lock counter, exceeds its +# maximum limit/threshold. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:52 +class Concurrent::ResourceLimitError < ::Concurrent::Error; end + +# @!macro internal_implementation_note +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:129 +class Concurrent::RubyExchanger < ::Concurrent::AbstractExchanger + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:159 + def initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def __initialize_atomic_fields__; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def compare_and_set_slot(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def slot; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def slot=(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def swap_slot(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def update_slot(&block); end + + private + + # @!macro exchanger_method_do_exchange + # + # @return [Object, CANCEL] the value exchanged by the other thread; {CANCEL} on timeout + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:170 + def do_exchange(value, timeout); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:138 +class Concurrent::RubyExchanger::Node < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:142 + def initialize(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def __initialize_atomic_fields__; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def compare_and_set_value(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:153 + def item; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:149 + def latch; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def swap_value(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def update_value(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def value; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def value=(value); end +end + +# @!macro abstract_executor_service_public_api +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:8 +class Concurrent::RubyExecutorService < ::Concurrent::AbstractExecutorService + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:11 + def initialize(*args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:42 + def kill; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:17 + def post(*args, &task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:33 + def shutdown; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:52 + def wait_for_termination(timeout = T.unsafe(nil)); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:70 + def ns_running?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:78 + def ns_shutdown?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:66 + def ns_shutdown_execution; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:74 + def ns_shuttingdown?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:58 + def stop_event; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:62 + def stopped_event; end +end + +# @!macro single_thread_executor +# @!macro abstract_executor_service_public_api +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb:9 +class Concurrent::RubySingleThreadExecutor < ::Concurrent::RubyThreadPoolExecutor + include ::Concurrent::SerialExecutorService + + # @!macro single_thread_executor_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb:13 + def initialize(opts = T.unsafe(nil)); end +end + +# @!macro thread_pool_executor +# @!macro thread_pool_options +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:13 +class Concurrent::RubyThreadPoolExecutor < ::Concurrent::RubyExecutorService + # @!macro thread_pool_executor_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:47 + def initialize(opts = T.unsafe(nil)); end + + # @!macro thread_pool_executor_method_active_count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:67 + def active_count; end + + # @!macro executor_service_method_can_overflow_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:74 + def can_overflow?; end + + # @!macro thread_pool_executor_attr_reader_completed_task_count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:62 + def completed_task_count; end + + # @!macro thread_pool_executor_attr_reader_idletime + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:38 + def idletime; end + + # @!macro thread_pool_executor_attr_reader_largest_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:52 + def largest_length; end + + # @!macro thread_pool_executor_attr_reader_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:79 + def length; end + + # @!macro thread_pool_executor_attr_reader_max_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:32 + def max_length; end + + # @!macro thread_pool_executor_attr_reader_max_queue + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:41 + def max_queue; end + + # @!macro thread_pool_executor_attr_reader_min_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:35 + def min_length; end + + # @!macro thread_pool_executor_method_prune_pool + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:139 + def prune_pool; end + + # removes the worker if it can be pruned + # + # @return [true, false] if the worker was pruned + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:104 + def prune_worker(worker); end + + # @!macro thread_pool_executor_attr_reader_queue_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:84 + def queue_length; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:124 + def ready_worker(worker, last_message); end + + # @!macro thread_pool_executor_attr_reader_remaining_capacity + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:89 + def remaining_capacity; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:116 + def remove_worker(worker); end + + # @!macro thread_pool_executor_attr_reader_scheduled_task_count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:57 + def scheduled_task_count; end + + # @!macro thread_pool_executor_attr_reader_synchronous + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:44 + def synchronous; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:129 + def worker_died(worker); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:134 + def worker_task_completed; end + + private + + # creates new worker which has to receive work to do after it's added + # @return [nil, Worker] nil of max capacity is reached + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:257 + def ns_add_busy_worker; end + + # tries to assign task to a worker, tries to get one from @ready or to create new one + # @return [true, false] if task is assigned to a worker + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:217 + def ns_assign_worker(*args, &task); end + + # tries to enqueue task + # @return [true, false] if enqueued + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:235 + def ns_enqueue(*args, &task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:178 + def ns_execute(*args, &task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:146 + def ns_initialize(opts); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:205 + def ns_kill_execution; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:173 + def ns_limited_queue?; end + + # @return [Integer] number of excess idle workers which can be removed without + # going below min_length, or all workers if not running + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:305 + def ns_prunable_capacity; end + + # handle ready worker, giving it new job or assigning back to @ready + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:269 + def ns_ready_worker(worker, last_message, success = T.unsafe(nil)); end + + # removes a worker which is not tracked in @ready + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:287 + def ns_remove_busy_worker(worker); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:294 + def ns_remove_ready_worker(worker); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:314 + def ns_reset_if_forked; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:190 + def ns_shutdown_execution; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:247 + def ns_worker_died(worker); end +end + +# @!macro thread_pool_executor_constant_default_max_pool_size +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:17 +Concurrent::RubyThreadPoolExecutor::DEFAULT_MAX_POOL_SIZE = T.let(T.unsafe(nil), Integer) + +# @!macro thread_pool_executor_constant_default_max_queue_size +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:23 +Concurrent::RubyThreadPoolExecutor::DEFAULT_MAX_QUEUE_SIZE = T.let(T.unsafe(nil), Integer) + +# @!macro thread_pool_executor_constant_default_min_pool_size +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:20 +Concurrent::RubyThreadPoolExecutor::DEFAULT_MIN_POOL_SIZE = T.let(T.unsafe(nil), Integer) + +# @!macro thread_pool_executor_constant_default_synchronous +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:29 +Concurrent::RubyThreadPoolExecutor::DEFAULT_SYNCHRONOUS = T.let(T.unsafe(nil), FalseClass) + +# @!macro thread_pool_executor_constant_default_thread_timeout +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:26 +Concurrent::RubyThreadPoolExecutor::DEFAULT_THREAD_IDLETIMEOUT = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:328 +class Concurrent::RubyThreadPoolExecutor::Worker + include ::Concurrent::Concern::Logging + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:331 + def initialize(pool, id); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:342 + def <<(message); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:350 + def kill; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:346 + def stop; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:356 + def create_worker(queue, pool, idletime); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:381 + def run_task(pool, task, args); end +end + +# A simple utility class that executes a callable and returns and array of three elements: +# success - indicating if the callable has been executed without errors +# value - filled by the callable result if it has been executed without errors, nil otherwise +# reason - the error risen by the callable if it has been executed with errors, nil otherwise +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:9 +class Concurrent::SafeTaskExecutor < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:11 + def initialize(task, opts = T.unsafe(nil)); end + + # @return [Array] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:18 + def execute(*args); end +end + +# `ScheduledTask` is a close relative of `Concurrent::Future` but with one +# important difference: A `Future` is set to execute as soon as possible +# whereas a `ScheduledTask` is set to execute after a specified delay. This +# implementation is loosely based on Java's +# [ScheduledExecutorService](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledExecutorService.html). +# It is a more feature-rich variant of {Concurrent.timer}. +# +# The *intended* schedule time of task execution is set on object construction +# with the `delay` argument. The delay is a numeric (floating point or integer) +# representing a number of seconds in the future. Any other value or a numeric +# equal to or less than zero will result in an exception. The *actual* schedule +# time of task execution is set when the `execute` method is called. +# +# The constructor can also be given zero or more processing options. Currently +# the only supported options are those recognized by the +# [Dereferenceable](Dereferenceable) module. +# +# The final constructor argument is a block representing the task to be performed. +# If no block is given an `ArgumentError` will be raised. +# +# **States** +# +# `ScheduledTask` mixes in the [Obligation](Obligation) module thus giving it +# "future" behavior. This includes the expected lifecycle states. `ScheduledTask` +# has one additional state, however. While the task (block) is being executed the +# state of the object will be `:processing`. This additional state is necessary +# because it has implications for task cancellation. +# +# **Cancellation** +# +# A `:pending` task can be cancelled using the `#cancel` method. A task in any +# other state, including `:processing`, cannot be cancelled. The `#cancel` +# method returns a boolean indicating the success of the cancellation attempt. +# A cancelled `ScheduledTask` cannot be restarted. It is immutable. +# +# **Obligation and Observation** +# +# The result of a `ScheduledTask` can be obtained either synchronously or +# asynchronously. `ScheduledTask` mixes in both the [Obligation](Obligation) +# module and the +# [Observable](http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html) +# module from the Ruby standard library. With one exception `ScheduledTask` +# behaves identically to [Future](Observable) with regard to these modules. +# +# @!macro copy_options +# +# @example Basic usage +# +# require 'concurrent/scheduled_task' +# require 'csv' +# require 'open-uri' +# +# class Ticker +# def get_year_end_closing(symbol, year, api_key) +# uri = "https://www.alphavantage.co/query?function=TIME_SERIES_MONTHLY&symbol=#{symbol}&apikey=#{api_key}&datatype=csv" +# data = [] +# csv = URI.parse(uri).read +# if csv.include?('call frequency') +# return :rate_limit_exceeded +# end +# CSV.parse(csv, headers: true) do |row| +# data << row['close'].to_f if row['timestamp'].include?(year.to_s) +# end +# year_end = data.first +# year_end +# rescue => e +# p e +# end +# end +# +# api_key = ENV['ALPHAVANTAGE_KEY'] +# abort(error_message) unless api_key +# +# # Future +# price = Concurrent::Future.execute{ Ticker.new.get_year_end_closing('TWTR', 2013, api_key) } +# price.state #=> :pending +# price.pending? #=> true +# price.value(0) #=> nil (does not block) +# +# sleep(1) # do other stuff +# +# price.value #=> 63.65 (after blocking if necessary) +# price.state #=> :fulfilled +# price.fulfilled? #=> true +# price.value #=> 63.65 +# +# @example Successful task execution +# +# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' } +# task.state #=> :unscheduled +# task.execute +# task.state #=> pending +# +# # wait for it... +# sleep(3) +# +# task.unscheduled? #=> false +# task.pending? #=> false +# task.fulfilled? #=> true +# task.rejected? #=> false +# task.value #=> 'What does the fox say?' +# +# @example One line creation and execution +# +# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' }.execute +# task.state #=> pending +# +# task = Concurrent::ScheduledTask.execute(2){ 'What do you get when you multiply 6 by 9?' } +# task.state #=> pending +# +# @example Failed task execution +# +# task = Concurrent::ScheduledTask.execute(2){ raise StandardError.new('Call me maybe?') } +# task.pending? #=> true +# +# # wait for it... +# sleep(3) +# +# task.unscheduled? #=> false +# task.pending? #=> false +# task.fulfilled? #=> false +# task.rejected? #=> true +# task.value #=> nil +# task.reason #=> # +# +# @example Task execution with observation +# +# observer = Class.new{ +# def update(time, value, reason) +# puts "The task completed at #{time} with value '#{value}'" +# end +# }.new +# +# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' } +# task.add_observer(observer) +# task.execute +# task.pending? #=> true +# +# # wait for it... +# sleep(3) +# +# #>> The task completed at 2013-11-07 12:26:09 -0500 with value 'What does the fox say?' +# +# @!macro monotonic_clock_warning +# +# @see Concurrent.timer +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:158 +class Concurrent::ScheduledTask < ::Concurrent::IVar + include ::Comparable + + # Schedule a task for execution at a specified future time. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @yield the task to be performed + # + # @!macro executor_and_deref_options + # + # @option opts [object, Array] :args zero or more arguments to be passed the task + # block on execution + # + # @raise [ArgumentError] When no block is given + # @raise [ArgumentError] When given a time that is in the past + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:178 + def initialize(delay, opts = T.unsafe(nil), &task); end + + # Comparator which orders by schedule time. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:213 + def <=>(other); end + + # Cancel this task and prevent it from executing. A task can only be + # cancelled if it is pending or unscheduled. + # + # @return [Boolean] true if successfully cancelled else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:235 + def cancel; end + + # Has the task been cancelled? + # + # @return [Boolean] true if the task is in the given state else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:220 + def cancelled?; end + + # Execute an `:unscheduled` `ScheduledTask`. Immediately sets the state to `:pending` + # and starts counting down toward execution. Does nothing if the `ScheduledTask` is + # in any state other than `:unscheduled`. + # + # @return [ScheduledTask] a reference to `self` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:273 + def execute; end + + # The executor on which to execute the task. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:163 + def executor; end + + # The `delay` value given at instantiation. + # + # @return [Float] the initial delay. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:199 + def initial_delay; end + + # Execute the task. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:297 + def process_task; end + + # In the task execution in progress? + # + # @return [Boolean] true if the task is in the given state else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:227 + def processing?; end + + # Reschedule the task using the given delay and the current time. + # A task can only be reset while it is `:pending`. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @return [Boolean] true if successfully rescheduled else false + # + # @raise [ArgumentError] When given a time that is in the past + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:262 + def reschedule(delay); end + + # Reschedule the task using the original delay and the current time. + # A task can only be reset while it is `:pending`. + # + # @return [Boolean] true if successfully rescheduled else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:250 + def reset; end + + # The monotonic time at which the the task is scheduled to be executed. + # + # @return [Float] the schedule time or nil if `unscheduled` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:206 + def schedule_time; end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:301 + def fail(reason = T.unsafe(nil)); end + + # Reschedule the task using the given delay and the current time. + # A task can only be reset while it is `:pending`. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @return [Boolean] true if successfully rescheduled else false + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:326 + def ns_reschedule(delay); end + + # Schedule the task using the given delay and the current time. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @return [Boolean] true if successfully rescheduled else false + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:312 + def ns_schedule(delay); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:301 + def set(value = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:301 + def try_set(value = T.unsafe(nil), &block); end + + class << self + # Create a new `ScheduledTask` object with the given block, execute it, and return the + # `:pending` object. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @!macro executor_and_deref_options + # + # @return [ScheduledTask] the newly created `ScheduledTask` in the `:pending` state + # + # @raise [ArgumentError] if no block is given + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:290 + def execute(delay, opts = T.unsafe(nil), &task); end + end +end + +# @!macro semaphore +# +# A counting semaphore. Conceptually, a semaphore maintains a set of +# permits. Each {#acquire} blocks if necessary until a permit is +# available, and then takes it. Each {#release} adds a permit, potentially +# releasing a blocking acquirer. +# However, no actual permit objects are used; the Semaphore just keeps a +# count of the number available and acts accordingly. +# Alternatively, permits may be acquired within a block, and automatically +# released after the block finishes executing. +# +# @!macro semaphore_public_api +# @example +# semaphore = Concurrent::Semaphore.new(2) +# +# t1 = Thread.new do +# semaphore.acquire +# puts "Thread 1 acquired semaphore" +# end +# +# t2 = Thread.new do +# semaphore.acquire +# puts "Thread 2 acquired semaphore" +# end +# +# t3 = Thread.new do +# semaphore.acquire +# puts "Thread 3 acquired semaphore" +# end +# +# t4 = Thread.new do +# sleep(2) +# puts "Thread 4 releasing semaphore" +# semaphore.release +# end +# +# [t1, t2, t3, t4].each(&:join) +# +# # prints: +# # Thread 3 acquired semaphore +# # Thread 2 acquired semaphore +# # Thread 4 releasing semaphore +# # Thread 1 acquired semaphore +# +# @example +# semaphore = Concurrent::Semaphore.new(1) +# +# puts semaphore.available_permits +# semaphore.acquire do +# puts semaphore.available_permits +# end +# puts semaphore.available_permits +# +# # prints: +# # 1 +# # 0 +# # 1 +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/semaphore.rb:161 +class Concurrent::Semaphore < ::Concurrent::MutexSemaphore; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/semaphore.rb:96 +Concurrent::SemaphoreImplementation = Concurrent::MutexSemaphore + +# Indicates that the including `ExecutorService` guarantees +# that all operations will occur in the order they are post and that no +# two operations may occur simultaneously. This module provides no +# functionality and provides no guarantees. That is the responsibility +# of the including class. This module exists solely to allow the including +# object to be interrogated for its serialization status. +# +# @example +# class Foo +# include Concurrent::SerialExecutor +# end +# +# foo = Foo.new +# +# foo.is_a? Concurrent::ExecutorService #=> true +# foo.is_a? Concurrent::SerialExecutor #=> true +# foo.serialized? #=> true +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb:24 +module Concurrent::SerialExecutorService + include ::Concurrent::Concern::Logging + include ::Concurrent::ExecutorService + + # @!macro executor_service_method_serialized_question + # + # @note Always returns `true` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb:30 + def serialized?; end +end + +# Ensures passed jobs in a serialized order never running at the same time. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:8 +class Concurrent::SerializedExecution < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Logging + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:11 + def initialize; end + + # Submit a task to the executor for asynchronous processing. + # + # @param [Executor] executor to be used for this job + # + # @param [Array] args zero or more arguments to be passed to the task + # + # @yield the asynchronous task to perform + # + # @return [Boolean] `true` if the task is queued, `false` if the executor + # is not running + # + # @raise [ArgumentError] if no task is given + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:34 + def post(executor, *args, &task); end + + # As {#post} but allows to submit multiple tasks at once, it's guaranteed that they will not + # be interleaved by other tasks. + # + # @param [Array, Proc)>] posts array of triplets where + # first is a {ExecutorService}, second is array of args for task, third is a task (Proc) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:44 + def posts(posts); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:75 + def call_job(job); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:70 + def ns_initialize; end + + # ensures next job is executed if any is stashed + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:95 + def work(job); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 +class Concurrent::SerializedExecution::Job < ::Struct + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def args; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def args=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def block; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def block=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:17 + def call; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def executor=(_); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def [](*_arg0); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def keyword_init?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def new(*_arg0); end + end +end + +# A wrapper/delegator for any `ExecutorService` that +# guarantees serialized execution of tasks. +# +# @see [SimpleDelegator](http://www.ruby-doc.org/stdlib-2.1.2/libdoc/delegate/rdoc/SimpleDelegator.html) +# @see Concurrent::SerializedExecution +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb:12 +class Concurrent::SerializedExecutionDelegator < ::SimpleDelegator + include ::Concurrent::Concern::Logging + include ::Concurrent::ExecutorService + include ::Concurrent::SerialExecutorService + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb:15 + def initialize(executor); end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb:22 + def post(*args, &task); end +end + +# @!macro concurrent_set +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:61 +class Concurrent::Set < ::Concurrent::CRubySet; end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:23 +Concurrent::SetImplementation = Concurrent::CRubySet + +# An thread-safe, write-once variation of Ruby's standard `Struct`. +# Each member can have its value set at most once, either at construction +# or any time thereafter. Attempting to assign a value to a member +# that has already been set will result in a `Concurrent::ImmutabilityError`. +# +# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct` +# @see http://en.wikipedia.org/wiki/Final_(Java) Java `final` keyword +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:14 +module Concurrent::SettableStruct + include ::Concurrent::Synchronization::AbstractStruct + + # @!macro struct_equality + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:50 + def ==(other); end + + # @!macro struct_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:45 + def [](member); end + + # @!macro struct_set + # + # @raise [Concurrent::ImmutabilityError] if the given member has already been set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:75 + def []=(member, value); end + + # @!macro struct_each + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:55 + def each(&block); end + + # @!macro struct_each_pair + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:61 + def each_pair(&block); end + + # @!macro struct_inspect + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:29 + def inspect; end + + # @!macro struct_merge + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:35 + def merge(other, &block); end + + # @!macro struct_select + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:67 + def select(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:21 + def to_a; end + + # @!macro struct_to_h + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:40 + def to_h; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:32 + def to_s; end + + # @!macro struct_values + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:18 + def values; end + + # @!macro struct_values_at + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:24 + def values_at(*indexes); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:97 + def initialize_copy(original); end + + class << self + # @!macro struct_new + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:105 + def new(*args, &block); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:115 +Concurrent::SettableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) + +# An executor service in which every operation spawns a new, +# independently operating thread. +# +# This is perhaps the most inefficient executor service in this +# library. It exists mainly for testing an debugging. Thread creation +# and management is expensive in Ruby and this executor performs no +# resource pooling. This can be very beneficial during testing and +# debugging because it decouples the using code from the underlying +# executor implementation. In production this executor will likely +# lead to suboptimal performance. +# +# @note Intended for use primarily in testing and debugging. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:21 +class Concurrent::SimpleExecutorService < ::Concurrent::RubyExecutorService + # @!macro executor_service_method_left_shift + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:56 + def <<(task); end + + # @!macro executor_service_method_kill + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:84 + def kill; end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:40 + def post(*args, &task); end + + # @!macro executor_service_method_running_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:62 + def running?; end + + # @!macro executor_service_method_shutdown + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:77 + def shutdown; end + + # @!macro executor_service_method_shutdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:72 + def shutdown?; end + + # @!macro executor_service_method_shuttingdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:67 + def shuttingdown?; end + + # @!macro executor_service_method_wait_for_termination + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:91 + def wait_for_termination(timeout = T.unsafe(nil)); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:97 + def ns_initialize(*args); end + + class << self + # @!macro executor_service_method_left_shift + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:34 + def <<(task); end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:24 + def post(*args); end + end +end + +# @!macro single_thread_executor +# +# A thread pool with a single thread an unlimited queue. Should the thread +# die for any reason it will be removed and replaced, thus ensuring that +# the executor will always remain viable and available to process jobs. +# +# A common pattern for background processing is to create a single thread +# on which an infinite loop is run. The thread's loop blocks on an input +# source (perhaps blocking I/O or a queue) and processes each input as it +# is received. This pattern has several issues. The thread itself is highly +# susceptible to errors during processing. Also, the thread itself must be +# constantly monitored and restarted should it die. `SingleThreadExecutor` +# encapsulates all these behaviors. The task processor is highly resilient +# to errors from within tasks. Also, should the thread die it will +# automatically be restarted. +# +# The API and behavior of this class are based on Java's `SingleThreadExecutor`. +# +# @!macro abstract_executor_service_public_api +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb:37 +class Concurrent::SingleThreadExecutor < ::Concurrent::RubySingleThreadExecutor; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb:10 +Concurrent::SingleThreadExecutorImplementation = Concurrent::RubySingleThreadExecutor + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:2 +module Concurrent::Synchronization + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/full_memory_barrier.rb:7 + def full_memory_barrier; end + end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:9 +class Concurrent::Synchronization::AbstractLockableObject < ::Concurrent::Synchronization::Object + protected + + # @!macro synchronization_object_method_ns_broadcast + # + # Broadcast to all waiting threads. + # @return [self] + # @note only to be used inside synchronized block + # @note to provide direct access to this method in a descendant add method + # ``` + # def broadcast + # synchronize { ns_broadcast } + # end + # ``` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:96 + def ns_broadcast; end + + # @!macro synchronization_object_method_ns_signal + # + # Signal one waiting thread. + # @return [self] + # @note only to be used inside synchronized block + # @note to provide direct access to this method in a descendant add method + # ``` + # def signal + # synchronize { ns_signal } + # end + # ``` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:81 + def ns_signal; end + + # @!macro synchronization_object_method_ns_wait + # + # Wait until another thread calls #signal or #broadcast, + # spurious wake-ups can happen. + # + # @param [Numeric, nil] timeout in seconds, `nil` means no timeout + # @return [self] + # @note only to be used inside synchronized block + # @note to provide direct access to this method in a descendant add method + # ``` + # def wait(timeout = nil) + # synchronize { ns_wait(timeout) } + # end + # ``` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:66 + def ns_wait(timeout = T.unsafe(nil)); end + + # @!macro synchronization_object_method_ns_wait_until + # + # Wait until condition is met or timeout passes, + # protects against spurious wake-ups. + # @param [Numeric, nil] timeout in seconds, `nil` means no timeout + # @yield condition to be met + # @yieldreturn [true, false] + # @return [true, false] if condition met + # @note only to be used inside synchronized block + # @note to provide direct access to this method in a descendant add method + # ``` + # def wait_until(timeout = nil, &condition) + # synchronize { ns_wait_until(timeout, &condition) } + # end + # ``` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:37 + def ns_wait_until(timeout = T.unsafe(nil), &condition); end + + # @!macro synchronization_object_method_synchronize + # + # @yield runs the block synchronized against this object, + # equivalent of java's `synchronize(this) {}` + # @note can by made public in descendants if required by `public :synchronize` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:18 + def synchronize; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:6 +class Concurrent::Synchronization::AbstractObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:7 + def initialize; end + + # @!visibility private + # @abstract + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:13 + def full_memory_barrier; end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:17 + def attr_volatile(*names); end + end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:6 +module Concurrent::Synchronization::AbstractStruct + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:9 + def initialize(*values); end + + # @!macro struct_length + # + # Returns the number of struct members. + # + # @return [Fixnum] the number of struct members + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:19 + def length; end + + # @!macro struct_members + # + # Returns the struct members as an array of symbols. + # + # @return [Array] the struct members as an array of symbols + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:29 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:22 + def size; end + + protected + + # @!macro struct_each + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:82 + def ns_each; end + + # @!macro struct_each_pair + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:89 + def ns_each_pair; end + + # @!macro struct_equality + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:75 + def ns_equality(other); end + + # @!macro struct_get + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:59 + def ns_get(member); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:119 + def ns_initialize_copy; end + + # @!macro struct_inspect + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:105 + def ns_inspect; end + + # @!macro struct_merge + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:114 + def ns_merge(other, &block); end + + # @!macro struct_select + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:98 + def ns_select; end + + # @!macro struct_to_h + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:52 + def ns_to_h; end + + # @!macro struct_values + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:38 + def ns_values; end + + # @!macro struct_values_at + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:45 + def ns_values_at(indexes); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:130 + def pr_underscore(clazz); end + + class << self + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:141 + def define_struct_class(parent, base, name, members, &block); end + end +end + +# @!visibility private +# TODO (pitr-ch 04-Dec-2016): should be in edge +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:8 +class Concurrent::Synchronization::Condition < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:18 + def initialize(lock); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:47 + def broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:51 + def ns_broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:43 + def ns_signal; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:27 + def ns_wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:35 + def ns_wait_until(timeout = T.unsafe(nil), &condition); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:39 + def signal; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:23 + def wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:31 + def wait_until(timeout = T.unsafe(nil), &condition); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:15 + def private_new(*args, &block); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:16 + def new(*args, &block); end + end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:8 +module Concurrent::Synchronization::ConditionSignalling + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:16 + def ns_broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:11 + def ns_signal; end +end + +# @!visibility private +# TODO (pitr-ch 04-Dec-2016): should be in edge +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:8 +class Concurrent::Synchronization::Lock < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:31 + def broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:35 + def ns_broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:29 + def ns_signal; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:17 + def ns_wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:23 + def ns_wait_until(timeout = T.unsafe(nil), &condition); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:25 + def signal; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:11 + def synchronize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:13 + def wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:19 + def wait_until(timeout = T.unsafe(nil), &condition); end +end + +# Safe synchronization under any Ruby implementation. +# It provides methods like {#synchronize}, {#wait}, {#signal} and {#broadcast}. +# Provides a single layer which can improve its implementation over time without changes needed to +# the classes using it. Use {Synchronization::Object} not this abstract class. +# +# @note this object does not support usage together with +# [`Thread#wakeup`](http://ruby-doc.org/core/Thread.html#method-i-wakeup) +# and [`Thread#raise`](http://ruby-doc.org/core/Thread.html#method-i-raise). +# `Thread#sleep` and `Thread#wakeup` will work as expected but mixing `Synchronization::Object#wait` and +# `Thread#wakeup` will not work on all platforms. +# +# @see Event implementation as an example of this class use +# +# @example simple +# class AnClass < Synchronization::Object +# def initialize +# super +# synchronize { @value = 'asd' } +# end +# +# def value +# synchronize { @value } +# end +# end +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb:50 +class Concurrent::Synchronization::LockableObject < ::Concurrent::Synchronization::MutexLockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:57 + def new_condition; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb:11 +Concurrent::Synchronization::LockableObjectImplementation = Concurrent::Synchronization::MutexLockableObject + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:60 +class Concurrent::Synchronization::MonitorLockableObject < ::Concurrent::Synchronization::AbstractLockableObject + include ::Concurrent::Synchronization::ConditionSignalling + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:65 + def initialize; end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:83 + def ns_wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:79 + def synchronize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:71 + def initialize_copy(other); end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:25 +class Concurrent::Synchronization::MutexLockableObject < ::Concurrent::Synchronization::AbstractLockableObject + include ::Concurrent::Synchronization::ConditionSignalling + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:30 + def initialize; end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:52 + def ns_wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:44 + def synchronize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:36 + def initialize_copy(other); end +end + +# Abstract object providing final, volatile, ans CAS extensions to build other concurrent abstractions. +# - final instance variables see {Object.safe_initialization!} +# - volatile instance variables see {Object.attr_volatile} +# - volatile instance variables see {Object.attr_atomic} +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:15 +class Concurrent::Synchronization::Object < ::Concurrent::Synchronization::AbstractObject + include ::Concurrent::Synchronization::Volatile + extend ::Concurrent::Synchronization::Volatile::ClassMethods + + # Has to be called by children. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:28 + def initialize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:146 + def __initialize_atomic_fields__; end + + class << self + # @return [true, false] is the attribute with name atomic? + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:125 + def atomic_attribute?(name); end + + # @param [true, false] inherited should inherited volatile with CAS fields be returned? + # @return [::Array] Returns defined volatile with CAS fields on this class. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:119 + def atomic_attributes(inherited = T.unsafe(nil)); end + + # Creates methods for reading and writing to a instance variable with + # volatile (Java) semantic as {.attr_volatile} does. + # The instance variable should be accessed only through generated methods. + # This method generates following methods: `value`, `value=(new_value) #=> new_value`, + # `swap_value(new_value) #=> old_value`, + # `compare_and_set_value(expected, value) #=> true || false`, `update_value(&block)`. + # @param [::Array] names of the instance variables to be volatile with CAS. + # @return [::Array] names of defined method names. + # @!macro attr_atomic + # @!method $1 + # @return [Object] The $1. + # @!method $1=(new_$1) + # Set the $1. + # @return [Object] new_$1. + # @!method swap_$1(new_$1) + # Set the $1 to new_$1 and return the old $1. + # @return [Object] old $1 + # @!method compare_and_set_$1(expected_$1, new_$1) + # Sets the $1 to new_$1 if the current $1 is expected_$1 + # @return [true, false] + # @!method update_$1(&block) + # Updates the $1 using the block. + # @yield [Object] Calculate a new $1 using given (old) $1 + # @yieldparam [Object] old $1 + # @return [Object] new $1 + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:84 + def attr_atomic(*names); end + + # For testing purposes, quite slow. Injects assert code to new method which will raise if class instance contains + # any instance variables with CamelCase names and isn't {.safe_initialization?}. + # @raise when offend found + # @return [true] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:45 + def ensure_safe_initialization_when_final_fields_are_present; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:33 + def safe_initialization!; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:37 + def safe_initialization?; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:131 + def define_initialize_atomic_fields; end + end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# By extending this module, a class and all its children are marked to be constructed safely. Meaning that +# all writes (ivar initializations) are made visible to all readers of newly constructed object. It ensures +# same behaviour as Java's final fields. +# +# Due to using Kernel#extend, the module is not included again if already present in the ancestors, +# which avoids extra overhead. +# +# @example +# class AClass < Concurrent::Synchronization::Object +# extend Concurrent::Synchronization::SafeInitialization +# +# def initialize +# @AFinalValue = 'value' # published safely, #foo will never return nil +# end +# +# def foo +# @AFinalValue +# end +# end +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb:28 +module Concurrent::Synchronization::SafeInitialization + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb:29 + def new(*args, &block); end +end + +# Volatile adds the attr_volatile class method when included. +# +# @example +# class Foo +# include Concurrent::Synchronization::Volatile +# +# attr_volatile :bar +# +# def initialize +# self.bar = 1 +# end +# end +# +# foo = Foo.new +# foo.bar +# => 1 +# foo.bar = 2 +# => 2 +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:28 +module Concurrent::Synchronization::Volatile + mixes_in_class_methods ::Concurrent::Synchronization::Volatile::ClassMethods + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:33 + def full_memory_barrier; end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:29 + def included(base); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:37 +module Concurrent::Synchronization::Volatile::ClassMethods + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:39 + def attr_volatile(*names); end +end + +# This class provides a trivial way to synchronize all calls to a given object +# by wrapping it with a `Delegator` that performs `Monitor#enter/exit` calls +# around the delegated `#send`. Example: +# +# array = [] # not thread-safe on many impls +# array = SynchronizedDelegator.new([]) # thread-safe +# +# A simple `Monitor` provides a very coarse-grained way to synchronize a given +# object, in that it will cause synchronization for methods that have no need +# for it, but this is a trivial way to get thread-safety where none may exist +# currently on some implementations. +# +# This class is currently being considered for inclusion into stdlib, via +# https://bugs.ruby-lang.org/issues/8556 +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:21 +class Concurrent::SynchronizedDelegator < ::SimpleDelegator + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:31 + def initialize(obj); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:36 + def method_missing(method, *args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:22 + def setup; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:27 + def teardown; end +end + +# A `TVar` is a transactional variable - a single-element container that +# is used as part of a transaction - see `Concurrent::atomically`. +# +# @!macro thread_safe_variable_comparison +# +# {include:file:docs-source/tvar.md} +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:12 +class Concurrent::TVar < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `TVar` with an initial value. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:16 + def initialize(value); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:46 + def unsafe_lock; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:36 + def unsafe_value; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:41 + def unsafe_value=(value); end + + # Get the value of a `TVar`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:22 + def value; end + + # Set the value of a `TVar`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:29 + def value=(value); end +end + +# A `ThreadLocalVar` is a variable where the value is different for each thread. +# Each variable may have a default value, but when you modify the variable only +# the current thread will ever see that change. +# +# This is similar to Ruby's built-in thread-local variables (`Thread#thread_variable_get`), +# but with these major advantages: +# * `ThreadLocalVar` has its own identity, it doesn't need a Symbol. +# * Each Ruby's built-in thread-local variable leaks some memory forever (it's a Symbol held forever on the thread), +# so it's only OK to create a small amount of them. +# `ThreadLocalVar` has no such issue and it is fine to create many of them. +# * Ruby's built-in thread-local variables leak forever the value set on each thread (unless set to nil explicitly). +# `ThreadLocalVar` automatically removes the mapping for each thread once the `ThreadLocalVar` instance is GC'd. +# +# @!macro thread_safe_variable_comparison +# +# @example +# v = ThreadLocalVar.new(14) +# v.value #=> 14 +# v.value = 2 +# v.value #=> 2 +# +# @example +# v = ThreadLocalVar.new(14) +# +# t1 = Thread.new do +# v.value #=> 14 +# v.value = 1 +# v.value #=> 1 +# end +# +# t2 = Thread.new do +# v.value #=> 14 +# v.value = 2 +# v.value #=> 2 +# end +# +# v.value #=> 14 +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:43 +class Concurrent::ThreadLocalVar + # Creates a thread local variable. + # + # @param [Object] default the default value when otherwise unset + # @param [Proc] default_block Optional block that gets called to obtain the + # default value for each thread + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:51 + def initialize(default = T.unsafe(nil), &default_block); end + + # Bind the given value to thread local storage during + # execution of the given block. + # + # @param [Object] value the value to bind + # @yield the operation to be performed with the bound variable + # @return [Object] the value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:88 + def bind(value); end + + # Returns the value in the current thread's copy of this thread-local variable. + # + # @return [Object] the current value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:70 + def value; end + + # Sets the current thread's copy of this thread-local variable to the specified value. + # + # @param [Object] value the value to set + # @return [Object] the new value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:78 + def value=(value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:103 + def default; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:44 +Concurrent::ThreadLocalVar::LOCALS = T.let(T.unsafe(nil), Concurrent::ThreadLocals) + +# @!visibility private +# @!macro internal_implementation_note +# An array-backed storage of indexed variables per thread. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:141 +class Concurrent::ThreadLocals < ::Concurrent::AbstractLocals + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:142 + def locals; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:146 + def locals!; end +end + +# @!macro thread_pool_executor +# +# An abstraction composed of one or more threads and a task queue. Tasks +# (blocks or `proc` objects) are submitted to the pool and added to the queue. +# The threads in the pool remove the tasks and execute them in the order +# they were received. +# +# A `ThreadPoolExecutor` will automatically adjust the pool size according +# to the bounds set by `min-threads` and `max-threads`. When a new task is +# submitted and fewer than `min-threads` threads are running, a new thread +# is created to handle the request, even if other worker threads are idle. +# If there are more than `min-threads` but less than `max-threads` threads +# running, a new thread will be created only if the queue is full. +# +# Threads that are idle for too long will be garbage collected, down to the +# configured minimum options. Should a thread crash it, too, will be garbage collected. +# +# `ThreadPoolExecutor` is based on the Java class of the same name. From +# the official Java documentation; +# +# > Thread pools address two different problems: they usually provide +# > improved performance when executing large numbers of asynchronous tasks, +# > due to reduced per-task invocation overhead, and they provide a means +# > of bounding and managing the resources, including threads, consumed +# > when executing a collection of tasks. Each ThreadPoolExecutor also +# > maintains some basic statistics, such as the number of completed tasks. +# > +# > To be useful across a wide range of contexts, this class provides many +# > adjustable parameters and extensibility hooks. However, programmers are +# > urged to use the more convenient Executors factory methods +# > [CachedThreadPool] (unbounded thread pool, with automatic thread reclamation), +# > [FixedThreadPool] (fixed size thread pool) and [SingleThreadExecutor] (single +# > background thread), that preconfigure settings for the most common usage +# > scenarios. +# +# @!macro thread_pool_options +# +# @!macro thread_pool_executor_public_api +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/thread_pool_executor.rb:56 +class Concurrent::ThreadPoolExecutor < ::Concurrent::RubyThreadPoolExecutor; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/thread_pool_executor.rb:10 +Concurrent::ThreadPoolExecutorImplementation = Concurrent::RubyThreadPoolExecutor + +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:4 +module Concurrent::ThreadSafe; end + +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:7 +module Concurrent::ThreadSafe::Util + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb:16 + def make_synchronized_on_cruby(klass); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb:41 + def make_synchronized_on_truffleruby(klass); end + end +end + +# TODO (pitr-ch 15-Oct-2016): migrate to Utility::ProcessorCounter +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:13 +Concurrent::ThreadSafe::Util::CPU_COUNT = T.let(T.unsafe(nil), Integer) + +# TODO (pitr-ch 15-Oct-2016): migrate to Utility::NativeInteger +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:10 +Concurrent::ThreadSafe::Util::FIXNUM_BIT_SIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:11 +Concurrent::ThreadSafe::Util::MAX_INT = T.let(T.unsafe(nil), Integer) + +# Raised when an operation times out. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:55 +class Concurrent::TimeoutError < ::Concurrent::Error; end + +# Executes a collection of tasks, each after a given delay. A master task +# monitors the set and schedules each task for execution at the appropriate +# time. Tasks are run on the global thread pool or on the supplied executor. +# Each task is represented as a `ScheduledTask`. +# +# @see Concurrent::ScheduledTask +# +# @!macro monotonic_clock_warning +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:19 +class Concurrent::TimerSet < ::Concurrent::RubyExecutorService + # Create a new set of timed tasks. + # + # @!macro executor_options + # + # @param [Hash] opts the options used to specify the executor on which to perform actions + # @option opts [Executor] :executor when set use the given `Executor` instance. + # Three special values are also supported: `:task` returns the global task pool, + # `:operation` returns the global operation pool, and `:immediate` returns a new + # `ImmediateExecutor` object. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:30 + def initialize(opts = T.unsafe(nil)); end + + # Begin an immediate shutdown. In-progress tasks will be allowed to + # complete but enqueued tasks will be dismissed and no new tasks + # will be accepted. Has no additional effect if the thread pool is + # not running. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:62 + def kill; end + + # Post a task to be execute run after a given delay (in seconds). If the + # delay is less than 1/100th of a second the task will be immediately post + # to the executor. + # + # @param [Float] delay the number of seconds to wait for before executing the task. + # @param [Array] args the arguments passed to the task on execution. + # + # @yield the task to be performed. + # + # @return [Concurrent::ScheduledTask, false] IVar representing the task if the post + # is successful; false after shutdown. + # + # @raise [ArgumentError] if the intended execution time is not in the future. + # @raise [ArgumentError] if no block is given. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:48 + def post(delay, *args, &task); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:67 + def <<(task); end + + # Initialize the object. + # + # @param [Hash] opts the options to create the object with. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:75 + def ns_initialize(opts); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:95 + def ns_post_task(task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:132 + def ns_reset_if_forked; end + + # `ExecutorService` callback called during shutdown. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:123 + def ns_shutdown_execution; end + + # Post the task to the internal queue. + # + # @note This is intended as a callback method from ScheduledTask + # only. It is not intended to be used directly. Post a task + # by using the `SchedulesTask#execute` method. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:90 + def post_task(task); end + + # Run a loop and execute tasks in the scheduled order and at the approximate + # scheduled time. If no tasks remain the thread will exit gracefully so that + # garbage collection can occur. If there are no ready tasks it will sleep + # for up to 60 seconds waiting for the next scheduled task. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:146 + def process_tasks; end + + # Remove the given task from the queue. + # + # @note This is intended as a callback method from `ScheduledTask` + # only. It is not intended to be used directly. Cancel a task + # by using the `ScheduledTask#cancel` method. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:116 + def remove_task(task); end +end + +# A very common concurrency pattern is to run a thread that performs a task at +# regular intervals. The thread that performs the task sleeps for the given +# interval then wakes up and performs the task. Lather, rinse, repeat... This +# pattern causes two problems. First, it is difficult to test the business +# logic of the task because the task itself is tightly coupled with the +# concurrency logic. Second, an exception raised while performing the task can +# cause the entire thread to abend. In a long-running application where the +# task thread is intended to run for days/weeks/years a crashed task thread +# can pose a significant problem. `TimerTask` alleviates both problems. +# +# When a `TimerTask` is launched it starts a thread for monitoring the +# execution interval. The `TimerTask` thread does not perform the task, +# however. Instead, the TimerTask launches the task on a separate thread. +# Should the task experience an unrecoverable crash only the task thread will +# crash. This makes the `TimerTask` very fault tolerant. Additionally, the +# `TimerTask` thread can respond to the success or failure of the task, +# performing logging or ancillary operations. +# +# One other advantage of `TimerTask` is that it forces the business logic to +# be completely decoupled from the concurrency logic. The business logic can +# be tested separately then passed to the `TimerTask` for scheduling and +# running. +# +# A `TimerTask` supports two different types of interval calculations. +# A fixed delay will always wait the same amount of time between the +# completion of one task and the start of the next. A fixed rate will +# attempt to maintain a constant rate of execution regardless of the +# duration of the task. For example, if a fixed rate task is scheduled +# to run every 60 seconds but the task itself takes 10 seconds to +# complete, the next task will be scheduled to run 50 seconds after +# the start of the previous task. If the task takes 70 seconds to +# complete, the next task will be start immediately after the previous +# task completes. Tasks will not be executed concurrently. +# +# In some cases it may be necessary for a `TimerTask` to affect its own +# execution cycle. To facilitate this, a reference to the TimerTask instance +# is passed as an argument to the provided block every time the task is +# executed. +# +# The `TimerTask` class includes the `Dereferenceable` mixin module so the +# result of the last execution is always available via the `#value` method. +# Dereferencing options can be passed to the `TimerTask` during construction or +# at any later time using the `#set_deref_options` method. +# +# `TimerTask` supports notification through the Ruby standard library +# {http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html +# Observable} module. On execution the `TimerTask` will notify the observers +# with three arguments: time of execution, the result of the block (or nil on +# failure), and any raised exceptions (or nil on success). +# +# @!macro copy_options +# +# @example Basic usage +# task = Concurrent::TimerTask.new{ puts 'Boom!' } +# task.execute +# +# task.execution_interval #=> 60 (default) +# +# # wait 60 seconds... +# #=> 'Boom!' +# +# task.shutdown #=> true +# +# @example Configuring `:execution_interval` +# task = Concurrent::TimerTask.new(execution_interval: 5) do +# puts 'Boom!' +# end +# +# task.execution_interval #=> 5 +# +# @example Immediate execution with `:run_now` +# task = Concurrent::TimerTask.new(run_now: true){ puts 'Boom!' } +# task.execute +# +# #=> 'Boom!' +# +# @example Configuring `:interval_type` with either :fixed_delay or :fixed_rate, default is :fixed_delay +# task = Concurrent::TimerTask.new(execution_interval: 5, interval_type: :fixed_rate) do +# puts 'Boom!' +# end +# task.interval_type #=> :fixed_rate +# +# @example Last `#value` and `Dereferenceable` mixin +# task = Concurrent::TimerTask.new( +# dup_on_deref: true, +# execution_interval: 5 +# ){ Time.now } +# +# task.execute +# Time.now #=> 2013-11-07 18:06:50 -0500 +# sleep(10) +# task.value #=> 2013-11-07 18:06:55 -0500 +# +# @example Controlling execution from within the block +# timer_task = Concurrent::TimerTask.new(execution_interval: 1) do |task| +# task.execution_interval.to_i.times{ print 'Boom! ' } +# print "\n" +# task.execution_interval += 1 +# if task.execution_interval > 5 +# puts 'Stopping...' +# task.shutdown +# end +# end +# +# timer_task.execute +# #=> Boom! +# #=> Boom! Boom! +# #=> Boom! Boom! Boom! +# #=> Boom! Boom! Boom! Boom! +# #=> Boom! Boom! Boom! Boom! Boom! +# #=> Stopping... +# +# @example Observation +# class TaskObserver +# def update(time, result, ex) +# if result +# print "(#{time}) Execution successfully returned #{result}\n" +# else +# print "(#{time}) Execution failed with error #{ex}\n" +# end +# end +# end +# +# task = Concurrent::TimerTask.new(execution_interval: 1){ 42 } +# task.add_observer(TaskObserver.new) +# task.execute +# sleep 4 +# +# #=> (2013-10-13 19:08:58 -0400) Execution successfully returned 42 +# #=> (2013-10-13 19:08:59 -0400) Execution successfully returned 42 +# #=> (2013-10-13 19:09:00 -0400) Execution successfully returned 42 +# task.shutdown +# +# task = Concurrent::TimerTask.new(execution_interval: 1){ sleep } +# task.add_observer(TaskObserver.new) +# task.execute +# +# #=> (2013-10-13 19:07:25 -0400) Execution timed out +# #=> (2013-10-13 19:07:27 -0400) Execution timed out +# #=> (2013-10-13 19:07:29 -0400) Execution timed out +# task.shutdown +# +# task = Concurrent::TimerTask.new(execution_interval: 1){ raise StandardError } +# task.add_observer(TaskObserver.new) +# task.execute +# +# #=> (2013-10-13 19:09:37 -0400) Execution failed with error StandardError +# #=> (2013-10-13 19:09:38 -0400) Execution failed with error StandardError +# #=> (2013-10-13 19:09:39 -0400) Execution failed with error StandardError +# task.shutdown +# +# @see http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html +# @see http://docs.oracle.com/javase/7/docs/api/java/util/TimerTask.html +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:166 +class Concurrent::TimerTask < ::Concurrent::RubyExecutorService + include ::Concurrent::Concern::Dereferenceable + include ::Concurrent::Concern::Observable + + # Create a new TimerTask with the given task and configuration. + # + # @!macro timer_task_initialize + # @param [Hash] opts the options defining task execution. + # @option opts [Float] :execution_interval number of seconds between + # task executions (default: EXECUTION_INTERVAL) + # @option opts [Boolean] :run_now Whether to run the task immediately + # upon instantiation or to wait until the first # execution_interval + # has passed (default: false) + # @options opts [Symbol] :interval_type method to calculate the interval + # between executions, can be either :fixed_rate or :fixed_delay. + # (default: :fixed_delay) + # @option opts [Executor] executor, default is `global_io_executor` + # + # @!macro deref_options + # + # @raise ArgumentError when no block is given. + # + # @yield to the block after :execution_interval seconds have passed since + # the last yield + # @yieldparam task a reference to the `TimerTask` instance so that the + # block can control its own lifecycle. Necessary since `self` will + # refer to the execution context of the block rather than the running + # `TimerTask`. + # + # @return [TimerTask] the new `TimerTask` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:210 + def initialize(opts = T.unsafe(nil), &task); end + + # Execute a previously created `TimerTask`. + # + # @return [TimerTask] a reference to `self` + # + # @example Instance and execute in separate steps + # task = Concurrent::TimerTask.new(execution_interval: 10){ print "Hello World\n" } + # task.running? #=> false + # task.execute + # task.running? #=> true + # + # @example Instance and execute in one line + # task = Concurrent::TimerTask.new(execution_interval: 10){ print "Hello World\n" }.execute + # task.running? #=> true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:236 + def execute; end + + # @!attribute [rw] execution_interval + # @return [Fixnum] Number of seconds after the task completes before the + # task is performed again. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:261 + def execution_interval; end + + # @!attribute [rw] execution_interval + # @return [Fixnum] Number of seconds after the task completes before the + # task is performed again. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:268 + def execution_interval=(value); end + + # @!attribute [r] interval_type + # @return [Symbol] method to calculate the interval between executions + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:278 + def interval_type; end + + # Is the executor running? + # + # @return [Boolean] `true` when running, `false` when shutting down or shutdown + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:219 + def running?; end + + # @!attribute [rw] timeout_interval + # @return [Fixnum] Number of seconds the task can run before it is + # considered to have failed. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:283 + def timeout_interval; end + + # @!attribute [rw] timeout_interval + # @return [Fixnum] Number of seconds the task can run before it is + # considered to have failed. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:290 + def timeout_interval=(value); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:294 + def <<(task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:357 + def calculate_next_interval(start_time); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:339 + def execute_task(completion, age_when_scheduled); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:298 + def ns_initialize(opts, &task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:327 + def ns_kill_execution; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:321 + def ns_shutdown_execution; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:294 + def post(*args, &task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:333 + def schedule_next_task(interval = T.unsafe(nil)); end + + class << self + # Create and execute a new `TimerTask`. + # + # @!macro timer_task_initialize + # + # @example + # task = Concurrent::TimerTask.execute(execution_interval: 10){ print "Hello World\n" } + # task.running? #=> true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:254 + def execute(opts = T.unsafe(nil), &task); end + end +end + +# Default `:interval_type` +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:182 +Concurrent::TimerTask::DEFAULT_INTERVAL_TYPE = T.let(T.unsafe(nil), Symbol) + +# Default `:execution_interval` in seconds. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:171 +Concurrent::TimerTask::EXECUTION_INTERVAL = T.let(T.unsafe(nil), Integer) + +# Maintain the interval between the end of one execution and the start of the next execution. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:174 +Concurrent::TimerTask::FIXED_DELAY = T.let(T.unsafe(nil), Symbol) + +# Maintain the interval between the start of one execution and the start of the next. +# If execution time exceeds the interval, the next execution will start immediately +# after the previous execution finishes. Executions will not run concurrently. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:179 +Concurrent::TimerTask::FIXED_RATE = T.let(T.unsafe(nil), Symbol) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:153 +class Concurrent::Transaction + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:162 + def initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:192 + def abort; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:196 + def commit; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:177 + def open(tvar); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:166 + def read(tvar); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:206 + def unlock; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:171 + def write(tvar, value); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:212 + def current; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:216 + def current=(transaction); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:155 +Concurrent::Transaction::ABORTED = T.let(T.unsafe(nil), Object) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:159 +class Concurrent::Transaction::AbortError < ::StandardError; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:160 +class Concurrent::Transaction::LeaveError < ::StandardError; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 +class Concurrent::Transaction::OpenEntry < ::Struct + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def modified; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def modified=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def value; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def value=(_); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def [](*_arg0); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def keyword_init?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def new(*_arg0); end + end +end + +# A fixed size array with volatile (synchronized, thread safe) getters/setters. +# Mixes in Ruby's `Enumerable` module for enhanced search, sort, and traversal. +# +# @example +# tuple = Concurrent::Tuple.new(16) +# +# tuple.set(0, :foo) #=> :foo | volatile write +# tuple.get(0) #=> :foo | volatile read +# tuple.compare_and_set(0, :foo, :bar) #=> true | strong CAS +# tuple.cas(0, :foo, :baz) #=> false | strong CAS +# tuple.get(0) #=> :bar | volatile read +# +# @see https://en.wikipedia.org/wiki/Tuple Tuple entry at Wikipedia +# @see http://www.erlang.org/doc/reference_manual/data_types.html#id70396 Erlang Tuple +# @see http://ruby-doc.org/core-2.2.2/Enumerable.html Enumerable +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:20 +class Concurrent::Tuple + include ::Enumerable + + # Create a new tuple of the given size. + # + # @param [Integer] size the number of elements in the tuple + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:29 + def initialize(size); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:73 + def cas(i, old_value, new_value); end + + # Set the value at the given index to the new value if and only if the current + # value matches the given old value. + # + # @param [Integer] i the index for the element to set + # @param [Object] old_value the value to compare against the current value + # @param [Object] new_value the value to set at the given index + # + # @return [Boolean] true if the value at the given element was set else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:69 + def compare_and_set(i, old_value, new_value); end + + # Calls the given block once for each element in self, passing that element as a parameter. + # + # @yieldparam [Object] ref the `Concurrent::AtomicReference` object at the current index + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:78 + def each; end + + # Get the value of the element at the given index. + # + # @param [Integer] i the index from which to retrieve the value + # @return [Object] the value at the given index or nil if the index is out of bounds + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:43 + def get(i); end + + # Set the element at the given index to the given value + # + # @param [Integer] i the index for the element to set + # @param [Object] value the value to set at the given index + # + # @return [Object] the new value of the element at the given index or nil if the index is out of bounds + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:55 + def set(i, value); end + + # The (fixed) size of the tuple. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:24 + def size; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:47 + def volatile_get(i); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:59 + def volatile_set(i, value); end +end + +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:3 +module Concurrent::Utility; end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:6 +module Concurrent::Utility::EngineDetector + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:7 + def on_cruby?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:11 + def on_jruby?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:27 + def on_linux?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:23 + def on_osx?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:15 + def on_truffleruby?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:19 + def on_windows?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:31 + def ruby_version(version = T.unsafe(nil), comparison, major, minor, patch); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:9 +module Concurrent::Utility::NativeExtensionLoader + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:11 + def allow_c_extensions?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:15 + def c_extensions_loaded?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:19 + def load_native_extensions; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:50 + def java_extensions_loaded?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:38 + def load_error_path(error); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:46 + def set_c_extensions_loaded; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:54 + def set_java_extensions_loaded; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:58 + def try_load_c_extension(path); end +end + +# @private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:5 +module Concurrent::Utility::NativeInteger + extend ::Concurrent::Utility::NativeInteger + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:24 + def ensure_integer(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:31 + def ensure_integer_and_bounds(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:17 + def ensure_lower_bound(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:37 + def ensure_positive(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:44 + def ensure_positive_and_no_zero(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:10 + def ensure_upper_bound(value); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:8 +Concurrent::Utility::NativeInteger::MAX_VALUE = T.let(T.unsafe(nil), Integer) + +# http://stackoverflow.com/questions/535721/ruby-max-integer +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:7 +Concurrent::Utility::NativeInteger::MIN_VALUE = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:10 +class Concurrent::Utility::ProcessorCounter + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:11 + def initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:26 + def available_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:41 + def cpu_quota; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:45 + def cpu_shares; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:22 + def physical_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:18 + def processor_count; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:104 + def compute_cpu_quota; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:124 + def compute_cpu_shares; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:59 + def compute_physical_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:51 + def compute_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:99 + def run(command); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/version.rb:2 +Concurrent::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/connection_pool@2.5.4.rbi b/sorbet/rbi/gems/connection_pool@3.0.2.rbi similarity index 100% rename from sorbet/rbi/gems/connection_pool@2.5.4.rbi rename to sorbet/rbi/gems/connection_pool@3.0.2.rbi diff --git a/sorbet/rbi/gems/i18n@1.14.7.rbi b/sorbet/rbi/gems/i18n@1.14.7.rbi deleted file mode 100644 index fa6c663..0000000 --- a/sorbet/rbi/gems/i18n@1.14.7.rbi +++ /dev/null @@ -1,9 +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/i18n@1.14.8.rbi b/sorbet/rbi/gems/i18n@1.14.8.rbi new file mode 100644 index 0000000..2fd9c08 --- /dev/null +++ b/sorbet/rbi/gems/i18n@1.14.8.rbi @@ -0,0 +1,2255 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `i18n` gem. +# Please instead update this file by running `bin/tapioca gem i18n`. + + +# pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:15 +module GetText; end + +# pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:17 +class GetText::PoParser < ::Racc::Parser + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:19 + def _(x); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:282 + def _reduce_10(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:295 + def _reduce_12(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:302 + def _reduce_13(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:309 + def _reduce_14(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:316 + def _reduce_15(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:235 + def _reduce_5(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:246 + def _reduce_8(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:264 + def _reduce_9(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:323 + def _reduce_none(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:23 + def next_token; end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:23 + def on_comment(comment); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:23 + def on_message(msgid, msgstr); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:23 + def parse(str, data, ignore_fuzzy = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:23 + def unescape(orig); end +end + +# pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:184 +GetText::PoParser::Racc_arg = T.let(T.unsafe(nil), Array) + +# pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:221 +GetText::PoParser::Racc_debug_parser = T.let(T.unsafe(nil), TrueClass) + +# pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:200 +GetText::PoParser::Racc_token_to_s_table = T.let(T.unsafe(nil), Array) + +# This module allows you to easily cache all responses from the backend - thus +# speeding up the I18n aspects of your application quite a bit. +# +# To enable caching you can simply include the Cache module to the Simple +# backend - or whatever other backend you are using: +# +# I18n::Backend::Simple.send(:include, I18n::Backend::Cache) +# +# You will also need to set a cache store implementation that you want to use: +# +# I18n.cache_store = ActiveSupport::Cache.lookup_store(:memory_store) +# +# You can use any cache implementation you want that provides the same API as +# ActiveSupport::Cache (only the methods #fetch and #write are being used). +# +# The cache_key implementation by default assumes you pass values that return +# a valid key from #hash (see +# https://www.ruby-doc.org/core/classes/Object.html#M000337). However, you can +# configure your own digest method via which responds to #hexdigest (see +# https://ruby-doc.org/stdlib/libdoc/openssl/rdoc/OpenSSL/Digest.html): +# +# I18n.cache_key_digest = OpenSSL::Digest::SHA256.new +# +# If you use a lambda as a default value in your translation like this: +# +# I18n.t(:"date.order", :default => lambda {[:month, :day, :year]}) +# +# Then you will always have a cache miss, because each time this method +# is called the lambda will have a different hash value. If you know +# the result of the lambda is a constant as in the example above, then +# to cache this you can make the lambda a constant, like this: +# +# DEFAULT_DATE_ORDER = lambda {[:month, :day, :year]} +# ... +# I18n.t(:"date.order", :default => DEFAULT_DATE_ORDER) +# +# If the lambda may result in different values for each call then consider +# also using the Memoize backend. +# +# The Cascade module adds the ability to do cascading lookups to backends that +# are compatible to the Simple backend. +# +# By cascading lookups we mean that for any key that can not be found the +# Cascade module strips one segment off the scope part of the key and then +# tries to look up the key in that scope. +# +# E.g. when a lookup for the key :"foo.bar.baz" does not yield a result then +# the segment :bar will be stripped off the scope part :"foo.bar" and the new +# scope :foo will be used to look up the key :baz. If that does not succeed +# then the remaining scope segment :foo will be omitted, too, and again the +# key :baz will be looked up (now with no scope). +# +# To enable a cascading lookup one passes the :cascade option: +# +# I18n.t(:'foo.bar.baz', :cascade => true) +# +# This will return the first translation found for :"foo.bar.baz", :"foo.baz" +# or :baz in this order. +# +# The cascading lookup takes precedence over resolving any given defaults. +# I.e. defaults will kick in after the cascading lookups haven't succeeded. +# +# This behavior is useful for libraries like ActiveRecord validations where +# the library wants to give users a bunch of more or less fine-grained options +# of scopes for a particular key. +# +# Thanks to Clemens Kofler for the initial idea and implementation! See +# http://github.com/clemens/i18n-cascading-backend +# I18n locale fallbacks are useful when you want your application to use +# translations from other locales when translations for the current locale are +# missing. E.g. you might want to use :en translations when translations in +# your applications main locale :de are missing. +# +# To enable locale fallbacks you can simply include the Fallbacks module to +# the Simple backend - or whatever other backend you are using: +# +# I18n::Backend::Simple.include(I18n::Backend::Fallbacks) +# The InterpolationCompiler module contains optimizations that can tremendously +# speed up the interpolation process on the Simple backend. +# +# It works by defining a pre-compiled method on stored translation Strings that +# already bring all the knowledge about contained interpolation variables etc. +# so that the actual recurring interpolation will be very fast. +# +# To enable pre-compiled interpolations you can simply include the +# InterpolationCompiler module to the Simple backend: +# +# I18n::Backend::Simple.include(I18n::Backend::InterpolationCompiler) +# +# Note that InterpolationCompiler does not yield meaningful results and consequently +# should not be used with Ruby 1.9 (YARV) but improves performance everywhere else +# (jRuby, Rubinius). +# Memoize module simply memoizes the values returned by lookup using +# a flat hash and can tremendously speed up the lookup process in a backend. +# +# To enable it you can simply include the Memoize module to your backend: +# +# I18n::Backend::Simple.include(I18n::Backend::Memoize) +# +# Notice that it's the responsibility of the backend to define whenever the +# cache should be cleaned. +# I18n translation metadata is useful when you want to access information +# about how a translation was looked up, pluralized or interpolated in +# your application. +# +# msg = I18n.t(:message, :default => 'Hi!', :scope => :foo) +# msg.translation_metadata +# # => { :key => :message, :scope => :foo, :default => 'Hi!' } +# +# If a :count option was passed to #translate it will be set to the metadata. +# Likewise, if any interpolation variables were passed they will also be set. +# +# To enable translation metadata you can simply include the Metadata module +# into the Simple backend class - or whatever other backend you are using: +# +# I18n::Backend::Simple.include(I18n::Backend::Metadata) +# +# I18n Pluralization are useful when you want your application to +# customize pluralization rules. +# +# To enable locale specific pluralizations you can simply include the +# Pluralization module to the Simple backend - or whatever other backend you +# are using. +# +# I18n::Backend::Simple.include(I18n::Backend::Pluralization) +# +# You also need to make sure to provide pluralization algorithms to the +# backend, i.e. include them to your I18n.load_path accordingly. +# heavily based on Masao Mutoh's gettext String interpolation extension +# http://github.com/mutoh/gettext/blob/f6566738b981fe0952548c421042ad1e0cdfb31e/lib/gettext/core_ext/string.rb +# Locale Fallbacks +# +# Extends the I18n module to hold a fallbacks instance which is set to an +# instance of I18n::Locale::Fallbacks by default but can be swapped with a +# different implementation. +# +# Locale fallbacks will compute a number of fallback locales for a given locale. +# For example: +# +#

+# I18n.fallbacks[:"es-MX"] # => [:"es-MX", :es, :en] 
+# +# Locale fallbacks always fall back to +# +# * all parent locales of a given locale (e.g. :es for :"es-MX") first, +# * the current default locales and all of their parents second +# +# The default locales are set to [] by default but can be set to something else. +# +# One can additionally add any number of additional fallback locales manually. +# These will be added before the default locales to the fallback chain. For +# example: +# +# # using a custom locale as default fallback locale +# +# I18n.fallbacks = I18n::Locale::Fallbacks.new(:"en-GB", :"de-AT" => :de, :"de-CH" => :de) +# I18n.fallbacks[:"de-AT"] # => [:"de-AT", :de, :"en-GB", :en] +# I18n.fallbacks[:"de-CH"] # => [:"de-CH", :de, :"en-GB", :en] +# +# # mapping fallbacks to an existing instance +# +# # people speaking Catalan also speak Spanish as spoken in Spain +# fallbacks = I18n.fallbacks +# fallbacks.map(:ca => :"es-ES") +# fallbacks[:ca] # => [:ca, :"es-ES", :es, :"en-US", :en] +# +# # people speaking Arabian as spoken in Palestine also speak Hebrew as spoken in Israel +# fallbacks.map(:"ar-PS" => :"he-IL") +# fallbacks[:"ar-PS"] # => [:"ar-PS", :ar, :"he-IL", :he, :"en-US", :en] +# fallbacks[:"ar-EG"] # => [:"ar-EG", :ar, :"en-US", :en] +# +# # people speaking Sami as spoken in Finland also speak Swedish and Finnish as spoken in Finland +# fallbacks.map(:sms => [:"se-FI", :"fi-FI"]) +# fallbacks[:sms] # => [:sms, :"se-FI", :se, :"fi-FI", :fi, :"en-US", :en] +# RFC 4646/47 compliant Locale tag implementation that parses locale tags to +# subtags such as language, script, region, variant etc. +# +# For more information see by http://en.wikipedia.org/wiki/IETF_language_tag +# +# Rfc4646::Parser does not implement grandfathered tags. +# Simple Locale tag implementation that computes subtags by simply splitting +# the locale tag at '-' occurrences. +# +# pkg:gem/i18n#lib/i18n/version.rb:3 +module I18n + extend ::I18n::Base + + class << self + # pkg:gem/i18n#lib/i18n/backend/cache.rb:64 + def cache_key_digest; end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:68 + def cache_key_digest=(key_digest); end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:56 + def cache_namespace; end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:60 + def cache_namespace=(namespace); end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:48 + def cache_store; end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:52 + def cache_store=(store); end + + # Returns the current fallbacks implementation. Defaults to +I18n::Locale::Fallbacks+. + # + # pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:17 + def fallbacks; end + + # Sets the current fallbacks implementation. Use this to set a different fallbacks implementation. + # + # pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:23 + def fallbacks=(fallbacks); end + + # Return String or raises MissingInterpolationArgument exception. + # Missing argument's logic is handled by I18n.config.missing_interpolation_argument_handler. + # + # pkg:gem/i18n#lib/i18n/interpolate/ruby.rb:23 + def interpolate(string, values); end + + # pkg:gem/i18n#lib/i18n/interpolate/ruby.rb:29 + def interpolate_hash(string, values); end + + # pkg:gem/i18n#lib/i18n.rb:38 + def new_double_nested_cache; end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:72 + def perform_caching?; end + + # Marks a key as reserved. Reserved keys are used internally, + # and can't also be used for interpolation. If you are using any + # extra keys as I18n options, you should call I18n.reserve_key + # before any I18n.translate (etc) calls are made. + # + # pkg:gem/i18n#lib/i18n.rb:46 + def reserve_key(key); end + + # pkg:gem/i18n#lib/i18n.rb:51 + def reserved_keys_pattern; end + end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:14 +class I18n::ArgumentError < ::ArgumentError; end + +# pkg:gem/i18n#lib/i18n/backend.rb:4 +module I18n::Backend; end + +# pkg:gem/i18n#lib/i18n/backend/base.rb:8 +module I18n::Backend::Base + include ::I18n::Backend::Transliterator + + # Returns an array of locales for which translations are available + # ignoring the reserved translation meta data key :i18n. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:97 + def available_locales; end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:105 + def eager_load!; end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:71 + def exists?(locale, key, options = T.unsafe(nil)); end + + # Accepts a list of paths to translation files. Loads translations from + # plain Ruby (*.rb), YAML files (*.yml), or JSON files (*.json). See #load_rb, #load_yml, and #load_json + # for details. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:14 + def load_translations(*filenames); end + + # Acts the same as +strftime+, but uses a localized version of the + # format string. Takes a key from the date/time formats translations as + # a format argument (e.g., :short in :'date.formats'). + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:78 + def localize(locale, object, format = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:101 + def reload!; end + + # This method receives a locale, a data hash and options for storing translations. + # Should be implemented + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:24 + def store_translations(locale, data, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:28 + def translate(locale, key, options = T.unsafe(nil)); end + + protected + + # Deep interpolation + # + # deep_interpolate { people: { ann: "Ann is %{ann}", john: "John is %{john}" } }, + # ann: 'good', john: 'big' + # #=> { people: { ann: "Ann is good", john: "John is big" } } + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:217 + def deep_interpolate(locale, data, values = T.unsafe(nil)); end + + # Evaluates defaults. + # If given subject is an Array, it walks the array and returns the + # first translation that can be resolved. Otherwise it tries to resolve + # the translation directly. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:128 + def default(locale, object, subject, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:111 + def eager_loaded?; end + + # Interpolates values into a given subject. + # + # if the given subject is a string then: + # method interpolates "file %{file} opened by %%{user}", :file => 'test.txt', :user => 'Mr. X' + # # => "file test.txt opened by %{user}" + # + # if the given subject is an array then: + # each element of the array is recursively interpolated (until it finds a string) + # method interpolates ["yes, %{user}", ["maybe no, %{user}", "no, %{user}"]], :user => "bartuz" + # # => ["yes, bartuz", ["maybe no, bartuz", "no, bartuz"]] + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:201 + def interpolate(locale, subject, values = T.unsafe(nil)); end + + # Loads a single translations file by delegating to #load_rb or + # #load_yml depending on the file extension and directly merges the + # data to the existing translations. Raises I18n::UnknownFileType + # for all other file extensions. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:240 + def load_file(filename); end + + # Loads a JSON translations file. The data must have locales as + # toplevel keys. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:276 + def load_json(filename); end + + # Loads a plain Ruby translations file. eval'ing the file must yield + # a Hash containing translation data with locales as toplevel keys. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:254 + def load_rb(filename); end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:272 + def load_yaml(filename); end + + # Loads a YAML translations file. The data must have locales as + # toplevel keys. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:261 + def load_yml(filename); end + + # The method which actually looks up for the translation in the store. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:116 + def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:308 + def pluralization_key(entry, count); end + + # Picks a translation from a pluralized mnemonic subkey according to English + # pluralization rules : + # - It will pick the :one subkey if count is equal to 1. + # - It will pick the :other subkey otherwise. + # - It will pick the :zero subkey in the special case where count is + # equal to 0 and there is a :zero subkey present. This behaviour is + # not standard with regards to the CLDR pluralization rules. + # Other backends can implement more flexible or complex pluralization rules. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:182 + def pluralize(locale, entry, count); end + + # Resolves a translation. + # If the given subject is a Symbol, it will be translated with the + # given options. If it is a Proc then it will be evaluated. All other + # subjects will be returned directly. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:150 + def resolve(locale, object, subject, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:172 + def resolve_entry(locale, object, subject, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:120 + def subtrees?; end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:289 + def translate_localization_format(locale, object, format, options); end +end + +# TODO Should the cache be cleared if new translations are stored? +# +# pkg:gem/i18n#lib/i18n/backend/cache.rb:79 +module I18n::Backend::Cache + # pkg:gem/i18n#lib/i18n/backend/cache.rb:80 + def translate(locale, key, options = T.unsafe(nil)); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:93 + def _fetch(cache_key, &block); end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:101 + def cache_key(locale, key, options); end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:86 + def fetch(cache_key, &block); end + + private + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:108 + def digest_item(key); end +end + +# Overwrites the Base load_file method to cache loaded file contents. +# +# pkg:gem/i18n#lib/i18n/backend/cache_file.rb:8 +module I18n::Backend::CacheFile + # Optionally provide path_roots array to normalize filename paths, + # to make the cached i18n data portable across environments. + # + # pkg:gem/i18n#lib/i18n/backend/cache_file.rb:11 + def path_roots; end + + # Optionally provide path_roots array to normalize filename paths, + # to make the cached i18n data portable across environments. + # + # pkg:gem/i18n#lib/i18n/backend/cache_file.rb:11 + def path_roots=(_arg0); end + + protected + + # Track loaded translation files in the `i18n.load_file` scope, + # and skip loading the file if its contents are still up-to-date. + # + # pkg:gem/i18n#lib/i18n/backend/cache_file.rb:17 + def load_file(filename); end + + # Translate absolute filename to relative path for i18n key. + # + # pkg:gem/i18n#lib/i18n/backend/cache_file.rb:28 + def normalized_path(file); end +end + +# pkg:gem/i18n#lib/i18n/backend/cascade.rb:35 +module I18n::Backend::Cascade + # pkg:gem/i18n#lib/i18n/backend/cascade.rb:36 + def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end +end + +# Backend that chains multiple other backends and checks each of them when +# a translation needs to be looked up. This is useful when you want to use +# standard translations with a Simple backend but store custom application +# translations in a database or other backends. +# +# To use the Chain backend instantiate it and set it to the I18n module. +# You can add chained backends through the initializer or backends +# accessor: +# +# # preserves the existing Simple backend set to I18n.backend +# I18n.backend = I18n::Backend::Chain.new(I18n::Backend::ActiveRecord.new, I18n.backend) +# +# The implementation assumes that all backends added to the Chain implement +# a lookup method with the same API as Simple backend does. +# +# Fallback translations using the :default option are only used by the last backend of a chain. +# +# pkg:gem/i18n#lib/i18n/backend/chain.rb:21 +class I18n::Backend::Chain + include ::I18n::Backend::Transliterator + include ::I18n::Backend::Base + include ::I18n::Backend::Chain::Implementation +end + +# pkg:gem/i18n#lib/i18n/backend/chain.rb:22 +module I18n::Backend::Chain::Implementation + include ::I18n::Backend::Transliterator + include ::I18n::Backend::Base + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:27 + def initialize(*backends); end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:52 + def available_locales; end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:25 + def backends; end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:25 + def backends=(_arg0); end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:44 + def eager_load!; end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:76 + def exists?(locale, key, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:31 + def initialized?; end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:82 + def localize(locale, object, format = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:40 + def reload!; end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:48 + def store_translations(locale, data, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:56 + def translate(locale, key, default_options = T.unsafe(nil)); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:92 + def init_translations; end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:108 + def namespace_lookup?(result, options); end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:98 + def translations; end + + private + + # This is approximately what gets used in ActiveSupport. + # However since we are not guaranteed to run in an ActiveSupport context + # it is wise to have our own copy. We underscore it + # to not pollute the namespace of the including class. + # + # pkg:gem/i18n#lib/i18n/backend/chain.rb:117 + def _deep_merge(hash, other_hash); end +end + +# pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:30 +module I18n::Backend::Fallbacks + # pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:98 + def exists?(locale, key, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:89 + def extract_non_symbol_default!(options); end + + # pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:67 + def resolve_entry(locale, object, subject, options = T.unsafe(nil)); end + + # Overwrites the Base backend translate method so that it will try each + # locale given by I18n.fallbacks for the given locale. E.g. for the + # locale :"de-DE" it might try the locales :"de-DE", :de and :en + # (depends on the fallbacks implementation) until it finds a result with + # the given options. If it does not find any result for any of the + # locales it will then throw MissingTranslation as usual. + # + # The default option takes precedence over fallback locales only when + # it's a Symbol. When the default contains a String, Proc or Hash + # it is evaluated last after all the fallback locales have been tried. + # + # pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:41 + def translate(locale, key, options = T.unsafe(nil)); end + + private + + # Overwrite on_fallback to add specified logic when the fallback succeeds. + # + # pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:114 + def on_fallback(_original_locale, _fallback_locale, _key, _options); end +end + +# This module contains several helpers to assist flattening translations. +# You may want to flatten translations for: +# +# 1) speed up lookups, as in the Memoize backend; +# 2) In case you want to store translations in a data store, as in ActiveRecord backend; +# +# You can check both backends above for some examples. +# This module also keeps all links in a hash so they can be properly resolved when flattened. +# +# pkg:gem/i18n#lib/i18n/backend/flatten.rb:13 +module I18n::Backend::Flatten + # Flatten keys for nested Hashes by chaining up keys: + # + # >> { "a" => { "b" => { "c" => "d", "e" => "f" }, "g" => "h" }, "i" => "j"}.wind + # => { "a.b.c" => "d", "a.b.e" => "f", "a.g" => "h", "i" => "j" } + # + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:59 + def flatten_keys(hash, escape, prev_key = T.unsafe(nil), &block); end + + # Receives a hash of translations (where the key is a locale and + # the value is another hash) and return a hash with all + # translations flattened. + # + # Nested hashes are included in the flattened hash just if subtree + # is true and Symbols are automatically stored as links. + # + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:74 + def flatten_translations(locale, data, escape, subtree); end + + # Store flattened links. + # + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:50 + def links; end + + # Shortcut to I18n::Backend::Flatten.normalize_flat_keys + # and then resolve_links. + # + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:44 + def normalize_flat_keys(locale, key, scope, separator); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:112 + def escape_default_separator(key); end + + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:106 + def find_link(locale, key); end + + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:93 + def resolve_link(locale, key); end + + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:89 + def store_link(locale, key, link); end + + class << self + # Receives a string and escape the default separator. + # + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:38 + def escape_default_separator(key); end + + # normalize_keys the flatten way. This method is significantly faster + # and creates way less objects than the one at I18n.normalize_keys. + # It also handles escaping the translation keys. + # + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:20 + def normalize_flat_keys(locale, key, scope, separator); end + end +end + +# pkg:gem/i18n#lib/i18n/backend/flatten.rb:15 +I18n::Backend::Flatten::FLATTEN_SEPARATOR = T.let(T.unsafe(nil), String) + +# pkg:gem/i18n#lib/i18n/backend/flatten.rb:14 +I18n::Backend::Flatten::SEPARATOR_ESCAPE_CHAR = T.let(T.unsafe(nil), String) + +# Experimental support for using Gettext po files to store translations. +# +# To use this you can simply include the module to the Simple backend - or +# whatever other backend you are using. +# +# I18n::Backend::Simple.include(I18n::Backend::Gettext) +# +# Now you should be able to include your Gettext translation (*.po) files to +# the +I18n.load_path+ so they're loaded to the backend and you can use them as +# usual: +# +# I18n.load_path += Dir["path/to/locales/*.po"] +# +# Following the Gettext convention this implementation expects that your +# translation files are named by their locales. E.g. the file en.po would +# contain the translations for the English locale. +# +# To translate text you must use one of the translate methods provided by +# I18n::Gettext::Helpers. +# +# include I18n::Gettext::Helpers +# puts _("some string") +# +# Without it strings containing periods (".") will not be translated. +# +# pkg:gem/i18n#lib/i18n/backend/gettext.rb:33 +module I18n::Backend::Gettext + protected + + # pkg:gem/i18n#lib/i18n/backend/gettext.rb:41 + def load_po(filename); end + + # pkg:gem/i18n#lib/i18n/backend/gettext.rb:51 + def normalize(locale, data); end + + # pkg:gem/i18n#lib/i18n/backend/gettext.rb:68 + def normalize_pluralization(locale, key, value); end + + # pkg:gem/i18n#lib/i18n/backend/gettext.rb:47 + def parse(filename); end +end + +# pkg:gem/i18n#lib/i18n/backend/gettext.rb:34 +class I18n::Backend::Gettext::PoData < ::Hash + # pkg:gem/i18n#lib/i18n/backend/gettext.rb:35 + def set_comment(msgid_or_sym, comment); end +end + +# pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:20 +module I18n::Backend::InterpolationCompiler + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:98 + def interpolate(locale, string, values); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:108 + def store_translations(locale, data, options = T.unsafe(nil)); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:114 + def compile_all_strings_in(data); end +end + +# pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:21 +module I18n::Backend::InterpolationCompiler::Compiler + extend ::I18n::Backend::InterpolationCompiler::Compiler + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:26 + def compile_if_an_interpolation(string); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:39 + def interpolated_str?(str); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:59 + def compile_interpolation_token(key); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:49 + def compiled_interpolation_body(str); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:72 + def direct_key(key); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:92 + def escape_key_sym(key); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:88 + def escape_plain_str(str); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:55 + def handle_interpolation_token(token); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:68 + def interpolate_key(key); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:63 + def interpolate_or_raise_missing(key); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:80 + def missing_key(key); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:76 + def nil_key(key); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:84 + def reserved_key(key); end + + # tokenize("foo %{bar} baz %%{buz}") # => ["foo ", "%{bar}", " baz ", "%%{buz}"] + # + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:45 + def tokenize(str); end +end + +# pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:24 +I18n::Backend::InterpolationCompiler::Compiler::TOKENIZER = T.let(T.unsafe(nil), Regexp) + +# This is a basic backend for key value stores. It receives on +# initialization the store, which should respond to three methods: +# +# * store#[](key) - Used to get a value +# * store#[]=(key, value) - Used to set a value +# * store#keys - Used to get all keys +# +# Since these stores only supports string, all values are converted +# to JSON before being stored, allowing it to also store booleans, +# hashes and arrays. However, this store does not support Procs. +# +# As the ActiveRecord backend, Symbols are just supported when loading +# translations from the filesystem or through explicit store translations. +# +# Also, avoid calling I18n.available_locales since it's a somehow +# expensive operation in most stores. +# +# == Example +# +# To setup I18n to use TokyoCabinet in memory is quite straightforward: +# +# require 'rufus/tokyo/cabinet' # gem install rufus-tokyo +# I18n.backend = I18n::Backend::KeyValue.new(Rufus::Tokyo::Cabinet.new('*')) +# +# == Performance +# +# You may make this backend even faster by including the Memoize module. +# However, notice that you should properly clear the cache if you change +# values directly in the key-store. +# +# == Subtrees +# +# In most backends, you are allowed to retrieve part of a translation tree: +# +# I18n.backend.store_translations :en, :foo => { :bar => :baz } +# I18n.t "foo" #=> { :bar => :baz } +# +# This backend supports this feature by default, but it slows down the storage +# of new data considerably and makes hard to delete entries. That said, you are +# allowed to disable the storage of subtrees on initialization: +# +# I18n::Backend::KeyValue.new(@store, false) +# +# This is useful if you are using a KeyValue backend chained to a Simple backend. +# +# pkg:gem/i18n#lib/i18n/backend/key_value.rb:69 +class I18n::Backend::KeyValue + include ::I18n::Backend::Flatten + include ::I18n::Backend::Transliterator + include ::I18n::Backend::Base + include ::I18n::Backend::KeyValue::Implementation +end + +# pkg:gem/i18n#lib/i18n/backend/key_value.rb:70 +module I18n::Backend::KeyValue::Implementation + include ::I18n::Backend::Flatten + include ::I18n::Backend::Transliterator + include ::I18n::Backend::Base + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:75 + def initialize(store, subtrees = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:102 + def available_locales; end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:79 + def initialized?; end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:71 + def store; end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:71 + def store=(_arg0); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:83 + def store_translations(locale, data, options = T.unsafe(nil)); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:124 + def init_translations; end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:136 + def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:150 + def pluralize(locale, entry, count); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:132 + def subtrees?; end + + # Queries the translations from the key-value store and converts + # them into a hash such as the one returned from loading the + # haml files + # + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:115 + def translations; end +end + +# pkg:gem/i18n#lib/i18n/backend/key_value.rb:161 +class I18n::Backend::KeyValue::SubtreeProxy + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:162 + def initialize(master_key, store); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:172 + def [](key); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:168 + def has_key?(key); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:196 + def inspect; end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:188 + def instance_of?(klass); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:183 + def is_a?(klass); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:186 + def kind_of?(klass); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:192 + def nil?; end +end + +# pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:65 +class I18n::Backend::LazyLoadable < ::I18n::Backend::Simple + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:66 + def initialize(lazy_load: T.unsafe(nil)); end + + # Parse the load path and extract all locales. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:99 + def available_locales; end + + # Eager loading is not supported in the lazy context. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:90 + def eager_load!; end + + # Returns whether the current locale is initialized. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:71 + def initialized?; end + + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:107 + def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end + + # Clean up translations and uninitialize all locales. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:80 + def reload!; end + + protected + + # Load translations from files that belong to the current locale. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:121 + def init_translations; end + + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:133 + def initialized_locales; end + + private + + # Checks if a filename is named in correspondence to the translations it loaded. + # The locale extracted from the path must be the single locale loaded in the translations. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:175 + def assert_file_named_correctly!(file, translations); end + + # Select all files from I18n load path that belong to current locale. + # These files must start with the locale identifier (ie. "en", "pt-BR"), + # followed by an "_" demarcation to separate proceeding text. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:167 + def filenames_for_current_locale; end + + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:139 + def lazy_load?; end + + # Loads each file supplied and asserts that the file only loads + # translations as expected by the name. The method returns a list of + # errors corresponding to offending files. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:152 + def load_translations_and_collect_file_errors(files); end +end + +# pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:143 +class I18n::Backend::LazyLoadable::FilenameIncorrect < ::StandardError + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:144 + def initialize(file, expected_locale, unexpected_locales); end +end + +# Backend that lazy loads translations based on the current locale. This +# implementation avoids loading all translations up front. Instead, it only +# loads the translations that belong to the current locale. This offers a +# performance incentive in local development and test environments for +# applications with many translations for many different locales. It's +# particularly useful when the application only refers to a single locales' +# translations at a time (ex. A Rails workload). The implementation +# identifies which translation files from the load path belong to the +# current locale by pattern matching against their path name. +# +# Specifically, a translation file is considered to belong to a locale if: +# a) the filename is in the I18n load path +# b) the filename ends in a supported extension (ie. .yml, .json, .po, .rb) +# c) the filename starts with the locale identifier +# d) the locale identifier and optional proceeding text is separated by an underscore, ie. "_". +# +# Examples: +# Valid files that will be selected by this backend: +# +# "files/locales/en_translation.yml" (Selected for locale "en") +# "files/locales/fr.po" (Selected for locale "fr") +# +# Invalid files that won't be selected by this backend: +# +# "files/locales/translation-file" +# "files/locales/en-translation.unsupported" +# "files/locales/french/translation.yml" +# "files/locales/fr/translation.yml" +# +# The implementation uses this assumption to defer the loading of +# translation files until the current locale actually requires them. +# +# The backend has two working modes: lazy_load and eager_load. +# +# Note: This backend should only be enabled in test environments! +# When the mode is set to false, the backend behaves exactly like the +# Simple backend, with an additional check that the paths being loaded +# abide by the format. If paths can't be matched to the format, an error is raised. +# +# You can configure lazy loaded backends through the initializer or backends +# accessor: +# +# # In test environments +# +# I18n.backend = I18n::Backend::LazyLoadable.new(lazy_load: true) +# +# # In other environments, such as production and CI +# +# I18n.backend = I18n::Backend::LazyLoadable.new(lazy_load: false) # default +# +# pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:55 +class I18n::Backend::LocaleExtractor + class << self + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:57 + def locale_from_path(path); end + end +end + +# pkg:gem/i18n#lib/i18n/backend/memoize.rb:14 +module I18n::Backend::Memoize + # pkg:gem/i18n#lib/i18n/backend/memoize.rb:15 + def available_locales; end + + # pkg:gem/i18n#lib/i18n/backend/memoize.rb:29 + def eager_load!; end + + # pkg:gem/i18n#lib/i18n/backend/memoize.rb:24 + def reload!; end + + # pkg:gem/i18n#lib/i18n/backend/memoize.rb:19 + def store_translations(locale, data, options = T.unsafe(nil)); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/memoize.rb:37 + def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/memoize.rb:44 + def memoized_lookup; end + + # pkg:gem/i18n#lib/i18n/backend/memoize.rb:48 + def reset_memoizations!(locale = T.unsafe(nil)); end +end + +# pkg:gem/i18n#lib/i18n/backend/metadata.rb:21 +module I18n::Backend::Metadata + # pkg:gem/i18n#lib/i18n/backend/metadata.rb:52 + def interpolate(locale, entry, values = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/metadata.rb:57 + def pluralize(locale, entry, count); end + + # pkg:gem/i18n#lib/i18n/backend/metadata.rb:40 + def translate(locale, key, options = T.unsafe(nil)); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/metadata.rb:63 + def with_metadata(metadata, &block); end + + class << self + # pkg:gem/i18n#lib/i18n/backend/metadata.rb:23 + def included(base); end + end +end + +# pkg:gem/i18n#lib/i18n/backend/pluralization.rb:16 +module I18n::Backend::Pluralization + # Overwrites the Base backend translate method so that it will check the + # translation meta data space (:i18n) for a locale specific pluralization + # rule and use it to pluralize the given entry. I.e., the library expects + # pluralization rules to be stored at I18n.t(:'i18n.plural.rule') + # + # Pluralization rules are expected to respond to #call(count) and + # return a pluralization key. Valid keys depend on the pluralization + # rules for the locale, as defined in the CLDR. + # As of v41, 6 locale-specific plural categories are defined: + # :few, :many, :one, :other, :two, :zero + # + # n.b., The :one plural category does not imply the number 1. + # Instead, :one is a category for any number that behaves like 1 in + # that locale. For example, in some locales, :one is used for numbers + # that end in "1" (like 1, 21, 151) but that don't end in + # 11 (like 11, 111, 10311). + # Similar notes apply to the :two, and :zero plural categories. + # + # If you want to have different strings for the categories of count == 0 + # (e.g. "I don't have any cars") or count == 1 (e.g. "I have a single car") + # use the explicit `"0"` and `"1"` keys. + # https://unicode-org.github.io/cldr/ldml/tr35-numbers.html#Explicit_0_1_rules + # + # pkg:gem/i18n#lib/i18n/backend/pluralization.rb:39 + def pluralize(locale, entry, count); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/pluralization.rb:81 + def pluralizer(locale); end + + # pkg:gem/i18n#lib/i18n/backend/pluralization.rb:77 + def pluralizers; end + + private + + # Normalizes categories of 0.0 and 1.0 + # and returns the symbolic version + # + # pkg:gem/i18n#lib/i18n/backend/pluralization.rb:89 + def symbolic_count(count); end +end + +# A simple backend that reads translations from YAML files and stores them in +# an in-memory hash. Relies on the Base backend. +# +# The implementation is provided by a Implementation module allowing to easily +# extend Simple backend's behavior by including modules. E.g.: +# +# module I18n::Backend::Pluralization +# def pluralize(*args) +# # extended pluralization logic +# super +# end +# end +# +# I18n::Backend::Simple.include(I18n::Backend::Pluralization) +# +# pkg:gem/i18n#lib/i18n/backend/simple.rb:21 +class I18n::Backend::Simple + include ::I18n::Backend::Transliterator + include ::I18n::Backend::Base + include ::I18n::Backend::Simple::Implementation +end + +# pkg:gem/i18n#lib/i18n/backend/simple.rb:22 +module I18n::Backend::Simple::Implementation + include ::I18n::Backend::Transliterator + include ::I18n::Backend::Base + + # Get available locales from the translations hash + # + # pkg:gem/i18n#lib/i18n/backend/simple.rb:49 + def available_locales; end + + # pkg:gem/i18n#lib/i18n/backend/simple.rb:64 + def eager_load!; end + + # pkg:gem/i18n#lib/i18n/backend/simple.rb:28 + def initialized?; end + + # Clean up translations hash and set initialized to false on reload! + # + # pkg:gem/i18n#lib/i18n/backend/simple.rb:58 + def reload!; end + + # Stores translations for the given locale in memory. + # This uses a deep merge for the translations hash, so existing + # translations will be overwritten by new ones only at the deepest + # level of the hash. + # + # pkg:gem/i18n#lib/i18n/backend/simple.rb:36 + def store_translations(locale, data, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/simple.rb:69 + def translations(do_init: T.unsafe(nil)); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/simple.rb:83 + def init_translations; end + + # Looks up a translation from the translations hash. Returns nil if + # either key is nil, or locale, scope or key do not exist as a key in the + # nested translations hash. Splits keys or scopes containing dots + # into multiple keys, i.e. currency.format is regarded the same as + # %w(currency format). + # + # pkg:gem/i18n#lib/i18n/backend/simple.rb:93 + def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end +end + +# Mutex to ensure that concurrent translations loading will be thread-safe +# +# pkg:gem/i18n#lib/i18n/backend/simple.rb:26 +I18n::Backend::Simple::Implementation::MUTEX = T.let(T.unsafe(nil), Thread::Mutex) + +# pkg:gem/i18n#lib/i18n/backend/transliterator.rb:6 +module I18n::Backend::Transliterator + # Given a locale and a UTF-8 string, return the locale's ASCII + # approximation for the string. + # + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:11 + def transliterate(locale, string, replacement = T.unsafe(nil)); end + + class << self + # Get a transliterator instance. + # + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:19 + def get(rule = T.unsafe(nil)); end + end +end + +# pkg:gem/i18n#lib/i18n/backend/transliterator.rb:7 +I18n::Backend::Transliterator::DEFAULT_REPLACEMENT_CHAR = T.let(T.unsafe(nil), String) + +# A transliterator which accepts a Hash of characters as its translation +# rule. +# +# pkg:gem/i18n#lib/i18n/backend/transliterator.rb:42 +class I18n::Backend::Transliterator::HashTransliterator + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:74 + def initialize(rule = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:80 + def transliterate(string, replacement = T.unsafe(nil)); end + + private + + # Add transliteration rules to the approximations hash. + # + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:100 + def add(hash); end + + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:93 + def add_default_approximations; end + + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:89 + def approximations; end +end + +# pkg:gem/i18n#lib/i18n/backend/transliterator.rb:43 +I18n::Backend::Transliterator::HashTransliterator::DEFAULT_APPROXIMATIONS = T.let(T.unsafe(nil), Hash) + +# A transliterator which accepts a Proc as its transliteration rule. +# +# pkg:gem/i18n#lib/i18n/backend/transliterator.rb:30 +class I18n::Backend::Transliterator::ProcTransliterator + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:31 + def initialize(rule); end + + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:35 + def transliterate(string, replacement = T.unsafe(nil)); end +end + +# pkg:gem/i18n#lib/i18n.rb:55 +module I18n::Base + # pkg:gem/i18n#lib/i18n.rb:70 + def available_locales; end + + # pkg:gem/i18n#lib/i18n.rb:70 + def available_locales=(value); end + + # pkg:gem/i18n#lib/i18n.rb:387 + def available_locales_initialized?; end + + # pkg:gem/i18n#lib/i18n.rb:70 + def backend; end + + # pkg:gem/i18n#lib/i18n.rb:70 + def backend=(value); end + + # Gets I18n configuration object. + # + # pkg:gem/i18n#lib/i18n.rb:57 + def config; end + + # Sets I18n configuration object. + # + # pkg:gem/i18n#lib/i18n.rb:63 + def config=(value); end + + # pkg:gem/i18n#lib/i18n.rb:70 + def default_locale; end + + # pkg:gem/i18n#lib/i18n.rb:70 + def default_locale=(value); end + + # pkg:gem/i18n#lib/i18n.rb:70 + def default_separator; end + + # pkg:gem/i18n#lib/i18n.rb:70 + def default_separator=(value); end + + # Tells the backend to load translations now. Used in situations like the + # Rails production environment. Backends can implement whatever strategy + # is useful. + # + # pkg:gem/i18n#lib/i18n.rb:92 + def eager_load!; end + + # pkg:gem/i18n#lib/i18n.rb:70 + def enforce_available_locales; end + + # Raises an InvalidLocale exception when the passed locale is not available. + # + # pkg:gem/i18n#lib/i18n.rb:381 + def enforce_available_locales!(locale); end + + # pkg:gem/i18n#lib/i18n.rb:70 + def enforce_available_locales=(value); end + + # pkg:gem/i18n#lib/i18n.rb:70 + def exception_handler; end + + # pkg:gem/i18n#lib/i18n.rb:70 + def exception_handler=(value); end + + # Returns true if a translation exists for a given key, otherwise returns false. + # + # pkg:gem/i18n#lib/i18n.rb:266 + def exists?(key, _locale = T.unsafe(nil), locale: T.unsafe(nil), **options); end + + # Returns an array of interpolation keys for the given translation key + # + # *Examples* + # + # Suppose we have the following: + # I18n.t 'example.zero' == 'Zero interpolations' + # I18n.t 'example.one' == 'One interpolation %{foo}' + # I18n.t 'example.two' == 'Two interpolations %{foo} %{bar}' + # I18n.t 'example.three' == ['One %{foo}', 'Two %{bar}', 'Three %{baz}'] + # I18n.t 'example.one', locale: :other == 'One interpolation %{baz}' + # + # Then we can expect the following results: + # I18n.interpolation_keys('example.zero') #=> [] + # I18n.interpolation_keys('example.one') #=> ['foo'] + # I18n.interpolation_keys('example.two') #=> ['foo', 'bar'] + # I18n.interpolation_keys('example.three') #=> ['foo', 'bar', 'baz'] + # I18n.interpolation_keys('one', scope: 'example', locale: :other) #=> ['baz'] + # I18n.interpolation_keys('does-not-exist') #=> [] + # I18n.interpolation_keys('example') #=> [] + # + # pkg:gem/i18n#lib/i18n.rb:255 + def interpolation_keys(key, **options); end + + # pkg:gem/i18n#lib/i18n.rb:344 + def l(object, locale: T.unsafe(nil), format: T.unsafe(nil), **options); end + + # pkg:gem/i18n#lib/i18n.rb:70 + def load_path; end + + # pkg:gem/i18n#lib/i18n.rb:70 + def load_path=(value); end + + # pkg:gem/i18n#lib/i18n.rb:70 + def locale; end + + # pkg:gem/i18n#lib/i18n.rb:70 + def locale=(value); end + + # Returns true when the passed locale, which can be either a String or a + # Symbol, is in the list of available locales. Returns false otherwise. + # + # pkg:gem/i18n#lib/i18n.rb:376 + def locale_available?(locale); end + + # Localizes certain objects, such as dates and numbers to local formatting. + # + # pkg:gem/i18n#lib/i18n.rb:336 + def localize(object, locale: T.unsafe(nil), format: T.unsafe(nil), **options); end + + # Merges the given locale, key and scope into a single array of keys. + # Splits keys that contain dots into multiple keys. Makes sure all + # keys are Symbols. + # + # pkg:gem/i18n#lib/i18n.rb:364 + def normalize_keys(locale, key, scope, separator = T.unsafe(nil)); end + + # Tells the backend to reload translations. Used in situations like the + # Rails development environment. Backends can implement whatever strategy + # is useful. + # + # pkg:gem/i18n#lib/i18n.rb:84 + def reload!; end + + # pkg:gem/i18n#lib/i18n.rb:227 + def t(key = T.unsafe(nil), throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), **options); end + + # pkg:gem/i18n#lib/i18n.rb:234 + def t!(key, **options); end + + # Translates, pluralizes and interpolates a given key using a given locale, + # scope, and default, as well as interpolation values. + # + # *LOOKUP* + # + # Translation data is organized as a nested hash using the upper-level keys + # as namespaces. E.g., ActionView ships with the translation: + # :date => {:formats => {:short => "%b %d"}}. + # + # Translations can be looked up at any level of this hash using the key argument + # and the scope option. E.g., in this example I18n.t :date + # returns the whole translations hash {:formats => {:short => "%b %d"}}. + # + # Key can be either a single key or a dot-separated key (both Strings and Symbols + # work). E.g., the short format can be looked up using both: + # I18n.t 'date.formats.short' + # I18n.t :'date.formats.short' + # + # Scope can be either a single key, a dot-separated key or an array of keys + # or dot-separated keys. Keys and scopes can be combined freely. So these + # examples will all look up the same short date format: + # I18n.t 'date.formats.short' + # I18n.t 'formats.short', :scope => 'date' + # I18n.t 'short', :scope => 'date.formats' + # I18n.t 'short', :scope => %w(date formats) + # + # *INTERPOLATION* + # + # Translations can contain interpolation variables which will be replaced by + # values passed to #translate as part of the options hash, with the keys matching + # the interpolation variable names. + # + # E.g., with a translation :foo => "foo %{bar}" the option + # value for the key +bar+ will be interpolated into the translation: + # I18n.t :foo, :bar => 'baz' # => 'foo baz' + # + # *PLURALIZATION* + # + # Translation data can contain pluralized translations. Pluralized translations + # are arrays of singular/plural versions of translations like ['Foo', 'Foos']. + # + # Note that I18n::Backend::Simple only supports an algorithm for English + # pluralization rules. Other algorithms can be supported by custom backends. + # + # This returns the singular version of a pluralized translation: + # I18n.t :foo, :count => 1 # => 'Foo' + # + # These both return the plural version of a pluralized translation: + # I18n.t :foo, :count => 0 # => 'Foos' + # I18n.t :foo, :count => 2 # => 'Foos' + # + # The :count option can be used both for pluralization and interpolation. + # E.g., with the translation + # :foo => ['%{count} foo', '%{count} foos'], count will + # be interpolated to the pluralized translation: + # I18n.t :foo, :count => 1 # => '1 foo' + # + # *DEFAULTS* + # + # This returns the translation for :foo or default if no translation was found: + # I18n.t :foo, :default => 'default' + # + # This returns the translation for :foo or the translation for :bar if no + # translation for :foo was found: + # I18n.t :foo, :default => :bar + # + # Returns the translation for :foo or the translation for :bar + # or default if no translations for :foo and :bar were found. + # I18n.t :foo, :default => [:bar, 'default'] + # + # BULK LOOKUP + # + # This returns an array with the translations for :foo and :bar. + # I18n.t [:foo, :bar] + # + # Can be used with dot-separated nested keys: + # I18n.t [:'baz.foo', :'baz.bar'] + # + # Which is the same as using a scope option: + # I18n.t [:foo, :bar], :scope => :baz + # + # *LAMBDAS* + # + # Both translations and defaults can be given as Ruby lambdas. Lambdas will be + # called and passed the key and options. + # + # E.g. assuming the key :salutation resolves to: + # lambda { |key, options| options[:gender] == 'm' ? "Mr. #{options[:name]}" : "Mrs. #{options[:name]}" } + # + # Then I18n.t(:salutation, :gender => 'w', :name => 'Smith') will result in "Mrs. Smith". + # + # Note that the string returned by lambda will go through string interpolation too, + # so the following lambda would give the same result: + # lambda { |key, options| options[:gender] == 'm' ? "Mr. %{name}" : "Mrs. %{name}" } + # + # It is recommended to use/implement lambdas in an "idempotent" way. E.g. when + # a cache layer is put in front of I18n.translate it will generate a cache key + # from the argument values passed to #translate. Therefore your lambdas should + # always return the same translations/values per unique combination of argument + # values. + # + # Ruby 2.7+ keyword arguments warning + # + # This method uses keyword arguments. + # There is a breaking change in ruby that produces warning with ruby 2.7 and won't work as expected with ruby 3.0 + # The "hash" parameter must be passed as keyword argument. + # + # Good: + # I18n.t(:salutation, :gender => 'w', :name => 'Smith') + # I18n.t(:salutation, **{ :gender => 'w', :name => 'Smith' }) + # I18n.t(:salutation, **any_hash) + # + # Bad: + # I18n.t(:salutation, { :gender => 'w', :name => 'Smith' }) + # I18n.t(:salutation, any_hash) + # + # pkg:gem/i18n#lib/i18n.rb:212 + def translate(key = T.unsafe(nil), throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), **options); end + + # Wrapper for translate that adds :raise => true. With + # this option, if no translation is found, it will raise I18n::MissingTranslationData + # + # pkg:gem/i18n#lib/i18n.rb:231 + def translate!(key, **options); end + + # Transliterates UTF-8 characters to ASCII. By default this method will + # transliterate only Latin strings to an ASCII approximation: + # + # I18n.transliterate("Ærøskøbing") + # # => "AEroskobing" + # + # I18n.transliterate("日本語") + # # => "???" + # + # It's also possible to add support for per-locale transliterations. I18n + # expects transliteration rules to be stored at + # i18n.transliterate.rule. + # + # Transliteration rules can either be a Hash or a Proc. Procs must accept a + # single string argument. Hash rules inherit the default transliteration + # rules, while Procs do not. + # + # *Examples* + # + # Setting a Hash in .yml: + # + # i18n: + # transliterate: + # rule: + # ü: "ue" + # ö: "oe" + # + # Setting a Hash using Ruby: + # + # store_translations(:de, i18n: { + # transliterate: { + # rule: { + # 'ü' => 'ue', + # 'ö' => 'oe' + # } + # } + # }) + # + # Setting a Proc: + # + # translit = lambda {|string| MyTransliterator.transliterate(string) } + # store_translations(:xx, :i18n => {:transliterate => {:rule => translit}) + # + # Transliterating strings: + # + # I18n.locale = :en + # I18n.transliterate("Jürgen") # => "Jurgen" + # I18n.locale = :de + # I18n.transliterate("Jürgen") # => "Juergen" + # I18n.transliterate("Jürgen", :locale => :en) # => "Jurgen" + # I18n.transliterate("Jürgen", :locale => :de) # => "Juergen" + # + # pkg:gem/i18n#lib/i18n.rb:325 + def transliterate(key, throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), replacement: T.unsafe(nil), **options); end + + # Executes block with given I18n.locale set. + # + # pkg:gem/i18n#lib/i18n.rb:347 + def with_locale(tmp_locale = T.unsafe(nil)); end + + private + + # Any exceptions thrown in translate will be sent to the @@exception_handler + # which can be a Symbol, a Proc or any other Object unless they're forced to + # be raised or thrown (MissingTranslation). + # + # If exception_handler is a Symbol then it will simply be sent to I18n as + # a method call. A Proc will simply be called. In any other case the + # method #call will be called on the exception_handler object. + # + # Examples: + # + # I18n.exception_handler = :custom_exception_handler # this is the default + # I18n.custom_exception_handler(exception, locale, key, options) # will be called like this + # + # I18n.exception_handler = lambda { |*args| ... } # a lambda + # I18n.exception_handler.call(exception, locale, key, options) # will be called like this + # + # I18n.exception_handler = I18nExceptionHandler.new # an object + # I18n.exception_handler.call(exception, locale, key, options) # will be called like this + # + # pkg:gem/i18n#lib/i18n.rb:423 + def handle_exception(handling, exception, locale, key, options); end + + # pkg:gem/i18n#lib/i18n.rb:465 + def interpolation_keys_from_translation(translation); end + + # pkg:gem/i18n#lib/i18n.rb:441 + def normalize_key(key, separator); end + + # pkg:gem/i18n#lib/i18n.rb:393 + def translate_key(key, throw, raise, locale, backend, options); end +end + +# pkg:gem/i18n#lib/i18n/config.rb:6 +class I18n::Config + # Returns an array of locales for which translations are available. + # Unless you explicitly set these through I18n.available_locales= + # the call will be delegated to the backend. + # + # pkg:gem/i18n#lib/i18n/config.rb:43 + def available_locales; end + + # Sets the available locales. + # + # pkg:gem/i18n#lib/i18n/config.rb:57 + def available_locales=(locales); end + + # Returns true if the available_locales have been initialized + # + # pkg:gem/i18n#lib/i18n/config.rb:64 + def available_locales_initialized?; end + + # Caches the available locales list as both strings and symbols in a Set, so + # that we can have faster lookups to do the available locales enforce check. + # + # pkg:gem/i18n#lib/i18n/config.rb:50 + def available_locales_set; end + + # Returns the current backend. Defaults to +Backend::Simple+. + # + # pkg:gem/i18n#lib/i18n/config.rb:20 + def backend; end + + # Sets the current backend. Used to set a custom backend. + # + # pkg:gem/i18n#lib/i18n/config.rb:25 + def backend=(backend); end + + # Clears the available locales set so it can be recomputed again after I18n + # gets reloaded. + # + # pkg:gem/i18n#lib/i18n/config.rb:70 + def clear_available_locales_set; end + + # Returns the current default locale. Defaults to :'en' + # + # pkg:gem/i18n#lib/i18n/config.rb:30 + def default_locale; end + + # Sets the current default locale. Used to set a custom default locale. + # + # pkg:gem/i18n#lib/i18n/config.rb:35 + def default_locale=(locale); end + + # Returns the current default scope separator. Defaults to '.' + # + # pkg:gem/i18n#lib/i18n/config.rb:75 + def default_separator; end + + # Sets the current default scope separator. + # + # pkg:gem/i18n#lib/i18n/config.rb:80 + def default_separator=(separator); end + + # pkg:gem/i18n#lib/i18n/config.rb:141 + def enforce_available_locales; end + + # pkg:gem/i18n#lib/i18n/config.rb:145 + def enforce_available_locales=(enforce_available_locales); end + + # Returns the current exception handler. Defaults to an instance of + # I18n::ExceptionHandler. + # + # pkg:gem/i18n#lib/i18n/config.rb:86 + def exception_handler; end + + # Sets the exception handler. + # + # pkg:gem/i18n#lib/i18n/config.rb:91 + def exception_handler=(exception_handler); end + + # Returns the current interpolation patterns. Defaults to + # I18n::DEFAULT_INTERPOLATION_PATTERNS. + # + # pkg:gem/i18n#lib/i18n/config.rb:151 + def interpolation_patterns; end + + # Sets the current interpolation patterns. Used to set a interpolation + # patterns. + # + # E.g. using {{}} as a placeholder like "{{hello}}, world!": + # + # I18n.config.interpolation_patterns << /\{\{(\w+)\}\}/ + # + # pkg:gem/i18n#lib/i18n/config.rb:161 + def interpolation_patterns=(interpolation_patterns); end + + # Allow clients to register paths providing translation data sources. The + # backend defines acceptable sources. + # + # E.g. the provided SimpleBackend accepts a list of paths to translation + # files which are either named *.rb and contain plain Ruby Hashes or are + # named *.yml and contain YAML data. So for the SimpleBackend clients may + # register translation files like this: + # I18n.load_path << 'path/to/locale/en.yml' + # + # pkg:gem/i18n#lib/i18n/config.rb:126 + def load_path; end + + # Sets the load path instance. Custom implementations are expected to + # behave like a Ruby Array. + # + # pkg:gem/i18n#lib/i18n/config.rb:132 + def load_path=(load_path); end + + # The only configuration value that is not global and scoped to thread is :locale. + # It defaults to the default_locale. + # + # pkg:gem/i18n#lib/i18n/config.rb:9 + def locale; end + + # Sets the current locale pseudo-globally, i.e. in the Thread.current hash. + # + # pkg:gem/i18n#lib/i18n/config.rb:14 + def locale=(locale); end + + # Returns the current handler for situations when interpolation argument + # is missing. MissingInterpolationArgument will be raised by default. + # + # pkg:gem/i18n#lib/i18n/config.rb:97 + def missing_interpolation_argument_handler; end + + # Sets the missing interpolation argument handler. It can be any + # object that responds to #call. The arguments that will be passed to #call + # are the same as for MissingInterpolationArgument initializer. Use +Proc.new+ + # if you don't care about arity. + # + # == Example: + # You can suppress raising an exception and return string instead: + # + # I18n.config.missing_interpolation_argument_handler = Proc.new do |key| + # "#{key} is missing" + # end + # + # pkg:gem/i18n#lib/i18n/config.rb:114 + def missing_interpolation_argument_handler=(exception_handler); end +end + +# pkg:gem/i18n#lib/i18n/interpolate/ruby.rb:7 +I18n::DEFAULT_INTERPOLATION_PATTERNS = T.let(T.unsafe(nil), Array) + +# pkg:gem/i18n#lib/i18n/exceptions.rb:16 +class I18n::Disabled < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:17 + def initialize(method); end +end + +# pkg:gem/i18n#lib/i18n.rb:36 +I18n::EMPTY_HASH = T.let(T.unsafe(nil), Hash) + +# pkg:gem/i18n#lib/i18n/exceptions.rb:4 +class I18n::ExceptionHandler + # pkg:gem/i18n#lib/i18n/exceptions.rb:5 + def call(exception, _locale, _key, _options); end +end + +# pkg:gem/i18n#lib/i18n/gettext.rb:4 +module I18n::Gettext + class << self + # pkg:gem/i18n#lib/i18n/gettext.rb:21 + def extract_scope(msgid, separator); end + + # returns an array of plural keys for the given locale or the whole hash + # of locale mappings to plural keys so that we can convert from gettext's + # integer-index based style + # TODO move this information to the pluralization module + # + # pkg:gem/i18n#lib/i18n/gettext.rb:17 + def plural_keys(*args); end + end +end + +# pkg:gem/i18n#lib/i18n/gettext.rb:6 +I18n::Gettext::CONTEXT_SEPARATOR = T.let(T.unsafe(nil), String) + +# Implements classical Gettext style accessors. To use this include the +# module to the global namespace or wherever you want to use it. +# +# include I18n::Gettext::Helpers +# +# pkg:gem/i18n#lib/i18n/gettext/helpers.rb:11 +module I18n::Gettext::Helpers + # Makes dynamic translation messages readable for the gettext parser. + # _(fruit) cannot be understood by the gettext parser. To help the parser find all your translations, + # you can add fruit = N_("Apple") which does not translate, but tells the parser: "Apple" needs translation. + # * msgid: the message id. + # * Returns: msgid. + # + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:17 + def N_(msgsid); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:24 + def _(msgid, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:21 + def gettext(msgid, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:41 + def n_(msgid, msgid_plural, n = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:38 + def ngettext(msgid, msgid_plural, n = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:72 + def np_(msgctxt, msgid, msgid_plural, n = T.unsafe(nil)); end + + # Method signatures: + # npgettext('Fruits', 'apple', 'apples', 2) + # npgettext('Fruits', ['apple', 'apples'], 2) + # + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:61 + def npgettext(msgctxt, msgid, msgid_plural, n = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:56 + def ns_(msgid, msgid_plural, n = T.unsafe(nil), separator = T.unsafe(nil)); end + + # Method signatures: + # nsgettext('Fruits|apple', 'apples', 2) + # nsgettext(['Fruits|apple', 'apples'], 2) + # + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:46 + def nsgettext(msgid, msgid_plural, n = T.unsafe(nil), separator = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:36 + def p_(msgctxt, msgid); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:32 + def pgettext(msgctxt, msgid); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:30 + def s_(msgid, separator = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:26 + def sgettext(msgid, separator = T.unsafe(nil)); end +end + +# pkg:gem/i18n#lib/i18n/gettext.rb:5 +I18n::Gettext::PLURAL_SEPARATOR = T.let(T.unsafe(nil), String) + +# pkg:gem/i18n#lib/i18n/interpolate/ruby.rb:12 +I18n::INTERPOLATION_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/i18n#lib/i18n/interpolate/ruby.rb:15 +I18n::INTERPOLATION_PATTERNS_CACHE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/i18n#lib/i18n/exceptions.rb:132 +class I18n::InvalidFilenames < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:134 + def initialize(file_errors); end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:133 +I18n::InvalidFilenames::NUMBER_OF_ERRORS_SHOWN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/i18n#lib/i18n/exceptions.rb:30 +class I18n::InvalidLocale < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:32 + def initialize(locale); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:31 + def locale; end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:38 +class I18n::InvalidLocaleData < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:40 + def initialize(filename, exception_message); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:39 + def filename; end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:90 +class I18n::InvalidPluralizationData < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:92 + def initialize(entry, count, key); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:91 + def count; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:91 + def entry; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:91 + def key; end +end + +# pkg:gem/i18n#lib/i18n/backend/key_value.rb:21 +I18n::JSON = ActiveSupport::JSON + +# pkg:gem/i18n#lib/i18n/locale.rb:4 +module I18n::Locale; end + +# pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:48 +class I18n::Locale::Fallbacks < ::Hash + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:49 + def initialize(*mappings); end + + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:60 + def [](locale); end + + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:58 + def defaults; end + + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:55 + def defaults=(defaults); end + + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:82 + def empty?; end + + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:86 + def inspect; end + + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:67 + def map(*args, &block); end + + protected + + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:92 + def compute(tags, include_defaults = T.unsafe(nil), exclude = T.unsafe(nil)); end +end + +# pkg:gem/i18n#lib/i18n/locale/tag.rb:5 +module I18n::Locale::Tag + class << self + # Returns the current locale tag implementation. Defaults to +I18n::Locale::Tag::Simple+. + # + # pkg:gem/i18n#lib/i18n/locale/tag.rb:12 + def implementation; end + + # Sets the current locale tag implementation. Use this to set a different locale tag implementation. + # + # pkg:gem/i18n#lib/i18n/locale/tag.rb:17 + def implementation=(implementation); end + + # Factory method for locale tags. Delegates to the current locale tag implementation. + # + # pkg:gem/i18n#lib/i18n/locale/tag.rb:22 + def tag(tag); end + end +end + +# pkg:gem/i18n#lib/i18n/locale/tag/parents.rb:4 +module I18n::Locale::Tag::Parents + # pkg:gem/i18n#lib/i18n/locale/tag/parents.rb:5 + def parent; end + + # pkg:gem/i18n#lib/i18n/locale/tag/parents.rb:18 + def parents; end + + # pkg:gem/i18n#lib/i18n/locale/tag/parents.rb:14 + def self_and_parents; end +end + +# pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:12 +I18n::Locale::Tag::RFC4646_FORMATS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:11 +I18n::Locale::Tag::RFC4646_SUBTAGS = T.let(T.unsafe(nil), Array) + +# pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:14 +class I18n::Locale::Tag::Rfc4646 < ::Struct + include ::I18n::Locale::Tag::Parents + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:35 + def language; end + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:35 + def region; end + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:35 + def script; end + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:46 + def to_a; end + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:42 + def to_s; end + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:38 + def to_sym; end + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:35 + def variant; end + + class << self + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:23 + def parser; end + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:27 + def parser=(parser); end + + # Parses the given tag and returns a Tag instance if it is valid. + # Returns false if the given tag is not valid according to RFC 4646. + # + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:18 + def tag(tag); end + end +end + +# pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:50 +module I18n::Locale::Tag::Rfc4646::Parser + class << self + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:63 + def match(tag); end + end +end + +# pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:51 +I18n::Locale::Tag::Rfc4646::Parser::PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:6 +class I18n::Locale::Tag::Simple + include ::I18n::Locale::Tag::Parents + + # pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:17 + def initialize(*tag); end + + # pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:21 + def subtags; end + + # pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:15 + def tag; end + + # pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:33 + def to_a; end + + # pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:29 + def to_s; end + + # pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:25 + def to_sym; end + + class << self + # pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:8 + def tag(tag); end + end +end + +# pkg:gem/i18n#lib/i18n/middleware.rb:4 +class I18n::Middleware + # pkg:gem/i18n#lib/i18n/middleware.rb:6 + def initialize(app); end + + # pkg:gem/i18n#lib/i18n/middleware.rb:10 + def call(env); end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:98 +class I18n::MissingInterpolationArgument < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:100 + def initialize(key, values, string); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:99 + def key; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:99 + def string; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:99 + def values; end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:46 +class I18n::MissingTranslation < ::I18n::ArgumentError + include ::I18n::MissingTranslation::Base +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:47 +module I18n::MissingTranslation::Base + # pkg:gem/i18n#lib/i18n/exceptions.rb:52 + def initialize(locale, key, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:50 + def key; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:57 + def keys; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:50 + def locale; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:63 + def message; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:72 + def normalized_option(key); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:50 + def options; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:78 + def to_exception; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:76 + def to_s; end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:48 +I18n::MissingTranslation::Base::PERMITTED_KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/i18n#lib/i18n/exceptions.rb:86 +class I18n::MissingTranslationData < ::I18n::ArgumentError + include ::I18n::MissingTranslation::Base +end + +# pkg:gem/i18n#lib/i18n.rb:19 +I18n::RESERVED_KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/i18n#lib/i18n/exceptions.rb:106 +class I18n::ReservedInterpolationKey < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:108 + def initialize(key, string); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:107 + def key; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:107 + def string; end +end + +# pkg:gem/i18n#lib/i18n/tests.rb:4 +module I18n::Tests; end + +# pkg:gem/i18n#lib/i18n/tests/localization.rb:3 +module I18n::Tests::Localization + class << self + # pkg:gem/i18n#lib/i18n/tests/localization.rb:9 + def included(base); end + end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:114 +class I18n::UnknownFileType < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:116 + def initialize(type, filename); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:115 + def filename; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:115 + def type; end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:122 +class I18n::UnsupportedMethod < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:124 + def initialize(method, backend_klass, msg); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:123 + def backend_klass; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:123 + def method; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:123 + def msg; end +end + +# pkg:gem/i18n#lib/i18n/utils.rb:4 +module I18n::Utils + class << self + # pkg:gem/i18n#lib/i18n/utils.rb:18 + def deep_merge(hash, other_hash, &block); end + + # pkg:gem/i18n#lib/i18n/utils.rb:22 + def deep_merge!(hash, other_hash, &block); end + + # pkg:gem/i18n#lib/i18n/utils.rb:34 + def deep_symbolize_keys(hash); end + + # pkg:gem/i18n#lib/i18n/utils.rb:7 + def except(hash, *keys); end + + private + + # pkg:gem/i18n#lib/i18n/utils.rb:43 + def deep_symbolize_keys_in_object(value); end + end +end + +# pkg:gem/i18n#lib/i18n/version.rb:4 +I18n::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/io-console@0.8.2.rbi b/sorbet/rbi/gems/io-console@0.8.2.rbi new file mode 100644 index 0000000..73616ab --- /dev/null +++ b/sorbet/rbi/gems/io-console@0.8.2.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `io-console` gem. +# Please instead update this file by running `bin/tapioca gem io-console`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/json@2.15.1.rbi b/sorbet/rbi/gems/json@2.19.4.rbi similarity index 85% rename from sorbet/rbi/gems/json@2.15.1.rbi rename to sorbet/rbi/gems/json@2.19.4.rbi index 7276954..d9835a5 100644 --- a/sorbet/rbi/gems/json@2.15.1.rbi +++ b/sorbet/rbi/gems/json@2.19.4.rbi @@ -5,32 +5,19 @@ # Please instead update this file by running `bin/tapioca gem json`. -class Array - include ::Enumerable - include ::JSON::Ext::Generator::GeneratorMethods::Array -end - -class FalseClass - include ::JSON::Ext::Generator::GeneratorMethods::FalseClass -end - -class Float < ::Numeric - include ::JSON::Ext::Generator::GeneratorMethods::Float -end - -class Hash - include ::Enumerable - include ::JSON::Ext::Generator::GeneratorMethods::Hash -end - -class Integer < ::Numeric - include ::JSON::Ext::Generator::GeneratorMethods::Integer -end - # = JavaScript \Object Notation (\JSON) # # \JSON is a lightweight data-interchange format. # +# \JSON is easy for us humans to read and write, +# and equally simple for machines to read (parse) and write (generate). +# +# \JSON is language-independent, making it an ideal interchange format +# for applications in differing programming languages +# and on differing operating systems. +# +# == \JSON Values +# # A \JSON value is one of the following: # - Double-quoted text: "foo". # - Number: +1+, +1.0+, +2.0e2+. @@ -198,6 +185,30 @@ end # When enabled: # JSON.parse('[1,]', allow_trailing_comma: true) # => [1] # +# --- +# +# Option +allow_control_characters+ (boolean) specifies whether to allow +# unescaped ASCII control characters, such as newlines, in strings; +# defaults to +false+. +# +# With the default, +false+: +# JSON.parse(%{"Hello\nWorld"}) # invalid ASCII control character in string (JSON::ParserError) +# +# When enabled: +# JSON.parse(%{"Hello\nWorld"}, allow_control_characters: true) # => "Hello\nWorld" +# +# --- +# +# Option +allow_invalid_escape+ (boolean) specifies whether to ignore backslahes that are followed +# by an invalid escape character in strings; +# defaults to +false+. +# +# With the default, +false+: +# JSON.parse('"Hell\o"') # invalid escape character in string (JSON::ParserError) +# +# When enabled: +# JSON.parse('"Hell\o"', allow_invalid_escape: true) # => "Hello" +# # ====== Output Options # # Option +freeze+ (boolean) specifies whether the returned objects will be frozen; @@ -327,8 +338,8 @@ end # JSON.generate(JSON::MinusInfinity) # # Allow: -# ruby = [Float::NaN, Float::Infinity, Float::MinusInfinity] -# JSON.generate(ruby, allow_nan: true) # => '[NaN,Infinity,-Infinity]' +# ruby = [Float::NAN, Float::INFINITY, JSON::NaN, JSON::Infinity, JSON::MinusInfinity] +# JSON.generate(ruby, allow_nan: true) # => '[NaN,Infinity,NaN,Infinity,-Infinity]' # # --- # @@ -661,7 +672,7 @@ end # Without custom addition: "#" (String) # With custom addition: # (Foo) # -# source://json//lib/json/version.rb#3 +# pkg:gem/json#lib/json/version.rb:3 module JSON private @@ -693,7 +704,7 @@ module JSON # Output: # {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"} # - # source://json//lib/json/common.rb#918 + # pkg:gem/json#lib/json/common.rb:932 def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end # :call-seq: @@ -710,10 +721,10 @@ module JSON # # Raises SystemStackError (stack level too deep): # JSON.fast_generate(a) # - # source://json//lib/json/common.rb#465 + # pkg:gem/json#lib/json/common.rb:462 def fast_generate(obj, opts = T.unsafe(nil)); end - # source://json//lib/json/common.rb#963 + # pkg:gem/json#lib/json/common.rb:977 def fast_unparse(*_arg0, **_arg1, &_arg2); end # :call-seq: @@ -752,10 +763,11 @@ module JSON # # Raises JSON::NestingError (nesting of 100 is too deep): # JSON.generate(a) # - # source://json//lib/json/common.rb#444 + # pkg:gem/json#lib/json/common.rb:441 def generate(obj, opts = T.unsafe(nil)); end # :call-seq: + # JSON.load(source, options = {}) -> object # JSON.load(source, proc = nil, options = {}) -> object # # Returns the Ruby objects created by parsing the given +source+. @@ -891,7 +903,7 @@ module JSON # #"Admin", "password"=>"0wn3d"}>} # - # source://json//lib/json/common.rb#852 + # pkg:gem/json#lib/json/common.rb:856 def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end # :call-seq: @@ -902,7 +914,7 @@ module JSON # # See method #parse. # - # source://json//lib/json/common.rb#393 + # pkg:gem/json#lib/json/common.rb:390 def load_file(filespec, opts = T.unsafe(nil)); end # :call-seq: @@ -913,7 +925,7 @@ module JSON # # See method #parse! # - # source://json//lib/json/common.rb#404 + # pkg:gem/json#lib/json/common.rb:401 def load_file!(filespec, opts = T.unsafe(nil)); end # :call-seq: @@ -964,7 +976,7 @@ module JSON # # Raises JSON::ParserError (783: unexpected token at ''): # JSON.parse('') # - # source://json//lib/json/common.rb#356 + # pkg:gem/json#lib/json/common.rb:353 def parse(source, opts = T.unsafe(nil)); end # :call-seq: @@ -979,7 +991,7 @@ module JSON # which disables checking for nesting depth. # - Option +allow_nan+, if not provided, defaults to +true+. # - # source://json//lib/json/common.rb#378 + # pkg:gem/json#lib/json/common.rb:375 def parse!(source, opts = T.unsafe(nil)); end # :call-seq: @@ -1012,23 +1024,24 @@ module JSON # } # } # - # source://json//lib/json/common.rb#512 + # pkg:gem/json#lib/json/common.rb:509 def pretty_generate(obj, opts = T.unsafe(nil)); end - # source://json//lib/json/common.rb#973 + # pkg:gem/json#lib/json/common.rb:987 def pretty_unparse(*_arg0, **_arg1, &_arg2); end - # source://json//lib/json/common.rb#983 + # pkg:gem/json#lib/json/common.rb:997 def restore(*_arg0, **_arg1, &_arg2); end # :stopdoc: # All these were meant to be deprecated circa 2009, but were just set as undocumented # so usage still exist in the wild. # - # source://json//lib/json/common.rb#953 + # pkg:gem/json#lib/json/common.rb:967 def unparse(*_arg0, **_arg1, &_arg2); end # :call-seq: + # JSON.unsafe_load(source, options = {}) -> object # JSON.unsafe_load(source, proc = nil, options = {}) -> object # # Returns the Ruby objects created by parsing the given +source+. @@ -1158,7 +1171,7 @@ module JSON # #"Admin", "password"=>"0wn3d"}>} # - # source://json//lib/json/common.rb#687 + # pkg:gem/json#lib/json/common.rb:685 def unsafe_load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end class << self @@ -1174,31 +1187,32 @@ module JSON # ruby = [0, 1, nil] # JSON[ruby] # => '[0,1,null]' # - # source://json//lib/json/common.rb#127 + # pkg:gem/json#lib/json/common.rb:132 def [](object, opts = T.unsafe(nil)); end + # pkg:gem/json#lib/json/common.rb:208 + def _dump_default_options; end + + # pkg:gem/json#lib/json/common.rb:208 + def _load_default_options; end + + # pkg:gem/json#lib/json/common.rb:208 + def _unsafe_load_default_options; end + # Returns the current create identifier. # See also JSON.create_id=. # - # source://json//lib/json/common.rb#239 + # pkg:gem/json#lib/json/common.rb:236 def create_id; end # Sets create identifier, which is used to decide if the _json_create_ # hook of a class should be called; initial value is +json_class+: # JSON.create_id # => 'json_class' # - # source://json//lib/json/common.rb#233 + # pkg:gem/json#lib/json/common.rb:230 def create_id=(new_value); end - # Return the constant located at _path_. The format of _path_ has to be - # either ::A::B::C or A::B::C. In any case, A has to be located at the top - # level (absolute namespace path?). If there doesn't exist a constant at - # the given path, an ArgumentError is raised. - # - # source://json//lib/json/common.rb#154 - def deep_const_get(path); end - - # source://json//lib/json/common.rb#99 + # pkg:gem/json#lib/json/common.rb:104 def deprecation_warning(message, uplevel = T.unsafe(nil)); end # :call-seq: @@ -1229,9 +1243,15 @@ module JSON # Output: # {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"} # - # source://json//lib/json/common.rb#918 + # pkg:gem/json#lib/json/common.rb:932 def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end + # pkg:gem/json#lib/json/common.rb:208 + def dump_default_options; end + + # pkg:gem/json#lib/json/common.rb:208 + def dump_default_options=(val); end + # :call-seq: # JSON.fast_generate(obj, opts) -> new_string # @@ -1246,10 +1266,10 @@ module JSON # # Raises SystemStackError (stack level too deep): # JSON.fast_generate(a) # - # source://json//lib/json/common.rb#465 + # pkg:gem/json#lib/json/common.rb:462 def fast_generate(obj, opts = T.unsafe(nil)); end - # source://json//lib/json/common.rb#963 + # pkg:gem/json#lib/json/common.rb:977 def fast_unparse(*_arg0, **_arg1, &_arg2); end # :call-seq: @@ -1288,20 +1308,21 @@ module JSON # # Raises JSON::NestingError (nesting of 100 is too deep): # JSON.generate(a) # - # source://json//lib/json/common.rb#444 + # pkg:gem/json#lib/json/common.rb:441 def generate(obj, opts = T.unsafe(nil)); end # Returns the JSON generator module that is used by JSON. # - # source://json//lib/json/common.rb#182 + # pkg:gem/json#lib/json/common.rb:179 def generator; end # Set the module _generator_ to be used by JSON. # - # source://json//lib/json/common.rb#161 + # pkg:gem/json#lib/json/common.rb:156 def generator=(generator); end # :call-seq: + # JSON.load(source, options = {}) -> object # JSON.load(source, proc = nil, options = {}) -> object # # Returns the Ruby objects created by parsing the given +source+. @@ -1437,9 +1458,15 @@ module JSON # #"Admin", "password"=>"0wn3d"}>} # - # source://json//lib/json/common.rb#852 + # pkg:gem/json#lib/json/common.rb:856 def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end + # pkg:gem/json#lib/json/common.rb:208 + def load_default_options; end + + # pkg:gem/json#lib/json/common.rb:208 + def load_default_options=(val); end + # :call-seq: # JSON.load_file(path, opts={}) -> object # @@ -1448,7 +1475,7 @@ module JSON # # See method #parse. # - # source://json//lib/json/common.rb#393 + # pkg:gem/json#lib/json/common.rb:390 def load_file(filespec, opts = T.unsafe(nil)); end # :call-seq: @@ -1459,7 +1486,7 @@ module JSON # # See method #parse! # - # source://json//lib/json/common.rb#404 + # pkg:gem/json#lib/json/common.rb:401 def load_file!(filespec, opts = T.unsafe(nil)); end # :call-seq: @@ -1510,7 +1537,7 @@ module JSON # # Raises JSON::ParserError (783: unexpected token at ''): # JSON.parse('') # - # source://json//lib/json/common.rb#356 + # pkg:gem/json#lib/json/common.rb:353 def parse(source, opts = T.unsafe(nil)); end # :call-seq: @@ -1525,17 +1552,17 @@ module JSON # which disables checking for nesting depth. # - Option +allow_nan+, if not provided, defaults to +true+. # - # source://json//lib/json/common.rb#378 + # pkg:gem/json#lib/json/common.rb:375 def parse!(source, opts = T.unsafe(nil)); end # Returns the JSON parser class that is used by JSON. # - # source://json//lib/json/common.rb#141 + # pkg:gem/json#lib/json/common.rb:146 def parser; end # Set the JSON parser class _parser_ to be used by JSON. # - # source://json//lib/json/common.rb#144 + # pkg:gem/json#lib/json/common.rb:149 def parser=(parser); end # :call-seq: @@ -1568,33 +1595,34 @@ module JSON # } # } # - # source://json//lib/json/common.rb#512 + # pkg:gem/json#lib/json/common.rb:509 def pretty_generate(obj, opts = T.unsafe(nil)); end - # source://json//lib/json/common.rb#973 + # pkg:gem/json#lib/json/common.rb:987 def pretty_unparse(*_arg0, **_arg1, &_arg2); end - # source://json//lib/json/common.rb#983 + # pkg:gem/json#lib/json/common.rb:997 def restore(*_arg0, **_arg1, &_arg2); end # Sets or Returns the JSON generator state class that is used by JSON. # - # source://json//lib/json/common.rb#185 + # pkg:gem/json#lib/json/common.rb:182 def state; end # Sets or Returns the JSON generator state class that is used by JSON. # - # source://json//lib/json/common.rb#185 + # pkg:gem/json#lib/json/common.rb:182 def state=(_arg0); end # :stopdoc: # All these were meant to be deprecated circa 2009, but were just set as undocumented # so usage still exist in the wild. # - # source://json//lib/json/common.rb#953 + # pkg:gem/json#lib/json/common.rb:967 def unparse(*_arg0, **_arg1, &_arg2); end # :call-seq: + # JSON.unsafe_load(source, options = {}) -> object # JSON.unsafe_load(source, proc = nil, options = {}) -> object # # Returns the Ruby objects created by parsing the given +source+. @@ -1724,20 +1752,26 @@ module JSON # #"Admin", "password"=>"0wn3d"}>} # - # source://json//lib/json/common.rb#687 + # pkg:gem/json#lib/json/common.rb:685 def unsafe_load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end + # pkg:gem/json#lib/json/common.rb:208 + def unsafe_load_default_options; end + + # pkg:gem/json#lib/json/common.rb:208 + def unsafe_load_default_options=(val); end + private - # source://json//lib/json/common.rb#996 + # pkg:gem/json#lib/json/common.rb:1010 def const_missing(const_name); end - # source://json//lib/json/common.rb#208 + # pkg:gem/json#lib/json/common.rb:205 def deprecated_singleton_attr_accessor(*attrs); end # Called from the extension when a hash has both string and symbol keys # - # source://json//lib/json/common.rb#190 + # pkg:gem/json#lib/json/common.rb:187 def on_mixed_keys_hash(hash, do_raise); end end end @@ -1752,13 +1786,14 @@ end # # MyApp::JSONC_CODER.load(document) # -# source://json//lib/json/common.rb#1022 +# pkg:gem/json#lib/json/common.rb:1036 class JSON::Coder # :call-seq: # JSON.new(options = nil, &block) # # Argument +options+, if given, contains a \Hash of options for both parsing and generating. - # See {Parsing Options}[#module-JSON-label-Parsing+Options], and {Generating Options}[#module-JSON-label-Generating+Options]. + # See {Parsing Options}[rdoc-ref:JSON@Parsing+Options], + # and {Generating Options}[rdoc-ref:JSON@Generating+Options]. # # For generation, the strict: true option is always set. When a Ruby object with no native \JSON counterpart is # encountered, the block provided to the initialize method is invoked, and must return a Ruby object that has a native @@ -1777,9 +1812,7 @@ class JSON::Coder # # puts MyApp::API_JSON_CODER.dump(Time.now.utc) # => "2025-01-21T08:41:44.286Z" # - # @return [Coder] a new instance of Coder - # - # source://json//lib/json/common.rb#1046 + # pkg:gem/json#lib/json/common.rb:1061 def initialize(options = T.unsafe(nil), &as_json); end # call-seq: @@ -1788,16 +1821,10 @@ class JSON::Coder # # Serialize the given object into a \JSON document. # - # source://json//lib/json/common.rb#1064 + # pkg:gem/json#lib/json/common.rb:1079 def dump(object, io = T.unsafe(nil)); end - # call-seq: - # dump(object) -> String - # dump(object, io) -> io - # - # Serialize the given object into a \JSON document. - # - # source://json//lib/json/common.rb#1064 + # pkg:gem/json#lib/json/common.rb:1082 def generate(object, io = T.unsafe(nil)); end # call-seq: @@ -1805,7 +1832,7 @@ class JSON::Coder # # Parse the given \JSON document and return an equivalent Ruby object. # - # source://json//lib/json/common.rb#1073 + # pkg:gem/json#lib/json/common.rb:1088 def load(source); end # call-seq: @@ -1813,96 +1840,215 @@ class JSON::Coder # # Parse the given \JSON document and return an equivalent Ruby object. # - # source://json//lib/json/common.rb#1082 + # pkg:gem/json#lib/json/common.rb:1097 def load_file(path); end - # call-seq: - # load(string) -> Object - # - # Parse the given \JSON document and return an equivalent Ruby object. - # - # source://json//lib/json/common.rb#1073 + # pkg:gem/json#lib/json/common.rb:1091 def parse(source); end end -# source://json//lib/json/ext/generator/state.rb#6 +# pkg:gem/json#lib/json/ext.rb:39 class JSON::Ext::Generator::State # call-seq: new(opts = {}) # # Instantiates a new State object, configured by _opts_. # # Argument +opts+, if given, contains a \Hash of options for the generation. - # See {Generating Options}[#module-JSON-label-Generating+Options]. - # - # @return [State] a new instance of State + # See {Generating Options}[rdoc-ref:JSON@Generating+Options]. # - # source://json//lib/json/ext/generator/state.rb#13 + # pkg:gem/json#lib/json/ext.rb:39 def initialize(opts = T.unsafe(nil)); end # call-seq: [](name) # # Returns the value returned by method +name+. # - # source://json//lib/json/ext/generator/state.rb#77 + # pkg:gem/json#lib/json/ext/generator/state.rb:77 def [](name); end # call-seq: []=(name, value) # # Sets the attribute name to value. # - # source://json//lib/json/ext/generator/state.rb#89 + # pkg:gem/json#lib/json/ext/generator/state.rb:91 def []=(name, value); end + # pkg:gem/json#lib/json/ext.rb:39 + def _generate_no_fallback(*_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def allow_nan=(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def allow_nan?; end + + # pkg:gem/json#lib/json/ext.rb:39 + def array_nl; end + + # pkg:gem/json#lib/json/ext.rb:39 + def array_nl=(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def as_json; end + + # pkg:gem/json#lib/json/ext.rb:39 + def as_json=(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def ascii_only=(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def ascii_only?; end + + # pkg:gem/json#lib/json/ext.rb:39 + def buffer_initial_length; end + + # pkg:gem/json#lib/json/ext.rb:39 + def buffer_initial_length=(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def check_circular?; end + # call-seq: configure(opts) # # Configure this State instance with the Hash _opts_, and return # itself. # - # source://json//lib/json/ext/generator/state.rb#23 + # pkg:gem/json#lib/json/ext/generator/state.rb:23 def configure(opts); end - # call-seq: configure(opts) - # - # Configure this State instance with the Hash _opts_, and return - # itself. - # - # source://json//lib/json/ext/generator/state.rb#23 + # pkg:gem/json#lib/json/ext.rb:39 + def depth; end + + # pkg:gem/json#lib/json/ext.rb:39 + def depth=(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def escape_slash; end + + # pkg:gem/json#lib/json/ext.rb:39 + def escape_slash=(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def escape_slash?; end + + # pkg:gem/json#lib/json/ext.rb:39 + def generate(*_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def indent; end + + # pkg:gem/json#lib/json/ext.rb:39 + def indent=(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def max_nesting; end + + # pkg:gem/json#lib/json/ext.rb:39 + def max_nesting=(_arg0); end + + # pkg:gem/json#lib/json/ext/generator/state.rb:36 def merge(opts); end + # pkg:gem/json#lib/json/ext.rb:39 + def object_nl; end + + # pkg:gem/json#lib/json/ext.rb:39 + def object_nl=(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def script_safe; end + + # pkg:gem/json#lib/json/ext.rb:39 + def script_safe=(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def script_safe?; end + + # pkg:gem/json#lib/json/ext.rb:39 + def space; end + + # pkg:gem/json#lib/json/ext.rb:39 + def space=(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def space_before; end + + # pkg:gem/json#lib/json/ext.rb:39 + def space_before=(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def strict; end + + # pkg:gem/json#lib/json/ext.rb:39 + def strict=(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def strict?; end + # call-seq: to_h # # Returns the configuration instance variables as a hash, that can be # passed to the configure method. # - # source://json//lib/json/ext/generator/state.rb#42 + # pkg:gem/json#lib/json/ext/generator/state.rb:42 def to_h; end - # call-seq: to_h - # - # Returns the configuration instance variables as a hash, that can be - # passed to the configure method. - # - # source://json//lib/json/ext/generator/state.rb#42 + # pkg:gem/json#lib/json/ext/generator/state.rb:72 def to_hash; end + + private + + # pkg:gem/json#lib/json/ext.rb:39 + def _configure(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def allow_duplicate_key?; end + + # pkg:gem/json#lib/json/ext.rb:39 + def initialize_copy(_arg0); end + + class << self + # pkg:gem/json#lib/json/ext.rb:39 + def _generate_no_fallback(_arg0, _arg1, _arg2); end + + # pkg:gem/json#lib/json/ext.rb:39 + def from_state(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:39 + def generate(_arg0, _arg1, _arg2); end + end end -# source://json//lib/json/ext.rb#9 +# pkg:gem/json#lib/json/ext.rb:9 class JSON::Ext::Parser - # @return [Parser] a new instance of Parser - # - # source://json//lib/json/ext.rb#17 + # pkg:gem/json#lib/json/ext.rb:17 def initialize(source, opts = T.unsafe(nil)); end - # source://json//lib/json/ext.rb#26 + # pkg:gem/json#lib/json/ext.rb:26 def parse; end - # source://json//lib/json/ext.rb#22 + # pkg:gem/json#lib/json/ext.rb:22 def source; end + + class << self + # pkg:gem/json#lib/json/ext.rb:11 + def parse(_arg0, _arg1); end + end end -# source://json//lib/json/ext.rb#32 +# pkg:gem/json#lib/json/ext.rb:32 JSON::Ext::Parser::Config = JSON::Ext::ParserConfig +# pkg:gem/json#lib/json/ext.rb:31 +class JSON::Ext::ParserConfig + # pkg:gem/json#lib/json/ext.rb:31 + def initialize(_arg0); end + + # pkg:gem/json#lib/json/ext.rb:31 + def parse(_arg0); end +end + # Fragment of JSON document that is to be included as is: # fragment = JSON::Fragment.new("[1, 2, 3]") # JSON.generate({ count: 3, items: fragments }) @@ -1914,148 +2060,155 @@ JSON::Ext::Parser::Config = JSON::Ext::ParserConfig # Note: no validation is performed on the provided string. It is the # responsibility of the caller to ensure the string contains valid JSON. # -# source://json//lib/json/common.rb#292 +# pkg:gem/json#lib/json/common.rb:289 class JSON::Fragment < ::Struct - # @return [Fragment] a new instance of Fragment - # - # source://json//lib/json/common.rb#293 + # pkg:gem/json#lib/json/common.rb:290 def initialize(json); end - # Returns the value of attribute json - # - # @return [Object] the current value of json + # pkg:gem/json#lib/json/common.rb:289 def json; end - # Sets the attribute json - # - # @param value [Object] the value to set the attribute json to. - # @return [Object] the newly set value + # pkg:gem/json#lib/json/common.rb:289 def json=(_); end - # source://json//lib/json/common.rb#301 + # pkg:gem/json#lib/json/common.rb:298 def to_json(state = T.unsafe(nil), *_arg1); end class << self + # pkg:gem/json#lib/json/common.rb:289 def [](*_arg0); end + + # pkg:gem/json#lib/json/common.rb:289 def inspect; end + + # pkg:gem/json#lib/json/common.rb:289 def keyword_init?; end + + # pkg:gem/json#lib/json/common.rb:289 def members; end + + # pkg:gem/json#lib/json/common.rb:289 def new(*_arg0); end end end # This exception is raised if a generator or unparser error occurs. # -# source://json//lib/json/common.rb#262 +# pkg:gem/json#lib/json/common.rb:259 class JSON::GeneratorError < ::JSON::JSONError - # @return [GeneratorError] a new instance of GeneratorError - # - # source://json//lib/json/common.rb#265 + # pkg:gem/json#lib/json/common.rb:262 def initialize(message, invalid_object = T.unsafe(nil)); end - # source://json//lib/json/common.rb#270 + # pkg:gem/json#lib/json/common.rb:267 def detailed_message(*_arg0, **_arg1, &_arg2); end - # Returns the value of attribute invalid_object. - # - # source://json//lib/json/common.rb#263 + # pkg:gem/json#lib/json/common.rb:260 def invalid_object; end end -# source://json//lib/json/generic_object.rb#9 +# pkg:gem/json#lib/json/common.rb:1102 +module JSON::GeneratorMethods + # call-seq: to_json(*) + # + # Converts this object into a JSON string. + # If this object doesn't directly maps to a JSON native type, + # first convert it to a string (calling #to_s), then converts + # it to a JSON string, and returns the result. + # This is a fallback, if no special method #to_json was defined for some object. + # + # pkg:gem/json#lib/json/common.rb:1110 + def to_json(state = T.unsafe(nil), *_arg1); end +end + +# pkg:gem/json#lib/json/generic_object.rb:9 class JSON::GenericObject < ::OpenStruct - # source://json//lib/json/generic_object.rb#59 + # pkg:gem/json#lib/json/generic_object.rb:59 def as_json(*_arg0); end - # source://json//lib/json/generic_object.rb#51 + # pkg:gem/json#lib/json/generic_object.rb:51 def to_hash; end - # source://json//lib/json/generic_object.rb#63 + # pkg:gem/json#lib/json/generic_object.rb:63 def to_json(*a); end - # source://json//lib/json/generic_object.rb#55 + # pkg:gem/json#lib/json/generic_object.rb:55 def |(other); end class << self - # source://json//lib/json/generic_object.rb#45 + # pkg:gem/json#lib/json/generic_object.rb:11 + def [](*_arg0); end + + # pkg:gem/json#lib/json/generic_object.rb:45 def dump(obj, *args); end - # source://json//lib/json/generic_object.rb#25 + # pkg:gem/json#lib/json/generic_object.rb:25 def from_hash(object); end - # Sets the attribute json_creatable - # - # @param value the value to set the attribute json_creatable to. - # - # source://json//lib/json/generic_object.rb#17 + # pkg:gem/json#lib/json/generic_object.rb:17 def json_creatable=(_arg0); end - # @return [Boolean] - # - # source://json//lib/json/generic_object.rb#13 + # pkg:gem/json#lib/json/generic_object.rb:13 def json_creatable?; end - # source://json//lib/json/generic_object.rb#19 + # pkg:gem/json#lib/json/generic_object.rb:19 def json_create(data); end - # source://json//lib/json/generic_object.rb#40 + # pkg:gem/json#lib/json/generic_object.rb:40 def load(source, proc = T.unsafe(nil), opts = T.unsafe(nil)); end end end -# source://json//lib/json/common.rb#361 +# pkg:gem/json#lib/json/common.rb:358 JSON::PARSE_L_OPTIONS = T.let(T.unsafe(nil), Hash) -# source://json//lib/json/common.rb#474 +# pkg:gem/json#lib/json/common.rb:471 JSON::PRETTY_GENERATE_OPTIONS = T.let(T.unsafe(nil), Hash) -# source://json//lib/json/common.rb#147 +# pkg:gem/json#lib/json/common.rb:152 JSON::Parser = JSON::Ext::Parser # This exception is raised if a parser error occurs. # -# source://json//lib/json/common.rb#253 +# pkg:gem/json#lib/json/common.rb:250 class JSON::ParserError < ::JSON::JSONError - # Returns the value of attribute column. - # - # source://json//lib/json/common.rb#254 + # pkg:gem/json#lib/json/common.rb:251 def column; end - # Returns the value of attribute line. - # - # source://json//lib/json/common.rb#254 + # pkg:gem/json#lib/json/common.rb:251 def line; end end -# source://json//lib/json/common.rb#8 +# pkg:gem/json#lib/json/common.rb:8 module JSON::ParserOptions class << self - # source://json//lib/json/common.rb#10 + # pkg:gem/json#lib/json/common.rb:10 def prepare(opts); end private - # source://json//lib/json/common.rb#40 + # pkg:gem/json#lib/json/common.rb:40 def array_class_proc(array_class, on_load); end # TODO: extract :create_additions support to another gem for version 3.0 # - # source://json//lib/json/common.rb#52 + # pkg:gem/json#lib/json/common.rb:52 def create_additions_proc(opts); end - # source://json//lib/json/common.rb#90 + # pkg:gem/json#lib/json/common.rb:95 def create_additions_warning; end - # source://json//lib/json/common.rb#29 + # pkg:gem/json#lib/json/common.rb:29 def object_class_proc(object_class, on_load); end end end -# source://json//lib/json/common.rb#176 +# pkg:gem/json#lib/json/common.rb:173 JSON::State = JSON::Ext::Generator::State -# source://json//lib/json/common.rb#1088 +# pkg:gem/json#lib/json/common.rb:1127 module Kernel + include ::Booleans::KernelExtension + private # If _object_ is string-like, parse the string and return the parsed result as @@ -2065,37 +2218,26 @@ module Kernel # The _opts_ argument is passed through to generate/parse respectively. See # generate and parse for their documentation. # - # source://json//lib/json/common.rb#1127 + # pkg:gem/json#lib/json/common.rb:1166 def JSON(object, opts = T.unsafe(nil)); end # Outputs _objs_ to STDOUT as JSON strings in the shortest form, that is in # one line. # - # source://json//lib/json/common.rb#1093 + # pkg:gem/json#lib/json/common.rb:1132 def j(*objs); end # Outputs _objs_ to STDOUT as JSON strings in a pretty format, with # indentation and over many lines. # - # source://json//lib/json/common.rb#1108 + # pkg:gem/json#lib/json/common.rb:1147 def jj(*objs); end end -class NilClass - include ::JSON::Ext::Generator::GeneratorMethods::NilClass -end - +# pkg:gem/json#lib/json/common.rb:1171 class Object < ::BasicObject + include ::Booleans::KernelExtension include ::Kernel include ::PP::ObjectMixin - include ::JSON::Ext::Generator::GeneratorMethods::Object -end - -class String - include ::Comparable - include ::JSON::Ext::Generator::GeneratorMethods::String -end - -class TrueClass - include ::JSON::Ext::Generator::GeneratorMethods::TrueClass + include ::JSON::GeneratorMethods end diff --git a/sorbet/rbi/gems/minitest@5.17.0.rbi b/sorbet/rbi/gems/minitest@6.0.5.rbi similarity index 100% rename from sorbet/rbi/gems/minitest@5.17.0.rbi rename to sorbet/rbi/gems/minitest@6.0.5.rbi diff --git a/sorbet/rbi/gems/parallel@1.27.0.rbi b/sorbet/rbi/gems/parallel@1.27.0.rbi deleted file mode 100644 index 854c487..0000000 --- a/sorbet/rbi/gems/parallel@1.27.0.rbi +++ /dev/null @@ -1,291 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `parallel` gem. -# Please instead update this file by running `bin/tapioca gem parallel`. - - -# source://parallel//lib/parallel/version.rb#2 -module Parallel - class << self - # @return [Boolean] - # - # source://parallel//lib/parallel.rb#243 - def all?(*args, &block); end - - # @return [Boolean] - # - # source://parallel//lib/parallel.rb#238 - def any?(*args, &block); end - - # source://parallel//lib/parallel.rb#234 - def each(array, options = T.unsafe(nil), &block); end - - # source://parallel//lib/parallel.rb#248 - def each_with_index(array, options = T.unsafe(nil), &block); end - - # source://parallel//lib/parallel.rb#307 - def filter_map(*_arg0, **_arg1, &_arg2); end - - # source://parallel//lib/parallel.rb#303 - def flat_map(*_arg0, **_arg1, &_arg2); end - - # source://parallel//lib/parallel.rb#228 - def in_processes(options = T.unsafe(nil), &block); end - - # source://parallel//lib/parallel.rb#212 - def in_threads(options = T.unsafe(nil)); end - - # source://parallel//lib/parallel.rb#252 - def map(source, options = T.unsafe(nil), &block); end - - # source://parallel//lib/parallel.rb#299 - def map_with_index(array, options = T.unsafe(nil), &block); end - - # Number of physical processor cores on the current system. - # - # source://parallel//lib/parallel.rb#312 - def physical_processor_count; end - - # Number of processors seen by the OS or value considering CPU quota if the process is inside a cgroup, - # used for process scheduling - # - # source://parallel//lib/parallel.rb#342 - def processor_count; end - - # source://parallel//lib/parallel.rb#346 - def worker_number; end - - # TODO: this does not work when doing threads in forks, so should remove and yield the number instead if needed - # - # source://parallel//lib/parallel.rb#351 - def worker_number=(worker_num); end - - private - - # source://parallel//lib/parallel.rb#384 - def add_progress_bar!(job_factory, options); end - - # source://parallel//lib/parallel.rb#699 - def available_processor_count; end - - # source://parallel//lib/parallel.rb#647 - def call_with_index(item, index, options, &block); end - - # source://parallel//lib/parallel.rb#579 - def create_workers(job_factory, options, &block); end - - # options is either a Integer or a Hash with :count - # - # source://parallel//lib/parallel.rb#637 - def extract_count_from_options(options); end - - # source://parallel//lib/parallel.rb#665 - def instrument_finish(item, index, result, options); end - - # yield results in the order of the input items - # needs to use `options` to store state between executions - # needs to use `done` index since a nil result would also be valid - # - # source://parallel//lib/parallel.rb#674 - def instrument_finish_in_order(item, index, result, options); end - - # source://parallel//lib/parallel.rb#694 - def instrument_start(item, index, options); end - - # source://parallel//lib/parallel.rb#357 - def physical_processor_count_windows; end - - # source://parallel//lib/parallel.rb#613 - def process_incoming_jobs(read, write, job_factory, options, &block); end - - # source://parallel//lib/parallel.rb#567 - def replace_worker(job_factory, workers, index, options, blk); end - - # source://parallel//lib/parallel.rb#378 - def run(command); end - - # source://parallel//lib/parallel.rb#658 - def with_instrumentation(item, index, options); end - - # source://parallel//lib/parallel.rb#409 - def work_direct(job_factory, options, &block); end - - # source://parallel//lib/parallel.rb#519 - def work_in_processes(job_factory, options, &blk); end - - # source://parallel//lib/parallel.rb#453 - def work_in_ractors(job_factory, options); end - - # source://parallel//lib/parallel.rb#428 - def work_in_threads(job_factory, options, &block); end - - # source://parallel//lib/parallel.rb#587 - def worker(job_factory, options, &block); end - end -end - -# source://parallel//lib/parallel.rb#11 -class Parallel::Break < ::StandardError - # @return [Break] a new instance of Break - # - # source://parallel//lib/parallel.rb#14 - def initialize(value = T.unsafe(nil)); end - - # Returns the value of attribute value. - # - # source://parallel//lib/parallel.rb#12 - def value; end -end - -# source://parallel//lib/parallel.rb#8 -class Parallel::DeadWorker < ::StandardError; end - -# source://parallel//lib/parallel.rb#32 -class Parallel::ExceptionWrapper - # @return [ExceptionWrapper] a new instance of ExceptionWrapper - # - # source://parallel//lib/parallel.rb#35 - def initialize(exception); end - - # Returns the value of attribute exception. - # - # source://parallel//lib/parallel.rb#33 - def exception; end -end - -# source://parallel//lib/parallel.rb#98 -class Parallel::JobFactory - # @return [JobFactory] a new instance of JobFactory - # - # source://parallel//lib/parallel.rb#99 - def initialize(source, mutex); end - - # source://parallel//lib/parallel.rb#107 - def next; end - - # generate item that is sent to workers - # just index is faster + less likely to blow up with unserializable errors - # - # source://parallel//lib/parallel.rb#136 - def pack(item, index); end - - # source://parallel//lib/parallel.rb#126 - def size; end - - # unpack item that is sent to workers - # - # source://parallel//lib/parallel.rb#141 - def unpack(data); end - - private - - # @return [Boolean] - # - # source://parallel//lib/parallel.rb#147 - def producer?; end - - # source://parallel//lib/parallel.rb#151 - def queue_wrapper(array); end -end - -# source://parallel//lib/parallel.rb#20 -class Parallel::Kill < ::Parallel::Break; end - -# source://parallel//lib/parallel.rb#6 -Parallel::Stop = T.let(T.unsafe(nil), Object) - -# source://parallel//lib/parallel.rb#23 -class Parallel::UndumpableException < ::StandardError - # @return [UndumpableException] a new instance of UndumpableException - # - # source://parallel//lib/parallel.rb#26 - def initialize(original); end - - # Returns the value of attribute backtrace. - # - # source://parallel//lib/parallel.rb#24 - def backtrace; end -end - -# source://parallel//lib/parallel.rb#156 -class Parallel::UserInterruptHandler - class << self - # source://parallel//lib/parallel.rb#181 - def kill(thing); end - - # kill all these pids or threads if user presses Ctrl+c - # - # source://parallel//lib/parallel.rb#161 - def kill_on_ctrl_c(pids, options); end - - private - - # source://parallel//lib/parallel.rb#205 - def restore_interrupt(old, signal); end - - # source://parallel//lib/parallel.rb#190 - def trap_interrupt(signal); end - end -end - -# source://parallel//lib/parallel.rb#157 -Parallel::UserInterruptHandler::INTERRUPT_SIGNAL = T.let(T.unsafe(nil), Symbol) - -# source://parallel//lib/parallel/version.rb#3 -Parallel::VERSION = T.let(T.unsafe(nil), String) - -# source://parallel//lib/parallel/version.rb#3 -Parallel::Version = T.let(T.unsafe(nil), String) - -# source://parallel//lib/parallel.rb#51 -class Parallel::Worker - # @return [Worker] a new instance of Worker - # - # source://parallel//lib/parallel.rb#55 - def initialize(read, write, pid); end - - # might be passed to started_processes and simultaneously closed by another thread - # when running in isolation mode, so we have to check if it is closed before closing - # - # source://parallel//lib/parallel.rb#68 - def close_pipes; end - - # Returns the value of attribute pid. - # - # source://parallel//lib/parallel.rb#52 - def pid; end - - # Returns the value of attribute read. - # - # source://parallel//lib/parallel.rb#52 - def read; end - - # source://parallel//lib/parallel.rb#61 - def stop; end - - # Returns the value of attribute thread. - # - # source://parallel//lib/parallel.rb#53 - def thread; end - - # Sets the attribute thread - # - # @param value the value to set the attribute thread to. - # - # source://parallel//lib/parallel.rb#53 - def thread=(_arg0); end - - # source://parallel//lib/parallel.rb#73 - def work(data); end - - # Returns the value of attribute write. - # - # source://parallel//lib/parallel.rb#52 - def write; end - - private - - # source://parallel//lib/parallel.rb#91 - def wait; end -end diff --git a/sorbet/rbi/gems/parallel@2.1.0.rbi b/sorbet/rbi/gems/parallel@2.1.0.rbi new file mode 100644 index 0000000..f785286 --- /dev/null +++ b/sorbet/rbi/gems/parallel@2.1.0.rbi @@ -0,0 +1,321 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `parallel` gem. +# Please instead update this file by running `bin/tapioca gem parallel`. + + +# pkg:gem/parallel#lib/parallel/version.rb:2 +module Parallel + class << self + # pkg:gem/parallel#lib/parallel.rb:256 + def all?(*args, &block); end + + # pkg:gem/parallel#lib/parallel.rb:251 + def any?(*args, &block); end + + # pkg:gem/parallel#lib/parallel.rb:247 + def each(array, options = T.unsafe(nil), &block); end + + # pkg:gem/parallel#lib/parallel.rb:261 + def each_with_index(array, options = T.unsafe(nil), &block); end + + # pkg:gem/parallel#lib/parallel.rb:320 + def filter_map(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/parallel#lib/parallel.rb:316 + def flat_map(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/parallel#lib/parallel.rb:241 + def in_processes(options = T.unsafe(nil), &block); end + + # pkg:gem/parallel#lib/parallel.rb:225 + def in_threads(options = T.unsafe(nil)); end + + # pkg:gem/parallel#lib/parallel.rb:265 + def map(source, options = T.unsafe(nil), &block); end + + # pkg:gem/parallel#lib/parallel.rb:312 + def map_with_index(array, options = T.unsafe(nil), &block); end + + # Number of physical processor cores on the current system. + # + # pkg:gem/parallel#lib/parallel.rb:325 + def physical_processor_count; end + + # Number of processors seen by the OS or value considering CPU quota if the process is inside a cgroup, + # used for process scheduling + # + # pkg:gem/parallel#lib/parallel.rb:355 + def processor_count; end + + # pkg:gem/parallel#lib/parallel.rb:359 + def worker_number; end + + # TODO: this does not work when doing threads in forks, so should remove and yield the number instead if needed + # + # pkg:gem/parallel#lib/parallel.rb:364 + def worker_number=(worker_num); end + + private + + # pkg:gem/parallel#lib/parallel.rb:397 + def add_progress_bar!(job_factory, options); end + + # pkg:gem/parallel#lib/parallel.rb:738 + def available_processor_count; end + + # pkg:gem/parallel#lib/parallel.rb:686 + def call_with_index(item, index, options, &block); end + + # pkg:gem/parallel#lib/parallel.rb:616 + def create_workers(job_factory, options, &block); end + + # options is either a Integer or a Hash with :count + # + # pkg:gem/parallel#lib/parallel.rb:676 + def extract_count_from_options(options); end + + # pkg:gem/parallel#lib/parallel.rb:704 + def instrument_finish(item, index, result, options); end + + # yield results in the order of the input items + # needs to use `options` to store state between executions + # needs to use `done` index since a nil result would also be valid + # + # pkg:gem/parallel#lib/parallel.rb:713 + def instrument_finish_in_order(item, index, result, options); end + + # pkg:gem/parallel#lib/parallel.rb:733 + def instrument_start(item, index, options); end + + # pkg:gem/parallel#lib/parallel.rb:370 + def physical_processor_count_windows; end + + # pkg:gem/parallel#lib/parallel.rb:651 + def process_incoming_jobs(read, write, job_factory, options, &block); end + + # pkg:gem/parallel#lib/parallel.rb:526 + def ractor_build(use_port); end + + # pkg:gem/parallel#lib/parallel.rb:547 + def ractor_result(item, index, result, results, results_mutex, options); end + + # pkg:gem/parallel#lib/parallel.rb:552 + def ractor_stop(ractor); end + + # pkg:gem/parallel#lib/parallel.rb:604 + def replace_worker(job_factory, workers, index, options, blk); end + + # pkg:gem/parallel#lib/parallel.rb:391 + def run(command); end + + # pkg:gem/parallel#lib/parallel.rb:697 + def with_instrumentation(item, index, options); end + + # pkg:gem/parallel#lib/parallel.rb:422 + def work_direct(job_factory, options, &block); end + + # pkg:gem/parallel#lib/parallel.rb:556 + def work_in_processes(job_factory, options, &blk); end + + # pkg:gem/parallel#lib/parallel.rb:466 + def work_in_ractors(job_factory, options); end + + # pkg:gem/parallel#lib/parallel.rb:441 + def work_in_threads(job_factory, options, &block); end + + # pkg:gem/parallel#lib/parallel.rb:624 + def worker(job_factory, options, &block); end + end +end + +# pkg:gem/parallel#lib/parallel.rb:12 +class Parallel::Break < ::StandardError + # pkg:gem/parallel#lib/parallel.rb:15 + def initialize(value = T.unsafe(nil)); end + + # marshal_dump that is used for ruby exceptions + # avoid dumping the cause since nobody needs that and it can include undumpable exceptions + # + # pkg:gem/parallel#lib/parallel.rb:22 + def _dump(_depth); end + + # pkg:gem/parallel#lib/parallel.rb:13 + def value; end + + class << self + # marshal_load that is used for ruby exceptions + # + # pkg:gem/parallel#lib/parallel.rb:27 + def _load(data); end + end +end + +# pkg:gem/parallel#lib/parallel.rb:9 +class Parallel::DeadWorker < ::StandardError; end + +# pkg:gem/parallel#lib/parallel.rb:44 +class Parallel::ExceptionWrapper + # pkg:gem/parallel#lib/parallel.rb:47 + def initialize(exception); end + + # pkg:gem/parallel#lib/parallel.rb:45 + def exception; end +end + +# pkg:gem/parallel#lib/parallel.rb:111 +class Parallel::JobFactory + # pkg:gem/parallel#lib/parallel.rb:112 + def initialize(source, mutex); end + + # pkg:gem/parallel#lib/parallel.rb:120 + def next; end + + # generate item that is sent to workers + # just index is faster + less likely to blow up with unserializable errors + # + # pkg:gem/parallel#lib/parallel.rb:149 + def pack(item, index); end + + # pkg:gem/parallel#lib/parallel.rb:139 + def size; end + + # unpack item that is sent to workers + # + # pkg:gem/parallel#lib/parallel.rb:154 + def unpack(data); end + + private + + # pkg:gem/parallel#lib/parallel.rb:160 + def producer?; end + + # pkg:gem/parallel#lib/parallel.rb:164 + def queue_wrapper(array); end +end + +# pkg:gem/parallel#lib/parallel.rb:32 +class Parallel::Kill < ::Parallel::Break; end + +# Pluggable wire serializers. Each must respond to `dump(data, io)` / +# `load(io)` (used directly by Worker) and `dump(data)` / `load(string)` +# (used by wrappers like Hmac). +# +# pkg:gem/parallel#lib/parallel/serializer.rb:9 +module Parallel::Serializer; end + +# Wraps any inner serializer with a length-prefixed HMAC-SHA256 frame keyed +# on a per-worker secret generated before fork. Forged frames from a +# pipe-injector fail verification. +# +# pkg:gem/parallel#lib/parallel/serializer.rb:17 +class Parallel::Serializer::Hmac + # SHA256 + # + # pkg:gem/parallel#lib/parallel/serializer.rb:22 + def initialize(inner: T.unsafe(nil), secret: T.unsafe(nil)); end + + # pkg:gem/parallel#lib/parallel/serializer.rb:27 + def dump(data, io); end + + # pkg:gem/parallel#lib/parallel/serializer.rb:33 + def load(io); end +end + +# 32-bit big-endian unsigned int +# +# pkg:gem/parallel#lib/parallel/serializer.rb:19 +Parallel::Serializer::Hmac::LENGTH_BYTES = T.let(T.unsafe(nil), Integer) + +# pkg:gem/parallel#lib/parallel/serializer.rb:18 +Parallel::Serializer::Hmac::LENGTH_FORMAT = T.let(T.unsafe(nil), String) + +# pkg:gem/parallel#lib/parallel/serializer.rb:20 +Parallel::Serializer::Hmac::MAC_BYTES = T.let(T.unsafe(nil), Integer) + +# Raw Marshal. Fast but trusts anything written to the pipe — a same-UID +# attacker that reopens /proc//fd/ can inject Marshal gadgets (RCE). +# +# pkg:gem/parallel#lib/parallel/serializer.rb:12 +Parallel::Serializer::Marshal = Marshal + +# pkg:gem/parallel#lib/parallel.rb:7 +Parallel::Stop = T.let(T.unsafe(nil), Object) + +# pkg:gem/parallel#lib/parallel.rb:35 +class Parallel::UndumpableException < ::StandardError + # pkg:gem/parallel#lib/parallel.rb:38 + def initialize(original); end + + # pkg:gem/parallel#lib/parallel.rb:36 + def backtrace; end +end + +# pkg:gem/parallel#lib/parallel.rb:169 +class Parallel::UserInterruptHandler + class << self + # pkg:gem/parallel#lib/parallel.rb:194 + def kill(thing); end + + # kill all these pids or threads if user presses Ctrl+c + # + # pkg:gem/parallel#lib/parallel.rb:174 + def kill_on_ctrl_c(pids, options); end + + private + + # pkg:gem/parallel#lib/parallel.rb:218 + def restore_interrupt(old, signal); end + + # pkg:gem/parallel#lib/parallel.rb:203 + def trap_interrupt(signal); end + end +end + +# pkg:gem/parallel#lib/parallel.rb:170 +Parallel::UserInterruptHandler::INTERRUPT_SIGNAL = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/parallel#lib/parallel/version.rb:3 +Parallel::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/parallel#lib/parallel/version.rb:3 +Parallel::Version = T.let(T.unsafe(nil), String) + +# pkg:gem/parallel#lib/parallel.rb:63 +class Parallel::Worker + # pkg:gem/parallel#lib/parallel.rb:67 + def initialize(read, write, pid, serializer); end + + # might be passed to started_processes and simultaneously closed by another thread + # when running in isolation mode, so we have to check if it is closed before closing + # + # pkg:gem/parallel#lib/parallel.rb:81 + def close_pipes; end + + # pkg:gem/parallel#lib/parallel.rb:64 + def pid; end + + # pkg:gem/parallel#lib/parallel.rb:64 + def read; end + + # pkg:gem/parallel#lib/parallel.rb:74 + def stop; end + + # pkg:gem/parallel#lib/parallel.rb:65 + def thread; end + + # pkg:gem/parallel#lib/parallel.rb:65 + def thread=(_arg0); end + + # pkg:gem/parallel#lib/parallel.rb:86 + def work(data); end + + # pkg:gem/parallel#lib/parallel.rb:64 + def write; end + + private + + # pkg:gem/parallel#lib/parallel.rb:104 + def wait; end +end diff --git a/sorbet/rbi/gems/prism@1.5.2.rbi b/sorbet/rbi/gems/prism@1.9.0.rbi similarity index 100% rename from sorbet/rbi/gems/prism@1.5.2.rbi rename to sorbet/rbi/gems/prism@1.9.0.rbi diff --git a/sorbet/rbi/gems/rake@13.0.6.rbi b/sorbet/rbi/gems/rake@13.4.2.rbi similarity index 100% rename from sorbet/rbi/gems/rake@13.0.6.rbi rename to sorbet/rbi/gems/rake@13.4.2.rbi diff --git a/sorbet/rbi/gems/rbi@0.3.7.rbi b/sorbet/rbi/gems/rbi@0.3.10.rbi similarity index 53% rename from sorbet/rbi/gems/rbi@0.3.7.rbi rename to sorbet/rbi/gems/rbi@0.3.10.rbi index 82dd8b8..05af80e 100644 --- a/sorbet/rbi/gems/rbi@0.3.7.rbi +++ b/sorbet/rbi/gems/rbi@0.3.10.rbi @@ -9,138 +9,107 @@ # DO NOT EDIT MANUALLY # This is an autogenerated file for types exported from the `rbi` gem. -# Please instead update this file by running `spoom srb sigs export`. +# Please instead update this file by running `bundle exec spoom srb sigs export`. -# source://rbi//lib/rbi.rb#7 +# pkg:gem/rbi#lib/rbi.rb:7 module RBI; end -# source://rbi//lib/rbi/model.rb#833 +# pkg:gem/rbi#lib/rbi/model.rb:862 class RBI::Arg < ::RBI::Node - # : (String value, ?loc: Loc?) -> void - # - # @return [Arg] a new instance of Arg - # - # source://rbi//lib/rbi/model.rb#838 + # pkg:gem/rbi#lib/rbi/model.rb:867 sig { params(value: ::String, loc: T.nilable(::RBI::Loc)).void } def initialize(value, loc: T.unsafe(nil)); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#844 + # pkg:gem/rbi#lib/rbi/model.rb:873 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#849 + # pkg:gem/rbi#lib/rbi/model.rb:878 sig { returns(::String) } def to_s; end - # : String - # - # source://rbi//lib/rbi/model.rb#835 + # pkg:gem/rbi#lib/rbi/model.rb:864 sig { returns(::String) } def value; end end # @abstract # -# source://rbi//lib/rbi/model.rb#298 +# pkg:gem/rbi#lib/rbi/model.rb:325 class RBI::Attr < ::RBI::NodeWithComments include ::RBI::Indexable abstract! - # : ( - # | Symbol name, - # | Array[Symbol] names, - # | ?visibility: Visibility, - # | ?sigs: Array[Sig], - # | ?loc: Loc?, - # | ?comments: Array[Comment] - # | ) -> void - # - # @return [Attr] a new instance of Attr - # - # source://rbi//lib/rbi/model.rb#316 + # pkg:gem/rbi#lib/rbi/model.rb:353 sig do params( name: ::Symbol, names: T::Array[::Symbol], visibility: ::RBI::Visibility, - sigs: T::Array[::RBI::Sig], + sigs: T.nilable(T::Array[::RBI::Sig]), loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment] + comments: T.nilable(T::Array[::RBI::Comment]) ).void end def initialize(name, names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # : (Node other) -> bool - # - # @return [Boolean] + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#407 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:420 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[Method] - # # @abstract - # @raise [NotImplementedError] # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#59 + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:59 sig { abstract.returns(T::Array[::RBI::Method]) } def convert_to_methods; end - # : -> Array[String] - # # @abstract - # @raise [NotImplementedError] # - # source://rbi//lib/rbi/model.rb#325 + # pkg:gem/rbi#lib/rbi/model.rb:362 sig { abstract.returns(T::Array[::String]) } def fully_qualified_names; end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#104 + # pkg:gem/rbi#lib/rbi/index.rb:104 sig { override.returns(T::Array[::String]) } def index_ids; end - # : (Node other) -> void + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#416 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:429 sig { override.params(other: ::RBI::Node).void } def merge_with(other); end - # : Array[Symbol] - # - # source://rbi//lib/rbi/model.rb#300 + # pkg:gem/rbi#lib/rbi/model.rb:327 sig { returns(T::Array[::Symbol]) } def names; end - # : Array[Sig] - # - # source://rbi//lib/rbi/model.rb#306 + # pkg:gem/rbi#lib/rbi/model.rb:333 sig { returns(T::Array[::RBI::Sig]) } def sigs; end - # : Visibility - # - # source://rbi//lib/rbi/model.rb#303 + # pkg:gem/rbi#lib/rbi/model.rb:343 + sig { params(sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Sig]) } + def sigs=(sigs); end + + # pkg:gem/rbi#lib/rbi/model.rb:338 + sig { returns(T::Boolean) } + def sigs?; end + + # pkg:gem/rbi#lib/rbi/model.rb:330 sig { returns(::RBI::Visibility) } def visibility; end - # : Visibility - # - # source://rbi//lib/rbi/model.rb#303 + # pkg:gem/rbi#lib/rbi/model.rb:330 def visibility=(_arg0); end private - # : (String name, Sig? sig, Visibility visibility, Loc? loc, Array[Comment] comments) -> Method - # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#80 + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:80 sig do params( name: ::String, @@ -152,16 +121,7 @@ class RBI::Attr < ::RBI::NodeWithComments end def create_getter_method(name, sig, visibility, loc, comments); end - # : ( - # | String name, - # | Sig? sig, - # | (Type | String)? attribute_type, - # | Visibility visibility, - # | Loc? loc, - # | Array[Comment] comments - # | ) -> Method - # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#99 + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:99 sig do params( name: ::String, @@ -174,300 +134,221 @@ class RBI::Attr < ::RBI::NodeWithComments end def create_setter_method(name, sig, attribute_type, visibility, loc, comments); end - # : -> [Sig?, (Type | String)?] - # - # @raise [UnexpectedMultipleSigsError] + # @final # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#65 + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:65 sig(:final) { returns([T.nilable(::RBI::Sig), T.nilable(T.any(::RBI::Type, ::String))]) } def parse_sig; end end -# source://rbi//lib/rbi/model.rb#328 +# pkg:gem/rbi#lib/rbi/model.rb:365 class RBI::AttrAccessor < ::RBI::Attr - # : ( - # | Symbol name, - # | *Symbol names, - # | ?visibility: Visibility, - # | ?sigs: Array[Sig], - # | ?loc: Loc?, - # | ?comments: Array[Comment] - # | ) ?{ (AttrAccessor node) -> void } -> void - # - # @return [AttrAccessor] a new instance of AttrAccessor - # - # source://rbi//lib/rbi/model.rb#337 + # pkg:gem/rbi#lib/rbi/model.rb:374 sig do params( name: ::Symbol, names: ::Symbol, visibility: ::RBI::Visibility, - sigs: T::Array[::RBI::Sig], + sigs: T.nilable(T::Array[::RBI::Sig]), loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::AttrAccessor).void) ).void end def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # - # @return [Boolean] + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#445 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:458 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[Method] + # @override # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#130 + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:130 sig { override.returns(T::Array[::RBI::Method]) } def convert_to_methods; end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/model.rb#344 + # pkg:gem/rbi#lib/rbi/model.rb:381 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#351 + # pkg:gem/rbi#lib/rbi/model.rb:388 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#357 +# pkg:gem/rbi#lib/rbi/model.rb:394 class RBI::AttrReader < ::RBI::Attr - # : ( - # | Symbol name, - # | *Symbol names, - # | ?visibility: Visibility, - # | ?sigs: Array[Sig], - # | ?loc: Loc?, - # | ?comments: Array[Comment] - # | ) ?{ (AttrReader node) -> void } -> void - # - # @return [AttrReader] a new instance of AttrReader - # - # source://rbi//lib/rbi/model.rb#366 + # pkg:gem/rbi#lib/rbi/model.rb:403 sig do params( name: ::Symbol, names: ::Symbol, visibility: ::RBI::Visibility, - sigs: T::Array[::RBI::Sig], + sigs: T.nilable(T::Array[::RBI::Sig]), loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::AttrReader).void) ).void end def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # - # @return [Boolean] + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#429 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:442 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[Method] + # @override # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#145 + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:145 sig { override.returns(T::Array[::RBI::Method]) } def convert_to_methods; end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/model.rb#373 + # pkg:gem/rbi#lib/rbi/model.rb:410 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#380 + # pkg:gem/rbi#lib/rbi/model.rb:417 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#386 +# pkg:gem/rbi#lib/rbi/model.rb:423 class RBI::AttrWriter < ::RBI::Attr - # : ( - # | Symbol name, - # | *Symbol names, - # | ?visibility: Visibility, - # | ?sigs: Array[Sig], - # | ?loc: Loc?, - # | ?comments: Array[Comment] - # | ) ?{ (AttrWriter node) -> void } -> void - # - # @return [AttrWriter] a new instance of AttrWriter - # - # source://rbi//lib/rbi/model.rb#395 + # pkg:gem/rbi#lib/rbi/model.rb:432 sig do params( name: ::Symbol, names: ::Symbol, visibility: ::RBI::Visibility, - sigs: T::Array[::RBI::Sig], + sigs: T.nilable(T::Array[::RBI::Sig]), loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::AttrWriter).void) ).void end def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool + # @override # - # @return [Boolean] - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#437 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:450 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[Method] + # @override # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#155 + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:155 sig { override.returns(T::Array[::RBI::Method]) } def convert_to_methods; end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/model.rb#402 + # pkg:gem/rbi#lib/rbi/model.rb:439 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#409 + # pkg:gem/rbi#lib/rbi/model.rb:446 sig { override.returns(::String) } def to_s; end end # An arbitrary blank line that can be added both in trees and comments # -# source://rbi//lib/rbi/model.rb#70 +# pkg:gem/rbi#lib/rbi/model.rb:70 class RBI::BlankLine < ::RBI::Comment - # : (?loc: Loc?) -> void - # - # @return [BlankLine] a new instance of BlankLine - # - # source://rbi//lib/rbi/model.rb#72 + # pkg:gem/rbi#lib/rbi/model.rb:72 sig { params(loc: T.nilable(::RBI::Loc)).void } def initialize(loc: T.unsafe(nil)); end end -# source://rbi//lib/rbi/model.rb#679 +# pkg:gem/rbi#lib/rbi/model.rb:710 class RBI::BlockParam < ::RBI::Param - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (BlockParam node) -> void } -> void - # - # @return [BlockParam] a new instance of BlockParam - # - # source://rbi//lib/rbi/model.rb#681 + # pkg:gem/rbi#lib/rbi/model.rb:712 sig do params( name: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::BlockParam).void) ).void end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#693 - sig { params(other: T.nilable(::Object)).returns(T::Boolean) } - def ==(other); end - - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#688 + # pkg:gem/rbi#lib/rbi/model.rb:719 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#195 +# pkg:gem/rbi#lib/rbi/model.rb:217 class RBI::Class < ::RBI::Scope - # : (String name, ?superclass_name: String?, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Class node) -> void } -> void - # - # @return [Class] a new instance of Class - # - # source://rbi//lib/rbi/model.rb#203 + # pkg:gem/rbi#lib/rbi/model.rb:230 sig do params( name: ::String, superclass_name: T.nilable(::String), loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::Class).void) ).void end def initialize(name, superclass_name: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # - # @return [Boolean] + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#375 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:388 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#212 + # pkg:gem/rbi#lib/rbi/model.rb:239 sig { override.returns(::String) } def fully_qualified_name; end - # : String - # - # source://rbi//lib/rbi/model.rb#197 + # pkg:gem/rbi#lib/rbi/model.rb:219 sig { returns(::String) } def name; end - # : String - # - # source://rbi//lib/rbi/model.rb#197 + # pkg:gem/rbi#lib/rbi/model.rb:219 def name=(_arg0); end - # : String? - # - # source://rbi//lib/rbi/model.rb#200 + # pkg:gem/rbi#lib/rbi/model.rb:222 sig { returns(T.nilable(::String)) } def superclass_name; end - # : String? - # - # source://rbi//lib/rbi/model.rb#200 + # pkg:gem/rbi#lib/rbi/model.rb:222 def superclass_name=(_arg0); end end -# source://rbi//lib/rbi/model.rb#51 +# pkg:gem/rbi#lib/rbi/model.rb:51 class RBI::Comment < ::RBI::Node - # : (String text, ?loc: Loc?) -> void - # - # @return [Comment] a new instance of Comment - # - # source://rbi//lib/rbi/model.rb#56 + # pkg:gem/rbi#lib/rbi/model.rb:56 sig { params(text: ::String, loc: T.nilable(::RBI::Loc)).void } def initialize(text, loc: T.unsafe(nil)); end - # : (Object other) -> bool - # - # source://rbi//lib/rbi/model.rb#62 + # pkg:gem/rbi#lib/rbi/model.rb:62 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end - # : String - # - # source://rbi//lib/rbi/model.rb#53 + # pkg:gem/rbi#lib/rbi/model.rb:53 sig { returns(::String) } def text; end - # : String - # - # source://rbi//lib/rbi/model.rb#53 + # pkg:gem/rbi#lib/rbi/model.rb:53 def text=(_arg0); end end @@ -486,190 +367,149 @@ end # end # ~~~ # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#559 +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:589 class RBI::ConflictTree < ::RBI::Tree - # : (?left_name: String, ?right_name: String) -> void - # - # @return [ConflictTree] a new instance of ConflictTree - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#567 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:597 sig { params(left_name: ::String, right_name: ::String).void } def initialize(left_name: T.unsafe(nil), right_name: T.unsafe(nil)); end - # : Tree - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#561 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:591 sig { returns(::RBI::Tree) } def left; end - # : String - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#564 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:594 sig { returns(::String) } def left_name; end - # : Tree - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#561 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:591 def right; end - # : String - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#564 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:594 def right_name; end end # Consts # -# source://rbi//lib/rbi/model.rb#269 +# pkg:gem/rbi#lib/rbi/model.rb:296 class RBI::Const < ::RBI::NodeWithComments include ::RBI::Indexable - # : (String name, String value, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Const node) -> void } -> void - # - # @return [Const] a new instance of Const - # - # source://rbi//lib/rbi/model.rb#274 + # pkg:gem/rbi#lib/rbi/model.rb:301 sig do params( name: ::String, value: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::Const).void) ).void end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # - # @return [Boolean] + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#399 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:412 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#282 + # pkg:gem/rbi#lib/rbi/model.rb:309 sig { returns(::String) } def fully_qualified_name; end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#94 + # pkg:gem/rbi#lib/rbi/index.rb:94 sig { override.returns(T::Array[::String]) } def index_ids; end - # : String - # - # source://rbi//lib/rbi/model.rb#271 + # pkg:gem/rbi#lib/rbi/model.rb:298 sig { returns(::String) } def name; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#290 + # pkg:gem/rbi#lib/rbi/model.rb:317 sig { override.returns(::String) } def to_s; end - # : String - # - # source://rbi//lib/rbi/model.rb#271 + # pkg:gem/rbi#lib/rbi/model.rb:298 def value; end end -# source://rbi//lib/rbi/rewriters/merge_trees.rb#345 +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:358 class RBI::DuplicateNodeError < ::RBI::Error; end -# source://rbi//lib/rbi.rb#8 +# pkg:gem/rbi#lib/rbi.rb:8 class RBI::Error < ::StandardError; end -# source://rbi//lib/rbi/model.rb#726 +# pkg:gem/rbi#lib/rbi/model.rb:752 class RBI::Extend < ::RBI::Mixin include ::RBI::Indexable - # : (String name, *String names, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Extend node) -> void } -> void - # - # @return [Extend] a new instance of Extend - # - # source://rbi//lib/rbi/model.rb#728 + # pkg:gem/rbi#lib/rbi/model.rb:754 sig do params( name: ::String, names: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::Extend).void) ).void end def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # - # @return [Boolean] + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#492 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:522 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#134 + # pkg:gem/rbi#lib/rbi/index.rb:134 sig { override.returns(T::Array[::String]) } def index_ids; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#735 + # pkg:gem/rbi#lib/rbi/model.rb:761 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#131 +# pkg:gem/rbi#lib/rbi/model.rb:143 class RBI::File - # : (?strictness: String?, ?comments: Array[Comment]) ?{ (File file) -> void } -> void - # - # @return [File] a new instance of File - # - # source://rbi//lib/rbi/model.rb#142 + # pkg:gem/rbi#lib/rbi/model.rb:164 sig do params( strictness: T.nilable(::String), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(file: ::RBI::File).void) ).void end def initialize(strictness: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node node) -> void - # - # source://rbi//lib/rbi/model.rb#150 + # pkg:gem/rbi#lib/rbi/model.rb:172 sig { params(node: ::RBI::Node).void } def <<(node); end - # : Array[Comment] - # - # source://rbi//lib/rbi/model.rb#139 + # pkg:gem/rbi#lib/rbi/model.rb:154 sig { returns(T::Array[::RBI::Comment]) } def comments; end - # : Array[Comment] - # - # source://rbi//lib/rbi/model.rb#139 - def comments=(_arg0); end + # pkg:gem/rbi#lib/rbi/model.rb:151 + sig { params(comments: T::Array[::RBI::Comment]).returns(T::Array[::RBI::Comment]) } + def comments=(comments); end - # : -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/model.rb#155 + # pkg:gem/rbi#lib/rbi/model.rb:159 + sig { returns(T::Boolean) } + def comments?; end + + # pkg:gem/rbi#lib/rbi/model.rb:177 sig { returns(T::Boolean) } def empty?; end - # : (?out: (IO | StringIO), ?indent: Integer, ?print_locs: bool, ?max_line_length: Integer?) -> void - # - # source://rbi//lib/rbi/printer.rb#819 + # pkg:gem/rbi#lib/rbi/printer.rb:877 sig do params( out: T.any(::IO, ::StringIO), @@ -680,62 +520,36 @@ 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 - # : (?out: (IO | StringIO), ?indent: Integer, ?print_locs: bool) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1212 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1236 sig { params(out: T.any(::IO, ::StringIO), indent: ::Integer, print_locs: T::Boolean).void } def rbs_print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end - # : (?indent: Integer, ?print_locs: bool) -> String - # - # source://rbi//lib/rbi/rbs_printer.rb#1218 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1242 sig { params(indent: ::Integer, print_locs: T::Boolean).returns(::String) } def rbs_string(indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end - # : Tree - # - # source://rbi//lib/rbi/model.rb#133 + # pkg:gem/rbi#lib/rbi/model.rb:145 sig { returns(::RBI::Tree) } def root; end - # : Tree - # - # source://rbi//lib/rbi/model.rb#133 + # pkg:gem/rbi#lib/rbi/model.rb:145 def root=(_arg0); end - # : String? - # - # source://rbi//lib/rbi/model.rb#136 + # pkg:gem/rbi#lib/rbi/model.rb:148 sig { returns(T.nilable(::String)) } def strictness; end - # : String? - # - # source://rbi//lib/rbi/model.rb#136 + # pkg:gem/rbi#lib/rbi/model.rb:148 def strictness=(_arg0); end - # : (?indent: Integer, ?print_locs: bool, ?max_line_length: Integer?) -> String - # - # source://rbi//lib/rbi/printer.rb#825 + # pkg:gem/rbi#lib/rbi/printer.rb:883 sig { params(indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer)).returns(::String) } def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end end -# source://rbi//lib/rbi/formatter.rb#5 +# pkg:gem/rbi#lib/rbi/formatter.rb:5 class RBI::Formatter - # : ( - # | ?add_sig_templates: bool, - # | ?group_nodes: bool, - # | ?max_line_length: Integer?, - # | ?nest_singleton_methods: bool, - # | ?nest_non_public_members: bool, - # | ?sort_nodes: bool, - # | ?replace_attributes_with_methods: bool - # | ) -> void - # - # @return [Formatter] a new instance of Formatter - # - # source://rbi//lib/rbi/formatter.rb#18 + # pkg:gem/rbi#lib/rbi/formatter.rb:18 sig do params( add_sig_templates: T::Boolean, @@ -749,273 +563,205 @@ 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_members: T.unsafe(nil), sort_nodes: T.unsafe(nil), replace_attributes_with_methods: T.unsafe(nil)); end - # : (RBI::File file) -> void - # - # source://rbi//lib/rbi/formatter.rb#43 + # pkg:gem/rbi#lib/rbi/formatter.rb:43 sig { params(file: ::RBI::File).void } def format_file(file); end - # : (RBI::Tree tree) -> void - # - # source://rbi//lib/rbi/formatter.rb#48 + # pkg:gem/rbi#lib/rbi/formatter.rb:48 sig { params(tree: ::RBI::Tree).void } def format_tree(tree); end - # : Integer? - # - # source://rbi//lib/rbi/formatter.rb#7 + # pkg:gem/rbi#lib/rbi/formatter.rb:7 sig { returns(T.nilable(::Integer)) } def max_line_length; end - # : Integer? - # - # source://rbi//lib/rbi/formatter.rb#7 + # pkg:gem/rbi#lib/rbi/formatter.rb:7 def max_line_length=(_arg0); end - # : (RBI::File file) -> String - # - # source://rbi//lib/rbi/formatter.rb#37 + # pkg:gem/rbi#lib/rbi/formatter.rb:37 sig { params(file: ::RBI::File).returns(::String) } def print_file(file); end end -# source://rbi//lib/rbi/rewriters/group_nodes.rb#84 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:86 class RBI::Group < ::RBI::Tree - # : (Kind kind) -> void - # - # @return [Group] a new instance of Group - # - # source://rbi//lib/rbi/rewriters/group_nodes.rb#89 + # pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:91 sig { params(kind: ::RBI::Group::Kind).void } def initialize(kind); end - # : Kind - # - # source://rbi//lib/rbi/rewriters/group_nodes.rb#86 + # pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:88 sig { returns(::RBI::Group::Kind) } def kind; end end -# source://rbi//lib/rbi/rewriters/group_nodes.rb#94 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:96 class RBI::Group::Kind class << self private + # pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:111 def new(*_arg0); end end end -# : Kind -# -# source://rbi//lib/rbi/rewriters/group_nodes.rb#101 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:103 RBI::Group::Kind::Attrs = T.let(T.unsafe(nil), RBI::Group::Kind) -# : Kind -# -# source://rbi//lib/rbi/rewriters/group_nodes.rb#107 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:109 RBI::Group::Kind::Consts = T.let(T.unsafe(nil), RBI::Group::Kind) -# : Kind -# -# source://rbi//lib/rbi/rewriters/group_nodes.rb#97 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:99 RBI::Group::Kind::Helpers = T.let(T.unsafe(nil), RBI::Group::Kind) -# : Kind -# -# source://rbi//lib/rbi/rewriters/group_nodes.rb#104 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:106 RBI::Group::Kind::Inits = T.let(T.unsafe(nil), RBI::Group::Kind) -# : Kind -# -# source://rbi//lib/rbi/rewriters/group_nodes.rb#105 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:107 RBI::Group::Kind::Methods = T.let(T.unsafe(nil), RBI::Group::Kind) -# : Kind -# -# source://rbi//lib/rbi/rewriters/group_nodes.rb#99 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:101 RBI::Group::Kind::MixesInClassMethods = T.let(T.unsafe(nil), RBI::Group::Kind) -# : Kind -# -# source://rbi//lib/rbi/rewriters/group_nodes.rb#95 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:97 RBI::Group::Kind::Mixins = T.let(T.unsafe(nil), RBI::Group::Kind) -# : Kind -# -# source://rbi//lib/rbi/rewriters/group_nodes.rb#96 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:98 RBI::Group::Kind::RequiredAncestors = T.let(T.unsafe(nil), RBI::Group::Kind) -# : Kind -# -# source://rbi//lib/rbi/rewriters/group_nodes.rb#100 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:102 RBI::Group::Kind::Sends = T.let(T.unsafe(nil), RBI::Group::Kind) -# : Kind -# -# source://rbi//lib/rbi/rewriters/group_nodes.rb#106 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:108 RBI::Group::Kind::SingletonClasses = T.let(T.unsafe(nil), RBI::Group::Kind) -# : Kind -# -# source://rbi//lib/rbi/rewriters/group_nodes.rb#103 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:105 RBI::Group::Kind::TEnums = T.let(T.unsafe(nil), RBI::Group::Kind) -# : Kind -# -# source://rbi//lib/rbi/rewriters/group_nodes.rb#102 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:104 RBI::Group::Kind::TStructFields = T.let(T.unsafe(nil), RBI::Group::Kind) -# : Kind -# -# source://rbi//lib/rbi/rewriters/group_nodes.rb#98 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:100 RBI::Group::Kind::TypeMembers = T.let(T.unsafe(nil), RBI::Group::Kind) -# source://rbi//lib/rbi/rewriters/group_nodes.rb#5 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:5 class RBI::GroupNodesError < ::RBI::Error; end # Sorbet's misc. # -# source://rbi//lib/rbi/model.rb#1141 +# pkg:gem/rbi#lib/rbi/model.rb:1187 class RBI::Helper < ::RBI::NodeWithComments include ::RBI::Indexable - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Helper node) -> void } -> void - # - # @return [Helper] a new instance of Helper - # - # source://rbi//lib/rbi/model.rb#1146 + # pkg:gem/rbi#lib/rbi/model.rb:1192 sig do params( name: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::Helper).void) ).void end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool + # @override # - # @return [Boolean] - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#508 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:538 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#164 + # pkg:gem/rbi#lib/rbi/index.rb:164 sig { override.returns(T::Array[::String]) } def index_ids; end - # : String - # - # source://rbi//lib/rbi/model.rb#1143 + # pkg:gem/rbi#lib/rbi/model.rb:1189 sig { returns(::String) } def name; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#1154 + # pkg:gem/rbi#lib/rbi/model.rb:1200 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#712 +# pkg:gem/rbi#lib/rbi/model.rb:738 class RBI::Include < ::RBI::Mixin include ::RBI::Indexable - # : (String name, *String names, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Include node) -> void } -> void - # - # @return [Include] a new instance of Include - # - # source://rbi//lib/rbi/model.rb#714 + # pkg:gem/rbi#lib/rbi/model.rb:740 sig do params( name: ::String, names: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::Include).void) ).void end def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool + # @override # - # @return [Boolean] - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#484 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:514 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#124 + # pkg:gem/rbi#lib/rbi/index.rb:124 sig { override.returns(T::Array[::String]) } def index_ids; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#721 + # pkg:gem/rbi#lib/rbi/model.rb:747 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/index.rb#5 +# pkg:gem/rbi#lib/rbi/index.rb:5 class RBI::Index < ::RBI::Visitor - # : -> void - # - # @return [Index] a new instance of Index - # - # source://rbi//lib/rbi/index.rb#16 + # pkg:gem/rbi#lib/rbi/index.rb:16 sig { void } def initialize; end - # : (String id) -> Array[Node] - # - # source://rbi//lib/rbi/index.rb#27 + # pkg:gem/rbi#lib/rbi/index.rb:27 sig { params(id: ::String).returns(T::Array[::RBI::Node]) } def [](id); end - # : (*Node nodes) -> void - # - # source://rbi//lib/rbi/index.rb#32 + # pkg:gem/rbi#lib/rbi/index.rb:32 sig { params(nodes: ::RBI::Node).void } def index(*nodes); end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#22 + # pkg:gem/rbi#lib/rbi/index.rb:22 sig { returns(T::Array[::String]) } def keys; end - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/index.rb#38 + # pkg:gem/rbi#lib/rbi/index.rb:38 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : ((Indexable & Node) node) -> void - # - # source://rbi//lib/rbi/index.rb#55 + # pkg:gem/rbi#lib/rbi/index.rb:55 sig { params(node: T.all(::RBI::Indexable, ::RBI::Node)).void } def index_node(node); end class << self - # : (*Node node) -> Index - # - # source://rbi//lib/rbi/index.rb#8 + # pkg:gem/rbi#lib/rbi/index.rb:8 sig { params(node: ::RBI::Node).returns(::RBI::Index) } def index(*node); end end end # A Node that can be referred to by a unique ID inside an index +# @interface # -# source://rbi//lib/rbi/index.rb#69 +# pkg:gem/rbi#lib/rbi/index.rb:69 module RBI::Indexable interface! @@ -1023,155 +769,100 @@ module RBI::Indexable # # Some nodes can have multiple ids, for example an attribute accessor matches the ID of the # getter and the setter. - # : -> Array[String] - # # @abstract - # @raise [NotImplementedError] # - # source://rbi//lib/rbi/index.rb#76 + # pkg:gem/rbi#lib/rbi/index.rb:76 sig { abstract.returns(T::Array[::String]) } def index_ids; end end -# source://rbi//lib/rbi/model.rb#854 +# pkg:gem/rbi#lib/rbi/model.rb:883 class RBI::KwArg < ::RBI::Arg - # : (String keyword, String value, ?loc: Loc?) -> void - # - # @return [KwArg] a new instance of KwArg - # - # source://rbi//lib/rbi/model.rb#859 + # pkg:gem/rbi#lib/rbi/model.rb:888 sig { params(keyword: ::String, value: ::String, loc: T.nilable(::RBI::Loc)).void } def initialize(keyword, value, loc: T.unsafe(nil)); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#865 + # pkg:gem/rbi#lib/rbi/model.rb:894 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # : String - # - # source://rbi//lib/rbi/model.rb#856 + # pkg:gem/rbi#lib/rbi/model.rb:885 sig { returns(::String) } def keyword; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#870 + # pkg:gem/rbi#lib/rbi/model.rb:899 sig { returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#637 +# pkg:gem/rbi#lib/rbi/model.rb:678 class RBI::KwOptParam < ::RBI::Param - # : (String name, String value, ?loc: Loc?, ?comments: Array[Comment]) ?{ (KwOptParam node) -> void } -> void - # - # @return [KwOptParam] a new instance of KwOptParam - # - # source://rbi//lib/rbi/model.rb#642 + # pkg:gem/rbi#lib/rbi/model.rb:683 sig do params( name: ::String, value: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::KwOptParam).void) ).void end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object? other) -> bool + # @override # - # source://rbi//lib/rbi/model.rb#655 - sig { params(other: T.nilable(::Object)).returns(T::Boolean) } - def ==(other); end - - # : -> String - # - # source://rbi//lib/rbi/model.rb#650 + # pkg:gem/rbi#lib/rbi/model.rb:691 sig { override.returns(::String) } def to_s; end - # : String - # - # source://rbi//lib/rbi/model.rb#639 + # pkg:gem/rbi#lib/rbi/model.rb:680 sig { returns(::String) } def value; end end -# source://rbi//lib/rbi/model.rb#618 +# pkg:gem/rbi#lib/rbi/model.rb:664 class RBI::KwParam < ::RBI::Param - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (KwParam node) -> void } -> void - # - # @return [KwParam] a new instance of KwParam - # - # source://rbi//lib/rbi/model.rb#620 + # pkg:gem/rbi#lib/rbi/model.rb:666 sig do params( name: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::KwParam).void) ).void end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#632 - sig { params(other: T.nilable(::Object)).returns(T::Boolean) } - def ==(other); end - - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#627 + # pkg:gem/rbi#lib/rbi/model.rb:673 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#660 +# pkg:gem/rbi#lib/rbi/model.rb:696 class RBI::KwRestParam < ::RBI::Param - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (KwRestParam node) -> void } -> void - # - # @return [KwRestParam] a new instance of KwRestParam - # - # source://rbi//lib/rbi/model.rb#662 + # pkg:gem/rbi#lib/rbi/model.rb:698 sig do params( name: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::KwRestParam).void) ).void end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object? other) -> bool + # @override # - # source://rbi//lib/rbi/model.rb#674 - sig { params(other: T.nilable(::Object)).returns(T::Boolean) } - def ==(other); end - - # : -> String - # - # source://rbi//lib/rbi/model.rb#669 + # pkg:gem/rbi#lib/rbi/model.rb:705 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/loc.rb#5 +# pkg:gem/rbi#lib/rbi/loc.rb:5 class RBI::Loc - # : ( - # | ?file: String?, - # | ?begin_line: Integer?, - # | ?end_line: Integer?, - # | ?begin_column: Integer?, - # | ?end_column: Integer? - # | ) -> void - # - # @return [Loc] a new instance of Loc - # - # source://rbi//lib/rbi/loc.rb#32 + # pkg:gem/rbi#lib/rbi/loc.rb:32 sig do params( file: T.nilable(::String), @@ -1183,55 +874,37 @@ class RBI::Loc end def initialize(file: T.unsafe(nil), begin_line: T.unsafe(nil), end_line: T.unsafe(nil), begin_column: T.unsafe(nil), end_column: T.unsafe(nil)); end - # : Integer? - # - # source://rbi//lib/rbi/loc.rb#23 + # pkg:gem/rbi#lib/rbi/loc.rb:23 def begin_column; end - # : Integer? - # - # source://rbi//lib/rbi/loc.rb#23 + # pkg:gem/rbi#lib/rbi/loc.rb:23 sig { returns(T.nilable(::Integer)) } def begin_line; end - # : Integer? - # - # source://rbi//lib/rbi/loc.rb#23 + # pkg:gem/rbi#lib/rbi/loc.rb:23 def end_column; end - # : Integer? - # - # source://rbi//lib/rbi/loc.rb#23 + # pkg:gem/rbi#lib/rbi/loc.rb:23 def end_line; end - # : String? - # - # source://rbi//lib/rbi/loc.rb#20 + # pkg:gem/rbi#lib/rbi/loc.rb:20 sig { returns(T.nilable(::String)) } def file; end - # : (Loc) -> Loc - # - # source://rbi//lib/rbi/loc.rb#41 + # pkg:gem/rbi#lib/rbi/loc.rb:41 sig { params(other: ::RBI::Loc).returns(::RBI::Loc) } def join(other); end - # : -> String? - # - # source://rbi//lib/rbi/loc.rb#61 + # pkg:gem/rbi#lib/rbi/loc.rb:61 sig { returns(T.nilable(::String)) } def source; end - # : -> String - # - # source://rbi//lib/rbi/loc.rb#52 + # pkg:gem/rbi#lib/rbi/loc.rb:52 sig { returns(::String) } def to_s; end class << self - # : (String file, Prism::Location prism_location) -> Loc - # - # source://rbi//lib/rbi/loc.rb#8 + # pkg:gem/rbi#lib/rbi/loc.rb:8 sig { params(file: ::String, prism_location: ::Prism::Location).returns(::RBI::Loc) } def from_prism(file, prism_location); end end @@ -1239,17 +912,9 @@ end # A tree that _might_ contain conflicts # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#329 +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:342 class RBI::MergeTree < ::RBI::Tree - # : ( - # | ?loc: Loc?, - # | ?comments: Array[Comment], - # | ?conflicts: Array[Rewriters::Merge::Conflict] - # | ) ?{ (Tree node) -> void } -> void - # - # @return [MergeTree] a new instance of MergeTree - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#338 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:351 sig do params( loc: T.nilable(::RBI::Loc), @@ -1260,401 +925,296 @@ class RBI::MergeTree < ::RBI::Tree end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), conflicts: T.unsafe(nil), &block); end - # : Array[Rewriters::Merge::Conflict] - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#331 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:344 sig { returns(T::Array[::RBI::Rewriters::Merge::Conflict]) } def conflicts; end end # Methods and args # -# source://rbi//lib/rbi/model.rb#417 +# pkg:gem/rbi#lib/rbi/model.rb:454 class RBI::Method < ::RBI::NodeWithComments include ::RBI::Indexable - # : ( - # | String name, - # | ?params: Array[Param], - # | ?is_singleton: bool, - # | ?visibility: Visibility, - # | ?sigs: Array[Sig], - # | ?loc: Loc?, - # | ?comments: Array[Comment] - # | ) ?{ (Method node) -> void } -> void - # - # @return [Method] a new instance of Method - # - # source://rbi//lib/rbi/model.rb#442 + # pkg:gem/rbi#lib/rbi/model.rb:491 sig do params( name: ::String, - params: T::Array[::RBI::Param], + params: T.nilable(T::Array[::RBI::Param]), is_singleton: T::Boolean, visibility: ::RBI::Visibility, - sigs: T::Array[::RBI::Sig], + sigs: T.nilable(T::Array[::RBI::Sig]), loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::Method).void) ).void end def initialize(name, params: T.unsafe(nil), is_singleton: T.unsafe(nil), visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Param param) -> void - # - # source://rbi//lib/rbi/model.rb#462 + # pkg:gem/rbi#lib/rbi/model.rb:511 sig { params(param: ::RBI::Param).void } def <<(param); end - # : (String name) -> void - # - # source://rbi//lib/rbi/model.rb#497 + # pkg:gem/rbi#lib/rbi/model.rb:546 sig { params(name: ::String).void } def add_block_param(name); end - # : (String name, String default_value) -> void - # - # source://rbi//lib/rbi/model.rb#487 + # pkg:gem/rbi#lib/rbi/model.rb:536 sig { params(name: ::String, default_value: ::String).void } def add_kw_opt_param(name, default_value); end - # : (String name) -> void - # - # source://rbi//lib/rbi/model.rb#482 + # pkg:gem/rbi#lib/rbi/model.rb:531 sig { params(name: ::String).void } def add_kw_param(name); end - # : (String name) -> void - # - # source://rbi//lib/rbi/model.rb#492 + # pkg:gem/rbi#lib/rbi/model.rb:541 sig { params(name: ::String).void } def add_kw_rest_param(name); end - # : (String name, String default_value) -> void - # - # source://rbi//lib/rbi/model.rb#472 + # pkg:gem/rbi#lib/rbi/model.rb:521 sig { params(name: ::String, default_value: ::String).void } def add_opt_param(name, default_value); end - # : (String name) -> void - # - # source://rbi//lib/rbi/model.rb#467 + # pkg:gem/rbi#lib/rbi/model.rb:516 sig { params(name: ::String).void } def add_param(name); end - # : (String name) -> void - # - # source://rbi//lib/rbi/model.rb#477 + # pkg:gem/rbi#lib/rbi/model.rb:526 sig { params(name: ::String).void } def add_rest_param(name); end - # : ( - # | ?params: Array[SigParam], - # | ?return_type: (String | Type), - # | ?is_abstract: bool, - # | ?is_override: bool, - # | ?is_overridable: bool, - # | ?is_final: bool, - # | ?type_params: Array[String], - # | ?checked: Symbol?) ?{ (Sig node) -> void } -> void - # - # source://rbi//lib/rbi/model.rb#510 + # pkg:gem/rbi#lib/rbi/model.rb:559 sig do params( - params: T::Array[::RBI::SigParam], + params: T.nilable(T::Array[::RBI::SigParam]), return_type: T.any(::RBI::Type, ::String), is_abstract: T::Boolean, is_override: T::Boolean, is_overridable: T::Boolean, is_final: T::Boolean, - type_params: T::Array[::String], + type_params: T.nilable(T::Array[::String]), checked: T.nilable(::Symbol), block: T.nilable(T.proc.params(node: ::RBI::Sig).void) ).void end def add_sig(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), &block); end - # : (Node other) -> bool - # - # @return [Boolean] + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#453 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:466 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#536 + # pkg:gem/rbi#lib/rbi/model.rb:585 sig { returns(::String) } def fully_qualified_name; end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#114 + # pkg:gem/rbi#lib/rbi/index.rb:114 sig { override.returns(T::Array[::String]) } def index_ids; end - # : bool - # - # source://rbi//lib/rbi/model.rb#425 + # pkg:gem/rbi#lib/rbi/model.rb:464 sig { returns(T::Boolean) } def is_singleton; end - # : bool - # - # source://rbi//lib/rbi/model.rb#425 + # pkg:gem/rbi#lib/rbi/model.rb:464 def is_singleton=(_arg0); end - # : (Node other) -> void + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#463 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:476 sig { override.params(other: ::RBI::Node).void } def merge_with(other); end - # : String - # - # source://rbi//lib/rbi/model.rb#419 + # pkg:gem/rbi#lib/rbi/model.rb:456 sig { returns(::String) } def name; end - # : String - # - # source://rbi//lib/rbi/model.rb#419 + # pkg:gem/rbi#lib/rbi/model.rb:456 def name=(_arg0); end - # : Array[Param] - # - # source://rbi//lib/rbi/model.rb#422 + # pkg:gem/rbi#lib/rbi/model.rb:459 sig { returns(T::Array[::RBI::Param]) } def params; end - # : Array[Sig] - # - # source://rbi//lib/rbi/model.rb#431 + # pkg:gem/rbi#lib/rbi/model.rb:470 sig { returns(T::Array[::RBI::Sig]) } def sigs; end - # : Array[Sig] - # - # source://rbi//lib/rbi/model.rb#431 - def sigs=(_arg0); end + # pkg:gem/rbi#lib/rbi/model.rb:480 + sig { params(sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Sig]) } + def sigs=(sigs); end - # : -> String + # pkg:gem/rbi#lib/rbi/model.rb:475 + sig { returns(T::Boolean) } + def sigs?; end + + # @override # - # source://rbi//lib/rbi/model.rb#546 + # pkg:gem/rbi#lib/rbi/model.rb:595 sig { override.returns(::String) } def to_s; end - # : Visibility - # - # source://rbi//lib/rbi/model.rb#428 + # pkg:gem/rbi#lib/rbi/model.rb:467 sig { returns(::RBI::Visibility) } def visibility; end - # : Visibility - # - # source://rbi//lib/rbi/model.rb#428 + # pkg:gem/rbi#lib/rbi/model.rb:467 def visibility=(_arg0); end + + private + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:496 + sig { params(other: ::RBI::Method).returns(T::Boolean) } + def at_most_one_side_anonymous?(other); end end -# source://rbi//lib/rbi/model.rb#1185 +# pkg:gem/rbi#lib/rbi/model.rb:1231 class RBI::MixesInClassMethods < ::RBI::Mixin include ::RBI::Indexable - # : ( - # | String name, - # | *String names, - # | ?loc: Loc?, - # | ?comments: Array[Comment] - # | ) ?{ (MixesInClassMethods node) -> void } -> void - # - # @return [MixesInClassMethods] a new instance of MixesInClassMethods - # - # source://rbi//lib/rbi/model.rb#1192 + # pkg:gem/rbi#lib/rbi/model.rb:1238 sig do params( name: ::String, names: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::MixesInClassMethods).void) ).void end def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # - # @return [Boolean] + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#500 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:530 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#144 + # pkg:gem/rbi#lib/rbi/index.rb:144 sig { override.returns(T::Array[::String]) } def index_ids; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#1199 + # pkg:gem/rbi#lib/rbi/model.rb:1245 sig { override.returns(::String) } def to_s; end end # @abstract # -# source://rbi//lib/rbi/model.rb#701 +# pkg:gem/rbi#lib/rbi/model.rb:727 class RBI::Mixin < ::RBI::NodeWithComments abstract! - # : (String name, Array[String] names, ?loc: Loc?, ?comments: Array[Comment]) -> void - # - # @return [Mixin] a new instance of Mixin - # - # source://rbi//lib/rbi/model.rb#706 + # pkg:gem/rbi#lib/rbi/model.rb:732 sig do params( name: ::String, names: T::Array[::String], loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment] + comments: T.nilable(T::Array[::RBI::Comment]) ).void end def initialize(name, names, loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # : (Node other) -> bool - # - # @return [Boolean] + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#476 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:506 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : Array[String] - # - # source://rbi//lib/rbi/model.rb#703 + # pkg:gem/rbi#lib/rbi/model.rb:729 sig { returns(T::Array[::String]) } def names; end end -# source://rbi//lib/rbi/model.rb#175 +# pkg:gem/rbi#lib/rbi/model.rb:197 class RBI::Module < ::RBI::Scope - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Module node) -> void } -> void - # - # @return [Module] a new instance of Module - # - # source://rbi//lib/rbi/model.rb#180 + # pkg:gem/rbi#lib/rbi/model.rb:202 sig do params( name: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::Module).void) ).void end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # - # @return [Boolean] + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#383 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:396 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#188 + # pkg:gem/rbi#lib/rbi/model.rb:210 sig { override.returns(::String) } def fully_qualified_name; end - # : String - # - # source://rbi//lib/rbi/model.rb#177 + # pkg:gem/rbi#lib/rbi/model.rb:199 sig { returns(::String) } def name; end - # : String - # - # source://rbi//lib/rbi/model.rb#177 + # pkg:gem/rbi#lib/rbi/model.rb:199 def name=(_arg0); end end # @abstract # -# source://rbi//lib/rbi/model.rb#8 +# pkg:gem/rbi#lib/rbi/model.rb:8 class RBI::Node abstract! - # : (?loc: Loc?) -> void - # - # @return [Node] a new instance of Node - # - # source://rbi//lib/rbi/model.rb#16 + # pkg:gem/rbi#lib/rbi/model.rb:16 sig { params(loc: T.nilable(::RBI::Loc)).void } def initialize(loc: T.unsafe(nil)); end # Can `self` and `_other` be merged into a single definition? - # : (Node _other) -> bool - # - # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#289 - sig { params(_other: ::RBI::Node).returns(T::Boolean) } + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:302 def compatible_with?(_other); end - # : -> void - # - # source://rbi//lib/rbi/model.rb#22 + # pkg:gem/rbi#lib/rbi/model.rb:22 sig { void } def detach; end - # : Loc? - # - # source://rbi//lib/rbi/model.rb#13 + # pkg:gem/rbi#lib/rbi/model.rb:13 sig { returns(T.nilable(::RBI::Loc)) } def loc; end - # : Loc? - # - # source://rbi//lib/rbi/model.rb#13 + # pkg:gem/rbi#lib/rbi/model.rb:13 def loc=(_arg0); end # Merge `self` and `other` into a single definition - # : (Node other) -> void # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#295 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:308 sig { params(other: ::RBI::Node).void } def merge_with(other); end - # : -> ConflictTree? - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#298 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:311 sig { returns(T.nilable(::RBI::ConflictTree)) } def parent_conflict_tree; end - # : -> Scope? - # - # source://rbi//lib/rbi/model.rb#44 + # pkg:gem/rbi#lib/rbi/model.rb:44 sig { returns(T.nilable(::RBI::Scope)) } def parent_scope; end - # : Tree? - # - # source://rbi//lib/rbi/model.rb#10 + # pkg:gem/rbi#lib/rbi/model.rb:10 sig { returns(T.nilable(::RBI::Tree)) } def parent_tree; end - # : Tree? - # - # source://rbi//lib/rbi/model.rb#10 + # pkg:gem/rbi#lib/rbi/model.rb:10 def parent_tree=(_arg0); end - # : (?out: (IO | StringIO), ?indent: Integer, ?print_locs: bool, ?max_line_length: Integer?) -> void - # - # source://rbi//lib/rbi/printer.rb#834 + # pkg:gem/rbi#lib/rbi/printer.rb:895 sig do params( out: T.any(::IO, ::StringIO), @@ -1665,9 +1225,7 @@ 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 - # : (?out: (IO | StringIO), ?indent: Integer, ?print_locs: bool, ?positional_names: bool) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1227 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1251 sig do params( out: T.any(::IO, ::StringIO), @@ -1678,420 +1236,324 @@ class RBI::Node end def rbs_print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil)); end - # : (?indent: Integer, ?print_locs: bool, ?positional_names: bool) -> String - # - # source://rbi//lib/rbi/rbs_printer.rb#1233 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1257 sig { params(indent: ::Integer, print_locs: T::Boolean, positional_names: T::Boolean).returns(::String) } def rbs_string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil)); end - # : (Node node) -> void - # - # @raise [ReplaceNodeError] - # - # source://rbi//lib/rbi/model.rb#31 + # pkg:gem/rbi#lib/rbi/model.rb:31 sig { params(node: ::RBI::Node).void } def replace(node); end - # : (Gem::Version version) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/rewriters/filter_versions.rb#91 + # pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:91 sig { params(version: ::Gem::Version).returns(T::Boolean) } def satisfies_version?(version); end - # : (?indent: Integer, ?print_locs: bool, ?max_line_length: Integer?) -> String - # - # source://rbi//lib/rbi/printer.rb#840 + # pkg:gem/rbi#lib/rbi/printer.rb:901 sig { params(indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer)).returns(::String) } def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end end # @abstract # -# source://rbi//lib/rbi/model.rb#88 +# pkg:gem/rbi#lib/rbi/model.rb:88 class RBI::NodeWithComments < ::RBI::Node abstract! - # : (?loc: Loc?, ?comments: Array[Comment]) -> void - # - # @return [NodeWithComments] a new instance of NodeWithComments - # - # source://rbi//lib/rbi/model.rb#93 - sig { params(loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } + # pkg:gem/rbi#lib/rbi/model.rb:105 + sig { params(loc: T.nilable(::RBI::Loc), comments: T.nilable(T::Array[::RBI::Comment])).void } def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # : -> Array[String] - # - # source://rbi//lib/rbi/model.rb#99 + # pkg:gem/rbi#lib/rbi/model.rb:111 sig { returns(T::Array[::String]) } def annotations; end - # : Array[Comment] - # - # source://rbi//lib/rbi/model.rb#90 + # pkg:gem/rbi#lib/rbi/model.rb:93 sig { returns(T::Array[::RBI::Comment]) } def comments; end - # : Array[Comment] + # pkg:gem/rbi#lib/rbi/model.rb:90 + sig { params(comments: T::Array[::RBI::Comment]).returns(T::Array[::RBI::Comment]) } + def comments=(comments); end + + # Returns true if this node has any comments, without allocating + # an empty array for nodes that have never had comments set. # - # source://rbi//lib/rbi/model.rb#90 - def comments=(_arg0); end + # pkg:gem/rbi#lib/rbi/model.rb:100 + sig { returns(T::Boolean) } + def comments?; end - # : (Node other) -> void + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#312 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:325 sig { override.params(other: ::RBI::Node).void } def merge_with(other); end - # : -> Array[Gem::Requirement] - # - # source://rbi//lib/rbi/rewriters/filter_versions.rb#101 + # pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:101 sig { returns(T::Array[::Gem::Requirement]) } def version_requirements; end end -# source://rbi//lib/rbi/model.rb#582 +# pkg:gem/rbi#lib/rbi/model.rb:638 class RBI::OptParam < ::RBI::Param - # : (String name, String value, ?loc: Loc?, ?comments: Array[Comment]) ?{ (OptParam node) -> void } -> void - # - # @return [OptParam] a new instance of OptParam - # - # source://rbi//lib/rbi/model.rb#587 + # pkg:gem/rbi#lib/rbi/model.rb:643 sig do params( name: ::String, value: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::OptParam).void) ).void end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#594 - sig { params(other: T.nilable(::Object)).returns(T::Boolean) } - def ==(other); end - - # : String - # - # source://rbi//lib/rbi/model.rb#584 + # pkg:gem/rbi#lib/rbi/model.rb:640 sig { returns(::String) } def value; end end # @abstract # -# source://rbi//lib/rbi/model.rb#552 +# pkg:gem/rbi#lib/rbi/model.rb:601 class RBI::Param < ::RBI::NodeWithComments abstract! - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) -> void - # - # @return [Param] a new instance of Param - # - # source://rbi//lib/rbi/model.rb#557 - sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } + # pkg:gem/rbi#lib/rbi/model.rb:606 + sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T.nilable(T::Array[::RBI::Comment])).void } def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # : String - # - # source://rbi//lib/rbi/model.rb#554 + # pkg:gem/rbi#lib/rbi/model.rb:624 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:619 + sig { returns(T::Boolean) } + def anonymous?; end + + # pkg:gem/rbi#lib/rbi/model.rb:603 sig { returns(::String) } def name; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#564 + # pkg:gem/rbi#lib/rbi/model.rb:614 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/parser.rb#7 +# pkg:gem/rbi#lib/rbi/parser.rb:7 class RBI::ParseError < ::RBI::Error - # : (String message, Loc location) -> void - # - # @return [ParseError] a new instance of ParseError - # - # source://rbi//lib/rbi/parser.rb#12 + # pkg:gem/rbi#lib/rbi/parser.rb:12 sig { params(message: ::String, location: ::RBI::Loc).void } def initialize(message, location); end - # : Loc - # - # source://rbi//lib/rbi/parser.rb#9 + # pkg:gem/rbi#lib/rbi/parser.rb:9 sig { returns(::RBI::Loc) } def location; end end -# source://rbi//lib/rbi/parser.rb#49 +# pkg:gem/rbi#lib/rbi/parser.rb:49 class RBI::Parser - # : (String path) -> Tree - # - # source://rbi//lib/rbi/parser.rb#80 + # pkg:gem/rbi#lib/rbi/parser.rb:80 sig { params(path: ::String).returns(::RBI::Tree) } def parse_file(path); end - # : (String string) -> Tree - # - # source://rbi//lib/rbi/parser.rb#75 + # pkg:gem/rbi#lib/rbi/parser.rb:75 sig { params(string: ::String).returns(::RBI::Tree) } def parse_string(string); end private - # : (String source, file: String) -> Tree - # - # source://rbi//lib/rbi/parser.rb#87 + # pkg:gem/rbi#lib/rbi/parser.rb:87 sig { params(source: ::String, file: ::String).returns(::RBI::Tree) } def parse(source, file:); end class << self - # : (String path) -> Tree - # - # source://rbi//lib/rbi/parser.rb#57 + # pkg:gem/rbi#lib/rbi/parser.rb:57 sig { params(path: ::String).returns(::RBI::Tree) } def parse_file(path); end - # : (Array[String] paths) -> Array[Tree] - # - # source://rbi//lib/rbi/parser.rb#62 + # pkg:gem/rbi#lib/rbi/parser.rb:62 sig { params(paths: T::Array[::String]).returns(T::Array[::RBI::Tree]) } def parse_files(paths); end - # : (String string) -> Tree - # - # source://rbi//lib/rbi/parser.rb#52 + # pkg:gem/rbi#lib/rbi/parser.rb:52 sig { params(string: ::String).returns(::RBI::Tree) } def parse_string(string); end - # : (Array[String] strings) -> Array[Tree] - # - # source://rbi//lib/rbi/parser.rb#68 + # pkg:gem/rbi#lib/rbi/parser.rb:68 sig { params(strings: T::Array[::String]).returns(T::Array[::RBI::Tree]) } def parse_strings(strings); end end end -# source://rbi//lib/rbi/parser.rb#1003 +# pkg:gem/rbi#lib/rbi/parser.rb:1003 class RBI::Parser::HeredocLocationVisitor < ::Prism::Visitor - # : (Prism::Source source, Integer begin_offset, Integer end_offset) -> void - # - # @return [HeredocLocationVisitor] a new instance of HeredocLocationVisitor - # - # source://rbi//lib/rbi/parser.rb#1005 + # pkg:gem/rbi#lib/rbi/parser.rb:1005 sig { params(source: ::Prism::Source, begin_offset: ::Integer, end_offset: ::Integer).void } def initialize(source, begin_offset, end_offset); end - # : -> Prism::Location - # - # source://rbi//lib/rbi/parser.rb#1036 + # pkg:gem/rbi#lib/rbi/parser.rb:1036 sig { returns(::Prism::Location) } def location; end - # : (Prism::InterpolatedStringNode node) -> void + # @override # - # source://rbi//lib/rbi/parser.rb#1026 + # pkg:gem/rbi#lib/rbi/parser.rb:1026 sig { override.params(node: ::Prism::InterpolatedStringNode).void } def visit_interpolated_string_node(node); end - # : (Prism::StringNode node) -> void + # @override # - # source://rbi//lib/rbi/parser.rb#1015 + # pkg:gem/rbi#lib/rbi/parser.rb:1015 sig { override.params(node: ::Prism::StringNode).void } def visit_string_node(node); end private - # : (Prism::StringNode | Prism::InterpolatedStringNode node) -> void - # - # source://rbi//lib/rbi/parser.rb#1047 + # pkg:gem/rbi#lib/rbi/parser.rb:1047 sig { params(node: T.any(::Prism::InterpolatedStringNode, ::Prism::StringNode)).void } def handle_string_node(node); end end -# source://rbi//lib/rbi/parser.rb#915 +# pkg:gem/rbi#lib/rbi/parser.rb:915 class RBI::Parser::SigBuilder < ::RBI::Parser::Visitor - # : (String content, file: String) -> void - # - # @return [SigBuilder] a new instance of SigBuilder - # - # source://rbi//lib/rbi/parser.rb#920 + # pkg:gem/rbi#lib/rbi/parser.rb:920 sig { params(content: ::String, file: ::String).void } def initialize(content, file:); end - # : (Prism::CallNode node, String value) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/parser.rb#986 + # pkg:gem/rbi#lib/rbi/parser.rb:986 sig { params(node: ::Prism::CallNode, value: ::String).returns(T::Boolean) } def allow_incompatible_override?(node, value); end - # : Sig - # - # source://rbi//lib/rbi/parser.rb#917 + # pkg:gem/rbi#lib/rbi/parser.rb:917 sig { returns(::RBI::Sig) } def current; end - # : (Prism::AssocNode node) -> void + # @override # - # source://rbi//lib/rbi/parser.rb#978 + # pkg:gem/rbi#lib/rbi/parser.rb:978 sig { override.params(node: ::Prism::AssocNode).void } def visit_assoc_node(node); end - # : (Prism::CallNode node) -> void + # @override # - # source://rbi//lib/rbi/parser.rb#928 + # pkg:gem/rbi#lib/rbi/parser.rb:928 sig { override.params(node: ::Prism::CallNode).void } def visit_call_node(node); end end -# source://rbi//lib/rbi/parser.rb#164 +# pkg:gem/rbi#lib/rbi/parser.rb:164 class RBI::Parser::TreeBuilder < ::RBI::Parser::Visitor - # : (String source, comments: Array[Prism::Comment], file: String) -> void - # - # @return [TreeBuilder] a new instance of TreeBuilder - # - # source://rbi//lib/rbi/parser.rb#172 + # pkg:gem/rbi#lib/rbi/parser.rb:172 sig { params(source: ::String, comments: T::Array[::Prism::Comment], file: ::String).void } def initialize(source, comments:, file:); end - # : Prism::Node? - # - # source://rbi//lib/rbi/parser.rb#169 + # pkg:gem/rbi#lib/rbi/parser.rb:169 sig { returns(T.nilable(::Prism::Node)) } def last_node; end - # : Tree - # - # source://rbi//lib/rbi/parser.rb#166 + # pkg:gem/rbi#lib/rbi/parser.rb:166 sig { returns(::RBI::Tree) } def tree; end - # : (Prism::CallNode node) -> void - # - # source://rbi//lib/rbi/parser.rb#361 + # pkg:gem/rbi#lib/rbi/parser.rb:361 sig { params(node: ::Prism::CallNode).void } def visit_call_node(node); end - # : (Prism::ClassNode node) -> void + # @override # - # source://rbi//lib/rbi/parser.rb#185 + # pkg:gem/rbi#lib/rbi/parser.rb:185 sig { override.params(node: ::Prism::ClassNode).void } def visit_class_node(node); end - # : ((Prism::ConstantWriteNode | Prism::ConstantPathWriteNode) node) -> void - # - # source://rbi//lib/rbi/parser.rb#236 + # pkg:gem/rbi#lib/rbi/parser.rb:236 sig { params(node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode)).void } def visit_constant_assign(node); end - # : (Prism::ConstantPathWriteNode node) -> void + # @override # - # source://rbi//lib/rbi/parser.rb#229 + # pkg:gem/rbi#lib/rbi/parser.rb:229 sig { override.params(node: ::Prism::ConstantPathWriteNode).void } def visit_constant_path_write_node(node); end - # : (Prism::ConstantWriteNode node) -> void + # @override # - # source://rbi//lib/rbi/parser.rb#221 + # pkg:gem/rbi#lib/rbi/parser.rb:221 sig { override.params(node: ::Prism::ConstantWriteNode).void } def visit_constant_write_node(node); end - # : (Prism::DefNode node) -> void + # @override # - # source://rbi//lib/rbi/parser.rb#291 + # pkg:gem/rbi#lib/rbi/parser.rb:291 sig { override.params(node: ::Prism::DefNode).void } def visit_def_node(node); end - # : (Prism::ModuleNode node) -> void + # @override # - # source://rbi//lib/rbi/parser.rb#313 + # pkg:gem/rbi#lib/rbi/parser.rb:313 sig { override.params(node: ::Prism::ModuleNode).void } def visit_module_node(node); end - # : (Prism::ProgramNode node) -> void + # @override # - # source://rbi//lib/rbi/parser.rb#332 + # pkg:gem/rbi#lib/rbi/parser.rb:332 sig { override.params(node: ::Prism::ProgramNode).void } def visit_program_node(node); end - # : (Prism::SingletonClassNode node) -> void + # @override # - # source://rbi//lib/rbi/parser.rb#344 + # pkg:gem/rbi#lib/rbi/parser.rb:344 sig { override.params(node: ::Prism::SingletonClassNode).void } def visit_singleton_class_node(node); end private # Collect all the remaining comments within a node - # : (Prism::Node node) -> void # - # source://rbi//lib/rbi/parser.rb#539 + # pkg:gem/rbi#lib/rbi/parser.rb:539 sig { params(node: ::Prism::Node).void } def collect_dangling_comments(node); end # Collect all the remaining comments after visiting the tree - # : -> void # - # source://rbi//lib/rbi/parser.rb#557 + # pkg:gem/rbi#lib/rbi/parser.rb:557 sig { void } def collect_orphan_comments; end - # : -> Tree - # - # source://rbi//lib/rbi/parser.rb#580 + # pkg:gem/rbi#lib/rbi/parser.rb:580 sig { returns(::RBI::Tree) } def current_scope; end - # : -> Array[Sig] - # - # source://rbi//lib/rbi/parser.rb#585 + # pkg:gem/rbi#lib/rbi/parser.rb:585 sig { returns(T::Array[::RBI::Sig]) } def current_sigs; end - # : (Array[Sig] sigs) -> Array[Comment] - # - # source://rbi//lib/rbi/parser.rb#592 + # pkg:gem/rbi#lib/rbi/parser.rb:592 sig { params(sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Comment]) } def detach_comments_from_sigs(sigs); end - # : (Prism::Node node) -> Array[Comment] - # - # source://rbi//lib/rbi/parser.rb#604 + # pkg:gem/rbi#lib/rbi/parser.rb:604 sig { params(node: ::Prism::Node).returns(T::Array[::RBI::Comment]) } def node_comments(node); end - # : (Prism::Comment node) -> Comment - # - # source://rbi//lib/rbi/parser.rb#666 + # pkg:gem/rbi#lib/rbi/parser.rb:666 sig { params(node: ::Prism::Comment).returns(::RBI::Comment) } def parse_comment(node); end - # : (Prism::Node? node) -> Array[Param] - # - # source://rbi//lib/rbi/parser.rb#699 + # pkg:gem/rbi#lib/rbi/parser.rb:699 sig { params(node: T.nilable(::Prism::Node)).returns(T::Array[::RBI::Param]) } def parse_params(node); end - # : (Prism::Node? node) -> Array[Arg] - # - # source://rbi//lib/rbi/parser.rb#673 + # pkg:gem/rbi#lib/rbi/parser.rb:673 sig { params(node: T.nilable(::Prism::Node)).returns(T::Array[::RBI::Arg]) } def parse_send_args(node); end - # : (Prism::CallNode node) -> Sig - # - # source://rbi//lib/rbi/parser.rb#765 + # pkg:gem/rbi#lib/rbi/parser.rb:765 sig { params(node: ::Prism::CallNode).returns(::RBI::Sig) } def parse_sig(node); end - # : ((Prism::ConstantWriteNode | Prism::ConstantPathWriteNode) node) -> Struct? - # - # source://rbi//lib/rbi/parser.rb#774 + # pkg:gem/rbi#lib/rbi/parser.rb:774 sig do params( node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode) @@ -2099,110 +1561,70 @@ class RBI::Parser::TreeBuilder < ::RBI::Parser::Visitor end def parse_struct(node); end - # : (Prism::CallNode send) -> void - # - # source://rbi//lib/rbi/parser.rb#822 + # pkg:gem/rbi#lib/rbi/parser.rb:822 sig { params(send: ::Prism::CallNode).void } def parse_tstruct_field(send); end - # : (String name, Prism::Node node) -> Visibility - # - # source://rbi//lib/rbi/parser.rb#859 + # pkg:gem/rbi#lib/rbi/parser.rb:859 sig { params(name: ::String, node: ::Prism::Node).returns(::RBI::Visibility) } def parse_visibility(name, node); end - # : -> void - # - # source://rbi//lib/rbi/parser.rb#873 + # pkg:gem/rbi#lib/rbi/parser.rb:873 sig { void } def separate_header_comments; end - # : -> void - # - # source://rbi//lib/rbi/parser.rb#883 + # pkg:gem/rbi#lib/rbi/parser.rb:883 sig { void } def set_root_tree_loc; end - # : (Prism::Node? node) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/parser.rb#902 + # pkg:gem/rbi#lib/rbi/parser.rb:902 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def t_enum_value?(node); end - # : (Prism::Node? node) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/parser.rb#897 + # pkg:gem/rbi#lib/rbi/parser.rb:897 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def type_variable_definition?(node); end end -# source://rbi//lib/rbi/parser.rb#114 +# pkg:gem/rbi#lib/rbi/parser.rb:114 class RBI::Parser::Visitor < ::Prism::Visitor - # : (String source, file: String) -> void - # - # @return [Visitor] a new instance of Visitor - # - # source://rbi//lib/rbi/parser.rb#116 + # pkg:gem/rbi#lib/rbi/parser.rb:116 sig { params(source: ::String, file: ::String).void } def initialize(source, file:); end private - # : (Prism::Node node) -> Prism::Location - # - # source://rbi//lib/rbi/parser.rb#143 + # pkg:gem/rbi#lib/rbi/parser.rb:143 sig { params(node: ::Prism::Node).returns(::Prism::Location) } def adjust_prism_location_for_heredoc(node); end - # : (Prism::Node node) -> Loc - # - # source://rbi//lib/rbi/parser.rb#126 + # pkg:gem/rbi#lib/rbi/parser.rb:126 sig { params(node: ::Prism::Node).returns(::RBI::Loc) } def node_loc(node); end - # : (Prism::Node? node) -> String? - # - # source://rbi//lib/rbi/parser.rb#131 + # pkg:gem/rbi#lib/rbi/parser.rb:131 sig { params(node: T.nilable(::Prism::Node)).returns(T.nilable(::String)) } def node_string(node); end - # : (Prism::Node node) -> String - # - # source://rbi//lib/rbi/parser.rb#138 + # pkg:gem/rbi#lib/rbi/parser.rb:138 sig { params(node: ::Prism::Node).returns(::String) } def node_string!(node); end - # : (Prism::Node? node) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/parser.rb#154 + # pkg:gem/rbi#lib/rbi/parser.rb:154 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def self?(node); end - # : (Prism::Node? node) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/parser.rb#159 + # pkg:gem/rbi#lib/rbi/parser.rb:159 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def t_sig_without_runtime?(node); end end -# source://rbi//lib/rbi/printer.rb#7 +# pkg:gem/rbi#lib/rbi/printer.rb:7 class RBI::Printer < ::RBI::Visitor - # : (?out: (IO | StringIO), ?indent: Integer, ?print_locs: bool, ?max_line_length: Integer?) -> void - # - # @return [Printer] a new instance of Printer - # - # source://rbi//lib/rbi/printer.rb#21 + # pkg:gem/rbi#lib/rbi/printer.rb:25 sig do params( - out: T.any(::IO, ::StringIO), + out: T.any(::IO, ::String, ::StringIO), indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer) @@ -2210,605 +1632,513 @@ class RBI::Printer < ::RBI::Visitor end def initialize(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end - # : Integer - # - # source://rbi//lib/rbi/printer.rb#15 + # pkg:gem/rbi#lib/rbi/printer.rb:19 sig { returns(::Integer) } def current_indent; end - # : -> void - # - # source://rbi//lib/rbi/printer.rb#39 + # pkg:gem/rbi#lib/rbi/printer.rb:48 + sig { returns(::String) } + def current_indent_string; end + + # pkg:gem/rbi#lib/rbi/printer.rb:43 sig { void } def dedent; end - # : bool - # - # source://rbi//lib/rbi/printer.rb#9 + # pkg:gem/rbi#lib/rbi/printer.rb:13 def in_visibility_group; end - # : bool - # - # source://rbi//lib/rbi/printer.rb#9 + # pkg:gem/rbi#lib/rbi/printer.rb:13 def in_visibility_group=(_arg0); end - # : -> void - # - # source://rbi//lib/rbi/printer.rb#34 + # pkg:gem/rbi#lib/rbi/printer.rb:38 sig { void } def indent; end - # : Integer? - # - # source://rbi//lib/rbi/printer.rb#18 + # pkg:gem/rbi#lib/rbi/printer.rb:22 sig { returns(T.nilable(::Integer)) } def max_line_length; end - # : Node? - # - # source://rbi//lib/rbi/printer.rb#12 + # pkg:gem/rbi#lib/rbi/printer.rb:16 sig { returns(T.nilable(::RBI::Node)) } def previous_node; end # Print a string without indentation nor `\n` at the end. - # : (String string) -> void # - # source://rbi//lib/rbi/printer.rb#45 + # pkg:gem/rbi#lib/rbi/printer.rb:54 sig { params(string: ::String).void } def print(string); end - # : bool - # - # source://rbi//lib/rbi/printer.rb#9 + # pkg:gem/rbi#lib/rbi/printer.rb:13 sig { returns(T::Boolean) } def print_locs; end - # : bool - # - # source://rbi//lib/rbi/printer.rb#9 + # pkg:gem/rbi#lib/rbi/printer.rb:13 def print_locs=(_arg0); end # Print a string with indentation and `\n` at the end. - # : (String string) -> void # - # source://rbi//lib/rbi/printer.rb#65 + # pkg:gem/rbi#lib/rbi/printer.rb:76 sig { params(string: ::String).void } def printl(string); end # Print a string without indentation but with a `\n` at the end. - # : (?String? string) -> void # - # source://rbi//lib/rbi/printer.rb#51 + # pkg:gem/rbi#lib/rbi/printer.rb:60 sig { params(string: T.nilable(::String)).void } def printn(string = T.unsafe(nil)); end # Print a string with indentation but without a `\n` at the end. - # : (?String? string) -> void # - # source://rbi//lib/rbi/printer.rb#58 + # pkg:gem/rbi#lib/rbi/printer.rb:69 sig { params(string: T.nilable(::String)).void } def printt(string = T.unsafe(nil)); end - # : (Array[Node] nodes) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#72 + # pkg:gem/rbi#lib/rbi/printer.rb:84 sig { override.params(nodes: T::Array[::RBI::Node]).void } def visit_all(nodes); end - # : (File file) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#84 + # pkg:gem/rbi#lib/rbi/printer.rb:98 sig { override.params(file: ::RBI::File).void } def visit_file(file); end private - # : (Node node) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/printer.rb#680 + # pkg:gem/rbi#lib/rbi/printer.rb:720 sig { params(node: ::RBI::Node).returns(T::Boolean) } def oneline?(node); end - # : (Node node) -> void - # - # source://rbi//lib/rbi/printer.rb#638 + # pkg:gem/rbi#lib/rbi/printer.rb:678 sig { params(node: ::RBI::Node).void } def print_blank_line_before(node); end - # : (Node node) -> void - # - # source://rbi//lib/rbi/printer.rb#648 + # pkg:gem/rbi#lib/rbi/printer.rb:688 sig { params(node: ::RBI::Node).void } def print_loc(node); end - # : (Param node, last: bool) -> void - # - # source://rbi//lib/rbi/printer.rb#654 + # pkg:gem/rbi#lib/rbi/printer.rb:694 sig { params(node: ::RBI::Param, last: T::Boolean).void } def print_param_comment_leading_space(node, last:); end - # : (Sig node) -> void - # - # source://rbi//lib/rbi/printer.rb#736 + # pkg:gem/rbi#lib/rbi/printer.rb:779 sig { params(node: ::RBI::Sig).void } def print_sig_as_block(node); end - # : (Sig node) -> void - # - # source://rbi//lib/rbi/printer.rb#709 + # pkg:gem/rbi#lib/rbi/printer.rb:749 sig { params(node: ::RBI::Sig).void } def print_sig_as_line(node); end - # : (SigParam node, last: bool) -> void - # - # source://rbi//lib/rbi/printer.rb#672 + # pkg:gem/rbi#lib/rbi/printer.rb:712 sig { params(node: ::RBI::SigParam, last: T::Boolean).void } def print_sig_param_comment_leading_space(node, last:); end - # : (Sig node) -> Array[String] - # - # source://rbi//lib/rbi/printer.rb#796 + # pkg:gem/rbi#lib/rbi/printer.rb:849 sig { params(node: ::RBI::Sig).returns(T::Array[::String]) } def sig_modifiers(node); end - # : (Arg node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#453 + # pkg:gem/rbi#lib/rbi/printer.rb:489 sig { override.params(node: ::RBI::Arg).void } def visit_arg(node); end - # : (Attr node) -> void - # - # source://rbi//lib/rbi/printer.rb#258 + # pkg:gem/rbi#lib/rbi/printer.rb:280 sig { params(node: ::RBI::Attr).void } def visit_attr(node); end - # : (AttrAccessor node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#241 + # pkg:gem/rbi#lib/rbi/printer.rb:263 sig { override.params(node: ::RBI::AttrAccessor).void } def visit_attr_accessor(node); end - # : (AttrReader node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#247 + # pkg:gem/rbi#lib/rbi/printer.rb:269 sig { override.params(node: ::RBI::AttrReader).void } def visit_attr_reader(node); end - # : (AttrWriter node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#253 + # pkg:gem/rbi#lib/rbi/printer.rb:275 sig { override.params(node: ::RBI::AttrWriter).void } def visit_attr_writer(node); end - # : (BlankLine node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#138 + # pkg:gem/rbi#lib/rbi/printer.rb:160 sig { override.params(node: ::RBI::BlankLine).void } def visit_blank_line(node); end - # : (BlockParam node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#373 + # pkg:gem/rbi#lib/rbi/printer.rb:408 sig { override.params(node: ::RBI::BlockParam).void } def visit_block_param(node); end - # : (Class node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#158 + # pkg:gem/rbi#lib/rbi/printer.rb:180 sig { override.params(node: ::RBI::Class).void } def visit_class(node); end - # : (Comment node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#121 + # pkg:gem/rbi#lib/rbi/printer.rb:139 sig { override.params(node: ::RBI::Comment).void } def visit_comment(node); end - # : (ConflictTree node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#614 + # pkg:gem/rbi#lib/rbi/printer.rb:654 sig { override.params(node: ::RBI::ConflictTree).void } def visit_conflict_tree(node); end - # : (Const node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#231 + # pkg:gem/rbi#lib/rbi/printer.rb:253 sig { override.params(node: ::RBI::Const).void } def visit_const(node); end - # : (Extend node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#385 + # pkg:gem/rbi#lib/rbi/printer.rb:421 sig { override.params(node: ::RBI::Extend).void } def visit_extend(node); end - # : (Group node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#583 + # pkg:gem/rbi#lib/rbi/printer.rb:623 sig { override.params(node: ::RBI::Group).void } def visit_group(node); end - # : (Helper node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#567 + # pkg:gem/rbi#lib/rbi/printer.rb:607 sig { override.params(node: ::RBI::Helper).void } def visit_helper(node); end - # : (Include node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#379 + # pkg:gem/rbi#lib/rbi/printer.rb:415 sig { override.params(node: ::RBI::Include).void } def visit_include(node); end - # : (KwArg node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#459 + # pkg:gem/rbi#lib/rbi/printer.rb:495 sig { override.params(node: ::RBI::KwArg).void } def visit_kw_arg(node); end - # : (KwOptParam node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#361 + # pkg:gem/rbi#lib/rbi/printer.rb:393 sig { override.params(node: ::RBI::KwOptParam).void } def visit_kw_opt_param(node); end - # : (KwParam node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#355 + # pkg:gem/rbi#lib/rbi/printer.rb:386 sig { override.params(node: ::RBI::KwParam).void } def visit_kw_param(node); end - # : (KwRestParam node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#367 + # pkg:gem/rbi#lib/rbi/printer.rb:401 sig { override.params(node: ::RBI::KwRestParam).void } def visit_kw_rest_param(node); end - # : (Method node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#287 + # pkg:gem/rbi#lib/rbi/printer.rb:315 sig { override.params(node: ::RBI::Method).void } def visit_method(node); end - # : (MixesInClassMethods node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#577 + # pkg:gem/rbi#lib/rbi/printer.rb:617 sig { override.params(node: ::RBI::MixesInClassMethods).void } def visit_mixes_in_class_methods(node); end - # : (Mixin node) -> void - # - # source://rbi//lib/rbi/printer.rb#390 + # pkg:gem/rbi#lib/rbi/printer.rb:426 sig { params(node: ::RBI::Mixin).void } def visit_mixin(node); end - # : (Module node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#152 + # pkg:gem/rbi#lib/rbi/printer.rb:174 sig { override.params(node: ::RBI::Module).void } def visit_module(node); end - # : (OptParam node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#343 + # pkg:gem/rbi#lib/rbi/printer.rb:371 sig { override.params(node: ::RBI::OptParam).void } def visit_opt_param(node); end - # : (Private node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#420 + # pkg:gem/rbi#lib/rbi/printer.rb:456 sig { override.params(node: ::RBI::Private).void } def visit_private(node); end - # : (Protected node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#414 + # pkg:gem/rbi#lib/rbi/printer.rb:450 sig { override.params(node: ::RBI::Protected).void } def visit_protected(node); end - # : (Public node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#408 + # pkg:gem/rbi#lib/rbi/printer.rb:444 sig { override.params(node: ::RBI::Public).void } def visit_public(node); end - # : (RBSComment node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#104 + # pkg:gem/rbi#lib/rbi/printer.rb:118 sig { override.params(node: ::RBI::RBSComment).void } def visit_rbs_comment(node); end - # : (ReqParam node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#337 + # pkg:gem/rbi#lib/rbi/printer.rb:365 sig { override.params(node: ::RBI::ReqParam).void } def visit_req_param(node); end - # : (RequiresAncestor node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#604 + # pkg:gem/rbi#lib/rbi/printer.rb:644 sig { override.params(node: ::RBI::RequiresAncestor).void } def visit_requires_ancestor(node); end - # : (RestParam node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#349 + # pkg:gem/rbi#lib/rbi/printer.rb:379 sig { override.params(node: ::RBI::RestParam).void } def visit_rest_param(node); end - # : (Scope node) -> void - # - # source://rbi//lib/rbi/printer.rb#175 + # pkg:gem/rbi#lib/rbi/printer.rb:197 sig { params(node: ::RBI::Scope).void } def visit_scope(node); end - # : (Scope node) -> void - # - # source://rbi//lib/rbi/printer.rb#220 + # pkg:gem/rbi#lib/rbi/printer.rb:242 sig { params(node: ::RBI::Scope).void } def visit_scope_body(node); end - # : (ScopeConflict node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#624 + # pkg:gem/rbi#lib/rbi/printer.rb:664 sig { override.params(node: ::RBI::ScopeConflict).void } def visit_scope_conflict(node); end - # : (Scope node) -> void - # - # source://rbi//lib/rbi/printer.rb#185 + # pkg:gem/rbi#lib/rbi/printer.rb:207 sig { params(node: ::RBI::Scope).void } def visit_scope_header(node); end - # : (Send node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#435 + # pkg:gem/rbi#lib/rbi/printer.rb:471 sig { override.params(node: ::RBI::Send).void } def visit_send(node); end - # : (Sig node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#465 + # pkg:gem/rbi#lib/rbi/printer.rb:503 sig { override.params(node: ::RBI::Sig).void } def visit_sig(node); end - # : (SigParam node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#486 + # pkg:gem/rbi#lib/rbi/printer.rb:524 sig { override.params(node: ::RBI::SigParam).void } def visit_sig_param(node); end - # : (SingletonClass node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#170 + # pkg:gem/rbi#lib/rbi/printer.rb:192 sig { override.params(node: ::RBI::SingletonClass).void } def visit_singleton_class(node); end - # : (Struct node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#164 + # pkg:gem/rbi#lib/rbi/printer.rb:186 sig { override.params(node: ::RBI::Struct).void } def visit_struct(node); end - # : (TStructField node) -> void - # - # source://rbi//lib/rbi/printer.rb#509 + # pkg:gem/rbi#lib/rbi/printer.rb:549 sig { params(node: ::RBI::TStructField).void } def visit_t_struct_field(node); end - # : (TEnum node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#528 + # pkg:gem/rbi#lib/rbi/printer.rb:568 sig { override.params(node: ::RBI::TEnum).void } def visit_tenum(node); end - # : (TEnumBlock node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#534 + # pkg:gem/rbi#lib/rbi/printer.rb:574 sig { override.params(node: ::RBI::TEnumBlock).void } def visit_tenum_block(node); end - # : (TEnumValue node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#547 + # pkg:gem/rbi#lib/rbi/printer.rb:587 sig { override.params(node: ::RBI::TEnumValue).void } def visit_tenum_value(node); end - # : (Tree node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#144 + # pkg:gem/rbi#lib/rbi/printer.rb:166 sig { override.params(node: ::RBI::Tree).void } def visit_tree(node); end - # : (TStruct node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#492 + # pkg:gem/rbi#lib/rbi/printer.rb:532 sig { override.params(node: ::RBI::TStruct).void } def visit_tstruct(node); end - # : (TStructConst node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#498 + # pkg:gem/rbi#lib/rbi/printer.rb:538 sig { override.params(node: ::RBI::TStructConst).void } def visit_tstruct_const(node); end - # : (TStructProp node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#504 + # pkg:gem/rbi#lib/rbi/printer.rb:544 sig { override.params(node: ::RBI::TStructProp).void } def visit_tstruct_prop(node); end - # : (TypeMember node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#557 + # pkg:gem/rbi#lib/rbi/printer.rb:597 sig { override.params(node: ::RBI::TypeMember).void } def visit_type_member(node); end - # : (Visibility node) -> void - # - # source://rbi//lib/rbi/printer.rb#425 + # pkg:gem/rbi#lib/rbi/printer.rb:461 sig { params(node: ::RBI::Visibility).void } def visit_visibility(node); end - # : (VisibilityGroup node) -> void + # @override # - # source://rbi//lib/rbi/printer.rb#590 + # pkg:gem/rbi#lib/rbi/printer.rb:630 sig { override.params(node: ::RBI::VisibilityGroup).void } def visit_visibility_group(node); end end -# source://rbi//lib/rbi/printer.rb#5 +# pkg:gem/rbi#lib/rbi/printer.rb:846 +RBI::Printer::EMPTY_MODIFIERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rbi#lib/rbi/printer.rb:10 +RBI::Printer::INDENT_CACHE = T.let(T.unsafe(nil), Array) + +# Pre-computed indentation strings to avoid allocating " " * indent on every line. +# +# pkg:gem/rbi#lib/rbi/printer.rb:9 +RBI::Printer::MAX_CACHED_INDENT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rbi#lib/rbi/printer.rb:5 class RBI::PrinterError < ::RBI::Error; end -# source://rbi//lib/rbi/model.rb#792 +# pkg:gem/rbi#lib/rbi/model.rb:821 class RBI::Private < ::RBI::Visibility - # : (?loc: Loc?, ?comments: Array[Comment]) ?{ (Private node) -> void } -> void - # - # @return [Private] a new instance of Private - # - # source://rbi//lib/rbi/model.rb#794 + # pkg:gem/rbi#lib/rbi/model.rb:823 sig do params( loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::Private).void) ).void end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#784 +# pkg:gem/rbi#lib/rbi/model.rb:813 class RBI::Protected < ::RBI::Visibility - # : (?loc: Loc?, ?comments: Array[Comment]) ?{ (Protected node) -> void } -> void - # - # @return [Protected] a new instance of Protected - # - # source://rbi//lib/rbi/model.rb#786 + # pkg:gem/rbi#lib/rbi/model.rb:815 sig do params( loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::Protected).void) ).void end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#776 +# pkg:gem/rbi#lib/rbi/model.rb:802 class RBI::Public < ::RBI::Visibility - # : (?loc: Loc?, ?comments: Array[Comment]) ?{ (Public node) -> void } -> void - # - # @return [Public] a new instance of Public - # - # source://rbi//lib/rbi/model.rb#778 + # pkg:gem/rbi#lib/rbi/model.rb:804 sig do params( loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::Public).void) ).void end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/rbs/method_type_translator.rb#5 +# Shared default instance to avoid allocating a new Public on every Method/Attr creation. +# +# pkg:gem/rbi#lib/rbi/model.rb:810 +RBI::Public::DEFAULT = T.let(T.unsafe(nil), RBI::Public) + +# pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:5 module RBI::RBS; end -# source://rbi//lib/rbi/rbs/method_type_translator.rb#6 +# pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:6 class RBI::RBS::MethodTypeTranslator - # : (Method) -> void - # - # @return [MethodTypeTranslator] a new instance of MethodTypeTranslator - # - # source://rbi//lib/rbi/rbs/method_type_translator.rb#22 + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:22 sig { params(method: ::RBI::Method).void } def initialize(method); end - # : Sig - # - # source://rbi//lib/rbi/rbs/method_type_translator.rb#19 + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:19 sig { returns(::RBI::Sig) } def result; end - # : (::RBS::MethodType) -> void - # - # source://rbi//lib/rbi/rbs/method_type_translator.rb#28 + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:28 sig { params(type: ::RBS::MethodType).void } def visit(type); end private - # : (::RBS::Types::Function::Param, Integer) -> SigParam - # - # source://rbi//lib/rbi/rbs/method_type_translator.rb#100 + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:100 sig { params(param: ::RBS::Types::Function::Param, index: ::Integer).returns(::RBI::SigParam) } def translate_function_param(param, index); end - # : (untyped) -> Type - # - # source://rbi//lib/rbi/rbs/method_type_translator.rb#115 + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:115 sig { params(type: T.untyped).returns(::RBI::Type) } def translate_type(type); end - # : (::RBS::Types::Block) -> void - # - # @raise [Error] - # - # source://rbi//lib/rbi/rbs/method_type_translator.rb#42 + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:42 sig { params(type: ::RBS::Types::Block).void } def visit_block_type(type); end - # : (::RBS::Types::Function) -> void - # - # source://rbi//lib/rbi/rbs/method_type_translator.rb#57 + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:57 sig { params(type: ::RBS::Types::Function).void } def visit_function_type(type); end class << self - # : (Method, ::RBS::MethodType) -> Sig - # - # source://rbi//lib/rbi/rbs/method_type_translator.rb#11 + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:11 sig { params(method: ::RBI::Method, type: ::RBS::MethodType).returns(::RBI::Sig) } def translate(method, type); end end end -# source://rbi//lib/rbi/rbs/method_type_translator.rb#7 +# pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:7 class RBI::RBS::MethodTypeTranslator::Error < ::RBI::Error; end -# source://rbi//lib/rbi/rbs/type_translator.rb#6 +# pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:6 class RBI::RBS::TypeTranslator class << self - # : ( - # | ::RBS::Types::Alias | - # | ::RBS::Types::Bases::Any | - # | ::RBS::Types::Bases::Bool | - # | ::RBS::Types::Bases::Bottom | - # | ::RBS::Types::Bases::Class | - # | ::RBS::Types::Bases::Instance | - # | ::RBS::Types::Bases::Nil | - # | ::RBS::Types::Bases::Self | - # | ::RBS::Types::Bases::Top | - # | ::RBS::Types::Bases::Void | - # | ::RBS::Types::ClassSingleton | - # | ::RBS::Types::ClassInstance | - # | ::RBS::Types::Function | - # | ::RBS::Types::Interface | - # | ::RBS::Types::Intersection | - # | ::RBS::Types::Literal | - # | ::RBS::Types::Optional | - # | ::RBS::Types::Proc | - # | ::RBS::Types::Record | - # | ::RBS::Types::Tuple | - # | ::RBS::Types::Union | - # | ::RBS::Types::UntypedFunction | - # | ::RBS::Types::Variable - # | ) -> Type - # - # source://rbi//lib/rbi/rbs/type_translator.rb#33 + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:33 sig do params( type: T.any(::RBS::Types::Alias, ::RBS::Types::Bases::Any, ::RBS::Types::Bases::Bool, ::RBS::Types::Bases::Bottom, ::RBS::Types::Bases::Class, ::RBS::Types::Bases::Instance, ::RBS::Types::Bases::Nil, ::RBS::Types::Bases::Self, ::RBS::Types::Bases::Top, ::RBS::Types::Bases::Void, ::RBS::Types::ClassInstance, ::RBS::Types::ClassSingleton, ::RBS::Types::Function, ::RBS::Types::Interface, ::RBS::Types::Intersection, ::RBS::Types::Literal, ::RBS::Types::Optional, ::RBS::Types::Proc, ::RBS::Types::Record, ::RBS::Types::Tuple, ::RBS::Types::Union, ::RBS::Types::UntypedFunction, ::RBS::Types::Variable) @@ -2818,27 +2148,19 @@ class RBI::RBS::TypeTranslator private - # : (::RBS::Types::ClassInstance) -> Type - # - # source://rbi//lib/rbi/rbs/type_translator.rb#107 + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:114 sig { params(type: ::RBS::Types::ClassInstance).returns(::RBI::Type) } def translate_class_instance(type); end - # : (::RBS::Types::Function) -> Type - # - # source://rbi//lib/rbi/rbs/type_translator.rb#115 + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:122 sig { params(type: ::RBS::Types::Function).returns(::RBI::Type) } def translate_function(type); end - # : (String type_name) -> String - # - # source://rbi//lib/rbi/rbs/type_translator.rb#162 + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:169 sig { params(type_name: ::String).returns(::String) } def translate_t_generic_type(type_name); end - # : (::RBS::Types::Alias) -> Type - # - # source://rbi//lib/rbi/rbs/type_translator.rb#95 + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:102 sig { params(type: ::RBS::Types::Alias).returns(::RBI::Type) } def translate_type_alias(type); end end @@ -2846,28 +2168,16 @@ end # A comment representing a RBS type prefixed with `#:` # -# source://rbi//lib/rbi/model.rb#78 +# pkg:gem/rbi#lib/rbi/model.rb:78 class RBI::RBSComment < ::RBI::Comment - # : (Object other) -> bool - # - # source://rbi//lib/rbi/model.rb#80 + # pkg:gem/rbi#lib/rbi/model.rb:80 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end end -# source://rbi//lib/rbi/rbs_printer.rb#5 +# pkg:gem/rbi#lib/rbi/rbs_printer.rb:5 class RBI::RBSPrinter < ::RBI::Visitor - # : ( - # | ?out: (IO | StringIO), - # | ?indent: Integer, - # | ?print_locs: bool, - # | ?positional_names: bool, - # | ?max_line_length: Integer? - # | ) -> void - # - # @return [RBSPrinter] a new instance of RBSPrinter - # - # source://rbi//lib/rbi/rbs_printer.rb#30 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:30 sig do params( out: T.any(::IO, ::StringIO), @@ -2879,686 +2189,563 @@ class RBI::RBSPrinter < ::RBI::Visitor end def initialize(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil), max_line_length: T.unsafe(nil)); end - # : Integer - # - # source://rbi//lib/rbi/rbs_printer.rb#15 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:15 sig { returns(::Integer) } def current_indent; end - # : -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#49 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:49 sig { void } def dedent; end - # : bool - # - # source://rbi//lib/rbi/rbs_printer.rb#9 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:9 def in_visibility_group; end - # : bool - # - # source://rbi//lib/rbi/rbs_printer.rb#9 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:9 def in_visibility_group=(_arg0); end - # : -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#44 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:44 sig { void } def indent; end - # : Integer? - # - # source://rbi//lib/rbi/rbs_printer.rb#21 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:21 sig { returns(T.nilable(::Integer)) } def max_line_length; end - # : bool - # - # source://rbi//lib/rbi/rbs_printer.rb#18 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:18 sig { returns(T::Boolean) } def positional_names; end - # : bool - # - # source://rbi//lib/rbi/rbs_printer.rb#18 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:18 def positional_names=(_arg0); end - # : Node? - # - # source://rbi//lib/rbi/rbs_printer.rb#12 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:12 sig { returns(T.nilable(::RBI::Node)) } def previous_node; end # Print a string without indentation nor `\n` at the end. - # : (String string) -> void # - # source://rbi//lib/rbi/rbs_printer.rb#55 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:55 sig { params(string: ::String).void } def print(string); end - # : (RBI::Attr node, Sig sig) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#302 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:302 sig { params(node: ::RBI::Attr, sig: ::RBI::Sig).void } def print_attr_sig(node, sig); end - # : bool - # - # source://rbi//lib/rbi/rbs_printer.rb#9 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:9 sig { returns(T::Boolean) } def print_locs; end - # : bool - # - # source://rbi//lib/rbi/rbs_printer.rb#9 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:9 def print_locs=(_arg0); end - # : (RBI::Method node, Sig sig) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#400 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:400 sig { params(node: ::RBI::Method, sig: ::RBI::Sig).void } def print_method_sig(node, sig); end - # : (RBI::Method node, Sig sig) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#417 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:417 sig { params(node: ::RBI::Method, sig: ::RBI::Sig).void } def print_method_sig_inline(node, sig); end - # : (RBI::Method node, Sig sig) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#479 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:479 sig { params(node: ::RBI::Method, sig: ::RBI::Sig).void } def print_method_sig_multiline(node, sig); end # Print a string with indentation and `\n` at the end. - # : (String string) -> void # - # source://rbi//lib/rbi/rbs_printer.rb#75 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:75 sig { params(string: ::String).void } def printl(string); end # Print a string without indentation but with a `\n` at the end. - # : (?String? string) -> void # - # source://rbi//lib/rbi/rbs_printer.rb#61 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:61 sig { params(string: T.nilable(::String)).void } def printn(string = T.unsafe(nil)); end # Print a string with indentation but without a `\n` at the end. - # : (?String? string) -> void # - # source://rbi//lib/rbi/rbs_printer.rb#68 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:68 sig { params(string: T.nilable(::String)).void } def printt(string = T.unsafe(nil)); end - # : (Array[Node] nodes) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#82 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:82 sig { override.params(nodes: T::Array[::RBI::Node]).void } def visit_all(nodes); end - # : (Arg node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#680 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:680 sig { override.params(node: ::RBI::Arg).void } def visit_arg(node); end - # : (Attr node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#270 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:270 sig { params(node: ::RBI::Attr).void } def visit_attr(node); end - # : (AttrAccessor node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#253 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:253 sig { override.params(node: ::RBI::AttrAccessor).void } def visit_attr_accessor(node); end - # : (AttrReader node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#259 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:259 sig { override.params(node: ::RBI::AttrReader).void } def visit_attr_reader(node); end - # : (AttrWriter node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#265 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:265 sig { override.params(node: ::RBI::AttrWriter).void } def visit_attr_writer(node); end - # : (BlankLine node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#124 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:124 sig { override.params(node: ::RBI::BlankLine).void } def visit_blank_line(node); end - # : (BlockParam node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#612 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:612 sig { override.params(node: ::RBI::BlockParam).void } def visit_block_param(node); end - # : (Class node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#144 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:144 sig { override.params(node: ::RBI::Class).void } def visit_class(node); end - # : (Comment node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#107 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:107 sig { override.params(node: ::RBI::Comment).void } def visit_comment(node); end - # : (ConflictTree node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#816 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:816 sig { override.params(node: ::RBI::ConflictTree).void } def visit_conflict_tree(node); end - # : (Const node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#237 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:237 sig { override.params(node: ::RBI::Const).void } def visit_const(node); end - # : (Extend node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#624 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:624 sig { override.params(node: ::RBI::Extend).void } def visit_extend(node); end - # : (File file) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#94 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:94 sig { override.params(file: ::RBI::File).void } def visit_file(file); end - # : (Group node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#789 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:789 sig { override.params(node: ::RBI::Group).void } def visit_group(node); end - # : (Helper node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#777 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:777 sig { override.params(node: ::RBI::Helper).void } def visit_helper(node); end - # : (Include node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#618 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:618 sig { override.params(node: ::RBI::Include).void } def visit_include(node); end - # : (KwArg node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#686 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:686 sig { override.params(node: ::RBI::KwArg).void } def visit_kw_arg(node); end - # : (KwOptParam node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#600 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:600 sig { override.params(node: ::RBI::KwOptParam).void } def visit_kw_opt_param(node); end - # : (KwParam node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#594 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:594 sig { override.params(node: ::RBI::KwParam).void } def visit_kw_param(node); end - # : (KwRestParam node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#606 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:606 sig { override.params(node: ::RBI::KwRestParam).void } def visit_kw_rest_param(node); end - # : (Method node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#325 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:325 sig { override.params(node: ::RBI::Method).void } def visit_method(node); end - # : (MixesInClassMethods node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#783 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:783 sig { override.params(node: ::RBI::MixesInClassMethods).void } def visit_mixes_in_class_methods(node); end - # : (Mixin node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#629 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:629 sig { params(node: ::RBI::Mixin).void } def visit_mixin(node); end - # : (Module node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#138 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:138 sig { override.params(node: ::RBI::Module).void } def visit_module(node); end - # : (OptParam node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#574 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:574 sig { override.params(node: ::RBI::OptParam).void } def visit_opt_param(node); end - # : (Private node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#659 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:659 sig { override.params(node: ::RBI::Private).void } def visit_private(node); end - # : (Protected node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#653 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:653 sig { override.params(node: ::RBI::Protected).void } def visit_protected(node); end - # : (Public node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#647 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:647 sig { override.params(node: ::RBI::Public).void } def visit_public(node); end - # : (ReqParam node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#564 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:564 sig { override.params(node: ::RBI::ReqParam).void } def visit_req_param(node); end - # : (RequiresAncestor node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#810 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:810 sig { override.params(node: ::RBI::RequiresAncestor).void } def visit_requires_ancestor(node); end - # : (RestParam node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#584 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:584 sig { override.params(node: ::RBI::RestParam).void } def visit_rest_param(node); end - # : (Scope node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#161 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:161 sig { params(node: ::RBI::Scope).void } def visit_scope(node); end - # : (Scope node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#224 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:224 sig { params(node: ::RBI::Scope).void } def visit_scope_body(node); end - # : (ScopeConflict node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#826 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:826 sig { override.params(node: ::RBI::ScopeConflict).void } def visit_scope_conflict(node); end - # : (Scope node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#171 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:171 sig { params(node: ::RBI::Scope).void } def visit_scope_header(node); end - # : (Send node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#674 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:674 sig { override.params(node: ::RBI::Send).void } def visit_send(node); end - # : (Sig node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#545 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:545 sig { params(node: ::RBI::Sig).void } def visit_sig(node); end - # : (SigParam node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#558 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:558 sig { params(node: ::RBI::SigParam).void } def visit_sig_param(node); end - # : (SingletonClass node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#156 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:156 sig { override.params(node: ::RBI::SingletonClass).void } def visit_singleton_class(node); end - # : (Struct node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#150 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:150 sig { override.params(node: ::RBI::Struct).void } def visit_struct(node); end - # : (TEnum node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#743 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:743 sig { override.params(node: ::RBI::TEnum).void } def visit_tenum(node); end - # : (TEnumBlock node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#749 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:749 sig { override.params(node: ::RBI::TEnumBlock).void } def visit_tenum_block(node); end - # : (TEnumValue node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#755 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:755 sig { override.params(node: ::RBI::TEnumValue).void } def visit_tenum_value(node); end - # : (Tree node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#130 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:130 sig { override.params(node: ::RBI::Tree).void } def visit_tree(node); end - # : (TStruct node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#692 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:692 sig { override.params(node: ::RBI::TStruct).void } def visit_tstruct(node); end - # : (TStructConst node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#727 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:727 sig { override.params(node: ::RBI::TStructConst).void } def visit_tstruct_const(node); end - # : (TStructProp node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#735 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:735 sig { override.params(node: ::RBI::TStructProp).void } def visit_tstruct_prop(node); end - # : (TypeMember node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#771 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:771 sig { override.params(node: ::RBI::TypeMember).void } def visit_type_member(node); end - # : (Visibility node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#664 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:664 sig { params(node: ::RBI::Visibility).void } def visit_visibility(node); end - # : (VisibilityGroup node) -> void + # @override # - # source://rbi//lib/rbi/rbs_printer.rb#796 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:796 sig { override.params(node: ::RBI::VisibilityGroup).void } def visit_visibility_group(node); end private - # : (Node node) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/rbs_printer.rb#929 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:929 sig { params(node: ::RBI::Node).returns(T::Boolean) } def oneline?(node); end # Parse a string containing a `T.let(x, X)` and extract the type # # Returns `nil` is the string is not a `T.let`. - # : (String? code) -> String? # - # source://rbi//lib/rbi/rbs_printer.rb#963 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:963 sig { params(code: T.nilable(::String)).returns(T.nilable(::String)) } def parse_t_let(code); end - # : ((Type | String) type) -> Type - # - # source://rbi//lib/rbi/rbs_printer.rb#951 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:951 sig { params(type: T.any(::RBI::Type, ::String)).returns(::RBI::Type) } def parse_type(type); end - # : (Node node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#842 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:842 sig { params(node: ::RBI::Node).void } def print_blank_line_before(node); end - # : (Node node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#861 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:861 sig { params(node: ::RBI::Node).void } def print_loc(node); end - # : (Param node, last: bool) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#903 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:903 sig { params(node: ::RBI::Param, last: T::Boolean).void } def print_param_comment_leading_space(node, last:); end - # : (Method node, SigParam param) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#867 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:867 sig { params(node: ::RBI::Method, param: ::RBI::SigParam).void } def print_sig_param(node, param); end - # : (SigParam node, last: bool) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#921 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:921 sig { params(node: ::RBI::SigParam, last: T::Boolean).void } def print_sig_param_comment_leading_space(node, last:); end end -# source://rbi//lib/rbi/rbs_printer.rb#6 +# pkg:gem/rbi#lib/rbi/rbs_printer.rb:6 class RBI::RBSPrinter::Error < ::RBI::Error; end -# source://rbi//lib/rbi/model.rb#5 +# pkg:gem/rbi#lib/rbi/model.rb:5 class RBI::ReplaceNodeError < ::RBI::Error; end -# source://rbi//lib/rbi/model.rb#569 +# pkg:gem/rbi#lib/rbi/model.rb:630 class RBI::ReqParam < ::RBI::Param - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (ReqParam node) -> void } -> void - # - # @return [ReqParam] a new instance of ReqParam - # - # source://rbi//lib/rbi/model.rb#571 + # pkg:gem/rbi#lib/rbi/model.rb:632 sig do params( name: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::ReqParam).void) ).void end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#577 - sig { params(other: T.nilable(::Object)).returns(T::Boolean) } - def ==(other); end end -# source://rbi//lib/rbi/model.rb#1204 +# pkg:gem/rbi#lib/rbi/model.rb:1250 class RBI::RequiresAncestor < ::RBI::NodeWithComments include ::RBI::Indexable - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) -> void - # - # @return [RequiresAncestor] a new instance of RequiresAncestor - # - # source://rbi//lib/rbi/model.rb#1209 - sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } + # pkg:gem/rbi#lib/rbi/model.rb:1255 + sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T.nilable(T::Array[::RBI::Comment])).void } def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#154 + # pkg:gem/rbi#lib/rbi/index.rb:154 sig { override.returns(T::Array[::String]) } def index_ids; end - # : String - # - # source://rbi//lib/rbi/model.rb#1206 + # pkg:gem/rbi#lib/rbi/model.rb:1252 sig { returns(::String) } def name; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#1216 + # pkg:gem/rbi#lib/rbi/model.rb:1262 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#599 +# pkg:gem/rbi#lib/rbi/model.rb:650 class RBI::RestParam < ::RBI::Param - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (RestParam node) -> void } -> void - # - # @return [RestParam] a new instance of RestParam - # - # source://rbi//lib/rbi/model.rb#601 + # pkg:gem/rbi#lib/rbi/model.rb:652 sig do params( name: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::RestParam).void) ).void end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#613 - sig { params(other: T.nilable(::Object)).returns(T::Boolean) } - def ==(other); end - - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#608 + # pkg:gem/rbi#lib/rbi/model.rb:659 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/rewriters/add_sig_templates.rb#5 +# pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:5 module RBI::Rewriters; end -# source://rbi//lib/rbi/rewriters/add_sig_templates.rb#6 +# pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:6 class RBI::Rewriters::AddSigTemplates < ::RBI::Visitor - # : (?with_todo_comment: bool) -> void - # - # @return [AddSigTemplates] a new instance of AddSigTemplates - # - # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#8 + # pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:8 sig { params(with_todo_comment: T::Boolean).void } def initialize(with_todo_comment: T.unsafe(nil)); end - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#15 + # pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:15 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : (Attr attr) -> void - # - # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#29 + # pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:29 sig { params(attr: ::RBI::Attr).void } def add_attr_sig(attr); end - # : (Method method) -> void - # - # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#44 + # pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:44 sig { params(method: ::RBI::Method).void } def add_method_sig(method); end - # : (NodeWithComments node) -> void - # - # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#55 + # pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:55 sig { params(node: ::RBI::NodeWithComments).void } def add_todo_comment(node); end end -# source://rbi//lib/rbi/rewriters/annotate.rb#6 +# pkg:gem/rbi#lib/rbi/rewriters/annotate.rb:6 class RBI::Rewriters::Annotate < ::RBI::Visitor - # : (String annotation, ?annotate_scopes: bool, ?annotate_properties: bool) -> void - # - # @return [Annotate] a new instance of Annotate - # - # source://rbi//lib/rbi/rewriters/annotate.rb#8 + # pkg:gem/rbi#lib/rbi/rewriters/annotate.rb:8 sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void } def initialize(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/annotate.rb#17 + # pkg:gem/rbi#lib/rbi/rewriters/annotate.rb:17 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : (NodeWithComments node) -> void - # - # source://rbi//lib/rbi/rewriters/annotate.rb#30 + # pkg:gem/rbi#lib/rbi/rewriters/annotate.rb:30 sig { params(node: ::RBI::NodeWithComments).void } def annotate_node(node); end - # : (Node node) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/rewriters/annotate.rb#37 + # pkg:gem/rbi#lib/rbi/rewriters/annotate.rb:37 sig { params(node: ::RBI::Node).returns(T::Boolean) } def root?(node); end end -# source://rbi//lib/rbi/rewriters/attr_to_methods.rb#22 +# pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:22 class RBI::Rewriters::AttrToMethods < ::RBI::Visitor - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#25 + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:25 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : (Node node, with: Array[Node]) -> void - # - # @raise [ReplaceNodeError] - # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#38 + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:38 sig { params(node: ::RBI::Node, with: T::Array[::RBI::Node]).void } def replace(node, with:); end end -# source://rbi//lib/rbi/rewriters/deannotate.rb#6 +# pkg:gem/rbi#lib/rbi/rewriters/deannotate.rb:6 class RBI::Rewriters::Deannotate < ::RBI::Visitor - # : (String annotation) -> void - # - # @return [Deannotate] a new instance of Deannotate - # - # source://rbi//lib/rbi/rewriters/deannotate.rb#8 + # pkg:gem/rbi#lib/rbi/rewriters/deannotate.rb:8 sig { params(annotation: ::String).void } def initialize(annotation); end - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/deannotate.rb#15 + # pkg:gem/rbi#lib/rbi/rewriters/deannotate.rb:15 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : (NodeWithComments node) -> void - # - # source://rbi//lib/rbi/rewriters/deannotate.rb#26 + # pkg:gem/rbi#lib/rbi/rewriters/deannotate.rb:26 sig { params(node: ::RBI::NodeWithComments).void } def deannotate_node(node); end end @@ -3615,32 +2802,26 @@ end # RBI with no versions: # - RBI with no version annotations are automatically counted towards ALL versions # -# source://rbi//lib/rbi/rewriters/filter_versions.rb#57 +# pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:57 class RBI::Rewriters::FilterVersions < ::RBI::Visitor - # : (Gem::Version version) -> void - # - # @return [FilterVersions] a new instance of FilterVersions - # - # source://rbi//lib/rbi/rewriters/filter_versions.rb#69 + # pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:69 sig { params(version: ::Gem::Version).void } def initialize(version); end - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/filter_versions.rb#76 + # pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:76 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end class << self - # : (Tree tree, Gem::Version version) -> void - # - # source://rbi//lib/rbi/rewriters/filter_versions.rb#62 + # pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:62 sig { params(tree: ::RBI::Tree, version: ::Gem::Version).void } def filter(tree, version); end end end -# source://rbi//lib/rbi/rewriters/filter_versions.rb#58 +# pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:58 RBI::Rewriters::FilterVersions::VERSION_PREFIX = T.let(T.unsafe(nil), String) # Rewrite non-singleton methods inside singleton classes to singleton methods @@ -3668,11 +2849,11 @@ RBI::Rewriters::FilterVersions::VERSION_PREFIX = T.let(T.unsafe(nil), String) # end # ~~~ # -# source://rbi//lib/rbi/rewriters/flatten_singleton_methods.rb#30 +# pkg:gem/rbi#lib/rbi/rewriters/flatten_singleton_methods.rb:30 class RBI::Rewriters::FlattenSingletonMethods < ::RBI::Visitor - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/flatten_singleton_methods.rb#33 + # pkg:gem/rbi#lib/rbi/rewriters/flatten_singleton_methods.rb:33 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end end @@ -3699,36 +2880,30 @@ end # end # ~~~ # -# source://rbi//lib/rbi/rewriters/flatten_visibilities.rb#27 +# pkg:gem/rbi#lib/rbi/rewriters/flatten_visibilities.rb:27 class RBI::Rewriters::FlattenVisibilities < ::RBI::Visitor - # : -> void - # - # @return [FlattenVisibilities] a new instance of FlattenVisibilities - # - # source://rbi//lib/rbi/rewriters/flatten_visibilities.rb#29 + # pkg:gem/rbi#lib/rbi/rewriters/flatten_visibilities.rb:29 sig { void } def initialize; end - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/flatten_visibilities.rb#37 + # pkg:gem/rbi#lib/rbi/rewriters/flatten_visibilities.rb:37 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end end -# source://rbi//lib/rbi/rewriters/group_nodes.rb#8 +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:8 class RBI::Rewriters::GroupNodes < ::RBI::Visitor - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/group_nodes.rb#11 + # pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:11 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : (Node node) -> Group::Kind - # - # source://rbi//lib/rbi/rewriters/group_nodes.rb#35 + # pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:37 sig { params(node: ::RBI::Node).returns(::RBI::Group::Kind) } def group_kind(node); end end @@ -3767,32 +2942,22 @@ end # end # ~~~ # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#39 +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:39 class RBI::Rewriters::Merge - # : (?left_name: String, ?right_name: String, ?keep: Keep) -> void - # - # @return [Merge] a new instance of Merge - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#66 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:66 sig { params(left_name: ::String, right_name: ::String, keep: ::RBI::Rewriters::Merge::Keep).void } def initialize(left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end - # : (Tree tree) -> void - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#75 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:75 sig { params(tree: ::RBI::Tree).void } def merge(tree); end - # : MergeTree - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#63 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:63 sig { returns(::RBI::MergeTree) } def tree; end class << self - # : (Tree left, Tree right, ?left_name: String, ?right_name: String, ?keep: Keep) -> MergeTree - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#50 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:50 sig do params( left: ::RBI::Tree, @@ -3808,41 +2973,27 @@ end # Used for logging / error displaying purpose # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#82 +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:82 class RBI::Rewriters::Merge::Conflict - # : (left: Node, right: Node, left_name: String, right_name: String) -> void - # - # @return [Conflict] a new instance of Conflict - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#90 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:90 sig { params(left: ::RBI::Node, right: ::RBI::Node, left_name: ::String, right_name: ::String).void } def initialize(left:, right:, left_name:, right_name:); end - # : Node - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#84 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:84 sig { returns(::RBI::Node) } def left; end - # : String - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#87 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:87 sig { returns(::String) } def left_name; end - # : Node - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#84 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:84 def right; end - # : String - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#87 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:87 def right_name; end - # : -> String - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#98 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:98 sig { returns(::String) } def to_s; end end @@ -3878,60 +3029,49 @@ end # end # ~~~ # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#247 +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:258 class RBI::Rewriters::Merge::ConflictTreeMerger < ::RBI::Visitor - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#250 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:261 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end - # : (Array[Node] nodes) -> void + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#256 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:267 sig { override.params(nodes: T::Array[::RBI::Node]).void } def visit_all(nodes); end private - # : (Tree left, Tree right) -> void - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#277 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:290 sig { params(left: ::RBI::Tree, right: ::RBI::Tree).void } def merge_conflict_trees(left, right); end end -# source://rbi//lib/rbi/rewriters/merge_trees.rb#40 +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:40 class RBI::Rewriters::Merge::Keep class << self private + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:45 def new(*_arg0); end end end -# : Keep -# -# source://rbi//lib/rbi/rewriters/merge_trees.rb#42 +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:42 RBI::Rewriters::Merge::Keep::LEFT = T.let(T.unsafe(nil), RBI::Rewriters::Merge::Keep) -# : Keep -# -# source://rbi//lib/rbi/rewriters/merge_trees.rb#41 +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:41 RBI::Rewriters::Merge::Keep::NONE = T.let(T.unsafe(nil), RBI::Rewriters::Merge::Keep) -# : Keep -# -# source://rbi//lib/rbi/rewriters/merge_trees.rb#43 +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:43 RBI::Rewriters::Merge::Keep::RIGHT = T.let(T.unsafe(nil), RBI::Rewriters::Merge::Keep) -# source://rbi//lib/rbi/rewriters/merge_trees.rb#103 +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:103 class RBI::Rewriters::Merge::TreeMerger < ::RBI::Visitor - # : (Tree output, ?left_name: String, ?right_name: String, ?keep: Keep) -> void - # - # @return [TreeMerger] a new instance of TreeMerger - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#108 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:108 sig do params( output: ::RBI::Tree, @@ -3942,65 +3082,53 @@ 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 - # : Array[Conflict] - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#105 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:105 sig { returns(T::Array[::RBI::Rewriters::Merge::Conflict]) } def conflicts; end - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#121 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:121 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : -> Tree - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#170 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:181 sig { returns(::RBI::Tree) } def current_scope; end - # : (Scope left, Scope right) -> void - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#187 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:198 sig { params(left: ::RBI::Scope, right: ::RBI::Scope).void } def make_conflict_scope(left, right); end - # : (Node left, Node right) -> void - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#194 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:205 sig { params(left: ::RBI::Node, right: ::RBI::Node).void } def make_conflict_tree(left, right); end - # : (Node node) -> Node? - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#175 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:186 sig { params(node: ::RBI::Node).returns(T.nilable(::RBI::Node)) } def previous_definition(node); end - # : (Scope left, Scope right) -> Scope - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#206 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:217 sig { params(left: ::RBI::Scope, right: ::RBI::Scope).returns(::RBI::Scope) } def replace_scope_header(left, right); end end -# source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#6 +# pkg:gem/rbi#lib/rbi/rewriters/nest_non_public_members.rb:6 class RBI::Rewriters::NestNonPublicMembers < ::RBI::Visitor - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#9 + # pkg:gem/rbi#lib/rbi/rewriters/nest_non_public_members.rb:9 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end end -# source://rbi//lib/rbi/rewriters/nest_singleton_methods.rb#6 +# pkg:gem/rbi#lib/rbi/rewriters/nest_singleton_methods.rb:6 class RBI::Rewriters::NestSingletonMethods < ::RBI::Visitor - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/nest_singleton_methods.rb#9 + # pkg:gem/rbi#lib/rbi/rewriters/nest_singleton_methods.rb:9 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end end @@ -4022,19 +3150,15 @@ end # end # ~~~ # -# source://rbi//lib/rbi/rewriters/nest_top_level_members.rb#22 +# pkg:gem/rbi#lib/rbi/rewriters/nest_top_level_members.rb:22 class RBI::Rewriters::NestTopLevelMembers < ::RBI::Visitor - # : -> void - # - # @return [NestTopLevelMembers] a new instance of NestTopLevelMembers - # - # source://rbi//lib/rbi/rewriters/nest_top_level_members.rb#24 + # pkg:gem/rbi#lib/rbi/rewriters/nest_top_level_members.rb:24 sig { void } def initialize; end - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/nest_top_level_members.rb#32 + # pkg:gem/rbi#lib/rbi/rewriters/nest_top_level_members.rb:32 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end end @@ -4082,60 +3206,42 @@ end # OPERATIONS # ~~~ # -# source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#48 +# pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:48 class RBI::Rewriters::RemoveKnownDefinitions < ::RBI::Visitor - # : (Index index) -> void - # - # @return [RemoveKnownDefinitions] a new instance of RemoveKnownDefinitions - # - # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#53 + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:53 sig { params(index: ::RBI::Index).void } def initialize(index); end - # : Array[Operation] - # - # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#50 + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:50 sig { returns(T::Array[::RBI::Rewriters::RemoveKnownDefinitions::Operation]) } def operations; end - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#75 + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:75 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end - # : (Array[Node] nodes) -> void - # - # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#69 + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:69 sig { params(nodes: T::Array[::RBI::Node]).void } def visit_all(nodes); end private - # : (Node node, Node previous) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#103 + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:103 sig { params(node: ::RBI::Node, previous: ::RBI::Node).returns(T::Boolean) } def can_delete_node?(node, previous); end - # : (Node node, Node previous) -> void - # - # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#121 + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:121 sig { params(node: ::RBI::Node, previous: ::RBI::Node).void } def delete_node(node, previous); end - # : (Indexable node) -> Node? - # - # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#94 + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:94 sig { params(node: ::RBI::Indexable).returns(T.nilable(::RBI::Node)) } def previous_definition_for(node); end class << self - # : (Tree tree, Index index) -> [Tree, Array[Operation]] - # - # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#61 + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:61 sig do params( tree: ::RBI::Tree, @@ -4146,136 +3252,108 @@ class RBI::Rewriters::RemoveKnownDefinitions < ::RBI::Visitor end end -# source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#126 +# pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:126 class RBI::Rewriters::RemoveKnownDefinitions::Operation - # : (deleted_node: Node, duplicate_of: Node) -> void - # - # @return [Operation] a new instance of Operation - # - # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#131 + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:131 sig { params(deleted_node: ::RBI::Node, duplicate_of: ::RBI::Node).void } def initialize(deleted_node:, duplicate_of:); end - # : Node - # - # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#128 + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:128 sig { returns(::RBI::Node) } def deleted_node; end - # : Node - # - # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#128 + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:128 def duplicate_of; end - # : -> String - # - # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#137 + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:137 sig { returns(::String) } def to_s; end end -# source://rbi//lib/rbi/rewriters/sort_nodes.rb#6 +# pkg:gem/rbi#lib/rbi/rewriters/sort_nodes.rb:6 class RBI::Rewriters::SortNodes < ::RBI::Visitor - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/sort_nodes.rb#9 + # pkg:gem/rbi#lib/rbi/rewriters/sort_nodes.rb:9 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : (Group::Kind kind) -> Integer - # - # source://rbi//lib/rbi/rewriters/sort_nodes.rb#74 + # pkg:gem/rbi#lib/rbi/rewriters/sort_nodes.rb:71 sig { params(kind: ::RBI::Group::Kind).returns(::Integer) } def group_rank(kind); end - # : (Node node) -> String? - # - # source://rbi//lib/rbi/rewriters/sort_nodes.rb#95 + # pkg:gem/rbi#lib/rbi/rewriters/sort_nodes.rb:92 sig { params(node: ::RBI::Node).returns(T.nilable(::String)) } def node_name(node); end - # : (Node node) -> Integer - # - # source://rbi//lib/rbi/rewriters/sort_nodes.rb#46 + # pkg:gem/rbi#lib/rbi/rewriters/sort_nodes.rb:43 sig { params(node: ::RBI::Node).returns(::Integer) } def node_rank(node); end - # : (Node node) -> void - # - # source://rbi//lib/rbi/rewriters/sort_nodes.rb#107 + # pkg:gem/rbi#lib/rbi/rewriters/sort_nodes.rb:104 sig { params(node: ::RBI::Node).void } def sort_node_names!(node); end end # Translate all RBS signature comments to Sorbet RBI signatures # -# source://rbi//lib/rbi/rewriters/translate_rbs_sigs.rb#7 +# pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:7 class RBI::Rewriters::TranslateRBSSigs < ::RBI::Visitor - # : (Node? node) -> void + # @override # - # source://rbi//lib/rbi/rewriters/translate_rbs_sigs.rb#12 + # pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:12 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : (Method | Attr) -> Array[RBSComment] - # - # source://rbi//lib/rbi/rewriters/translate_rbs_sigs.rb#34 + # pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:34 sig { params(node: T.any(::RBI::Attr, ::RBI::Method)).returns(T::Array[::RBI::RBSComment]) } def extract_rbs_comments(node); end - # : (Attr, RBSComment) -> Sig - # - # source://rbi//lib/rbi/rewriters/translate_rbs_sigs.rb#61 + # pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:61 sig { params(node: ::RBI::Attr, comment: ::RBI::RBSComment).returns(::RBI::Sig) } def translate_rbs_attr_type(node, comment); end - # : (Method, RBSComment) -> Sig - # - # source://rbi//lib/rbi/rewriters/translate_rbs_sigs.rb#53 + # pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:53 sig { params(node: ::RBI::Method, comment: ::RBI::RBSComment).returns(::RBI::Sig) } def translate_rbs_method_type(node, comment); end end -# source://rbi//lib/rbi/rewriters/translate_rbs_sigs.rb#8 +# pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:8 class RBI::Rewriters::TranslateRBSSigs::Error < ::RBI::Error; end # @abstract # -# source://rbi//lib/rbi/model.rb#163 +# pkg:gem/rbi#lib/rbi/model.rb:185 class RBI::Scope < ::RBI::Tree include ::RBI::Indexable abstract! # Duplicate `self` scope without its body - # : -> self # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#350 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:363 sig { returns(T.self_type) } def dup_empty; end - # : -> String - # # @abstract - # @raise [NotImplementedError] # - # source://rbi//lib/rbi/model.rb#166 + # pkg:gem/rbi#lib/rbi/model.rb:188 sig { abstract.returns(::String) } def fully_qualified_name; end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#84 + # pkg:gem/rbi#lib/rbi/index.rb:84 sig { override.returns(T::Array[::String]) } def index_ids; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#170 + # pkg:gem/rbi#lib/rbi/model.rb:192 sig { override.returns(::String) } def to_s; end end @@ -4293,132 +3371,86 @@ end # end # ~~~ # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#590 +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:620 class RBI::ScopeConflict < ::RBI::Tree - # : (left: Scope, right: Scope, ?left_name: String, ?right_name: String) -> void - # - # @return [ScopeConflict] a new instance of ScopeConflict - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#598 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:628 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 - # : Scope - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#592 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:622 sig { returns(::RBI::Scope) } def left; end - # : String - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#595 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:625 sig { returns(::String) } def left_name; end - # : Scope - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#592 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:622 def right; end - # : String - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#595 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:625 def right_name; end end # Sends # -# source://rbi//lib/rbi/model.rb#802 +# pkg:gem/rbi#lib/rbi/model.rb:831 class RBI::Send < ::RBI::NodeWithComments include ::RBI::Indexable - # : (String method, ?Array[Arg] args, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Send node) -> void } -> void - # - # @return [Send] a new instance of Send - # - # source://rbi//lib/rbi/model.rb#810 + # pkg:gem/rbi#lib/rbi/model.rb:839 sig do params( method: ::String, args: T::Array[::RBI::Arg], loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::Send).void) ).void end def initialize(method, args = T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Arg arg) -> void - # - # source://rbi//lib/rbi/model.rb#818 + # pkg:gem/rbi#lib/rbi/model.rb:847 sig { params(arg: ::RBI::Arg).void } def <<(arg); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#823 + # pkg:gem/rbi#lib/rbi/model.rb:852 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # : Array[Arg] - # - # source://rbi//lib/rbi/model.rb#807 + # pkg:gem/rbi#lib/rbi/model.rb:836 sig { returns(T::Array[::RBI::Arg]) } def args; end - # : (Node other) -> bool - # - # @return [Boolean] + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#516 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:546 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#184 + # pkg:gem/rbi#lib/rbi/index.rb:184 sig { override.returns(T::Array[::String]) } def index_ids; end - # : String - # - # source://rbi//lib/rbi/model.rb#804 + # pkg:gem/rbi#lib/rbi/model.rb:833 sig { returns(::String) } def method; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#828 + # pkg:gem/rbi#lib/rbi/model.rb:857 sig { returns(::String) } def to_s; end end # Sorbet's sigs # -# source://rbi//lib/rbi/model.rb#877 +# pkg:gem/rbi#lib/rbi/model.rb:906 class RBI::Sig < ::RBI::NodeWithComments - # : ( - # | ?params: Array[SigParam], - # | ?return_type: (Type | String), - # | ?is_abstract: bool, - # | ?is_override: bool, - # | ?is_overridable: bool, - # | ?is_final: bool, - # | ?allow_incompatible_override: bool, - # | ?allow_incompatible_override_visibility: bool, - # | ?without_runtime: bool, - # | ?type_params: Array[String], - # | ?checked: Symbol?, - # | ?loc: Loc?, - # | ?comments: Array[Comment] - # | ) ?{ (Sig node) -> void } -> void - # - # @return [Sig] a new instance of Sig - # - # source://rbi//lib/rbi/model.rb#926 + # pkg:gem/rbi#lib/rbi/model.rb:964 sig do params( - params: T::Array[::RBI::SigParam], + params: T.nilable(T::Array[::RBI::SigParam]), return_type: T.any(::RBI::Type, ::String), is_abstract: T::Boolean, is_override: T::Boolean, @@ -4427,720 +3459,490 @@ class RBI::Sig < ::RBI::NodeWithComments allow_incompatible_override: T::Boolean, allow_incompatible_override_visibility: T::Boolean, without_runtime: T::Boolean, - type_params: T::Array[::String], + type_params: T.nilable(T::Array[::String]), checked: T.nilable(::Symbol), loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::Sig).void) ).void end def initialize(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), allow_incompatible_override: T.unsafe(nil), allow_incompatible_override_visibility: T.unsafe(nil), without_runtime: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (SigParam param) -> void - # - # source://rbi//lib/rbi/model.rb#958 + # pkg:gem/rbi#lib/rbi/model.rb:996 sig { params(param: ::RBI::SigParam).void } def <<(param); end - # : (Object other) -> bool - # - # source://rbi//lib/rbi/model.rb#968 + # pkg:gem/rbi#lib/rbi/model.rb:1006 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end - # : (String name, (Type | String) type) -> void - # - # source://rbi//lib/rbi/model.rb#963 + # pkg:gem/rbi#lib/rbi/model.rb:1001 sig { params(name: ::String, type: T.any(::RBI::Type, ::String)).void } def add_param(name, type); end - # : bool - # - # source://rbi//lib/rbi/model.rb#897 + # pkg:gem/rbi#lib/rbi/model.rb:928 sig { returns(T::Boolean) } def allow_incompatible_override; end - # : bool - # - # source://rbi//lib/rbi/model.rb#897 + # pkg:gem/rbi#lib/rbi/model.rb:928 def allow_incompatible_override=(_arg0); end - # : bool - # - # source://rbi//lib/rbi/model.rb#900 + # pkg:gem/rbi#lib/rbi/model.rb:931 sig { returns(T::Boolean) } def allow_incompatible_override_visibility; end - # : bool - # - # source://rbi//lib/rbi/model.rb#900 + # pkg:gem/rbi#lib/rbi/model.rb:931 def allow_incompatible_override_visibility=(_arg0); end - # : Symbol? - # - # source://rbi//lib/rbi/model.rb#909 + # pkg:gem/rbi#lib/rbi/model.rb:947 sig { returns(T.nilable(::Symbol)) } def checked; end - # : Symbol? - # - # source://rbi//lib/rbi/model.rb#909 + # pkg:gem/rbi#lib/rbi/model.rb:947 def checked=(_arg0); end - # : bool - # - # source://rbi//lib/rbi/model.rb#885 + # pkg:gem/rbi#lib/rbi/model.rb:916 sig { returns(T::Boolean) } def is_abstract; end - # : bool - # - # source://rbi//lib/rbi/model.rb#885 + # pkg:gem/rbi#lib/rbi/model.rb:916 def is_abstract=(_arg0); end - # : bool - # - # source://rbi//lib/rbi/model.rb#894 + # pkg:gem/rbi#lib/rbi/model.rb:925 sig { returns(T::Boolean) } def is_final; end - # : bool - # - # source://rbi//lib/rbi/model.rb#894 + # pkg:gem/rbi#lib/rbi/model.rb:925 def is_final=(_arg0); end - # : bool - # - # source://rbi//lib/rbi/model.rb#891 + # pkg:gem/rbi#lib/rbi/model.rb:922 sig { returns(T::Boolean) } def is_overridable; end - # : bool - # - # source://rbi//lib/rbi/model.rb#891 + # pkg:gem/rbi#lib/rbi/model.rb:922 def is_overridable=(_arg0); end - # : bool - # - # source://rbi//lib/rbi/model.rb#888 + # pkg:gem/rbi#lib/rbi/model.rb:919 sig { returns(T::Boolean) } def is_override; end - # : bool - # - # source://rbi//lib/rbi/model.rb#888 + # pkg:gem/rbi#lib/rbi/model.rb:919 def is_override=(_arg0); end - # : Array[SigParam] - # - # source://rbi//lib/rbi/model.rb#879 + # pkg:gem/rbi#lib/rbi/model.rb:908 sig { returns(T::Array[::RBI::SigParam]) } def params; end - # : (Type | String) - # - # source://rbi//lib/rbi/model.rb#882 + # pkg:gem/rbi#lib/rbi/model.rb:913 sig { returns(T.any(::RBI::Type, ::String)) } def return_type; end - # : (Type | String) - # - # source://rbi//lib/rbi/model.rb#882 + # pkg:gem/rbi#lib/rbi/model.rb:913 def return_type=(_arg0); end - # : Array[String] - # - # source://rbi//lib/rbi/model.rb#906 + # pkg:gem/rbi#lib/rbi/model.rb:937 sig { returns(T::Array[::String]) } def type_params; end - # : bool - # - # source://rbi//lib/rbi/model.rb#903 + # pkg:gem/rbi#lib/rbi/model.rb:942 + sig { returns(T::Boolean) } + def type_params?; end + + # pkg:gem/rbi#lib/rbi/model.rb:934 sig { returns(T::Boolean) } def without_runtime; end - # : bool - # - # source://rbi//lib/rbi/model.rb#903 + # pkg:gem/rbi#lib/rbi/model.rb:934 def without_runtime=(_arg0); end end -# source://rbi//lib/rbi/model.rb#977 +# pkg:gem/rbi#lib/rbi/model.rb:1015 class RBI::SigParam < ::RBI::NodeWithComments - # : (String name, (Type | String) type, ?loc: Loc?, ?comments: Array[Comment]) ?{ (SigParam node) -> void } -> void - # - # @return [SigParam] a new instance of SigParam - # - # source://rbi//lib/rbi/model.rb#985 + # pkg:gem/rbi#lib/rbi/model.rb:1023 sig do params( name: ::String, type: T.any(::RBI::Type, ::String), loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::SigParam).void) ).void end def initialize(name, type, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object other) -> bool - # - # source://rbi//lib/rbi/model.rb#993 + # pkg:gem/rbi#lib/rbi/model.rb:1037 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end - # : String - # - # source://rbi//lib/rbi/model.rb#979 + # pkg:gem/rbi#lib/rbi/model.rb:1032 + sig { returns(T::Boolean) } + def anonymous?; end + + # pkg:gem/rbi#lib/rbi/model.rb:1017 sig { returns(::String) } def name; end - # : (Type | String) - # - # source://rbi//lib/rbi/model.rb#982 + # pkg:gem/rbi#lib/rbi/model.rb:1020 sig { returns(T.any(::RBI::Type, ::String)) } def type; end end -# source://rbi//lib/rbi/model.rb#219 +# pkg:gem/rbi#lib/rbi/model.rb:246 class RBI::SingletonClass < ::RBI::Scope - # : (?loc: Loc?, ?comments: Array[Comment]) ?{ (SingletonClass node) -> void } -> void - # - # @return [SingletonClass] a new instance of SingletonClass - # - # source://rbi//lib/rbi/model.rb#221 + # pkg:gem/rbi#lib/rbi/model.rb:248 sig do params( loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::SingletonClass).void) ).void end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#228 + # pkg:gem/rbi#lib/rbi/model.rb:255 sig { override.returns(::String) } def fully_qualified_name; end end -# source://rbi//lib/rbi/model.rb#233 +# pkg:gem/rbi#lib/rbi/model.rb:260 class RBI::Struct < ::RBI::Scope - # : ( - # | String name, - # | ?members: Array[Symbol], - # | ?keyword_init: bool, - # | ?loc: Loc?, - # | ?comments: Array[Comment] - # | ) ?{ (Struct struct) -> void } -> void - # - # @return [Struct] a new instance of Struct - # - # source://rbi//lib/rbi/model.rb#250 + # pkg:gem/rbi#lib/rbi/model.rb:277 sig do params( name: ::String, members: T::Array[::Symbol], keyword_init: T::Boolean, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(struct: ::RBI::Struct).void) ).void end def initialize(name, members: T.unsafe(nil), keyword_init: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool + # @override # - # @return [Boolean] - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#391 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:404 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#260 + # pkg:gem/rbi#lib/rbi/model.rb:287 sig { override.returns(::String) } def fully_qualified_name; end - # : bool - # - # source://rbi//lib/rbi/model.rb#241 + # pkg:gem/rbi#lib/rbi/model.rb:268 sig { returns(T::Boolean) } def keyword_init; end - # : bool - # - # source://rbi//lib/rbi/model.rb#241 + # pkg:gem/rbi#lib/rbi/model.rb:268 def keyword_init=(_arg0); end - # : Array[Symbol] - # - # source://rbi//lib/rbi/model.rb#238 + # pkg:gem/rbi#lib/rbi/model.rb:265 sig { returns(T::Array[::Symbol]) } def members; end - # : Array[Symbol] - # - # source://rbi//lib/rbi/model.rb#238 + # pkg:gem/rbi#lib/rbi/model.rb:265 def members=(_arg0); end - # : String - # - # source://rbi//lib/rbi/model.rb#235 + # pkg:gem/rbi#lib/rbi/model.rb:262 sig { returns(::String) } def name; end - # : String - # - # source://rbi//lib/rbi/model.rb#235 + # pkg:gem/rbi#lib/rbi/model.rb:262 def name=(_arg0); end end # Sorbet's T::Enum # -# source://rbi//lib/rbi/model.rb#1088 +# pkg:gem/rbi#lib/rbi/model.rb:1134 class RBI::TEnum < ::RBI::Class - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (TEnum klass) -> void } -> void - # - # @return [TEnum] a new instance of TEnum - # - # source://rbi//lib/rbi/model.rb#1090 + # pkg:gem/rbi#lib/rbi/model.rb:1136 sig do params( name: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(klass: ::RBI::TEnum).void) ).void end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#1096 +# pkg:gem/rbi#lib/rbi/model.rb:1142 class RBI::TEnumBlock < ::RBI::Scope - # : (?loc: Loc?, ?comments: Array[Comment]) ?{ (TEnumBlock node) -> void } -> void - # - # @return [TEnumBlock] a new instance of TEnumBlock - # - # source://rbi//lib/rbi/model.rb#1098 + # pkg:gem/rbi#lib/rbi/model.rb:1144 sig do params( loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::TEnumBlock).void) ).void end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#1105 + # pkg:gem/rbi#lib/rbi/model.rb:1151 sig { override.returns(::String) } def fully_qualified_name; end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#214 + # pkg:gem/rbi#lib/rbi/index.rb:214 sig { override.returns(T::Array[::String]) } def index_ids; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#1111 + # pkg:gem/rbi#lib/rbi/model.rb:1157 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#1116 +# pkg:gem/rbi#lib/rbi/model.rb:1162 class RBI::TEnumValue < ::RBI::NodeWithComments include ::RBI::Indexable - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (TEnumValue node) -> void } -> void - # - # @return [TEnumValue] a new instance of TEnumValue - # - # source://rbi//lib/rbi/model.rb#1121 + # pkg:gem/rbi#lib/rbi/model.rb:1167 sig do params( name: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::TEnumValue).void) ).void end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#1128 + # pkg:gem/rbi#lib/rbi/model.rb:1174 sig { returns(::String) } def fully_qualified_name; end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#224 + # pkg:gem/rbi#lib/rbi/index.rb:224 sig { override.returns(T::Array[::String]) } def index_ids; end - # : String - # - # source://rbi//lib/rbi/model.rb#1118 + # pkg:gem/rbi#lib/rbi/model.rb:1164 sig { returns(::String) } def name; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#1134 + # pkg:gem/rbi#lib/rbi/model.rb:1180 sig { override.returns(::String) } def to_s; end end # Sorbet's T::Struct # -# source://rbi//lib/rbi/model.rb#1000 +# pkg:gem/rbi#lib/rbi/model.rb:1046 class RBI::TStruct < ::RBI::Class - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (TStruct klass) -> void } -> void - # - # @return [TStruct] a new instance of TStruct - # - # source://rbi//lib/rbi/model.rb#1002 + # pkg:gem/rbi#lib/rbi/model.rb:1048 sig do params( name: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(klass: ::RBI::TStruct).void) ).void end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#1032 +# pkg:gem/rbi#lib/rbi/model.rb:1078 class RBI::TStructConst < ::RBI::TStructField include ::RBI::Indexable - # : ( - # | String name, - # | (Type | String) type, - # | ?default: String?, - # | ?loc: Loc?, - # | ?comments: Array[Comment] - # | ) ?{ (TStructConst node) -> void } -> void - # - # @return [TStructConst] a new instance of TStructConst - # - # source://rbi//lib/rbi/model.rb#1040 + # pkg:gem/rbi#lib/rbi/model.rb:1086 sig do params( name: ::String, type: T.any(::RBI::Type, ::String), default: T.nilable(::String), loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::TStructConst).void) ).void end def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool + # @override # - # @return [Boolean] - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#532 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:562 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/model.rb#1047 + # pkg:gem/rbi#lib/rbi/model.rb:1093 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#194 + # pkg:gem/rbi#lib/rbi/index.rb:194 sig { override.returns(T::Array[::String]) } def index_ids; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#1054 + # pkg:gem/rbi#lib/rbi/model.rb:1100 sig { override.returns(::String) } def to_s; end end # @abstract # -# source://rbi//lib/rbi/model.rb#1009 +# pkg:gem/rbi#lib/rbi/model.rb:1055 class RBI::TStructField < ::RBI::NodeWithComments abstract! - # : (String name, (Type | String) type, ?default: String?, ?loc: Loc?, ?comments: Array[Comment]) -> void - # - # @return [TStructField] a new instance of TStructField - # - # source://rbi//lib/rbi/model.rb#1020 + # pkg:gem/rbi#lib/rbi/model.rb:1066 sig do params( name: ::String, type: T.any(::RBI::Type, ::String), default: T.nilable(::String), loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment] + comments: T.nilable(T::Array[::RBI::Comment]) ).void end def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # : (Node other) -> bool + # @override # - # @return [Boolean] - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#524 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:554 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : String? - # - # source://rbi//lib/rbi/model.rb#1017 + # pkg:gem/rbi#lib/rbi/model.rb:1063 sig { returns(T.nilable(::String)) } def default; end - # : String? - # - # source://rbi//lib/rbi/model.rb#1017 + # pkg:gem/rbi#lib/rbi/model.rb:1063 def default=(_arg0); end - # : -> Array[String] - # # @abstract - # @raise [NotImplementedError] # - # source://rbi//lib/rbi/model.rb#1029 + # pkg:gem/rbi#lib/rbi/model.rb:1075 sig { abstract.returns(T::Array[::String]) } def fully_qualified_names; end - # : String - # - # source://rbi//lib/rbi/model.rb#1011 + # pkg:gem/rbi#lib/rbi/model.rb:1057 sig { returns(::String) } def name; end - # : String - # - # source://rbi//lib/rbi/model.rb#1011 + # pkg:gem/rbi#lib/rbi/model.rb:1057 def name=(_arg0); end - # : (Type | String) - # - # source://rbi//lib/rbi/model.rb#1014 + # pkg:gem/rbi#lib/rbi/model.rb:1060 sig { returns(T.any(::RBI::Type, ::String)) } def type; end - # : (Type | String) - # - # source://rbi//lib/rbi/model.rb#1014 + # pkg:gem/rbi#lib/rbi/model.rb:1060 def type=(_arg0); end end -# source://rbi//lib/rbi/model.rb#1059 +# pkg:gem/rbi#lib/rbi/model.rb:1105 class RBI::TStructProp < ::RBI::TStructField include ::RBI::Indexable - # : ( - # | String name, - # | (Type | String) type, - # | ?default: String?, - # | ?loc: Loc?, - # | ?comments: Array[Comment] - # | ) ?{ (TStructProp node) -> void } -> void - # - # @return [TStructProp] a new instance of TStructProp - # - # source://rbi//lib/rbi/model.rb#1067 + # pkg:gem/rbi#lib/rbi/model.rb:1113 sig do params( name: ::String, type: T.any(::RBI::Type, ::String), default: T.nilable(::String), loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::TStructProp).void) ).void end def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # - # @return [Boolean] + # @override # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#540 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:570 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/model.rb#1074 + # pkg:gem/rbi#lib/rbi/model.rb:1120 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#204 + # pkg:gem/rbi#lib/rbi/index.rb:204 sig { override.returns(T::Array[::String]) } def index_ids; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#1081 + # pkg:gem/rbi#lib/rbi/model.rb:1127 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#108 +# pkg:gem/rbi#lib/rbi/model.rb:120 class RBI::Tree < ::RBI::NodeWithComments - # : (?loc: Loc?, ?comments: Array[Comment]) ?{ (Tree node) -> void } -> void - # - # @return [Tree] a new instance of Tree - # - # source://rbi//lib/rbi/model.rb#113 + # pkg:gem/rbi#lib/rbi/model.rb:125 sig do params( loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::Tree).void) ).void end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node node) -> void - # - # source://rbi//lib/rbi/model.rb#120 + # pkg:gem/rbi#lib/rbi/model.rb:132 sig { params(node: ::RBI::Node).void } def <<(node); end - # : (?with_todo_comment: bool) -> void - # - # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#63 - sig { params(with_todo_comment: T::Boolean).void } - def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end - - # : (String annotation, ?annotate_scopes: bool, ?annotate_properties: bool) -> void - # - # source://rbi//lib/rbi/rewriters/annotate.rb#46 - sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void } - def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end - - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#38 - sig do - params( - name: ::String, - superclass_name: T.nilable(::String), - block: T.nilable(T.proc.params(scope: ::RBI::Scope).void) - ).returns(::RBI::Scope) - end - def create_class(name, superclass_name: T.unsafe(nil), &block); end - - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#45 - sig { params(name: ::String, value: ::String).void } - def create_constant(name, value:); end - - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#55 - sig { params(name: ::String).void } - def create_extend(name); end - - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#50 - sig { params(name: ::String).void } - def create_include(name); end - - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#90 - sig do - params( - name: ::String, - parameters: T::Array[::RBI::TypedParam], - return_type: T.nilable(::String), - class_method: T::Boolean, - visibility: ::RBI::Visibility, - comments: T::Array[::RBI::Comment], - block: T.nilable(T.proc.params(node: ::RBI::Method).void) - ).void - end - def create_method(name, parameters: T.unsafe(nil), return_type: T.unsafe(nil), class_method: T.unsafe(nil), visibility: T.unsafe(nil), comments: T.unsafe(nil), &block); end - - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#60 - sig { params(name: ::String).void } - def create_mixes_in_class_methods(name); end - - # source://tapioca/0.16.11/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.16.11/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.16.11/lib/tapioca/rbi_ext/model.rb#74 - sig do - params( - name: ::String, - type: ::String, - variance: ::Symbol, - fixed: T.nilable(::String), - upper: T.nilable(::String), - lower: T.nilable(::String) - ).void - end - def create_type_variable(name, type:, variance: T.unsafe(nil), fixed: T.unsafe(nil), upper: T.unsafe(nil), lower: T.unsafe(nil)); end - - # : (String annotation) -> void - # - # source://rbi//lib/rbi/rewriters/deannotate.rb#38 + # pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:63 + sig { params(with_todo_comment: T::Boolean).void } + def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rewriters/annotate.rb:46 + sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void } + def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rewriters/deannotate.rb:38 sig { params(annotation: ::String).void } def deannotate!(annotation); end - # : -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/model.rb#126 + # pkg:gem/rbi#lib/rbi/model.rb:138 sig { returns(T::Boolean) } def empty?; end - # : (Gem::Version version) -> void - # - # source://rbi//lib/rbi/rewriters/filter_versions.rb#113 + # pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:113 sig { params(version: ::Gem::Version).void } def filter_versions!(version); end - # : -> void - # - # source://rbi//lib/rbi/rewriters/flatten_singleton_methods.rb#58 + # pkg:gem/rbi#lib/rbi/rewriters/flatten_singleton_methods.rb:58 sig { void } def flatten_singleton_methods!; end - # : -> void - # - # source://rbi//lib/rbi/rewriters/flatten_visibilities.rb#57 + # pkg:gem/rbi#lib/rbi/rewriters/flatten_visibilities.rb:57 sig { void } def flatten_visibilities!; end - # : -> void - # - # source://rbi//lib/rbi/rewriters/group_nodes.rb#78 + # pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:80 sig { void } def group_nodes!; end - # : -> Index - # - # source://rbi//lib/rbi/index.rb#62 + # pkg:gem/rbi#lib/rbi/index.rb:62 sig { returns(::RBI::Index) } def index; end - # : (Tree other, ?left_name: String, ?right_name: String, ?keep: Rewriters::Merge::Keep) -> MergeTree - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#323 + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:336 sig do params( other: ::RBI::Tree, @@ -5151,95 +3953,59 @@ class RBI::Tree < ::RBI::NodeWithComments end def merge(other, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end - # : -> void - # - # source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#43 + # pkg:gem/rbi#lib/rbi/rewriters/nest_non_public_members.rb:52 sig { void } def nest_non_public_members!; end - # : -> void - # - # source://rbi//lib/rbi/rewriters/nest_singleton_methods.rb#33 + # pkg:gem/rbi#lib/rbi/rewriters/nest_singleton_methods.rb:41 sig { void } def nest_singleton_methods!; end - # : -> void - # - # source://rbi//lib/rbi/rewriters/nest_top_level_members.rb#60 + # pkg:gem/rbi#lib/rbi/rewriters/nest_top_level_members.rb:60 sig { void } def nest_top_level_members!; end - # : Array[Node] - # - # source://rbi//lib/rbi/model.rb#110 + # pkg:gem/rbi#lib/rbi/model.rb:122 sig { returns(T::Array[::RBI::Node]) } def nodes; end - # : -> void - # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#50 + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:50 sig { void } def replace_attributes_with_methods!; end - # : -> void - # - # source://rbi//lib/rbi/rewriters/sort_nodes.rb#118 + # pkg:gem/rbi#lib/rbi/rewriters/sort_nodes.rb:115 sig { void } def sort_nodes!; end - # : -> void - # - # source://rbi//lib/rbi/rewriters/translate_rbs_sigs.rb#82 + # pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:82 sig { void } def translate_rbs_sigs!; end - - private - - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#123 - sig { params(node: ::RBI::Node).returns(::RBI::Node) } - def create_node(node); end - - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#118 - sig { returns(T::Hash[::String, ::RBI::Node]) } - def nodes_cache; end end # The base class for all RBI types. -# # @abstract # -# source://rbi//lib/rbi/type.rb#7 +# pkg:gem/rbi#lib/rbi/type.rb:7 class RBI::Type abstract! - # : -> void - # - # @return [Type] a new instance of Type - # - # source://rbi//lib/rbi/type.rb#951 + # pkg:gem/rbi#lib/rbi/type.rb:993 sig { void } def initialize; end - # : (BasicObject) -> bool - # # @abstract - # @raise [NotImplementedError] # - # source://rbi//lib/rbi/type.rb#1022 + # pkg:gem/rbi#lib/rbi/type.rb:1064 sig { abstract.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : (BasicObject other) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/type.rb#1025 + # pkg:gem/rbi#lib/rbi/type.rb:1067 sig { params(other: ::BasicObject).returns(T::Boolean) } def eql?(other); end - # : -> Integer + # @override # - # source://rbi//lib/rbi/type.rb#1031 + # pkg:gem/rbi#lib/rbi/type.rb:1073 sig { override.returns(::Integer) } def hash; end @@ -5249,21 +4015,17 @@ class RBI::Type # ```ruby # type = RBI::Type.simple("String") # type.to_rbi # => "String" - # type.nilable.to_rbi # => "T.nilable(String)" - # type.nilable.nilable.to_rbi # => "T.nilable(String)" + # type.nilable.to_rbi # => "::T.nilable(String)" + # type.nilable.nilable.to_rbi # => "::T.nilable(String)" # ``` - # : -> Type # - # source://rbi//lib/rbi/type.rb#965 + # pkg:gem/rbi#lib/rbi/type.rb:1007 sig { returns(::RBI::Type) } def nilable; end # Returns whether the type is nilable. - # : -> bool # - # @return [Boolean] - # - # source://rbi//lib/rbi/type.rb#992 + # pkg:gem/rbi#lib/rbi/type.rb:1034 sig { returns(T::Boolean) } def nilable?; end @@ -5273,13 +4035,12 @@ class RBI::Type # # ```ruby # type = RBI::Type.nilable(RBI::Type.simple("String")) - # type.to_rbi # => "T.nilable(String)" + # type.to_rbi # => "::T.nilable(String)" # type.non_nilable.to_rbi # => "String" # type.non_nilable.non_nilable.to_rbi # => "String" # ``` - # : -> Type # - # source://rbi//lib/rbi/type.rb#980 + # pkg:gem/rbi#lib/rbi/type.rb:1022 sig { returns(::RBI::Type) } def non_nilable; end @@ -5291,18 +4052,13 @@ class RBI::Type # # This is the inverse of `#simplify`. # - # : -> Type - # # @abstract - # @raise [NotImplementedError] # - # source://rbi//lib/rbi/type.rb#1006 + # pkg:gem/rbi#lib/rbi/type.rb:1048 sig { abstract.returns(::RBI::Type) } def normalize; end - # : -> String - # - # source://rbi//lib/rbi/rbs_printer.rb#1242 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1266 sig { returns(::String) } def rbs_string; end @@ -5314,27 +4070,21 @@ class RBI::Type # # This is the inverse of `#normalize`. # - # : -> Type - # # @abstract - # @raise [NotImplementedError] # - # source://rbi//lib/rbi/type.rb#1018 + # pkg:gem/rbi#lib/rbi/type.rb:1060 sig { abstract.returns(::RBI::Type) } def simplify; end - # : -> String - # # @abstract - # @raise [NotImplementedError] # - # source://rbi//lib/rbi/type.rb#1037 + # pkg:gem/rbi#lib/rbi/type.rb:1079 sig { abstract.returns(::String) } def to_rbi; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#1041 + # pkg:gem/rbi#lib/rbi/type.rb:1083 sig { override.returns(::String) } def to_s; end @@ -5343,9 +4093,8 @@ class RBI::Type # # Note that this method transforms types such as `T.all(String, String)` into `String`, so # it may return something other than a `All`. - # : (Type type1, Type type2, *Type types) -> Type # - # source://rbi//lib/rbi/type.rb#887 + # pkg:gem/rbi#lib/rbi/type.rb:929 sig { params(type1: ::RBI::Type, type2: ::RBI::Type, types: ::RBI::Type).returns(::RBI::Type) } def all(type1, type2, *types); end @@ -5353,44 +4102,38 @@ class RBI::Type # # Note that this method transforms types such as `T.any(String, NilClass)` into `T.nilable(String)`, so # it may return something other than a `Any`. - # : (Type type1, Type type2, *Type types) -> Type # - # source://rbi//lib/rbi/type.rb#896 + # pkg:gem/rbi#lib/rbi/type.rb:938 sig { params(type1: ::RBI::Type, type2: ::RBI::Type, types: ::RBI::Type).returns(::RBI::Type) } def any(type1, type2, *types); end # Builds a type that represents `T.anything`. - # : -> Anything # - # source://rbi//lib/rbi/type.rb#818 + # pkg:gem/rbi#lib/rbi/type.rb:854 sig { returns(::RBI::Type::Anything) } def anything; end # Builds a type that represents `T.attached_class`. - # : -> AttachedClass # - # source://rbi//lib/rbi/type.rb#824 + # pkg:gem/rbi#lib/rbi/type.rb:860 sig { returns(::RBI::Type::AttachedClass) } def attached_class; end # Builds a type that represents `T::Boolean`. - # : -> Boolean # - # source://rbi//lib/rbi/type.rb#830 + # pkg:gem/rbi#lib/rbi/type.rb:866 sig { returns(::RBI::Type::Boolean) } def boolean; end # Builds a type that represents the singleton class of another type like `T.class_of(Foo)`. - # : (Simple type, ?Type? type_parameter) -> ClassOf # - # source://rbi//lib/rbi/type.rb#868 + # pkg:gem/rbi#lib/rbi/type.rb:910 sig { params(type: ::RBI::Type::Simple, type_parameter: T.nilable(::RBI::Type)).returns(::RBI::Type::ClassOf) } def class_of(type, type_parameter = T.unsafe(nil)); end # Builds a type that represents a generic type like `T::Array[String]` or `T::Hash[Symbol, Integer]`. - # : (String name, *(Type | Array[Type]) params) -> Generic # - # source://rbi//lib/rbi/type.rb#904 + # pkg:gem/rbi#lib/rbi/type.rb:946 sig { params(name: ::String, params: T.any(::RBI::Type, T::Array[::RBI::Type])).returns(::RBI::Type::Generic) } def generic(name, *params); end @@ -5398,220 +4141,160 @@ class RBI::Type # # Note that this method transforms types such as `T.nilable(T.untyped)` into `T.untyped`, so # it may return something other than a `RBI::Type::Nilable`. - # : (Type type) -> Type # - # source://rbi//lib/rbi/type.rb#877 + # pkg:gem/rbi#lib/rbi/type.rb:919 sig { params(type: ::RBI::Type).returns(::RBI::Type) } def nilable(type); end # Builds a type that represents `T.noreturn`. - # : -> NoReturn # - # source://rbi//lib/rbi/type.rb#836 + # pkg:gem/rbi#lib/rbi/type.rb:872 sig { returns(::RBI::Type::NoReturn) } def noreturn; end - # : (Prism::Node node) -> Type - # - # source://rbi//lib/rbi/type_parser.rb#26 + # pkg:gem/rbi#lib/rbi/type_parser.rb:26 sig { params(node: ::Prism::Node).returns(::RBI::Type) } def parse_node(node); end - # : (String string) -> Type - # - # @raise [Error] - # - # source://rbi//lib/rbi/type_parser.rb#10 + # pkg:gem/rbi#lib/rbi/type_parser.rb:10 sig { params(string: ::String).returns(::RBI::Type) } def parse_string(string); end # Builds a type that represents a proc type like `T.proc.void`. - # : -> Proc # - # source://rbi//lib/rbi/type.rb#938 + # pkg:gem/rbi#lib/rbi/type.rb:980 sig { returns(::RBI::Type::Proc) } def proc; end # Builds a type that represents `T.self_type`. - # : -> SelfType # - # source://rbi//lib/rbi/type.rb#842 + # pkg:gem/rbi#lib/rbi/type.rb:878 sig { returns(::RBI::Type::SelfType) } def self_type; end # Builds a type that represents a shape type like `{name: String, age: Integer}`. - # : (?Hash[(String | Symbol), Type] types) -> Shape # - # source://rbi//lib/rbi/type.rb#930 + # pkg:gem/rbi#lib/rbi/type.rb:972 sig { params(types: T::Hash[T.any(::String, ::Symbol), ::RBI::Type]).returns(::RBI::Type::Shape) } def shape(types = T.unsafe(nil)); end # Builds a simple type like `String` or `::Foo::Bar`. # # It raises a `NameError` if the name is not a valid Ruby class identifier. - # : (String name) -> Simple # - # @raise [NameError] - # - # source://rbi//lib/rbi/type.rb#807 + # pkg:gem/rbi#lib/rbi/type.rb:843 sig { params(name: ::String).returns(::RBI::Type::Simple) } def simple(name); end # Builds a type that represents the class of another type like `T::Class[Foo]`. - # : (Type type) -> Class # - # source://rbi//lib/rbi/type.rb#862 + # pkg:gem/rbi#lib/rbi/type.rb:898 sig { params(type: ::RBI::Type).returns(::RBI::Type::Class) } def t_class(type); end + # Builds a type that represents the module of another type like `T::Module[Foo]`. + # + # pkg:gem/rbi#lib/rbi/type.rb:904 + sig { params(type: ::RBI::Type).returns(::RBI::Type::Module) } + def t_module(type); end + # Builds a type that represents a tuple type like `[String, Integer]`. - # : (*(Type | Array[Type]) types) -> Tuple # - # source://rbi//lib/rbi/type.rb#924 + # pkg:gem/rbi#lib/rbi/type.rb:966 sig { params(types: T.any(::RBI::Type, T::Array[::RBI::Type])).returns(::RBI::Type::Tuple) } def tuple(*types); end # Builds a type that represents a type alias like `MyTypeAlias`. - # : (String name, Type aliased_type) -> TypeAlias # - # source://rbi//lib/rbi/type.rb#916 + # pkg:gem/rbi#lib/rbi/type.rb:958 sig { params(name: ::String, aliased_type: ::RBI::Type).returns(::RBI::Type::TypeAlias) } def type_alias(name, aliased_type); end # Builds a type that represents a type parameter like `T.type_parameter(:U)`. - # : (Symbol name) -> TypeParameter # - # source://rbi//lib/rbi/type.rb#910 + # pkg:gem/rbi#lib/rbi/type.rb:952 sig { params(name: ::Symbol).returns(::RBI::Type::TypeParameter) } def type_parameter(name); end # Builds a type that represents `T.untyped`. - # : -> Untyped # - # source://rbi//lib/rbi/type.rb#848 + # pkg:gem/rbi#lib/rbi/type.rb:884 sig { returns(::RBI::Type::Untyped) } def untyped; end # Builds a type that represents `void`. - # : -> Void # - # source://rbi//lib/rbi/type.rb#854 + # pkg:gem/rbi#lib/rbi/type.rb:890 sig { returns(::RBI::Type::Void) } def void; end private - # : (Prism::CallNode node) -> Array[Prism::Node] - # - # source://rbi//lib/rbi/type_parser.rb#314 + # pkg:gem/rbi#lib/rbi/type_parser.rb:322 sig { params(node: ::Prism::CallNode).returns(T::Array[::Prism::Node]) } def call_chain(node); end - # : (Prism::CallNode node, Integer count) -> Array[Prism::Node] - # - # source://rbi//lib/rbi/type_parser.rb#301 + # pkg:gem/rbi#lib/rbi/type_parser.rb:309 sig { params(node: ::Prism::CallNode, count: ::Integer).returns(T::Array[::Prism::Node]) } def check_arguments_at_least!(node, count); end - # : (Prism::CallNode node, Integer count) -> Array[Prism::Node] - # - # source://rbi//lib/rbi/type_parser.rb#286 + # pkg:gem/rbi#lib/rbi/type_parser.rb:294 sig { params(node: ::Prism::CallNode, count: ::Integer).returns(T::Array[::Prism::Node]) } def check_arguments_exactly!(node, count); end - # : (Prism::CallNode node) -> Type - # - # @raise [Error] - # - # source://rbi//lib/rbi/type_parser.rb#96 + # pkg:gem/rbi#lib/rbi/type_parser.rb:96 sig { params(node: ::Prism::CallNode).returns(::RBI::Type) } def parse_call(node); end - # : ((Prism::ConstantReadNode | Prism::ConstantPathNode) node) -> Type - # - # source://rbi//lib/rbi/type_parser.rb#56 + # pkg:gem/rbi#lib/rbi/type_parser.rb:56 sig { params(node: T.any(::Prism::ConstantPathNode, ::Prism::ConstantReadNode)).returns(::RBI::Type) } def parse_constant(node); end - # : (Prism::ConstantWriteNode | Prism::ConstantPathWriteNode node) -> Type - # - # source://rbi//lib/rbi/type_parser.rb#73 + # pkg:gem/rbi#lib/rbi/type_parser.rb:73 sig { params(node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode)).returns(::RBI::Type) } def parse_constant_assignment(node); end - # : (Prism::CallNode node) -> Type - # - # @raise [Error] - # - # source://rbi//lib/rbi/type_parser.rb#236 + # pkg:gem/rbi#lib/rbi/type_parser.rb:244 sig { params(node: ::Prism::CallNode).returns(::RBI::Type) } def parse_proc(node); end - # : ((Prism::HashNode | Prism::KeywordHashNode) node) -> Type - # - # source://rbi//lib/rbi/type_parser.rb#215 + # pkg:gem/rbi#lib/rbi/type_parser.rb:223 sig { params(node: T.any(::Prism::HashNode, ::Prism::KeywordHashNode)).returns(::RBI::Type) } def parse_shape(node); end - # : (Prism::ArrayNode node) -> Type - # - # source://rbi//lib/rbi/type_parser.rb#210 + # pkg:gem/rbi#lib/rbi/type_parser.rb:218 sig { params(node: ::Prism::ArrayNode).returns(::RBI::Type) } def parse_tuple(node); end - # : (Prism::Node? node) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/type_parser.rb#327 + # pkg:gem/rbi#lib/rbi/type_parser.rb:335 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def t?(node); end - # : (Prism::Node? node) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/type_parser.rb#346 + # pkg:gem/rbi#lib/rbi/type_parser.rb:354 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def t_boolean?(node); end - # : (Prism::ConstantPathNode node) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/type_parser.rb#353 + # pkg:gem/rbi#lib/rbi/type_parser.rb:361 sig { params(node: ::Prism::ConstantPathNode).returns(T::Boolean) } def t_class?(node); end - # : (Prism::Node? node) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/type_parser.rb#358 + # pkg:gem/rbi#lib/rbi/type_parser.rb:371 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def t_class_of?(node); end - # : (Prism::CallNode node) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/type_parser.rb#365 + # pkg:gem/rbi#lib/rbi/type_parser.rb:366 + sig { params(node: ::Prism::ConstantPathNode).returns(T::Boolean) } + def t_module?(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:378 sig { params(node: ::Prism::CallNode).returns(T::Boolean) } def t_proc?(node); end - # : (Prism::Node? node) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/type_parser.rb#339 + # pkg:gem/rbi#lib/rbi/type_parser.rb:347 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def t_type_alias?(node); end - # : (String name) -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/type.rb#945 + # pkg:gem/rbi#lib/rbi/type.rb:987 sig { params(name: ::String).returns(T::Boolean) } def valid_identifier?(name); end end @@ -5619,537 +4302,511 @@ end # A type that is intersection of multiple types like `T.all(String, Integer)`. # -# source://rbi//lib/rbi/type.rb#384 +# pkg:gem/rbi#lib/rbi/type.rb:420 class RBI::Type::All < ::RBI::Type::Composite - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#393 + # pkg:gem/rbi#lib/rbi/type.rb:429 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#413 + # pkg:gem/rbi#lib/rbi/type.rb:449 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#387 + # pkg:gem/rbi#lib/rbi/type.rb:423 sig { override.returns(::String) } def to_rbi; end end # A type that is union of multiple types like `T.any(String, Integer)`. # -# source://rbi//lib/rbi/type.rb#426 +# pkg:gem/rbi#lib/rbi/type.rb:462 class RBI::Type::Any < ::RBI::Type::Composite - # : -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/type.rb#434 + # pkg:gem/rbi#lib/rbi/type.rb:470 sig { returns(T::Boolean) } def nilable?; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#440 + # pkg:gem/rbi#lib/rbi/type.rb:476 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#460 + # pkg:gem/rbi#lib/rbi/type.rb:496 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#429 + # pkg:gem/rbi#lib/rbi/type.rb:465 sig { override.returns(::String) } def to_rbi; end end # `T.anything`. # -# source://rbi//lib/rbi/type.rb#51 +# pkg:gem/rbi#lib/rbi/type.rb:51 class RBI::Type::Anything < ::RBI::Type - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#54 + # pkg:gem/rbi#lib/rbi/type.rb:54 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#66 + # pkg:gem/rbi#lib/rbi/type.rb:66 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#72 + # pkg:gem/rbi#lib/rbi/type.rb:72 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#60 + # pkg:gem/rbi#lib/rbi/type.rb:60 sig { override.returns(::String) } def to_rbi; end end # `T.attached_class`. # -# source://rbi//lib/rbi/type.rb#78 +# pkg:gem/rbi#lib/rbi/type.rb:78 class RBI::Type::AttachedClass < ::RBI::Type - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#81 + # pkg:gem/rbi#lib/rbi/type.rb:81 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#93 + # pkg:gem/rbi#lib/rbi/type.rb:93 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#99 + # pkg:gem/rbi#lib/rbi/type.rb:99 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#87 + # pkg:gem/rbi#lib/rbi/type.rb:87 sig { override.returns(::String) } def to_rbi; end end # `T::Boolean`. # -# source://rbi//lib/rbi/type.rb#105 +# pkg:gem/rbi#lib/rbi/type.rb:105 class RBI::Type::Boolean < ::RBI::Type - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#108 + # pkg:gem/rbi#lib/rbi/type.rb:108 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#120 + # pkg:gem/rbi#lib/rbi/type.rb:120 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#126 + # pkg:gem/rbi#lib/rbi/type.rb:126 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#114 + # pkg:gem/rbi#lib/rbi/type.rb:114 sig { override.returns(::String) } def to_rbi; end end # The class of another type like `T::Class[Foo]`. # -# source://rbi//lib/rbi/type.rb#242 +# pkg:gem/rbi#lib/rbi/type.rb:242 class RBI::Type::Class < ::RBI::Type - # : (Type type) -> void - # - # @return [Class] a new instance of Class - # - # source://rbi//lib/rbi/type.rb#247 + # pkg:gem/rbi#lib/rbi/type.rb:247 sig { params(type: ::RBI::Type).void } def initialize(type); end - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#254 + # pkg:gem/rbi#lib/rbi/type.rb:254 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#266 + # pkg:gem/rbi#lib/rbi/type.rb:266 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#272 + # pkg:gem/rbi#lib/rbi/type.rb:272 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#260 + # pkg:gem/rbi#lib/rbi/type.rb:260 sig { override.returns(::String) } def to_rbi; end - # : Type - # - # source://rbi//lib/rbi/type.rb#244 + # pkg:gem/rbi#lib/rbi/type.rb:244 sig { returns(::RBI::Type) } def type; end end # The singleton class of another type like `T.class_of(Foo)`. # -# source://rbi//lib/rbi/type.rb#278 +# pkg:gem/rbi#lib/rbi/type.rb:314 class RBI::Type::ClassOf < ::RBI::Type - # : (Simple type, ?Type? type_parameter) -> void - # - # @return [ClassOf] a new instance of ClassOf - # - # source://rbi//lib/rbi/type.rb#286 + # pkg:gem/rbi#lib/rbi/type.rb:322 sig { params(type: ::RBI::Type::Simple, type_parameter: T.nilable(::RBI::Type)).void } def initialize(type, type_parameter = T.unsafe(nil)); end - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#294 + # pkg:gem/rbi#lib/rbi/type.rb:330 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#310 + # pkg:gem/rbi#lib/rbi/type.rb:346 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#316 + # pkg:gem/rbi#lib/rbi/type.rb:352 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#300 + # pkg:gem/rbi#lib/rbi/type.rb:336 sig { override.returns(::String) } def to_rbi; end - # : Simple - # - # source://rbi//lib/rbi/type.rb#280 + # pkg:gem/rbi#lib/rbi/type.rb:316 sig { returns(::RBI::Type::Simple) } def type; end - # : Type? - # - # source://rbi//lib/rbi/type.rb#283 + # pkg:gem/rbi#lib/rbi/type.rb:319 sig { returns(T.nilable(::RBI::Type)) } def type_parameter; end end # A type that is composed of multiple types like `T.all(String, Integer)`. -# # @abstract # -# source://rbi//lib/rbi/type.rb#366 +# pkg:gem/rbi#lib/rbi/type.rb:402 class RBI::Type::Composite < ::RBI::Type abstract! - # : (Array[Type] types) -> void - # - # @return [Composite] a new instance of Composite - # - # source://rbi//lib/rbi/type.rb#371 + # pkg:gem/rbi#lib/rbi/type.rb:407 sig { params(types: T::Array[::RBI::Type]).void } def initialize(types); end - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#378 + # pkg:gem/rbi#lib/rbi/type.rb:414 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : Array[Type] - # - # source://rbi//lib/rbi/type.rb#368 + # pkg:gem/rbi#lib/rbi/type.rb:404 sig { returns(T::Array[::RBI::Type]) } def types; end end -# source://rbi//lib/rbi/type_parser.rb#6 +# pkg:gem/rbi#lib/rbi/type_parser.rb:6 class RBI::Type::Error < ::RBI::Error; end # A generic type like `T::Array[String]` or `T::Hash[Symbol, Integer]`. # -# source://rbi//lib/rbi/type.rb#511 +# pkg:gem/rbi#lib/rbi/type.rb:547 class RBI::Type::Generic < ::RBI::Type - # : (String name, *Type params) -> void - # - # @return [Generic] a new instance of Generic - # - # source://rbi//lib/rbi/type.rb#519 + # pkg:gem/rbi#lib/rbi/type.rb:555 sig { params(name: ::String, params: ::RBI::Type).void } def initialize(name, *params); end - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#527 + # pkg:gem/rbi#lib/rbi/type.rb:563 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : String - # - # source://rbi//lib/rbi/type.rb#513 + # pkg:gem/rbi#lib/rbi/type.rb:549 sig { returns(::String) } def name; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#539 + # pkg:gem/rbi#lib/rbi/type.rb:575 sig { override.returns(::RBI::Type) } def normalize; end - # : Array[Type] - # - # source://rbi//lib/rbi/type.rb#516 + # pkg:gem/rbi#lib/rbi/type.rb:552 sig { returns(T::Array[::RBI::Type]) } def params; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#545 + # pkg:gem/rbi#lib/rbi/type.rb:581 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#533 + # pkg:gem/rbi#lib/rbi/type.rb:569 sig { override.returns(::String) } def to_rbi; end end -# A type that can be `nil` like `T.nilable(String)`. +# The module of another type like `T::Module[Foo]`. # -# source://rbi//lib/rbi/type.rb#322 -class RBI::Type::Nilable < ::RBI::Type - # : (Type type) -> void +# pkg:gem/rbi#lib/rbi/type.rb:278 +class RBI::Type::Module < ::RBI::Type + # pkg:gem/rbi#lib/rbi/type.rb:283 + sig { params(type: ::RBI::Type).void } + def initialize(type); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:290 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # @override # - # @return [Nilable] a new instance of Nilable + # pkg:gem/rbi#lib/rbi/type.rb:302 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:308 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override # - # source://rbi//lib/rbi/type.rb#327 + # pkg:gem/rbi#lib/rbi/type.rb:296 + sig { override.returns(::String) } + def to_rbi; end + + # pkg:gem/rbi#lib/rbi/type.rb:280 + sig { returns(::RBI::Type) } + def type; end +end + +# A type that can be `nil` like `T.nilable(String)`. +# +# pkg:gem/rbi#lib/rbi/type.rb:358 +class RBI::Type::Nilable < ::RBI::Type + # pkg:gem/rbi#lib/rbi/type.rb:363 sig { params(type: ::RBI::Type).void } def initialize(type); end - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#334 + # pkg:gem/rbi#lib/rbi/type.rb:370 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#346 + # pkg:gem/rbi#lib/rbi/type.rb:382 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#352 + # pkg:gem/rbi#lib/rbi/type.rb:388 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#340 + # pkg:gem/rbi#lib/rbi/type.rb:376 sig { override.returns(::String) } def to_rbi; end - # : Type - # - # source://rbi//lib/rbi/type.rb#324 + # pkg:gem/rbi#lib/rbi/type.rb:360 sig { returns(::RBI::Type) } def type; end end # `T.noreturn`. # -# source://rbi//lib/rbi/type.rb#132 +# pkg:gem/rbi#lib/rbi/type.rb:132 class RBI::Type::NoReturn < ::RBI::Type - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#135 + # pkg:gem/rbi#lib/rbi/type.rb:135 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#147 + # pkg:gem/rbi#lib/rbi/type.rb:147 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#153 + # pkg:gem/rbi#lib/rbi/type.rb:153 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#141 + # pkg:gem/rbi#lib/rbi/type.rb:141 sig { override.returns(::String) } def to_rbi; end end # A proc type like `T.proc.void`. # -# source://rbi//lib/rbi/type.rb#707 +# pkg:gem/rbi#lib/rbi/type.rb:743 class RBI::Type::Proc < ::RBI::Type - # : -> void - # - # @return [Proc] a new instance of Proc - # - # source://rbi//lib/rbi/type.rb#718 + # pkg:gem/rbi#lib/rbi/type.rb:754 sig { void } def initialize; end - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#727 + # pkg:gem/rbi#lib/rbi/type.rb:763 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : (untyped type) -> self - # - # source://rbi//lib/rbi/type.rb#755 + # pkg:gem/rbi#lib/rbi/type.rb:791 sig { params(type: T.untyped).returns(T.self_type) } def bind(type); end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#787 + # pkg:gem/rbi#lib/rbi/type.rb:823 sig { override.returns(::RBI::Type) } def normalize; end - # : (**Type params) -> self - # - # source://rbi//lib/rbi/type.rb#737 + # pkg:gem/rbi#lib/rbi/type.rb:773 sig { params(params: ::RBI::Type).returns(T.self_type) } def params(**params); end - # : Type? - # - # source://rbi//lib/rbi/type.rb#715 + # pkg:gem/rbi#lib/rbi/type.rb:751 sig { returns(T.nilable(::RBI::Type)) } def proc_bind; end - # : Hash[Symbol, Type] - # - # source://rbi//lib/rbi/type.rb#709 + # pkg:gem/rbi#lib/rbi/type.rb:745 sig { returns(T::Hash[::Symbol, ::RBI::Type]) } def proc_params; end - # : Type - # - # source://rbi//lib/rbi/type.rb#712 + # pkg:gem/rbi#lib/rbi/type.rb:748 sig { returns(::RBI::Type) } def proc_returns; end - # : (untyped type) -> self - # - # source://rbi//lib/rbi/type.rb#743 + # pkg:gem/rbi#lib/rbi/type.rb:779 sig { params(type: T.untyped).returns(T.self_type) } def returns(type); end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#793 + # pkg:gem/rbi#lib/rbi/type.rb:829 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#762 + # pkg:gem/rbi#lib/rbi/type.rb:798 sig { override.returns(::String) } def to_rbi; end - # : -> self - # - # source://rbi//lib/rbi/type.rb#749 + # pkg:gem/rbi#lib/rbi/type.rb:785 sig { returns(T.self_type) } def void; end end # `T.self_type`. # -# source://rbi//lib/rbi/type.rb#159 +# pkg:gem/rbi#lib/rbi/type.rb:159 class RBI::Type::SelfType < ::RBI::Type - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#162 + # pkg:gem/rbi#lib/rbi/type.rb:162 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#174 + # pkg:gem/rbi#lib/rbi/type.rb:174 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#180 + # pkg:gem/rbi#lib/rbi/type.rb:180 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#168 + # pkg:gem/rbi#lib/rbi/type.rb:168 sig { override.returns(::String) } def to_rbi; end end # A shape type like `{name: String, age: Integer}`. # -# source://rbi//lib/rbi/type.rb#665 +# pkg:gem/rbi#lib/rbi/type.rb:701 class RBI::Type::Shape < ::RBI::Type - # : (Hash[(String | Symbol), Type] types) -> void - # - # @return [Shape] a new instance of Shape - # - # source://rbi//lib/rbi/type.rb#670 + # pkg:gem/rbi#lib/rbi/type.rb:706 sig { params(types: T::Hash[T.any(::String, ::Symbol), ::RBI::Type]).void } def initialize(types); end - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#677 + # pkg:gem/rbi#lib/rbi/type.rb:713 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#693 + # pkg:gem/rbi#lib/rbi/type.rb:729 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#699 + # pkg:gem/rbi#lib/rbi/type.rb:735 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#683 + # pkg:gem/rbi#lib/rbi/type.rb:719 sig { override.returns(::String) } def to_rbi; end - # : Hash[(String | Symbol), Type] - # - # source://rbi//lib/rbi/type.rb#667 + # pkg:gem/rbi#lib/rbi/type.rb:703 sig { returns(T::Hash[T.any(::String, ::Symbol), ::RBI::Type]) } def types; end end @@ -6158,958 +4815,706 @@ end # # It can also be a qualified name like `::Foo` or `Foo::Bar`. # -# source://rbi//lib/rbi/type.rb#13 +# pkg:gem/rbi#lib/rbi/type.rb:13 class RBI::Type::Simple < ::RBI::Type - # : (String name) -> void - # - # @return [Simple] a new instance of Simple - # - # source://rbi//lib/rbi/type.rb#18 + # pkg:gem/rbi#lib/rbi/type.rb:18 sig { params(name: ::String).void } def initialize(name); end - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#25 + # pkg:gem/rbi#lib/rbi/type.rb:25 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : String - # - # source://rbi//lib/rbi/type.rb#15 + # pkg:gem/rbi#lib/rbi/type.rb:15 sig { returns(::String) } def name; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#37 + # pkg:gem/rbi#lib/rbi/type.rb:37 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#43 + # pkg:gem/rbi#lib/rbi/type.rb:43 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#31 + # pkg:gem/rbi#lib/rbi/type.rb:31 sig { override.returns(::String) } def to_rbi; end end # A tuple type like `[String, Integer]`. # -# source://rbi//lib/rbi/type.rb#629 +# pkg:gem/rbi#lib/rbi/type.rb:665 class RBI::Type::Tuple < ::RBI::Type - # : (Array[Type] types) -> void - # - # @return [Tuple] a new instance of Tuple - # - # source://rbi//lib/rbi/type.rb#634 + # pkg:gem/rbi#lib/rbi/type.rb:670 sig { params(types: T::Array[::RBI::Type]).void } def initialize(types); end - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#641 + # pkg:gem/rbi#lib/rbi/type.rb:677 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#653 + # pkg:gem/rbi#lib/rbi/type.rb:689 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#659 + # pkg:gem/rbi#lib/rbi/type.rb:695 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#647 + # pkg:gem/rbi#lib/rbi/type.rb:683 sig { override.returns(::String) } def to_rbi; end - # : Array[Type] - # - # source://rbi//lib/rbi/type.rb#631 + # pkg:gem/rbi#lib/rbi/type.rb:667 sig { returns(T::Array[::RBI::Type]) } def types; end end # A type alias that references another type by name like `MyTypeAlias`. # -# source://rbi//lib/rbi/type.rb#587 +# pkg:gem/rbi#lib/rbi/type.rb:623 class RBI::Type::TypeAlias < ::RBI::Type - # : (String name, Type aliased_type) -> void - # - # @return [TypeAlias] a new instance of TypeAlias - # - # source://rbi//lib/rbi/type.rb#595 + # pkg:gem/rbi#lib/rbi/type.rb:631 sig { params(name: ::String, aliased_type: ::RBI::Type).void } def initialize(name, aliased_type); end - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#603 + # pkg:gem/rbi#lib/rbi/type.rb:639 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : Type - # - # source://rbi//lib/rbi/type.rb#592 + # pkg:gem/rbi#lib/rbi/type.rb:628 sig { returns(::RBI::Type) } def aliased_type; end - # : String - # - # source://rbi//lib/rbi/type.rb#589 + # pkg:gem/rbi#lib/rbi/type.rb:625 sig { returns(::String) } def name; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#615 + # pkg:gem/rbi#lib/rbi/type.rb:651 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#621 + # pkg:gem/rbi#lib/rbi/type.rb:657 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#609 + # pkg:gem/rbi#lib/rbi/type.rb:645 sig { override.returns(::String) } def to_rbi; end end # A type parameter like `T.type_parameter(:U)`. # -# source://rbi//lib/rbi/type.rb#551 +# pkg:gem/rbi#lib/rbi/type.rb:587 class RBI::Type::TypeParameter < ::RBI::Type - # : (Symbol name) -> void - # - # @return [TypeParameter] a new instance of TypeParameter - # - # source://rbi//lib/rbi/type.rb#556 + # pkg:gem/rbi#lib/rbi/type.rb:592 sig { params(name: ::Symbol).void } def initialize(name); end - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#563 + # pkg:gem/rbi#lib/rbi/type.rb:599 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : Symbol - # - # source://rbi//lib/rbi/type.rb#553 + # pkg:gem/rbi#lib/rbi/type.rb:589 sig { returns(::Symbol) } def name; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#575 + # pkg:gem/rbi#lib/rbi/type.rb:611 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#581 + # pkg:gem/rbi#lib/rbi/type.rb:617 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#569 + # pkg:gem/rbi#lib/rbi/type.rb:605 sig { override.returns(::String) } def to_rbi; end end # `T.untyped`. # -# source://rbi//lib/rbi/type.rb#186 +# pkg:gem/rbi#lib/rbi/type.rb:186 class RBI::Type::Untyped < ::RBI::Type - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#189 + # pkg:gem/rbi#lib/rbi/type.rb:189 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#201 + # pkg:gem/rbi#lib/rbi/type.rb:201 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#207 + # pkg:gem/rbi#lib/rbi/type.rb:207 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#195 + # pkg:gem/rbi#lib/rbi/type.rb:195 sig { override.returns(::String) } def to_rbi; end end -# source://rbi//lib/rbi/type_visitor.rb#6 +# pkg:gem/rbi#lib/rbi/type_visitor.rb:6 class RBI::Type::Visitor - # : (Type node) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#10 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:10 sig { params(node: ::RBI::Type).void } def visit(node); end private - # : (Type::All type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#58 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:58 sig { params(type: ::RBI::Type::All).void } def visit_all(type); end - # : (Type::Any type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#61 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:61 sig { params(type: ::RBI::Type::Any).void } def visit_any(type); end - # : (Type::Anything type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#64 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:64 sig { params(type: ::RBI::Type::Anything).void } def visit_anything(type); end - # : (Type::AttachedClass type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#67 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:67 sig { params(type: ::RBI::Type::AttachedClass).void } def visit_attached_class(type); end - # : (Type::Boolean type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#70 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:70 sig { params(type: ::RBI::Type::Boolean).void } def visit_boolean(type); end - # : (Type::Class type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#73 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:73 sig { params(type: ::RBI::Type::Class).void } def visit_class(type); end - # : (Type::ClassOf type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#76 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:76 sig { params(type: ::RBI::Type::ClassOf).void } def visit_class_of(type); end - # : (Type::Generic type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#79 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:79 sig { params(type: ::RBI::Type::Generic).void } def visit_generic(type); end - # : (Type::Nilable type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#82 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:82 sig { params(type: ::RBI::Type::Nilable).void } def visit_nilable(type); end - # : (Type::NoReturn type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#88 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:88 sig { params(type: ::RBI::Type::NoReturn).void } def visit_no_return(type); end - # : (Type::Proc type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#91 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:91 sig { params(type: ::RBI::Type::Proc).void } def visit_proc(type); end - # : (Type::SelfType type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#94 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:94 sig { params(type: ::RBI::Type::SelfType).void } def visit_self_type(type); end - # : (Type::Shape type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#100 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:100 sig { params(type: ::RBI::Type::Shape).void } def visit_shape(type); end - # : (Type::Simple type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#85 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:85 sig { params(type: ::RBI::Type::Simple).void } def visit_simple(type); end - # : (Type::Tuple type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#103 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:103 sig { params(type: ::RBI::Type::Tuple).void } def visit_tuple(type); end - # : (Type::TypeAlias type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#112 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:112 sig { params(type: ::RBI::Type::TypeAlias).void } def visit_type_alias(type); end - # : (Type::TypeParameter type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#106 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:106 sig { params(type: ::RBI::Type::TypeParameter).void } def visit_type_parameter(type); end - # : (Type::Untyped type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#109 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:109 sig { params(type: ::RBI::Type::Untyped).void } def visit_untyped(type); end - # : (Type::Void type) -> void - # - # source://rbi//lib/rbi/type_visitor.rb#97 + # pkg:gem/rbi#lib/rbi/type_visitor.rb:97 sig { params(type: ::RBI::Type::Void).void } def visit_void(type); end end -# source://rbi//lib/rbi/type_visitor.rb#7 +# pkg:gem/rbi#lib/rbi/type_visitor.rb:7 class RBI::Type::Visitor::Error < ::RBI::Error; end # `void`. # -# source://rbi//lib/rbi/type.rb#213 +# pkg:gem/rbi#lib/rbi/type.rb:213 class RBI::Type::Void < ::RBI::Type - # : (BasicObject other) -> bool + # @override # - # source://rbi//lib/rbi/type.rb#216 + # pkg:gem/rbi#lib/rbi/type.rb:216 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#228 + # pkg:gem/rbi#lib/rbi/type.rb:228 sig { override.returns(::RBI::Type) } def normalize; end - # : -> Type + # @override # - # source://rbi//lib/rbi/type.rb#234 + # pkg:gem/rbi#lib/rbi/type.rb:234 sig { override.returns(::RBI::Type) } def simplify; end - # : -> String + # @override # - # source://rbi//lib/rbi/type.rb#222 + # pkg:gem/rbi#lib/rbi/type.rb:222 sig { override.returns(::String) } def to_rbi; end end -# source://rbi//lib/rbi/model.rb#1159 +# pkg:gem/rbi#lib/rbi/model.rb:1205 class RBI::TypeMember < ::RBI::NodeWithComments include ::RBI::Indexable - # : (String name, String value, ?loc: Loc?, ?comments: Array[Comment]) ?{ (TypeMember node) -> void } -> void - # - # @return [TypeMember] a new instance of TypeMember - # - # source://rbi//lib/rbi/model.rb#1164 + # pkg:gem/rbi#lib/rbi/model.rb:1210 sig do params( name: ::String, value: ::String, loc: T.nilable(::RBI::Loc), - comments: T::Array[::RBI::Comment], + comments: T.nilable(T::Array[::RBI::Comment]), block: T.nilable(T.proc.params(node: ::RBI::TypeMember).void) ).void end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#1172 + # pkg:gem/rbi#lib/rbi/model.rb:1218 sig { returns(::String) } def fully_qualified_name; end - # : -> Array[String] + # @override # - # source://rbi//lib/rbi/index.rb#174 + # pkg:gem/rbi#lib/rbi/index.rb:174 sig { override.returns(T::Array[::String]) } def index_ids; end - # : String - # - # source://rbi//lib/rbi/model.rb#1161 + # pkg:gem/rbi#lib/rbi/model.rb:1207 sig { returns(::String) } def name; end - # : -> String + # @override # - # source://rbi//lib/rbi/model.rb#1180 + # pkg:gem/rbi#lib/rbi/model.rb:1226 sig { override.returns(::String) } def to_s; end - # : String - # - # source://rbi//lib/rbi/model.rb#1161 + # pkg:gem/rbi#lib/rbi/model.rb:1207 def value; end end -# source://rbi//lib/rbi/rbs_printer.rb#984 +# pkg:gem/rbi#lib/rbi/rbs_printer.rb:984 class RBI::TypePrinter - # : (?max_line_length: Integer?) -> void - # - # @return [TypePrinter] a new instance of TypePrinter - # - # source://rbi//lib/rbi/rbs_printer.rb#989 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:989 sig { params(max_line_length: T.nilable(::Integer)).void } def initialize(max_line_length: T.unsafe(nil)); end - # : String - # - # source://rbi//lib/rbi/rbs_printer.rb#986 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:986 sig { returns(::String) } def string; end - # : (Type node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#995 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:995 sig { params(node: ::RBI::Type).void } def visit(node); end - # : (Type::All type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1110 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1117 sig { params(type: ::RBI::Type::All).void } def visit_all(type); end - # : (Type::Any type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1120 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1127 sig { params(type: ::RBI::Type::Any).void } def visit_any(type); end - # : (Type::Anything type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1060 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1062 sig { params(type: ::RBI::Type::Anything).void } def visit_anything(type); end - # : (Type::AttachedClass type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1085 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1087 sig { params(type: ::RBI::Type::AttachedClass).void } def visit_attached_class(type); end - # : (Type::Boolean type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1044 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1046 sig { params(type: ::RBI::Type::Boolean).void } def visit_boolean(type); end - # : (Type::Class type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1187 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1194 sig { params(type: ::RBI::Type::Class).void } def visit_class(type); end - # : (Type::ClassOf type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1103 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1105 sig { params(type: ::RBI::Type::ClassOf).void } def visit_class_of(type); end - # : (Type::Generic type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1049 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1051 sig { params(type: ::RBI::Type::Generic).void } def visit_generic(type); end - # : (Type::Nilable type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1090 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1201 + sig { params(type: ::RBI::Type::Module).void } + def visit_module(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1092 sig { params(type: ::RBI::Type::Nilable).void } def visit_nilable(type); end - # : (Type::NoReturn type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1070 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1072 sig { params(type: ::RBI::Type::NoReturn).void } def visit_no_return(type); end - # : (Type::Proc type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1160 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1167 sig { params(type: ::RBI::Type::Proc).void } def visit_proc(type); end - # : (Type::SelfType type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1080 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1082 sig { params(type: ::RBI::Type::SelfType).void } def visit_self_type(type); end - # : (Type::Shape type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1140 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1147 sig { params(type: ::RBI::Type::Shape).void } def visit_shape(type); end - # : (Type::Simple type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1039 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1041 sig { params(type: ::RBI::Type::Simple).void } def visit_simple(type); end - # : (Type::Tuple type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1130 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1137 sig { params(type: ::RBI::Type::Tuple).void } def visit_tuple(type); end - # : (Type::TypeParameter type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1182 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1189 sig { params(type: ::RBI::Type::TypeParameter).void } def visit_type_parameter(type); end - # : (Type::Untyped type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1075 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1077 sig { params(type: ::RBI::Type::Untyped).void } def visit_untyped(type); end - # : (Type::Void type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1065 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1067 sig { params(type: ::RBI::Type::Void).void } def visit_void(type); end private - # : (String type_name) -> String - # - # source://rbi//lib/rbi/rbs_printer.rb#1196 + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1210 sig { params(type_name: ::String).returns(::String) } def translate_t_type(type_name); end end -# source://rbi//lib/rbi/rewriters/attr_to_methods.rb#5 +# pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:5 class RBI::UnexpectedMultipleSigsError < ::RBI::Error - # : (Node node) -> void - # - # @return [UnexpectedMultipleSigsError] a new instance of UnexpectedMultipleSigsError - # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#10 + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:10 sig { params(node: ::RBI::Node).void } def initialize(node); end - # : Node - # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#7 + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:7 sig { returns(::RBI::Node) } def node; end end -# source://rbi//lib/rbi/parser.rb#18 +# pkg:gem/rbi#lib/rbi/parser.rb:18 class RBI::UnexpectedParserError < ::RBI::Error - # : (Exception parent_exception, Loc last_location) -> void - # - # @return [UnexpectedParserError] a new instance of UnexpectedParserError - # - # source://rbi//lib/rbi/parser.rb#23 + # pkg:gem/rbi#lib/rbi/parser.rb:23 sig { params(parent_exception: ::Exception, last_location: ::RBI::Loc).void } def initialize(parent_exception, last_location); end - # : Loc - # - # source://rbi//lib/rbi/parser.rb#20 + # pkg:gem/rbi#lib/rbi/parser.rb:20 sig { returns(::RBI::Loc) } def last_location; end - # : (?io: (IO | StringIO)) -> void - # - # source://rbi//lib/rbi/parser.rb#30 + # pkg:gem/rbi#lib/rbi/parser.rb:30 sig { params(io: T.any(::IO, ::StringIO)).void } def print_debug(io: T.unsafe(nil)); end end -# source://rbi//lib/rbi/version.rb#5 +# pkg:gem/rbi#lib/rbi/version.rb:5 RBI::VERSION = T.let(T.unsafe(nil), String) # @abstract # -# source://rbi//lib/rbi/model.rb#743 +# pkg:gem/rbi#lib/rbi/model.rb:769 class RBI::Visibility < ::RBI::NodeWithComments abstract! - # : (Symbol visibility, ?loc: Loc?, ?comments: Array[Comment]) -> void - # - # @return [Visibility] a new instance of Visibility - # - # source://rbi//lib/rbi/model.rb#748 - sig { params(visibility: ::Symbol, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } + # pkg:gem/rbi#lib/rbi/model.rb:774 + sig { params(visibility: ::Symbol, loc: T.nilable(::RBI::Loc), comments: T.nilable(T::Array[::RBI::Comment])).void } def initialize(visibility, loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#754 + # pkg:gem/rbi#lib/rbi/model.rb:780 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # : -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/model.rb#771 + # pkg:gem/rbi#lib/rbi/model.rb:797 sig { returns(T::Boolean) } def private?; end - # : -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/model.rb#766 + # pkg:gem/rbi#lib/rbi/model.rb:792 sig { returns(T::Boolean) } def protected?; end - # : -> bool - # - # @return [Boolean] - # - # source://rbi//lib/rbi/model.rb#761 + # pkg:gem/rbi#lib/rbi/model.rb:787 sig { returns(T::Boolean) } def public?; end - # : Symbol - # - # source://rbi//lib/rbi/model.rb#745 + # pkg:gem/rbi#lib/rbi/model.rb:771 sig { returns(::Symbol) } def visibility; end end -# source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#49 +# pkg:gem/rbi#lib/rbi/rewriters/nest_non_public_members.rb:58 class RBI::VisibilityGroup < ::RBI::Tree - # : (Visibility visibility) -> void - # - # @return [VisibilityGroup] a new instance of VisibilityGroup - # - # source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#54 + # pkg:gem/rbi#lib/rbi/rewriters/nest_non_public_members.rb:63 sig { params(visibility: ::RBI::Visibility).void } def initialize(visibility); end - # : Visibility - # - # source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#51 + # pkg:gem/rbi#lib/rbi/rewriters/nest_non_public_members.rb:60 sig { returns(::RBI::Visibility) } def visibility; end end # @abstract # -# source://rbi//lib/rbi/visitor.rb#8 +# pkg:gem/rbi#lib/rbi/visitor.rb:8 class RBI::Visitor abstract! - # : (Node? node) -> void - # - # source://rbi//lib/rbi/visitor.rb#10 + # pkg:gem/rbi#lib/rbi/visitor.rb:10 sig { params(node: T.nilable(::RBI::Node)).void } def visit(node); end - # : (Array[Node] nodes) -> void - # - # source://rbi//lib/rbi/visitor.rb#108 + # pkg:gem/rbi#lib/rbi/visitor.rb:108 sig { params(nodes: T::Array[::RBI::Node]).void } def visit_all(nodes); end - # : (File file) -> void - # - # source://rbi//lib/rbi/visitor.rb#113 + # pkg:gem/rbi#lib/rbi/visitor.rb:113 sig { params(file: ::RBI::File).void } def visit_file(file); end private - # : (Arg node) -> void - # - # source://rbi//lib/rbi/visitor.rb#198 + # pkg:gem/rbi#lib/rbi/visitor.rb:198 sig { params(node: ::RBI::Arg).void } def visit_arg(node); end - # : (AttrAccessor node) -> void - # - # source://rbi//lib/rbi/visitor.rb#147 + # pkg:gem/rbi#lib/rbi/visitor.rb:147 sig { params(node: ::RBI::AttrAccessor).void } def visit_attr_accessor(node); end - # : (AttrReader node) -> void - # - # source://rbi//lib/rbi/visitor.rb#150 + # pkg:gem/rbi#lib/rbi/visitor.rb:150 sig { params(node: ::RBI::AttrReader).void } def visit_attr_reader(node); end - # : (AttrWriter node) -> void - # - # source://rbi//lib/rbi/visitor.rb#153 + # pkg:gem/rbi#lib/rbi/visitor.rb:153 sig { params(node: ::RBI::AttrWriter).void } def visit_attr_writer(node); end - # : (BlankLine node) -> void - # - # source://rbi//lib/rbi/visitor.rb#126 + # pkg:gem/rbi#lib/rbi/visitor.rb:126 sig { params(node: ::RBI::BlankLine).void } def visit_blank_line(node); end - # : (BlockParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#177 + # pkg:gem/rbi#lib/rbi/visitor.rb:177 sig { params(node: ::RBI::BlockParam).void } def visit_block_param(node); end - # : (Class node) -> void - # - # source://rbi//lib/rbi/visitor.rb#132 + # pkg:gem/rbi#lib/rbi/visitor.rb:132 sig { params(node: ::RBI::Class).void } def visit_class(node); end - # : (Comment node) -> void - # - # source://rbi//lib/rbi/visitor.rb#120 + # pkg:gem/rbi#lib/rbi/visitor.rb:120 sig { params(node: ::RBI::Comment).void } def visit_comment(node); end - # : (ConflictTree node) -> void - # - # source://rbi//lib/rbi/visitor.rb#246 + # pkg:gem/rbi#lib/rbi/visitor.rb:246 sig { params(node: ::RBI::ConflictTree).void } def visit_conflict_tree(node); end - # : (Const node) -> void - # - # source://rbi//lib/rbi/visitor.rb#144 + # pkg:gem/rbi#lib/rbi/visitor.rb:144 sig { params(node: ::RBI::Const).void } def visit_const(node); end - # : (Extend node) -> void - # - # source://rbi//lib/rbi/visitor.rb#183 + # pkg:gem/rbi#lib/rbi/visitor.rb:183 sig { params(node: ::RBI::Extend).void } def visit_extend(node); end - # : (Group node) -> void - # - # source://rbi//lib/rbi/visitor.rb#240 + # pkg:gem/rbi#lib/rbi/visitor.rb:240 sig { params(node: ::RBI::Group).void } def visit_group(node); end - # : (Helper node) -> void - # - # source://rbi//lib/rbi/visitor.rb#228 + # pkg:gem/rbi#lib/rbi/visitor.rb:228 sig { params(node: ::RBI::Helper).void } def visit_helper(node); end - # : (Include node) -> void - # - # source://rbi//lib/rbi/visitor.rb#180 + # pkg:gem/rbi#lib/rbi/visitor.rb:180 sig { params(node: ::RBI::Include).void } def visit_include(node); end - # : (KwArg node) -> void - # - # source://rbi//lib/rbi/visitor.rb#201 + # pkg:gem/rbi#lib/rbi/visitor.rb:201 sig { params(node: ::RBI::KwArg).void } def visit_kw_arg(node); end - # : (KwOptParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#171 + # pkg:gem/rbi#lib/rbi/visitor.rb:171 sig { params(node: ::RBI::KwOptParam).void } def visit_kw_opt_param(node); end - # : (KwParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#168 + # pkg:gem/rbi#lib/rbi/visitor.rb:168 sig { params(node: ::RBI::KwParam).void } def visit_kw_param(node); end - # : (KwRestParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#174 + # pkg:gem/rbi#lib/rbi/visitor.rb:174 sig { params(node: ::RBI::KwRestParam).void } def visit_kw_rest_param(node); end - # : (Method node) -> void - # - # source://rbi//lib/rbi/visitor.rb#156 + # pkg:gem/rbi#lib/rbi/visitor.rb:156 sig { params(node: ::RBI::Method).void } def visit_method(node); end - # : (MixesInClassMethods node) -> void - # - # source://rbi//lib/rbi/visitor.rb#234 + # pkg:gem/rbi#lib/rbi/visitor.rb:234 sig { params(node: ::RBI::MixesInClassMethods).void } def visit_mixes_in_class_methods(node); end - # : (Module node) -> void - # - # source://rbi//lib/rbi/visitor.rb#129 + # pkg:gem/rbi#lib/rbi/visitor.rb:129 sig { params(node: ::RBI::Module).void } def visit_module(node); end - # : (OptParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#162 + # pkg:gem/rbi#lib/rbi/visitor.rb:162 sig { params(node: ::RBI::OptParam).void } def visit_opt_param(node); end - # : (Private node) -> void - # - # source://rbi//lib/rbi/visitor.rb#192 + # pkg:gem/rbi#lib/rbi/visitor.rb:192 sig { params(node: ::RBI::Private).void } def visit_private(node); end - # : (Protected node) -> void - # - # source://rbi//lib/rbi/visitor.rb#189 + # pkg:gem/rbi#lib/rbi/visitor.rb:189 sig { params(node: ::RBI::Protected).void } def visit_protected(node); end - # : (Public node) -> void - # - # source://rbi//lib/rbi/visitor.rb#186 + # pkg:gem/rbi#lib/rbi/visitor.rb:186 sig { params(node: ::RBI::Public).void } def visit_public(node); end - # : (RBSComment node) -> void - # - # source://rbi//lib/rbi/visitor.rb#123 + # pkg:gem/rbi#lib/rbi/visitor.rb:123 sig { params(node: ::RBI::RBSComment).void } def visit_rbs_comment(node); end - # : (ReqParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#159 + # pkg:gem/rbi#lib/rbi/visitor.rb:159 sig { params(node: ::RBI::ReqParam).void } def visit_req_param(node); end - # : (RequiresAncestor node) -> void - # - # source://rbi//lib/rbi/visitor.rb#237 + # pkg:gem/rbi#lib/rbi/visitor.rb:237 sig { params(node: ::RBI::RequiresAncestor).void } def visit_requires_ancestor(node); end - # : (RestParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#165 + # pkg:gem/rbi#lib/rbi/visitor.rb:165 sig { params(node: ::RBI::RestParam).void } def visit_rest_param(node); end - # : (ScopeConflict node) -> void - # - # source://rbi//lib/rbi/visitor.rb#249 + # pkg:gem/rbi#lib/rbi/visitor.rb:249 sig { params(node: ::RBI::ScopeConflict).void } def visit_scope_conflict(node); end - # : (Send node) -> void - # - # source://rbi//lib/rbi/visitor.rb#195 + # pkg:gem/rbi#lib/rbi/visitor.rb:195 sig { params(node: ::RBI::Send).void } def visit_send(node); end - # : (Sig node) -> void - # - # source://rbi//lib/rbi/visitor.rb#204 + # pkg:gem/rbi#lib/rbi/visitor.rb:204 sig { params(node: ::RBI::Sig).void } def visit_sig(node); end - # : (SigParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#207 + # pkg:gem/rbi#lib/rbi/visitor.rb:207 sig { params(node: ::RBI::SigParam).void } def visit_sig_param(node); end - # : (SingletonClass node) -> void - # - # source://rbi//lib/rbi/visitor.rb#135 + # pkg:gem/rbi#lib/rbi/visitor.rb:135 sig { params(node: ::RBI::SingletonClass).void } def visit_singleton_class(node); end - # : (Struct node) -> void - # - # source://rbi//lib/rbi/visitor.rb#138 + # pkg:gem/rbi#lib/rbi/visitor.rb:138 sig { params(node: ::RBI::Struct).void } def visit_struct(node); end - # : (TEnum node) -> void - # - # source://rbi//lib/rbi/visitor.rb#219 + # pkg:gem/rbi#lib/rbi/visitor.rb:219 sig { params(node: ::RBI::TEnum).void } def visit_tenum(node); end - # : (TEnumBlock node) -> void - # - # source://rbi//lib/rbi/visitor.rb#222 + # pkg:gem/rbi#lib/rbi/visitor.rb:222 sig { params(node: ::RBI::TEnumBlock).void } def visit_tenum_block(node); end - # : (TEnumValue node) -> void - # - # source://rbi//lib/rbi/visitor.rb#225 + # pkg:gem/rbi#lib/rbi/visitor.rb:225 sig { params(node: ::RBI::TEnumValue).void } def visit_tenum_value(node); end - # : (Tree node) -> void - # - # source://rbi//lib/rbi/visitor.rb#141 + # pkg:gem/rbi#lib/rbi/visitor.rb:141 sig { params(node: ::RBI::Tree).void } def visit_tree(node); end - # : (TStruct node) -> void - # - # source://rbi//lib/rbi/visitor.rb#210 + # pkg:gem/rbi#lib/rbi/visitor.rb:210 sig { params(node: ::RBI::TStruct).void } def visit_tstruct(node); end - # : (TStructConst node) -> void - # - # source://rbi//lib/rbi/visitor.rb#213 + # pkg:gem/rbi#lib/rbi/visitor.rb:213 sig { params(node: ::RBI::TStructConst).void } def visit_tstruct_const(node); end - # : (TStructProp node) -> void - # - # source://rbi//lib/rbi/visitor.rb#216 + # pkg:gem/rbi#lib/rbi/visitor.rb:216 sig { params(node: ::RBI::TStructProp).void } def visit_tstruct_prop(node); end - # : (TypeMember node) -> void - # - # source://rbi//lib/rbi/visitor.rb#231 + # pkg:gem/rbi#lib/rbi/visitor.rb:231 sig { params(node: ::RBI::TypeMember).void } def visit_type_member(node); end - # : (VisibilityGroup node) -> void - # - # source://rbi//lib/rbi/visitor.rb#243 + # pkg:gem/rbi#lib/rbi/visitor.rb:243 sig { params(node: ::RBI::VisibilityGroup).void } def visit_visibility_group(node); end end -# source://rbi//lib/rbi/visitor.rb#5 +# pkg:gem/rbi#lib/rbi/visitor.rb:5 class RBI::VisitorError < ::RBI::Error; end diff --git a/sorbet/rbi/gems/rbs@3.9.5.rbi b/sorbet/rbi/gems/rbs@4.0.2.rbi similarity index 100% rename from sorbet/rbi/gems/rbs@3.9.5.rbi rename to sorbet/rbi/gems/rbs@4.0.2.rbi diff --git a/sorbet/rbi/gems/reline@0.6.3.rbi b/sorbet/rbi/gems/reline@0.6.3.rbi new file mode 100644 index 0000000..13fa313 --- /dev/null +++ b/sorbet/rbi/gems/reline@0.6.3.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `reline` gem. +# Please instead update this file by running `bin/tapioca gem reline`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/require-hooks@0.3.0.rbi b/sorbet/rbi/gems/require-hooks@0.3.0.rbi new file mode 100644 index 0000000..3aaca37 --- /dev/null +++ b/sorbet/rbi/gems/require-hooks@0.3.0.rbi @@ -0,0 +1,120 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `require-hooks` gem. +# Please instead update this file by running `bin/tapioca gem require-hooks`. + + +# pkg:gem/require-hooks#lib/require-hooks/api.rb:3 +module RequireHooks + class << self + # Define a block to wrap the code loading. + # The return value MUST be a result of calling the passed block. + # For example, you can use such hooks for instrumentation, debugging purposes. + # + # RequireHooks.around_load do |path, &block| + # puts "Loading #{path}" + # block.call.tap { puts "Loaded #{path}" } + # end + # + # pkg:gem/require-hooks#lib/require-hooks/api.rb:90 + def around_load(patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil), &block); end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:144 + def context_for(path); end + + # This hook should be used to manually compile byte code to be loaded by the VM. + # The arguments are (path, source = nil), where source is only defined if transformations took place. + # Otherwise, you MUST read the source code from the file yourself. + # + # The return value MUST be either nil (continue to the next hook or default behavior) or a platform-specific bytecode object (e.g., RubyVM::InstructionSequence). + # + # RequireHooks.hijack_load do |path, source| + # source ||= File.read(path) + # if defined?(RubyVM::InstructionSequence) + # RubyVM::InstructionSequence.compile(source) + # elsif defined?(JRUBY_VERSION) + # JRuby.compile(source) + # end + # end + # + # pkg:gem/require-hooks#lib/require-hooks/api.rb:134 + def hijack_load(patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil), &block); end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:80 + def print_warnings; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:80 + def print_warnings=(_arg0); end + + # Define hooks to perform source-to-source transformations. + # The return value MUST be either String (new source code) or nil (indicating that no transformations were performed). + # + # NOTE: The second argument (`source`) MAY be nil, indicating that no transformer tried to transform the source code. + # + # + # RequireHooks.source_transform do |path, source| + # end + # + # pkg:gem/require-hooks#lib/require-hooks/api.rb:110 + def source_transform(patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil), &block); end + end +end + +# pkg:gem/require-hooks#lib/require-hooks/api.rb:4 +class RequireHooks::Context + # pkg:gem/require-hooks#lib/require-hooks/api.rb:8 + def initialize(patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil)); end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:5 + def around_load; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:29 + def empty?; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:5 + def exclude_patterns; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:38 + def hijack?; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:5 + def hijack_load; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:23 + def match?(path); end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:5 + def patterns; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:52 + def perform_source_transform(path); end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:42 + def run_around_load_callbacks(path); end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:5 + def source_transform; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:34 + def source_transform?; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:19 + def to_key; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:64 + def try_hijack_load(path, source); end +end + +# pkg:gem/require-hooks#lib/require-hooks/mode/load_iseq.rb:4 +RequireHooks::EMPTY_ISEQ = T.let(T.unsafe(nil), RubyVM::InstructionSequence) + +# pkg:gem/require-hooks#lib/require-hooks/mode/load_iseq.rb:6 +module RequireHooks::LoadIseq + # pkg:gem/require-hooks#lib/require-hooks/mode/load_iseq.rb:7 + def load_iseq(path); end +end + +class RubyVM::InstructionSequence + extend ::RequireHooks::LoadIseq +end diff --git a/sorbet/rbi/gems/rexml@3.4.4.rbi b/sorbet/rbi/gems/rexml@3.4.4.rbi new file mode 100644 index 0000000..0a38bc4 --- /dev/null +++ b/sorbet/rbi/gems/rexml@3.4.4.rbi @@ -0,0 +1,4905 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rexml` gem. +# Please instead update this file by running `bin/tapioca gem rexml`. + + +# This class needs: +# * Documentation +# * Work! Not all types of attlists are intelligently parsed, so we just +# spew back out what we get in. This works, but it would be better if +# we formatted the output ourselves. +# +# AttlistDecls provide *just* enough support to allow namespace +# declarations. If you need some sort of generalized support, or have an +# interesting idea about how to map the hideous, terrible design of DTD +# AttlistDecls onto an intuitive Ruby interface, let me know. I'm desperate +# for anything to make DTDs more palateable. +# +# pkg:gem/rexml#lib/rexml/attlistdecl.rb:18 +class REXML::AttlistDecl < ::REXML::Child + include ::Enumerable + + # Create an AttlistDecl, pulling the information from a Source. Notice + # that this isn't very convenient; to create an AttlistDecl, you basically + # have to format it yourself, and then have the initializer parse it. + # Sorry, but for the foreseeable future, DTD support in REXML is pretty + # weak on convenience. Have I mentioned how much I hate DTDs? + # + # pkg:gem/rexml#lib/rexml/attlistdecl.rb:29 + def initialize(source); end + + # Access the attlist attribute/value pairs. + # value = attlist_decl[ attribute_name ] + # + # pkg:gem/rexml#lib/rexml/attlistdecl.rb:38 + def [](key); end + + # Iterate over the key/value pairs: + # attlist_decl.each { |attribute_name, attribute_value| ... } + # + # pkg:gem/rexml#lib/rexml/attlistdecl.rb:50 + def each(&block); end + + # What is this? Got me. + # + # pkg:gem/rexml#lib/rexml/attlistdecl.rb:22 + def element_name; end + + # Whether an attlist declaration includes the given attribute definition + # if attlist_decl.include? "xmlns:foobar" + # + # pkg:gem/rexml#lib/rexml/attlistdecl.rb:44 + def include?(key); end + + # pkg:gem/rexml#lib/rexml/attlistdecl.rb:59 + def node_type; end + + # Write out exactly what we got in. + # + # pkg:gem/rexml#lib/rexml/attlistdecl.rb:55 + def write(out, indent = T.unsafe(nil)); end +end + +# Defines an Element Attribute; IE, a attribute=value pair, as in: +# . Attributes can be in their own +# namespaces. General users of REXML will not interact with the +# Attribute class much. +# +# pkg:gem/rexml#lib/rexml/attribute.rb:10 +class REXML::Attribute + include ::REXML::Node + include ::REXML::XMLTokens + include ::REXML::Namespace + + # Constructor. + # FIXME: The parser doesn't catch illegal characters in attributes + # + # first:: + # Either: an Attribute, which this new attribute will become a + # clone of; or a String, which is the name of this attribute + # second:: + # If +first+ is an Attribute, then this may be an Element, or nil. + # If nil, then the Element parent of this attribute is the parent + # of the +first+ Attribute. If the first argument is a String, + # then this must also be a String, and is the content of the attribute. + # If this is the content, it must be fully normalized (contain no + # illegal characters). + # parent:: + # Ignored unless +first+ is a String; otherwise, may be the Element + # parent of this attribute, or nil. + # + # + # Attribute.new( attribute_to_clone ) + # Attribute.new( attribute_to_clone, parent_element ) + # Attribute.new( "attr", "attr_value" ) + # Attribute.new( "attr", "attr_value", parent_element ) + # + # pkg:gem/rexml#lib/rexml/attribute.rb:42 + def initialize(first, second = T.unsafe(nil), parent = T.unsafe(nil)); end + + # Returns true if other is an Attribute and has the same name and value, + # false otherwise. + # + # pkg:gem/rexml#lib/rexml/attribute.rb:106 + def ==(other); end + + # Returns a copy of this attribute + # + # pkg:gem/rexml#lib/rexml/attribute.rb:161 + def clone; end + + # pkg:gem/rexml#lib/rexml/attribute.rb:132 + def doctype; end + + # pkg:gem/rexml#lib/rexml/attribute.rb:205 + def document; end + + # The element to which this attribute belongs + # + # pkg:gem/rexml#lib/rexml/attribute.rb:15 + def element; end + + # Sets the element of which this object is an attribute. Normally, this + # is not directly called. + # + # Returns this attribute + # + # pkg:gem/rexml#lib/rexml/attribute.rb:169 + def element=(element); end + + # Creates (and returns) a hash from both the name and value + # + # pkg:gem/rexml#lib/rexml/attribute.rb:111 + def hash; end + + # pkg:gem/rexml#lib/rexml/attribute.rb:195 + def inspect; end + + # Returns the namespace URL, if defined, or nil otherwise + # + # e = Element.new("el") + # e.add_namespace("ns", "http://url") + # e.add_attribute("ns:a", "b") + # e.add_attribute("nsx:a", "c") + # e.attribute("ns:a").namespace # => "http://url" + # e.attribute("nsx:a").namespace # => nil + # + # This method always returns "" for no namespace attribute. Because + # the default namespace doesn't apply to attribute names. + # + # From https://www.w3.org/TR/xml-names/#uniqAttrs + # + # > the default namespace does not apply to attribute names + # + # e = REXML::Element.new("el") + # e.add_namespace("", "http://example.com/") + # e.namespace # => "http://example.com/" + # e.add_attribute("a", "b") + # e.attribute("a").namespace # => "" + # + # pkg:gem/rexml#lib/rexml/attribute.rb:95 + def namespace(arg = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/attribute.rb:191 + def node_type; end + + # The normalized value of this attribute. That is, the attribute with + # entities intact. + # + # pkg:gem/rexml#lib/rexml/attribute.rb:155 + def normalized=(new_normalized); end + + # Returns the namespace of the attribute. + # + # e = Element.new( "elns:myelement" ) + # e.add_attribute( "nsa:a", "aval" ) + # e.add_attribute( "b", "bval" ) + # e.attributes.get_attribute( "a" ).prefix # -> "nsa" + # e.attributes.get_attribute( "b" ).prefix # -> "" + # a = Attribute.new( "x", "y" ) + # a.prefix # -> "" + # + # pkg:gem/rexml#lib/rexml/attribute.rb:70 + def prefix; end + + # Removes this Attribute from the tree, and returns true if successful + # + # This method is usually not called directly. + # + # pkg:gem/rexml#lib/rexml/attribute.rb:182 + def remove; end + + # Returns the attribute value, with entities replaced + # + # pkg:gem/rexml#lib/rexml/attribute.rb:137 + def to_s; end + + # Returns this attribute out as XML source, expanding the name + # + # a = Attribute.new( "x", "y" ) + # a.to_string # -> "x='y'" + # b = Attribute.new( "ns:x", "y" ) + # b.to_string # -> "ns:x='y'" + # + # pkg:gem/rexml#lib/rexml/attribute.rb:121 + def to_string; end + + # Returns the UNNORMALIZED value of this attribute. That is, entities + # have been expanded to their values + # + # pkg:gem/rexml#lib/rexml/attribute.rb:146 + def value; end + + # Writes this attribute (EG, puts 'key="value"' to the output) + # + # pkg:gem/rexml#lib/rexml/attribute.rb:187 + def write(output, indent = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/attribute.rb:201 + def xpath; end +end + +# A class that defines the set of Attributes of an Element and provides +# operations for accessing elements in that set. +# +# pkg:gem/rexml#lib/rexml/element.rb:2131 +class REXML::Attributes < ::Hash + # :call-seq: + # new(element) + # + # Creates and returns a new \REXML::Attributes object. + # The element given by argument +element+ is stored, + # but its own attributes are not modified: + # + # ele = REXML::Element.new('foo') + # attrs = REXML::Attributes.new(ele) + # attrs.object_id == ele.attributes.object_id # => false + # + # Other instance methods in class \REXML::Attributes may refer to: + # + # - +element.document+. + # - +element.prefix+. + # - +element.expanded_name+. + # + # pkg:gem/rexml#lib/rexml/element.rb:2150 + def initialize(element); end + + # pkg:gem/rexml#lib/rexml/element.rb:2520 + def <<(attribute); end + + # :call-seq: + # [name] -> attribute_value or nil + # + # Returns the value for the attribute given by +name+, + # if it exists; otherwise +nil+. + # The value returned is the unnormalized attribute value, + # with entities expanded: + # + # xml_string = <<-EOT + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # ele = d.elements['//ele'] # => + # ele.attributes['att'] # => "<" + # ele.attributes['bar:att'] # => "2" + # ele.attributes['nosuch'] # => nil + # + # Related: get_attribute (returns an \Attribute object). + # + # pkg:gem/rexml#lib/rexml/element.rb:2175 + def [](name); end + + # :call-seq: + # [name] = value -> value + # + # When +value+ is non-+nil+, + # assigns that to the attribute for the given +name+, + # overwriting the previous value if it exists: + # + # xml_string = <<-EOT + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # ele = d.root.elements['//ele'] # => + # attrs = ele.attributes + # attrs['foo:att'] = '2' # => "2" + # attrs['baz:att'] = '3' # => "3" + # + # When +value+ is +nil+, deletes the attribute if it exists: + # + # attrs['baz:att'] = nil + # attrs.include?('baz:att') # => false + # + # pkg:gem/rexml#lib/rexml/element.rb:2358 + def []=(name, value); end + + # :call-seq: + # add(attribute) -> attribute + # + # Adds attribute +attribute+, replacing the previous + # attribute of the same name if it exists; + # returns +attribute+: + # + # xml_string = <<-EOT + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # ele = d.root.elements['//ele'] # => + # attrs = ele.attributes + # attrs # => {"att"=>{"foo"=>foo:att='1', "bar"=>bar:att='2', ""=>att='<'}} + # attrs.add(REXML::Attribute.new('foo:att', '2')) # => foo:att='2' + # attrs.add(REXML::Attribute.new('baz', '3')) # => baz='3' + # attrs.include?('baz') # => true + # + # pkg:gem/rexml#lib/rexml/element.rb:2516 + def add(attribute); end + + # :call-seq: + # delete(name) -> element + # delete(attribute) -> element + # + # Removes a specified attribute if it exists; + # returns the attributes' element. + # + # When string argument +name+ is given, + # removes the attribute of that name if it exists: + # + # xml_string = <<-EOT + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # ele = d.root.elements['//ele'] # => + # attrs = ele.attributes + # attrs.delete('foo:att') # => + # attrs.delete('foo:att') # => + # + # When attribute argument +attribute+ is given, + # removes that attribute if it exists: + # + # attr = REXML::Attribute.new('bar:att', '2') + # attrs.delete(attr) # => # => + # attrs.delete(attr) # => # => + # + # pkg:gem/rexml#lib/rexml/element.rb:2471 + def delete(attribute); end + + # :call-seq: + # delete_all(name) -> array_of_removed_attributes + # + # Removes all attributes matching the given +name+; + # returns an array of the removed attributes: + # + # xml_string = <<-EOT + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # ele = d.root.elements['//ele'] # => + # attrs = ele.attributes + # attrs.delete_all('att') # => [att='<'] + # + # pkg:gem/rexml#lib/rexml/element.rb:2538 + def delete_all(name); end + + # :call-seq: + # each {|expanded_name, value| ... } + # + # Calls the given block with each expanded-name/value pair: + # + # xml_string = <<-EOT + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # ele = d.root.elements['//ele'] # => + # ele.attributes.each do |expanded_name, value| + # p [expanded_name, value] + # end + # + # Output: + # + # ["foo:att", "1"] + # ["bar:att", "2"] + # ["att", "<"] + # + # pkg:gem/rexml#lib/rexml/element.rb:2276 + def each; end + + # :call-seq: + # each_attribute {|attr| ... } + # + # Calls the given block with each \REXML::Attribute object: + # + # xml_string = <<-EOT + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # ele = d.root.elements['//ele'] # => + # ele.attributes.each_attribute do |attr| + # p [attr.class, attr] + # end + # + # Output: + # + # [REXML::Attribute, foo:att='1'] + # [REXML::Attribute, bar:att='2'] + # [REXML::Attribute, att='<'] + # + # pkg:gem/rexml#lib/rexml/element.rb:2243 + def each_attribute; end + + # :call-seq: + # get_attribute(name) -> attribute_object or nil + # + # Returns the \REXML::Attribute object for the given +name+: + # + # xml_string = <<-EOT + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # ele = d.root.elements['//ele'] # => + # attrs = ele.attributes + # attrs.get_attribute('foo:att') # => foo:att='1' + # attrs.get_attribute('foo:att').class # => REXML::Attribute + # attrs.get_attribute('bar:att') # => bar:att='2' + # attrs.get_attribute('att') # => att='<' + # attrs.get_attribute('nosuch') # => nil + # + # pkg:gem/rexml#lib/rexml/element.rb:2302 + def get_attribute(name); end + + # :call-seq: + # get_attribute_ns(namespace, name) + # + # Returns the \REXML::Attribute object among the attributes + # that matches the given +namespace+ and +name+: + # + # xml_string = <<-EOT + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # ele = d.root.elements['//ele'] # => + # attrs = ele.attributes + # attrs.get_attribute_ns('http://foo', 'att') # => foo:att='1' + # attrs.get_attribute_ns('http://foo', 'nosuch') # => nil + # + # pkg:gem/rexml#lib/rexml/element.rb:2564 + def get_attribute_ns(namespace, name); end + + # :call-seq: + # length + # + # Returns the count of attributes: + # + # xml_string = <<-EOT + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # ele = d.root.elements['//ele'] # => + # ele.attributes.length # => 3 + # + # pkg:gem/rexml#lib/rexml/element.rb:2214 + def length; end + + # :call-seq: + # namespaces + # + # Returns a hash of name/value pairs for the namespaces: + # + # xml_string = '' + # d = REXML::Document.new(xml_string) + # d.root.attributes.namespaces # => {"xmlns"=>"foo", "x"=>"bar", "y"=>"twee"} + # + # pkg:gem/rexml#lib/rexml/element.rb:2426 + def namespaces; end + + # :call-seq: + # prefixes -> array_of_prefix_strings + # + # Returns an array of prefix strings in the attributes. + # The array does not include the default + # namespace declaration, if one exists. + # + # xml_string = '' + # d = REXML::Document.new(xml_string) + # d.root.attributes.prefixes # => ["x", "y"] + # + # pkg:gem/rexml#lib/rexml/element.rb:2400 + def prefixes; end + + # pkg:gem/rexml#lib/rexml/element.rb:2219 + def size; end + + # :call-seq: + # to_a -> array_of_attribute_objects + # + # Returns an array of \REXML::Attribute objects representing + # the attributes: + # + # xml_string = <<-EOT + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # ele = d.root.elements['//ele'] # => + # attrs = ele.attributes.to_a # => [foo:att='1', bar:att='2', att='<'] + # attrs.first.class # => REXML::Attribute + # + # pkg:gem/rexml#lib/rexml/element.rb:2196 + def to_a; end +end + +# pkg:gem/rexml#lib/rexml/cdata.rb:5 +class REXML::CData < ::REXML::Text + # Constructor. CData is data between + # + # _Examples_ + # CData.new( source ) + # CData.new( "Here is some CDATA" ) + # CData.new( "Some unprocessed data", respect_whitespace_TF, parent_element ) + # + # pkg:gem/rexml#lib/rexml/cdata.rb:16 + def initialize(first, whitespace = T.unsafe(nil), parent = T.unsafe(nil)); end + + # Make a copy of this object + # + # _Examples_ + # c = CData.new( "Some text" ) + # d = c.clone + # d.to_s # -> "Some text" + # + # pkg:gem/rexml#lib/rexml/cdata.rb:26 + def clone; end + + # Returns the content of this CData object + # + # _Examples_ + # c = CData.new( "Some text" ) + # c.to_s # -> "Some text" + # + # pkg:gem/rexml#lib/rexml/cdata.rb:35 + def to_s; end + + # pkg:gem/rexml#lib/rexml/cdata.rb:39 + def value; end + + # == DEPRECATED + # See the rexml/formatters package + # + # Generates XML output of this object + # + # output:: + # Where to write the string. Defaults to $stdout + # indent:: + # The amount to indent this node by + # transitive:: + # Ignored + # ie_hack:: + # Ignored + # + # _Examples_ + # c = CData.new( " Some text " ) + # c.write( $stdout ) #-> + # + # pkg:gem/rexml#lib/rexml/cdata.rb:60 + def write(output = T.unsafe(nil), indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end +end + +# A Child object is something contained by a parent, and this class +# contains methods to support that. Most user code will not use this +# class directly. +# +# pkg:gem/rexml#lib/rexml/child.rb:9 +class REXML::Child + include ::REXML::Node + + # Constructor. Any inheritors of this class should call super to make + # sure this method is called. + # parent:: + # if supplied, the parent of this child will be set to the + # supplied value, and self will be added to the parent + # + # pkg:gem/rexml#lib/rexml/child.rb:18 + def initialize(parent = T.unsafe(nil)); end + + # This doesn't yet handle encodings + # + # pkg:gem/rexml#lib/rexml/child.rb:90 + def bytes; end + + # Returns:: the document this child belongs to, or nil if this child + # belongs to no document + # + # pkg:gem/rexml#lib/rexml/child.rb:85 + def document; end + + # pkg:gem/rexml#lib/rexml/child.rb:58 + def next_sibling; end + + # Sets the next sibling of this child. This can be used to insert a child + # after some other child. + # a = Element.new("a") + # b = a.add_element("b") + # c = Element.new("c") + # b.next_sibling = c + # # => + # + # pkg:gem/rexml#lib/rexml/child.rb:68 + def next_sibling=(other); end + + # pkg:gem/rexml#lib/rexml/child.rb:11 + def parent; end + + # Sets the parent of this child to the supplied argument. + # + # other:: + # Must be a Parent object. If this object is the same object as the + # existing parent of this child, no action is taken. Otherwise, this + # child is removed from the current parent (if one exists), and is added + # to the new parent. + # Returns:: The parent added + # + # pkg:gem/rexml#lib/rexml/child.rb:52 + def parent=(other); end + + # pkg:gem/rexml#lib/rexml/child.rb:59 + def previous_sibling; end + + # Sets the previous sibling of this child. This can be used to insert a + # child before some other child. + # a = Element.new("a") + # b = a.add_element("b") + # c = Element.new("c") + # b.previous_sibling = c + # # => + # + # pkg:gem/rexml#lib/rexml/child.rb:79 + def previous_sibling=(other); end + + # Removes this child from the parent. + # + # Returns:: self + # + # pkg:gem/rexml#lib/rexml/child.rb:37 + def remove; end + + # Replaces this object with another object. Basically, calls + # Parent.replace_child + # + # Returns:: self + # + # pkg:gem/rexml#lib/rexml/child.rb:29 + def replace_with(child); end +end + +# Represents an XML comment; that is, text between \ +# +# pkg:gem/rexml#lib/rexml/comment.rb:7 +class REXML::Comment < ::REXML::Child + include ::Comparable + + # Constructor. The first argument can be one of three types: + # @param first If String, the contents of this comment are set to the + # argument. If Comment, the argument is duplicated. If + # Source, the argument is scanned for a comment. + # @param second If the first argument is a Source, this argument + # should be nil, not supplied, or a Parent to be set as the parent + # of this object + # + # pkg:gem/rexml#lib/rexml/comment.rb:24 + def initialize(first, second = T.unsafe(nil)); end + + # Compares this Comment to another; the contents of the comment are used + # in the comparison. + # + # pkg:gem/rexml#lib/rexml/comment.rb:63 + def <=>(other); end + + # Compares this Comment to another; the contents of the comment are used + # in the comparison. + # + # pkg:gem/rexml#lib/rexml/comment.rb:70 + def ==(other); end + + # pkg:gem/rexml#lib/rexml/comment.rb:33 + def clone; end + + # pkg:gem/rexml#lib/rexml/comment.rb:75 + def node_type; end + + # The content text + # + # pkg:gem/rexml#lib/rexml/comment.rb:14 + def string; end + + # The content text + # + # pkg:gem/rexml#lib/rexml/comment.rb:14 + def string=(_arg0); end + + # pkg:gem/rexml#lib/rexml/comment.rb:58 + def to_s; end + + # == DEPRECATED + # See REXML::Formatters + # + # output:: + # Where to write the string + # indent:: + # An integer. If -1, no indenting will be used; otherwise, the + # indentation will be this number of spaces, and children will be + # indented an additional amount. + # transitive:: + # Ignored by this class. The contents of comments are never modified. + # ie_hack:: + # Needed for conformity to the child API, but not used by this class. + # + # pkg:gem/rexml#lib/rexml/comment.rb:50 + def write(output, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end +end + +# pkg:gem/rexml#lib/rexml/xpath_parser.rb:11 +module REXML::DClonable; end + +# This is an abstract class. You never use this directly; it serves as a +# parent class for the specific declarations. +# +# pkg:gem/rexml#lib/rexml/doctype.rb:238 +class REXML::Declaration < ::REXML::Child + # pkg:gem/rexml#lib/rexml/doctype.rb:239 + def initialize(src); end + + # pkg:gem/rexml#lib/rexml/doctype.rb:244 + def to_s; end + + # == DEPRECATED + # See REXML::Formatters + # + # pkg:gem/rexml#lib/rexml/doctype.rb:251 + def write(output, indent); end +end + +# Represents an XML DOCTYPE declaration; that is, the contents of . DOCTYPES can be used to declare the DTD of a document, as well as +# being used to declare entities used in the document. +# +# pkg:gem/rexml#lib/rexml/doctype.rb:51 +class REXML::DocType < ::REXML::Parent + include ::REXML::XMLTokens + + # Constructor + # + # dt = DocType.new( 'foo', '-//I/Hate/External/IDs' ) + # # + # dt = DocType.new( doctype_to_clone ) + # # Incomplete. Shallow clone of doctype + # + # +Note+ that the constructor: + # + # Doctype.new( Source.new( "" ) ) + # + # is _deprecated_. Do not use it. It will probably disappear. + # + # pkg:gem/rexml#lib/rexml/doctype.rb:80 + def initialize(first, parent = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/doctype.rb:181 + def add(child); end + + # pkg:gem/rexml#lib/rexml/doctype.rb:125 + def attribute_of(element, attribute); end + + # pkg:gem/rexml#lib/rexml/doctype.rb:115 + def attributes_of(element); end + + # pkg:gem/rexml#lib/rexml/doctype.rb:135 + def clone; end + + # pkg:gem/rexml#lib/rexml/doctype.rb:173 + def context; end + + # name is the name of the doctype + # external_id is the referenced DTD, if given + # + # pkg:gem/rexml#lib/rexml/doctype.rb:66 + def entities; end + + # pkg:gem/rexml#lib/rexml/doctype.rb:177 + def entity(name); end + + # name is the name of the doctype + # external_id is the referenced DTD, if given + # + # pkg:gem/rexml#lib/rexml/doctype.rb:66 + def external_id; end + + # name is the name of the doctype + # external_id is the referenced DTD, if given + # + # pkg:gem/rexml#lib/rexml/doctype.rb:66 + def name; end + + # name is the name of the doctype + # external_id is the referenced DTD, if given + # + # pkg:gem/rexml#lib/rexml/doctype.rb:66 + def namespaces; end + + # pkg:gem/rexml#lib/rexml/doctype.rb:111 + def node_type; end + + # Retrieves a named notation. Only notations declared in the internal + # DTD subset can be retrieved. + # + # Method contributed by Henrik Martensson + # + # pkg:gem/rexml#lib/rexml/doctype.rb:225 + def notation(name); end + + # This method returns a list of notations that have been declared in the + # _internal_ DTD subset. Notations in the external DTD subset are not + # listed. + # + # Method contributed by Henrik Martensson + # + # pkg:gem/rexml#lib/rexml/doctype.rb:217 + def notations; end + + # This method retrieves the public identifier identifying the document's + # DTD. + # + # Method contributed by Henrik Martensson + # + # pkg:gem/rexml#lib/rexml/doctype.rb:191 + def public; end + + # This method retrieves the system identifier identifying the document's DTD + # + # Method contributed by Henrik Martensson + # + # pkg:gem/rexml#lib/rexml/doctype.rb:203 + def system; end + + # output:: + # Where to write the string + # indent:: + # An integer. If -1, no indentation will be used; otherwise, the + # indentation will be this number of spaces, and children will be + # indented an additional amount. + # transitive:: + # Ignored + # ie_hack:: + # Ignored + # + # pkg:gem/rexml#lib/rexml/doctype.rb:149 + def write(output, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end +end + +# Represents an XML document. +# +# A document may have: +# +# - A single child that may be accessed via method #root. +# - An XML declaration. +# - A document type. +# - Processing instructions. +# +# == In a Hurry? +# +# If you're somewhat familiar with XML +# and have a particular task in mind, +# you may want to see the +# {tasks pages}[../doc/rexml/tasks/tocs/master_toc_rdoc.html], +# and in particular, the +# {tasks page for documents}[../doc/rexml/tasks/tocs/document_toc_rdoc.html]. +# +# pkg:gem/rexml#lib/rexml/document.rb:35 +class REXML::Document < ::REXML::Element + # :call-seq: + # new(string = nil, context = {}) -> new_document + # new(io_stream = nil, context = {}) -> new_document + # new(document = nil, context = {}) -> new_document + # + # Returns a new \REXML::Document object. + # + # When no arguments are given, + # returns an empty document: + # + # d = REXML::Document.new + # d.to_s # => "" + # + # When argument +string+ is given, it must be a string + # containing a valid XML document: + # + # xml_string = 'FooBar' + # d = REXML::Document.new(xml_string) + # d.to_s # => "FooBar" + # + # When argument +io_stream+ is given, it must be an \IO object + # that is opened for reading, and when read must return a valid XML document: + # + # File.write('t.xml', xml_string) + # d = File.open('t.xml', 'r') do |io| + # REXML::Document.new(io) + # end + # d.to_s # => "FooBar" + # + # When argument +document+ is given, it must be an existing + # document object, whose context and attributes (but not children) + # are cloned into the new document: + # + # d = REXML::Document.new(xml_string) + # d.children # => [ ... ] + # d.context = {raw: :all, compress_whitespace: :all} + # d.add_attributes({'bar' => 0, 'baz' => 1}) + # d1 = REXML::Document.new(d) + # d1.children # => [] + # d1.context # => {:raw=>:all, :compress_whitespace=>:all} + # d1.attributes # => {"bar"=>bar='0', "baz"=>baz='1'} + # + # When argument +context+ is given, it must be a hash + # containing context entries for the document; + # see {Element Context}[../doc/rexml/context_rdoc.html]: + # + # context = {raw: :all, compress_whitespace: :all} + # d = REXML::Document.new(xml_string, context) + # d.context # => {:raw=>:all, :compress_whitespace=>:all} + # + # pkg:gem/rexml#lib/rexml/document.rb:92 + def initialize(source = T.unsafe(nil), context = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/document.rb:205 + def <<(child); end + + # :call-seq: + # add(xml_decl) -> self + # add(doc_type) -> self + # add(object) -> self + # + # Adds an object to the document; returns +self+. + # + # When argument +xml_decl+ is given, + # it must be an REXML::XMLDecl object, + # which becomes the XML declaration for the document, + # replacing the previous XML declaration if any: + # + # d = REXML::Document.new + # d.xml_decl.to_s # => "" + # d.add(REXML::XMLDecl.new('2.0')) + # d.xml_decl.to_s # => "" + # + # When argument +doc_type+ is given, + # it must be an REXML::DocType object, + # which becomes the document type for the document, + # replacing the previous document type, if any: + # + # d = REXML::Document.new + # d.doctype.to_s # => "" + # d.add(REXML::DocType.new('foo')) + # d.doctype.to_s # => "" + # + # When argument +object+ (not an REXML::XMLDecl or REXML::DocType object) + # is given it is added as the last child: + # + # d = REXML::Document.new + # d.add(REXML::Element.new('foo')) + # d.to_s # => "" + # + # pkg:gem/rexml#lib/rexml/document.rb:174 + def add(child); end + + # :call-seq: + # add_element(name_or_element = nil, attributes = nil) -> new_element + # + # Adds an element to the document by calling REXML::Element.add_element: + # + # REXML::Element.add_element(name_or_element, attributes) + # + # pkg:gem/rexml#lib/rexml/document.rb:213 + def add_element(arg = T.unsafe(nil), arg2 = T.unsafe(nil)); end + + # :call-seq: + # clone -> new_document + # + # Returns the new document resulting from executing + # Document.new(self). See Document.new. + # + # pkg:gem/rexml#lib/rexml/document.rb:124 + def clone; end + + # :call-seq: + # doctype -> doc_type or nil + # + # Returns the DocType object for the document, if it exists, otherwise +nil+: + # + # d = REXML::Document.new('') + # d.doctype.class # => REXML::DocType + # d = REXML::Document.new('') + # d.doctype.class # => nil + # + # pkg:gem/rexml#lib/rexml/document.rb:245 + def doctype; end + + # pkg:gem/rexml#lib/rexml/document.rb:448 + def document; end + + # :call-seq: + # encoding -> encoding_string + # + # Returns the XMLDecl encoding of the document, + # + # d = REXML::Document.new('') + # d.encoding # => "UTF-16" + # d = REXML::Document.new('') + # d.encoding # => "UTF-8" + # + # pkg:gem/rexml#lib/rexml/document.rb:294 + def encoding; end + + # pkg:gem/rexml#lib/rexml/document.rb:437 + def entity_expansion_count; end + + # pkg:gem/rexml#lib/rexml/document.rb:438 + def entity_expansion_limit=(_arg0); end + + # pkg:gem/rexml#lib/rexml/document.rb:439 + def entity_expansion_text_limit; end + + # pkg:gem/rexml#lib/rexml/document.rb:439 + def entity_expansion_text_limit=(_arg0); end + + # :call-seq: + # expanded_name -> empty_string + # + # Returns an empty string. + # + # pkg:gem/rexml#lib/rexml/document.rb:133 + def expanded_name; end + + # pkg:gem/rexml#lib/rexml/document.rb:138 + def name; end + + # :call-seq: + # node_type -> :document + # + # Returns the symbol +:document+. + # + # pkg:gem/rexml#lib/rexml/document.rb:114 + def node_type; end + + # pkg:gem/rexml#lib/rexml/document.rb:441 + def record_entity_expansion; end + + # :call-seq: + # root -> root_element or nil + # + # Returns the root element of the document, if it exists, otherwise +nil+: + # + # d = REXML::Document.new('') + # d.root # => + # d = REXML::Document.new('') + # d.root # => nil + # + # pkg:gem/rexml#lib/rexml/document.rb:229 + def root; end + + # :call-seq: + # stand_alone? + # + # Returns the XMLDecl standalone value of the document as a string, + # if it has been set, otherwise the default standalone value: + # + # d = REXML::Document.new('') + # d.stand_alone? # => "yes" + # d = REXML::Document.new('') + # d.stand_alone? # => nil + # + # pkg:gem/rexml#lib/rexml/document.rb:309 + def stand_alone?; end + + # :call-seq: + # version -> version_string + # + # Returns the XMLDecl version of this document as a string, + # if it has been set, otherwise the default version: + # + # d = REXML::Document.new('') + # d.version # => "2.0" + # d = REXML::Document.new('') + # d.version # => "1.0" + # + # pkg:gem/rexml#lib/rexml/document.rb:279 + def version; end + + # :call-seq: + # doc.write(output=$stdout, indent=-1, transitive=false, ie_hack=false, encoding=nil) + # doc.write(options={:output => $stdout, :indent => -1, :transitive => false, :ie_hack => false, :encoding => nil}) + # + # Write the XML tree out, optionally with indent. This writes out the + # entire XML document, including XML declarations, doctype declarations, + # and processing instructions (if any are given). + # + # A controversial point is whether Document should always write the XML + # declaration () whether or not one is given by the + # user (or source document). REXML does not write one if one was not + # specified, because it adds unnecessary bandwidth to applications such + # as XML-RPC. + # + # Accept Nth argument style and options Hash style as argument. + # The recommended style is options Hash style for one or more + # arguments case. + # + # _Examples_ + # Document.new("").write + # + # output = "" + # Document.new("").write(output) + # + # output = "" + # Document.new("").write(:output => output, :indent => 2) + # + # See also the classes in the rexml/formatters package for the proper way + # to change the default formatting of XML output. + # + # _Examples_ + # + # output = "" + # tr = Transitive.new + # tr.write(Document.new(""), output) + # + # output:: + # output an object which supports '<< string'; this is where the + # document will be written. + # indent:: + # An integer. If -1, no indenting will be used; otherwise, the + # indentation will be twice this number of spaces, and children will be + # indented an additional amount. For a value of 3, every item will be + # indented 3 more levels, or 6 more spaces (2 * 3). Defaults to -1 + # transitive:: + # If transitive is true and indent is >= 0, then the output will be + # pretty-printed in such a way that the added whitespace does not affect + # the absolute *value* of the document -- that is, it leaves the value + # and number of Text nodes in the document unchanged. + # ie_hack:: + # This hack inserts a space before the /> on empty tags to address + # a limitation of Internet Explorer. Defaults to false + # Encoding name as String. Change output encoding to specified encoding + # instead of encoding in XML declaration. + # Defaults to nil. It means encoding in XML declaration is used. + # + # pkg:gem/rexml#lib/rexml/document.rb:369 + def write(*arguments); end + + # :call-seq: + # xml_decl -> xml_decl + # + # Returns the XMLDecl object for the document, if it exists, + # otherwise the default XMLDecl object: + # + # d = REXML::Document.new('') + # d.xml_decl.class # => REXML::XMLDecl + # d.xml_decl.to_s # => "" + # d = REXML::Document.new('') + # d.xml_decl.class # => REXML::XMLDecl + # d.xml_decl.to_s # => "" + # + # pkg:gem/rexml#lib/rexml/document.rb:262 + def xml_decl; end + + private + + # pkg:gem/rexml#lib/rexml/document.rb:467 + def build(source); end + + # New document level cache is created and available in this block. + # This API is thread unsafe. Users can't change this document in this block. + # + # pkg:gem/rexml#lib/rexml/document.rb:458 + def enable_cache; end + + # pkg:gem/rexml#lib/rexml/document.rb:454 + def namespaces_cache; end + + # pkg:gem/rexml#lib/rexml/document.rb:454 + def namespaces_cache=(_arg0); end + + class << self + # Get the entity expansion limit. By default the limit is set to 10000. + # + # Deprecated. Use REXML::Security.entity_expansion_limit= instead. + # + # pkg:gem/rexml#lib/rexml/document.rb:419 + def entity_expansion_limit; end + + # Set the entity expansion limit. By default the limit is set to 10000. + # + # Deprecated. Use REXML::Security.entity_expansion_limit= instead. + # + # pkg:gem/rexml#lib/rexml/document.rb:412 + def entity_expansion_limit=(val); end + + # Get the entity expansion limit. By default the limit is set to 10240. + # + # Deprecated. Use REXML::Security.entity_expansion_text_limit instead. + # + # pkg:gem/rexml#lib/rexml/document.rb:433 + def entity_expansion_text_limit; end + + # Set the entity expansion limit. By default the limit is set to 10240. + # + # Deprecated. Use REXML::Security.entity_expansion_text_limit= instead. + # + # pkg:gem/rexml#lib/rexml/document.rb:426 + def entity_expansion_text_limit=(val); end + + # pkg:gem/rexml#lib/rexml/document.rb:405 + def parse_stream(source, listener); end + end +end + +# An \REXML::Element object represents an XML element. +# +# An element: +# +# - Has a name (string). +# - May have a parent (another element). +# - Has zero or more children +# (other elements, text, CDATA, processing instructions, and comments). +# - Has zero or more siblings +# (other elements, text, CDATA, processing instructions, and comments). +# - Has zero or more named attributes. +# +# == In a Hurry? +# +# If you're somewhat familiar with XML +# and have a particular task in mind, +# you may want to see the +# {tasks pages}[../doc/rexml/tasks/tocs/master_toc_rdoc.html], +# and in particular, the +# {tasks page for elements}[../doc/rexml/tasks/tocs/element_toc_rdoc.html]. +# +# === Name +# +# An element has a name, which is initially set when the element is created: +# +# e = REXML::Element.new('foo') +# e.name # => "foo" +# +# The name may be changed: +# +# e.name = 'bar' +# e.name # => "bar" +# +# +# === \Parent +# +# An element may have a parent. +# +# Its parent may be assigned explicitly when the element is created: +# +# e0 = REXML::Element.new('foo') +# e1 = REXML::Element.new('bar', e0) +# e1.parent # => ... +# +# Note: the representation of an element always shows the element's name. +# If the element has children, the representation indicates that +# by including an ellipsis (...). +# +# The parent may be assigned explicitly at any time: +# +# e2 = REXML::Element.new('baz') +# e1.parent = e2 +# e1.parent # => +# +# When an element is added as a child, its parent is set automatically: +# +# e1.add_element(e0) +# e0.parent # => ... +# +# For an element that has no parent, method +parent+ returns +nil+. +# +# === Children +# +# An element has zero or more children. +# The children are an ordered collection +# of all objects whose parent is the element itself. +# +# The children may include any combination of elements, text, comments, +# processing instructions, and CDATA. +# (This example keeps things clean by controlling whitespace +# via a +context+ setting.) +# +# xml_string = <<-EOT +# +# +# text 0 +# +# +# +# +# text 1 +# +# +# +# +# EOT +# context = {ignore_whitespace_nodes: :all, compress_whitespace: :all} +# d = REXML::Document.new(xml_string, context) +# root = d.root +# root.children.size # => 10 +# root.each {|child| p "#{child.class}: #{child}" } +# +# Output: +# +# "REXML::Element: " +# "REXML::Text: \n text 0\n " +# "REXML::Comment: comment 0" +# "REXML::Instruction: " +# "REXML::CData: cdata 0" +# "REXML::Element: " +# "REXML::Text: \n text 1\n " +# "REXML::Comment: comment 1" +# "REXML::Instruction: " +# "REXML::CData: cdata 1" +# +# A child may be added using inherited methods +# Parent#insert_before or Parent#insert_after: +# +# xml_string = '' +# d = REXML::Document.new(xml_string) +# root = d.root +# c = d.root[1] # => +# root.insert_before(c, REXML::Element.new('b')) +# root.to_a # => [, , , ] +# +# A child may be replaced using Parent#replace_child: +# +# root.replace_child(c, REXML::Element.new('x')) +# root.to_a # => [, , , ] +# +# A child may be removed using Parent#delete: +# +# x = root[2] # => +# root.delete(x) +# root.to_a # => [, , ] +# +# === Siblings +# +# An element has zero or more siblings, +# which are the other children of the element's parent. +# +# In the example above, element +ele_1+ is between a CDATA sibling +# and a text sibling: +# +# ele_1 = root[5] # => +# ele_1.previous_sibling # => "cdata 0" +# ele_1.next_sibling # => "\n text 1\n " +# +# === \Attributes +# +# An element has zero or more named attributes. +# +# A new element has no attributes: +# +# e = REXML::Element.new('foo') +# e.attributes # => {} +# +# Attributes may be added: +# +# e.add_attribute('bar', 'baz') +# e.add_attribute('bat', 'bam') +# e.attributes.size # => 2 +# e['bar'] # => "baz" +# e['bat'] # => "bam" +# +# An existing attribute may be modified: +# +# e.add_attribute('bar', 'bad') +# e.attributes.size # => 2 +# e['bar'] # => "bad" +# +# An existing attribute may be deleted: +# +# e.delete_attribute('bar') +# e.attributes.size # => 1 +# e['bar'] # => nil +# +# == What's Here +# +# To begin with, what's elsewhere? +# +# \Class \REXML::Element inherits from its ancestor classes: +# +# - REXML::Child +# - REXML::Parent +# +# \REXML::Element itself and its ancestors also include modules: +# +# - {Enumerable}[https://docs.ruby-lang.org/en/master/Enumerable.html] +# - REXML::Namespace +# - REXML::Node +# - REXML::XMLTokens +# +# === Methods for Creating an \Element +# +# ::new:: Returns a new empty element. +# #clone:: Returns a clone of another element. +# +# === Methods for Attributes +# +# {[attribute_name]}[#method-i-5B-5D]:: Returns an attribute value. +# #add_attribute:: Adds a new attribute. +# #add_attributes:: Adds multiple new attributes. +# #attribute:: Returns the attribute value for a given name and optional namespace. +# #delete_attribute:: Removes an attribute. +# +# === Methods for Children +# +# {[index]}[#method-i-5B-5D]:: Returns the child at the given offset. +# #add_element:: Adds an element as the last child. +# #delete_element:: Deletes a child element. +# #each_element:: Calls the given block with each child element. +# #each_element_with_attribute:: Calls the given block with each child element +# that meets given criteria, +# which can include the attribute name. +# #each_element_with_text:: Calls the given block with each child element +# that meets given criteria, +# which can include text. +# #get_elements:: Returns an array of element children that match a given xpath. +# +# === Methods for \Text Children +# +# #add_text:: Adds a text node to the element. +# #get_text:: Returns a text node that meets specified criteria. +# #text:: Returns the text string from the first node that meets specified criteria. +# #texts:: Returns an array of the text children of the element. +# #text=:: Adds, removes, or replaces the first text child of the element +# +# === Methods for Other Children +# +# #cdatas:: Returns an array of the cdata children of the element. +# #comments:: Returns an array of the comment children of the element. +# #instructions:: Returns an array of the instruction children of the element. +# +# === Methods for Namespaces +# +# #add_namespace:: Adds a namespace to the element. +# #delete_namespace:: Removes a namespace from the element. +# #namespace:: Returns the string namespace URI for the element. +# #namespaces:: Returns a hash of all defined namespaces in the element. +# #prefixes:: Returns an array of the string prefixes (names) +# of all defined namespaces in the element +# +# === Methods for Querying +# +# #document:: Returns the document, if any, that the element belongs to. +# #root:: Returns the most distant element (not document) ancestor of the element. +# #root_node:: Returns the most distant ancestor of the element. +# #xpath:: Returns the string xpath to the element +# relative to the most distant parent +# #has_attributes?:: Returns whether the element has attributes. +# #has_elements?:: Returns whether the element has elements. +# #has_text?:: Returns whether the element has text. +# #next_element:: Returns the next sibling that is an element. +# #previous_element:: Returns the previous sibling that is an element. +# #raw:: Returns whether raw mode is set for the element. +# #whitespace:: Returns whether whitespace is respected for the element. +# #ignore_whitespace_nodes:: Returns whether whitespace nodes +# are to be ignored for the element. +# #node_type:: Returns symbol :element. +# +# === One More Method +# +# #inspect:: Returns a string representation of the element. +# +# === Accessors +# +# #elements:: Returns the REXML::Elements object for the element. +# #attributes:: Returns the REXML::Attributes object for the element. +# #context:: Returns or sets the context hash for the element. +# +# pkg:gem/rexml#lib/rexml/element.rb:271 +class REXML::Element < ::REXML::Parent + include ::REXML::XMLTokens + include ::REXML::Namespace + + # :call-seq: + # Element.new(name = 'UNDEFINED', parent = nil, context = nil) -> new_element + # Element.new(element, parent = nil, context = nil) -> new_element + # + # Returns a new \REXML::Element object. + # + # When no arguments are given, + # returns an element with name 'UNDEFINED': + # + # e = REXML::Element.new # => + # e.class # => REXML::Element + # e.name # => "UNDEFINED" + # + # When only argument +name+ is given, + # returns an element of the given name: + # + # REXML::Element.new('foo') # => + # + # When only argument +element+ is given, it must be an \REXML::Element object; + # returns a shallow copy of the given element: + # + # e0 = REXML::Element.new('foo') + # e1 = REXML::Element.new(e0) # => + # + # When argument +parent+ is also given, it must be an REXML::Parent object: + # + # e = REXML::Element.new('foo', REXML::Parent.new) + # e.parent # => #]> + # + # When argument +context+ is also given, it must be a hash + # representing the context for the element; + # see {Element Context}[../doc/rexml/context_rdoc.html]: + # + # e = REXML::Element.new('foo', nil, {raw: :all}) + # e.context # => {:raw=>:all} + # + # pkg:gem/rexml#lib/rexml/element.rb:319 + def initialize(arg = T.unsafe(nil), parent = T.unsafe(nil), context = T.unsafe(nil)); end + + # :call-seq: + # [index] -> object + # [attr_name] -> attr_value + # [attr_sym] -> attr_value + # + # With integer argument +index+ given, + # returns the child at offset +index+, or +nil+ if none: + # + # d = REXML::Document.new '>textmore' + # root = d.root + # (0..root.size).each do |index| + # node = root[index] + # p "#{index}: #{node} (#{node.class})" + # end + # + # Output: + # + # "0: (REXML::Element)" + # "1: text (REXML::Text)" + # "2: (REXML::Element)" + # "3: more (REXML::Text)" + # "4: (REXML::Element)" + # "5: (NilClass)" + # + # With string argument +attr_name+ given, + # returns the string value for the given attribute name if it exists, + # otherwise +nil+: + # + # d = REXML::Document.new('') + # root = d.root + # root['attr'] # => "value" + # root['nosuch'] # => nil + # + # With symbol argument +attr_sym+ given, + # returns [attr_sym.to_s]: + # + # root[:attr] # => "value" + # root[:nosuch] # => nil + # + # pkg:gem/rexml#lib/rexml/element.rb:1238 + def [](name_or_index); end + + # :call-seq: + # add_attribute(name, value) -> value + # add_attribute(attribute) -> attribute + # + # Adds an attribute to this element, overwriting any existing attribute + # by the same name. + # + # With string argument +name+ and object +value+ are given, + # adds the attribute created with that name and value: + # + # e = REXML::Element.new + # e.add_attribute('attr', 'value') # => "value" + # e['attr'] # => "value" + # e.add_attribute('attr', 'VALUE') # => "VALUE" + # e['attr'] # => "VALUE" + # + # With only attribute object +attribute+ given, + # adds the given attribute: + # + # a = REXML::Attribute.new('attr', 'value') + # e.add_attribute(a) # => attr='value' + # e['attr'] # => "value" + # a = REXML::Attribute.new('attr', 'VALUE') + # e.add_attribute(a) # => attr='VALUE' + # e['attr'] # => "VALUE" + # + # pkg:gem/rexml#lib/rexml/element.rb:1336 + def add_attribute(key, value = T.unsafe(nil)); end + + # :call-seq: + # add_attributes(hash) -> hash + # add_attributes(array) + # + # Adds zero or more attributes to the element; + # returns the argument. + # + # If hash argument +hash+ is given, + # each key must be a string; + # adds each attribute created with the key/value pair: + # + # e = REXML::Element.new + # h = {'foo' => 'bar', 'baz' => 'bat'} + # e.add_attributes(h) + # + # If argument +array+ is given, + # each array member must be a 2-element array [name, value]; + # each name must be a string: + # + # e = REXML::Element.new + # a = [['foo' => 'bar'], ['baz' => 'bat']] + # e.add_attributes(a) + # + # pkg:gem/rexml#lib/rexml/element.rb:1367 + def add_attributes(hash); end + + # :call-seq: + # add_element(name, attributes = nil) -> new_element + # add_element(element, attributes = nil) -> element + # + # Adds a child element, optionally setting attributes + # on the added element; returns the added element. + # + # With string argument +name+, creates a new element with that name + # and adds the new element as a child: + # + # e0 = REXML::Element.new('foo') + # e0.add_element('bar') + # e0[0] # => + # + # + # With argument +name+ and hash argument +attributes+, + # sets attributes on the new element: + # + # e0.add_element('baz', {'bat' => '0', 'bam' => '1'}) + # e0[1] # => + # + # With element argument +element+, adds that element as a child: + # + # e0 = REXML::Element.new('foo') + # e1 = REXML::Element.new('bar') + # e0.add_element(e1) + # e0[0] # => + # + # With argument +element+ and hash argument +attributes+, + # sets attributes on the added element: + # + # e0.add_element(e1, {'bat' => '0', 'bam' => '1'}) + # e0[1] # => + # + # pkg:gem/rexml#lib/rexml/element.rb:725 + def add_element(element, attrs = T.unsafe(nil)); end + + # :call-seq: + # add_namespace(prefix, uri = nil) -> self + # + # Adds a namespace to the element; returns +self+. + # + # With the single argument +prefix+, + # adds a namespace using the given +prefix+ and the namespace URI: + # + # e = REXML::Element.new('foo') + # e.add_namespace('bar') + # e.namespaces # => {"xmlns"=>"bar"} + # + # With both arguments +prefix+ and +uri+ given, + # adds a namespace using both arguments: + # + # e.add_namespace('baz', 'bat') + # e.namespaces # => {"xmlns"=>"bar", "baz"=>"bat"} + # + # pkg:gem/rexml#lib/rexml/element.rb:648 + def add_namespace(prefix, uri = T.unsafe(nil)); end + + # :call-seq: + # add_text(string) -> nil + # add_text(text_node) -> self + # + # Adds text to the element. + # + # When string argument +string+ is given, returns +nil+. + # + # If the element has no child text node, + # creates a \REXML::Text object using the string, + # honoring the current settings for whitespace and raw, + # then adds that node to the element: + # + # d = REXML::Document.new('') + # a = d.root + # a.add_text('foo') + # a.to_a # => [, "foo"] + # + # If the element has child text nodes, + # appends the string to the _last_ text node: + # + # d = REXML::Document.new('foobar') + # a = d.root + # a.add_text('baz') + # a.to_a # => ["foo", , "barbaz"] + # a.add_text('baz') + # a.to_a # => ["foo", , "barbazbaz"] + # + # When text node argument +text_node+ is given, + # appends the node as the last text node in the element; + # returns +self+: + # + # d = REXML::Document.new('foobar') + # a = d.root + # a.add_text(REXML::Text.new('baz')) + # a.to_a # => ["foo", , "bar", "baz"] + # a.add_text(REXML::Text.new('baz')) + # a.to_a # => ["foo", , "bar", "baz", "baz"] + # + # pkg:gem/rexml#lib/rexml/element.rb:1139 + def add_text(text); end + + # :call-seq: + # attribute(name, namespace = nil) + # + # Returns the string value for the given attribute name. + # + # With only argument +name+ given, + # returns the value of the named attribute if it exists, otherwise +nil+: + # + # xml_string = <<-EOT + # + # + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # root = d.root + # a = root[1] # => + # a.attribute('attr') # => attr='value' + # a.attribute('nope') # => nil + # + # With arguments +name+ and +namespace+ given, + # returns the value of the named attribute if it exists, otherwise +nil+: + # + # xml_string = "" + # document = REXML::Document.new(xml_string) + # document.root.attribute("x") # => x='x' + # document.root.attribute("x", "a") # => a:x='a:x' + # + # pkg:gem/rexml#lib/rexml/element.rb:1279 + def attribute(name, namespace = T.unsafe(nil)); end + + # Mechanisms for accessing attributes and child elements of this + # element. + # + # pkg:gem/rexml#lib/rexml/element.rb:278 + def attributes; end + + # :call-seq: + # cdatas -> array_of_cdata_children + # + # Returns a frozen array of the REXML::CData children of the element: + # + # xml_string = <<-EOT + # + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # cds = d.root.cdatas # => ["foo", "bar"] + # cds.frozen? # => true + # cds.map {|cd| cd.class } # => [REXML::CData, REXML::CData] + # + # pkg:gem/rexml#lib/rexml/element.rb:1411 + def cdatas; end + + # :call-seq: + # clone -> new_element + # + # Returns a shallow copy of the element, containing the name and attributes, + # but not the parent or children: + # + # e = REXML::Element.new('foo') + # e.add_attributes({'bar' => 0, 'baz' => 1}) + # e.clone # => + # + # pkg:gem/rexml#lib/rexml/element.rb:383 + def clone; end + + # :call-seq: + # comments -> array_of_comment_children + # + # Returns a frozen array of the REXML::Comment children of the element: + # + # xml_string = <<-EOT + # + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # cs = d.root.comments + # cs.frozen? # => true + # cs.map {|c| c.class } # => [REXML::Comment, REXML::Comment] + # cs.map {|c| c.to_s } # => ["foo", "bar"] + # + # pkg:gem/rexml#lib/rexml/element.rb:1432 + def comments; end + + # The context holds information about the processing environment, such as + # whitespace handling. + # + # pkg:gem/rexml#lib/rexml/element.rb:281 + def context; end + + # The context holds information about the processing environment, such as + # whitespace handling. + # + # pkg:gem/rexml#lib/rexml/element.rb:281 + def context=(_arg0); end + + # :call-seq: + # delete_attribute(name) -> removed_attribute or nil + # + # Removes a named attribute if it exists; + # returns the removed attribute if found, otherwise +nil+: + # + # e = REXML::Element.new('foo') + # e.add_attribute('bar', 'baz') + # e.delete_attribute('bar') # => + # e.delete_attribute('bar') # => nil + # + # pkg:gem/rexml#lib/rexml/element.rb:1386 + def delete_attribute(key); end + + # :call-seq: + # delete_element(index) -> removed_element or nil + # delete_element(element) -> removed_element or nil + # delete_element(xpath) -> removed_element or nil + # + # Deletes a child element. + # + # When 1-based integer argument +index+ is given, + # removes and returns the child element at that offset if it exists; + # indexing does not include text nodes; + # returns +nil+ if the element does not exist: + # + # d = REXML::Document.new 'text' + # a = d.root # => ... + # a.delete_element(1) # => + # a.delete_element(1) # => + # a.delete_element(1) # => nil + # + # When element argument +element+ is given, + # removes and returns that child element if it exists, + # otherwise returns +nil+: + # + # d = REXML::Document.new 'text' + # a = d.root # => ... + # c = a[2] # => + # a.delete_element(c) # => + # a.delete_element(c) # => nil + # + # When xpath argument +xpath+ is given, + # removes and returns the element at xpath if it exists, + # otherwise returns +nil+: + # + # d = REXML::Document.new 'text' + # a = d.root # => ... + # a.delete_element('//c') # => + # a.delete_element('//c') # => nil + # + # pkg:gem/rexml#lib/rexml/element.rb:771 + def delete_element(element); end + + # :call-seq: + # delete_namespace(namespace = 'xmlns') -> self + # + # Removes a namespace from the element. + # + # With no argument, removes the default namespace: + # + # d = REXML::Document.new "" + # d.to_s # => "" + # d.root.delete_namespace # => + # d.to_s # => "" + # + # With argument +namespace+, removes the specified namespace: + # + # d.root.delete_namespace('foo') + # d.to_s # => "" + # + # Does nothing if no such namespace is found: + # + # d.root.delete_namespace('nosuch') + # d.to_s # => "" + # + # pkg:gem/rexml#lib/rexml/element.rb:680 + def delete_namespace(namespace = T.unsafe(nil)); end + + # :call-seq: + # document -> document or nil + # + # If the element is part of a document, returns that document: + # + # d = REXML::Document.new('') + # top_element = d.first + # child = top_element.first + # top_element.document == d # => true + # child.document == d # => true + # + # If the element is not part of a document, returns +nil+: + # + # REXML::Element.new.document # => nil + # + # For a document, returns +self+: + # + # d.document == d # => true + # + # Related: #root, #root_node. + # + # pkg:gem/rexml#lib/rexml/element.rb:475 + def document; end + + # :call-seq: + # each_element {|e| ... } + # + # Calls the given block with each child element: + # + # d = REXML::Document.new 'bbd' + # a = d.root + # a.each_element {|e| p e } + # + # Output: + # + # ... + # ... + # ... + # + # + # pkg:gem/rexml#lib/rexml/element.rb:923 + def each_element(xpath = T.unsafe(nil), &block); end + + # :call-seq: + # each_element_with_attribute(attr_name, value = nil, max = 0, xpath = nil) {|e| ... } + # + # Calls the given block with each child element that meets given criteria. + # + # When only string argument +attr_name+ is given, + # calls the block with each child element that has that attribute: + # + # d = REXML::Document.new '' + # a = d.root + # a.each_element_with_attribute('id') {|e| p e } + # + # Output: + # + # + # + # + # + # With argument +attr_name+ and string argument +value+ given, + # calls the block with each child element that has that attribute + # with that value: + # + # a.each_element_with_attribute('id', '1') {|e| p e } + # + # Output: + # + # + # + # + # With arguments +attr_name+, +value+, and integer argument +max+ given, + # calls the block with at most +max+ child elements: + # + # a.each_element_with_attribute('id', '1', 1) {|e| p e } + # + # Output: + # + # + # + # With all arguments given, including +xpath+, + # calls the block with only those child elements + # that meet the first three criteria, + # and also match the given +xpath+: + # + # a.each_element_with_attribute('id', '1', 2, '//d') {|e| p e } + # + # Output: + # + # + # + # pkg:gem/rexml#lib/rexml/element.rb:840 + def each_element_with_attribute(key, value = T.unsafe(nil), max = T.unsafe(nil), name = T.unsafe(nil), &block); end + + # :call-seq: + # each_element_with_text(text = nil, max = 0, xpath = nil) {|e| ... } + # + # Calls the given block with each child element that meets given criteria. + # + # With no arguments, calls the block with each child element that has text: + # + # d = REXML::Document.new 'bbd' + # a = d.root + # a.each_element_with_text {|e| p e } + # + # Output: + # + # ... + # ... + # ... + # + # With the single string argument +text+, + # calls the block with each element that has exactly that text: + # + # a.each_element_with_text('b') {|e| p e } + # + # Output: + # + # ... + # ... + # + # With argument +text+ and integer argument +max+, + # calls the block with at most +max+ elements: + # + # a.each_element_with_text('b', 1) {|e| p e } + # + # Output: + # + # ... + # + # With all arguments given, including +xpath+, + # calls the block with only those child elements + # that meet the first two criteria, + # and also match the given +xpath+: + # + # a.each_element_with_text('b', 2, '//c') {|e| p e } + # + # Output: + # + # ... + # + # pkg:gem/rexml#lib/rexml/element.rb:897 + def each_element_with_text(text = T.unsafe(nil), max = T.unsafe(nil), name = T.unsafe(nil), &block); end + + # Mechanisms for accessing attributes and child elements of this + # element. + # + # pkg:gem/rexml#lib/rexml/element.rb:278 + def elements; end + + # :call-seq: + # get_elements(xpath) + # + # Returns an array of the elements that match the given +xpath+: + # + # xml_string = <<-EOT + # + # + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # d.root.get_elements('//a') # => [ ... , ] + # + # pkg:gem/rexml#lib/rexml/element.rb:942 + def get_elements(xpath); end + + # :call-seq: + # get_text(xpath = nil) -> text_node or nil + # + # Returns the first text node child in a specified element, if it exists, + # +nil+ otherwise. + # + # With no argument, returns the first text node from +self+: + # + # d = REXML::Document.new "

some text this is bold! more text

" + # d.root.get_text.class # => REXML::Text + # d.root.get_text # => "some text " + # + # With argument +xpath+, returns the first text node from the element + # that matches +xpath+: + # + # d.root.get_text(1) # => "this is bold!" + # + # pkg:gem/rexml#lib/rexml/element.rb:1045 + def get_text(path = T.unsafe(nil)); end + + # :call-seq: + # has_attributes? -> true or false + # + # Returns +true+ if the element has attributes, +false+ otherwise: + # + # d = REXML::Document.new('
') + # a, b = *d.root + # a.has_attributes? # => true + # b.has_attributes? # => false + # + # pkg:gem/rexml#lib/rexml/element.rb:1306 + def has_attributes?; end + + # :call-seq: + # has_elements? + # + # Returns +true+ if the element has one or more element children, + # +false+ otherwise: + # + # d = REXML::Document.new 'text' + # a = d.root # => ... + # a.has_elements? # => true + # b = a[0] # => + # b.has_elements? # => false + # + # pkg:gem/rexml#lib/rexml/element.rb:787 + def has_elements?; end + + # :call-seq: + # has_text? -> true or false + # + # Returns +true+ if the element has one or more text noded, + # +false+ otherwise: + # + # d = REXML::Document.new 'text' + # a = d.root + # a.has_text? # => true + # b = a[0] + # b.has_text? # => false + # + # pkg:gem/rexml#lib/rexml/element.rb:995 + def has_text?; end + + # :call-seq: + # ignore_whitespace_nodes + # + # Returns +true+ if whitespace nodes are ignored for the element. + # + # See {Element Context}[../doc/rexml/context_rdoc.html]. + # + # pkg:gem/rexml#lib/rexml/element.rb:512 + def ignore_whitespace_nodes; end + + # :call-seq: + # inspect -> string + # + # Returns a string representation of the element. + # + # For an element with no attributes and no children, shows the element name: + # + # REXML::Element.new.inspect # => "" + # + # Shows attributes, if any: + # + # e = REXML::Element.new('foo') + # e.add_attributes({'bar' => 0, 'baz' => 1}) + # e.inspect # => "" + # + # Shows an ellipsis (...), if there are child elements: + # + # e.add_element(REXML::Element.new('bar')) + # e.add_element(REXML::Element.new('baz')) + # e.inspect # => " ... " + # + # pkg:gem/rexml#lib/rexml/element.rb:358 + def inspect; end + + # :call-seq: + # instructions -> array_of_instruction_children + # + # Returns a frozen array of the REXML::Instruction children of the element: + # + # xml_string = <<-EOT + # + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # is = d.root.instructions + # is.frozen? # => true + # is.map {|i| i.class } # => [REXML::Instruction, REXML::Instruction] + # is.map {|i| i.to_s } # => ["", ""] + # + # pkg:gem/rexml#lib/rexml/element.rb:1453 + def instructions; end + + # :call-seq: + # namespace(prefix = nil) -> string_uri or nil + # + # Returns the string namespace URI for the element, + # possibly deriving from one of its ancestors. + # + # xml_string = <<-EOT + # + # + # + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # b = d.elements['//b'] + # b.namespace # => "1" + # b.namespace('y') # => "2" + # b.namespace('nosuch') # => nil + # + # pkg:gem/rexml#lib/rexml/element.rb:619 + def namespace(prefix = T.unsafe(nil)); end + + # :call-seq: + # namespaces -> array_of_namespace_names + # + # Returns a hash of all defined namespaces + # in the element and its ancestors: + # + # xml_string = <<-EOT + # + # + # + # + # + # + # EOT + # d = REXML::Document.new(xml_string) + # d.elements['//a'].namespaces # => {"x"=>"1", "y"=>"2"} + # d.elements['//b'].namespaces # => {"x"=>"1", "y"=>"2"} + # d.elements['//c'].namespaces # => {"x"=>"1", "y"=>"2", "z"=>"3"} + # + # pkg:gem/rexml#lib/rexml/element.rb:590 + def namespaces; end + + # :call-seq: + # next_element + # + # Returns the next sibling that is an element if it exists, + # +niL+ otherwise: + # + # d = REXML::Document.new 'text' + # d.root.elements['b'].next_element #-> + # d.root.elements['c'].next_element #-> nil + # + # pkg:gem/rexml#lib/rexml/element.rb:956 + def next_element; end + + # :call-seq: + # node_type -> :element + # + # Returns symbol :element: + # + # d = REXML::Document.new('') + # a = d.root # => + # a.node_type # => :element + # + # pkg:gem/rexml#lib/rexml/element.rb:1160 + def node_type; end + + # :call-seq: + # prefixes -> array_of_namespace_prefixes + # + # Returns an array of the string prefixes (names) of all defined namespaces + # in the element and its ancestors: + # + # xml_string = <<-EOT + # + # + # + # + # + # + # EOT + # d = REXML::Document.new(xml_string, {compress_whitespace: :all}) + # d.elements['//a'].prefixes # => ["x", "y"] + # d.elements['//b'].prefixes # => ["x", "y"] + # d.elements['//c'].prefixes # => ["x", "y", "z"] + # + # pkg:gem/rexml#lib/rexml/element.rb:564 + def prefixes; end + + # :call-seq: + # previous_element + # + # Returns the previous sibling that is an element if it exists, + # +niL+ otherwise: + # + # d = REXML::Document.new 'text' + # d.root.elements['c'].previous_element #-> + # d.root.elements['b'].previous_element #-> nil + # + # pkg:gem/rexml#lib/rexml/element.rb:972 + def previous_element; end + + # :call-seq: + # raw + # + # Returns +true+ if raw mode is set for the element. + # + # See {Element Context}[../doc/rexml/context_rdoc.html]. + # + # The evaluation is tested against +expanded_name+, and so is namespace + # sensitive. + # + # pkg:gem/rexml#lib/rexml/element.rb:532 + def raw; end + + # :call-seq: + # root -> element + # + # Returns the most distant _element_ (not document) ancestor of the element: + # + # d = REXML::Document.new('') + # top_element = d.first + # child = top_element.first + # top_element.root == top_element # => true + # child.root == top_element # => true + # + # For a document, returns the topmost element: + # + # d.root == top_element # => true + # + # Related: #root_node, #document. + # + # pkg:gem/rexml#lib/rexml/element.rb:443 + def root; end + + # :call-seq: + # root_node -> document or element + # + # Returns the most distant ancestor of +self+. + # + # When the element is part of a document, + # returns the root node of the document. + # Note that the root node is different from the document element; + # in this example +a+ is document element and the root node is its parent: + # + # d = REXML::Document.new('') + # top_element = d.first # => ... + # child = top_element.first # => ... + # d.root_node == d # => true + # top_element.root_node == d # => true + # child.root_node == d # => true + # + # When the element is not part of a document, but does have ancestor elements, + # returns the most distant ancestor element: + # + # e0 = REXML::Element.new('foo') + # e1 = REXML::Element.new('bar') + # e1.parent = e0 + # e2 = REXML::Element.new('baz') + # e2.parent = e1 + # e2.root_node == e0 # => true + # + # When the element has no ancestor elements, + # returns +self+: + # + # e = REXML::Element.new('foo') + # e.root_node == e # => true + # + # Related: #root, #document. + # + # pkg:gem/rexml#lib/rexml/element.rb:422 + def root_node; end + + # :call-seq: + # text(xpath = nil) -> text_string or nil + # + # Returns the text string from the first text node child + # in a specified element, if it exists, +nil+ otherwise. + # + # With no argument, returns the text from the first text node in +self+: + # + # d = REXML::Document.new "

some text this is bold! more text

" + # d.root.text.class # => String + # d.root.text # => "some text " + # + # With argument +xpath+, returns text from the first text node + # in the element that matches +xpath+: + # + # d.root.text(1) # => "this is bold!" + # + # Note that an element may have multiple text nodes, + # possibly separated by other non-text children, as above. + # Even so, the returned value is the string text from the first such node. + # + # Note also that the text note is retrieved by method get_text, + # and so is always normalized text. + # + # pkg:gem/rexml#lib/rexml/element.rb:1023 + def text(path = T.unsafe(nil)); end + + # :call-seq: + # text = string -> string + # text = nil -> nil + # + # Adds, replaces, or removes the first text node child in the element. + # + # With string argument +string+, + # creates a new \REXML::Text node containing that string, + # honoring the current settings for whitespace and row, + # then places the node as the first text child in the element; + # returns +string+. + # + # If the element has no text child, the text node is added: + # + # d = REXML::Document.new '
' + # d.root.text = 'foo' #-> 'foo' + # + # If the element has a text child, it is replaced: + # + # d.root.text = 'bar' #-> 'bar' + # + # With argument +nil+, removes the first text child: + # + # d.root.text = nil #-> '' + # + # pkg:gem/rexml#lib/rexml/element.rb:1081 + def text=(text); end + + # :call-seq: + # texts -> array_of_text_children + # + # Returns a frozen array of the REXML::Text children of the element: + # + # xml_string = 'textmore' + # d = REXML::Document.new(xml_string) + # ts = d.root.texts + # ts.frozen? # => true + # ts.map {|t| t.class } # => [REXML::Text, REXML::Text] + # ts.map {|t| t.to_s } # => ["text", "more"] + # + # pkg:gem/rexml#lib/rexml/element.rb:1469 + def texts; end + + # :call-seq: + # whitespace + # + # Returns +true+ if whitespace is respected for this element, + # +false+ otherwise. + # + # See {Element Context}[../doc/rexml/context_rdoc.html]. + # + # The evaluation is tested against the element's +expanded_name+, + # and so is namespace-sensitive. + # + # pkg:gem/rexml#lib/rexml/element.rb:489 + def whitespace; end + + # == DEPRECATED + # See REXML::Formatters + # + # Writes out this element, and recursively, all children. + # output:: + # output an object which supports '<< string'; this is where the + # document will be written. + # indent:: + # An integer. If -1, no indenting will be used; otherwise, the + # indentation will be this number of spaces, and children will be + # indented an additional amount. Defaults to -1 + # transitive:: + # If transitive is true and indent is >= 0, then the output will be + # pretty-printed in such a way that the added whitespace does not affect + # the parse tree of the document + # ie_hack:: + # This hack inserts a space before the /> on empty tags to address + # a limitation of Internet Explorer. Defaults to false + # + # out = '' + # doc.write( out ) #-> doc is written to the string 'out' + # doc.write( $stdout ) #-> doc written to the console + # + # pkg:gem/rexml#lib/rexml/element.rb:1495 + def write(output = T.unsafe(nil), indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end + + # :call-seq: + # xpath -> string_xpath + # + # Returns the string xpath to the element + # relative to the most distant parent: + # + # d = REXML::Document.new('') + # a = d.root # => ... + # b = a[0] # => ... + # c = b[0] # => + # d.xpath # => "" + # a.xpath # => "/a" + # b.xpath # => "/a/b" + # c.xpath # => "/a/b/c" + # + # If there is no parent, returns the expanded name of the element: + # + # e = REXML::Element.new('foo') + # e.xpath # => "foo" + # + # pkg:gem/rexml#lib/rexml/element.rb:1184 + def xpath; end + + private + + # pkg:gem/rexml#lib/rexml/element.rb:1519 + def __to_xpath_helper(node); end + + # pkg:gem/rexml#lib/rexml/element.rb:1511 + def calculate_namespaces; end + + # A private helper method + # + # pkg:gem/rexml#lib/rexml/element.rb:1534 + def each_with_something(test, max = T.unsafe(nil), name = T.unsafe(nil)); end +end + +# pkg:gem/rexml#lib/rexml/doctype.rb:257 +class REXML::ElementDecl < ::REXML::Declaration + # pkg:gem/rexml#lib/rexml/doctype.rb:258 + def initialize(src); end +end + +# A class which provides filtering of children for Elements, and +# XPath search support. You are expected to only encounter this class as +# the element.elements object. Therefore, you are +# _not_ expected to instantiate this yourself. +# +# xml_string = <<-EOT +# +# +# +# Everyday Italian +# Giada De Laurentiis +# 2005 +# 30.00 +# +# +# Harry Potter +# J K. Rowling +# 2005 +# 29.99 +# +# +# XQuery Kick Start +# James McGovern +# Per Bothner +# Kurt Cagle +# James Linn +# Vaidyanathan Nagarajan +# 2003 +# 49.99 +# +# +# Learning XML +# Erik T. Ray +# 2003 +# 39.95 +# +# +# EOT +# d = REXML::Document.new(xml_string) +# elements = d.root.elements +# elements # => # ... > +# +# pkg:gem/rexml#lib/rexml/element.rb:1589 +class REXML::Elements + include ::Enumerable + + # :call-seq: + # new(parent) -> new_elements_object + # + # Returns a new \Elements object with the given +parent+. + # Does _not_ assign parent.elements = self: + # + # d = REXML::Document.new(xml_string) + # eles = REXML::Elements.new(d.root) + # eles # => # ... > + # eles == d.root.elements # => false + # + # pkg:gem/rexml#lib/rexml/element.rb:1602 + def initialize(parent); end + + # pkg:gem/rexml#lib/rexml/element.rb:1927 + def <<(element = T.unsafe(nil)); end + + # :call-seq: + # elements[index] -> element or nil + # elements[xpath] -> element or nil + # elements[n, name] -> element or nil + # + # Returns the first \Element object selected by the arguments, + # if any found, or +nil+ if none found. + # + # Notes: + # - The +index+ is 1-based, not 0-based, so that: + # - The first element has index 1 + # - The _nth_ element has index +n+. + # - The selection ignores non-\Element nodes. + # + # When the single argument +index+ is given, + # returns the element given by the index, if any; otherwise, +nil+: + # + # d = REXML::Document.new(xml_string) + # eles = d.root.elements + # eles # => # ... > + # eles[1] # => ... + # eles.size # => 4 + # eles[4] # => ... + # eles[5] # => nil + # + # The node at this index is not an \Element, and so is not returned: + # + # eles = d.root.first.first # => ... </> + # eles.to_a # => ["Everyday Italian"] + # eles[1] # => nil + # + # When the single argument +xpath+ is given, + # returns the first element found via that +xpath+, if any; otherwise, +nil+: + # + # eles = d.root.elements # => #<REXML::Elements @element=<bookstore> ... </>> + # eles['/bookstore'] # => <bookstore> ... </> + # eles['//book'] # => <book category='cooking'> ... </> + # eles['//book [@category="children"]'] # => <book category='children'> ... </> + # eles['/nosuch'] # => nil + # eles['//nosuch'] # => nil + # eles['//book [@category="nosuch"]'] # => nil + # eles['.'] # => <bookstore> ... </> + # eles['..'].class # => REXML::Document + # + # With arguments +n+ and +name+ given, + # returns the _nth_ found element that has the given +name+, + # or +nil+ if there is no such _nth_ element: + # + # eles = d.root.elements # => #<REXML::Elements @element=<bookstore> ... </>> + # eles[1, 'book'] # => <book category='cooking'> ... </> + # eles[4, 'book'] # => <book category='web' cover='paperback'> ... </> + # eles[5, 'book'] # => nil + # + # pkg:gem/rexml#lib/rexml/element.rb:1674 + def [](index, name = T.unsafe(nil)); end + + # :call-seq: + # elements[] = index, replacement_element -> replacement_element or nil + # + # Replaces or adds an element. + # + # When <tt>eles[index]</tt> exists, replaces it with +replacement_element+ + # and returns +replacement_element+: + # + # d = REXML::Document.new(xml_string) + # eles = d.root.elements # => #<REXML::Elements @element=<bookstore> ... </>> + # eles[1] # => <book category='cooking'> ... </> + # eles[1] = REXML::Element.new('foo') + # eles[1] # => <foo/> + # + # Does nothing (or raises an exception) + # if +replacement_element+ is not an \Element: + # eles[2] # => <book category='web' cover='paperback'> ... </> + # eles[2] = REXML::Text.new('bar') + # eles[2] # => <book category='web' cover='paperback'> ... </> + # + # When <tt>eles[index]</tt> does not exist, + # adds +replacement_element+ to the element and returns + # + # d = REXML::Document.new(xml_string) + # eles = d.root.elements # => #<REXML::Elements @element=<bookstore> ... </>> + # eles.size # => 4 + # eles[50] = REXML::Element.new('foo') # => <foo/> + # eles.size # => 5 + # eles[5] # => <foo/> + # + # Does nothing (or raises an exception) + # if +replacement_element+ is not an \Element: + # + # eles[50] = REXML::Text.new('bar') # => "bar" + # eles.size # => 5 + # + # pkg:gem/rexml#lib/rexml/element.rb:1725 + def []=(index, element); end + + # :call-seq: + # add -> new_element + # add(name) -> new_element + # add(element) -> element + # + # Adds an element; returns the element added. + # + # With no argument, creates and adds a new element. + # The new element has: + # + # - No name. + # - \Parent from the \Elements object. + # - Context from the that parent. + # + # Example: + # + # d = REXML::Document.new(xml_string) + # elements = d.root.elements + # parent = elements.parent # => <bookstore> ... </> + # parent.context = {raw: :all} + # elements.size # => 4 + # new_element = elements.add # => </> + # elements.size # => 5 + # new_element.name # => nil + # new_element.parent # => <bookstore> ... </> + # new_element.context # => {:raw=>:all} + # + # With string argument +name+, creates and adds a new element. + # The new element has: + # + # - Name +name+. + # - \Parent from the \Elements object. + # - Context from the that parent. + # + # Example: + # + # d = REXML::Document.new(xml_string) + # elements = d.root.elements + # parent = elements.parent # => <bookstore> ... </> + # parent.context = {raw: :all} + # elements.size # => 4 + # new_element = elements.add('foo') # => <foo/> + # elements.size # => 5 + # new_element.name # => "foo" + # new_element.parent # => <bookstore> ... </> + # new_element.context # => {:raw=>:all} + # + # With argument +element+, + # creates and adds a clone of the given +element+. + # The new element has name, parent, and context from the given +element+. + # + # d = REXML::Document.new(xml_string) + # elements = d.root.elements + # elements.size # => 4 + # e0 = REXML::Element.new('foo') + # e1 = REXML::Element.new('bar', e0, {raw: :all}) + # element = elements.add(e1) # => <bar/> + # elements.size # => 5 + # element.name # => "bar" + # element.parent # => <bookstore> ... </> + # element.context # => {:raw=>:all} + # + # pkg:gem/rexml#lib/rexml/element.rb:1915 + def add(element = T.unsafe(nil)); end + + # :call-seq: + # collect(xpath = nil) {|element| ... } -> array + # + # Iterates over the elements; returns the array of block return values. + # + # With no argument, iterates over all elements: + # + # d = REXML::Document.new(xml_string) + # elements = d.root.elements + # elements.collect {|element| element.size } # => [9, 9, 17, 9] + # + # With argument +xpath+, iterates over elements that match + # the given +xpath+: + # + # xpath = '//book [@category="web"]' + # elements.collect(xpath) {|element| element.size } # => [17, 9] + # + # pkg:gem/rexml#lib/rexml/element.rb:1978 + def collect(xpath = T.unsafe(nil)); end + + # :call-seq: + # delete(index) -> removed_element or nil + # delete(element) -> removed_element or nil + # delete(xpath) -> removed_element or nil + # + # Removes an element; returns the removed element, or +nil+ if none removed. + # + # With integer argument +index+ given, + # removes the child element at that offset: + # + # d = REXML::Document.new(xml_string) + # elements = d.root.elements + # elements.size # => 4 + # elements[2] # => <book category='children'> ... </> + # elements.delete(2) # => <book category='children'> ... </> + # elements.size # => 3 + # elements[2] # => <book category='web'> ... </> + # elements.delete(50) # => nil + # + # With element argument +element+ given, + # removes that child element: + # + # d = REXML::Document.new(xml_string) + # elements = d.root.elements + # ele_1, ele_2, ele_3, ele_4 = *elements + # elements.size # => 4 + # elements[2] # => <book category='children'> ... </> + # elements.delete(ele_2) # => <book category='children'> ... </> + # elements.size # => 3 + # elements[2] # => <book category='web'> ... </> + # elements.delete(ele_2) # => nil + # + # With string argument +xpath+ given, + # removes the first element found via that xpath: + # + # d = REXML::Document.new(xml_string) + # elements = d.root.elements + # elements.delete('//book') # => <book category='cooking'> ... </> + # elements.delete('//book [@category="children"]') # => <book category='children'> ... </> + # elements.delete('//nosuch') # => nil + # + # pkg:gem/rexml#lib/rexml/element.rb:1815 + def delete(element); end + + # :call-seq: + # delete_all(xpath) + # + # Removes all elements found via the given +xpath+; + # returns the array of removed elements, if any, else +nil+. + # + # d = REXML::Document.new(xml_string) + # elements = d.root.elements + # elements.size # => 4 + # deleted_elements = elements.delete_all('//book [@category="web"]') + # deleted_elements.size # => 2 + # elements.size # => 2 + # deleted_elements = elements.delete_all('//book') + # deleted_elements.size # => 2 + # elements.size # => 0 + # elements.delete_all('//book') # => [] + # + # pkg:gem/rexml#lib/rexml/element.rb:1841 + def delete_all(xpath); end + + # :call-seq: + # each(xpath = nil) {|element| ... } -> self + # + # Iterates over the elements. + # + # With no argument, calls the block with each element: + # + # d = REXML::Document.new(xml_string) + # elements = d.root.elements + # elements.each {|element| p element } + # + # Output: + # + # <book category='cooking'> ... </> + # <book category='children'> ... </> + # <book category='web'> ... </> + # <book category='web' cover='paperback'> ... </> + # + # With argument +xpath+, calls the block with each element + # that matches the given +xpath+: + # + # elements.each('//book [@category="web"]') {|element| p element } + # + # Output: + # + # <book category='web'> ... </> + # <book category='web' cover='paperback'> ... </> + # + # pkg:gem/rexml#lib/rexml/element.rb:1957 + def each(xpath = T.unsafe(nil)); end + + # :call-seq: + # empty? -> true or false + # + # Returns +true+ if there are no children, +false+ otherwise. + # + # d = REXML::Document.new('') + # d.elements.empty? # => true + # d = REXML::Document.new(xml_string) + # d.elements.empty? # => false + # + # pkg:gem/rexml#lib/rexml/element.rb:1745 + def empty?; end + + # :call-seq: + # index(element) + # + # Returns the 1-based index of the given +element+, if found; + # otherwise, returns -1: + # + # d = REXML::Document.new(xml_string) + # elements = d.root.elements + # ele_1, ele_2, ele_3, ele_4 = *elements + # elements.index(ele_4) # => 4 + # elements.delete(ele_3) + # elements.index(ele_4) # => 3 + # elements.index(ele_3) # => -1 + # + # pkg:gem/rexml#lib/rexml/element.rb:1763 + def index(element); end + + # :call-seq: + # inject(xpath = nil, initial = nil) -> object + # + # Calls the block with elements; returns the last block return value. + # + # With no argument, iterates over the elements, calling the block + # <tt>elements.size - 1</tt> times. + # + # - The first call passes the first and second elements. + # - The second call passes the first block return value and the third element. + # - The third call passes the second block return value and the fourth element. + # - And so on. + # + # In this example, the block returns the passed element, + # which is then the object argument to the next call: + # + # d = REXML::Document.new(xml_string) + # elements = d.root.elements + # elements.inject do |object, element| + # p [elements.index(object), elements.index(element)] + # element + # end + # + # Output: + # + # [1, 2] + # [2, 3] + # [3, 4] + # + # With the single argument +xpath+, calls the block only with + # elements matching that xpath: + # + # elements.inject('//book [@category="web"]') do |object, element| + # p [elements.index(object), elements.index(element)] + # element + # end + # + # Output: + # + # [3, 4] + # + # With argument +xpath+ given as +nil+ + # and argument +initial+ also given, + # calls the block once for each element. + # + # - The first call passes the +initial+ and the first element. + # - The second call passes the first block return value and the second element. + # - The third call passes the second block return value and the third element. + # - And so on. + # + # In this example, the first object index is <tt>-1</tt> + # + # elements.inject(nil, 'Initial') do |object, element| + # p [elements.index(object), elements.index(element)] + # element + # end + # + # Output: + # + # [-1, 1] + # [1, 2] + # [2, 3] + # [3, 4] + # + # In this form the passed object can be used as an accumulator: + # + # elements.inject(nil, 0) do |total, element| + # total += element.size + # end # => 44 + # + # With both arguments +xpath+ and +initial+ are given, + # calls the block only with elements matching that xpath: + # + # elements.inject('//book [@category="web"]', 0) do |total, element| + # total += element.size + # end # => 26 + # + # pkg:gem/rexml#lib/rexml/element.rb:2063 + def inject(xpath = T.unsafe(nil), initial = T.unsafe(nil)); end + + # :call-seq: + # parent + # + # Returns the parent element cited in creating the \Elements object. + # This element is also the default starting point for searching + # in the \Elements object. + # + # d = REXML::Document.new(xml_string) + # elements = REXML::Elements.new(d.root) + # elements.parent == d.root # => true + # + # pkg:gem/rexml#lib/rexml/element.rb:1617 + def parent; end + + # :call-seq: + # size -> integer + # + # Returns the count of \Element children: + # + # d = REXML::Document.new '<a>sean<b/>elliott<b/>russell<b/></a>' + # d.root.elements.size # => 3 # Three elements. + # d.root.size # => 6 # Three elements plus three text nodes.. + # + # pkg:gem/rexml#lib/rexml/element.rb:2087 + def size; end + + # :call-seq: + # to_a(xpath = nil) -> array_of_elements + # + # Returns an array of element children (not including non-element children). + # + # With no argument, returns an array of all element children: + # + # d = REXML::Document.new '<a>sean<b/>elliott<c/></a>' + # elements = d.root.elements + # elements.to_a # => [<b/>, <c/>] # Omits non-element children. + # children = d.root.children + # children # => ["sean", <b/>, "elliott", <c/>] # Includes non-element children. + # + # With argument +xpath+, returns an array of element children + # that match the xpath: + # + # elements.to_a('//c') # => [<c/>] + # + # pkg:gem/rexml#lib/rexml/element.rb:2111 + def to_a(xpath = T.unsafe(nil)); end + + private + + # Private helper class. Removes quotes from quoted strings + # + # pkg:gem/rexml#lib/rexml/element.rb:2119 + def literalize(name); end +end + +# pkg:gem/rexml#lib/rexml/encoding.rb:4 +module REXML::Encoding + # pkg:gem/rexml#lib/rexml/encoding.rb:26 + def decode(string); end + + # pkg:gem/rexml#lib/rexml/encoding.rb:22 + def encode(string); end + + # ID ---> Encoding name + # + # pkg:gem/rexml#lib/rexml/encoding.rb:6 + def encoding; end + + # pkg:gem/rexml#lib/rexml/encoding.rb:7 + def encoding=(encoding); end + + private + + # pkg:gem/rexml#lib/rexml/encoding.rb:31 + def find_encoding(name); end +end + +# pkg:gem/rexml#lib/rexml/entity.rb:7 +class REXML::Entity < ::REXML::Child + include ::REXML::XMLTokens + + # Create a new entity. Simple entities can be constructed by passing a + # name, value to the constructor; this creates a generic, plain entity + # reference. For anything more complicated, you have to pass a Source to + # the constructor with the entity definition, or use the accessor methods. + # +WARNING+: There is no validation of entity state except when the entity + # is read from a stream. If you start poking around with the accessors, + # you can easily create a non-conformant Entity. + # + # e = Entity.new( 'amp', '&' ) + # + # pkg:gem/rexml#lib/rexml/entity.rb:34 + def initialize(stream, value = T.unsafe(nil), parent = T.unsafe(nil), reference = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/entity.rb:23 + def external; end + + # pkg:gem/rexml#lib/rexml/entity.rb:23 + def name; end + + # pkg:gem/rexml#lib/rexml/entity.rb:23 + def ndata; end + + # Returns the value of this entity unprocessed -- raw. This is the + # normalized value; that is, with all %ent; and &ent; entities intact + # + # pkg:gem/rexml#lib/rexml/entity.rb:86 + def normalized; end + + # pkg:gem/rexml#lib/rexml/entity.rb:23 + def pubid; end + + # pkg:gem/rexml#lib/rexml/entity.rb:23 + def ref; end + + # Returns this entity as a string. See write(). + # + # pkg:gem/rexml#lib/rexml/entity.rb:120 + def to_s; end + + # Evaluates to the unnormalized value of this entity; that is, replacing + # &ent; entities. + # + # pkg:gem/rexml#lib/rexml/entity.rb:73 + def unnormalized; end + + # pkg:gem/rexml#lib/rexml/entity.rb:23 + def value; end + + # Write out a fully formed, correct entity definition (assuming the Entity + # object itself is valid.) + # + # out:: + # An object implementing <TT><<</TT> to which the entity will be + # output + # indent:: + # *DEPRECATED* and ignored + # + # pkg:gem/rexml#lib/rexml/entity.rb:98 + def write(out, indent = T.unsafe(nil)); end + + class << self + # Evaluates whether the given string matches an entity definition, + # returning true if so, and false otherwise. + # + # pkg:gem/rexml#lib/rexml/entity.rb:67 + def matches?(string); end + end +end + +# pkg:gem/rexml#lib/rexml/doctype.rb:263 +class REXML::ExternalEntity < ::REXML::Child + # pkg:gem/rexml#lib/rexml/doctype.rb:264 + def initialize(src); end + + # pkg:gem/rexml#lib/rexml/doctype.rb:268 + def to_s; end + + # pkg:gem/rexml#lib/rexml/doctype.rb:271 + def write(output, indent); end +end + +# pkg:gem/rexml#lib/rexml/formatters/default.rb:5 +class REXML::Formatters::Default + # Prints out the XML document with no formatting -- except if ie_hack is + # set. + # + # ie_hack:: + # If set to true, then inserts whitespace before the close of an empty + # tag, so that IE's bad XML parser doesn't choke. + # + # pkg:gem/rexml#lib/rexml/formatters/default.rb:12 + def initialize(ie_hack = T.unsafe(nil)); end + + # Writes the node to some output. + # + # node:: + # The node to write + # output:: + # A class implementing <TT><<</TT>. Pass in an Output object to + # change the output encoding. + # + # pkg:gem/rexml#lib/rexml/formatters/default.rb:23 + def write(node, output); end + + protected + + # pkg:gem/rexml#lib/rexml/formatters/default.rb:98 + def write_cdata(node, output); end + + # pkg:gem/rexml#lib/rexml/formatters/default.rb:92 + def write_comment(node, output); end + + # pkg:gem/rexml#lib/rexml/formatters/default.rb:61 + def write_document(node, output); end + + # pkg:gem/rexml#lib/rexml/formatters/default.rb:65 + def write_element(node, output); end + + # pkg:gem/rexml#lib/rexml/formatters/default.rb:104 + def write_instruction(node, output); end + + # pkg:gem/rexml#lib/rexml/formatters/default.rb:88 + def write_text(node, output); end +end + +# Pretty-prints an XML document. This destroys whitespace in text nodes +# and will insert carriage returns and indentations. +# +# TODO: Add an option to print attributes on new lines +# +# pkg:gem/rexml#lib/rexml/formatters/pretty.rb:10 +class REXML::Formatters::Pretty < ::REXML::Formatters::Default + # Create a new pretty printer. + # + # output:: + # An object implementing '<<(String)', to which the output will be written. + # indentation:: + # An integer greater than 0. The indentation of each level will be + # this number of spaces. If this is < 1, the behavior of this object + # is undefined. Defaults to 2. + # ie_hack:: + # If true, the printer will insert whitespace before closing empty + # tags, thereby allowing Internet Explorer's XML parser to + # function. Defaults to false. + # + # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:30 + def initialize(indentation = T.unsafe(nil), ie_hack = T.unsafe(nil)); end + + # If compact is set to true, then the formatter will attempt to use as + # little space as possible + # + # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:14 + def compact; end + + # If compact is set to true, then the formatter will attempt to use as + # little space as possible + # + # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:14 + def compact=(_arg0); end + + # The width of a page. Used for formatting text + # + # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:16 + def width; end + + # The width of a page. Used for formatting text + # + # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:16 + def width=(_arg0); end + + protected + + # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:102 + def write_cdata(node, output); end + + # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:97 + def write_comment(node, output); end + + # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:107 + def write_document(node, output); end + + # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:39 + def write_element(node, output); end + + # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:88 + def write_text(node, output); end + + private + + # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:124 + def indent_text(string, level = T.unsafe(nil), style = T.unsafe(nil), indentfirstline = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:129 + def wrap(string, width); end +end + +# If you add a method, keep in mind two things: +# (1) the first argument will always be a list of nodes from which to +# filter. In the case of context methods (such as position), the function +# should return an array with a value for each child in the array. +# (2) all method calls from XML will have "-" replaced with "_". +# Therefore, in XML, "local-name()" is identical (and actually becomes) +# "local_name()" +# +# pkg:gem/rexml#lib/rexml/functions.rb:10 +module REXML::Functions + class << self + # pkg:gem/rexml#lib/rexml/functions.rb:317 + def boolean(object = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/functions.rb:417 + def ceiling(number); end + + # pkg:gem/rexml#lib/rexml/functions.rb:370 + def compare_language(lang1, lang2); end + + # pkg:gem/rexml#lib/rexml/functions.rb:190 + def concat(*objects); end + + # Fixed by Mike Stok + # + # pkg:gem/rexml#lib/rexml/functions.rb:204 + def contains(string, test); end + + # pkg:gem/rexml#lib/rexml/functions.rb:38 + def context=(value); end + + # Returns the size of the given list of nodes. + # + # pkg:gem/rexml#lib/rexml/functions.rb:60 + def count(node_set); end + + # UNTESTED + # + # pkg:gem/rexml#lib/rexml/functions.rb:347 + def false; end + + # pkg:gem/rexml#lib/rexml/functions.rb:413 + def floor(number); end + + # Helper method. + # + # pkg:gem/rexml#lib/rexml/functions.rb:87 + def get_namespace(node_set = T.unsafe(nil)); end + + # Since REXML is non-validating, this method is not implemented as it + # requires a DTD + # + # pkg:gem/rexml#lib/rexml/functions.rb:66 + def id(object); end + + # UNTESTED + # + # pkg:gem/rexml#lib/rexml/functions.rb:352 + def lang(language); end + + # Returns the last node of the given list of nodes. + # + # pkg:gem/rexml#lib/rexml/functions.rb:51 + def last; end + + # pkg:gem/rexml#lib/rexml/functions.rb:69 + def local_name(node_set = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/functions.rb:80 + def name(node_set = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/functions.rb:35 + def namespace_context; end + + # pkg:gem/rexml#lib/rexml/functions.rb:33 + def namespace_context=(x); end + + # pkg:gem/rexml#lib/rexml/functions.rb:76 + def namespace_uri(node_set = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/functions.rb:265 + def normalize_space(string = T.unsafe(nil)); end + + # UNTESTED + # + # pkg:gem/rexml#lib/rexml/functions.rb:337 + def not(object); end + + # a string that consists of optional whitespace followed by an optional + # minus sign followed by a Number followed by whitespace is converted to + # the IEEE 754 number that is nearest (according to the IEEE 754 + # round-to-nearest rule) to the mathematical value represented by the + # string; any other string is converted to NaN + # + # boolean true is converted to 1; boolean false is converted to 0 + # + # a node-set is first converted to a string as if by a call to the string + # function and then converted in the same way as a string argument + # + # an object of a type other than the four basic types is converted to a + # number in a way that is dependent on that type + # + # pkg:gem/rexml#lib/rexml/functions.rb:387 + def number(object = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/functions.rb:55 + def position; end + + # pkg:gem/rexml#lib/rexml/functions.rb:432 + def processing_instruction(node); end + + # pkg:gem/rexml#lib/rexml/functions.rb:421 + def round(number); end + + # pkg:gem/rexml#lib/rexml/functions.rb:436 + def send(name, *args); end + + # pkg:gem/rexml#lib/rexml/functions.rb:26 + def singleton_method_added(name); end + + # Fixed by Mike Stok + # + # pkg:gem/rexml#lib/rexml/functions.rb:199 + def starts_with(string, test); end + + # A node-set is converted to a string by returning the string-value of the + # node in the node-set that is first in document order. If the node-set is + # empty, an empty string is returned. + # + # A number is converted to a string as follows + # + # NaN is converted to the string NaN + # + # positive zero is converted to the string 0 + # + # negative zero is converted to the string 0 + # + # positive infinity is converted to the string Infinity + # + # negative infinity is converted to the string -Infinity + # + # if the number is an integer, the number is represented in decimal form + # as a Number with no decimal point and no leading zeros, preceded by a + # minus sign (-) if the number is negative + # + # otherwise, the number is represented in decimal form as a Number + # including a decimal point with at least one digit before the decimal + # point and at least one digit after the decimal point, preceded by a + # minus sign (-) if the number is negative; there must be no leading zeros + # before the decimal point apart possibly from the one required digit + # immediately before the decimal point; beyond the one required digit + # after the decimal point there must be as many, but only as many, more + # digits as are needed to uniquely distinguish the number from all other + # IEEE 754 numeric values. + # + # The boolean false value is converted to the string false. The boolean + # true value is converted to the string true. + # + # An object of a type other than the four basic types is converted to a + # string in a way that is dependent on that type. + # + # pkg:gem/rexml#lib/rexml/functions.rb:138 + def string(object = T.unsafe(nil)); end + + # UNTESTED + # + # pkg:gem/rexml#lib/rexml/functions.rb:261 + def string_length(string); end + + # A node-set is converted to a string by + # returning the concatenation of the string-value + # of each of the children of the node in the + # node-set that is first in document order. + # If the node-set is empty, an empty string is returned. + # + # pkg:gem/rexml#lib/rexml/functions.rb:178 + def string_value(o); end + + # Take equal portions of Mike Stok and Sean Russell; mix + # vigorously, and pour into a tall, chilled glass. Serves 10,000. + # + # pkg:gem/rexml#lib/rexml/functions.rb:228 + def substring(string, start, length = T.unsafe(nil)); end + + # Kouhei fixed this too + # + # pkg:gem/rexml#lib/rexml/functions.rb:220 + def substring_after(string, test); end + + # Kouhei fixed this + # + # pkg:gem/rexml#lib/rexml/functions.rb:209 + def substring_before(string, test); end + + # pkg:gem/rexml#lib/rexml/functions.rb:408 + def sum(nodes); end + + # pkg:gem/rexml#lib/rexml/functions.rb:40 + def text; end + + # This is entirely Mike Stok's beast + # + # pkg:gem/rexml#lib/rexml/functions.rb:275 + def translate(string, tr1, tr2); end + + # UNTESTED + # + # pkg:gem/rexml#lib/rexml/functions.rb:342 + def true; end + + # pkg:gem/rexml#lib/rexml/functions.rb:36 + def variables; end + + # pkg:gem/rexml#lib/rexml/functions.rb:34 + def variables=(x); end + end +end + +# A Source that wraps an IO. See the Source class for method +# documentation +# +# pkg:gem/rexml#lib/rexml/source.rb:220 +class REXML::IOSource < ::REXML::Source + # block_size has been deprecated + # + # pkg:gem/rexml#lib/rexml/source.rb:224 + def initialize(arg, block_size = T.unsafe(nil), encoding = T.unsafe(nil)); end + + # @return the current line in the source + # + # pkg:gem/rexml#lib/rexml/source.rb:329 + def current_line; end + + # pkg:gem/rexml#lib/rexml/source.rb:324 + def empty?; end + + # pkg:gem/rexml#lib/rexml/source.rb:284 + def ensure_buffer; end + + # pkg:gem/rexml#lib/rexml/source.rb:288 + def match(pattern, cons = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/source.rb:307 + def match?(pattern, cons = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/source.rb:245 + def read(term = T.unsafe(nil), min_bytes = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/source.rb:266 + def read_until(term); end + + private + + # pkg:gem/rexml#lib/rexml/source.rb:376 + def encoding_updated; end + + # pkg:gem/rexml#lib/rexml/source.rb:351 + def readline(term = T.unsafe(nil)); end +end + +# Represents an XML Instruction; IE, <? ... ?> +# TODO: Add parent arg (3rd arg) to constructor +# +# pkg:gem/rexml#lib/rexml/instruction.rb:9 +class REXML::Instruction < ::REXML::Child + # Constructs a new Instruction + # @param target can be one of a number of things. If String, then + # the target of this instruction is set to this. If an Instruction, + # then the Instruction is shallowly cloned (target and content are + # copied). + # @param content Must be either a String, or a Parent. Can only + # be a Parent if the target argument is a Source. Otherwise, this + # String is set as the content of this instruction. + # + # pkg:gem/rexml#lib/rexml/instruction.rb:25 + def initialize(target, content = T.unsafe(nil)); end + + # @return true if other is an Instruction, and the content and target + # of the other matches the target and content of this object. + # + # pkg:gem/rexml#lib/rexml/instruction.rb:65 + def ==(other); end + + # pkg:gem/rexml#lib/rexml/instruction.rb:44 + def clone; end + + # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?> + # content is everything else. + # + # pkg:gem/rexml#lib/rexml/instruction.rb:15 + def content; end + + # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?> + # content is everything else. + # + # pkg:gem/rexml#lib/rexml/instruction.rb:15 + def content=(_arg0); end + + # pkg:gem/rexml#lib/rexml/instruction.rb:75 + def inspect; end + + # pkg:gem/rexml#lib/rexml/instruction.rb:71 + def node_type; end + + # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?> + # content is everything else. + # + # pkg:gem/rexml#lib/rexml/instruction.rb:15 + def target; end + + # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?> + # content is everything else. + # + # pkg:gem/rexml#lib/rexml/instruction.rb:15 + def target=(_arg0); end + + # == DEPRECATED + # See the rexml/formatters package + # + # pkg:gem/rexml#lib/rexml/instruction.rb:51 + def write(writer, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end +end + +# Adds named attributes to an object. +# +# pkg:gem/rexml#lib/rexml/namespace.rb:7 +module REXML::Namespace + include ::REXML::XMLTokens + + # The name of the object, valid if set + # + # pkg:gem/rexml#lib/rexml/namespace.rb:9 + def expanded_name; end + + # Fully expand the name, even if the prefix wasn't specified in the + # source file. + # + # pkg:gem/rexml#lib/rexml/namespace.rb:57 + def fully_expanded_name; end + + # Compares names optionally WITH namespaces + # + # pkg:gem/rexml#lib/rexml/namespace.rb:43 + def has_name?(other, ns = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/namespace.rb:53 + def local_name; end + + # The name of the object, valid if set + # + # pkg:gem/rexml#lib/rexml/namespace.rb:9 + def name; end + + # Sets the name and the expanded name + # + # pkg:gem/rexml#lib/rexml/namespace.rb:17 + def name=(name); end + + # The expanded name of the object, valid if name is set + # + # pkg:gem/rexml#lib/rexml/namespace.rb:11 + def prefix; end + + # The expanded name of the object, valid if name is set + # + # pkg:gem/rexml#lib/rexml/namespace.rb:11 + def prefix=(_arg0); end +end + +# pkg:gem/rexml#lib/rexml/namespace.rb:13 +REXML::Namespace::NAME_WITHOUT_NAMESPACE = T.let(T.unsafe(nil), Regexp) + +# Represents a node in the tree. Nodes are never encountered except as +# superclasses of other objects. Nodes have siblings. +# +# pkg:gem/rexml#lib/rexml/node.rb:9 +module REXML::Node + # Visit all subnodes of +self+ recursively + # + # pkg:gem/rexml#lib/rexml/node.rb:54 + def each_recursive(&block); end + + # Find (and return) first subnode (recursively) for which the block + # evaluates to true. Returns +nil+ if none was found. + # + # pkg:gem/rexml#lib/rexml/node.rb:67 + def find_first_recursive(&block); end + + # pkg:gem/rexml#lib/rexml/node.rb:39 + def indent(to, ind); end + + # Returns the position that +self+ holds in its parent's array, indexed + # from 1. + # + # pkg:gem/rexml#lib/rexml/node.rb:76 + def index_in_parent; end + + # @return the next sibling (nil if unset) + # + # pkg:gem/rexml#lib/rexml/node.rb:11 + def next_sibling_node; end + + # pkg:gem/rexml#lib/rexml/node.rb:48 + def parent?; end + + # @return the previous sibling (nil if unset) + # + # pkg:gem/rexml#lib/rexml/node.rb:17 + def previous_sibling_node; end + + # indent:: + # *DEPRECATED* This parameter is now ignored. See the formatters in the + # REXML::Formatters package for changing the output style. + # + # pkg:gem/rexml#lib/rexml/node.rb:27 + def to_s(indent = T.unsafe(nil)); end +end + +# pkg:gem/rexml#lib/rexml/doctype.rb:276 +class REXML::NotationDecl < ::REXML::Child + # pkg:gem/rexml#lib/rexml/doctype.rb:278 + def initialize(name, middle, pub, sys); end + + # This method retrieves the name of the notation. + # + # Method contributed by Henrik Martensson + # + # pkg:gem/rexml#lib/rexml/doctype.rb:302 + def name; end + + # pkg:gem/rexml#lib/rexml/doctype.rb:277 + def public; end + + # pkg:gem/rexml#lib/rexml/doctype.rb:277 + def public=(_arg0); end + + # pkg:gem/rexml#lib/rexml/doctype.rb:277 + def system; end + + # pkg:gem/rexml#lib/rexml/doctype.rb:277 + def system=(_arg0); end + + # pkg:gem/rexml#lib/rexml/doctype.rb:286 + def to_s; end + + # pkg:gem/rexml#lib/rexml/doctype.rb:295 + def write(output, indent = T.unsafe(nil)); end +end + +# pkg:gem/rexml#lib/rexml/output.rb:5 +class REXML::Output + include ::REXML::Encoding + + # pkg:gem/rexml#lib/rexml/output.rb:10 + def initialize(real_IO, encd = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/output.rb:22 + def <<(content); end + + # pkg:gem/rexml#lib/rexml/output.rb:8 + def encoding; end + + # pkg:gem/rexml#lib/rexml/output.rb:26 + def to_s; end +end + +# A parent has children, and has methods for accessing them. The Parent +# class is never encountered except as the superclass for some other +# object. +# +# pkg:gem/rexml#lib/rexml/parent.rb:8 +class REXML::Parent < ::REXML::Child + include ::Enumerable + + # Constructor + # @param parent if supplied, will be set as the parent of this object + # + # pkg:gem/rexml#lib/rexml/parent.rb:13 + def initialize(parent = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/parent.rb:25 + def <<(object); end + + # Fetches a child at a given index + # @param index the Integer index of the child to fetch + # + # pkg:gem/rexml#lib/rexml/parent.rb:57 + def [](index); end + + # Set an index entry. See Array.[]= + # @param index the index of the element to set + # @param opt either the object to set, or an Integer length + # @param child if opt is an Integer, this is the child to set + # @return the parent (self) + # + # pkg:gem/rexml#lib/rexml/parent.rb:70 + def []=(*args); end + + # pkg:gem/rexml#lib/rexml/parent.rb:18 + def add(object); end + + # pkg:gem/rexml#lib/rexml/parent.rb:160 + def children; end + + # Deeply clones this object. This creates a complete duplicate of this + # Parent, including all descendants. + # + # pkg:gem/rexml#lib/rexml/parent.rb:148 + def deep_clone; end + + # pkg:gem/rexml#lib/rexml/parent.rb:32 + def delete(object); end + + # pkg:gem/rexml#lib/rexml/parent.rb:47 + def delete_at(index); end + + # pkg:gem/rexml#lib/rexml/parent.rb:43 + def delete_if(&block); end + + # pkg:gem/rexml#lib/rexml/parent.rb:39 + def each(&block); end + + # pkg:gem/rexml#lib/rexml/parent.rb:61 + def each_child(&block); end + + # pkg:gem/rexml#lib/rexml/parent.rb:51 + def each_index(&block); end + + # Fetches the index of a given child + # @param child the child to get the index of + # @return the index of the child, or nil if the object is not a child + # of this parent. + # + # pkg:gem/rexml#lib/rexml/parent.rb:123 + def index(child); end + + # Inserts an child after another child + # @param child1 this is either an xpath or an Element. If an Element, + # child2 will be inserted after child1 in the child list of the parent. + # If an xpath, child2 will be inserted after the first child to match + # the xpath. + # @param child2 the child to insert + # @return the parent (self) + # + # pkg:gem/rexml#lib/rexml/parent.rb:102 + def insert_after(child1, child2); end + + # Inserts an child before another child + # @param child1 this is either an xpath or an Element. If an Element, + # child2 will be inserted before child1 in the child list of the parent. + # If an xpath, child2 will be inserted before the first child to match + # the xpath. + # @param child2 the child to insert + # @return the parent (self) + # + # pkg:gem/rexml#lib/rexml/parent.rb:82 + def insert_before(child1, child2); end + + # pkg:gem/rexml#lib/rexml/parent.rb:134 + def length; end + + # pkg:gem/rexml#lib/rexml/parent.rb:162 + def parent?; end + + # pkg:gem/rexml#lib/rexml/parent.rb:24 + def push(object); end + + # Replaces one child with another, making sure the nodelist is correct + # @param to_replace the child to replace (must be a Child) + # @param replacement the child to insert into the nodelist (must be a + # Child) + # + # pkg:gem/rexml#lib/rexml/parent.rb:140 + def replace_child(to_replace, replacement); end + + # @return the number of children of this parent + # + # pkg:gem/rexml#lib/rexml/parent.rb:130 + def size; end + + # pkg:gem/rexml#lib/rexml/parent.rb:115 + def to_a; end + + # pkg:gem/rexml#lib/rexml/parent.rb:27 + def unshift(object); end +end + +# pkg:gem/rexml#lib/rexml/parseexception.rb:3 +class REXML::ParseException < ::RuntimeError + # pkg:gem/rexml#lib/rexml/parseexception.rb:6 + def initialize(message, source = T.unsafe(nil), parser = T.unsafe(nil), exception = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/parseexception.rb:49 + def context; end + + # pkg:gem/rexml#lib/rexml/parseexception.rb:4 + def continued_exception; end + + # pkg:gem/rexml#lib/rexml/parseexception.rb:4 + def continued_exception=(_arg0); end + + # pkg:gem/rexml#lib/rexml/parseexception.rb:44 + def line; end + + # pkg:gem/rexml#lib/rexml/parseexception.rb:4 + def parser; end + + # pkg:gem/rexml#lib/rexml/parseexception.rb:4 + def parser=(_arg0); end + + # pkg:gem/rexml#lib/rexml/parseexception.rb:39 + def position; end + + # pkg:gem/rexml#lib/rexml/parseexception.rb:4 + def source; end + + # pkg:gem/rexml#lib/rexml/parseexception.rb:4 + def source=(_arg0); end + + # pkg:gem/rexml#lib/rexml/parseexception.rb:13 + def to_s; end +end + +# = Using the Pull Parser +# <em>This API is experimental, and subject to change.</em> +# parser = PullParser.new( "<a>text<b att='val'/>txet</a>" ) +# while parser.has_next? +# res = parser.next +# puts res[1]['att'] if res.start_tag? and res[0] == 'b' +# end +# See the PullEvent class for information on the content of the results. +# The data is identical to the arguments passed for the various events to +# the StreamListener API. +# +# Notice that: +# parser = PullParser.new( "<a>BAD DOCUMENT" ) +# while parser.has_next? +# res = parser.next +# raise res[1] if res.error? +# end +# +# Nat Price gave me some good ideas for the API. +# +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:57 +class REXML::Parsers::BaseParser + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:164 + def initialize(source); end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:175 + def add_listener(listener); end + + # Returns true if there are no more events + # + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:210 + def empty?; end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:537 + def entity(reference, entities); end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:180 + def entity_expansion_count; end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:181 + def entity_expansion_limit=(_arg0); end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:182 + def entity_expansion_text_limit=(_arg0); end + + # Returns true if there are more events. Synonymous with !empty? + # + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:215 + def has_next?; end + + # Escapes all possible entities + # + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:548 + def normalize(input, entities = T.unsafe(nil), entity_filter = T.unsafe(nil)); end + + # Peek at the +depth+ event in the stack. The first element on the stack + # is at depth 0. If +depth+ is -1, will parse to the end of the input + # stream and return the last event, which is always :end_document. + # Be aware that this causes the stream to be parsed up to the +depth+ + # event, so you can effectively pre-parse the entire document (pull the + # entire thing into memory) using this method. + # + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:231 + def peek(depth = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:200 + def position; end + + # Returns the next event. This is a +PullEvent+ object. + # + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:246 + def pull; end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:189 + def reset; end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:179 + def source; end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:184 + def stream=(source); end + + # Unescapes all possible entities + # + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:564 + def unnormalize(string, entities = T.unsafe(nil), filter = T.unsafe(nil)); end + + # Push an event back on the head of the stream. This method + # has (theoretically) infinite depth. + # + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:221 + def unshift(token); end + + private + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:613 + def add_namespace(prefix, uri); end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:646 + def need_source_encoding_update?(xml_declaration_encoding); end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:652 + def normalize_xml_declaration_encoding(xml_declaration_encoding); end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:849 + def parse_attribute_value_with_equal(name); end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:868 + def parse_attributes(prefixes); end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:669 + def parse_id(base_error_message, accept_external_id:, accept_public_id:); end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:697 + def parse_id_invalid_details(accept_external_id:, accept_public_id:); end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:656 + def parse_name(base_error_message); end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:628 + def pop_namespaces_restore; end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:735 + def process_comment; end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:747 + def process_instruction; end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:256 + def pull_event; end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:622 + def push_namespaces_restore; end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:639 + def record_entity_expansion(delta = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:835 + def scan_quote; end + + # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:769 + def xml_declaration; end +end + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:130 +REXML::Parsers::BaseParser::EXTERNAL_ID_PUBLIC = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:131 +REXML::Parsers::BaseParser::EXTERNAL_ID_SYSTEM = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:132 +REXML::Parsers::BaseParser::PUBLIC_ID = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:143 +module REXML::Parsers::BaseParser::Private; end + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:148 +REXML::Parsers::BaseParser::Private::ATTLISTDECL_END = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:153 +REXML::Parsers::BaseParser::Private::CARRIAGE_RETURN_NEWLINE_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:154 +REXML::Parsers::BaseParser::Private::CHARACTER_REFERENCES = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:146 +REXML::Parsers::BaseParser::Private::CLOSE_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:155 +REXML::Parsers::BaseParser::Private::DEFAULT_ENTITIES_PATTERNS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:152 +REXML::Parsers::BaseParser::Private::ENTITYDECL_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:147 +REXML::Parsers::BaseParser::Private::EQUAL_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:150 +REXML::Parsers::BaseParser::Private::GEDECL_PATTERN = T.let(T.unsafe(nil), String) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:149 +REXML::Parsers::BaseParser::Private::NAME_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:151 +REXML::Parsers::BaseParser::Private::PEDECL_PATTERN = T.let(T.unsafe(nil), String) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:144 +REXML::Parsers::BaseParser::Private::PEREFERENCE_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:145 +REXML::Parsers::BaseParser::Private::TAG_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:160 +REXML::Parsers::BaseParser::Private::XML_PREFIXED_NAMESPACE = T.let(T.unsafe(nil), String) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:66 +REXML::Parsers::BaseParser::QNAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:65 +REXML::Parsers::BaseParser::QNAME_STR = T.let(T.unsafe(nil), String) + +# pkg:gem/rexml#lib/rexml/parsers/streamparser.rb:6 +class REXML::Parsers::StreamParser + # pkg:gem/rexml#lib/rexml/parsers/streamparser.rb:7 + def initialize(source, listener); end + + # pkg:gem/rexml#lib/rexml/parsers/streamparser.rb:13 + def add_listener(listener); end + + # pkg:gem/rexml#lib/rexml/parsers/streamparser.rb:17 + def entity_expansion_count; end + + # pkg:gem/rexml#lib/rexml/parsers/streamparser.rb:21 + def entity_expansion_limit=(limit); end + + # pkg:gem/rexml#lib/rexml/parsers/streamparser.rb:25 + def entity_expansion_text_limit=(limit); end + + # pkg:gem/rexml#lib/rexml/parsers/streamparser.rb:29 + def parse; end +end + +# pkg:gem/rexml#lib/rexml/parsers/treeparser.rb:7 +class REXML::Parsers::TreeParser + # pkg:gem/rexml#lib/rexml/parsers/treeparser.rb:8 + def initialize(source, build_context = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/parsers/treeparser.rb:13 + def add_listener(listener); end + + # pkg:gem/rexml#lib/rexml/parsers/treeparser.rb:17 + def parse; end +end + +# You don't want to use this class. Really. Use XPath, which is a wrapper +# for this class. Believe me. You don't want to poke around in here. +# There is strange, dark magic at work in this code. Beware. Go back! Go +# back while you still can! +# +# pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:12 +class REXML::Parsers::XPathParser + include ::REXML::XMLTokens + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:42 + def abbreviate(path_or_parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:132 + def expand(path_or_parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:16 + def namespaces=(namespaces); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:21 + def parse(path); end + + # For backward compatibility + # + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:221 + def preciate_to_string(parsed, &block); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:36 + def predicate(path); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:174 + def predicate_to_path(parsed, &block); end + + private + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:505 + def AdditiveExpr(path, parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:438 + def AndExpr(path, parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:457 + def EqualityExpr(path, parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:608 + def FilterExpr(path, parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:663 + def FunctionCall(rest, parsed); end + + # LocationPath + # | RelativeLocationPath + # | '/' RelativeLocationPath? + # | '//' RelativeLocationPath + # + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:243 + def LocationPath(path, parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:528 + def MultiplicativeExpr(path, parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:343 + def NodeTest(path, parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:419 + def OrExpr(path, parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:590 + def PathExpr(path, parsed); end + + # Filters the supplied nodeset on the predicate(s) + # + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:395 + def Predicate(path, parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:626 + def PrimaryExpr(path, parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:480 + def RelationalExpr(path, parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:267 + def RelativeLocationPath(path, parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:553 + def UnaryExpr(path, parsed); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:571 + def UnionExpr(path, parsed); end + + # get_group( '[foo]bar' ) -> ['bar', '[foo]'] + # + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:676 + def get_group(string); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:694 + def parse_args(string); end + + # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:224 + def quote_literal(literal); end +end + +# pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:339 +REXML::Parsers::XPathParser::LOCAL_NAME_WILDCARD = T.let(T.unsafe(nil), Regexp) + +# Returns a 1-1 map of the nodeset +# The contents of the resulting array are either: +# true/false, if a positive match +# String, if a name match +# NodeTest +# | ('*' | NCNAME ':' '*' | QNAME) NameTest +# | '*' ':' NCNAME NameTest since XPath 2.0 +# | NODE_TYPE '(' ')' NodeType +# | PI '(' LITERAL ')' PI +# | '[' expr ']' Predicate +# +# pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:338 +REXML::Parsers::XPathParser::PREFIX_WILDCARD = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rexml#lib/rexml/doctype.rb:10 +class REXML::ReferenceWriter + # pkg:gem/rexml#lib/rexml/doctype.rb:11 + def initialize(id_type, public_id_literal, system_literal, context = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/doctype.rb:25 + def write(output); end +end + +# pkg:gem/rexml#lib/rexml/security.rb:3 +module REXML::Security + class << self + # Get the entity expansion limit. By default the limit is set to 10000. + # + # pkg:gem/rexml#lib/rexml/security.rb:12 + def entity_expansion_limit; end + + # Set the entity expansion limit. By default the limit is set to 10000. + # + # pkg:gem/rexml#lib/rexml/security.rb:7 + def entity_expansion_limit=(val); end + + # Get the entity expansion limit. By default the limit is set to 10240. + # + # pkg:gem/rexml#lib/rexml/security.rb:24 + def entity_expansion_text_limit; end + + # Set the entity expansion limit. By default the limit is set to 10240. + # + # pkg:gem/rexml#lib/rexml/security.rb:19 + def entity_expansion_text_limit=(val); end + end +end + +# A Source can be searched for patterns, and wraps buffers and other +# objects and provides consumption of text +# +# pkg:gem/rexml#lib/rexml/source.rb:61 +class REXML::Source + include ::REXML::Encoding + + # Constructor + # @param arg must be a String, and should be a valid XML document + # @param encoding if non-null, sets the encoding of the source to this + # value, overriding all encoding detection + # + # pkg:gem/rexml#lib/rexml/source.rb:88 + def initialize(arg, encoding = T.unsafe(nil)); end + + # The current buffer (what we're going to read next) + # + # pkg:gem/rexml#lib/rexml/source.rb:101 + def buffer; end + + # pkg:gem/rexml#lib/rexml/source.rb:111 + def buffer_encoding=(encoding); end + + # @return the current line in the source + # + # pkg:gem/rexml#lib/rexml/source.rb:180 + def current_line; end + + # pkg:gem/rexml#lib/rexml/source.rb:105 + def drop_parsed_content; end + + # @return true if the Source is exhausted + # + # pkg:gem/rexml#lib/rexml/source.rb:175 + def empty?; end + + # pkg:gem/rexml#lib/rexml/source.rb:65 + def encoding; end + + # Inherited from Encoding + # Overridden to support optimized en/decoding + # + # pkg:gem/rexml#lib/rexml/source.rb:117 + def encoding=(enc); end + + # pkg:gem/rexml#lib/rexml/source.rb:135 + def ensure_buffer; end + + # The line number of the last consumed text + # + # pkg:gem/rexml#lib/rexml/source.rb:64 + def line; end + + # pkg:gem/rexml#lib/rexml/source.rb:138 + def match(pattern, cons = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/source.rb:146 + def match?(pattern, cons = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/source.rb:166 + def peek_byte; end + + # pkg:gem/rexml#lib/rexml/source.rb:158 + def position; end + + # pkg:gem/rexml#lib/rexml/source.rb:162 + def position=(pos); end + + # pkg:gem/rexml#lib/rexml/source.rb:122 + def read(term = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/source.rb:125 + def read_until(term); end + + # pkg:gem/rexml#lib/rexml/source.rb:170 + def scan_byte; end + + # pkg:gem/rexml#lib/rexml/source.rb:154 + def skip_spaces; end + + private + + # pkg:gem/rexml#lib/rexml/source.rb:189 + def detect_encoding; end + + # pkg:gem/rexml#lib/rexml/source.rb:207 + def encoding_updated; end +end + +# pkg:gem/rexml#lib/rexml/source.rb:67 +module REXML::Source::Private; end + +# pkg:gem/rexml#lib/rexml/source.rb:70 +REXML::Source::Private::PRE_DEFINED_TERM_PATTERNS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rexml#lib/rexml/source.rb:69 +REXML::Source::Private::SCANNER_RESET_SIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rexml#lib/rexml/source.rb:68 +REXML::Source::Private::SPACES_PATTERN = T.let(T.unsafe(nil), Regexp) + +# Generates Source-s. USE THIS CLASS. +# +# pkg:gem/rexml#lib/rexml/source.rb:38 +class REXML::SourceFactory + class << self + # Generates a Source object + # @param arg Either a String, or an IO + # @return a Source, or nil if a bad argument was given + # + # pkg:gem/rexml#lib/rexml/source.rb:42 + def create_from(arg); end + end +end + +# Represents text nodes in an XML document +# +# pkg:gem/rexml#lib/rexml/text.rb:11 +class REXML::Text < ::REXML::Child + include ::Comparable + + # Constructor + # +arg+ if a String, the content is set to the String. If a Text, + # the object is shallowly cloned. + # + # +respect_whitespace+ (boolean, false) if true, whitespace is + # respected + # + # +parent+ (nil) if this is a Parent object, the parent + # will be set to this. + # + # +raw+ (nil) This argument can be given three values. + # If true, then the value of used to construct this object is expected to + # contain no unescaped XML markup, and REXML will not change the text. If + # this value is false, the string may contain any characters, and REXML will + # escape any and all defined entities whose values are contained in the + # text. If this value is nil (the default), then the raw value of the + # parent will be used as the raw value for this node. If there is no raw + # value for the parent, and no value is supplied, the default is false. + # Use this field if you have entities defined for some text, and you don't + # want REXML to escape that text in output. + # Text.new( "<&", false, nil, false ) #-> "<&" + # Text.new( "<&", false, nil, false ) #-> "&lt;&amp;" + # Text.new( "<&", false, nil, true ) #-> Parse exception + # Text.new( "<&", false, nil, true ) #-> "<&" + # # Assume that the entity "s" is defined to be "sean" + # # and that the entity "r" is defined to be "russell" + # Text.new( "sean russell" ) #-> "&s; &r;" + # Text.new( "sean russell", false, nil, true ) #-> "sean russell" + # + # +entity_filter+ (nil) This can be an array of entities to match in the + # supplied text. This argument is only useful if +raw+ is set to false. + # Text.new( "sean russell", false, nil, false, ["s"] ) #-> "&s; russell" + # Text.new( "sean russell", false, nil, true, ["s"] ) #-> "sean russell" + # In the last example, the +entity_filter+ argument is ignored. + # + # +illegal+ INTERNAL USE ONLY + # + # pkg:gem/rexml#lib/rexml/text.rb:79 + def initialize(arg, respect_whitespace = T.unsafe(nil), parent = T.unsafe(nil), raw = T.unsafe(nil), entity_filter = T.unsafe(nil), illegal = T.unsafe(nil)); end + + # Appends text to this text node. The text is appended in the +raw+ mode + # of this text node. + # + # +returns+ the text itself to enable method chain like + # 'text << "XXX" << "YYY"'. + # + # pkg:gem/rexml#lib/rexml/text.rb:189 + def <<(to_append); end + + # +other+ a String or a Text + # +returns+ the result of (to_s <=> arg.to_s) + # + # pkg:gem/rexml#lib/rexml/text.rb:198 + def <=>(other); end + + # pkg:gem/rexml#lib/rexml/text.rb:179 + def clone; end + + # pkg:gem/rexml#lib/rexml/text.rb:202 + def doctype; end + + # pkg:gem/rexml#lib/rexml/text.rb:174 + def empty?; end + + # pkg:gem/rexml#lib/rexml/text.rb:271 + def indent_text(string, level = T.unsafe(nil), style = T.unsafe(nil), indentfirstline = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/text.rb:225 + def inspect; end + + # pkg:gem/rexml#lib/rexml/text.rb:170 + def node_type; end + + # pkg:gem/rexml#lib/rexml/text.rb:110 + def parent=(parent); end + + # If +raw+ is true, then REXML leaves the value alone + # + # pkg:gem/rexml#lib/rexml/text.rb:21 + def raw; end + + # If +raw+ is true, then REXML leaves the value alone + # + # pkg:gem/rexml#lib/rexml/text.rb:21 + def raw=(_arg0); end + + # Returns the string value of this text node. This string is always + # escaped, meaning that it is a valid XML text node string, and all + # entities that can be escaped, have been inserted. This method respects + # the entity filter set in the constructor. + # + # # Assume that the entity "s" is defined to be "sean", and that the + # # entity "r" is defined to be "russell" + # t = Text.new( "< & sean russell", false, nil, false, ['s'] ) + # t.to_s #-> "< & &s; russell" + # t = Text.new( "< & &s; russell", false, nil, false ) + # t.to_s #-> "< & &s; russell" + # u = Text.new( "sean russell", false, nil, true ) + # u.to_s #-> "sean russell" + # + # pkg:gem/rexml#lib/rexml/text.rb:220 + def to_s; end + + # Returns the string value of this text. This is the text without + # entities, as it might be used programmatically, or printed to the + # console. This ignores the 'raw' attribute setting, and any + # entity_filter. + # + # # Assume that the entity "s" is defined to be "sean", and that the + # # entity "r" is defined to be "russell" + # t = Text.new( "< & sean russell", false, nil, false, ['s'] ) + # t.value #-> "< & sean russell" + # t = Text.new( "< & &s; russell", false, nil, false ) + # t.value #-> "< & sean russell" + # u = Text.new( "sean russell", false, nil, true ) + # u.value #-> "sean russell" + # + # pkg:gem/rexml#lib/rexml/text.rb:242 + def value; end + + # Sets the contents of this text node. This expects the text to be + # unnormalized. It returns self. + # + # e = Element.new( "a" ) + # e.add_text( "foo" ) # <a>foo</a> + # e[0].value = "bar" # <a>bar</a> + # e[0].value = "<a>" # <a><a></a> + # + # pkg:gem/rexml#lib/rexml/text.rb:254 + def value=(val); end + + # pkg:gem/rexml#lib/rexml/text.rb:260 + def wrap(string, width, addnewline = T.unsafe(nil)); end + + # == DEPRECATED + # See REXML::Formatters + # + # pkg:gem/rexml#lib/rexml/text.rb:288 + def write(writer, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end + + # Writes out text, substituting special characters beforehand. + # +out+ A String, IO, or any other object supporting <<( String ) + # +input+ the text to substitute and the write out + # + # z=utf8.unpack("U*") + # ascOut="" + # z.each{|r| + # if r < 0x100 + # ascOut.concat(r.chr) + # else + # ascOut.concat(sprintf("&#x%x;", r)) + # end + # } + # puts ascOut + # + # pkg:gem/rexml#lib/rexml/text.rb:318 + def write_with_substitution(out, input); end + + # FIXME + # This probably won't work properly + # + # pkg:gem/rexml#lib/rexml/text.rb:300 + def xpath; end + + private + + # pkg:gem/rexml#lib/rexml/text.rb:331 + def clear_cache; end + + class << self + # check for illegal characters + # + # pkg:gem/rexml#lib/rexml/text.rb:116 + def check(string, pattern, doctype = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/text.rb:401 + def expand(ref, doctype, filter); end + + # Escapes all possible entities + # + # pkg:gem/rexml#lib/rexml/text.rb:363 + def normalize(input, doctype = T.unsafe(nil), entity_filter = T.unsafe(nil)); end + + # Reads text, substituting entities + # + # pkg:gem/rexml#lib/rexml/text.rb:337 + def read_with_substitution(input, illegal = T.unsafe(nil)); end + + # Unescapes all possible entities + # + # pkg:gem/rexml#lib/rexml/text.rb:387 + def unnormalize(string, doctype = T.unsafe(nil), filter = T.unsafe(nil), illegal = T.unsafe(nil), entity_expansion_text_limit: T.unsafe(nil)); end + end +end + +# pkg:gem/rexml#lib/rexml/undefinednamespaceexception.rb:4 +class REXML::UndefinedNamespaceException < ::REXML::ParseException + # pkg:gem/rexml#lib/rexml/undefinednamespaceexception.rb:5 + def initialize(prefix, source, parser); end +end + +# pkg:gem/rexml#lib/rexml/validation/validationexception.rb:4 +class REXML::Validation::ValidationException < ::RuntimeError + # pkg:gem/rexml#lib/rexml/validation/validationexception.rb:5 + def initialize(msg); end +end + +# NEEDS DOCUMENTATION +# +# pkg:gem/rexml#lib/rexml/xmldecl.rb:8 +class REXML::XMLDecl < ::REXML::Child + include ::REXML::Encoding + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:20 + def initialize(version = T.unsafe(nil), encoding = T.unsafe(nil), standalone = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:56 + def ==(other); end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:39 + def clone; end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:102 + def dowrite; end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:76 + def encoding=(enc); end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:106 + def inspect; end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:69 + def node_type; end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:98 + def nowrite; end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:74 + def old_enc=(encoding); end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:73 + def stand_alone?; end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:17 + def standalone; end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:17 + def standalone=(_arg0); end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:17 + def version; end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:17 + def version=(_arg0); end + + # indent:: + # Ignored. There must be no whitespace before an XML declaration + # transitive:: + # Ignored + # ie_hack:: + # Ignored + # + # pkg:gem/rexml#lib/rexml/xmldecl.rb:49 + def write(writer, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:18 + def writeencoding; end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:18 + def writethis; end + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:63 + def xmldecl(version, encoding, standalone); end + + private + + # pkg:gem/rexml#lib/rexml/xmldecl.rb:111 + def content(enc); end + + class << self + # Only use this if you do not want the XML declaration to be written; + # this object is ignored by the XML writer. Otherwise, instantiate your + # own XMLDecl and add it to the document. + # + # Note that XML 1.1 documents *must* include an XML declaration + # + # pkg:gem/rexml#lib/rexml/xmldecl.rb:92 + def default; end + end +end + +# Wrapper class. Use this class to access the XPath functions. +# +# pkg:gem/rexml#lib/rexml/xpath.rb:7 +class REXML::XPath + include ::REXML::Functions + + class << self + # Iterates over nodes that match the given path, calling the supplied + # block with the match. + # element:: + # The context element + # path:: + # The xpath to search for. If not supplied or nil, defaults to '*' + # namespaces:: + # If supplied, a Hash which defines a namespace mapping + # variables:: + # If supplied, a Hash which maps $variables in the query + # to values. This can be used to avoid XPath injection attacks + # or to automatically handle escaping string values. + # + # XPath.each( node ) { |el| ... } + # XPath.each( node, '/*[@attr='v']' ) { |el| ... } + # XPath.each( node, 'ancestor::x' ) { |el| ... } + # XPath.each( node, '/book/publisher/text()=$publisher', {}, {"publisher"=>"O'Reilly"}) \ + # {|el| ... } + # + # pkg:gem/rexml#lib/rexml/xpath.rb:55 + def each(element, path = T.unsafe(nil), namespaces = T.unsafe(nil), variables = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Finds and returns the first node that matches the supplied xpath. + # element:: + # The context element + # path:: + # The xpath to search for. If not supplied or nil, returns the first + # node matching '*'. + # namespaces:: + # If supplied, a Hash which defines a namespace mapping. + # variables:: + # If supplied, a Hash which maps $variables in the query + # to values. This can be used to avoid XPath injection attacks + # or to automatically handle escaping string values. + # + # XPath.first( node ) + # XPath.first( doc, "//b"} ) + # XPath.first( node, "a/x:b", { "x"=>"http://doofus" } ) + # XPath.first( node, '/book/publisher/text()=$publisher', {}, {"publisher"=>"O'Reilly"}) + # + # pkg:gem/rexml#lib/rexml/xpath.rb:31 + def first(element, path = T.unsafe(nil), namespaces = T.unsafe(nil), variables = T.unsafe(nil), options = T.unsafe(nil)); end + + # Returns an array of nodes matching a given XPath. + # + # pkg:gem/rexml#lib/rexml/xpath.rb:62 + def match(element, path = T.unsafe(nil), namespaces = T.unsafe(nil), variables = T.unsafe(nil), options = T.unsafe(nil)); end + end +end + +# @private +# +# pkg:gem/rexml#lib/rexml/xpath_parser.rb:965 +class REXML::XPathNode + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:967 + def initialize(node, context = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:966 + def context; end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:976 + def position; end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:966 + def raw_node; end +end + +# You don't want to use this class. Really. Use XPath, which is a wrapper +# for this class. Believe me. You don't want to poke around in here. +# There is strange, dark magic at work in this code. Beware. Go back! Go +# back while you still can! +# +# pkg:gem/rexml#lib/rexml/xpath_parser.rb:54 +class REXML::XPathParser + include ::REXML::XMLTokens + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:60 + def initialize(strict: T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:107 + def []=(variable_name, value); end + + # Performs a depth-first (document order) XPath search, and returns the + # first match. This is the fastest, lightest way to return a single result. + # + # FIXME: This method is incomplete! + # + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:116 + def first(path_stack, node); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:97 + def get_first(path, node); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:153 + def match(path_stack, node); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:69 + def namespaces=(namespaces = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:79 + def parse(path, node); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:102 + def predicate(path, node); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:74 + def variables=(vars = T.unsafe(nil)); end + + private + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:781 + def child(nodeset); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:922 + def compare(a, operator, b); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:687 + def descendant(nodeset, include_self); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:698 + def descendant_recursive(raw_node, new_nodeset, new_nodes, include_self); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:944 + def each_unnode(nodeset); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:646 + def enter(tag, *args); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:821 + def equality_relational_compare(set1, op, set2); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:596 + def evaluate_predicate(expression, nodesets); end + + # Expr takes a stack of path elements and a set of nodes (either a Parent + # or an Array and returns an Array of matching nodes + # + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:186 + def expr(path_stack, nodeset, context = T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:587 + def filter_nodeset(nodeset); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:754 + def following(node); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:765 + def following_node_of(node); end + + # Returns a String namespace for a node, given a prefix + # The rules are: + # + # 1. Use the supplied namespace mapping first. + # 2. If no mapping was supplied, use the context node to look up the namespace + # + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:174 + def get_namespace(node, prefix); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:651 + def leave(tag, *args); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:771 + def next_sibling_node(node); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:488 + def node_test(path_stack, nodesets, any_type: T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:808 + def norm(b); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:896 + def normalize_compare_values(a, operator, b); end + + # Builds a nodeset of all of the preceding nodes of the supplied node, + # in reverse document order + # preceding:: includes every element in the document that precedes this node, + # except for ancestors + # + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:717 + def preceding(node); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:739 + def preceding_node_of(node); end + + # Reorders an array of nodes so that they are in document order + # It tries to do this efficiently. + # + # FIXME: I need to get rid of this, but the issue is that most of the XPath + # interpreter functions as a filter, which means that we lose context going + # in and out of function calls. If I knew what the index of the nodes was, + # I wouldn't have to do this. Maybe add a document IDX for each node? + # Problems with mutable documents. Or, rewrite everything. + # + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:664 + def sort(array_of_nodes, order); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:452 + def step(path_stack, any_type: T.unsafe(nil), order: T.unsafe(nil)); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:165 + def strict?; end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:639 + def trace(*args); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:956 + def unnode(nodeset); end + + # pkg:gem/rexml#lib/rexml/xpath_parser.rb:883 + def value_type(value); end +end + +# pkg:gem/rexml#lib/rexml/xpath_parser.rb:58 +REXML::XPathParser::DEBUG = T.let(T.unsafe(nil), FalseClass) diff --git a/sorbet/rbi/gems/rubydex@0.1.0.beta13.rbi b/sorbet/rbi/gems/rubydex@0.1.0.beta13.rbi new file mode 100644 index 0000000..c0c3ce5 --- /dev/null +++ b/sorbet/rbi/gems/rubydex@0.1.0.beta13.rbi @@ -0,0 +1,651 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubydex` gem. +# Please instead update this file by running `bin/tapioca gem rubydex`. + + +# frozen_string_literal: true +# typed: strict + +# pkg:gem/rubydex#lib/rubydex/version.rb:3 +module Rubydex; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::AttrAccessorDefinition < ::Rubydex::Definition; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::AttrReaderDefinition < ::Rubydex::Definition; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::AttrWriterDefinition < ::Rubydex::Definition; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Class < ::Rubydex::Namespace; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::ClassDefinition < ::Rubydex::Definition + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Array[Rubydex::Mixin]) } + def mixins; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T.nilable(Rubydex::ConstantReference)) } + def superclass; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::ClassVariable < ::Rubydex::Declaration + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Array[T.untyped]) } + def references; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::ClassVariableDefinition < ::Rubydex::Definition; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Comment + # pkg:gem/rubydex#lib/rubydex/comment.rb:12 + sig { params(string: String, location: Rubydex::Location).void } + def initialize(string:, location:); end + + # pkg:gem/rubydex#lib/rubydex/comment.rb:9 + sig { returns(Rubydex::Location) } + def location; end + + # pkg:gem/rubydex#lib/rubydex/comment.rb:6 + sig { returns(String) } + def string; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Constant < ::Rubydex::Declaration + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Enumerable[Rubydex::ConstantReference]) } + def references; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::ConstantAlias < ::Rubydex::Declaration + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Enumerable[Rubydex::ConstantReference]) } + def references; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::ConstantAliasDefinition < ::Rubydex::Definition; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::ConstantDefinition < ::Rubydex::Definition; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::ConstantReference < ::Rubydex::Reference + # pkg:gem/rubydex#lib/rubydex.rb:11 + def initialize(_arg0, _arg1); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(Rubydex::Location) } + def location; end + + class << self + def new(*args); end + end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::ConstantVisibilityDefinition < ::Rubydex::Definition; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Declaration + # pkg:gem/rubydex#lib/rubydex.rb:11 + def initialize(_arg0, _arg1); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Enumerable[Rubydex::Definition]) } + def definitions; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(String) } + def name; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(Rubydex::Declaration) } + def owner; end + + # @abstract + # + # pkg:gem/rubydex#lib/rubydex/declaration.rb:7 + sig { returns(T::Enumerable[Rubydex::Reference]) } + def references; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(String) } + def unqualified_name; end + + class << self + private + + # pkg:gem/rubydex#lib/rubydex.rb:11 + def new(*args); end + end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Definition + # pkg:gem/rubydex#lib/rubydex.rb:11 + def initialize(_arg0, _arg1); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Array[Rubydex::Comment]) } + def comments; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Boolean) } + def deprecated?; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(Rubydex::Location) } + def location; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(String) } + def name; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T.nilable(Rubydex::Location)) } + def name_location; end + + class << self + private + + # pkg:gem/rubydex#lib/rubydex.rb:11 + def new(*args); end + end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Diagnostic + # pkg:gem/rubydex#lib/rubydex/diagnostic.rb:15 + sig { params(rule: Symbol, message: String, location: Rubydex::Location).void } + def initialize(rule:, message:, location:); end + + # pkg:gem/rubydex#lib/rubydex/diagnostic.rb:12 + sig { returns(Rubydex::Location) } + def location; end + + # pkg:gem/rubydex#lib/rubydex/diagnostic.rb:9 + sig { returns(String) } + def message; end + + # pkg:gem/rubydex#lib/rubydex/diagnostic.rb:6 + sig { returns(Symbol) } + def rule; end +end + +# A one based location intended for display purposes. This is what should be used when displaying a location to users, +# like in CLIs +# +# pkg:gem/rubydex#lib/rubydex/location.rb:70 +class Rubydex::DisplayLocation < ::Rubydex::Location + # Normalize to zero-based for comparison with Location + # + # pkg:gem/rubydex#lib/rubydex/location.rb:81 + sig { returns([String, Integer, Integer, Integer, Integer]) } + def comparable_values; end + + # Returns itself + # + # pkg:gem/rubydex#lib/rubydex/location.rb:74 + sig { returns(Rubydex::DisplayLocation) } + def to_display; end + + # pkg:gem/rubydex#lib/rubydex/location.rb:86 + sig { returns(String) } + def to_s; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Document + # pkg:gem/rubydex#lib/rubydex.rb:11 + def initialize(_arg0, _arg1); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Enumerable[Rubydex::Definition]) } + def definitions; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(String) } + def uri; end + + class << self + private + + # pkg:gem/rubydex#lib/rubydex.rb:11 + def new(*args); end + end +end + +class Rubydex::Error < StandardError; end + +# Represents `extend SomeModule` +# +# pkg:gem/rubydex#lib/rubydex/mixin.rb:21 +class Rubydex::Extend < ::Rubydex::Mixin; end + +# pkg:gem/rubydex#lib/rubydex/failures.rb:4 +class Rubydex::Failure + # pkg:gem/rubydex#lib/rubydex/failures.rb:9 + sig { params(message: String).void } + def initialize(message); end + + # pkg:gem/rubydex#lib/rubydex/failures.rb:6 + sig { returns(String) } + def message; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::GlobalVariable < ::Rubydex::Declaration + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Array[T.untyped]) } + def references; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::GlobalVariableAliasDefinition < ::Rubydex::Definition; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::GlobalVariableDefinition < ::Rubydex::Definition; end + +# The global graph representing all declarations and their relationships for the workspace +# +# Note: this class is partially defined in C to integrate with the Rust backend +# +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Graph + # pkg:gem/rubydex#lib/rubydex/graph.rb:24 + sig { params(workspace_path: T.nilable(String)).void } + def initialize(workspace_path: T.unsafe(nil)); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { params(fully_qualified_name: String).returns(T.nilable(Rubydex::Declaration)) } + def [](fully_qualified_name); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Array[Rubydex::Failure]) } + def check_integrity; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + # Returns completion candidates for an expression context. This includes all keywords, constants, methods, instance + # variables, class variables and global variables reachable from the current lexical scope and self type. + # + # The nesting array represents the lexical scope stack, where the last element is the self type. An empty array + # defaults to `Object` as the self type (top-level context). + sig { params(nesting: T::Array[String]).returns(T::Array[T.any(Rubydex::Declaration, Rubydex::Keyword)]) } + def complete_expression(nesting); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + # Returns completion candidates inside a method call's argument list (e.g., `foo.bar(|)`). This includes everything + # that expression completion provides plus keyword argument names of the method being called. + # + # The nesting array represents the lexical scope stack, where the last element is the self type. + sig do + params( + name: String, + nesting: T::Array[String] + ).returns(T::Array[T.any(Rubydex::Declaration, Rubydex::Keyword, Rubydex::KeywordParameter)]) + end + def complete_method_argument(name, nesting); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + # Returns completion candidates after a method call operator (e.g., `foo.`). This includes all methods that exist on + # the type of the receiver and its ancestors. + sig { params(name: String).returns(T::Array[Rubydex::Method]) } + def complete_method_call(name); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + # Returns completion candidates after a namespace access operator (e.g., `Foo::`). This includes all constants and + # singleton methods for the namespace and its ancestors. + sig { params(name: String).returns(T::Array[Rubydex::Declaration]) } + def complete_namespace_access(name); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Enumerable[Rubydex::ConstantReference]) } + def constant_references; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Enumerable[Rubydex::Declaration]) } + def declarations; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { params(uri: String).returns(T.nilable(Rubydex::Document)) } + def delete_document(uri); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Array[Rubydex::Diagnostic]) } + def diagnostics; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Enumerable[Rubydex::Document]) } + def documents; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { params(encoding: String).void } + def encoding=(encoding); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { params(paths: T::Array[String]).void } + def exclude_paths(paths); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Array[String]) } + def excluded_paths; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { params(query: String).returns(T::Enumerable[Rubydex::Declaration]) } + def fuzzy_search(query); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { params(file_paths: T::Array[String]).returns(T::Array[String]) } + def index_all(file_paths); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { params(uri: String, source: String, language_id: String).void } + def index_source(uri, source, language_id); end + + # Index all files and dependencies of the workspace that exists in `@workspace_path` + # + # pkg:gem/rubydex#lib/rubydex/graph.rb:32 + sig { returns(T::Array[String]) } + def index_workspace; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + def keyword(_arg0); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Enumerable[Rubydex::MethodReference]) } + def method_references; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { params(load_paths: T::Array[String]).returns(T::Array[String]) } + def require_paths(load_paths); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T.self_type) } + def resolve; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { params(name: String, nesting: T::Array[String]).returns(T.nilable(Rubydex::Declaration)) } + def resolve_constant(name, nesting); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { params(require_path: String, load_paths: T::Array[String]).returns(T.nilable(Rubydex::Document)) } + def resolve_require_path(require_path, load_paths); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { params(query: String).returns(T::Enumerable[Rubydex::Declaration]) } + def search(query); end + + # pkg:gem/rubydex#lib/rubydex/graph.rb:21 + sig { returns(String) } + def workspace_path; end + + # pkg:gem/rubydex#lib/rubydex/graph.rb:21 + sig { params(workspace_path: String).returns(String) } + def workspace_path=(workspace_path); end + + # Returns all workspace paths that should be indexed, excluding directories that we don't need to descend into such + # as `.git`, `node_modules`. Also includes any top level Ruby files + # + # pkg:gem/rubydex#lib/rubydex/graph.rb:40 + sig { returns(T::Array[String]) } + def workspace_paths; end + + private + + # Searches for the latest installation of the `rbs` gem and adds the paths for the core and stdlib RBS definitions + # to the list of paths. This method does not require `rbs` to be a part of the bundle. It searches for whatever + # latest installation of `rbs` exists in the system and fails silently if we can't find one + # + # pkg:gem/rubydex#lib/rubydex/graph.rb:87 + sig { params(paths: T::Array[String]).void } + def add_core_rbs_definition_paths(paths); end + + # Gathers the paths we have to index for all workspace dependencies + # + # pkg:gem/rubydex#lib/rubydex/graph.rb:63 + sig { params(paths: T::Array[String]).void } + def add_workspace_dependency_paths(paths); end +end + +# pkg:gem/rubydex#lib/rubydex/graph.rb:8 +Rubydex::Graph::IGNORED_DIRECTORIES = T.let(T.unsafe(nil), Array) + +# Represents `include SomeModule` +# +# pkg:gem/rubydex#lib/rubydex/mixin.rb:15 +class Rubydex::Include < ::Rubydex::Mixin; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::InstanceVariable < ::Rubydex::Declaration + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Array[T.untyped]) } + def references; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::InstanceVariableDefinition < ::Rubydex::Definition; end + +# pkg:gem/rubydex#lib/rubydex/failures.rb:14 +class Rubydex::IntegrityFailure < ::Rubydex::Failure; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Keyword + # pkg:gem/rubydex#lib/rubydex/keyword.rb:12 + sig { params(name: String, documentation: String).void } + def initialize(name, documentation); end + + # pkg:gem/rubydex#lib/rubydex/keyword.rb:9 + sig { returns(String) } + def documentation; end + + # pkg:gem/rubydex#lib/rubydex/keyword.rb:6 + sig { returns(String) } + def name; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::KeywordParameter + # pkg:gem/rubydex#lib/rubydex/keyword_parameter.rb:9 + sig { params(name: String).void } + def initialize(name); end + + # pkg:gem/rubydex#lib/rubydex/keyword_parameter.rb:6 + sig { returns(String) } + def name; end +end + +# A zero based internal location. Intended to be used for tool-to-tool communication, such as a language server +# communicating with an editor. +# +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Location + include ::Comparable + + # pkg:gem/rubydex#lib/rubydex/location.rb:18 + sig { params(uri: String, start_line: Integer, end_line: Integer, start_column: Integer, end_column: Integer).void } + def initialize(uri:, start_line:, end_line:, start_column:, end_column:); end + + # pkg:gem/rubydex#lib/rubydex/location.rb:38 + sig { params(other: T.untyped).returns(T.nilable(Integer)) } + def <=>(other); end + + # pkg:gem/rubydex#lib/rubydex/location.rb:45 + sig { returns([String, Integer, Integer, Integer, Integer]) } + def comparable_values; end + + # pkg:gem/rubydex#lib/rubydex/location.rb:15 + sig { returns(Integer) } + def end_column; end + + # pkg:gem/rubydex#lib/rubydex/location.rb:15 + sig { returns(Integer) } + def end_line; end + + # pkg:gem/rubydex#lib/rubydex/location.rb:15 + sig { returns(Integer) } + def start_column; end + + # pkg:gem/rubydex#lib/rubydex/location.rb:15 + sig { returns(Integer) } + def start_line; end + + # Turns this zero based location into a one based location for display purposes. + # + # pkg:gem/rubydex#lib/rubydex/location.rb:52 + sig { returns(Rubydex::DisplayLocation) } + def to_display; end + + # pkg:gem/rubydex#lib/rubydex/location.rb:27 + sig { returns(String) } + def to_file_path; end + + # pkg:gem/rubydex#lib/rubydex/location.rb:63 + sig { returns(String) } + def to_s; end + + # pkg:gem/rubydex#lib/rubydex/location.rb:12 + sig { returns(String) } + def uri; end +end + +# pkg:gem/rubydex#lib/rubydex/location.rb:7 +class Rubydex::Location::NotFileUriError < ::StandardError; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Method < ::Rubydex::Declaration + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Enumerable[Rubydex::MethodReference]) } + def references; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::MethodAliasDefinition < ::Rubydex::Definition; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::MethodDefinition < ::Rubydex::Definition; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::MethodReference < ::Rubydex::Reference + # pkg:gem/rubydex#lib/rubydex.rb:11 + def initialize(_arg0, _arg1); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(Rubydex::Location) } + def location; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(String) } + def name; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::MethodVisibilityDefinition < ::Rubydex::Definition; end + +# pkg:gem/rubydex#lib/rubydex/mixin.rb:4 +class Rubydex::Mixin + # pkg:gem/rubydex#lib/rubydex/mixin.rb:9 + sig { params(constant_reference: Rubydex::ConstantReference).void } + def initialize(constant_reference); end + + # pkg:gem/rubydex#lib/rubydex/mixin.rb:6 + def constant_reference; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Module < ::Rubydex::Namespace; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::ModuleDefinition < ::Rubydex::Definition + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Array[Rubydex::Mixin]) } + def mixins; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Namespace < ::Rubydex::Declaration + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Enumerable[Rubydex::Namespace]) } + def ancestors; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Enumerable[Rubydex::Namespace]) } + def descendants; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + def find_member(*_arg0); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { params(name: String).returns(T.nilable(Rubydex::Declaration)) } + def member(name); end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Enumerable[Rubydex::Declaration]) } + def members; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Enumerable[Rubydex::ConstantReference]) } + def references; end + + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T.nilable(Rubydex::SingletonClass)) } + def singleton_class; end +end + +# Represents `prepend SomeModule` +# +# pkg:gem/rubydex#lib/rubydex/mixin.rb:18 +class Rubydex::Prepend < ::Rubydex::Mixin; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Reference + # pkg:gem/rubydex#lib/rubydex.rb:11 + def initialize(_arg0, _arg1); end + + class << self + private + + # pkg:gem/rubydex#lib/rubydex.rb:11 + def new(*args); end + end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::ResolvedConstantReference < ::Rubydex::ConstantReference + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(Rubydex::Declaration) } + def declaration; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::SingletonClass < ::Rubydex::Namespace; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::SingletonClassDefinition < ::Rubydex::Definition + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(T::Array[Rubydex::Mixin]) } + def mixins; end +end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::Todo < ::Rubydex::Namespace; end + +# pkg:gem/rubydex#lib/rubydex.rb:11 +class Rubydex::UnresolvedConstantReference < ::Rubydex::ConstantReference + # pkg:gem/rubydex#lib/rubydex.rb:11 + sig { returns(String) } + def name; end +end + +# pkg:gem/rubydex#lib/rubydex/version.rb:4 +Rubydex::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/spoom@1.6.1.rbi b/sorbet/rbi/gems/spoom@1.6.1.rbi deleted file mode 100644 index 0d5ef74..0000000 --- a/sorbet/rbi/gems/spoom@1.6.1.rbi +++ /dev/null @@ -1,7274 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `spoom` gem. -# Please instead update this file by running `bin/tapioca gem spoom`. - - -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `spoom` gem. -# Please instead update this file by running `spoom srb sigs export`. - -# source://spoom//lib/spoom.rb#7 -module Spoom - class << self - # : (String ruby, file: String) -> Prism::Node - # - # source://spoom//lib/spoom/parse.rb#11 - sig { params(ruby: ::String, file: ::String).returns(::Prism::Node) } - def parse_ruby(ruby, file:); end - - # : (String ruby, file: String) -> [Prism::Node, Array[Prism::Comment]] - # - # source://spoom//lib/spoom/parse.rb#27 - sig { params(ruby: ::String, file: ::String).returns([::Prism::Node, T::Array[::Prism::Comment]]) } - def parse_ruby_with_comments(ruby, file:); end - end -end - -# source://spoom//lib/spoom/cli/helper.rb#9 -module Spoom::Cli; end - -# source://spoom//lib/spoom/cli/deadcode.rb#8 -class Spoom::Cli::Deadcode < ::Thor - include ::Spoom::Colorize - include ::Spoom::Cli::Helper - - # : (*String paths) -> void - # - # source://spoom//lib/spoom/cli/deadcode.rb#51 - sig { params(paths: ::String).void } - def deadcode(*paths); end - - def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end - - # source://spoom//lib/spoom/cli/deadcode.rb#153 - def remove(location_string); end -end - -# source://spoom//lib/spoom/cli/helper.rb#10 -module Spoom::Cli::Helper - include ::Spoom::Colorize - - requires_ancestor { Thor } - - # : (String string) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#147 - sig { params(string: ::String).returns(::String) } - def blue(string); end - - # Collect files from `paths`, defaulting to `exec_path` - # : (Array[String] paths) -> Array[String] - # - # source://spoom//lib/spoom/cli/helper.rb#85 - # Collect files from `paths`, defaulting to `exec_path` - sig { params(paths: T::Array[::String]).returns(T::Array[::String]) } - def collect_files(paths); end - - # Is the `--color` option true? - # : -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/cli/helper.rb#111 - # Is the `--color` option true? - sig { returns(T::Boolean) } - def color?; end - - # Colorize a string if `color?` - # : (String string, *Color color) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#140 - # Colorize a string if `color?` - sig { params(string: ::String, color: ::Spoom::Color).returns(::String) } - def colorize(string, *color); end - - # Returns the context at `--path` (by default the current working directory) - # : -> Context - # - # source://spoom//lib/spoom/cli/helper.rb#58 - # Returns the context at `--path` (by default the current working directory) - sig { returns(::Spoom::Context) } - def context; end - - # Raise if `spoom` is not ran inside a context with a `sorbet/config` file - # : -> Context - # - # source://spoom//lib/spoom/cli/helper.rb#64 - # Raise if `spoom` is not ran inside a context with a `sorbet/config` file - sig { returns(::Spoom::Context) } - def context_requiring_sorbet!; end - - # : (String string) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#152 - sig { params(string: ::String).returns(::String) } - def cyan(string); end - - # Return the path specified through `--path` - # : -> String - # - # source://spoom//lib/spoom/cli/helper.rb#79 - # Return the path specified through `--path` - sig { returns(::String) } - def exec_path; end - - # : (String string) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#157 - sig { params(string: ::String).returns(::String) } - def gray(string); end - - # : (String string) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#162 - sig { params(string: ::String).returns(::String) } - def green(string); end - - # : (String string) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#116 - sig { params(string: ::String).returns(::String) } - def highlight(string); end - - # : (String string) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#167 - sig { params(string: ::String).returns(::String) } - def red(string); end - - # Print `message` on `$stdout` - # : (String message) -> void - # - # source://spoom//lib/spoom/cli/helper.rb#19 - # Print `message` on `$stdout` - sig { params(message: ::String).void } - def say(message); end - - # Print `message` on `$stderr` - # - # The message is prefixed by a status (default: `Error`). - # : (String message, ?status: String?, ?nl: bool) -> void - # - # source://spoom//lib/spoom/cli/helper.rb#32 - # Print `message` on `$stderr` - # The message is prefixed by a status (default: `Error`). - sig { params(message: ::String, status: T.nilable(::String), nl: T::Boolean).void } - def say_error(message, status: T.unsafe(nil), nl: T.unsafe(nil)); end - - # Print `message` on `$stderr` - # - # The message is prefixed by a status (default: `Warning`). - # : (String message, ?status: String?, ?nl: bool) -> void - # - # source://spoom//lib/spoom/cli/helper.rb#46 - # Print `message` on `$stderr` - # The message is prefixed by a status (default: `Warning`). - sig { params(message: ::String, status: T.nilable(::String), nl: T::Boolean).void } - def say_warning(message, status: T.unsafe(nil), nl: T.unsafe(nil)); end - - # : (String string) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#172 - sig { params(string: ::String).returns(::String) } - def yellow(string); end -end - -# source://spoom//lib/spoom/cli.rb#12 -class Spoom::Cli::Main < ::Thor - include ::Spoom::Colorize - include ::Spoom::Cli::Helper - - # source://spoom//lib/spoom/cli.rb#100 - def __print_version; end - - # : (?String directory) -> void - # - # source://spoom//lib/spoom/cli.rb#57 - sig { params(directory: ::String).void } - def bump(directory = T.unsafe(nil)); end - - # source://spoom//lib/spoom/cli.rb#64 - def coverage(*args); end - - # source://thor/1.4.0/lib/thor.rb#334 - def deadcode(*args); end - - # source://spoom//lib/spoom/cli.rb#74 - def lsp(*args); end - - # source://thor/1.4.0/lib/thor.rb#334 - def srb(*args); end - - # source://spoom//lib/spoom/cli.rb#93 - def tc(*paths_to_select); end - - class << self - # @return [Boolean] - # - # source://spoom//lib/spoom/cli.rb#107 - def exit_on_failure?; end - end -end - -# source://spoom//lib/spoom/cli.rb#80 -Spoom::Cli::Main::SORT_CODE = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/cli.rb#82 -Spoom::Cli::Main::SORT_ENUM = T.let(T.unsafe(nil), Array) - -# source://spoom//lib/spoom/cli.rb#81 -Spoom::Cli::Main::SORT_LOC = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/cli/srb/assertions.rb#6 -module Spoom::Cli::Srb; end - -# source://spoom//lib/spoom/cli/srb/assertions.rb#7 -class Spoom::Cli::Srb::Assertions < ::Thor - include ::Spoom::Colorize - include ::Spoom::Cli::Helper - - def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end - - # source://spoom//lib/spoom/cli/srb/assertions.rb#29 - def transform_files(files, &block); end - - # source://spoom//lib/spoom/cli/srb/assertions.rb#13 - def translate(*paths); end -end - -# source://spoom//lib/spoom/cli/srb/bump.rb#10 -class Spoom::Cli::Srb::Bump < ::Thor - include ::Spoom::Colorize - include ::Spoom::Cli::Helper - - # : (?String directory) -> void - # - # source://spoom//lib/spoom/cli/srb/bump.rb#49 - sig { params(directory: ::String).void } - def bump(directory = T.unsafe(nil)); end - - def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end - - # source://spoom//lib/spoom/cli/srb/bump.rb#170 - def print_changes(files, command:, from: T.unsafe(nil), to: T.unsafe(nil), dry: T.unsafe(nil), path: T.unsafe(nil)); end - - # source://spoom//lib/spoom/cli/srb/bump.rb#192 - def undo_changes(files, from_strictness); end -end - -# source://spoom//lib/spoom/cli/srb/coverage.rb#10 -class Spoom::Cli::Srb::Coverage < ::Thor - include ::Spoom::Colorize - include ::Spoom::Cli::Helper - - # source://spoom//lib/spoom/cli/srb/coverage.rb#199 - def bundle_install(path, sha); end - - def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end - - # source://spoom//lib/spoom/cli/srb/coverage.rb#211 - def message_no_data(file); end - - # source://spoom//lib/spoom/cli/srb/coverage.rb#174 - def open(file = T.unsafe(nil)); end - - # source://spoom//lib/spoom/cli/srb/coverage.rb#190 - def parse_time(string, option); end - - # source://spoom//lib/spoom/cli/srb/coverage.rb#143 - def report; end - - # source://spoom//lib/spoom/cli/srb/coverage.rb#21 - def snapshot; end - - # source://spoom//lib/spoom/cli/srb/coverage.rb#43 - def timeline; end -end - -# source://spoom//lib/spoom/cli/srb/coverage.rb#13 -Spoom::Cli::Srb::Coverage::DATA_DIR = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/cli/srb/lsp.rb#11 -class Spoom::Cli::Srb::LSP < ::Thor - include ::Spoom::Colorize - include ::Spoom::Cli::Helper - - # TODO: options, filter, limit, kind etc.. filter rbi - # - # source://spoom//lib/spoom/cli/srb/lsp.rb#45 - def defs(file, line, col); end - - # TODO: options, filter, limit, kind etc.. filter rbi - # - # source://spoom//lib/spoom/cli/srb/lsp.rb#55 - def find(query); end - - def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end - - # TODO: options, filter, limit, kind etc.. filter rbi - # - # source://spoom//lib/spoom/cli/srb/lsp.rb#31 - def hover(file, line, col); end - - # TODO: options, filter, limit, kind etc.. filter rbi - # - # source://spoom//lib/spoom/cli/srb/lsp.rb#16 - def list; end - - # source://spoom//lib/spoom/cli/srb/lsp.rb#104 - def lsp_client; end - - # TODO: options, filter, limit, kind etc.. filter rbi - # - # source://spoom//lib/spoom/cli/srb/lsp.rb#75 - def refs(file, line, col); end - - # source://spoom//lib/spoom/cli/srb/lsp.rb#127 - def run(&block); end - - # TODO: options, filter, limit, kind etc.. filter rbi - # - # source://spoom//lib/spoom/cli/srb/lsp.rb#85 - def sigs(file, line, col); end - - # source://spoom//lib/spoom/cli/srb/lsp.rb#119 - def symbol_printer; end - - # TODO: options, filter, limit, kind etc.. filter rbi - # - # source://spoom//lib/spoom/cli/srb/lsp.rb#65 - def symbols(file); end - - # source://spoom//lib/spoom/cli/srb/lsp.rb#152 - def to_uri(path); end - - # TODO: options, filter, limit, kind etc.. filter rbi - # - # source://spoom//lib/spoom/cli/srb/lsp.rb#95 - def types(file, line, col); end -end - -# source://spoom//lib/spoom/cli/srb.rb#14 -class Spoom::Cli::Srb::Main < ::Thor - # source://thor/1.4.0/lib/thor.rb#334 - def assertions(*args); end - - # source://thor/1.4.0/lib/thor.rb#334 - def bump(*args); end - - # source://thor/1.4.0/lib/thor.rb#334 - def coverage(*args); end - - def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end - - # source://thor/1.4.0/lib/thor.rb#334 - def lsp(*args); end - - # source://thor/1.4.0/lib/thor.rb#334 - def sigs(*args); end - - # source://thor/1.4.0/lib/thor.rb#334 - def tc(*args); end -end - -# source://spoom//lib/spoom/cli/srb/sigs.rb#9 -class Spoom::Cli::Srb::Sigs < ::Thor - include ::Spoom::Colorize - include ::Spoom::Cli::Helper - - # source://spoom//lib/spoom/cli/srb/sigs.rb#197 - def exec(context, command); end - - # source://spoom//lib/spoom/cli/srb/sigs.rb#68 - def export(output_path = T.unsafe(nil)); end - - def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end - - # source://spoom//lib/spoom/cli/srb/sigs.rb#49 - def strip(*paths); end - - # source://spoom//lib/spoom/cli/srb/sigs.rb#174 - def transform_files(files, &block); end - - # source://spoom//lib/spoom/cli/srb/sigs.rb#20 - def translate(*paths); end -end - -# source://spoom//lib/spoom/cli/srb/tc.rb#7 -class Spoom::Cli::Srb::Tc < ::Thor - include ::Spoom::Colorize - include ::Spoom::Cli::Helper - - # source://spoom//lib/spoom/cli/srb/tc.rb#132 - def colorize_message(message); end - - # source://spoom//lib/spoom/cli/srb/tc.rb#123 - def format_error(error, format); end - - def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end - - # source://spoom//lib/spoom/cli/srb/tc.rb#27 - def tc(*paths_to_select); end -end - -# source://spoom//lib/spoom/cli/srb/tc.rb#16 -Spoom::Cli::Srb::Tc::DEFAULT_FORMAT = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/cli/srb/tc.rb#12 -Spoom::Cli::Srb::Tc::SORT_CODE = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/cli/srb/tc.rb#14 -Spoom::Cli::Srb::Tc::SORT_ENUM = T.let(T.unsafe(nil), Array) - -# source://spoom//lib/spoom/cli/srb/tc.rb#13 -Spoom::Cli::Srb::Tc::SORT_LOC = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/colors.rb#5 -class Spoom::Color < ::T::Enum - enums do - BLACK = new - BLUE = new - BOLD = new - CLEAR = new - CYAN = new - GREEN = new - LIGHT_BLACK = new - LIGHT_BLUE = new - LIGHT_CYAN = new - LIGHT_GREEN = new - LIGHT_MAGENTA = new - LIGHT_RED = new - LIGHT_WHITE = new - LIGHT_YELLOW = new - MAGENTA = new - RED = new - WHITE = new - YELLOW = new - end - - # : -> String - # - # source://spoom//lib/spoom/colors.rb#30 - sig { returns(::String) } - def ansi_code; end -end - -# source://spoom//lib/spoom/colors.rb#35 -module Spoom::Colorize - # : (String string, *Color color) -> String - # - # source://spoom//lib/spoom/colors.rb#37 - sig { params(string: ::String, color: ::Spoom::Color).returns(::String) } - def set_color(string, *color); end -end - -# An abstraction to a Ruby project context -# -# A context maps to a directory in the file system. -# It is used to manipulate files and run commands in the context of this directory. -# -# source://spoom//lib/spoom/context/bundle.rb#5 -# An abstraction to a Ruby project context -# A context maps to a directory in the file system. -class Spoom::Context - include ::Spoom::Context::Bundle - include ::Spoom::Context::Exec - include ::Spoom::Context::FileSystem - include ::Spoom::Context::Git - include ::Spoom::Context::Sorbet - - # Create a new context about `absolute_path` - # - # The directory will not be created if it doesn't exist. - # Call `#make!` to create it. - # : (String absolute_path) -> void - # - # @return [Context] a new instance of Context - # - # source://spoom//lib/spoom/context.rb#47 - # Create a new context about `absolute_path` - # The directory will not be created if it doesn't exist. - # Call `#make!` to create it. - sig { params(absolute_path: ::String).void } - def initialize(absolute_path); end - - # The absolute path to the directory this context is about - # : String - # - # source://spoom//lib/spoom/context.rb#40 - # The absolute path to the directory this context is about - sig { returns(::String) } - def absolute_path; end - - class << self - # Create a new context in the system's temporary directory - # - # `name` is used as prefix to the temporary directory name. - # The directory will be created if it doesn't exist. - # : (?String? name) -> instance - # - # source://spoom//lib/spoom/context.rb#33 - # Create a new context in the system's temporary directory - # `name` is used as prefix to the temporary directory name. - # The directory will be created if it doesn't exist. - sig { params(name: T.nilable(::String)).returns(T.attached_class) } - def mktmp!(name = T.unsafe(nil)); end - end -end - -# Bundle features for a context -# -# source://spoom//lib/spoom/context/bundle.rb#7 -module Spoom::Context::Bundle - requires_ancestor { Spoom::Context } - - # Run a command with `bundle` in this context directory - # : (String command, ?version: String?, ?capture_err: bool) -> ExecResult - # - # source://spoom//lib/spoom/context/bundle.rb#32 - # Run a command with `bundle` in this context directory - sig { params(command: ::String, version: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } - def bundle(command, version: T.unsafe(nil), capture_err: T.unsafe(nil)); end - - # Run a command `bundle exec` in this context directory - # : (String command, ?version: String?, ?capture_err: bool) -> ExecResult - # - # source://spoom//lib/spoom/context/bundle.rb#45 - # Run a command `bundle exec` in this context directory - sig { params(command: ::String, version: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } - def bundle_exec(command, version: T.unsafe(nil), capture_err: T.unsafe(nil)); end - - # Run `bundle install` in this context directory - # : (?version: String?, ?capture_err: bool) -> ExecResult - # - # source://spoom//lib/spoom/context/bundle.rb#39 - # Run `bundle install` in this context directory - sig { params(version: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } - def bundle_install!(version: T.unsafe(nil), capture_err: T.unsafe(nil)); end - - # Get `gem` version from the `Gemfile.lock` content - # - # Returns `nil` if `gem` cannot be found in the Gemfile. - # : (String gem) -> Gem::Version? - # - # source://spoom//lib/spoom/context/bundle.rb#61 - # Get `gem` version from the `Gemfile.lock` content - # Returns `nil` if `gem` cannot be found in the Gemfile. - sig { params(gem: ::String).returns(T.nilable(::Gem::Version)) } - def gem_version_from_gemfile_lock(gem); end - - # : -> Hash[String, Bundler::LazySpecification] - # - # source://spoom//lib/spoom/context/bundle.rb#50 - sig { returns(T::Hash[::String, ::Bundler::LazySpecification]) } - def gemfile_lock_specs; end - - # Read the contents of the Gemfile in this context directory - # : -> String? - # - # source://spoom//lib/spoom/context/bundle.rb#14 - # Read the contents of the Gemfile in this context directory - sig { returns(T.nilable(::String)) } - def read_gemfile; end - - # Read the contents of the Gemfile.lock in this context directory - # : -> String? - # - # source://spoom//lib/spoom/context/bundle.rb#20 - # Read the contents of the Gemfile.lock in this context directory - sig { returns(T.nilable(::String)) } - def read_gemfile_lock; end - - # Set the `contents` of the Gemfile in this context directory - # : (String contents, ?append: bool) -> void - # - # source://spoom//lib/spoom/context/bundle.rb#26 - # Set the `contents` of the Gemfile in this context directory - sig { params(contents: ::String, append: T::Boolean).void } - def write_gemfile!(contents, append: T.unsafe(nil)); end -end - -# Execution features for a context -# -# source://spoom//lib/spoom/context/exec.rb#25 -module Spoom::Context::Exec - requires_ancestor { Spoom::Context } - - # Run a command in this context directory - # : (String command, ?capture_err: bool) -> ExecResult - # - # source://spoom//lib/spoom/context/exec.rb#32 - # Run a command in this context directory - sig { params(command: ::String, capture_err: T::Boolean).returns(::Spoom::ExecResult) } - def exec(command, capture_err: T.unsafe(nil)); end -end - -# File System features for a context -# -# source://spoom//lib/spoom/context/file_system.rb#7 -module Spoom::Context::FileSystem - requires_ancestor { Spoom::Context } - - # Returns the absolute path to `relative_path` in the context's directory - # : (String relative_path) -> String - # - # source://spoom//lib/spoom/context/file_system.rb#14 - # Returns the absolute path to `relative_path` in the context's directory - sig { params(relative_path: ::String).returns(::String) } - def absolute_path_to(relative_path); end - - # : (?allow_extensions: Array[String], ?allow_mime_types: Array[String], ?exclude_patterns: Array[String]) -> Array[String] - # - # source://spoom//lib/spoom/context/file_system.rb#46 - sig do - params( - allow_extensions: T::Array[::String], - allow_mime_types: T::Array[::String], - exclude_patterns: T::Array[::String] - ).returns(T::Array[::String]) - end - def collect_files(allow_extensions: T.unsafe(nil), allow_mime_types: T.unsafe(nil), exclude_patterns: T.unsafe(nil)); end - - # Delete this context and its content - # - # Warning: it will `rm -rf` the context directory on the file system. - # : -> void - # - # source://spoom//lib/spoom/context/file_system.rb#98 - # Delete this context and its content - # Warning: it will `rm -rf` the context directory on the file system. - sig { void } - def destroy!; end - - # Does the context directory at `absolute_path` exist and is a directory? - # : -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/context/file_system.rb#20 - # Does the context directory at `absolute_path` exist and is a directory? - sig { returns(T::Boolean) } - def exist?; end - - # Does `relative_path` point to an existing file in this context directory? - # : (String relative_path) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/context/file_system.rb#58 - # Does `relative_path` point to an existing file in this context directory? - sig { params(relative_path: ::String).returns(T::Boolean) } - def file?(relative_path); end - - # List all files in this context matching `pattern` - # : (?String pattern) -> Array[String] - # - # source://spoom//lib/spoom/context/file_system.rb#33 - # List all files in this context matching `pattern` - sig { params(pattern: ::String).returns(T::Array[::String]) } - def glob(pattern = T.unsafe(nil)); end - - # List all files at the top level of this context directory - # : -> Array[String] - # - # source://spoom//lib/spoom/context/file_system.rb#41 - # List all files at the top level of this context directory - sig { returns(T::Array[::String]) } - def list; end - - # Create the context directory at `absolute_path` - # : -> void - # - # source://spoom//lib/spoom/context/file_system.rb#26 - # Create the context directory at `absolute_path` - sig { void } - def mkdir!; end - - # Move the file or directory from `from_relative_path` to `to_relative_path` - # : (String from_relative_path, String to_relative_path) -> void - # - # source://spoom//lib/spoom/context/file_system.rb#88 - # Move the file or directory from `from_relative_path` to `to_relative_path` - sig { params(from_relative_path: ::String, to_relative_path: ::String).void } - def move!(from_relative_path, to_relative_path); end - - # Return the contents of the file at `relative_path` in this context directory - # - # Will raise if the file doesn't exist. - # : (String relative_path) -> String - # - # source://spoom//lib/spoom/context/file_system.rb#66 - # Return the contents of the file at `relative_path` in this context directory - # Will raise if the file doesn't exist. - sig { params(relative_path: ::String).returns(::String) } - def read(relative_path); end - - # Remove the path at `relative_path` (recursive + force) in this context directory - # : (String relative_path) -> void - # - # source://spoom//lib/spoom/context/file_system.rb#82 - # Remove the path at `relative_path` (recursive + force) in this context directory - sig { params(relative_path: ::String).void } - def remove!(relative_path); end - - # Write `contents` in the file at `relative_path` in this context directory - # - # Append to the file if `append` is true. - # : (String relative_path, ?String contents, ?append: bool) -> void - # - # source://spoom//lib/spoom/context/file_system.rb#74 - # Write `contents` in the file at `relative_path` in this context directory - # Append to the file if `append` is true. - sig { params(relative_path: ::String, contents: ::String, append: T::Boolean).void } - def write!(relative_path, contents = T.unsafe(nil), append: T.unsafe(nil)); end -end - -# Git features for a context -# -# source://spoom//lib/spoom/context/git.rb#31 -module Spoom::Context::Git - requires_ancestor { Spoom::Context } - - # Run a command prefixed by `git` in this context directory - # : (String command) -> ExecResult - # - # source://spoom//lib/spoom/context/git.rb#38 - # Run a command prefixed by `git` in this context directory - sig { params(command: ::String).returns(::Spoom::ExecResult) } - def git(command); end - - # Run `git checkout` in this context directory - # : (?ref: String) -> ExecResult - # - # source://spoom//lib/spoom/context/git.rb#57 - # Run `git checkout` in this context directory - sig { params(ref: ::String).returns(::Spoom::ExecResult) } - def git_checkout!(ref: T.unsafe(nil)); end - - # Run `git checkout -b <branch-name> <ref>` in this context directory - # : (String branch_name, ?ref: String?) -> ExecResult - # - # source://spoom//lib/spoom/context/git.rb#63 - # Run `git checkout -b <branch-name> <ref>` in this context directory - sig { params(branch_name: ::String, ref: T.nilable(::String)).returns(::Spoom::ExecResult) } - def git_checkout_new_branch!(branch_name, ref: T.unsafe(nil)); end - - # Run `git add . && git commit` in this context directory - # : (?message: String, ?time: Time, ?allow_empty: bool) -> ExecResult - # - # source://spoom//lib/spoom/context/git.rb#73 - # Run `git add . && git commit` in this context directory - sig { params(message: ::String, time: ::Time, allow_empty: T::Boolean).returns(::Spoom::ExecResult) } - def git_commit!(message: T.unsafe(nil), time: T.unsafe(nil), allow_empty: T.unsafe(nil)); end - - # Get the current git branch in this context directory - # : -> String? - # - # source://spoom//lib/spoom/context/git.rb#84 - # Get the current git branch in this context directory - sig { returns(T.nilable(::String)) } - def git_current_branch; end - - # Run `git diff` in this context directory - # : (*String arg) -> ExecResult - # - # source://spoom//lib/spoom/context/git.rb#93 - # Run `git diff` in this context directory - sig { params(arg: ::String).returns(::Spoom::ExecResult) } - def git_diff(*arg); end - - # Run `git init` in this context directory - # - # Warning: passing a branch will run `git init -b <branch>` which is only available in git 2.28+. - # In older versions, use `git_init!` followed by `git("checkout -b <branch>")`. - # : (?branch: String?) -> ExecResult - # - # source://spoom//lib/spoom/context/git.rb#47 - # Run `git init` in this context directory - # Warning: passing a branch will run `git init -b <branch>` which is only available in git 2.28+. - # In older versions, use `git_init!` followed by `git("checkout -b <branch>")`. - sig { params(branch: T.nilable(::String)).returns(::Spoom::ExecResult) } - def git_init!(branch: T.unsafe(nil)); end - - # Get the last commit in the currently checked out branch - # : (?short_sha: bool) -> Spoom::Git::Commit? - # - # source://spoom//lib/spoom/context/git.rb#99 - # Get the last commit in the currently checked out branch - sig { params(short_sha: T::Boolean).returns(T.nilable(::Spoom::Git::Commit)) } - def git_last_commit(short_sha: T.unsafe(nil)); end - - # : (*String arg) -> ExecResult - # - # source://spoom//lib/spoom/context/git.rb#110 - sig { params(arg: ::String).returns(::Spoom::ExecResult) } - def git_log(*arg); end - - # Run `git push <remote> <ref>` in this context directory - # : (String remote, String ref, ?force: bool) -> ExecResult - # - # source://spoom//lib/spoom/context/git.rb#116 - # Run `git push <remote> <ref>` in this context directory - sig { params(remote: ::String, ref: ::String, force: T::Boolean).returns(::Spoom::ExecResult) } - def git_push!(remote, ref, force: T.unsafe(nil)); end - - # : (*String arg) -> ExecResult - # - # source://spoom//lib/spoom/context/git.rb#121 - sig { params(arg: ::String).returns(::Spoom::ExecResult) } - def git_show(*arg); end - - # Is there uncommitted changes in this context directory? - # : (?path: String) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/context/git.rb#127 - # Is there uncommitted changes in this context directory? - sig { params(path: ::String).returns(T::Boolean) } - def git_workdir_clean?(path: T.unsafe(nil)); end -end - -# Sorbet features for a context -# -# source://spoom//lib/spoom/context/sorbet.rb#7 -module Spoom::Context::Sorbet - requires_ancestor { Spoom::Context } - - # Does this context has a `sorbet/config` file? - # : -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/context/sorbet.rb#106 - # Does this context has a `sorbet/config` file? - sig { returns(T::Boolean) } - def has_sorbet_config?; end - - # Read the strictness sigil from the file at `relative_path` (returns `nil` if no sigil) - # : (String relative_path) -> String? - # - # source://spoom//lib/spoom/context/sorbet.rb#129 - # Read the strictness sigil from the file at `relative_path` (returns `nil` if no sigil) - sig { params(relative_path: ::String).returns(T.nilable(::String)) } - def read_file_strictness(relative_path); end - - # Read the contents of `sorbet/config` in this context directory - # : -> String - # - # source://spoom//lib/spoom/context/sorbet.rb#117 - # Read the contents of `sorbet/config` in this context directory - sig { returns(::String) } - def read_sorbet_config; end - - # : -> Spoom::Sorbet::Config - # - # source://spoom//lib/spoom/context/sorbet.rb#111 - sig { returns(::Spoom::Sorbet::Config) } - def sorbet_config; end - - # Get the commit introducing the `sorbet/config` file - # : -> Spoom::Git::Commit? - # - # source://spoom//lib/spoom/context/sorbet.rb#135 - # Get the commit introducing the `sorbet/config` file - sig { returns(T.nilable(::Spoom::Git::Commit)) } - def sorbet_intro_commit; end - - # Get the commit removing the `sorbet/config` file - # : -> Spoom::Git::Commit? - # - # source://spoom//lib/spoom/context/sorbet.rb#147 - # Get the commit removing the `sorbet/config` file - sig { returns(T.nilable(::Spoom::Git::Commit)) } - def sorbet_removal_commit; end - - # Run `bundle exec srb` in this context directory - # : (*String arg, ?sorbet_bin: String?, ?capture_err: bool) -> ExecResult - # - # source://spoom//lib/spoom/context/sorbet.rb#14 - # Run `bundle exec srb` in this context directory - sig { params(arg: ::String, sorbet_bin: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } - def srb(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end - - # List all files typechecked by Sorbet from its `config` - # : (?with_config: Spoom::Sorbet::Config?, ?include_rbis: bool) -> Array[String] - # - # source://spoom//lib/spoom/context/sorbet.rb#58 - # List all files typechecked by Sorbet from its `config` - sig { params(with_config: T.nilable(::Spoom::Sorbet::Config), include_rbis: T::Boolean).returns(T::Array[::String]) } - def srb_files(with_config: T.unsafe(nil), include_rbis: T.unsafe(nil)); end - - # List all files typechecked by Sorbet from its `config` that matches `strictness` - # : (String strictness, ?with_config: Spoom::Sorbet::Config?, ?include_rbis: bool) -> Array[String] - # - # source://spoom//lib/spoom/context/sorbet.rb#91 - # List all files typechecked by Sorbet from its `config` that matches `strictness` - sig do - params( - strictness: ::String, - with_config: T.nilable(::Spoom::Sorbet::Config), - include_rbis: T::Boolean - ).returns(T::Array[::String]) - end - def srb_files_with_strictness(strictness, with_config: T.unsafe(nil), include_rbis: T.unsafe(nil)); end - - # : (*String arg, ?sorbet_bin: String?, ?capture_err: bool) -> Hash[String, Integer]? - # - # source://spoom//lib/spoom/context/sorbet.rb#38 - sig do - params( - arg: ::String, - sorbet_bin: T.nilable(::String), - capture_err: T::Boolean - ).returns(T.nilable(T::Hash[::String, ::Integer])) - end - def srb_metrics(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end - - # : (*String arg, ?sorbet_bin: String?, ?capture_err: bool) -> ExecResult - # - # source://spoom//lib/spoom/context/sorbet.rb#32 - sig { params(arg: ::String, sorbet_bin: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } - def srb_tc(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end - - # : (*String arg, ?sorbet_bin: String?, ?capture_err: bool) -> String? - # - # source://spoom//lib/spoom/context/sorbet.rb#97 - sig { params(arg: ::String, sorbet_bin: T.nilable(::String), capture_err: T::Boolean).returns(T.nilable(::String)) } - def srb_version(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end - - # Set the `contents` of `sorbet/config` in this context directory - # : (String contents, ?append: bool) -> void - # - # source://spoom//lib/spoom/context/sorbet.rb#123 - # Set the `contents` of `sorbet/config` in this context directory - sig { params(contents: ::String, append: T::Boolean).void } - def write_sorbet_config!(contents, append: T.unsafe(nil)); end -end - -# source://spoom//lib/spoom/coverage/snapshot.rb#5 -module Spoom::Coverage - class << self - # : (Context context) -> FileTree - # - # source://spoom//lib/spoom/coverage.rb#101 - sig { params(context: ::Spoom::Context).returns(::Spoom::FileTree) } - def file_tree(context); end - - # : (Context context, Array[Snapshot] snapshots, palette: D3::ColorPalette) -> Report - # - # source://spoom//lib/spoom/coverage.rb#81 - sig do - params( - context: ::Spoom::Context, - snapshots: T::Array[::Spoom::Coverage::Snapshot], - palette: ::Spoom::Coverage::D3::ColorPalette - ).returns(::Spoom::Coverage::Report) - end - def report(context, snapshots, palette:); end - - # : (Context context, ?rbi: bool, ?sorbet_bin: String?) -> Snapshot - # - # source://spoom//lib/spoom/coverage.rb#14 - sig do - params( - context: ::Spoom::Context, - rbi: T::Boolean, - sorbet_bin: T.nilable(::String) - ).returns(::Spoom::Coverage::Snapshot) - end - def snapshot(context, rbi: T.unsafe(nil), sorbet_bin: T.unsafe(nil)); end - end -end - -# source://spoom//lib/spoom/coverage/report.rb#87 -module Spoom::Coverage::Cards; end - -# source://spoom//lib/spoom/coverage/report.rb#88 -class Spoom::Coverage::Cards::Card < ::Spoom::Coverage::Template - # : (?template: String, ?title: String?, ?body: String?) -> void - # - # @return [Card] a new instance of Card - # - # source://spoom//lib/spoom/coverage/report.rb#97 - sig { params(template: ::String, title: T.nilable(::String), body: T.nilable(::String)).void } - def initialize(template: T.unsafe(nil), title: T.unsafe(nil), body: T.unsafe(nil)); end - - # : String? - # - # source://spoom//lib/spoom/coverage/report.rb#94 - # @return [String, nil] - def body; end - - # : String? - # - # source://spoom//lib/spoom/coverage/report.rb#94 - sig { returns(T.nilable(::String)) } - def title; end -end - -# source://spoom//lib/spoom/coverage/report.rb#91 -Spoom::Coverage::Cards::Card::TEMPLATE = T.let(T.unsafe(nil), String) - -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/coverage/report.rb#104 -class Spoom::Coverage::Cards::Erb < ::Spoom::Coverage::Cards::Card - abstract! - - # : -> void - # - # @return [Erb] a new instance of Erb - # - # source://spoom//lib/spoom/coverage/report.rb#110 - sig { void } - def initialize; end - - # @abstract - # - # source://spoom//lib/spoom/coverage/report.rb#119 - sig { abstract.returns(::String) } - def erb; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#114 - sig { override.returns(::String) } - def html; end -end - -# source://spoom//lib/spoom/coverage/report.rb#150 -class Spoom::Coverage::Cards::Map < ::Spoom::Coverage::Cards::Card - # : (file_tree: FileTree, nodes_strictnesses: Hash[FileTree::Node, String?], nodes_strictness_scores: Hash[FileTree::Node, Float], ?title: String) -> void - # - # @return [Map] a new instance of Map - # - # source://spoom//lib/spoom/coverage/report.rb#152 - sig do - params( - file_tree: ::Spoom::FileTree, - nodes_strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], - nodes_strictness_scores: T::Hash[::Spoom::FileTree::Node, ::Float], - title: ::String - ).void - end - def initialize(file_tree:, nodes_strictnesses:, nodes_strictness_scores:, title: T.unsafe(nil)); end -end - -# source://spoom//lib/spoom/coverage/report.rb#122 -class Spoom::Coverage::Cards::Snapshot < ::Spoom::Coverage::Cards::Card - # : (snapshot: Coverage::Snapshot, ?title: String) -> void - # - # @return [Snapshot] a new instance of Snapshot - # - # source://spoom//lib/spoom/coverage/report.rb#129 - sig { params(snapshot: ::Spoom::Coverage::Snapshot, title: ::String).void } - def initialize(snapshot:, title: T.unsafe(nil)); end - - # : -> D3::Pie::Calls - # - # source://spoom//lib/spoom/coverage/report.rb#140 - sig { returns(::Spoom::Coverage::D3::Pie::Calls) } - def pie_calls; end - - # : -> D3::Pie::Sigils - # - # source://spoom//lib/spoom/coverage/report.rb#135 - sig { returns(::Spoom::Coverage::D3::Pie::Sigils) } - def pie_sigils; end - - # : -> D3::Pie::Sigs - # - # source://spoom//lib/spoom/coverage/report.rb#145 - sig { returns(::Spoom::Coverage::D3::Pie::Sigs) } - def pie_sigs; end - - # : Coverage::Snapshot - # - # source://spoom//lib/spoom/coverage/report.rb#126 - sig { returns(::Spoom::Coverage::Snapshot) } - def snapshot; end -end - -# source://spoom//lib/spoom/coverage/report.rb#123 -Spoom::Coverage::Cards::Snapshot::TEMPLATE = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/coverage/report.rb#214 -class Spoom::Coverage::Cards::SorbetIntro < ::Spoom::Coverage::Cards::Erb - # : (?sorbet_intro_commit: String?, ?sorbet_intro_date: Time?) -> void - # - # @return [SorbetIntro] a new instance of SorbetIntro - # - # source://spoom//lib/spoom/coverage/report.rb#216 - sig { params(sorbet_intro_commit: T.nilable(::String), sorbet_intro_date: T.nilable(::Time)).void } - def initialize(sorbet_intro_commit: T.unsafe(nil), sorbet_intro_date: T.unsafe(nil)); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#223 - sig { override.returns(::String) } - def erb; end -end - -# source://spoom//lib/spoom/coverage/report.rb#165 -class Spoom::Coverage::Cards::Timeline < ::Spoom::Coverage::Cards::Card - # : (title: String, timeline: D3::Timeline) -> void - # - # @return [Timeline] a new instance of Timeline - # - # source://spoom//lib/spoom/coverage/report.rb#167 - sig { params(title: ::String, timeline: ::Spoom::Coverage::D3::Timeline).void } - def initialize(title:, timeline:); end -end - -# source://spoom//lib/spoom/coverage/report.rb#178 -class Spoom::Coverage::Cards::Timeline::Calls < ::Spoom::Coverage::Cards::Timeline - # : (snapshots: Array[Coverage::Snapshot], ?title: String) -> void - # - # @return [Calls] a new instance of Calls - # - # source://spoom//lib/spoom/coverage/report.rb#180 - sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } - def initialize(snapshots:, title: T.unsafe(nil)); end -end - -# source://spoom//lib/spoom/coverage/report.rb#192 -class Spoom::Coverage::Cards::Timeline::RBIs < ::Spoom::Coverage::Cards::Timeline - # : (snapshots: Array[Coverage::Snapshot], ?title: String) -> void - # - # @return [RBIs] a new instance of RBIs - # - # source://spoom//lib/spoom/coverage/report.rb#194 - sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } - def initialize(snapshots:, title: T.unsafe(nil)); end -end - -# source://spoom//lib/spoom/coverage/report.rb#206 -class Spoom::Coverage::Cards::Timeline::Runtimes < ::Spoom::Coverage::Cards::Timeline - # : (snapshots: Array[Coverage::Snapshot], ?title: String) -> void - # - # @return [Runtimes] a new instance of Runtimes - # - # source://spoom//lib/spoom/coverage/report.rb#208 - sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } - def initialize(snapshots:, title: T.unsafe(nil)); end -end - -# source://spoom//lib/spoom/coverage/report.rb#171 -class Spoom::Coverage::Cards::Timeline::Sigils < ::Spoom::Coverage::Cards::Timeline - # : (snapshots: Array[Coverage::Snapshot], ?title: String) -> void - # - # @return [Sigils] a new instance of Sigils - # - # source://spoom//lib/spoom/coverage/report.rb#173 - sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } - def initialize(snapshots:, title: T.unsafe(nil)); end -end - -# source://spoom//lib/spoom/coverage/report.rb#185 -class Spoom::Coverage::Cards::Timeline::Sigs < ::Spoom::Coverage::Cards::Timeline - # : (snapshots: Array[Coverage::Snapshot], ?title: String) -> void - # - # @return [Sigs] a new instance of Sigs - # - # source://spoom//lib/spoom/coverage/report.rb#187 - sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } - def initialize(snapshots:, title: T.unsafe(nil)); end -end - -# source://spoom//lib/spoom/coverage/report.rb#199 -class Spoom::Coverage::Cards::Timeline::Versions < ::Spoom::Coverage::Cards::Timeline - # : (snapshots: Array[Coverage::Snapshot], ?title: String) -> void - # - # @return [Versions] a new instance of Versions - # - # source://spoom//lib/spoom/coverage/report.rb#201 - sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } - def initialize(snapshots:, title: T.unsafe(nil)); end -end - -# source://spoom//lib/spoom/coverage/d3/base.rb#6 -module Spoom::Coverage::D3 - class << self - # : (ColorPalette palette) -> String - # - # source://spoom//lib/spoom/coverage/d3.rb#59 - sig { params(palette: ::Spoom::Coverage::D3::ColorPalette).returns(::String) } - def header_script(palette); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3.rb#19 - sig { returns(::String) } - def header_style; end - end -end - -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/coverage/d3/base.rb#7 -class Spoom::Coverage::D3::Base - abstract! - - # : (String id, untyped data) -> void - # - # @return [Base] a new instance of Base - # - # source://spoom//lib/spoom/coverage/d3/base.rb#17 - sig { params(id: ::String, data: T.untyped).void } - def initialize(id, data); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/base.rb#35 - sig { returns(::String) } - def html; end - - # : String - # - # source://spoom//lib/spoom/coverage/d3/base.rb#14 - sig { returns(::String) } - def id; end - - # @abstract - # - # source://spoom//lib/spoom/coverage/d3/base.rb#48 - sig { abstract.returns(::String) } - def script; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/base.rb#43 - sig { returns(::String) } - def tooltip; end - - class << self - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/base.rb#29 - sig { returns(::String) } - def header_script; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/base.rb#24 - sig { returns(::String) } - def header_style; end - end -end - -# source://spoom//lib/spoom/coverage/d3.rb#12 -Spoom::Coverage::D3::COLOR_FALSE = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/coverage/d3.rb#11 -Spoom::Coverage::D3::COLOR_IGNORE = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/coverage/d3.rb#14 -Spoom::Coverage::D3::COLOR_STRICT = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/coverage/d3.rb#15 -Spoom::Coverage::D3::COLOR_STRONG = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/coverage/d3.rb#13 -Spoom::Coverage::D3::COLOR_TRUE = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/coverage/d3/circle_map.rb#9 -class Spoom::Coverage::D3::CircleMap < ::Spoom::Coverage::D3::Base - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/circle_map.rb#58 - sig { override.returns(::String) } - def script; end - - class << self - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/circle_map.rb#38 - sig { returns(::String) } - def header_script; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/circle_map.rb#12 - sig { returns(::String) } - def header_style; end - end -end - -# source://spoom//lib/spoom/coverage/d3/circle_map.rb#147 -class Spoom::Coverage::D3::CircleMap::Sigils < ::Spoom::Coverage::D3::CircleMap - # : (String id, FileTree file_tree, Hash[FileTree::Node, String?] nodes_strictnesses, Hash[FileTree::Node, Float] nodes_scores) -> void - # - # @return [Sigils] a new instance of Sigils - # - # source://spoom//lib/spoom/coverage/d3/circle_map.rb#149 - sig do - params( - id: ::String, - file_tree: ::Spoom::FileTree, - nodes_strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], - nodes_scores: T::Hash[::Spoom::FileTree::Node, ::Float] - ).void - end - def initialize(id, file_tree, nodes_strictnesses, nodes_scores); end - - # : (FileTree::Node node) -> Hash[Symbol, untyped] - # - # source://spoom//lib/spoom/coverage/d3/circle_map.rb#156 - sig { params(node: ::Spoom::FileTree::Node).returns(T::Hash[::Symbol, T.untyped]) } - def tree_node_to_json(node); end -end - -# source://spoom//lib/spoom/coverage/d3.rb#101 -class Spoom::Coverage::D3::ColorPalette < ::T::Struct - prop :ignore, ::String - prop :false, ::String - prop :true, ::String - prop :strict, ::String - prop :strong, ::String - - class << self - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/coverage/d3/pie.rb#9 -class Spoom::Coverage::D3::Pie < ::Spoom::Coverage::D3::Base - abstract! - - # : (String id, String title, untyped data) -> void - # - # @return [Pie] a new instance of Pie - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#15 - sig { params(id: ::String, title: ::String, data: T.untyped).void } - def initialize(id, title, data); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#54 - sig { override.returns(::String) } - def script; end - - class << self - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#40 - sig { returns(::String) } - def header_script; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#22 - sig { returns(::String) } - def header_style; end - end -end - -# source://spoom//lib/spoom/coverage/d3/pie.rb#138 -class Spoom::Coverage::D3::Pie::Calls < ::Spoom::Coverage::D3::Pie - # : (String id, String title, Snapshot snapshot) -> void - # - # @return [Calls] a new instance of Calls - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#140 - sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void } - def initialize(id, title, snapshot); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#146 - sig { override.returns(::String) } - def tooltip; end -end - -# source://spoom//lib/spoom/coverage/d3/pie.rb#121 -class Spoom::Coverage::D3::Pie::Sigils < ::Spoom::Coverage::D3::Pie - # : (String id, String title, Snapshot snapshot) -> void - # - # @return [Sigils] a new instance of Sigils - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#123 - sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void } - def initialize(id, title, snapshot); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#129 - sig { override.returns(::String) } - def tooltip; end -end - -# source://spoom//lib/spoom/coverage/d3/pie.rb#155 -class Spoom::Coverage::D3::Pie::Sigs < ::Spoom::Coverage::D3::Pie - # : (String id, String title, Snapshot snapshot) -> void - # - # @return [Sigs] a new instance of Sigs - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#157 - sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void } - def initialize(id, title, snapshot); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#167 - sig { override.returns(::String) } - def tooltip; end -end - -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/coverage/d3/timeline.rb#9 -class Spoom::Coverage::D3::Timeline < ::Spoom::Coverage::D3::Base - abstract! - - # : (String id, untyped data, Array[String] keys) -> void - # - # @return [Timeline] a new instance of Timeline - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#15 - sig { params(id: ::String, data: T.untyped, keys: T::Array[::String]).void } - def initialize(id, data, keys); end - - # : (y: String, ?color: String, ?curve: String) -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#185 - sig { params(y: ::String, color: ::String, curve: ::String).returns(::String) } - def area(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end - - # : (y: String, ?color: String, ?curve: String) -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#201 - sig { params(y: ::String, color: ::String, curve: ::String).returns(::String) } - def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end - - # @abstract - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#124 - sig { abstract.returns(::String) } - def plot; end - - # : (y: String) -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#215 - sig { params(y: ::String).returns(::String) } - def points(y:); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#99 - sig { override.returns(::String) } - def script; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#127 - sig { returns(::String) } - def x_scale; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#143 - sig { returns(::String) } - def x_ticks; end - - # : (min: String, max: String, ticks: String) -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#156 - sig { params(min: ::String, max: ::String, ticks: ::String).returns(::String) } - def y_scale(min:, max:, ticks:); end - - # : (ticks: String, format: String, padding: Integer) -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#172 - sig { params(ticks: ::String, format: ::String, padding: ::Integer).returns(::String) } - def y_ticks(ticks:, format:, padding:); end - - class << self - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#76 - sig { returns(::String) } - def header_script; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#22 - sig { returns(::String) } - def header_style; end - end -end - -# source://spoom//lib/spoom/coverage/d3/timeline.rb#447 -class Spoom::Coverage::D3::Timeline::Calls < ::Spoom::Coverage::D3::Timeline::Stacked - # : (String id, Array[Snapshot] snapshots) -> void - # - # @return [Calls] a new instance of Calls - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#449 - sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } - def initialize(id, snapshots); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#464 - sig { override.returns(::String) } - def tooltip; end -end - -# source://spoom//lib/spoom/coverage/d3/timeline.rb#502 -class Spoom::Coverage::D3::Timeline::RBIs < ::Spoom::Coverage::D3::Timeline::Stacked - # : (String id, Array[Snapshot] snapshots) -> void - # - # @return [RBIs] a new instance of RBIs - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#504 - sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } - def initialize(id, snapshots); end - - # : (y: String, ?color: String, ?curve: String) -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#575 - sig { override.params(y: ::String, color: ::String, curve: ::String).returns(::String) } - def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#616 - sig { override.returns(::String) } - def plot; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#534 - sig { override.returns(::String) } - def script; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#519 - sig { override.returns(::String) } - def tooltip; end -end - -# source://spoom//lib/spoom/coverage/d3/timeline.rb#280 -class Spoom::Coverage::D3::Timeline::Runtimes < ::Spoom::Coverage::D3::Timeline - # : (String id, Array[Snapshot] snapshots) -> void - # - # @return [Runtimes] a new instance of Runtimes - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#282 - sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } - def initialize(id, snapshots); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#309 - sig { override.returns(::String) } - def plot; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#295 - sig { override.returns(::String) } - def tooltip; end -end - -# source://spoom//lib/spoom/coverage/d3/timeline.rb#421 -class Spoom::Coverage::D3::Timeline::Sigils < ::Spoom::Coverage::D3::Timeline::Stacked - # : (String id, Array[Snapshot] snapshots) -> void - # - # @return [Sigils] a new instance of Sigils - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#423 - sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } - def initialize(id, snapshots); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#438 - sig { override.returns(::String) } - def tooltip; end -end - -# source://spoom//lib/spoom/coverage/d3/timeline.rb#473 -class Spoom::Coverage::D3::Timeline::Sigs < ::Spoom::Coverage::D3::Timeline::Stacked - # : (String id, Array[Snapshot] snapshots) -> void - # - # @return [Sigs] a new instance of Sigs - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#475 - sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } - def initialize(id, snapshots); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#493 - sig { override.returns(::String) } - def tooltip; end -end - -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/coverage/d3/timeline.rb#327 -class Spoom::Coverage::D3::Timeline::Stacked < ::Spoom::Coverage::D3::Timeline - abstract! - - # : (y: String, ?color: String, ?curve: String) -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#388 - sig { override.params(y: ::String, color: ::String, curve: ::String).returns(::String) } - def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#376 - sig { override.returns(::String) } - def plot; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#334 - sig { override.returns(::String) } - def script; end -end - -# source://spoom//lib/spoom/coverage/d3/timeline.rb#230 -class Spoom::Coverage::D3::Timeline::Versions < ::Spoom::Coverage::D3::Timeline - # : (String id, Array[Snapshot] snapshots) -> void - # - # @return [Versions] a new instance of Versions - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#232 - sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } - def initialize(id, snapshots); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#261 - sig { override.returns(::String) } - def plot; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#246 - sig { override.returns(::String) } - def tooltip; end -end - -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/coverage/report.rb#37 -class Spoom::Coverage::Page < ::Spoom::Coverage::Template - abstract! - - # : (title: String, palette: D3::ColorPalette, ?template: String) -> void - # - # @return [Page] a new instance of Page - # - # source://spoom//lib/spoom/coverage/report.rb#52 - sig { params(title: ::String, palette: ::Spoom::Coverage::D3::ColorPalette, template: ::String).void } - def initialize(title:, palette:, template: T.unsafe(nil)); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#74 - sig { returns(::String) } - def body_html; end - - # @abstract - # - # source://spoom//lib/spoom/coverage/report.rb#79 - sig { abstract.returns(T::Array[::Spoom::Coverage::Cards::Card]) } - def cards; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#82 - sig { returns(::String) } - def footer_html; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#69 - sig { returns(::String) } - def header_html; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#64 - sig { returns(::String) } - def header_script; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#59 - sig { returns(::String) } - def header_style; end - - # : D3::ColorPalette - # - # source://spoom//lib/spoom/coverage/report.rb#49 - sig { returns(::Spoom::Coverage::D3::ColorPalette) } - def palette; end - - # : String - # - # source://spoom//lib/spoom/coverage/report.rb#46 - sig { returns(::String) } - def title; end -end - -# source://spoom//lib/spoom/coverage/report.rb#43 -Spoom::Coverage::Page::TEMPLATE = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/coverage/report.rb#234 -class Spoom::Coverage::Report < ::Spoom::Coverage::Page - # : (project_name: String, palette: D3::ColorPalette, snapshots: Array[Snapshot], file_tree: FileTree, nodes_strictnesses: Hash[FileTree::Node, String?], nodes_strictness_scores: Hash[FileTree::Node, Float], ?sorbet_intro_commit: String?, ?sorbet_intro_date: Time?) -> void - # - # @return [Report] a new instance of Report - # - # source://spoom//lib/spoom/coverage/report.rb#236 - sig do - params( - project_name: ::String, - palette: ::Spoom::Coverage::D3::ColorPalette, - snapshots: T::Array[::Spoom::Coverage::Snapshot], - file_tree: ::Spoom::FileTree, - nodes_strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], - nodes_strictness_scores: T::Hash[::Spoom::FileTree::Node, ::Float], - sorbet_intro_commit: T.nilable(::String), - sorbet_intro_date: T.nilable(::Time) - ).void - end - def initialize(project_name:, palette:, snapshots:, file_tree:, nodes_strictnesses:, nodes_strictness_scores:, sorbet_intro_commit: T.unsafe(nil), sorbet_intro_date: T.unsafe(nil)); end - - # : -> Array[Cards::Card] - # - # source://spoom//lib/spoom/coverage/report.rb#270 - sig { override.returns(T::Array[::Spoom::Coverage::Cards::Card]) } - def cards; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#258 - sig { override.returns(::String) } - def header_html; end -end - -# source://spoom//lib/spoom/coverage/snapshot.rb#6 -class Spoom::Coverage::Snapshot < ::T::Struct - prop :timestamp, ::Integer, default: T.unsafe(nil) - prop :version_static, T.nilable(::String), default: T.unsafe(nil) - prop :version_runtime, T.nilable(::String), default: T.unsafe(nil) - prop :duration, ::Integer, default: T.unsafe(nil) - prop :commit_sha, T.nilable(::String), default: T.unsafe(nil) - prop :commit_timestamp, T.nilable(::Integer), default: T.unsafe(nil) - prop :files, ::Integer, default: T.unsafe(nil) - prop :rbi_files, ::Integer, default: T.unsafe(nil) - prop :modules, ::Integer, default: T.unsafe(nil) - prop :classes, ::Integer, default: T.unsafe(nil) - prop :singleton_classes, ::Integer, default: T.unsafe(nil) - prop :methods_without_sig, ::Integer, default: T.unsafe(nil) - prop :methods_with_sig, ::Integer, default: T.unsafe(nil) - prop :calls_untyped, ::Integer, default: T.unsafe(nil) - prop :calls_typed, ::Integer, default: T.unsafe(nil) - prop :sigils, T::Hash[::String, ::Integer], default: T.unsafe(nil) - prop :methods_with_sig_excluding_rbis, ::Integer, default: T.unsafe(nil) - prop :methods_without_sig_excluding_rbis, ::Integer, default: T.unsafe(nil) - prop :sigils_excluding_rbis, T::Hash[::String, ::Integer], default: T.unsafe(nil) - - # : (?out: (IO | StringIO), ?colors: bool, ?indent_level: Integer) -> void - # - # source://spoom//lib/spoom/coverage/snapshot.rb#31 - sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean, indent_level: ::Integer).void } - def print(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil)); end - - # : (*untyped arg) -> String - # - # source://spoom//lib/spoom/coverage/snapshot.rb#37 - sig { params(arg: T.untyped).returns(::String) } - def to_json(*arg); end - - class << self - # : (String json) -> Snapshot - # - # source://spoom//lib/spoom/coverage/snapshot.rb#43 - sig { params(json: ::String).returns(::Spoom::Coverage::Snapshot) } - def from_json(json); end - - # : (Hash[String, untyped] obj) -> Snapshot - # - # source://spoom//lib/spoom/coverage/snapshot.rb#48 - sig { params(obj: T::Hash[::String, T.untyped]).returns(::Spoom::Coverage::Snapshot) } - def from_obj(obj); end - - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# The strictness name as found in the Sorbet metrics file -# -# source://spoom//lib/spoom/coverage/snapshot.rb#28 -Spoom::Coverage::Snapshot::STRICTNESSES = T.let(T.unsafe(nil), Array) - -# source://spoom//lib/spoom/coverage/snapshot.rb#91 -class Spoom::Coverage::SnapshotPrinter < ::Spoom::Printer - # : (Snapshot snapshot) -> void - # - # source://spoom//lib/spoom/coverage/snapshot.rb#93 - sig { params(snapshot: ::Spoom::Coverage::Snapshot).void } - def print_snapshot(snapshot); end - - private - - # : (Integer? value, Integer? total) -> String - # - # source://spoom//lib/spoom/coverage/snapshot.rb#152 - sig { params(value: T.nilable(::Integer), total: T.nilable(::Integer)).returns(::String) } - def percent(value, total); end - - # : (Hash[String, Integer] hash, Integer total) -> void - # - # source://spoom//lib/spoom/coverage/snapshot.rb#141 - sig { params(hash: T::Hash[::String, ::Integer], total: ::Integer).void } - def print_map(hash, total); end -end - -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/coverage/report.rb#10 -class Spoom::Coverage::Template - abstract! - - # Create a new template from an Erb file path - # : (template: String) -> void - # - # @return [Template] a new instance of Template - # - # source://spoom//lib/spoom/coverage/report.rb#17 - # Create a new template from an Erb file path - sig { params(template: ::String).void } - def initialize(template:); end - - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#22 - sig { returns(::String) } - def erb; end - - # : -> Binding - # - # source://spoom//lib/spoom/coverage/report.rb#32 - sig { returns(::Binding) } - def get_binding; end - - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#27 - sig { returns(::String) } - def html; end -end - -# source://spoom//lib/spoom/deadcode/erb.rb#27 -module Spoom::Deadcode - class << self - # : (Context context) -> Array[singleton(Plugins::Base)] - # - # source://spoom//lib/spoom/deadcode/plugins.rb#73 - sig { params(context: ::Spoom::Context).returns(T::Array[T.class_of(Spoom::Deadcode::Plugins::Base)]) } - def load_custom_plugins(context); end - - # : (Context context) -> Set[singleton(Plugins::Base)] - # - # source://spoom//lib/spoom/deadcode/plugins.rb#59 - sig { params(context: ::Spoom::Context).returns(T::Set[T.class_of(Spoom::Deadcode::Plugins::Base)]) } - def plugins_from_gemfile_lock(context); end - end -end - -# source://spoom//lib/spoom/deadcode/plugins.rb#26 -Spoom::Deadcode::DEFAULT_CUSTOM_PLUGINS_PATH = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/deadcode/plugins.rb#28 -Spoom::Deadcode::DEFAULT_PLUGINS = T.let(T.unsafe(nil), Set) - -# A definition is a class, module, method, constant, etc. being defined in the code -# -# source://spoom//lib/spoom/deadcode/definition.rb#7 -class Spoom::Deadcode::Definition < ::T::Struct - const :kind, ::Spoom::Deadcode::Definition::Kind - const :name, ::String - const :full_name, ::String - const :location, ::Spoom::Location - const :status, ::Spoom::Deadcode::Definition::Status, default: T.unsafe(nil) - - # : -> void - # - # source://spoom//lib/spoom/deadcode/definition.rb#76 - sig { void } - def alive!; end - - # : -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/definition.rb#71 - # Status - sig { returns(T::Boolean) } - def alive?; end - - # : -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/definition.rb#39 - # Kind - sig { returns(T::Boolean) } - def attr_reader?; end - - # : -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/definition.rb#44 - sig { returns(T::Boolean) } - def attr_writer?; end - - # : -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/definition.rb#49 - sig { returns(T::Boolean) } - def class?; end - - # : -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/definition.rb#54 - sig { returns(T::Boolean) } - def constant?; end - - # : -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/definition.rb#81 - sig { returns(T::Boolean) } - def dead?; end - - # : -> void - # - # source://spoom//lib/spoom/deadcode/definition.rb#91 - sig { void } - def ignored!; end - - # : -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/definition.rb#86 - sig { returns(T::Boolean) } - def ignored?; end - - # : -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/definition.rb#59 - sig { returns(T::Boolean) } - def method?; end - - # : -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/definition.rb#64 - sig { returns(T::Boolean) } - def module?; end - - # : (*untyped args) -> String - # - # source://spoom//lib/spoom/deadcode/definition.rb#98 - # Utils - sig { params(args: T.untyped).returns(::String) } - def to_json(*args); end - - class << self - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# source://spoom//lib/spoom/deadcode/definition.rb#8 -class Spoom::Deadcode::Definition::Kind < ::T::Enum - enums do - AttrReader = new - AttrWriter = new - Class = new - Constant = new - Method = new - Module = new - end -end - -# source://spoom//lib/spoom/deadcode/definition.rb#19 -class Spoom::Deadcode::Definition::Status < ::T::Enum - enums do - ALIVE = new - DEAD = new - IGNORED = new - end -end - -# Custom engine to handle ERB templates as used by Rails -# -# source://spoom//lib/spoom/deadcode/erb.rb#29 -class Spoom::Deadcode::ERB < ::Erubi::Engine - # : (untyped input, ?untyped properties) -> void - # - # @return [ERB] a new instance of ERB - # - # source://spoom//lib/spoom/deadcode/erb.rb#31 - sig { params(input: T.untyped, properties: T.untyped).void } - def initialize(input, properties = T.unsafe(nil)); end - - private - - # : (untyped code) -> void - # - # source://spoom//lib/spoom/deadcode/erb.rb#84 - sig { override.params(code: T.untyped).void } - def add_code(code); end - - # : (untyped indicator, untyped code) -> void - # - # source://spoom//lib/spoom/deadcode/erb.rb#66 - sig { override.params(indicator: T.untyped, code: T.untyped).void } - def add_expression(indicator, code); end - - # : (untyped _) -> void - # - # source://spoom//lib/spoom/deadcode/erb.rb#91 - sig { override.params(_: T.untyped).void } - def add_postamble(_); end - - # : (untyped text) -> void - # - # source://spoom//lib/spoom/deadcode/erb.rb#47 - sig { override.params(text: T.untyped).void } - def add_text(text); end - - # : (untyped src) -> void - # - # source://spoom//lib/spoom/deadcode/erb.rb#97 - sig { params(src: T.untyped).void } - def flush_newline_if_pending(src); end -end - -# source://spoom//lib/spoom/deadcode/erb.rb#62 -Spoom::Deadcode::ERB::BLOCK_EXPR = T.let(T.unsafe(nil), Regexp) - -# source://spoom//lib/spoom/deadcode/index.rb#6 -class Spoom::Deadcode::Index - # : (Model model) -> void - # - # @return [Index] a new instance of Index - # - # source://spoom//lib/spoom/deadcode/index.rb#25 - sig { params(model: ::Spoom::Model).void } - def initialize(model); end - - # : -> Array[Definition] - # - # source://spoom//lib/spoom/deadcode/index.rb#215 - sig { returns(T::Array[::Spoom::Deadcode::Definition]) } - def all_definitions; end - - # : -> Array[Model::Reference] - # - # source://spoom//lib/spoom/deadcode/index.rb#220 - sig { returns(T::Array[::Spoom::Model::Reference]) } - def all_references; end - - # : (Array[Plugins::Base] plugins) -> void - # - # source://spoom//lib/spoom/deadcode/index.rb#95 - sig { params(plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } - def apply_plugins!(plugins); end - - # : (Definition definition) -> void - # - # source://spoom//lib/spoom/deadcode/index.rb#75 - sig { params(definition: ::Spoom::Deadcode::Definition).void } - def define(definition); end - - # : Hash[String, Array[Definition]] - # - # source://spoom//lib/spoom/deadcode/index.rb#19 - sig { returns(T::Hash[::String, T::Array[::Spoom::Deadcode::Definition]]) } - def definitions; end - - # : (String name) -> Array[Definition] - # - # source://spoom//lib/spoom/deadcode/index.rb#210 - # Utils - sig { params(name: ::String).returns(T::Array[::Spoom::Deadcode::Definition]) } - def definitions_for_name(name); end - - # Mark all definitions having a reference of the same name as `alive` - # - # To be called once all the files have been indexed and all the definitions and references discovered. - # : -> void - # - # source://spoom//lib/spoom/deadcode/index.rb#118 - # Mark all definitions having a reference of the same name as `alive` - # To be called once all the files have been indexed and all the definitions and references discovered. - sig { void } - def finalize!; end - - # : (Model::SymbolDef symbol_def) -> void - # - # source://spoom//lib/spoom/deadcode/index.rb#90 - sig { params(symbol_def: ::Spoom::Model::SymbolDef).void } - def ignore(symbol_def); end - - # : (String erb, file: String, ?plugins: Array[Plugins::Base]) -> void - # - # source://spoom//lib/spoom/deadcode/index.rb#46 - sig { params(erb: ::String, file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } - def index_erb(erb, file:, plugins: T.unsafe(nil)); end - - # : (String file, ?plugins: Array[Plugins::Base]) -> void - # - # source://spoom//lib/spoom/deadcode/index.rb#35 - # Indexing - sig { params(file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } - def index_file(file, plugins: T.unsafe(nil)); end - - # : (String rb, file: String, ?plugins: Array[Plugins::Base]) -> void - # - # source://spoom//lib/spoom/deadcode/index.rb#51 - sig { params(rb: ::String, file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } - def index_ruby(rb, file:, plugins: T.unsafe(nil)); end - - # : Model - # - # source://spoom//lib/spoom/deadcode/index.rb#16 - sig { returns(::Spoom::Model) } - def model; end - - # : (String name, Location location) -> void - # - # source://spoom//lib/spoom/deadcode/index.rb#80 - sig { params(name: ::String, location: ::Spoom::Location).void } - def reference_constant(name, location); end - - # : (String name, Location location) -> void - # - # source://spoom//lib/spoom/deadcode/index.rb#85 - sig { params(name: ::String, location: ::Spoom::Location).void } - def reference_method(name, location); end - - # : Hash[String, Array[Model::Reference]] - # - # source://spoom//lib/spoom/deadcode/index.rb#22 - sig { returns(T::Hash[::String, T::Array[::Spoom::Model::Reference]]) } - def references; end -end - -# source://spoom//lib/spoom/deadcode/index.rb#7 -class Spoom::Deadcode::Index::Error < ::Spoom::Error - # : (String message, parent: Exception) -> void - # - # @return [Error] a new instance of Error - # - # source://spoom//lib/spoom/deadcode/index.rb#9 - sig { params(message: ::String, parent: ::Exception).void } - def initialize(message, parent:); end -end - -# source://spoom//lib/spoom/deadcode/indexer.rb#6 -class Spoom::Deadcode::Indexer < ::Spoom::Visitor - # : (String path, Index index, ?plugins: Array[Plugins::Base]) -> void - # - # @return [Indexer] a new instance of Indexer - # - # source://spoom//lib/spoom/deadcode/indexer.rb#14 - sig do - params( - path: ::String, - index: ::Spoom::Deadcode::Index, - plugins: T::Array[::Spoom::Deadcode::Plugins::Base] - ).void - end - def initialize(path, index, plugins: T.unsafe(nil)); end - - # : Index - # - # source://spoom//lib/spoom/deadcode/indexer.rb#11 - sig { returns(::Spoom::Deadcode::Index) } - def index; end - - # : String - # - # source://spoom//lib/spoom/deadcode/indexer.rb#8 - sig { returns(::String) } - def path; end - - # : (Prism::CallNode node) -> void - # - # source://spoom//lib/spoom/deadcode/indexer.rb#26 - sig { override.params(node: ::Prism::CallNode).void } - def visit_call_node(node); end -end - -# source://spoom//lib/spoom/deadcode/plugins.rb#36 -Spoom::Deadcode::PLUGINS_FOR_GEM = T.let(T.unsafe(nil), Hash) - -# source://spoom//lib/spoom/deadcode/plugins/base.rb#8 -module Spoom::Deadcode::Plugins; end - -# source://spoom//lib/spoom/deadcode/plugins/action_mailer.rb#7 -class Spoom::Deadcode::Plugins::ActionMailer < ::Spoom::Deadcode::Plugins::Base - # : (Send send) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/action_mailer.rb#10 - sig { override.params(send: ::Spoom::Deadcode::Send).void } - def on_send(send); end -end - -# source://spoom//lib/spoom/deadcode/plugins/action_mailer_preview.rb#7 -class Spoom::Deadcode::Plugins::ActionMailerPreview < ::Spoom::Deadcode::Plugins::Base - # : (Model::Method definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/action_mailer_preview.rb#12 - sig { override.params(definition: ::Spoom::Model::Method).void } - def on_define_method(definition); end -end - -# source://spoom//lib/spoom/deadcode/plugins/actionpack.rb#7 -class Spoom::Deadcode::Plugins::ActionPack < ::Spoom::Deadcode::Plugins::Base - # : (Model::Method definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/actionpack.rb#30 - sig { override.params(definition: ::Spoom::Model::Method).void } - def on_define_method(definition); end - - # : (Send send) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/actionpack.rb#39 - sig { override.params(send: ::Spoom::Deadcode::Send).void } - def on_send(send); end -end - -# source://spoom//lib/spoom/deadcode/plugins/actionpack.rb#10 -Spoom::Deadcode::Plugins::ActionPack::CALLBACKS = T.let(T.unsafe(nil), Array) - -# source://spoom//lib/spoom/deadcode/plugins/active_job.rb#7 -class Spoom::Deadcode::Plugins::ActiveJob < ::Spoom::Deadcode::Plugins::Base; end - -# source://spoom//lib/spoom/deadcode/plugins/active_model.rb#7 -class Spoom::Deadcode::Plugins::ActiveModel < ::Spoom::Deadcode::Plugins::Base - # : (Send send) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/active_model.rb#13 - sig { override.params(send: ::Spoom::Deadcode::Send).void } - def on_send(send); end -end - -# source://spoom//lib/spoom/deadcode/plugins/active_record.rb#7 -class Spoom::Deadcode::Plugins::ActiveRecord < ::Spoom::Deadcode::Plugins::Base - # : (Send send) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/active_record.rb#73 - sig { override.params(send: ::Spoom::Deadcode::Send).void } - def on_send(send); end -end - -# source://spoom//lib/spoom/deadcode/plugins/active_record.rb#62 -Spoom::Deadcode::Plugins::ActiveRecord::ARRAY_METHODS = T.let(T.unsafe(nil), Array) - -# source://spoom//lib/spoom/deadcode/plugins/active_record.rb#18 -Spoom::Deadcode::Plugins::ActiveRecord::CALLBACKS = T.let(T.unsafe(nil), Array) - -# source://spoom//lib/spoom/deadcode/plugins/active_record.rb#47 -Spoom::Deadcode::Plugins::ActiveRecord::CRUD_METHODS = T.let(T.unsafe(nil), Array) - -# source://spoom//lib/spoom/deadcode/plugins/active_support.rb#7 -class Spoom::Deadcode::Plugins::ActiveSupport < ::Spoom::Deadcode::Plugins::Base - # : (Send send) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/active_support.rb#23 - sig { override.params(send: ::Spoom::Deadcode::Send).void } - def on_send(send); end -end - -# source://spoom//lib/spoom/deadcode/plugins/active_support.rb#19 -Spoom::Deadcode::Plugins::ActiveSupport::SETUP_AND_TEARDOWN_METHODS = T.let(T.unsafe(nil), Array) - -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/deadcode/plugins/base.rb#9 -class Spoom::Deadcode::Plugins::Base - abstract! - - # : (Index index) -> void - # - # @return [Base] a new instance of Base - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#129 - sig { params(index: ::Spoom::Deadcode::Index).void } - def initialize(index); end - - # : Index - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#126 - sig { returns(::Spoom::Deadcode::Index) } - def index; end - - # Do not override this method, use `on_define_accessor` instead. - # : (Model::Attr definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#155 - # Do not override this method, use `on_define_accessor` instead. - sig { params(definition: ::Spoom::Model::Attr).void } - def internal_on_define_accessor(definition); end - - # Do not override this method, use `on_define_class` instead. - # : (Model::Class definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#179 - # Do not override this method, use `on_define_class` instead. - sig { params(definition: ::Spoom::Model::Class).void } - def internal_on_define_class(definition); end - - # Do not override this method, use `on_define_constant` instead. - # : (Model::Constant definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#209 - # Do not override this method, use `on_define_constant` instead. - sig { params(definition: ::Spoom::Model::Constant).void } - def internal_on_define_constant(definition); end - - # Do not override this method, use `on_define_method` instead. - # : (Model::Method definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#235 - # Do not override this method, use `on_define_method` instead. - sig { params(definition: ::Spoom::Model::Method).void } - def internal_on_define_method(definition); end - - # Do not override this method, use `on_define_module` instead. - # : (Model::Module definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#261 - # Do not override this method, use `on_define_module` instead. - sig { params(definition: ::Spoom::Model::Module).void } - def internal_on_define_module(definition); end - - # Called when an accessor is defined. - # - # Will be called when the indexer processes a `attr_reader`, `attr_writer` or `attr_accessor` node. - # Note that when this method is called, the definition for the node has already been added to the index. - # It is still possible to ignore it from the plugin: - # - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_accessor(definition) - # @index.ignore(definition) if symbol_def.name == "foo" - # end - # end - # ~~~ - # : (Model::Attr definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#149 - # Called when an accessor is defined. - # Will be called when the indexer processes a `attr_reader`, `attr_writer` or `attr_accessor` node. - # Note that when this method is called, the definition for the node has already been added to the index. - # It is still possible to ignore it from the plugin: - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_accessor(definition) - # @index.ignore(definition) if symbol_def.name == "foo" - # end - # end - # ~~~ - sig { params(definition: ::Spoom::Model::Attr).void } - def on_define_accessor(definition); end - - # Called when a class is defined. - # - # Will be called when the indexer processes a `class` node. - # Note that when this method is called, the definition for the node has already been added to the index. - # It is still possible to ignore it from the plugin: - # - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_class(definition) - # @index.ignore(definition) if definition.name == "Foo" - # end - # end - # ~~~ - # : (Model::Class definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#173 - # Called when a class is defined. - # Will be called when the indexer processes a `class` node. - # Note that when this method is called, the definition for the node has already been added to the index. - # It is still possible to ignore it from the plugin: - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_class(definition) - # @index.ignore(definition) if definition.name == "Foo" - # end - # end - # ~~~ - sig { params(definition: ::Spoom::Model::Class).void } - def on_define_class(definition); end - - # Called when a constant is defined. - # - # Will be called when the indexer processes a `CONST =` node. - # Note that when this method is called, the definition for the node has already been added to the index. - # It is still possible to ignore it from the plugin: - # - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_constant(definition) - # @index.ignore(definition) if definition.name == "FOO" - # end - # end - # ~~~ - # : (Model::Constant definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#203 - # Called when a constant is defined. - # Will be called when the indexer processes a `CONST =` node. - # Note that when this method is called, the definition for the node has already been added to the index. - # It is still possible to ignore it from the plugin: - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_constant(definition) - # @index.ignore(definition) if definition.name == "FOO" - # end - # end - # ~~~ - sig { params(definition: ::Spoom::Model::Constant).void } - def on_define_constant(definition); end - - # Called when a method is defined. - # - # Will be called when the indexer processes a `def` or `defs` node. - # Note that when this method is called, the definition for the node has already been added to the index. - # It is still possible to ignore it from the plugin: - # - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_method(definition) - # @index.ignore(definition) if definition.name == "foo" - # end - # end - # ~~~ - # : (Model::Method definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#229 - # Called when a method is defined. - # Will be called when the indexer processes a `def` or `defs` node. - # Note that when this method is called, the definition for the node has already been added to the index. - # It is still possible to ignore it from the plugin: - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_method(definition) - # @index.ignore(definition) if definition.name == "foo" - # end - # end - # ~~~ - sig { params(definition: ::Spoom::Model::Method).void } - def on_define_method(definition); end - - # Called when a module is defined. - # - # Will be called when the indexer processes a `module` node. - # Note that when this method is called, the definition for the node has already been added to the index. - # It is still possible to ignore it from the plugin: - # - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_module(definition) - # @index.ignore(definition) if definition.name == "Foo" - # end - # end - # ~~~ - # : (Model::Module definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#255 - # Called when a module is defined. - # Will be called when the indexer processes a `module` node. - # Note that when this method is called, the definition for the node has already been added to the index. - # It is still possible to ignore it from the plugin: - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_module(definition) - # @index.ignore(definition) if definition.name == "Foo" - # end - # end - # ~~~ - sig { params(definition: ::Spoom::Model::Module).void } - def on_define_module(definition); end - - # Called when a send is being processed - # - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_send(send) - # return unless send.name == "dsl_method" - # return if send.args.empty? - # - # method_name = send.args.first.slice.delete_prefix(":") - # @index.reference_method(method_name, send.node, send.loc) - # end - # end - # ~~~ - # : (Send send) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#281 - # Called when a send is being processed - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_send(send) - # return unless send.name == "dsl_method" - # return if send.args.empty? - # method_name = send.args.first.slice.delete_prefix(":") - # @index.reference_method(method_name, send.node, send.loc) - # end - # end - # ~~~ - sig { params(send: ::Spoom::Deadcode::Send).void } - def on_send(send); end - - private - - # : (String name) -> String - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#349 - # Plugin utils - sig { params(name: ::String).returns(::String) } - def camelize(name); end - - # : (String? name) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#298 - sig { params(name: T.nilable(::String)).returns(T::Boolean) } - def ignored_class_name?(name); end - - # : (String name) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#317 - sig { params(name: ::String).returns(T::Boolean) } - def ignored_constant_name?(name); end - - # : (String name) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#322 - sig { params(name: ::String).returns(T::Boolean) } - def ignored_method_name?(name); end - - # : (String name) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#327 - sig { params(name: ::String).returns(T::Boolean) } - def ignored_module_name?(name); end - - # : (String name, Symbol names_variable, Symbol patterns_variable) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#332 - sig { params(name: ::String, names_variable: ::Symbol, patterns_variable: ::Symbol).returns(T::Boolean) } - def ignored_name?(name, names_variable, patterns_variable); end - - # : (Model::Class definition) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#305 - sig { params(definition: ::Spoom::Model::Class).returns(T::Boolean) } - def ignored_subclass?(definition); end - - # : (Symbol const) -> Set[String] - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#337 - sig { params(const: ::Symbol).returns(T::Set[::String]) } - def names(const); end - - # : (Symbol const) -> Array[Regexp] - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#342 - sig { params(const: ::Symbol).returns(T::Array[::Regexp]) } - def patterns(const); end - - # : (Model::Namespace definition, String superclass_name) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#290 - # DSL support - sig { params(definition: ::Spoom::Model::Namespace, superclass_name: ::String).returns(T::Boolean) } - def subclass_of?(definition, superclass_name); end - - class << self - # Mark classes directly subclassing a class matching `names` as ignored. - # - # Names can be either strings or regexps: - # - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # ignore_classes_inheriting_from( - # "Foo", - # "Bar", - # /Baz.*/, - # ) - # end - # ~~~ - # : (*(String | Regexp) names) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#49 - # Mark classes directly subclassing a class matching `names` as ignored. - # Names can be either strings or regexps: - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # ignore_classes_inheriting_from( - # "Foo", - # "Bar", - # /Baz.*/, - # ) - # end - # ~~~ - sig { params(names: T.any(::Regexp, ::String)).void } - def ignore_classes_inheriting_from(*names); end - - # Mark classes matching `names` as ignored. - # - # Names can be either strings or regexps: - # - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # ignore_class_names( - # "Foo", - # "Bar", - # /Baz.*/, - # ) - # end - # ~~~ - # : (*(String | Regexp) names) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#31 - # Mark classes matching `names` as ignored. - # Names can be either strings or regexps: - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # ignore_class_names( - # "Foo", - # "Bar", - # /Baz.*/, - # ) - # end - # ~~~ - sig { params(names: T.any(::Regexp, ::String)).void } - def ignore_classes_named(*names); end - - # Mark constants matching `names` as ignored. - # - # Names can be either strings or regexps: - # - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # ignore_class_names( - # "FOO", - # "BAR", - # /BAZ.*/, - # ) - # end - # ~~~ - # : (*(String | Regexp) names) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#67 - # Mark constants matching `names` as ignored. - # Names can be either strings or regexps: - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # ignore_class_names( - # "FOO", - # "BAR", - # /BAZ.*/, - # ) - # end - # ~~~ - sig { params(names: T.any(::Regexp, ::String)).void } - def ignore_constants_named(*names); end - - # Mark methods matching `names` as ignored. - # - # Names can be either strings or regexps: - # - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # ignore_method_names( - # "foo", - # "bar", - # /baz.*/, - # ) - # end - # ~~~ - # : (*(String | Regexp) names) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#85 - # Mark methods matching `names` as ignored. - # Names can be either strings or regexps: - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # ignore_method_names( - # "foo", - # "bar", - # /baz.*/, - # ) - # end - # ~~~ - sig { params(names: T.any(::Regexp, ::String)).void } - def ignore_methods_named(*names); end - - # Mark modules matching `names` as ignored. - # - # Names can be either strings or regexps: - # - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # ignore_class_names( - # "Foo", - # "Bar", - # /Baz.*/, - # ) - # end - # ~~~ - # : (*(String | Regexp) names) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#103 - # Mark modules matching `names` as ignored. - # Names can be either strings or regexps: - # ~~~rb - # class MyPlugin < Spoom::Deadcode::Plugins::Base - # ignore_class_names( - # "Foo", - # "Bar", - # /Baz.*/, - # ) - # end - # ~~~ - sig { params(names: T.any(::Regexp, ::String)).void } - def ignore_modules_named(*names); end - - private - - # : (Array[(String | Regexp)] names, Symbol names_variable, Symbol patterns_variable) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#110 - sig do - params( - names: T::Array[T.any(::Regexp, ::String)], - names_variable: ::Symbol, - patterns_variable: ::Symbol - ).void - end - def save_names_and_patterns(names, names_variable, patterns_variable); end - end -end - -# source://spoom//lib/spoom/deadcode/plugins/graphql.rb#7 -class Spoom::Deadcode::Plugins::GraphQL < ::Spoom::Deadcode::Plugins::Base - # : (Send send) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/graphql.rb#27 - sig { override.params(send: ::Spoom::Deadcode::Send).void } - def on_send(send); end -end - -# source://spoom//lib/spoom/deadcode/plugins/minitest.rb#7 -class Spoom::Deadcode::Plugins::Minitest < ::Spoom::Deadcode::Plugins::Base - # : (Model::Method definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/minitest.rb#21 - sig { override.params(definition: ::Spoom::Model::Method).void } - def on_define_method(definition); end - - # : (Send send) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/minitest.rb#28 - sig { override.params(send: ::Spoom::Deadcode::Send).void } - def on_send(send); end -end - -# source://spoom//lib/spoom/deadcode/plugins/namespaces.rb#7 -class Spoom::Deadcode::Plugins::Namespaces < ::Spoom::Deadcode::Plugins::Base - # : (Model::Class definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/namespaces.rb#10 - sig { override.params(definition: ::Spoom::Model::Class).void } - def on_define_class(definition); end - - # : (Model::Module definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/namespaces.rb#16 - sig { override.params(definition: ::Spoom::Model::Module).void } - def on_define_module(definition); end - - private - - # : (Model::Namespace symbol_def) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/plugins/namespaces.rb#23 - sig { params(symbol_def: ::Spoom::Model::Namespace).returns(T::Boolean) } - def used_as_namespace?(symbol_def); end -end - -# source://spoom//lib/spoom/deadcode/plugins/rspec.rb#7 -class Spoom::Deadcode::Plugins::RSpec < ::Spoom::Deadcode::Plugins::Base; end - -# source://spoom//lib/spoom/deadcode/plugins/rails.rb#7 -class Spoom::Deadcode::Plugins::Rails < ::Spoom::Deadcode::Plugins::Base - # : (Model::Class definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/rails.rb#12 - sig { override.params(definition: ::Spoom::Model::Class).void } - def on_define_class(definition); end - - # : (Model::Module definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/rails.rb#18 - sig { override.params(definition: ::Spoom::Model::Module).void } - def on_define_module(definition); end - - private - - # : (Model::Namespace symbol_def) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/plugins/rails.rb#25 - sig { params(symbol_def: ::Spoom::Model::Namespace).returns(T::Boolean) } - def file_is_helper?(symbol_def); end -end - -# source://spoom//lib/spoom/deadcode/plugins/rake.rb#7 -class Spoom::Deadcode::Plugins::Rake < ::Spoom::Deadcode::Plugins::Base; end - -# source://spoom//lib/spoom/deadcode/plugins/rubocop.rb#7 -class Spoom::Deadcode::Plugins::Rubocop < ::Spoom::Deadcode::Plugins::Base - # : (Model::Constant definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/rubocop.rb#17 - sig { override.params(definition: ::Spoom::Model::Constant).void } - def on_define_constant(definition); end - - # : (Model::Method definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/rubocop.rb#26 - sig { override.params(definition: ::Spoom::Model::Method).void } - def on_define_method(definition); end -end - -# source://spoom//lib/spoom/deadcode/plugins/rubocop.rb#8 -Spoom::Deadcode::Plugins::Rubocop::RUBOCOP_CONSTANTS = T.let(T.unsafe(nil), Set) - -# source://spoom//lib/spoom/deadcode/plugins/ruby.rb#7 -class Spoom::Deadcode::Plugins::Ruby < ::Spoom::Deadcode::Plugins::Base - # : (Send send) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/ruby.rb#23 - sig { override.params(send: ::Spoom::Deadcode::Send).void } - def on_send(send); end - - private - - # : (Send send, Prism::Node node) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/ruby.rb#45 - sig { params(send: ::Spoom::Deadcode::Send, node: ::Prism::Node).void } - def reference_symbol_as_constant(send, node); end -end - -# source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#7 -class Spoom::Deadcode::Plugins::Sorbet < ::Spoom::Deadcode::Plugins::Base - # : (Model::Constant definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#10 - sig { override.params(definition: ::Spoom::Model::Constant).void } - def on_define_constant(definition); end - - # : (Model::Method definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#16 - sig { override.params(definition: ::Spoom::Model::Method).void } - def on_define_method(definition); end - - private - - # : (Model::Constant definition) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#34 - sig { params(definition: ::Spoom::Model::Constant).returns(T::Boolean) } - def sorbet_enum_constant?(definition); end - - # : (Model::Constant definition) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#29 - sig { params(definition: ::Spoom::Model::Constant).returns(T::Boolean) } - def sorbet_type_member?(definition); end -end - -# source://spoom//lib/spoom/deadcode/plugins/thor.rb#7 -class Spoom::Deadcode::Plugins::Thor < ::Spoom::Deadcode::Plugins::Base - # : (Model::Method definition) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/thor.rb#12 - sig { override.params(definition: ::Spoom::Model::Method).void } - def on_define_method(definition); end -end - -# source://spoom//lib/spoom/deadcode/remover.rb#6 -class Spoom::Deadcode::Remover - # : (Context context) -> void - # - # @return [Remover] a new instance of Remover - # - # source://spoom//lib/spoom/deadcode/remover.rb#10 - sig { params(context: ::Spoom::Context).void } - def initialize(context); end - - # : (Definition::Kind? kind, Location location) -> String - # - # source://spoom//lib/spoom/deadcode/remover.rb#15 - sig { params(kind: T.nilable(::Spoom::Deadcode::Definition::Kind), location: ::Spoom::Location).returns(::String) } - def remove_location(kind, location); end -end - -# source://spoom//lib/spoom/deadcode/remover.rb#7 -class Spoom::Deadcode::Remover::Error < ::Spoom::Error; end - -# source://spoom//lib/spoom/deadcode/remover.rb#362 -class Spoom::Deadcode::Remover::NodeContext - # : (String source, Hash[Integer, Prism::Comment] comments, Prism::Node node, Array[Prism::Node] nesting) -> void - # - # @return [NodeContext] a new instance of NodeContext - # - # source://spoom//lib/spoom/deadcode/remover.rb#373 - sig do - params( - source: ::String, - comments: T::Hash[::Integer, ::Prism::Comment], - node: ::Prism::Node, - nesting: T::Array[::Prism::Node] - ).void - end - def initialize(source, comments, node, nesting); end - - # : (Prism::Node node) -> Array[Prism::Comment] - # - # source://spoom//lib/spoom/deadcode/remover.rb#487 - sig { params(node: ::Prism::Node).returns(T::Array[::Prism::Comment]) } - def attached_comments(node); end - - # : -> Prism::CallNode? - # - # source://spoom//lib/spoom/deadcode/remover.rb#515 - sig { returns(T.nilable(::Prism::CallNode)) } - def attached_sig; end - - # : -> Array[Prism::Node] - # - # source://spoom//lib/spoom/deadcode/remover.rb#502 - sig { returns(T::Array[::Prism::Node]) } - def attached_sigs; end - - # : Hash[Integer, Prism::Comment] - # - # source://spoom//lib/spoom/deadcode/remover.rb#364 - sig { returns(T::Hash[::Integer, ::Prism::Comment]) } - def comments; end - - # : (Integer start_line, Integer end_line) -> Array[Prism::Comment] - # - # source://spoom//lib/spoom/deadcode/remover.rb#475 - sig { params(start_line: ::Integer, end_line: ::Integer).returns(T::Array[::Prism::Comment]) } - def comments_between_lines(start_line, end_line); end - - # : Array[Prism::Node] - # - # source://spoom//lib/spoom/deadcode/remover.rb#370 - sig { returns(T::Array[::Prism::Node]) } - def nesting; end - - # : Array[Prism::Node] - # - # source://spoom//lib/spoom/deadcode/remover.rb#370 - # @return [Array<Prism::Node>] - def nesting=(_arg0); end - - # : -> Prism::Node? - # - # source://spoom//lib/spoom/deadcode/remover.rb#425 - sig { returns(T.nilable(::Prism::Node)) } - def next_node; end - - # : -> Array[Prism::Node] - # - # @raise [Error] - # - # source://spoom//lib/spoom/deadcode/remover.rb#414 - sig { returns(T::Array[::Prism::Node]) } - def next_nodes; end - - # : Prism::Node - # - # source://spoom//lib/spoom/deadcode/remover.rb#367 - sig { returns(::Prism::Node) } - def node; end - - # : -> NodeContext - # - # @raise [Error] - # - # source://spoom//lib/spoom/deadcode/remover.rb#389 - sig { returns(::Spoom::Deadcode::Remover::NodeContext) } - def parent_context; end - - # : -> Prism::Node - # - # @raise [Error] - # - # source://spoom//lib/spoom/deadcode/remover.rb#381 - sig { returns(::Prism::Node) } - def parent_node; end - - # : -> Prism::Node? - # - # source://spoom//lib/spoom/deadcode/remover.rb#409 - sig { returns(T.nilable(::Prism::Node)) } - def previous_node; end - - # : -> Array[Prism::Node] - # - # @raise [Error] - # - # source://spoom//lib/spoom/deadcode/remover.rb#398 - sig { returns(T::Array[::Prism::Node]) } - def previous_nodes; end - - # : -> NodeContext? - # - # source://spoom//lib/spoom/deadcode/remover.rb#430 - sig { returns(T.nilable(::Spoom::Deadcode::Remover::NodeContext)) } - def sclass_context; end - - # : (Prism::Node? node) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/remover.rb#463 - sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } - def sorbet_extend_sig?(node); end - - # : (Prism::Node? node) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/remover.rb#458 - sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } - def sorbet_signature?(node); end -end - -# source://spoom//lib/spoom/deadcode/remover.rb#530 -class Spoom::Deadcode::Remover::NodeFinder < ::Spoom::Visitor - # : (Location location, Definition::Kind? kind) -> void - # - # @return [NodeFinder] a new instance of NodeFinder - # - # source://spoom//lib/spoom/deadcode/remover.rb#598 - sig { params(location: ::Spoom::Location, kind: T.nilable(::Spoom::Deadcode::Definition::Kind)).void } - def initialize(location, kind); end - - # : Prism::Node? - # - # source://spoom//lib/spoom/deadcode/remover.rb#592 - sig { returns(T.nilable(::Prism::Node)) } - def node; end - - # : Array[Prism::Node] - # - # source://spoom//lib/spoom/deadcode/remover.rb#595 - sig { returns(T::Array[::Prism::Node]) } - def nodes_nesting; end - - # : (Prism::Node? node) -> void - # - # source://spoom//lib/spoom/deadcode/remover.rb#608 - sig { override.params(node: T.nilable(::Prism::Node)).void } - def visit(node); end - - class << self - # : (String source, Location location, Definition::Kind? kind) -> NodeContext - # - # source://spoom//lib/spoom/deadcode/remover.rb#533 - sig do - params( - source: ::String, - location: ::Spoom::Location, - kind: T.nilable(::Spoom::Deadcode::Definition::Kind) - ).returns(::Spoom::Deadcode::Remover::NodeContext) - end - def find(source, location, kind); end - - # : (Prism::Node node, Definition::Kind kind) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/deadcode/remover.rb#567 - sig { params(node: ::Prism::Node, kind: ::Spoom::Deadcode::Definition::Kind).returns(T::Boolean) } - def node_match_kind?(node, kind); end - end -end - -# source://spoom//lib/spoom/deadcode/remover.rb#27 -class Spoom::Deadcode::Remover::NodeRemover - # : (String source, Definition::Kind? kind, Location location) -> void - # - # @return [NodeRemover] a new instance of NodeRemover - # - # source://spoom//lib/spoom/deadcode/remover.rb#32 - sig do - params( - source: ::String, - kind: T.nilable(::Spoom::Deadcode::Definition::Kind), - location: ::Spoom::Location - ).void - end - def initialize(source, kind, location); end - - # : -> void - # - # source://spoom//lib/spoom/deadcode/remover.rb#42 - sig { void } - def apply_edit; end - - # : String - # - # source://spoom//lib/spoom/deadcode/remover.rb#29 - sig { returns(::String) } - def new_source; end - - private - - # : (NodeContext context) -> void - # - # source://spoom//lib/spoom/deadcode/remover.rb#149 - sig { params(context: ::Spoom::Deadcode::Remover::NodeContext).void } - def delete_attr_accessor(context); end - - # : (Integer start_char, Integer end_char) -> void - # - # source://spoom//lib/spoom/deadcode/remover.rb#321 - sig { params(start_char: ::Integer, end_char: ::Integer).void } - def delete_chars(start_char, end_char); end - - # : (NodeContext context) -> void - # - # source://spoom//lib/spoom/deadcode/remover.rb#69 - sig { params(context: ::Spoom::Deadcode::Remover::NodeContext).void } - def delete_constant_assignment(context); end - - # : (Integer start_line, Integer end_line) -> void - # - # source://spoom//lib/spoom/deadcode/remover.rb#314 - sig { params(start_line: ::Integer, end_line: ::Integer).void } - def delete_lines(start_line, end_line); end - - # : (NodeContext context) -> void - # - # source://spoom//lib/spoom/deadcode/remover.rb#251 - sig { params(context: ::Spoom::Deadcode::Remover::NodeContext).void } - def delete_node_and_comments_and_sigs(context); end - - # : (Prism::Node node, NodeContext send_context, was_removed: bool) -> void - # - # source://spoom//lib/spoom/deadcode/remover.rb#208 - sig do - params( - node: ::Prism::Node, - send_context: ::Spoom::Deadcode::Remover::NodeContext, - was_removed: T::Boolean - ).void - end - def insert_accessor(node, send_context, was_removed:); end - - # : (Integer start_char, Integer end_char, String replacement) -> void - # - # source://spoom//lib/spoom/deadcode/remover.rb#326 - sig { params(start_char: ::Integer, end_char: ::Integer, replacement: ::String).void } - def replace_chars(start_char, end_char, replacement); end - - # : (Prism::CallNode node, name: String, kind: Definition::Kind?) -> String - # - # source://spoom//lib/spoom/deadcode/remover.rb#331 - sig do - params( - node: ::Prism::CallNode, - name: ::String, - kind: T.nilable(::Spoom::Deadcode::Definition::Kind) - ).returns(::String) - end - def transform_sig(node, name:, kind:); end -end - -# An abstraction to simplify handling of Prism::CallNode nodes. -# -# source://spoom//lib/spoom/deadcode/send.rb#7 -class Spoom::Deadcode::Send < ::T::Struct - const :node, ::Prism::CallNode - const :name, ::String - const :recv, T.nilable(::Prism::Node), default: T.unsafe(nil) - const :args, T::Array[::Prism::Node], default: T.unsafe(nil) - const :block, T.nilable(::Prism::Node), default: T.unsafe(nil) - const :location, ::Spoom::Location - - # : [T] (Class[T] arg_type) { (T arg) -> void } -> void - # - # source://spoom//lib/spoom/deadcode/send.rb#16 - sig do - type_parameters(:T) - .params( - arg_type: T::Class[T.type_parameter(:T)], - block: T.proc.params(arg: T.type_parameter(:T)).void - ).void - end - def each_arg(arg_type, &block); end - - # : { (Prism::Node key, Prism::Node? value) -> void } -> void - # - # source://spoom//lib/spoom/deadcode/send.rb#23 - sig { params(block: T.proc.params(key: ::Prism::Node, value: T.nilable(::Prism::Node)).void).void } - def each_arg_assoc(&block); end - - class << self - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# source://spoom//lib/spoom.rb#10 -class Spoom::Error < ::StandardError; end - -# source://spoom//lib/spoom/context/exec.rb#5 -class Spoom::ExecResult < ::T::Struct - const :out, ::String - const :err, T.nilable(::String) - const :status, T::Boolean - const :exit_code, ::Integer - - # : -> String - # - # source://spoom//lib/spoom/context/exec.rb#12 - sig { returns(::String) } - def to_s; end - - class << self - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# source://spoom//lib/spoom/file_collector.rb#5 -class Spoom::FileCollector - # Initialize a new file collector - # - # If `allow_extensions` is empty, all files are collected. - # If `allow_extensions` is an array of extensions, only files with one of these extensions are collected. - # - # If `allow_mime_types` is empty, all files are collected. - # If `allow_mime_types` is an array of mimetypes, files without an extension are collected if their mimetype is in - # the list. - # : (?allow_extensions: Array[String], ?allow_mime_types: Array[String], ?exclude_patterns: Array[String]) -> void - # - # @return [FileCollector] a new instance of FileCollector - # - # source://spoom//lib/spoom/file_collector.rb#18 - # Initialize a new file collector - # If `allow_extensions` is empty, all files are collected. - # If `allow_extensions` is an array of extensions, only files with one of these extensions are collected. - # If `allow_mime_types` is empty, all files are collected. - # If `allow_mime_types` is an array of mimetypes, files without an extension are collected if their mimetype is in - # the list. - sig do - params( - allow_extensions: T::Array[::String], - allow_mime_types: T::Array[::String], - exclude_patterns: T::Array[::String] - ).void - end - def initialize(allow_extensions: T.unsafe(nil), allow_mime_types: T.unsafe(nil), exclude_patterns: T.unsafe(nil)); end - - # : Array[String] - # - # source://spoom//lib/spoom/file_collector.rb#7 - sig { returns(T::Array[::String]) } - def files; end - - # : (String path) -> void - # - # source://spoom//lib/spoom/file_collector.rb#31 - sig { params(path: ::String).void } - def visit_path(path); end - - # : (Array[String] paths) -> void - # - # source://spoom//lib/spoom/file_collector.rb#26 - sig { params(paths: T::Array[::String]).void } - def visit_paths(paths); end - - private - - # : (String path) -> String - # - # source://spoom//lib/spoom/file_collector.rb#48 - sig { params(path: ::String).returns(::String) } - def clean_path(path); end - - # : (String path) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/file_collector.rb#65 - sig { params(path: ::String).returns(T::Boolean) } - def excluded_file?(path); end - - # : (String path) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/file_collector.rb#80 - sig { params(path: ::String).returns(T::Boolean) } - def excluded_path?(path); end - - # : (String path) -> String? - # - # source://spoom//lib/spoom/file_collector.rb#89 - sig { params(path: ::String).returns(T.nilable(::String)) } - def mime_type_for(path); end - - # : (String path) -> void - # - # source://spoom//lib/spoom/file_collector.rb#60 - sig { params(path: ::String).void } - def visit_directory(path); end - - # : (String path) -> void - # - # source://spoom//lib/spoom/file_collector.rb#53 - sig { params(path: ::String).void } - def visit_file(path); end -end - -# Build a file hierarchy from a set of file paths. -# -# source://spoom//lib/spoom/file_tree.rb#6 -class Spoom::FileTree - # : (?T::Enumerable[String] paths) -> void - # - # @return [FileTree] a new instance of FileTree - # - # source://spoom//lib/spoom/file_tree.rb#8 - sig { params(paths: T::Enumerable[::String]).void } - def initialize(paths = T.unsafe(nil)); end - - # Add a `path` to the tree - # - # This will create all nodes until the root of `path`. - # : (String path) -> Node - # - # source://spoom//lib/spoom/file_tree.rb#23 - # Add a `path` to the tree - # This will create all nodes until the root of `path`. - sig { params(path: ::String).returns(::Spoom::FileTree::Node) } - def add_path(path); end - - # Add all `paths` to the tree - # : (T::Enumerable[String] paths) -> void - # - # source://spoom//lib/spoom/file_tree.rb#15 - # Add all `paths` to the tree - sig { params(paths: T::Enumerable[::String]).void } - def add_paths(paths); end - - # All the nodes in this tree - # : -> Array[Node] - # - # source://spoom//lib/spoom/file_tree.rb#43 - # All the nodes in this tree - sig { returns(T::Array[::Spoom::FileTree::Node]) } - def nodes; end - - # Return a map of typing scores for each node in the tree - # : (Context context) -> Hash[Node, Float] - # - # source://spoom//lib/spoom/file_tree.rb#57 - # Return a map of typing scores for each node in the tree - sig { params(context: ::Spoom::Context).returns(T::Hash[::Spoom::FileTree::Node, ::Float]) } - def nodes_strictness_scores(context); end - - # All the paths in this tree - # : -> Array[String] - # - # source://spoom//lib/spoom/file_tree.rb#51 - # All the paths in this tree - sig { returns(T::Array[::String]) } - def paths; end - - # Return a map of typing scores for each path in the tree - # : (Context context) -> Hash[String, Float] - # - # source://spoom//lib/spoom/file_tree.rb#65 - # Return a map of typing scores for each path in the tree - sig { params(context: ::Spoom::Context).returns(T::Hash[::String, ::Float]) } - def paths_strictness_scores(context); end - - # : (?out: (IO | StringIO), ?colors: bool) -> void - # - # source://spoom//lib/spoom/file_tree.rb#70 - sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean).void } - def print(out: T.unsafe(nil), colors: T.unsafe(nil)); end - - # All root nodes - # : -> Array[Node] - # - # source://spoom//lib/spoom/file_tree.rb#37 - # All root nodes - sig { returns(T::Array[::Spoom::FileTree::Node]) } - def roots; end -end - -# A visitor that collects all the nodes in a tree -# -# source://spoom//lib/spoom/file_tree.rb#119 -class Spoom::FileTree::CollectNodes < ::Spoom::FileTree::Visitor - # : -> void - # - # @return [CollectNodes] a new instance of CollectNodes - # - # source://spoom//lib/spoom/file_tree.rb#124 - sig { void } - def initialize; end - - # : Array[FileTree::Node] - # - # source://spoom//lib/spoom/file_tree.rb#121 - sig { returns(T::Array[::Spoom::FileTree::Node]) } - def nodes; end - - # : (FileTree::Node node) -> void - # - # source://spoom//lib/spoom/file_tree.rb#131 - sig { override.params(node: ::Spoom::FileTree::Node).void } - def visit_node(node); end -end - -# A visitor that collects the typing score of each node in a tree -# -# source://spoom//lib/spoom/file_tree.rb#160 -class Spoom::FileTree::CollectScores < ::Spoom::FileTree::CollectStrictnesses - # : (Context context) -> void - # - # @return [CollectScores] a new instance of CollectScores - # - # source://spoom//lib/spoom/file_tree.rb#165 - sig { params(context: ::Spoom::Context).void } - def initialize(context); end - - # : Hash[Node, Float] - # - # source://spoom//lib/spoom/file_tree.rb#162 - sig { returns(T::Hash[::Spoom::FileTree::Node, ::Float]) } - def scores; end - - # : (FileTree::Node node) -> void - # - # source://spoom//lib/spoom/file_tree.rb#173 - sig { override.params(node: ::Spoom::FileTree::Node).void } - def visit_node(node); end - - private - - # : (Node node) -> Float - # - # source://spoom//lib/spoom/file_tree.rb#182 - sig { params(node: ::Spoom::FileTree::Node).returns(::Float) } - def node_score(node); end - - # : (String? strictness) -> Float - # - # source://spoom//lib/spoom/file_tree.rb#191 - sig { params(strictness: T.nilable(::String)).returns(::Float) } - def strictness_score(strictness); end -end - -# A visitor that collects the strictness of each node in a tree -# -# source://spoom//lib/spoom/file_tree.rb#138 -class Spoom::FileTree::CollectStrictnesses < ::Spoom::FileTree::Visitor - # : (Context context) -> void - # - # @return [CollectStrictnesses] a new instance of CollectStrictnesses - # - # source://spoom//lib/spoom/file_tree.rb#143 - sig { params(context: ::Spoom::Context).void } - def initialize(context); end - - # : Hash[Node, String?] - # - # source://spoom//lib/spoom/file_tree.rb#140 - sig { returns(T::Hash[::Spoom::FileTree::Node, T.nilable(::String)]) } - def strictnesses; end - - # : (FileTree::Node node) -> void - # - # source://spoom//lib/spoom/file_tree.rb#151 - sig { override.params(node: ::Spoom::FileTree::Node).void } - def visit_node(node); end -end - -# A node representing either a file or a directory inside a FileTree -# -# source://spoom//lib/spoom/file_tree.rb#76 -class Spoom::FileTree::Node < ::T::Struct - const :parent, T.nilable(::Spoom::FileTree::Node) - const :name, ::String - const :children, T::Hash[::String, ::Spoom::FileTree::Node], default: T.unsafe(nil) - - # Full path to this node from root - # : -> String - # - # source://spoom//lib/spoom/file_tree.rb#88 - # Full path to this node from root - sig { returns(::String) } - def path; end - - class << self - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# An internal class used to print a FileTree -# -# See `FileTree#print` -# -# source://spoom//lib/spoom/file_tree.rb#204 -# An internal class used to print a FileTree -class Spoom::FileTree::Printer < ::Spoom::FileTree::Visitor - # : (Hash[FileTree::Node, String?] strictnesses, ?out: (IO | StringIO), ?colors: bool) -> void - # - # @return [Printer] a new instance of Printer - # - # source://spoom//lib/spoom/file_tree.rb#206 - sig do - params( - strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], - out: T.any(::IO, ::StringIO), - colors: T::Boolean - ).void - end - def initialize(strictnesses, out: T.unsafe(nil), colors: T.unsafe(nil)); end - - # : (FileTree::Node node) -> void - # - # source://spoom//lib/spoom/file_tree.rb#215 - sig { override.params(node: ::Spoom::FileTree::Node).void } - def visit_node(node); end - - private - - # : (String? strictness) -> Color - # - # source://spoom//lib/spoom/file_tree.rb#240 - sig { params(strictness: T.nilable(::String)).returns(::Spoom::Color) } - def strictness_color(strictness); end -end - -# An abstract visitor for FileTree -# -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/file_tree.rb#97 -class Spoom::FileTree::Visitor - abstract! - - # : (FileTree::Node node) -> void - # - # source://spoom//lib/spoom/file_tree.rb#108 - sig { params(node: ::Spoom::FileTree::Node).void } - def visit_node(node); end - - # : (Array[FileTree::Node] nodes) -> void - # - # source://spoom//lib/spoom/file_tree.rb#113 - sig { params(nodes: T::Array[::Spoom::FileTree::Node]).void } - def visit_nodes(nodes); end - - # : (FileTree tree) -> void - # - # source://spoom//lib/spoom/file_tree.rb#103 - sig { params(tree: ::Spoom::FileTree).void } - def visit_tree(tree); end -end - -# source://spoom//lib/spoom/context/git.rb#5 -module Spoom::Git; end - -# source://spoom//lib/spoom/context/git.rb#6 -class Spoom::Git::Commit < ::T::Struct - const :sha, ::String - const :time, ::Time - - # : -> Integer - # - # source://spoom//lib/spoom/context/git.rb#23 - sig { returns(::Integer) } - def timestamp; end - - class << self - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - - # Parse a line formatted as `%h %at` into a `Commit` - # : (String string) -> Commit? - # - # source://spoom//lib/spoom/context/git.rb#10 - # Parse a line formatted as `%h %at` into a `Commit` - sig { params(string: ::String).returns(T.nilable(::Spoom::Git::Commit)) } - def parse_line(string); end - end -end - -# source://spoom//lib/spoom/sorbet/lsp/base.rb#5 -module Spoom::LSP; end - -# source://spoom//lib/spoom/sorbet/lsp.rb#13 -class Spoom::LSP::Client - # : (String sorbet_bin, *String sorbet_args, ?path: String) -> void - # - # @return [Client] a new instance of Client - # - # source://spoom//lib/spoom/sorbet/lsp.rb#15 - sig { params(sorbet_bin: ::String, sorbet_args: ::String, path: ::String).void } - def initialize(sorbet_bin, *sorbet_args, path: T.unsafe(nil)); end - - # : -> void - # - # source://spoom//lib/spoom/sorbet/lsp.rb#227 - sig { void } - def close; end - - # : (String uri, Integer line, Integer column) -> Array[Location] - # - # source://spoom//lib/spoom/sorbet/lsp.rb#129 - sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::Location]) } - def definitions(uri, line, column); end - - # : (String uri) -> Array[DocumentSymbol] - # - # source://spoom//lib/spoom/sorbet/lsp.rb#210 - sig { params(uri: ::String).returns(T::Array[::Spoom::LSP::DocumentSymbol]) } - def document_symbols(uri); end - - # : (String uri, Integer line, Integer column) -> Hover? - # - # source://spoom//lib/spoom/sorbet/lsp.rb#87 - sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T.nilable(::Spoom::LSP::Hover)) } - def hover(uri, line, column); end - - # : -> Integer - # - # source://spoom//lib/spoom/sorbet/lsp.rb#25 - sig { returns(::Integer) } - def next_id; end - - # : (String workspace_path) -> void - # - # @raise [Error::AlreadyOpen] - # - # source://spoom//lib/spoom/sorbet/lsp.rb#70 - # LSP requests - sig { params(workspace_path: ::String).void } - def open(workspace_path); end - - # : -> Hash[untyped, untyped]? - # - # source://spoom//lib/spoom/sorbet/lsp.rb#52 - sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) } - def read; end - - # : -> String? - # - # @raise [Error::BadHeaders] - # - # source://spoom//lib/spoom/sorbet/lsp.rb#41 - sig { returns(T.nilable(::String)) } - def read_raw; end - - # : (String uri, Integer line, Integer column, ?bool include_decl) -> Array[Location] - # - # source://spoom//lib/spoom/sorbet/lsp.rb#171 - sig do - params( - uri: ::String, - line: ::Integer, - column: ::Integer, - include_decl: T::Boolean - ).returns(T::Array[::Spoom::LSP::Location]) - end - def references(uri, line, column, include_decl = T.unsafe(nil)); end - - # : (Message message) -> Hash[untyped, untyped]? - # - # source://spoom//lib/spoom/sorbet/lsp.rb#35 - sig { params(message: ::Spoom::LSP::Message).returns(T.nilable(T::Hash[T.untyped, T.untyped])) } - def send(message); end - - # : (String json_string) -> void - # - # source://spoom//lib/spoom/sorbet/lsp.rb#30 - sig { params(json_string: ::String).void } - def send_raw(json_string); end - - # : (String uri, Integer line, Integer column) -> Array[SignatureHelp] - # - # source://spoom//lib/spoom/sorbet/lsp.rb#108 - sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::SignatureHelp]) } - def signatures(uri, line, column); end - - # : (String query) -> Array[DocumentSymbol] - # - # source://spoom//lib/spoom/sorbet/lsp.rb#195 - sig { params(query: ::String).returns(T::Array[::Spoom::LSP::DocumentSymbol]) } - def symbols(query); end - - # : (String uri, Integer line, Integer column) -> Array[Location] - # - # source://spoom//lib/spoom/sorbet/lsp.rb#150 - sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::Location]) } - def type_definitions(uri, line, column); end -end - -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#168 -class Spoom::LSP::Diagnostic < ::T::Struct - include ::Spoom::LSP::PrintableSymbol - - const :range, ::Spoom::LSP::Range - const :code, ::Integer - const :message, ::String - const :information, ::Object - - # : (SymbolPrinter printer) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#190 - sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end - - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#195 - sig { returns(::String) } - def to_s; end - - class << self - # : (Hash[untyped, untyped] json) -> Diagnostic - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#178 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Diagnostic) } - def from_json(json); end - - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#200 -class Spoom::LSP::DocumentSymbol < ::T::Struct - include ::Spoom::LSP::PrintableSymbol - - const :name, ::String - const :detail, T.nilable(::String) - const :kind, ::Integer - const :location, T.nilable(::Spoom::LSP::Location) - const :range, T.nilable(::Spoom::LSP::Range) - const :children, T::Array[::Spoom::LSP::DocumentSymbol] - - # : (SymbolPrinter printer) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#226 - sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end - - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#258 - sig { returns(::String) } - def kind_string; end - - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#253 - sig { returns(::String) } - def to_s; end - - class << self - # : (Hash[untyped, untyped] json) -> DocumentSymbol - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#212 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::DocumentSymbol) } - def from_json(json); end - - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#262 -Spoom::LSP::DocumentSymbol::SYMBOL_KINDS = T.let(T.unsafe(nil), Hash) - -# source://spoom//lib/spoom/sorbet/lsp/errors.rb#6 -class Spoom::LSP::Error < ::Spoom::Error; end - -# source://spoom//lib/spoom/sorbet/lsp/errors.rb#7 -class Spoom::LSP::Error::AlreadyOpen < ::Spoom::LSP::Error; end - -# source://spoom//lib/spoom/sorbet/lsp/errors.rb#8 -class Spoom::LSP::Error::BadHeaders < ::Spoom::LSP::Error; end - -# source://spoom//lib/spoom/sorbet/lsp/errors.rb#10 -class Spoom::LSP::Error::Diagnostics < ::Spoom::LSP::Error - # : (String uri, Array[Diagnostic] diagnostics) -> void - # - # @return [Diagnostics] a new instance of Diagnostics - # - # source://spoom//lib/spoom/sorbet/lsp/errors.rb#28 - sig { params(uri: ::String, diagnostics: T::Array[::Spoom::LSP::Diagnostic]).void } - def initialize(uri, diagnostics); end - - # : Array[Diagnostic] - # - # source://spoom//lib/spoom/sorbet/lsp/errors.rb#15 - sig { returns(T::Array[::Spoom::LSP::Diagnostic]) } - def diagnostics; end - - # : String - # - # source://spoom//lib/spoom/sorbet/lsp/errors.rb#12 - sig { returns(::String) } - def uri; end - - class << self - # : (Hash[untyped, untyped] json) -> Diagnostics - # - # source://spoom//lib/spoom/sorbet/lsp/errors.rb#19 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Error::Diagnostics) } - def from_json(json); end - end -end - -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#19 -class Spoom::LSP::Hover < ::T::Struct - include ::Spoom::LSP::PrintableSymbol - - const :contents, ::String - const :range, T.nilable(T::Range[T.untyped]) - - # : (SymbolPrinter printer) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#37 - sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end - - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#43 - sig { returns(::String) } - def to_s; end - - class << self - # : (Hash[untyped, untyped] json) -> Hover - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#27 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Hover) } - def from_json(json); end - - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#106 -class Spoom::LSP::Location < ::T::Struct - include ::Spoom::LSP::PrintableSymbol - - const :uri, ::String - const :range, ::Spoom::LSP::Range - - # : (SymbolPrinter printer) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#124 - sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end - - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#130 - sig { returns(::String) } - def to_s; end - - class << self - # : (Hash[untyped, untyped] json) -> Location - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#114 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Location) } - def from_json(json); end - - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# A general message as defined by JSON-RPC. -# -# The language server protocol always uses `"2.0"` as the `jsonrpc` version. -# -# source://spoom//lib/spoom/sorbet/lsp/base.rb#12 -# A general message as defined by JSON-RPC. -class Spoom::LSP::Message - # : -> void - # - # @return [Message] a new instance of Message - # - # source://spoom//lib/spoom/sorbet/lsp/base.rb#14 - sig { void } - def initialize; end - - # : -> Hash[untyped, untyped] - # - # source://spoom//lib/spoom/sorbet/lsp/base.rb#19 - sig { returns(T::Hash[T.untyped, T.untyped]) } - def as_json; end - - # : (*untyped args) -> String - # - # source://spoom//lib/spoom/sorbet/lsp/base.rb#27 - sig { params(args: T.untyped).returns(::String) } - def to_json(*args); end -end - -# A notification message. -# -# A processed notification message must not send a response back. They work like events. -# -# source://spoom//lib/spoom/sorbet/lsp/base.rb#54 -# A notification message. -class Spoom::LSP::Notification < ::Spoom::LSP::Message - # : (String method, Hash[untyped, untyped] params) -> void - # - # @return [Notification] a new instance of Notification - # - # source://spoom//lib/spoom/sorbet/lsp/base.rb#62 - sig { params(method: ::String, params: T::Hash[T.untyped, T.untyped]).void } - def initialize(method, params); end - - # : String - # - # source://spoom//lib/spoom/sorbet/lsp/base.rb#56 - sig { returns(::String) } - def method; end - - # : Hash[untyped, untyped] - # - # source://spoom//lib/spoom/sorbet/lsp/base.rb#59 - sig { returns(T::Hash[T.untyped, T.untyped]) } - def params; end -end - -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#48 -class Spoom::LSP::Position < ::T::Struct - include ::Spoom::LSP::PrintableSymbol - - const :line, ::Integer - const :char, ::Integer - - # : (SymbolPrinter printer) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#66 - sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end - - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#71 - sig { returns(::String) } - def to_s; end - - class << self - # : (Hash[untyped, untyped] json) -> Position - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#56 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Position) } - def from_json(json); end - - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# @abstract Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#9 -module Spoom::LSP::PrintableSymbol - interface! - - # @abstract - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#16 - sig { abstract.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end -end - -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#76 -class Spoom::LSP::Range < ::T::Struct - include ::Spoom::LSP::PrintableSymbol - - const :start, ::Spoom::LSP::Position - const :end, ::Spoom::LSP::Position - - # : (SymbolPrinter printer) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#94 - sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end - - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#101 - sig { returns(::String) } - def to_s; end - - class << self - # : (Hash[untyped, untyped] json) -> Range - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#84 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Range) } - def from_json(json); end - - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# A request message to describe a request between the client and the server. -# -# Every processed request must send a response back to the sender of the request. -# -# source://spoom//lib/spoom/sorbet/lsp/base.rb#35 -# A request message to describe a request between the client and the server. -class Spoom::LSP::Request < ::Spoom::LSP::Message - # : (Integer id, String method, Hash[untyped, untyped] params) -> void - # - # @return [Request] a new instance of Request - # - # source://spoom//lib/spoom/sorbet/lsp/base.rb#43 - sig { params(id: ::Integer, method: ::String, params: T::Hash[T.untyped, T.untyped]).void } - def initialize(id, method, params); end - - # : Integer - # - # source://spoom//lib/spoom/sorbet/lsp/base.rb#37 - sig { returns(::Integer) } - def id; end - - # : Hash[untyped, untyped] - # - # source://spoom//lib/spoom/sorbet/lsp/base.rb#40 - sig { returns(T::Hash[T.untyped, T.untyped]) } - def params; end -end - -# source://spoom//lib/spoom/sorbet/lsp/errors.rb#36 -class Spoom::LSP::ResponseError < ::Spoom::LSP::Error - # : (Integer code, String message, Hash[untyped, untyped] data) -> void - # - # @return [ResponseError] a new instance of ResponseError - # - # source://spoom//lib/spoom/sorbet/lsp/errors.rb#55 - sig { params(code: ::Integer, message: ::String, data: T::Hash[T.untyped, T.untyped]).void } - def initialize(code, message, data); end - - # : Integer - # - # source://spoom//lib/spoom/sorbet/lsp/errors.rb#38 - sig { returns(::Integer) } - def code; end - - # : Hash[untyped, untyped] - # - # source://spoom//lib/spoom/sorbet/lsp/errors.rb#41 - sig { returns(T::Hash[T.untyped, T.untyped]) } - def data; end - - class << self - # : (Hash[untyped, untyped] json) -> ResponseError - # - # source://spoom//lib/spoom/sorbet/lsp/errors.rb#45 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::ResponseError) } - def from_json(json); end - end -end - -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#135 -class Spoom::LSP::SignatureHelp < ::T::Struct - include ::Spoom::LSP::PrintableSymbol - - const :label, T.nilable(::String) - const :doc, ::Object - const :params, T::Array[T.untyped] - - # : (SymbolPrinter printer) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#155 - sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end - - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#163 - sig { returns(::String) } - def to_s; end - - class << self - # : (Hash[untyped, untyped] json) -> SignatureHelp - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#144 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::SignatureHelp) } - def from_json(json); end - - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#295 -class Spoom::LSP::SymbolPrinter < ::Spoom::Printer - # : (?out: (IO | StringIO), ?colors: bool, ?indent_level: Integer, ?prefix: String?) -> void - # - # @return [SymbolPrinter] a new instance of SymbolPrinter - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#303 - sig do - params( - out: T.any(::IO, ::StringIO), - colors: T::Boolean, - indent_level: ::Integer, - prefix: T.nilable(::String) - ).void - end - def initialize(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil), prefix: T.unsafe(nil)); end - - # : (String uri) -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#325 - sig { params(uri: ::String).returns(::String) } - def clean_uri(uri); end - - # : String? - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#300 - sig { returns(T.nilable(::String)) } - def prefix; end - - # : String? - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#300 - # @return [String, nil] - def prefix=(_arg0); end - - # : (Array[PrintableSymbol] objects) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#333 - sig { params(objects: T::Array[::Spoom::LSP::PrintableSymbol]).void } - def print_list(objects); end - - # : (PrintableSymbol? object) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#313 - sig { params(object: T.nilable(::Spoom::LSP::PrintableSymbol)).void } - def print_object(object); end - - # : (Array[PrintableSymbol] objects) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#320 - sig { params(objects: T::Array[::Spoom::LSP::PrintableSymbol]).void } - def print_objects(objects); end - - # : Set[Integer] - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#297 - sig { returns(T::Set[::Integer]) } - def seen; end -end - -# source://spoom//lib/spoom/location.rb#5 -class Spoom::Location - include ::Comparable - - # : (String file, ?start_line: Integer?, ?start_column: Integer?, ?end_line: Integer?, ?end_column: Integer?) -> void - # - # @raise [LocationError] - # @return [Location] a new instance of Location - # - # source://spoom//lib/spoom/location.rb#61 - sig do - params( - file: ::String, - start_line: T.nilable(::Integer), - start_column: T.nilable(::Integer), - end_line: T.nilable(::Integer), - end_column: T.nilable(::Integer) - ).void - end - def initialize(file, start_line: T.unsafe(nil), start_column: T.unsafe(nil), end_line: T.unsafe(nil), end_column: T.unsafe(nil)); end - - # : (BasicObject other) -> Integer? - # - # source://spoom//lib/spoom/location.rb#95 - sig { override.params(other: ::BasicObject).returns(T.nilable(::Integer)) } - def <=>(other); end - - # : Integer? - # - # source://spoom//lib/spoom/location.rb#58 - # @return [Integer, nil] - def end_column; end - - # : Integer? - # - # source://spoom//lib/spoom/location.rb#58 - # @return [Integer, nil] - def end_line; end - - # : String - # - # source://spoom//lib/spoom/location.rb#55 - sig { returns(::String) } - def file; end - - # : (Location other) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/location.rb#81 - sig { params(other: ::Spoom::Location).returns(T::Boolean) } - def include?(other); end - - # : Integer? - # - # source://spoom//lib/spoom/location.rb#58 - # @return [Integer, nil] - def start_column; end - - # : Integer? - # - # source://spoom//lib/spoom/location.rb#58 - sig { returns(T.nilable(::Integer)) } - def start_line; end - - # : -> String - # - # source://spoom//lib/spoom/location.rb#118 - sig { returns(::String) } - def to_s; end - - class << self - # : (String file, Prism::Location location) -> Location - # - # source://spoom//lib/spoom/location.rb#43 - sig { params(file: ::String, location: ::Prism::Location).returns(::Spoom::Location) } - def from_prism(file, location); end - - # : (String location_string) -> Location - # - # @raise [LocationError] - # - # source://spoom//lib/spoom/location.rb#12 - sig { params(location_string: ::String).returns(::Spoom::Location) } - def from_string(location_string); end - end -end - -# source://spoom//lib/spoom/location.rb#8 -class Spoom::Location::LocationError < ::Spoom::Error; end - -# source://spoom//lib/spoom/model/model.rb#5 -class Spoom::Model - # : -> void - # - # @return [Model] a new instance of Model - # - # source://spoom//lib/spoom/model/model.rb#235 - sig { void } - def initialize; end - - # Get a symbol by it's full name - # - # Raises an error if the symbol is not found - # : (String full_name) -> Symbol - # - # @raise [Error] - # - # source://spoom//lib/spoom/model/model.rb#244 - # Get a symbol by it's full name - # Raises an error if the symbol is not found - sig { params(full_name: ::String).returns(::Spoom::Model::Symbol) } - def [](full_name); end - - # : -> void - # - # source://spoom//lib/spoom/model/model.rb#293 - sig { void } - def finalize!; end - - # Register a new symbol by it's full name - # - # If the symbol already exists, it will be returned. - # : (String full_name) -> Symbol - # - # source://spoom//lib/spoom/model/model.rb#255 - # Register a new symbol by it's full name - # If the symbol already exists, it will be returned. - sig { params(full_name: ::String).returns(::Spoom::Model::Symbol) } - def register_symbol(full_name); end - - # : (String full_name, context: Symbol) -> Symbol - # - # source://spoom//lib/spoom/model/model.rb#260 - sig { params(full_name: ::String, context: ::Spoom::Model::Symbol).returns(::Spoom::Model::Symbol) } - def resolve_symbol(full_name, context:); end - - # : (Symbol symbol) -> Array[Symbol] - # - # source://spoom//lib/spoom/model/model.rb#287 - sig { params(symbol: ::Spoom::Model::Symbol).returns(T::Array[::Spoom::Model::Symbol]) } - def subtypes(symbol); end - - # : (Symbol symbol) -> Array[Symbol] - # - # source://spoom//lib/spoom/model/model.rb#281 - sig { params(symbol: ::Spoom::Model::Symbol).returns(T::Array[::Spoom::Model::Symbol]) } - def supertypes(symbol); end - - # All the symbols registered in this model - # : Hash[String, Symbol] - # - # source://spoom//lib/spoom/model/model.rb#229 - # All the symbols registered in this model - sig { returns(T::Hash[::String, ::Spoom::Model::Symbol]) } - def symbols; end - - # : Poset[Symbol] - # - # source://spoom//lib/spoom/model/model.rb#232 - sig { returns(Spoom::Poset[::Spoom::Model::Symbol]) } - def symbols_hierarchy; end - - private - - # : -> void - # - # source://spoom//lib/spoom/model/model.rb#300 - sig { void } - def compute_symbols_hierarchy!; end -end - -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/model/model.rb#179 -class Spoom::Model::Attr < ::Spoom::Model::Property - abstract! -end - -# source://spoom//lib/spoom/model/model.rb#185 -class Spoom::Model::AttrAccessor < ::Spoom::Model::Attr; end - -# source://spoom//lib/spoom/model/model.rb#183 -class Spoom::Model::AttrReader < ::Spoom::Model::Attr; end - -# source://spoom//lib/spoom/model/model.rb#184 -class Spoom::Model::AttrWriter < ::Spoom::Model::Attr; end - -# Populate a Model by visiting the nodes from a Ruby file -# -# source://spoom//lib/spoom/model/builder.rb#7 -class Spoom::Model::Builder < ::Spoom::Model::NamespaceVisitor - # : (Model model, String file, ?comments: Array[Prism::Comment]) -> void - # - # @return [Builder] a new instance of Builder - # - # source://spoom//lib/spoom/model/builder.rb#9 - sig { params(model: ::Spoom::Model, file: ::String, comments: T::Array[::Prism::Comment]).void } - def initialize(model, file, comments:); end - - # : (Prism::CallNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#165 - sig { override.params(node: ::Prism::CallNode).void } - def visit_call_node(node); end - - # : (Prism::ClassNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#29 - sig { override.params(node: ::Prism::ClassNode).void } - def visit_class_node(node); end - - # : (Prism::ConstantPathWriteNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#82 - sig { override.params(node: ::Prism::ConstantPathWriteNode).void } - def visit_constant_path_write_node(node); end - - # : (Prism::ConstantWriteNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#105 - sig { override.params(node: ::Prism::ConstantWriteNode).void } - def visit_constant_write_node(node); end - - # : (Prism::DefNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#144 - sig { override.params(node: ::Prism::DefNode).void } - def visit_def_node(node); end - - # : (Prism::ModuleNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#64 - sig { override.params(node: ::Prism::ModuleNode).void } - def visit_module_node(node); end - - # : (Prism::MultiWriteNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#121 - sig { override.params(node: ::Prism::MultiWriteNode).void } - def visit_multi_write_node(node); end - - # : (Prism::SingletonClassNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#46 - sig { override.params(node: ::Prism::SingletonClassNode).void } - def visit_singleton_class_node(node); end - - private - - # : -> Array[Sig] - # - # source://spoom//lib/spoom/model/builder.rb#256 - sig { returns(T::Array[::Spoom::Model::Sig]) } - def collect_sigs; end - - # : -> Visibility - # - # source://spoom//lib/spoom/model/builder.rb#251 - sig { returns(::Spoom::Model::Visibility) } - def current_visibility; end - - # : (Prism::Node node) -> Array[Comment] - # - # source://spoom//lib/spoom/model/builder.rb#268 - sig { params(node: ::Prism::Node).returns(T::Array[::Spoom::Model::Comment]) } - def node_comments(node); end - - # : (Prism::Node node) -> Location - # - # source://spoom//lib/spoom/model/builder.rb#263 - sig { params(node: ::Prism::Node).returns(::Spoom::Location) } - def node_location(node); end -end - -# source://spoom//lib/spoom/model/model.rb#132 -class Spoom::Model::Class < ::Spoom::Model::Namespace - # : (Symbol symbol, owner: Namespace?, location: Location, ?superclass_name: String?, ?comments: Array[Comment]) -> void - # - # @return [Class] a new instance of Class - # - # source://spoom//lib/spoom/model/model.rb#137 - sig do - params( - symbol: ::Spoom::Model::Symbol, - owner: T.nilable(::Spoom::Model::Namespace), - location: ::Spoom::Location, - superclass_name: T.nilable(::String), - comments: T::Array[::Spoom::Model::Comment] - ).void - end - def initialize(symbol, owner:, location:, superclass_name: T.unsafe(nil), comments: T.unsafe(nil)); end - - # : String? - # - # source://spoom//lib/spoom/model/model.rb#134 - sig { returns(T.nilable(::String)) } - def superclass_name; end - - # : String? - # - # source://spoom//lib/spoom/model/model.rb#134 - # @return [String, nil] - def superclass_name=(_arg0); end -end - -# source://spoom//lib/spoom/model/model.rb#8 -class Spoom::Model::Comment - # : (String string, Location location) -> void - # - # @return [Comment] a new instance of Comment - # - # source://spoom//lib/spoom/model/model.rb#16 - sig { params(string: ::String, location: ::Spoom::Location).void } - def initialize(string, location); end - - # : Location - # - # source://spoom//lib/spoom/model/model.rb#13 - sig { returns(::Spoom::Location) } - def location; end - - # : String - # - # source://spoom//lib/spoom/model/model.rb#10 - sig { returns(::String) } - def string; end -end - -# source://spoom//lib/spoom/model/model.rb#146 -class Spoom::Model::Constant < ::Spoom::Model::SymbolDef - # : (Symbol symbol, owner: Namespace?, location: Location, value: String, ?comments: Array[Comment]) -> void - # - # @return [Constant] a new instance of Constant - # - # source://spoom//lib/spoom/model/model.rb#151 - sig do - params( - symbol: ::Spoom::Model::Symbol, - owner: T.nilable(::Spoom::Model::Namespace), - location: ::Spoom::Location, - value: ::String, - comments: T::Array[::Spoom::Model::Comment] - ).void - end - def initialize(symbol, owner:, location:, value:, comments: T.unsafe(nil)); end - - # : String - # - # source://spoom//lib/spoom/model/model.rb#148 - sig { returns(::String) } - def value; end -end - -# source://spoom//lib/spoom/model/model.rb#6 -class Spoom::Model::Error < ::Spoom::Error; end - -# source://spoom//lib/spoom/model/model.rb#212 -class Spoom::Model::Extend < ::Spoom::Model::Mixin; end - -# source://spoom//lib/spoom/model/model.rb#210 -class Spoom::Model::Include < ::Spoom::Model::Mixin; end - -# source://spoom//lib/spoom/model/model.rb#177 -class Spoom::Model::Method < ::Spoom::Model::Property; end - -# A mixin (include, prepend, extend) to a namespace -# -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/model/model.rb#196 -class Spoom::Model::Mixin - abstract! - - # : (String name) -> void - # - # @return [Mixin] a new instance of Mixin - # - # source://spoom//lib/spoom/model/model.rb#205 - sig { params(name: ::String).void } - def initialize(name); end - - # : String - # - # source://spoom//lib/spoom/model/model.rb#202 - sig { returns(::String) } - def name; end -end - -# source://spoom//lib/spoom/model/model.rb#144 -class Spoom::Model::Module < ::Spoom::Model::Namespace; end - -# A class or module -# -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/model/model.rb#112 -class Spoom::Model::Namespace < ::Spoom::Model::SymbolDef - abstract! - - # : (Symbol symbol, owner: Namespace?, location: Location, ?comments: Array[Comment]) -> void - # - # @return [Namespace] a new instance of Namespace - # - # source://spoom//lib/spoom/model/model.rb#122 - sig do - params( - symbol: ::Spoom::Model::Symbol, - owner: T.nilable(::Spoom::Model::Namespace), - location: ::Spoom::Location, - comments: T::Array[::Spoom::Model::Comment] - ).void - end - def initialize(symbol, owner:, location:, comments: T.unsafe(nil)); end - - # : Array[SymbolDef] - # - # source://spoom//lib/spoom/model/model.rb#116 - sig { returns(T::Array[::Spoom::Model::SymbolDef]) } - def children; end - - # : Array[Mixin] - # - # source://spoom//lib/spoom/model/model.rb#119 - sig { returns(T::Array[::Spoom::Model::Mixin]) } - def mixins; end -end - -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/model/namespace_visitor.rb#6 -class Spoom::Model::NamespaceVisitor < ::Spoom::Visitor - abstract! - - # : -> void - # - # @return [NamespaceVisitor] a new instance of NamespaceVisitor - # - # source://spoom//lib/spoom/model/namespace_visitor.rb#12 - sig { void } - def initialize; end - - # : (Prism::Node? node) -> void - # - # source://spoom//lib/spoom/model/namespace_visitor.rb#20 - sig { override.params(node: T.nilable(::Prism::Node)).void } - def visit(node); end -end - -# source://spoom//lib/spoom/model/model.rb#211 -class Spoom::Model::Prepend < ::Spoom::Model::Mixin; end - -# A method or an attribute accessor -# -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/model/model.rb#159 -class Spoom::Model::Property < ::Spoom::Model::SymbolDef - abstract! - - # : (Symbol symbol, owner: Namespace?, location: Location, visibility: Visibility, ?sigs: Array[Sig], ?comments: Array[Comment]) -> void - # - # @return [Property] a new instance of Property - # - # source://spoom//lib/spoom/model/model.rb#169 - sig do - params( - symbol: ::Spoom::Model::Symbol, - owner: T.nilable(::Spoom::Model::Namespace), - location: ::Spoom::Location, - visibility: ::Spoom::Model::Visibility, - sigs: T::Array[::Spoom::Model::Sig], - comments: T::Array[::Spoom::Model::Comment] - ).void - end - def initialize(symbol, owner:, location:, visibility:, sigs: T.unsafe(nil), comments: T.unsafe(nil)); end - - # : Array[Sig] - # - # source://spoom//lib/spoom/model/model.rb#166 - sig { returns(T::Array[::Spoom::Model::Sig]) } - def sigs; end - - # : Visibility - # - # source://spoom//lib/spoom/model/model.rb#163 - sig { returns(::Spoom::Model::Visibility) } - def visibility; end -end - -# A reference to something that looks like a constant or a method -# -# Constants could be classes, modules, or actual constants. -# Methods could be accessors, instance or class methods, aliases, etc. -# -# source://spoom//lib/spoom/model/reference.rb#10 -# A reference to something that looks like a constant or a method -# Constants could be classes, modules, or actual constants. -class Spoom::Model::Reference < ::T::Struct - const :kind, ::Spoom::Model::Reference::Kind - const :name, ::String - const :location, ::Spoom::Location - - # : -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/model/reference.rb#35 - sig { returns(T::Boolean) } - def constant?; end - - # : -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/model/reference.rb#40 - sig { returns(T::Boolean) } - def method?; end - - class << self - # : (String name, Spoom::Location location) -> Reference - # - # source://spoom//lib/spoom/model/reference.rb#20 - sig { params(name: ::String, location: ::Spoom::Location).returns(::Spoom::Model::Reference) } - def constant(name, location); end - - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - - # : (String name, Spoom::Location location) -> Reference - # - # source://spoom//lib/spoom/model/reference.rb#25 - sig { params(name: ::String, location: ::Spoom::Location).returns(::Spoom::Model::Reference) } - def method(name, location); end - end -end - -# source://spoom//lib/spoom/model/reference.rb#11 -class Spoom::Model::Reference::Kind < ::T::Enum - enums do - Constant = new - Method = new - end -end - -# Visit a file to collect all the references to constants and methods -# -# source://spoom//lib/spoom/model/references_visitor.rb#7 -class Spoom::Model::ReferencesVisitor < ::Spoom::Visitor - # : (String file) -> void - # - # @return [ReferencesVisitor] a new instance of ReferencesVisitor - # - # source://spoom//lib/spoom/model/references_visitor.rb#12 - sig { params(file: ::String).void } - def initialize(file); end - - # : Array[Reference] - # - # source://spoom//lib/spoom/model/references_visitor.rb#9 - sig { returns(T::Array[::Spoom::Model::Reference]) } - def references; end - - # : (Prism::AliasMethodNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#21 - sig { override.params(node: ::Prism::AliasMethodNode).void } - def visit_alias_method_node(node); end - - # : (Prism::AndNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#27 - sig { override.params(node: ::Prism::AndNode).void } - def visit_and_node(node); end - - # : (Prism::BlockArgumentNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#34 - sig { override.params(node: ::Prism::BlockArgumentNode).void } - def visit_block_argument_node(node); end - - # : (Prism::CallAndWriteNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#46 - sig { override.params(node: ::Prism::CallAndWriteNode).void } - def visit_call_and_write_node(node); end - - # : (Prism::CallNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#73 - sig { override.params(node: ::Prism::CallNode).void } - def visit_call_node(node); end - - # : (Prism::CallOperatorWriteNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#55 - sig { override.params(node: ::Prism::CallOperatorWriteNode).void } - def visit_call_operator_write_node(node); end - - # : (Prism::CallOrWriteNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#64 - sig { override.params(node: ::Prism::CallOrWriteNode).void } - def visit_call_or_write_node(node); end - - # : (Prism::ClassNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#91 - sig { override.params(node: ::Prism::ClassNode).void } - def visit_class_node(node); end - - # : (Prism::ConstantAndWriteNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#98 - sig { override.params(node: ::Prism::ConstantAndWriteNode).void } - def visit_constant_and_write_node(node); end - - # : (Prism::ConstantOperatorWriteNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#105 - sig { override.params(node: ::Prism::ConstantOperatorWriteNode).void } - def visit_constant_operator_write_node(node); end - - # : (Prism::ConstantOrWriteNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#112 - sig { override.params(node: ::Prism::ConstantOrWriteNode).void } - def visit_constant_or_write_node(node); end - - # : (Prism::ConstantPathNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#119 - sig { override.params(node: ::Prism::ConstantPathNode).void } - def visit_constant_path_node(node); end - - # : (Prism::ConstantPathWriteNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#126 - sig { override.params(node: ::Prism::ConstantPathWriteNode).void } - def visit_constant_path_write_node(node); end - - # : (Prism::ConstantReadNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#133 - sig { override.params(node: ::Prism::ConstantReadNode).void } - def visit_constant_read_node(node); end - - # : (Prism::ConstantWriteNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#139 - sig { override.params(node: ::Prism::ConstantWriteNode).void } - def visit_constant_write_node(node); end - - # : (Prism::LocalVariableAndWriteNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#145 - sig { override.params(node: ::Prism::LocalVariableAndWriteNode).void } - def visit_local_variable_and_write_node(node); end - - # : (Prism::LocalVariableOperatorWriteNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#154 - sig { override.params(node: ::Prism::LocalVariableOperatorWriteNode).void } - def visit_local_variable_operator_write_node(node); end - - # : (Prism::LocalVariableOrWriteNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#163 - sig { override.params(node: ::Prism::LocalVariableOrWriteNode).void } - def visit_local_variable_or_write_node(node); end - - # : (Prism::LocalVariableWriteNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#172 - sig { override.params(node: ::Prism::LocalVariableWriteNode).void } - def visit_local_variable_write_node(node); end - - # : (Prism::ModuleNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#179 - sig { override.params(node: ::Prism::ModuleNode).void } - def visit_module_node(node); end - - # : (Prism::MultiWriteNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#185 - sig { override.params(node: ::Prism::MultiWriteNode).void } - def visit_multi_write_node(node); end - - # : (Prism::OrNode node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#197 - sig { override.params(node: ::Prism::OrNode).void } - def visit_or_node(node); end - - private - - # : (Prism::Node node) -> Location - # - # source://spoom//lib/spoom/model/references_visitor.rb#215 - sig { params(node: ::Prism::Node).returns(::Spoom::Location) } - def node_location(node); end - - # : (String name, Prism::Node node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#205 - sig { params(name: ::String, node: ::Prism::Node).void } - def reference_constant(name, node); end - - # : (String name, Prism::Node node) -> void - # - # source://spoom//lib/spoom/model/references_visitor.rb#210 - sig { params(name: ::String, node: ::Prism::Node).void } - def reference_method(name, node); end -end - -# A Sorbet signature (sig block) -# -# source://spoom//lib/spoom/model/model.rb#215 -class Spoom::Model::Sig - # : (String string) -> void - # - # @return [Sig] a new instance of Sig - # - # source://spoom//lib/spoom/model/model.rb#220 - sig { params(string: ::String).void } - def initialize(string); end - - # : String - # - # source://spoom//lib/spoom/model/model.rb#217 - sig { returns(::String) } - def string; end -end - -# source://spoom//lib/spoom/model/model.rb#130 -class Spoom::Model::SingletonClass < ::Spoom::Model::Namespace; end - -# A Symbol is a uniquely named entity in the Ruby codebase -# -# A symbol can have multiple definitions, e.g. a class can be reopened. -# Sometimes a symbol can have multiple definitions of different types, -# e.g. `foo` method can be defined both as a method and as an attribute accessor. -# -# source://spoom//lib/spoom/model/model.rb#27 -# A Symbol is a uniquely named entity in the Ruby codebase -# A symbol can have multiple definitions, e.g. a class can be reopened. -# Sometimes a symbol can have multiple definitions of different types, -class Spoom::Model::Symbol - # : (String full_name) -> void - # - # @return [Symbol] a new instance of Symbol - # - # source://spoom//lib/spoom/model/model.rb#37 - sig { params(full_name: ::String).void } - def initialize(full_name); end - - # The definitions of this symbol (where it exists in the code) - # : Array[SymbolDef] - # - # source://spoom//lib/spoom/model/model.rb#34 - # The definitions of this symbol (where it exists in the code) - sig { returns(T::Array[::Spoom::Model::SymbolDef]) } - def definitions; end - - # The full, unique name of this symbol - # : String - # - # source://spoom//lib/spoom/model/model.rb#30 - # The full, unique name of this symbol - sig { returns(::String) } - def full_name; end - - # The short name of this symbol - # : -> String - # - # source://spoom//lib/spoom/model/model.rb#44 - # The short name of this symbol - sig { returns(::String) } - def name; end - - # : -> String - # - # source://spoom//lib/spoom/model/model.rb#49 - sig { returns(::String) } - def to_s; end -end - -# A SymbolDef is a definition of a Symbol -# -# It can be a class, module, constant, method, etc. -# A SymbolDef has a location pointing to the actual code that defines the symbol. -# -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/model/model.rb#66 -# A SymbolDef is a definition of a Symbol -# It can be a class, module, constant, method, etc. -class Spoom::Model::SymbolDef - abstract! - - # : (Symbol symbol, owner: Namespace?, location: Location, ?comments: Array[Comment]) -> void - # - # @return [SymbolDef] a new instance of SymbolDef - # - # source://spoom//lib/spoom/model/model.rb#88 - sig do - params( - symbol: ::Spoom::Model::Symbol, - owner: T.nilable(::Spoom::Model::Namespace), - location: ::Spoom::Location, - comments: T::Array[::Spoom::Model::Comment] - ).void - end - def initialize(symbol, owner:, location:, comments:); end - - # The comments associated with this definition - # : Array[Comment] - # - # source://spoom//lib/spoom/model/model.rb#85 - # The comments associated with this definition - sig { returns(T::Array[::Spoom::Model::Comment]) } - def comments; end - - # The full name of the symbol this definition belongs to - # : -> String - # - # source://spoom//lib/spoom/model/model.rb#100 - # The full name of the symbol this definition belongs to - sig { returns(::String) } - def full_name; end - - # The actual code location of this definition - # : Location - # - # source://spoom//lib/spoom/model/model.rb#81 - # The actual code location of this definition - sig { returns(::Spoom::Location) } - def location; end - - # The short name of the symbol this definition belongs to - # : -> String - # - # source://spoom//lib/spoom/model/model.rb#106 - # The short name of the symbol this definition belongs to - sig { returns(::String) } - def name; end - - # The enclosing namespace this definition belongs to - # : Namespace? - # - # source://spoom//lib/spoom/model/model.rb#77 - # The enclosing namespace this definition belongs to - sig { returns(T.nilable(::Spoom::Model::Namespace)) } - def owner; end - - # The symbol this definition belongs to - # : Symbol - # - # source://spoom//lib/spoom/model/model.rb#73 - # The symbol this definition belongs to - sig { returns(::Spoom::Model::Symbol) } - def symbol; end -end - -# source://spoom//lib/spoom/model/model.rb#54 -class Spoom::Model::UnresolvedSymbol < ::Spoom::Model::Symbol - # : -> String - # - # source://spoom//lib/spoom/model/model.rb#57 - sig { override.returns(::String) } - def to_s; end -end - -# source://spoom//lib/spoom/model/model.rb#187 -class Spoom::Model::Visibility < ::T::Enum - enums do - Private = new - Protected = new - Public = new - end -end - -# source://spoom//lib/spoom/parse.rb#7 -class Spoom::ParseError < ::Spoom::Error; end - -# A Poset is a set of elements with a partial order relation. -# -# The partial order relation is a binary relation that is reflexive, antisymmetric, and transitive. -# It can be used to represent a hierarchy of classes or modules, the dependencies between gems, etc. -# -# source://spoom//lib/spoom/poset.rb#9 -# A Poset is a set of elements with a partial order relation. -# The partial order relation is a binary relation that is reflexive, antisymmetric, and transitive. -class Spoom::Poset - extend T::Generic - - E = type_member { { upper: Object } } - - # : -> void - # - # @return [Poset] a new instance of Poset - # - # source://spoom//lib/spoom/poset.rb#17 - sig { void } - def initialize; end - - # Get the POSet element for a given value - # - # Raises if the element is not found - # : (E value) -> Element[E] - # - # @raise [Error] - # - # source://spoom//lib/spoom/poset.rb#25 - # Get the POSet element for a given value - # Raises if the element is not found - sig { params(value: E).returns(Spoom::Poset::Element[E]) } - def [](value); end - - # Add a direct edge from one element to another - # - # Transitive edges (transitive closure) are automatically computed. - # Adds the elements if they don't exist. - # If the direct edge already exists, nothing is done. - # : (E from, E to) -> void - # - # source://spoom//lib/spoom/poset.rb#53 - # Add a direct edge from one element to another - # Transitive edges (transitive closure) are automatically computed. - # Adds the elements if they don't exist. - # If the direct edge already exists, nothing is done. - sig { params(from: E, to: E).void } - def add_direct_edge(from, to); end - - # Add an element to the POSet - # : (E value) -> Element[E] - # - # source://spoom//lib/spoom/poset.rb#34 - # Add an element to the POSet - sig { params(value: E).returns(Spoom::Poset::Element[E]) } - def add_element(value); end - - # Is there a direct edge from `from` to `to`? - # : (E from, E to) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/poset.rb#100 - # Is there a direct edge from `from` to `to`? - sig { params(from: E, to: E).returns(T::Boolean) } - def direct_edge?(from, to); end - - # Is there an edge (direct or indirect) from `from` to `to`? - # : (E from, E to) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/poset.rb#91 - # Is there an edge (direct or indirect) from `from` to `to`? - sig { params(from: E, to: E).returns(T::Boolean) } - def edge?(from, to); end - - # Is the given value a element in the POSet? - # : (E value) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/poset.rb#43 - # Is the given value a element in the POSet? - sig { params(value: E).returns(T::Boolean) } - def element?(value); end - - # Show the POSet as a DOT graph using xdot (used for debugging) - # : (?direct: bool, ?transitive: bool) -> void - # - # source://spoom//lib/spoom/poset.rb#106 - # Show the POSet as a DOT graph using xdot (used for debugging) - sig { params(direct: T::Boolean, transitive: T::Boolean).void } - def show_dot(direct: T.unsafe(nil), transitive: T.unsafe(nil)); end - - # Return the POSet as a DOT graph - # : (?direct: bool, ?transitive: bool) -> String - # - # source://spoom//lib/spoom/poset.rb#115 - # Return the POSet as a DOT graph - sig { params(direct: T::Boolean, transitive: T::Boolean).returns(::String) } - def to_dot(direct: T.unsafe(nil), transitive: T.unsafe(nil)); end -end - -# An element in a POSet -# -# source://spoom//lib/spoom/poset.rb#135 -class Spoom::Poset::Element - extend T::Generic - include ::Comparable - - E = type_member { { upper: Object } } - - # : (E value) -> void - # - # @return [Element] a new instance of Element - # - # source://spoom//lib/spoom/poset.rb#150 - sig { params(value: E).void } - def initialize(value); end - - # : (untyped other) -> Integer? - # - # source://spoom//lib/spoom/poset.rb#159 - sig { params(other: T.untyped).returns(T.nilable(::Integer)) } - def <=>(other); end - - # Direct and indirect ancestors of this element - # : -> Array[E] - # - # source://spoom//lib/spoom/poset.rb#178 - # Direct and indirect ancestors of this element - sig { returns(T::Array[E]) } - def ancestors; end - - # Direct children of this element - # : -> Array[E] - # - # source://spoom//lib/spoom/poset.rb#184 - # Direct children of this element - sig { returns(T::Array[E]) } - def children; end - - # Direct and indirect descendants of this element - # : -> Array[E] - # - # source://spoom//lib/spoom/poset.rb#190 - # Direct and indirect descendants of this element - sig { returns(T::Array[E]) } - def descendants; end - - # Edges (direct and indirect) from this element to other elements in the same POSet - # : Set[Element[E]] - # - # source://spoom//lib/spoom/poset.rb#147 - # Edges (direct and indirect) from this element to other elements in the same POSet - # @return [Set<Element[E]>] - def dfroms; end - - # Edges (direct and indirect) from this element to other elements in the same POSet - # : Set[Element[E]] - # - # source://spoom//lib/spoom/poset.rb#147 - # Edges (direct and indirect) from this element to other elements in the same POSet - sig { returns(T::Set[Spoom::Poset::Element[E]]) } - def dtos; end - - # Edges (direct and indirect) from this element to other elements in the same POSet - # : Set[Element[E]] - # - # source://spoom//lib/spoom/poset.rb#147 - # Edges (direct and indirect) from this element to other elements in the same POSet - # @return [Set<Element[E]>] - def froms; end - - # Direct parents of this element - # : -> Array[E] - # - # source://spoom//lib/spoom/poset.rb#172 - # Direct parents of this element - sig { returns(T::Array[E]) } - def parents; end - - # Edges (direct and indirect) from this element to other elements in the same POSet - # : Set[Element[E]] - # - # source://spoom//lib/spoom/poset.rb#147 - # Edges (direct and indirect) from this element to other elements in the same POSet - # @return [Set<Element[E]>] - def tos; end - - # The value held by this element - # : E - # - # source://spoom//lib/spoom/poset.rb#143 - # The value held by this element - sig { returns(E) } - def value; end -end - -# source://spoom//lib/spoom/poset.rb#12 -class Spoom::Poset::Error < ::Spoom::Error; end - -# source://spoom//lib/spoom/printer.rb#7 -class Spoom::Printer - include ::Spoom::Colorize - - # : (?out: (IO | StringIO), ?colors: bool, ?indent_level: Integer) -> void - # - # @return [Printer] a new instance of Printer - # - # source://spoom//lib/spoom/printer.rb#14 - sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean, indent_level: ::Integer).void } - def initialize(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil)); end - - # Colorize `string` with color if `@colors` - # : (String string, *Spoom::Color color) -> String - # - # source://spoom//lib/spoom/printer.rb#75 - # Colorize `string` with color if `@colors` - sig { params(string: ::String, color: ::Spoom::Color).returns(::String) } - def colorize(string, *color); end - - # Decrease indent level - # : -> void - # - # source://spoom//lib/spoom/printer.rb#28 - # Decrease indent level - sig { void } - def dedent; end - - # Increase indent level - # : -> void - # - # source://spoom//lib/spoom/printer.rb#22 - # Increase indent level - sig { void } - def indent; end - - # : (IO | StringIO) - # - # source://spoom//lib/spoom/printer.rb#11 - sig { returns(T.any(::IO, ::StringIO)) } - def out; end - - # : (IO | StringIO) - # - # source://spoom//lib/spoom/printer.rb#11 - # @return [IO, StringIO] - def out=(_arg0); end - - # Print `string` into `out` - # : (String? string) -> void - # - # source://spoom//lib/spoom/printer.rb#34 - # Print `string` into `out` - sig { params(string: T.nilable(::String)).void } - def print(string); end - - # Print `string` colored with `color` into `out` - # - # Does not use colors unless `@colors`. - # : (String? string, *Color color) -> void - # - # source://spoom//lib/spoom/printer.rb#44 - # Print `string` colored with `color` into `out` - # Does not use colors unless `@colors`. - sig { params(string: T.nilable(::String), color: ::Spoom::Color).void } - def print_colored(string, *color); end - - # Print `string` with indent and newline - # : (String? string) -> void - # - # source://spoom//lib/spoom/printer.rb#59 - # Print `string` with indent and newline - sig { params(string: T.nilable(::String)).void } - def printl(string); end - - # Print a new line into `out` - # : -> void - # - # source://spoom//lib/spoom/printer.rb#53 - # Print a new line into `out` - sig { void } - def printn; end - - # Print an indent space into `out` - # : -> void - # - # source://spoom//lib/spoom/printer.rb#69 - # Print an indent space into `out` - sig { void } - def printt; end -end - -# source://spoom//lib/spoom.rb#8 -Spoom::SPOOM_PATH = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/sorbet/assertions.rb#7 -module Spoom::Sorbet; end - -# source://spoom//lib/spoom/sorbet/assertions.rb#8 -class Spoom::Sorbet::Assertions - class << self - # : (String, file: String) -> String - # - # source://spoom//lib/spoom/sorbet/assertions.rb#11 - sig { params(ruby_contents: ::String, file: ::String).returns(::String) } - def rbi_to_rbs(ruby_contents, file:); end - - private - - # : (String, file: String) -> Array[AssignNode] - # - # source://spoom//lib/spoom/sorbet/assertions.rb#46 - sig { params(ruby_contents: ::String, file: ::String).returns(T::Array[::Spoom::Sorbet::Assertions::AssignNode]) } - def collect_assigns(ruby_contents, file:); end - - # : (AssignNode) -> String - # - # source://spoom//lib/spoom/sorbet/assertions.rb#54 - sig { params(assign: ::Spoom::Sorbet::Assertions::AssignNode).returns(::String) } - def dedent_value(assign); end - end -end - -# source://spoom//lib/spoom/sorbet/assertions.rb#122 -class Spoom::Sorbet::Assertions::AssignNode - # : (AssignType, Prism::Location, Prism::Node, Prism::Node) -> void - # - # @return [AssignNode] a new instance of AssignNode - # - # source://spoom//lib/spoom/sorbet/assertions.rb#133 - sig do - params( - node: T.any(::Prism::ClassVariableAndWriteNode, ::Prism::ClassVariableOperatorWriteNode, ::Prism::ClassVariableOrWriteNode, ::Prism::ClassVariableWriteNode, ::Prism::ConstantAndWriteNode, ::Prism::ConstantOperatorWriteNode, ::Prism::ConstantOrWriteNode, ::Prism::ConstantPathAndWriteNode, ::Prism::ConstantPathOperatorWriteNode, ::Prism::ConstantPathOrWriteNode, ::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode, ::Prism::GlobalVariableAndWriteNode, ::Prism::GlobalVariableOperatorWriteNode, ::Prism::GlobalVariableOrWriteNode, ::Prism::GlobalVariableWriteNode, ::Prism::InstanceVariableAndWriteNode, ::Prism::InstanceVariableOperatorWriteNode, ::Prism::InstanceVariableOrWriteNode, ::Prism::InstanceVariableWriteNode, ::Prism::LocalVariableAndWriteNode, ::Prism::LocalVariableOperatorWriteNode, ::Prism::LocalVariableOrWriteNode, ::Prism::LocalVariableWriteNode), - operator_loc: ::Prism::Location, - value: ::Prism::Node, - type: ::Prism::Node - ).void - end - def initialize(node, operator_loc, value, type); end - - # : AssignType - # - # source://spoom//lib/spoom/sorbet/assertions.rb#124 - sig do - returns(T.any(::Prism::ClassVariableAndWriteNode, ::Prism::ClassVariableOperatorWriteNode, ::Prism::ClassVariableOrWriteNode, ::Prism::ClassVariableWriteNode, ::Prism::ConstantAndWriteNode, ::Prism::ConstantOperatorWriteNode, ::Prism::ConstantOrWriteNode, ::Prism::ConstantPathAndWriteNode, ::Prism::ConstantPathOperatorWriteNode, ::Prism::ConstantPathOrWriteNode, ::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode, ::Prism::GlobalVariableAndWriteNode, ::Prism::GlobalVariableOperatorWriteNode, ::Prism::GlobalVariableOrWriteNode, ::Prism::GlobalVariableWriteNode, ::Prism::InstanceVariableAndWriteNode, ::Prism::InstanceVariableOperatorWriteNode, ::Prism::InstanceVariableOrWriteNode, ::Prism::InstanceVariableWriteNode, ::Prism::LocalVariableAndWriteNode, ::Prism::LocalVariableOperatorWriteNode, ::Prism::LocalVariableOrWriteNode, ::Prism::LocalVariableWriteNode)) - end - def node; end - - # : Prism::Location - # - # source://spoom//lib/spoom/sorbet/assertions.rb#127 - sig { returns(::Prism::Location) } - def operator_loc; end - - # : -> String - # - # source://spoom//lib/spoom/sorbet/assertions.rb#141 - sig { returns(::String) } - def rbs_type; end - - # : Prism::Node - # - # source://spoom//lib/spoom/sorbet/assertions.rb#130 - # @return [Prism::Node] - def type; end - - # : Prism::Node - # - # source://spoom//lib/spoom/sorbet/assertions.rb#130 - sig { returns(::Prism::Node) } - def value; end -end - -# source://spoom//lib/spoom/sorbet/assertions.rb#93 -Spoom::Sorbet::Assertions::AssignType = T.type_alias { T.any(::Prism::ClassVariableAndWriteNode, ::Prism::ClassVariableOperatorWriteNode, ::Prism::ClassVariableOrWriteNode, ::Prism::ClassVariableWriteNode, ::Prism::ConstantAndWriteNode, ::Prism::ConstantOperatorWriteNode, ::Prism::ConstantOrWriteNode, ::Prism::ConstantPathAndWriteNode, ::Prism::ConstantPathOperatorWriteNode, ::Prism::ConstantPathOrWriteNode, ::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode, ::Prism::GlobalVariableAndWriteNode, ::Prism::GlobalVariableOperatorWriteNode, ::Prism::GlobalVariableOrWriteNode, ::Prism::GlobalVariableWriteNode, ::Prism::InstanceVariableAndWriteNode, ::Prism::InstanceVariableOperatorWriteNode, ::Prism::InstanceVariableOrWriteNode, ::Prism::InstanceVariableWriteNode, ::Prism::LocalVariableAndWriteNode, ::Prism::LocalVariableOperatorWriteNode, ::Prism::LocalVariableOrWriteNode, ::Prism::LocalVariableWriteNode) } - -# source://spoom//lib/spoom/sorbet/assertions.rb#146 -class Spoom::Sorbet::Assertions::Locator < ::Spoom::Visitor - # : -> void - # - # @return [Locator] a new instance of Locator - # - # source://spoom//lib/spoom/sorbet/assertions.rb#153 - sig { void } - def initialize; end - - # : Array[AssignNode] - # - # source://spoom//lib/spoom/sorbet/assertions.rb#150 - sig { returns(T::Array[::Spoom::Sorbet::Assertions::AssignNode]) } - def assigns; end - - # : (Prism::Node) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/sorbet/assertions.rb#245 - sig { params(node: ::Prism::Node).returns(T::Boolean) } - def contains_heredoc?(node); end - - # Is this node a `T` or `::T` constant? - # : (Prism::Node?) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/sorbet/assertions.rb#223 - # Is this node a `T` or `::T` constant? - sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } - def t?(node); end - - # Is this node a `T.let` or `T.cast`? - # : (Prism::CallNode) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/sorbet/assertions.rb#236 - # Is this node a `T.let` or `T.cast`? - sig { params(node: ::Prism::CallNode).returns(T::Boolean) } - def t_annotation?(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - sig do - params( - node: T.any(::Prism::ClassVariableAndWriteNode, ::Prism::ClassVariableOperatorWriteNode, ::Prism::ClassVariableOrWriteNode, ::Prism::ClassVariableWriteNode, ::Prism::ConstantAndWriteNode, ::Prism::ConstantOperatorWriteNode, ::Prism::ConstantOrWriteNode, ::Prism::ConstantPathAndWriteNode, ::Prism::ConstantPathOperatorWriteNode, ::Prism::ConstantPathOrWriteNode, ::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode, ::Prism::GlobalVariableAndWriteNode, ::Prism::GlobalVariableOperatorWriteNode, ::Prism::GlobalVariableOrWriteNode, ::Prism::GlobalVariableWriteNode, ::Prism::InstanceVariableAndWriteNode, ::Prism::InstanceVariableOperatorWriteNode, ::Prism::InstanceVariableOrWriteNode, ::Prism::InstanceVariableWriteNode, ::Prism::LocalVariableAndWriteNode, ::Prism::LocalVariableOperatorWriteNode, ::Prism::LocalVariableOrWriteNode, ::Prism::LocalVariableWriteNode) - ).void - end - def visit_assign(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_class_variable_and_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_class_variable_operator_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_class_variable_or_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_class_variable_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_and_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_operator_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_or_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_path_and_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_path_operator_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_path_or_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_path_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_global_variable_and_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_global_variable_operator_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_global_variable_or_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_global_variable_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_instance_variable_and_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_instance_variable_operator_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_instance_variable_or_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_instance_variable_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_local_variable_and_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_local_variable_operator_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_local_variable_or_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_local_variable_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_multi_write_node(node); end -end - -# source://spoom//lib/spoom/sorbet/assertions.rb#147 -Spoom::Sorbet::Assertions::Locator::ANNOTATION_METHODS = T.let(T.unsafe(nil), Array) - -# source://spoom//lib/spoom/sorbet/assertions.rb#251 -class Spoom::Sorbet::Assertions::Locator::HeredocVisitor < ::Spoom::Visitor - # : -> void - # - # @return [HeredocVisitor] a new instance of HeredocVisitor - # - # source://spoom//lib/spoom/sorbet/assertions.rb#256 - sig { void } - def initialize; end - - # : bool - # - # source://spoom//lib/spoom/sorbet/assertions.rb#253 - sig { returns(T::Boolean) } - def contains_heredoc; end - - # : (Prism::Node?) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#264 - sig { override.params(node: T.nilable(::Prism::Node)).void } - def visit(node); end -end - -# source://spoom//lib/spoom/sorbet.rb#33 -Spoom::Sorbet::BIN_PATH = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/sorbet.rb#30 -Spoom::Sorbet::CONFIG_PATH = T.let(T.unsafe(nil), String) - -# Parse Sorbet config files -# -# Parses a Sorbet config file: -# -# ```ruby -# config = Spoom::Sorbet::Config.parse_file("sorbet/config") -# puts config.paths # "." -# ``` -# -# Parses a Sorbet config string: -# -# ```ruby -# config = Spoom::Sorbet::Config.parse_string(<<~CONFIG) -# a -# --file=b -# --ignore=c -# CONFIG -# puts config.paths # "a", "b" -# puts config.ignore # "c" -# ``` -# -# source://spoom//lib/spoom/sorbet/config.rb#26 -# Parse Sorbet config files -# Parses a Sorbet config file: -# ```ruby -# config = Spoom::Sorbet::Config.parse_file("sorbet/config") -# puts config.paths # "." -# Parses a Sorbet config string: -# config = Spoom::Sorbet::Config.parse_string(<<~CONFIG) -# a -# --file=b -# --ignore=c -# CONFIG -# puts config.paths # "a", "b" -# puts config.ignore # "c" -class Spoom::Sorbet::Config - # : -> void - # - # @return [Config] a new instance of Config - # - # source://spoom//lib/spoom/sorbet/config.rb#36 - sig { void } - def initialize; end - - # : Array[String] - # - # source://spoom//lib/spoom/sorbet/config.rb#30 - # @return [Array<String>] - def allowed_extensions; end - - # : Array[String] - # - # source://spoom//lib/spoom/sorbet/config.rb#30 - # @return [Array<String>] - def allowed_extensions=(_arg0); end - - # : -> Config - # - # source://spoom//lib/spoom/sorbet/config.rb#44 - sig { returns(::Spoom::Sorbet::Config) } - def copy; end - - # : Array[String] - # - # source://spoom//lib/spoom/sorbet/config.rb#30 - # @return [Array<String>] - def ignore; end - - # : Array[String] - # - # source://spoom//lib/spoom/sorbet/config.rb#30 - # @return [Array<String>] - def ignore=(_arg0); end - - # : bool - # - # source://spoom//lib/spoom/sorbet/config.rb#33 - sig { returns(T::Boolean) } - def no_stdlib; end - - # : bool - # - # source://spoom//lib/spoom/sorbet/config.rb#33 - # @return [Boolean] - def no_stdlib=(_arg0); end - - # Returns self as a string of options that can be passed to Sorbet - # - # Example: - # ~~~rb - # config = Sorbet::Config.new - # config.paths << "/foo" - # config.paths << "/bar" - # config.ignore << "/baz" - # config.allowed_extensions << ".rb" - # - # puts config.options_string # "/foo /bar --ignore /baz --allowed-extension .rb" - # ~~~ - # : -> String - # - # source://spoom//lib/spoom/sorbet/config.rb#66 - # Returns self as a string of options that can be passed to Sorbet - # Example: - # ~~~rb - # config = Sorbet::Config.new - # config.paths << "/foo" - # config.paths << "/bar" - # config.ignore << "/baz" - # config.allowed_extensions << ".rb" - # puts config.options_string # "/foo /bar --ignore /baz --allowed-extension .rb" - # ~~~ - sig { returns(::String) } - def options_string; end - - # : Array[String] - # - # source://spoom//lib/spoom/sorbet/config.rb#30 - sig { returns(T::Array[::String]) } - def paths; end - - # : Array[String] - # - # source://spoom//lib/spoom/sorbet/config.rb#30 - # @return [Array<String>] - def paths=(_arg0); end - - class << self - # : (String sorbet_config_path) -> Spoom::Sorbet::Config - # - # source://spoom//lib/spoom/sorbet/config.rb#77 - sig { params(sorbet_config_path: ::String).returns(::Spoom::Sorbet::Config) } - def parse_file(sorbet_config_path); end - - # : (String sorbet_config) -> Spoom::Sorbet::Config - # - # source://spoom//lib/spoom/sorbet/config.rb#82 - sig { params(sorbet_config: ::String).returns(::Spoom::Sorbet::Config) } - def parse_string(sorbet_config); end - - private - - # : (String line) -> String - # - # source://spoom//lib/spoom/sorbet/config.rb#143 - sig { params(line: ::String).returns(::String) } - def parse_option(line); end - end -end - -# source://spoom//lib/spoom/sorbet/config.rb#27 -Spoom::Sorbet::Config::DEFAULT_ALLOWED_EXTENSIONS = T.let(T.unsafe(nil), Array) - -# source://spoom//lib/spoom/sorbet.rb#15 -class Spoom::Sorbet::Error < ::Spoom::Error - # : (String message, ExecResult result) -> void - # - # @return [Error] a new instance of Error - # - # source://spoom//lib/spoom/sorbet.rb#23 - sig { params(message: ::String, result: ::Spoom::ExecResult).void } - def initialize(message, result); end - - # : ExecResult - # - # source://spoom//lib/spoom/sorbet.rb#20 - sig { returns(::Spoom::ExecResult) } - def result; end -end - -# source://spoom//lib/spoom/sorbet.rb#16 -class Spoom::Sorbet::Error::Killed < ::Spoom::Sorbet::Error; end - -# source://spoom//lib/spoom/sorbet.rb#17 -class Spoom::Sorbet::Error::Segfault < ::Spoom::Sorbet::Error; end - -# source://spoom//lib/spoom/sorbet/errors.rb#6 -module Spoom::Sorbet::Errors - class << self - # : (Array[Error] errors) -> Array[Error] - # - # source://spoom//lib/spoom/sorbet/errors.rb#11 - sig { params(errors: T::Array[::Spoom::Sorbet::Errors::Error]).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } - def sort_errors_by_code(errors); end - end -end - -# source://spoom//lib/spoom/sorbet/errors.rb#7 -Spoom::Sorbet::Errors::DEFAULT_ERROR_URL_BASE = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/sorbet/errors.rb#121 -class Spoom::Sorbet::Errors::Error - include ::Comparable - - # : (String? file, Integer? line, String? message, Integer? code, ?Array[String] more) -> void - # - # @return [Error] a new instance of Error - # - # source://spoom//lib/spoom/sorbet/errors.rb#138 - sig do - params( - file: T.nilable(::String), - line: T.nilable(::Integer), - message: T.nilable(::String), - code: T.nilable(::Integer), - more: T::Array[::String] - ).void - end - def initialize(file, line, message, code, more = T.unsafe(nil)); end - - # By default errors are sorted by location - # : (untyped other) -> Integer - # - # source://spoom//lib/spoom/sorbet/errors.rb#149 - # By default errors are sorted by location - sig { params(other: T.untyped).returns(::Integer) } - def <=>(other); end - - # : Integer? - # - # source://spoom//lib/spoom/sorbet/errors.rb#128 - # @return [Integer, nil] - def code; end - - # : String? - # - # source://spoom//lib/spoom/sorbet/errors.rb#125 - sig { returns(T.nilable(::String)) } - def file; end - - # Other files associated with the error - # : Set[String] - # - # source://spoom//lib/spoom/sorbet/errors.rb#135 - # Other files associated with the error - sig { returns(T::Set[::String]) } - def files_from_error_sections; end - - # : Integer? - # - # source://spoom//lib/spoom/sorbet/errors.rb#128 - sig { returns(T.nilable(::Integer)) } - def line; end - - # : String? - # - # source://spoom//lib/spoom/sorbet/errors.rb#125 - # @return [String, nil] - def message; end - - # : Array[String] - # - # source://spoom//lib/spoom/sorbet/errors.rb#131 - sig { returns(T::Array[::String]) } - def more; end - - # : -> String - # - # source://spoom//lib/spoom/sorbet/errors.rb#156 - sig { returns(::String) } - def to_s; end -end - -# Parse errors from Sorbet output -# -# source://spoom//lib/spoom/sorbet/errors.rb#16 -class Spoom::Sorbet::Errors::Parser - # : (?error_url_base: String) -> void - # - # @return [Parser] a new instance of Parser - # - # source://spoom//lib/spoom/sorbet/errors.rb#39 - sig { params(error_url_base: ::String).void } - def initialize(error_url_base: T.unsafe(nil)); end - - # : (String output) -> Array[Error] - # - # source://spoom//lib/spoom/sorbet/errors.rb#46 - sig { params(output: ::String).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } - def parse(output); end - - private - - # : (String line) -> void - # - # @raise [ParseError] - # - # source://spoom//lib/spoom/sorbet/errors.rb#110 - sig { params(line: ::String).void } - def append_error(line); end - - # : -> void - # - # @raise [ParseError] - # - # source://spoom//lib/spoom/sorbet/errors.rb#102 - sig { void } - def close_error; end - - # : (String error_url_base) -> Regexp - # - # source://spoom//lib/spoom/sorbet/errors.rb#69 - sig { params(error_url_base: ::String).returns(::Regexp) } - def error_line_match_regexp(error_url_base); end - - # : (String line) -> Error? - # - # source://spoom//lib/spoom/sorbet/errors.rb#86 - sig { params(line: ::String).returns(T.nilable(::Spoom::Sorbet::Errors::Error)) } - def match_error_line(line); end - - # : (Error error) -> void - # - # @raise [ParseError] - # - # source://spoom//lib/spoom/sorbet/errors.rb#95 - sig { params(error: ::Spoom::Sorbet::Errors::Error).void } - def open_error(error); end - - class << self - # : (String output, ?error_url_base: String) -> Array[Error] - # - # source://spoom//lib/spoom/sorbet/errors.rb#32 - sig { params(output: ::String, error_url_base: ::String).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } - def parse_string(output, error_url_base: T.unsafe(nil)); end - end -end - -# source://spoom//lib/spoom/sorbet/errors.rb#19 -Spoom::Sorbet::Errors::Parser::HEADER = T.let(T.unsafe(nil), Array) - -# source://spoom//lib/spoom/sorbet/errors.rb#17 -class Spoom::Sorbet::Errors::Parser::ParseError < ::Spoom::Error; end - -# source://spoom//lib/spoom/sorbet.rb#31 -Spoom::Sorbet::GEM_PATH = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/sorbet.rb#32 -Spoom::Sorbet::GEM_VERSION = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/sorbet.rb#35 -Spoom::Sorbet::KILLED_CODE = T.let(T.unsafe(nil), Integer) - -# source://spoom//lib/spoom/sorbet/metrics.rb#8 -module Spoom::Sorbet::MetricsParser - class << self - # : (String path, ?String prefix) -> Hash[String, Integer] - # - # source://spoom//lib/spoom/sorbet/metrics.rb#13 - sig { params(path: ::String, prefix: ::String).returns(T::Hash[::String, ::Integer]) } - def parse_file(path, prefix = T.unsafe(nil)); end - - # : (Hash[String, untyped] obj, ?String prefix) -> Hash[String, Integer] - # - # source://spoom//lib/spoom/sorbet/metrics.rb#23 - sig { params(obj: T::Hash[::String, T.untyped], prefix: ::String).returns(T::Hash[::String, ::Integer]) } - def parse_hash(obj, prefix = T.unsafe(nil)); end - - # : (String string, ?String prefix) -> Hash[String, Integer] - # - # source://spoom//lib/spoom/sorbet/metrics.rb#18 - sig { params(string: ::String, prefix: ::String).returns(T::Hash[::String, ::Integer]) } - def parse_string(string, prefix = T.unsafe(nil)); end - end -end - -# source://spoom//lib/spoom/sorbet/metrics.rb#9 -Spoom::Sorbet::MetricsParser::DEFAULT_PREFIX = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/sorbet.rb#36 -Spoom::Sorbet::SEGFAULT_CODE = T.let(T.unsafe(nil), Integer) - -# source://spoom//lib/spoom/sorbet/sigils.rb#9 -module Spoom::Sorbet::Sigils - class << self - # changes the sigil in the file at the passed path to the specified new strictness - # : ((String | Pathname) path, String new_strictness) -> bool - # - # source://spoom//lib/spoom/sorbet/sigils.rb#68 - # changes the sigil in the file at the passed path to the specified new strictness - sig { params(path: T.any(::Pathname, ::String), new_strictness: ::String).returns(T::Boolean) } - def change_sigil_in_file(path, new_strictness); end - - # changes the sigil to have a new strictness in a list of files - # : (Array[String] path_list, String new_strictness) -> Array[String] - # - # source://spoom//lib/spoom/sorbet/sigils.rb#79 - # changes the sigil to have a new strictness in a list of files - sig { params(path_list: T::Array[::String], new_strictness: ::String).returns(T::Array[::String]) } - def change_sigil_in_files(path_list, new_strictness); end - - # returns a string containing the strictness of a sigil in a file at the passed path - # * returns nil if no sigil - # : ((String | Pathname) path) -> String? - # - # source://spoom//lib/spoom/sorbet/sigils.rb#59 - # returns a string containing the strictness of a sigil in a file at the passed path - # * returns nil if no sigil - sig { params(path: T.any(::Pathname, ::String)).returns(T.nilable(::String)) } - def file_strictness(path); end - - # returns the full sigil comment string for the passed strictness - # : (String strictness) -> String - # - # source://spoom//lib/spoom/sorbet/sigils.rb#34 - # returns the full sigil comment string for the passed strictness - sig { params(strictness: ::String).returns(::String) } - def sigil_string(strictness); end - - # returns the strictness of a sigil in the passed file content string (nil if no sigil) - # : (String content) -> String? - # - # source://spoom//lib/spoom/sorbet/sigils.rb#46 - # returns the strictness of a sigil in the passed file content string (nil if no sigil) - sig { params(content: ::String).returns(T.nilable(::String)) } - def strictness_in_content(content); end - - # returns a string which is the passed content but with the sigil updated to a new strictness - # : (String content, String new_strictness) -> String - # - # source://spoom//lib/spoom/sorbet/sigils.rb#52 - # returns a string which is the passed content but with the sigil updated to a new strictness - sig { params(content: ::String, new_strictness: ::String).returns(::String) } - def update_sigil(content, new_strictness); end - - # returns true if the passed string is a valid strictness (else false) - # : (String strictness) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/sorbet/sigils.rb#40 - # returns true if the passed string is a valid strictness (else false) - sig { params(strictness: ::String).returns(T::Boolean) } - def valid_strictness?(strictness); end - end -end - -# source://spoom//lib/spoom/sorbet/sigils.rb#29 -Spoom::Sorbet::Sigils::SIGIL_REGEXP = T.let(T.unsafe(nil), Regexp) - -# source://spoom//lib/spoom/sorbet/sigils.rb#11 -Spoom::Sorbet::Sigils::STRICTNESS_FALSE = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/sorbet/sigils.rb#10 -Spoom::Sorbet::Sigils::STRICTNESS_IGNORE = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/sorbet/sigils.rb#15 -Spoom::Sorbet::Sigils::STRICTNESS_INTERNAL = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/sorbet/sigils.rb#13 -Spoom::Sorbet::Sigils::STRICTNESS_STRICT = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/sorbet/sigils.rb#14 -Spoom::Sorbet::Sigils::STRICTNESS_STRONG = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/sorbet/sigils.rb#12 -Spoom::Sorbet::Sigils::STRICTNESS_TRUE = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/sorbet/sigils.rb#17 -Spoom::Sorbet::Sigils::VALID_STRICTNESS = T.let(T.unsafe(nil), Array) - -# source://spoom//lib/spoom/sorbet/sigs.rb#8 -class Spoom::Sorbet::Sigs - class << self - # : (String ruby_contents, positional_names: bool) -> String - # - # source://spoom//lib/spoom/sorbet/sigs.rb#24 - sig { params(ruby_contents: ::String, positional_names: T::Boolean).returns(::String) } - def rbi_to_rbs(ruby_contents, positional_names: T.unsafe(nil)); end - - # : (String ruby_contents) -> String - # - # source://spoom//lib/spoom/sorbet/sigs.rb#46 - sig { params(ruby_contents: ::String).returns(::String) } - def rbs_to_rbi(ruby_contents); end - - # : (String ruby_contents) -> String - # - # source://spoom//lib/spoom/sorbet/sigs.rb#12 - sig { params(ruby_contents: ::String).returns(::String) } - def strip(ruby_contents); end - - private - - # : (String ruby_contents) -> Array[[RBI::RBSComment, (RBI::Method | RBI::Attr)]] - # - # source://spoom//lib/spoom/sorbet/sigs.rb#80 - sig { params(ruby_contents: ::String).returns(T::Array[[::RBI::RBSComment, T.any(::RBI::Attr, ::RBI::Method)]]) } - def collect_rbs_comments(ruby_contents); end - - # : (String ruby_contents) -> Array[[RBI::Sig, (RBI::Method | RBI::Attr)]] - # - # source://spoom//lib/spoom/sorbet/sigs.rb#72 - sig { params(ruby_contents: ::String).returns(T::Array[[::RBI::Sig, T.any(::RBI::Attr, ::RBI::Method)]]) } - def collect_sorbet_sigs(ruby_contents); end - end -end - -# source://spoom//lib/spoom/sorbet/sigs.rb#9 -class Spoom::Sorbet::Sigs::Error < ::Spoom::Error; end - -# source://spoom//lib/spoom/sorbet/sigs.rb#123 -class Spoom::Sorbet::Sigs::RBIToRBSTranslator - class << self - # : (RBI::Sig sig, (RBI::Method | RBI::Attr) node, positional_names: bool) -> String - # - # source://spoom//lib/spoom/sorbet/sigs.rb#126 - sig do - params( - sig: ::RBI::Sig, - node: T.any(::RBI::Attr, ::RBI::Method), - positional_names: T::Boolean - ).returns(::String) - end - def translate(sig, node, positional_names: T.unsafe(nil)); end - - private - - # : (RBI::Sig sig, RBI::Attr node, positional_names: bool) -> String - # - # source://spoom//lib/spoom/sorbet/sigs.rb#173 - sig { params(sig: ::RBI::Sig, node: ::RBI::Attr, positional_names: T::Boolean).returns(::String) } - def translate_attr_sig(sig, node, positional_names: T.unsafe(nil)); end - - # : (RBI::Sig sig, RBI::Method node, positional_names: bool) -> String - # - # source://spoom//lib/spoom/sorbet/sigs.rb#138 - sig { params(sig: ::RBI::Sig, node: ::RBI::Method, positional_names: T::Boolean).returns(::String) } - def translate_method_sig(sig, node, positional_names: T.unsafe(nil)); end - end -end - -# source://spoom//lib/spoom/sorbet/sigs.rb#182 -class Spoom::Sorbet::Sigs::RBSToRBITranslator - class << self - # : (RBI::RBSComment comment, (RBI::Method | RBI::Attr) node) -> String? - # - # source://spoom//lib/spoom/sorbet/sigs.rb#187 - sig { params(comment: ::RBI::RBSComment, node: T.any(::RBI::Attr, ::RBI::Method)).returns(T.nilable(::String)) } - def translate(comment, node); end - - private - - # : (RBI::RBSComment comment, RBI::Attr node) -> String - # - # source://spoom//lib/spoom/sorbet/sigs.rb#228 - sig { params(comment: ::RBI::RBSComment, node: ::RBI::Attr).returns(::String) } - def translate_attr_sig(comment, node); end - - # : (RBI::RBSComment rbs_comment, RBI::Method node) -> String - # - # source://spoom//lib/spoom/sorbet/sigs.rb#201 - sig { params(rbs_comment: ::RBI::RBSComment, node: ::RBI::Method).returns(::String) } - def translate_method_sig(rbs_comment, node); end - end -end - -# From https://github.com/Shopify/ruby-lsp/blob/9154bfc6ef/lib/ruby_lsp/document.rb#L127 -# -# source://spoom//lib/spoom/sorbet/sigs.rb#248 -class Spoom::Sorbet::Sigs::Scanner - # : (String source) -> void - # - # @return [Scanner] a new instance of Scanner - # - # source://spoom//lib/spoom/sorbet/sigs.rb#252 - sig { params(source: ::String).void } - def initialize(source); end - - # Finds the character index inside the source string for a given line and column - # : (Integer line, Integer character) -> Integer - # - # source://spoom//lib/spoom/sorbet/sigs.rb#260 - # Finds the character index inside the source string for a given line and column - sig { params(line: ::Integer, character: ::Integer).returns(::Integer) } - def find_char_position(line, character); end -end - -# source://spoom//lib/spoom/sorbet/sigs.rb#249 -Spoom::Sorbet::Sigs::Scanner::LINE_BREAK = T.let(T.unsafe(nil), Integer) - -# source://spoom//lib/spoom/sorbet/sigs.rb#88 -class Spoom::Sorbet::Sigs::SigsLocator < ::RBI::Visitor - # : -> void - # - # @return [SigsLocator] a new instance of SigsLocator - # - # source://spoom//lib/spoom/sorbet/sigs.rb#96 - sig { void } - def initialize; end - - # : Array[[RBI::RBSComment, (RBI::Method | RBI::Attr)]] - # - # source://spoom//lib/spoom/sorbet/sigs.rb#93 - sig { returns(T::Array[[::RBI::RBSComment, T.any(::RBI::Attr, ::RBI::Method)]]) } - def rbs_comments; end - - # : Array[[RBI::Sig, (RBI::Method | RBI::Attr)]] - # - # source://spoom//lib/spoom/sorbet/sigs.rb#90 - sig { returns(T::Array[[::RBI::Sig, T.any(::RBI::Attr, ::RBI::Method)]]) } - def sigs; end - - # : (RBI::Node? node) -> void - # - # source://spoom//lib/spoom/sorbet/sigs.rb#104 - sig { override.params(node: T.nilable(::RBI::Node)).void } - def visit(node); end -end - -# source://spoom//lib/spoom/timeline.rb#5 -class Spoom::Timeline - # : (Context context, Time from, Time to) -> void - # - # @return [Timeline] a new instance of Timeline - # - # source://spoom//lib/spoom/timeline.rb#7 - sig { params(context: ::Spoom::Context, from: ::Time, to: ::Time).void } - def initialize(context, from, to); end - - # Return one commit for each date in `dates` - # : (Array[Time] dates) -> Array[Git::Commit] - # - # source://spoom//lib/spoom/timeline.rb#34 - # Return one commit for each date in `dates` - sig { params(dates: T::Array[::Time]).returns(T::Array[::Spoom::Git::Commit]) } - def commits_for_dates(dates); end - - # Return all months between `from` and `to` - # : -> Array[Time] - # - # source://spoom//lib/spoom/timeline.rb#21 - # Return all months between `from` and `to` - sig { returns(T::Array[::Time]) } - def months; end - - # Return one commit for each month between `from` and `to` - # : -> Array[Git::Commit] - # - # source://spoom//lib/spoom/timeline.rb#15 - # Return one commit for each month between `from` and `to` - sig { returns(T::Array[::Spoom::Git::Commit]) } - def ticks; end -end - -# source://spoom//lib/spoom/version.rb#5 -Spoom::VERSION = T.let(T.unsafe(nil), String) - -# source://spoom//lib/spoom/visitor.rb#7 -class Spoom::Visitor < ::Prism::Visitor - # : (Prism::AliasGlobalVariableNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#16 - sig { override.params(node: ::Prism::AliasGlobalVariableNode).void } - def visit_alias_global_variable_node(node); end - - # : (Prism::AliasMethodNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#22 - sig { override.params(node: ::Prism::AliasMethodNode).void } - def visit_alias_method_node(node); end - - # : (Prism::AlternationPatternNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#28 - sig { override.params(node: ::Prism::AlternationPatternNode).void } - def visit_alternation_pattern_node(node); end - - # : (Prism::AndNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#34 - sig { override.params(node: ::Prism::AndNode).void } - def visit_and_node(node); end - - # : (Prism::ArgumentsNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#40 - sig { override.params(node: ::Prism::ArgumentsNode).void } - def visit_arguments_node(node); end - - # : (Prism::ArrayNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#46 - sig { override.params(node: ::Prism::ArrayNode).void } - def visit_array_node(node); end - - # : (Prism::ArrayPatternNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#52 - sig { override.params(node: ::Prism::ArrayPatternNode).void } - def visit_array_pattern_node(node); end - - # : (Prism::AssocNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#58 - sig { override.params(node: ::Prism::AssocNode).void } - def visit_assoc_node(node); end - - # : (Prism::AssocSplatNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#64 - sig { override.params(node: ::Prism::AssocSplatNode).void } - def visit_assoc_splat_node(node); end - - # : (Prism::BackReferenceReadNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#70 - sig { override.params(node: ::Prism::BackReferenceReadNode).void } - def visit_back_reference_read_node(node); end - - # : (Prism::BeginNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#76 - sig { override.params(node: ::Prism::BeginNode).void } - def visit_begin_node(node); end - - # : (Prism::BlockArgumentNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#82 - sig { override.params(node: ::Prism::BlockArgumentNode).void } - def visit_block_argument_node(node); end - - # : (Prism::BlockLocalVariableNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#88 - sig { override.params(node: ::Prism::BlockLocalVariableNode).void } - def visit_block_local_variable_node(node); end - - # : (Prism::BlockNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#94 - sig { override.params(node: ::Prism::BlockNode).void } - def visit_block_node(node); end - - # : (Prism::BlockParameterNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#100 - sig { override.params(node: ::Prism::BlockParameterNode).void } - def visit_block_parameter_node(node); end - - # : (Prism::BlockParametersNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#106 - sig { override.params(node: ::Prism::BlockParametersNode).void } - def visit_block_parameters_node(node); end - - # : (Prism::BreakNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#112 - sig { override.params(node: ::Prism::BreakNode).void } - def visit_break_node(node); end - - # : (Prism::CallAndWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#118 - sig { override.params(node: ::Prism::CallAndWriteNode).void } - def visit_call_and_write_node(node); end - - # : (Prism::CallNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#124 - sig { override.params(node: ::Prism::CallNode).void } - def visit_call_node(node); end - - # : (Prism::CallOperatorWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#130 - sig { override.params(node: ::Prism::CallOperatorWriteNode).void } - def visit_call_operator_write_node(node); end - - # : (Prism::CallOrWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#136 - sig { override.params(node: ::Prism::CallOrWriteNode).void } - def visit_call_or_write_node(node); end - - # : (Prism::CallTargetNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#142 - sig { override.params(node: ::Prism::CallTargetNode).void } - def visit_call_target_node(node); end - - # : (Prism::CapturePatternNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#148 - sig { override.params(node: ::Prism::CapturePatternNode).void } - def visit_capture_pattern_node(node); end - - # : (Prism::CaseMatchNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#154 - sig { override.params(node: ::Prism::CaseMatchNode).void } - def visit_case_match_node(node); end - - # : (Prism::CaseNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#160 - sig { override.params(node: ::Prism::CaseNode).void } - def visit_case_node(node); end - - # : (Prism::Node node) -> void - # - # source://spoom//lib/spoom/visitor.rb#10 - sig { override.params(node: ::Prism::Node).void } - def visit_child_nodes(node); end - - # : (Prism::ClassNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#166 - sig { override.params(node: ::Prism::ClassNode).void } - def visit_class_node(node); end - - # : (Prism::ClassVariableAndWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#172 - sig { override.params(node: ::Prism::ClassVariableAndWriteNode).void } - def visit_class_variable_and_write_node(node); end - - # : (Prism::ClassVariableOperatorWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#178 - sig { override.params(node: ::Prism::ClassVariableOperatorWriteNode).void } - def visit_class_variable_operator_write_node(node); end - - # : (Prism::ClassVariableOrWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#184 - sig { override.params(node: ::Prism::ClassVariableOrWriteNode).void } - def visit_class_variable_or_write_node(node); end - - # : (Prism::ClassVariableReadNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#190 - sig { override.params(node: ::Prism::ClassVariableReadNode).void } - def visit_class_variable_read_node(node); end - - # : (Prism::ClassVariableTargetNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#196 - sig { override.params(node: ::Prism::ClassVariableTargetNode).void } - def visit_class_variable_target_node(node); end - - # : (Prism::ClassVariableWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#202 - sig { override.params(node: ::Prism::ClassVariableWriteNode).void } - def visit_class_variable_write_node(node); end - - # : (Prism::ConstantAndWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#208 - sig { override.params(node: ::Prism::ConstantAndWriteNode).void } - def visit_constant_and_write_node(node); end - - # : (Prism::ConstantOperatorWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#214 - sig { override.params(node: ::Prism::ConstantOperatorWriteNode).void } - def visit_constant_operator_write_node(node); end - - # : (Prism::ConstantOrWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#220 - sig { override.params(node: ::Prism::ConstantOrWriteNode).void } - def visit_constant_or_write_node(node); end - - # : (Prism::ConstantPathAndWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#226 - sig { override.params(node: ::Prism::ConstantPathAndWriteNode).void } - def visit_constant_path_and_write_node(node); end - - # : (Prism::ConstantPathNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#232 - sig { override.params(node: ::Prism::ConstantPathNode).void } - def visit_constant_path_node(node); end - - # : (Prism::ConstantPathOperatorWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#238 - sig { override.params(node: ::Prism::ConstantPathOperatorWriteNode).void } - def visit_constant_path_operator_write_node(node); end - - # : (Prism::ConstantPathOrWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#244 - sig { override.params(node: ::Prism::ConstantPathOrWriteNode).void } - def visit_constant_path_or_write_node(node); end - - # : (Prism::ConstantPathTargetNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#250 - sig { override.params(node: ::Prism::ConstantPathTargetNode).void } - def visit_constant_path_target_node(node); end - - # : (Prism::ConstantPathWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#256 - sig { override.params(node: ::Prism::ConstantPathWriteNode).void } - def visit_constant_path_write_node(node); end - - # : (Prism::ConstantReadNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#262 - sig { override.params(node: ::Prism::ConstantReadNode).void } - def visit_constant_read_node(node); end - - # : (Prism::ConstantTargetNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#268 - sig { override.params(node: ::Prism::ConstantTargetNode).void } - def visit_constant_target_node(node); end - - # : (Prism::ConstantWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#274 - sig { override.params(node: ::Prism::ConstantWriteNode).void } - def visit_constant_write_node(node); end - - # : (Prism::DefNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#280 - sig { override.params(node: ::Prism::DefNode).void } - def visit_def_node(node); end - - # : (Prism::DefinedNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#286 - sig { override.params(node: ::Prism::DefinedNode).void } - def visit_defined_node(node); end - - # : (Prism::ElseNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#292 - sig { override.params(node: ::Prism::ElseNode).void } - def visit_else_node(node); end - - # : (Prism::EmbeddedStatementsNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#298 - sig { override.params(node: ::Prism::EmbeddedStatementsNode).void } - def visit_embedded_statements_node(node); end - - # : (Prism::EmbeddedVariableNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#304 - sig { override.params(node: ::Prism::EmbeddedVariableNode).void } - def visit_embedded_variable_node(node); end - - # : (Prism::EnsureNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#310 - sig { override.params(node: ::Prism::EnsureNode).void } - def visit_ensure_node(node); end - - # : (Prism::FalseNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#316 - sig { override.params(node: ::Prism::FalseNode).void } - def visit_false_node(node); end - - # : (Prism::FindPatternNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#322 - sig { override.params(node: ::Prism::FindPatternNode).void } - def visit_find_pattern_node(node); end - - # : (Prism::FlipFlopNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#328 - sig { override.params(node: ::Prism::FlipFlopNode).void } - def visit_flip_flop_node(node); end - - # : (Prism::FloatNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#334 - sig { override.params(node: ::Prism::FloatNode).void } - def visit_float_node(node); end - - # : (Prism::ForNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#340 - sig { override.params(node: ::Prism::ForNode).void } - def visit_for_node(node); end - - # : (Prism::ForwardingArgumentsNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#346 - sig { override.params(node: ::Prism::ForwardingArgumentsNode).void } - def visit_forwarding_arguments_node(node); end - - # : (Prism::ForwardingParameterNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#352 - sig { override.params(node: ::Prism::ForwardingParameterNode).void } - def visit_forwarding_parameter_node(node); end - - # : (Prism::ForwardingSuperNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#358 - sig { override.params(node: ::Prism::ForwardingSuperNode).void } - def visit_forwarding_super_node(node); end - - # : (Prism::GlobalVariableAndWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#364 - sig { override.params(node: ::Prism::GlobalVariableAndWriteNode).void } - def visit_global_variable_and_write_node(node); end - - # : (Prism::GlobalVariableOperatorWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#370 - sig { override.params(node: ::Prism::GlobalVariableOperatorWriteNode).void } - def visit_global_variable_operator_write_node(node); end - - # : (Prism::GlobalVariableOrWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#376 - sig { override.params(node: ::Prism::GlobalVariableOrWriteNode).void } - def visit_global_variable_or_write_node(node); end - - # : (Prism::GlobalVariableReadNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#382 - sig { override.params(node: ::Prism::GlobalVariableReadNode).void } - def visit_global_variable_read_node(node); end - - # : (Prism::GlobalVariableTargetNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#388 - sig { override.params(node: ::Prism::GlobalVariableTargetNode).void } - def visit_global_variable_target_node(node); end - - # : (Prism::GlobalVariableWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#394 - sig { override.params(node: ::Prism::GlobalVariableWriteNode).void } - def visit_global_variable_write_node(node); end - - # : (Prism::HashNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#400 - sig { override.params(node: ::Prism::HashNode).void } - def visit_hash_node(node); end - - # : (Prism::HashPatternNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#406 - sig { override.params(node: ::Prism::HashPatternNode).void } - def visit_hash_pattern_node(node); end - - # : (Prism::IfNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#412 - sig { override.params(node: ::Prism::IfNode).void } - def visit_if_node(node); end - - # : (Prism::ImaginaryNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#418 - sig { override.params(node: ::Prism::ImaginaryNode).void } - def visit_imaginary_node(node); end - - # : (Prism::ImplicitNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#424 - sig { override.params(node: ::Prism::ImplicitNode).void } - def visit_implicit_node(node); end - - # : (Prism::ImplicitRestNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#430 - sig { override.params(node: ::Prism::ImplicitRestNode).void } - def visit_implicit_rest_node(node); end - - # : (Prism::InNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#436 - sig { override.params(node: ::Prism::InNode).void } - def visit_in_node(node); end - - # : (Prism::IndexAndWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#442 - sig { override.params(node: ::Prism::IndexAndWriteNode).void } - def visit_index_and_write_node(node); end - - # : (Prism::IndexOperatorWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#448 - sig { override.params(node: ::Prism::IndexOperatorWriteNode).void } - def visit_index_operator_write_node(node); end - - # : (Prism::IndexOrWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#454 - sig { override.params(node: ::Prism::IndexOrWriteNode).void } - def visit_index_or_write_node(node); end - - # : (Prism::IndexTargetNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#460 - sig { override.params(node: ::Prism::IndexTargetNode).void } - def visit_index_target_node(node); end - - # : (Prism::InstanceVariableAndWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#466 - sig { override.params(node: ::Prism::InstanceVariableAndWriteNode).void } - def visit_instance_variable_and_write_node(node); end - - # : (Prism::InstanceVariableOperatorWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#472 - sig { override.params(node: ::Prism::InstanceVariableOperatorWriteNode).void } - def visit_instance_variable_operator_write_node(node); end - - # : (Prism::InstanceVariableOrWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#478 - sig { override.params(node: ::Prism::InstanceVariableOrWriteNode).void } - def visit_instance_variable_or_write_node(node); end - - # : (Prism::InstanceVariableReadNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#484 - sig { override.params(node: ::Prism::InstanceVariableReadNode).void } - def visit_instance_variable_read_node(node); end - - # : (Prism::InstanceVariableTargetNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#490 - sig { override.params(node: ::Prism::InstanceVariableTargetNode).void } - def visit_instance_variable_target_node(node); end - - # : (Prism::InstanceVariableWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#496 - sig { override.params(node: ::Prism::InstanceVariableWriteNode).void } - def visit_instance_variable_write_node(node); end - - # : (Prism::IntegerNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#502 - sig { override.params(node: ::Prism::IntegerNode).void } - def visit_integer_node(node); end - - # : (Prism::InterpolatedMatchLastLineNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#508 - sig { override.params(node: ::Prism::InterpolatedMatchLastLineNode).void } - def visit_interpolated_match_last_line_node(node); end - - # : (Prism::InterpolatedRegularExpressionNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#514 - sig { override.params(node: ::Prism::InterpolatedRegularExpressionNode).void } - def visit_interpolated_regular_expression_node(node); end - - # : (Prism::InterpolatedStringNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#520 - sig { override.params(node: ::Prism::InterpolatedStringNode).void } - def visit_interpolated_string_node(node); end - - # : (Prism::InterpolatedSymbolNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#526 - sig { override.params(node: ::Prism::InterpolatedSymbolNode).void } - def visit_interpolated_symbol_node(node); end - - # : (Prism::InterpolatedXStringNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#532 - sig { override.params(node: ::Prism::InterpolatedXStringNode).void } - def visit_interpolated_x_string_node(node); end - - # : (Prism::KeywordHashNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#538 - sig { override.params(node: ::Prism::KeywordHashNode).void } - def visit_keyword_hash_node(node); end - - # : (Prism::KeywordRestParameterNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#544 - sig { override.params(node: ::Prism::KeywordRestParameterNode).void } - def visit_keyword_rest_parameter_node(node); end - - # : (Prism::LambdaNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#550 - sig { override.params(node: ::Prism::LambdaNode).void } - def visit_lambda_node(node); end - - # : (Prism::LocalVariableAndWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#556 - sig { override.params(node: ::Prism::LocalVariableAndWriteNode).void } - def visit_local_variable_and_write_node(node); end - - # : (Prism::LocalVariableOperatorWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#562 - sig { override.params(node: ::Prism::LocalVariableOperatorWriteNode).void } - def visit_local_variable_operator_write_node(node); end - - # : (Prism::LocalVariableOrWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#568 - sig { override.params(node: ::Prism::LocalVariableOrWriteNode).void } - def visit_local_variable_or_write_node(node); end - - # : (Prism::LocalVariableReadNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#574 - sig { override.params(node: ::Prism::LocalVariableReadNode).void } - def visit_local_variable_read_node(node); end - - # : (Prism::LocalVariableTargetNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#580 - sig { override.params(node: ::Prism::LocalVariableTargetNode).void } - def visit_local_variable_target_node(node); end - - # : (Prism::LocalVariableWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#586 - sig { override.params(node: ::Prism::LocalVariableWriteNode).void } - def visit_local_variable_write_node(node); end - - # : (Prism::MatchLastLineNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#592 - sig { override.params(node: ::Prism::MatchLastLineNode).void } - def visit_match_last_line_node(node); end - - # : (Prism::MatchPredicateNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#598 - sig { override.params(node: ::Prism::MatchPredicateNode).void } - def visit_match_predicate_node(node); end - - # : (Prism::MatchRequiredNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#604 - sig { override.params(node: ::Prism::MatchRequiredNode).void } - def visit_match_required_node(node); end - - # : (Prism::MatchWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#610 - sig { override.params(node: ::Prism::MatchWriteNode).void } - def visit_match_write_node(node); end - - # : (Prism::MissingNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#616 - sig { override.params(node: ::Prism::MissingNode).void } - def visit_missing_node(node); end - - # : (Prism::ModuleNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#622 - sig { override.params(node: ::Prism::ModuleNode).void } - def visit_module_node(node); end - - # : (Prism::MultiTargetNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#628 - sig { override.params(node: ::Prism::MultiTargetNode).void } - def visit_multi_target_node(node); end - - # : (Prism::MultiWriteNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#634 - sig { override.params(node: ::Prism::MultiWriteNode).void } - def visit_multi_write_node(node); end - - # : (Prism::NextNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#640 - sig { override.params(node: ::Prism::NextNode).void } - def visit_next_node(node); end - - # : (Prism::NilNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#646 - sig { override.params(node: ::Prism::NilNode).void } - def visit_nil_node(node); end - - # : (Prism::NoKeywordsParameterNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#652 - sig { override.params(node: ::Prism::NoKeywordsParameterNode).void } - def visit_no_keywords_parameter_node(node); end - - # : (Prism::NumberedParametersNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#658 - sig { override.params(node: ::Prism::NumberedParametersNode).void } - def visit_numbered_parameters_node(node); end - - # : (Prism::NumberedReferenceReadNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#664 - sig { override.params(node: ::Prism::NumberedReferenceReadNode).void } - def visit_numbered_reference_read_node(node); end - - # : (Prism::OptionalKeywordParameterNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#670 - sig { override.params(node: ::Prism::OptionalKeywordParameterNode).void } - def visit_optional_keyword_parameter_node(node); end - - # : (Prism::OptionalParameterNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#676 - sig { override.params(node: ::Prism::OptionalParameterNode).void } - def visit_optional_parameter_node(node); end - - # : (Prism::OrNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#682 - sig { override.params(node: ::Prism::OrNode).void } - def visit_or_node(node); end - - # : (Prism::ParametersNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#688 - sig { override.params(node: ::Prism::ParametersNode).void } - def visit_parameters_node(node); end - - # : (Prism::ParenthesesNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#694 - sig { override.params(node: ::Prism::ParenthesesNode).void } - def visit_parentheses_node(node); end - - # : (Prism::PinnedExpressionNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#700 - sig { override.params(node: ::Prism::PinnedExpressionNode).void } - def visit_pinned_expression_node(node); end - - # : (Prism::PinnedVariableNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#706 - sig { override.params(node: ::Prism::PinnedVariableNode).void } - def visit_pinned_variable_node(node); end - - # : (Prism::PostExecutionNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#712 - sig { override.params(node: ::Prism::PostExecutionNode).void } - def visit_post_execution_node(node); end - - # : (Prism::PreExecutionNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#718 - sig { override.params(node: ::Prism::PreExecutionNode).void } - def visit_pre_execution_node(node); end - - # : (Prism::ProgramNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#724 - sig { override.params(node: ::Prism::ProgramNode).void } - def visit_program_node(node); end - - # : (Prism::RangeNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#730 - sig { override.params(node: ::Prism::RangeNode).void } - def visit_range_node(node); end - - # : (Prism::RationalNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#736 - sig { override.params(node: ::Prism::RationalNode).void } - def visit_rational_node(node); end - - # : (Prism::RedoNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#742 - sig { override.params(node: ::Prism::RedoNode).void } - def visit_redo_node(node); end - - # : (Prism::RegularExpressionNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#748 - sig { override.params(node: ::Prism::RegularExpressionNode).void } - def visit_regular_expression_node(node); end - - # : (Prism::RequiredKeywordParameterNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#754 - sig { override.params(node: ::Prism::RequiredKeywordParameterNode).void } - def visit_required_keyword_parameter_node(node); end - - # : (Prism::RequiredParameterNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#760 - sig { override.params(node: ::Prism::RequiredParameterNode).void } - def visit_required_parameter_node(node); end - - # : (Prism::RescueModifierNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#766 - sig { override.params(node: ::Prism::RescueModifierNode).void } - def visit_rescue_modifier_node(node); end - - # : (Prism::RescueNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#772 - sig { override.params(node: ::Prism::RescueNode).void } - def visit_rescue_node(node); end - - # : (Prism::RestParameterNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#778 - sig { override.params(node: ::Prism::RestParameterNode).void } - def visit_rest_parameter_node(node); end - - # : (Prism::RetryNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#784 - sig { override.params(node: ::Prism::RetryNode).void } - def visit_retry_node(node); end - - # : (Prism::ReturnNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#790 - sig { override.params(node: ::Prism::ReturnNode).void } - def visit_return_node(node); end - - # : (Prism::SelfNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#796 - sig { override.params(node: ::Prism::SelfNode).void } - def visit_self_node(node); end - - # : (Prism::SingletonClassNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#802 - sig { override.params(node: ::Prism::SingletonClassNode).void } - def visit_singleton_class_node(node); end - - # : (Prism::SourceEncodingNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#808 - sig { override.params(node: ::Prism::SourceEncodingNode).void } - def visit_source_encoding_node(node); end - - # : (Prism::SourceFileNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#814 - sig { override.params(node: ::Prism::SourceFileNode).void } - def visit_source_file_node(node); end - - # : (Prism::SourceLineNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#820 - sig { override.params(node: ::Prism::SourceLineNode).void } - def visit_source_line_node(node); end - - # : (Prism::SplatNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#826 - sig { override.params(node: ::Prism::SplatNode).void } - def visit_splat_node(node); end - - # : (Prism::StatementsNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#832 - sig { override.params(node: ::Prism::StatementsNode).void } - def visit_statements_node(node); end - - # : (Prism::StringNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#838 - sig { override.params(node: ::Prism::StringNode).void } - def visit_string_node(node); end - - # : (Prism::SuperNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#844 - sig { override.params(node: ::Prism::SuperNode).void } - def visit_super_node(node); end - - # : (Prism::SymbolNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#850 - sig { override.params(node: ::Prism::SymbolNode).void } - def visit_symbol_node(node); end - - # : (Prism::TrueNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#856 - sig { override.params(node: ::Prism::TrueNode).void } - def visit_true_node(node); end - - # : (Prism::UndefNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#862 - sig { override.params(node: ::Prism::UndefNode).void } - def visit_undef_node(node); end - - # : (Prism::UnlessNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#868 - sig { override.params(node: ::Prism::UnlessNode).void } - def visit_unless_node(node); end - - # : (Prism::UntilNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#874 - sig { override.params(node: ::Prism::UntilNode).void } - def visit_until_node(node); end - - # : (Prism::WhenNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#880 - sig { override.params(node: ::Prism::WhenNode).void } - def visit_when_node(node); end - - # : (Prism::WhileNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#886 - sig { override.params(node: ::Prism::WhileNode).void } - def visit_while_node(node); end - - # : (Prism::XStringNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#892 - sig { override.params(node: ::Prism::XStringNode).void } - def visit_x_string_node(node); end - - # : (Prism::YieldNode node) -> void - # - # source://spoom//lib/spoom/visitor.rb#898 - sig { override.params(node: ::Prism::YieldNode).void } - def visit_yield_node(node); end -end diff --git a/sorbet/rbi/gems/spoom@1.7.13.rbi b/sorbet/rbi/gems/spoom@1.7.13.rbi new file mode 100644 index 0000000..bc416d2 --- /dev/null +++ b/sorbet/rbi/gems/spoom@1.7.13.rbi @@ -0,0 +1,6151 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `spoom` gem. +# Please instead update this file by running `bin/tapioca gem spoom`. + + +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `spoom` gem. +# Please instead update this file by running `bundle exec spoom srb sigs export`. + +# Copied from https://github.com/rails/rails/blob/main/actionview/lib/action_view/template/handlers/erb/erubi.rb. +# +# Copyright (c) David Heinemeier Hansson +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# where "strictness" represents the level at which Sorbet will report errors +# See https://sorbet.org/docs/static for a more complete explanation +# +# pkg:gem/spoom#lib/spoom.rb:7 +module Spoom + class << self + # pkg:gem/spoom#lib/spoom/parse.rb:11 + sig { params(ruby: ::String, file: ::String).returns([::Prism::Node, T::Array[::Prism::Comment]]) } + def parse_ruby(ruby, file:); end + end +end + +# pkg:gem/spoom#lib/spoom/bundler_helper.rb:5 +module Spoom::BundlerHelper + class << self + # Generate a gem requirement for the given gem name, using that gem's version in the "real" current bundle. + # + # This ensures that any child Spoom::Contexts use predictable gem versions, + # without having to manually specify them and bump them to stay in sync with Spoom's real Gemfile. + # + # Given `"foo"`, returns a string like 'gem "foo", "= 1.2.3"', suitable for inserting into a Gemfile. + # + # pkg:gem/spoom#lib/spoom/bundler_helper.rb:14 + sig { params(gem_name: ::String).returns(::String) } + def gem_requirement_from_real_bundle(gem_name); end + end +end + +# pkg:gem/spoom#lib/spoom/cli/helper.rb:9 +module Spoom::Cli; end + +# pkg:gem/spoom#lib/spoom/cli/deadcode.rb:8 +class Spoom::Cli::Deadcode < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # pkg:gem/spoom#lib/spoom/cli/deadcode.rb:51 + sig { params(paths: ::String).void } + def deadcode(*paths); end + + # pkg:gem/spoom#lib/spoom/cli.rb:71 + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/cli/deadcode.rb:153 + def remove(location_string); end +end + +# pkg:gem/spoom#lib/spoom/cli/helper.rb:11 +module Spoom::Cli::Helper + include ::Spoom::Colorize + + requires_ancestor { Thor } + + # pkg:gem/spoom#lib/spoom/cli/helper.rb:146 + sig { params(string: ::String).returns(::String) } + def blue(string); end + + # Collect files from `paths`, defaulting to `exec_path` + # + # pkg:gem/spoom#lib/spoom/cli/helper.rb:82 + sig { params(paths: T::Array[::String], include_rbi_files: T::Boolean).returns(T::Array[::String]) } + def collect_files(paths, include_rbi_files: T.unsafe(nil)); end + + # Is the `--color` option true? + # + # pkg:gem/spoom#lib/spoom/cli/helper.rb:110 + sig { returns(T::Boolean) } + def color?; end + + # Colorize a string if `color?` + # + # pkg:gem/spoom#lib/spoom/cli/helper.rb:139 + sig { params(string: ::String, color: ::Spoom::Color).returns(::String) } + def colorize(string, *color); end + + # Returns the context at `--path` (by default the current working directory) + # + # pkg:gem/spoom#lib/spoom/cli/helper.rb:55 + sig { returns(::Spoom::Context) } + def context; end + + # Raise if `spoom` is not ran inside a context with a `sorbet/config` file + # + # pkg:gem/spoom#lib/spoom/cli/helper.rb:61 + sig { returns(::Spoom::Context) } + def context_requiring_sorbet!; end + + # pkg:gem/spoom#lib/spoom/cli/helper.rb:151 + sig { params(string: ::String).returns(::String) } + def cyan(string); end + + # Return the path specified through `--path` + # + # pkg:gem/spoom#lib/spoom/cli/helper.rb:76 + sig { returns(::String) } + def exec_path; end + + # pkg:gem/spoom#lib/spoom/cli/helper.rb:156 + sig { params(string: ::String).returns(::String) } + def gray(string); end + + # pkg:gem/spoom#lib/spoom/cli/helper.rb:161 + sig { params(string: ::String).returns(::String) } + def green(string); end + + # pkg:gem/spoom#lib/spoom/cli/helper.rb:115 + sig { params(string: ::String).returns(::String) } + def highlight(string); end + + # pkg:gem/spoom#lib/spoom/cli/helper.rb:166 + sig { params(string: ::String).returns(::String) } + def red(string); end + + # Print `message` on `$stdout` + # + # pkg:gem/spoom#lib/spoom/cli/helper.rb:16 + sig { params(message: ::String).void } + def say(message); end + + # Print `message` on `$stderr` + # + # The message is prefixed by a status (default: `Error`). + # + # pkg:gem/spoom#lib/spoom/cli/helper.rb:29 + sig { params(message: ::String, status: T.nilable(::String), nl: T::Boolean).void } + def say_error(message, status: T.unsafe(nil), nl: T.unsafe(nil)); end + + # Print `message` on `$stderr` + # + # The message is prefixed by a status (default: `Warning`). + # + # pkg:gem/spoom#lib/spoom/cli/helper.rb:43 + sig { params(message: ::String, status: T.nilable(::String), nl: T::Boolean).void } + def say_warning(message, status: T.unsafe(nil), nl: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/cli/helper.rb:171 + sig { params(string: ::String).returns(::String) } + def yellow(string); end +end + +# pkg:gem/spoom#lib/spoom/cli.rb:12 +class Spoom::Cli::Main < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # pkg:gem/spoom#lib/spoom/cli.rb:100 + def __print_version; end + + # pkg:gem/spoom#lib/spoom/cli.rb:57 + sig { params(directory: ::String).void } + def bump(directory = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/cli.rb:64 + def coverage(*args); end + + # pkg:gem/spoom#lib/spoom/cli.rb:71 + def deadcode(*args); end + + # pkg:gem/spoom#lib/spoom/cli.rb:74 + def lsp(*args); end + + # pkg:gem/spoom#lib/spoom/cli.rb:21 + def srb(*args); end + + # pkg:gem/spoom#lib/spoom/cli.rb:93 + def tc(*paths_to_select); end + + class << self + # pkg:gem/spoom#lib/spoom/cli.rb:107 + def exit_on_failure?; end + end +end + +# pkg:gem/spoom#lib/spoom/cli.rb:80 +Spoom::Cli::Main::SORT_CODE = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/cli.rb:82 +Spoom::Cli::Main::SORT_ENUM = T.let(T.unsafe(nil), Array) + +# pkg:gem/spoom#lib/spoom/cli.rb:81 +Spoom::Cli::Main::SORT_LOC = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/cli/srb/assertions.rb:6 +module Spoom::Cli::Srb; end + +# pkg:gem/spoom#lib/spoom/cli/srb/assertions.rb:7 +class Spoom::Cli::Srb::Assertions < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # pkg:gem/spoom#lib/spoom/cli/srb.rb:17 + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/cli/srb/assertions.rb:42 + def transform_files(files, &block); end + + # pkg:gem/spoom#lib/spoom/cli/srb/assertions.rb:18 + def translate(*paths); end +end + +# pkg:gem/spoom#lib/spoom/cli/srb/bump.rb:10 +class Spoom::Cli::Srb::Bump < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # pkg:gem/spoom#lib/spoom/cli/srb/bump.rb:49 + sig { params(directory: ::String).void } + def bump(directory = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/cli/srb.rb:20 + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/cli/srb/bump.rb:170 + def print_changes(files, command:, from: T.unsafe(nil), to: T.unsafe(nil), dry: T.unsafe(nil), path: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/cli/srb/bump.rb:192 + def undo_changes(files, from_strictness); end +end + +# pkg:gem/spoom#lib/spoom/cli/srb/coverage.rb:10 +class Spoom::Cli::Srb::Coverage < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # pkg:gem/spoom#lib/spoom/cli/srb/coverage.rb:199 + def bundle_install(path, sha); end + + # pkg:gem/spoom#lib/spoom/cli/srb.rb:23 + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/cli/srb/coverage.rb:211 + def message_no_data(file); end + + # pkg:gem/spoom#lib/spoom/cli/srb/coverage.rb:174 + def open(file = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/cli/srb/coverage.rb:190 + def parse_time(string, option); end + + # pkg:gem/spoom#lib/spoom/cli/srb/coverage.rb:143 + def report; end + + # pkg:gem/spoom#lib/spoom/cli/srb/coverage.rb:21 + def snapshot; end + + # pkg:gem/spoom#lib/spoom/cli/srb/coverage.rb:43 + def timeline; end +end + +# pkg:gem/spoom#lib/spoom/cli/srb/coverage.rb:13 +Spoom::Cli::Srb::Coverage::DATA_DIR = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/cli/srb/lsp.rb:11 +class Spoom::Cli::Srb::LSP < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # pkg:gem/spoom#lib/spoom/cli/srb/lsp.rb:45 + def defs(file, line, col); end + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # pkg:gem/spoom#lib/spoom/cli/srb/lsp.rb:55 + def find(query); end + + # pkg:gem/spoom#lib/spoom/cli/srb.rb:26 + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # pkg:gem/spoom#lib/spoom/cli/srb/lsp.rb:31 + def hover(file, line, col); end + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # pkg:gem/spoom#lib/spoom/cli/srb/lsp.rb:16 + def list; end + + # pkg:gem/spoom#lib/spoom/cli/srb/lsp.rb:104 + def lsp_client; end + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # pkg:gem/spoom#lib/spoom/cli/srb/lsp.rb:75 + def refs(file, line, col); end + + # pkg:gem/spoom#lib/spoom/cli/srb/lsp.rb:127 + def run(&block); end + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # pkg:gem/spoom#lib/spoom/cli/srb/lsp.rb:85 + def sigs(file, line, col); end + + # pkg:gem/spoom#lib/spoom/cli/srb/lsp.rb:119 + def symbol_printer; end + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # pkg:gem/spoom#lib/spoom/cli/srb/lsp.rb:65 + def symbols(file); end + + # pkg:gem/spoom#lib/spoom/cli/srb/lsp.rb:152 + def to_uri(path); end + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # pkg:gem/spoom#lib/spoom/cli/srb/lsp.rb:95 + def types(file, line, col); end +end + +# pkg:gem/spoom#lib/spoom/cli/srb.rb:15 +class Spoom::Cli::Srb::Main < ::Thor + # pkg:gem/spoom#lib/spoom/cli/srb.rb:17 + def assertions(*args); end + + # pkg:gem/spoom#lib/spoom/cli/srb.rb:20 + def bump(*args); end + + # pkg:gem/spoom#lib/spoom/cli/srb.rb:23 + def coverage(*args); end + + # pkg:gem/spoom#lib/spoom/cli.rb:21 + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/cli/srb.rb:26 + def lsp(*args); end + + # pkg:gem/spoom#lib/spoom/cli/srb.rb:29 + def metrics(*args); end + + # pkg:gem/spoom#lib/spoom/cli/srb.rb:32 + def sigs(*args); end + + # pkg:gem/spoom#lib/spoom/cli/srb.rb:35 + def tc(*args); end +end + +# pkg:gem/spoom#lib/spoom/cli/srb/metrics.rb:7 +class Spoom::Cli::Srb::Metrics < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # pkg:gem/spoom#lib/spoom/cli/srb.rb:29 + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/cli/srb/metrics.rb:14 + def show(*paths); end +end + +# pkg:gem/spoom#lib/spoom/cli/srb/sigs.rb:9 +class Spoom::Cli::Srb::Sigs < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # pkg:gem/spoom#lib/spoom/cli/srb/sigs.rb:227 + def exec(context, command); end + + # pkg:gem/spoom#lib/spoom/cli/srb/sigs.rb:95 + def export(output_path = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/cli/srb.rb:32 + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/cli/srb/sigs.rb:76 + def strip(*paths); end + + # pkg:gem/spoom#lib/spoom/cli/srb/sigs.rb:204 + def transform_files(files, &block); end + + # pkg:gem/spoom#lib/spoom/cli/srb/sigs.rb:25 + def translate(*paths); end +end + +# pkg:gem/spoom#lib/spoom/cli/srb/tc.rb:7 +class Spoom::Cli::Srb::Tc < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # pkg:gem/spoom#lib/spoom/cli/srb/tc.rb:147 + def colorize_message(message); end + + # pkg:gem/spoom#lib/spoom/cli/srb/tc.rb:138 + def format_error(error, format); end + + # pkg:gem/spoom#lib/spoom/cli/srb.rb:35 + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/cli/srb/tc.rb:28 + def tc(*paths_to_select); end +end + +# pkg:gem/spoom#lib/spoom/cli/srb/tc.rb:16 +Spoom::Cli::Srb::Tc::DEFAULT_FORMAT = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/cli/srb/tc.rb:12 +Spoom::Cli::Srb::Tc::SORT_CODE = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/cli/srb/tc.rb:14 +Spoom::Cli::Srb::Tc::SORT_ENUM = T.let(T.unsafe(nil), Array) + +# pkg:gem/spoom#lib/spoom/cli/srb/tc.rb:13 +Spoom::Cli::Srb::Tc::SORT_LOC = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/colors.rb:5 +class Spoom::Color < ::T::Enum + enums do + BLACK = new + BLUE = new + BOLD = new + CLEAR = new + CYAN = new + GREEN = new + LIGHT_BLACK = new + LIGHT_BLUE = new + LIGHT_CYAN = new + LIGHT_GREEN = new + LIGHT_MAGENTA = new + LIGHT_RED = new + LIGHT_WHITE = new + LIGHT_YELLOW = new + MAGENTA = new + RED = new + WHITE = new + YELLOW = new + end + + # pkg:gem/spoom#lib/spoom/colors.rb:30 + sig { returns(::String) } + def ansi_code; end +end + +# pkg:gem/spoom#lib/spoom/colors.rb:35 +module Spoom::Colorize + # pkg:gem/spoom#lib/spoom/colors.rb:37 + sig { params(string: ::String, color: ::Spoom::Color).returns(::String) } + def set_color(string, *color); end +end + +# An abstraction to a Ruby project context +# +# A context maps to a directory in the file system. +# It is used to manipulate files and run commands in the context of this directory. +# +# pkg:gem/spoom#lib/spoom/context/bundle.rb:5 +class Spoom::Context + include ::Spoom::Context::Bundle + include ::Spoom::Context::Exec + include ::Spoom::Context::FileSystem + include ::Spoom::Context::Git + include ::Spoom::Context::Sorbet + + # Create a new context about `absolute_path` + # + # The directory will not be created if it doesn't exist. + # Call `#make!` to create it. + # + # pkg:gem/spoom#lib/spoom/context.rb:47 + sig { params(absolute_path: ::String).void } + def initialize(absolute_path); end + + # The absolute path to the directory this context is about + # + # pkg:gem/spoom#lib/spoom/context.rb:40 + sig { returns(::String) } + def absolute_path; end + + class << self + # Create a new context in the system's temporary directory + # + # `name` is used as prefix to the temporary directory name. + # The directory will be created if it doesn't exist. + # + # pkg:gem/spoom#lib/spoom/context.rb:33 + sig { params(name: T.nilable(::String)).returns(T.attached_class) } + def mktmp!(name = T.unsafe(nil)); end + end +end + +# Bundle features for a context +# +# pkg:gem/spoom#lib/spoom/context/bundle.rb:8 +module Spoom::Context::Bundle + requires_ancestor { Spoom::Context } + + # Run a command with `bundle` in this context directory + # + # pkg:gem/spoom#lib/spoom/context/bundle.rb:29 + sig { params(command: ::String, version: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } + def bundle(command, version: T.unsafe(nil), capture_err: T.unsafe(nil)); end + + # Run a command `bundle exec` in this context directory + # + # pkg:gem/spoom#lib/spoom/context/bundle.rb:42 + sig { params(command: ::String, version: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } + def bundle_exec(command, version: T.unsafe(nil), capture_err: T.unsafe(nil)); end + + # Run `bundle install` in this context directory + # + # pkg:gem/spoom#lib/spoom/context/bundle.rb:36 + sig { params(version: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } + def bundle_install!(version: T.unsafe(nil), capture_err: T.unsafe(nil)); end + + # Get `gem` version from the `Gemfile.lock` content + # + # Returns `nil` if `gem` cannot be found in the Gemfile. + # + # pkg:gem/spoom#lib/spoom/context/bundle.rb:58 + sig { params(gem: ::String).returns(T.nilable(::Gem::Version)) } + def gem_version_from_gemfile_lock(gem); end + + # pkg:gem/spoom#lib/spoom/context/bundle.rb:47 + sig { returns(T::Hash[::String, ::Bundler::LazySpecification]) } + def gemfile_lock_specs; end + + # Read the contents of the Gemfile in this context directory + # + # pkg:gem/spoom#lib/spoom/context/bundle.rb:11 + sig { returns(T.nilable(::String)) } + def read_gemfile; end + + # Read the contents of the Gemfile.lock in this context directory + # + # pkg:gem/spoom#lib/spoom/context/bundle.rb:17 + sig { returns(T.nilable(::String)) } + def read_gemfile_lock; end + + # Set the `contents` of the Gemfile in this context directory + # + # pkg:gem/spoom#lib/spoom/context/bundle.rb:23 + sig { params(contents: ::String, append: T::Boolean).void } + def write_gemfile!(contents, append: T.unsafe(nil)); end +end + +# Execution features for a context +# +# pkg:gem/spoom#lib/spoom/context/exec.rb:28 +module Spoom::Context::Exec + requires_ancestor { Spoom::Context } + + # Run a command in this context directory + # + # pkg:gem/spoom#lib/spoom/context/exec.rb:31 + sig { params(command: ::String, capture_err: T::Boolean).returns(::Spoom::ExecResult) } + def exec(command, capture_err: T.unsafe(nil)); end +end + +# File System features for a context +# +# pkg:gem/spoom#lib/spoom/context/file_system.rb:8 +module Spoom::Context::FileSystem + requires_ancestor { Spoom::Context } + + # Returns the absolute path to `relative_path` in the context's directory + # + # pkg:gem/spoom#lib/spoom/context/file_system.rb:11 + sig { params(relative_path: ::String).returns(::String) } + def absolute_path_to(relative_path); end + + # pkg:gem/spoom#lib/spoom/context/file_system.rb:47 + sig do + params( + allow_extensions: T::Array[::String], + allow_mime_types: T::Array[::String], + exclude_patterns: T::Array[::String] + ).returns(T::Array[::String]) + end + def collect_files(allow_extensions: T.unsafe(nil), allow_mime_types: T.unsafe(nil), exclude_patterns: T.unsafe(nil)); end + + # Delete this context and its content + # + # Warning: it will `rm -rf` the context directory on the file system. + # + # pkg:gem/spoom#lib/spoom/context/file_system.rb:99 + sig { void } + def destroy!; end + + # Does the context directory at `absolute_path` exist and is a directory? + # + # pkg:gem/spoom#lib/spoom/context/file_system.rb:17 + sig { returns(T::Boolean) } + def exist?; end + + # Does `relative_path` point to an existing file in this context directory? + # + # pkg:gem/spoom#lib/spoom/context/file_system.rb:59 + sig { params(relative_path: ::String).returns(T::Boolean) } + def file?(relative_path); end + + # List all files in this context matching `pattern` + # + # pkg:gem/spoom#lib/spoom/context/file_system.rb:30 + sig { params(pattern: ::String).returns(T::Array[::String]) } + def glob(pattern = T.unsafe(nil)); end + + # List all files at the top level of this context directory + # + # pkg:gem/spoom#lib/spoom/context/file_system.rb:38 + sig { returns(T::Array[::String]) } + def list; end + + # Create the context directory at `absolute_path` + # + # pkg:gem/spoom#lib/spoom/context/file_system.rb:23 + sig { void } + def mkdir!; end + + # Move the file or directory from `from_relative_path` to `to_relative_path` + # + # pkg:gem/spoom#lib/spoom/context/file_system.rb:89 + sig { params(from_relative_path: ::String, to_relative_path: ::String).void } + def move!(from_relative_path, to_relative_path); end + + # Return the contents of the file at `relative_path` in this context directory + # + # Will raise if the file doesn't exist. + # + # pkg:gem/spoom#lib/spoom/context/file_system.rb:67 + sig { params(relative_path: ::String).returns(::String) } + def read(relative_path); end + + # Remove the path at `relative_path` (recursive + force) in this context directory + # + # pkg:gem/spoom#lib/spoom/context/file_system.rb:83 + sig { params(relative_path: ::String).void } + def remove!(relative_path); end + + # Write `contents` in the file at `relative_path` in this context directory + # + # Append to the file if `append` is true. + # + # pkg:gem/spoom#lib/spoom/context/file_system.rb:75 + sig { params(relative_path: ::String, contents: ::String, append: T::Boolean).void } + def write!(relative_path, contents = T.unsafe(nil), append: T.unsafe(nil)); end +end + +# Git features for a context +# +# pkg:gem/spoom#lib/spoom/context/git.rb:32 +module Spoom::Context::Git + requires_ancestor { Spoom::Context } + + # Run a command prefixed by `git` in this context directory + # + # pkg:gem/spoom#lib/spoom/context/git.rb:35 + sig { params(command: ::String).returns(::Spoom::ExecResult) } + def git(command); end + + # Run `git checkout` in this context directory + # + # pkg:gem/spoom#lib/spoom/context/git.rb:54 + sig { params(ref: ::String).returns(::Spoom::ExecResult) } + def git_checkout!(ref: T.unsafe(nil)); end + + # Run `git checkout -b <branch-name> <ref>` in this context directory + # + # pkg:gem/spoom#lib/spoom/context/git.rb:60 + sig { params(branch_name: ::String, ref: T.nilable(::String)).returns(::Spoom::ExecResult) } + def git_checkout_new_branch!(branch_name, ref: T.unsafe(nil)); end + + # Run `git add . && git commit` in this context directory + # + # pkg:gem/spoom#lib/spoom/context/git.rb:70 + sig { params(message: ::String, time: ::Time, allow_empty: T::Boolean).returns(::Spoom::ExecResult) } + def git_commit!(message: T.unsafe(nil), time: T.unsafe(nil), allow_empty: T.unsafe(nil)); end + + # Get the current git branch in this context directory + # + # pkg:gem/spoom#lib/spoom/context/git.rb:81 + sig { returns(T.nilable(::String)) } + def git_current_branch; end + + # Run `git diff` in this context directory + # + # pkg:gem/spoom#lib/spoom/context/git.rb:90 + sig { params(arg: ::String).returns(::Spoom::ExecResult) } + def git_diff(*arg); end + + # Run `git init` in this context directory + # + # Warning: passing a branch will run `git init -b <branch>` which is only available in git 2.28+. + # In older versions, use `git_init!` followed by `git("checkout -b <branch>")`. + # + # pkg:gem/spoom#lib/spoom/context/git.rb:44 + sig { params(branch: T.nilable(::String)).returns(::Spoom::ExecResult) } + def git_init!(branch: T.unsafe(nil)); end + + # Get the last commit in the currently checked out branch + # + # pkg:gem/spoom#lib/spoom/context/git.rb:96 + sig { params(short_sha: T::Boolean).returns(T.nilable(::Spoom::Git::Commit)) } + def git_last_commit(short_sha: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/context/git.rb:107 + sig { params(arg: ::String).returns(::Spoom::ExecResult) } + def git_log(*arg); end + + # Run `git push <remote> <ref>` in this context directory + # + # pkg:gem/spoom#lib/spoom/context/git.rb:113 + sig { params(remote: ::String, ref: ::String, force: T::Boolean).returns(::Spoom::ExecResult) } + def git_push!(remote, ref, force: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/context/git.rb:118 + sig { params(arg: ::String).returns(::Spoom::ExecResult) } + def git_show(*arg); end + + # Is there uncommitted changes in this context directory? + # + # pkg:gem/spoom#lib/spoom/context/git.rb:124 + sig { params(path: ::String).returns(T::Boolean) } + def git_workdir_clean?(path: T.unsafe(nil)); end +end + +# Sorbet features for a context +# +# pkg:gem/spoom#lib/spoom/context/sorbet.rb:8 +module Spoom::Context::Sorbet + requires_ancestor { Spoom::Context } + + # Does this context has a `sorbet/config` file? + # + # pkg:gem/spoom#lib/spoom/context/sorbet.rb:103 + sig { returns(T::Boolean) } + def has_sorbet_config?; end + + # Read the strictness sigil from the file at `relative_path` (returns `nil` if no sigil) + # + # pkg:gem/spoom#lib/spoom/context/sorbet.rb:126 + sig { params(relative_path: ::String).returns(T.nilable(::String)) } + def read_file_strictness(relative_path); end + + # Read the contents of `sorbet/config` in this context directory + # + # pkg:gem/spoom#lib/spoom/context/sorbet.rb:114 + sig { returns(::String) } + def read_sorbet_config; end + + # pkg:gem/spoom#lib/spoom/context/sorbet.rb:108 + sig { returns(::Spoom::Sorbet::Config) } + def sorbet_config; end + + # Get the commit introducing the `sorbet/config` file + # + # pkg:gem/spoom#lib/spoom/context/sorbet.rb:132 + sig { returns(T.nilable(::Spoom::Git::Commit)) } + def sorbet_intro_commit; end + + # Get the commit removing the `sorbet/config` file + # + # pkg:gem/spoom#lib/spoom/context/sorbet.rb:144 + sig { returns(T.nilable(::Spoom::Git::Commit)) } + def sorbet_removal_commit; end + + # Run `bundle exec srb` in this context directory + # + # pkg:gem/spoom#lib/spoom/context/sorbet.rb:11 + sig { params(arg: ::String, sorbet_bin: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } + def srb(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end + + # List all files typechecked by Sorbet from its `config` + # + # pkg:gem/spoom#lib/spoom/context/sorbet.rb:55 + sig { params(with_config: T.nilable(::Spoom::Sorbet::Config), include_rbis: T::Boolean).returns(T::Array[::String]) } + def srb_files(with_config: T.unsafe(nil), include_rbis: T.unsafe(nil)); end + + # List all files typechecked by Sorbet from its `config` that matches `strictness` + # + # pkg:gem/spoom#lib/spoom/context/sorbet.rb:88 + sig do + params( + strictness: ::String, + with_config: T.nilable(::Spoom::Sorbet::Config), + include_rbis: T::Boolean + ).returns(T::Array[::String]) + end + def srb_files_with_strictness(strictness, with_config: T.unsafe(nil), include_rbis: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/context/sorbet.rb:35 + sig do + params( + arg: ::String, + sorbet_bin: T.nilable(::String), + capture_err: T::Boolean + ).returns(T.nilable(T::Hash[::String, ::Integer])) + end + def srb_metrics(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/context/sorbet.rb:29 + sig { params(arg: ::String, sorbet_bin: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } + def srb_tc(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/context/sorbet.rb:94 + sig { params(arg: ::String, sorbet_bin: T.nilable(::String), capture_err: T::Boolean).returns(T.nilable(::String)) } + def srb_version(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end + + # Set the `contents` of `sorbet/config` in this context directory + # + # pkg:gem/spoom#lib/spoom/context/sorbet.rb:120 + sig { params(contents: ::String, append: T::Boolean).void } + def write_sorbet_config!(contents, append: T.unsafe(nil)); end +end + +# pkg:gem/spoom#lib/spoom/counters.rb:6 +class Spoom::Counters < ::Hash + extend T::Generic + + K = type_member { { fixed: String } } + V = type_member { { fixed: Integer } } + Elem = type_member { { fixed: [String, Integer] } } + + # pkg:gem/spoom#lib/spoom/counters.rb:8 + sig { void } + def initialize; end + + # pkg:gem/spoom#lib/spoom/counters.rb:18 + sig { params(key: ::String).returns(::Integer) } + def [](key); end + + # pkg:gem/spoom#lib/spoom/counters.rb:13 + sig { params(key: ::String).void } + def increment(key); end +end + +# pkg:gem/spoom#lib/spoom/coverage/snapshot.rb:5 +module Spoom::Coverage + class << self + # pkg:gem/spoom#lib/spoom/coverage.rb:101 + sig { params(context: ::Spoom::Context).returns(::Spoom::FileTree) } + def file_tree(context); end + + # pkg:gem/spoom#lib/spoom/coverage.rb:81 + sig do + params( + context: ::Spoom::Context, + snapshots: T::Array[::Spoom::Coverage::Snapshot], + palette: ::Spoom::Coverage::D3::ColorPalette + ).returns(::Spoom::Coverage::Report) + end + def report(context, snapshots, palette:); end + + # pkg:gem/spoom#lib/spoom/coverage.rb:14 + sig do + params( + context: ::Spoom::Context, + rbi: T::Boolean, + sorbet_bin: T.nilable(::String) + ).returns(::Spoom::Coverage::Snapshot) + end + def snapshot(context, rbi: T.unsafe(nil), sorbet_bin: T.unsafe(nil)); end + end +end + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:81 +module Spoom::Coverage::Cards; end + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:82 +class Spoom::Coverage::Cards::Card < ::Spoom::Coverage::Template + # pkg:gem/spoom#lib/spoom/coverage/report.rb:89 + sig { params(template: ::String, title: T.nilable(::String), body: T.nilable(::String)).void } + def initialize(template: T.unsafe(nil), title: T.unsafe(nil), body: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:86 + def body; end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:86 + sig { returns(T.nilable(::String)) } + def title; end +end + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:83 +Spoom::Coverage::Cards::Card::TEMPLATE = T.let(T.unsafe(nil), String) + +# @abstract +# +# pkg:gem/spoom#lib/spoom/coverage/report.rb:97 +class Spoom::Coverage::Cards::Erb < ::Spoom::Coverage::Cards::Card + abstract! + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:99 + sig { void } + def initialize; end + + # @abstract + # + # pkg:gem/spoom#lib/spoom/coverage/report.rb:109 + sig { abstract.returns(::String) } + def erb; end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/report.rb:103 + sig { override.returns(::String) } + def html; end +end + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:140 +class Spoom::Coverage::Cards::Map < ::Spoom::Coverage::Cards::Card + # pkg:gem/spoom#lib/spoom/coverage/report.rb:147 + sig do + params( + file_tree: ::Spoom::FileTree, + nodes_strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], + nodes_strictness_scores: T::Hash[::Spoom::FileTree::Node, ::Float], + title: ::String + ).void + end + def initialize(file_tree:, nodes_strictnesses:, nodes_strictness_scores:, title: T.unsafe(nil)); end +end + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:112 +class Spoom::Coverage::Cards::Snapshot < ::Spoom::Coverage::Cards::Card + # pkg:gem/spoom#lib/spoom/coverage/report.rb:119 + sig { params(snapshot: ::Spoom::Coverage::Snapshot, title: ::String).void } + def initialize(snapshot:, title: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:130 + sig { returns(::Spoom::Coverage::D3::Pie::Calls) } + def pie_calls; end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:125 + sig { returns(::Spoom::Coverage::D3::Pie::Sigils) } + def pie_sigils; end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:135 + sig { returns(::Spoom::Coverage::D3::Pie::Sigs) } + def pie_sigs; end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:116 + sig { returns(::Spoom::Coverage::Snapshot) } + def snapshot; end +end + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:113 +Spoom::Coverage::Cards::Snapshot::TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:209 +class Spoom::Coverage::Cards::SorbetIntro < ::Spoom::Coverage::Cards::Erb + # pkg:gem/spoom#lib/spoom/coverage/report.rb:211 + sig { params(sorbet_intro_commit: T.nilable(::String), sorbet_intro_date: T.nilable(::Time)).void } + def initialize(sorbet_intro_commit: T.unsafe(nil), sorbet_intro_date: T.unsafe(nil)); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/report.rb:218 + sig { override.returns(::String) } + def erb; end +end + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:160 +class Spoom::Coverage::Cards::Timeline < ::Spoom::Coverage::Cards::Card + # pkg:gem/spoom#lib/spoom/coverage/report.rb:162 + sig { params(title: ::String, timeline: ::Spoom::Coverage::D3::Timeline).void } + def initialize(title:, timeline:); end +end + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:173 +class Spoom::Coverage::Cards::Timeline::Calls < ::Spoom::Coverage::Cards::Timeline + # pkg:gem/spoom#lib/spoom/coverage/report.rb:175 + sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } + def initialize(snapshots:, title: T.unsafe(nil)); end +end + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:187 +class Spoom::Coverage::Cards::Timeline::RBIs < ::Spoom::Coverage::Cards::Timeline + # pkg:gem/spoom#lib/spoom/coverage/report.rb:189 + sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } + def initialize(snapshots:, title: T.unsafe(nil)); end +end + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:201 +class Spoom::Coverage::Cards::Timeline::Runtimes < ::Spoom::Coverage::Cards::Timeline + # pkg:gem/spoom#lib/spoom/coverage/report.rb:203 + sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } + def initialize(snapshots:, title: T.unsafe(nil)); end +end + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:166 +class Spoom::Coverage::Cards::Timeline::Sigils < ::Spoom::Coverage::Cards::Timeline + # pkg:gem/spoom#lib/spoom/coverage/report.rb:168 + sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } + def initialize(snapshots:, title: T.unsafe(nil)); end +end + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:180 +class Spoom::Coverage::Cards::Timeline::Sigs < ::Spoom::Coverage::Cards::Timeline + # pkg:gem/spoom#lib/spoom/coverage/report.rb:182 + sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } + def initialize(snapshots:, title: T.unsafe(nil)); end +end + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:194 +class Spoom::Coverage::Cards::Timeline::Versions < ::Spoom::Coverage::Cards::Timeline + # pkg:gem/spoom#lib/spoom/coverage/report.rb:196 + sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } + def initialize(snapshots:, title: T.unsafe(nil)); end +end + +# pkg:gem/spoom#lib/spoom/coverage/d3/base.rb:6 +module Spoom::Coverage::D3 + class << self + # pkg:gem/spoom#lib/spoom/coverage/d3.rb:59 + sig { params(palette: ::Spoom::Coverage::D3::ColorPalette).returns(::String) } + def header_script(palette); end + + # pkg:gem/spoom#lib/spoom/coverage/d3.rb:19 + sig { returns(::String) } + def header_style; end + end +end + +# @abstract +# +# pkg:gem/spoom#lib/spoom/coverage/d3/base.rb:8 +class Spoom::Coverage::D3::Base + abstract! + + # pkg:gem/spoom#lib/spoom/coverage/d3/base.rb:13 + sig { params(id: ::String, data: T.untyped).void } + def initialize(id, data); end + + # pkg:gem/spoom#lib/spoom/coverage/d3/base.rb:31 + sig { returns(::String) } + def html; end + + # pkg:gem/spoom#lib/spoom/coverage/d3/base.rb:10 + sig { returns(::String) } + def id; end + + # @abstract + # + # pkg:gem/spoom#lib/spoom/coverage/d3/base.rb:45 + sig { abstract.returns(::String) } + def script; end + + # pkg:gem/spoom#lib/spoom/coverage/d3/base.rb:39 + sig { returns(::String) } + def tooltip; end + + class << self + # pkg:gem/spoom#lib/spoom/coverage/d3/base.rb:25 + sig { returns(::String) } + def header_script; end + + # pkg:gem/spoom#lib/spoom/coverage/d3/base.rb:20 + sig { returns(::String) } + def header_style; end + end +end + +# pkg:gem/spoom#lib/spoom/coverage/d3.rb:12 +Spoom::Coverage::D3::COLOR_FALSE = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/coverage/d3.rb:11 +Spoom::Coverage::D3::COLOR_IGNORE = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/coverage/d3.rb:14 +Spoom::Coverage::D3::COLOR_STRICT = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/coverage/d3.rb:15 +Spoom::Coverage::D3::COLOR_STRONG = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/coverage/d3.rb:13 +Spoom::Coverage::D3::COLOR_TRUE = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/coverage/d3/circle_map.rb:9 +class Spoom::Coverage::D3::CircleMap < ::Spoom::Coverage::D3::Base + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/circle_map.rb:58 + sig { override.returns(::String) } + def script; end + + class << self + # pkg:gem/spoom#lib/spoom/coverage/d3/circle_map.rb:38 + sig { returns(::String) } + def header_script; end + + # pkg:gem/spoom#lib/spoom/coverage/d3/circle_map.rb:12 + sig { returns(::String) } + def header_style; end + end +end + +# pkg:gem/spoom#lib/spoom/coverage/d3/circle_map.rb:147 +class Spoom::Coverage::D3::CircleMap::Sigils < ::Spoom::Coverage::D3::CircleMap + # pkg:gem/spoom#lib/spoom/coverage/d3/circle_map.rb:154 + sig do + params( + id: ::String, + file_tree: ::Spoom::FileTree, + nodes_strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], + nodes_scores: T::Hash[::Spoom::FileTree::Node, ::Float] + ).void + end + def initialize(id, file_tree, nodes_strictnesses, nodes_scores); end + + # pkg:gem/spoom#lib/spoom/coverage/d3/circle_map.rb:161 + sig { params(node: ::Spoom::FileTree::Node).returns(T::Hash[::Symbol, T.untyped]) } + def tree_node_to_json(node); end +end + +# pkg:gem/spoom#lib/spoom/coverage/d3.rb:101 +class Spoom::Coverage::D3::ColorPalette < ::T::Struct + prop :ignore, ::String + prop :false, ::String + prop :true, ::String + prop :strict, ::String + prop :strong, ::String +end + +# @abstract +# +# pkg:gem/spoom#lib/spoom/coverage/d3/pie.rb:10 +class Spoom::Coverage::D3::Pie < ::Spoom::Coverage::D3::Base + abstract! + + # pkg:gem/spoom#lib/spoom/coverage/d3/pie.rb:12 + sig { params(id: ::String, title: ::String, data: T.untyped).void } + def initialize(id, title, data); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/pie.rb:51 + sig { override.returns(::String) } + def script; end + + class << self + # pkg:gem/spoom#lib/spoom/coverage/d3/pie.rb:37 + sig { returns(::String) } + def header_script; end + + # pkg:gem/spoom#lib/spoom/coverage/d3/pie.rb:19 + sig { returns(::String) } + def header_style; end + end +end + +# pkg:gem/spoom#lib/spoom/coverage/d3/pie.rb:135 +class Spoom::Coverage::D3::Pie::Calls < ::Spoom::Coverage::D3::Pie + # pkg:gem/spoom#lib/spoom/coverage/d3/pie.rb:137 + sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void } + def initialize(id, title, snapshot); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/pie.rb:143 + sig { override.returns(::String) } + def tooltip; end +end + +# pkg:gem/spoom#lib/spoom/coverage/d3/pie.rb:118 +class Spoom::Coverage::D3::Pie::Sigils < ::Spoom::Coverage::D3::Pie + # pkg:gem/spoom#lib/spoom/coverage/d3/pie.rb:120 + sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void } + def initialize(id, title, snapshot); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/pie.rb:126 + sig { override.returns(::String) } + def tooltip; end +end + +# pkg:gem/spoom#lib/spoom/coverage/d3/pie.rb:152 +class Spoom::Coverage::D3::Pie::Sigs < ::Spoom::Coverage::D3::Pie + # pkg:gem/spoom#lib/spoom/coverage/d3/pie.rb:154 + sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void } + def initialize(id, title, snapshot); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/pie.rb:164 + sig { override.returns(::String) } + def tooltip; end +end + +# @abstract +# +# pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:10 +class Spoom::Coverage::D3::Timeline < ::Spoom::Coverage::D3::Base + abstract! + + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:12 + sig { params(id: ::String, data: T.untyped, keys: T::Array[::String]).void } + def initialize(id, data, keys); end + + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:183 + sig { params(y: ::String, color: ::String, curve: ::String).returns(::String) } + def area(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:199 + sig { params(y: ::String, color: ::String, curve: ::String).returns(::String) } + def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end + + # @abstract + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:122 + sig { abstract.returns(::String) } + def plot; end + + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:213 + sig { params(y: ::String).returns(::String) } + def points(y:); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:96 + sig { override.returns(::String) } + def script; end + + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:125 + sig { returns(::String) } + def x_scale; end + + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:141 + sig { returns(::String) } + def x_ticks; end + + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:154 + sig { params(min: ::String, max: ::String, ticks: ::String).returns(::String) } + def y_scale(min:, max:, ticks:); end + + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:170 + sig { params(ticks: ::String, format: ::String, padding: ::Integer).returns(::String) } + def y_ticks(ticks:, format:, padding:); end + + class << self + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:73 + sig { returns(::String) } + def header_script; end + + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:19 + sig { returns(::String) } + def header_style; end + end +end + +# pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:442 +class Spoom::Coverage::D3::Timeline::Calls < ::Spoom::Coverage::D3::Timeline::Stacked + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:444 + sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } + def initialize(id, snapshots); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:459 + sig { override.returns(::String) } + def tooltip; end +end + +# pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:497 +class Spoom::Coverage::D3::Timeline::RBIs < ::Spoom::Coverage::D3::Timeline::Stacked + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:499 + sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } + def initialize(id, snapshots); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:570 + sig { override.params(y: ::String, color: ::String, curve: ::String).returns(::String) } + def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:611 + sig { override.returns(::String) } + def plot; end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:529 + sig { override.returns(::String) } + def script; end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:514 + sig { override.returns(::String) } + def tooltip; end +end + +# pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:278 +class Spoom::Coverage::D3::Timeline::Runtimes < ::Spoom::Coverage::D3::Timeline + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:280 + sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } + def initialize(id, snapshots); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:307 + sig { override.returns(::String) } + def plot; end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:293 + sig { override.returns(::String) } + def tooltip; end +end + +# pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:416 +class Spoom::Coverage::D3::Timeline::Sigils < ::Spoom::Coverage::D3::Timeline::Stacked + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:418 + sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } + def initialize(id, snapshots); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:433 + sig { override.returns(::String) } + def tooltip; end +end + +# pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:468 +class Spoom::Coverage::D3::Timeline::Sigs < ::Spoom::Coverage::D3::Timeline::Stacked + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:470 + sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } + def initialize(id, snapshots); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:488 + sig { override.returns(::String) } + def tooltip; end +end + +# @abstract +# +# pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:326 +class Spoom::Coverage::D3::Timeline::Stacked < ::Spoom::Coverage::D3::Timeline + abstract! + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:383 + sig { override.params(y: ::String, color: ::String, curve: ::String).returns(::String) } + def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:371 + sig { override.returns(::String) } + def plot; end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:329 + sig { override.returns(::String) } + def script; end +end + +# pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:228 +class Spoom::Coverage::D3::Timeline::Versions < ::Spoom::Coverage::D3::Timeline + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:230 + sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } + def initialize(id, snapshots); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:259 + sig { override.returns(::String) } + def plot; end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/d3/timeline.rb:244 + sig { override.returns(::String) } + def tooltip; end +end + +# @abstract +# +# pkg:gem/spoom#lib/spoom/coverage/report.rb:35 +class Spoom::Coverage::Page < ::Spoom::Coverage::Template + abstract! + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:45 + sig { params(title: ::String, palette: ::Spoom::Coverage::D3::ColorPalette, template: ::String).void } + def initialize(title:, palette:, template: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:67 + sig { returns(::String) } + def body_html; end + + # @abstract + # + # pkg:gem/spoom#lib/spoom/coverage/report.rb:73 + sig { abstract.returns(T::Array[::Spoom::Coverage::Cards::Card]) } + def cards; end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:76 + sig { returns(::String) } + def footer_html; end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:62 + sig { returns(::String) } + def header_html; end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:57 + sig { returns(::String) } + def header_script; end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:52 + sig { returns(::String) } + def header_style; end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:42 + sig { returns(::Spoom::Coverage::D3::ColorPalette) } + def palette; end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:39 + sig { returns(::String) } + def title; end +end + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:36 +Spoom::Coverage::Page::TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/coverage/report.rb:229 +class Spoom::Coverage::Report < ::Spoom::Coverage::Page + # pkg:gem/spoom#lib/spoom/coverage/report.rb:240 + sig do + params( + project_name: ::String, + palette: ::Spoom::Coverage::D3::ColorPalette, + snapshots: T::Array[::Spoom::Coverage::Snapshot], + file_tree: ::Spoom::FileTree, + nodes_strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], + nodes_strictness_scores: T::Hash[::Spoom::FileTree::Node, ::Float], + sorbet_intro_commit: T.nilable(::String), + sorbet_intro_date: T.nilable(::Time) + ).void + end + def initialize(project_name:, palette:, snapshots:, file_tree:, nodes_strictnesses:, nodes_strictness_scores:, sorbet_intro_commit: T.unsafe(nil), sorbet_intro_date: T.unsafe(nil)); end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/report.rb:274 + sig { override.returns(T::Array[::Spoom::Coverage::Cards::Card]) } + def cards; end + + # @override + # + # pkg:gem/spoom#lib/spoom/coverage/report.rb:262 + sig { override.returns(::String) } + def header_html; end +end + +# pkg:gem/spoom#lib/spoom/coverage/snapshot.rb:6 +class Spoom::Coverage::Snapshot < ::T::Struct + prop :timestamp, ::Integer, default: T.unsafe(nil) + prop :version_static, T.nilable(::String), default: T.unsafe(nil) + prop :version_runtime, T.nilable(::String), default: T.unsafe(nil) + prop :duration, ::Integer, default: T.unsafe(nil) + prop :commit_sha, T.nilable(::String), default: T.unsafe(nil) + prop :commit_timestamp, T.nilable(::Integer), default: T.unsafe(nil) + prop :files, ::Integer, default: T.unsafe(nil) + prop :rbi_files, ::Integer, default: T.unsafe(nil) + prop :modules, ::Integer, default: T.unsafe(nil) + prop :classes, ::Integer, default: T.unsafe(nil) + prop :singleton_classes, ::Integer, default: T.unsafe(nil) + prop :methods_without_sig, ::Integer, default: T.unsafe(nil) + prop :methods_with_sig, ::Integer, default: T.unsafe(nil) + prop :calls_untyped, ::Integer, default: T.unsafe(nil) + prop :calls_typed, ::Integer, default: T.unsafe(nil) + prop :sigils, T::Hash[::String, ::Integer], default: T.unsafe(nil) + prop :methods_with_sig_excluding_rbis, ::Integer, default: T.unsafe(nil) + prop :methods_without_sig_excluding_rbis, ::Integer, default: T.unsafe(nil) + prop :sigils_excluding_rbis, T::Hash[::String, ::Integer], default: T.unsafe(nil) + + # pkg:gem/spoom#lib/spoom/coverage/snapshot.rb:31 + sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean, indent_level: ::Integer).void } + def print(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/coverage/snapshot.rb:37 + sig { params(arg: T.untyped).returns(::String) } + def to_json(*arg); end + + class << self + # pkg:gem/spoom#lib/spoom/coverage/snapshot.rb:43 + sig { params(json: ::String).returns(::Spoom::Coverage::Snapshot) } + def from_json(json); end + + # pkg:gem/spoom#lib/spoom/coverage/snapshot.rb:48 + sig { params(obj: T::Hash[::String, T.untyped]).returns(::Spoom::Coverage::Snapshot) } + def from_obj(obj); end + end +end + +# The strictness name as found in the Sorbet metrics file +# +# pkg:gem/spoom#lib/spoom/coverage/snapshot.rb:28 +Spoom::Coverage::Snapshot::STRICTNESSES = T.let(T.unsafe(nil), Array) + +# pkg:gem/spoom#lib/spoom/coverage/snapshot.rb:91 +class Spoom::Coverage::SnapshotPrinter < ::Spoom::Printer + # pkg:gem/spoom#lib/spoom/coverage/snapshot.rb:93 + sig { params(snapshot: ::Spoom::Coverage::Snapshot).void } + def print_snapshot(snapshot); end + + private + + # pkg:gem/spoom#lib/spoom/coverage/snapshot.rb:152 + sig { params(value: T.nilable(::Integer), total: T.nilable(::Integer)).returns(::String) } + def percent(value, total); end + + # pkg:gem/spoom#lib/spoom/coverage/snapshot.rb:141 + sig { params(hash: T::Hash[::String, ::Integer], total: ::Integer).void } + def print_map(hash, total); end +end + +# @abstract +# +# pkg:gem/spoom#lib/spoom/coverage/report.rb:11 +class Spoom::Coverage::Template + abstract! + + # Create a new template from an Erb file path + # + # pkg:gem/spoom#lib/spoom/coverage/report.rb:14 + sig { params(template: ::String).void } + def initialize(template:); end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:19 + sig { returns(::String) } + def erb; end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:29 + sig { returns(::Binding) } + def get_binding; end + + # pkg:gem/spoom#lib/spoom/coverage/report.rb:24 + sig { returns(::String) } + def html; end +end + +# pkg:gem/spoom#lib/spoom/deadcode/erb.rb:27 +module Spoom::Deadcode + class << self + # pkg:gem/spoom#lib/spoom/deadcode/plugins.rb:67 + sig { params(context: ::Spoom::Context).returns(T::Array[T.class_of(Spoom::Deadcode::Plugins::Base)]) } + def load_custom_plugins(context); end + + # pkg:gem/spoom#lib/spoom/deadcode/plugins.rb:53 + sig { params(context: ::Spoom::Context).returns(T::Set[T.class_of(Spoom::Deadcode::Plugins::Base)]) } + def plugins_from_gemfile_lock(context); end + end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins.rb:26 +Spoom::Deadcode::DEFAULT_CUSTOM_PLUGINS_PATH = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/deadcode/plugins.rb:28 +Spoom::Deadcode::DEFAULT_PLUGINS = T.let(T.unsafe(nil), Set) + +# A definition is a class, module, method, constant, etc. being defined in the code +# +# pkg:gem/spoom#lib/spoom/deadcode/definition.rb:7 +class Spoom::Deadcode::Definition < ::T::Struct + const :kind, ::Spoom::Deadcode::Definition::Kind + const :name, ::String + const :full_name, ::String + const :location, ::Spoom::Location + const :status, ::Spoom::Deadcode::Definition::Status, default: T.unsafe(nil) + + # pkg:gem/spoom#lib/spoom/deadcode/definition.rb:76 + sig { void } + def alive!; end + + # pkg:gem/spoom#lib/spoom/deadcode/definition.rb:71 + sig { returns(T::Boolean) } + def alive?; end + + # pkg:gem/spoom#lib/spoom/deadcode/definition.rb:39 + sig { returns(T::Boolean) } + def attr_reader?; end + + # pkg:gem/spoom#lib/spoom/deadcode/definition.rb:44 + sig { returns(T::Boolean) } + def attr_writer?; end + + # pkg:gem/spoom#lib/spoom/deadcode/definition.rb:49 + sig { returns(T::Boolean) } + def class?; end + + # pkg:gem/spoom#lib/spoom/deadcode/definition.rb:54 + sig { returns(T::Boolean) } + def constant?; end + + # pkg:gem/spoom#lib/spoom/deadcode/definition.rb:81 + sig { returns(T::Boolean) } + def dead?; end + + # pkg:gem/spoom#lib/spoom/deadcode/definition.rb:91 + sig { void } + def ignored!; end + + # pkg:gem/spoom#lib/spoom/deadcode/definition.rb:86 + sig { returns(T::Boolean) } + def ignored?; end + + # pkg:gem/spoom#lib/spoom/deadcode/definition.rb:59 + sig { returns(T::Boolean) } + def method?; end + + # pkg:gem/spoom#lib/spoom/deadcode/definition.rb:64 + sig { returns(T::Boolean) } + def module?; end + + # pkg:gem/spoom#lib/spoom/deadcode/definition.rb:98 + sig { params(args: T.untyped).returns(::String) } + def to_json(*args); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/definition.rb:8 +class Spoom::Deadcode::Definition::Kind < ::T::Enum + enums do + AttrReader = new + AttrWriter = new + Class = new + Constant = new + Method = new + Module = new + end +end + +# pkg:gem/spoom#lib/spoom/deadcode/definition.rb:19 +class Spoom::Deadcode::Definition::Status < ::T::Enum + enums do + ALIVE = new + DEAD = new + IGNORED = new + end +end + +# Custom engine to handle ERB templates as used by Rails +# +# pkg:gem/spoom#lib/spoom/deadcode/erb.rb:29 +class Spoom::Deadcode::ERB < ::Erubi::Engine + # pkg:gem/spoom#lib/spoom/deadcode/erb.rb:31 + sig { params(input: T.untyped, properties: T.untyped).void } + def initialize(input, properties = T.unsafe(nil)); end + + private + + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/erb.rb:84 + sig { override.params(code: T.untyped).void } + def add_code(code); end + + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/erb.rb:66 + sig { override.params(indicator: T.untyped, code: T.untyped).void } + def add_expression(indicator, code); end + + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/erb.rb:91 + def add_postamble(_); end + + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/erb.rb:47 + sig { override.params(text: T.untyped).void } + def add_text(text); end + + # pkg:gem/spoom#lib/spoom/deadcode/erb.rb:97 + sig { params(src: T.untyped).void } + def flush_newline_if_pending(src); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/erb.rb:62 +Spoom::Deadcode::ERB::BLOCK_EXPR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/spoom#lib/spoom/deadcode/index.rb:6 +class Spoom::Deadcode::Index + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:25 + sig { params(model: ::Spoom::Model).void } + def initialize(model); end + + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:215 + sig { returns(T::Array[::Spoom::Deadcode::Definition]) } + def all_definitions; end + + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:220 + sig { returns(T::Array[::Spoom::Model::Reference]) } + def all_references; end + + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:95 + sig { params(plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } + def apply_plugins!(plugins); end + + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:75 + sig { params(definition: ::Spoom::Deadcode::Definition).void } + def define(definition); end + + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:19 + sig { returns(T::Hash[::String, T::Array[::Spoom::Deadcode::Definition]]) } + def definitions; end + + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:210 + sig { params(name: ::String).returns(T::Array[::Spoom::Deadcode::Definition]) } + def definitions_for_name(name); end + + # Mark all definitions having a reference of the same name as `alive` + # + # To be called once all the files have been indexed and all the definitions and references discovered. + # + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:118 + sig { void } + def finalize!; end + + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:90 + sig { params(symbol_def: ::Spoom::Model::SymbolDef).void } + def ignore(symbol_def); end + + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:46 + sig { params(erb: ::String, file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } + def index_erb(erb, file:, plugins: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:35 + sig { params(file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } + def index_file(file, plugins: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:51 + sig { params(rb: ::String, file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } + def index_ruby(rb, file:, plugins: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:16 + sig { returns(::Spoom::Model) } + def model; end + + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:80 + sig { params(name: ::String, location: ::Spoom::Location).void } + def reference_constant(name, location); end + + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:85 + sig { params(name: ::String, location: ::Spoom::Location).void } + def reference_method(name, location); end + + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:22 + sig { returns(T::Hash[::String, T::Array[::Spoom::Model::Reference]]) } + def references; end +end + +# pkg:gem/spoom#lib/spoom/deadcode/index.rb:7 +class Spoom::Deadcode::Index::Error < ::Spoom::Error + # pkg:gem/spoom#lib/spoom/deadcode/index.rb:9 + sig { params(message: ::String, parent: ::Exception).void } + def initialize(message, parent:); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/indexer.rb:6 +class Spoom::Deadcode::Indexer < ::Spoom::Visitor + # pkg:gem/spoom#lib/spoom/deadcode/indexer.rb:14 + sig do + params( + path: ::String, + index: ::Spoom::Deadcode::Index, + plugins: T::Array[::Spoom::Deadcode::Plugins::Base] + ).void + end + def initialize(path, index, plugins: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/deadcode/indexer.rb:11 + sig { returns(::Spoom::Deadcode::Index) } + def index; end + + # pkg:gem/spoom#lib/spoom/deadcode/indexer.rb:8 + sig { returns(::String) } + def path; end + + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/indexer.rb:26 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins.rb:33 +Spoom::Deadcode::PLUGINS_FOR_GEM = T.let(T.unsafe(nil), Hash) + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:8 +module Spoom::Deadcode::Plugins; end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/action_mailer.rb:7 +class Spoom::Deadcode::Plugins::ActionMailer < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/action_mailer.rb:10 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/action_mailer_preview.rb:7 +class Spoom::Deadcode::Plugins::ActionMailerPreview < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/action_mailer_preview.rb:12 + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/actionpack.rb:7 +class Spoom::Deadcode::Plugins::ActionPack < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/actionpack.rb:27 + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end + + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/actionpack.rb:36 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/actionpack.rb:10 +Spoom::Deadcode::Plugins::ActionPack::CALLBACKS = T.let(T.unsafe(nil), Array) + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/active_job.rb:7 +class Spoom::Deadcode::Plugins::ActiveJob < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/active_job.rb:22 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/active_job.rb:11 +Spoom::Deadcode::Plugins::ActiveJob::CALLBACKS = T.let(T.unsafe(nil), Array) + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/active_model.rb:7 +class Spoom::Deadcode::Plugins::ActiveModel < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/active_model.rb:13 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/active_record.rb:7 +class Spoom::Deadcode::Plugins::ActiveRecord < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/active_record.rb:69 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/active_record.rb:61 +Spoom::Deadcode::Plugins::ActiveRecord::ARRAY_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/active_record.rb:18 +Spoom::Deadcode::Plugins::ActiveRecord::CALLBACKS = T.let(T.unsafe(nil), Array) + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/active_record.rb:44 +Spoom::Deadcode::Plugins::ActiveRecord::CALLBACK_CONDITIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/active_record.rb:49 +Spoom::Deadcode::Plugins::ActiveRecord::CRUD_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/active_support.rb:7 +class Spoom::Deadcode::Plugins::ActiveSupport < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/active_support.rb:23 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/active_support.rb:19 +Spoom::Deadcode::Plugins::ActiveSupport::SETUP_AND_TEARDOWN_METHODS = T.let(T.unsafe(nil), Array) + +# @abstract +# +# pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:10 +class Spoom::Deadcode::Plugins::Base + abstract! + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:126 + sig { params(index: ::Spoom::Deadcode::Index).void } + def initialize(index); end + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:123 + sig { returns(::Spoom::Deadcode::Index) } + def index; end + + # Do not override this method, use `on_define_accessor` instead. + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:152 + sig { params(definition: ::Spoom::Model::Attr).void } + def internal_on_define_accessor(definition); end + + # Do not override this method, use `on_define_class` instead. + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:176 + sig { params(definition: ::Spoom::Model::Class).void } + def internal_on_define_class(definition); end + + # Do not override this method, use `on_define_constant` instead. + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:206 + sig { params(definition: ::Spoom::Model::Constant).void } + def internal_on_define_constant(definition); end + + # Do not override this method, use `on_define_method` instead. + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:232 + sig { params(definition: ::Spoom::Model::Method).void } + def internal_on_define_method(definition); end + + # Do not override this method, use `on_define_module` instead. + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:258 + sig { params(definition: ::Spoom::Model::Module).void } + def internal_on_define_module(definition); end + + # Called when an accessor is defined. + # + # Will be called when the indexer processes a `attr_reader`, `attr_writer` or `attr_accessor` node. + # Note that when this method is called, the definition for the node has already been added to the index. + # It is still possible to ignore it from the plugin: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # def on_define_accessor(definition) + # @index.ignore(definition) if symbol_def.name == "foo" + # end + # end + # ~~~ + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:146 + sig { params(definition: ::Spoom::Model::Attr).void } + def on_define_accessor(definition); end + + # Called when a class is defined. + # + # Will be called when the indexer processes a `class` node. + # Note that when this method is called, the definition for the node has already been added to the index. + # It is still possible to ignore it from the plugin: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # def on_define_class(definition) + # @index.ignore(definition) if definition.name == "Foo" + # end + # end + # ~~~ + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:170 + sig { params(definition: ::Spoom::Model::Class).void } + def on_define_class(definition); end + + # Called when a constant is defined. + # + # Will be called when the indexer processes a `CONST =` node. + # Note that when this method is called, the definition for the node has already been added to the index. + # It is still possible to ignore it from the plugin: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # def on_define_constant(definition) + # @index.ignore(definition) if definition.name == "FOO" + # end + # end + # ~~~ + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:200 + sig { params(definition: ::Spoom::Model::Constant).void } + def on_define_constant(definition); end + + # Called when a method is defined. + # + # Will be called when the indexer processes a `def` or `defs` node. + # Note that when this method is called, the definition for the node has already been added to the index. + # It is still possible to ignore it from the plugin: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # def on_define_method(definition) + # @index.ignore(definition) if definition.name == "foo" + # end + # end + # ~~~ + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:226 + sig { params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end + + # Called when a module is defined. + # + # Will be called when the indexer processes a `module` node. + # Note that when this method is called, the definition for the node has already been added to the index. + # It is still possible to ignore it from the plugin: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # def on_define_module(definition) + # @index.ignore(definition) if definition.name == "Foo" + # end + # end + # ~~~ + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:252 + sig { params(definition: ::Spoom::Model::Module).void } + def on_define_module(definition); end + + # Called when a send is being processed + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # def on_send(send) + # return unless send.name == "dsl_method" + # return if send.args.empty? + # + # method_name = send.args.first.slice.delete_prefix(":") + # @index.reference_method(method_name, send.node, send.loc) + # end + # end + # ~~~ + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:278 + sig { params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end + + private + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:346 + sig { params(name: ::String).returns(::String) } + def camelize(name); end + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:295 + sig { params(name: T.nilable(::String)).returns(T::Boolean) } + def ignored_class_name?(name); end + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:314 + sig { params(name: ::String).returns(T::Boolean) } + def ignored_constant_name?(name); end + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:319 + sig { params(name: ::String).returns(T::Boolean) } + def ignored_method_name?(name); end + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:324 + sig { params(name: ::String).returns(T::Boolean) } + def ignored_module_name?(name); end + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:329 + sig { params(name: ::String, names_variable: ::Symbol, patterns_variable: ::Symbol).returns(T::Boolean) } + def ignored_name?(name, names_variable, patterns_variable); end + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:302 + sig { params(definition: ::Spoom::Model::Class).returns(T::Boolean) } + def ignored_subclass?(definition); end + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:334 + sig { params(const: ::Symbol).returns(T::Set[::String]) } + def names(const); end + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:339 + sig { params(const: ::Symbol).returns(T::Array[::Regexp]) } + def patterns(const); end + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:287 + sig { params(definition: ::Spoom::Model::Namespace, superclass_name: ::String).returns(T::Boolean) } + def subclass_of?(definition, superclass_name); end + + class << self + # Mark classes directly subclassing a class matching `names` as ignored. + # + # Names can be either strings or regexps: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # ignore_classes_inheriting_from( + # "Foo", + # "Bar", + # /Baz.*/, + # ) + # end + # ~~~ + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:46 + sig { params(names: T.any(::Regexp, ::String)).void } + def ignore_classes_inheriting_from(*names); end + + # Mark classes matching `names` as ignored. + # + # Names can be either strings or regexps: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # ignore_class_names( + # "Foo", + # "Bar", + # /Baz.*/, + # ) + # end + # ~~~ + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:28 + sig { params(names: T.any(::Regexp, ::String)).void } + def ignore_classes_named(*names); end + + # Mark constants matching `names` as ignored. + # + # Names can be either strings or regexps: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # ignore_class_names( + # "FOO", + # "BAR", + # /BAZ.*/, + # ) + # end + # ~~~ + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:64 + sig { params(names: T.any(::Regexp, ::String)).void } + def ignore_constants_named(*names); end + + # Mark methods matching `names` as ignored. + # + # Names can be either strings or regexps: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # ignore_method_names( + # "foo", + # "bar", + # /baz.*/, + # ) + # end + # ~~~ + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:82 + sig { params(names: T.any(::Regexp, ::String)).void } + def ignore_methods_named(*names); end + + # Mark modules matching `names` as ignored. + # + # Names can be either strings or regexps: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # ignore_class_names( + # "Foo", + # "Bar", + # /Baz.*/, + # ) + # end + # ~~~ + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:100 + sig { params(names: T.any(::Regexp, ::String)).void } + def ignore_modules_named(*names); end + + private + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/base.rb:107 + sig do + params( + names: T::Array[T.any(::Regexp, ::String)], + names_variable: ::Symbol, + patterns_variable: ::Symbol + ).void + end + def save_names_and_patterns(names, names_variable, patterns_variable); end + end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/graphql.rb:7 +class Spoom::Deadcode::Plugins::GraphQL < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/graphql.rb:27 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/minitest.rb:7 +class Spoom::Deadcode::Plugins::Minitest < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/minitest.rb:21 + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end + + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/minitest.rb:28 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/namespaces.rb:7 +class Spoom::Deadcode::Plugins::Namespaces < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/namespaces.rb:10 + sig { override.params(definition: ::Spoom::Model::Class).void } + def on_define_class(definition); end + + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/namespaces.rb:16 + sig { override.params(definition: ::Spoom::Model::Module).void } + def on_define_module(definition); end + + private + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/namespaces.rb:23 + sig { params(symbol_def: ::Spoom::Model::Namespace).returns(T::Boolean) } + def used_as_namespace?(symbol_def); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/rspec.rb:7 +class Spoom::Deadcode::Plugins::RSpec < ::Spoom::Deadcode::Plugins::Base; end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/rails.rb:7 +class Spoom::Deadcode::Plugins::Rails < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/rails.rb:12 + sig { override.params(definition: ::Spoom::Model::Class).void } + def on_define_class(definition); end + + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/rails.rb:18 + sig { override.params(definition: ::Spoom::Model::Module).void } + def on_define_module(definition); end + + private + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/rails.rb:25 + sig { params(symbol_def: ::Spoom::Model::Namespace).returns(T::Boolean) } + def file_is_helper?(symbol_def); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/rake.rb:7 +class Spoom::Deadcode::Plugins::Rake < ::Spoom::Deadcode::Plugins::Base; end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/rubocop.rb:7 +class Spoom::Deadcode::Plugins::Rubocop < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/rubocop.rb:17 + sig { override.params(definition: ::Spoom::Model::Constant).void } + def on_define_constant(definition); end + + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/rubocop.rb:26 + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/rubocop.rb:8 +Spoom::Deadcode::Plugins::Rubocop::RUBOCOP_CONSTANTS = T.let(T.unsafe(nil), Set) + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/ruby.rb:7 +class Spoom::Deadcode::Plugins::Ruby < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/ruby.rb:23 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end + + private + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/ruby.rb:51 + sig { params(send: ::Spoom::Deadcode::Send, node: ::Prism::Node).void } + def reference_symbol_as_constant(send, node); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/sorbet.rb:7 +class Spoom::Deadcode::Plugins::Sorbet < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/sorbet.rb:10 + sig { override.params(definition: ::Spoom::Model::Constant).void } + def on_define_constant(definition); end + + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/sorbet.rb:16 + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end + + private + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/sorbet.rb:34 + sig { params(definition: ::Spoom::Model::Constant).returns(T::Boolean) } + def sorbet_enum_constant?(definition); end + + # pkg:gem/spoom#lib/spoom/deadcode/plugins/sorbet.rb:29 + sig { params(definition: ::Spoom::Model::Constant).returns(T::Boolean) } + def sorbet_type_member?(definition); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/plugins/thor.rb:7 +class Spoom::Deadcode::Plugins::Thor < ::Spoom::Deadcode::Plugins::Base + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/plugins/thor.rb:12 + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/remover.rb:6 +class Spoom::Deadcode::Remover + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:10 + sig { params(context: ::Spoom::Context).void } + def initialize(context); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:15 + sig { params(kind: T.nilable(::Spoom::Deadcode::Definition::Kind), location: ::Spoom::Location).returns(::String) } + def remove_location(kind, location); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/remover.rb:7 +class Spoom::Deadcode::Remover::Error < ::Spoom::Error; end + +# pkg:gem/spoom#lib/spoom/deadcode/remover.rb:366 +class Spoom::Deadcode::Remover::NodeContext + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:377 + sig do + params( + source: ::String, + comments: T::Hash[::Integer, ::Prism::Comment], + node: ::Prism::Node, + nesting: T::Array[::Prism::Node] + ).void + end + def initialize(source, comments, node, nesting); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:491 + sig { params(node: ::Prism::Node).returns(T::Array[::Prism::Comment]) } + def attached_comments(node); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:519 + sig { returns(T.nilable(::Prism::CallNode)) } + def attached_sig; end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:506 + sig { returns(T::Array[::Prism::Node]) } + def attached_sigs; end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:368 + sig { returns(T::Hash[::Integer, ::Prism::Comment]) } + def comments; end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:479 + sig { params(start_line: ::Integer, end_line: ::Integer).returns(T::Array[::Prism::Comment]) } + def comments_between_lines(start_line, end_line); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:374 + sig { returns(T::Array[::Prism::Node]) } + def nesting; end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:374 + def nesting=(_arg0); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:429 + sig { returns(T.nilable(::Prism::Node)) } + def next_node; end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:418 + sig { returns(T::Array[::Prism::Node]) } + def next_nodes; end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:371 + sig { returns(::Prism::Node) } + def node; end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:393 + sig { returns(::Spoom::Deadcode::Remover::NodeContext) } + def parent_context; end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:385 + sig { returns(::Prism::Node) } + def parent_node; end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:413 + sig { returns(T.nilable(::Prism::Node)) } + def previous_node; end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:402 + sig { returns(T::Array[::Prism::Node]) } + def previous_nodes; end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:434 + sig { returns(T.nilable(::Spoom::Deadcode::Remover::NodeContext)) } + def sclass_context; end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:467 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def sorbet_extend_sig?(node); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:462 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def sorbet_signature?(node); end +end + +# pkg:gem/spoom#lib/spoom/deadcode/remover.rb:534 +class Spoom::Deadcode::Remover::NodeFinder < ::Spoom::Visitor + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:599 + sig { params(location: ::Spoom::Location, kind: T.nilable(::Spoom::Deadcode::Definition::Kind)).void } + def initialize(location, kind); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:593 + sig { returns(T.nilable(::Prism::Node)) } + def node; end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:596 + sig { returns(T::Array[::Prism::Node]) } + def nodes_nesting; end + + # @override + # + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:609 + sig { override.params(node: T.nilable(::Prism::Node)).void } + def visit(node); end + + class << self + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:537 + sig do + params( + source: ::String, + location: ::Spoom::Location, + kind: T.nilable(::Spoom::Deadcode::Definition::Kind) + ).returns(::Spoom::Deadcode::Remover::NodeContext) + end + def find(source, location, kind); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:568 + sig { params(node: ::Prism::Node, kind: ::Spoom::Deadcode::Definition::Kind).returns(T::Boolean) } + def node_match_kind?(node, kind); end + end +end + +# pkg:gem/spoom#lib/spoom/deadcode/remover.rb:27 +class Spoom::Deadcode::Remover::NodeRemover + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:32 + sig do + params( + source: ::String, + kind: T.nilable(::Spoom::Deadcode::Definition::Kind), + location: ::Spoom::Location + ).void + end + def initialize(source, kind, location); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:42 + sig { void } + def apply_edit; end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:29 + sig { returns(::String) } + def new_source; end + + private + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:151 + sig { params(context: ::Spoom::Deadcode::Remover::NodeContext).void } + def delete_attr_accessor(context); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:325 + sig { params(start_char: ::Integer, end_char: ::Integer).void } + def delete_chars(start_char, end_char); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:69 + sig { params(context: ::Spoom::Deadcode::Remover::NodeContext).void } + def delete_constant_assignment(context); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:318 + sig { params(start_line: ::Integer, end_line: ::Integer).void } + def delete_lines(start_line, end_line); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:255 + sig { params(context: ::Spoom::Deadcode::Remover::NodeContext).void } + def delete_node_and_comments_and_sigs(context); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:212 + sig do + params( + node: ::Prism::Node, + send_context: ::Spoom::Deadcode::Remover::NodeContext, + was_removed: T::Boolean + ).void + end + def insert_accessor(node, send_context, was_removed:); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:330 + sig { params(start_char: ::Integer, end_char: ::Integer, replacement: ::String).void } + def replace_chars(start_char, end_char, replacement); end + + # pkg:gem/spoom#lib/spoom/deadcode/remover.rb:335 + sig do + params( + node: ::Prism::CallNode, + name: ::String, + kind: T.nilable(::Spoom::Deadcode::Definition::Kind) + ).returns(::String) + end + def transform_sig(node, name:, kind:); end +end + +# An abstraction to simplify handling of Prism::CallNode nodes. +# +# pkg:gem/spoom#lib/spoom/deadcode/send.rb:7 +class Spoom::Deadcode::Send < ::T::Struct + const :node, ::Prism::CallNode + const :name, ::String + const :recv, T.nilable(::Prism::Node), default: T.unsafe(nil) + const :args, T::Array[::Prism::Node], default: T.unsafe(nil) + const :block, T.nilable(::Prism::Node), default: T.unsafe(nil) + const :location, ::Spoom::Location + + # pkg:gem/spoom#lib/spoom/deadcode/send.rb:16 + sig do + type_parameters(:T) + .params( + arg_type: T::Class[T.type_parameter(:T)], + block: T.proc.params(arg: T.type_parameter(:T)).void + ).void + end + def each_arg(arg_type, &block); end + + # pkg:gem/spoom#lib/spoom/deadcode/send.rb:23 + sig { params(block: T.proc.params(key: ::Prism::Node, value: T.nilable(::Prism::Node)).void).void } + def each_arg_assoc(&block); end +end + +# pkg:gem/spoom#lib/spoom.rb:10 +class Spoom::Error < ::StandardError; end + +# pkg:gem/spoom#lib/spoom/context/exec.rb:7 +class Spoom::ExecResult < ::T::Struct + const :out, ::String + const :err, T.nilable(::String) + const :status, T::Boolean + const :exit_code, ::Integer + + # pkg:gem/spoom#lib/spoom/context/exec.rb:14 + sig { returns(::String) } + def to_s; end +end + +# pkg:gem/spoom#lib/spoom/file_collector.rb:5 +class Spoom::FileCollector + # Initialize a new file collector + # + # If `allow_extensions` is empty, all files are collected. + # If `allow_extensions` is an array of extensions, only files with one of these extensions are collected. + # + # If `allow_mime_types` is empty, all files are collected. + # If `allow_mime_types` is an array of mimetypes, files without an extension are collected if their mimetype is in + # the list. + # + # pkg:gem/spoom#lib/spoom/file_collector.rb:18 + sig do + params( + allow_extensions: T::Array[::String], + allow_mime_types: T::Array[::String], + exclude_patterns: T::Array[::String] + ).void + end + def initialize(allow_extensions: T.unsafe(nil), allow_mime_types: T.unsafe(nil), exclude_patterns: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/file_collector.rb:7 + sig { returns(T::Array[::String]) } + def files; end + + # pkg:gem/spoom#lib/spoom/file_collector.rb:31 + sig { params(path: ::String).void } + def visit_path(path); end + + # pkg:gem/spoom#lib/spoom/file_collector.rb:26 + sig { params(paths: T::Array[::String]).void } + def visit_paths(paths); end + + private + + # pkg:gem/spoom#lib/spoom/file_collector.rb:48 + sig { params(path: ::String).returns(::String) } + def clean_path(path); end + + # pkg:gem/spoom#lib/spoom/file_collector.rb:65 + sig { params(path: ::String).returns(T::Boolean) } + def excluded_file?(path); end + + # pkg:gem/spoom#lib/spoom/file_collector.rb:80 + sig { params(path: ::String).returns(T::Boolean) } + def excluded_path?(path); end + + # pkg:gem/spoom#lib/spoom/file_collector.rb:89 + sig { params(path: ::String).returns(T.nilable(::String)) } + def mime_type_for(path); end + + # pkg:gem/spoom#lib/spoom/file_collector.rb:60 + sig { params(path: ::String).void } + def visit_directory(path); end + + # pkg:gem/spoom#lib/spoom/file_collector.rb:53 + sig { params(path: ::String).void } + def visit_file(path); end +end + +# Build a file hierarchy from a set of file paths. +# +# pkg:gem/spoom#lib/spoom/file_tree.rb:6 +class Spoom::FileTree + # pkg:gem/spoom#lib/spoom/file_tree.rb:8 + sig { params(paths: T::Enumerable[::String]).void } + def initialize(paths = T.unsafe(nil)); end + + # Add a `path` to the tree + # + # This will create all nodes until the root of `path`. + # + # pkg:gem/spoom#lib/spoom/file_tree.rb:23 + sig { params(path: ::String).returns(::Spoom::FileTree::Node) } + def add_path(path); end + + # Add all `paths` to the tree + # + # pkg:gem/spoom#lib/spoom/file_tree.rb:15 + sig { params(paths: T::Enumerable[::String]).void } + def add_paths(paths); end + + # All the nodes in this tree + # + # pkg:gem/spoom#lib/spoom/file_tree.rb:43 + sig { returns(T::Array[::Spoom::FileTree::Node]) } + def nodes; end + + # Return a map of typing scores for each node in the tree + # + # pkg:gem/spoom#lib/spoom/file_tree.rb:57 + sig { params(context: ::Spoom::Context).returns(T::Hash[::Spoom::FileTree::Node, ::Float]) } + def nodes_strictness_scores(context); end + + # All the paths in this tree + # + # pkg:gem/spoom#lib/spoom/file_tree.rb:51 + sig { returns(T::Array[::String]) } + def paths; end + + # Return a map of typing scores for each path in the tree + # + # pkg:gem/spoom#lib/spoom/file_tree.rb:65 + sig { params(context: ::Spoom::Context).returns(T::Hash[::String, ::Float]) } + def paths_strictness_scores(context); end + + # pkg:gem/spoom#lib/spoom/file_tree.rb:70 + sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean).void } + def print(out: T.unsafe(nil), colors: T.unsafe(nil)); end + + # All root nodes + # + # pkg:gem/spoom#lib/spoom/file_tree.rb:37 + sig { returns(T::Array[::Spoom::FileTree::Node]) } + def roots; end +end + +# A visitor that collects all the nodes in a tree +# +# pkg:gem/spoom#lib/spoom/file_tree.rb:116 +class Spoom::FileTree::CollectNodes < ::Spoom::FileTree::Visitor + # pkg:gem/spoom#lib/spoom/file_tree.rb:121 + sig { void } + def initialize; end + + # pkg:gem/spoom#lib/spoom/file_tree.rb:118 + sig { returns(T::Array[::Spoom::FileTree::Node]) } + def nodes; end + + # @override + # + # pkg:gem/spoom#lib/spoom/file_tree.rb:128 + sig { override.params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end +end + +# A visitor that collects the typing score of each node in a tree +# +# pkg:gem/spoom#lib/spoom/file_tree.rb:157 +class Spoom::FileTree::CollectScores < ::Spoom::FileTree::CollectStrictnesses + # pkg:gem/spoom#lib/spoom/file_tree.rb:162 + sig { params(context: ::Spoom::Context).void } + def initialize(context); end + + # pkg:gem/spoom#lib/spoom/file_tree.rb:159 + sig { returns(T::Hash[::Spoom::FileTree::Node, ::Float]) } + def scores; end + + # @override + # + # pkg:gem/spoom#lib/spoom/file_tree.rb:170 + sig { override.params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end + + private + + # pkg:gem/spoom#lib/spoom/file_tree.rb:179 + sig { params(node: ::Spoom::FileTree::Node).returns(::Float) } + def node_score(node); end + + # pkg:gem/spoom#lib/spoom/file_tree.rb:188 + sig { params(strictness: T.nilable(::String)).returns(::Float) } + def strictness_score(strictness); end +end + +# A visitor that collects the strictness of each node in a tree +# +# pkg:gem/spoom#lib/spoom/file_tree.rb:135 +class Spoom::FileTree::CollectStrictnesses < ::Spoom::FileTree::Visitor + # pkg:gem/spoom#lib/spoom/file_tree.rb:140 + sig { params(context: ::Spoom::Context).void } + def initialize(context); end + + # pkg:gem/spoom#lib/spoom/file_tree.rb:137 + sig { returns(T::Hash[::Spoom::FileTree::Node, T.nilable(::String)]) } + def strictnesses; end + + # @override + # + # pkg:gem/spoom#lib/spoom/file_tree.rb:148 + sig { override.params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end +end + +# A node representing either a file or a directory inside a FileTree +# +# pkg:gem/spoom#lib/spoom/file_tree.rb:76 +class Spoom::FileTree::Node < ::T::Struct + const :parent, T.nilable(::Spoom::FileTree::Node) + const :name, ::String + const :children, T::Hash[::String, ::Spoom::FileTree::Node], default: T.unsafe(nil) + + # Full path to this node from root + # + # pkg:gem/spoom#lib/spoom/file_tree.rb:88 + sig { returns(::String) } + def path; end +end + +# An internal class used to print a FileTree +# +# See `FileTree#print` +# +# pkg:gem/spoom#lib/spoom/file_tree.rb:201 +class Spoom::FileTree::Printer < ::Spoom::FileTree::Visitor + # pkg:gem/spoom#lib/spoom/file_tree.rb:203 + sig do + params( + strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], + out: T.any(::IO, ::StringIO), + colors: T::Boolean + ).void + end + def initialize(strictnesses, out: T.unsafe(nil), colors: T.unsafe(nil)); end + + # @override + # + # pkg:gem/spoom#lib/spoom/file_tree.rb:212 + sig { override.params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end + + private + + # pkg:gem/spoom#lib/spoom/file_tree.rb:237 + sig { params(strictness: T.nilable(::String)).returns(::Spoom::Color) } + def strictness_color(strictness); end +end + +# An abstract visitor for FileTree +# @abstract +# +# pkg:gem/spoom#lib/spoom/file_tree.rb:98 +class Spoom::FileTree::Visitor + abstract! + + # pkg:gem/spoom#lib/spoom/file_tree.rb:105 + sig { params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end + + # pkg:gem/spoom#lib/spoom/file_tree.rb:110 + sig { params(nodes: T::Array[::Spoom::FileTree::Node]).void } + def visit_nodes(nodes); end + + # pkg:gem/spoom#lib/spoom/file_tree.rb:100 + sig { params(tree: ::Spoom::FileTree).void } + def visit_tree(tree); end +end + +# pkg:gem/spoom#lib/spoom/context/git.rb:5 +module Spoom::Git; end + +# pkg:gem/spoom#lib/spoom/context/git.rb:6 +class Spoom::Git::Commit < ::T::Struct + const :sha, ::String + const :time, ::Time + + # pkg:gem/spoom#lib/spoom/context/git.rb:23 + sig { returns(::Integer) } + def timestamp; end + + class << self + # Parse a line formatted as `%h %at` into a `Commit` + # + # pkg:gem/spoom#lib/spoom/context/git.rb:10 + sig { params(string: ::String).returns(T.nilable(::Spoom::Git::Commit)) } + def parse_line(string); end + end +end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/base.rb:5 +module Spoom::LSP; end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:13 +class Spoom::LSP::Client + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:15 + sig { params(sorbet_bin: ::String, sorbet_args: ::String, path: ::String).void } + def initialize(sorbet_bin, *sorbet_args, path: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:227 + sig { void } + def close; end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:129 + sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::Location]) } + def definitions(uri, line, column); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:210 + sig { params(uri: ::String).returns(T::Array[::Spoom::LSP::DocumentSymbol]) } + def document_symbols(uri); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:87 + sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T.nilable(::Spoom::LSP::Hover)) } + def hover(uri, line, column); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:25 + sig { returns(::Integer) } + def next_id; end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:70 + sig { params(workspace_path: ::String).void } + def open(workspace_path); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:52 + sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) } + def read; end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:41 + sig { returns(T.nilable(::String)) } + def read_raw; end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:171 + sig do + params( + uri: ::String, + line: ::Integer, + column: ::Integer, + include_decl: T::Boolean + ).returns(T::Array[::Spoom::LSP::Location]) + end + def references(uri, line, column, include_decl = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:35 + sig { params(message: ::Spoom::LSP::Message).returns(T.nilable(T::Hash[T.untyped, T.untyped])) } + def send(message); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:30 + sig { params(json_string: ::String).void } + def send_raw(json_string); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:108 + sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::SignatureHelp]) } + def signatures(uri, line, column); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:195 + sig { params(query: ::String).returns(T::Array[::Spoom::LSP::DocumentSymbol]) } + def symbols(query); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp.rb:150 + sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::Location]) } + def type_definitions(uri, line, column); end +end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:165 +class Spoom::LSP::Diagnostic < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :range, ::Spoom::LSP::Range + const :code, ::Integer + const :message, ::String + const :information, ::Object + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:187 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:192 + sig { returns(::String) } + def to_s; end + + class << self + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:175 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Diagnostic) } + def from_json(json); end + end +end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:197 +class Spoom::LSP::DocumentSymbol < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :name, ::String + const :detail, T.nilable(::String) + const :kind, ::Integer + const :location, T.nilable(::Spoom::LSP::Location) + const :range, T.nilable(::Spoom::LSP::Range) + const :children, T::Array[::Spoom::LSP::DocumentSymbol] + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:223 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:255 + sig { returns(::String) } + def kind_string; end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:250 + sig { returns(::String) } + def to_s; end + + class << self + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:209 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::DocumentSymbol) } + def from_json(json); end + end +end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:259 +Spoom::LSP::DocumentSymbol::SYMBOL_KINDS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/errors.rb:6 +class Spoom::LSP::Error < ::Spoom::Error; end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/errors.rb:7 +class Spoom::LSP::Error::AlreadyOpen < ::Spoom::LSP::Error; end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/errors.rb:8 +class Spoom::LSP::Error::BadHeaders < ::Spoom::LSP::Error; end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/errors.rb:10 +class Spoom::LSP::Error::Diagnostics < ::Spoom::LSP::Error + # pkg:gem/spoom#lib/spoom/sorbet/lsp/errors.rb:28 + sig { params(uri: ::String, diagnostics: T::Array[::Spoom::LSP::Diagnostic]).void } + def initialize(uri, diagnostics); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/errors.rb:15 + sig { returns(T::Array[::Spoom::LSP::Diagnostic]) } + def diagnostics; end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/errors.rb:12 + sig { returns(::String) } + def uri; end + + class << self + # pkg:gem/spoom#lib/spoom/sorbet/lsp/errors.rb:19 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Error::Diagnostics) } + def from_json(json); end + end +end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:16 +class Spoom::LSP::Hover < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :contents, ::String + const :range, T.nilable(T::Range[T.untyped]) + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:34 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:40 + sig { returns(::String) } + def to_s; end + + class << self + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:24 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Hover) } + def from_json(json); end + end +end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:103 +class Spoom::LSP::Location < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :uri, ::String + const :range, ::Spoom::LSP::Range + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:121 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:127 + sig { returns(::String) } + def to_s; end + + class << self + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:111 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Location) } + def from_json(json); end + end +end + +# A general message as defined by JSON-RPC. +# +# The language server protocol always uses `"2.0"` as the `jsonrpc` version. +# +# pkg:gem/spoom#lib/spoom/sorbet/lsp/base.rb:12 +class Spoom::LSP::Message + # pkg:gem/spoom#lib/spoom/sorbet/lsp/base.rb:14 + sig { void } + def initialize; end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/base.rb:19 + sig { returns(T::Hash[T.untyped, T.untyped]) } + def as_json; end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/base.rb:27 + sig { params(args: T.untyped).returns(::String) } + def to_json(*args); end +end + +# A notification message. +# +# A processed notification message must not send a response back. They work like events. +# +# pkg:gem/spoom#lib/spoom/sorbet/lsp/base.rb:54 +class Spoom::LSP::Notification < ::Spoom::LSP::Message + # pkg:gem/spoom#lib/spoom/sorbet/lsp/base.rb:62 + sig { params(method: ::String, params: T::Hash[T.untyped, T.untyped]).void } + def initialize(method, params); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/base.rb:56 + sig { returns(::String) } + def method; end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/base.rb:59 + sig { returns(T::Hash[T.untyped, T.untyped]) } + def params; end +end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:45 +class Spoom::LSP::Position < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :line, ::Integer + const :char, ::Integer + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:63 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:68 + sig { returns(::String) } + def to_s; end + + class << self + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:53 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Position) } + def from_json(json); end + end +end + +# @interface +# +# pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:10 +module Spoom::LSP::PrintableSymbol + interface! + + # @abstract + # + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:13 + sig { abstract.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end +end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:73 +class Spoom::LSP::Range < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :start, ::Spoom::LSP::Position + const :end, ::Spoom::LSP::Position + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:91 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:98 + sig { returns(::String) } + def to_s; end + + class << self + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:81 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Range) } + def from_json(json); end + end +end + +# A request message to describe a request between the client and the server. +# +# Every processed request must send a response back to the sender of the request. +# +# pkg:gem/spoom#lib/spoom/sorbet/lsp/base.rb:35 +class Spoom::LSP::Request < ::Spoom::LSP::Message + # pkg:gem/spoom#lib/spoom/sorbet/lsp/base.rb:43 + sig { params(id: ::Integer, method: ::String, params: T::Hash[T.untyped, T.untyped]).void } + def initialize(id, method, params); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/base.rb:37 + sig { returns(::Integer) } + def id; end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/base.rb:40 + sig { returns(T::Hash[T.untyped, T.untyped]) } + def params; end +end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/errors.rb:36 +class Spoom::LSP::ResponseError < ::Spoom::LSP::Error + # pkg:gem/spoom#lib/spoom/sorbet/lsp/errors.rb:55 + sig { params(code: ::Integer, message: ::String, data: T::Hash[T.untyped, T.untyped]).void } + def initialize(code, message, data); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/errors.rb:38 + sig { returns(::Integer) } + def code; end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/errors.rb:41 + sig { returns(T::Hash[T.untyped, T.untyped]) } + def data; end + + class << self + # pkg:gem/spoom#lib/spoom/sorbet/lsp/errors.rb:45 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::ResponseError) } + def from_json(json); end + end +end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:132 +class Spoom::LSP::SignatureHelp < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :label, T.nilable(::String) + const :doc, ::Object + const :params, T::Array[T.untyped] + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:152 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:160 + sig { returns(::String) } + def to_s; end + + class << self + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:141 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::SignatureHelp) } + def from_json(json); end + end +end + +# pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:289 +class Spoom::LSP::SymbolPrinter < ::Spoom::Printer + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:297 + sig do + params( + out: T.any(::IO, ::StringIO), + colors: T::Boolean, + indent_level: ::Integer, + prefix: T.nilable(::String) + ).void + end + def initialize(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil), prefix: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:319 + sig { params(uri: ::String).returns(::String) } + def clean_uri(uri); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:294 + sig { returns(T.nilable(::String)) } + def prefix; end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:294 + def prefix=(_arg0); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:327 + sig { params(objects: T::Array[::Spoom::LSP::PrintableSymbol]).void } + def print_list(objects); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:307 + sig { params(object: T.nilable(::Spoom::LSP::PrintableSymbol)).void } + def print_object(object); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:314 + sig { params(objects: T::Array[::Spoom::LSP::PrintableSymbol]).void } + def print_objects(objects); end + + # pkg:gem/spoom#lib/spoom/sorbet/lsp/structures.rb:291 + sig { returns(T::Set[::Integer]) } + def seen; end +end + +# pkg:gem/spoom#lib/spoom/location.rb:5 +class Spoom::Location + include ::Comparable + + # pkg:gem/spoom#lib/spoom/location.rb:61 + sig do + params( + file: ::String, + start_line: T.nilable(::Integer), + start_column: T.nilable(::Integer), + end_line: T.nilable(::Integer), + end_column: T.nilable(::Integer) + ).void + end + def initialize(file, start_line: T.unsafe(nil), start_column: T.unsafe(nil), end_line: T.unsafe(nil), end_column: T.unsafe(nil)); end + + # @override + # + # pkg:gem/spoom#lib/spoom/location.rb:95 + sig { override.params(other: ::BasicObject).returns(T.nilable(::Integer)) } + def <=>(other); end + + # pkg:gem/spoom#lib/spoom/location.rb:58 + def end_column; end + + # pkg:gem/spoom#lib/spoom/location.rb:58 + def end_line; end + + # pkg:gem/spoom#lib/spoom/location.rb:55 + sig { returns(::String) } + def file; end + + # pkg:gem/spoom#lib/spoom/location.rb:81 + sig { params(other: ::Spoom::Location).returns(T::Boolean) } + def include?(other); end + + # pkg:gem/spoom#lib/spoom/location.rb:58 + def start_column; end + + # pkg:gem/spoom#lib/spoom/location.rb:58 + sig { returns(T.nilable(::Integer)) } + def start_line; end + + # pkg:gem/spoom#lib/spoom/location.rb:118 + sig { returns(::String) } + def to_s; end + + class << self + # pkg:gem/spoom#lib/spoom/location.rb:43 + sig { params(file: ::String, location: ::Prism::Location).returns(::Spoom::Location) } + def from_prism(file, location); end + + # pkg:gem/spoom#lib/spoom/location.rb:12 + sig { params(location_string: ::String).returns(::Spoom::Location) } + def from_string(location_string); end + end +end + +# pkg:gem/spoom#lib/spoom/location.rb:8 +class Spoom::Location::LocationError < ::Spoom::Error; end + +# pkg:gem/spoom#lib/spoom/model/model.rb:5 +class Spoom::Model + # pkg:gem/spoom#lib/spoom/model/model.rb:240 + sig { void } + def initialize; end + + # Get a symbol by it's full name + # + # Raises an error if the symbol is not found + # + # pkg:gem/spoom#lib/spoom/model/model.rb:249 + sig { params(full_name: ::String).returns(::Spoom::Model::Symbol) } + def [](full_name); end + + # pkg:gem/spoom#lib/spoom/model/model.rb:298 + sig { void } + def finalize!; end + + # Register a new symbol by it's full name + # + # If the symbol already exists, it will be returned. + # + # pkg:gem/spoom#lib/spoom/model/model.rb:260 + sig { params(full_name: ::String).returns(::Spoom::Model::Symbol) } + def register_symbol(full_name); end + + # pkg:gem/spoom#lib/spoom/model/model.rb:265 + sig { params(full_name: ::String, context: ::Spoom::Model::Symbol).returns(::Spoom::Model::Symbol) } + def resolve_symbol(full_name, context:); end + + # pkg:gem/spoom#lib/spoom/model/model.rb:292 + sig { params(symbol: ::Spoom::Model::Symbol).returns(T::Array[::Spoom::Model::Symbol]) } + def subtypes(symbol); end + + # pkg:gem/spoom#lib/spoom/model/model.rb:286 + sig { params(symbol: ::Spoom::Model::Symbol).returns(T::Array[::Spoom::Model::Symbol]) } + def supertypes(symbol); end + + # All the symbols registered in this model + # + # pkg:gem/spoom#lib/spoom/model/model.rb:234 + sig { returns(T::Hash[::String, ::Spoom::Model::Symbol]) } + def symbols; end + + # pkg:gem/spoom#lib/spoom/model/model.rb:237 + sig { returns(Spoom::Poset[::Spoom::Model::Symbol]) } + def symbols_hierarchy; end + + private + + # pkg:gem/spoom#lib/spoom/model/model.rb:305 + sig { void } + def compute_symbols_hierarchy!; end +end + +# @abstract +# +# pkg:gem/spoom#lib/spoom/model/model.rb:188 +class Spoom::Model::Attr < ::Spoom::Model::Property + abstract! +end + +# pkg:gem/spoom#lib/spoom/model/model.rb:193 +class Spoom::Model::AttrAccessor < ::Spoom::Model::Attr; end + +# pkg:gem/spoom#lib/spoom/model/model.rb:191 +class Spoom::Model::AttrReader < ::Spoom::Model::Attr; end + +# pkg:gem/spoom#lib/spoom/model/model.rb:192 +class Spoom::Model::AttrWriter < ::Spoom::Model::Attr; end + +# Populate a Model by visiting the nodes from a Ruby file +# +# pkg:gem/spoom#lib/spoom/model/builder.rb:7 +class Spoom::Model::Builder < ::Spoom::Model::NamespaceVisitor + # pkg:gem/spoom#lib/spoom/model/builder.rb:9 + sig { params(model: ::Spoom::Model, file: ::String).void } + def initialize(model, file); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/builder.rb:159 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/builder.rb:23 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/builder.rb:76 + sig { override.params(node: ::Prism::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/builder.rb:99 + sig { override.params(node: ::Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/builder.rb:138 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/builder.rb:58 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/builder.rb:115 + sig { override.params(node: ::Prism::MultiWriteNode).void } + def visit_multi_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/builder.rb:40 + sig { override.params(node: ::Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + private + + # pkg:gem/spoom#lib/spoom/model/builder.rb:250 + sig { returns(T::Array[::Spoom::Model::Sig]) } + def collect_sigs; end + + # pkg:gem/spoom#lib/spoom/model/builder.rb:245 + sig { returns(::Spoom::Model::Visibility) } + def current_visibility; end + + # pkg:gem/spoom#lib/spoom/model/builder.rb:262 + sig { params(node: ::Prism::Node).returns(T::Array[::Spoom::Model::Comment]) } + def node_comments(node); end + + # pkg:gem/spoom#lib/spoom/model/builder.rb:257 + sig { params(node: ::Prism::Node).returns(::Spoom::Location) } + def node_location(node); end +end + +# pkg:gem/spoom#lib/spoom/model/model.rb:128 +class Spoom::Model::Class < ::Spoom::Model::Namespace + # pkg:gem/spoom#lib/spoom/model/model.rb:139 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location, + superclass_name: T.nilable(::String), + comments: T::Array[::Spoom::Model::Comment] + ).void + end + def initialize(symbol, owner:, location:, superclass_name: T.unsafe(nil), comments: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/model/model.rb:130 + sig { returns(T.nilable(::String)) } + def superclass_name; end + + # pkg:gem/spoom#lib/spoom/model/model.rb:130 + def superclass_name=(_arg0); end +end + +# pkg:gem/spoom#lib/spoom/model/model.rb:8 +class Spoom::Model::Comment + # pkg:gem/spoom#lib/spoom/model/model.rb:16 + sig { params(string: ::String, location: ::Spoom::Location).void } + def initialize(string, location); end + + # pkg:gem/spoom#lib/spoom/model/model.rb:13 + sig { returns(::Spoom::Location) } + def location; end + + # pkg:gem/spoom#lib/spoom/model/model.rb:10 + sig { returns(::String) } + def string; end +end + +# pkg:gem/spoom#lib/spoom/model/model.rb:148 +class Spoom::Model::Constant < ::Spoom::Model::SymbolDef + # pkg:gem/spoom#lib/spoom/model/model.rb:153 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location, + value: ::String, + comments: T::Array[::Spoom::Model::Comment] + ).void + end + def initialize(symbol, owner:, location:, value:, comments: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/model/model.rb:150 + sig { returns(::String) } + def value; end +end + +# pkg:gem/spoom#lib/spoom/model/model.rb:6 +class Spoom::Model::Error < ::Spoom::Error; end + +# pkg:gem/spoom#lib/spoom/model/model.rb:217 +class Spoom::Model::Extend < ::Spoom::Model::Mixin; end + +# pkg:gem/spoom#lib/spoom/model/model.rb:215 +class Spoom::Model::Include < ::Spoom::Model::Mixin; end + +# pkg:gem/spoom#lib/spoom/model/model.rb:185 +class Spoom::Model::Method < ::Spoom::Model::Property; end + +# A mixin (include, prepend, extend) to a namespace +# @abstract +# +# pkg:gem/spoom#lib/spoom/model/model.rb:205 +class Spoom::Model::Mixin + abstract! + + # pkg:gem/spoom#lib/spoom/model/model.rb:210 + sig { params(name: ::String).void } + def initialize(name); end + + # pkg:gem/spoom#lib/spoom/model/model.rb:207 + sig { returns(::String) } + def name; end +end + +# pkg:gem/spoom#lib/spoom/model/model.rb:146 +class Spoom::Model::Module < ::Spoom::Model::Namespace; end + +# A class or module +# @abstract +# +# pkg:gem/spoom#lib/spoom/model/model.rb:110 +class Spoom::Model::Namespace < ::Spoom::Model::SymbolDef + abstract! + + # pkg:gem/spoom#lib/spoom/model/model.rb:118 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location, + comments: T::Array[::Spoom::Model::Comment] + ).void + end + def initialize(symbol, owner:, location:, comments: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/model/model.rb:112 + sig { returns(T::Array[::Spoom::Model::SymbolDef]) } + def children; end + + # pkg:gem/spoom#lib/spoom/model/model.rb:115 + sig { returns(T::Array[::Spoom::Model::Mixin]) } + def mixins; end +end + +# @abstract +# +# pkg:gem/spoom#lib/spoom/model/namespace_visitor.rb:7 +class Spoom::Model::NamespaceVisitor < ::Spoom::Visitor + abstract! + + # pkg:gem/spoom#lib/spoom/model/namespace_visitor.rb:9 + sig { void } + def initialize; end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/namespace_visitor.rb:17 + sig { override.params(node: T.nilable(::Prism::Node)).void } + def visit(node); end +end + +# pkg:gem/spoom#lib/spoom/model/model.rb:216 +class Spoom::Model::Prepend < ::Spoom::Model::Mixin; end + +# A method or an attribute accessor +# @abstract +# +# pkg:gem/spoom#lib/spoom/model/model.rb:162 +class Spoom::Model::Property < ::Spoom::Model::SymbolDef + abstract! + + # pkg:gem/spoom#lib/spoom/model/model.rb:177 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location, + visibility: ::Spoom::Model::Visibility, + sigs: T::Array[::Spoom::Model::Sig], + comments: T::Array[::Spoom::Model::Comment] + ).void + end + def initialize(symbol, owner:, location:, visibility:, sigs: T.unsafe(nil), comments: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/model/model.rb:167 + sig { returns(T::Array[::Spoom::Model::Sig]) } + def sigs; end + + # pkg:gem/spoom#lib/spoom/model/model.rb:164 + sig { returns(::Spoom::Model::Visibility) } + def visibility; end +end + +# A reference to something that looks like a constant or a method +# +# Constants could be classes, modules, or actual constants. +# Methods could be accessors, instance or class methods, aliases, etc. +# +# pkg:gem/spoom#lib/spoom/model/reference.rb:10 +class Spoom::Model::Reference < ::T::Struct + const :kind, ::Spoom::Model::Reference::Kind + const :name, ::String + const :location, ::Spoom::Location + + # pkg:gem/spoom#lib/spoom/model/reference.rb:35 + sig { returns(T::Boolean) } + def constant?; end + + # pkg:gem/spoom#lib/spoom/model/reference.rb:40 + sig { returns(T::Boolean) } + def method?; end + + class << self + # pkg:gem/spoom#lib/spoom/model/reference.rb:20 + sig { params(name: ::String, location: ::Spoom::Location).returns(::Spoom::Model::Reference) } + def constant(name, location); end + + # pkg:gem/spoom#lib/spoom/model/reference.rb:25 + sig { params(name: ::String, location: ::Spoom::Location).returns(::Spoom::Model::Reference) } + def method(name, location); end + end +end + +# pkg:gem/spoom#lib/spoom/model/reference.rb:11 +class Spoom::Model::Reference::Kind < ::T::Enum + enums do + Constant = new + Method = new + end +end + +# Visit a file to collect all the references to constants and methods +# +# pkg:gem/spoom#lib/spoom/model/references_visitor.rb:7 +class Spoom::Model::ReferencesVisitor < ::Spoom::Visitor + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:12 + sig { params(file: ::String).void } + def initialize(file); end + + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:9 + sig { returns(T::Array[::Spoom::Model::Reference]) } + def references; end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:21 + sig { override.params(node: ::Prism::AliasMethodNode).void } + def visit_alias_method_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:27 + sig { override.params(node: ::Prism::AndNode).void } + def visit_and_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:34 + sig { override.params(node: ::Prism::BlockArgumentNode).void } + def visit_block_argument_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:46 + sig { override.params(node: ::Prism::CallAndWriteNode).void } + def visit_call_and_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:73 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:55 + sig { override.params(node: ::Prism::CallOperatorWriteNode).void } + def visit_call_operator_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:64 + sig { override.params(node: ::Prism::CallOrWriteNode).void } + def visit_call_or_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:91 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:98 + sig { override.params(node: ::Prism::ConstantAndWriteNode).void } + def visit_constant_and_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:105 + sig { override.params(node: ::Prism::ConstantOperatorWriteNode).void } + def visit_constant_operator_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:112 + sig { override.params(node: ::Prism::ConstantOrWriteNode).void } + def visit_constant_or_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:119 + sig { override.params(node: ::Prism::ConstantPathNode).void } + def visit_constant_path_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:126 + sig { override.params(node: ::Prism::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:133 + sig { override.params(node: ::Prism::ConstantReadNode).void } + def visit_constant_read_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:139 + sig { override.params(node: ::Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:145 + sig { override.params(node: ::Prism::LocalVariableAndWriteNode).void } + def visit_local_variable_and_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:154 + sig { override.params(node: ::Prism::LocalVariableOperatorWriteNode).void } + def visit_local_variable_operator_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:163 + sig { override.params(node: ::Prism::LocalVariableOrWriteNode).void } + def visit_local_variable_or_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:172 + sig { override.params(node: ::Prism::LocalVariableWriteNode).void } + def visit_local_variable_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:179 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:185 + sig { override.params(node: ::Prism::MultiWriteNode).void } + def visit_multi_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:197 + sig { override.params(node: ::Prism::OrNode).void } + def visit_or_node(node); end + + private + + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:215 + sig { params(node: ::Prism::Node).returns(::Spoom::Location) } + def node_location(node); end + + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:205 + sig { params(name: ::String, node: ::Prism::Node).void } + def reference_constant(name, node); end + + # pkg:gem/spoom#lib/spoom/model/references_visitor.rb:210 + sig { params(name: ::String, node: ::Prism::Node).void } + def reference_method(name, node); end +end + +# A Sorbet signature (sig block) +# +# pkg:gem/spoom#lib/spoom/model/model.rb:220 +class Spoom::Model::Sig + # pkg:gem/spoom#lib/spoom/model/model.rb:225 + sig { params(string: ::String).void } + def initialize(string); end + + # pkg:gem/spoom#lib/spoom/model/model.rb:222 + sig { returns(::String) } + def string; end +end + +# pkg:gem/spoom#lib/spoom/model/model.rb:126 +class Spoom::Model::SingletonClass < ::Spoom::Model::Namespace; end + +# A Symbol is a uniquely named entity in the Ruby codebase +# +# A symbol can have multiple definitions, e.g. a class can be reopened. +# Sometimes a symbol can have multiple definitions of different types, +# e.g. `foo` method can be defined both as a method and as an attribute accessor. +# +# pkg:gem/spoom#lib/spoom/model/model.rb:27 +class Spoom::Model::Symbol + # pkg:gem/spoom#lib/spoom/model/model.rb:37 + sig { params(full_name: ::String).void } + def initialize(full_name); end + + # The definitions of this symbol (where it exists in the code) + # + # pkg:gem/spoom#lib/spoom/model/model.rb:34 + sig { returns(T::Array[::Spoom::Model::SymbolDef]) } + def definitions; end + + # The full, unique name of this symbol + # + # pkg:gem/spoom#lib/spoom/model/model.rb:30 + sig { returns(::String) } + def full_name; end + + # The short name of this symbol + # + # pkg:gem/spoom#lib/spoom/model/model.rb:44 + sig { returns(::String) } + def name; end + + # pkg:gem/spoom#lib/spoom/model/model.rb:49 + sig { returns(::String) } + def to_s; end +end + +# A SymbolDef is a definition of a Symbol +# +# It can be a class, module, constant, method, etc. +# A SymbolDef has a location pointing to the actual code that defines the symbol. +# @abstract +# +# pkg:gem/spoom#lib/spoom/model/model.rb:67 +class Spoom::Model::SymbolDef + abstract! + + # pkg:gem/spoom#lib/spoom/model/model.rb:85 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location, + comments: T::Array[::Spoom::Model::Comment] + ).void + end + def initialize(symbol, owner:, location:, comments:); end + + # The comments associated with this definition + # + # pkg:gem/spoom#lib/spoom/model/model.rb:82 + sig { returns(T::Array[::Spoom::Model::Comment]) } + def comments; end + + # The full name of the symbol this definition belongs to + # + # pkg:gem/spoom#lib/spoom/model/model.rb:97 + sig { returns(::String) } + def full_name; end + + # The actual code location of this definition + # + # pkg:gem/spoom#lib/spoom/model/model.rb:78 + sig { returns(::Spoom::Location) } + def location; end + + # The short name of the symbol this definition belongs to + # + # pkg:gem/spoom#lib/spoom/model/model.rb:103 + sig { returns(::String) } + def name; end + + # The enclosing namespace this definition belongs to + # + # pkg:gem/spoom#lib/spoom/model/model.rb:74 + sig { returns(T.nilable(::Spoom::Model::Namespace)) } + def owner; end + + # The symbol this definition belongs to + # + # pkg:gem/spoom#lib/spoom/model/model.rb:70 + sig { returns(::Spoom::Model::Symbol) } + def symbol; end +end + +# pkg:gem/spoom#lib/spoom/model/model.rb:54 +class Spoom::Model::UnresolvedSymbol < ::Spoom::Model::Symbol + # @override + # + # pkg:gem/spoom#lib/spoom/model/model.rb:57 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/spoom#lib/spoom/model/model.rb:195 +class Spoom::Model::Visibility < ::T::Enum + enums do + Private = new + Protected = new + Public = new + end +end + +# pkg:gem/spoom#lib/spoom/parse.rb:7 +class Spoom::ParseError < ::Spoom::Error; end + +# A Poset is a set of elements with a partial order relation. +# +# The partial order relation is a binary relation that is reflexive, antisymmetric, and transitive. +# It can be used to represent a hierarchy of classes or modules, the dependencies between gems, etc. +# +# pkg:gem/spoom#lib/spoom/poset.rb:10 +class Spoom::Poset + extend T::Generic + + E = type_member { { upper: Object } } + + # pkg:gem/spoom#lib/spoom/poset.rb:14 + sig { void } + def initialize; end + + # Get the POSet element for a given value + # + # Raises if the element is not found + # + # pkg:gem/spoom#lib/spoom/poset.rb:22 + sig { params(value: E).returns(Spoom::Poset::Element[E]) } + def [](value); end + + # Add a direct edge from one element to another + # + # Transitive edges (transitive closure) are automatically computed. + # Adds the elements if they don't exist. + # If the direct edge already exists, nothing is done. + # + # pkg:gem/spoom#lib/spoom/poset.rb:50 + sig { params(from: E, to: E).void } + def add_direct_edge(from, to); end + + # Add an element to the POSet + # + # pkg:gem/spoom#lib/spoom/poset.rb:31 + sig { params(value: E).returns(Spoom::Poset::Element[E]) } + def add_element(value); end + + # Is there a direct edge from `from` to `to`? + # + # pkg:gem/spoom#lib/spoom/poset.rb:97 + sig { params(from: E, to: E).returns(T::Boolean) } + def direct_edge?(from, to); end + + # Is there an edge (direct or indirect) from `from` to `to`? + # + # pkg:gem/spoom#lib/spoom/poset.rb:88 + sig { params(from: E, to: E).returns(T::Boolean) } + def edge?(from, to); end + + # Is the given value a element in the POSet? + # + # pkg:gem/spoom#lib/spoom/poset.rb:40 + sig { params(value: E).returns(T::Boolean) } + def element?(value); end + + # Show the POSet as a DOT graph using xdot (used for debugging) + # + # pkg:gem/spoom#lib/spoom/poset.rb:103 + sig { params(direct: T::Boolean, transitive: T::Boolean).void } + def show_dot(direct: T.unsafe(nil), transitive: T.unsafe(nil)); end + + # Return the POSet as a DOT graph + # + # pkg:gem/spoom#lib/spoom/poset.rb:112 + sig { params(direct: T::Boolean, transitive: T::Boolean).returns(::String) } + def to_dot(direct: T.unsafe(nil), transitive: T.unsafe(nil)); end +end + +# An element in a POSet +# +# pkg:gem/spoom#lib/spoom/poset.rb:133 +class Spoom::Poset::Element + include ::Comparable + extend T::Generic + + E = type_member { { upper: Object } } + + # pkg:gem/spoom#lib/spoom/poset.rb:145 + sig { params(value: E).void } + def initialize(value); end + + # pkg:gem/spoom#lib/spoom/poset.rb:154 + sig { params(other: T.untyped).returns(T.nilable(::Integer)) } + def <=>(other); end + + # Direct and indirect ancestors of this element + # + # pkg:gem/spoom#lib/spoom/poset.rb:173 + sig { returns(T::Array[E]) } + def ancestors; end + + # Direct children of this element + # + # pkg:gem/spoom#lib/spoom/poset.rb:179 + sig { returns(T::Array[E]) } + def children; end + + # Direct and indirect descendants of this element + # + # pkg:gem/spoom#lib/spoom/poset.rb:185 + sig { returns(T::Array[E]) } + def descendants; end + + # Edges (direct and indirect) from this element to other elements in the same POSet + # + # pkg:gem/spoom#lib/spoom/poset.rb:142 + def dfroms; end + + # Edges (direct and indirect) from this element to other elements in the same POSet + # + # pkg:gem/spoom#lib/spoom/poset.rb:142 + sig { returns(T::Set[Spoom::Poset::Element[E]]) } + def dtos; end + + # Edges (direct and indirect) from this element to other elements in the same POSet + # + # pkg:gem/spoom#lib/spoom/poset.rb:142 + def froms; end + + # Direct parents of this element + # + # pkg:gem/spoom#lib/spoom/poset.rb:167 + sig { returns(T::Array[E]) } + def parents; end + + # Edges (direct and indirect) from this element to other elements in the same POSet + # + # pkg:gem/spoom#lib/spoom/poset.rb:142 + def tos; end + + # The value held by this element + # + # pkg:gem/spoom#lib/spoom/poset.rb:138 + sig { returns(E) } + def value; end +end + +# pkg:gem/spoom#lib/spoom/poset.rb:11 +class Spoom::Poset::Error < ::Spoom::Error; end + +# pkg:gem/spoom#lib/spoom/printer.rb:7 +class Spoom::Printer + include ::Spoom::Colorize + + # pkg:gem/spoom#lib/spoom/printer.rb:14 + sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean, indent_level: ::Integer).void } + def initialize(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil)); end + + # Colorize `string` with color if `@colors` + # + # pkg:gem/spoom#lib/spoom/printer.rb:75 + sig { params(string: ::String, color: ::Spoom::Color).returns(::String) } + def colorize(string, *color); end + + # Decrease indent level + # + # pkg:gem/spoom#lib/spoom/printer.rb:28 + sig { void } + def dedent; end + + # Increase indent level + # + # pkg:gem/spoom#lib/spoom/printer.rb:22 + sig { void } + def indent; end + + # pkg:gem/spoom#lib/spoom/printer.rb:11 + sig { returns(T.any(::IO, ::StringIO)) } + def out; end + + # pkg:gem/spoom#lib/spoom/printer.rb:11 + def out=(_arg0); end + + # Print `string` into `out` + # + # pkg:gem/spoom#lib/spoom/printer.rb:34 + sig { params(string: T.nilable(::String)).void } + def print(string); end + + # Print `string` colored with `color` into `out` + # + # Does not use colors unless `@colors`. + # + # pkg:gem/spoom#lib/spoom/printer.rb:44 + sig { params(string: T.nilable(::String), color: ::Spoom::Color).void } + def print_colored(string, *color); end + + # Print `string` with indent and newline + # + # pkg:gem/spoom#lib/spoom/printer.rb:59 + sig { params(string: T.nilable(::String)).void } + def printl(string); end + + # Print a new line into `out` + # + # pkg:gem/spoom#lib/spoom/printer.rb:53 + sig { void } + def printn; end + + # Print an indent space into `out` + # + # pkg:gem/spoom#lib/spoom/printer.rb:69 + sig { void } + def printt; end +end + +# pkg:gem/spoom#lib/spoom/rbs.rb:5 +module Spoom::RBS; end + +# pkg:gem/spoom#lib/spoom/rbs.rb:71 +class Spoom::RBS::Annotation < ::Spoom::RBS::Comment; end + +# pkg:gem/spoom#lib/spoom/rbs.rb:57 +class Spoom::RBS::Comment + # pkg:gem/spoom#lib/spoom/rbs.rb:65 + sig { params(string: ::String, location: ::Prism::Location).void } + def initialize(string, location); end + + # pkg:gem/spoom#lib/spoom/rbs.rb:62 + sig { returns(::Prism::Location) } + def location; end + + # pkg:gem/spoom#lib/spoom/rbs.rb:59 + sig { returns(::String) } + def string; end +end + +# pkg:gem/spoom#lib/spoom/rbs.rb:6 +class Spoom::RBS::Comments + # pkg:gem/spoom#lib/spoom/rbs.rb:14 + sig { void } + def initialize; end + + # pkg:gem/spoom#lib/spoom/rbs.rb:8 + sig { returns(T::Array[::Spoom::RBS::Annotation]) } + def annotations; end + + # pkg:gem/spoom#lib/spoom/rbs.rb:25 + sig { returns(T::Array[::Spoom::RBS::Annotation]) } + def class_annotations; end + + # pkg:gem/spoom#lib/spoom/rbs.rb:20 + sig { returns(T::Boolean) } + def empty?; end + + # pkg:gem/spoom#lib/spoom/rbs.rb:39 + sig { returns(T::Array[::Spoom::RBS::Annotation]) } + def method_annotations; end + + # pkg:gem/spoom#lib/spoom/rbs.rb:11 + sig { returns(T::Array[::Spoom::RBS::Signature]) } + def signatures; end +end + +# pkg:gem/spoom#lib/spoom/rbs.rb:75 +module Spoom::RBS::ExtractRBSComments + # pkg:gem/spoom#lib/spoom/rbs.rb:77 + sig { params(node: ::Prism::Node).returns(::Spoom::RBS::Comments) } + def node_rbs_comments(node); end +end + +# pkg:gem/spoom#lib/spoom/rbs.rb:72 +class Spoom::RBS::Signature < ::Spoom::RBS::Comment; end + +# pkg:gem/spoom#lib/spoom/rbs.rb:73 +class Spoom::RBS::TypeAlias < ::Spoom::RBS::Comment; end + +# pkg:gem/spoom#lib/spoom.rb:8 +Spoom::SPOOM_PATH = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/sorbet/config.rb:5 +module Spoom::Sorbet; end + +# pkg:gem/spoom#lib/spoom/sorbet.rb:33 +Spoom::Sorbet::BIN_PATH = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/sorbet.rb:30 +Spoom::Sorbet::CONFIG_PATH = T.let(T.unsafe(nil), String) + +# Parse Sorbet config files +# +# Parses a Sorbet config file: +# +# ```ruby +# config = Spoom::Sorbet::Config.parse_file("sorbet/config") +# puts config.paths # "." +# ``` +# +# Parses a Sorbet config string: +# +# ```ruby +# config = Spoom::Sorbet::Config.parse_string(<<~CONFIG) +# a +# --file=b +# --ignore=c +# CONFIG +# puts config.paths # "a", "b" +# puts config.ignore # "c" +# ``` +# +# pkg:gem/spoom#lib/spoom/sorbet/config.rb:26 +class Spoom::Sorbet::Config + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:36 + sig { void } + def initialize; end + + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:30 + def allowed_extensions; end + + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:30 + def allowed_extensions=(_arg0); end + + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:30 + def ignore; end + + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:30 + def ignore=(_arg0); end + + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:33 + sig { returns(T::Boolean) } + def no_stdlib; end + + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:33 + def no_stdlib=(_arg0); end + + # Returns self as a string of options that can be passed to Sorbet + # + # Example: + # ~~~rb + # config = Sorbet::Config.new + # config.paths << "/foo" + # config.paths << "/bar" + # config.ignore << "/baz" + # config.allowed_extensions << ".rb" + # + # puts config.options_string # "/foo /bar --ignore /baz --allowed-extension .rb" + # ~~~ + # + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:64 + sig { returns(::String) } + def options_string; end + + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:30 + sig { returns(T::Array[::String]) } + def paths; end + + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:30 + def paths=(_arg0); end + + private + + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:44 + sig { params(source: ::Spoom::Sorbet::Config).void } + def initialize_copy(source); end + + class << self + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:75 + sig { params(sorbet_config_path: ::String).returns(::Spoom::Sorbet::Config) } + def parse_file(sorbet_config_path); end + + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:80 + sig { params(sorbet_config: ::String).returns(::Spoom::Sorbet::Config) } + def parse_string(sorbet_config); end + + private + + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:146 + sig { params(line: ::String).returns(T::Boolean) } + def parse_bool_option(line); end + + # pkg:gem/spoom#lib/spoom/sorbet/config.rb:141 + sig { params(line: ::String).returns(::String) } + def parse_option(line); end + end +end + +# pkg:gem/spoom#lib/spoom/sorbet/config.rb:27 +Spoom::Sorbet::Config::DEFAULT_ALLOWED_EXTENSIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/spoom#lib/spoom/sorbet.rb:15 +class Spoom::Sorbet::Error < ::Spoom::Error + # pkg:gem/spoom#lib/spoom/sorbet.rb:23 + sig { params(message: ::String, result: ::Spoom::ExecResult).void } + def initialize(message, result); end + + # pkg:gem/spoom#lib/spoom/sorbet.rb:20 + sig { returns(::Spoom::ExecResult) } + def result; end +end + +# pkg:gem/spoom#lib/spoom/sorbet.rb:16 +class Spoom::Sorbet::Error::Killed < ::Spoom::Sorbet::Error; end + +# pkg:gem/spoom#lib/spoom/sorbet.rb:17 +class Spoom::Sorbet::Error::Segfault < ::Spoom::Sorbet::Error; end + +# pkg:gem/spoom#lib/spoom/sorbet/errors.rb:8 +module Spoom::Sorbet::Errors + class << self + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:13 + sig { params(errors: T::Array[::Spoom::Sorbet::Errors::Error]).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } + def sort_errors_by_code(errors); end + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:18 + sig { params(errors: T::Array[::Spoom::Sorbet::Errors::Error]).returns(::REXML::Document) } + def to_junit_xml(errors); end + end +end + +# pkg:gem/spoom#lib/spoom/sorbet/errors.rb:9 +Spoom::Sorbet::Errors::DEFAULT_ERROR_URL_BASE = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/sorbet/errors.rb:149 +class Spoom::Sorbet::Errors::Error + include ::Comparable + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:166 + sig do + params( + file: T.nilable(::String), + line: T.nilable(::Integer), + message: T.nilable(::String), + code: T.nilable(::Integer), + more: T::Array[::String] + ).void + end + def initialize(file, line, message, code, more = T.unsafe(nil)); end + + # By default errors are sorted by location + # + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:177 + sig { params(other: T.untyped).returns(::Integer) } + def <=>(other); end + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:156 + def code; end + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:153 + sig { returns(T.nilable(::String)) } + def file; end + + # Other files associated with the error + # + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:163 + sig { returns(T::Set[::String]) } + def files_from_error_sections; end + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:156 + sig { returns(T.nilable(::Integer)) } + def line; end + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:153 + def message; end + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:159 + sig { returns(T::Array[::String]) } + def more; end + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:189 + sig { returns(::REXML::Element) } + def to_junit_xml_element; end + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:184 + sig { returns(::String) } + def to_s; end +end + +# Parse errors from Sorbet output +# +# pkg:gem/spoom#lib/spoom/sorbet/errors.rb:47 +class Spoom::Sorbet::Errors::Parser + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:67 + sig { params(error_url_base: ::String).void } + def initialize(error_url_base: T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:74 + sig { params(output: ::String).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } + def parse(output); end + + private + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:138 + sig { params(line: ::String).void } + def append_error(line); end + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:130 + sig { void } + def close_error; end + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:97 + sig { params(error_url_base: ::String).returns(::Regexp) } + def error_line_match_regexp(error_url_base); end + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:114 + sig { params(line: ::String).returns(T.nilable(::Spoom::Sorbet::Errors::Error)) } + def match_error_line(line); end + + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:123 + sig { params(error: ::Spoom::Sorbet::Errors::Error).void } + def open_error(error); end + + class << self + # pkg:gem/spoom#lib/spoom/sorbet/errors.rb:60 + sig { params(output: ::String, error_url_base: ::String).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } + def parse_string(output, error_url_base: T.unsafe(nil)); end + end +end + +# pkg:gem/spoom#lib/spoom/sorbet/errors.rb:50 +Spoom::Sorbet::Errors::Parser::HEADER = T.let(T.unsafe(nil), Array) + +# pkg:gem/spoom#lib/spoom/sorbet/errors.rb:48 +class Spoom::Sorbet::Errors::Parser::ParseError < ::Spoom::Error; end + +# pkg:gem/spoom#lib/spoom/sorbet.rb:31 +Spoom::Sorbet::GEM_PATH = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/sorbet.rb:32 +Spoom::Sorbet::GEM_VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/sorbet.rb:35 +Spoom::Sorbet::KILLED_CODE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:6 +module Spoom::Sorbet::Metrics + class << self + # pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:9 + sig { params(files: T::Array[::String]).returns(Spoom::Counters) } + def collect_code_metrics(files); end + end +end + +# Collects metrics about how Sorbet is used in the codebase. +# +# This approach is different from the metrics file we get directly from Sorbet. +# +# This visitor actually visits the codebase and collects metrics about the amount of signatures, `T.` calls, +# and other metrics. It also knows about RBS comments. +# +# On the other hand, the metrics file is a snapshot of the metrics at type checking time and knows about +# is calls are typed, how many assertions are done, etc. +# +# pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:34 +class Spoom::Sorbet::Metrics::CodeMetricsVisitor < ::Spoom::Visitor + include ::Spoom::RBS::ExtractRBSComments + + # pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:38 + sig { params(counters: Spoom::Counters).void } + def initialize(counters); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:49 + sig { override.params(node: T.nilable(::Prism::Node)).void } + def visit(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:124 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:75 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:99 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:83 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:91 + sig { override.params(node: ::Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + private + + # pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:213 + sig { returns(T::Array[::Prism::CallNode]) } + def collect_last_srb_sigs; end + + # pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:220 + sig { params(node: T.any(::Prism::ClassNode, ::Prism::ModuleNode, ::Prism::SingletonClassNode)).returns(::String) } + def node_key(node); end + + # pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:167 + sig { params(node: ::Prism::CallNode).void } + def visit_attr_accessor(node); end + + # pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:151 + sig do + params( + node: T.any(::Prism::ClassNode, ::Prism::ModuleNode, ::Prism::SingletonClassNode), + block: T.proc.void + ).void + end + def visit_scope(node, &block); end + + # pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:187 + sig { params(node: ::Prism::CallNode).void } + def visit_sig(node); end + + # pkg:gem/spoom#lib/spoom/sorbet/metrics/code_metrics_visitor.rb:197 + sig { params(node: ::Prism::CallNode).void } + def visit_type_member(node); end +end + +# pkg:gem/spoom#lib/spoom/sorbet/metrics/metrics_file_parser.rb:9 +module Spoom::Sorbet::Metrics::MetricsFileParser + class << self + # pkg:gem/spoom#lib/spoom/sorbet/metrics/metrics_file_parser.rb:14 + sig { params(path: ::String, prefix: ::String).returns(T::Hash[::String, ::Integer]) } + def parse_file(path, prefix = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/sorbet/metrics/metrics_file_parser.rb:24 + sig { params(obj: T::Hash[::String, T.untyped], prefix: ::String).returns(Spoom::Counters) } + def parse_hash(obj, prefix = T.unsafe(nil)); end + + # pkg:gem/spoom#lib/spoom/sorbet/metrics/metrics_file_parser.rb:19 + sig { params(string: ::String, prefix: ::String).returns(T::Hash[::String, ::Integer]) } + def parse_string(string, prefix = T.unsafe(nil)); end + end +end + +# pkg:gem/spoom#lib/spoom/sorbet/metrics/metrics_file_parser.rb:10 +Spoom::Sorbet::Metrics::MetricsFileParser::DEFAULT_PREFIX = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/sorbet.rb:36 +Spoom::Sorbet::SEGFAULT_CODE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:9 +module Spoom::Sorbet::Sigils + class << self + # changes the sigil in the file at the passed path to the specified new strictness + # + # pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:65 + sig { params(path: T.any(::Pathname, ::String), new_strictness: ::String).returns(T::Boolean) } + def change_sigil_in_file(path, new_strictness); end + + # changes the sigil to have a new strictness in a list of files + # + # pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:76 + sig { params(path_list: T::Array[::String], new_strictness: ::String).returns(T::Array[::String]) } + def change_sigil_in_files(path_list, new_strictness); end + + # returns a string containing the strictness of a sigil in a file at the passed path + # * returns nil if no sigil + # + # pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:56 + sig { params(path: T.any(::Pathname, ::String)).returns(T.nilable(::String)) } + def file_strictness(path); end + + # returns the full sigil comment string for the passed strictness + # + # pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:31 + sig { params(strictness: ::String).returns(::String) } + def sigil_string(strictness); end + + # returns the strictness of a sigil in the passed file content string (nil if no sigil) + # + # pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:43 + sig { params(content: ::String).returns(T.nilable(::String)) } + def strictness_in_content(content); end + + # returns a string which is the passed content but with the sigil updated to a new strictness + # + # pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:49 + sig { params(content: ::String, new_strictness: ::String).returns(::String) } + def update_sigil(content, new_strictness); end + + # returns true if the passed string is a valid strictness (else false) + # + # pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:37 + sig { params(strictness: ::String).returns(T::Boolean) } + def valid_strictness?(strictness); end + end +end + +# pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:26 +Spoom::Sorbet::Sigils::SIGIL_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:11 +Spoom::Sorbet::Sigils::STRICTNESS_FALSE = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:10 +Spoom::Sorbet::Sigils::STRICTNESS_IGNORE = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:15 +Spoom::Sorbet::Sigils::STRICTNESS_INTERNAL = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:13 +Spoom::Sorbet::Sigils::STRICTNESS_STRICT = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:14 +Spoom::Sorbet::Sigils::STRICTNESS_STRONG = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:12 +Spoom::Sorbet::Sigils::STRICTNESS_TRUE = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/sorbet/sigils.rb:17 +Spoom::Sorbet::Sigils::VALID_STRICTNESS = T.let(T.unsafe(nil), Array) + +# pkg:gem/spoom#lib/spoom/sorbet/translate/translator.rb:6 +module Spoom::Sorbet::Translate + class << self + # Converts all the RBS comments in the given Ruby code to `sig` nodes. + # It also handles type members and class annotations. + # + # pkg:gem/spoom#lib/spoom/sorbet/translate.rb:57 + sig { params(ruby_contents: ::String, file: ::String, max_line_length: T.nilable(::Integer)).returns(::String) } + def rbs_comments_to_sorbet_sigs(ruby_contents, file:, max_line_length: T.unsafe(nil)); end + + # Converts all `T.let` and `T.cast` nodes to RBS comments in the given Ruby code. + # It also handles type members and class annotations. + # + # pkg:gem/spoom#lib/spoom/sorbet/translate.rb:72 + sig do + params( + ruby_contents: ::String, + file: ::String, + translate_t_let: T::Boolean, + translate_t_cast: T::Boolean, + translate_t_bind: T::Boolean, + translate_t_must: T::Boolean, + translate_t_unsafe: T::Boolean + ).returns(::String) + end + def sorbet_assertions_to_rbs_comments(ruby_contents, file:, translate_t_let: T.unsafe(nil), translate_t_cast: T.unsafe(nil), translate_t_bind: T.unsafe(nil), translate_t_must: T.unsafe(nil), translate_t_unsafe: T.unsafe(nil)); end + + # Converts all `sig` nodes to RBS comments in the given Ruby code. + # It also handles type members and class annotations. + # + # pkg:gem/spoom#lib/spoom/sorbet/translate.rb:37 + sig do + params( + ruby_contents: ::String, + file: ::String, + positional_names: T::Boolean, + max_line_length: T.nilable(::Integer), + translate_generics: T::Boolean, + translate_helpers: T::Boolean, + translate_abstract_methods: T::Boolean + ).returns(::String) + end + def sorbet_sigs_to_rbs_comments(ruby_contents, file:, positional_names: T.unsafe(nil), max_line_length: T.unsafe(nil), translate_generics: T.unsafe(nil), translate_helpers: T.unsafe(nil), translate_abstract_methods: T.unsafe(nil)); end + + # Deletes all `sig` nodes from the given Ruby code. + # It doesn't handle type members and class annotations. + # + # pkg:gem/spoom#lib/spoom/sorbet/translate.rb:22 + sig { params(ruby_contents: ::String, file: ::String).returns(::String) } + def strip_sorbet_sigs(ruby_contents, file:); end + end +end + +# pkg:gem/spoom#lib/spoom/sorbet/translate.rb:16 +class Spoom::Sorbet::Translate::Error < ::Spoom::Error; end + +# pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:7 +class Spoom::Sorbet::Translate::RBSCommentsToSorbetSigs < ::Spoom::Sorbet::Translate::Translator + include ::Spoom::RBS::ExtractRBSComments + + # pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:11 + sig { params(ruby_contents: ::String, file: ::String, max_line_length: T.nilable(::Integer)).void } + def initialize(ruby_contents, file:, max_line_length: T.unsafe(nil)); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:59 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:29 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:53 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:37 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:19 + sig { override.params(node: ::Prism::ProgramNode).void } + def visit_program_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:45 + sig { override.params(node: ::Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + private + + # pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:282 + sig do + params( + node: T.any(::Prism::ClassNode, ::Prism::ModuleNode, ::Prism::SingletonClassNode), + constant_regex: ::Regexp + ).returns(T::Boolean) + end + def already_extends?(node, constant_regex); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:157 + sig { params(node: T.any(::Prism::ClassNode, ::Prism::ModuleNode, ::Prism::SingletonClassNode)).void } + def apply_class_annotations(node); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:258 + sig { params(annotations: T::Array[::Spoom::RBS::Annotation], sig: ::RBI::Sig).void } + def apply_member_annotations(annotations, sig); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:334 + sig { params(comments: T::Array[::Prism::Comment]).void } + def apply_type_aliases(comments); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:298 + sig { params(comments: T::Array[::Prism::Comment]).returns(T::Array[::Spoom::RBS::TypeAlias]) } + def collect_type_aliases(comments); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:115 + sig { params(def_node: ::Prism::DefNode, comments: ::Spoom::RBS::Comments).void } + def rewrite_def(def_node, comments); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb:77 + sig { params(node: ::Prism::CallNode).void } + def visit_attr(node); end +end + +# Translates Sorbet assertions to RBS comments. +# +# pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb:8 +class Spoom::Sorbet::Translate::SorbetAssertionsToRBSComments < ::Spoom::Sorbet::Translate::Translator + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb:20 + sig do + params( + ruby_contents: ::String, + file: ::String, + translate_t_let: T::Boolean, + translate_t_cast: T::Boolean, + translate_t_bind: T::Boolean, + translate_t_must: T::Boolean, + translate_t_unsafe: T::Boolean + ).void + end + def initialize(ruby_contents, file:, translate_t_let: T.unsafe(nil), translate_t_cast: T.unsafe(nil), translate_t_bind: T.unsafe(nil), translate_t_must: T.unsafe(nil), translate_t_unsafe: T.unsafe(nil)); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb:49 + sig { override.params(node: ::Prism::IfNode).void } + def visit_if_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb:40 + sig { override.params(node: ::Prism::StatementsNode).void } + def visit_statements_node(node); end + + private + + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb:176 + sig { params(node: ::Prism::Node).returns(T::Boolean) } + def at_end_of_line?(node); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb:118 + sig { params(call: ::Prism::CallNode).returns(::String) } + def build_rbs_annotation(call); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb:216 + sig { params(assign: ::Prism::Node, value: ::Prism::Node).returns(::String) } + def dedent_value(assign, value); end + + # Extract any trailing comment after the node + # Returns [comment_text, comment_end_offset] or [nil, nil] if no comment or RBS annotation + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb:196 + sig { params(node: ::Prism::Node).returns([T.nilable(::String), T.nilable(::Integer)]) } + def extract_trailing_comment(node); end + + # Check if the node has an RBS annotation comment (#:) after it + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb:185 + sig { params(node: ::Prism::Node).returns(T::Boolean) } + def has_rbs_annotation?(node); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb:71 + sig { params(node: ::Prism::Node).returns(T::Boolean) } + def maybe_translate_assertion(node); end + + # Is this node a `T` or `::T` constant? + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb:143 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t?(node); end + + # Is this node a `T.let` or `T.cast`? + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb:156 + sig { params(node: ::Prism::CallNode).returns(T::Boolean) } + def translatable_annotation?(node); end +end + +# pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb:9 +Spoom::Sorbet::Translate::SorbetAssertionsToRBSComments::LINE_BREAK = T.let(T.unsafe(nil), Integer) + +# Converts all `sig` nodes to RBS comments in the given Ruby code. +# It also handles type members and class annotations. +# +# pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:9 +class Spoom::Sorbet::Translate::SorbetSigsToRBSComments < ::Spoom::Sorbet::Translate::Translator + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:19 + sig do + params( + ruby_contents: ::String, + file: ::String, + positional_names: T::Boolean, + max_line_length: T.nilable(::Integer), + translate_generics: T::Boolean, + translate_helpers: T::Boolean, + translate_abstract_methods: T::Boolean + ).void + end + def initialize(ruby_contents, file:, positional_names:, max_line_length: T.unsafe(nil), translate_generics: T.unsafe(nil), translate_helpers: T.unsafe(nil), translate_abstract_methods: T.unsafe(nil)); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:100 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:46 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:119 + sig { override.params(node: ::Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:64 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:52 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:58 + sig { override.params(node: ::Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + private + + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:233 + sig do + params( + parent: T.any(::Prism::ClassNode, ::Prism::ModuleNode, ::Prism::SingletonClassNode), + node: ::Prism::CallNode + ).void + end + def apply_class_annotation(parent, node); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:277 + sig { params(sigs: T::Array[[::Prism::CallNode, ::RBI::Sig]]).void } + def apply_member_annotations(sigs); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:313 + sig { params(node: ::Prism::ConstantWriteNode).returns(::String) } + def build_type_member_string(node); end + + # Collects the last signatures visited and clears the current list + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:384 + sig { returns(T::Array[[::Prism::CallNode, ::RBI::Sig]]) } + def collect_last_sigs; end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:371 + sig { void } + def delete_extend_t_generics; end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:359 + sig { void } + def delete_extend_t_helpers; end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:391 + sig { params(indent: ::Integer, block: T.proc.params(arg0: ::RBI::RBSPrinter).void).returns(::String) } + def rbs_print(indent, &block); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:191 + sig { params(node: ::Prism::CallNode).void } + def visit_attr(node); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:215 + sig { params(node: ::Prism::CallNode).void } + def visit_extend(node); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:138 + sig do + params( + node: T.any(::Prism::ClassNode, ::Prism::ModuleNode, ::Prism::SingletonClassNode), + block: T.proc.void + ).void + end + def visit_scope(node, &block); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb:179 + sig { params(node: ::Prism::CallNode).void } + def visit_sig(node); end +end + +# Deletes all `sig` nodes from the given Ruby code. +# It doesn't handle type members and class annotations. +# +# pkg:gem/spoom#lib/spoom/sorbet/translate/strip_sorbet_sigs.rb:9 +class Spoom::Sorbet::Translate::StripSorbetSigs < ::Spoom::Sorbet::Translate::Translator + # @override + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/strip_sorbet_sigs.rb:12 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end +end + +# @abstract +# +# pkg:gem/spoom#lib/spoom/sorbet/translate/translator.rb:8 +class Spoom::Sorbet::Translate::Translator < ::Spoom::Visitor + abstract! + + # pkg:gem/spoom#lib/spoom/sorbet/translate/translator.rb:10 + sig { params(ruby_contents: ::String, file: ::String).void } + def initialize(ruby_contents, file:); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/translator.rb:30 + sig { returns(::String) } + def rewrite; end + + private + + # pkg:gem/spoom#lib/spoom/sorbet/translate/translator.rb:55 + sig { params(offset: ::Integer).returns(::Integer) } + def adjust_to_line_end(offset); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/translator.rb:49 + sig { params(offset: ::Integer).returns(::Integer) } + def adjust_to_line_start(offset); end + + # Consume the next blank line if any + # + # pkg:gem/spoom#lib/spoom/sorbet/translate/translator.rb:62 + sig { params(offset: ::Integer).returns(::Integer) } + def adjust_to_new_line(offset); end + + # pkg:gem/spoom#lib/spoom/sorbet/translate/translator.rb:39 + sig { params(node: ::Prism::CallNode).returns(T::Boolean) } + def sorbet_sig?(node); end +end + +# This module provides a simple API to rewrite source code. +# +# Using a `Rewriter`, you can build a list of changes to apply to a source file +# and apply them all at once. Edits are applied from bottom to top, so that the +# line numbers are not remapped after each edit. +# +# The source code is represented as an array of bytes, so that it can be +# manipulated in place. The client is responsible for `string <-> bytes` +# conversions and encoding handling. +# +# ```ruby +# bytes = "def foo; end".bytes +# +# rewriter = Spoom::Source::Rewriter.new +# rewriter << Spoom::Source::Replace.new(4, 6, "baz") +# rewriter << Spoom::Source::Insert.new(0, "def bar; end\n") +# rewriter.rewrite!(bytes) +# +# puts bytes.pack("C*") # => "def bar; end\ndef baz; end" +# ``` +# +# pkg:gem/spoom#lib/spoom/source/rewriter.rb:25 +module Spoom::Source; end + +# pkg:gem/spoom#lib/spoom/source/rewriter.rb:114 +class Spoom::Source::Delete < ::Spoom::Source::Edit + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:119 + sig { params(from: ::Integer, to: ::Integer).void } + def initialize(from, to); end + + # @override + # + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:128 + sig { override.params(bytes: T::Array[T.untyped]).void } + def apply(bytes); end + + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:116 + sig { returns(::Integer) } + def from; end + + # @override + # + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:137 + sig { override.returns([::Integer, ::Integer]) } + def range; end + + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:116 + def to; end + + # @override + # + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:143 + sig { override.returns(::String) } + def to_s; end +end + +# @abstract +# +# pkg:gem/spoom#lib/spoom/source/rewriter.rb:29 +class Spoom::Source::Edit + abstract! + + # @abstract + # + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:32 + sig { abstract.params(bytes: T::Array[::Integer]).void } + def apply(bytes); end + + # @abstract + # + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:36 + sig { abstract.returns([::Integer, ::Integer]) } + def range; end +end + +# pkg:gem/spoom#lib/spoom/source/rewriter.rb:39 +class Spoom::Source::Insert < ::Spoom::Source::Edit + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:47 + sig { params(position: ::Integer, text: ::String).void } + def initialize(position, text); end + + # @override + # + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:56 + sig { override.params(bytes: T::Array[::Integer]).void } + def apply(bytes); end + + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:41 + sig { returns(::Integer) } + def position; end + + # @override + # + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:65 + sig { override.returns([::Integer, ::Integer]) } + def range; end + + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:44 + sig { returns(::String) } + def text; end + + # @override + # + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:71 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/spoom#lib/spoom/source/rewriter.rb:26 +class Spoom::Source::PositionError < ::Spoom::Error; end + +# pkg:gem/spoom#lib/spoom/source/rewriter.rb:76 +class Spoom::Source::Replace < ::Spoom::Source::Edit + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:84 + sig { params(from: ::Integer, to: ::Integer, text: ::String).void } + def initialize(from, to, text); end + + # @override + # + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:94 + sig { override.params(bytes: T::Array[::Integer]).void } + def apply(bytes); end + + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:78 + sig { returns(::Integer) } + def from; end + + # @override + # + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:103 + sig { override.returns([::Integer, ::Integer]) } + def range; end + + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:81 + sig { returns(::String) } + def text; end + + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:78 + def to; end + + # @override + # + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:109 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/spoom#lib/spoom/source/rewriter.rb:148 +class Spoom::Source::Rewriter + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:150 + sig { void } + def initialize; end + + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:155 + sig { params(other: ::Spoom::Source::Edit).void } + def <<(other); end + + # pkg:gem/spoom#lib/spoom/source/rewriter.rb:160 + sig { params(bytes: T::Array[::Integer]).void } + def rewrite!(bytes); end +end + +# pkg:gem/spoom#lib/spoom/timeline.rb:5 +class Spoom::Timeline + # pkg:gem/spoom#lib/spoom/timeline.rb:7 + sig { params(context: ::Spoom::Context, from: ::Time, to: ::Time).void } + def initialize(context, from, to); end + + # Return one commit for each date in `dates` + # + # pkg:gem/spoom#lib/spoom/timeline.rb:34 + sig { params(dates: T::Array[::Time]).returns(T::Array[::Spoom::Git::Commit]) } + def commits_for_dates(dates); end + + # Return all months between `from` and `to` + # + # pkg:gem/spoom#lib/spoom/timeline.rb:21 + sig { returns(T::Array[::Time]) } + def months; end + + # Return one commit for each month between `from` and `to` + # + # pkg:gem/spoom#lib/spoom/timeline.rb:15 + sig { returns(T::Array[::Spoom::Git::Commit]) } + def ticks; end +end + +# pkg:gem/spoom#lib/spoom/version.rb:5 +Spoom::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/spoom#lib/spoom/visitor.rb:7 +class Spoom::Visitor < ::Prism::Visitor + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:16 + sig { override.params(node: ::Prism::AliasGlobalVariableNode).void } + def visit_alias_global_variable_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:22 + sig { override.params(node: ::Prism::AliasMethodNode).void } + def visit_alias_method_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:28 + sig { override.params(node: ::Prism::AlternationPatternNode).void } + def visit_alternation_pattern_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:34 + sig { override.params(node: ::Prism::AndNode).void } + def visit_and_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:40 + sig { override.params(node: ::Prism::ArgumentsNode).void } + def visit_arguments_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:46 + sig { override.params(node: ::Prism::ArrayNode).void } + def visit_array_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:52 + sig { override.params(node: ::Prism::ArrayPatternNode).void } + def visit_array_pattern_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:58 + sig { override.params(node: ::Prism::AssocNode).void } + def visit_assoc_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:64 + sig { override.params(node: ::Prism::AssocSplatNode).void } + def visit_assoc_splat_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:70 + sig { override.params(node: ::Prism::BackReferenceReadNode).void } + def visit_back_reference_read_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:76 + sig { override.params(node: ::Prism::BeginNode).void } + def visit_begin_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:82 + sig { override.params(node: ::Prism::BlockArgumentNode).void } + def visit_block_argument_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:88 + sig { override.params(node: ::Prism::BlockLocalVariableNode).void } + def visit_block_local_variable_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:94 + sig { override.params(node: ::Prism::BlockNode).void } + def visit_block_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:100 + sig { override.params(node: ::Prism::BlockParameterNode).void } + def visit_block_parameter_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:106 + sig { override.params(node: ::Prism::BlockParametersNode).void } + def visit_block_parameters_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:112 + sig { override.params(node: ::Prism::BreakNode).void } + def visit_break_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:118 + sig { override.params(node: ::Prism::CallAndWriteNode).void } + def visit_call_and_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:124 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:130 + sig { override.params(node: ::Prism::CallOperatorWriteNode).void } + def visit_call_operator_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:136 + sig { override.params(node: ::Prism::CallOrWriteNode).void } + def visit_call_or_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:142 + sig { override.params(node: ::Prism::CallTargetNode).void } + def visit_call_target_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:148 + sig { override.params(node: ::Prism::CapturePatternNode).void } + def visit_capture_pattern_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:154 + sig { override.params(node: ::Prism::CaseMatchNode).void } + def visit_case_match_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:160 + sig { override.params(node: ::Prism::CaseNode).void } + def visit_case_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:10 + sig { override.params(node: ::Prism::Node).void } + def visit_child_nodes(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:166 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:172 + sig { override.params(node: ::Prism::ClassVariableAndWriteNode).void } + def visit_class_variable_and_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:178 + sig { override.params(node: ::Prism::ClassVariableOperatorWriteNode).void } + def visit_class_variable_operator_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:184 + sig { override.params(node: ::Prism::ClassVariableOrWriteNode).void } + def visit_class_variable_or_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:190 + sig { override.params(node: ::Prism::ClassVariableReadNode).void } + def visit_class_variable_read_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:196 + sig { override.params(node: ::Prism::ClassVariableTargetNode).void } + def visit_class_variable_target_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:202 + sig { override.params(node: ::Prism::ClassVariableWriteNode).void } + def visit_class_variable_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:208 + sig { override.params(node: ::Prism::ConstantAndWriteNode).void } + def visit_constant_and_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:214 + sig { override.params(node: ::Prism::ConstantOperatorWriteNode).void } + def visit_constant_operator_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:220 + sig { override.params(node: ::Prism::ConstantOrWriteNode).void } + def visit_constant_or_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:226 + sig { override.params(node: ::Prism::ConstantPathAndWriteNode).void } + def visit_constant_path_and_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:232 + sig { override.params(node: ::Prism::ConstantPathNode).void } + def visit_constant_path_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:238 + sig { override.params(node: ::Prism::ConstantPathOperatorWriteNode).void } + def visit_constant_path_operator_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:244 + sig { override.params(node: ::Prism::ConstantPathOrWriteNode).void } + def visit_constant_path_or_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:250 + sig { override.params(node: ::Prism::ConstantPathTargetNode).void } + def visit_constant_path_target_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:256 + sig { override.params(node: ::Prism::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:262 + sig { override.params(node: ::Prism::ConstantReadNode).void } + def visit_constant_read_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:268 + sig { override.params(node: ::Prism::ConstantTargetNode).void } + def visit_constant_target_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:274 + sig { override.params(node: ::Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:280 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:286 + sig { override.params(node: ::Prism::DefinedNode).void } + def visit_defined_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:292 + sig { override.params(node: ::Prism::ElseNode).void } + def visit_else_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:298 + sig { override.params(node: ::Prism::EmbeddedStatementsNode).void } + def visit_embedded_statements_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:304 + sig { override.params(node: ::Prism::EmbeddedVariableNode).void } + def visit_embedded_variable_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:310 + sig { override.params(node: ::Prism::EnsureNode).void } + def visit_ensure_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:316 + sig { override.params(node: ::Prism::FalseNode).void } + def visit_false_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:322 + sig { override.params(node: ::Prism::FindPatternNode).void } + def visit_find_pattern_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:328 + sig { override.params(node: ::Prism::FlipFlopNode).void } + def visit_flip_flop_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:334 + sig { override.params(node: ::Prism::FloatNode).void } + def visit_float_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:340 + sig { override.params(node: ::Prism::ForNode).void } + def visit_for_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:346 + sig { override.params(node: ::Prism::ForwardingArgumentsNode).void } + def visit_forwarding_arguments_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:352 + sig { override.params(node: ::Prism::ForwardingParameterNode).void } + def visit_forwarding_parameter_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:358 + sig { override.params(node: ::Prism::ForwardingSuperNode).void } + def visit_forwarding_super_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:364 + sig { override.params(node: ::Prism::GlobalVariableAndWriteNode).void } + def visit_global_variable_and_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:370 + sig { override.params(node: ::Prism::GlobalVariableOperatorWriteNode).void } + def visit_global_variable_operator_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:376 + sig { override.params(node: ::Prism::GlobalVariableOrWriteNode).void } + def visit_global_variable_or_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:382 + sig { override.params(node: ::Prism::GlobalVariableReadNode).void } + def visit_global_variable_read_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:388 + sig { override.params(node: ::Prism::GlobalVariableTargetNode).void } + def visit_global_variable_target_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:394 + sig { override.params(node: ::Prism::GlobalVariableWriteNode).void } + def visit_global_variable_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:400 + sig { override.params(node: ::Prism::HashNode).void } + def visit_hash_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:406 + sig { override.params(node: ::Prism::HashPatternNode).void } + def visit_hash_pattern_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:412 + sig { override.params(node: ::Prism::IfNode).void } + def visit_if_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:418 + sig { override.params(node: ::Prism::ImaginaryNode).void } + def visit_imaginary_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:424 + sig { override.params(node: ::Prism::ImplicitNode).void } + def visit_implicit_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:430 + sig { override.params(node: ::Prism::ImplicitRestNode).void } + def visit_implicit_rest_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:436 + sig { override.params(node: ::Prism::InNode).void } + def visit_in_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:442 + sig { override.params(node: ::Prism::IndexAndWriteNode).void } + def visit_index_and_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:448 + sig { override.params(node: ::Prism::IndexOperatorWriteNode).void } + def visit_index_operator_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:454 + sig { override.params(node: ::Prism::IndexOrWriteNode).void } + def visit_index_or_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:460 + sig { override.params(node: ::Prism::IndexTargetNode).void } + def visit_index_target_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:466 + sig { override.params(node: ::Prism::InstanceVariableAndWriteNode).void } + def visit_instance_variable_and_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:472 + sig { override.params(node: ::Prism::InstanceVariableOperatorWriteNode).void } + def visit_instance_variable_operator_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:478 + sig { override.params(node: ::Prism::InstanceVariableOrWriteNode).void } + def visit_instance_variable_or_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:484 + sig { override.params(node: ::Prism::InstanceVariableReadNode).void } + def visit_instance_variable_read_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:490 + sig { override.params(node: ::Prism::InstanceVariableTargetNode).void } + def visit_instance_variable_target_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:496 + sig { override.params(node: ::Prism::InstanceVariableWriteNode).void } + def visit_instance_variable_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:502 + sig { override.params(node: ::Prism::IntegerNode).void } + def visit_integer_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:508 + sig { override.params(node: ::Prism::InterpolatedMatchLastLineNode).void } + def visit_interpolated_match_last_line_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:514 + sig { override.params(node: ::Prism::InterpolatedRegularExpressionNode).void } + def visit_interpolated_regular_expression_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:520 + sig { override.params(node: ::Prism::InterpolatedStringNode).void } + def visit_interpolated_string_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:526 + sig { override.params(node: ::Prism::InterpolatedSymbolNode).void } + def visit_interpolated_symbol_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:532 + sig { override.params(node: ::Prism::InterpolatedXStringNode).void } + def visit_interpolated_x_string_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:538 + sig { override.params(node: ::Prism::KeywordHashNode).void } + def visit_keyword_hash_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:544 + sig { override.params(node: ::Prism::KeywordRestParameterNode).void } + def visit_keyword_rest_parameter_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:550 + sig { override.params(node: ::Prism::LambdaNode).void } + def visit_lambda_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:556 + sig { override.params(node: ::Prism::LocalVariableAndWriteNode).void } + def visit_local_variable_and_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:562 + sig { override.params(node: ::Prism::LocalVariableOperatorWriteNode).void } + def visit_local_variable_operator_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:568 + sig { override.params(node: ::Prism::LocalVariableOrWriteNode).void } + def visit_local_variable_or_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:574 + sig { override.params(node: ::Prism::LocalVariableReadNode).void } + def visit_local_variable_read_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:580 + sig { override.params(node: ::Prism::LocalVariableTargetNode).void } + def visit_local_variable_target_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:586 + sig { override.params(node: ::Prism::LocalVariableWriteNode).void } + def visit_local_variable_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:592 + sig { override.params(node: ::Prism::MatchLastLineNode).void } + def visit_match_last_line_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:598 + sig { override.params(node: ::Prism::MatchPredicateNode).void } + def visit_match_predicate_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:604 + sig { override.params(node: ::Prism::MatchRequiredNode).void } + def visit_match_required_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:610 + sig { override.params(node: ::Prism::MatchWriteNode).void } + def visit_match_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:616 + sig { override.params(node: ::Prism::MissingNode).void } + def visit_missing_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:622 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:628 + sig { override.params(node: ::Prism::MultiTargetNode).void } + def visit_multi_target_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:634 + sig { override.params(node: ::Prism::MultiWriteNode).void } + def visit_multi_write_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:640 + sig { override.params(node: ::Prism::NextNode).void } + def visit_next_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:646 + sig { override.params(node: ::Prism::NilNode).void } + def visit_nil_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:652 + sig { override.params(node: ::Prism::NoKeywordsParameterNode).void } + def visit_no_keywords_parameter_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:658 + sig { override.params(node: ::Prism::NumberedParametersNode).void } + def visit_numbered_parameters_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:664 + sig { override.params(node: ::Prism::NumberedReferenceReadNode).void } + def visit_numbered_reference_read_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:670 + sig { override.params(node: ::Prism::OptionalKeywordParameterNode).void } + def visit_optional_keyword_parameter_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:676 + sig { override.params(node: ::Prism::OptionalParameterNode).void } + def visit_optional_parameter_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:682 + sig { override.params(node: ::Prism::OrNode).void } + def visit_or_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:688 + sig { override.params(node: ::Prism::ParametersNode).void } + def visit_parameters_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:694 + sig { override.params(node: ::Prism::ParenthesesNode).void } + def visit_parentheses_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:700 + sig { override.params(node: ::Prism::PinnedExpressionNode).void } + def visit_pinned_expression_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:706 + sig { override.params(node: ::Prism::PinnedVariableNode).void } + def visit_pinned_variable_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:712 + sig { override.params(node: ::Prism::PostExecutionNode).void } + def visit_post_execution_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:718 + sig { override.params(node: ::Prism::PreExecutionNode).void } + def visit_pre_execution_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:724 + sig { override.params(node: ::Prism::ProgramNode).void } + def visit_program_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:730 + sig { override.params(node: ::Prism::RangeNode).void } + def visit_range_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:736 + sig { override.params(node: ::Prism::RationalNode).void } + def visit_rational_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:742 + sig { override.params(node: ::Prism::RedoNode).void } + def visit_redo_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:748 + sig { override.params(node: ::Prism::RegularExpressionNode).void } + def visit_regular_expression_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:754 + sig { override.params(node: ::Prism::RequiredKeywordParameterNode).void } + def visit_required_keyword_parameter_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:760 + sig { override.params(node: ::Prism::RequiredParameterNode).void } + def visit_required_parameter_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:766 + sig { override.params(node: ::Prism::RescueModifierNode).void } + def visit_rescue_modifier_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:772 + sig { override.params(node: ::Prism::RescueNode).void } + def visit_rescue_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:778 + sig { override.params(node: ::Prism::RestParameterNode).void } + def visit_rest_parameter_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:784 + sig { override.params(node: ::Prism::RetryNode).void } + def visit_retry_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:790 + sig { override.params(node: ::Prism::ReturnNode).void } + def visit_return_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:796 + sig { override.params(node: ::Prism::SelfNode).void } + def visit_self_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:802 + sig { override.params(node: ::Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:808 + sig { override.params(node: ::Prism::SourceEncodingNode).void } + def visit_source_encoding_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:814 + sig { override.params(node: ::Prism::SourceFileNode).void } + def visit_source_file_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:820 + sig { override.params(node: ::Prism::SourceLineNode).void } + def visit_source_line_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:826 + sig { override.params(node: ::Prism::SplatNode).void } + def visit_splat_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:832 + sig { override.params(node: ::Prism::StatementsNode).void } + def visit_statements_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:838 + sig { override.params(node: ::Prism::StringNode).void } + def visit_string_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:844 + sig { override.params(node: ::Prism::SuperNode).void } + def visit_super_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:850 + sig { override.params(node: ::Prism::SymbolNode).void } + def visit_symbol_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:856 + sig { override.params(node: ::Prism::TrueNode).void } + def visit_true_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:862 + sig { override.params(node: ::Prism::UndefNode).void } + def visit_undef_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:868 + sig { override.params(node: ::Prism::UnlessNode).void } + def visit_unless_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:874 + sig { override.params(node: ::Prism::UntilNode).void } + def visit_until_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:880 + sig { override.params(node: ::Prism::WhenNode).void } + def visit_when_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:886 + sig { override.params(node: ::Prism::WhileNode).void } + def visit_while_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:892 + sig { override.params(node: ::Prism::XStringNode).void } + def visit_x_string_node(node); end + + # @override + # + # pkg:gem/spoom#lib/spoom/visitor.rb:898 + sig { override.params(node: ::Prism::YieldNode).void } + def visit_yield_node(node); end +end diff --git a/sorbet/rbi/gems/tapioca@0.16.11.rbi b/sorbet/rbi/gems/tapioca@0.19.1.rbi similarity index 53% rename from sorbet/rbi/gems/tapioca@0.16.11.rbi rename to sorbet/rbi/gems/tapioca@0.19.1.rbi index 81406e9..72ff0ff 100644 --- a/sorbet/rbi/gems/tapioca@0.16.11.rbi +++ b/sorbet/rbi/gems/tapioca@0.19.1.rbi @@ -9,20 +9,20 @@ class Bundler::Dependency < ::Gem::Dependency include ::Tapioca::BundlerExt::AutoRequireHook end -# source://tapioca//lib/tapioca/helpers/git_attributes.rb#4 +# pkg:gem/tapioca#lib/tapioca/helpers/git_attributes.rb:4 class GitAttributes class << self - # source://tapioca//lib/tapioca/helpers/git_attributes.rb#9 + # pkg:gem/tapioca#lib/tapioca/helpers/git_attributes.rb:7 sig { params(path: ::Pathname).void } def create_generated_attribute_file(path); end - # source://tapioca//lib/tapioca/helpers/git_attributes.rb#16 + # pkg:gem/tapioca#lib/tapioca/helpers/git_attributes.rb:14 sig { params(path: ::Pathname).void } def create_vendored_attribute_file(path); end private - # source://tapioca//lib/tapioca/helpers/git_attributes.rb#25 + # pkg:gem/tapioca#lib/tapioca/helpers/git_attributes.rb:23 sig { params(path: ::Pathname, content: ::String).void } def create_gitattributes_file(path, content); end end @@ -35,39 +35,33 @@ end # That's because RubyGems does alias-method-chain for Kernel#require and such, # so, if Bootsnap were to do prepend, it might end up breaking RubyGems. # -# source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#68 +# pkg:gem/tapioca#lib/tapioca/runtime/trackers/constant_definition.rb:101 class Module - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#101 + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/mixin.rb:95 def append_features(constant); end - # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#71 + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/autoload.rb:46 def autoload(const_name, path); end - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#111 + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/constant_definition.rb:103 + def const_added(cname); end + + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/mixin.rb:105 def extend_object(obj); end - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#91 + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/method_definition.rb:59 + def method_added(method_name); end + + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/mixin.rb:85 def prepend_features(constant); end end -# source://tapioca//lib/tapioca/rbi_ext/model.rb#4 +# pkg:gem/tapioca#lib/tapioca/rbi_ext/model.rb:4 module RBI; end -# source://tapioca//lib/tapioca/rbi_ext/model.rb#5 +# pkg:gem/tapioca#lib/tapioca/rbi_ext/model.rb:5 class RBI::Tree < ::RBI::NodeWithComments - # source://rbi/0.3.7/lib/rbi/model.rb#113 - def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - - # source://rbi/0.3.7/lib/rbi/model.rb#120 - def <<(node); end - - # source://rbi/0.3.7/lib/rbi/rewriters/add_sig_templates.rb#63 - def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end - - # source://rbi/0.3.7/lib/rbi/rewriters/annotate.rb#46 - def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end - - # source://tapioca//lib/tapioca/rbi_ext/model.rb#38 + # pkg:gem/tapioca#lib/tapioca/rbi_ext/model.rb:30 sig do params( name: ::String, @@ -77,19 +71,19 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_class(name, superclass_name: T.unsafe(nil), &block); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#45 + # pkg:gem/tapioca#lib/tapioca/rbi_ext/model.rb:37 sig { params(name: ::String, value: ::String).void } def create_constant(name, value:); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#55 + # pkg:gem/tapioca#lib/tapioca/rbi_ext/model.rb:47 sig { params(name: ::String).void } def create_extend(name); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#50 + # pkg:gem/tapioca#lib/tapioca/rbi_ext/model.rb:42 sig { params(name: ::String).void } def create_include(name); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#90 + # pkg:gem/tapioca#lib/tapioca/rbi_ext/model.rb:63 sig do params( name: ::String, @@ -103,19 +97,24 @@ 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), &block); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#60 + # pkg:gem/tapioca#lib/tapioca/rbi_ext/model.rb:52 sig { params(name: ::String).void } def create_mixes_in_class_methods(name); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#25 + # pkg:gem/tapioca#lib/tapioca/rbi_ext/model.rb:23 sig { params(name: ::String, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) } def create_module(name, &block); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#9 - sig { params(constant: ::Module, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) } + # pkg:gem/tapioca#lib/tapioca/rbi_ext/model.rb:7 + sig do + params( + constant: T::Module[T.anything], + block: T.nilable(T.proc.params(scope: ::RBI::Scope).void) + ).returns(::RBI::Scope) + end def create_path(constant, &block); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#74 + # pkg:gem/tapioca#lib/tapioca/rbi_ext/model.rb:57 sig do params( name: ::String, @@ -128,87 +127,37 @@ 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/0.3.7/lib/rbi/rewriters/deannotate.rb#38 - def deannotate!(annotation); end - - # source://rbi/0.3.7/lib/rbi/model.rb#126 - def empty?; end - - # source://rbi/0.3.7/lib/rbi/rewriters/filter_versions.rb#113 - def filter_versions!(version); end - - # source://rbi/0.3.7/lib/rbi/rewriters/flatten_singleton_methods.rb#58 - def flatten_singleton_methods!; end - - # source://rbi/0.3.7/lib/rbi/rewriters/flatten_visibilities.rb#57 - def flatten_visibilities!; end - - # source://rbi/0.3.7/lib/rbi/rewriters/group_nodes.rb#78 - def group_nodes!; end - - # source://rbi/0.3.7/lib/rbi/index.rb#62 - def index; end - - # source://rbi/0.3.7/lib/rbi/rewriters/merge_trees.rb#323 - def merge(other, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end - - # source://rbi/0.3.7/lib/rbi/rewriters/nest_non_public_members.rb#43 - def nest_non_public_members!; end - - # source://rbi/0.3.7/lib/rbi/rewriters/nest_singleton_methods.rb#33 - def nest_singleton_methods!; end - - # source://rbi/0.3.7/lib/rbi/rewriters/nest_top_level_members.rb#60 - def nest_top_level_members!; end - - # source://rbi/0.3.7/lib/rbi/model.rb#110 - def nodes; end - - # source://rbi/0.3.7/lib/rbi/rewriters/attr_to_methods.rb#50 - def replace_attributes_with_methods!; end - - # source://rbi/0.3.7/lib/rbi/rewriters/sort_nodes.rb#118 - def sort_nodes!; end - - # source://rbi/0.3.7/lib/rbi/rewriters/translate_rbs_sigs.rb#82 - def translate_rbs_sigs!; end - private - # source://tapioca//lib/tapioca/rbi_ext/model.rb#123 + # pkg:gem/tapioca#lib/tapioca/rbi_ext/model.rb:100 sig { params(node: ::RBI::Node).returns(::RBI::Node) } def create_node(node); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#118 + # pkg:gem/tapioca#lib/tapioca/rbi_ext/model.rb:95 sig { returns(T::Hash[::String, ::RBI::Node]) } def nodes_cache; end end -# source://tapioca//lib/tapioca/rbi_ext/model.rb#133 +# pkg:gem/tapioca#lib/tapioca/rbi_ext/model.rb:110 class RBI::TypedParam < ::T::Struct const :param, ::RBI::Param const :type, ::String - - class << self - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end end -# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#5 +# pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:5 module T::Generic - include ::Kernel + include ::Booleans::KernelExtension - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#13 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:13 def [](*types); end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#47 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:47 def has_attached_class!(variance = T.unsafe(nil), &bounds_proc); end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#21 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:21 def type_member(variance = T.unsafe(nil), &bounds_proc); end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#34 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:34 def type_template(variance = T.unsafe(nil), &bounds_proc); end end @@ -219,214 +168,140 @@ end # We are interested in the data of the `[]`, `type_member` and `type_template` calls which # are all needed to generate good generic information at runtime. # -# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#12 +# pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:12 module T::Generic::TypeStoragePatch - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#13 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:13 def [](*types); end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#47 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:47 def has_attached_class!(variance = T.unsafe(nil), &bounds_proc); end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#21 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:21 def type_member(variance = T.unsafe(nil), &bounds_proc); end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#34 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:34 def type_template(variance = T.unsafe(nil), &bounds_proc); end end -# source://tapioca//lib/tapioca/runtime/trackers/required_ancestor.rb#54 +# pkg:gem/tapioca#lib/tapioca/runtime/trackers/required_ancestor.rb:52 module T::Helpers - # source://tapioca//lib/tapioca/runtime/trackers/required_ancestor.rb#56 + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/required_ancestor.rb:54 def requires_ancestor(&block); end end -class T::InexactStruct - include ::T::Props - include ::T::Props::Plugin - include ::T::Props::Optional - include ::T::Props::PrettyPrintable - include ::T::Props::Serializable - include ::T::Props::WeakConstructor - include ::T::Props::Constructor - extend ::T::Props::ClassMethods - extend ::T::Props::Plugin::ClassMethods - extend ::T::Props::Serializable::ClassMethods -end - -# source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#28 +# pkg:gem/tapioca#lib/tapioca/sorbet_ext/proc_bind_patch.rb:28 module T::Private::Methods class << self - # source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#30 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/proc_bind_patch.rb:30 def finalize_proc(decl); end end end -class T::Private::Methods::Declaration < ::Struct - def bind; end - def bind=(_); end - def checked; end - def checked=(_); end - def finalized; end - def finalized=(_); end - def mod; end - def mod=(_); end - def mode; end - def mode=(_); end - def on_failure; end - def on_failure=(_); end - def override_allow_incompatible; end - def override_allow_incompatible=(_); end - def params; end - def params=(_); end - def raw; end - def raw=(_); end - def returns; end - def returns=(_); end - def type_parameters; end - def type_parameters=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -class T::Private::Methods::DeclarationBlock < ::Struct - def blk; end - def blk=(_); end - def final; end - def final=(_); end - def loc; end - def loc=(_); end - def mod; end - def mod=(_); end - def raw; end - def raw=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#29 +# pkg:gem/tapioca#lib/tapioca/sorbet_ext/proc_bind_patch.rb:29 module T::Private::Methods::ProcBindPatch - # source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#30 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/proc_bind_patch.rb:30 def finalize_proc(decl); end end -module T::Private::Retry; end -module T::Private::Retry::RETRY; end - class T::Types::Proc < ::T::Types::Base - # source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#7 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/proc_bind_patch.rb:7 def initialize(arg_types, returns, bind = T.unsafe(nil)); end - # source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#15 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/proc_bind_patch.rb:15 def name; end end -# source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#6 +# pkg:gem/tapioca#lib/tapioca/sorbet_ext/proc_bind_patch.rb:6 module T::Types::ProcBindPatch - # source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#7 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/proc_bind_patch.rb:7 def initialize(arg_types, returns, bind = T.unsafe(nil)); end - # source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#15 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/proc_bind_patch.rb:15 def name; end end -# source://tapioca//lib/tapioca/sorbet_ext/name_patch.rb#6 +# pkg:gem/tapioca#lib/tapioca/sorbet_ext/name_patch.rb:6 class T::Types::Simple < ::T::Types::Base - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#70 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:70 def name; end end -# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#65 +# pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:65 module T::Types::Simple::GenericPatch # This method intercepts calls to the `name` method for simple types, so that # it can ask the name to the type if the type is generic, since, by this point, # we've created a clone of that type with the `name` method returning the # appropriate name for that specific concrete type. # - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#70 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:70 def name; end end -# source://tapioca//lib/tapioca/sorbet_ext/name_patch.rb#7 +# pkg:gem/tapioca#lib/tapioca/sorbet_ext/name_patch.rb:7 module T::Types::Simple::NamePatch - # source://tapioca//lib/tapioca/sorbet_ext/name_patch.rb#10 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/name_patch.rb:8 def name; end - - # source://tapioca//lib/tapioca/sorbet_ext/name_patch.rb#16 - def qualified_name_of(constant); end end -# source://tapioca//lib/tapioca/sorbet_ext/name_patch.rb#8 -T::Types::Simple::NamePatch::NAME_METHOD = T.let(T.unsafe(nil), UnboundMethod) - -# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#87 +# pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:87 module T::Utils::Private class << self - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#89 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:89 def coerce_and_check_module_types(val, check_val, check_module_type); end end end -# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#88 +# pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:88 module T::Utils::Private::PrivateCoercePatch - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#89 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:89 def coerce_and_check_module_types(val, check_val, check_module_type); end end -# source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#4 -module Tapioca - class << self - # source://tapioca//lib/tapioca.rb#20 - sig do - type_parameters(:Result) - .params( - blk: T.proc.returns(T.type_parameter(:Result)) - ).returns(T.type_parameter(:Result)) - end - def silence_warnings(&blk); end - end -end +# A package URL, or _purl_, is a URL string used to +# identify and locate a software package in a mostly universal and uniform way +# across programing languages, package managers, packaging conventions, tools, +# APIs and databases. +# +# A purl is a URL composed of seven components: +# +# ``` +# scheme:type/namespace/name@version?qualifiers#subpath +# ``` +# +# For example, +# the package URL for this Ruby package at version 0.1.0 is +# `pkg:ruby/mattt/packageurl-ruby@0.1.0`. +# +# pkg:gem/tapioca#lib/tapioca/runtime/trackers/autoload.rb:4 +module Tapioca; end -# source://tapioca//lib/tapioca.rb#39 +# pkg:gem/tapioca#lib/tapioca.rb:18 Tapioca::BINARY_FILE = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#5 +# pkg:gem/tapioca#lib/tapioca/bundler_ext/auto_require_hook.rb:5 module Tapioca::BundlerExt; end # This is a module that gets prepended to `Bundler::Dependency` and # makes sure even gems marked as `require: false` are required during # `Bundler.require`. # -# source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#9 +# pkg:gem/tapioca#lib/tapioca/bundler_ext/auto_require_hook.rb:9 module Tapioca::BundlerExt::AutoRequireHook requires_ancestor { Bundler::Dependency } - # source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#46 + # pkg:gem/tapioca#lib/tapioca/bundler_ext/auto_require_hook.rb:38 sig { returns(T.untyped) } def autorequire; end class << self - # @return [Boolean] - # - # source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#26 + # pkg:gem/tapioca#lib/tapioca/bundler_ext/auto_require_hook.rb:23 def enabled?; end - # source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#22 + # pkg:gem/tapioca#lib/tapioca/bundler_ext/auto_require_hook.rb:19 sig { params(name: T.untyped).returns(T::Boolean) } def excluded?(name); end - # source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#36 + # pkg:gem/tapioca#lib/tapioca/bundler_ext/auto_require_hook.rb:28 sig do type_parameters(:Result) .params( @@ -438,102 +313,102 @@ module Tapioca::BundlerExt::AutoRequireHook end end -# source://tapioca//lib/tapioca.rb#62 +# pkg:gem/tapioca#lib/tapioca.rb:38 Tapioca::CENTRAL_REPO_ANNOTATIONS_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#61 +# pkg:gem/tapioca#lib/tapioca.rb:37 Tapioca::CENTRAL_REPO_INDEX_PATH = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#60 +# pkg:gem/tapioca#lib/tapioca.rb:36 Tapioca::CENTRAL_REPO_ROOT_URI = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca/cli.rb#5 +# pkg:gem/tapioca#lib/tapioca/cli.rb:5 class Tapioca::Cli < ::Thor include ::Tapioca::CliHelper include ::Tapioca::ConfigHelper include ::Tapioca::EnvHelper - # source://tapioca//lib/tapioca/cli.rb#372 + # pkg:gem/tapioca#lib/tapioca/cli.rb:373 def __print_version; end - # source://tapioca//lib/tapioca/cli.rb#354 + # pkg:gem/tapioca#lib/tapioca/cli.rb:355 def annotations; end - # source://tapioca//lib/tapioca/cli.rb#326 + # pkg:gem/tapioca#lib/tapioca/cli.rb:327 def check_shims; end - # source://tapioca//lib/tapioca/cli.rb#46 + # pkg:gem/tapioca#lib/tapioca/cli.rb:46 def configure; end - # source://tapioca//lib/tapioca/cli.rb#146 + # pkg:gem/tapioca#lib/tapioca/cli.rb:146 def dsl(*constant_or_paths); end - # @raise [MalformattedArgumentError] - # - # source://tapioca//lib/tapioca/cli.rb#269 + # pkg:gem/tapioca#lib/tapioca/cli.rb:269 def gem(*gems); end - # source://tapioca//lib/tapioca/cli.rb#27 + # pkg:gem/tapioca#lib/tapioca/cli.rb:27 def init; end - # source://tapioca//lib/tapioca/cli.rb#57 + # pkg:gem/tapioca#lib/tapioca/cli.rb:57 def require; end - # source://tapioca//lib/tapioca/cli.rb#74 + # pkg:gem/tapioca#lib/tapioca/cli.rb:74 def todo; end private - # source://tapioca//lib/tapioca/cli.rb#399 + # pkg:gem/tapioca#lib/tapioca/cli.rb:398 def print_init_next_steps; end class << self - # source://tapioca//lib/tapioca/cli.rb#383 + # Indicates that we are running from the LSP, set using the `addon_mode!` method + # + # pkg:gem/tapioca#lib/tapioca/cli.rb:382 def addon_mode; end - # source://tapioca//lib/tapioca/cli.rb#386 + # pkg:gem/tapioca#lib/tapioca/cli.rb:385 sig { void } def addon_mode!; end - # source://tapioca//lib/tapioca/cli.rb#391 + # pkg:gem/tapioca#lib/tapioca/cli.rb:390 sig { returns(T::Boolean) } def exit_on_failure?; end end end -# source://tapioca//lib/tapioca/cli.rb#10 +# pkg:gem/tapioca#lib/tapioca/cli.rb:10 Tapioca::Cli::FILE_HEADER_OPTION_DESC = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca/helpers/cli_helper.rb#5 +# pkg:gem/tapioca#lib/tapioca/helpers/cli_helper.rb:5 module Tapioca::CliHelper requires_ancestor { Thor::Shell } - # source://tapioca//lib/tapioca/helpers/cli_helper.rb#33 + # pkg:gem/tapioca#lib/tapioca/helpers/cli_helper.rb:32 sig { params(options: T::Hash[::Symbol, T.untyped]).returns(T.nilable(::String)) } def netrc_file(options); end - # source://tapioca//lib/tapioca/helpers/cli_helper.rb#26 + # pkg:gem/tapioca#lib/tapioca/helpers/cli_helper.rb:25 sig { params(options: T::Hash[::Symbol, T.untyped]).returns(::Tapioca::RBIFormatter) } def rbi_formatter(options); end - # source://tapioca//lib/tapioca/helpers/cli_helper.rb#12 + # pkg:gem/tapioca#lib/tapioca/helpers/cli_helper.rb:11 sig { params(message: ::String, color: T.any(::Symbol, T::Array[::Symbol])).void } def say_error(message = T.unsafe(nil), *color); end end -# source://tapioca//lib/tapioca/commands.rb#5 +# pkg:gem/tapioca#lib/tapioca/commands.rb:5 module Tapioca::Commands; end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://tapioca//lib/tapioca/commands/abstract_dsl.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:6 class Tapioca::Commands::AbstractDsl < ::Tapioca::Commands::CommandWithoutTracker include ::Tapioca::SorbetHelper include ::Tapioca::RBIFilesHelper abstract! - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#34 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:15 sig do params( requested_constants: T::Array[::String], @@ -560,15 +435,15 @@ class Tapioca::Commands::AbstractDsl < ::Tapioca::Commands::CommandWithoutTracke private - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#107 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:88 sig { returns(T::Array[::String]) } def all_requested_constants; end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#313 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:284 sig { params(cause: ::Symbol, files: T::Array[::String]).returns(::String) } def build_error_for_files(cause, files); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#237 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:208 sig do params( constant_name: ::String, @@ -579,89 +454,94 @@ class Tapioca::Commands::AbstractDsl < ::Tapioca::Commands::CommandWithoutTracke end def compile_dsl_rbi(constant_name, rbi, outpath: T.unsafe(nil), quiet: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#172 - sig { params(constant_names: T::Array[::String], ignore_missing: T::Boolean).returns(T::Array[::Module]) } + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:150 + sig do + params( + constant_names: T::Array[::String], + ignore_missing: T::Boolean + ).returns(T::Array[T::Module[T.anything]]) + end def constantize(constant_names, ignore_missing: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#197 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:175 sig { params(compiler_names: T::Array[::String]).returns(T::Array[T.class_of(Tapioca::Dsl::Compiler)]) } def constantize_compilers(compiler_names); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#373 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:344 sig { returns(T::Array[::String]) } def constants_from_requested_paths; end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#133 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:111 sig { returns(::Tapioca::Dsl::Pipeline) } def create_pipeline; end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#276 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:247 sig { params(constant_name: ::String).returns(::Pathname) } def dsl_rbi_filename(constant_name); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#158 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:136 sig { params(requested_constants: T::Array[::String], path: ::Pathname).returns(T::Set[::Pathname]) } def existing_rbi_filenames(requested_constants, path: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#368 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:339 sig { params(constant: ::String).returns(::String) } def generate_command_for(constant); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#79 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:60 sig { params(outpath: ::Pathname, quiet: T::Boolean).returns(T::Set[::Pathname]) } def generate_dsl_rbi_files(outpath, quiet:); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#120 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:98 sig { void } def load_application; end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#255 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:226 sig { params(dir: ::Pathname).void } def perform_dsl_verification(dir); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#115 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:93 sig { returns(::Tapioca::Dsl::Pipeline) } def pipeline; end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#264 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:235 sig { params(files: T::Set[::Pathname]).void } def purge_stale_dsl_rbi_files(files); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#363 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:334 sig { params(constant: ::String).returns(::String) } def rbi_filename_for(constant); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#344 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:315 sig { params(path: ::Pathname).returns(T::Array[::Pathname]) } def rbi_files_in(path); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#322 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:293 sig { params(diff: T::Hash[::String, ::Symbol], command: ::Symbol).void } def report_diff_and_exit_if_out_of_date(diff, command); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#217 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:195 sig { params(name: ::String).returns(T.nilable(T.class_of(Tapioca::Dsl::Compiler))) } def resolve(name); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#351 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:322 sig { params(class_name: ::String).returns(::String) } def underscore(class_name); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#281 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_dsl.rb:252 sig { params(tmp_dir: ::Pathname).returns(T::Hash[::String, ::Symbol]) } def verify_dsl_rbi(tmp_dir:); end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://tapioca//lib/tapioca/commands/abstract_gem.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:6 class Tapioca::Commands::AbstractGem < ::Tapioca::Commands::Command include ::Tapioca::SorbetHelper include ::Tapioca::RBIFilesHelper abstract! - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#33 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:15 sig do params( gem_names: T::Array[::String], @@ -680,77 +560,78 @@ class Tapioca::Commands::AbstractGem < ::Tapioca::Commands::Command dsl_dir: ::String, rbi_formatter: ::Tapioca::RBIFormatter, halt_upon_load_error: T::Boolean, - lsp_addon: T.nilable(T::Boolean) + lsp_addon: T.nilable(T::Boolean), + verbose: T.nilable(T::Boolean) ).void end - def initialize(gem_names:, exclude:, include_dependencies:, prerequire:, postrequire:, typed_overrides:, outpath:, file_header:, include_doc:, include_loc:, include_exported_rbis:, number_of_workers: T.unsafe(nil), auto_strictness: T.unsafe(nil), dsl_dir: T.unsafe(nil), rbi_formatter: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil), lsp_addon: T.unsafe(nil)); end + def initialize(gem_names:, exclude:, include_dependencies:, prerequire:, postrequire:, typed_overrides:, outpath:, file_header:, include_doc:, include_loc:, include_exported_rbis:, number_of_workers: T.unsafe(nil), auto_strictness: T.unsafe(nil), dsl_dir: T.unsafe(nil), rbi_formatter: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil), lsp_addon: T.unsafe(nil), verbose: T.unsafe(nil)); end private - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#200 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:185 sig { returns(T::Array[::String]) } def added_rbis; end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#261 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:246 sig { params(cause: ::Symbol, files: T::Array[::String]).returns(::String) } def build_error_for_files(cause, files); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#80 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:64 sig { params(gem: ::Tapioca::Gemfile::GemSpec).void } def compile_gem_rbi(gem); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#195 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:180 sig { params(gem_name: ::String).returns(::Pathname) } def existing_rbi(gem_name); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#243 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:228 sig { returns(T::Hash[::String, ::String]) } def existing_rbis; end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#207 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:192 sig { params(gem_name: ::String).returns(::Pathname) } def expected_rbi(gem_name); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#249 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:234 sig { returns(T::Hash[::String, ::String]) } def expected_rbis; end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#212 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:197 sig { params(gem_name: ::String).returns(T::Boolean) } def gem_rbi_exists?(gem_name); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#256 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:241 sig { params(gem_name: ::String, version: ::String).returns(::Pathname) } def gem_rbi_filename(gem_name, version); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#266 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:251 sig { params(gem: ::Tapioca::Gemfile::GemSpec, file: ::RBI::File).void } def merge_with_exported_rbi(gem, file); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#237 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:222 sig { params(old_filename: ::Pathname, new_filename: ::Pathname).void } def move(old_filename, new_filename); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#147 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:132 sig { void } def perform_additions; end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#120 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:105 sig { void } def perform_removals; end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#190 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:175 sig { returns(T::Array[::String]) } def removed_rbis; end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#217 + # pkg:gem/tapioca#lib/tapioca/commands/abstract_gem.rb:202 sig { params(diff: T::Hash[::String, ::Symbol], command: ::Symbol).void } def report_diff_and_exit_if_out_of_date(diff, command); end end -# source://tapioca//lib/tapioca/commands/annotations.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:6 class Tapioca::Commands::Annotations < ::Tapioca::Commands::CommandWithoutTracker - # source://tapioca//lib/tapioca/commands/annotations.rb#18 + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:8 sig do params( central_repo_root_uris: T::Array[::String], @@ -764,81 +645,83 @@ class Tapioca::Commands::Annotations < ::Tapioca::Commands::CommandWithoutTracke private - # source://tapioca//lib/tapioca/commands/annotations.rb#197 + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:190 sig { params(name: ::String, content: ::String).returns(::String) } def add_header(name, content); end - # source://tapioca//lib/tapioca/commands/annotations.rb#217 + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:210 sig { params(name: ::String, content: ::String).returns(::String) } def apply_typed_override(name, content); end - # source://tapioca//lib/tapioca/commands/annotations.rb#39 + # @override + # + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:30 sig { override.void } def execute; end - # source://tapioca//lib/tapioca/commands/annotations.rb#136 - sig { params(repo_uris: T::Array[::String], gem_info: ::Tapioca::GemInfo).void } + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:128 + sig { params(repo_uris: T::Array[::String], gem_info: ::Tapioca::GemInfo).returns(T::Boolean) } def fetch_annotation(repo_uris, gem_info); end - # source://tapioca//lib/tapioca/commands/annotations.rb#113 + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:105 sig { params(project_gems: T::Array[::Tapioca::GemInfo]).returns(T::Array[::String]) } def fetch_annotations(project_gems); end - # source://tapioca//lib/tapioca/commands/annotations.rb#156 + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:149 sig { params(repo_uri: ::String, path: ::String).returns(T.nilable(::String)) } def fetch_file(repo_uri, path); end - # source://tapioca//lib/tapioca/commands/annotations.rb#173 + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:166 sig { params(repo_uri: ::String, path: ::String).returns(T.nilable(::String)) } def fetch_http_file(repo_uri, path); end - # source://tapioca//lib/tapioca/commands/annotations.rb#102 - sig { params(repo_uri: ::String, repo_number: T.nilable(::Integer)).returns(T.nilable(Tapioca::RepoIndex)) } + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:94 + sig { params(repo_uri: ::String, repo_number: T.nilable(::Integer)).returns(T.nilable(::Tapioca::RepoIndex)) } def fetch_index(repo_uri, repo_number:); end - # source://tapioca//lib/tapioca/commands/annotations.rb#81 - sig { returns(T::Hash[::String, Tapioca::RepoIndex]) } + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:73 + sig { returns(T::Hash[::String, ::Tapioca::RepoIndex]) } def fetch_indexes; end - # source://tapioca//lib/tapioca/commands/annotations.rb#165 + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:158 sig { params(repo_uri: ::String, path: ::String).returns(T.nilable(::String)) } def fetch_local_file(repo_uri, path); end - # source://tapioca//lib/tapioca/commands/annotations.rb#229 + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:222 sig { params(gem_version: ::Gem::Version, content: ::String).returns(::String) } def filter_versions(gem_version, content); end - # source://tapioca//lib/tapioca/commands/annotations.rb#50 + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:41 sig { returns(T::Array[::Tapioca::GemInfo]) } def list_gemfile_gems; end - # source://tapioca//lib/tapioca/commands/annotations.rb#237 + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:230 sig { params(gem_name: ::String, contents: T::Array[::String]).returns(T.nilable(::String)) } def merge_files(gem_name, contents); end - # source://tapioca//lib/tapioca/commands/annotations.rb#60 + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:52 sig { params(project_gems: T::Array[::Tapioca::GemInfo]).void } def remove_expired_annotations(project_gems); end - # source://tapioca//lib/tapioca/commands/annotations.rb#264 + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:257 sig { returns(T::Hash[::String, T.nilable(::String)]) } def repo_tokens; end - # source://tapioca//lib/tapioca/commands/annotations.rb#292 + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:285 sig { params(path: ::String, repo_uri: ::String, message: ::String).void } def say_http_error(path, repo_uri, message:); end - # source://tapioca//lib/tapioca/commands/annotations.rb#276 + # pkg:gem/tapioca#lib/tapioca/commands/annotations.rb:269 sig { params(repo_uri: ::String).returns(T.nilable(::String)) } def token_for(repo_uri); end end -# source://tapioca//lib/tapioca/commands/check_shims.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/check_shims.rb:6 class Tapioca::Commands::CheckShims < ::Tapioca::Commands::CommandWithoutTracker include ::Tapioca::SorbetHelper include ::Tapioca::RBIFilesHelper - # source://tapioca//lib/tapioca/commands/check_shims.rb#22 + # pkg:gem/tapioca#lib/tapioca/commands/check_shims.rb:11 sig do params( gem_rbi_dir: ::String, @@ -854,14 +737,16 @@ class Tapioca::Commands::CheckShims < ::Tapioca::Commands::CommandWithoutTracker private - # source://tapioca//lib/tapioca/commands/check_shims.rb#44 + # @override + # + # pkg:gem/tapioca#lib/tapioca/commands/check_shims.rb:34 sig { override.void } def execute; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://tapioca//lib/tapioca/commands/command.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/command.rb:6 class Tapioca::Commands::Command include ::Thor::Base include ::Thor::Invocation @@ -872,21 +757,23 @@ class Tapioca::Commands::Command abstract! - # source://tapioca//lib/tapioca/commands/command.rb#20 + # pkg:gem/tapioca#lib/tapioca/commands/command.rb:19 sig { void } def initialize; end - # source://thor/1.4.0/lib/thor/base.rb#155 + # pkg:gem/tapioca#lib/tapioca/commands/command.rb:43 sig { returns(::Thor::Actions) } def file_writer; end - # source://tapioca//lib/tapioca/commands/command.rb#25 + # @final + # + # pkg:gem/tapioca#lib/tapioca/commands/command.rb:25 sig(:final) { void } def run; end private - # source://tapioca//lib/tapioca/commands/command.rb#53 + # pkg:gem/tapioca#lib/tapioca/commands/command.rb:46 sig do params( path: T.any(::Pathname, ::String), @@ -898,111 +785,121 @@ class Tapioca::Commands::Command end def create_file(path, content, force: T.unsafe(nil), skip: T.unsafe(nil), verbose: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/commands/command.rb#37 + # pkg:gem/tapioca#lib/tapioca/commands/command.rb:38 sig { params(command: ::Symbol, args: ::String).returns(::String) } def default_command(command, *args); end # @abstract # - # source://tapioca//lib/tapioca/commands/command.rb#34 + # pkg:gem/tapioca#lib/tapioca/commands/command.rb:35 sig { abstract.void } def execute; end - # source://tapioca//lib/tapioca/commands/command.rb#63 + # pkg:gem/tapioca#lib/tapioca/commands/command.rb:51 sig { params(path: T.any(::Pathname, ::String), verbose: T::Boolean).void } def remove_file(path, verbose: T.unsafe(nil)); end end -# source://tapioca//lib/tapioca/commands/command.rb#10 +# pkg:gem/tapioca#lib/tapioca/commands/command.rb:11 class Tapioca::Commands::Command::FileWriter < ::Thor include ::Thor::Actions extend ::Thor::Actions::ClassMethods end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://tapioca//lib/tapioca/commands/command_without_tracker.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/command_without_tracker.rb:6 class Tapioca::Commands::CommandWithoutTracker < ::Tapioca::Commands::Command abstract! - # source://tapioca//lib/tapioca/commands/command_without_tracker.rb#12 + # pkg:gem/tapioca#lib/tapioca/commands/command_without_tracker.rb:12 sig { void } def initialize; end end -# source://tapioca//lib/tapioca/commands/configure.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/configure.rb:6 class Tapioca::Commands::Configure < ::Tapioca::Commands::CommandWithoutTracker - # source://tapioca//lib/tapioca/commands/configure.rb#14 + # pkg:gem/tapioca#lib/tapioca/commands/configure.rb:8 sig { params(sorbet_config: ::String, tapioca_config: ::String, default_postrequire: ::String).void } def initialize(sorbet_config:, tapioca_config:, default_postrequire:); end private - # source://tapioca//lib/tapioca/commands/configure.rb#79 + # pkg:gem/tapioca#lib/tapioca/commands/configure.rb:75 sig { void } def create_binstub; end - # source://tapioca//lib/tapioca/commands/configure.rb#69 + # pkg:gem/tapioca#lib/tapioca/commands/configure.rb:65 sig { void } def create_post_require; end - # source://tapioca//lib/tapioca/commands/configure.rb#40 + # pkg:gem/tapioca#lib/tapioca/commands/configure.rb:35 sig { void } def create_sorbet_config; end - # source://tapioca//lib/tapioca/commands/configure.rb#50 + # pkg:gem/tapioca#lib/tapioca/commands/configure.rb:46 sig { void } def create_tapioca_config; end - # source://tapioca//lib/tapioca/commands/configure.rb#32 + # @override + # + # pkg:gem/tapioca#lib/tapioca/commands/configure.rb:27 sig { override.void } def execute; end - # source://tapioca//lib/tapioca/commands/configure.rb#92 + # pkg:gem/tapioca#lib/tapioca/commands/configure.rb:88 sig { returns(::Bundler::Installer) } def installer; end - # source://tapioca//lib/tapioca/commands/configure.rb#97 + # pkg:gem/tapioca#lib/tapioca/commands/configure.rb:93 sig { returns(T.any(::Bundler::StubSpecification, ::Gem::Specification)) } def spec; end end -# source://tapioca//lib/tapioca/commands/dsl_compiler_list.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/dsl_compiler_list.rb:6 class Tapioca::Commands::DslCompilerList < ::Tapioca::Commands::AbstractDsl private - # source://tapioca//lib/tapioca/commands/dsl_compiler_list.rb#10 + # @override + # + # pkg:gem/tapioca#lib/tapioca/commands/dsl_compiler_list.rb:11 sig { override.void } def execute; end end -# source://tapioca//lib/tapioca/commands/dsl_generate.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/dsl_generate.rb:6 class Tapioca::Commands::DslGenerate < ::Tapioca::Commands::AbstractDsl private - # source://tapioca//lib/tapioca/commands/dsl_generate.rb#10 + # @override + # + # pkg:gem/tapioca#lib/tapioca/commands/dsl_generate.rb:11 sig { override.void } def execute; end end -# source://tapioca//lib/tapioca/commands/dsl_verify.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/dsl_verify.rb:6 class Tapioca::Commands::DslVerify < ::Tapioca::Commands::AbstractDsl private - # source://tapioca//lib/tapioca/commands/dsl_verify.rb#10 + # @override + # + # pkg:gem/tapioca#lib/tapioca/commands/dsl_verify.rb:11 sig { override.void } def execute; end end -# source://tapioca//lib/tapioca/commands/gem_generate.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/gem_generate.rb:6 class Tapioca::Commands::GemGenerate < ::Tapioca::Commands::AbstractGem private - # source://tapioca//lib/tapioca/commands/gem_generate.rb#10 + # @override + # + # pkg:gem/tapioca#lib/tapioca/commands/gem_generate.rb:11 sig { override.void } def execute; end - # source://tapioca//lib/tapioca/commands/gem_generate.rb#74 + # pkg:gem/tapioca#lib/tapioca/commands/gem_generate.rb:70 sig do params( gem: ::Tapioca::Gemfile::GemSpec, @@ -1011,107 +908,115 @@ class Tapioca::Commands::GemGenerate < ::Tapioca::Commands::AbstractGem end def gem_dependencies(gem, dependencies = T.unsafe(nil)); end - # source://tapioca//lib/tapioca/commands/gem_generate.rb#51 + # pkg:gem/tapioca#lib/tapioca/commands/gem_generate.rb:52 sig { params(gem_names: T::Array[::String]).returns(T::Array[::Tapioca::Gemfile::GemSpec]) } def gems_to_generate(gem_names); end end -# source://tapioca//lib/tapioca/commands/gem_sync.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/gem_sync.rb:6 class Tapioca::Commands::GemSync < ::Tapioca::Commands::AbstractGem private - # source://tapioca//lib/tapioca/commands/gem_sync.rb#10 + # @override + # + # pkg:gem/tapioca#lib/tapioca/commands/gem_sync.rb:11 sig { override.void } def execute; end end -# source://tapioca//lib/tapioca/commands/gem_verify.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/gem_verify.rb:6 class Tapioca::Commands::GemVerify < ::Tapioca::Commands::AbstractGem private - # source://tapioca//lib/tapioca/commands/gem_verify.rb#10 + # @override + # + # pkg:gem/tapioca#lib/tapioca/commands/gem_verify.rb:11 sig { override.void } def execute; end - # source://tapioca//lib/tapioca/commands/gem_verify.rb#17 + # pkg:gem/tapioca#lib/tapioca/commands/gem_verify.rb:18 sig { void } def perform_sync_verification; end end -# source://tapioca//lib/tapioca/commands/require.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/require.rb:6 class Tapioca::Commands::Require < ::Tapioca::Commands::CommandWithoutTracker - # source://tapioca//lib/tapioca/commands/require.rb#13 + # pkg:gem/tapioca#lib/tapioca/commands/require.rb:8 sig { params(requires_path: ::String, sorbet_config_path: ::String).void } def initialize(requires_path:, sorbet_config_path:); end private - # source://tapioca//lib/tapioca/commands/require.rb#23 + # @override + # + # pkg:gem/tapioca#lib/tapioca/commands/require.rb:19 sig { override.void } def execute; end end -# source://tapioca//lib/tapioca/commands/todo.rb#6 +# pkg:gem/tapioca#lib/tapioca/commands/todo.rb:6 class Tapioca::Commands::Todo < ::Tapioca::Commands::CommandWithoutTracker include ::Tapioca::SorbetHelper - # source://tapioca//lib/tapioca/commands/todo.rb#26 + # pkg:gem/tapioca#lib/tapioca/commands/todo.rb:21 sig { params(todo_file: ::String, file_header: T::Boolean).void } def initialize(todo_file:, file_header:); end - # source://tapioca//lib/tapioca/commands/todo.rb#34 + # pkg:gem/tapioca#lib/tapioca/commands/todo.rb:29 sig { void } def run_with_deprecation; end private - # source://tapioca//lib/tapioca/commands/todo.rb#44 + # @override + # + # pkg:gem/tapioca#lib/tapioca/commands/todo.rb:40 sig { override.void } def execute; end - # source://tapioca//lib/tapioca/commands/todo.rb#68 + # pkg:gem/tapioca#lib/tapioca/commands/todo.rb:64 sig { params(constants: T::Array[::String], command: ::String).returns(::RBI::File) } def rbi(constants, command:); end - # source://tapioca//lib/tapioca/commands/todo.rb#88 + # pkg:gem/tapioca#lib/tapioca/commands/todo.rb:84 sig { returns(T::Array[::String]) } def unresolved_constants; end end -# source://tapioca//lib/tapioca/commands/todo.rb#9 +# pkg:gem/tapioca#lib/tapioca/commands/todo.rb:9 Tapioca::Commands::Todo::DEPRECATION_MESSAGE = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca/helpers/config_helper.rb#5 +# pkg:gem/tapioca#lib/tapioca/helpers/config_helper.rb:5 module Tapioca::ConfigHelper requires_ancestor { Thor } - # source://tapioca//lib/tapioca/helpers/config_helper.rb#18 + # pkg:gem/tapioca#lib/tapioca/helpers/config_helper.rb:17 sig { params(args: T.untyped, local_options: T.untyped, config: T.untyped).void } def initialize(args = T.unsafe(nil), local_options = T.unsafe(nil), config = T.unsafe(nil)); end - # source://tapioca//lib/tapioca/helpers/config_helper.rb#12 + # pkg:gem/tapioca#lib/tapioca/helpers/config_helper.rb:11 sig { returns(::String) } def command_name; end - # source://tapioca//lib/tapioca/helpers/config_helper.rb#15 + # pkg:gem/tapioca#lib/tapioca/helpers/config_helper.rb:14 sig { returns(::Thor::CoreExt::HashWithIndifferentAccess) } def defaults; end - # source://tapioca//lib/tapioca/helpers/config_helper.rb#34 + # pkg:gem/tapioca#lib/tapioca/helpers/config_helper.rb:33 sig { returns(::Thor::CoreExt::HashWithIndifferentAccess) } def options; end private - # source://tapioca//lib/tapioca/helpers/config_helper.rb#153 + # pkg:gem/tapioca#lib/tapioca/helpers/config_helper.rb:146 sig { params(msg: ::String).returns(::Tapioca::ConfigHelper::ConfigError) } def build_error(msg); end - # source://tapioca//lib/tapioca/helpers/config_helper.rb#178 + # pkg:gem/tapioca#lib/tapioca/helpers/config_helper.rb:171 sig { params(config_file: ::String, errors: T::Array[::Tapioca::ConfigHelper::ConfigError]).returns(::String) } def build_error_message(config_file, errors); end - # source://tapioca//lib/tapioca/helpers/config_helper.rb#56 + # pkg:gem/tapioca#lib/tapioca/helpers/config_helper.rb:55 sig do params( options: ::Thor::CoreExt::HashWithIndifferentAccess @@ -1119,11 +1024,11 @@ module Tapioca::ConfigHelper end def config_options(options); end - # source://tapioca//lib/tapioca/helpers/config_helper.rb#46 + # pkg:gem/tapioca#lib/tapioca/helpers/config_helper.rb:45 sig { params(options: T::Hash[::Symbol, ::Thor::Option]).void } def filter_defaults(options); end - # source://tapioca//lib/tapioca/helpers/config_helper.rb#196 + # pkg:gem/tapioca#lib/tapioca/helpers/config_helper.rb:186 sig do params( options: T.nilable(::Thor::CoreExt::HashWithIndifferentAccess) @@ -1131,11 +1036,11 @@ module Tapioca::ConfigHelper end def merge_options(*options); end - # source://tapioca//lib/tapioca/helpers/config_helper.rb#70 + # pkg:gem/tapioca#lib/tapioca/helpers/config_helper.rb:69 sig { params(config_file: ::String, config: T::Hash[T.untyped, T.untyped]).void } def validate_config!(config_file, config); end - # source://tapioca//lib/tapioca/helpers/config_helper.rb#102 + # pkg:gem/tapioca#lib/tapioca/helpers/config_helper.rb:95 sig do params( command_options: T::Hash[::Symbol, ::Thor::Option], @@ -1146,80 +1051,68 @@ module Tapioca::ConfigHelper def validate_config_options(command_options, config_key, config_options); end end -# source://tapioca//lib/tapioca/helpers/config_helper.rb#148 +# pkg:gem/tapioca#lib/tapioca/helpers/config_helper.rb:141 class Tapioca::ConfigHelper::ConfigError < ::T::Struct const :message_parts, T::Array[::Tapioca::ConfigHelper::ConfigErrorMessagePart] - - class << self - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end end -# source://tapioca//lib/tapioca/helpers/config_helper.rb#143 +# pkg:gem/tapioca#lib/tapioca/helpers/config_helper.rb:136 class Tapioca::ConfigHelper::ConfigErrorMessagePart < ::T::Struct const :message, ::String const :colors, T::Array[::Symbol] - - class << self - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end - end end -# source://tapioca//lib/tapioca.rb#46 +# pkg:gem/tapioca#lib/tapioca.rb:25 Tapioca::DEFAULT_ANNOTATIONS_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#42 +# pkg:gem/tapioca#lib/tapioca.rb:21 Tapioca::DEFAULT_DSL_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#58 +# pkg:gem/tapioca#lib/tapioca.rb:34 Tapioca::DEFAULT_ENVIRONMENT = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#43 +# pkg:gem/tapioca#lib/tapioca.rb:22 Tapioca::DEFAULT_GEM_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#48 +# pkg:gem/tapioca#lib/tapioca.rb:27 Tapioca::DEFAULT_OVERRIDES = T.let(T.unsafe(nil), Hash) -# source://tapioca//lib/tapioca.rb#40 +# pkg:gem/tapioca#lib/tapioca.rb:19 Tapioca::DEFAULT_POSTREQUIRE_FILE = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#41 +# pkg:gem/tapioca#lib/tapioca.rb:20 Tapioca::DEFAULT_RBI_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca/rbi_formatter.rb#31 +# pkg:gem/tapioca#lib/tapioca/rbi_formatter.rb:23 Tapioca::DEFAULT_RBI_FORMATTER = T.let(T.unsafe(nil), Tapioca::RBIFormatter) -# source://tapioca//lib/tapioca.rb#57 +# pkg:gem/tapioca#lib/tapioca.rb:33 Tapioca::DEFAULT_RBI_MAX_LINE_LENGTH = T.let(T.unsafe(nil), Integer) -# source://tapioca//lib/tapioca.rb#44 +# pkg:gem/tapioca#lib/tapioca.rb:23 Tapioca::DEFAULT_SHIM_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#45 +# pkg:gem/tapioca#lib/tapioca.rb:24 Tapioca::DEFAULT_TODO_FILE = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca/dsl/compilers.rb#5 +# pkg:gem/tapioca#lib/tapioca/dsl/compilers.rb:5 module Tapioca::Dsl; end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://tapioca//lib/tapioca/dsl/compiler.rb#6 +# pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:6 class Tapioca::Dsl::Compiler extend T::Generic include ::Tapioca::SorbetHelper include ::Tapioca::RBIHelper - include ::Tapioca::Runtime::AttachedClassOf include ::Tapioca::Runtime::Reflection - extend ::Tapioca::Runtime::AttachedClassOf extend ::Tapioca::Runtime::Reflection abstract! - ConstantType = type_member { { upper: Module } } + ConstantType = type_member { { upper: T::Module[T.anything] } } - # source://tapioca//lib/tapioca/dsl/compiler.rb#110 + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:89 sig do params( pipeline: ::Tapioca::Dsl::Pipeline, @@ -1232,86 +1125,86 @@ class Tapioca::Dsl::Compiler # NOTE: This should eventually accept an `Error` object or `Exception` rather than simply a `String`. # - # source://tapioca//lib/tapioca/dsl/compiler.rb#128 + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:108 sig { params(error: ::String).void } def add_error(error); end - # source://tapioca//lib/tapioca/dsl/compiler.rb#119 + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:98 sig { params(compiler_name: ::String).returns(T::Boolean) } def compiler_enabled?(compiler_name); end - # source://tapioca//lib/tapioca/dsl/compiler.rb#20 + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:20 sig { returns(ConstantType) } def constant; end # @abstract # - # source://tapioca//lib/tapioca/dsl/compiler.rb#124 + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:104 sig { abstract.void } def decorate; end - # source://tapioca//lib/tapioca/dsl/compiler.rb#26 + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:26 sig { returns(T::Hash[::String, T.untyped]) } def options; end - # source://tapioca//lib/tapioca/dsl/compiler.rb#23 + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:23 sig { returns(::RBI::Tree) } def root; end private - # source://tapioca//lib/tapioca/dsl/compiler.rb#177 + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:157 sig { params(method_def: T.any(::Method, ::UnboundMethod)).returns(T::Array[::RBI::TypedParam]) } def compile_method_parameters_to_rbi(method_def); end - # source://tapioca//lib/tapioca/dsl/compiler.rb#213 + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:193 sig { params(method_def: T.any(::Method, ::UnboundMethod)).returns(::String) } def compile_method_return_type_to_rbi(method_def); end - # source://tapioca//lib/tapioca/dsl/compiler.rb#167 + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:144 sig { params(scope: ::RBI::Scope, method_def: T.any(::Method, ::UnboundMethod), class_method: T::Boolean).void } def create_method_from_def(scope, method_def, class_method: T.unsafe(nil)); end # Get the types of each parameter from a method signature # - # source://tapioca//lib/tapioca/dsl/compiler.rb#141 + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:116 sig { params(method_def: T.any(::Method, ::UnboundMethod), signature: T.untyped).returns(T::Array[::String]) } def parameters_types_from_signature(method_def, signature); end class << self # @abstract # - # source://tapioca//lib/tapioca/dsl/compiler.rb#39 - sig { abstract.returns(T::Enumerable[::Module]) } + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:38 + sig { abstract.returns(T::Enumerable[T::Module[T.anything]]) } def gather_constants; end - # source://tapioca//lib/tapioca/dsl/compiler.rb#34 - sig { params(constant: ::Module).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:32 + sig { params(constant: T::Module[T.anything]).returns(T::Boolean) } def handles?(constant); end - # source://tapioca//lib/tapioca/dsl/compiler.rb#42 - sig { returns(T::Set[::Module]) } + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:41 + sig { returns(T::Set[T::Module[T.anything]]) } def processable_constants; end - # source://tapioca//lib/tapioca/dsl/compiler.rb#50 - sig { params(constants: T::Array[::Module]).void } + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:46 + sig { params(constants: T::Array[T::Module[T.anything]]).void } def requested_constants=(constants); end - # source://tapioca//lib/tapioca/dsl/compiler.rb#55 + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:51 sig { void } def reset_state; end private - # source://tapioca//lib/tapioca/dsl/compiler.rb#82 + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:74 sig { returns(T::Enumerable[T::Class[T.anything]]) } def all_classes; end - # source://tapioca//lib/tapioca/dsl/compiler.rb#90 - sig { returns(T::Enumerable[::Module]) } + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:79 + sig { returns(T::Enumerable[T::Module[T.anything]]) } def all_modules; end - # source://tapioca//lib/tapioca/dsl/compiler.rb#68 + # pkg:gem/tapioca#lib/tapioca/dsl/compiler.rb:60 sig do type_parameters(:U) .params( @@ -1322,7 +1215,7 @@ class Tapioca::Dsl::Compiler end end -# source://tapioca//lib/tapioca/dsl/compilers.rb#6 +# pkg:gem/tapioca#lib/tapioca/dsl/compilers.rb:6 module Tapioca::Dsl::Compilers; end # DSL compilers are either built-in to Tapioca and live under the @@ -1332,20 +1225,20 @@ module Tapioca::Dsl::Compilers; end # qualified name. This constant encapsulates that dual lookup when # a compiler needs to be resolved by name. # -# source://tapioca//lib/tapioca/dsl/compilers.rb#13 +# pkg:gem/tapioca#lib/tapioca/dsl/compilers.rb:13 Tapioca::Dsl::Compilers::NAMESPACES = T.let(T.unsafe(nil), Array) -# source://tapioca//lib/tapioca/dsl/pipeline.rb#6 +# pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:6 class Tapioca::Dsl::Pipeline - # source://tapioca//lib/tapioca/dsl/pipeline.rb#40 + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:26 sig do params( - requested_constants: T::Array[::Module], + requested_constants: T::Array[T::Module[T.anything]], requested_paths: T::Array[::Pathname], requested_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)], excluded_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)], error_handler: T.proc.params(error: ::String).void, - skipped_constants: T::Array[::Module], + skipped_constants: T::Array[T::Module[T.anything]], number_of_workers: T.nilable(::Integer), compiler_options: T::Hash[::String, T.untyped], lsp_addon: T::Boolean @@ -1353,62 +1246,62 @@ class Tapioca::Dsl::Pipeline end def initialize(requested_constants:, requested_paths: T.unsafe(nil), requested_compilers: T.unsafe(nil), excluded_compilers: T.unsafe(nil), error_handler: T.unsafe(nil), skipped_constants: T.unsafe(nil), number_of_workers: T.unsafe(nil), compiler_options: T.unsafe(nil), lsp_addon: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#10 + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:8 sig { returns(T::Enumerable[T.class_of(Tapioca::Dsl::Compiler)]) } def active_compilers; end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#110 + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:90 sig { params(error: ::String).void } def add_error(error); end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#115 + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:95 sig { params(compiler_name: ::String).returns(T::Boolean) } def compiler_enabled?(compiler_name); end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#124 + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:104 sig { returns(T::Array[T.class_of(Tapioca::Dsl::Compiler)]) } def compilers; end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#22 + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:20 sig { returns(T.proc.params(error: ::String).void) } def error_handler; end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#25 + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:23 sig { returns(T::Array[::String]) } def errors; end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#13 - sig { returns(T::Array[::Module]) } + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:11 + sig { returns(T::Array[T::Module[T.anything]]) } def requested_constants; end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#16 + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:14 sig { returns(T::Array[::Pathname]) } def requested_paths; end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#70 + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:50 sig do - type_parameters(:T) + type_parameters(:R) .params( - blk: T.proc.params(constant: ::Module, rbi: ::RBI::File).returns(T.type_parameter(:T)) - ).returns(T::Array[T.type_parameter(:T)]) + blk: T.proc.params(constant: T::Module[T.anything], rbi: ::RBI::File).returns(T.type_parameter(:R)) + ).returns(T::Array[T.type_parameter(:R)]) end def run(&blk); end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#19 - sig { returns(T::Array[::Module]) } + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:17 + sig { returns(T::Array[T::Module[T.anything]]) } def skipped_constants; end private - # source://tapioca//lib/tapioca/dsl/pipeline.rb#231 + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:197 sig { void } def abort_if_pending_migrations!; end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#177 - sig { params(constants: T::Set[::Module]).returns(T::Set[::Module]) } + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:143 + sig { params(constants: T::Set[T::Module[T.anything]]).returns(T::Set[T::Module[T.anything]]) } def filter_anonymous_and_reloaded_constants(constants); end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#141 + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:113 sig do params( requested_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)], @@ -1417,43 +1310,43 @@ class Tapioca::Dsl::Pipeline end def gather_active_compilers(requested_compilers, excluded_compilers); end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#155 + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:121 sig do params( - requested_constants: T::Array[::Module], + requested_constants: T::Array[T::Module[T.anything]], requested_paths: T::Array[::Pathname], - skipped_constants: T::Array[::Module] - ).returns(T::Set[::Module]) + skipped_constants: T::Array[T::Module[T.anything]] + ).returns(T::Set[T::Module[T.anything]]) end def gather_constants(requested_constants, requested_paths, skipped_constants); end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#206 - sig { params(constant: ::Module).returns(T.nilable(::RBI::File)) } + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:172 + sig { params(constant: T::Module[T.anything]).returns(T.nilable(::RBI::File)) } def rbi_for_constant(constant); end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#225 + # pkg:gem/tapioca#lib/tapioca/dsl/pipeline.rb:191 sig { params(error: ::String).void } def report_error(error); end end -# source://tapioca//lib/tapioca/helpers/env_helper.rb#5 +# pkg:gem/tapioca#lib/tapioca/helpers/env_helper.rb:5 module Tapioca::EnvHelper requires_ancestor { Thor } - # source://tapioca//lib/tapioca/helpers/env_helper.rb#12 + # pkg:gem/tapioca#lib/tapioca/helpers/env_helper.rb:11 sig { params(options: T::Hash[::Symbol, T.untyped]).void } def set_environment(options); end end class Tapioca::Error < ::StandardError; end -# source://tapioca//lib/tapioca/executor.rb#5 +# pkg:gem/tapioca#lib/tapioca/executor.rb:5 class Tapioca::Executor - # source://tapioca//lib/tapioca/executor.rb#11 + # pkg:gem/tapioca#lib/tapioca/executor.rb:9 sig { params(queue: T::Array[T.untyped], number_of_workers: T.nilable(::Integer)).void } def initialize(queue, number_of_workers: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/executor.rb#28 + # pkg:gem/tapioca#lib/tapioca/executor.rb:20 sig do type_parameters(:T) .params( @@ -1464,187 +1357,243 @@ class Tapioca::Executor private - # source://tapioca//lib/tapioca/executor.rb#37 + # pkg:gem/tapioca#lib/tapioca/executor.rb:29 sig { returns(::Integer) } def max_processors; end end -# source://tapioca//lib/tapioca/executor.rb#8 +# pkg:gem/tapioca#lib/tapioca/executor.rb:6 Tapioca::Executor::MINIMUM_ITEMS_PER_WORKER = T.let(T.unsafe(nil), Integer) -# source://tapioca//lib/tapioca/gem/events.rb#5 +# pkg:gem/tapioca#lib/tapioca/gem/events.rb:5 module Tapioca::Gem; end -# source://tapioca//lib/tapioca/gem/events.rb#77 +# pkg:gem/tapioca#lib/tapioca/gem/events.rb:72 class Tapioca::Gem::ConstNodeAdded < ::Tapioca::Gem::NodeAdded - # source://tapioca//lib/tapioca/gem/events.rb#84 - sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Const).void } + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:77 + sig { params(symbol: ::String, constant: T::Module[T.anything], node: ::RBI::Const).void } def initialize(symbol, constant, node); end - # source://tapioca//lib/tapioca/gem/events.rb#81 + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:74 sig { returns(::RBI::Const) } def node; end end -# source://tapioca//lib/tapioca/gem/events.rb#26 +# pkg:gem/tapioca#lib/tapioca/gem/events.rb:23 class Tapioca::Gem::ConstantFound < ::Tapioca::Gem::Event - # source://tapioca//lib/tapioca/gem/events.rb#36 - sig { params(symbol: ::String, constant: ::BasicObject).void } + # @without_runtime + # + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:33 def initialize(symbol, constant); end - # source://tapioca//lib/tapioca/gem/events.rb#33 - sig { returns(::BasicObject) } + # @without_runtime + # + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:29 def constant; end - # source://tapioca//lib/tapioca/gem/events.rb#30 + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:25 sig { returns(::String) } def symbol; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://tapioca//lib/tapioca/gem/events.rb#6 +# pkg:gem/tapioca#lib/tapioca/gem/events.rb:6 class Tapioca::Gem::Event abstract! end -# source://tapioca//lib/tapioca/gem/events.rb#43 +# pkg:gem/tapioca#lib/tapioca/gem/events.rb:40 class Tapioca::Gem::ForeignConstantFound < ::Tapioca::Gem::ConstantFound - # source://tapioca//lib/tapioca/gem/events.rb#52 - sig { params(symbol: ::String, constant: ::Module).void } + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:48 + sig { params(symbol: ::String, constant: T::Module[T.anything]).void } def initialize(symbol, constant); end - # source://tapioca//lib/tapioca/gem/events.rb#47 - sig { override.returns(::Module) } + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:43 + sig { override.returns(T::Module[T.anything]) } def constant; end end -# source://tapioca//lib/tapioca/gem/events.rb#103 +# pkg:gem/tapioca#lib/tapioca/gem/events.rb:94 class Tapioca::Gem::ForeignScopeNodeAdded < ::Tapioca::Gem::ScopeNodeAdded; end -# source://tapioca//lib/tapioca/gem/listeners/base.rb#6 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/base.rb:6 module Tapioca::Gem::Listeners; end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://tapioca//lib/tapioca/gem/listeners/base.rb#7 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/base.rb:7 class Tapioca::Gem::Listeners::Base abstract! - # source://tapioca//lib/tapioca/gem/listeners/base.rb#14 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/base.rb:13 sig { params(pipeline: ::Tapioca::Gem::Pipeline).void } def initialize(pipeline); end - # source://tapioca//lib/tapioca/gem/listeners/base.rb#19 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/base.rb:18 sig { params(event: ::Tapioca::Gem::NodeAdded).void } def dispatch(event); end private - # source://tapioca//lib/tapioca/gem/listeners/base.rb#49 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/base.rb:48 sig { params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/base.rb#37 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/base.rb:36 sig { params(event: ::Tapioca::Gem::ConstNodeAdded).void } def on_const(event); end - # source://tapioca//lib/tapioca/gem/listeners/base.rb#45 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/base.rb:44 sig { params(event: ::Tapioca::Gem::MethodNodeAdded).void } def on_method(event); end - # source://tapioca//lib/tapioca/gem/listeners/base.rb#41 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/base.rb:40 sig { params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end -# source://tapioca//lib/tapioca/gem/listeners/dynamic_mixins.rb#7 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/documentation.rb:7 +class Tapioca::Gem::Listeners::Documentation < ::Tapioca::Gem::Listeners::Base + # pkg:gem/tapioca#lib/tapioca/gem/listeners/documentation.rb:21 + sig { params(pipeline: ::Tapioca::Gem::Pipeline, gem_graph: ::Rubydex::Graph).void } + def initialize(pipeline, gem_graph); end + + private + + # pkg:gem/tapioca#lib/tapioca/gem/listeners/documentation.rb:58 + sig { params(name: ::String, sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Comment]) } + def documentation_comments(name, sigs: T.unsafe(nil)); end + + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/documentation.rb:88 + sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } + def ignore?(event); end + + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/documentation.rb:36 + sig { override.params(event: ::Tapioca::Gem::ConstNodeAdded).void } + def on_const(event); end + + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/documentation.rb:48 + sig { override.params(event: ::Tapioca::Gem::MethodNodeAdded).void } + def on_method(event); end + + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/documentation.rb:42 + sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end + + # pkg:gem/tapioca#lib/tapioca/gem/listeners/documentation.rb:30 + sig { params(line: ::String).returns(T::Boolean) } + def rbs_comment?(line); end +end + +# pkg:gem/tapioca#lib/tapioca/gem/listeners/documentation.rb:8 +Tapioca::Gem::Listeners::Documentation::IGNORED_COMMENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/tapioca#lib/tapioca/gem/listeners/dynamic_mixins.rb:7 class Tapioca::Gem::Listeners::DynamicMixins < ::Tapioca::Gem::Listeners::Base - include ::Tapioca::Runtime::AttachedClassOf include ::Tapioca::Runtime::Reflection private - # source://tapioca//lib/tapioca/gem/listeners/dynamic_mixins.rb#31 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/dynamic_mixins.rb:31 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/dynamic_mixins.rb#15 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/dynamic_mixins.rb:14 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end -# source://tapioca//lib/tapioca/gem/listeners/foreign_constants.rb#7 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/foreign_constants.rb:7 class Tapioca::Gem::Listeners::ForeignConstants < ::Tapioca::Gem::Listeners::Base - include ::Tapioca::Runtime::AttachedClassOf include ::Tapioca::Runtime::Reflection private - # source://tapioca//lib/tapioca/gem/listeners/foreign_constants.rb#60 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/foreign_constants.rb:56 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/foreign_constants.rb#55 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/foreign_constants.rb:50 sig { params(location: ::String).returns(T::Boolean) } def mixed_in_by_gem?(location); end - # source://tapioca//lib/tapioca/gem/listeners/foreign_constants.rb#15 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/foreign_constants.rb:14 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end -# source://tapioca//lib/tapioca/gem/listeners/methods.rb#7 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/methods.rb:7 class Tapioca::Gem::Listeners::Methods < ::Tapioca::Gem::Listeners::Base include ::Tapioca::SorbetHelper include ::Tapioca::RBIHelper - include ::Tapioca::Runtime::AttachedClassOf include ::Tapioca::Runtime::Reflection private - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#35 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/methods.rb:26 sig do params( tree: ::RBI::Tree, module_name: ::String, - mod: ::Module, + mod: T::Module[T.anything], for_visibility: T::Array[::Symbol], - attached_class: T.nilable(::Module) + attached_class: T.nilable(T::Module[T.anything]) ).void end def compile_directly_owned_methods(tree, module_name, mod, for_visibility = T.unsafe(nil), attached_class: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#71 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/methods.rb:54 sig do params( tree: ::RBI::Tree, symbol_name: ::String, - constant: ::Module, + constant: T::Module[T.anything], method: T.nilable(::UnboundMethod), visibility: ::RBI::Visibility ).void end def compile_method(tree, symbol_name, constant, method, visibility = T.unsafe(nil)); end - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#211 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/methods.rb:210 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#204 - sig { params(constant: ::Module).returns(T.nilable(::UnboundMethod)) } + # pkg:gem/tapioca#lib/tapioca/gem/listeners/methods.rb:202 + sig { params(constant: T::Module[T.anything]).returns(T.nilable(::UnboundMethod)) } def initialize_method_for(constant); end - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#216 - sig { params(method: ::UnboundMethod).returns(T.untyped) } - def lookup_signature_of(method); end - - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#172 - sig { params(mod: ::Module).returns(T::Hash[::Symbol, T::Array[::Symbol]]) } + # pkg:gem/tapioca#lib/tapioca/gem/listeners/methods.rb:175 + sig { params(mod: T::Module[T.anything]).returns(T::Hash[::Symbol, T::Array[::Symbol]]) } def method_names_by_visibility(mod); end - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#196 - sig { params(attached_class: T.nilable(::Module), method_name: ::Symbol).returns(T.nilable(T::Boolean)) } + # pkg:gem/tapioca#lib/tapioca/gem/listeners/methods.rb:194 + sig do + params( + attached_class: T.nilable(T::Module[T.anything]), + method_name: ::Symbol + ).returns(T.nilable(T::Boolean)) + end def method_new_in_abstract_class?(attached_class, method_name); end # Check whether the method is defined by the constant. @@ -1657,266 +1606,264 @@ class Tapioca::Gem::Listeners::Methods < ::Tapioca::Gem::Listeners::Base # It walks up the ancestor tree via the `super_method` method; if any of the super # methods are owned by the constant, it means that the constant declares the method. # - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#158 - sig { params(method: ::UnboundMethod, constant: ::Module).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/gem/listeners/methods.rb:161 + sig { params(method: ::UnboundMethod, constant: T::Module[T.anything]).returns(T::Boolean) } def method_owned_by_constant?(method, constant); end - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#16 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/methods.rb:15 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#181 - sig { params(constant: ::Module, method_name: ::String).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/gem/listeners/methods.rb:184 + sig { params(constant: T::Module[T.anything], method_name: ::String).returns(T::Boolean) } def struct_method?(constant, method_name); end end -# source://tapioca//lib/tapioca/gem/listeners/mixins.rb#7 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/mixins.rb:7 class Tapioca::Gem::Listeners::Mixins < ::Tapioca::Gem::Listeners::Base - include ::Tapioca::Runtime::AttachedClassOf include ::Tapioca::Runtime::Reflection private - # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#42 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/mixins.rb:34 sig do params( tree: ::RBI::Tree, - constant: ::Module, - mods: T::Array[::Module], + constant: T::Module[T.anything], + mods: T::Array[T::Module[T.anything]], mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type ).void end def add_mixins(tree, constant, mods, mixin_type); end - # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#84 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/mixins.rb:70 sig { params(mixin_name: ::String).returns(T::Boolean) } def filtered_mixin?(mixin_name); end - # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#91 - sig { params(constant: ::Module).returns(T::Array[::Module]) } + # pkg:gem/tapioca#lib/tapioca/gem/listeners/mixins.rb:77 + sig { params(constant: T::Module[T.anything]).returns(T::Array[T::Module[T.anything]]) } def interesting_ancestors_of(constant); end - # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#75 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/mixins.rb:61 sig do params( - constant: ::Module, - mixin: ::Module, + constant: T::Module[T.anything], + mixin: T::Module[T.anything], mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type ).returns(T::Boolean) end def mixed_in_by_gem?(constant, mixin, mixin_type); end - # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#15 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/mixins.rb:14 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end -# source://tapioca//lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb#7 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb:7 class Tapioca::Gem::Listeners::RemoveEmptyPayloadScopes < ::Tapioca::Gem::Listeners::Base - include ::Tapioca::Runtime::AttachedClassOf include ::Tapioca::Runtime::Reflection private - # source://tapioca//lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb#20 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb:20 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb#15 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb:14 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end -# source://tapioca//lib/tapioca/gem/listeners/sorbet_enums.rb#7 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_enums.rb:7 class Tapioca::Gem::Listeners::SorbetEnums < ::Tapioca::Gem::Listeners::Base private - # source://tapioca//lib/tapioca/gem/listeners/sorbet_enums.rb#28 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_enums.rb:28 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_enums.rb#13 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_enums.rb:12 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end -# source://tapioca//lib/tapioca/gem/listeners/sorbet_helpers.rb#7 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_helpers.rb:7 class Tapioca::Gem::Listeners::SorbetHelpers < ::Tapioca::Gem::Listeners::Base - include ::Tapioca::Runtime::AttachedClassOf include ::Tapioca::Runtime::Reflection private - # source://tapioca//lib/tapioca/gem/listeners/sorbet_helpers.rb#27 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_helpers.rb:27 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_helpers.rb#15 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_helpers.rb:14 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end -# source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#7 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_props.rb:7 class Tapioca::Gem::Listeners::SorbetProps < ::Tapioca::Gem::Listeners::Base include ::Tapioca::SorbetHelper include ::Tapioca::RBIHelper private - # source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#33 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_props.rb:34 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#14 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_props.rb:14 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end -# source://tapioca//lib/tapioca/gem/listeners/sorbet_required_ancestors.rb#7 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_required_ancestors.rb:7 class Tapioca::Gem::Listeners::SorbetRequiredAncestors < ::Tapioca::Gem::Listeners::Base private - # source://tapioca//lib/tapioca/gem/listeners/sorbet_required_ancestors.rb#23 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_required_ancestors.rb:23 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_required_ancestors.rb#13 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_required_ancestors.rb:12 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end -# source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#7 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_signatures.rb:7 class Tapioca::Gem::Listeners::SorbetSignatures < ::Tapioca::Gem::Listeners::Base - include ::Tapioca::Runtime::AttachedClassOf include ::Tapioca::Runtime::Reflection include ::Tapioca::SorbetHelper include ::Tapioca::RBIHelper private - # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#26 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_signatures.rb:23 sig { params(signature: T.untyped, parameters: T::Array[[::Symbol, ::String]]).returns(::RBI::Sig) } def compile_signature(signature, parameters); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#79 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_signatures.rb:77 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#18 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_signatures.rb:15 sig { override.params(event: ::Tapioca::Gem::MethodNodeAdded).void } def on_method(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#68 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_signatures.rb:65 sig { params(signature: T.untyped).returns(T::Boolean) } def signature_final?(signature); end end -# source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#13 -Tapioca::Gem::Listeners::SorbetSignatures::TYPE_PARAMETER_MATCHER = T.let(T.unsafe(nil), Regexp) - -# source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#7 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_type_variables.rb:7 class Tapioca::Gem::Listeners::SorbetTypeVariables < ::Tapioca::Gem::Listeners::Base - include ::Tapioca::Runtime::AttachedClassOf include ::Tapioca::Runtime::Reflection private - # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#27 - sig { params(tree: ::RBI::Tree, constant: ::Module).void } + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_type_variables.rb:26 + sig { params(tree: ::RBI::Tree, constant: T::Module[T.anything]).void } def compile_type_variable_declarations(tree, constant); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#63 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_type_variables.rb:63 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#50 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_type_variables.rb:49 sig { params(type_variable: ::Tapioca::TypeVariableModule).returns(T.nilable(::RBI::Node)) } def node_from_type_variable(type_variable); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#15 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/sorbet_type_variables.rb:14 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end -# source://tapioca//lib/tapioca/gem/listeners/source_location.rb#7 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/source_location.rb:7 class Tapioca::Gem::Listeners::SourceLocation < ::Tapioca::Gem::Listeners::Base private - # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#41 + # pkg:gem/tapioca#lib/tapioca/gem/listeners/source_location.rb:46 sig { params(node: ::RBI::NodeWithComments, file: T.nilable(::String), line: T.nilable(::Integer)).void } def add_source_location_comment(node, file, line); end - # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#13 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/source_location.rb:12 sig { override.params(event: ::Tapioca::Gem::ConstNodeAdded).void } def on_const(event); end - # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#35 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/source_location.rb:36 sig { override.params(event: ::Tapioca::Gem::MethodNodeAdded).void } def on_method(event); end - # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#19 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/source_location.rb:19 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end -# source://tapioca//lib/tapioca/gem/listeners/subconstants.rb#7 +# pkg:gem/tapioca#lib/tapioca/gem/listeners/subconstants.rb:7 class Tapioca::Gem::Listeners::Subconstants < ::Tapioca::Gem::Listeners::Base - include ::Tapioca::Runtime::AttachedClassOf include ::Tapioca::Runtime::Reflection private - # source://tapioca//lib/tapioca/gem/listeners/subconstants.rb#35 - sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } - def ignore?(event); end - - # source://tapioca//lib/tapioca/gem/listeners/subconstants.rb#15 - sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } - def on_scope(event); end -end - -# source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#7 -class Tapioca::Gem::Listeners::YardDoc < ::Tapioca::Gem::Listeners::Base - # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#27 - sig { params(pipeline: ::Tapioca::Gem::Pipeline).void } - def initialize(pipeline); end - - private - - # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#55 - sig { params(name: ::String, sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Comment]) } - def documentation_comments(name, sigs: T.unsafe(nil)); end - - # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#99 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/subconstants.rb:35 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#36 - sig { override.params(event: ::Tapioca::Gem::ConstNodeAdded).void } - def on_const(event); end - - # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#46 - sig { override.params(event: ::Tapioca::Gem::MethodNodeAdded).void } - def on_method(event); end - - # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#41 + # @override + # + # pkg:gem/tapioca#lib/tapioca/gem/listeners/subconstants.rb:14 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end -# source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#10 -Tapioca::Gem::Listeners::YardDoc::IGNORED_COMMENTS = T.let(T.unsafe(nil), Array) - -# source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#24 -Tapioca::Gem::Listeners::YardDoc::IGNORED_SIG_TAGS = T.let(T.unsafe(nil), Array) - -# source://tapioca//lib/tapioca/gem/events.rb#105 +# pkg:gem/tapioca#lib/tapioca/gem/events.rb:96 class Tapioca::Gem::MethodNodeAdded < ::Tapioca::Gem::NodeAdded - # source://tapioca//lib/tapioca/gem/events.rb#130 + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:110 sig do params( symbol: ::String, - constant: ::Module, + constant: T::Module[T.anything], method: ::UnboundMethod, node: ::RBI::Method, signature: T.untyped, @@ -1925,50 +1872,49 @@ class Tapioca::Gem::MethodNodeAdded < ::Tapioca::Gem::NodeAdded end def initialize(symbol, constant, method, node, signature, parameters); end - # source://tapioca//lib/tapioca/gem/events.rb#109 + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:98 sig { returns(::UnboundMethod) } def method; end - # source://tapioca//lib/tapioca/gem/events.rb#112 + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:101 sig { returns(::RBI::Method) } def node; end - # source://tapioca//lib/tapioca/gem/events.rb#118 + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:107 sig { returns(T::Array[[::Symbol, ::String]]) } def parameters; end - # source://tapioca//lib/tapioca/gem/events.rb#115 + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:104 sig { returns(T.untyped) } def signature; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://tapioca//lib/tapioca/gem/events.rb#57 +# pkg:gem/tapioca#lib/tapioca/gem/events.rb:53 class Tapioca::Gem::NodeAdded < ::Tapioca::Gem::Event abstract! - # source://tapioca//lib/tapioca/gem/events.rb#70 - sig { params(symbol: ::String, constant: ::Module).void } + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:65 + sig { params(symbol: ::String, constant: T::Module[T.anything]).void } def initialize(symbol, constant); end - # source://tapioca//lib/tapioca/gem/events.rb#67 - sig { returns(::Module) } + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:62 + sig { returns(T::Module[T.anything]) } def constant; end - # source://tapioca//lib/tapioca/gem/events.rb#64 + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:59 sig { returns(::String) } def symbol; end end -# source://tapioca//lib/tapioca/gem/pipeline.rb#6 +# pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:6 class Tapioca::Gem::Pipeline - include ::Tapioca::Runtime::AttachedClassOf include ::Tapioca::Runtime::Reflection include ::Tapioca::SorbetHelper include ::Tapioca::RBIHelper - # source://tapioca//lib/tapioca/gem/pipeline.rb#27 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:19 sig do params( gem: ::Tapioca::Gemfile::GemSpec, @@ -1979,53 +1925,57 @@ class Tapioca::Gem::Pipeline end def initialize(gem, error_handler:, include_doc: T.unsafe(nil), include_loc: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#64 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:57 sig { returns(::RBI::Tree) } def compile; end - # source://tapioca//lib/tapioca/gem/pipeline.rb#135 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:111 sig { params(name: T.any(::String, ::Symbol)).returns(T::Boolean) } def constant_in_gem?(name); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#17 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:16 sig { returns(T.proc.params(error: ::String).void) } def error_handler; end - # source://tapioca//lib/tapioca/gem/pipeline.rb#14 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:13 sig { returns(::Tapioca::Gemfile::GemSpec) } def gem; end - # source://tapioca//lib/tapioca/gem/pipeline.rb#153 - sig { params(method: ::UnboundMethod).returns(T::Boolean) } - def method_in_gem?(method); end + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:147 + sig do + params( + method_name: ::Symbol, + owner: T::Module[T.anything] + ).returns(::Tapioca::Gem::Pipeline::MethodDefinitionLookupResult) + end + def method_definition_in_gem(method_name, owner); end - # Helpers - # - # source://tapioca//lib/tapioca/gem/pipeline.rb#163 - sig { params(constant: ::Module).returns(T.nilable(::String)) } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:173 + sig { params(constant: T::Module[T.anything]).returns(T.nilable(::String)) } def name_of(constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#87 - sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Const).void } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:81 + sig { params(symbol: ::String, constant: T::Module[T.anything], node: ::RBI::Const).void } def push_const(symbol, constant, node); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#77 - sig { params(symbol: ::String, constant: ::BasicObject).void } + # @without_runtime + # + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:71 def push_constant(symbol, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#82 - sig { params(symbol: ::String, constant: ::Module).void } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:76 + sig { params(symbol: ::String, constant: T::Module[T.anything]).void } def push_foreign_constant(symbol, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#101 - sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Scope).void } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:91 + sig { params(symbol: ::String, constant: T::Module[T.anything], node: ::RBI::Scope).void } def push_foreign_scope(symbol, constant, node); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#115 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:96 sig do params( symbol: ::String, - constant: ::Module, + constant: T::Module[T.anything], method: ::UnboundMethod, node: ::RBI::Method, signature: T.untyped, @@ -2034,388 +1984,493 @@ class Tapioca::Gem::Pipeline end def push_method(symbol, constant, method, node, signature, parameters); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#94 - sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Scope).void } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:86 + sig { params(symbol: ::String, constant: T::Module[T.anything], node: ::RBI::Scope).void } def push_scope(symbol, constant, node); end - # Events handling - # - # source://tapioca//lib/tapioca/gem/pipeline.rb#72 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:65 sig { params(symbol: ::String).void } def push_symbol(symbol); end - # Constants and properties filtering - # - # source://tapioca//lib/tapioca/gem/pipeline.rb#122 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:103 sig { params(symbol_name: ::String).returns(T::Boolean) } def symbol_in_payload?(symbol_name); end private - # source://tapioca//lib/tapioca/gem/pipeline.rb#456 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:470 sig { params(name: ::String).void } def add_to_alias_namespace(name); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#461 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:475 sig { params(name: ::String).returns(T::Boolean) } def alias_namespaced?(name); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#260 - sig { params(name: ::String, constant: ::Module).void } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:271 + sig { params(name: ::String, constant: T::Module[T.anything]).void } def compile_alias(name, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#246 - sig { params(symbol: ::String, constant: ::BasicObject).void } + # @without_runtime + # + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:257 def compile_constant(symbol, constant); end - # Compiling - # - # source://tapioca//lib/tapioca/gem/pipeline.rb#235 - sig { params(symbol: ::String, constant: ::Module).void } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:245 + sig { params(symbol: ::String, constant: T::Module[T.anything]).void } def compile_foreign_constant(symbol, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#314 - sig { params(name: ::String, constant: ::Module).void } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:326 + sig { params(name: ::String, constant: T::Module[T.anything]).void } def compile_module(name, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#281 - sig { params(name: ::String, value: ::BasicObject).void } + # @without_runtime + # + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:293 def compile_object(name, value); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#325 - sig { params(name: ::String, constant: ::Module).returns(::RBI::Scope) } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:337 + sig { params(name: ::String, constant: T::Module[T.anything]).returns(::RBI::Scope) } def compile_scope(name, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#339 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:351 sig { params(constant: T::Class[T.anything]).returns(T.nilable(::String)) } def compile_superclass(constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#437 - sig { params(constant: ::Module, strict: T::Boolean).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:451 + sig { params(constant: T::Module[T.anything], strict: T::Boolean).returns(T::Boolean) } def defined_in_gem?(constant, strict: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#193 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:203 sig { params(event: ::Tapioca::Gem::Event).void } def dispatch(event); end - # Helpers - # - # source://tapioca//lib/tapioca/gem/pipeline.rb#480 - sig { params(constant: T.all(::Module, ::T::Generic)).returns(::String) } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:494 + sig { params(constant: T.all(::T::Generic, T::Module[T.anything])).returns(::String) } def generic_name_of(constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#449 - sig { params(constant: ::Module).returns(T::Set[::String]) } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:463 + sig { params(constant: T::Module[T.anything]).returns(T::Set[::String]) } def get_file_candidates(constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#178 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:188 sig { params(gem: ::Tapioca::Gemfile::GemSpec).returns(T::Set[::String]) } def load_bootstrap_symbols(gem); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#496 - sig { params(constant: ::Module, class_name: T.nilable(::String)).returns(T.nilable(::String)) } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:510 + sig { params(constant: T::Module[T.anything], class_name: T.nilable(::String)).returns(T.nilable(::String)) } def name_of_proxy_target(constant, class_name); end - # Events handling - # - # source://tapioca//lib/tapioca/gem/pipeline.rb#188 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:198 sig { returns(::Tapioca::Gem::Event) } def next_event; end - # source://tapioca//lib/tapioca/gem/pipeline.rb#216 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:226 sig { params(event: ::Tapioca::Gem::ConstantFound).void } def on_constant(event); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#228 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:238 sig { params(event: ::Tapioca::Gem::NodeAdded).void } def on_node(event); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#207 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:217 sig { params(event: ::Tapioca::Gem::SymbolFound).void } def on_symbol(event); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#468 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:482 sig { params(name: ::String).void } def seen!(name); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#473 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:487 sig { params(name: ::String).returns(T::Boolean) } def seen?(name); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#407 - sig { params(name: ::String, constant: ::Module).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:420 + sig { params(name: ::String, constant: T::Module[T.anything]).returns(T::Boolean) } def skip_alias?(name, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#395 - sig { params(name: ::String, constant: T.anything).returns(T::Boolean) } + # @without_runtime + # + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:408 def skip_constant?(name, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#424 - sig { params(name: ::String, constant: ::Module).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:438 + sig { params(name: ::String, constant: T::Module[T.anything]).returns(T::Boolean) } def skip_foreign_constant?(name, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#429 - sig { params(name: ::String, constant: ::Module).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:443 + sig { params(name: ::String, constant: T::Module[T.anything]).returns(T::Boolean) } def skip_module?(name, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#416 - sig { params(name: ::String, constant: ::BasicObject).returns(T::Boolean) } + # @without_runtime + # + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:430 def skip_object?(name, constant); end - # Constants and properties filtering - # - # source://tapioca//lib/tapioca/gem/pipeline.rb#390 + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:402 sig { params(name: ::String).returns(T::Boolean) } def skip_symbol?(name); end end -# this looks something like: -# "(eval at /path/to/file.rb:123)" -# and we are just interested in the "/path/to/file.rb" part +# pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:10 +Tapioca::Gem::Pipeline::IGNORED_SYMBOLS = T.let(T.unsafe(nil), Array) + +# pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:120 +class Tapioca::Gem::Pipeline::MethodDefinitionLookupResult + abstract! +end + +# The method defined in gem and has a source location # -# source://tapioca//lib/tapioca/gem/pipeline.rb#132 -Tapioca::Gem::Pipeline::EVAL_SOURCE_FILE_PATTERN = T.let(T.unsafe(nil), Regexp) +# pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:135 +class Tapioca::Gem::Pipeline::MethodInGemWithLocation < ::Tapioca::Gem::Pipeline::MethodDefinitionLookupResult + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:140 + sig { params(location: ::Tapioca::Runtime::SourceLocation).void } + def initialize(location); end -# source://tapioca//lib/tapioca/gem/pipeline.rb#11 -Tapioca::Gem::Pipeline::IGNORED_SYMBOLS = T.let(T.unsafe(nil), Array) + # pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:137 + sig { returns(::Tapioca::Runtime::SourceLocation) } + def location; end +end + +# The method probably defined in the gem but doesn't have a source location +# +# pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:132 +class Tapioca::Gem::Pipeline::MethodInGemWithoutLocation < ::Tapioca::Gem::Pipeline::MethodDefinitionLookupResult; end + +# The method is not defined in the gem +# +# pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:129 +class Tapioca::Gem::Pipeline::MethodNotInGem < ::Tapioca::Gem::Pipeline::MethodDefinitionLookupResult; end -# source://tapioca//lib/tapioca/gem/events.rb#90 +# The method doesn't seem to exist +# +# pkg:gem/tapioca#lib/tapioca/gem/pipeline.rb:126 +class Tapioca::Gem::Pipeline::MethodUnknown < ::Tapioca::Gem::Pipeline::MethodDefinitionLookupResult; end + +# pkg:gem/tapioca#lib/tapioca/gem/events.rb:83 class Tapioca::Gem::ScopeNodeAdded < ::Tapioca::Gem::NodeAdded - # source://tapioca//lib/tapioca/gem/events.rb#97 - sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Scope).void } + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:88 + sig { params(symbol: ::String, constant: T::Module[T.anything], node: ::RBI::Scope).void } def initialize(symbol, constant, node); end - # source://tapioca//lib/tapioca/gem/events.rb#94 + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:85 sig { returns(::RBI::Scope) } def node; end end -# source://tapioca//lib/tapioca/gem/events.rb#13 +# pkg:gem/tapioca#lib/tapioca/gem/events.rb:12 class Tapioca::Gem::SymbolFound < ::Tapioca::Gem::Event - # source://tapioca//lib/tapioca/gem/events.rb#20 + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:17 sig { params(symbol: ::String).void } def initialize(symbol); end - # source://tapioca//lib/tapioca/gem/events.rb#17 + # pkg:gem/tapioca#lib/tapioca/gem/events.rb:14 sig { returns(::String) } def symbol; end end -# source://tapioca//lib/tapioca/helpers/gem_helper.rb#5 +# pkg:gem/tapioca#lib/tapioca/helpers/gem_helper.rb:5 module Tapioca::GemHelper - # source://tapioca//lib/tapioca/helpers/gem_helper.rb#9 + # pkg:gem/tapioca#lib/tapioca/helpers/gem_helper.rb:7 sig { params(app_dir: T.any(::Pathname, ::String), full_gem_path: ::String).returns(T::Boolean) } def gem_in_app_dir?(app_dir, full_gem_path); end - # source://tapioca//lib/tapioca/helpers/gem_helper.rb#17 + # pkg:gem/tapioca#lib/tapioca/helpers/gem_helper.rb:15 sig { params(full_gem_path: ::String).returns(T::Boolean) } def gem_in_bundle_path?(full_gem_path); end - # source://tapioca//lib/tapioca/helpers/gem_helper.rb#22 + # pkg:gem/tapioca#lib/tapioca/helpers/gem_helper.rb:20 sig { params(full_gem_path: ::String).returns(T::Boolean) } def gem_in_ruby_path?(full_gem_path); end - # source://tapioca//lib/tapioca/helpers/gem_helper.rb#27 + # pkg:gem/tapioca#lib/tapioca/helpers/gem_helper.rb:25 sig { params(path: T.any(::Pathname, ::String)).returns(::String) } def to_realpath(path); end private - # source://tapioca//lib/tapioca/helpers/gem_helper.rb#36 + # pkg:gem/tapioca#lib/tapioca/helpers/gem_helper.rb:34 sig { params(path: T.any(::Pathname, ::String), dir: T.any(::Pathname, ::String)).returns(T::Boolean) } def path_in_dir?(path, dir); end end -# source://tapioca//lib/tapioca/gem_info.rb#5 +# pkg:gem/tapioca#lib/tapioca/gem_info.rb:5 class Tapioca::GemInfo < ::T::Struct const :name, ::String const :version, ::Gem::Version class << self - # source://tapioca//lib/tapioca/gem_info.rb#13 - sig { params(spec: ::Bundler::LazySpecification).returns(::Tapioca::GemInfo) } + # pkg:gem/tapioca#lib/tapioca/gem_info.rb:13 + sig { params(spec: T.any(::Bundler::StubSpecification, ::Gem::Specification)).returns(::Tapioca::GemInfo) } def from_spec(spec); end - - # source://sorbet-runtime/0.6.12642/lib/types/struct.rb#13 - def inherited(s); end end end -# source://tapioca//lib/tapioca/gemfile.rb#7 +# pkg:gem/tapioca#lib/tapioca/gemfile.rb:7 class Tapioca::Gemfile - # source://tapioca//lib/tapioca/gemfile.rb#27 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:27 sig { params(excluded_gems: T::Array[::String]).void } def initialize(excluded_gems); end - # source://tapioca//lib/tapioca/gemfile.rb#18 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:18 sig { returns(::Bundler::Definition) } def definition; end - # source://tapioca//lib/tapioca/gemfile.rb#21 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:21 sig { returns(T::Array[::Tapioca::Gemfile::GemSpec]) } def dependencies; end - # source://tapioca//lib/tapioca/gemfile.rb#40 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:40 sig { params(gem_name: ::String).returns(T.nilable(::Tapioca::Gemfile::GemSpec)) } def gem(gem_name); end - # source://tapioca//lib/tapioca/gemfile.rb#24 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:24 sig { returns(T::Array[::String]) } def missing_specs; end - # source://tapioca//lib/tapioca/gemfile.rb#45 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:45 sig { void } def require_bundle; end private - # source://tapioca//lib/tapioca/gemfile.rb#101 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:101 sig { returns(::String) } def dir; end - # source://tapioca//lib/tapioca/gemfile.rb#54 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:54 sig { returns(::File) } def gemfile; end - # source://tapioca//lib/tapioca/gemfile.rb#96 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:96 sig { returns(T::Array[::Symbol]) } def groups; end - # source://tapioca//lib/tapioca/gemfile.rb#57 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:57 sig { returns([T::Array[::Tapioca::Gemfile::GemSpec], T::Array[::String]]) } def load_dependencies; end - # @return [File] - # - # source://tapioca//lib/tapioca/gemfile.rb#54 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:54 def lockfile; end - # source://tapioca//lib/tapioca/gemfile.rb#68 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:68 sig { returns([T::Enumerable[T.any(::Bundler::StubSpecification, ::Gem::Specification)], T::Array[::String]]) } def materialize_deps; end - # source://tapioca//lib/tapioca/gemfile.rb#91 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:91 sig { returns(::Bundler::Runtime) } def runtime; end end -# source://tapioca//lib/tapioca/gemfile.rb#105 +# pkg:gem/tapioca#lib/tapioca/gemfile.rb:105 class Tapioca::Gemfile::GemSpec include ::Tapioca::GemHelper - # source://tapioca//lib/tapioca/gemfile.rb#145 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:137 sig { params(spec: T.any(::Bundler::StubSpecification, ::Gem::Specification)).void } def initialize(spec); end - # source://tapioca//lib/tapioca/gemfile.rb#155 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:147 sig { params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # source://tapioca//lib/tapioca/gemfile.rb#180 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:172 sig { params(path: ::String).returns(T::Boolean) } def contains_path?(path); end - # source://tapioca//lib/tapioca/gemfile.rb#170 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:162 sig { returns(T::Array[::Gem::Dependency]) } def dependencies; end - # source://tapioca//lib/tapioca/gemfile.rb#210 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:186 sig { returns(T::Boolean) } def export_rbi_files?; end - # source://tapioca//lib/tapioca/gemfile.rb#205 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:181 sig { returns(T::Array[::String]) } def exported_rbi_files; end - # source://tapioca//lib/tapioca/gemfile.rb#215 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:191 sig { returns(::RBI::MergeTree) } def exported_rbi_tree; end - # source://tapioca//lib/tapioca/gemfile.rb#142 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:134 sig { returns(T::Array[::Pathname]) } def files; end - # source://tapioca//lib/tapioca/gemfile.rb#139 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:131 sig { returns(::String) } def full_gem_path; end - # source://tapioca//lib/tapioca/gemfile.rb#160 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:152 sig { params(gemfile_dir: ::String).returns(T::Boolean) } def ignore?(gemfile_dir); end - # source://tapioca//lib/tapioca/gemfile.rb#165 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:157 sig { returns(::String) } def name; end - # source://tapioca//lib/tapioca/gemfile.rb#189 - sig { void } - def parse_yard_docs; end - - # source://tapioca//lib/tapioca/gemfile.rb#175 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:167 sig { returns(::String) } def rbi_file_name; end - # source://tapioca//lib/tapioca/gemfile.rb#227 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:203 sig { params(file: ::Pathname).returns(::Pathname) } def relative_path_for(file); end - # @return [String] - # - # source://tapioca//lib/tapioca/gemfile.rb#139 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:131 def version; end private - # source://tapioca//lib/tapioca/gemfile.rb#238 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:214 sig { returns(T::Array[::Pathname]) } def collect_files; end - # source://tapioca//lib/tapioca/gemfile.rb#253 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:229 sig { returns(T.nilable(T::Boolean)) } def default_gem?; end - # source://tapioca//lib/tapioca/gemfile.rb#312 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:285 sig { returns(T::Boolean) } def gem_ignored?; end - # source://tapioca//lib/tapioca/gemfile.rb#291 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:264 sig { params(path: ::String).returns(T::Boolean) } def has_parent_gemspec?(path); end - # source://tapioca//lib/tapioca/gemfile.rb#258 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:234 sig { returns(::Regexp) } def require_paths_prefix_matcher; end - # source://tapioca//lib/tapioca/gemfile.rb#270 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:243 sig { params(file: ::String).returns(::Pathname) } def resolve_to_ruby_lib_dir(file); end - # source://tapioca//lib/tapioca/gemfile.rb#284 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:257 sig { returns(::String) } def version_string; end class << self - # source://tapioca//lib/tapioca/gemfile.rb#113 + # pkg:gem/tapioca#lib/tapioca/gemfile.rb:111 sig { returns(T::Hash[::String, ::Tapioca::Gemfile::GemSpec]) } def spec_lookup_by_file_path; end end end -# source://tapioca//lib/tapioca/gemfile.rb#125 +# pkg:gem/tapioca#lib/tapioca/gemfile.rb:120 Tapioca::Gemfile::GemSpec::IGNORED_GEMS = T.let(T.unsafe(nil), Array) -# source://tapioca//lib/tapioca/gemfile.rb#10 +# pkg:gem/tapioca#lib/tapioca/gemfile.rb:10 Tapioca::Gemfile::Spec = T.type_alias { T.any(::Bundler::StubSpecification, ::Gem::Specification) } -# source://tapioca//lib/tapioca.rb#33 +# pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:47 +module Tapioca::Helpers; end + +# pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:48 +class Tapioca::Helpers::PackageURL + # Constructs a package URL from its components + # @param type [String] The package type or protocol. + # @param namespace [String] A name prefix, specific to the type of package. + # @param name [String] The name of the package. + # @param version [String] The version of the package. + # @param qualifiers [Hash] Extra qualifying data for a package, specific to the type of package. + # @param subpath [String] An extra subpath within a package, relative to the package root. + # + # pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:85 + def initialize(type:, name:, namespace: T.unsafe(nil), version: T.unsafe(nil), qualifiers: T.unsafe(nil), subpath: T.unsafe(nil)); end + + # Returns an array containing the + # scheme, type, namespace, name, version, qualifiers, and subpath components + # of the package URL. + # + # pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:404 + def deconstruct; end + + # Returns a hash containing the + # scheme, type, namespace, name, version, qualifiers, and subpath components + # of the package URL. + # + # pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:411 + def deconstruct_keys(_keys); end + + # The name of the package. + # + # pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:66 + def name; end + + # A name prefix, specific to the type of package. + # For example, an npm scope, a Docker image owner, or a GitHub user. + # + # pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:63 + def namespace; end + + # Extra qualifying data for a package, specific to the type of package. + # For example, the operating system or architecture. + # + # pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:73 + def qualifiers; end + + # The URL scheme, which has a constant value of `"pkg"`. + # + # pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:54 + def scheme; end + + # An extra subpath within a package, relative to the package root. + # + # pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:76 + def subpath; end + + # Returns a hash containing the + # scheme, type, namespace, name, version, qualifiers, and subpath components + # of the package URL. + # + # pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:259 + def to_h; end + + # Returns a string representation of the package URL. + # Package URL representations are created according to the instructions from + # https://github.com/package-url/purl-spec/blob/0b1559f76b79829e789c4f20e6d832c7314762c5/PURL-SPECIFICATION.rst#how-to-build-purl-string-from-its-components. + # + # pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:274 + def to_s; end + + # The package type or protocol, such as `"gem"`, `"npm"`, and `"github"`. + # + # pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:59 + def type; end + + # The version of the package. + # + # pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:69 + def version; end + + class << self + # Creates a new PackageURL from a string. + # @param [String] string The package URL string. + # @raise [InvalidPackageURL] If the string is not a valid package URL. + # @return [PackageURL] + # + # pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:101 + def parse(string); end + end +end + +# Raised when attempting to parse an invalid package URL string. +# @see #parse +# +# pkg:gem/tapioca#lib/tapioca/helpers/package_url.rb:51 +class Tapioca::Helpers::PackageURL::InvalidPackageURL < ::ArgumentError; end + +# pkg:gem/tapioca#lib/tapioca.rb:12 Tapioca::LIB_ROOT_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca/loaders/loader.rb#5 +# pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:5 module Tapioca::Loaders; end -# source://tapioca//lib/tapioca/loaders/dsl.rb#6 +# pkg:gem/tapioca#lib/tapioca/loaders/dsl.rb:6 class Tapioca::Loaders::Dsl < ::Tapioca::Loaders::Loader - # source://tapioca//lib/tapioca/loaders/dsl.rb#74 + # pkg:gem/tapioca#lib/tapioca/loaders/dsl.rb:62 sig do params( tapioca_path: ::String, @@ -2426,40 +2481,42 @@ class Tapioca::Loaders::Dsl < ::Tapioca::Loaders::Loader end def initialize(tapioca_path:, eager_load: T.unsafe(nil), app_root: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/loaders/dsl.rb#36 + # @override + # + # pkg:gem/tapioca#lib/tapioca/loaders/dsl.rb:26 sig { override.void } def load; end - # source://tapioca//lib/tapioca/loaders/dsl.rb#43 + # pkg:gem/tapioca#lib/tapioca/loaders/dsl.rb:33 sig { void } def load_dsl_extensions_and_compilers; end - # source://tapioca//lib/tapioca/loaders/dsl.rb#49 + # pkg:gem/tapioca#lib/tapioca/loaders/dsl.rb:39 sig { void } def reload_custom_compilers; end protected - # source://tapioca//lib/tapioca/loaders/dsl.rb#120 + # pkg:gem/tapioca#lib/tapioca/loaders/dsl.rb:108 sig { void } def load_application; end - # source://tapioca//lib/tapioca/loaders/dsl.rb#100 + # pkg:gem/tapioca#lib/tapioca/loaders/dsl.rb:88 sig { void } def load_dsl_compilers; end - # source://tapioca//lib/tapioca/loaders/dsl.rb#85 + # pkg:gem/tapioca#lib/tapioca/loaders/dsl.rb:73 sig { void } def load_dsl_extensions; end private - # source://tapioca//lib/tapioca/loaders/dsl.rb#136 + # pkg:gem/tapioca#lib/tapioca/loaders/dsl.rb:124 sig { void } def load_custom_dsl_compilers; end class << self - # source://tapioca//lib/tapioca/loaders/dsl.rb#20 + # pkg:gem/tapioca#lib/tapioca/loaders/dsl.rb:9 sig do params( tapioca_path: ::String, @@ -2472,9 +2529,9 @@ class Tapioca::Loaders::Dsl < ::Tapioca::Loaders::Loader end end -# source://tapioca//lib/tapioca/loaders/gem.rb#6 +# pkg:gem/tapioca#lib/tapioca/loaders/gem.rb:6 class Tapioca::Loaders::Gem < ::Tapioca::Loaders::Loader - # source://tapioca//lib/tapioca/loaders/gem.rb#49 + # pkg:gem/tapioca#lib/tapioca/loaders/gem.rb:30 sig do params( bundle: ::Tapioca::Gemfile, @@ -2486,22 +2543,24 @@ class Tapioca::Loaders::Gem < ::Tapioca::Loaders::Loader end def initialize(bundle:, prerequire:, postrequire:, default_command:, halt_upon_load_error:); end - # source://tapioca//lib/tapioca/loaders/gem.rb#34 + # @override + # + # pkg:gem/tapioca#lib/tapioca/loaders/gem.rb:23 sig { override.void } def load; end protected - # source://tapioca//lib/tapioca/loaders/gem.rb#80 + # pkg:gem/tapioca#lib/tapioca/loaders/gem.rb:68 sig { params(file: ::String, error: ::LoadError).void } def explain_failed_require(file, error); end - # source://tapioca//lib/tapioca/loaders/gem.rb#60 + # pkg:gem/tapioca#lib/tapioca/loaders/gem.rb:41 sig { void } def require_gem_file; end class << self - # source://tapioca//lib/tapioca/loaders/gem.rb#21 + # pkg:gem/tapioca#lib/tapioca/loaders/gem.rb:9 sig do params( bundle: ::Tapioca::Gemfile, @@ -2515,9 +2574,9 @@ class Tapioca::Loaders::Gem < ::Tapioca::Loaders::Loader end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://tapioca//lib/tapioca/loaders/loader.rb#6 +# pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:6 class Tapioca::Loaders::Loader include ::Thor::Base include ::Thor::Invocation @@ -2531,7 +2590,7 @@ class Tapioca::Loaders::Loader # @abstract # - # source://tapioca//lib/tapioca/loaders/loader.rb#17 + # pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:17 sig { abstract.void } def load; end @@ -2541,23 +2600,21 @@ class Tapioca::Loaders::Loader # The `eager_load_paths` method still exists, but doesn't return all paths anymore and causes Tapioca to miss some # engine paths. The following commit is the change: # https://github.com/rails/rails/commit/ebfca905db14020589c22e6937382e6f8f687664 + # @without_runtime # - # @param engine [T.class_of(Rails::Engine)] - # @return [Array<String>] - # - # source://tapioca//lib/tapioca/loaders/loader.rb#234 + # pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:218 def eager_load_paths(engine); end - # source://tapioca//lib/tapioca/loaders/loader.rb#199 + # pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:182 sig { void } def eager_load_rails_app; end - # @return [Array<T.class_of(Rails::Engine)>] + # @without_runtime # - # source://tapioca//lib/tapioca/loaders/loader.rb#178 + # pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:161 def engines; end - # source://tapioca//lib/tapioca/loaders/loader.rb#29 + # pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:22 sig do params( gemfile: ::Tapioca::Gemfile, @@ -2568,15 +2625,15 @@ class Tapioca::Loaders::Loader end def load_bundle(gemfile, initialize_file, require_file, halt_upon_load_error); end - # source://tapioca//lib/tapioca/loaders/loader.rb#136 + # pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:118 sig { void } def load_engines_in_classic_mode; end - # source://tapioca//lib/tapioca/loaders/loader.rb#114 + # pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:100 sig { void } def load_engines_in_zeitwerk_mode; end - # source://tapioca//lib/tapioca/loaders/loader.rb#49 + # pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:35 sig do params( environment_load: T::Boolean, @@ -2587,36 +2644,36 @@ class Tapioca::Loaders::Loader end def load_rails_application(environment_load: T.unsafe(nil), eager_load: T.unsafe(nil), app_root: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/loaders/loader.rb#89 + # pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:75 sig { void } def load_rails_engines; end - # source://tapioca//lib/tapioca/loaders/loader.rb#220 + # pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:203 sig { params(file: T.nilable(::String)).void } def require_helper(file); end - # source://tapioca//lib/tapioca/loaders/loader.rb#103 + # pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:89 def run_initializers; end - # source://tapioca//lib/tapioca/loaders/loader.rb#192 + # pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:175 sig { params(path: ::String).void } def safe_require(path); end - # source://tapioca//lib/tapioca/loaders/loader.rb#161 + # pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:143 sig { params(blk: T.proc.void).void } def with_rails_application(&blk); end - # source://tapioca//lib/tapioca/loaders/loader.rb#154 + # pkg:gem/tapioca#lib/tapioca/loaders/loader.rb:136 sig { returns(T::Boolean) } def zeitwerk_mode?; end end -# source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#5 +# pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:5 module Tapioca::RBIFilesHelper requires_ancestor { Tapioca::SorbetHelper } requires_ancestor { Thor::Shell } - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#48 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:42 sig do params( index: ::RBI::Index, @@ -2626,19 +2683,19 @@ module Tapioca::RBIFilesHelper end def duplicated_nodes_from_index(index, shim_rbi_dir:, todo_rbi_file:); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#13 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:13 sig { params(index: ::RBI::Index, kind: ::String, file: ::String).void } def index_rbi(index, kind, file); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#25 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:25 sig { params(index: ::RBI::Index, kind: ::String, dir: ::String, number_of_workers: T.nilable(::Integer)).void } def index_rbis(index, kind, dir, number_of_workers:); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#65 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:59 sig { params(loc: ::RBI::Loc, path_prefix: T.nilable(::String)).returns(::String) } def location_to_payload_url(loc, path_prefix:); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#86 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:71 sig do params( command: ::String, @@ -2653,27 +2710,11 @@ module Tapioca::RBIFilesHelper private - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#223 - sig { params(nodes: T::Array[::RBI::Node]).returns(T::Array[::RBI::Scope]) } - def extract_empty_scopes(nodes); end - - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#228 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:249 sig { params(nodes: T::Array[::RBI::Node]).returns(T::Array[T.any(::RBI::Attr, ::RBI::Method)]) } def extract_methods_and_attrs(nodes); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#238 - sig { params(nodes: T::Array[::RBI::Node]).returns(T::Array[T.any(::RBI::Mixin, ::RBI::RequiresAncestor)]) } - def extract_mixins(nodes); end - - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#248 - sig do - params( - nodes: T::Array[T.any(::RBI::Attr, ::RBI::Method)] - ).returns(T::Array[T.any(::RBI::Attr, ::RBI::Method)]) - end - def extract_nodes_with_sigs(nodes); end - - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#216 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:242 sig do params( nodes: T::Array[::RBI::Node], @@ -2683,94 +2724,112 @@ module Tapioca::RBIFilesHelper end def extract_shims_and_todos(nodes, shim_rbi_dir:, todo_rbi_file:); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#280 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:286 sig { params(path: ::String).returns(::String) } def gem_name_from_rbi_path(path); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#155 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:210 + sig { params(nodes: T::Array[::RBI::Node], shims_or_todos: T::Array[::RBI::Node]).returns(T::Boolean) } + def has_duplicated_methods_and_attrs?(nodes, shims_or_todos); end + + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:202 + sig { params(shims_or_todos: T::Array[::RBI::Node]).returns(T::Boolean) } + def has_duplicated_mixins?(shims_or_todos); end + + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:174 + sig { params(all_nodes: T::Array[::RBI::Node], shims_or_todos: T::Array[::RBI::Node]).returns(T::Boolean) } + def has_duplicated_scopes?(all_nodes, shims_or_todos); end + + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:140 sig { params(index: ::RBI::Index, files: T::Array[::String], number_of_workers: T.nilable(::Integer)).void } def parse_and_index_files(index, files, number_of_workers:); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#171 + # Do the list of `nodes` sharing the same name have duplicates? + # + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:157 sig { params(nodes: T::Array[::RBI::Node], shim_rbi_dir: ::String, todo_rbi_file: ::String).returns(T::Boolean) } def shims_or_todos_have_duplicates?(nodes, shim_rbi_dir:, todo_rbi_file:); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#253 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_files_helper.rb:259 sig { params(errors: T::Array[::Spoom::Sorbet::Errors::Error], gem_dir: ::String).void } def update_gem_rbis_strictnesses(errors, gem_dir); end end -# source://tapioca//lib/tapioca/rbi_formatter.rb#5 +# pkg:gem/tapioca#lib/tapioca/rbi_formatter.rb:5 class Tapioca::RBIFormatter < ::RBI::Formatter - # source://tapioca//lib/tapioca/rbi_formatter.rb#24 + # pkg:gem/tapioca#lib/tapioca/rbi_formatter.rb:16 sig { params(file: ::RBI::File).void } def write_empty_body_comment!(file); end - # source://tapioca//lib/tapioca/rbi_formatter.rb#15 + # pkg:gem/tapioca#lib/tapioca/rbi_formatter.rb:7 sig { params(file: ::RBI::File, command: ::String, reason: T.nilable(::String)).void } def write_header!(file, command, reason: T.unsafe(nil)); end end -# source://tapioca//lib/tapioca/helpers/rbi_helper.rb#5 +# pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:5 module Tapioca::RBIHelper include ::Tapioca::SorbetHelper extend ::Tapioca::SorbetHelper extend ::Tapioca::RBIHelper - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#91 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:80 sig { params(type: ::String).returns(::String) } def as_nilable_type(type); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#100 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:89 sig { params(type: ::String).returns(::String) } def as_non_nilable_type(type); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#72 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:61 sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } def create_block_param(name, type:); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#62 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:51 sig { params(name: ::String, type: ::String, default: ::String).returns(::RBI::TypedParam) } def create_kw_opt_param(name, type:, default:); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#57 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:46 sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } def create_kw_param(name, type:); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#67 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:56 sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } def create_kw_rest_param(name, type:); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#47 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:36 sig { params(name: ::String, type: ::String, default: ::String).returns(::RBI::TypedParam) } def create_opt_param(name, type:, default:); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#42 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:31 sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } def create_param(name, type:); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#52 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:41 sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } def create_rest_param(name, type:); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#77 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:66 sig { params(param: ::RBI::Param, type: ::String).returns(::RBI::TypedParam) } def create_typed_param(param, type); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#82 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:100 + sig { params(type_strings: T::Array[::String]).returns(T::Array[::String]) } + def extract_type_parameters(type_strings); end + + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:71 sig { params(sig_string: ::String).returns(::String) } def sanitize_signature_types(sig_string); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#109 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:105 sig { params(name: ::String).returns(T::Boolean) } def valid_method_name?(name); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#114 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:110 sig { params(name: ::String).returns(T::Boolean) } def valid_parameter_name?(name); end class << self - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#23 + # pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:12 sig do params( type: ::String, @@ -2784,112 +2843,93 @@ module Tapioca::RBIHelper end end -# source://tapioca//lib/tapioca/repo_index.rb#5 +# pkg:gem/tapioca#lib/tapioca/helpers/rbi_helper.rb:97 +Tapioca::RBIHelper::TYPE_PARAMETER_MATCHER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/tapioca#lib/tapioca/repo_index.rb:5 class Tapioca::RepoIndex - # source://tapioca//lib/tapioca/repo_index.rb#26 + # pkg:gem/tapioca#lib/tapioca/repo_index.rb:21 sig { void } def initialize; end - # source://tapioca//lib/tapioca/repo_index.rb#31 + # pkg:gem/tapioca#lib/tapioca/repo_index.rb:26 sig { params(gem_name: ::String).void } def <<(gem_name); end - # source://tapioca//lib/tapioca/repo_index.rb#36 + # pkg:gem/tapioca#lib/tapioca/repo_index.rb:31 sig { returns(T::Enumerable[::String]) } def gems; end - # source://tapioca//lib/tapioca/repo_index.rb#41 + # pkg:gem/tapioca#lib/tapioca/repo_index.rb:36 sig { params(gem_name: ::String).returns(T::Boolean) } def has_gem?(gem_name); end class << self - # source://tapioca//lib/tapioca/repo_index.rb#18 - sig { params(hash: T::Hash[::String, T::Hash[T.untyped, T.untyped]]).returns(Tapioca::RepoIndex) } + # pkg:gem/tapioca#lib/tapioca/repo_index.rb:13 + sig { params(hash: T::Hash[::String, T::Hash[T.untyped, T.untyped]]).returns(::Tapioca::RepoIndex) } def from_hash(hash); end - # source://tapioca//lib/tapioca/repo_index.rb#13 - sig { params(json: ::String).returns(Tapioca::RepoIndex) } + # pkg:gem/tapioca#lib/tapioca/repo_index.rb:8 + sig { params(json: ::String).returns(::Tapioca::RepoIndex) } def from_json(json); end end end -# source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#5 -module Tapioca::Runtime; end +# pkg:gem/tapioca#lib/tapioca/runtime/trackers/autoload.rb:5 +module Tapioca::Runtime + class << self + # pkg:gem/tapioca#lib/tapioca/runtime/helpers.rb:11 + def silence_warnings(&blk); end -# This module should only be included when running versions of Ruby -# older than 3.2. Because the Class#attached_object method is not -# available, it implements finding the attached class of a singleton -# class by iterating through ObjectSpace. -module Tapioca::Runtime::AttachedClassOf - # source://tapioca//lib/tapioca/runtime/attached_class_of_32.rb#14 - sig { params(singleton_class: ::Class).returns(T.nilable(::Module)) } - def attached_class_of(singleton_class); end + # pkg:gem/tapioca#lib/tapioca/runtime/helpers.rb:22 + def with_disabled_exits(&block); end + end end -# source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#6 +# pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:6 class Tapioca::Runtime::DynamicMixinCompiler - include ::Tapioca::Runtime::AttachedClassOf include ::Tapioca::Runtime::Reflection - # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#20 - sig { params(constant: ::Module).void } + # pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:19 def initialize(constant); end - # @return [Array<Symbol>] - # - # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#14 + # pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:13 def class_attribute_predicates; end - # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#14 - sig { returns(T::Array[::Symbol]) } + # pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:13 def class_attribute_readers; end - # @return [Array<Symbol>] - # - # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#14 + # pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:13 def class_attribute_writers; end - # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#137 - sig { params(tree: ::RBI::Tree).void } + # pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:134 def compile_class_attributes(tree); end - # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#180 - sig { params(tree: ::RBI::Tree).returns([T::Array[::Module], T::Array[::Module]]) } + # pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:177 def compile_mixes_in_class_methods(tree); end - # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#11 - sig { returns(T::Array[::Module]) } + # pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:10 def dynamic_extends; end - # @return [Array<Module>] - # - # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#11 + # pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:10 def dynamic_includes; end - # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#132 - sig { returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:129 def empty_attributes?; end - # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#222 - sig { params(qualified_mixin_name: ::String).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:219 def filtered_mixin?(qualified_mixin_name); end - # @return [Array<Symbol>] - # - # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#17 + # pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:16 def instance_attribute_predicates; end - # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#17 - sig { returns(T::Array[::Symbol]) } + # pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:16 def instance_attribute_readers; end - # @return [Array<Symbol>] - # - # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#17 + # pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:16 def instance_attribute_writers; end - # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#215 - sig { params(mod: ::Module, dynamic_extends: T::Array[::Module]).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/runtime/dynamic_mixin_compiler.rb:212 def module_included_by_another_dynamic_extend?(mod, dynamic_extends); end end @@ -2911,15 +2951,13 @@ end # variable to type variable serializers. This allows us to associate type variables # to the constant names that represent them, easily. # -# source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#23 +# pkg:gem/tapioca#lib/tapioca/runtime/generic_type_registry.rb:23 module Tapioca::Runtime::GenericTypeRegistry class << self - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#80 - sig { params(instance: ::Object).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/runtime/generic_type_registry.rb:71 def generic_type_instance?(instance); end - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#85 - sig { params(constant: ::Module).returns(T.nilable(T::Array[::Tapioca::TypeVariableModule])) } + # pkg:gem/tapioca#lib/tapioca/runtime/generic_type_registry.rb:76 def lookup_type_variables(constant); end # This method is responsible for building the name of the instantiated concrete type @@ -2934,8 +2972,7 @@ module Tapioca::Runtime::GenericTypeRegistry # # This method returns the created or cached clone of the constant. # - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#65 - sig { params(constant: T.untyped, types: T.untyped).returns(::Module) } + # pkg:gem/tapioca#lib/tapioca/runtime/generic_type_registry.rb:56 def register_type(constant, types); end # This method is called from intercepted calls to `type_member` and `type_template`. @@ -2948,70 +2985,68 @@ module Tapioca::Runtime::GenericTypeRegistry # Finally, the original `type_variable` is returned from this method, so that the caller # can return it from the original methods as well. # - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#104 - sig { params(constant: T.untyped, type_variable: ::Tapioca::TypeVariableModule).void } + # pkg:gem/tapioca#lib/tapioca/runtime/generic_type_registry.rb:90 def register_type_variable(constant, type_variable); end private - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#113 - sig { params(constant: ::Module, name: ::String).returns(::Module) } + # pkg:gem/tapioca#lib/tapioca/runtime/generic_type_registry.rb:99 def create_generic_type(constant, name); end - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#155 - sig { params(constant: T::Class[T.anything]).returns(T::Class[T.anything]) } + # pkg:gem/tapioca#lib/tapioca/runtime/generic_type_registry.rb:141 def create_safe_subclass(constant); end - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#182 - sig { params(constant: ::Module).returns(T::Array[::Tapioca::TypeVariableModule]) } + # pkg:gem/tapioca#lib/tapioca/runtime/generic_type_registry.rb:168 def lookup_or_initialize_type_variables(constant); end end end -# source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#34 +# pkg:gem/tapioca#lib/tapioca/runtime/generic_type_registry.rb:28 class Tapioca::Runtime::GenericTypeRegistry::GenericType < ::T::Types::Simple - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#38 - sig { params(raw_type: ::Module, underlying_type: ::Module).void } + # pkg:gem/tapioca#lib/tapioca/runtime/generic_type_registry.rb:30 def initialize(raw_type, underlying_type); end - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#45 - sig { override.params(obj: T.untyped).returns(T::Boolean) } + # @override + # + # pkg:gem/tapioca#lib/tapioca/runtime/generic_type_registry.rb:38 def valid?(obj); end end +# pkg:gem/tapioca#lib/tapioca/runtime/helpers.rb:6 +Tapioca::Runtime::NOOP_METHOD = T.let(T.unsafe(nil), Proc) + module Tapioca::Runtime::Reflection - include ::Tapioca::Runtime::AttachedClassOf - extend ::Tapioca::Runtime::AttachedClassOf extend ::Tapioca::Runtime::Reflection - # source://tapioca//lib/tapioca/runtime/reflection.rb#207 - sig { params(constant: ::Module).returns(T.untyped) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:229 def abstract_type_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#77 - sig { params(constant: ::Module).returns(T::Array[::Module]) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:63 def ancestors_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#92 - sig { params(object: ::BasicObject, other: ::BasicObject).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:84 def are_equal?(object, other); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#56 - sig { params(object: ::BasicObject).returns(T::Class[T.anything]) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:73 + def attached_class_of(singleton_class); end + + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:42 def class_of(object); end - # @param constant [BasicObject] - # @return [Boolean] + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:173 + def const_source_location(constant_name); end + + # @without_runtime # - # source://tapioca//lib/tapioca/runtime/reflection.rb#38 + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:29 def constant_defined?(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#49 - sig { params(symbol: ::String, inherit: T::Boolean, namespace: ::Module).returns(::BasicObject) } + # @without_runtime + # + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:35 def constantize(symbol, inherit: T.unsafe(nil), namespace: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#61 - sig { params(constant: ::Module).returns(T::Array[::Symbol]) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:47 def constants_of(constant); end # Returns an array with all classes that are < than the supplied class. @@ -3028,57 +3063,40 @@ module Tapioca::Runtime::Reflection # class D < C; end # descendants_of(C) # => [B, A, D] # - # source://tapioca//lib/tapioca/runtime/reflection.rb#172 - sig do - type_parameters(:U) - .params( - klass: T.all(T.type_parameter(:U), T::Class[T.anything]) - ).returns(T::Array[T.type_parameter(:U)]) - end + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:164 def descendants_of(klass); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#200 - sig { params(constant: ::Module).returns(T::Set[::String]) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:215 def file_candidates_for(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#213 - sig { params(constant: ::Module).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:235 def final_module?(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#112 - sig { params(constant: ::Module).returns(T::Array[::Module]) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:104 def inherited_ancestors_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#150 - sig { params(constant: ::Module, method: ::Symbol).returns(::Method) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:146 def method_of(constant, method); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#66 - sig { params(constant: ::Module).returns(T.nilable(::String)) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:52 def name_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#145 - sig { params(type: ::T::Types::Base).returns(::String) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:141 def name_of_type(type); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#87 - sig { params(object: ::BasicObject).returns(::Integer) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:79 def object_id_of(object); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#107 - sig { params(constant: ::Module).returns(T::Array[::Symbol]) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:99 def private_instance_methods_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#102 - sig { params(constant: ::Module).returns(T::Array[::Symbol]) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:94 def protected_instance_methods_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#97 - sig { params(constant: ::Module).returns(T::Array[::Symbol]) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:89 def public_instance_methods_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#121 - sig { params(constant: ::Module).returns(T.nilable(::String)) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:113 def qualified_name_of(constant); end # Examines the call stack to identify the closest location where a "require" is performed @@ -3086,166 +3104,185 @@ module Tapioca::Runtime::Reflection # case of an ActiveSupport.on_load hook. If none is found, it returns the location # labeled "<main>", which is the original call site. # - # source://tapioca//lib/tapioca/runtime/reflection.rb#185 - sig { params(locations: T.nilable(T::Array[::Thread::Backtrace::Location])).returns(::String) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:186 def resolve_loc(locations); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#218 - sig { params(constant: ::Module).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:240 def sealed_module?(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#138 - sig { params(method: T.any(::Method, ::UnboundMethod)).returns(T.untyped) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:134 def signature_of(method); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#133 - sig { params(method: T.any(::Method, ::UnboundMethod)).returns(T.untyped) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:127 def signature_of!(method); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#72 - sig { params(constant: ::Module).returns(T::Class[T.anything]) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:58 def singleton_class_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#82 - sig { params(constant: T::Class[T.anything]).returns(T.nilable(T::Class[T.anything])) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:68 def superclass_of(constant); end private - # source://tapioca//lib/tapioca/runtime/reflection.rb#255 - sig { params(parent: ::Module, name: ::String).returns(T.nilable(::Module)) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:277 def child_module_for_parent_with_name(parent, name); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#271 - sig { params(name: ::String).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:293 def has_aliased_namespace?(name); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#266 - sig { params(method: ::UnboundMethod).returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:288 def method_defined_by_forwardable_module?(method); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#241 - sig { params(constant: ::Module).returns(T::Array[::UnboundMethod]) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:263 def methods_for(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#225 - sig { params(constant: ::Module).returns(T::Array[::UnboundMethod]) } + # pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:247 def relevant_methods_for(constant); end end -# source://tapioca//lib/tapioca/runtime/reflection.rb#25 +# pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:15 Tapioca::Runtime::Reflection::ANCESTORS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#21 +# pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:11 Tapioca::Runtime::Reflection::CLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#22 +# pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:12 Tapioca::Runtime::Reflection::CONSTANTS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#28 +# pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:18 Tapioca::Runtime::Reflection::EQUAL_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#32 +# pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:22 Tapioca::Runtime::Reflection::METHOD_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#23 +# pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:13 Tapioca::Runtime::Reflection::NAME_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#27 +# pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:17 Tapioca::Runtime::Reflection::OBJECT_ID_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#31 +# pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:21 Tapioca::Runtime::Reflection::PRIVATE_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#30 +# pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:20 Tapioca::Runtime::Reflection::PROTECTED_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#29 +# pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:19 Tapioca::Runtime::Reflection::PUBLIC_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#35 +# pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:25 Tapioca::Runtime::Reflection::REQUIRED_FROM_LABELS = T.let(T.unsafe(nil), Array) -# source://tapioca//lib/tapioca/runtime/reflection.rb#24 +# pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:14 Tapioca::Runtime::Reflection::SINGLETON_CLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#26 +# pkg:gem/tapioca#lib/tapioca/runtime/reflection.rb:16 Tapioca::Runtime::Reflection::SUPERCLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#6 +class Tapioca::Runtime::Reflection::SignatureBlockError < ::Tapioca::Error; end + +class Tapioca::Runtime::SourceLocation + # pkg:gem/tapioca#lib/tapioca/runtime/source_location.rb:18 + def initialize(file:, line:); end + + # pkg:gem/tapioca#lib/tapioca/runtime/source_location.rb:13 + def file; end + + # pkg:gem/tapioca#lib/tapioca/runtime/source_location.rb:16 + def line; end + + class << self + # pkg:gem/tapioca#lib/tapioca/runtime/source_location.rb:38 + def from_loc(loc); end + + private + + def new(*_arg0); end + end +end + +# this looks something like: +# "(eval at /path/to/file.rb:123)" +# and we are interested in the "/path/to/file.rb" and "123" parts +# +# pkg:gem/tapioca#lib/tapioca/runtime/source_location.rb:10 +Tapioca::Runtime::SourceLocation::EVAL_SOURCE_FILE_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/tapioca#lib/tapioca/runtime/trackers/autoload.rb:6 module Tapioca::Runtime::Trackers class << self - # source://tapioca//lib/tapioca/runtime/trackers.rb#34 - sig { void } + # pkg:gem/tapioca#lib/tapioca/runtime/trackers.rb:26 def disable_all!; end - # source://tapioca//lib/tapioca/runtime/trackers.rb#39 - sig { params(tracker: ::Tapioca::Runtime::Trackers::Tracker).void } + # pkg:gem/tapioca#lib/tapioca/runtime/trackers.rb:31 def register_tracker(tracker); end - # source://tapioca//lib/tapioca/runtime/trackers.rb#21 - sig do - type_parameters(:Return) - .params( - blk: T.proc.returns(T.type_parameter(:Return)) - ).returns(T.type_parameter(:Return)) - end + # pkg:gem/tapioca#lib/tapioca/runtime/trackers.rb:13 def with_trackers_enabled(&blk); end end end -# source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#7 +# pkg:gem/tapioca#lib/tapioca/runtime/trackers/autoload.rb:7 module Tapioca::Runtime::Trackers::Autoload extend ::Tapioca::Runtime::Trackers::Tracker class << self - # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#19 - sig { void } + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/autoload.rb:14 def eager_load_all!; end - # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#31 - sig { params(constant_name: ::String).void } + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/autoload.rb:26 def register(constant_name); end - - # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#42 - sig do - type_parameters(:Result) - .params( - block: T.proc.returns(T.type_parameter(:Result)) - ).returns(T.type_parameter(:Result)) - end - def with_disabled_exits(&block); end end end -# source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#11 -Tapioca::Runtime::Trackers::Autoload::NOOP_METHOD = T.let(T.unsafe(nil), Proc) - # Registers a TracePoint immediately upon load to track points at which # classes and modules are opened for definition. This is used to track # correspondence between classes/modules and files, as this information isn't # available in the ruby runtime without extra accounting. module Tapioca::Runtime::Trackers::ConstantDefinition extend ::Tapioca::Runtime::Trackers::Tracker - extend ::Tapioca::Runtime::AttachedClassOf extend ::Tapioca::Runtime::Reflection class << self - # source://tapioca//lib/tapioca/runtime/trackers/constant_definition.rb#61 - def build_constant_location(tp, locations); end + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/constant_definition.rb:58 + def build_source_location(tp, locations); end - # source://tapioca//lib/tapioca/runtime/trackers/constant_definition.rb#55 + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/constant_definition.rb:52 def disable!; end # Returns the files in which this class or module was opened. Doesn't know # about situations where the class was opened prior to +require+ing, # or where metaprogramming was used via +eval+, etc. # - # source://tapioca//lib/tapioca/runtime/trackers/constant_definition.rb#71 + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/constant_definition.rb:87 def files_for(klass); end - # source://tapioca//lib/tapioca/runtime/trackers/constant_definition.rb#75 + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/constant_definition.rb:92 def locations_for(klass); end + + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/constant_definition.rb:67 + def register(constant, loc); end + + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/constant_definition.rb:73 + def register_cname(cname, namespace, locations); end + end +end + +# pkg:gem/tapioca#lib/tapioca/runtime/trackers/method_definition.rb:7 +module Tapioca::Runtime::Trackers::MethodDefinition + extend ::Tapioca::Runtime::Trackers::Tracker + + class << self + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/method_definition.rb:28 + def method_definitions_for(method_name, owner); end + + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/method_definition.rb:14 + def register(method_name, owner, locations); end + + private + + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/method_definition.rb:42 + def registrations_for(method_name, owner); end end end @@ -3253,59 +3290,27 @@ module Tapioca::Runtime::Trackers::Mixin extend ::Tapioca::Runtime::Trackers::Tracker class << self - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#56 - sig do - params( - mixin: ::Module - ).returns(T::Hash[::Tapioca::Runtime::Trackers::Mixin::Type, T::Hash[::Module, ::String]]) - end + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/mixin.rb:50 def constants_with_mixin(mixin); end - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#61 - sig do - params( - mixin: ::Module, - mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type, - constant: ::Module - ).returns(T.nilable(::String)) - end + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/mixin.rb:55 def mixin_location(mixin, mixin_type, constant); end - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#35 - sig { params(constant: ::Module, mixin: ::Module, mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type).void } + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/mixin.rb:28 def register(constant, mixin, mixin_type); end - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#43 + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/mixin.rb:37 def resolve_to_attached_class(constant, mixin, mixin_type); end - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#30 - sig do - type_parameters(:Result) - .params( - block: T.proc.returns(T.type_parameter(:Result)) - ).returns(T.type_parameter(:Result)) - end + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/mixin.rb:23 def with_disabled_registration(&block); end private - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#76 - sig do - params( - mixin: ::Module - ).returns(T::Hash[::Tapioca::Runtime::Trackers::Mixin::Type, T::Hash[::Module, ::String]]) - end + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/mixin.rb:70 def find_or_initialize_mixin_lookup(mixin); end - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#68 - sig do - params( - constant: ::Module, - mixin: ::Module, - mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type, - location: ::String - ).void - end + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/mixin.rb:62 def register_with_location(constant, mixin, mixin_type, location); end end end @@ -3318,251 +3323,193 @@ class Tapioca::Runtime::Trackers::Mixin::Type < ::T::Enum end end -# source://tapioca//lib/tapioca/runtime/trackers/required_ancestor.rb#7 +# pkg:gem/tapioca#lib/tapioca/runtime/trackers/required_ancestor.rb:7 module Tapioca::Runtime::Trackers::RequiredAncestor extend ::Tapioca::Runtime::Trackers::Tracker class << self - # source://tapioca//lib/tapioca/runtime/trackers/required_ancestor.rb#15 - sig { params(requiring: ::T::Helpers, block: T.proc.void).void } + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/required_ancestor.rb:13 def register(requiring, block); end - # source://tapioca//lib/tapioca/runtime/trackers/required_ancestor.rb#23 - sig { params(mod: ::Module).returns(T::Array[T.proc.void]) } + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/required_ancestor.rb:21 def required_ancestors_blocks_by(mod); end - # source://tapioca//lib/tapioca/runtime/trackers/required_ancestor.rb#28 - sig { params(mod: ::Module).returns(T::Array[T.untyped]) } + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/required_ancestor.rb:26 def required_ancestors_by(mod); end end end -# @abstract Subclasses must implement the `abstract` methods below. +# @abstract module Tapioca::Runtime::Trackers::Tracker - abstract! - - # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#26 - sig { void } + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/tracker.rb:20 def disable!; end - # @return [Boolean] - # - # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#30 + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/tracker.rb:24 def enabled?; end - # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#34 + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/tracker.rb:28 def with_disabled_tracker(&block); end class << self - # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#17 - sig { params(base: T.all(::Module, ::Tapioca::Runtime::Trackers::Tracker)).void } + # pkg:gem/tapioca#lib/tapioca/runtime/trackers/tracker.rb:11 def extended(base); end end end -# source://tapioca//lib/tapioca.rb#35 +# pkg:gem/tapioca#lib/tapioca.rb:14 Tapioca::SORBET_CONFIG_FILE = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#34 +# pkg:gem/tapioca#lib/tapioca.rb:13 Tapioca::SORBET_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#5 +# pkg:gem/tapioca#lib/tapioca/helpers/sorbet_helper.rb:5 module Tapioca::SorbetHelper - # source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#32 + # pkg:gem/tapioca#lib/tapioca/helpers/sorbet_helper.rb:21 sig { params(sorbet_args: ::String).returns(::Spoom::ExecResult) } def sorbet(*sorbet_args); end - # source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#37 + # pkg:gem/tapioca#lib/tapioca/helpers/sorbet_helper.rb:45 sig { returns(::String) } def sorbet_path; end - # source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#44 + # pkg:gem/tapioca#lib/tapioca/helpers/sorbet_helper.rb:52 sig { params(feature: ::Symbol, version: T.nilable(::Gem::Version)).returns(T::Boolean) } def sorbet_supports?(feature, version: T.unsafe(nil)); end + + # pkg:gem/tapioca#lib/tapioca/helpers/sorbet_helper.rb:26 + sig { params(source: ::String, rbi_mode: T::Boolean, on_failure: T.proc.params(stderr: ::String).void).void } + def sorbet_syntax_check!(source, rbi_mode:, &on_failure); end end -# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#24 +# pkg:gem/tapioca#lib/tapioca/helpers/sorbet_helper.rb:16 Tapioca::SorbetHelper::FEATURE_REQUIREMENTS = T.let(T.unsafe(nil), Hash) -# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#13 +# pkg:gem/tapioca#lib/tapioca/helpers/sorbet_helper.rb:8 Tapioca::SorbetHelper::SORBET_BIN = T.let(T.unsafe(nil), Pathname) -# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#18 +# pkg:gem/tapioca#lib/tapioca/helpers/sorbet_helper.rb:10 Tapioca::SorbetHelper::SORBET_EXE_PATH_ENV_VAR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#8 +# pkg:gem/tapioca#lib/tapioca/helpers/sorbet_helper.rb:6 Tapioca::SorbetHelper::SORBET_GEM_SPEC = T.let(T.unsafe(nil), Gem::Specification) -# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#20 +# pkg:gem/tapioca#lib/tapioca/helpers/sorbet_helper.rb:12 Tapioca::SorbetHelper::SORBET_PAYLOAD_URL = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#22 +# pkg:gem/tapioca#lib/tapioca/helpers/sorbet_helper.rb:14 Tapioca::SorbetHelper::SPOOM_CONTEXT = T.let(T.unsafe(nil), Spoom::Context) -# source://tapioca//lib/tapioca/helpers/source_uri.rb#7 -class Tapioca::SourceURI < ::URI::File - # source://tapioca//lib/tapioca/helpers/source_uri.rb#72 - sig { params(v: T.nilable(::String)).returns(T::Boolean) } - def check_host(v); end - - # source://tapioca//lib/tapioca/helpers/source_uri.rb#55 - sig { returns(T.nilable(::String)) } - def gem_name; end - - # source://tapioca//lib/tapioca/helpers/source_uri.rb#29 - sig { returns(T.nilable(::String)) } - def gem_version; end - - # source://tapioca//lib/tapioca/helpers/source_uri.rb#60 - sig { returns(T.nilable(::String)) } - def line_number; end - - # source://tapioca//lib/tapioca/helpers/source_uri.rb#65 - sig { params(v: T.nilable(::String)).void } - def set_path(v); end - - # source://tapioca//lib/tapioca/helpers/source_uri.rb#84 - sig { returns(::String) } - def to_s; end - - class << self - # source://tapioca//lib/tapioca/helpers/source_uri.rb#42 - sig do - params( - gem_name: ::String, - gem_version: T.nilable(::String), - path: ::String, - line_number: T.nilable(::String) - ).returns(T.attached_class) - end - def build(gem_name:, gem_version:, path:, line_number:); end - end -end - -# source://tapioca//lib/tapioca/helpers/source_uri.rb#10 -Tapioca::SourceURI::COMPONENT = T.let(T.unsafe(nil), Array) - -# `uri` for Ruby 3.4 switched the default parser from RFC2396 to RFC3986. The new parser emits a deprecation -# warning on a few methods and delegates them to RFC2396, namely `extract`/`make_regexp`/`escape`/`unescape`. -# On earlier versions of the uri gem, the RFC2396_PARSER constant doesn't exist, so it needs some special -# handling to select a parser that doesn't emit deprecations. While it was backported to Ruby 3.1, users may -# have the uri gem in their own bundle and thus not use a compatible version. -# -# source://tapioca//lib/tapioca/helpers/source_uri.rb#26 -Tapioca::SourceURI::PARSER = T.let(T.unsafe(nil), URI::RFC2396_Parser) - -# source://tapioca//lib/tapioca/static/symbol_table_parser.rb#5 +# pkg:gem/tapioca#lib/tapioca/static/symbol_table_parser.rb:5 module Tapioca::Static; end -# source://tapioca//lib/tapioca/static/requires_compiler.rb#6 +# pkg:gem/tapioca#lib/tapioca/static/requires_compiler.rb:6 class Tapioca::Static::RequiresCompiler - # source://tapioca//lib/tapioca/static/requires_compiler.rb#10 + # pkg:gem/tapioca#lib/tapioca/static/requires_compiler.rb:8 sig { params(sorbet_path: ::String).void } def initialize(sorbet_path); end - # source://tapioca//lib/tapioca/static/requires_compiler.rb#15 + # pkg:gem/tapioca#lib/tapioca/static/requires_compiler.rb:13 sig { returns(::String) } def compile; end private - # source://tapioca//lib/tapioca/static/requires_compiler.rb#29 + # pkg:gem/tapioca#lib/tapioca/static/requires_compiler.rb:27 sig { params(config: ::Spoom::Sorbet::Config).returns(T::Array[::String]) } def collect_files(config); end - # source://tapioca//lib/tapioca/static/requires_compiler.rb#44 + # pkg:gem/tapioca#lib/tapioca/static/requires_compiler.rb:42 sig { params(file_path: ::String).returns(T::Enumerable[::String]) } def collect_requires(file_path); end - # source://tapioca//lib/tapioca/static/requires_compiler.rb#51 + # pkg:gem/tapioca#lib/tapioca/static/requires_compiler.rb:49 sig { params(config: ::Spoom::Sorbet::Config, file_path: ::Pathname).returns(T::Boolean) } def file_ignored_by_sorbet?(config, file_path); end - # source://tapioca//lib/tapioca/static/requires_compiler.rb#80 + # pkg:gem/tapioca#lib/tapioca/static/requires_compiler.rb:78 sig { params(path: ::Pathname).returns(T::Array[::String]) } def path_parts(path); end end -# source://tapioca//lib/tapioca/static/symbol_loader.rb#6 +# pkg:gem/tapioca#lib/tapioca/static/symbol_loader.rb:6 module Tapioca::Static::SymbolLoader extend ::Tapioca::SorbetHelper - extend ::Tapioca::Runtime::AttachedClassOf extend ::Tapioca::Runtime::Reflection class << self - # source://tapioca//lib/tapioca/static/symbol_loader.rb#23 + # pkg:gem/tapioca#lib/tapioca/static/symbol_loader.rb:35 sig { params(gem: ::Tapioca::Gemfile::GemSpec).returns(T::Set[::String]) } def engine_symbols(gem); end - # source://tapioca//lib/tapioca/static/symbol_loader.rb#48 + # pkg:gem/tapioca#lib/tapioca/static/symbol_loader.rb:30 sig { params(gem: ::Tapioca::Gemfile::GemSpec).returns(T::Set[::String]) } def gem_symbols(gem); end - # source://tapioca//lib/tapioca/static/symbol_loader.rb#13 + # pkg:gem/tapioca#lib/tapioca/static/symbol_loader.rb:22 + sig { params(paths: T::Array[::Pathname]).returns(::Rubydex::Graph) } + def graph_from_paths(paths); end + + # pkg:gem/tapioca#lib/tapioca/static/symbol_loader.rb:12 sig { returns(T::Set[::String]) } def payload_symbols; end - # source://tapioca//lib/tapioca/static/symbol_loader.rb#53 + # pkg:gem/tapioca#lib/tapioca/static/symbol_loader.rb:60 sig { params(paths: T::Array[::Pathname]).returns(T::Set[::String]) } def symbols_from_paths(paths); end private - # @return [Array<T.class_of(Rails::Engine)>] + # @without_runtime # - # source://tapioca//lib/tapioca/static/symbol_loader.rb#71 + # pkg:gem/tapioca#lib/tapioca/static/symbol_loader.rb:79 def engines; end - # source://tapioca//lib/tapioca/static/symbol_loader.rb#84 + # pkg:gem/tapioca#lib/tapioca/static/symbol_loader.rb:89 sig { params(input: ::String, table_type: ::String).returns(::String) } def symbol_table_json_from(input, table_type: T.unsafe(nil)); end end end -# source://tapioca//lib/tapioca/static/symbol_table_parser.rb#6 +# pkg:gem/tapioca#lib/tapioca/static/symbol_table_parser.rb:6 class Tapioca::Static::SymbolTableParser - # source://tapioca//lib/tapioca/static/symbol_table_parser.rb#30 + # pkg:gem/tapioca#lib/tapioca/static/symbol_table_parser.rb:26 sig { void } def initialize; end - # source://tapioca//lib/tapioca/static/symbol_table_parser.rb#65 + # pkg:gem/tapioca#lib/tapioca/static/symbol_table_parser.rb:61 sig { params(name: ::String).returns(::String) } def fully_qualified_name(name); end - # source://tapioca//lib/tapioca/static/symbol_table_parser.rb#36 + # pkg:gem/tapioca#lib/tapioca/static/symbol_table_parser.rb:32 sig { params(object: T::Hash[::String, T.untyped]).void } def parse_object(object); end - # source://tapioca//lib/tapioca/static/symbol_table_parser.rb#27 + # pkg:gem/tapioca#lib/tapioca/static/symbol_table_parser.rb:23 sig { returns(T::Set[::String]) } def symbols; end class << self - # source://tapioca//lib/tapioca/static/symbol_table_parser.rb#15 + # pkg:gem/tapioca#lib/tapioca/static/symbol_table_parser.rb:11 sig { params(json_string: ::String).returns(T::Set[::String]) } def parse_json(json_string); end end end -# source://tapioca//lib/tapioca/static/symbol_table_parser.rb#9 +# pkg:gem/tapioca#lib/tapioca/static/symbol_table_parser.rb:7 Tapioca::Static::SymbolTableParser::SKIP_PARSE_KINDS = T.let(T.unsafe(nil), Array) -# source://tapioca//lib/tapioca.rb#37 +# pkg:gem/tapioca#lib/tapioca.rb:16 Tapioca::TAPIOCA_CONFIG_FILE = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#36 +# pkg:gem/tapioca#lib/tapioca.rb:15 Tapioca::TAPIOCA_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#108 +# pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:108 class Tapioca::TypeVariable < ::T::Types::TypeVariable - # @return [TypeVariable] a new instance of TypeVariable - # - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#109 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:109 def initialize(name, variance); end - # Returns the value of attribute name. - # - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#114 + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:114 def name; end end @@ -3572,50 +3519,36 @@ end # need to do any matching of constants to type variables to bind their names, Ruby will # do that automatically for us and we get the `name` method for free from `Module`. # -# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#122 +# pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:122 class Tapioca::TypeVariableModule < ::Module - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#146 - sig do - params( - context: ::Module, - type: ::Tapioca::TypeVariableModule::Type, - variance: ::Symbol, - bounds_proc: T.nilable(T.proc.returns(T::Hash[::Symbol, T.untyped])) - ).void - end + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:137 def initialize(context, type, variance, bounds_proc); end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#181 - sig { returns(::Tapioca::TypeVariable) } + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:173 def coerce_to_type_variable; end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#161 - sig { returns(T::Boolean) } + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:153 def fixed?; end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#155 - sig { returns(T.nilable(::String)) } + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:147 def name; end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#166 - sig { returns(::String) } + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:158 def serialize; end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#136 - sig { returns(::Tapioca::TypeVariableModule::Type) } + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:134 def type; end private - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#188 - sig { returns(T::Hash[::Symbol, T.untyped]) } + # pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:180 def bounds; end end -# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#133 +# pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:131 Tapioca::TypeVariableModule::DEFAULT_BOUNDS_PROC = T.let(T.unsafe(nil), Proc) -# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#125 +# pkg:gem/tapioca#lib/tapioca/sorbet_ext/generic_name_patch.rb:123 class Tapioca::TypeVariableModule::Type < ::T::Enum enums do HasAttachedClass = new @@ -3624,5 +3557,5 @@ class Tapioca::TypeVariableModule::Type < ::T::Enum end end -# source://tapioca//lib/tapioca/version.rb#5 +# pkg:gem/tapioca#lib/tapioca/version.rb:5 Tapioca::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/thor@1.4.0.rbi b/sorbet/rbi/gems/thor@1.5.0.rbi similarity index 66% rename from sorbet/rbi/gems/thor@1.4.0.rbi rename to sorbet/rbi/gems/thor@1.5.0.rbi index fd38611..1e2610a 100644 --- a/sorbet/rbi/gems/thor@1.4.0.rbi +++ b/sorbet/rbi/gems/thor@1.5.0.rbi @@ -5,14 +5,14 @@ # Please instead update this file by running `bin/tapioca gem thor`. -# source://thor//lib/thor/shell/lcs_diff.rb#1 +# pkg:gem/thor#lib/thor/shell/lcs_diff.rb:1 module LCSDiff protected # Overwrite show_diff to show diff with colors if Diff::LCS is # available. # - # source://thor//lib/thor/shell/lcs_diff.rb#6 + # pkg:gem/thor#lib/thor/shell/lcs_diff.rb:6 def show_diff(destination, content); end private @@ -20,16 +20,14 @@ module LCSDiff # Check if Diff::LCS is loaded. If it is, use it to create pretty output # for diff. # - # @return [Boolean] - # - # source://thor//lib/thor/shell/lcs_diff.rb#37 + # pkg:gem/thor#lib/thor/shell/lcs_diff.rb:37 def diff_lcs_loaded?; end - # source://thor//lib/thor/shell/lcs_diff.rb#21 + # pkg:gem/thor#lib/thor/shell/lcs_diff.rb:21 def output_diff_line(diff); end end -# source://thor//lib/thor/command.rb#1 +# pkg:gem/thor#lib/thor/command.rb:1 class Thor include ::Thor::Base include ::Thor::Invocation @@ -37,48 +35,19 @@ class Thor extend ::Thor::Base::ClassMethods extend ::Thor::Invocation::ClassMethods - # source://thor//lib/thor.rb#663 + # pkg:gem/thor#lib/thor.rb:663 def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + # pkg:gem/thor#lib/thor.rb:678 + def tree; end + + private + + # pkg:gem/thor#lib/thor.rb:684 + def build_command_tree(klass, indent); end + class << self - # Adds and declares option group for required at least one of options in the - # block of arguments. You can declare options as the outside of the block. - # - # If :for is given as option, it allows you to change the options from - # a previous defined command. - # - # ==== Parameters - # Array[Thor::Option.name] - # options<Hash>:: :for is applied for previous defined command. - # - # ==== Examples - # - # at_least_one do - # option :one - # option :two - # end - # - # Or - # - # option :one - # option :two - # at_least_one :one, :two - # - # If you do not give "--one" and "--two" AtLeastOneRequiredArgumentError - # will be raised. - # - # You can use at_least_one and exclusive at the same time. - # - # exclusive do - # at_least_one do - # option :one - # option :two - # end - # end - # - # Then it is required either only one of "--one" or "--two". - # - # source://thor//lib/thor.rb#246 + # pkg:gem/thor#lib/thor.rb:250 def at_least_one(*args, &block); end # Extend check unknown options to accept a hash of conditions. @@ -86,14 +55,12 @@ class Thor # === Parameters # options<Hash>: A hash containing :only and/or :except keys # - # source://thor//lib/thor.rb#350 + # pkg:gem/thor#lib/thor.rb:350 def check_unknown_options!(options = T.unsafe(nil)); end # Overwrite check_unknown_options? to take subcommands and options into account. # - # @return [Boolean] - # - # source://thor//lib/thor.rb#363 + # pkg:gem/thor#lib/thor.rb:363 def check_unknown_options?(config); end # Checks if a specified command exists. @@ -104,9 +71,7 @@ class Thor # ==== Returns # Boolean:: +true+ if the command exists, +false+ otherwise. # - # @return [Boolean] - # - # source://thor//lib/thor.rb#449 + # pkg:gem/thor#lib/thor.rb:449 def command_exists?(command_name); end # Prints help information for the given command. @@ -115,7 +80,7 @@ class Thor # shell<Thor::Shell> # command_name<String> # - # source://thor//lib/thor.rb#258 + # pkg:gem/thor#lib/thor.rb:258 def command_help(shell, command_name); end # Sets the default command when thor is executed without an explicit command to be called. @@ -123,18 +88,13 @@ class Thor # ==== Parameters # meth<Symbol>:: name of the default command # - # source://thor//lib/thor.rb#21 + # pkg:gem/thor#lib/thor.rb:21 def default_command(meth = T.unsafe(nil)); end - # Sets the default command when thor is executed without an explicit command to be called. - # - # ==== Parameters - # meth<Symbol>:: name of the default command - # - # source://thor//lib/thor.rb#21 + # pkg:gem/thor#lib/thor.rb:28 def default_task(meth = T.unsafe(nil)); end - # source://thor//lib/thor/base.rb#26 + # pkg:gem/thor#lib/thor/base.rb:27 def deprecation_warning(message); end # Defines the usage and the description of the next command. @@ -144,7 +104,7 @@ class Thor # description<String> # options<String> # - # source://thor//lib/thor.rb#54 + # pkg:gem/thor#lib/thor.rb:54 def desc(usage, description, options = T.unsafe(nil)); end # Disable the check for required options for the given commands. @@ -154,41 +114,13 @@ class Thor # ==== Parameters # Symbol ...:: A list of commands that should be affected. # - # source://thor//lib/thor.rb#434 + # pkg:gem/thor#lib/thor.rb:434 def disable_required_check!(*command_names); end - # @return [Boolean] - # - # source://thor//lib/thor.rb#438 + # pkg:gem/thor#lib/thor.rb:438 def disable_required_check?(command); end - # Adds and declares option group for exclusive options in the - # block and arguments. You can declare options as the outside of the block. - # - # If :for is given as option, it allows you to change the options from - # a previous defined command. - # - # ==== Parameters - # Array[Thor::Option.name] - # options<Hash>:: :for is applied for previous defined command. - # - # ==== Examples - # - # exclusive do - # option :one - # option :two - # end - # - # Or - # - # option :one - # option :two - # exclusive :one, :two - # - # If you give "--one" and "--two" at the same time ExclusiveArgumentsError - # will be raised. - # - # source://thor//lib/thor.rb#203 + # pkg:gem/thor#lib/thor.rb:207 def exclusive(*args, &block); end # Prints help information for this class. @@ -196,7 +128,7 @@ class Thor # ==== Parameters # shell<Thor::Shell> # - # source://thor//lib/thor.rb#288 + # pkg:gem/thor#lib/thor.rb:288 def help(shell, subcommand = T.unsafe(nil)); end # Defines the long description of the next command. @@ -211,7 +143,7 @@ class Thor # long description<String> # options<Hash> # - # source://thor//lib/thor.rb#78 + # pkg:gem/thor#lib/thor.rb:78 def long_desc(long_description, options = T.unsafe(nil)); end # Maps an input to a command. If you define: @@ -227,7 +159,7 @@ class Thor # ==== Parameters # Hash[String|Array => Symbol]:: Maps the string or the strings in the array to the given command. # - # source://thor//lib/thor.rb#101 + # pkg:gem/thor#lib/thor.rb:101 def map(mappings = T.unsafe(nil), **kw); end # Adds and declares option group for required at least one of options in the @@ -267,7 +199,7 @@ class Thor # # Then it is required either only one of "--one" or "--two". # - # source://thor//lib/thor.rb#246 + # pkg:gem/thor#lib/thor.rb:246 def method_at_least_one(*args, &block); end # Adds and declares option group for exclusive options in the @@ -296,7 +228,7 @@ class Thor # If you give "--one" and "--two" at the same time ExclusiveArgumentsError # will be raised. # - # source://thor//lib/thor.rb#203 + # pkg:gem/thor#lib/thor.rb:203 def method_exclusive(*args, &block); end # Adds an option to the set of method options. If :for is given as option, @@ -325,7 +257,7 @@ class Thor # :banner - String to show on usage notes. # :hide - If you want to hide this option from the help. # - # source://thor//lib/thor.rb#163 + # pkg:gem/thor#lib/thor.rb:163 def method_option(name, options = T.unsafe(nil)); end # Declares the options for the next command to be declared. @@ -335,46 +267,13 @@ class Thor # is the type of the option. Can be :string, :array, :hash, :boolean, :numeric # or :required (string). If you give a value, the type of the value is used. # - # source://thor//lib/thor.rb#129 + # pkg:gem/thor#lib/thor.rb:129 def method_options(options = T.unsafe(nil)); end - # Adds an option to the set of method options. If :for is given as option, - # it allows you to change the options from a previous defined command. - # - # def previous_command - # # magic - # end - # - # method_option :foo, :for => :previous_command - # - # def next_command - # # magic - # end - # - # ==== Parameters - # name<Symbol>:: The name of the argument. - # options<Hash>:: Described below. - # - # ==== Options - # :desc - Description for the argument. - # :required - If the argument is required or not. - # :default - Default value for this argument. It cannot be required and have default values. - # :aliases - Aliases for this option. - # :type - The type of the argument, can be :string, :hash, :array, :numeric or :boolean. - # :banner - String to show on usage notes. - # :hide - If you want to hide this option from the help. - # - # source://thor//lib/thor.rb#163 + # pkg:gem/thor#lib/thor.rb:175 def option(name, options = T.unsafe(nil)); end - # Declares the options for the next command to be declared. - # - # ==== Parameters - # Hash[Symbol => Object]:: The hash key is the name of the option and the value - # is the type of the option. Can be :string, :array, :hash, :boolean, :numeric - # or :required (string). If you give a value, the type of the value is used. - # - # source://thor//lib/thor.rb#129 + # pkg:gem/thor#lib/thor.rb:135 def options(options = T.unsafe(nil)); end # Allows for custom "Command" package naming. @@ -383,17 +282,15 @@ class Thor # name<String> # options<Hash> # - # source://thor//lib/thor.rb#12 + # pkg:gem/thor#lib/thor.rb:12 def package_name(name, _ = T.unsafe(nil)); end # Returns commands ready to be printed. # - # source://thor//lib/thor.rb#309 + # pkg:gem/thor#lib/thor.rb:309 def printable_commands(all = T.unsafe(nil), subcommand = T.unsafe(nil)); end - # Returns commands ready to be printed. - # - # source://thor//lib/thor.rb#309 + # pkg:gem/thor#lib/thor.rb:318 def printable_tasks(all = T.unsafe(nil), subcommand = T.unsafe(nil)); end # Registers another Thor subclass as a command. @@ -404,7 +301,7 @@ class Thor # usage<String>:: Short usage for the subcommand # description<String>:: Description for the subcommand # - # source://thor//lib/thor.rb#37 + # pkg:gem/thor#lib/thor.rb:37 def register(klass, subcommand_name, usage, description, options = T.unsafe(nil)); end # Stop parsing of options as soon as an unknown option or a regular @@ -445,36 +342,28 @@ class Thor # ==== Parameters # Symbol ...:: A list of commands that should be affected. # - # source://thor//lib/thor.rb#420 + # pkg:gem/thor#lib/thor.rb:420 def stop_on_unknown_option!(*command_names); end - # @return [Boolean] - # - # source://thor//lib/thor.rb#424 + # pkg:gem/thor#lib/thor.rb:424 def stop_on_unknown_option?(command); end - # source://thor//lib/thor.rb#329 + # pkg:gem/thor#lib/thor.rb:329 def subcommand(subcommand, subcommand_class); end - # source://thor//lib/thor.rb#325 + # pkg:gem/thor#lib/thor.rb:325 def subcommand_classes; end - # source://thor//lib/thor.rb#320 + # pkg:gem/thor#lib/thor.rb:320 def subcommands; end - # source://thor//lib/thor.rb#329 + # pkg:gem/thor#lib/thor.rb:344 def subtask(subcommand, subcommand_class); end - # source://thor//lib/thor.rb#320 + # pkg:gem/thor#lib/thor.rb:323 def subtasks; end - # Prints help information for the given command. - # - # ==== Parameters - # shell<Thor::Shell> - # command_name<String> - # - # source://thor//lib/thor.rb#258 + # pkg:gem/thor#lib/thor.rb:281 def task_help(shell, command_name); end protected @@ -484,48 +373,42 @@ class Thor # the command that is going to be invoked and a boolean which indicates if # the namespace should be displayed as arguments. # - # source://thor//lib/thor.rb#546 + # pkg:gem/thor#lib/thor.rb:546 def banner(command, namespace = T.unsafe(nil), subcommand = T.unsafe(nil)); end - # source://thor//lib/thor.rb#552 + # pkg:gem/thor#lib/thor.rb:552 def baseclass; end - # source://thor//lib/thor.rb#560 + # pkg:gem/thor#lib/thor.rb:560 def create_command(meth); end - # source://thor//lib/thor.rb#560 + # pkg:gem/thor#lib/thor.rb:584 def create_task(meth); end # help command has the required check disabled by default. # - # source://thor//lib/thor.rb#478 + # pkg:gem/thor#lib/thor.rb:478 def disable_required_check; end # The method responsible for dispatching given the args. # - # @yield [instance] - # - # source://thor//lib/thor.rb#505 + # pkg:gem/thor#lib/thor.rb:505 def dispatch(meth, given_args, given_opts, config); end - # source://thor//lib/thor.rb#556 + # pkg:gem/thor#lib/thor.rb:556 def dynamic_command_class; end # this is the logic that takes the command name passed in by the user # and determines whether it is an unambiguous substrings of a command or # alias name. # - # source://thor//lib/thor.rb#626 + # pkg:gem/thor#lib/thor.rb:626 def find_command_possibilities(meth); end - # this is the logic that takes the command name passed in by the user - # and determines whether it is an unambiguous substrings of a command or - # alias name. - # - # source://thor//lib/thor.rb#626 + # pkg:gem/thor#lib/thor.rb:639 def find_task_possibilities(meth); end - # source://thor//lib/thor.rb#586 + # pkg:gem/thor#lib/thor.rb:586 def initialize_added; end # Returns this class at least one of required options array set. @@ -533,7 +416,7 @@ class Thor # ==== Returns # Array[Array[Thor::Option.name]] # - # source://thor//lib/thor.rb#469 + # pkg:gem/thor#lib/thor.rb:469 def method_at_least_one_option_names; end # Returns this class exclusive options array set. @@ -541,7 +424,7 @@ class Thor # ==== Returns # Array[Array[Thor::Option.name]] # - # source://thor//lib/thor.rb#460 + # pkg:gem/thor#lib/thor.rb:460 def method_exclusive_option_names; end # receives a (possibly nil) command name and returns a name that is in @@ -552,38 +435,24 @@ class Thor # +normalize_command_name+ also converts names like +animal-prison+ # into +animal_prison+. # - # @raise [AmbiguousTaskError] - # - # source://thor//lib/thor.rb#605 + # pkg:gem/thor#lib/thor.rb:605 def normalize_command_name(meth); end - # receives a (possibly nil) command name and returns a name that is in - # the commands hash. In addition to normalizing aliases, this logic - # will determine if a shortened command is an unambiguous substring of - # a command or alias. - # - # +normalize_command_name+ also converts names like +animal-prison+ - # into +animal_prison+. - # - # @raise [AmbiguousTaskError] - # - # source://thor//lib/thor.rb#605 + # pkg:gem/thor#lib/thor.rb:621 def normalize_task_name(meth); end - # source://thor//lib/thor.rb#493 + # pkg:gem/thor#lib/thor.rb:493 def print_at_least_one_required_options(shell, command = T.unsafe(nil)); end - # source://thor//lib/thor.rb#482 + # pkg:gem/thor#lib/thor.rb:482 def print_exclusive_options(shell, command = T.unsafe(nil)); end # Retrieve the command name from given args. # - # source://thor//lib/thor.rb#592 + # pkg:gem/thor#lib/thor.rb:592 def retrieve_command_name(args); end - # Retrieve the command name from given args. - # - # source://thor//lib/thor.rb#592 + # pkg:gem/thor#lib/thor.rb:596 def retrieve_task_name(args); end # Sort the commands, lexicographically by default. @@ -591,21 +460,21 @@ class Thor # Can be overridden in the subclass to change the display order of the # commands. # - # source://thor//lib/thor.rb#653 + # pkg:gem/thor#lib/thor.rb:653 def sort_commands!(list); end - # source://thor//lib/thor.rb#473 + # pkg:gem/thor#lib/thor.rb:473 def stop_on_unknown_option; end - # source://thor//lib/thor.rb#641 + # pkg:gem/thor#lib/thor.rb:641 def subcommand_help(cmd); end - # source://thor//lib/thor.rb#641 + # pkg:gem/thor#lib/thor.rb:647 def subtask_help(cmd); end end end -# source://thor//lib/thor/actions/empty_directory.rb#2 +# pkg:gem/thor#lib/thor/actions/empty_directory.rb:2 module Thor::Actions mixes_in_class_methods ::Thor::Actions::ClassMethods @@ -618,65 +487,21 @@ module Thor::Actions # # destination_root<String>:: The root directory needed for some actions. # - # source://thor//lib/thor/actions.rb#72 + # pkg:gem/thor#lib/thor/actions.rb:72 def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil)); end # Wraps an action object and call it accordingly to the thor class behavior. # - # source://thor//lib/thor/actions.rb#89 + # pkg:gem/thor#lib/thor/actions.rb:89 def action(instance); end - # Create a new file relative to the destination root with the given data, - # which is the return value of a block or a data string. - # - # ==== Parameters - # destination<String>:: the relative path to the destination root. - # data<String|NilClass>:: the data to append to the file. - # config<Hash>:: give :verbose => false to not log the status. - # - # ==== Examples - # - # create_file "lib/fun_party.rb" do - # hostname = ask("What is the virtual hostname I should use?") - # "vhost.name = #{hostname}" - # end - # - # create_file "config/apache.conf", "your apache config" - # - # source://thor//lib/thor/actions/create_file.rb#22 + # pkg:gem/thor#lib/thor/actions/create_file.rb:27 def add_file(destination, *args, &block); end - # Create a new file relative to the destination root from the given source. - # - # ==== Parameters - # destination<String>:: the relative path to the destination root. - # source<String|NilClass>:: the relative path to the source root. - # config<Hash>:: give :verbose => false to not log the status. - # :: give :symbolic => false for hard link. - # - # ==== Examples - # - # create_link "config/apache.conf", "/etc/apache.conf" - # - # source://thor//lib/thor/actions/create_link.rb#17 + # pkg:gem/thor#lib/thor/actions/create_link.rb:22 def add_link(destination, *args); end - # Append text to a file. Since it depends on insert_into_file, it's reversible. - # - # ==== Parameters - # path<String>:: path of the file to be changed - # data<String>:: the data to append to the file, can be also given as a block. - # config<Hash>:: give :verbose => false to not log the status. - # - # ==== Example - # - # append_to_file 'config/environments/test.rb', 'config.gem "rspec"' - # - # append_to_file 'config/environments/test.rb' do - # 'config.gem "rspec"' - # end - # - # source://thor//lib/thor/actions/file_manipulation.rb#192 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:197 def append_file(path, *args, &block); end # Append text to a file. Since it depends on insert_into_file, it's reversible. @@ -694,7 +519,7 @@ module Thor::Actions # 'config.gem "rspec"' # end # - # source://thor//lib/thor/actions/file_manipulation.rb#192 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:192 def append_to_file(path, *args, &block); end # Loads an external file and execute it in the instance binding. @@ -709,19 +534,13 @@ module Thor::Actions # # apply "recipes/jquery.rb" # - # source://thor//lib/thor/actions.rb#216 + # pkg:gem/thor#lib/thor/actions.rb:216 def apply(path, config = T.unsafe(nil)); end - # Returns the value of attribute behavior. - # - # source://thor//lib/thor/actions.rb#10 + # pkg:gem/thor#lib/thor/actions.rb:10 def behavior; end - # Sets the attribute behavior - # - # @param value the value to set the attribute behavior to. - # - # source://thor//lib/thor/actions.rb#10 + # pkg:gem/thor#lib/thor/actions.rb:10 def behavior=(_arg0); end # Changes the mode of the given file or directory. @@ -735,7 +554,7 @@ module Thor::Actions # # chmod "script/server", 0755 # - # source://thor//lib/thor/actions/file_manipulation.rb#145 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:145 def chmod(path, mode, config = T.unsafe(nil)); end # Comment all lines matching a given regex. It will leave the space @@ -751,7 +570,7 @@ module Thor::Actions # # comment_lines 'config/initializers/session_store.rb', /cookie_store/ # - # source://thor//lib/thor/actions/file_manipulation.rb#333 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:333 def comment_lines(path, flag, *args); end # Copies the file from the relative source to the relative destination. If @@ -769,7 +588,7 @@ module Thor::Actions # # copy_file "doc/README" # - # source://thor//lib/thor/actions/file_manipulation.rb#20 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:20 def copy_file(source, *args, &block); end # Create a new file relative to the destination root with the given data, @@ -789,7 +608,7 @@ module Thor::Actions # # create_file "config/apache.conf", "your apache config" # - # source://thor//lib/thor/actions/create_file.rb#22 + # pkg:gem/thor#lib/thor/actions/create_file.rb:22 def create_file(destination, *args, &block); end # Create a new file relative to the destination root from the given source. @@ -804,18 +623,18 @@ module Thor::Actions # # create_link "config/apache.conf", "/etc/apache.conf" # - # source://thor//lib/thor/actions/create_link.rb#17 + # pkg:gem/thor#lib/thor/actions/create_link.rb:17 def create_link(destination, *args); end # Returns the root for this thor class (also aliased as destination root). # - # source://thor//lib/thor/actions.rb#99 + # pkg:gem/thor#lib/thor/actions.rb:99 def destination_root; end # Sets the root for this thor class. Relatives path are added to the # directory where the script was invoked and expanded. # - # source://thor//lib/thor/actions.rb#106 + # pkg:gem/thor#lib/thor/actions.rb:106 def destination_root=(root); end # Copies recursively the files from source directory to root directory. @@ -862,7 +681,7 @@ module Thor::Actions # directory "doc" # directory "doc", "docs", :recursive => false # - # source://thor//lib/thor/actions/directory.rb#49 + # pkg:gem/thor#lib/thor/actions/directory.rb:49 def directory(source, *args, &block); end # Creates an empty directory. @@ -875,14 +694,12 @@ module Thor::Actions # # empty_directory "doc" # - # source://thor//lib/thor/actions/empty_directory.rb#13 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:13 def empty_directory(destination, config = T.unsafe(nil)); end # Receives a file or directory and search for it in the source paths. # - # @raise [Error] - # - # source://thor//lib/thor/actions.rb#133 + # pkg:gem/thor#lib/thor/actions.rb:133 def find_in_source_paths(file); end # Gets the content at the given address and places it at the given relative @@ -908,7 +725,7 @@ module Thor::Actions # content.split("\n").first # end # - # source://thor//lib/thor/actions/file_manipulation.rb#81 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:81 def get(source, *args, &block); end # Run a regular expression replacement on a file. @@ -928,7 +745,7 @@ module Thor::Actions # match << " no more. Use thor!" # end # - # source://thor//lib/thor/actions/file_manipulation.rb#291 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:291 def gsub_file(path, flag, *args, &block); end # Run a regular expression replacement on a file, raising an error if the @@ -949,12 +766,12 @@ module Thor::Actions # match << " no more. Use thor!" # end # - # source://thor//lib/thor/actions/file_manipulation.rb#263 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:263 def gsub_file!(path, flag, *args, &block); end # Goes to the root and execute the given block. # - # source://thor//lib/thor/actions.rb#200 + # pkg:gem/thor#lib/thor/actions.rb:200 def in_root; end # Injects text right after the class definition. Since it depends on @@ -974,12 +791,15 @@ module Thor::Actions # " filter_parameter :password\n" # end # - # source://thor//lib/thor/actions/file_manipulation.rb#216 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:216 def inject_into_class(path, klass, *args, &block); end - # source://thor//lib/thor/actions/inject_into_file.rb#26 + # pkg:gem/thor#lib/thor/actions/inject_into_file.rb:64 def inject_into_file(destination, *args, &block); end + # pkg:gem/thor#lib/thor/actions/inject_into_file.rb:35 + def inject_into_file!(destination, *args, &block); end + # Injects text right after the module definition. Since it depends on # insert_into_file, it's reversible. # @@ -997,12 +817,53 @@ module Thor::Actions # " def help; 'help'; end\n" # end # - # source://thor//lib/thor/actions/file_manipulation.rb#239 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:239 def inject_into_module(path, module_name, *args, &block); end - # source://thor//lib/thor/actions/inject_into_file.rb#26 + # Injects the given content into a file. Different from gsub_file, this + # method is reversible. + # + # ==== Parameters + # destination<String>:: Relative path to the destination root + # data<String>:: Data to add to the file. Can be given as a block. + # config<Hash>:: give :verbose => false to not log the status and the flag + # for injection (:after or :before) or :force => true for + # insert two or more times the same content. + # + # ==== Examples + # + # insert_into_file "config/environment.rb", "config.gem :thor", :after => "Rails::Initializer.run do |config|\n" + # + # insert_into_file "config/environment.rb", :after => "Rails::Initializer.run do |config|\n" do + # gems = ask "Which gems would you like to add?" + # gems.split(" ").map{ |gem| " config.gem :#{gem}" }.join("\n") + # end + # + # pkg:gem/thor#lib/thor/actions/inject_into_file.rb:56 def insert_into_file(destination, *args, &block); end + # Injects the given content into a file, raising an error if the contents of + # the file are not changed. Different from gsub_file, this method is reversible. + # + # ==== Parameters + # destination<String>:: Relative path to the destination root + # data<String>:: Data to add to the file. Can be given as a block. + # config<Hash>:: give :verbose => false to not log the status and the flag + # for injection (:after or :before) or :force => true for + # insert two or more times the same content. + # + # ==== Examples + # + # insert_into_file "config/environment.rb", "config.gem :thor", :after => "Rails::Initializer.run do |config|\n" + # + # insert_into_file "config/environment.rb", :after => "Rails::Initializer.run do |config|\n" do + # gems = ask "Which gems would you like to add?" + # gems.split(" ").map{ |gem| " config.gem :#{gem}" }.join("\n") + # end + # + # pkg:gem/thor#lib/thor/actions/inject_into_file.rb:26 + def insert_into_file!(destination, *args, &block); end + # Do something in the root or on a provided subfolder. If a relative path # is given it's referenced from the current root. The full path is yielded # to the block you provide. The path is set back to the previous path when @@ -1014,7 +875,7 @@ module Thor::Actions # dir<String>:: the directory to move to. # config<Hash>:: give :verbose => true to log and use padding. # - # source://thor//lib/thor/actions.rb#170 + # pkg:gem/thor#lib/thor/actions.rb:170 def inside(dir = T.unsafe(nil), config = T.unsafe(nil), &block); end # Links the file from the relative source to the relative destination. If @@ -1031,25 +892,10 @@ module Thor::Actions # # link_file "doc/README" # - # source://thor//lib/thor/actions/file_manipulation.rb#50 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:50 def link_file(source, *args); end - # Prepend text to a file. Since it depends on insert_into_file, it's reversible. - # - # ==== Parameters - # path<String>:: path of the file to be changed - # data<String>:: the data to prepend to the file, can be also given as a block. - # config<Hash>:: give :verbose => false to not log the status. - # - # ==== Example - # - # prepend_to_file 'config/environments/test.rb', 'config.gem "rspec"' - # - # prepend_to_file 'config/environments/test.rb' do - # 'config.gem "rspec"' - # end - # - # source://thor//lib/thor/actions/file_manipulation.rb#170 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:175 def prepend_file(path, *args, &block); end # Prepend text to a file. Since it depends on insert_into_file, it's reversible. @@ -1067,27 +913,16 @@ module Thor::Actions # 'config.gem "rspec"' # end # - # source://thor//lib/thor/actions/file_manipulation.rb#170 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:170 def prepend_to_file(path, *args, &block); end # Returns the given path relative to the absolute root (ie, root where # the script started). # - # source://thor//lib/thor/actions.rb#114 + # pkg:gem/thor#lib/thor/actions.rb:114 def relative_to_original_destination_root(path, remove_dot = T.unsafe(nil)); end - # Removes a file at the given location. - # - # ==== Parameters - # path<String>:: path of the file to be changed - # config<Hash>:: give :verbose => false to not log the status. - # - # ==== Example - # - # remove_file 'README' - # remove_file 'app/controllers/application_controller.rb' - # - # source://thor//lib/thor/actions/file_manipulation.rb#350 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:360 def remove_dir(path, config = T.unsafe(nil)); end # Removes a file at the given location. @@ -1101,7 +936,7 @@ module Thor::Actions # remove_file 'README' # remove_file 'app/controllers/application_controller.rb' # - # source://thor//lib/thor/actions/file_manipulation.rb#350 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:350 def remove_file(path, config = T.unsafe(nil)); end # Executes a command returning the contents of the command. @@ -1117,7 +952,7 @@ module Thor::Actions # run('ln -s ~/edge rails') # end # - # source://thor//lib/thor/actions.rb#248 + # pkg:gem/thor#lib/thor/actions.rb:248 def run(command, config = T.unsafe(nil)); end # Executes a ruby script (taking into account WIN32 platform quirks). @@ -1126,12 +961,12 @@ module Thor::Actions # command<String>:: the command to be executed. # config<Hash>:: give :verbose => false to not log the status. # - # source://thor//lib/thor/actions.rb#285 + # pkg:gem/thor#lib/thor/actions.rb:285 def run_ruby_script(command, config = T.unsafe(nil)); end # Holds source paths in instance so they can be manipulated. # - # source://thor//lib/thor/actions.rb#127 + # pkg:gem/thor#lib/thor/actions.rb:127 def source_paths; end # Gets an ERB template at the relative source, executes it and makes a copy @@ -1149,7 +984,7 @@ module Thor::Actions # # template "doc/README" # - # source://thor//lib/thor/actions/file_manipulation.rb#117 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:117 def template(source, *args, &block); end # Run a thor command. A hash of options can be given and it's converted to @@ -1170,7 +1005,7 @@ module Thor::Actions # thor :list, :all => true, :substring => 'rails' # #=> thor list --all --substring=rails # - # source://thor//lib/thor/actions.rb#308 + # pkg:gem/thor#lib/thor/actions.rb:308 def thor(command, *args); end # Uncomment all lines matching a given regex. Preserves indentation before @@ -1185,47 +1020,41 @@ module Thor::Actions # # uncomment_lines 'config/initializers/session_store.rb', /active_record/ # - # source://thor//lib/thor/actions/file_manipulation.rb#314 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:314 def uncomment_lines(path, flag, *args); end protected - # source://thor//lib/thor/actions.rb#329 + # pkg:gem/thor#lib/thor/actions.rb:329 def _cleanup_options_and_set(options, key); end # Allow current root to be shared between invocations. # - # source://thor//lib/thor/actions.rb#325 + # pkg:gem/thor#lib/thor/actions.rb:325 def _shared_configuration; end private - # source://thor//lib/thor/actions/file_manipulation.rb#385 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:385 def actually_gsub_file(path, flag, args, error_on_no_change, &block); end - # source://thor//lib/thor/actions/file_manipulation.rb#371 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:371 def capture(*args); end - # source://thor//lib/thor/actions/file_manipulation.rb#367 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:367 def concat(string); end - # Returns the value of attribute output_buffer. - # - # source://thor//lib/thor/actions/file_manipulation.rb#362 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:362 def output_buffer; end - # Sets the attribute output_buffer - # - # @param value the value to set the attribute output_buffer to. - # - # source://thor//lib/thor/actions/file_manipulation.rb#362 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:362 def output_buffer=(_arg0); end - # source://thor//lib/thor/actions/file_manipulation.rb#375 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:375 def with_output_buffer(buf = T.unsafe(nil)); end class << self - # source://thor//lib/thor/actions.rb#12 + # pkg:gem/thor#lib/thor/actions.rb:12 def included(base); end end end @@ -1233,24 +1062,24 @@ end # Thor::Actions#capture depends on what kind of buffer is used in ERB. # Thus CapturableERB fixes ERB to use String buffer. # -# source://thor//lib/thor/actions/file_manipulation.rb#398 +# pkg:gem/thor#lib/thor/actions/file_manipulation.rb:398 class Thor::Actions::CapturableERB < ::ERB - # source://thor//lib/thor/actions/file_manipulation.rb#399 + # pkg:gem/thor#lib/thor/actions/file_manipulation.rb:399 def set_eoutvar(compiler, eoutvar = T.unsafe(nil)); end end -# source://thor//lib/thor/actions.rb#17 +# pkg:gem/thor#lib/thor/actions.rb:17 module Thor::Actions::ClassMethods # Add runtime options that help actions execution. # - # source://thor//lib/thor/actions.rb#48 + # pkg:gem/thor#lib/thor/actions.rb:48 def add_runtime_options!; end # Hold source paths for one Thor instance. source_paths_for_search is the # method responsible to gather source_paths from this current class, # inherited paths and the source root. # - # source://thor//lib/thor/actions.rb#22 + # pkg:gem/thor#lib/thor/actions.rb:22 def source_paths; end # Returns the source paths in the following order: @@ -1259,26 +1088,24 @@ module Thor::Actions::ClassMethods # 2) Source root # 3) Parents source paths # - # source://thor//lib/thor/actions.rb#38 + # pkg:gem/thor#lib/thor/actions.rb:38 def source_paths_for_search; end # Stores and return the source root for this class # - # source://thor//lib/thor/actions.rb#27 + # pkg:gem/thor#lib/thor/actions.rb:27 def source_root(path = T.unsafe(nil)); end end # CreateFile is a subset of Template, which instead of rendering a file with # ERB, it gets the content from the user. # -# source://thor//lib/thor/actions/create_file.rb#32 +# pkg:gem/thor#lib/thor/actions/create_file.rb:32 class Thor::Actions::CreateFile < ::Thor::Actions::EmptyDirectory - # @return [CreateFile] a new instance of CreateFile - # - # source://thor//lib/thor/actions/create_file.rb#35 + # pkg:gem/thor#lib/thor/actions/create_file.rb:35 def initialize(base, destination, data, config = T.unsafe(nil)); end - # source://thor//lib/thor/actions/create_file.rb#33 + # pkg:gem/thor#lib/thor/actions/create_file.rb:33 def data; end # Checks if the content of the file at the destination is identical to the rendered result. @@ -1286,52 +1113,46 @@ class Thor::Actions::CreateFile < ::Thor::Actions::EmptyDirectory # ==== Returns # Boolean:: true if it is identical, false otherwise. # - # @return [Boolean] - # - # source://thor//lib/thor/actions/create_file.rb#45 + # pkg:gem/thor#lib/thor/actions/create_file.rb:45 def identical?; end - # source://thor//lib/thor/actions/create_file.rb#60 + # pkg:gem/thor#lib/thor/actions/create_file.rb:60 def invoke!; end # Holds the content to be added to the file. # - # source://thor//lib/thor/actions/create_file.rb#52 + # pkg:gem/thor#lib/thor/actions/create_file.rb:52 def render; end protected # Shows the file collision menu to the user and gets the result. # - # @return [Boolean] - # - # source://thor//lib/thor/actions/create_file.rb#100 + # pkg:gem/thor#lib/thor/actions/create_file.rb:100 def force_on_collision?; end # If force is true, run the action, otherwise check if it's not being # skipped. If both are false, show the file_collision menu, if the menu # returns true, force it, otherwise skip. # - # source://thor//lib/thor/actions/create_file.rb#86 + # pkg:gem/thor#lib/thor/actions/create_file.rb:86 def force_or_skip_or_conflict(force, skip, &block); end # Now on conflict we check if the file is identical or not. # - # source://thor//lib/thor/actions/create_file.rb#73 + # pkg:gem/thor#lib/thor/actions/create_file.rb:73 def on_conflict_behavior(&block); end end # CreateLink is a subset of CreateFile, which instead of taking a block of # data, just takes a source string from the user. # -# source://thor//lib/thor/actions/create_link.rb#27 +# pkg:gem/thor#lib/thor/actions/create_link.rb:27 class Thor::Actions::CreateLink < ::Thor::Actions::CreateFile - # source://thor//lib/thor/actions/create_link.rb#28 + # pkg:gem/thor#lib/thor/actions/create_link.rb:28 def data; end - # @return [Boolean] - # - # source://thor//lib/thor/actions/create_link.rb#56 + # pkg:gem/thor#lib/thor/actions/create_link.rb:56 def exists?; end # Checks if the content of the file at the destination is identical to the rendered result. @@ -1339,46 +1160,46 @@ class Thor::Actions::CreateLink < ::Thor::Actions::CreateFile # ==== Returns # Boolean:: true if it is identical, false otherwise. # - # @return [Boolean] - # - # source://thor//lib/thor/actions/create_link.rb#35 + # pkg:gem/thor#lib/thor/actions/create_link.rb:35 def identical?; end - # source://thor//lib/thor/actions/create_link.rb#40 + # pkg:gem/thor#lib/thor/actions/create_link.rb:40 def invoke!; end end -# source://thor//lib/thor/actions/directory.rb#55 +# pkg:gem/thor#lib/thor/actions/directory.rb:55 class Thor::Actions::Directory < ::Thor::Actions::EmptyDirectory - # @return [Directory] a new instance of Directory - # - # source://thor//lib/thor/actions/directory.rb#58 + # pkg:gem/thor#lib/thor/actions/directory.rb:58 def initialize(base, source, destination = T.unsafe(nil), config = T.unsafe(nil), &block); end - # source://thor//lib/thor/actions/directory.rb#64 + # pkg:gem/thor#lib/thor/actions/directory.rb:64 def invoke!; end - # source://thor//lib/thor/actions/directory.rb#69 + # pkg:gem/thor#lib/thor/actions/directory.rb:69 def revoke!; end - # Returns the value of attribute source. - # - # source://thor//lib/thor/actions/directory.rb#56 + # pkg:gem/thor#lib/thor/actions/directory.rb:56 def source; end protected - # source://thor//lib/thor/actions/directory.rb#75 + # pkg:gem/thor#lib/thor/actions/directory.rb:75 def execute!; end - # source://thor//lib/thor/actions/directory.rb#99 + # pkg:gem/thor#lib/thor/actions/directory.rb:99 def file_level_lookup(previous_lookup); end - # source://thor//lib/thor/actions/directory.rb#103 + # pkg:gem/thor#lib/thor/actions/directory.rb:103 def files(lookup); end end -# source://thor//lib/thor/actions/empty_directory.rb#23 +# Class which holds create directory logic. This is the base class for +# other actions like create_file and directory. +# +# This implementation is based in Templater actions, created by Jonas Nicklas +# and Michael S. Klishin under MIT LICENSE. +# +# pkg:gem/thor#lib/thor/actions/empty_directory.rb:23 class Thor::Actions::EmptyDirectory # Initializes given the source and destination. # @@ -1388,18 +1209,16 @@ class Thor::Actions::EmptyDirectory # destination<String>:: Relative path to the destination of this file # config<Hash>:: give :verbose => false to not log the status. # - # @return [EmptyDirectory] a new instance of EmptyDirectory - # - # source://thor//lib/thor/actions/empty_directory.rb#34 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:34 def initialize(base, destination, config = T.unsafe(nil)); end - # source://thor//lib/thor/actions/empty_directory.rb#24 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:24 def base; end - # source://thor//lib/thor/actions/empty_directory.rb#24 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:24 def config; end - # source://thor//lib/thor/actions/empty_directory.rb#24 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:24 def destination; end # Checks if the destination file already exists. @@ -1407,21 +1226,19 @@ class Thor::Actions::EmptyDirectory # ==== Returns # Boolean:: true if the file exists, false otherwise. # - # @return [Boolean] - # - # source://thor//lib/thor/actions/empty_directory.rb#45 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:45 def exists?; end - # source://thor//lib/thor/actions/empty_directory.rb#24 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:24 def given_destination; end - # source://thor//lib/thor/actions/empty_directory.rb#49 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:49 def invoke!; end - # source://thor//lib/thor/actions/empty_directory.rb#24 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:24 def relative_destination; end - # source://thor//lib/thor/actions/empty_directory.rb#56 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:56 def revoke!; end protected @@ -1437,7 +1254,7 @@ class Thor::Actions::EmptyDirectory # # The method referenced can be either public or private. # - # source://thor//lib/thor/actions/empty_directory.rb#103 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:103 def convert_encoded_instructions(filename); end # Sets the absolute destination value from a relative destination value. @@ -1454,234 +1271,166 @@ class Thor::Actions::EmptyDirectory # relative_destination #=> bar/baz # given_destination #=> baz # - # source://thor//lib/thor/actions/empty_directory.rb#85 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:85 def destination=(destination); end # Receives a hash of options and just execute the block if some # conditions are met. # - # source://thor//lib/thor/actions/empty_directory.rb#113 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:113 def invoke_with_conflict_check(&block); end # What to do when the destination file already exists. # - # source://thor//lib/thor/actions/empty_directory.rb#132 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:132 def on_conflict_behavior; end - # source://thor//lib/thor/actions/empty_directory.rb#126 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:126 def on_file_clash_behavior; end # Shortcut for pretend. # - # @return [Boolean] - # - # source://thor//lib/thor/actions/empty_directory.rb#67 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:67 def pretend?; end # Shortcut to say_status shell method. # - # source://thor//lib/thor/actions/empty_directory.rb#138 + # pkg:gem/thor#lib/thor/actions/empty_directory.rb:138 def say_status(status, color); end end -# source://thor//lib/thor/actions/inject_into_file.rb#36 +# pkg:gem/thor#lib/thor/actions/inject_into_file.rb:66 class Thor::Actions::InjectIntoFile < ::Thor::Actions::EmptyDirectory - # @return [InjectIntoFile] a new instance of InjectIntoFile - # - # source://thor//lib/thor/actions/inject_into_file.rb#39 + # pkg:gem/thor#lib/thor/actions/inject_into_file.rb:69 def initialize(base, destination, data, config); end - # Returns the value of attribute behavior. - # - # source://thor//lib/thor/actions/inject_into_file.rb#37 + # pkg:gem/thor#lib/thor/actions/inject_into_file.rb:67 def behavior; end - # Returns the value of attribute flag. - # - # source://thor//lib/thor/actions/inject_into_file.rb#37 + # pkg:gem/thor#lib/thor/actions/inject_into_file.rb:67 def flag; end - # source://thor//lib/thor/actions/inject_into_file.rb#52 + # pkg:gem/thor#lib/thor/actions/inject_into_file.rb:83 def invoke!; end - # Returns the value of attribute replacement. - # - # source://thor//lib/thor/actions/inject_into_file.rb#37 + # pkg:gem/thor#lib/thor/actions/inject_into_file.rb:67 def replacement; end - # source://thor//lib/thor/actions/inject_into_file.rb#74 + # pkg:gem/thor#lib/thor/actions/inject_into_file.rb:107 def revoke!; end protected - # source://thor//lib/thor/actions/inject_into_file.rb#110 + # pkg:gem/thor#lib/thor/actions/inject_into_file.rb:143 def content; end # Adds the content to the file. # - # source://thor//lib/thor/actions/inject_into_file.rb#120 + # pkg:gem/thor#lib/thor/actions/inject_into_file.rb:153 def replace!(regexp, string, force); end - # @return [Boolean] - # - # source://thor//lib/thor/actions/inject_into_file.rb#114 + # pkg:gem/thor#lib/thor/actions/inject_into_file.rb:147 def replacement_present?; end - # source://thor//lib/thor/actions/inject_into_file.rb#90 + # pkg:gem/thor#lib/thor/actions/inject_into_file.rb:123 def say_status(behavior, warning: T.unsafe(nil), color: T.unsafe(nil)); end end -# Injects the given content into a file. Different from gsub_file, this -# method is reversible. -# -# ==== Parameters -# destination<String>:: Relative path to the destination root -# data<String>:: Data to add to the file. Can be given as a block. -# config<Hash>:: give :verbose => false to not log the status and the flag -# for injection (:after or :before) or :force => true for -# insert two or more times the same content. -# -# ==== Examples -# -# insert_into_file "config/environment.rb", "config.gem :thor", :after => "Rails::Initializer.run do |config|\n" -# -# insert_into_file "config/environment.rb", :after => "Rails::Initializer.run do |config|\n" do -# gems = ask "Which gems would you like to add?" -# gems.split(" ").map{ |gem| " config.gem :#{gem}" }.join("\n") -# end -# -# source://thor//lib/thor/actions/inject_into_file.rb#24 +# pkg:gem/thor#lib/thor/actions/inject_into_file.rb:5 Thor::Actions::WARNINGS = T.let(T.unsafe(nil), Hash) -# source://thor//lib/thor/error.rb#57 +# pkg:gem/thor#lib/thor/error.rb:57 class Thor::AmbiguousCommandError < ::Thor::Error; end -# source://thor//lib/thor/error.rb#59 +# pkg:gem/thor#lib/thor/error.rb:59 Thor::AmbiguousTaskError = Thor::AmbiguousCommandError -# source://thor//lib/thor/parser/argument.rb#2 +# pkg:gem/thor#lib/thor/parser/argument.rb:2 class Thor::Argument - # @raise [ArgumentError] - # @return [Argument] a new instance of Argument - # - # source://thor//lib/thor/parser/argument.rb#8 + # pkg:gem/thor#lib/thor/parser/argument.rb:8 def initialize(name, options = T.unsafe(nil)); end - # Returns the value of attribute banner. - # - # source://thor//lib/thor/parser/argument.rb#5 + # pkg:gem/thor#lib/thor/parser/argument.rb:5 def banner; end - # Returns the value of attribute default. - # - # source://thor//lib/thor/parser/argument.rb#5 + # pkg:gem/thor#lib/thor/parser/argument.rb:5 def default; end - # Returns the value of attribute description. - # - # source://thor//lib/thor/parser/argument.rb#5 + # pkg:gem/thor#lib/thor/parser/argument.rb:5 def description; end - # Returns the value of attribute enum. - # - # source://thor//lib/thor/parser/argument.rb#5 + # pkg:gem/thor#lib/thor/parser/argument.rb:5 def enum; end - # source://thor//lib/thor/parser/argument.rb#52 + # pkg:gem/thor#lib/thor/parser/argument.rb:52 def enum_to_s; end - # Returns the value of attribute name. - # - # source://thor//lib/thor/parser/argument.rb#5 + # pkg:gem/thor#lib/thor/parser/argument.rb:6 def human_name; end - # Returns the value of attribute name. - # - # source://thor//lib/thor/parser/argument.rb#5 + # pkg:gem/thor#lib/thor/parser/argument.rb:5 def name; end - # source://thor//lib/thor/parser/argument.rb#27 + # pkg:gem/thor#lib/thor/parser/argument.rb:27 def print_default; end - # Returns the value of attribute required. - # - # source://thor//lib/thor/parser/argument.rb#5 + # pkg:gem/thor#lib/thor/parser/argument.rb:5 def required; end - # @return [Boolean] - # - # source://thor//lib/thor/parser/argument.rb#39 + # pkg:gem/thor#lib/thor/parser/argument.rb:39 def required?; end - # @return [Boolean] - # - # source://thor//lib/thor/parser/argument.rb#43 + # pkg:gem/thor#lib/thor/parser/argument.rb:43 def show_default?; end - # Returns the value of attribute type. - # - # source://thor//lib/thor/parser/argument.rb#5 + # pkg:gem/thor#lib/thor/parser/argument.rb:5 def type; end - # source://thor//lib/thor/parser/argument.rb#35 + # pkg:gem/thor#lib/thor/parser/argument.rb:35 def usage; end protected - # source://thor//lib/thor/parser/argument.rb#71 + # pkg:gem/thor#lib/thor/parser/argument.rb:71 def default_banner; end - # @return [Boolean] - # - # source://thor//lib/thor/parser/argument.rb#67 + # pkg:gem/thor#lib/thor/parser/argument.rb:67 def valid_type?(type); end - # @raise [ArgumentError] - # - # source://thor//lib/thor/parser/argument.rb#62 + # pkg:gem/thor#lib/thor/parser/argument.rb:62 def validate!; end end -# source://thor//lib/thor/parser/argument.rb#3 +# pkg:gem/thor#lib/thor/parser/argument.rb:3 Thor::Argument::VALID_TYPES = T.let(T.unsafe(nil), Array) -# source://thor//lib/thor/parser/arguments.rb#2 +# pkg:gem/thor#lib/thor/parser/arguments.rb:2 class Thor::Arguments # Takes an array of Thor::Argument objects. # - # @return [Arguments] a new instance of Arguments - # - # source://thor//lib/thor/parser/arguments.rb#26 + # pkg:gem/thor#lib/thor/parser/arguments.rb:26 def initialize(arguments = T.unsafe(nil)); end - # source://thor//lib/thor/parser/arguments.rb#40 + # pkg:gem/thor#lib/thor/parser/arguments.rb:40 def parse(args); end - # source://thor//lib/thor/parser/arguments.rb#53 + # pkg:gem/thor#lib/thor/parser/arguments.rb:53 def remaining; end private # Raises an error if @non_assigned_required array is not empty. # - # @raise [RequiredArgumentMissingError] - # - # source://thor//lib/thor/parser/arguments.rb#186 + # pkg:gem/thor#lib/thor/parser/arguments.rb:186 def check_requirement!; end - # @return [Boolean] - # - # source://thor//lib/thor/parser/arguments.rb#84 + # pkg:gem/thor#lib/thor/parser/arguments.rb:84 def current_is_value?; end - # @return [Boolean] - # - # source://thor//lib/thor/parser/arguments.rb#64 + # pkg:gem/thor#lib/thor/parser/arguments.rb:64 def last?; end - # @return [Boolean] - # - # source://thor//lib/thor/parser/arguments.rb#59 + # pkg:gem/thor#lib/thor/parser/arguments.rb:59 def no_or_skip?(arg); end # Runs through the argument array getting all strings until no string is @@ -1693,7 +1442,7 @@ class Thor::Arguments # # ["a", "b", "c"] # - # source://thor//lib/thor/parser/arguments.rb#118 + # pkg:gem/thor#lib/thor/parser/arguments.rb:118 def parse_array(name); end # Runs through the argument array getting strings that contains ":" and @@ -1705,14 +1454,14 @@ class Thor::Arguments # # { "name" => "string", "age" => "integer" } # - # source://thor//lib/thor/parser/arguments.rb#97 + # pkg:gem/thor#lib/thor/parser/arguments.rb:97 def parse_hash(name); end # Check if the peek is numeric format and return a Float or Integer. # Check if the peek is included in enum if enum is provided. # Otherwise raises an error. # - # source://thor//lib/thor/parser/arguments.rb#139 + # pkg:gem/thor#lib/thor/parser/arguments.rb:139 def parse_numeric(name); end # Parse string: @@ -1720,42 +1469,42 @@ class Thor::Arguments # for --no-string-arg, nil # Check if the peek is included in enum if enum is provided. Otherwise raises an error. # - # source://thor//lib/thor/parser/arguments.rb#158 + # pkg:gem/thor#lib/thor/parser/arguments.rb:158 def parse_string(name); end - # source://thor//lib/thor/parser/arguments.rb#68 + # pkg:gem/thor#lib/thor/parser/arguments.rb:68 def peek; end - # source://thor//lib/thor/parser/arguments.rb#72 + # pkg:gem/thor#lib/thor/parser/arguments.rb:72 def shift; end - # source://thor//lib/thor/parser/arguments.rb#76 + # pkg:gem/thor#lib/thor/parser/arguments.rb:76 def unshift(arg); end # Raises an error if the switch is an enum and the values aren't included on it. # - # source://thor//lib/thor/parser/arguments.rb#172 + # pkg:gem/thor#lib/thor/parser/arguments.rb:172 def validate_enum_value!(name, value, message); end class << self - # source://thor//lib/thor/parser/arguments.rb#19 + # pkg:gem/thor#lib/thor/parser/arguments.rb:19 def parse(*args); end # Receives an array of args and returns two arrays, one with arguments # and one with switches. # - # source://thor//lib/thor/parser/arguments.rb#8 + # pkg:gem/thor#lib/thor/parser/arguments.rb:8 def split(args); end end end -# source://thor//lib/thor/parser/arguments.rb#3 +# pkg:gem/thor#lib/thor/parser/arguments.rb:3 Thor::Arguments::NUMERIC = T.let(T.unsafe(nil), Regexp) -# source://thor//lib/thor/error.rb#104 +# pkg:gem/thor#lib/thor/error.rb:104 class Thor::AtLeastOneRequiredArgumentError < ::Thor::InvocationError; end -# source://thor//lib/thor/shell.rb#4 +# pkg:gem/thor#lib/thor/shell.rb:4 module Thor::Base include ::Thor::Invocation include ::Thor::Shell @@ -1779,66 +1528,47 @@ module Thor::Base # # config<Hash>:: Configuration for this Thor class. # - # source://thor//lib/thor/base.rb#53 + # pkg:gem/thor#lib/thor/base.rb:54 def initialize(args = T.unsafe(nil), local_options = T.unsafe(nil), config = T.unsafe(nil)); end - # Returns the value of attribute args. - # - # source://thor//lib/thor/base.rb#35 + # pkg:gem/thor#lib/thor/base.rb:36 def args; end - # Sets the attribute args - # - # @param value the value to set the attribute args to. - # - # source://thor//lib/thor/base.rb#35 + # pkg:gem/thor#lib/thor/base.rb:36 def args=(_arg0); end - # Returns the value of attribute options. - # - # source://thor//lib/thor/base.rb#35 + # pkg:gem/thor#lib/thor/base.rb:36 def options; end - # Sets the attribute options - # - # @param value the value to set the attribute options to. - # - # source://thor//lib/thor/base.rb#35 + # pkg:gem/thor#lib/thor/base.rb:36 def options=(_arg0); end - # Returns the value of attribute parent_options. - # - # source://thor//lib/thor/base.rb#35 + # pkg:gem/thor#lib/thor/base.rb:36 def parent_options; end - # Sets the attribute parent_options - # - # @param value the value to set the attribute parent_options to. - # - # source://thor//lib/thor/base.rb#35 + # pkg:gem/thor#lib/thor/base.rb:36 def parent_options=(_arg0); end class << self - # source://thor//lib/thor/base.rb#116 + # pkg:gem/thor#lib/thor/base.rb:117 def included(base); end # Whenever a class inherits from Thor or Thor::Group, we should track the # class and the file on Thor::Base. This is the method responsible for it. # - # source://thor//lib/thor/base.rb#144 + # pkg:gem/thor#lib/thor/base.rb:145 def register_klass_file(klass); end # Returns the shell used in all Thor classes. If you are in a Unix platform # it will use a colored log, otherwise it will use a basic one without color. # - # source://thor//lib/thor/shell.rb#11 + # pkg:gem/thor#lib/thor/shell.rb:11 def shell; end - # Sets the attribute shell - # - # @param value the value to set the attribute shell to. + # Returns the shell used in all Thor classes. If you are in a Unix platform + # it will use a colored log, otherwise it will use a basic one without color. # - # source://thor//lib/thor/shell.rb#6 + # pkg:gem/thor#lib/thor/shell.rb:6 def shell=(_arg0); end # Returns the files where the subclasses are kept. @@ -1846,7 +1576,7 @@ module Thor::Base # ==== Returns # Hash[path<String> => Class] # - # source://thor//lib/thor/base.rb#137 + # pkg:gem/thor#lib/thor/base.rb:138 def subclass_files; end # Returns the classes that inherits from Thor or Thor::Group. @@ -1854,12 +1584,12 @@ module Thor::Base # ==== Returns # Array[Class] # - # source://thor//lib/thor/base.rb#128 + # pkg:gem/thor#lib/thor/base.rb:129 def subclasses; end end end -# source://thor//lib/thor/base.rb#153 +# pkg:gem/thor#lib/thor/base.rb:154 module Thor::Base::ClassMethods # Returns the commands for this Thor class and all subclasses. # @@ -1867,22 +1597,16 @@ module Thor::Base::ClassMethods # Hash:: An ordered hash with commands names as keys and Thor::Command # objects as values. # - # source://thor//lib/thor/base.rb#482 + # pkg:gem/thor#lib/thor/base.rb:483 def all_commands; end - # Returns the commands for this Thor class and all subclasses. - # - # ==== Returns - # Hash:: An ordered hash with commands names as keys and Thor::Command - # objects as values. - # - # source://thor//lib/thor/base.rb#482 + # pkg:gem/thor#lib/thor/base.rb:487 def all_tasks; end # If you want to use defaults that don't match the type of an option, # either specify `check_default_type: false` or call `allow_incompatible_default_type!` # - # source://thor//lib/thor/base.rb#189 + # pkg:gem/thor#lib/thor/base.rb:190 def allow_incompatible_default_type!; end # Adds an argument to the class and creates an attr_accessor for it. @@ -1920,7 +1644,7 @@ module Thor::Base::ClassMethods # ==== Errors # ArgumentError:: Raised if you supply a required argument after a non required one. # - # source://thor//lib/thor/base.rb#261 + # pkg:gem/thor#lib/thor/base.rb:262 def argument(name, options = T.unsafe(nil)); end # Returns this class arguments, looking up in the ancestors chain. @@ -1928,40 +1652,38 @@ module Thor::Base::ClassMethods # ==== Returns # Array[Thor::Argument] # - # source://thor//lib/thor/base.rb#293 + # pkg:gem/thor#lib/thor/base.rb:294 def arguments; end - # source://thor//lib/thor/base.rb#162 + # pkg:gem/thor#lib/thor/base.rb:163 def attr_accessor(*_arg0); end - # source://thor//lib/thor/base.rb#154 + # pkg:gem/thor#lib/thor/base.rb:155 def attr_reader(*_arg0); end - # source://thor//lib/thor/base.rb#158 + # pkg:gem/thor#lib/thor/base.rb:159 def attr_writer(*_arg0); end - # source://thor//lib/thor/base.rb#193 + # pkg:gem/thor#lib/thor/base.rb:194 def check_default_type; end # If you want to raise an error when the default value of an option does not match # the type call check_default_type! # This will be the default; for compatibility a deprecation warning is issued if necessary. # - # source://thor//lib/thor/base.rb#183 + # pkg:gem/thor#lib/thor/base.rb:184 def check_default_type!; end - # source://thor//lib/thor/base.rb#172 + # pkg:gem/thor#lib/thor/base.rb:173 def check_unknown_options; end # If you want to raise an error for unknown options, call check_unknown_options! # This is disabled by default to allow dynamic invocations. # - # source://thor//lib/thor/base.rb#168 + # pkg:gem/thor#lib/thor/base.rb:169 def check_unknown_options!; end - # @return [Boolean] - # - # source://thor//lib/thor/base.rb#176 + # pkg:gem/thor#lib/thor/base.rb:177 def check_unknown_options?(config); end # Adds and declares option group for required at least one of options in the @@ -1994,7 +1716,7 @@ module Thor::Base::ClassMethods # # Then it is required either only one of "--one" or "--two". # - # source://thor//lib/thor/base.rb#392 + # pkg:gem/thor#lib/thor/base.rb:393 def class_at_least_one(*args, &block); end # Returns this class at least one of required options array set, looking up in the ancestors chain. @@ -2002,7 +1724,7 @@ module Thor::Base::ClassMethods # ==== Returns # Array[Array[Thor::Option.name]] # - # source://thor//lib/thor/base.rb#411 + # pkg:gem/thor#lib/thor/base.rb:412 def class_at_least_one_option_names; end # Adds and declares option group for exclusive options in the @@ -2027,7 +1749,7 @@ module Thor::Base::ClassMethods # If you give "--one" and "--two" at the same time ExclusiveArgumentsError # will be raised. # - # source://thor//lib/thor/base.rb#357 + # pkg:gem/thor#lib/thor/base.rb:358 def class_exclusive(*args, &block); end # Returns this class exclusive options array set, looking up in the ancestors chain. @@ -2035,7 +1757,7 @@ module Thor::Base::ClassMethods # ==== Returns # Array[Array[Thor::Option.name]] # - # source://thor//lib/thor/base.rb#402 + # pkg:gem/thor#lib/thor/base.rb:403 def class_exclusive_option_names; end # Adds an option to the set of class options @@ -2054,7 +1776,7 @@ module Thor::Base::ClassMethods # :banner:: -- String to show on usage notes. # :hide:: -- If you want to hide this option from the help. # - # source://thor//lib/thor/base.rb#328 + # pkg:gem/thor#lib/thor/base.rb:329 def class_option(name, options = T.unsafe(nil)); end # Adds a bunch of options to the set of class options. @@ -2066,7 +1788,7 @@ module Thor::Base::ClassMethods # ==== Parameters # Hash[Symbol => Object] # - # source://thor//lib/thor/base.rb#306 + # pkg:gem/thor#lib/thor/base.rb:307 def class_options(options = T.unsafe(nil)); end # Returns the commands for this Thor class. @@ -2075,22 +1797,18 @@ module Thor::Base::ClassMethods # Hash:: An ordered hash with commands names as keys and Thor::Command # objects as values. # - # source://thor//lib/thor/base.rb#471 + # pkg:gem/thor#lib/thor/base.rb:472 def commands; end # If true, option set will not suspend the execution of the command when # a required option is not provided. # - # @return [Boolean] - # - # source://thor//lib/thor/base.rb#207 + # pkg:gem/thor#lib/thor/base.rb:208 def disable_required_check?(command_name); end # A flag that makes the process exit with status 1 if any error happens. # - # @return [Boolean] - # - # source://thor//lib/thor/base.rb#628 + # pkg:gem/thor#lib/thor/base.rb:629 def exit_on_failure?; end # Defines the group. This is used when thor list is invoked so you can specify @@ -2099,22 +1817,16 @@ module Thor::Base::ClassMethods # ==== Parameters # name<String|Symbol> # - # source://thor//lib/thor/base.rb#457 + # pkg:gem/thor#lib/thor/base.rb:458 def group(name = T.unsafe(nil)); end - # @raise [InvocationError] - # - # source://thor//lib/thor/base.rb#618 + # pkg:gem/thor#lib/thor/base.rb:619 def handle_argument_error(command, error, args, arity); end - # @raise [UndefinedCommandError] - # - # source://thor//lib/thor/base.rb#613 + # pkg:gem/thor#lib/thor/base.rb:614 def handle_no_command_error(command, has_namespace = T.unsafe(nil)); end - # @raise [UndefinedCommandError] - # - # source://thor//lib/thor/base.rb#613 + # pkg:gem/thor#lib/thor/base.rb:617 def handle_no_task_error(command, has_namespace = T.unsafe(nil)); end # Sets the namespace for the Thor or Thor::Group class. By default the @@ -2139,7 +1851,7 @@ module Thor::Base::ClassMethods # # thor :my_command # - # source://thor//lib/thor/base.rb#566 + # pkg:gem/thor#lib/thor/base.rb:567 def namespace(name = T.unsafe(nil)); end # All methods defined inside the given block are not added as commands. @@ -2161,37 +1873,16 @@ module Thor::Base::ClassMethods # remove_command :this_is_not_a_command # end # - # source://thor//lib/thor/base.rb#530 + # pkg:gem/thor#lib/thor/base.rb:531 def no_commands(&block); end - # @return [Boolean] - # - # source://thor//lib/thor/base.rb#540 + # pkg:gem/thor#lib/thor/base.rb:541 def no_commands?; end - # source://thor//lib/thor/base.rb#536 + # pkg:gem/thor#lib/thor/base.rb:537 def no_commands_context; end - # All methods defined inside the given block are not added as commands. - # - # So you can do: - # - # class MyScript < Thor - # no_commands do - # def this_is_not_a_command - # end - # end - # end - # - # You can also add the method and remove it from the command list: - # - # class MyScript < Thor - # def this_is_not_a_command - # end - # remove_command :this_is_not_a_command - # end - # - # source://thor//lib/thor/base.rb#530 + # pkg:gem/thor#lib/thor/base.rb:535 def no_tasks(&block); end # Allows to use private methods from parent in child classes as commands. @@ -2204,20 +1895,10 @@ module Thor::Base::ClassMethods # public_command :foo # public_command :foo, :bar, :baz # - # source://thor//lib/thor/base.rb#606 + # pkg:gem/thor#lib/thor/base.rb:607 def public_command(*names); end - # Allows to use private methods from parent in child classes as commands. - # - # ==== Parameters - # names<Array>:: Method names to be used as commands - # - # ==== Examples - # - # public_command :foo - # public_command :foo, :bar, :baz - # - # source://thor//lib/thor/base.rb#606 + # pkg:gem/thor#lib/thor/base.rb:612 def public_task(*names); end # Removes a previous defined argument. If :undefine is given, undefine @@ -2231,7 +1912,7 @@ module Thor::Base::ClassMethods # remove_argument :foo # remove_argument :foo, :bar, :baz, :undefine => true # - # source://thor//lib/thor/base.rb#426 + # pkg:gem/thor#lib/thor/base.rb:427 def remove_argument(*names); end # Removes a previous defined class option. @@ -2244,7 +1925,7 @@ module Thor::Base::ClassMethods # remove_class_option :foo # remove_class_option :foo, :bar, :baz # - # source://thor//lib/thor/base.rb#445 + # pkg:gem/thor#lib/thor/base.rb:446 def remove_class_option(*names); end # Removes a given command from this Thor class. This is usually done if you @@ -2259,22 +1940,10 @@ module Thor::Base::ClassMethods # options<Hash>:: You can give :undefine => true if you want commands the method # to be undefined from the class as well. # - # source://thor//lib/thor/base.rb#500 + # pkg:gem/thor#lib/thor/base.rb:501 def remove_command(*names); end - # Removes a given command from this Thor class. This is usually done if you - # are inheriting from another class and don't want it to be available - # anymore. - # - # By default it only remove the mapping to the command. But you can supply - # :undefine => true to undefine the method from the class as well. - # - # ==== Parameters - # name<Symbol|String>:: The name of the command to be removed - # options<Hash>:: You can give :undefine => true if you want commands the method - # to be undefined from the class as well. - # - # source://thor//lib/thor/base.rb#500 + # pkg:gem/thor#lib/thor/base.rb:510 def remove_task(*names); end # Parses the command and options from the given args, instantiate the class @@ -2285,40 +1954,30 @@ module Thor::Base::ClassMethods # script = MyScript.new(args, options, config) # script.invoke(:command, first_arg, second_arg, third_arg) # - # source://thor//lib/thor/base.rb#582 + # pkg:gem/thor#lib/thor/base.rb:583 def start(given_args = T.unsafe(nil), config = T.unsafe(nil)); end # If true, option parsing is suspended as soon as an unknown option or a # regular argument is encountered. All remaining arguments are passed to # the command as regular arguments. # - # @return [Boolean] - # - # source://thor//lib/thor/base.rb#201 + # pkg:gem/thor#lib/thor/base.rb:202 def stop_on_unknown_option?(command_name); end - # source://thor//lib/thor/base.rb#218 + # pkg:gem/thor#lib/thor/base.rb:219 def strict_args_position; end # If you want only strict string args (useful when cascading thor classes), # call strict_args_position! This is disabled by default to allow dynamic # invocations. # - # source://thor//lib/thor/base.rb#214 + # pkg:gem/thor#lib/thor/base.rb:215 def strict_args_position!; end - # @return [Boolean] - # - # source://thor//lib/thor/base.rb#222 + # pkg:gem/thor#lib/thor/base.rb:223 def strict_args_position?(config); end - # Returns the commands for this Thor class. - # - # ==== Returns - # Hash:: An ordered hash with commands names as keys and Thor::Command - # objects as values. - # - # source://thor//lib/thor/base.rb#471 + # pkg:gem/thor#lib/thor/base.rb:475 def tasks; end protected @@ -2326,12 +1985,12 @@ module Thor::Base::ClassMethods # SIGNATURE: Sets the baseclass. This is where the superclass lookup # finishes. # - # source://thor//lib/thor/base.rb#777 + # pkg:gem/thor#lib/thor/base.rb:778 def baseclass; end # The basename of the program invoking the thor class. # - # source://thor//lib/thor/base.rb#771 + # pkg:gem/thor#lib/thor/base.rb:772 def basename; end # Build an option and adds it to the given scope. @@ -2341,7 +2000,7 @@ module Thor::Base::ClassMethods # options<Hash>:: Described in both class_option and method_option. # scope<Hash>:: Options hash that is being built up # - # source://thor//lib/thor/base.rb#688 + # pkg:gem/thor#lib/thor/base.rb:689 def build_option(name, options, scope); end # Receives a hash of options, parse them and add to the scope. This is a @@ -2352,187 +2011,160 @@ module Thor::Base::ClassMethods # ==== Parameters # Hash[Symbol => Object] # - # source://thor//lib/thor/base.rb#699 + # pkg:gem/thor#lib/thor/base.rb:700 def build_options(options, scope); end # Get target(method_options or class_options) options # of before and after by block evaluation. # - # source://thor//lib/thor/base.rb#808 + # pkg:gem/thor#lib/thor/base.rb:809 def built_option_names(target, opt = T.unsafe(nil), &block); end # Prints the class options per group. If an option does not belong to # any group, it's printed as Class option. # - # source://thor//lib/thor/base.rb#638 + # pkg:gem/thor#lib/thor/base.rb:639 def class_options_help(shell, groups = T.unsafe(nil)); end # Get command scope member by name. # - # source://thor//lib/thor/base.rb#816 + # pkg:gem/thor#lib/thor/base.rb:817 def command_scope_member(name, options = T.unsafe(nil)); end # SIGNATURE: Creates a new command if valid_command? is true. This method is # called when a new method is added to the class. # - # source://thor//lib/thor/base.rb#782 + # pkg:gem/thor#lib/thor/base.rb:783 def create_command(meth); end - # SIGNATURE: Creates a new command if valid_command? is true. This method is - # called when a new method is added to the class. - # - # source://thor//lib/thor/base.rb#782 + # pkg:gem/thor#lib/thor/base.rb:785 def create_task(meth); end # SIGNATURE: The hook invoked by start. # - # @raise [NotImplementedError] - # - # source://thor//lib/thor/base.rb#792 + # pkg:gem/thor#lib/thor/base.rb:793 def dispatch(command, given_args, given_opts, config); end # Finds a command with the given name. If the command belongs to the current # class, just return it, otherwise dup it and add the fresh copy to the # current command hash. # - # source://thor//lib/thor/base.rb#708 + # pkg:gem/thor#lib/thor/base.rb:709 def find_and_refresh_command(name); end - # Finds a command with the given name. If the command belongs to the current - # class, just return it, otherwise dup it and add the fresh copy to the - # current command hash. - # - # source://thor//lib/thor/base.rb#708 + # pkg:gem/thor#lib/thor/base.rb:718 def find_and_refresh_task(name); end # Retrieves a value from superclass. If it reaches the baseclass, # returns default. # - # source://thor//lib/thor/base.rb#749 + # pkg:gem/thor#lib/thor/base.rb:750 def from_superclass(method, default = T.unsafe(nil)); end # Every time someone inherits from a Thor class, register the klass # and file into baseclass. # - # source://thor//lib/thor/base.rb#721 + # pkg:gem/thor#lib/thor/base.rb:722 def inherited(klass); end # SIGNATURE: Defines behavior when the initialize method is added to the # class. # - # source://thor//lib/thor/base.rb#788 + # pkg:gem/thor#lib/thor/base.rb:789 def initialize_added; end # Raises an error if the word given is a Thor reserved word. # - # @return [Boolean] - # - # source://thor//lib/thor/base.rb#677 + # pkg:gem/thor#lib/thor/base.rb:678 def is_thor_reserved_word?(word, type); end # Fire this callback whenever a method is added. Added methods are # tracked as commands by invoking the create_command method. # - # source://thor//lib/thor/base.rb#729 + # pkg:gem/thor#lib/thor/base.rb:730 def method_added(meth); end # Receives a set of options and print them. # - # source://thor//lib/thor/base.rb#656 + # pkg:gem/thor#lib/thor/base.rb:657 def print_options(shell, options, group_name = T.unsafe(nil)); end # Register a relation of options for target(method_option/class_option) # by args and block. # - # source://thor//lib/thor/base.rb#798 + # pkg:gem/thor#lib/thor/base.rb:799 def register_options_relation_for(target, relation, *args, &block); end end -# source://thor//lib/thor/command.rb#2 +# pkg:gem/thor#lib/thor/command.rb:2 class Thor::Command < ::Struct - # @return [Command] a new instance of Command - # - # source://thor//lib/thor/command.rb#5 + # pkg:gem/thor#lib/thor/command.rb:5 def initialize(name, description, long_description, wrap_long_description, usage, options = T.unsafe(nil), options_relation = T.unsafe(nil)); end # Returns the formatted usage by injecting given required arguments # and required options into the given usage. # - # source://thor//lib/thor/command.rb#42 + # pkg:gem/thor#lib/thor/command.rb:42 def formatted_usage(klass, namespace = T.unsafe(nil), subcommand = T.unsafe(nil)); end - # @return [Boolean] - # - # source://thor//lib/thor/command.rb#15 + # pkg:gem/thor#lib/thor/command.rb:15 def hidden?; end - # source://thor//lib/thor/command.rb#70 + # pkg:gem/thor#lib/thor/command.rb:70 def method_at_least_one_option_names; end - # source://thor//lib/thor/command.rb#66 + # pkg:gem/thor#lib/thor/command.rb:66 def method_exclusive_option_names; end # By default, a command invokes a method in the thor class. You can change this # implementation to create custom commands. # - # source://thor//lib/thor/command.rb#21 + # pkg:gem/thor#lib/thor/command.rb:21 def run(instance, args = T.unsafe(nil)); end protected - # @return [Boolean] - # - # source://thor//lib/thor/command.rb#114 + # pkg:gem/thor#lib/thor/command.rb:114 def handle_argument_error?(instance, error, caller); end - # @return [Boolean] - # - # source://thor//lib/thor/command.rb#121 + # pkg:gem/thor#lib/thor/command.rb:121 def handle_no_method_error?(instance, error, caller); end - # @return [Boolean] - # - # source://thor//lib/thor/command.rb#104 + # pkg:gem/thor#lib/thor/command.rb:104 def local_method?(instance, name); end - # @return [Boolean] - # - # source://thor//lib/thor/command.rb#87 + # pkg:gem/thor#lib/thor/command.rb:87 def not_debugging?(instance); end - # @return [Boolean] - # - # source://thor//lib/thor/command.rb#100 + # pkg:gem/thor#lib/thor/command.rb:100 def private_method?(instance); end # Given a target, checks if this class name is a public method. # - # @return [Boolean] - # - # source://thor//lib/thor/command.rb#96 + # pkg:gem/thor#lib/thor/command.rb:96 def public_method?(instance); end # Add usage with required arguments # - # source://thor//lib/thor/command.rb#77 + # pkg:gem/thor#lib/thor/command.rb:77 def required_arguments_for(klass, usage); end - # source://thor//lib/thor/command.rb#91 + # pkg:gem/thor#lib/thor/command.rb:91 def required_options; end - # source://thor//lib/thor/command.rb#109 + # pkg:gem/thor#lib/thor/command.rb:109 def sans_backtrace(backtrace, caller); end private - # source://thor//lib/thor/command.rb#9 + # pkg:gem/thor#lib/thor/command.rb:9 def initialize_copy(other); end end -# source://thor//lib/thor/command.rb#3 +# pkg:gem/thor#lib/thor/command.rb:3 Thor::Command::FILE_REGEXP = T.let(T.unsafe(nil), Regexp) -# source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#2 +# pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:2 module Thor::CoreExt; end # A hash with indifferent access and magic predicates. @@ -2543,62 +2175,58 @@ module Thor::CoreExt; end # hash['foo'] #=> 'bar' # hash.foo? #=> true # -# source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#11 +# pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:11 class Thor::CoreExt::HashWithIndifferentAccess < ::Hash - # @return [HashWithIndifferentAccess] a new instance of HashWithIndifferentAccess - # - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#12 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:12 def initialize(hash = T.unsafe(nil)); end - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#19 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:19 def [](key); end - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#23 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:23 def []=(key, value); end - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#27 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:27 def delete(key); end - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#31 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:31 def except(*keys); end - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#37 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:37 def fetch(key, *args); end - # @return [Boolean] - # - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#45 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:45 def key?(key); end - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#53 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:53 def merge(other); end - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#57 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:57 def merge!(other); end - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#72 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:72 def replace(other_hash); end - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#64 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:64 def reverse_merge(other); end - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#68 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:68 def reverse_merge!(other_hash); end - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#41 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:41 def slice(*keys); end # Convert to a Hash with String keys. # - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#77 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:77 def to_hash; end - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#49 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:49 def values_at(*indices); end protected - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#83 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:83 def convert_key(key); end # Magic predicates. For instance: @@ -2607,33 +2235,31 @@ class Thor::CoreExt::HashWithIndifferentAccess < ::Hash # options.shebang # => "/usr/lib/local/ruby" # options.test_framework?(:rspec) # => options[:test_framework] == :rspec # - # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#93 + # pkg:gem/thor#lib/thor/core_ext/hash_with_indifferent_access.rb:93 def method_missing(method, *args); end end -# source://thor//lib/thor/error.rb#3 +# pkg:gem/thor#lib/thor/error.rb:3 module Thor::Correctable - # source://thor//lib/thor/error.rb#8 + # pkg:gem/thor#lib/thor/error.rb:8 def corrections; end - # source://thor//lib/thor/error.rb#4 + # pkg:gem/thor#lib/thor/error.rb:4 def to_s; end end # A dynamic command that handles method missing scenarios. # -# source://thor//lib/thor/command.rb#137 +# pkg:gem/thor#lib/thor/command.rb:137 class Thor::DynamicCommand < ::Thor::Command - # @return [DynamicCommand] a new instance of DynamicCommand - # - # source://thor//lib/thor/command.rb#138 + # pkg:gem/thor#lib/thor/command.rb:138 def initialize(name, options = T.unsafe(nil)); end - # source://thor//lib/thor/command.rb#142 + # pkg:gem/thor#lib/thor/command.rb:142 def run(instance, args = T.unsafe(nil)); end end -# source://thor//lib/thor/command.rb#150 +# pkg:gem/thor#lib/thor/command.rb:150 Thor::DynamicTask = Thor::DynamicCommand # Thor::Error is raised when it's caused by wrong usage of thor classes. Those @@ -2643,10 +2269,10 @@ Thor::DynamicTask = Thor::DynamicCommand # overwrites a thor keyword, SHOULD NOT raise a Thor::Error. This way, we # ensure that developer errors are shown with full backtrace. # -# source://thor//lib/thor/error.rb#20 +# pkg:gem/thor#lib/thor/error.rb:20 class Thor::Error < ::StandardError; end -# source://thor//lib/thor/error.rb#101 +# pkg:gem/thor#lib/thor/error.rb:101 class Thor::ExclusiveArgumentError < ::Thor::InvocationError; end # Thor has a special class called Thor::Group. The main difference to Thor class @@ -2654,7 +2280,7 @@ class Thor::ExclusiveArgumentError < ::Thor::InvocationError; end # invocations to be done at the class method, which are not available to Thor # commands. # -# source://thor//lib/thor/group.rb#7 +# pkg:gem/thor#lib/thor/group.rb:7 class Thor::Group include ::Thor::Base include ::Thor::Invocation @@ -2667,14 +2293,14 @@ class Thor::Group # Shortcut to invoke with padding and block handling. Use internally by # invoke and invoke_from_option class methods. # - # source://thor//lib/thor/group.rb#276 + # pkg:gem/thor#lib/thor/group.rb:276 def _invoke_for_class_method(klass, command = T.unsafe(nil), *args, &block); end class << self # Overwrite class options help to allow invoked generators options to be # shown recursively when invoking a generator. # - # source://thor//lib/thor/group.rb#161 + # pkg:gem/thor#lib/thor/group.rb:161 def class_options_help(shell, groups = T.unsafe(nil)); end # Checks if a specified command exists. @@ -2685,9 +2311,7 @@ class Thor::Group # ==== Returns # Boolean:: +true+ if the command exists, +false+ otherwise. # - # @return [Boolean] - # - # source://thor//lib/thor/group.rb#221 + # pkg:gem/thor#lib/thor/group.rb:221 def command_exists?(command_name); end # The description for this Thor::Group. If none is provided, but a source root @@ -2697,19 +2321,17 @@ class Thor::Group # ==== Parameters # description<String>:: The description for this Thor::Group. # - # source://thor//lib/thor/group.rb#16 + # pkg:gem/thor#lib/thor/group.rb:16 def desc(description = T.unsafe(nil)); end # Get invocations array and merge options from invocations. Those # options are added to group_options hash. Options that already exists # in base_options are not added twice. # - # source://thor//lib/thor/group.rb#172 + # pkg:gem/thor#lib/thor/group.rb:172 def get_options_from_invocations(group_options, base_options); end - # @raise [error] - # - # source://thor//lib/thor/group.rb#207 + # pkg:gem/thor#lib/thor/group.rb:207 def handle_argument_error(command, error, _args, arity); end # Prints help information. @@ -2717,17 +2339,17 @@ class Thor::Group # ==== Options # short:: When true, shows only usage. # - # source://thor//lib/thor/group.rb#29 + # pkg:gem/thor#lib/thor/group.rb:29 def help(shell); end # Stores invocation blocks used on invoke_from_option. # - # source://thor//lib/thor/group.rb#45 + # pkg:gem/thor#lib/thor/group.rb:45 def invocation_blocks; end # Stores invocations for this class merging with superclass values. # - # source://thor//lib/thor/group.rb#39 + # pkg:gem/thor#lib/thor/group.rb:39 def invocations; end # Invoke the given namespace or class given. It adds an instance @@ -2737,7 +2359,7 @@ class Thor::Group # The namespace/class given will have its options showed on the help # usage. Check invoke_from_option for more information. # - # source://thor//lib/thor/group.rb#56 + # pkg:gem/thor#lib/thor/group.rb:56 def invoke(*names, &block); end # Invoke a thor class based on the value supplied by the user to the @@ -2770,17 +2392,15 @@ class Thor::Group # invoked. The block receives two parameters, an instance of the current # class and the klass to be invoked. # - # source://thor//lib/thor/group.rb#110 + # pkg:gem/thor#lib/thor/group.rb:110 def invoke_from_option(*names, &block); end # Returns commands ready to be printed. # - # source://thor//lib/thor/group.rb#199 + # pkg:gem/thor#lib/thor/group.rb:199 def printable_commands(*_arg0); end - # Returns commands ready to be printed. - # - # source://thor//lib/thor/group.rb#199 + # pkg:gem/thor#lib/thor/group.rb:205 def printable_tasks(*_arg0); end # Remove a previously added invocation. @@ -2789,7 +2409,7 @@ class Thor::Group # # remove_invocation :test_framework # - # source://thor//lib/thor/group.rb#149 + # pkg:gem/thor#lib/thor/group.rb:149 def remove_invocation(*names); end protected @@ -2797,67 +2417,61 @@ class Thor::Group # The banner for this class. You can customize it if you are invoking the # thor class by another ways which is not the Thor::Runner. # - # source://thor//lib/thor/group.rb#249 + # pkg:gem/thor#lib/thor/group.rb:249 def banner; end - # source://thor//lib/thor/group.rb#259 + # pkg:gem/thor#lib/thor/group.rb:259 def baseclass; end - # source://thor//lib/thor/group.rb#263 + # pkg:gem/thor#lib/thor/group.rb:263 def create_command(meth); end - # source://thor//lib/thor/group.rb#263 + # pkg:gem/thor#lib/thor/group.rb:267 def create_task(meth); end # The method responsible for dispatching given the args. # - # @yield [instance] - # - # source://thor//lib/thor/group.rb#228 + # pkg:gem/thor#lib/thor/group.rb:228 def dispatch(command, given_args, given_opts, config); end # Represents the whole class as a command. # - # source://thor//lib/thor/group.rb#254 + # pkg:gem/thor#lib/thor/group.rb:254 def self_command; end - # Represents the whole class as a command. - # - # source://thor//lib/thor/group.rb#254 + # pkg:gem/thor#lib/thor/group.rb:257 def self_task; end end end -# Shortcuts for help. +# Shortcuts for help and tree commands. # -# source://thor//lib/thor/base.rb#17 +# pkg:gem/thor#lib/thor/base.rb:17 Thor::HELP_MAPPINGS = T.let(T.unsafe(nil), Array) # A command that is hidden in help messages but still invocable. # -# source://thor//lib/thor/command.rb#129 +# pkg:gem/thor#lib/thor/command.rb:129 class Thor::HiddenCommand < ::Thor::Command - # @return [Boolean] - # - # source://thor//lib/thor/command.rb#130 + # pkg:gem/thor#lib/thor/command.rb:130 def hidden?; end end -# source://thor//lib/thor/command.rb#134 +# pkg:gem/thor#lib/thor/command.rb:134 Thor::HiddenTask = Thor::HiddenCommand -# source://thor//lib/thor/invocation.rb#2 +# pkg:gem/thor#lib/thor/invocation.rb:2 module Thor::Invocation mixes_in_class_methods ::Thor::Invocation::ClassMethods # Make initializer aware of invocations and the initialization args. # - # source://thor//lib/thor/invocation.rb#23 + # pkg:gem/thor#lib/thor/invocation.rb:23 def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil), &block); end # Make the current command chain accessible with in a Thor-(sub)command # - # source://thor//lib/thor/invocation.rb#30 + # pkg:gem/thor#lib/thor/invocation.rb:30 def current_command_chain; end # Receives a name and invokes it. The name can be a string (either "command" or @@ -2928,34 +2542,32 @@ module Thor::Invocation # # invoke Rspec::RR, [], :style => :foo # - # source://thor//lib/thor/invocation.rb#102 + # pkg:gem/thor#lib/thor/invocation.rb:102 def invoke(name = T.unsafe(nil), *args); end # Invoke all commands for the current instance. # - # source://thor//lib/thor/invocation.rb#133 + # pkg:gem/thor#lib/thor/invocation.rb:133 def invoke_all; end # Invoke the given command if the given args. # - # source://thor//lib/thor/invocation.rb#122 + # pkg:gem/thor#lib/thor/invocation.rb:122 def invoke_command(command, *args); end - # Invoke the given command if the given args. - # - # source://thor//lib/thor/invocation.rb#122 + # pkg:gem/thor#lib/thor/invocation.rb:130 def invoke_task(command, *args); end # Invokes using shell padding. # - # source://thor//lib/thor/invocation.rb#138 + # pkg:gem/thor#lib/thor/invocation.rb:138 def invoke_with_padding(*args); end protected # Initialize klass using values stored in the @_initializer. # - # source://thor//lib/thor/invocation.rb#166 + # pkg:gem/thor#lib/thor/invocation.rb:166 def _parse_initialization_options(args, opts, config); end # This method simply retrieves the class and command to be invoked. @@ -2963,268 +2575,221 @@ module Thor::Invocation # use the given name and return self as class. Otherwise, call # prepare_for_invocation in the current class. # - # source://thor//lib/thor/invocation.rb#153 + # pkg:gem/thor#lib/thor/invocation.rb:153 def _retrieve_class_and_command(name, sent_command = T.unsafe(nil)); end - # This method simply retrieves the class and command to be invoked. - # If the name is nil or the given name is a command in the current class, - # use the given name and return self as class. Otherwise, call - # prepare_for_invocation in the current class. - # - # source://thor//lib/thor/invocation.rb#153 + # pkg:gem/thor#lib/thor/invocation.rb:163 def _retrieve_class_and_task(name, sent_command = T.unsafe(nil)); end # Configuration values that are shared between invocations. # - # source://thor//lib/thor/invocation.rb#145 + # pkg:gem/thor#lib/thor/invocation.rb:145 def _shared_configuration; end class << self - # source://thor//lib/thor/invocation.rb#3 + # pkg:gem/thor#lib/thor/invocation.rb:3 def included(base); end end end -# source://thor//lib/thor/invocation.rb#8 +# pkg:gem/thor#lib/thor/invocation.rb:8 module Thor::Invocation::ClassMethods # This method is responsible for receiving a name and find the proper # class and command for it. The key is an optional parameter which is # available only in class methods invocations (i.e. in Thor::Group). # - # source://thor//lib/thor/invocation.rb#12 + # pkg:gem/thor#lib/thor/invocation.rb:12 def prepare_for_invocation(key, name); end end # Raised when a command was found, but not invoked properly. # -# source://thor//lib/thor/error.rb#62 +# pkg:gem/thor#lib/thor/error.rb:62 class Thor::InvocationError < ::Thor::Error; end -# source://thor//lib/thor/line_editor/basic.rb#2 +# pkg:gem/thor#lib/thor/line_editor/basic.rb:2 module Thor::LineEditor class << self - # source://thor//lib/thor/line_editor.rb#10 + # pkg:gem/thor#lib/thor/line_editor.rb:10 def best_available; end - # source://thor//lib/thor/line_editor.rb#6 + # pkg:gem/thor#lib/thor/line_editor.rb:6 def readline(prompt, options = T.unsafe(nil)); end end end -# source://thor//lib/thor/line_editor/basic.rb#3 +# pkg:gem/thor#lib/thor/line_editor/basic.rb:3 class Thor::LineEditor::Basic - # @return [Basic] a new instance of Basic - # - # source://thor//lib/thor/line_editor/basic.rb#10 + # pkg:gem/thor#lib/thor/line_editor/basic.rb:10 def initialize(prompt, options); end - # Returns the value of attribute options. - # - # source://thor//lib/thor/line_editor/basic.rb#4 + # pkg:gem/thor#lib/thor/line_editor/basic.rb:4 def options; end - # Returns the value of attribute prompt. - # - # source://thor//lib/thor/line_editor/basic.rb#4 + # pkg:gem/thor#lib/thor/line_editor/basic.rb:4 def prompt; end - # source://thor//lib/thor/line_editor/basic.rb#15 + # pkg:gem/thor#lib/thor/line_editor/basic.rb:15 def readline; end private - # @return [Boolean] - # - # source://thor//lib/thor/line_editor/basic.rb#32 + # pkg:gem/thor#lib/thor/line_editor/basic.rb:32 def echo?; end - # source://thor//lib/thor/line_editor/basic.rb#22 + # pkg:gem/thor#lib/thor/line_editor/basic.rb:22 def get_input; end class << self - # @return [Boolean] - # - # source://thor//lib/thor/line_editor/basic.rb#6 + # pkg:gem/thor#lib/thor/line_editor/basic.rb:6 def available?; end end end -# source://thor//lib/thor/line_editor/readline.rb#3 +# pkg:gem/thor#lib/thor/line_editor/readline.rb:3 class Thor::LineEditor::Readline < ::Thor::LineEditor::Basic - # source://thor//lib/thor/line_editor/readline.rb#13 + # pkg:gem/thor#lib/thor/line_editor/readline.rb:13 def readline; end private - # @return [Boolean] - # - # source://thor//lib/thor/line_editor/readline.rb#28 + # pkg:gem/thor#lib/thor/line_editor/readline.rb:28 def add_to_history?; end - # source://thor//lib/thor/line_editor/readline.rb#42 + # pkg:gem/thor#lib/thor/line_editor/readline.rb:42 def completion_options; end - # source://thor//lib/thor/line_editor/readline.rb#32 + # pkg:gem/thor#lib/thor/line_editor/readline.rb:32 def completion_proc; end - # @return [Boolean] - # - # source://thor//lib/thor/line_editor/readline.rb#46 + # pkg:gem/thor#lib/thor/line_editor/readline.rb:46 def use_path_completion?; end class << self - # @return [Boolean] - # - # source://thor//lib/thor/line_editor/readline.rb#4 + # pkg:gem/thor#lib/thor/line_editor/readline.rb:4 def available?; end end end -# source://thor//lib/thor/line_editor/readline.rb#50 +# pkg:gem/thor#lib/thor/line_editor/readline.rb:50 class Thor::LineEditor::Readline::PathCompletion - # @return [PathCompletion] a new instance of PathCompletion - # - # source://thor//lib/thor/line_editor/readline.rb#54 + # pkg:gem/thor#lib/thor/line_editor/readline.rb:54 def initialize(text); end - # source://thor//lib/thor/line_editor/readline.rb#58 + # pkg:gem/thor#lib/thor/line_editor/readline.rb:58 def matches; end private - # source://thor//lib/thor/line_editor/readline.rb#68 + # pkg:gem/thor#lib/thor/line_editor/readline.rb:68 def absolute_matches; end - # source://thor//lib/thor/line_editor/readline.rb#82 + # pkg:gem/thor#lib/thor/line_editor/readline.rb:82 def base_path; end - # source://thor//lib/thor/line_editor/readline.rb#78 + # pkg:gem/thor#lib/thor/line_editor/readline.rb:78 def glob_pattern; end - # source://thor//lib/thor/line_editor/readline.rb#64 + # pkg:gem/thor#lib/thor/line_editor/readline.rb:64 def relative_matches; end - # Returns the value of attribute text. - # - # source://thor//lib/thor/line_editor/readline.rb#51 + # pkg:gem/thor#lib/thor/line_editor/readline.rb:51 def text; end end -# source://thor//lib/thor/error.rb#98 +# pkg:gem/thor#lib/thor/error.rb:98 class Thor::MalformattedArgumentError < ::Thor::InvocationError; end -# source://thor//lib/thor/nested_context.rb#2 +# pkg:gem/thor#lib/thor/nested_context.rb:2 class Thor::NestedContext - # @return [NestedContext] a new instance of NestedContext - # - # source://thor//lib/thor/nested_context.rb#3 + # pkg:gem/thor#lib/thor/nested_context.rb:3 def initialize; end - # source://thor//lib/thor/nested_context.rb#7 + # pkg:gem/thor#lib/thor/nested_context.rb:7 def enter; end - # @return [Boolean] - # - # source://thor//lib/thor/nested_context.rb#15 + # pkg:gem/thor#lib/thor/nested_context.rb:15 def entered?; end private - # source://thor//lib/thor/nested_context.rb#25 + # pkg:gem/thor#lib/thor/nested_context.rb:25 def pop; end - # source://thor//lib/thor/nested_context.rb#21 + # pkg:gem/thor#lib/thor/nested_context.rb:21 def push; end end -# source://thor//lib/thor/parser/option.rb#2 +# pkg:gem/thor#lib/thor/parser/option.rb:2 class Thor::Option < ::Thor::Argument - # @return [Option] a new instance of Option - # - # source://thor//lib/thor/parser/option.rb#7 + # pkg:gem/thor#lib/thor/parser/option.rb:7 def initialize(name, options = T.unsafe(nil)); end - # Returns the value of attribute aliases. - # - # source://thor//lib/thor/parser/option.rb#3 + # pkg:gem/thor#lib/thor/parser/option.rb:3 def aliases; end - # source://thor//lib/thor/parser/option.rb#99 + # pkg:gem/thor#lib/thor/parser/option.rb:99 def aliases_for_usage; end - # source://thor//lib/thor/parser/option.rb#118 + # pkg:gem/thor#lib/thor/parser/option.rb:117 def array?; end - # source://thor//lib/thor/parser/option.rb#118 + # pkg:gem/thor#lib/thor/parser/option.rb:117 def boolean?; end - # Returns the value of attribute group. - # - # source://thor//lib/thor/parser/option.rb#3 + # pkg:gem/thor#lib/thor/parser/option.rb:3 def group; end - # source://thor//lib/thor/parser/option.rb#118 + # pkg:gem/thor#lib/thor/parser/option.rb:117 def hash?; end - # Returns the value of attribute hide. - # - # source://thor//lib/thor/parser/option.rb#3 + # pkg:gem/thor#lib/thor/parser/option.rb:3 def hide; end - # source://thor//lib/thor/parser/option.rb#79 + # pkg:gem/thor#lib/thor/parser/option.rb:79 def human_name; end - # Returns the value of attribute lazy_default. - # - # source://thor//lib/thor/parser/option.rb#3 + # pkg:gem/thor#lib/thor/parser/option.rb:3 def lazy_default; end - # source://thor//lib/thor/parser/option.rb#118 + # pkg:gem/thor#lib/thor/parser/option.rb:117 def numeric?; end - # Returns the value of attribute repeatable. - # - # source://thor//lib/thor/parser/option.rb#3 + # pkg:gem/thor#lib/thor/parser/option.rb:3 def repeatable; end - # @return [Boolean] - # - # source://thor//lib/thor/parser/option.rb#107 + # pkg:gem/thor#lib/thor/parser/option.rb:107 def show_default?; end - # source://thor//lib/thor/parser/option.rb#118 + # pkg:gem/thor#lib/thor/parser/option.rb:117 def string?; end - # source://thor//lib/thor/parser/option.rb#75 + # pkg:gem/thor#lib/thor/parser/option.rb:75 def switch_name; end - # source://thor//lib/thor/parser/option.rb#83 + # pkg:gem/thor#lib/thor/parser/option.rb:83 def usage(padding = T.unsafe(nil)); end protected - # source://thor//lib/thor/parser/option.rb#168 + # pkg:gem/thor#lib/thor/parser/option.rb:168 def dasherize(str); end - # @return [Boolean] - # - # source://thor//lib/thor/parser/option.rb#160 + # pkg:gem/thor#lib/thor/parser/option.rb:160 def dasherized?; end - # source://thor//lib/thor/parser/option.rb#164 + # pkg:gem/thor#lib/thor/parser/option.rb:164 def undasherize(str); end - # @raise [ArgumentError] - # - # source://thor//lib/thor/parser/option.rb#126 + # pkg:gem/thor#lib/thor/parser/option.rb:126 def validate!; end - # source://thor//lib/thor/parser/option.rb#131 + # pkg:gem/thor#lib/thor/parser/option.rb:131 def validate_default_type!; end private - # source://thor//lib/thor/parser/option.rb#174 + # pkg:gem/thor#lib/thor/parser/option.rb:174 def normalize_aliases(aliases); end class << self @@ -3255,55 +2820,51 @@ class Thor::Option < ::Thor::Argument # # By default all options are optional, unless :required is given. # - # source://thor//lib/thor/parser/option.rb#45 + # pkg:gem/thor#lib/thor/parser/option.rb:45 def parse(key, value); end end end -# source://thor//lib/thor/parser/option.rb#5 +# pkg:gem/thor#lib/thor/parser/option.rb:5 Thor::Option::VALID_TYPES = T.let(T.unsafe(nil), Array) -# source://thor//lib/thor/parser/options.rb#2 +# pkg:gem/thor#lib/thor/parser/options.rb:2 class Thor::Options < ::Thor::Arguments # Takes a hash of Thor::Option and a hash with defaults. # # If +stop_on_unknown+ is true, #parse will stop as soon as it encounters # an unknown option or a regular argument. # - # @return [Options] a new instance of Options - # - # source://thor//lib/thor/parser/options.rb#32 + # pkg:gem/thor#lib/thor/parser/options.rb:32 def initialize(hash_options = T.unsafe(nil), defaults = T.unsafe(nil), stop_on_unknown = T.unsafe(nil), disable_required_check = T.unsafe(nil), relations = T.unsafe(nil)); end - # source://thor//lib/thor/parser/options.rb#156 + # pkg:gem/thor#lib/thor/parser/options.rb:156 def check_at_least_one!; end - # source://thor//lib/thor/parser/options.rb#144 + # pkg:gem/thor#lib/thor/parser/options.rb:144 def check_exclusive!; end - # @raise [UnknownArgumentError] - # - # source://thor//lib/thor/parser/options.rb#168 + # pkg:gem/thor#lib/thor/parser/options.rb:168 def check_unknown!; end - # source://thor//lib/thor/parser/options.rb#89 + # pkg:gem/thor#lib/thor/parser/options.rb:89 def parse(args); end - # source://thor//lib/thor/parser/options.rb#65 + # pkg:gem/thor#lib/thor/parser/options.rb:65 def peek; end - # source://thor//lib/thor/parser/options.rb#61 + # pkg:gem/thor#lib/thor/parser/options.rb:61 def remaining; end - # source://thor//lib/thor/parser/options.rb#79 + # pkg:gem/thor#lib/thor/parser/options.rb:79 def shift; end - # source://thor//lib/thor/parser/options.rb#84 + # pkg:gem/thor#lib/thor/parser/options.rb:84 def unshift(arg, is_value: T.unsafe(nil)); end protected - # source://thor//lib/thor/parser/options.rb#189 + # pkg:gem/thor#lib/thor/parser/options.rb:189 def assign_result!(option, result); end # Check if the current value in peek is a registered switch. @@ -3311,81 +2872,71 @@ class Thor::Options < ::Thor::Arguments # Two booleans are returned. The first is true if the current value # starts with a hyphen; the second is true if it is a registered switch. # - # @return [Boolean] - # - # source://thor//lib/thor/parser/options.rb#203 + # pkg:gem/thor#lib/thor/parser/options.rb:203 def current_is_switch?; end - # @return [Boolean] - # - # source://thor//lib/thor/parser/options.rb#215 + # pkg:gem/thor#lib/thor/parser/options.rb:215 def current_is_switch_formatted?; end - # @return [Boolean] - # - # source://thor//lib/thor/parser/options.rb#225 + # pkg:gem/thor#lib/thor/parser/options.rb:225 def current_is_value?; end # Option names changes to swith name or human name # - # source://thor//lib/thor/parser/options.rb#179 + # pkg:gem/thor#lib/thor/parser/options.rb:179 def names_to_switch_names(names = T.unsafe(nil)); end # Check if the given argument is actually a shortcut. # - # source://thor//lib/thor/parser/options.rb#244 + # pkg:gem/thor#lib/thor/parser/options.rb:244 def normalize_switch(arg); end # Parse boolean values which can be given as --foo=true or --foo for true values, or # --foo=false, --no-foo or --skip-foo for false values. # - # source://thor//lib/thor/parser/options.rb#256 + # pkg:gem/thor#lib/thor/parser/options.rb:256 def parse_boolean(switch); end # Parse the value at the peek analyzing if it requires an input or not. # - # source://thor//lib/thor/parser/options.rb#274 + # pkg:gem/thor#lib/thor/parser/options.rb:274 def parse_peek(switch, option); end - # @return [Boolean] - # - # source://thor//lib/thor/parser/options.rb#248 + # pkg:gem/thor#lib/thor/parser/options.rb:248 def parsing_options?; end - # @return [Boolean] - # - # source://thor//lib/thor/parser/options.rb#230 + # pkg:gem/thor#lib/thor/parser/options.rb:230 def switch?(arg); end - # source://thor//lib/thor/parser/options.rb#234 + # pkg:gem/thor#lib/thor/parser/options.rb:234 def switch_option(arg); end class << self # Receives a hash and makes it switches. # - # source://thor//lib/thor/parser/options.rb#11 + # pkg:gem/thor#lib/thor/parser/options.rb:11 def to_switches(options); end end end -# source://thor//lib/thor/parser/options.rb#5 +# pkg:gem/thor#lib/thor/parser/options.rb:5 Thor::Options::EQ_RE = T.let(T.unsafe(nil), Regexp) -# source://thor//lib/thor/parser/options.rb#3 +# pkg:gem/thor#lib/thor/parser/options.rb:3 Thor::Options::LONG_RE = T.let(T.unsafe(nil), Regexp) -# source://thor//lib/thor/parser/options.rb#8 +# pkg:gem/thor#lib/thor/parser/options.rb:8 Thor::Options::OPTS_END = T.let(T.unsafe(nil), String) -# source://thor//lib/thor/parser/options.rb#7 +# Allow either -x -v or -xv style for single char args +# +# pkg:gem/thor#lib/thor/parser/options.rb:7 Thor::Options::SHORT_NUM = T.let(T.unsafe(nil), Regexp) -# source://thor//lib/thor/parser/options.rb#4 +# pkg:gem/thor#lib/thor/parser/options.rb:4 Thor::Options::SHORT_RE = T.let(T.unsafe(nil), Regexp) -# Allow either -x -v or -xv style for single char args -# -# source://thor//lib/thor/parser/options.rb#6 +# pkg:gem/thor#lib/thor/parser/options.rb:6 Thor::Options::SHORT_SQ_RE = T.let(T.unsafe(nil), Regexp) # Adds a compatibility layer to your Thor classes which allows you to use @@ -3403,7 +2954,7 @@ Thor::Options::SHORT_SQ_RE = T.let(T.unsafe(nil), Regexp) # end # end # -# source://thor//lib/thor/rake_compat.rb#20 +# pkg:gem/thor#lib/thor/rake_compat.rb:20 module Thor::RakeCompat include ::FileUtils::StreamUtils_ include ::FileUtils @@ -3411,23 +2962,21 @@ module Thor::RakeCompat include ::Rake::DSL class << self - # @private - # - # source://thor//lib/thor/rake_compat.rb#27 + # pkg:gem/thor#lib/thor/rake_compat.rb:27 def included(base); end - # source://thor//lib/thor/rake_compat.rb#23 + # pkg:gem/thor#lib/thor/rake_compat.rb:23 def rake_classes; end end end -# source://thor//lib/thor/error.rb#95 +# pkg:gem/thor#lib/thor/error.rb:95 class Thor::RequiredArgumentMissingError < ::Thor::InvocationError; end -# source://thor//lib/thor/util.rb#4 +# pkg:gem/thor#lib/thor/util.rb:4 module Thor::Sandbox; end -# source://thor//lib/thor/shell.rb#23 +# pkg:gem/thor#lib/thor/shell.rb:23 module Thor::Shell # Add shell to initialize config values. # @@ -3442,81 +2991,78 @@ module Thor::Shell # # MyScript.new [1.0], { :foo => :bar }, :shell => Thor::Shell::Basic.new # - # source://thor//lib/thor/shell.rb#44 + # pkg:gem/thor#lib/thor/shell.rb:44 def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil)); end - # source://thor//lib/thor/shell.rb#59 + # pkg:gem/thor#lib/thor/shell.rb:58 def ask(*args, &block); end - # source://thor//lib/thor/shell.rb#59 + # pkg:gem/thor#lib/thor/shell.rb:58 def error(*args, &block); end - # source://thor//lib/thor/shell.rb#59 + # pkg:gem/thor#lib/thor/shell.rb:58 def file_collision(*args, &block); end - # source://thor//lib/thor/shell.rb#59 + # pkg:gem/thor#lib/thor/shell.rb:58 def no?(*args, &block); end - # source://thor//lib/thor/shell.rb#59 + # pkg:gem/thor#lib/thor/shell.rb:58 def print_in_columns(*args, &block); end - # source://thor//lib/thor/shell.rb#59 + # pkg:gem/thor#lib/thor/shell.rb:58 def print_table(*args, &block); end - # source://thor//lib/thor/shell.rb#59 + # pkg:gem/thor#lib/thor/shell.rb:58 def print_wrapped(*args, &block); end - # source://thor//lib/thor/shell.rb#59 + # pkg:gem/thor#lib/thor/shell.rb:58 def say(*args, &block); end - # source://thor//lib/thor/shell.rb#59 + # pkg:gem/thor#lib/thor/shell.rb:58 def say_error(*args, &block); end - # source://thor//lib/thor/shell.rb#59 + # pkg:gem/thor#lib/thor/shell.rb:58 def say_status(*args, &block); end - # source://thor//lib/thor/shell.rb#59 + # pkg:gem/thor#lib/thor/shell.rb:58 def set_color(*args, &block); end # Holds the shell for the given Thor instance. If no shell is given, # it gets a default shell from Thor::Base.shell. # - # source://thor//lib/thor/shell.rb#52 + # pkg:gem/thor#lib/thor/shell.rb:52 def shell; end - # Sets the attribute shell - # - # @param value the value to set the attribute shell to. + # Holds the shell for the given Thor instance. If no shell is given, + # it gets a default shell from Thor::Base.shell. # - # source://thor//lib/thor/shell.rb#25 + # pkg:gem/thor#lib/thor/shell.rb:25 def shell=(_arg0); end - # source://thor//lib/thor/shell.rb#59 + # pkg:gem/thor#lib/thor/shell.rb:58 def terminal_width(*args, &block); end # Yields the given block with padding. # - # source://thor//lib/thor/shell.rb#66 + # pkg:gem/thor#lib/thor/shell.rb:66 def with_padding; end - # source://thor//lib/thor/shell.rb#59 + # pkg:gem/thor#lib/thor/shell.rb:58 def yes?(*args, &block); end protected # Allow shell to be shared between invocations. # - # source://thor//lib/thor/shell.rb#77 + # pkg:gem/thor#lib/thor/shell.rb:77 def _shared_configuration; end end -# source://thor//lib/thor/shell/basic.rb#7 +# pkg:gem/thor#lib/thor/shell/basic.rb:7 class Thor::Shell::Basic # Initialize base, mute and padding to nil. # - # @return [Basic] a new instance of Basic - # - # source://thor//lib/thor/shell/basic.rb#13 + # pkg:gem/thor#lib/thor/shell/basic.rb:13 def initialize; end # Asks something to the user and receives a response. @@ -3549,19 +3095,13 @@ class Thor::Shell::Basic # # ask("Where should the file be saved?", :path => true) # - # source://thor//lib/thor/shell/basic.rb#80 + # pkg:gem/thor#lib/thor/shell/basic.rb:80 def ask(statement, *args); end - # Returns the value of attribute base. - # - # source://thor//lib/thor/shell/basic.rb#8 + # pkg:gem/thor#lib/thor/shell/basic.rb:8 def base; end - # Sets the attribute base - # - # @param value the value to set the attribute base to. - # - # source://thor//lib/thor/shell/basic.rb#8 + # pkg:gem/thor#lib/thor/shell/basic.rb:8 def base=(_arg0); end # Called if something goes wrong during the execution. This is used by Thor @@ -3569,7 +3109,7 @@ class Thor::Shell::Basic # wrong, you can always raise an exception. If you raise a Thor::Error, it # will be rescued and wrapped in the method below. # - # source://thor//lib/thor/shell/basic.rb#251 + # pkg:gem/thor#lib/thor/shell/basic.rb:251 def error(statement); end # Deals with file collision and returns true if the file should be @@ -3580,42 +3120,36 @@ class Thor::Shell::Basic # destination<String>:: the destination file to solve conflicts # block<Proc>:: an optional block that returns the value to be used in diff and merge # - # source://thor//lib/thor/shell/basic.rb#207 + # pkg:gem/thor#lib/thor/shell/basic.rb:207 def file_collision(destination); end # Sets the output padding while executing a block and resets it. # - # source://thor//lib/thor/shell/basic.rb#43 + # pkg:gem/thor#lib/thor/shell/basic.rb:43 def indent(count = T.unsafe(nil)); end # Mute everything that's inside given block # - # source://thor//lib/thor/shell/basic.rb#22 + # pkg:gem/thor#lib/thor/shell/basic.rb:22 def mute; end # Check if base is muted # - # @return [Boolean] - # - # source://thor//lib/thor/shell/basic.rb#31 + # pkg:gem/thor#lib/thor/shell/basic.rb:31 def mute?; end # Asks the user a question and returns true if the user replies "n" or # "no". # - # @return [Boolean] - # - # source://thor//lib/thor/shell/basic.rb#156 + # pkg:gem/thor#lib/thor/shell/basic.rb:156 def no?(statement, color = T.unsafe(nil)); end - # Returns the value of attribute padding. - # - # source://thor//lib/thor/shell/basic.rb#9 + # pkg:gem/thor#lib/thor/shell/basic.rb:9 def padding; end # Sets the output padding, not allowing less than zero values. # - # source://thor//lib/thor/shell/basic.rb#37 + # pkg:gem/thor#lib/thor/shell/basic.rb:37 def padding=(value); end # Prints values in columns @@ -3623,7 +3157,7 @@ class Thor::Shell::Basic # ==== Parameters # Array[String, String, ...] # - # source://thor//lib/thor/shell/basic.rb#165 + # pkg:gem/thor#lib/thor/shell/basic.rb:165 def print_in_columns(array); end # Prints a table. @@ -3636,7 +3170,7 @@ class Thor::Shell::Basic # colwidth<Integer>:: Force the first column to colwidth spaces wide. # borders<Boolean>:: Adds ascii borders. # - # source://thor//lib/thor/shell/basic.rb#180 + # pkg:gem/thor#lib/thor/shell/basic.rb:180 def print_table(array, options = T.unsafe(nil)); end # Prints a long string, word-wrapping the text to the current width of the @@ -3648,7 +3182,7 @@ class Thor::Shell::Basic # ==== Options # indent<Integer>:: Indent each line of the printed paragraph by indent value. # - # source://thor//lib/thor/shell/basic.rb#194 + # pkg:gem/thor#lib/thor/shell/basic.rb:194 def print_wrapped(message, options = T.unsafe(nil)); end # Say (print) something to the user. If the sentence ends with a whitespace @@ -3658,7 +3192,7 @@ class Thor::Shell::Basic # ==== Example # say("I know you knew that.") # - # source://thor//lib/thor/shell/basic.rb#98 + # pkg:gem/thor#lib/thor/shell/basic.rb:98 def say(message = T.unsafe(nil), color = T.unsafe(nil), force_new_line = T.unsafe(nil)); end # Say (print) an error to the user. If the sentence ends with a whitespace @@ -3668,7 +3202,7 @@ class Thor::Shell::Basic # ==== Example # say_error("error: something went wrong") # - # source://thor//lib/thor/shell/basic.rb#115 + # pkg:gem/thor#lib/thor/shell/basic.rb:115 def say_error(message = T.unsafe(nil), color = T.unsafe(nil), force_new_line = T.unsafe(nil)); end # Say a status with the given color and appends the message. Since this @@ -3676,83 +3210,76 @@ class Thor::Shell::Basic # in log_status, avoiding the message from being shown. If a Symbol is # given in log_status, it's used as the color. # - # source://thor//lib/thor/shell/basic.rb#130 + # pkg:gem/thor#lib/thor/shell/basic.rb:130 def say_status(status, message, log_status = T.unsafe(nil)); end # Apply color to the given string with optional bold. Disabled in the # Thor::Shell::Basic class. # - # source://thor//lib/thor/shell/basic.rb#258 + # pkg:gem/thor#lib/thor/shell/basic.rb:258 def set_color(string, *_arg1); end # Asks the user a question and returns true if the user replies "y" or # "yes". # - # @return [Boolean] - # - # source://thor//lib/thor/shell/basic.rb#149 + # pkg:gem/thor#lib/thor/shell/basic.rb:149 def yes?(statement, color = T.unsafe(nil)); end protected - # source://thor//lib/thor/shell/basic.rb#362 + # pkg:gem/thor#lib/thor/shell/basic.rb:360 def answer_match(possibilities, answer, case_insensitive); end - # source://thor//lib/thor/shell/basic.rb#349 + # pkg:gem/thor#lib/thor/shell/basic.rb:347 def ask_filtered(statement, color, options); end - # source://thor//lib/thor/shell/basic.rb#332 + # pkg:gem/thor#lib/thor/shell/basic.rb:330 def ask_simply(statement, color, options); end - # @return [Boolean] - # - # source://thor//lib/thor/shell/basic.rb#269 + # pkg:gem/thor#lib/thor/shell/basic.rb:269 def can_display_colors?; end - # source://thor//lib/thor/shell/basic.rb#296 + # pkg:gem/thor#lib/thor/shell/basic.rb:384 + def diff_tool; end + + # pkg:gem/thor#lib/thor/shell/basic.rb:296 def file_collision_help(block_given); end - # @return [Boolean] - # - # source://thor//lib/thor/shell/basic.rb#286 + # pkg:gem/thor#lib/thor/shell/basic.rb:286 def is?(value); end - # source://thor//lib/thor/shell/basic.rb#273 + # pkg:gem/thor#lib/thor/shell/basic.rb:273 def lookup_color(color); end - # source://thor//lib/thor/shell/basic.rb#370 + # pkg:gem/thor#lib/thor/shell/basic.rb:368 def merge(destination, content); end - # source://thor//lib/thor/shell/basic.rb#379 + # pkg:gem/thor#lib/thor/shell/basic.rb:377 def merge_tool; end - # source://thor//lib/thor/shell/basic.rb#264 + # pkg:gem/thor#lib/thor/shell/basic.rb:264 def prepare_message(message, *color); end - # @return [Boolean] - # - # source://thor//lib/thor/shell/basic.rb#324 + # pkg:gem/thor#lib/thor/shell/basic.rb:322 def quiet?; end - # source://thor//lib/thor/shell/basic.rb#313 + # pkg:gem/thor#lib/thor/shell/basic.rb:313 def show_diff(destination, content); end - # source://thor//lib/thor/shell/basic.rb#282 + # pkg:gem/thor#lib/thor/shell/basic.rb:282 def stderr; end - # source://thor//lib/thor/shell/basic.rb#278 + # pkg:gem/thor#lib/thor/shell/basic.rb:278 def stdout; end - # @return [Boolean] - # - # source://thor//lib/thor/shell/basic.rb#328 + # pkg:gem/thor#lib/thor/shell/basic.rb:326 def unix?; end end # Inherit from Thor::Shell::Basic and add set_color behavior. Check # Thor::Shell::Basic to see all available methods. # -# source://thor//lib/thor/shell/color.rb#9 +# pkg:gem/thor#lib/thor/shell/color.rb:11 class Thor::Shell::Color < ::Thor::Shell::Basic include ::LCSDiff @@ -3788,142 +3315,130 @@ class Thor::Shell::Color < ::Thor::Shell::Basic # :on_cyan # :on_white # - # source://thor//lib/thor/shell/color.rb#82 + # pkg:gem/thor#lib/thor/shell/color.rb:84 def set_color(string, *colors); end protected - # @return [Boolean] - # - # source://thor//lib/thor/shell/color.rb#110 + # pkg:gem/thor#lib/thor/shell/color.rb:112 def are_colors_disabled?; end - # @return [Boolean] - # - # source://thor//lib/thor/shell/color.rb#106 + # pkg:gem/thor#lib/thor/shell/color.rb:108 def are_colors_supported?; end - # @return [Boolean] - # - # source://thor//lib/thor/shell/color.rb#102 + # pkg:gem/thor#lib/thor/shell/color.rb:104 def can_display_colors?; end end # Set the terminal's foreground ANSI color to black. # -# source://thor//lib/thor/shell/color.rb#18 +# pkg:gem/thor#lib/thor/shell/color.rb:20 Thor::Shell::Color::BLACK = T.let(T.unsafe(nil), String) # Set the terminal's foreground ANSI color to blue. # -# source://thor//lib/thor/shell/color.rb#26 +# pkg:gem/thor#lib/thor/shell/color.rb:28 Thor::Shell::Color::BLUE = T.let(T.unsafe(nil), String) # The start of an ANSI bold sequence. # -# source://thor//lib/thor/shell/color.rb#15 +# pkg:gem/thor#lib/thor/shell/color.rb:17 Thor::Shell::Color::BOLD = T.let(T.unsafe(nil), String) # Embed in a String to clear all previous ANSI sequences. # -# source://thor//lib/thor/shell/color.rb#13 +# pkg:gem/thor#lib/thor/shell/color.rb:15 Thor::Shell::Color::CLEAR = T.let(T.unsafe(nil), String) # Set the terminal's foreground ANSI color to cyan. # -# source://thor//lib/thor/shell/color.rb#30 +# pkg:gem/thor#lib/thor/shell/color.rb:32 Thor::Shell::Color::CYAN = T.let(T.unsafe(nil), String) # Set the terminal's foreground ANSI color to green. # -# source://thor//lib/thor/shell/color.rb#22 +# pkg:gem/thor#lib/thor/shell/color.rb:24 Thor::Shell::Color::GREEN = T.let(T.unsafe(nil), String) # Set the terminal's foreground ANSI color to magenta. # -# source://thor//lib/thor/shell/color.rb#28 +# pkg:gem/thor#lib/thor/shell/color.rb:30 Thor::Shell::Color::MAGENTA = T.let(T.unsafe(nil), String) # Set the terminal's background ANSI color to black. # -# source://thor//lib/thor/shell/color.rb#35 +# pkg:gem/thor#lib/thor/shell/color.rb:37 Thor::Shell::Color::ON_BLACK = T.let(T.unsafe(nil), String) # Set the terminal's background ANSI color to blue. # -# source://thor//lib/thor/shell/color.rb#43 +# pkg:gem/thor#lib/thor/shell/color.rb:45 Thor::Shell::Color::ON_BLUE = T.let(T.unsafe(nil), String) # Set the terminal's background ANSI color to cyan. # -# source://thor//lib/thor/shell/color.rb#47 +# pkg:gem/thor#lib/thor/shell/color.rb:49 Thor::Shell::Color::ON_CYAN = T.let(T.unsafe(nil), String) # Set the terminal's background ANSI color to green. # -# source://thor//lib/thor/shell/color.rb#39 +# pkg:gem/thor#lib/thor/shell/color.rb:41 Thor::Shell::Color::ON_GREEN = T.let(T.unsafe(nil), String) # Set the terminal's background ANSI color to magenta. # -# source://thor//lib/thor/shell/color.rb#45 +# pkg:gem/thor#lib/thor/shell/color.rb:47 Thor::Shell::Color::ON_MAGENTA = T.let(T.unsafe(nil), String) # Set the terminal's background ANSI color to red. # -# source://thor//lib/thor/shell/color.rb#37 +# pkg:gem/thor#lib/thor/shell/color.rb:39 Thor::Shell::Color::ON_RED = T.let(T.unsafe(nil), String) # Set the terminal's background ANSI color to white. # -# source://thor//lib/thor/shell/color.rb#49 +# pkg:gem/thor#lib/thor/shell/color.rb:51 Thor::Shell::Color::ON_WHITE = T.let(T.unsafe(nil), String) # Set the terminal's background ANSI color to yellow. # -# source://thor//lib/thor/shell/color.rb#41 +# pkg:gem/thor#lib/thor/shell/color.rb:43 Thor::Shell::Color::ON_YELLOW = T.let(T.unsafe(nil), String) # Set the terminal's foreground ANSI color to red. # -# source://thor//lib/thor/shell/color.rb#20 +# pkg:gem/thor#lib/thor/shell/color.rb:22 Thor::Shell::Color::RED = T.let(T.unsafe(nil), String) # Set the terminal's foreground ANSI color to white. # -# source://thor//lib/thor/shell/color.rb#32 +# pkg:gem/thor#lib/thor/shell/color.rb:34 Thor::Shell::Color::WHITE = T.let(T.unsafe(nil), String) # Set the terminal's foreground ANSI color to yellow. # -# source://thor//lib/thor/shell/color.rb#24 +# pkg:gem/thor#lib/thor/shell/color.rb:26 Thor::Shell::Color::YELLOW = T.let(T.unsafe(nil), String) -# source://thor//lib/thor/shell/column_printer.rb#5 +# pkg:gem/thor#lib/thor/shell/column_printer.rb:5 class Thor::Shell::ColumnPrinter - # @return [ColumnPrinter] a new instance of ColumnPrinter - # - # source://thor//lib/thor/shell/column_printer.rb#8 + # pkg:gem/thor#lib/thor/shell/column_printer.rb:8 def initialize(stdout, options = T.unsafe(nil)); end - # Returns the value of attribute options. - # - # source://thor//lib/thor/shell/column_printer.rb#6 + # pkg:gem/thor#lib/thor/shell/column_printer.rb:6 def options; end - # source://thor//lib/thor/shell/column_printer.rb#14 + # pkg:gem/thor#lib/thor/shell/column_printer.rb:14 def print(array); end - # Returns the value of attribute stdout. - # - # source://thor//lib/thor/shell/column_printer.rb#6 + # pkg:gem/thor#lib/thor/shell/column_printer.rb:6 def stdout; end end # Inherit from Thor::Shell::Basic and add set_color behavior. Check # Thor::Shell::Basic to see all available methods. # -# source://thor//lib/thor/shell/html.rb#9 +# pkg:gem/thor#lib/thor/shell/html.rb:9 class Thor::Shell::HTML < ::Thor::Shell::Basic include ::LCSDiff @@ -3934,9 +3449,7 @@ class Thor::Shell::HTML < ::Thor::Shell::Basic # # TODO: Implement #ask for Thor::Shell::HTML # - # @raise [NotImplementedError] - # - # source://thor//lib/thor/shell/html.rb#73 + # pkg:gem/thor#lib/thor/shell/html.rb:73 def ask(statement, color = T.unsafe(nil)); end # Set color by using a string or one of the defined constants. If a third @@ -3944,262 +3457,242 @@ class Thor::Shell::HTML < ::Thor::Shell::Basic # on Highline implementation and it automatically appends CLEAR to the end # of the returned String. # - # source://thor//lib/thor/shell/html.rb#54 + # pkg:gem/thor#lib/thor/shell/html.rb:54 def set_color(string, *colors); end protected - # @return [Boolean] - # - # source://thor//lib/thor/shell/html.rb#79 + # pkg:gem/thor#lib/thor/shell/html.rb:79 def can_display_colors?; end end # Set the terminal's foreground HTML color to black. # -# source://thor//lib/thor/shell/html.rb#16 +# pkg:gem/thor#lib/thor/shell/html.rb:16 Thor::Shell::HTML::BLACK = T.let(T.unsafe(nil), String) # Set the terminal's foreground HTML color to blue. # -# source://thor//lib/thor/shell/html.rb#24 +# pkg:gem/thor#lib/thor/shell/html.rb:24 Thor::Shell::HTML::BLUE = T.let(T.unsafe(nil), String) # The start of an HTML bold sequence. # -# source://thor//lib/thor/shell/html.rb#13 +# pkg:gem/thor#lib/thor/shell/html.rb:13 Thor::Shell::HTML::BOLD = T.let(T.unsafe(nil), String) # Set the terminal's foreground HTML color to cyan. # -# source://thor//lib/thor/shell/html.rb#28 +# pkg:gem/thor#lib/thor/shell/html.rb:28 Thor::Shell::HTML::CYAN = T.let(T.unsafe(nil), String) # Set the terminal's foreground HTML color to green. # -# source://thor//lib/thor/shell/html.rb#20 +# pkg:gem/thor#lib/thor/shell/html.rb:20 Thor::Shell::HTML::GREEN = T.let(T.unsafe(nil), String) # Set the terminal's foreground HTML color to magenta. # -# source://thor//lib/thor/shell/html.rb#26 +# pkg:gem/thor#lib/thor/shell/html.rb:26 Thor::Shell::HTML::MAGENTA = T.let(T.unsafe(nil), String) # Set the terminal's background HTML color to black. # -# source://thor//lib/thor/shell/html.rb#33 +# pkg:gem/thor#lib/thor/shell/html.rb:33 Thor::Shell::HTML::ON_BLACK = T.let(T.unsafe(nil), String) # Set the terminal's background HTML color to blue. # -# source://thor//lib/thor/shell/html.rb#41 +# pkg:gem/thor#lib/thor/shell/html.rb:41 Thor::Shell::HTML::ON_BLUE = T.let(T.unsafe(nil), String) # Set the terminal's background HTML color to cyan. # -# source://thor//lib/thor/shell/html.rb#45 +# pkg:gem/thor#lib/thor/shell/html.rb:45 Thor::Shell::HTML::ON_CYAN = T.let(T.unsafe(nil), String) # Set the terminal's background HTML color to green. # -# source://thor//lib/thor/shell/html.rb#37 +# pkg:gem/thor#lib/thor/shell/html.rb:37 Thor::Shell::HTML::ON_GREEN = T.let(T.unsafe(nil), String) # Set the terminal's background HTML color to magenta. # -# source://thor//lib/thor/shell/html.rb#43 +# pkg:gem/thor#lib/thor/shell/html.rb:43 Thor::Shell::HTML::ON_MAGENTA = T.let(T.unsafe(nil), String) # Set the terminal's background HTML color to red. # -# source://thor//lib/thor/shell/html.rb#35 +# pkg:gem/thor#lib/thor/shell/html.rb:35 Thor::Shell::HTML::ON_RED = T.let(T.unsafe(nil), String) # Set the terminal's background HTML color to white. # -# source://thor//lib/thor/shell/html.rb#47 +# pkg:gem/thor#lib/thor/shell/html.rb:47 Thor::Shell::HTML::ON_WHITE = T.let(T.unsafe(nil), String) # Set the terminal's background HTML color to yellow. # -# source://thor//lib/thor/shell/html.rb#39 +# pkg:gem/thor#lib/thor/shell/html.rb:39 Thor::Shell::HTML::ON_YELLOW = T.let(T.unsafe(nil), String) # Set the terminal's foreground HTML color to red. # -# source://thor//lib/thor/shell/html.rb#18 +# pkg:gem/thor#lib/thor/shell/html.rb:18 Thor::Shell::HTML::RED = T.let(T.unsafe(nil), String) # Set the terminal's foreground HTML color to white. # -# source://thor//lib/thor/shell/html.rb#30 +# pkg:gem/thor#lib/thor/shell/html.rb:30 Thor::Shell::HTML::WHITE = T.let(T.unsafe(nil), String) # Set the terminal's foreground HTML color to yellow. # -# source://thor//lib/thor/shell/html.rb#22 +# pkg:gem/thor#lib/thor/shell/html.rb:22 Thor::Shell::HTML::YELLOW = T.let(T.unsafe(nil), String) -# source://thor//lib/thor/shell.rb#24 +# pkg:gem/thor#lib/thor/shell.rb:24 Thor::Shell::SHELL_DELEGATED_METHODS = T.let(T.unsafe(nil), Array) -# source://thor//lib/thor/shell/table_printer.rb#6 +# pkg:gem/thor#lib/thor/shell/table_printer.rb:6 class Thor::Shell::TablePrinter < ::Thor::Shell::ColumnPrinter - # @return [TablePrinter] a new instance of TablePrinter - # - # source://thor//lib/thor/shell/table_printer.rb#9 + # pkg:gem/thor#lib/thor/shell/table_printer.rb:9 def initialize(stdout, options = T.unsafe(nil)); end - # source://thor//lib/thor/shell/table_printer.rb#18 + # pkg:gem/thor#lib/thor/shell/table_printer.rb:18 def print(array); end private - # source://thor//lib/thor/shell/table_printer.rb#72 + # pkg:gem/thor#lib/thor/shell/table_printer.rb:72 def format_cell(column, row_size, index); end - # source://thor//lib/thor/shell/table_printer.rb#113 + # pkg:gem/thor#lib/thor/shell/table_printer.rb:113 def indentation; end - # source://thor//lib/thor/shell/table_printer.rb#47 + # pkg:gem/thor#lib/thor/shell/table_printer.rb:47 def prepare(array); end - # source://thor//lib/thor/shell/table_printer.rb#96 + # pkg:gem/thor#lib/thor/shell/table_printer.rb:96 def print_border_separator; end - # source://thor//lib/thor/shell/table_printer.rb#103 + # pkg:gem/thor#lib/thor/shell/table_printer.rb:103 def truncate(string); end end -# source://thor//lib/thor/shell/table_printer.rb#7 +# pkg:gem/thor#lib/thor/shell/table_printer.rb:7 Thor::Shell::TablePrinter::BORDER_SEPARATOR = T.let(T.unsafe(nil), Symbol) -# source://thor//lib/thor/shell/terminal.rb#3 +# pkg:gem/thor#lib/thor/shell/terminal.rb:3 module Thor::Shell::Terminal class << self - # source://thor//lib/thor/shell/terminal.rb#9 + # This code was copied from Rake, available under MIT-LICENSE + # Copyright (c) 2003, 2004 Jim Weirich + # + # pkg:gem/thor#lib/thor/shell/terminal.rb:9 def terminal_width; end - # @return [Boolean] - # - # source://thor//lib/thor/shell/terminal.rb#20 + # pkg:gem/thor#lib/thor/shell/terminal.rb:20 def unix?; end private # Calculate the dynamic width of the terminal # - # source://thor//lib/thor/shell/terminal.rb#27 + # pkg:gem/thor#lib/thor/shell/terminal.rb:27 def dynamic_width; end - # source://thor//lib/thor/shell/terminal.rb#31 + # pkg:gem/thor#lib/thor/shell/terminal.rb:31 def dynamic_width_stty; end - # source://thor//lib/thor/shell/terminal.rb#35 + # pkg:gem/thor#lib/thor/shell/terminal.rb:35 def dynamic_width_tput; end end end -# source://thor//lib/thor/shell/terminal.rb#4 +# pkg:gem/thor#lib/thor/shell/terminal.rb:4 Thor::Shell::Terminal::DEFAULT_TERMINAL_WIDTH = T.let(T.unsafe(nil), Integer) -# source://thor//lib/thor/shell/wrapped_printer.rb#6 +# pkg:gem/thor#lib/thor/shell/wrapped_printer.rb:6 class Thor::Shell::WrappedPrinter < ::Thor::Shell::ColumnPrinter - # source://thor//lib/thor/shell/wrapped_printer.rb#7 + # pkg:gem/thor#lib/thor/shell/wrapped_printer.rb:7 def print(message); end end -# source://thor//lib/thor/base.rb#23 +# pkg:gem/thor#lib/thor/base.rb:24 Thor::TEMPLATE_EXTNAME = T.let(T.unsafe(nil), String) # Thor methods that should not be overwritten by the user. # -# source://thor//lib/thor/base.rb#20 +# pkg:gem/thor#lib/thor/base.rb:21 Thor::THOR_RESERVED_WORDS = T.let(T.unsafe(nil), Array) -# source://thor//lib/thor/command.rb#126 +# pkg:gem/thor#lib/thor/base.rb:18 +Thor::TREE_MAPPINGS = T.let(T.unsafe(nil), Array) + +# pkg:gem/thor#lib/thor/command.rb:126 Thor::Task = Thor::Command # Raised when a command was not found. # -# source://thor//lib/thor/error.rb#24 +# pkg:gem/thor#lib/thor/error.rb:24 class Thor::UndefinedCommandError < ::Thor::Error include ::Thor::Correctable - # @return [UndefinedCommandError] a new instance of UndefinedCommandError - # - # source://thor//lib/thor/error.rb#43 + # pkg:gem/thor#lib/thor/error.rb:43 def initialize(command, all_commands, namespace); end - # Returns the value of attribute all_commands. - # - # source://thor//lib/thor/error.rb#41 + # pkg:gem/thor#lib/thor/error.rb:41 def all_commands; end - # Returns the value of attribute command. - # - # source://thor//lib/thor/error.rb#41 + # pkg:gem/thor#lib/thor/error.rb:41 def command; end end -# source://thor//lib/thor/error.rb#25 +# pkg:gem/thor#lib/thor/error.rb:25 class Thor::UndefinedCommandError::SpellChecker - # @return [SpellChecker] a new instance of SpellChecker - # - # source://thor//lib/thor/error.rb#28 + # pkg:gem/thor#lib/thor/error.rb:28 def initialize(error); end - # source://thor//lib/thor/error.rb#32 + # pkg:gem/thor#lib/thor/error.rb:32 def corrections; end - # Returns the value of attribute error. - # - # source://thor//lib/thor/error.rb#26 + # pkg:gem/thor#lib/thor/error.rb:26 def error; end - # source://thor//lib/thor/error.rb#36 + # pkg:gem/thor#lib/thor/error.rb:36 def spell_checker; end end -# source://thor//lib/thor/error.rb#55 +# pkg:gem/thor#lib/thor/error.rb:55 Thor::UndefinedTaskError = Thor::UndefinedCommandError -# source://thor//lib/thor/error.rb#65 +# pkg:gem/thor#lib/thor/error.rb:65 class Thor::UnknownArgumentError < ::Thor::Error include ::Thor::Correctable - # @return [UnknownArgumentError] a new instance of UnknownArgumentError - # - # source://thor//lib/thor/error.rb#85 + # pkg:gem/thor#lib/thor/error.rb:85 def initialize(switches, unknown); end - # Returns the value of attribute switches. - # - # source://thor//lib/thor/error.rb#83 + # pkg:gem/thor#lib/thor/error.rb:83 def switches; end - # Returns the value of attribute unknown. - # - # source://thor//lib/thor/error.rb#83 + # pkg:gem/thor#lib/thor/error.rb:83 def unknown; end end -# source://thor//lib/thor/error.rb#66 +# pkg:gem/thor#lib/thor/error.rb:66 class Thor::UnknownArgumentError::SpellChecker - # @return [SpellChecker] a new instance of SpellChecker - # - # source://thor//lib/thor/error.rb#69 + # pkg:gem/thor#lib/thor/error.rb:69 def initialize(error); end - # source://thor//lib/thor/error.rb#73 + # pkg:gem/thor#lib/thor/error.rb:73 def corrections; end - # Returns the value of attribute error. - # - # source://thor//lib/thor/error.rb#67 + # pkg:gem/thor#lib/thor/error.rb:67 def error; end - # source://thor//lib/thor/error.rb#78 + # pkg:gem/thor#lib/thor/error.rb:78 def spell_checker; end end @@ -4213,7 +3706,7 @@ end # # Thor::Util.load_thorfile("~/.thor/foo") # -# source://thor//lib/thor/util.rb#17 +# pkg:gem/thor#lib/thor/util.rb:17 module Thor::Util class << self # Receives a string and convert it to camel case. camel_case returns CamelCase. @@ -4224,7 +3717,7 @@ module Thor::Util # ==== Returns # String # - # source://thor//lib/thor/util.rb#104 + # pkg:gem/thor#lib/thor/util.rb:104 def camel_case(str); end # Returns a string that has had any glob characters escaped. @@ -4240,7 +3733,7 @@ module Thor::Util # ==== Returns # String # - # source://thor//lib/thor/util.rb#264 + # pkg:gem/thor#lib/thor/util.rb:264 def escape_globs(path); end # Returns a string that has had any HTML characters escaped. @@ -4255,7 +3748,7 @@ module Thor::Util # ==== Returns # String # - # source://thor//lib/thor/util.rb#280 + # pkg:gem/thor#lib/thor/util.rb:280 def escape_html(string); end # Receives a namespace and search for it in the Thor::Base subclasses. @@ -4263,7 +3756,7 @@ module Thor::Util # ==== Parameters # namespace<String>:: The namespace to search for. # - # source://thor//lib/thor/util.rb#24 + # pkg:gem/thor#lib/thor/util.rb:24 def find_by_namespace(namespace); end # Receives a namespace and tries to retrieve a Thor or Thor::Group class @@ -4288,43 +3781,21 @@ module Thor::Util # ==== Parameters # namespace<String> # - # source://thor//lib/thor/util.rb#131 + # pkg:gem/thor#lib/thor/util.rb:131 def find_class_and_command_by_namespace(namespace, fallback = T.unsafe(nil)); end - # Receives a namespace and tries to retrieve a Thor or Thor::Group class - # from it. It first searches for a class using the all the given namespace, - # if it's not found, removes the highest entry and searches for the class - # again. If found, returns the highest entry as the class name. - # - # ==== Examples - # - # class Foo::Bar < Thor - # def baz - # end - # end - # - # class Baz::Foo < Thor::Group - # end - # - # Thor::Util.namespace_to_thor_class("foo:bar") #=> Foo::Bar, nil # will invoke default command - # Thor::Util.namespace_to_thor_class("baz:foo") #=> Baz::Foo, nil - # Thor::Util.namespace_to_thor_class("foo:bar:baz") #=> Foo::Bar, "baz" - # - # ==== Parameters - # namespace<String> - # - # source://thor//lib/thor/util.rb#131 + # pkg:gem/thor#lib/thor/util.rb:148 def find_class_and_task_by_namespace(namespace, fallback = T.unsafe(nil)); end # Where to look for Thor files. # - # source://thor//lib/thor/util.rb#213 + # pkg:gem/thor#lib/thor/util.rb:213 def globs_for(path); end # Receives a path and load the thor file in the path. The file is evaluated # inside the sandbox to avoid namespacing conflicts. # - # source://thor//lib/thor/util.rb#153 + # pkg:gem/thor#lib/thor/util.rb:153 def load_thorfile(path, content = T.unsafe(nil), debug = T.unsafe(nil)); end # Receives a constant and converts it to a Thor namespace. Since Thor @@ -4341,7 +3812,7 @@ module Thor::Util # ==== Returns # String:: If we receive Foo::Bar::Baz it returns "foo:bar:baz" # - # source://thor//lib/thor/util.rb#43 + # pkg:gem/thor#lib/thor/util.rb:43 def namespace_from_thor_class(constant); end # Given the contents, evaluate it inside the sandbox and returns the @@ -4353,13 +3824,13 @@ module Thor::Util # ==== Returns # Array[Object] # - # source://thor//lib/thor/util.rb#58 + # pkg:gem/thor#lib/thor/util.rb:58 def namespaces_in_content(contents, file = T.unsafe(nil)); end # Return the path to the ruby interpreter taking into account multiple # installations and windows extensions. # - # source://thor//lib/thor/util.rb#221 + # pkg:gem/thor#lib/thor/util.rb:221 def ruby_command; end # Receives a string and convert it to snake case. SnakeCase returns snake_case. @@ -4370,17 +3841,17 @@ module Thor::Util # ==== Returns # String # - # source://thor//lib/thor/util.rb#90 + # pkg:gem/thor#lib/thor/util.rb:90 def snake_case(str); end # Returns the thor classes declared inside the given class. # - # source://thor//lib/thor/util.rb#74 + # pkg:gem/thor#lib/thor/util.rb:74 def thor_classes_in(klass); end # Returns the root where thor files are located, depending on the OS. # - # source://thor//lib/thor/util.rb#192 + # pkg:gem/thor#lib/thor/util.rb:192 def thor_root; end # Returns the files in the thor root. On Windows thor_root will be something @@ -4390,10 +3861,10 @@ module Thor::Util # # If we don't #gsub the \ character, Dir.glob will fail. # - # source://thor//lib/thor/util.rb#203 + # pkg:gem/thor#lib/thor/util.rb:203 def thor_root_glob; end - # source://thor//lib/thor/util.rb#168 + # pkg:gem/thor#lib/thor/util.rb:168 def user_home; end end end diff --git a/sorbet/rbi/gems/tsort@0.2.0.rbi b/sorbet/rbi/gems/tsort@0.2.0.rbi new file mode 100644 index 0000000..a60ab54 --- /dev/null +++ b/sorbet/rbi/gems/tsort@0.2.0.rbi @@ -0,0 +1,389 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `tsort` gem. +# Please instead update this file by running `bin/tapioca gem tsort`. + + +# TSort implements topological sorting using Tarjan's algorithm for +# strongly connected components. +# +# TSort is designed to be able to be used with any object which can be +# interpreted as a directed graph. +# +# TSort requires two methods to interpret an object as a graph, +# tsort_each_node and tsort_each_child. +# +# * tsort_each_node is used to iterate for all nodes over a graph. +# * tsort_each_child is used to iterate for child nodes of a given node. +# +# The equality of nodes are defined by eql? and hash since +# TSort uses Hash internally. +# +# == A Simple Example +# +# The following example demonstrates how to mix the TSort module into an +# existing class (in this case, Hash). Here, we're treating each key in +# the hash as a node in the graph, and so we simply alias the required +# #tsort_each_node method to Hash's #each_key method. For each key in the +# hash, the associated value is an array of the node's child nodes. This +# choice in turn leads to our implementation of the required #tsort_each_child +# method, which fetches the array of child nodes and then iterates over that +# array using the user-supplied block. +# +# require 'tsort' +# +# class Hash +# include TSort +# alias tsort_each_node each_key +# def tsort_each_child(node, &block) +# fetch(node).each(&block) +# end +# end +# +# {1=>[2, 3], 2=>[3], 3=>[], 4=>[]}.tsort +# #=> [3, 2, 1, 4] +# +# {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}.strongly_connected_components +# #=> [[4], [2, 3], [1]] +# +# == A More Realistic Example +# +# A very simple `make' like tool can be implemented as follows: +# +# require 'tsort' +# +# class Make +# def initialize +# @dep = {} +# @dep.default = [] +# end +# +# def rule(outputs, inputs=[], &block) +# triple = [outputs, inputs, block] +# outputs.each {|f| @dep[f] = [triple]} +# @dep[triple] = inputs +# end +# +# def build(target) +# each_strongly_connected_component_from(target) {|ns| +# if ns.length != 1 +# fs = ns.delete_if {|n| Array === n} +# raise TSort::Cyclic.new("cyclic dependencies: #{fs.join ', '}") +# end +# n = ns.first +# if Array === n +# outputs, inputs, block = n +# inputs_time = inputs.map {|f| File.mtime f}.max +# begin +# outputs_time = outputs.map {|f| File.mtime f}.min +# rescue Errno::ENOENT +# outputs_time = nil +# end +# if outputs_time == nil || +# inputs_time != nil && outputs_time <= inputs_time +# sleep 1 if inputs_time != nil && inputs_time.to_i == Time.now.to_i +# block.call +# end +# end +# } +# end +# +# def tsort_each_child(node, &block) +# @dep[node].each(&block) +# end +# include TSort +# end +# +# def command(arg) +# print arg, "\n" +# system arg +# end +# +# m = Make.new +# m.rule(%w[t1]) { command 'date > t1' } +# m.rule(%w[t2]) { command 'date > t2' } +# m.rule(%w[t3]) { command 'date > t3' } +# m.rule(%w[t4], %w[t1 t3]) { command 'cat t1 t3 > t4' } +# m.rule(%w[t5], %w[t4 t2]) { command 'cat t4 t2 > t5' } +# m.build('t5') +# +# == Bugs +# +# * 'tsort.rb' is wrong name because this library uses +# Tarjan's algorithm for strongly connected components. +# Although 'strongly_connected_components.rb' is correct but too long. +# +# == References +# +# R. E. Tarjan, "Depth First Search and Linear Graph Algorithms", +# <em>SIAM Journal on Computing</em>, Vol. 1, No. 2, pp. 146-160, June 1972. +# +# pkg:gem/tsort#lib/tsort.rb:124 +module TSort + # The iterator version of the #strongly_connected_components method. + # <tt><em>obj</em>.each_strongly_connected_component</tt> is similar to + # <tt><em>obj</em>.strongly_connected_components.each</tt>, but + # modification of _obj_ during the iteration may lead to unexpected results. + # + # #each_strongly_connected_component returns +nil+. + # + # class G + # include TSort + # def initialize(g) + # @g = g + # end + # def tsort_each_child(n, &b) @g[n].each(&b) end + # def tsort_each_node(&b) @g.each_key(&b) end + # end + # + # graph = G.new({1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}) + # graph.each_strongly_connected_component {|scc| p scc } + # #=> [4] + # # [2] + # # [3] + # # [1] + # + # graph = G.new({1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}) + # graph.each_strongly_connected_component {|scc| p scc } + # #=> [4] + # # [2, 3] + # # [1] + # + # pkg:gem/tsort#lib/tsort.rb:316 + def each_strongly_connected_component(&block); end + + # Iterates over strongly connected component in the subgraph reachable from + # _node_. + # + # Return value is unspecified. + # + # #each_strongly_connected_component_from doesn't call #tsort_each_node. + # + # class G + # include TSort + # def initialize(g) + # @g = g + # end + # def tsort_each_child(n, &b) @g[n].each(&b) end + # def tsort_each_node(&b) @g.each_key(&b) end + # end + # + # graph = G.new({1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}) + # graph.each_strongly_connected_component_from(2) {|scc| p scc } + # #=> [4] + # # [2] + # + # graph = G.new({1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}) + # graph.each_strongly_connected_component_from(2) {|scc| p scc } + # #=> [4] + # # [2, 3] + # + # pkg:gem/tsort#lib/tsort.rb:386 + def each_strongly_connected_component_from(node, id_map = T.unsafe(nil), stack = T.unsafe(nil), &block); end + + # Returns strongly connected components as an array of arrays of nodes. + # The array is sorted from children to parents. + # Each elements of the array represents a strongly connected component. + # + # class G + # include TSort + # def initialize(g) + # @g = g + # end + # def tsort_each_child(n, &b) @g[n].each(&b) end + # def tsort_each_node(&b) @g.each_key(&b) end + # end + # + # graph = G.new({1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}) + # p graph.strongly_connected_components #=> [[4], [2], [3], [1]] + # + # graph = G.new({1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}) + # p graph.strongly_connected_components #=> [[4], [2, 3], [1]] + # + # pkg:gem/tsort#lib/tsort.rb:257 + def strongly_connected_components; end + + # Returns a topologically sorted array of nodes. + # The array is sorted from children to parents, i.e. + # the first element has no child and the last node has no parent. + # + # If there is a cycle, TSort::Cyclic is raised. + # + # class G + # include TSort + # def initialize(g) + # @g = g + # end + # def tsort_each_child(n, &b) @g[n].each(&b) end + # def tsort_each_node(&b) @g.each_key(&b) end + # end + # + # graph = G.new({1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}) + # p graph.tsort #=> [4, 2, 3, 1] + # + # graph = G.new({1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}) + # p graph.tsort # raises TSort::Cyclic + # + # pkg:gem/tsort#lib/tsort.rb:152 + def tsort; end + + # The iterator version of the #tsort method. + # <tt><em>obj</em>.tsort_each</tt> is similar to <tt><em>obj</em>.tsort.each</tt>, but + # modification of _obj_ during the iteration may lead to unexpected results. + # + # #tsort_each returns +nil+. + # If there is a cycle, TSort::Cyclic is raised. + # + # class G + # include TSort + # def initialize(g) + # @g = g + # end + # def tsort_each_child(n, &b) @g[n].each(&b) end + # def tsort_each_node(&b) @g.each_key(&b) end + # end + # + # graph = G.new({1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}) + # graph.tsort_each {|n| p n } + # #=> 4 + # # 2 + # # 3 + # # 1 + # + # pkg:gem/tsort#lib/tsort.rb:205 + def tsort_each(&block); end + + # Should be implemented by a extended class. + # + # #tsort_each_child is used to iterate for child nodes of _node_. + # + # pkg:gem/tsort#lib/tsort.rb:452 + def tsort_each_child(node); end + + # Should be implemented by a extended class. + # + # #tsort_each_node is used to iterate for all nodes over a graph. + # + # pkg:gem/tsort#lib/tsort.rb:444 + def tsort_each_node; end + + class << self + # The iterator version of the TSort.strongly_connected_components method. + # + # The graph is represented by _each_node_ and _each_child_. + # _each_node_ should have +call+ method which yields for each node in the graph. + # _each_child_ should have +call+ method which takes a node argument and yields for each child node. + # + # g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]} + # each_node = lambda {|&b| g.each_key(&b) } + # each_child = lambda {|n, &b| g[n].each(&b) } + # TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc } + # #=> [4] + # # [2] + # # [3] + # # [1] + # + # g = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]} + # each_node = lambda {|&b| g.each_key(&b) } + # each_child = lambda {|n, &b| g[n].each(&b) } + # TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc } + # #=> [4] + # # [2, 3] + # # [1] + # + # pkg:gem/tsort#lib/tsort.rb:345 + def each_strongly_connected_component(each_node, each_child); end + + # Iterates over strongly connected components in a graph. + # The graph is represented by _node_ and _each_child_. + # + # _node_ is the first node. + # _each_child_ should have +call+ method which takes a node argument + # and yields for each child node. + # + # Return value is unspecified. + # + # #TSort.each_strongly_connected_component_from is a class method and + # it doesn't need a class to represent a graph which includes TSort. + # + # graph = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]} + # each_child = lambda {|n, &b| graph[n].each(&b) } + # TSort.each_strongly_connected_component_from(1, each_child) {|scc| + # p scc + # } + # #=> [4] + # # [2, 3] + # # [1] + # + # pkg:gem/tsort#lib/tsort.rb:411 + def each_strongly_connected_component_from(node, each_child, id_map = T.unsafe(nil), stack = T.unsafe(nil)); end + + # Returns strongly connected components as an array of arrays of nodes. + # The array is sorted from children to parents. + # Each elements of the array represents a strongly connected component. + # + # The graph is represented by _each_node_ and _each_child_. + # _each_node_ should have +call+ method which yields for each node in the graph. + # _each_child_ should have +call+ method which takes a node argument and yields for each child node. + # + # g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]} + # each_node = lambda {|&b| g.each_key(&b) } + # each_child = lambda {|n, &b| g[n].each(&b) } + # p TSort.strongly_connected_components(each_node, each_child) + # #=> [[4], [2], [3], [1]] + # + # g = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]} + # each_node = lambda {|&b| g.each_key(&b) } + # each_child = lambda {|n, &b| g[n].each(&b) } + # p TSort.strongly_connected_components(each_node, each_child) + # #=> [[4], [2, 3], [1]] + # + # pkg:gem/tsort#lib/tsort.rb:283 + def strongly_connected_components(each_node, each_child); end + + # Returns a topologically sorted array of nodes. + # The array is sorted from children to parents, i.e. + # the first element has no child and the last node has no parent. + # + # The graph is represented by _each_node_ and _each_child_. + # _each_node_ should have +call+ method which yields for each node in the graph. + # _each_child_ should have +call+ method which takes a node argument and yields for each child node. + # + # If there is a cycle, TSort::Cyclic is raised. + # + # g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]} + # each_node = lambda {|&b| g.each_key(&b) } + # each_child = lambda {|n, &b| g[n].each(&b) } + # p TSort.tsort(each_node, each_child) #=> [4, 2, 3, 1] + # + # g = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]} + # each_node = lambda {|&b| g.each_key(&b) } + # each_child = lambda {|n, &b| g[n].each(&b) } + # p TSort.tsort(each_node, each_child) # raises TSort::Cyclic + # + # pkg:gem/tsort#lib/tsort.rb:178 + def tsort(each_node, each_child); end + + # The iterator version of the TSort.tsort method. + # + # The graph is represented by _each_node_ and _each_child_. + # _each_node_ should have +call+ method which yields for each node in the graph. + # _each_child_ should have +call+ method which takes a node argument and yields for each child node. + # + # g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]} + # each_node = lambda {|&b| g.each_key(&b) } + # each_child = lambda {|n, &b| g[n].each(&b) } + # TSort.tsort_each(each_node, each_child) {|n| p n } + # #=> 4 + # # 2 + # # 3 + # # 1 + # + # pkg:gem/tsort#lib/tsort.rb:226 + def tsort_each(each_node, each_child); end + end +end + +# pkg:gem/tsort#lib/tsort.rb:126 +TSort::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/unicode-emoji@4.1.0.rbi b/sorbet/rbi/gems/unicode-emoji@4.1.0.rbi deleted file mode 100644 index fcf0c22..0000000 --- a/sorbet/rbi/gems/unicode-emoji@4.1.0.rbi +++ /dev/null @@ -1,251 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `unicode-emoji` gem. -# Please instead update this file by running `bin/tapioca gem unicode-emoji`. - - -# This file was generated by a script, please do not edit it by hand. -# See `$ rake generate_constants` and data/generate_constants.rb for more info. -# -# source://unicode-emoji//lib/unicode/emoji/constants.rb#3 -module Unicode; end - -# source://unicode-emoji//lib/unicode/emoji/constants.rb#4 -module Unicode::Emoji - class << self - # Returns ordered list of Emoji, categorized in a three-level deep Hash structure - # - # source://unicode-emoji//lib/unicode/emoji.rb#80 - def list(key = T.unsafe(nil), sub_key = T.unsafe(nil)); end - - # Return Emoji properties of character as an Array or nil - # See PROPERTY_NAMES constant for possible properties - # - # Source: see https://www.unicode.org/Public/16.0.0/ucd/emoji/emoji-data.txt - # - # source://unicode-emoji//lib/unicode/emoji.rb#68 - def properties(char); end - - private - - # source://unicode-emoji//lib/unicode/emoji.rb#88 - def get_codepoint_value(char); end - end -end - -# Last codepoint of tag-based subdivision flags -# -# source://unicode-emoji//lib/unicode/emoji/constants.rb#31 -Unicode::Emoji::CANCEL_TAG = T.let(T.unsafe(nil), Integer) - -# source://unicode-emoji//lib/unicode/emoji/constants.rb#7 -Unicode::Emoji::CLDR_VERSION = T.let(T.unsafe(nil), String) - -# source://unicode-emoji//lib/unicode/emoji/constants.rb#8 -Unicode::Emoji::DATA_DIRECTORY = T.let(T.unsafe(nil), String) - -# The current list of codepoints with the "Emoji" property -# Same characters as \p{Emoji} -# (Emoji version of this gem might be more recent than Ruby's Emoji version) -# -# source://unicode-emoji//lib/unicode/emoji/lazy_constants.rb#8 -Unicode::Emoji::EMOJI_CHAR = T.let(T.unsafe(nil), Array) - -# The current list of codepoints with the "Emoji_Component" property -# Same characters as \p{Emoji Component} or \p{EComp} -# (Emoji version of this gem might be more recent than Ruby's Emoji version) -# -# source://unicode-emoji//lib/unicode/emoji/lazy_constants.rb#21 -Unicode::Emoji::EMOJI_COMPONENT = T.let(T.unsafe(nil), Array) - -# The list of characters that can be used as base for keycap sequences -# -# source://unicode-emoji//lib/unicode/emoji/lazy_constants.rb#42 -Unicode::Emoji::EMOJI_KEYCAPS = T.let(T.unsafe(nil), Array) - -# Combining Enclosing Keycap character -# -# source://unicode-emoji//lib/unicode/emoji/constants.rb#37 -Unicode::Emoji::EMOJI_KEYCAP_SUFFIX = T.let(T.unsafe(nil), Integer) - -# The current list of codepoints with the "Emoji_Modifier" property -# Same characters as \p{Emoji Modifier} or \p{EMod} -# (Emoji version of this gem might be more recent than Ruby's Emoji version) -# -# source://unicode-emoji//lib/unicode/emoji/lazy_constants.rb#31 -Unicode::Emoji::EMOJI_MODIFIERS = T.let(T.unsafe(nil), Array) - -# The current list of codepoints with the "Emoji_Modifier_Base" property -# Same characters as \p{Emoji Modifier Base} or \p{EBase} -# (Emoji version of this gem might be more recent than Ruby's Emoji version) -# -# source://unicode-emoji//lib/unicode/emoji/lazy_constants.rb#26 -Unicode::Emoji::EMOJI_MODIFIER_BASES = T.let(T.unsafe(nil), Array) - -# The current list of codepoints with the "Emoji_Presentation" property -# Same characters as \p{Emoji Presentation} or \p{EPres} -# (Emoji version of this gem might be more recent than Ruby's Emoji version) -# -# source://unicode-emoji//lib/unicode/emoji/lazy_constants.rb#13 -Unicode::Emoji::EMOJI_PRESENTATION = T.let(T.unsafe(nil), Array) - -# First codepoint of tag-based subdivision flags -# -# source://unicode-emoji//lib/unicode/emoji/constants.rb#28 -Unicode::Emoji::EMOJI_TAG_BASE_FLAG = T.let(T.unsafe(nil), Integer) - -# Variation Selector 16 (VS16), enables emoji presentation mode for preceding codepoint -# -# source://unicode-emoji//lib/unicode/emoji/constants.rb#22 -Unicode::Emoji::EMOJI_VARIATION_SELECTOR = T.let(T.unsafe(nil), Integer) - -# source://unicode-emoji//lib/unicode/emoji/constants.rb#6 -Unicode::Emoji::EMOJI_VERSION = T.let(T.unsafe(nil), String) - -# The current list of codepoints with the "Extended_Pictographic" property -# Same characters as \p{Extended Pictographic} or \p{ExtPict} -# (Emoji version of this gem might be more recent than Ruby's Emoji version) -# -# source://unicode-emoji//lib/unicode/emoji/lazy_constants.rb#36 -Unicode::Emoji::EXTENDED_PICTOGRAPHIC = T.let(T.unsafe(nil), Array) - -# The current list of codepoints with the "Extended_Pictographic" property that don't have the "Emoji" property -# -# source://unicode-emoji//lib/unicode/emoji/lazy_constants.rb#39 -Unicode::Emoji::EXTENDED_PICTOGRAPHIC_NO_EMOJI = T.let(T.unsafe(nil), Array) - -# source://unicode-emoji//lib/unicode/emoji/index.rb#11 -Unicode::Emoji::INDEX = T.let(T.unsafe(nil), Hash) - -# source://unicode-emoji//lib/unicode/emoji/constants.rb#9 -Unicode::Emoji::INDEX_FILENAME = T.let(T.unsafe(nil), String) - -# Contains an ordered and group list of all currently recommended Emoji (RGI/FQE) -# -# source://unicode-emoji//lib/unicode/emoji/list.rb#6 -Unicode::Emoji::LIST = T.let(T.unsafe(nil), Hash) - -# Sometimes, categories change, we issue a warning in these cases -# -# source://unicode-emoji//lib/unicode/emoji/list.rb#9 -Unicode::Emoji::LIST_REMOVED_KEYS = T.let(T.unsafe(nil), Array) - -# Unicode properties, see https://www.unicode.org/Public/16.0.0/ucd/emoji/emoji-data.txt -# -# source://unicode-emoji//lib/unicode/emoji/constants.rb#12 -Unicode::Emoji::PROPERTY_NAMES = T.let(T.unsafe(nil), Hash) - -# The list RGI tag sequence flags -# -# source://unicode-emoji//lib/unicode/emoji/lazy_constants.rb#51 -Unicode::Emoji::RECOMMENDED_SUBDIVISION_FLAGS = T.let(T.unsafe(nil), Array) - -# The list of fully-qualified RGI Emoji ZWJ sequences -# -# source://unicode-emoji//lib/unicode/emoji/lazy_constants.rb#54 -Unicode::Emoji::RECOMMENDED_ZWJ_SEQUENCES = T.let(T.unsafe(nil), Array) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex.rb#6 -Unicode::Emoji::REGEX = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_basic.rb#6 -Unicode::Emoji::REGEX_BASIC = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_emoji_keycap.rb#6 -Unicode::Emoji::REGEX_EMOJI_KEYCAP = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_include_mqe.rb#6 -Unicode::Emoji::REGEX_INCLUDE_MQE = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_include_mqe_uqe.rb#6 -Unicode::Emoji::REGEX_INCLUDE_MQE_UQE = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_include_text.rb#6 -Unicode::Emoji::REGEX_INCLUDE_TEXT = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_picto.rb#6 -Unicode::Emoji::REGEX_PICTO = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_picto_no_emoji.rb#6 -Unicode::Emoji::REGEX_PICTO_NO_EMOJI = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_possible.rb#6 -Unicode::Emoji::REGEX_POSSIBLE = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_prop_component.rb#6 -Unicode::Emoji::REGEX_PROP_COMPONENT = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_prop_emoji.rb#6 -Unicode::Emoji::REGEX_PROP_EMOJI = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_prop_modifier.rb#6 -Unicode::Emoji::REGEX_PROP_MODIFIER = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_prop_modifier_base.rb#6 -Unicode::Emoji::REGEX_PROP_MODIFIER_BASE = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_prop_presentation.rb#6 -Unicode::Emoji::REGEX_PROP_PRESENTATION = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_text.rb#6 -Unicode::Emoji::REGEX_TEXT = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_text_presentation.rb#6 -Unicode::Emoji::REGEX_TEXT_PRESENTATION = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_valid.rb#6 -Unicode::Emoji::REGEX_VALID = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_valid_include_text.rb#6 -Unicode::Emoji::REGEX_VALID_INCLUDE_TEXT = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_well_formed.rb#6 -Unicode::Emoji::REGEX_WELL_FORMED = T.let(T.unsafe(nil), Regexp) - -# source://unicode-emoji//lib/unicode/emoji/generated/regex_well_formed_include_text.rb#6 -Unicode::Emoji::REGEX_WELL_FORMED_INCLUDE_TEXT = T.let(T.unsafe(nil), Regexp) - -# Two regional indicators make up a region -# -# source://unicode-emoji//lib/unicode/emoji/constants.rb#43 -Unicode::Emoji::REGIONAL_INDICATORS = T.let(T.unsafe(nil), Array) - -# Tags characters allowed in tag-based subdivision flags -# -# source://unicode-emoji//lib/unicode/emoji/constants.rb#34 -Unicode::Emoji::SPEC_TAGS = T.let(T.unsafe(nil), Array) - -# The current list of codepoints with the "Emoji" property that lack the "Emoji Presentation" property -# -# source://unicode-emoji//lib/unicode/emoji/lazy_constants.rb#16 -Unicode::Emoji::TEXT_PRESENTATION = T.let(T.unsafe(nil), Array) - -# Variation Selector 15 (VS15), enables text presentation mode for preceding codepoint -# -# source://unicode-emoji//lib/unicode/emoji/constants.rb#25 -Unicode::Emoji::TEXT_VARIATION_SELECTOR = T.let(T.unsafe(nil), Integer) - -# The list of valid regions -# -# source://unicode-emoji//lib/unicode/emoji/lazy_constants.rb#45 -Unicode::Emoji::VALID_REGION_FLAGS = T.let(T.unsafe(nil), Array) - -# The list of valid subdivisions in regex character class syntax -# -# source://unicode-emoji//lib/unicode/emoji/lazy_constants.rb#48 -Unicode::Emoji::VALID_SUBDIVISIONS = T.let(T.unsafe(nil), Array) - -# source://unicode-emoji//lib/unicode/emoji/constants.rb#5 -Unicode::Emoji::VERSION = T.let(T.unsafe(nil), String) - -# The current list of Emoji components that should have a visual representation -# Currently skin tone modifiers + hair components -# -# source://unicode-emoji//lib/unicode/emoji/constants.rb#47 -Unicode::Emoji::VISUAL_COMPONENT = T.let(T.unsafe(nil), Array) - -# Zero-width-joiner to enable combination of multiple Emoji in a sequence -# -# source://unicode-emoji//lib/unicode/emoji/constants.rb#40 -Unicode::Emoji::ZWJ = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi b/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi new file mode 100644 index 0000000..032c8a2 --- /dev/null +++ b/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi @@ -0,0 +1,332 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `unicode-emoji` gem. +# Please instead update this file by running `bin/tapioca gem unicode-emoji`. + + +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# This file was generated by a script, please do not edit it by hand. +# See `$ rake generate_constants` and data/generate_constants.rb for more info. +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:3 +module Unicode; end + +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:4 +module Unicode::Emoji + class << self + # Returns ordered list of Emoji, categorized in a three-level deep Hash structure + # + # pkg:gem/unicode-emoji#lib/unicode/emoji.rb:80 + def list(key = T.unsafe(nil), sub_key = T.unsafe(nil)); end + + # Return Emoji properties of character as an Array or nil + # See PROPERTY_NAMES constant for possible properties + # + # Source: see https://www.unicode.org/Public/16.0.0/ucd/emoji/emoji-data.txt + # + # pkg:gem/unicode-emoji#lib/unicode/emoji.rb:68 + def properties(char); end + + private + + # pkg:gem/unicode-emoji#lib/unicode/emoji.rb:88 + def get_codepoint_value(char); end + end +end + +# Last codepoint of tag-based subdivision flags +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:32 +Unicode::Emoji::CANCEL_TAG = T.let(T.unsafe(nil), Integer) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:8 +Unicode::Emoji::CLDR_VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:9 +Unicode::Emoji::DATA_DIRECTORY = T.let(T.unsafe(nil), String) + +# The current list of codepoints with the "Emoji" property +# Same characters as \p{Emoji} +# (Emoji version of this gem might be more recent than Ruby's Emoji version) +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/lazy_constants.rb:8 +Unicode::Emoji::EMOJI_CHAR = T.let(T.unsafe(nil), Array) + +# The current list of codepoints with the "Emoji_Component" property +# Same characters as \p{Emoji Component} or \p{EComp} +# (Emoji version of this gem might be more recent than Ruby's Emoji version) +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/lazy_constants.rb:21 +Unicode::Emoji::EMOJI_COMPONENT = T.let(T.unsafe(nil), Array) + +# The list of characters that can be used as base for keycap sequences +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/lazy_constants.rb:42 +Unicode::Emoji::EMOJI_KEYCAPS = T.let(T.unsafe(nil), Array) + +# Combining Enclosing Keycap character +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:38 +Unicode::Emoji::EMOJI_KEYCAP_SUFFIX = T.let(T.unsafe(nil), Integer) + +# The current list of codepoints with the "Emoji_Modifier" property +# Same characters as \p{Emoji Modifier} or \p{EMod} +# (Emoji version of this gem might be more recent than Ruby's Emoji version) +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/lazy_constants.rb:31 +Unicode::Emoji::EMOJI_MODIFIERS = T.let(T.unsafe(nil), Array) + +# The current list of codepoints with the "Emoji_Modifier_Base" property +# Same characters as \p{Emoji Modifier Base} or \p{EBase} +# (Emoji version of this gem might be more recent than Ruby's Emoji version) +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/lazy_constants.rb:26 +Unicode::Emoji::EMOJI_MODIFIER_BASES = T.let(T.unsafe(nil), Array) + +# The current list of codepoints with the "Emoji_Presentation" property +# Same characters as \p{Emoji Presentation} or \p{EPres} +# (Emoji version of this gem might be more recent than Ruby's Emoji version) +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/lazy_constants.rb:13 +Unicode::Emoji::EMOJI_PRESENTATION = T.let(T.unsafe(nil), Array) + +# First codepoint of tag-based subdivision flags +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:29 +Unicode::Emoji::EMOJI_TAG_BASE_FLAG = T.let(T.unsafe(nil), Integer) + +# Variation Selector 16 (VS16), enables emoji presentation mode for preceding codepoint +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:23 +Unicode::Emoji::EMOJI_VARIATION_SELECTOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:6 +Unicode::Emoji::EMOJI_VERSION = T.let(T.unsafe(nil), String) + +# The current list of codepoints with the "Extended_Pictographic" property +# Same characters as \p{Extended Pictographic} or \p{ExtPict} +# (Emoji version of this gem might be more recent than Ruby's Emoji version) +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/lazy_constants.rb:36 +Unicode::Emoji::EXTENDED_PICTOGRAPHIC = T.let(T.unsafe(nil), Array) + +# The current list of codepoints with the "Extended_Pictographic" property that don't have the "Emoji" property +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/lazy_constants.rb:39 +Unicode::Emoji::EXTENDED_PICTOGRAPHIC_NO_EMOJI = T.let(T.unsafe(nil), Array) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/index.rb:11 +Unicode::Emoji::INDEX = T.let(T.unsafe(nil), Hash) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:10 +Unicode::Emoji::INDEX_FILENAME = T.let(T.unsafe(nil), String) + +# Contains an ordered and group list of all currently recommended Emoji (RGI/FQE) +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/list.rb:6 +Unicode::Emoji::LIST = T.let(T.unsafe(nil), Hash) + +# Sometimes, categories change, we issue a warning in these cases +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/list.rb:9 +Unicode::Emoji::LIST_REMOVED_KEYS = T.let(T.unsafe(nil), Array) + +# Unicode properties, see https://www.unicode.org/Public/16.0.0/ucd/emoji/emoji-data.txt +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:13 +Unicode::Emoji::PROPERTY_NAMES = T.let(T.unsafe(nil), Hash) + +# The list RGI tag sequence flags +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/lazy_constants.rb:51 +Unicode::Emoji::RECOMMENDED_SUBDIVISION_FLAGS = T.let(T.unsafe(nil), Array) + +# The list of fully-qualified RGI Emoji ZWJ sequences +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/lazy_constants.rb:54 +Unicode::Emoji::RECOMMENDED_ZWJ_SEQUENCES = T.let(T.unsafe(nil), Array) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex.rb:6 +Unicode::Emoji::REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_basic.rb:6 +Unicode::Emoji::REGEX_BASIC = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_emoji_keycap.rb:6 +Unicode::Emoji::REGEX_EMOJI_KEYCAP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_include_mqe.rb:6 +Unicode::Emoji::REGEX_INCLUDE_MQE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_include_mqe_uqe.rb:6 +Unicode::Emoji::REGEX_INCLUDE_MQE_UQE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_include_text.rb:6 +Unicode::Emoji::REGEX_INCLUDE_TEXT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_picto.rb:6 +Unicode::Emoji::REGEX_PICTO = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_picto_no_emoji.rb:6 +Unicode::Emoji::REGEX_PICTO_NO_EMOJI = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_possible.rb:6 +Unicode::Emoji::REGEX_POSSIBLE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_prop_component.rb:6 +Unicode::Emoji::REGEX_PROP_COMPONENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_prop_emoji.rb:6 +Unicode::Emoji::REGEX_PROP_EMOJI = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_prop_modifier.rb:6 +Unicode::Emoji::REGEX_PROP_MODIFIER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_prop_modifier_base.rb:6 +Unicode::Emoji::REGEX_PROP_MODIFIER_BASE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_prop_presentation.rb:6 +Unicode::Emoji::REGEX_PROP_PRESENTATION = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_text.rb:6 +Unicode::Emoji::REGEX_TEXT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_text_presentation.rb:6 +Unicode::Emoji::REGEX_TEXT_PRESENTATION = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_valid.rb:6 +Unicode::Emoji::REGEX_VALID = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_valid_include_text.rb:6 +Unicode::Emoji::REGEX_VALID_INCLUDE_TEXT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_well_formed.rb:6 +Unicode::Emoji::REGEX_WELL_FORMED = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/generated/regex_well_formed_include_text.rb:6 +Unicode::Emoji::REGEX_WELL_FORMED_INCLUDE_TEXT = T.let(T.unsafe(nil), Regexp) + +# Two regional indicators make up a region +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:44 +Unicode::Emoji::REGIONAL_INDICATORS = T.let(T.unsafe(nil), Array) + +# Tags characters allowed in tag-based subdivision flags +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:35 +Unicode::Emoji::SPEC_TAGS = T.let(T.unsafe(nil), Array) + +# The current list of codepoints with the "Emoji" property that lack the "Emoji Presentation" property +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/lazy_constants.rb:16 +Unicode::Emoji::TEXT_PRESENTATION = T.let(T.unsafe(nil), Array) + +# Variation Selector 15 (VS15), enables text presentation mode for preceding codepoint +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:26 +Unicode::Emoji::TEXT_VARIATION_SELECTOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:7 +Unicode::Emoji::UNICODE_VERSION = T.let(T.unsafe(nil), String) + +# The list of valid regions +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/lazy_constants.rb:45 +Unicode::Emoji::VALID_REGION_FLAGS = T.let(T.unsafe(nil), Array) + +# The list of valid subdivisions in regex character class syntax +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/lazy_constants.rb:48 +Unicode::Emoji::VALID_SUBDIVISIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:5 +Unicode::Emoji::VERSION = T.let(T.unsafe(nil), String) + +# The current list of Emoji components that should have a visual representation +# Currently skin tone modifiers + hair components +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:48 +Unicode::Emoji::VISUAL_COMPONENT = T.let(T.unsafe(nil), Array) + +# Zero-width-joiner to enable combination of multiple Emoji in a sequence +# +# pkg:gem/unicode-emoji#lib/unicode/emoji/constants.rb:41 +Unicode::Emoji::ZWJ = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/uri@1.0.4.rbi b/sorbet/rbi/gems/uri@1.1.1.rbi similarity index 78% rename from sorbet/rbi/gems/uri@1.0.4.rbi rename to sorbet/rbi/gems/uri@1.1.1.rbi index ad709e3..79129cd 100644 --- a/sorbet/rbi/gems/uri@1.0.4.rbi +++ b/sorbet/rbi/gems/uri@1.1.1.rbi @@ -7,13 +7,16 @@ # module URI # -# source://uri//lib/uri/common.rb#856 +# pkg:gem/uri#lib/uri/common.rb:895 module Kernel + include ::Booleans::KernelExtension + private # Returns a \URI object derived from the given +uri+, # which may be a \URI string or an existing \URI object: # + # require 'uri' # # Returns a new URI. # uri = URI('http://github.com/ruby/ruby') # # => #<URI::HTTP http://github.com/ruby/ruby> @@ -21,13 +24,16 @@ module Kernel # URI(uri) # # => #<URI::HTTP http://github.com/ruby/ruby> # - # source://uri//lib/uri/common.rb#869 + # You must require 'uri' to use this method. + # + # pkg:gem/uri#lib/uri/common.rb:911 def URI(uri); end class << self # Returns a \URI object derived from the given +uri+, # which may be a \URI string or an existing \URI object: # + # require 'uri' # # Returns a new URI. # uri = URI('http://github.com/ruby/ruby') # # => #<URI::HTTP http://github.com/ruby/ruby> @@ -35,20 +41,118 @@ module Kernel # URI(uri) # # => #<URI::HTTP http://github.com/ruby/ruby> # - # source://uri//lib/uri/common.rb#869 + # You must require 'uri' to use this method. + # + # pkg:gem/uri#lib/uri/common.rb:921 def URI(uri); end end end -# source://uri//lib/uri.rb#90 +# URI is a module providing classes to handle Uniform Resource Identifiers +# (RFC2396[https://www.rfc-editor.org/rfc/rfc2396]). +# +# == Features +# +# * Uniform way of handling URIs. +# * Flexibility to introduce custom URI schemes. +# * Flexibility to have an alternate URI::Parser (or just different patterns +# and regexp's). +# +# == Basic example +# +# require 'uri' +# +# uri = URI("http://foo.com/posts?id=30&limit=5#time=1305298413") +# #=> #<URI::HTTP http://foo.com/posts?id=30&limit=5#time=1305298413> +# +# uri.scheme #=> "http" +# uri.host #=> "foo.com" +# uri.path #=> "/posts" +# uri.query #=> "id=30&limit=5" +# uri.fragment #=> "time=1305298413" +# +# uri.to_s #=> "http://foo.com/posts?id=30&limit=5#time=1305298413" +# +# == Adding custom URIs +# +# module URI +# class RSYNC < Generic +# DEFAULT_PORT = 873 +# end +# register_scheme 'RSYNC', RSYNC +# end +# #=> URI::RSYNC +# +# URI.scheme_list +# #=> {"FILE"=>URI::File, "FTP"=>URI::FTP, "HTTP"=>URI::HTTP, +# # "HTTPS"=>URI::HTTPS, "LDAP"=>URI::LDAP, "LDAPS"=>URI::LDAPS, +# # "MAILTO"=>URI::MailTo, "RSYNC"=>URI::RSYNC} +# +# uri = URI("rsync://rsync.foo.com") +# #=> #<URI::RSYNC rsync://rsync.foo.com> +# +# == RFC References +# +# A good place to view an RFC spec is http://www.ietf.org/rfc.html. +# +# Here is a list of all related RFC's: +# - RFC822[https://www.rfc-editor.org/rfc/rfc822] +# - RFC1738[https://www.rfc-editor.org/rfc/rfc1738] +# - RFC2255[https://www.rfc-editor.org/rfc/rfc2255] +# - RFC2368[https://www.rfc-editor.org/rfc/rfc2368] +# - RFC2373[https://www.rfc-editor.org/rfc/rfc2373] +# - RFC2396[https://www.rfc-editor.org/rfc/rfc2396] +# - RFC2732[https://www.rfc-editor.org/rfc/rfc2732] +# - RFC3986[https://www.rfc-editor.org/rfc/rfc3986] +# +# == Class tree +# +# - URI::Generic (in uri/generic.rb) +# - URI::File - (in uri/file.rb) +# - URI::FTP - (in uri/ftp.rb) +# - URI::HTTP - (in uri/http.rb) +# - URI::HTTPS - (in uri/https.rb) +# - URI::LDAP - (in uri/ldap.rb) +# - URI::LDAPS - (in uri/ldaps.rb) +# - URI::MailTo - (in uri/mailto.rb) +# - URI::Parser - (in uri/common.rb) +# - URI::REGEXP - (in uri/common.rb) +# - URI::REGEXP::PATTERN - (in uri/common.rb) +# - URI::Util - (in uri/common.rb) +# - URI::Error - (in uri/common.rb) +# - URI::InvalidURIError - (in uri/common.rb) +# - URI::InvalidComponentError - (in uri/common.rb) +# - URI::BadURIError - (in uri/common.rb) +# +# == Copyright Info +# +# Author:: Akira Yamada <akira@ruby-lang.org> +# Documentation:: +# Akira Yamada <akira@ruby-lang.org> +# Dmitry V. Sabanin <sdmitry@lrn.ru> +# Vincent Batts <vbatts@hashbangbash.com> +# License:: +# Copyright (c) 2001 akira yamada <akira@ruby-lang.org> +# You can redistribute it and/or modify it under the same term as Ruby. +# +# -- +# = uri/common.rb +# +# Author:: Akira Yamada <akira@ruby-lang.org> +# License:: +# You can redistribute it and/or modify it under the same term as Ruby. +# +# See URI for general documentation +# +# pkg:gem/uri#lib/uri.rb:90 module URI class << self - # source://uri//lib/uri/common.rb#47 + # pkg:gem/uri#lib/uri/common.rb:50 def const_missing(const); end # Like URI.decode_www_form_component, except that <tt>'+'</tt> is preserved. # - # source://uri//lib/uri/common.rb#406 + # pkg:gem/uri#lib/uri/common.rb:441 def decode_uri_component(str, enc = T.unsafe(nil)); end # Returns name/value pairs derived from the given string +str+, @@ -84,9 +188,7 @@ module URI # URI.decode_www_form('foo=0--bar=1--baz', separator: '--') # # => [["foo", "0"], ["bar", "1"], ["baz", ""]] # - # @raise [ArgumentError] - # - # source://uri//lib/uri/common.rb#581 + # pkg:gem/uri#lib/uri/common.rb:620 def decode_www_form(str, enc = T.unsafe(nil), separator: T.unsafe(nil), use__charset_: T.unsafe(nil), isindex: T.unsafe(nil)); end # Returns a string decoded from the given \URL-encoded string +str+. @@ -119,13 +221,13 @@ module URI # # Related: URI.decode_uri_component (preserves <tt>'+'</tt>). # - # source://uri//lib/uri/common.rb#395 + # pkg:gem/uri#lib/uri/common.rb:430 def decode_www_form_component(str, enc = T.unsafe(nil)); end # Like URI.encode_www_form_component, except that <tt>' '</tt> (space) # is encoded as <tt>'%20'</tt> (instead of <tt>'+'</tt>). # - # source://uri//lib/uri/common.rb#401 + # pkg:gem/uri#lib/uri/common.rb:436 def encode_uri_component(str, enc = T.unsafe(nil)); end # Returns a URL-encoded string derived from the given @@ -226,7 +328,7 @@ module URI # URI.encode_www_form({foo: [0, 1], bar: 2}) # # => "foo=0&foo=1&bar=2" # - # source://uri//lib/uri/common.rb#528 + # pkg:gem/uri#lib/uri/common.rb:567 def encode_www_form(enum, enc = T.unsafe(nil)); end # Returns a URL-encoded string derived from the given string +str+. @@ -266,7 +368,7 @@ module URI # # Related: URI.encode_uri_component (encodes <tt>' '</tt> as <tt>'%20'</tt>). # - # source://uri//lib/uri/common.rb#362 + # pkg:gem/uri#lib/uri/common.rb:397 def encode_www_form_component(str, enc = T.unsafe(nil)); end # == Synopsis @@ -292,7 +394,7 @@ module URI # URI.extract("text here http://foo.example.org/bla and here mailto:test@example.com and here also.") # # => ["http://foo.example.com/bla", "mailto:test@example.com"] # - # source://uri//lib/uri/common.rb#266 + # pkg:gem/uri#lib/uri/common.rb:301 def extract(str, schemes = T.unsafe(nil), &block); end # Returns a new object constructed from the given +scheme+, +arguments+, @@ -311,13 +413,13 @@ module URI # URI.for('foo', *values, default: URI::HTTP) # # => #<URI::HTTP foo://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top> # - # source://uri//lib/uri/common.rb#150 + # pkg:gem/uri#lib/uri/common.rb:187 def for(scheme, *arguments, default: T.unsafe(nil)); end # return encoding or nil # http://encoding.spec.whatwg.org/#concept-encoding-get # - # source://uri//lib/uri/common.rb#851 + # pkg:gem/uri#lib/uri/common.rb:890 def get_encoding(label); end # Merges the given URI strings +str+ @@ -343,7 +445,7 @@ module URI # URI.join('http://example.com', '/foo/', 'bar') # # => #<URI::HTTP http://example.com/foo/bar> # - # source://uri//lib/uri/common.rb#238 + # pkg:gem/uri#lib/uri/common.rb:273 def join(*str); end # Returns a new \URI object constructed from the given string +uri+: @@ -353,15 +455,15 @@ module URI # URI.parse('http://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top') # # => #<URI::HTTP http://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top> # - # It's recommended to first ::escape string +uri+ + # It's recommended to first URI::RFC2396_PARSER.escape string +uri+ # if it may contain invalid URI characters. # - # source://uri//lib/uri/common.rb#211 + # pkg:gem/uri#lib/uri/common.rb:246 def parse(uri); end # Set the default parser instance. # - # source://uri//lib/uri/common.rb#29 + # pkg:gem/uri#lib/uri/common.rb:29 def parser=(parser = T.unsafe(nil)); end # == Synopsis @@ -395,7 +497,7 @@ module URI # p $& # end # - # source://uri//lib/uri/common.rb#303 + # pkg:gem/uri#lib/uri/common.rb:338 def regexp(schemes = T.unsafe(nil)); end # Registers the given +klass+ as the class to be instantiated @@ -407,7 +509,7 @@ module URI # Note that after calling String#upcase on +scheme+, it must be a valid # constant name. # - # source://uri//lib/uri/common.rb#106 + # pkg:gem/uri#lib/uri/common.rb:143 def register_scheme(scheme, klass); end # Returns a hash of the defined schemes: @@ -425,7 +527,7 @@ module URI # # Related: URI.register_scheme. # - # source://uri//lib/uri/common.rb#124 + # pkg:gem/uri#lib/uri/common.rb:161 def scheme_list; end # Returns a 9-element array representing the parts of the \URI @@ -446,17 +548,21 @@ module URI # ["query", "tag=networking&order=newest"], # ["fragment", "top"]] # - # source://uri//lib/uri/common.rb#197 + # pkg:gem/uri#lib/uri/common.rb:232 def split(uri); end private - # @raise [ArgumentError] + # Returns a string decoding characters matching +regexp+ from the + # given \URL-encoded string +str+. # - # source://uri//lib/uri/common.rb#424 + # pkg:gem/uri#lib/uri/common.rb:463 def _decode_uri_component(regexp, str, enc); end - # source://uri//lib/uri/common.rb#410 + # Returns a string derived from the given string +str+ with + # URI-encoded characters matching +regexp+ according to +table+. + # + # pkg:gem/uri#lib/uri/common.rb:447 def _encode_uri_component(regexp, table, str, enc); end end end @@ -468,7 +574,7 @@ end # is a good summary about the de facto spec. # https://datatracker.ietf.org/doc/html/draft-hoffman-ftp-uri-04 # -# source://uri//lib/uri/ftp.rb#22 +# pkg:gem/uri#lib/uri/ftp.rb:22 class URI::FTP < ::URI::Generic # == Description # @@ -481,13 +587,10 @@ class URI::FTP < ::URI::Generic # Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+, # +opaque+, +query+, and +fragment+, in that order. # - # @raise [InvalidURIError] - # @return [FTP] a new instance of FTP - # - # source://uri//lib/uri/ftp.rb#133 + # pkg:gem/uri#lib/uri/ftp.rb:133 def initialize(scheme, userinfo, host, port, registry, path, opaque, query, fragment, parser = T.unsafe(nil), arg_check = T.unsafe(nil)); end - # source://uri//lib/uri/ftp.rb#214 + # pkg:gem/uri#lib/uri/ftp.rb:214 def merge(oth); end # Returns the path from an FTP URI. @@ -507,19 +610,19 @@ class URI::FTP < ::URI::Generic # # This method will then return "/pub/ruby". # - # source://uri//lib/uri/ftp.rb#240 + # pkg:gem/uri#lib/uri/ftp.rb:240 def path; end # Returns a String representation of the URI::FTP. # - # source://uri//lib/uri/ftp.rb#251 + # pkg:gem/uri#lib/uri/ftp.rb:251 def to_s; end # typecode accessor. # # See URI::FTP::COMPONENT. # - # source://uri//lib/uri/ftp.rb#161 + # pkg:gem/uri#lib/uri/ftp.rb:161 def typecode; end # == Args @@ -544,21 +647,21 @@ class URI::FTP < ::URI::Generic # uri # #=> #<URI::FTP ftp://john@ftp.example.com/my_file.img;type=i> # - # source://uri//lib/uri/ftp.rb#208 + # pkg:gem/uri#lib/uri/ftp.rb:208 def typecode=(typecode); end protected # Private setter for the path of the URI::FTP. # - # source://uri//lib/uri/ftp.rb#245 + # pkg:gem/uri#lib/uri/ftp.rb:245 def set_path(v); end # Private setter for the typecode +v+. # # See also URI::FTP.typecode=. # - # source://uri//lib/uri/ftp.rb#180 + # pkg:gem/uri#lib/uri/ftp.rb:180 def set_typecode(v); end private @@ -566,7 +669,7 @@ class URI::FTP < ::URI::Generic # Validates typecode +v+, # returns +true+ or +false+. # - # source://uri//lib/uri/ftp.rb#166 + # pkg:gem/uri#lib/uri/ftp.rb:166 def check_typecode(v); end class << self @@ -598,64 +701,58 @@ class URI::FTP < ::URI::Generic # :path => 'ruby/src'}) # uri2.to_s # => "ftp://ftp.example.com/ruby/src" # - # source://uri//lib/uri/ftp.rb#96 + # pkg:gem/uri#lib/uri/ftp.rb:96 def build(args); end - # source://uri//lib/uri/ftp.rb#47 + # pkg:gem/uri#lib/uri/ftp.rb:47 def new2(user, password, host, port, path, typecode = T.unsafe(nil), arg_check = T.unsafe(nil)); end end end # The "file" URI is defined by RFC8089. # -# source://uri//lib/uri/file.rb#10 +# pkg:gem/uri#lib/uri/file.rb:10 class URI::File < ::URI::Generic # raise InvalidURIError # - # @raise [URI::InvalidURIError] - # - # source://uri//lib/uri/file.rb#82 + # pkg:gem/uri#lib/uri/file.rb:82 def check_password(user); end # raise InvalidURIError # - # @raise [URI::InvalidURIError] - # - # source://uri//lib/uri/file.rb#77 + # pkg:gem/uri#lib/uri/file.rb:77 def check_user(user); end # raise InvalidURIError # - # @raise [URI::InvalidURIError] - # - # source://uri//lib/uri/file.rb#72 + # pkg:gem/uri#lib/uri/file.rb:72 def check_userinfo(user); end # Protected setter for the host component +v+. # # See also URI::Generic.host=. # - # source://uri//lib/uri/file.rb#62 + # pkg:gem/uri#lib/uri/file.rb:62 def set_host(v); end # do nothing # - # source://uri//lib/uri/file.rb#95 + # pkg:gem/uri#lib/uri/file.rb:95 def set_password(v); end # do nothing # - # source://uri//lib/uri/file.rb#68 + # pkg:gem/uri#lib/uri/file.rb:68 def set_port(v); end # do nothing # - # source://uri//lib/uri/file.rb#91 + # pkg:gem/uri#lib/uri/file.rb:91 def set_user(v); end # do nothing # - # source://uri//lib/uri/file.rb#87 + # pkg:gem/uri#lib/uri/file.rb:87 def set_userinfo(v); end class << self @@ -685,28 +782,28 @@ class URI::File < ::URI::Generic # :path => '/ruby/src'}) # uri2.to_s # => "file://host.example.com/ruby/src" # - # uri3 = URI::File.build({:path => URI::escape('/path/my file.txt')}) + # uri3 = URI::File.build({:path => URI::RFC2396_PARSER.escape('/path/my file.txt')}) # uri3.to_s # => "file:///path/my%20file.txt" # - # source://uri//lib/uri/file.rb#53 + # pkg:gem/uri#lib/uri/file.rb:53 def build(args); end end end # An Array of the available components for URI::File. # -# source://uri//lib/uri/file.rb#17 +# pkg:gem/uri#lib/uri/file.rb:17 URI::File::COMPONENT = T.let(T.unsafe(nil), Array) # A Default port of nil for URI::File. # -# source://uri//lib/uri/file.rb#12 +# pkg:gem/uri#lib/uri/file.rb:12 URI::File::DEFAULT_PORT = T.let(T.unsafe(nil), T.untyped) # Base class for all URI classes. # Implements generic URI syntax as per RFC 2396. # -# source://uri//lib/uri/generic.rb#21 +# pkg:gem/uri#lib/uri/generic.rb:21 class URI::Generic include ::URI @@ -739,75 +836,34 @@ class URI::Generic # # Creates a new URI::Generic instance from ``generic'' components without check. # - # @return [Generic] a new instance of Generic - # - # source://uri//lib/uri/generic.rb#169 + # pkg:gem/uri#lib/uri/generic.rb:169 def initialize(scheme, userinfo, host, port, registry, path, opaque, query, fragment, parser = T.unsafe(nil), arg_check = T.unsafe(nil)); end - # == Args - # - # +oth+:: - # URI or String - # - # == Description - # - # Merges two URIs. - # - # == Usage - # - # require 'uri' - # - # uri = URI.parse("http://my.example.com") - # uri.merge("/main.rbx?page=1") - # # => "http://my.example.com/main.rbx?page=1" # merge # - # source://uri//lib/uri/generic.rb#1124 + # pkg:gem/uri#lib/uri/generic.rb:1164 def +(oth); end - # == Args - # - # +oth+:: - # URI or String - # - # == Description - # - # Calculates relative path from oth to self. - # - # == Usage - # - # require 'uri' - # - # uri = URI.parse('http://my.example.com/main.rbx?page=1') - # uri.route_from('http://my.example.com') - # #=> #<URI::Generic /main.rbx?page=1> - # - # source://uri//lib/uri/generic.rb#1274 + # pkg:gem/uri#lib/uri/generic.rb:1294 def -(oth); end # Compares two URIs. # - # source://uri//lib/uri/generic.rb#1399 + # pkg:gem/uri#lib/uri/generic.rb:1399 def ==(oth); end - # Returns true if URI has a scheme (e.g. http:// or https://) specified. - # - # @return [Boolean] - # - # source://uri//lib/uri/generic.rb#987 + # pkg:gem/uri#lib/uri/generic.rb:994 def absolute; end # Returns true if URI has a scheme (e.g. http:// or https://) specified. # - # @return [Boolean] - # - # source://uri//lib/uri/generic.rb#987 + # pkg:gem/uri#lib/uri/generic.rb:987 def absolute?; end # Returns the authority info (array of user, password, host and # port), if any is set. Or returns +nil+. # - # source://uri//lib/uri/generic.rb#579 + # pkg:gem/uri#lib/uri/generic.rb:579 def authority; end # == Args @@ -828,34 +884,32 @@ class URI::Generic # uri.coerce("http://foo.com") # #=> [#<URI::HTTP http://foo.com>, #<URI::HTTP http://my.example.com>] # - # source://uri//lib/uri/generic.rb#1478 + # pkg:gem/uri#lib/uri/generic.rb:1478 def coerce(oth); end # Components of the URI in the order. # - # source://uri//lib/uri/generic.rb#313 + # pkg:gem/uri#lib/uri/generic.rb:313 def component; end # Returns the password component after URI decoding. # - # source://uri//lib/uri/generic.rb#589 + # pkg:gem/uri#lib/uri/generic.rb:589 def decoded_password; end # Returns the user component after URI decoding. # - # source://uri//lib/uri/generic.rb#584 + # pkg:gem/uri#lib/uri/generic.rb:584 def decoded_user; end # Returns default port. # - # source://uri//lib/uri/generic.rb#39 + # pkg:gem/uri#lib/uri/generic.rb:39 def default_port; end # Compares with _oth_ for Hash. # - # @return [Boolean] - # - # source://uri//lib/uri/generic.rb#1413 + # pkg:gem/uri#lib/uri/generic.rb:1413 def eql?(oth); end # Returns a proxy URI. @@ -874,19 +928,17 @@ class URI::Generic # http_proxy is not used too if the variable is case insensitive. # CGI_HTTP_PROXY can be used instead. # - # @raise [BadURIError] - # - # source://uri//lib/uri/generic.rb#1504 + # pkg:gem/uri#lib/uri/generic.rb:1504 def find_proxy(env = T.unsafe(nil)); end # Returns the fragment component of the URI. # # URI("http://foo/bar/baz?search=FooBar#ponies").fragment #=> "ponies" # - # source://uri//lib/uri/generic.rb#283 + # pkg:gem/uri#lib/uri/generic.rb:283 def fragment; end - # Checks the fragment +v+ component against the URI::Parser Regexp for :FRAGMENT. + # Checks the fragment +v+ component against the +parser+ Regexp for :FRAGMENT. # # # == Args @@ -907,12 +959,12 @@ class URI::Generic # uri.fragment = "time=1305212086" # uri.to_s #=> "http://my.example.com/?id=25#time=1305212086" # - # source://uri//lib/uri/generic.rb#944 + # pkg:gem/uri#lib/uri/generic.rb:944 def fragment=(v); end # Returns the hash value. # - # source://uri//lib/uri/generic.rb#1408 + # pkg:gem/uri#lib/uri/generic.rb:1408 def hash; end # Returns true if URI is hierarchical. @@ -933,9 +985,7 @@ class URI::Generic # uri.hierarchical? # #=> false # - # @return [Boolean] - # - # source://uri//lib/uri/generic.rb#976 + # pkg:gem/uri#lib/uri/generic.rb:976 def hierarchical?; end # Returns the host component of the URI. @@ -958,7 +1008,7 @@ class URI::Generic # URI("http://[::1]/bar/baz").host #=> "[::1]" # URI("http://[::1]/bar/baz").hostname #=> "::1" # - # source://uri//lib/uri/generic.rb#243 + # pkg:gem/uri#lib/uri/generic.rb:243 def host; end # == Args @@ -981,7 +1031,7 @@ class URI::Generic # uri.host = "foo.com" # uri.to_s #=> "http://foo.com" # - # source://uri//lib/uri/generic.rb#652 + # pkg:gem/uri#lib/uri/generic.rb:652 def host=(v); end # Extract the host part of the URI and unwrap brackets for IPv6 addresses. @@ -993,7 +1043,7 @@ class URI::Generic # uri.hostname #=> "::1" # uri.host #=> "[::1]" # - # source://uri//lib/uri/generic.rb#668 + # pkg:gem/uri#lib/uri/generic.rb:668 def hostname; end # Sets the host part of the URI as the argument with brackets for IPv6 addresses. @@ -1008,10 +1058,10 @@ class URI::Generic # If the argument seems to be an IPv6 address, # it is wrapped with brackets. # - # source://uri//lib/uri/generic.rb#685 + # pkg:gem/uri#lib/uri/generic.rb:685 def hostname=(v); end - # source://uri//lib/uri/generic.rb#1455 + # pkg:gem/uri#lib/uri/generic.rb:1455 def inspect; end # == Args @@ -1031,7 +1081,7 @@ class URI::Generic # uri.merge("/main.rbx?page=1") # # => "http://my.example.com/main.rbx?page=1" # - # source://uri//lib/uri/generic.rb#1124 + # pkg:gem/uri#lib/uri/generic.rb:1124 def merge(oth); end # == Args @@ -1051,7 +1101,7 @@ class URI::Generic # uri.merge!("/main.rbx?page=1") # uri.to_s # => "http://my.example.com/main.rbx?page=1" # - # source://uri//lib/uri/generic.rb#1096 + # pkg:gem/uri#lib/uri/generic.rb:1096 def merge!(oth); end # Returns normalized URI. @@ -1066,12 +1116,12 @@ class URI::Generic # * scheme and host are converted to lowercase, # * an empty path component is set to "/". # - # source://uri//lib/uri/generic.rb#1331 + # pkg:gem/uri#lib/uri/generic.rb:1331 def normalize; end # Destructive version of #normalize. # - # source://uri//lib/uri/generic.rb#1340 + # pkg:gem/uri#lib/uri/generic.rb:1340 def normalize!; end # Returns the opaque part of the URI. @@ -1083,7 +1133,7 @@ class URI::Generic # The path typically refers to an absolute path or an opaque part. # (See RFC2396 Section 3 and 5.2.) # - # source://uri//lib/uri/generic.rb#277 + # pkg:gem/uri#lib/uri/generic.rb:277 def opaque; end # == Args @@ -1098,19 +1148,19 @@ class URI::Generic # # See also URI::Generic.check_opaque. # - # source://uri//lib/uri/generic.rb#916 + # pkg:gem/uri#lib/uri/generic.rb:916 def opaque=(v); end # Returns the parser to be used. # - # Unless a URI::Parser is defined, DEFAULT_PARSER is used. + # Unless the +parser+ is defined, DEFAULT_PARSER is used. # - # source://uri//lib/uri/generic.rb#289 + # pkg:gem/uri#lib/uri/generic.rb:289 def parser; end # Returns the password component (without URI decoding). # - # source://uri//lib/uri/generic.rb#573 + # pkg:gem/uri#lib/uri/generic.rb:573 def password; end # == Args @@ -1133,14 +1183,14 @@ class URI::Generic # uri.password = "V3ry_S3nsit1ve" # uri.to_s #=> "http://john:V3ry_S3nsit1ve@my.example.com" # - # source://uri//lib/uri/generic.rb#498 + # pkg:gem/uri#lib/uri/generic.rb:498 def password=(password); end # Returns the path component of the URI. # # URI("http://foo/bar/baz").path #=> "/bar/baz" # - # source://uri//lib/uri/generic.rb#260 + # pkg:gem/uri#lib/uri/generic.rb:260 def path; end # == Args @@ -1163,7 +1213,7 @@ class URI::Generic # uri.path = "/faq/" # uri.to_s #=> "http://my.example.com/faq/" # - # source://uri//lib/uri/generic.rb#830 + # pkg:gem/uri#lib/uri/generic.rb:830 def path=(v); end # Returns the port component of the URI. @@ -1171,7 +1221,7 @@ class URI::Generic # URI("http://foo/bar/baz").port #=> 80 # URI("http://foo:8080/bar/baz").port #=> 8080 # - # source://uri//lib/uri/generic.rb#250 + # pkg:gem/uri#lib/uri/generic.rb:250 def port; end # == Args @@ -1194,14 +1244,14 @@ class URI::Generic # uri.port = 8080 # uri.to_s #=> "http://my.example.com:8080" # - # source://uri//lib/uri/generic.rb#743 + # pkg:gem/uri#lib/uri/generic.rb:743 def port=(v); end # Returns the query component of the URI. # # URI("http://foo/bar/baz?search=FooBar").query #=> "search=FooBar" # - # source://uri//lib/uri/generic.rb#266 + # pkg:gem/uri#lib/uri/generic.rb:266 def query; end # == Args @@ -1221,24 +1271,18 @@ class URI::Generic # uri.query = "id=1" # uri.to_s #=> "http://my.example.com/?id=1" # - # @raise [InvalidURIError] - # - # source://uri//lib/uri/generic.rb#854 + # pkg:gem/uri#lib/uri/generic.rb:854 def query=(v); end - # source://uri//lib/uri/generic.rb#252 + # pkg:gem/uri#lib/uri/generic.rb:252 def registry; end - # @raise [InvalidURIError] - # - # source://uri//lib/uri/generic.rb#760 + # pkg:gem/uri#lib/uri/generic.rb:760 def registry=(v); end # Returns true if URI does not have a scheme (e.g. http:// or https://) specified. # - # @return [Boolean] - # - # source://uri//lib/uri/generic.rb#999 + # pkg:gem/uri#lib/uri/generic.rb:999 def relative?; end # == Args @@ -1258,7 +1302,7 @@ class URI::Generic # uri.route_from('http://my.example.com') # #=> #<URI::Generic /main.rbx?page=1> # - # source://uri//lib/uri/generic.rb#1274 + # pkg:gem/uri#lib/uri/generic.rb:1274 def route_from(oth); end # == Args @@ -1278,14 +1322,14 @@ class URI::Generic # uri.route_to('http://my.example.com/main.rbx?page=1') # #=> #<URI::Generic /main.rbx?page=1> # - # source://uri//lib/uri/generic.rb#1314 + # pkg:gem/uri#lib/uri/generic.rb:1314 def route_to(oth); end # Returns the scheme component of the URI. # # URI("http://foo/bar/baz").scheme #=> "http" # - # source://uri//lib/uri/generic.rb#221 + # pkg:gem/uri#lib/uri/generic.rb:221 def scheme; end # == Args @@ -1308,7 +1352,7 @@ class URI::Generic # uri.scheme = "https" # uri.to_s #=> "https://my.example.com" # - # source://uri//lib/uri/generic.rb#360 + # pkg:gem/uri#lib/uri/generic.rb:360 def scheme=(v); end # == Args @@ -1328,22 +1372,20 @@ class URI::Generic # uri.select(:userinfo, :host, :path) # # => ["myuser:mypass", "my.example.com", "/test.rbx"] # - # source://uri//lib/uri/generic.rb#1444 + # pkg:gem/uri#lib/uri/generic.rb:1444 def select(*components); end # Constructs String from URI. # - # source://uri//lib/uri/generic.rb#1355 + # pkg:gem/uri#lib/uri/generic.rb:1355 def to_s; end - # Constructs String from URI. - # - # source://uri//lib/uri/generic.rb#1355 + # pkg:gem/uri#lib/uri/generic.rb:1394 def to_str; end # Returns the user component (without URI decoding). # - # source://uri//lib/uri/generic.rb#568 + # pkg:gem/uri#lib/uri/generic.rb:568 def user; end # == Args @@ -1366,84 +1408,82 @@ class URI::Generic # uri.user = "sam" # uri.to_s #=> "http://sam:V3ry_S3nsit1ve@my.example.com" # - # source://uri//lib/uri/generic.rb#471 + # pkg:gem/uri#lib/uri/generic.rb:471 def user=(user); end # Returns the userinfo, either as 'user' or 'user:password'. # - # source://uri//lib/uri/generic.rb#557 + # pkg:gem/uri#lib/uri/generic.rb:557 def userinfo; end # Sets userinfo, argument is string like 'name:pass'. # - # source://uri//lib/uri/generic.rb#441 + # pkg:gem/uri#lib/uri/generic.rb:441 def userinfo=(userinfo); end protected # Returns an Array of the components defined from the COMPONENT Array. # - # source://uri//lib/uri/generic.rb#1420 + # pkg:gem/uri#lib/uri/generic.rb:1420 def component_ary; end # Protected setter for the authority info (+user+, +password+, +host+ # and +port+). If +port+ is +nil+, +default_port+ will be set. # - # source://uri//lib/uri/generic.rb#627 + # pkg:gem/uri#lib/uri/generic.rb:627 def set_authority(user, password, host, port = T.unsafe(nil)); end # Protected setter for the host component +v+. # # See also URI::Generic.host=. # - # source://uri//lib/uri/generic.rb#619 + # pkg:gem/uri#lib/uri/generic.rb:619 def set_host(v); end # Protected setter for the opaque component +v+. # # See also URI::Generic.opaque=. # - # source://uri//lib/uri/generic.rb#898 + # pkg:gem/uri#lib/uri/generic.rb:898 def set_opaque(v); end # Protected setter for the password component +v+. # # See also URI::Generic.password=. # - # source://uri//lib/uri/generic.rb#534 + # pkg:gem/uri#lib/uri/generic.rb:534 def set_password(v); end # Protected setter for the path component +v+. # # See also URI::Generic.path=. # - # source://uri//lib/uri/generic.rb#804 + # pkg:gem/uri#lib/uri/generic.rb:804 def set_path(v); end # Protected setter for the port component +v+. # # See also URI::Generic.port=. # - # source://uri//lib/uri/generic.rb#716 + # pkg:gem/uri#lib/uri/generic.rb:716 def set_port(v); end - # @raise [InvalidURIError] - # - # source://uri//lib/uri/generic.rb#755 + # pkg:gem/uri#lib/uri/generic.rb:755 def set_registry(v); end # Protected setter for the scheme component +v+. # # See also URI::Generic.scheme=. # - # source://uri//lib/uri/generic.rb#334 + # pkg:gem/uri#lib/uri/generic.rb:334 def set_scheme(v); end # Protected setter for the user component +v+. # # See also URI::Generic.user=. # - # source://uri//lib/uri/generic.rb#524 + # pkg:gem/uri#lib/uri/generic.rb:524 def set_user(v); end # Protected setter for the +user+ component, and +password+ if available @@ -1451,74 +1491,72 @@ class URI::Generic # # See also URI::Generic.userinfo=. # - # source://uri//lib/uri/generic.rb#509 + # pkg:gem/uri#lib/uri/generic.rb:509 def set_userinfo(user, password = T.unsafe(nil)); end private # Checks the host +v+ component for RFC2396 compliance - # and against the URI::Parser Regexp for :HOST. + # and against the +parser+ Regexp for :HOST. # # Can not have a registry or opaque component defined, # with a host component defined. # - # source://uri//lib/uri/generic.rb#600 + # pkg:gem/uri#lib/uri/generic.rb:600 def check_host(v); end # Checks the opaque +v+ component for RFC2396 compliance and - # against the URI::Parser Regexp for :OPAQUE. + # against the +parser+ Regexp for :OPAQUE. # # Can not have a host, port, user, or path component defined, # with an opaque component defined. # - # source://uri//lib/uri/generic.rb#876 + # pkg:gem/uri#lib/uri/generic.rb:876 def check_opaque(v); end # Checks the password +v+ component for RFC2396 compliance - # and against the URI::Parser Regexp for :USERINFO. + # and against the +parser+ Regexp for :USERINFO. # # Can not have a registry or opaque component defined, # with a user component defined. # - # source://uri//lib/uri/generic.rb#417 + # pkg:gem/uri#lib/uri/generic.rb:417 def check_password(v, user = T.unsafe(nil)); end # Checks the path +v+ component for RFC2396 compliance - # and against the URI::Parser Regexp + # and against the +parser+ Regexp # for :ABS_PATH and :REL_PATH. # # Can not have a opaque component defined, # with a path component defined. # - # source://uri//lib/uri/generic.rb#772 + # pkg:gem/uri#lib/uri/generic.rb:772 def check_path(v); end # Checks the port +v+ component for RFC2396 compliance - # and against the URI::Parser Regexp for :PORT. + # and against the +parser+ Regexp for :PORT. # # Can not have a registry or opaque component defined, # with a port component defined. # - # source://uri//lib/uri/generic.rb#697 + # pkg:gem/uri#lib/uri/generic.rb:697 def check_port(v); end - # @raise [InvalidURIError] - # - # source://uri//lib/uri/generic.rb#750 + # pkg:gem/uri#lib/uri/generic.rb:750 def check_registry(v); end - # Checks the scheme +v+ component against the URI::Parser Regexp for :SCHEME. + # Checks the scheme +v+ component against the +parser+ Regexp for :SCHEME. # - # source://uri//lib/uri/generic.rb#320 + # pkg:gem/uri#lib/uri/generic.rb:320 def check_scheme(v); end # Checks the user +v+ component for RFC2396 compliance - # and against the URI::Parser Regexp for :USERINFO. + # and against the +parser+ Regexp for :USERINFO. # # Can not have a registry or opaque component defined, # with a user component defined. # - # source://uri//lib/uri/generic.rb#393 + # pkg:gem/uri#lib/uri/generic.rb:393 def check_user(v); end # Checks the +user+ and +password+. @@ -1529,44 +1567,44 @@ class URI::Generic # # See also URI::Generic.check_user, URI::Generic.check_password. # - # source://uri//lib/uri/generic.rb#375 + # pkg:gem/uri#lib/uri/generic.rb:375 def check_userinfo(user, password = T.unsafe(nil)); end # Escapes 'user:password' +v+ based on RFC 1738 section 3.1. # - # source://uri//lib/uri/generic.rb#551 + # pkg:gem/uri#lib/uri/generic.rb:551 def escape_userpass(v); end # Merges a base path +base+, with relative path +rel+, # returns a modified base path. # - # source://uri//lib/uri/generic.rb#1015 + # pkg:gem/uri#lib/uri/generic.rb:1015 def merge_path(base, rel); end # Replaces self by other URI object. # - # source://uri//lib/uri/generic.rb#299 + # pkg:gem/uri#lib/uri/generic.rb:299 def replace!(oth); end # :stopdoc: # - # source://uri//lib/uri/generic.rb#1206 + # pkg:gem/uri#lib/uri/generic.rb:1206 def route_from0(oth); end # :stopdoc: # - # source://uri//lib/uri/generic.rb#1167 + # pkg:gem/uri#lib/uri/generic.rb:1167 def route_from_path(src, dst); end # Returns an Array of the path split on '/'. # - # source://uri//lib/uri/generic.rb#1006 + # pkg:gem/uri#lib/uri/generic.rb:1006 def split_path(path); end # Returns the userinfo +ui+ as <code>[user, password]</code> # if properly formatted as 'user:password'. # - # source://uri//lib/uri/generic.rb#542 + # pkg:gem/uri#lib/uri/generic.rb:542 def split_userinfo(ui); end class << self @@ -1581,7 +1619,7 @@ class URI::Generic # opaque, query, and fragment. You can provide arguments either by an Array or a Hash. # See ::new for hash keys to use or for order of array items. # - # source://uri//lib/uri/generic.rb#116 + # pkg:gem/uri#lib/uri/generic.rb:116 def build(args); end # == Synopsis @@ -1592,27 +1630,25 @@ class URI::Generic # # At first, tries to create a new URI::Generic instance using # URI::Generic::build. But, if exception URI::InvalidComponentError is raised, - # then it does URI::Escape.escape all URI components and tries again. + # then it does URI::RFC2396_PARSER.escape all URI components and tries again. # - # source://uri//lib/uri/generic.rb#78 + # pkg:gem/uri#lib/uri/generic.rb:78 def build2(args); end # Components of the URI in the order. # - # source://uri//lib/uri/generic.rb#57 + # pkg:gem/uri#lib/uri/generic.rb:57 def component; end # Returns default port. # - # source://uri//lib/uri/generic.rb#32 + # pkg:gem/uri#lib/uri/generic.rb:32 def default_port; end - # @return [Boolean] - # - # source://uri//lib/uri/generic.rb#1570 + # pkg:gem/uri#lib/uri/generic.rb:1570 def use_proxy?(hostname, addr, port, no_proxy); end - # source://uri//lib/uri/generic.rb#63 + # pkg:gem/uri#lib/uri/generic.rb:63 def use_registry; end end end @@ -1624,7 +1660,7 @@ end # supported in Internet Explorer 5 and 6, before the MS04-004 security # update. See <URL:http://support.microsoft.com/kb/834489>. # -# source://uri//lib/uri/http.rb#22 +# pkg:gem/uri#lib/uri/http.rb:22 class URI::HTTP < ::URI::Generic # == Description # @@ -1638,9 +1674,14 @@ class URI::HTTP < ::URI::Generic # URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').authority #=> "www.example.com:8000" # URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').authority #=> "www.example.com" # - # source://uri//lib/uri/http.rb#97 + # pkg:gem/uri#lib/uri/http.rb:109 def authority; end + # Do not allow empty host names, as they are not allowed by RFC 3986. + # + # pkg:gem/uri#lib/uri/http.rb:65 + def check_host(v); end + # == Description # # Returns the origin for an HTTP uri, as defined in @@ -1654,7 +1695,7 @@ class URI::HTTP < ::URI::Generic # URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').origin #=> "http://www.example.com" # URI::HTTPS.build(host: 'www.example.com', path: '/foo/bar').origin #=> "https://www.example.com" # - # source://uri//lib/uri/http.rb#119 + # pkg:gem/uri#lib/uri/http.rb:131 def origin; end # == Description @@ -1669,7 +1710,7 @@ class URI::HTTP < ::URI::Generic # uri = URI::HTTP.build(path: '/foo/bar', query: 'test=true') # uri.request_uri # => "/foo/bar?test=true" # - # source://uri//lib/uri/http.rb#77 + # pkg:gem/uri#lib/uri/http.rb:89 def request_uri; end class << self @@ -1696,12 +1737,14 @@ class URI::HTTP < ::URI::Generic # Currently, if passed userinfo components this method generates # invalid HTTP URIs as per RFC 1738. # - # source://uri//lib/uri/http.rb#59 + # pkg:gem/uri#lib/uri/http.rb:59 def build(args); end end end -# source://uri//lib/uri/common.rb#130 +# :stopdoc: +# +# pkg:gem/uri#lib/uri/common.rb:166 URI::INITIAL_SCHEMES = T.let(T.unsafe(nil), Hash) # LDAP URI SCHEMA (described in RFC2255). @@ -1709,7 +1752,7 @@ URI::INITIAL_SCHEMES = T.let(T.unsafe(nil), Hash) # ldap://<host>/<dn>[?<attrs>[?<scope>[?<filter>[?<extensions>]]]] # ++ # -# source://uri//lib/uri/ldap.rb#23 +# pkg:gem/uri#lib/uri/ldap.rb:23 class URI::LDAP < ::URI::Generic # == Description # @@ -1726,114 +1769,108 @@ class URI::LDAP < ::URI::Generic # # See also URI::Generic.new. # - # @return [LDAP] a new instance of LDAP - # - # source://uri//lib/uri/ldap.rb#108 + # pkg:gem/uri#lib/uri/ldap.rb:108 def initialize(*arg); end # Returns attributes. # - # source://uri//lib/uri/ldap.rb#178 + # pkg:gem/uri#lib/uri/ldap.rb:178 def attributes; end # Setter for attributes +val+. # - # source://uri//lib/uri/ldap.rb#191 + # pkg:gem/uri#lib/uri/ldap.rb:191 def attributes=(val); end # Returns dn. # - # source://uri//lib/uri/ldap.rb#159 + # pkg:gem/uri#lib/uri/ldap.rb:159 def dn; end # Setter for dn +val+. # - # source://uri//lib/uri/ldap.rb#172 + # pkg:gem/uri#lib/uri/ldap.rb:172 def dn=(val); end # Returns extensions. # - # source://uri//lib/uri/ldap.rb#235 + # pkg:gem/uri#lib/uri/ldap.rb:235 def extensions; end # Setter for extensions +val+. # - # source://uri//lib/uri/ldap.rb#248 + # pkg:gem/uri#lib/uri/ldap.rb:248 def extensions=(val); end # Returns filter. # - # source://uri//lib/uri/ldap.rb#216 + # pkg:gem/uri#lib/uri/ldap.rb:216 def filter; end # Setter for filter +val+. # - # source://uri//lib/uri/ldap.rb#229 + # pkg:gem/uri#lib/uri/ldap.rb:229 def filter=(val); end # Checks if URI has a path. # For URI::LDAP this will return +false+. # - # @return [Boolean] - # - # source://uri//lib/uri/ldap.rb#255 + # pkg:gem/uri#lib/uri/ldap.rb:255 def hierarchical?; end # Returns scope. # - # source://uri//lib/uri/ldap.rb#197 + # pkg:gem/uri#lib/uri/ldap.rb:197 def scope; end # Setter for scope +val+. # - # source://uri//lib/uri/ldap.rb#210 + # pkg:gem/uri#lib/uri/ldap.rb:210 def scope=(val); end protected # Private setter for attributes +val+. # - # source://uri//lib/uri/ldap.rb#183 + # pkg:gem/uri#lib/uri/ldap.rb:183 def set_attributes(val); end # Private setter for dn +val+. # - # source://uri//lib/uri/ldap.rb#164 + # pkg:gem/uri#lib/uri/ldap.rb:164 def set_dn(val); end # Private setter for extensions +val+. # - # source://uri//lib/uri/ldap.rb#240 + # pkg:gem/uri#lib/uri/ldap.rb:240 def set_extensions(val); end # Private setter for filter +val+. # - # source://uri//lib/uri/ldap.rb#221 + # pkg:gem/uri#lib/uri/ldap.rb:221 def set_filter(val); end # Private setter for scope +val+. # - # source://uri//lib/uri/ldap.rb#202 + # pkg:gem/uri#lib/uri/ldap.rb:202 def set_scope(val); end private # Private method to assemble +query+ from +attributes+, +scope+, +filter+, and +extensions+. # - # source://uri//lib/uri/ldap.rb#146 + # pkg:gem/uri#lib/uri/ldap.rb:146 def build_path_query; end # Private method to cleanup +dn+ from using the +path+ component attribute. # - # @raise [InvalidURIError] - # - # source://uri//lib/uri/ldap.rb#120 + # pkg:gem/uri#lib/uri/ldap.rb:120 def parse_dn; end # Private method to cleanup +attributes+, +scope+, +filter+, and +extensions+ # from using the +query+ component attribute. # - # source://uri//lib/uri/ldap.rb#128 + # pkg:gem/uri#lib/uri/ldap.rb:128 def parse_query; end class << self @@ -1858,14 +1895,14 @@ class URI::LDAP < ::URI::Generic # uri = URI::LDAP.build(["ldap.example.com", nil, # "/dc=example;dc=com", "query", nil, nil, nil]) # - # source://uri//lib/uri/ldap.rb#74 + # pkg:gem/uri#lib/uri/ldap.rb:74 def build(args); end end end # RFC6068, the mailto URL scheme. # -# source://uri//lib/uri/mailto.rb#17 +# pkg:gem/uri#lib/uri/mailto.rb:17 class URI::MailTo < ::URI::Generic include ::URI::RFC2396_REGEXP @@ -1877,29 +1914,27 @@ class URI::MailTo < ::URI::Generic # This method is usually called from URI::parse, which checks # the validity of each component. # - # @return [MailTo] a new instance of MailTo - # - # source://uri//lib/uri/mailto.rb#132 + # pkg:gem/uri#lib/uri/mailto.rb:132 def initialize(*arg); end # E-mail headers set by the URL, as an Array of Arrays. # - # source://uri//lib/uri/mailto.rb#166 + # pkg:gem/uri#lib/uri/mailto.rb:166 def headers; end # Setter for headers +v+. # - # source://uri//lib/uri/mailto.rb#232 + # pkg:gem/uri#lib/uri/mailto.rb:232 def headers=(v); end # The primary e-mail address of the URL, as a String. # - # source://uri//lib/uri/mailto.rb#163 + # pkg:gem/uri#lib/uri/mailto.rb:163 def to; end # Setter for to +v+. # - # source://uri//lib/uri/mailto.rb#200 + # pkg:gem/uri#lib/uri/mailto.rb:200 def to=(v); end # Returns the RFC822 e-mail text equivalent of the URL, as a String. @@ -1912,37 +1947,27 @@ class URI::MailTo < ::URI::Generic # uri.to_mailtext # # => "To: ruby-list@ruby-lang.org\nSubject: subscribe\nCc: myaddr\n\n\n" # - # source://uri//lib/uri/mailto.rb#268 + # pkg:gem/uri#lib/uri/mailto.rb:268 def to_mailtext; end - # Returns the RFC822 e-mail text equivalent of the URL, as a String. - # - # Example: - # - # require 'uri' - # - # uri = URI.parse("mailto:ruby-list@ruby-lang.org?Subject=subscribe&cc=myaddr") - # uri.to_mailtext - # # => "To: ruby-list@ruby-lang.org\nSubject: subscribe\nCc: myaddr\n\n\n" - # - # source://uri//lib/uri/mailto.rb#268 + # pkg:gem/uri#lib/uri/mailto.rb:289 def to_rfc822text; end # Constructs String from URI. # - # source://uri//lib/uri/mailto.rb#239 + # pkg:gem/uri#lib/uri/mailto.rb:239 def to_s; end protected # Private setter for headers +v+. # - # source://uri//lib/uri/mailto.rb#221 + # pkg:gem/uri#lib/uri/mailto.rb:221 def set_headers(v); end # Private setter for to +v+. # - # source://uri//lib/uri/mailto.rb#194 + # pkg:gem/uri#lib/uri/mailto.rb:194 def set_to(v); end private @@ -1950,12 +1975,12 @@ class URI::MailTo < ::URI::Generic # Checks the headers +v+ component against either # * HEADER_REGEXP # - # source://uri//lib/uri/mailto.rb#208 + # pkg:gem/uri#lib/uri/mailto.rb:208 def check_headers(v); end # Checks the to +v+ component. # - # source://uri//lib/uri/mailto.rb#169 + # pkg:gem/uri#lib/uri/mailto.rb:169 def check_to(v); end class << self @@ -1985,22 +2010,25 @@ class URI::MailTo < ::URI::Generic # m3 = URI::MailTo.build({:to => 'listman@example.com', :headers => [['subject', 'subscribe']]}) # m3.to_s # => "mailto:listman@example.com?subject=subscribe" # - # source://uri//lib/uri/mailto.rb#85 + # pkg:gem/uri#lib/uri/mailto.rb:85 def build(args); end end end +# pkg:gem/uri#lib/uri/common.rb:34 +URI::PARSER = T.let(T.unsafe(nil), URI::RFC3986_Parser) + # Class that parses String's into URI's. # # It contains a Hash set of patterns and Regexp's that match and validate. # -# source://uri//lib/uri/rfc2396_parser.rb#64 +# pkg:gem/uri#lib/uri/rfc2396_parser.rb:64 class URI::RFC2396_Parser include ::URI::RFC2396_REGEXP # == Synopsis # - # URI::Parser.new([opts]) + # URI::RFC2396_Parser.new([opts]) # # == Args # @@ -2019,7 +2047,7 @@ class URI::RFC2396_Parser # # == Examples # - # p = URI::Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})") + # p = URI::RFC2396_Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})") # u = p.parse("http://example.jp/%uABCD") #=> #<URI::HTTP http://example.jp/%uABCD> # URI.parse(u.to_s) #=> raises URI::InvalidURIError # @@ -2029,9 +2057,7 @@ class URI::RFC2396_Parser # u1 == u2 #=> true # u1.eql?(u2) #=> false # - # @return [RFC2396_Parser] a new instance of RFC2396_Parser - # - # source://uri//lib/uri/rfc2396_parser.rb#99 + # pkg:gem/uri#lib/uri/rfc2396_parser.rb:99 def initialize(opts = T.unsafe(nil)); end # :call-seq: @@ -2050,7 +2076,7 @@ class URI::RFC2396_Parser # Constructs a safe String from +str+, removing unsafe characters, # replacing them with codes. # - # source://uri//lib/uri/rfc2396_parser.rb#287 + # pkg:gem/uri#lib/uri/rfc2396_parser.rb:286 def escape(str, unsafe = T.unsafe(nil)); end # :call-seq: @@ -2071,12 +2097,12 @@ class URI::RFC2396_Parser # If no +block+ given, then returns the result, # else it calls +block+ for each element in result. # - # See also URI::Parser.make_regexp. + # See also #make_regexp. # - # source://uri//lib/uri/rfc2396_parser.rb#249 + # pkg:gem/uri#lib/uri/rfc2396_parser.rb:248 def extract(str, schemes = T.unsafe(nil)); end - # source://uri//lib/uri/rfc2396_parser.rb#326 + # pkg:gem/uri#lib/uri/rfc2396_parser.rb:325 def inspect; end # == Args @@ -2088,13 +2114,13 @@ class URI::RFC2396_Parser # # Attempts to parse and merge a set of URIs. # - # source://uri//lib/uri/rfc2396_parser.rb#223 + # pkg:gem/uri#lib/uri/rfc2396_parser.rb:222 def join(*uris); end # Returns Regexp that is default +self.regexp[:ABS_URI_REF]+, # unless +schemes+ is provided. Then it is a Regexp.union with +self.pattern[:X_ABS_URI]+. # - # source://uri//lib/uri/rfc2396_parser.rb#262 + # pkg:gem/uri#lib/uri/rfc2396_parser.rb:261 def make_regexp(schemes = T.unsafe(nil)); end # == Args @@ -2109,30 +2135,29 @@ class URI::RFC2396_Parser # # == Usage # - # p = URI::Parser.new - # p.parse("ldap://ldap.example.com/dc=example?user=john") + # URI::RFC2396_PARSER.parse("ldap://ldap.example.com/dc=example?user=john") # #=> #<URI::LDAP ldap://ldap.example.com/dc=example?user=john> # - # source://uri//lib/uri/rfc2396_parser.rb#209 + # pkg:gem/uri#lib/uri/rfc2396_parser.rb:208 def parse(uri); end # The Hash of patterns. # - # See also URI::Parser.initialize_pattern. + # See also #initialize_pattern. # - # source://uri//lib/uri/rfc2396_parser.rb#112 + # pkg:gem/uri#lib/uri/rfc2396_parser.rb:112 def pattern; end # The Hash of Regexp. # - # See also URI::Parser.initialize_regexp. + # See also #initialize_regexp. # - # source://uri//lib/uri/rfc2396_parser.rb#117 + # pkg:gem/uri#lib/uri/rfc2396_parser.rb:117 def regexp; end # Returns a split URI against +regexp[:ABS_URI]+. # - # source://uri//lib/uri/rfc2396_parser.rb#120 + # pkg:gem/uri#lib/uri/rfc2396_parser.rb:120 def split(uri); end # :call-seq: @@ -2150,149 +2175,165 @@ class URI::RFC2396_Parser # # Removes escapes from +str+. # - # source://uri//lib/uri/rfc2396_parser.rb#318 + # pkg:gem/uri#lib/uri/rfc2396_parser.rb:317 def unescape(str, escaped = T.unsafe(nil)); end private - # source://uri//lib/uri/rfc2396_parser.rb#527 + # Returns +uri+ as-is if it is URI, or convert it to URI if it is + # a String. + # + # pkg:gem/uri#lib/uri/rfc2396_parser.rb:528 def convert_to_uri(uri); end # Constructs the default Hash of patterns. # - # source://uri//lib/uri/rfc2396_parser.rb#338 + # pkg:gem/uri#lib/uri/rfc2396_parser.rb:337 def initialize_pattern(opts = T.unsafe(nil)); end # Constructs the default Hash of Regexp's. # - # source://uri//lib/uri/rfc2396_parser.rb#496 + # pkg:gem/uri#lib/uri/rfc2396_parser.rb:495 def initialize_regexp(pattern); end end -# source://uri//lib/uri/rfc2396_parser.rb#324 +# pkg:gem/uri#lib/uri/rfc2396_parser.rb:323 URI::RFC2396_Parser::TO_S = T.let(T.unsafe(nil), UnboundMethod) -# source://uri//lib/uri/rfc3986_parser.rb#3 +# pkg:gem/uri#lib/uri/rfc3986_parser.rb:3 class URI::RFC3986_Parser - # @return [RFC3986_Parser] a new instance of RFC3986_Parser - # - # source://uri//lib/uri/rfc3986_parser.rb#73 + # pkg:gem/uri#lib/uri/rfc3986_parser.rb:73 def initialize; end # Compatibility for RFC2396 parser # - # source://uri//lib/uri/rfc3986_parser.rb#156 + # pkg:gem/uri#lib/uri/rfc3986_parser.rb:156 def escape(str, unsafe = T.unsafe(nil)); end # Compatibility for RFC2396 parser # - # source://uri//lib/uri/rfc3986_parser.rb#144 + # pkg:gem/uri#lib/uri/rfc3986_parser.rb:144 def extract(str, schemes = T.unsafe(nil), &block); end - # source://uri//lib/uri/rfc3986_parser.rb#169 + # pkg:gem/uri#lib/uri/rfc3986_parser.rb:169 def inspect; end - # source://uri//lib/uri/rfc3986_parser.rb#138 + # pkg:gem/uri#lib/uri/rfc3986_parser.rb:138 def join(*uris); end # Compatibility for RFC2396 parser # - # source://uri//lib/uri/rfc3986_parser.rb#150 + # pkg:gem/uri#lib/uri/rfc3986_parser.rb:150 def make_regexp(schemes = T.unsafe(nil)); end - # source://uri//lib/uri/rfc3986_parser.rb#134 + # pkg:gem/uri#lib/uri/rfc3986_parser.rb:134 def parse(uri); end - # Returns the value of attribute regexp. - # - # source://uri//lib/uri/rfc3986_parser.rb#71 + # pkg:gem/uri#lib/uri/rfc3986_parser.rb:71 def regexp; end - # source://uri//lib/uri/rfc3986_parser.rb#77 + # pkg:gem/uri#lib/uri/rfc3986_parser.rb:77 def split(uri); end # Compatibility for RFC2396 parser # - # source://uri//lib/uri/rfc3986_parser.rb#162 + # pkg:gem/uri#lib/uri/rfc3986_parser.rb:162 def unescape(str, escaped = T.unsafe(nil)); end private - # source://uri//lib/uri/rfc3986_parser.rb#194 + # pkg:gem/uri#lib/uri/rfc3986_parser.rb:194 def convert_to_uri(uri); end - # source://uri//lib/uri/rfc3986_parser.rb#180 + # pkg:gem/uri#lib/uri/rfc3986_parser.rb:180 def default_regexp; end end -# source://uri//lib/uri/rfc3986_parser.rb#33 +# pkg:gem/uri#lib/uri/rfc3986_parser.rb:33 URI::RFC3986_Parser::FRAGMENT = T.let(T.unsafe(nil), String) # URI defined in RFC3986 # -# source://uri//lib/uri/rfc3986_parser.rb#5 +# pkg:gem/uri#lib/uri/rfc3986_parser.rb:5 URI::RFC3986_Parser::HOST = T.let(T.unsafe(nil), Regexp) -# source://uri//lib/uri/rfc3986_parser.rb#54 +# pkg:gem/uri#lib/uri/rfc3986_parser.rb:54 URI::RFC3986_Parser::RFC3986_relative_ref = T.let(T.unsafe(nil), Regexp) -# source://uri//lib/uri/rfc3986_parser.rb#30 +# pkg:gem/uri#lib/uri/rfc3986_parser.rb:30 URI::RFC3986_Parser::SCHEME = T.let(T.unsafe(nil), String) -# source://uri//lib/uri/rfc3986_parser.rb#31 +# pkg:gem/uri#lib/uri/rfc3986_parser.rb:31 URI::RFC3986_Parser::SEG = T.let(T.unsafe(nil), String) -# source://uri//lib/uri/rfc3986_parser.rb#32 +# pkg:gem/uri#lib/uri/rfc3986_parser.rb:32 URI::RFC3986_Parser::SEG_NC = T.let(T.unsafe(nil), String) -# source://uri//lib/uri/rfc3986_parser.rb#28 +# pkg:gem/uri#lib/uri/rfc3986_parser.rb:28 URI::RFC3986_Parser::USERINFO = T.let(T.unsafe(nil), Regexp) -# source://uri//lib/uri/common.rb#94 -module URI::Schemes; end +# pkg:gem/uri#lib/uri/common.rb:97 +module URI::Schemes + class << self + # Use Lo category chars as escaped chars for TruffleRuby, which + # does not allow Symbol categories as identifiers. + # + # pkg:gem/uri#lib/uri/common.rb:104 + def escape(name); end + + # pkg:gem/uri#lib/uri/common.rb:115 + def find(name); end + + # pkg:gem/uri#lib/uri/common.rb:126 + def list; end -# source://uri//lib/uri/common.rb#107 + # pkg:gem/uri#lib/uri/common.rb:119 + def register(name, klass); end + + # pkg:gem/uri#lib/uri/common.rb:111 + def unescape(name); end + end +end + +# pkg:gem/uri#lib/uri/common.rb:123 URI::Schemes::FILE = URI::File -# source://uri//lib/uri/common.rb#107 +# pkg:gem/uri#lib/uri/common.rb:123 URI::Schemes::FTP = URI::FTP -# source://uri//lib/uri/common.rb#107 +# pkg:gem/uri#lib/uri/common.rb:123 URI::Schemes::HTTP = URI::HTTP -# source://uri//lib/uri/common.rb#107 +# pkg:gem/uri#lib/uri/common.rb:123 URI::Schemes::HTTPS = URI::HTTPS -# source://uri//lib/uri/common.rb#107 +# pkg:gem/uri#lib/uri/common.rb:123 URI::Schemes::LDAP = URI::LDAP -# source://uri//lib/uri/common.rb#107 +# pkg:gem/uri#lib/uri/common.rb:123 URI::Schemes::LDAPS = URI::LDAPS -# source://uri//lib/uri/common.rb#107 +# pkg:gem/uri#lib/uri/common.rb:123 URI::Schemes::MAILTO = URI::MailTo -# source://uri//lib/uri/common.rb#107 -URI::Schemes::SOURCE = Tapioca::SourceURI - -# source://uri//lib/uri/common.rb#107 +# pkg:gem/uri#lib/uri/common.rb:123 URI::Schemes::WS = URI::WS -# source://uri//lib/uri/common.rb#107 +# pkg:gem/uri#lib/uri/common.rb:123 URI::Schemes::WSS = URI::WSS -# source://uri//lib/uri/common.rb#312 +# pkg:gem/uri#lib/uri/common.rb:347 URI::TBLENCURICOMP_ = T.let(T.unsafe(nil), Hash) -# source://uri//lib/uri/common.rb#62 +# pkg:gem/uri#lib/uri/common.rb:65 module URI::Util private - # source://uri//lib/uri/common.rb#63 + # pkg:gem/uri#lib/uri/common.rb:66 def make_components_hash(klass, array_hash); end class << self - # source://uri//lib/uri/common.rb#63 + # pkg:gem/uri#lib/uri/common.rb:94 def make_components_hash(klass, array_hash); end end end @@ -2304,7 +2345,7 @@ end # supported in Internet Explorer 5 and 6, before the MS04-004 security # update. See <URL:http://support.microsoft.com/kb/834489>. # -# source://uri//lib/uri/ws.rb#22 +# pkg:gem/uri#lib/uri/ws.rb:22 class URI::WS < ::URI::Generic # == Description # @@ -2318,7 +2359,7 @@ class URI::WS < ::URI::Generic # uri = URI::WS.build(path: '/foo/bar', query: 'test=true') # uri.request_uri # => "/foo/bar?test=true" # - # source://uri//lib/uri/ws.rb#74 + # pkg:gem/uri#lib/uri/ws.rb:74 def request_uri; end class << self @@ -2343,7 +2384,7 @@ class URI::WS < ::URI::Generic # Currently, if passed userinfo components this method generates # invalid WS URIs as per RFC 1738. # - # source://uri//lib/uri/ws.rb#56 + # pkg:gem/uri#lib/uri/ws.rb:56 def build(args); end end end @@ -2352,10 +2393,10 @@ end # than 'ws:'. Other than that, WSS URIs are identical to WS URIs; # see URI::WS. # -# source://uri//lib/uri/wss.rb#17 +# pkg:gem/uri#lib/uri/wss.rb:17 class URI::WSS < ::URI::WS; end # A Default port of 443 for URI::WSS # -# source://uri//lib/uri/wss.rb#19 +# pkg:gem/uri#lib/uri/wss.rb:19 URI::WSS::DEFAULT_PORT = T.let(T.unsafe(nil), Integer) diff --git a/test/shale/builder_test.rb b/test/shale/builder_test.rb index 31bdb09..020b80e 100644 --- a/test/shale/builder_test.rb +++ b/test/shale/builder_test.rb @@ -78,8 +78,8 @@ class TestMultipleClientTransactionType < TestTransactionType assert !TestTransactionType.include?(mod_child) assert TestEnhancedTransactionType.include?(mod_child) assert TestEnhancedTransactionType.include?(mod_parent) - assert_equal %i[memo_amount amount], mod_parent.instance_methods - assert_equal %i[client_data memo_client_data], mod_child.instance_methods + assert_equal %i[amount memo_amount], mod_parent.instance_methods + assert_equal %i[memo_client_data client_data], mod_child.instance_methods end should 'correctly build an instance of a subclass' do @@ -149,7 +149,7 @@ class TestMultipleClientTransactionType < TestTransactionType mod = TestTransactionType.builder_methods_module assert mod.is_a?(::Module) assert TestTransactionType.include?(mod) - assert_equal %i[memo_amount amount], mod.instance_methods + assert_equal %i[amount memo_amount], mod.instance_methods end should 'not define a new method for an attribute when it is a primitive' do @@ -157,10 +157,10 @@ class TestMultipleClientTransactionType < TestTransactionType test_subclass.include ::Shale::Builder mod = test_subclass.builder_methods_module - assert !mod.instance_methods.include?(:type) + assert !mod.method_defined?(:type) test_subclass.attribute :type, ::Shale::Type::String - assert !mod.instance_methods.include?(:type) + assert !mod.method_defined?(:type) test_subclass.new.type do |_| assert false end @@ -171,10 +171,10 @@ class TestMultipleClientTransactionType < TestTransactionType test_subclass.include ::Shale::Builder mod = test_subclass.builder_methods_module - assert !mod.instance_methods.include?(:transaction) + assert !mod.method_defined?(:transaction) test_subclass.attribute :transaction, TestTransactionType - assert mod.instance_methods.include?(:transaction) + assert mod.method_defined?(:transaction) test_object = test_subclass.new assert_nil test_object.transaction From 52d4538b590437b8ea882b7c6d493d38ac90f666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zaporski?= <focus16k@gmail.com> Date: Tue, 28 Apr 2026 16:33:48 +0200 Subject: [PATCH 2/3] Update config --- .github/workflows/ci.yml | 10 +++++----- .ruby-version | 2 +- Gemfile.lock | 3 ++- test/shale/builder_test.rb | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb92a32..efab0ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI Ruby on: push: - branches: [ 'main', 'develop' ] + branches: [ "main", "develop" ] pull_request: - branches: [ 'main', 'develop' ] + branches: [ "main", "develop" ] jobs: test: @@ -13,7 +13,7 @@ jobs: CI: true strategy: matrix: - ruby-version: ['3.2', '3.3', '3.4'] + ruby-version: [ "3.3", "3.4", "4.0" ] steps: - name: Checkout code uses: actions/checkout@v3 @@ -35,7 +35,7 @@ jobs: - name: Install Ruby and gems uses: ruby/setup-ruby@v1 with: - ruby-version: '3.2' + ruby-version: "4.0" bundler-cache: true - name: Lint Ruby files run: bundle exec rubocop --parallel @@ -50,7 +50,7 @@ jobs: - name: Install Ruby and gems uses: ruby/setup-ruby@v1 with: - ruby-version: '3.2' + ruby-version: "4.0" bundler-cache: true - name: Typecheck Ruby files run: bundle exec srb tc diff --git a/.ruby-version b/.ruby-version index 7921bd0..8b52f98 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.8 +ruby-4.0.3 diff --git a/Gemfile.lock b/Gemfile.lock index ab60dee..6cc04ae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -135,6 +135,7 @@ PLATFORMS arm64-darwin-20 arm64-darwin-22 arm64-darwin-24 + arm64-darwin-25 x86_64-linux DEPENDENCIES @@ -154,4 +155,4 @@ DEPENDENCIES tapioca (> 0.19) BUNDLED WITH - 2.7.2 + 4.0.10 diff --git a/test/shale/builder_test.rb b/test/shale/builder_test.rb index 020b80e..69155f8 100644 --- a/test/shale/builder_test.rb +++ b/test/shale/builder_test.rb @@ -78,8 +78,8 @@ class TestMultipleClientTransactionType < TestTransactionType assert !TestTransactionType.include?(mod_child) assert TestEnhancedTransactionType.include?(mod_child) assert TestEnhancedTransactionType.include?(mod_parent) - assert_equal %i[amount memo_amount], mod_parent.instance_methods - assert_equal %i[memo_client_data client_data], mod_child.instance_methods + assert_equal %i[amount memo_amount], mod_parent.instance_methods.sort + assert_equal %i[client_data memo_client_data], mod_child.instance_methods.sort end should 'correctly build an instance of a subclass' do @@ -149,7 +149,7 @@ class TestMultipleClientTransactionType < TestTransactionType mod = TestTransactionType.builder_methods_module assert mod.is_a?(::Module) assert TestTransactionType.include?(mod) - assert_equal %i[amount memo_amount], mod.instance_methods + assert_equal %i[amount memo_amount], mod.instance_methods.sort end should 'not define a new method for an attribute when it is a primitive' do From a24d9a6a13a2a9f302529d0f528336cdaab9f792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zaporski?= <focus16k@gmail.com> Date: Tue, 28 Apr 2026 16:45:26 +0200 Subject: [PATCH 3/3] Update the required ruby version --- .rubocop.yml | 2 +- shale-builder.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 3c5e341..9cc43c4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ inherit_gem: rubocop-espago: sorbet.yml AllCops: - TargetRubyVersion: 3.1 + TargetRubyVersion: 3.2 Exclude: - lib/tapioca/**/*.rb diff --git a/shale-builder.gemspec b/shale-builder.gemspec index d6c6d34..fc4ed68 100644 --- a/shale-builder.gemspec +++ b/shale-builder.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |spec| spec.description = spec.summary spec.homepage = 'https://github.com/Verseth/ruby-shale-builder' spec.license = 'MIT' - spec.required_ruby_version = '>= 3.1.0' + spec.required_ruby_version = '>= 3.2.0' spec.metadata['homepage_uri'] = spec.homepage spec.metadata['source_code_uri'] = spec.homepage