From ed87fb3c171f006fe05ad42219c7f40682a31ce9 Mon Sep 17 00:00:00 2001 From: Jacobo Bouzas Quiroga Date: Wed, 27 Nov 2024 12:29:52 +0100 Subject: [PATCH] chore: update sorbet version and fixes --- Gemfile | 5 +- Gemfile.lock | 46 +- examples/sinatra-pet-shelter/Gemfile | 2 +- examples/sinatra-pet-shelter/Gemfile.lock | 56 +- .../sorbet/rbi/gems/rbi@0.1.14.rbi | 4 +- ...73ddd272417ca8026e5f13e1103b4c72897824.rbi | 14 +- .../sorbet/rbi/gems/spoom@1.5.0.rbi | 30 +- .../sorbet/rbi/gems/tapioca@0.15.1.rbi | 12 +- .../sorbet/rbi/gems/yard-sorbet@0.9.0.rbi | 2 +- lib/resource_registry.rb | 7 +- lib/schema_generator.rb | 34 - resource_registry-0.0.0.gem | Bin 0 -> 5632 bytes resource_registry.gemspec | 34 +- sorbet/rbi/dsl/.gitattributes | 1 + sorbet/rbi/dsl/active_support/callbacks.rbi | 23 + sorbet/rbi/gems/activesupport.rbi | 1245 -- sorbet/rbi/gems/base64@0.2.0.rbi | 502 +- sorbet/rbi/gems/bigdecimal.rbi | 86 - sorbet/rbi/gems/bigdecimal@3.1.8.rbi | 73 +- sorbet/rbi/gems/concurrent-ruby.rbi | 1651 --- sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi | 11640 +++++++++++++++- sorbet/rbi/gems/connection_pool.rbi | 60 - sorbet/rbi/gems/drb.rbi | 220 - sorbet/rbi/gems/drb@2.2.1.rbi | 46 + sorbet/rbi/gems/i18n.rbi | 322 - sorbet/rbi/gems/minitest.rbi | 440 - sorbet/rbi/gems/minitest@5.25.1.rbi | 1541 +- sorbet/rbi/gems/polyfill.rbi | 335 - sorbet/rbi/gems/rbi@0.1.13.rbi | 4 +- sorbet/rbi/gems/rspec-core.rbi | 1982 --- sorbet/rbi/gems/rspec-core@3.13.0.rbi | 12 +- sorbet/rbi/gems/rspec-expectations.rbi | 1193 -- sorbet/rbi/gems/rspec-expectations@3.13.1.rbi | 8167 +++++++++++ sorbet/rbi/gems/rspec-mocks.rbi | 1115 -- sorbet/rbi/gems/rspec-mocks@3.13.1.rbi | 2 +- sorbet/rbi/gems/rspec-sorbet@1.9.2.rbi | 2 +- sorbet/rbi/gems/rspec-support.rbi | 288 - sorbet/rbi/gems/rspec-support@3.13.1.rbi | 35 + sorbet/rbi/gems/rspec.rbi | 15 - sorbet/rbi/gems/safe_type.rbi | 112 - sorbet/rbi/gems/sorbet-coerce.rbi | 37 - sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi | 2 +- sorbet/rbi/gems/spoom@1.4.2.rbi | 30 +- sorbet/rbi/gems/tapioca@0.15.1.rbi | 12 +- sorbet/rbi/gems/tzinfo.rbi | 591 - sorbet/rbi/gems/tzinfo@2.0.6.rbi | 5913 +++++++- sorbet/rbi/gems/yard-sorbet@0.9.0.rbi | 2 +- sorbet/rbi/gems/yard@0.9.36.rbi | 44 +- 48 files changed, 28095 insertions(+), 9894 deletions(-) delete mode 100644 lib/schema_generator.rb create mode 100644 resource_registry-0.0.0.gem create mode 100644 sorbet/rbi/dsl/.gitattributes create mode 100644 sorbet/rbi/dsl/active_support/callbacks.rbi delete mode 100644 sorbet/rbi/gems/activesupport.rbi delete mode 100644 sorbet/rbi/gems/bigdecimal.rbi delete mode 100644 sorbet/rbi/gems/concurrent-ruby.rbi delete mode 100644 sorbet/rbi/gems/connection_pool.rbi delete mode 100644 sorbet/rbi/gems/drb.rbi delete mode 100644 sorbet/rbi/gems/i18n.rbi delete mode 100644 sorbet/rbi/gems/minitest.rbi delete mode 100644 sorbet/rbi/gems/polyfill.rbi delete mode 100644 sorbet/rbi/gems/rspec-core.rbi delete mode 100644 sorbet/rbi/gems/rspec-expectations.rbi create mode 100644 sorbet/rbi/gems/rspec-expectations@3.13.1.rbi delete mode 100644 sorbet/rbi/gems/rspec-mocks.rbi delete mode 100644 sorbet/rbi/gems/rspec-support.rbi delete mode 100644 sorbet/rbi/gems/rspec.rbi delete mode 100644 sorbet/rbi/gems/safe_type.rbi delete mode 100644 sorbet/rbi/gems/sorbet-coerce.rbi delete mode 100644 sorbet/rbi/gems/tzinfo.rbi diff --git a/Gemfile b/Gemfile index 188ad31..642ac94 100644 --- a/Gemfile +++ b/Gemfile @@ -2,12 +2,11 @@ source "https://rubygems.org" -gem "activesupport" gem "rspec" gem "rspec-json_expectations" gem "rspec-sorbet", "~> 1.9.2" -gem "sorbet-coerce", ">= 0.2.6" -gem "sorbet-static-and-runtime", ">= 0.5.11609" +gem "sorbet-coerce", "~> 0.7" +gem "sorbet-static-and-runtime", "0.5.11670" gem "tapioca", "~> 0.15.1", require: false gem "syntax_tree", "~> 6.2", require: false diff --git a/Gemfile.lock b/Gemfile.lock index f17f896..93dac9b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,26 +1,8 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.2.2) - base64 - benchmark (>= 0.3) - bigdecimal - concurrent-ruby (~> 1.0, >= 1.3.1) - connection_pool (>= 2.2.5) - drb - i18n (>= 1.6, < 2) - logger (>= 1.4.2) - minitest (>= 5.1) - securerandom (>= 0.3) - tzinfo (~> 2.0, >= 2.0.5) - base64 (0.2.0) - benchmark (0.3.0) - bigdecimal (3.1.8) coderay (1.1.3) - concurrent-ruby (1.3.4) - connection_pool (2.4.1) diff-lcs (1.5.1) - drb (2.2.1) erubi (1.12.0) ffi (1.17.0-arm64-darwin) ffi (1.17.0-x86_64-linux-gnu) @@ -39,15 +21,11 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) - i18n (1.14.6) - concurrent-ruby (~> 1.0) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.1) lumberjack (1.2.10) method_source (1.1.0) - minitest (5.25.1) nenv (0.3.0) netrc (0.11.0) notiffany (0.1.3) @@ -83,20 +61,19 @@ GEM sorbet-runtime rspec-support (3.13.1) safe_type (1.1.1) - securerandom (0.3.1) shellany (0.0.1) - sorbet (0.5.11609) - sorbet-static (= 0.5.11609) + sorbet (0.5.11670) + sorbet-static (= 0.5.11670) sorbet-coerce (0.7.0) polyfill (~> 1.8) safe_type (~> 1.1, >= 1.1.1) sorbet-runtime (>= 0.4.4704) - sorbet-runtime (0.5.11609) - sorbet-static (0.5.11609-universal-darwin) - sorbet-static (0.5.11609-x86_64-linux) - sorbet-static-and-runtime (0.5.11609) - sorbet (= 0.5.11609) - sorbet-runtime (= 0.5.11609) + sorbet-runtime (0.5.11670) + sorbet-static (0.5.11670-universal-darwin) + sorbet-static (0.5.11670-x86_64-linux) + sorbet-static-and-runtime (0.5.11670) + sorbet (= 0.5.11670) + sorbet-runtime (= 0.5.11670) spoom (1.4.2) erubi (>= 1.10.0) prism (>= 0.28.0) @@ -114,8 +91,6 @@ GEM thor (>= 1.2.0) yard-sorbet thor (1.3.0) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) yard (0.9.36) yard-sorbet (0.9.0) sorbet-runtime @@ -126,14 +101,13 @@ PLATFORMS x86_64-linux DEPENDENCIES - activesupport guard guard-rspec rspec rspec-json_expectations rspec-sorbet (~> 1.9.2) - sorbet-coerce (>= 0.2.6) - sorbet-static-and-runtime (>= 0.5.11609) + sorbet-coerce (~> 0.7) + sorbet-static-and-runtime (= 0.5.11670) syntax_tree (~> 6.2) tapioca (~> 0.15.1) diff --git a/examples/sinatra-pet-shelter/Gemfile b/examples/sinatra-pet-shelter/Gemfile index 06d2a2b..1787fbc 100644 --- a/examples/sinatra-pet-shelter/Gemfile +++ b/examples/sinatra-pet-shelter/Gemfile @@ -5,7 +5,7 @@ source "https://rubygems.org" gem "json" gem "resource_registry", github: "factorialco/resource-registry", - branch: "adding-example-app" + branch: "chore/update-sorbet-version-and-fixes" gem "sinatra" gem "sinatra-contrib" gem "tapioca", "~> 0.15.1", require: false diff --git a/examples/sinatra-pet-shelter/Gemfile.lock b/examples/sinatra-pet-shelter/Gemfile.lock index 0091787..81b2848 100644 --- a/examples/sinatra-pet-shelter/Gemfile.lock +++ b/examples/sinatra-pet-shelter/Gemfile.lock @@ -1,26 +1,48 @@ GIT remote: https://github.com/factorialco/resource-registry.git - revision: 2b73ddd272417ca8026e5f13e1103b4c72897824 - branch: adding-example-app + revision: a621f442492ec55ad4433a710dd90217bf59a516 + branch: chore/update-sorbet-version-and-fixes specs: resource_registry (0.0.0) - dry-inflector (= 1.1.0) - sorbet-coerce (>= 0.2.6) - sorbet-runtime (= 0.5.11609) + activesupport (~> 7.1.3) + sorbet-coerce (~> 0.2.6) + sorbet-runtime (= 0.5.11670) GEM remote: https://rubygems.org/ specs: + activesupport (7.1.5) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + mutex_m + securerandom (>= 0.3) + tzinfo (~> 2.0) base64 (0.2.0) + benchmark (0.4.0) + bigdecimal (3.1.8) coderay (1.1.3) + concurrent-ruby (1.3.4) + connection_pool (2.4.1) diff-lcs (1.5.1) - dry-inflector (1.1.0) + drb (2.2.1) erubi (1.13.0) + i18n (1.14.6) + concurrent-ruby (~> 1.0) json (2.7.2) + logger (1.6.1) method_source (1.1.0) + minitest (5.25.2) multi_json (1.15.0) mustermann (3.0.3) ruby2_keywords (~> 0.0.1) + mutex_m (0.3.0) netrc (0.11.0) parallel (1.26.3) polyfill (1.9.0) @@ -52,6 +74,7 @@ GEM rspec-support (3.13.1) ruby2_keywords (0.0.5) safe_type (1.1.1) + securerandom (0.3.2) sinatra (3.2.0) mustermann (~> 3.0) rack (~> 2.2, >= 2.2.4) @@ -63,18 +86,19 @@ GEM rack-protection (= 3.2.0) sinatra (= 3.2.0) tilt (~> 2.0) - sorbet (0.5.11609) - sorbet-static (= 0.5.11609) - sorbet-coerce (0.7.0) + sorbet (0.5.11670) + sorbet-static (= 0.5.11670) + sorbet-coerce (0.2.7) polyfill (~> 1.8) safe_type (~> 1.1, >= 1.1.1) + sorbet (>= 0.4.4704) sorbet-runtime (>= 0.4.4704) - sorbet-runtime (0.5.11609) - sorbet-static (0.5.11609-universal-darwin) - sorbet-static (0.5.11609-x86_64-linux) - sorbet-static-and-runtime (0.5.11609) - sorbet (= 0.5.11609) - sorbet-runtime (= 0.5.11609) + sorbet-runtime (0.5.11670) + sorbet-static (0.5.11670-universal-darwin) + sorbet-static (0.5.11670-x86_64-linux) + sorbet-static-and-runtime (0.5.11670) + sorbet (= 0.5.11670) + sorbet-runtime (= 0.5.11670) spoom (1.5.0) erubi (>= 1.10.0) prism (>= 0.28.0) @@ -91,6 +115,8 @@ GEM yard-sorbet thor (1.3.2) tilt (2.4.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) yard (0.9.37) yard-sorbet (0.9.0) sorbet-runtime diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/rbi@0.1.14.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rbi@0.1.14.rbi index f7e518b..e3b0534 100644 --- a/examples/sinatra-pet-shelter/sorbet/rbi/gems/rbi@0.1.14.rbi +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rbi@0.1.14.rbi @@ -2099,7 +2099,7 @@ class RBI::Rewriters::Merge::Conflict < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2316,7 +2316,7 @@ class RBI::Rewriters::RemoveKnownDefinitions::Operation < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/resource_registry@0.0.0-2b73ddd272417ca8026e5f13e1103b4c72897824.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/resource_registry@0.0.0-2b73ddd272417ca8026e5f13e1103b4c72897824.rbi index 64e218b..2fb54ac 100644 --- a/examples/sinatra-pet-shelter/sorbet/rbi/gems/resource_registry@0.0.0-2b73ddd272417ca8026e5f13e1103b4c72897824.rbi +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/resource_registry@0.0.0-2b73ddd272417ca8026e5f13e1103b4c72897824.rbi @@ -642,7 +642,7 @@ class ResourceRegistry::Relationship < ::T::Struct def should_skip_argument?(argument); end class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end # source://resource_registry//lib/public/relationship.rb#39 @@ -1047,7 +1047,7 @@ class ResourceRegistry::Repositories::OutputContexts::PageInfoDto < ::T::Struct const :end_cursor, T.nilable(::String), default: T.unsafe(nil) class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -1219,7 +1219,7 @@ class ResourceRegistry::Resource < ::T::Struct def inflector; end class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end # source://resource_registry//lib/public/resource.rb#220 @@ -1341,7 +1341,7 @@ class ResourceRegistry::Verb < ::T::Struct def inflector; end class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end # @raise [ArgumentError] @@ -1486,7 +1486,7 @@ class SchemaRegistry::FilterField < ::T::Struct const :in_memory, T::Boolean, default: T.unsafe(nil) class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -1724,7 +1724,7 @@ class SchemaRegistry::Property < ::T::Struct def value_object?; end class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -1864,7 +1864,7 @@ class SchemaRegistry::Schema < ::T::Struct def inflector; end class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end # source://resource_registry//lib/schema_registry/schema.rb#84 diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/spoom@1.5.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/spoom@1.5.0.rbi index b0b590b..dce5d9c 100644 --- a/examples/sinatra-pet-shelter/sorbet/rbi/gems/spoom@1.5.0.rbi +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/spoom@1.5.0.rbi @@ -1004,7 +1004,7 @@ class Spoom::Coverage::D3::ColorPalette < ::T::Struct prop :strong, ::String class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -1344,7 +1344,7 @@ class Spoom::Coverage::Snapshot < ::T::Struct sig { params(obj: T::Hash[::String, T.untyped]).returns(::Spoom::Coverage::Snapshot) } def from_obj(obj); end - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -1480,7 +1480,7 @@ class Spoom::Deadcode::Definition < ::T::Struct def to_json(*args); end class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2368,7 +2368,7 @@ class Spoom::Deadcode::Send < ::T::Struct def each_arg_assoc(&block); end class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2388,7 +2388,7 @@ class Spoom::ExecResult < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2586,7 +2586,7 @@ class Spoom::FileTree::Node < ::T::Struct def path; end class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2652,7 +2652,7 @@ class Spoom::Git::Commit < ::T::Struct def timestamp; end class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end # Parse a line formatted as `%h %at` into a `Commit` @@ -2764,7 +2764,7 @@ class Spoom::LSP::Diagnostic < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Diagnostic) } def from_json(json); end - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2797,7 +2797,7 @@ class Spoom::LSP::DocumentSymbol < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::DocumentSymbol) } def from_json(json); end - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2855,7 +2855,7 @@ class Spoom::LSP::Hover < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Hover) } def from_json(json); end - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2880,7 +2880,7 @@ class Spoom::LSP::Location < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Location) } def from_json(json); end - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2943,7 +2943,7 @@ class Spoom::LSP::Position < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Position) } def from_json(json); end - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2981,7 +2981,7 @@ class Spoom::LSP::Range < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Range) } def from_json(json); end - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -3047,7 +3047,7 @@ class Spoom::LSP::SignatureHelp < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::SignatureHelp) } def from_json(json); end - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -3473,7 +3473,7 @@ class Spoom::Model::Reference < ::T::Struct sig { params(name: ::String, location: ::Spoom::Location).returns(::Spoom::Model::Reference) } def constant(name, location); end - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end # source://spoom//lib/spoom/model/reference.rb#29 diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/tapioca@0.15.1.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/tapioca@0.15.1.rbi index bafa82e..ab02c3b 100644 --- a/examples/sinatra-pet-shelter/sorbet/rbi/gems/tapioca@0.15.1.rbi +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/tapioca@0.15.1.rbi @@ -228,7 +228,7 @@ class RBI::TypedParam < ::T::Struct const :type, ::String class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -1151,7 +1151,7 @@ class Tapioca::ConfigHelper::ConfigError < ::T::Struct const :message_parts, T::Array[::Tapioca::ConfigHelper::ConfigErrorMessagePart] class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -1162,7 +1162,7 @@ class Tapioca::ConfigHelper::ConfigErrorMessagePart < ::T::Struct const :colors, T::Array[::Symbol] class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2203,7 +2203,7 @@ class Tapioca::GemInfo < ::T::Struct sig { params(spec: ::Bundler::LazySpecification).returns(::Tapioca::GemInfo) } def from_spec(spec); end - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2495,7 +2495,7 @@ class Tapioca::Loaders::Loader # @param engine [T.class_of(Rails::Engine)] # @return [Array] # - # source://sorbet-runtime/0.5.11609/lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11670/lib/types/private/methods/_methods.rb#257 def eager_load_paths(*args, **_arg1, &blk); end # source://tapioca//lib/tapioca/loaders/loader.rb#188 @@ -3403,7 +3403,7 @@ module Tapioca::Static::SymbolLoader # @return [Array] # - # source://sorbet-runtime/0.5.11609/lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11670/lib/types/private/methods/_methods.rb#257 def engines(*args, **_arg1, &blk); end # source://tapioca//lib/tapioca/static/symbol_loader.rb#82 diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi index 7a68b98..3889d4b 100644 --- a/examples/sinatra-pet-shelter/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi @@ -388,7 +388,7 @@ class YARDSorbet::TStructProp < ::T::Struct const :types, T::Array[::String] class << self - # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end diff --git a/lib/resource_registry.rb b/lib/resource_registry.rb index 54132e7..f34487b 100644 --- a/lib/resource_registry.rb +++ b/lib/resource_registry.rb @@ -8,12 +8,15 @@ require "public/versions" require "public/versions/version" require "public/entity_finder" +require "public/resource_struct_builder" +require "public/registry" +require "public/serializer" +require "public/repositories/base" +require "schema_registry/registry" require "schema_registry/json_schema_mapper" require "schema_registry/maybe" require "schema_registry/generate_from_struct" require "runtime_generic" -require "public/resource_struct_builder" -require "public/registry" # Entry point for ResourceRegistry module ResourceRegistry diff --git a/lib/schema_generator.rb b/lib/schema_generator.rb deleted file mode 100644 index e12cbc2..0000000 --- a/lib/schema_generator.rb +++ /dev/null @@ -1,34 +0,0 @@ -# typed: strict - -require_relative "./schema_registry/generate_from_struct" - -module ResourceRegistry - class SchemaGenerator - extend T::Sig - - Repository = - T.type_alias { T.class_of(ResourceRegistry::Repositories::Base) } - - sig do - params(repository: Repository).returns(T.nilable(SchemaRegistry::Schema)) - end - def generate(repository:) - struct_klass = ResourceRegistry::EntityFinder.call(repository: repository) - return nil unless struct_klass - - definition = - SchemaRegistry::GenerateFromStruct.new(struct_klass: struct_klass).call - SchemaRegistry::JsonSchemaMapper.new( - namespace: repository.namespace, - definition: definition - ).call - end - - private - - sig { params(repo: Repository).returns(Symbol) } - def identifier_from_repo(repo) - "#{repo.namespace.underscore}.#{T.must(repo.name).underscore.singularize}".to_sym - end - end -end diff --git a/resource_registry-0.0.0.gem b/resource_registry-0.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..4af2741ffbc47f28e5d373f0a0a875da77af0747 GIT binary patch literal 5632 zcmeHKX*?9_8Xp;h8B3O!qtFOpiWw$Lq!5yWY*}i;AR{I*GqN1pq)ueXzGNv=hU{dC zvLB8mJCTrV4Kqer!gQ0)RlOpiUqGhY^33Lx0|vh$lGt zd~xX}*45SX&xUWt|H=NZ*uDn$&GNtNRPr7dV4cm-Z6Et^@|4#gVt@M-(o=J(U{gJn_D{9KaAw-}owcW^S~kg0aG|wgasgZbACs8ep*w&ScoufK-?x$D*Lo%1W>B{a$MsBw=Uz z2>c2EFRPxxiQQK_cEjD$K7_be1#AUgBypfg7rB^zb$v=U66kjlB;PyWl?dhiQv4$V z6gIjSWCt^ND5LsqOKN|7_~yIzF&&49;ksuBvkroL24@^MGI_BidwN-fRdVP<5S8Q) z^WZ!GrKG-Yk#lIR8w-gG4}E`tVZOExKm zY)UP+^}%~|O~?&xL;8!tr59`qn9ai2t~C;WT(r=GOVk4EaJX}tVdQR1-KcN+Zn`ux zT}$(n<7U_Wb@hZ6)B{hwvm6_M@+PRwc`HxOh0N~^tn-1FD3;MIx^yDLqO z>&hrWD#^^pGlRH4(!6f*j3{=F(Vn`;O?gQ zdh*<3xIGXp(558L2zoJt2F7l#N{MKVy-tO<6b&4D72M4OIyw1S#KRZyAhUZxv*H>q zSTa+h=O*7gS-T$eUr@510zDAz7)+EAa1&0pyOCJ+sZBdv}S*3*2g)n z4b8|yl|MCw6eJc-*RAZPH1s&s2XidIuZLc-utVr)!Ewmje!K=$C|yGOyjWJwo#y)m zRb}r7Y+dA6I0_FuKELOpBjsHN_KBVa_~_H6^D+(2LY}DjB*g2Xr>wZ5?*}AwofVdE zmdulh1a)FQNf^_}pcN99E|!%n5T)FWvDi)D`(1g+iHeH!#!Q2*i%GSlgg@#Ru}`P^ zp8?lw?Sz}d9@hYFVFVmI>hJ7Rw`vhlCu)}y_-Lp?)Cx1ySoyF|hGH`ZE0j9kW}3Dk zLwPz!Q8f3+Dz|lnuygt3+Fi}fw}w4?lN44qTOrZSu#BctI~cS9;pg$h_EKl^PioLO zi}Pkjd?@IAROD_6>hULxEvEY9aD9cf_oK25qKG=^V%bS+{Ouu zgWjU2_Rx`_Bfm6;B`@Ran3j>{F3k+_Cl%$jo*IVnu2`RB!lXNFnfCN|pe!W^wccFn zAfR>H_6E*V^r3~IKa3oyjZ51KlgAj+=wS<=6;(9ZVimX(CXtHyzhVxWJ9rfq-$Tz@ zZ53Wim1`@(wGj`NmTcGd>pg#TeVav&hIPMSlo>ane$aT@Q{mIwqQGKH|9D?6i!lX&rxAjP+{t2V!a=Cj}MON&_eSsh~F?93AK4 zw@%ld*fCxX(P26S9wXBGyoR@!)q4!bV4s?PR_39ed4A^9%^_BjnTZYOm0^KX#hTEP zYRg_hLYU%Kd7rDzOmx))A+^azO9T5Oo(EArBir(pDR&pW7wx;p!%te~Ga}xT?p@kn zfPymCG)IxcZCgWn$PTc|$oy+n?gw&=sGNsZjZx3D=zOzLMKg7?Nym?(#RNDs3+RkT zv2SjIwJN0pc%Q!?*tbrZF<@?h>W|s1%o_PqP1>TjU4HR8#mG*{9jevUR6j=?4pary z7Jxx(%iC!@;1C&_#YX~UXSBirqC3&qWlSA5vHz;r-mA0yzMikn;Hja-WQ^|5?iLFjOIzZyBhg3o z_;}eHT>FPe7F)lil*)0YDj2(GP&9gS*krrBGmNgSO=z{(5G?D^u+&3B_3wt9leR%J z6Y!t=pa%M}ch;j`8tTr0iW7tRZQd3yhOldy3NQLxre1|E`WhST^`6Ei`PuR>IWg}p zIeej07KGQSzyY|7Wgc1Ao&8Ns8xKVIxBW701^iMiL=Fp3912aEC&({2))qs~0Qw>4- z?_=9nKUYj$+1pS$9UP)%or9klD?gcf;Ub9|;iTI6PTEI@r+{3RWX=^Di( zz?pd70=6c5@UmRllE;sSxkRJ&AK;Q=g-xq;@0QqLA ARsaA1 literal 0 HcmV?d00001 diff --git a/resource_registry.gemspec b/resource_registry.gemspec index 5d24fa9..78b14d7 100644 --- a/resource_registry.gemspec +++ b/resource_registry.gemspec @@ -1,19 +1,21 @@ Gem::Specification.new do |s| - s.name = 'resource_registry' - s.version = '0.0.0' - s.summary = 'Resource Registry' - s.description = 'A declarative approach to define resources and their relationships' - s.authors = ['Genar Trias Ortiz'] - s.email = 'genar.factorial@factorial.co' - s.files = ['lib/resource_registry.rb', 'lib/public/repositories/base.rb', 'rbi/resource_registry.rbi'] - s.homepage = - 'https://rubygems.org/gems/resource_registry' - s.license = 'MIT' - s.add_dependency 'sorbet-coerce', '>= 0.2.6' - # s.add_runtime_dependency 'sorbet-runtime-stub', '0.2.0' - s.add_development_dependency 'sorbet', '0.5.11609' - s.add_runtime_dependency 'activesupport', '>= 7.1.3' - s.add_runtime_dependency 'dry-inflector', '>= 0.1.2' - s.add_runtime_dependency 'sorbet-runtime', '0.5.11609' + s.name = "resource_registry" + s.version = "0.0.0" + s.summary = "Resource Registry" + s.description = + "A declarative approach to define resources and their relationships" + s.authors = ["Genar Trias Ortiz"] + s.email = "genar.factorial@factorial.co" + s.files = %w[ + lib/resource_registry.rb + lib/public/repositories/base.rb + rbi/resource_registry.rbi + ] + s.homepage = "https://rubygems.org/gems/resource_registry" + s.license = "MIT" + s.required_ruby_version = ">= 3.0" + s.add_dependency "sorbet-coerce", "~> 0.7" + s.add_development_dependency "sorbet", "0.5.11670" + s.add_runtime_dependency "sorbet-runtime", "0.5.11670" # s.add_development_dependency 'tapioca' end diff --git a/sorbet/rbi/dsl/.gitattributes b/sorbet/rbi/dsl/.gitattributes new file mode 100644 index 0000000..d9bb82a --- /dev/null +++ b/sorbet/rbi/dsl/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-generated=true diff --git a/sorbet/rbi/dsl/active_support/callbacks.rbi b/sorbet/rbi/dsl/active_support/callbacks.rbi new file mode 100644 index 0000000..4c1ad13 --- /dev/null +++ b/sorbet/rbi/dsl/active_support/callbacks.rbi @@ -0,0 +1,23 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveSupport::Callbacks`. +# Please instead update this file by running `bin/tapioca dsl ActiveSupport::Callbacks`. + + +module ActiveSupport::Callbacks + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + end +end diff --git a/sorbet/rbi/gems/activesupport.rbi b/sorbet/rbi/gems/activesupport.rbi deleted file mode 100644 index ea8b79f..0000000 --- a/sorbet/rbi/gems/activesupport.rbi +++ /dev/null @@ -1,1245 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: false -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/activesupport/all/activesupport.rbi -# -# activesupport-7.2.0 - -module ActiveSupport - def self.cache_format_version; end - def self.cache_format_version=(value); end - def self.deprecator; end - def self.eager_load!; end - def self.error_reporter; end - def self.error_reporter=(arg0); end - def self.gem_version; end - def self.test_order; end - def self.test_order=(val); end - def self.test_parallelization_threshold; end - def self.test_parallelization_threshold=(val); end - def self.to_time_preserves_timezone; end - def self.to_time_preserves_timezone=(value); end - def self.utc_to_local_returns_utc_offset_times; end - def self.utc_to_local_returns_utc_offset_times=(value); end - def self.version; end - def test_order; end - def test_order=(val); end - def test_parallelization_threshold; end - def test_parallelization_threshold=(val); end - extend ActiveSupport::Autoload - extend ActiveSupport::LazyLoadHooks -end -module ActiveSupport::DeepMergeable - def deep_merge!(other, &block); end - def deep_merge(other, &block); end - def deep_merge?(other); end -end -class Hash - def _deep_transform_keys_in_object!(object, &block); end - def _deep_transform_keys_in_object(object, &block); end - def assert_valid_keys(*valid_keys); end - def blank?; end - def compact_blank!; end - def compact_blank; end - def deep_merge?(other); end - def deep_stringify_keys!; end - def deep_stringify_keys; end - def deep_symbolize_keys!; end - def deep_symbolize_keys; end - def deep_transform_keys!(&block); end - def deep_transform_keys(&block); end - def except!(*keys); end - def extract!(*keys); end - def extractable_options?; end - def present?; end - def reverse_merge!(other_hash); end - def reverse_merge(other_hash); end - def reverse_update(other_hash); end - def slice!(*keys); end - def stringify_keys!; end - def stringify_keys; end - def symbolize_keys!; end - def symbolize_keys; end - def to_options!; end - def to_options; end - def to_param(namespace = nil); end - def to_query(namespace = nil); end - def with_defaults!(other_hash); end - def with_defaults(other_hash); end - include ActiveSupport::DeepMergeable -end -module ActiveSupport::LazyLoadHooks - def execute_hook(name, base, options, block); end - def on_load(name, options = nil, &block); end - def run_load_hooks(name, base = nil); end - def self.extended(base); end - def with_execution_control(name, block, once); end -end -module ActiveSupport::Inflector - def apply_inflections(word, rules, locale = nil); end - def camelize(term, uppercase_first_letter = nil); end - def classify(table_name); end - def const_regexp(camel_cased_word); end - def constantize(camel_cased_word); end - def dasherize(underscored_word); end - def deconstantize(path); end - def demodulize(path); end - def downcase_first(string); end - def foreign_key(class_name, separate_class_name_and_id_with_underscore = nil); end - def humanize(lower_case_and_underscored_word, capitalize: nil, keep_id_suffix: nil); end - def inflections(locale = nil); end - def ordinal(number); end - def ordinalize(number); end - def parameterize(string, separator: nil, preserve_case: nil, locale: nil); end - def pluralize(word, locale = nil); end - def safe_constantize(camel_cased_word); end - def singularize(word, locale = nil); end - def tableize(class_name); end - def titleize(word, keep_id_suffix: nil); end - def transliterate(string, replacement = nil, locale: nil); end - def underscore(camel_cased_word); end - def upcase_first(string); end - extend ActiveSupport::Inflector - extend ActiveSupport::Inflector -end -class ActiveSupport::Inflector::Inflections - def acronym(word); end - def acronyms; end - def acronyms_camelize_regex; end - def acronyms_underscore_regex; end - def clear(scope = nil); end - def define_acronym_regex_patterns; end - def human(rule, replacement); end - def humans; end - def initialize; end - def initialize_dup(orig); end - def irregular(singular, plural); end - def plural(rule, replacement); end - def plurals; end - def self.instance(locale = nil); end - def self.instance_or_fallback(locale); end - def singular(rule, replacement); end - def singulars; end - def uncountable(*words); end - def uncountables; end -end -class ActiveSupport::Inflector::Inflections::Uncountables < Array - def <<(*word); end - def add(words); end - def delete(entry); end - def initialize; end - def to_regex(string); end - def uncountable?(str); end -end -module ActiveSupport::Autoload - def autoload(const_name, path = nil); end - def autoload_at(path); end - def autoload_under(path); end - def eager_autoload; end - def eager_load!; end -end -module ActiveSupport::VERSION -end -module ActiveSupport::Concern - def append_features(base); end - def class_methods(&class_methods_module_definition); end - def included(base = nil, &block); end - def prepend_features(base); end - def prepended(base = nil, &block); end - def self.extended(base); end -end -class ActiveSupport::Concern::MultipleIncludedBlocks < StandardError - def initialize; end -end -class ActiveSupport::Concern::MultiplePrependBlocks < StandardError - def initialize; end -end -class Module - def cattr_accessor(*syms, instance_reader: nil, instance_writer: nil, instance_accessor: nil, default: nil, &blk); end - def cattr_reader(*syms, instance_reader: nil, instance_accessor: nil, default: nil, location: nil); end - def cattr_writer(*syms, instance_writer: nil, instance_accessor: nil, default: nil, location: nil); end - def delegate(*methods, to: nil, prefix: nil, allow_nil: nil, private: nil); end - def delegate_missing_to(target, allow_nil: nil); end - def mattr_accessor(*syms, instance_reader: nil, instance_writer: nil, instance_accessor: nil, default: nil, &blk); end - def mattr_reader(*syms, instance_reader: nil, instance_accessor: nil, default: nil, location: nil); end - def mattr_writer(*syms, instance_writer: nil, instance_accessor: nil, default: nil, location: nil); end - def method_visibility(method); end - def redefine_method(method, &block); end - def redefine_singleton_method(method, &block); end - def remove_possible_method(method); end - def remove_possible_singleton_method(method); end - def silence_redefinition_of_method(method); end -end -module ActiveSupport::LoggerThreadSafeLevel - def level; end - def local_level; end - def local_level=(level); end - def local_level_key; end - def log_at(level); end - extend ActiveSupport::Concern -end -module ActiveSupport::LoggerSilence - def silence(severity = nil); end - extend ActiveSupport::Concern -end -class ActiveSupport::Logger < Logger - def initialize(*args, **kwargs); end - def self.logger_outputs_to?(logger, *sources); end - def self.normalize_sources(sources); end - def self.silencer; end - def self.silencer=(val); end - def silencer; end - def silencer=(val); end - include ActiveSupport::LoggerSilence - include ActiveSupport::LoggerThreadSafeLevel -end -class ActiveSupport::Logger::SimpleFormatter < Logger::Formatter - def call(severity, timestamp, progname, msg); end -end -class ActiveSupport::BroadcastLogger - def <<(message); end - def add(*args, &block); end - def broadcast_to(*loggers); end - def broadcasts; end - def close; end - def debug!; end - def debug(*args, &block); end - def debug?; end - def dispatch(&block); end - def error!; end - def error(*args, &block); end - def error?; end - def fatal!; end - def fatal(*args, &block); end - def fatal?; end - def formatter; end - def formatter=(formatter); end - def info!; end - def info(*args, &block); end - def info?; end - def initialize(*loggers); end - def initialize_copy(other); end - def level; end - def level=(level); end - def local_level=(level); end - def log(*args, &block); end - def method_missing(name, *, **, &); end - def progname; end - def progname=(arg0); end - def respond_to_missing?(method, include_all); end - def self.silencer; end - def self.silencer=(val); end - def sev_threshold=(level); end - def silencer; end - def silencer=(val); end - def stop_broadcasting_to(logger); end - def unknown(*args, &block); end - def warn!; end - def warn(*args, &block); end - def warn?; end - include ActiveSupport::LoggerSilence - include ActiveSupport::LoggerThreadSafeLevel -end -module DateAndTime -end -module DateAndTime::Compatibility - def preserve_timezone; end - def self.preserve_timezone; end - def self.preserve_timezone=(val); end - def self.utc_to_local_returns_utc_offset_times; end - def self.utc_to_local_returns_utc_offset_times=(val); end - def utc_to_local_returns_utc_offset_times; end -end -class ActiveSupport::ErrorReporter - def debug_mode; end - def debug_mode=(arg0); end - def disable(subscriber); end - def handle(*error_classes, severity: nil, context: nil, fallback: nil, source: nil); end - def initialize(*subscribers, logger: nil); end - def logger; end - def logger=(arg0); end - def record(*error_classes, severity: nil, context: nil, source: nil); end - def report(error, handled: nil, severity: nil, context: nil, source: nil); end - def set_context(*, **, &); end - def subscribe(subscriber); end - def unexpected(error, severity: nil, context: nil, source: nil); end - def unsubscribe(subscriber); end -end -class ActiveSupport::ErrorReporter::UnexpectedError < Exception -end -module ActiveSupport::ActionableError - def self.actions(error); end - def self.dispatch(error, name); end - extend ActiveSupport::Concern -end -class ActiveSupport::ActionableError::NonActionable < StandardError -end -module ActiveSupport::ActionableError::ClassMethods - def action(name, &block); end -end -module ActiveSupport::DescendantsTracker - def descendants; end - def self.clear(classes); end - def self.descendants(klass); end - def self.disable_clear!; end - def self.reject!(classes); end - def self.subclasses(klass); end -end -class ActiveSupport::DescendantsTracker::WeakSet < ObjectSpace::WeakMap - def <<(object); end - def to_a; end -end -module ActiveSupport::DescendantsTracker::ReloadedClassesFiltering - def descendants; end - def subclasses; end -end -class Array - def blank?; end - def compact_blank!; end - def extract_options!; end - def present?; end - def to_formatted_s(format = nil); end - def to_fs(format = nil); end - def to_param; end - def to_query(key); end - def to_sentence(options = nil); end - def to_xml(options = nil); end -end -class Class < Module - def class_attribute(*attrs, instance_accessor: nil, instance_reader: nil, instance_writer: nil, instance_predicate: nil, default: nil); end -end -class String - def blank?; end - def camelcase(first_letter = nil); end - def camelize(first_letter = nil); end - def classify; end - def constantize; end - def dasherize; end - def deconstantize; end - def demodulize; end - def downcase_first; end - def foreign_key(separate_class_name_and_id_with_underscore = nil); end - def humanize(capitalize: nil, keep_id_suffix: nil); end - def is_utf8?; end - def mb_chars; end - def parameterize(separator: nil, preserve_case: nil, locale: nil); end - def pluralize(count = nil, locale = nil); end - def present?; end - def remove!(*patterns); end - def remove(*patterns); end - def safe_constantize; end - def singularize(locale = nil); end - def squish!; end - def squish; end - def tableize; end - def titlecase(keep_id_suffix: nil); end - def titleize(keep_id_suffix: nil); end - def truncate(truncate_to, options = nil); end - def truncate_bytes(truncate_to, omission: nil); end - def truncate_words(words_count, options = nil); end - def underscore; end - def upcase_first; end -end -class Object < BasicObject - def acts_like?(duck); end - def blank?; end - def presence; end - def present?; end - def to_param; end - def to_query(key); end - def with(**attributes); end - include ActiveSupport::Tryable -end -class NilClass - def blank?; end - def present?; end - def to_param; end - def try!(*); end - def try(*); end -end -class FalseClass - def blank?; end - def present?; end - def to_param; end -end -class TrueClass - def blank?; end - def present?; end - def to_param; end -end -class Symbol - def blank?; end - def present?; end -end -class Numeric - def blank?; end - def present?; end -end -class Time - def acts_like_time?; end - def advance(options); end - def ago(seconds); end - def at_beginning_of_day; end - def at_beginning_of_hour; end - def at_beginning_of_minute; end - def at_end_of_day; end - def at_end_of_hour; end - def at_end_of_minute; end - def at_midday; end - def at_middle_of_day; end - def at_midnight; end - def at_noon; end - def beginning_of_day; end - def beginning_of_hour; end - def beginning_of_minute; end - def blank?; end - def change(options); end - def compare_with_coercion(other); end - def compare_without_coercion(arg0); end - def end_of_day; end - def end_of_hour; end - def end_of_minute; end - def eql_with_coercion(other); end - def eql_without_coercion(arg0); end - def formatted_offset(colon = nil, alternate_utc_string = nil); end - def in(seconds); end - def midday; end - def middle_of_day; end - def midnight; end - def minus_with_coercion(other); end - def minus_with_duration(other); end - def minus_without_coercion(other); end - def minus_without_duration(arg0); end - def next_day(days = nil); end - def next_month(months = nil); end - def next_year(years = nil); end - def noon; end - def plus_with_duration(other); end - def plus_without_duration(arg0); end - def present?; end - def prev_day(days = nil); end - def prev_month(months = nil); end - def prev_year(years = nil); end - def rfc3339(fraction_digits = nil); end - def sec_fraction; end - def seconds_since_midnight; end - def seconds_until_end_of_day; end - def self.===(other); end - def self.at_with_coercion(time_or_number, *args, **); end - def self.at_without_coercion(time, subsec = nil, unit = nil, in: nil); end - def self.current; end - def self.days_in_month(month, year = nil); end - def self.days_in_year(year = nil); end - def self.find_zone!(time_zone); end - def self.find_zone(time_zone); end - def self.rfc3339(str); end - def self.use_zone(time_zone); end - def self.zone; end - def self.zone=(time_zone); end - def self.zone_default; end - def self.zone_default=(arg0); end - def since(seconds); end - def to_formatted_s(format = nil); end - def to_fs(format = nil); end - include DateAndTime::Calculations - include DateAndTime::Zones -end -module ActiveSupport::Callbacks - def halted_callback_hook(filter, name); end - def run_callbacks(kind, type = nil); end - extend ActiveSupport::Concern -end -module ActiveSupport::Callbacks::Conditionals -end -class ActiveSupport::Callbacks::Conditionals::Value - def call(target, value); end - def initialize(&block); end -end -module ActiveSupport::Callbacks::Filters -end -class ActiveSupport::Callbacks::Filters::Environment < Struct - def halted; end - def halted=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end - def target; end - def target=(_); end - def value; end - def value=(_); end -end -class ActiveSupport::Callbacks::Filters::Before - def apply(callback_sequence); end - def call(env); end - def filter; end - def halted_lambda; end - def initialize(user_callback, user_conditions, chain_config, filter, name); end - def name; end - def user_callback; end - def user_conditions; end -end -class ActiveSupport::Callbacks::Filters::After - def apply(callback_sequence); end - def call(env); end - def halting; end - def initialize(user_callback, user_conditions, chain_config); end - def user_callback; end - def user_conditions; end -end -class ActiveSupport::Callbacks::Filters::Around - def apply(callback_sequence); end - def initialize(user_callback, user_conditions); end -end -class ActiveSupport::Callbacks::Callback - def apply(callback_sequence); end - def chain_config; end - def check_conditionals(conditionals); end - def compiled; end - def conditions_lambdas; end - def current_scopes; end - def duplicates?(other); end - def filter; end - def initialize(name, filter, kind, options, chain_config); end - def kind; end - def kind=(arg0); end - def matches?(_kind, _filter); end - def merge_conditional_options(chain, if_option:, unless_option:); end - def name; end - def name=(arg0); end - def self.build(chain, filter, kind, options); end -end -module ActiveSupport::Callbacks::CallTemplate - def self.build(filter, callback); end -end -class ActiveSupport::Callbacks::CallTemplate::MethodCall - def expand(target, value, block); end - def initialize(method); end - def inverted_lambda; end - def make_lambda; end -end -class ActiveSupport::Callbacks::CallTemplate::ObjectCall - def expand(target, value, block); end - def initialize(target, method); end - def inverted_lambda; end - def make_lambda; end -end -class ActiveSupport::Callbacks::CallTemplate::InstanceExec0 - def expand(target, value, block); end - def initialize(block); end - def inverted_lambda; end - def make_lambda; end -end -class ActiveSupport::Callbacks::CallTemplate::InstanceExec1 - def expand(target, value, block); end - def initialize(block); end - def inverted_lambda; end - def make_lambda; end -end -class ActiveSupport::Callbacks::CallTemplate::InstanceExec2 - def expand(target, value, block); end - def initialize(block); end - def inverted_lambda; end - def make_lambda; end -end -class ActiveSupport::Callbacks::CallTemplate::ProcCall - def expand(target, value, block); end - def initialize(target); end - def inverted_lambda; end - def make_lambda; end -end -class ActiveSupport::Callbacks::CallbackSequence - def after(after); end - def around(call_template, user_conditions); end - def before(before); end - def expand_call_template(arg, block); end - def final?; end - def initialize(nested = nil, call_template = nil, user_conditions = nil); end - def invoke_after(arg); end - def invoke_before(arg); end - def nested; end - def skip?(arg); end -end -class ActiveSupport::Callbacks::CallbackChain - def append(*callbacks); end - def append_one(callback); end - def chain; end - def clear; end - def compile(type); end - def config; end - def default_terminator; end - def delete(o); end - def each(&block); end - def empty?; end - def index(o); end - def initialize(name, config); end - def initialize_copy(other); end - def insert(index, o); end - def name; end - def prepend(*callbacks); end - def prepend_one(callback); end - def remove_duplicates(callback); end - include Enumerable -end -module ActiveSupport::Callbacks::ClassMethods - def __update_callbacks(name); end - def define_callbacks(*names); end - def get_callbacks(name); end - def normalize_callback_params(filters, block); end - def reset_callbacks(name); end - def set_callback(name, *filter_list, &block); end - def set_callbacks(name, callbacks); end - def skip_callback(name, *filter_list, &block); end -end -module ActiveSupport::EnumerableCoreExt -end -module ActiveSupport::EnumerableCoreExt::Constants - def const_missing(name); end -end -module Enumerable - def compact_blank; end - def exclude?(object); end - def excluding(*elements); end - def in_order_of(key, series); end - def including(*elements); end - def index_by; end - def index_with(default = nil); end - def many?; end - def maximum(key); end - def minimum(key); end - def pick(*keys); end - def pluck(*keys); end - def sole; end - def without(*elements); end -end -class Enumerable::SoleItemExpectedError < StandardError -end -class Range - def sum(initial_value = nil); end -end -class ActiveSupport::DelegationError < NoMethodError - def self.nil_target(method_name, target); end -end -module ActiveSupport::Delegation - def self.generate(owner, methods, location: nil, to: nil, prefix: nil, allow_nil: nil, nilable: nil, private: nil, as: nil, signature: nil); end - def self.generate_method_missing(owner, target, allow_nil: nil); end -end -module ActiveSupport::IsolatedExecutionState - def self.[](key); end - def self.[]=(key, value); end - def self.clear; end - def self.context; end - def self.delete(key); end - def self.isolation_level; end - def self.isolation_level=(level); end - def self.key?(key); end - def self.scope; end - def self.share_with(other); end - def self.state; end - def self.unique_id; end -end -class Thread - def active_support_execution_state; end - def active_support_execution_state=(arg0); end -end -class Fiber - def active_support_execution_state; end - def active_support_execution_state=(arg0); end -end -class ActiveSupport::CurrentAttributes - def __callbacks; end - def __callbacks?; end - def _reset_callbacks; end - def _run_reset_callbacks(&block); end - def self.__callbacks; end - def self.__callbacks=(value); end - def self.__callbacks?; end - def self._reset_callbacks; end - def self._reset_callbacks=(value); end - def self.after_reset(*methods, &block); end - def self.attribute(*names, default: nil); end - def self.before_reset(*methods, &block); end - def self.clear_all; end - def self.current_instances; end - def self.current_instances_key; end - def self.defaults; end - def self.defaults=(value); end - def self.defaults?; end - def self.generated_attribute_methods; end - def self.instance; end - def self.method_added(name); end - def self.method_missing(name, *, **, &); end - def self.reset(*, **, &); end - def self.reset_all; end - def self.resets(*methods, &block); end - def self.respond_to_missing?(name, _); end - def self.set(*, **, &); end - extend ActiveSupport::Callbacks::ClassMethods - extend ActiveSupport::DescendantsTracker - include ActiveSupport::Callbacks -end -module ActiveSupport::Concurrency -end -class ActiveSupport::Concurrency::ShareLock - def busy_for_exclusive?(purpose); end - def busy_for_sharing?(purpose); end - def eligible_waiters?(compatible); end - def exclusive(purpose: nil, compatible: nil, after_compatible: nil, no_wait: nil); end - def initialize; end - def raw_state; end - def sharing; end - def start_exclusive(purpose: nil, compatible: nil, no_wait: nil); end - def start_sharing; end - def stop_exclusive(compatible: nil); end - def stop_sharing; end - def wait_for(method, &block); end - def yield_shares(purpose: nil, compatible: nil, block_share: nil); end - include MonitorMixin -end -module ActiveSupport::Dependencies - def self._autoloaded_tracked_classes; end - def self._autoloaded_tracked_classes=(arg0); end - def self._eager_load_paths; end - def self._eager_load_paths=(arg0); end - def self.autoload_once_paths; end - def self.autoload_once_paths=(arg0); end - def self.autoload_paths; end - def self.autoload_paths=(arg0); end - def self.autoloader; end - def self.autoloader=(arg0); end - def self.clear; end - def self.eager_load?(path); end - def self.interlock; end - def self.interlock=(arg0); end - def self.load_interlock(&block); end - def self.run_interlock(&block); end - def self.search_for_file(relpath); end - def self.unload_interlock(&block); end -end -class ActiveSupport::Dependencies::Interlock - def done_running; end - def done_unloading; end - def initialize; end - def loading(&block); end - def permit_concurrent_loads(&block); end - def raw_state(&block); end - def running(&block); end - def start_running; end - def start_unloading; end - def unloading(&block); end -end -module ActiveSupport::Dependencies::RequireDependency - def require_dependency(filename); end -end -class ActiveSupport::ExecutionWrapper - def __callbacks; end - def __callbacks?; end - def _complete_callbacks; end - def _run_callbacks; end - def _run_complete_callbacks(&block); end - def _run_run_callbacks(&block); end - def complete!; end - def complete; end - def hook_state; end - def run!; end - def run; end - def self.__callbacks; end - def self.__callbacks=(value); end - def self.__callbacks?; end - def self._complete_callbacks; end - def self._complete_callbacks=(value); end - def self._run_callbacks; end - def self._run_callbacks=(value); end - def self.active?; end - def self.active_key; end - def self.error_reporter; end - def self.perform; end - def self.register_hook(hook, outer: nil); end - def self.run!(reset: nil); end - def self.to_complete(*args, &block); end - def self.to_run(*args, &block); end - def self.wrap(source: nil); end - extend ActiveSupport::Callbacks::ClassMethods - extend ActiveSupport::DescendantsTracker - include ActiveSupport::Callbacks -end -class ActiveSupport::ExecutionWrapper::RunHook < Struct - def before(target); end - def hook; end - def hook=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class ActiveSupport::ExecutionWrapper::CompleteHook < Struct - def after(target); end - def before(target); end - def hook; end - def hook=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class ActiveSupport::Executor < ActiveSupport::ExecutionWrapper -end -module ActiveSupport::Multibyte - def self.proxy_class; end - def self.proxy_class=(klass); end -end -class ActiveSupport::Duration - def %(other); end - def *(other); end - def +(other); end - def +@; end - def -(other); end - def -@; end - def /(other); end - def <=>(other); end - def ==(other); end - def _parts; end - def abs(&); end - def after(time = nil); end - def ago(time = nil); end - def as_json(options = nil); end - def before(time = nil); end - def coerce(other); end - def encode_with(coder); end - def eql?(other); end - def from_now(time = nil); end - def hash; end - def in_days; end - def in_hours; end - def in_minutes; end - def in_months; end - def in_seconds; end - def in_weeks; end - def in_years; end - def init_with(coder); end - def initialize(value, parts, variable = nil); end - def inspect; end - def instance_of?(klass); end - def is_a?(klass); end - def iso8601(precision: nil); end - def kind_of?(klass); end - def method_missing(*, **, &); end - def negative?(&); end - def parts; end - def positive?(&); end - def raise_type_error(other); end - def respond_to_missing?(method, _); end - def self.===(other); end - def self.build(value); end - def self.calculate_total_seconds(parts); end - def self.days(value); end - def self.hours(value); end - def self.minutes(value); end - def self.months(value); end - def self.parse(iso8601duration); end - def self.seconds(value); end - def self.weeks(value); end - def self.years(value); end - def since(time = nil); end - def sum(sign, time = nil); end - def to_f(&); end - def to_i; end - def to_s; end - def until(time = nil); end - def value; end - def variable?; end - def zero?(&); end -end -class ActiveSupport::Duration::Scalar < Numeric - def %(other); end - def *(other); end - def +(other); end - def -(other); end - def -@; end - def /(other); end - def <=>(other); end - def calculate(op, other); end - def coerce(other); end - def initialize(value); end - def raise_type_error(other); end - def to_f(*, **, &); end - def to_i(*, **, &); end - def to_s(*, **, &); end - def value; end - def variable?; end -end -class ActiveSupport::TimeZone - def <=>(zone); end - def =~(re); end - def at(*args); end - def encode_with(coder); end - def formatted_offset(colon = nil, alternate_utc_string = nil); end - def init_with(coder); end - def initialize(name, utc_offset = nil, tzinfo = nil); end - def iso8601(str); end - def local(*args); end - def local_to_utc(time, dst = nil); end - def match?(re); end - def name; end - def now; end - def parse(str, now = nil); end - def parts_to_time(parts, now); end - def period_for_local(time, dst = nil); end - def period_for_utc(time); end - def periods_for_local(time); end - def rfc3339(str); end - def self.[](arg); end - def self.all; end - def self.clear; end - def self.country_zones(country_code); end - def self.create(*, **); end - def self.find_tzinfo(name); end - def self.load_country_zones(code); end - def self.new(name); end - def self.seconds_to_utc_offset(seconds, colon = nil); end - def self.us_zones; end - def self.zones_map; end - def strptime(str, format, now = nil); end - def time_now; end - def to_s; end - def today; end - def tomorrow; end - def tzinfo; end - def utc_offset; end - def utc_to_local(time); end - def yesterday; end - include Comparable -end -class ActiveSupport::TimeWithZone - def +(other); end - def -(other); end - def <=>(other); end - def acts_like_time?; end - def advance(options); end - def after?(arg0); end - def ago(other); end - def as_json(options = nil); end - def before?(arg0); end - def between?(min, max); end - def blank?; end - def change(options); end - def comparable_time; end - def day; end - def dst?; end - def duration_of_variable_length?(obj); end - def encode_with(coder); end - def eql?(other); end - def formatted_offset(colon = nil, alternate_utc_string = nil); end - def freeze; end - def future?; end - def get_period_and_ensure_valid_local_time(period); end - def getgm; end - def getlocal(utc_offset = nil); end - def getutc; end - def gmt?; end - def gmt_offset; end - def gmtime; end - def gmtoff; end - def hash; end - def hour; end - def httpdate; end - def in(other); end - def in_time_zone(new_zone = nil); end - def incorporate_utc_offset(time, offset); end - def init_with(coder); end - def initialize(utc_time, time_zone, local_time = nil, period = nil); end - def inspect; end - def is_a?(klass); end - def isdst; end - def iso8601(fraction_digits = nil); end - def kind_of?(klass); end - def localtime(utc_offset = nil); end - def marshal_dump; end - def marshal_load(variables); end - def mday; end - def method_missing(*, **, &); end - def min; end - def mon; end - def month; end - def next_day?; end - def nsec; end - def past?; end - def period; end - def present?; end - def prev_day?; end - def respond_to?(sym, include_priv = nil); end - def respond_to_missing?(sym, include_priv); end - def rfc2822; end - def rfc3339(fraction_digits = nil); end - def rfc822; end - def sec; end - def since(other); end - def strftime(format); end - def time; end - def time_zone; end - def to_a; end - def to_date; end - def to_datetime; end - def to_f; end - def to_formatted_s(format = nil); end - def to_fs(format = nil); end - def to_i; end - def to_r; end - def to_s; end - def to_time; end - def today?; end - def tomorrow?; end - def transfer_time_values_to_utc_constructor(time); end - def tv_sec; end - def usec; end - def utc; end - def utc?; end - def utc_offset; end - def wday; end - def wrap_with_time_zone(time); end - def xmlschema(fraction_digits = nil); end - def yday; end - def year; end - def yesterday?; end - def zone; end - include Comparable -end -module DateAndTime::Zones - def in_time_zone(zone = nil); end - def time_with_zone(time, zone); end -end -module ActiveSupport::Tryable - def try!(*args, **, &block); end - def try(*args, **, &block); end -end -class Delegator < BasicObject - include ActiveSupport::Tryable -end -class DateTime < Date - def <=>(other); end - def advance(options); end - def ago(seconds); end - def at_beginning_of_day; end - def at_beginning_of_hour; end - def at_beginning_of_minute; end - def at_end_of_day; end - def at_end_of_hour; end - def at_end_of_minute; end - def at_midday; end - def at_middle_of_day; end - def at_midnight; end - def at_noon; end - def beginning_of_day; end - def beginning_of_hour; end - def beginning_of_minute; end - def change(options); end - def default_inspect; end - def end_of_day; end - def end_of_hour; end - def end_of_minute; end - def formatted_offset(colon = nil, alternate_utc_string = nil); end - def getgm; end - def getlocal(utc_offset = nil); end - def getutc; end - def gmtime; end - def in(seconds); end - def inspect; end - def localtime(utc_offset = nil); end - def midday; end - def middle_of_day; end - def midnight; end - def noon; end - def nsec; end - def offset_in_seconds; end - def readable_inspect; end - def seconds_since_midnight; end - def seconds_since_unix_epoch; end - def seconds_until_end_of_day; end - def self.civil_from_format(utc_or_local, year, month = nil, day = nil, hour = nil, min = nil, sec = nil); end - def self.current; end - def since(seconds); end - def subsec; end - def to_f; end - def to_formatted_s(format = nil); end - def to_fs(format = nil); end - def to_i; end - def usec; end - def utc; end - def utc?; end - def utc_offset; end -end -module DateAndTime::Calculations - def after?(date_or_time); end - def all_day; end - def all_month; end - def all_quarter; end - def all_week(start_day = nil); end - def all_year; end - def at_beginning_of_month; end - def at_beginning_of_quarter; end - def at_beginning_of_week(start_day = nil); end - def at_beginning_of_year; end - def at_end_of_month; end - def at_end_of_quarter; end - def at_end_of_week(start_day = nil); end - def at_end_of_year; end - def before?(date_or_time); end - def beginning_of_month; end - def beginning_of_quarter; end - def beginning_of_week(start_day = nil); end - def beginning_of_year; end - def copy_time_to(other); end - def days_ago(days); end - def days_since(days); end - def days_span(day); end - def days_to_week_start(start_day = nil); end - def end_of_month; end - def end_of_quarter; end - def end_of_week(start_day = nil); end - def end_of_year; end - def first_hour(date_or_time); end - def future?; end - def last_hour(date_or_time); end - def last_month; end - def last_quarter; end - def last_week(start_day = nil, same_time: nil); end - def last_weekday; end - def last_year; end - def monday; end - def months_ago(months); end - def months_since(months); end - def next_day?; end - def next_occurring(day_of_week); end - def next_quarter; end - def next_week(given_day_in_next_week = nil, same_time: nil); end - def next_weekday; end - def on_weekday?; end - def on_weekend?; end - def past?; end - def prev_day?; end - def prev_occurring(day_of_week); end - def prev_quarter; end - def prev_week(start_day = nil, same_time: nil); end - def prev_weekday; end - def quarter; end - def sunday; end - def today?; end - def tomorrow; end - def tomorrow?; end - def weeks_ago(weeks); end - def weeks_since(weeks); end - def years_ago(years); end - def years_since(years); end - def yesterday; end - def yesterday?; end -end -class Date - def advance(options); end - def ago(seconds); end - def at_beginning_of_day; end - def at_end_of_day; end - def at_midday; end - def at_middle_of_day; end - def at_midnight; end - def at_noon; end - def beginning_of_day; end - def change(options); end - def compare_with_coercion(other); end - def compare_without_coercion(arg0); end - def end_of_day; end - def in(seconds); end - def midday; end - def middle_of_day; end - def midnight; end - def minus_with_duration(other); end - def minus_without_duration(arg0); end - def noon; end - def plus_with_duration(other); end - def plus_without_duration(arg0); end - def self.beginning_of_week; end - def self.beginning_of_week=(week_start); end - def self.beginning_of_week_default; end - def self.beginning_of_week_default=(arg0); end - def self.current; end - def self.find_beginning_of_week!(week_start); end - def self.tomorrow; end - def self.yesterday; end - def since(seconds); end - include DateAndTime::Calculations - include DateAndTime::Zones -end -class ActiveSupport::FileUpdateChecker - def compile_ext(array); end - def compile_glob(hash); end - def escape(key); end - def execute; end - def execute_if_updated; end - def initialize(files, dirs = nil, &block); end - def max_mtime(paths); end - def updated?; end - def updated_at(paths); end - def watched; end -end -class ActiveSupport::HashWithIndifferentAccess < Hash - def [](key); end - def []=(key, value); end - def assoc(key); end - def compact; end - def convert_key(key); end - def convert_value(value, conversion: nil); end - def deep_stringify_keys!; end - def deep_stringify_keys; end - def deep_symbolize_keys; end - def default(key = nil); end - def delete(key); end - def dig(*args); end - def dup; end - def except(*keys); end - def extractable_options?; end - def fetch(key, *extras); end - def fetch_values(*indices, &block); end - def has_key?(key); end - def include?(key); end - def initialize(constructor = nil); end - def key?(key); end - def member?(key); end - def merge!(*other_hashes, &block); end - def merge(*hashes, &block); end - def nested_under_indifferent_access; end - def regular_update(*arg0); end - def regular_writer(arg0, arg1); end - def reject(*args, &block); end - def replace(other_hash); end - def reverse_merge!(other_hash); end - def reverse_merge(other_hash); end - def select(*args, &block); end - def self.[](*args); end - def set_defaults(target); end - def slice!(*keys); end - def slice(*keys); end - def store(key, value); end - def stringify_keys!; end - def stringify_keys; end - def symbolize_keys; end - def to_hash; end - def to_options!; end - def to_options; end - def to_proc; end - def transform_keys!(hash = nil, &block); end - def transform_keys(hash = nil, &block); end - def transform_values(&block); end - def update(*other_hashes, &block); end - def update_with_single_argument(other_hash, block); end - def values_at(*keys); end - def with_defaults!(other_hash); end - def with_defaults(other_hash); end - def with_indifferent_access; end - def without(*keys); end -end diff --git a/sorbet/rbi/gems/base64@0.2.0.rbi b/sorbet/rbi/gems/base64@0.2.0.rbi index 7f733b0..087b64e 100644 --- a/sorbet/rbi/gems/base64@0.2.0.rbi +++ b/sorbet/rbi/gems/base64@0.2.0.rbi @@ -5,5 +5,503 @@ # Please instead update this file by running `bin/tapioca gem base64`. -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem +# \Module \Base64 provides methods for: +# +# - Encoding a binary string (containing non-ASCII characters) +# as a string of printable ASCII characters. +# - Decoding such an encoded string. +# +# \Base64 is commonly used in contexts where binary data +# is not allowed or supported: +# +# - Images in HTML or CSS files, or in URLs. +# - Email attachments. +# +# A \Base64-encoded string is about one-third larger that its source. +# See the {Wikipedia article}[https://en.wikipedia.org/wiki/Base64] +# for more information. +# +# This module provides three pairs of encode/decode methods. +# Your choices among these methods should depend on: +# +# - Which character set is to be used for encoding and decoding. +# - Whether "padding" is to be used. +# - Whether encoded strings are to contain newlines. +# +# Note: Examples on this page assume that the including program has executed: +# +# require 'base64' +# +# == Encoding Character Sets +# +# A \Base64-encoded string consists only of characters from a 64-character set: +# +# - ('A'..'Z'). +# - ('a'..'z'). +# - ('0'..'9'). +# - =, the 'padding' character. +# - Either: +# - %w[+ /]: +# {RFC-2045-compliant}[https://datatracker.ietf.org/doc/html/rfc2045]; +# _not_ safe for URLs. +# - %w[- _]: +# {RFC-4648-compliant}[https://datatracker.ietf.org/doc/html/rfc4648]; +# safe for URLs. +# +# If you are working with \Base64-encoded strings that will come from +# or be put into URLs, you should choose this encoder-decoder pair +# of RFC-4648-compliant methods: +# +# - Base64.urlsafe_encode64 and Base64.urlsafe_decode64. +# +# Otherwise, you may choose any of the pairs in this module, +# including the pair above, or the RFC-2045-compliant pairs: +# +# - Base64.encode64 and Base64.decode64. +# - Base64.strict_encode64 and Base64.strict_decode64. +# +# == Padding +# +# \Base64-encoding changes a triplet of input bytes +# into a quartet of output characters. +# +# Padding in Encode Methods +# +# Padding -- extending an encoded string with zero, one, or two trailing +# = characters -- is performed by methods Base64.encode64, +# Base64.strict_encode64, and, by default, Base64.urlsafe_encode64: +# +# Base64.encode64('s') # => "cw==\n" +# Base64.strict_encode64('s') # => "cw==" +# Base64.urlsafe_encode64('s') # => "cw==" +# Base64.urlsafe_encode64('s', padding: false) # => "cw" +# +# When padding is performed, the encoded string is always of length 4n, +# where +n+ is a non-negative integer: +# +# - Input bytes of length 3n generate unpadded output characters +# of length 4n: +# +# # n = 1: 3 bytes => 4 characters. +# Base64.strict_encode64('123') # => "MDEy" +# # n = 2: 6 bytes => 8 characters. +# Base64.strict_encode64('123456') # => "MDEyMzQ1" +# +# - Input bytes of length 3n+1 generate padded output characters +# of length 4(n+1), with two padding characters at the end: +# +# # n = 1: 4 bytes => 8 characters. +# Base64.strict_encode64('1234') # => "MDEyMw==" +# # n = 2: 7 bytes => 12 characters. +# Base64.strict_encode64('1234567') # => "MDEyMzQ1Ng==" +# +# - Input bytes of length 3n+2 generate padded output characters +# of length 4(n+1), with one padding character at the end: +# +# # n = 1: 5 bytes => 8 characters. +# Base64.strict_encode64('12345') # => "MDEyMzQ=" +# # n = 2: 8 bytes => 12 characters. +# Base64.strict_encode64('12345678') # => "MDEyMzQ1Njc=" +# +# When padding is suppressed, for a positive integer n: +# +# - Input bytes of length 3n generate unpadded output characters +# of length 4n: +# +# # n = 1: 3 bytes => 4 characters. +# Base64.urlsafe_encode64('123', padding: false) # => "MDEy" +# # n = 2: 6 bytes => 8 characters. +# Base64.urlsafe_encode64('123456', padding: false) # => "MDEyMzQ1" +# +# - Input bytes of length 3n+1 generate unpadded output characters +# of length 4n+2, with two padding characters at the end: +# +# # n = 1: 4 bytes => 6 characters. +# Base64.urlsafe_encode64('1234', padding: false) # => "MDEyMw" +# # n = 2: 7 bytes => 10 characters. +# Base64.urlsafe_encode64('1234567', padding: false) # => "MDEyMzQ1Ng" +# +# - Input bytes of length 3n+2 generate unpadded output characters +# of length 4n+3, with one padding character at the end: +# +# # n = 1: 5 bytes => 7 characters. +# Base64.urlsafe_encode64('12345', padding: false) # => "MDEyMzQ" +# # m = 2: 8 bytes => 11 characters. +# Base64.urlsafe_encode64('12345678', padding: false) # => "MDEyMzQ1Njc" +# +# Padding in Decode Methods +# +# All of the \Base64 decode methods support (but do not require) padding. +# +# \Method Base64.decode64 does not check the size of the padding: +# +# Base64.decode64("MDEyMzQ1Njc") # => "01234567" +# Base64.decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.decode64("MDEyMzQ1Njc==") # => "01234567" +# +# \Method Base64.strict_decode64 strictly enforces padding size: +# +# Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError +# Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError +# +# \Method Base64.urlsafe_decode64 allows padding in +str+, +# which if present, must be correct: +# see {Padding}[Base64.html#module-Base64-label-Padding], above: +# +# Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" +# Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. +# +# == Newlines +# +# An encoded string returned by Base64.encode64 or Base64.urlsafe_encode64 +# has an embedded newline character +# after each 60-character sequence, and, if non-empty, at the end: +# +# # No newline if empty. +# encoded = Base64.encode64("\x00" * 0) +# encoded.index("\n") # => nil +# +# # Newline at end of short output. +# encoded = Base64.encode64("\x00" * 1) +# encoded.size # => 4 +# encoded.index("\n") # => 4 +# +# # Newline at end of longer output. +# encoded = Base64.encode64("\x00" * 45) +# encoded.size # => 60 +# encoded.index("\n") # => 60 +# +# # Newlines embedded and at end of still longer output. +# encoded = Base64.encode64("\x00" * 46) +# encoded.size # => 65 +# encoded.rindex("\n") # => 65 +# encoded.split("\n").map {|s| s.size } # => [60, 4] +# +# The string to be encoded may itself contain newlines, +# which are encoded as \Base64: +# +# # Base64.encode64("\n\n\n") # => "CgoK\n" +# s = "This is line 1\nThis is line 2\n" +# Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" +module Base64 + private + + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ are ignored; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.decode64("\x00\n-_") # => "" + # + # Padding in +str+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # source://base64//base64.rb#241 + def decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.encode64('*') # => "Kg==\n" + # + # The returned string ends with a newline character, and if sufficiently long + # will have one or more embedded newline characters; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.encode64('*') # => "Kg==\n" + # Base64.encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.encode64("\n\n\n") # => "CgoK\n" + # s = "This is line 1\nThis is line 2\n" + # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # + # source://base64//base64.rb#219 + def encode64(bin); end + + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ not allowed; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.strict_decode64("\n") # Raises ArgumentError + # Base64.strict_decode64('-') # Raises ArgumentError + # Base64.strict_decode64('_') # Raises ArgumentError + # + # Padding in +str+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # source://base64//base64.rb#297 + def strict_decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.strict_encode64('*') # => "Kg==\n" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.strict_encode64('*') # => "Kg==" + # Base64.strict_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.strict_encode64("\n\n\n") # => "CgoK" + # s = "This is line 1\nThis is line 2\n" + # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # + # source://base64//base64.rb#273 + def strict_encode64(bin); end + + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +str+: + # + # +str+ may not contain non-Base64 characters; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_decode64('+') # Raises ArgumentError. + # Base64.urlsafe_decode64('/') # Raises ArgumentError. + # Base64.urlsafe_decode64("\n") # Raises ArgumentError. + # + # Padding in +str+, if present, must be correct: + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. + # + # source://base64//base64.rb#351 + def urlsafe_decode64(str); end + + # Returns the RFC-4648-compliant \Base64-encoding of +bin+. + # + # Per RFC 4648, the returned string will not contain the URL-unsafe characters + # + or /, + # but instead may contain the URL-safe characters + # - and _; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----" + # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____" + # + # By default, the returned string may have padding; + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # + # Optionally, you can suppress padding: + # + # Base64.urlsafe_encode64('*', padding: false) # => "Kg" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # Base64.urlsafe_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # source://base64//base64.rb#328 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + + class << self + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ are ignored; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.decode64("\x00\n-_") # => "" + # + # Padding in +str+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # source://base64//base64.rb#241 + def decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.encode64('*') # => "Kg==\n" + # + # The returned string ends with a newline character, and if sufficiently long + # will have one or more embedded newline characters; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.encode64('*') # => "Kg==\n" + # Base64.encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.encode64("\n\n\n") # => "CgoK\n" + # s = "This is line 1\nThis is line 2\n" + # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # + # source://base64//base64.rb#219 + def encode64(bin); end + + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ not allowed; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.strict_decode64("\n") # Raises ArgumentError + # Base64.strict_decode64('-') # Raises ArgumentError + # Base64.strict_decode64('_') # Raises ArgumentError + # + # Padding in +str+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # source://base64//base64.rb#297 + def strict_decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.strict_encode64('*') # => "Kg==\n" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.strict_encode64('*') # => "Kg==" + # Base64.strict_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.strict_encode64("\n\n\n") # => "CgoK" + # s = "This is line 1\nThis is line 2\n" + # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # + # source://base64//base64.rb#273 + def strict_encode64(bin); end + + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +str+: + # + # +str+ may not contain non-Base64 characters; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_decode64('+') # Raises ArgumentError. + # Base64.urlsafe_decode64('/') # Raises ArgumentError. + # Base64.urlsafe_decode64("\n") # Raises ArgumentError. + # + # Padding in +str+, if present, must be correct: + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. + # + # source://base64//base64.rb#351 + def urlsafe_decode64(str); end + + # Returns the RFC-4648-compliant \Base64-encoding of +bin+. + # + # Per RFC 4648, the returned string will not contain the URL-unsafe characters + # + or /, + # but instead may contain the URL-safe characters + # - and _; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----" + # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____" + # + # By default, the returned string may have padding; + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # + # Optionally, you can suppress padding: + # + # Base64.urlsafe_encode64('*', padding: false) # => "Kg" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # Base64.urlsafe_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # source://base64//base64.rb#328 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + end +end + +# source://base64//base64.rb#186 +Base64::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/bigdecimal.rbi b/sorbet/rbi/gems/bigdecimal.rbi deleted file mode 100644 index cbee900..0000000 --- a/sorbet/rbi/gems/bigdecimal.rbi +++ /dev/null @@ -1,86 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: false -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/bigdecimal/all/bigdecimal.rbi -# -# bigdecimal-3.1.8 - -module Kernel - def BigDecimal(*arg0); end - def self.BigDecimal(*arg0); end -end -class BigDecimal < Numeric - def %(arg0); end - def *(arg0); end - def **(arg0); end - def +(arg0); end - def +@; end - def -(arg0); end - def -@; end - def /(arg0); end - def <(arg0); end - def <=(arg0); end - def <=>(arg0); end - def ==(arg0); end - def ===(arg0); end - def >(arg0); end - def >=(arg0); end - def _dump(*arg0); end - def abs; end - def add(arg0, arg1); end - def ceil(*arg0); end - def clone; end - def coerce(arg0); end - def div(*arg0); end - def divmod(arg0); end - def dup; end - def eql?(arg0); end - def exponent; end - def finite?; end - def fix; end - def floor(*arg0); end - def frac; end - def hash; end - def infinite?; end - def inspect; end - def modulo(arg0); end - def mult(arg0, arg1); end - def n_significant_digits; end - def nan?; end - def nonzero?; end - def power(*arg0); end - def precision; end - def precision_scale; end - def precs; end - def quo(*arg0); end - def remainder(arg0); end - def round(*arg0); end - def scale; end - def self._load(arg0); end - def self.double_fig; end - def self.interpret_loosely(arg0); end - def self.limit(*arg0); end - def self.mode(*arg0); end - def self.save_exception_mode; end - def self.save_limit; end - def self.save_rounding_mode; end - def sign; end - def split; end - def sqrt(arg0); end - def sub(arg0, arg1); end - def to_f; end - def to_i; end - def to_int; end - def to_r; end - def to_s(*arg0); end - def truncate(*arg0); end - def zero?; end -end -module BigMath - def self.exp(arg0, arg1); end - def self.log(arg0, arg1); end -end diff --git a/sorbet/rbi/gems/bigdecimal@3.1.8.rbi b/sorbet/rbi/gems/bigdecimal@3.1.8.rbi index c52d9ff..c275b2f 100644 --- a/sorbet/rbi/gems/bigdecimal@3.1.8.rbi +++ b/sorbet/rbi/gems/bigdecimal@3.1.8.rbi @@ -5,5 +5,74 @@ # Please instead update this file by running `bin/tapioca gem bigdecimal`. -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem +# source://bigdecimal//lib/bigdecimal/util.rb#78 +class BigDecimal < ::Numeric + # call-seq: + # a.to_d -> bigdecimal + # + # Returns self. + # + # require 'bigdecimal/util' + # + # d = BigDecimal("3.14") + # d.to_d # => 0.314e1 + # + # source://bigdecimal//lib/bigdecimal/util.rb#110 + def to_d; end + + # call-seq: + # a.to_digits -> string + # + # Converts a BigDecimal to a String of the form "nnnnnn.mmm". + # This method is deprecated; use BigDecimal#to_s("F") instead. + # + # require 'bigdecimal/util' + # + # d = BigDecimal("3.14") + # d.to_digits # => "3.14" + # + # source://bigdecimal//lib/bigdecimal/util.rb#90 + def to_digits; end +end + +BigDecimal::VERSION = T.let(T.unsafe(nil), String) + +# source://bigdecimal//lib/bigdecimal/util.rb#138 +class Complex < ::Numeric + # call-seq: + # cmp.to_d -> bigdecimal + # cmp.to_d(precision) -> bigdecimal + # + # Returns the value as a BigDecimal. + # + # The +precision+ parameter is required for a rational complex number. + # This parameter is used to determine the number of significant digits + # for the result. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # Complex(0.1234567, 0).to_d(4) # => 0.1235e0 + # Complex(Rational(22, 7), 0).to_d(3) # => 0.314e1 + # + # See also Kernel.BigDecimal. + # + # source://bigdecimal//lib/bigdecimal/util.rb#157 + def to_d(*args); end +end + +# source://bigdecimal//lib/bigdecimal/util.rb#171 +class NilClass + # call-seq: + # nil.to_d -> bigdecimal + # + # Returns nil represented as a BigDecimal. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # nil.to_d # => 0.0 + # + # source://bigdecimal//lib/bigdecimal/util.rb#182 + def to_d; end +end diff --git a/sorbet/rbi/gems/concurrent-ruby.rbi b/sorbet/rbi/gems/concurrent-ruby.rbi deleted file mode 100644 index 44ea559..0000000 --- a/sorbet/rbi/gems/concurrent-ruby.rbi +++ /dev/null @@ -1,1651 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: true -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/concurrent-ruby/all/concurrent-ruby.rbi -# -# concurrent-ruby-1.3.4 - -module Concurrent - def abort_transaction; end - def atomically; end - def call_dataflow(method, executor, *inputs, &block); end - def dataflow!(*inputs, &block); end - def dataflow(*inputs, &block); end - def dataflow_with!(executor, *inputs, &block); end - def dataflow_with(executor, *inputs, &block); end - def leave_transaction; end - def monotonic_time(unit = nil); end - def self.abort_transaction; end - def self.atomically; end - def self.available_processor_count; end - def self.call_dataflow(method, executor, *inputs, &block); end - def self.cpu_quota; end - def self.cpu_shares; end - def self.create_simple_logger(level = nil, output = nil); end - def self.create_stdlib_logger(level = nil, output = nil); end - def self.dataflow!(*inputs, &block); end - def self.dataflow(*inputs, &block); end - def self.dataflow_with!(executor, *inputs, &block); end - def self.dataflow_with(executor, *inputs, &block); end - def self.disable_at_exit_handlers!; end - def self.executor(executor_identifier); end - def self.global_fast_executor; end - def self.global_immediate_executor; end - def self.global_io_executor; end - def self.global_logger; end - def self.global_logger=(value); end - def self.global_timer_set; end - def self.leave_transaction; end - def self.monotonic_time(unit = nil); end - def self.mutex_owned_per_thread?; end - def self.new_fast_executor(opts = nil); end - def self.new_io_executor(opts = nil); end - def self.physical_processor_count; end - def self.processor_count; end - def self.processor_counter; end - def self.use_simple_logger(level = nil, output = nil); end - def self.use_stdlib_logger(level = nil, output = nil); end - extend Concurrent::Concern::Deprecation - extend Concurrent::Concern::Logging - extend Concurrent::Utility::EngineDetector - extend Concurrent::Utility::NativeExtensionLoader -end -module Concurrent::Utility -end -module Concurrent::Utility::EngineDetector - def on_cruby?; end - def on_jruby?; end - def on_linux?; end - def on_osx?; end - def on_truffleruby?; end - def on_windows?; end - def ruby_version(version = nil, comparison, major, minor, patch); end -end -module Concurrent::Collection -end -class Concurrent::Collection::NonConcurrentMapBackend - def [](key); end - def []=(key, value); end - def clear; end - def compute(key); end - def compute_if_absent(key); end - def compute_if_present(key); end - def delete(key); end - def delete_pair(key, value); end - def dupped_backend; end - def each_pair; end - def get_and_set(key, value); end - def get_or_default(key, default_value); end - def initialize(options = nil, &default_proc); end - def initialize_copy(other); end - def key?(key); end - def merge_pair(key, value); end - def pair?(key, expected_value); end - def replace_if_exists(key, new_value); end - def replace_pair(key, old_value, new_value); end - def set_backend(default_proc); end - def size; end - def store_computed_value(key, new_value); end -end -class Concurrent::Collection::MriMapBackend < Concurrent::Collection::NonConcurrentMapBackend - def []=(key, value); end - def clear; end - def compute(key); end - def compute_if_absent(key); end - def compute_if_present(key); end - def delete(key); end - def delete_pair(key, value); end - def get_and_set(key, value); end - def initialize(options = nil, &default_proc); end - def merge_pair(key, value); end - def replace_if_exists(key, new_value); end - def replace_pair(key, old_value, new_value); end -end -class Concurrent::Map < Concurrent::Collection::MriMapBackend - def each; end - def each_key; end - def each_pair; end - def each_value; end - def empty?; end - def fetch(key, default_value = nil); end - def fetch_or_store(key, default_value = nil); end - def get(key); end - def initialize_copy(other); end - def inspect; end - def key(value); end - def keys; end - def marshal_dump; end - def marshal_load(hash); end - def populate_from(hash); end - def put(key, value); end - def put_if_absent(key, value); end - def raise_fetch_no_key; end - def validate_options_hash!(options); end - def value?(value); end - def values; end -end -module Concurrent::ThreadSafe -end -module Concurrent::ThreadSafe::Util - def self.make_synchronized_on_cruby(klass); end - def self.make_synchronized_on_truffleruby(klass); end -end -class Concurrent::Hash < Hash -end -class Concurrent::Error < StandardError -end -class Concurrent::ConfigurationError < Concurrent::Error -end -class Concurrent::CancelledOperationError < Concurrent::Error -end -class Concurrent::LifecycleError < Concurrent::Error -end -class Concurrent::ImmutabilityError < Concurrent::Error -end -class Concurrent::IllegalOperationError < Concurrent::Error -end -class Concurrent::InitializationError < Concurrent::Error -end -class Concurrent::MaxRestartFrequencyError < Concurrent::Error -end -class Concurrent::MultipleAssignmentError < Concurrent::Error - def initialize(message = nil, inspection_data = nil); end - def inspect; end - def inspection_data; end -end -class Concurrent::RejectedExecutionError < Concurrent::Error -end -class Concurrent::ResourceLimitError < Concurrent::Error -end -class Concurrent::TimeoutError < Concurrent::Error -end -class Concurrent::MultipleErrors < Concurrent::Error - def errors; end - def initialize(errors, message = nil); end -end -class Concurrent::ConcurrentUpdateError < ThreadError -end -module Concurrent::Synchronization - def self.full_memory_barrier; end -end -class Concurrent::Synchronization::AbstractObject - def full_memory_barrier; end - def initialize; end - def self.attr_volatile(*names); end -end -module Concurrent::Utility::NativeExtensionLoader - def allow_c_extensions?; end - def c_extensions_loaded?; end - def java_extensions_loaded?; end - def load_error_path(error); end - def load_native_extensions; end - def set_c_extensions_loaded; end - def set_java_extensions_loaded; end - def try_load_c_extension(path); end -end -module Concurrent::Synchronization::SafeInitialization - def new(*args, &block); end -end -module Concurrent::Synchronization::Volatile - def full_memory_barrier; end - def self.included(base); end -end -module Concurrent::Synchronization::Volatile::ClassMethods - def attr_volatile(*names); end -end -module Concurrent::AtomicDirectUpdate - def try_update!; end - def try_update; end - def update; end -end -module Concurrent::AtomicNumericCompareAndSetWrapper - def compare_and_set(old_value, new_value); end -end -class Concurrent::MutexAtomicReference - def _compare_and_set(old_value, new_value); end - def compare_and_swap(old_value, new_value); end - def get; end - def get_and_set(new_value); end - def initialize(value = nil); end - def set(new_value); end - def swap(new_value); end - def synchronize; end - def value; end - def value=(new_value); end - extend Concurrent::Synchronization::SafeInitialization - include Concurrent::AtomicDirectUpdate - include Concurrent::AtomicNumericCompareAndSetWrapper -end -class Concurrent::AtomicReference < Concurrent::MutexAtomicReference - def inspect; end - def to_s; end -end -class Concurrent::Synchronization::Object < Concurrent::Synchronization::AbstractObject - def __initialize_atomic_fields__; end - def initialize; end - def self.atomic_attribute?(name); end - def self.atomic_attributes(inherited = nil); end - def self.attr_atomic(*names); end - def self.define_initialize_atomic_fields; end - def self.ensure_safe_initialization_when_final_fields_are_present; end - def self.safe_initialization!; end - def self.safe_initialization?; end - extend Concurrent::Synchronization::Volatile::ClassMethods - include Concurrent::Synchronization::Volatile -end -class Concurrent::Synchronization::AbstractLockableObject < Concurrent::Synchronization::Object - def ns_broadcast; end - def ns_signal; end - def ns_wait(timeout = nil); end - def ns_wait_until(timeout = nil, &condition); end - def synchronize; end -end -module Concurrent::Synchronization::ConditionSignalling - def ns_broadcast; end - def ns_signal; end -end -class Concurrent::Synchronization::MutexLockableObject < Concurrent::Synchronization::AbstractLockableObject - def initialize; end - def initialize_copy(other); end - def ns_wait(timeout = nil); end - def synchronize; end - extend Concurrent::Synchronization::SafeInitialization - include Concurrent::Synchronization::ConditionSignalling -end -class Concurrent::Synchronization::MonitorLockableObject < Concurrent::Synchronization::AbstractLockableObject - def initialize; end - def initialize_copy(other); end - def ns_wait(timeout = nil); end - def synchronize; end - extend Concurrent::Synchronization::SafeInitialization - include Concurrent::Synchronization::ConditionSignalling -end -class Concurrent::Synchronization::LockableObject < Concurrent::Synchronization::MutexLockableObject - def new_condition; end -end -class Concurrent::Event < Concurrent::Synchronization::LockableObject - def initialize; end - def ns_initialize; end - def ns_set; end - def reset; end - def set; end - def set?; end - def try?; end - def wait(timeout = nil); end -end -module Concurrent::Concern -end -module Concurrent::Concern::Dereferenceable - def apply_deref_options(value); end - def deref; end - def ns_set_deref_options(opts); end - def set_deref_options(opts = nil); end - def value; end - def value=(value); end -end -module Concurrent::Concern::Obligation - def compare_and_set_state(next_state, *expected_current); end - def complete?; end - def event; end - def exception(*args); end - def fulfilled?; end - def get_arguments_from(opts = nil); end - def if_state(*expected_states); end - def incomplete?; end - def init_obligation; end - def no_error!(timeout = nil); end - def ns_check_state?(expected); end - def ns_set_state(value); end - def pending?; end - def realized?; end - def reason; end - def rejected?; end - def set_state(success, value, reason); end - def state; end - def state=(value); end - def unscheduled?; end - def value!(timeout = nil); end - def value(timeout = nil); end - def wait!(timeout = nil); end - def wait(timeout = nil); end - include Concurrent::Concern::Dereferenceable -end -module Concurrent::Concern::Logging - def log(level, progname, message = nil, &block); end - include Logger::Severity -end -module Concurrent::Concern::Deprecation - def deprecated(message, strip = nil); end - def deprecated_method(old_name, new_name); end - extend Concurrent::Concern::Deprecation - include Concurrent::Concern::Logging -end -module Concurrent::ExecutorService - def <<(task); end - def can_overflow?; end - def post(*args, &task); end - def serialized?; end - include Concurrent::Concern::Logging -end -class Concurrent::AbstractExecutorService < Concurrent::Synchronization::LockableObject - def auto_terminate=(value); end - def auto_terminate?; end - def fallback_action(*args); end - def fallback_policy; end - def initialize(opts = nil, &block); end - def kill; end - def name; end - def ns_auto_terminate?; end - def ns_execute(*args, &task); end - def ns_kill_execution; end - def ns_shutdown_execution; end - def running?; end - def shutdown; end - def shutdown?; end - def shuttingdown?; end - def to_s; end - def wait_for_termination(timeout = nil); end - include Concurrent::Concern::Deprecation - include Concurrent::ExecutorService -end -module Concurrent::SerialExecutorService - def serialized?; end - include Concurrent::ExecutorService -end -class Concurrent::ImmediateExecutor < Concurrent::AbstractExecutorService - def <<(task); end - def initialize; end - def kill; end - def post(*args, &task); end - def running?; end - def shutdown; end - def shutdown?; end - def shuttingdown?; end - def wait_for_termination(timeout = nil); end - include Concurrent::SerialExecutorService -end -class Concurrent::Delay < Concurrent::Synchronization::LockableObject - def execute_task_once; end - def initialize(opts = nil, &block); end - def ns_initialize(opts, &block); end - def reconfigure(&block); end - def value!(timeout = nil); end - def value(timeout = nil); end - def wait(timeout = nil); end - include Concurrent::Concern::Obligation -end -class Concurrent::RubyExecutorService < Concurrent::AbstractExecutorService - def initialize(*args, &block); end - def kill; end - def ns_running?; end - def ns_shutdown?; end - def ns_shutdown_execution; end - def ns_shuttingdown?; end - def post(*args, &task); end - def shutdown; end - def stop_event; end - def stopped_event; end - def wait_for_termination(timeout = nil); end -end -class Concurrent::RubyThreadPoolExecutor < Concurrent::RubyExecutorService - def active_count; end - def can_overflow?; end - def completed_task_count; end - def idletime; end - def initialize(opts = nil); end - def largest_length; end - def length; end - def max_length; end - def max_queue; end - def min_length; end - def ns_add_busy_worker; end - def ns_assign_worker(*args, &task); end - def ns_enqueue(*args, &task); end - def ns_execute(*args, &task); end - def ns_initialize(opts); end - def ns_kill_execution; end - def ns_limited_queue?; end - def ns_prune_pool; end - def ns_ready_worker(worker, last_message, success = nil); end - def ns_remove_busy_worker(worker); end - def ns_reset_if_forked; end - def ns_shutdown_execution; end - def ns_worker_died(worker); end - def prune_pool; end - def queue_length; end - def ready_worker(worker, last_message); end - def remaining_capacity; end - def remove_busy_worker(worker); end - def scheduled_task_count; end - def synchronous; end - def worker_died(worker); end - def worker_task_completed; end -end -class Concurrent::RubyThreadPoolExecutor::Worker - def <<(message); end - def create_worker(queue, pool, idletime); end - def initialize(pool, id); end - def kill; end - def run_task(pool, task, args); end - def stop; end - include Concurrent::Concern::Logging -end -class Concurrent::ThreadPoolExecutor < Concurrent::RubyThreadPoolExecutor -end -class Concurrent::FixedThreadPool < Concurrent::ThreadPoolExecutor - def initialize(num_threads, opts = nil); end -end -class Concurrent::CachedThreadPool < Concurrent::ThreadPoolExecutor - def initialize(opts = nil); end - def ns_initialize(opts); end -end -class Concurrent::Utility::ProcessorCounter - def available_processor_count; end - def compute_cpu_quota; end - def compute_cpu_shares; end - def compute_physical_processor_count; end - def compute_processor_count; end - def cpu_quota; end - def cpu_shares; end - def initialize; end - def physical_processor_count; end - def processor_count; end - def run(command); end -end -class Concurrent::MutexAtomicBoolean - def false?; end - def initialize(initial = nil); end - def make_false; end - def make_true; end - def ns_make_value(value); end - def synchronize; end - def true?; end - def value; end - def value=(value); end - extend Concurrent::Synchronization::SafeInitialization -end -class Concurrent::AtomicBoolean < Concurrent::MutexAtomicBoolean - def inspect; end - def to_s; end -end -module Concurrent::Utility::NativeInteger - def ensure_integer(value); end - def ensure_integer_and_bounds(value); end - def ensure_lower_bound(value); end - def ensure_positive(value); end - def ensure_positive_and_no_zero(value); end - def ensure_upper_bound(value); end - extend Concurrent::Utility::NativeInteger -end -class Concurrent::MutexAtomicFixnum - def compare_and_set(expect, update); end - def decrement(delta = nil); end - def down(delta = nil); end - def increment(delta = nil); end - def initialize(initial = nil); end - def ns_set(value); end - def synchronize; end - def up(delta = nil); end - def update; end - def value; end - def value=(value); end - extend Concurrent::Synchronization::SafeInitialization -end -class Concurrent::AtomicFixnum < Concurrent::MutexAtomicFixnum - def inspect; end - def to_s; end -end -class Concurrent::CyclicBarrier < Concurrent::Synchronization::LockableObject - def broken?; end - def initialize(parties, &block); end - def ns_generation_done(generation, status, continue = nil); end - def ns_initialize(parties, &block); end - def ns_next_generation; end - def number_waiting; end - def parties; end - def reset; end - def wait(timeout = nil); end -end -class Concurrent::CyclicBarrier::Generation < Struct - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end - def status; end - def status=(_); end -end -class Concurrent::MutexCountDownLatch < Concurrent::Synchronization::LockableObject - def count; end - def count_down; end - def initialize(count = nil); end - def ns_initialize(count); end - def wait(timeout = nil); end -end -class Concurrent::CountDownLatch < Concurrent::MutexCountDownLatch -end -class Concurrent::Synchronization::Lock < Concurrent::Synchronization::LockableObject - def broadcast; end - def ns_broadcast; end - def ns_signal; end - def ns_wait(timeout = nil); end - def ns_wait_until(timeout = nil, &condition); end - def signal; end - def synchronize; end - def wait(timeout = nil); end - def wait_until(timeout = nil, &condition); end -end -class Concurrent::ReadWriteLock < Concurrent::Synchronization::Object - def acquire_read_lock; end - def acquire_write_lock; end - def has_waiters?; end - def initialize; end - def max_readers?(c = nil); end - def max_writers?(c = nil); end - def release_read_lock; end - def release_write_lock; end - def running_readers(c = nil); end - def running_readers?(c = nil); end - def running_writer?(c = nil); end - def waiting_writer?(c = nil); end - def waiting_writers(c = nil); end - def with_read_lock; end - def with_write_lock; end - def write_locked?; end - extend Concurrent::Synchronization::SafeInitialization -end -class Concurrent::AbstractLocals - def fetch(index); end - def free_index(index); end - def initialize; end - def local_finalizer(index); end - def locals!; end - def locals; end - def next_index(local); end - def set(index, value); end - def synchronize; end - def thread_fiber_finalizer(array_object_id); end - def weak_synchronize; end -end -class Concurrent::ThreadLocals < Concurrent::AbstractLocals - def locals!; end - def locals; end -end -class Concurrent::FiberLocals < Concurrent::AbstractLocals - def locals!; end - def locals; end -end -class Concurrent::FiberLocalVar - def bind(value); end - def default; end - def initialize(default = nil, &default_block); end - def value; end - def value=(value); end -end -class Concurrent::ThreadLocalVar - def bind(value); end - def default; end - def initialize(default = nil, &default_block); end - def value; end - def value=(value); end -end -class Concurrent::ReentrantReadWriteLock < Concurrent::Synchronization::Object - def acquire_read_lock; end - def acquire_write_lock; end - def initialize; end - def max_readers?(c = nil); end - def max_writers?(c = nil); end - def release_read_lock; end - def release_write_lock; end - def running_readers(c = nil); end - def running_readers?(c = nil); end - def running_writer?(c = nil); end - def try_read_lock; end - def try_write_lock; end - def waiting_or_running_writer?(c = nil); end - def waiting_writers(c = nil); end - def with_read_lock; end - def with_write_lock; end - extend Concurrent::Synchronization::SafeInitialization -end -class Concurrent::MutexSemaphore < Concurrent::Synchronization::LockableObject - def acquire(permits = nil); end - def available_permits; end - def drain_permits; end - def initialize(count); end - def ns_initialize(count); end - def reduce_permits(reduction); end - def release(permits = nil); end - def try_acquire(permits = nil, timeout = nil); end - def try_acquire_now(permits); end - def try_acquire_timed(permits, timeout); end -end -class Concurrent::Semaphore < Concurrent::MutexSemaphore -end -class Concurrent::SimpleExecutorService < Concurrent::RubyExecutorService - def <<(task); end - def kill; end - def ns_initialize(*args); end - def post(*args, &task); end - def running?; end - def self.<<(task); end - def self.post(*args); end - def shutdown; end - def shutdown?; end - def shuttingdown?; end - def wait_for_termination(timeout = nil); end -end -class Concurrent::IndirectImmediateExecutor < Concurrent::ImmediateExecutor - def initialize; end - def post(*args, &task); end -end -class Concurrent::RubySingleThreadExecutor < Concurrent::RubyThreadPoolExecutor - def initialize(opts = nil); end -end -class Concurrent::SafeTaskExecutor < Concurrent::Synchronization::LockableObject - def execute(*args); end - def initialize(task, opts = nil); end -end -class Concurrent::SerializedExecution < Concurrent::Synchronization::LockableObject - def call_job(job); end - def initialize; end - def ns_initialize; end - def post(executor, *args, &task); end - def posts(posts); end - def work(job); end - include Concurrent::Concern::Logging -end -class Concurrent::SerializedExecution::Job < Struct - def args; end - def args=(_); end - def block; end - def block=(_); end - def call; end - def executor; end - def executor=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class Concurrent::SerializedExecutionDelegator < SimpleDelegator - def initialize(executor); end - def post(*args, &task); end - include Concurrent::SerialExecutorService -end -class Concurrent::SingleThreadExecutor < Concurrent::RubySingleThreadExecutor -end -class Concurrent::Collection::CopyOnWriteObserverSet < Concurrent::Synchronization::LockableObject - def add_observer(observer = nil, func = nil, &block); end - def clear_observers_and_return_old; end - def count_observers; end - def delete_observer(observer); end - def delete_observers; end - def initialize; end - def notify_and_delete_observers(*args, &block); end - def notify_observers(*args, &block); end - def notify_to(observers, *args); end - def ns_initialize; end - def observers; end - def observers=(new_set); end -end -class Concurrent::Collection::CopyOnNotifyObserverSet < Concurrent::Synchronization::LockableObject - def add_observer(observer = nil, func = nil, &block); end - def count_observers; end - def delete_observer(observer); end - def delete_observers; end - def duplicate_and_clear_observers; end - def duplicate_observers; end - def initialize; end - def notify_and_delete_observers(*args, &block); end - def notify_observers(*args, &block); end - def notify_to(observers, *args); end - def ns_initialize; end -end -module Concurrent::Concern::Observable - def add_observer(observer = nil, func = nil, &block); end - def count_observers; end - def delete_observer(observer); end - def delete_observers; end - def observers; end - def observers=(arg0); end - def with_observer(observer = nil, func = nil, &block); end -end -class Concurrent::IVar < Concurrent::Synchronization::LockableObject - def add_observer(observer = nil, func = nil, &block); end - def check_for_block_or_value!(block_given, value); end - def complete(success, value, reason); end - def complete_without_notification(success, value, reason); end - def fail(reason = nil); end - def initialize(value = nil, opts = nil, &block); end - def notify_observers(value, reason); end - def ns_complete_without_notification(success, value, reason); end - def ns_initialize(value, opts); end - def safe_execute(task, args = nil); end - def set(value = nil); end - def try_set(value = nil, &block); end - include Concurrent::Concern::Obligation - include Concurrent::Concern::Observable -end -module Concurrent::Options - def self.executor(executor_identifier); end - def self.executor_from_options(opts = nil); end -end -class Concurrent::ScheduledTask < Concurrent::IVar - def <=>(other); end - def cancel; end - def cancelled?; end - def execute; end - def executor; end - def fail(reason = nil); end - def initial_delay; end - def initialize(delay, opts = nil, &task); end - def ns_reschedule(delay); end - def ns_schedule(delay); end - def process_task; end - def processing?; end - def reschedule(delay); end - def reset; end - def schedule_time; end - def self.execute(delay, opts = nil, &task); end - def set(value = nil); end - def try_set(value = nil, &block); end - include Comparable -end -class Concurrent::Collection::RubyNonConcurrentPriorityQueue - def <<(item); end - def clear; end - def delete(item); end - def deq; end - def empty?; end - def enq(item); end - def has_priority?(item); end - def include?(item); end - def initialize(opts = nil); end - def length; end - def ordered?(x, y); end - def peek; end - def pop; end - def push(item); end - def self.from_list(list, opts = nil); end - def shift; end - def sink(k); end - def size; end - def swap(x, y); end - def swim(k); end -end -class Concurrent::Collection::NonConcurrentPriorityQueue < Concurrent::Collection::RubyNonConcurrentPriorityQueue - def <<(item); end - def deq; end - def enq(item); end - def has_priority?(item); end - def shift; end - def size; end -end -class Concurrent::TimerSet < Concurrent::RubyExecutorService - def <<(task); end - def initialize(opts = nil); end - def kill; end - def ns_initialize(opts); end - def ns_post_task(task); end - def ns_reset_if_forked; end - def ns_shutdown_execution; end - def post(delay, *args, &task); end - def post_task(task); end - def process_tasks; end - def remove_task(task); end -end -class Concurrent::Synchronization::Condition < Concurrent::Synchronization::LockableObject - def broadcast; end - def initialize(lock); end - def ns_broadcast; end - def ns_signal; end - def ns_wait(timeout = nil); end - def ns_wait_until(timeout = nil, &condition); end - def self.new(*args, &block); end - def self.private_new(*args, &block); end - def signal; end - def wait(timeout = nil); end - def wait_until(timeout = nil, &condition); end -end -class Concurrent::AtomicMarkableReference < Concurrent::Synchronization::Object - def __initialize_atomic_fields__; end - def compare_and_set(expected_val, new_val, expected_mark, new_mark); end - def compare_and_set_reference(expected, value); end - def compare_and_swap(expected_val, new_val, expected_mark, new_mark); end - def get; end - def immutable_array(*args); end - def initialize(value = nil, mark = nil); end - def mark; end - def marked?; end - def reference; end - def reference=(value); end - def set(new_val, new_mark); end - def swap_reference(value); end - def try_update!; end - def try_update; end - def update; end - def update_reference(&block); end - def value; end - extend Concurrent::Synchronization::SafeInitialization -end -class Concurrent::Agent < Concurrent::Synchronization::LockableObject - def <<(action); end - def await; end - def await_for!(timeout); end - def await_for(timeout); end - def deref; end - def enqueue_action_job(action, args, executor); end - def enqueue_await_job(latch); end - def error; end - def error_mode; end - def execute_next_job; end - def failed?; end - def handle_error(error); end - def initialize(initial, opts = nil); end - def ns_enqueue_job(job, index = nil); end - def ns_find_last_job_for_thread; end - def ns_initialize(initial, opts); end - def ns_post_next_job; end - def ns_validate(value); end - def post(*args, &action); end - def reason; end - def restart(new_value, opts = nil); end - def self.await(*agents); end - def self.await_for!(timeout, *agents); end - def self.await_for(timeout, *agents); end - def send!(*args, &action); end - def send(*args, &action); end - def send_off!(*args, &action); end - def send_off(*args, &action); end - def send_via!(executor, *args, &action); end - def send_via(executor, *args, &action); end - def stopped?; end - def value; end - def wait(timeout = nil); end - include Concurrent::Concern::Observable -end -class Concurrent::Agent::Job < Struct - def action; end - def action=(_); end - def args; end - def args=(_); end - def caller; end - def caller=(_); end - def executor; end - def executor=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class Concurrent::Agent::Error < StandardError - def initialize(message = nil); end -end -class Concurrent::Agent::ValidationError < Concurrent::Agent::Error - def initialize(message = nil); end -end -class Concurrent::Atom < Concurrent::Synchronization::Object - def __initialize_atomic_fields__; end - def compare_and_set(old_value, new_value); end - def compare_and_set_value(expected, value); end - def deref; end - def initialize(value, opts = nil); end - def reset(new_value); end - def swap(*args); end - def swap_value(value); end - def update_value(&block); end - def valid?(new_value); end - def value; end - def value=(value); end - extend Concurrent::Synchronization::SafeInitialization - include Concurrent::Concern::Observable -end -class Concurrent::Array < Array -end -class Concurrent::CRubySet < Set - def &(*args); end - def +(*args); end - def -(*args); end - def <(*args); end - def <<(*args); end - def <=(*args); end - def <=>(*args); end - def ==(*args); end - def ===(*args); end - def >(*args); end - def >=(*args); end - def ^(*args); end - def add(*args); end - def add?(*args); end - def classify(*args); end - def clear(*args); end - def collect!(*args); end - def compare_by_identity(*args); end - def compare_by_identity?(*args); end - def delete(*args); end - def delete?(*args); end - def delete_if(*args); end - def difference(*args); end - def disjoint?(*args); end - def divide(*args); end - def each(*args); end - def empty?(*args); end - def eql?(*args); end - def filter!(*args); end - def flatten!(*args); end - def flatten(*args); end - def flatten_merge(*args); end - def freeze(*args); end - def hash(*args); end - def include?(*args); end - def initialize(*args, &block); end - def initialize_copy(other); end - def inspect(*args); end - def intersect?(*args); end - def intersection(*args); end - def join(*args); end - def keep_if(*args); end - def length(*args); end - def map!(*args); end - def member?(*args); end - def merge(*args); end - def pretty_print(*args); end - def pretty_print_cycle(*args); end - def proper_subset?(*args); end - def proper_superset?(*args); end - def reject!(*args); end - def replace(*args); end - def reset(*args); end - def select!(*args); end - def size(*args); end - def subset?(*args); end - def subtract(*args); end - def superset?(*args); end - def to_a(*args); end - def to_s(*args); end - def to_set(*args); end - def union(*args); end - def |(*args); end -end -class Concurrent::Set < Concurrent::CRubySet -end -class Concurrent::Tuple - def cas(i, old_value, new_value); end - def compare_and_set(i, old_value, new_value); end - def each; end - def get(i); end - def initialize(size); end - def set(i, value); end - def size; end - def volatile_get(i); end - def volatile_set(i, value); end - include Enumerable -end -module Concurrent::Async - def async; end - def await; end - def call; end - def cast; end - def init_synchronization; end - def self.included(base); end - def self.validate_argc(obj, method, *args); end -end -module Concurrent::Async::ClassMethods - def new(*args, **, &block); end -end -class Concurrent::Async::AsyncDelegator < Concurrent::Synchronization::LockableObject - def initialize(delegate); end - def method_missing(method, *args, &block); end - def perform; end - def reset_if_forked; end - def respond_to_missing?(method, include_private = nil); end -end -class Concurrent::Async::AwaitDelegator - def initialize(delegate); end - def method_missing(method, *args, &block); end - def respond_to_missing?(method, include_private = nil); end -end -class Concurrent::Future < Concurrent::IVar - def cancel; end - def cancelled?; end - def execute; end - def initialize(opts = nil, &block); end - def ns_initialize(value, opts); end - def self.execute(opts = nil, &block); end - def set(value = nil, &block); end - def wait_or_cancel(timeout); end -end -class Concurrent::DependencyCounter - def initialize(count, &block); end - def update(time, value, reason); end -end -class Concurrent::Maybe < Concurrent::Synchronization::Object - def <=>(other); end - def fulfilled?; end - def initialize(just, nothing); end - def just; end - def just?; end - def nothing; end - def nothing?; end - def or(other); end - def reason; end - def rejected?; end - def self.from(*args); end - def self.just(value); end - def self.new(*args, &block); end - def self.nothing(error = nil); end - def value; end - extend Concurrent::Synchronization::SafeInitialization - include Comparable -end -class Concurrent::AbstractExchanger < Concurrent::Synchronization::Object - def do_exchange(value, timeout); end - def exchange!(value, timeout = nil); end - def exchange(value, timeout = nil); end - def initialize; end - def try_exchange(value, timeout = nil); end -end -class Concurrent::RubyExchanger < Concurrent::AbstractExchanger - def __initialize_atomic_fields__; end - def compare_and_set_slot(expected, value); end - def do_exchange(value, timeout); end - def initialize; end - def slot; end - def slot=(value); end - def swap_slot(value); end - def update_slot(&block); end - extend Concurrent::Synchronization::SafeInitialization -end -class Concurrent::RubyExchanger::Node < Concurrent::Synchronization::Object - def __initialize_atomic_fields__; end - def compare_and_set_value(expected, value); end - def initialize(item); end - def item; end - def latch; end - def swap_value(value); end - def update_value(&block); end - def value; end - def value=(value); end - extend Concurrent::Synchronization::SafeInitialization -end -class Concurrent::Exchanger < Concurrent::RubyExchanger -end -module Concurrent::Synchronization::AbstractStruct - def initialize(*values); end - def length; end - def members; end - def ns_each; end - def ns_each_pair; end - def ns_equality(other); end - def ns_get(member); end - def ns_initialize_copy; end - def ns_inspect; end - def ns_merge(other, &block); end - def ns_select; end - def ns_to_h; end - def ns_values; end - def ns_values_at(indexes); end - def pr_underscore(clazz); end - def self.define_struct_class(parent, base, name, members, &block); end - def size; end -end -module Concurrent::ImmutableStruct - def ==(other); end - def [](member); end - def each(&block); end - def each_pair(&block); end - def initialize_copy(original); end - def inspect; end - def merge(other, &block); end - def select(&block); end - def self.included(base); end - def self.new(*args, &block); end - def to_a; end - def to_h; end - def to_s; end - def values; end - def values_at(*indexes); end - include Concurrent::Synchronization::AbstractStruct -end -module Concurrent::MutableStruct - def ==(other); end - def [](member); end - def []=(member, value); end - def each(&block); end - def each_pair(&block); end - def initialize_copy(original); end - def inspect; end - def merge(other, &block); end - def select(&block); end - def self.new(*args, &block); end - def to_a; end - def to_h; end - def to_s; end - def values; end - def values_at(*indexes); end - include Concurrent::Synchronization::AbstractStruct -end -class Concurrent::MVar < Concurrent::Synchronization::Object - def borrow(timeout = nil); end - def empty?; end - def full?; end - def initialize(value = nil, opts = nil); end - def modify!; end - def modify(timeout = nil); end - def put(value, timeout = nil); end - def set!(value); end - def synchronize(&block); end - def take(timeout = nil); end - def try_put!(value); end - def try_take!; end - def unlocked_empty?; end - def unlocked_full?; end - def wait_for_empty(timeout); end - def wait_for_full(timeout); end - def wait_while(condition, timeout); end - extend Concurrent::Synchronization::SafeInitialization - include Concurrent::Concern::Dereferenceable -end -class Concurrent::PromiseExecutionError < StandardError -end -class Concurrent::Promise < Concurrent::IVar - def catch(&block); end - def complete(success, value, reason); end - def execute; end - def fail(reason = nil); end - def flat_map(&block); end - def initialize(opts = nil, &block); end - def notify_child(child); end - def ns_initialize(value, opts); end - def on_error(&block); end - def on_fulfill(result); end - def on_reject(reason); end - def on_success(&block); end - def realize(task); end - def rescue(&block); end - def root?; end - def self.aggregate(method, *promises); end - def self.all?(*promises); end - def self.any?(*promises); end - def self.execute(opts = nil, &block); end - def self.fulfill(value, opts = nil); end - def self.reject(reason, opts = nil); end - def self.zip(*promises); end - def set(value = nil, &block); end - def set_pending; end - def set_state!(success, value, reason); end - def synchronized_set_state!(success, value, reason); end - def then(*args, &block); end - def zip(*others); end -end -module Concurrent::SettableStruct - def ==(other); end - def [](member); end - def []=(member, value); end - def each(&block); end - def each_pair(&block); end - def initialize_copy(original); end - def inspect; end - def merge(other, &block); end - def select(&block); end - def self.new(*args, &block); end - def to_a; end - def to_h; end - def to_s; end - def values; end - def values_at(*indexes); end - include Concurrent::Synchronization::AbstractStruct -end -class Concurrent::TimerTask < Concurrent::RubyExecutorService - def <<(task); end - def calculate_next_interval(start_time); end - def execute; end - def execute_task(completion); end - def execution_interval; end - def execution_interval=(value); end - def initialize(opts = nil, &task); end - def interval_type; end - def ns_initialize(opts, &task); end - def ns_kill_execution; end - def ns_shutdown_execution; end - def post(*args, &task); end - def running?; end - def schedule_next_task(interval = nil); end - def self.execute(opts = nil, &task); end - def timeout_interval; end - def timeout_interval=(value); end - include Concurrent::Concern::Dereferenceable - include Concurrent::Concern::Observable -end -class Concurrent::TVar < Concurrent::Synchronization::Object - def initialize(value); end - def unsafe_lock; end - def unsafe_value; end - def unsafe_value=(value); end - def value; end - def value=(value); end - extend Concurrent::Synchronization::SafeInitialization -end -class Concurrent::Transaction - def abort; end - def commit; end - def initialize; end - def open(tvar); end - def read(tvar); end - def self.current; end - def self.current=(transaction); end - def unlock; end - def write(tvar, value); end -end -class Concurrent::Transaction::OpenEntry < Struct - def modified; end - def modified=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end - def value; end - def value=(_); end -end -class Concurrent::Transaction::AbortError < StandardError -end -class Concurrent::Transaction::LeaveError < StandardError -end -class Concurrent::LockFreeStack < Concurrent::Synchronization::Object - def __initialize_atomic_fields__; end - def clear; end - def clear_each(&block); end - def clear_if(head); end - def compare_and_clear(head); end - def compare_and_pop(head); end - def compare_and_push(head, value); end - def compare_and_set_head(expected, value); end - def each(head = nil); end - def empty?(head = nil); end - def head; end - def head=(value); end - def initialize(head = nil); end - def inspect; end - def peek; end - def pop; end - def push(value); end - def replace_if(head, new_head); end - def self.of1(value); end - def self.of2(value1, value2); end - def swap_head(value); end - def to_s; end - def update_head(&block); end - extend Concurrent::Synchronization::SafeInitialization - include Enumerable -end -class Concurrent::LockFreeStack::Node - def initialize(value, next_node); end - def next_node; end - def self.[](*, **); end - def value; end - def value=(arg0); end -end -module Concurrent::ReInclude - def extended(base); end - def include(*modules); end - def included(base); end -end -module Concurrent::Promises - extend Concurrent::Promises::FactoryMethods -end -module Concurrent::Promises::FactoryMethods - def any(*futures_and_or_events); end - def any_event(*futures_and_or_events); end - def any_event_on(default_executor, *futures_and_or_events); end - def any_fulfilled_future(*futures_and_or_events); end - def any_fulfilled_future_on(default_executor, *futures_and_or_events); end - def any_resolved_future(*futures_and_or_events); end - def any_resolved_future_on(default_executor, *futures_and_or_events); end - def delay(*args, &task); end - def delay_on(default_executor, *args, &task); end - def fulfilled_future(value, default_executor = nil); end - def future(*args, &task); end - def future_on(default_executor, *args, &task); end - def make_future(argument = nil, default_executor = nil); end - def rejected_future(reason, default_executor = nil); end - def resolvable_event; end - def resolvable_event_on(default_executor = nil); end - def resolvable_future; end - def resolvable_future_on(default_executor = nil); end - def resolved_event(default_executor = nil); end - def resolved_future(fulfilled, value, reason, default_executor = nil); end - def schedule(intended_time, *args, &task); end - def schedule_on(default_executor, intended_time, *args, &task); end - def zip(*futures_and_or_events); end - def zip_events(*futures_and_or_events); end - def zip_events_on(default_executor, *futures_and_or_events); end - def zip_futures(*futures_and_or_events); end - def zip_futures_on(default_executor, *futures_and_or_events); end - extend Concurrent::Promises::FactoryMethods - extend Concurrent::Promises::FactoryMethods::Configuration - extend Concurrent::ReInclude - include Concurrent::Promises::FactoryMethods::Configuration -end -module Concurrent::Promises::FactoryMethods::Configuration - def default_executor; end -end -module Concurrent::Promises::InternalStates -end -class Concurrent::Promises::InternalStates::State - def resolved?; end - def to_sym; end -end -class Concurrent::Promises::InternalStates::Pending < Concurrent::Promises::InternalStates::State - def resolved?; end - def to_sym; end -end -class Concurrent::Promises::InternalStates::Reserved < Concurrent::Promises::InternalStates::Pending -end -class Concurrent::Promises::InternalStates::ResolvedWithResult < Concurrent::Promises::InternalStates::State - def apply; end - def fulfilled?; end - def reason; end - def resolved?; end - def result; end - def to_sym; end - def value; end -end -class Concurrent::Promises::InternalStates::Fulfilled < Concurrent::Promises::InternalStates::ResolvedWithResult - def apply(args, block); end - def fulfilled?; end - def initialize(value); end - def reason; end - def to_sym; end - def value; end -end -class Concurrent::Promises::InternalStates::FulfilledArray < Concurrent::Promises::InternalStates::Fulfilled - def apply(args, block); end -end -class Concurrent::Promises::InternalStates::Rejected < Concurrent::Promises::InternalStates::ResolvedWithResult - def apply(args, block); end - def fulfilled?; end - def initialize(reason); end - def reason; end - def to_sym; end - def value; end -end -class Concurrent::Promises::InternalStates::PartiallyRejected < Concurrent::Promises::InternalStates::ResolvedWithResult - def apply(args, block); end - def fulfilled?; end - def initialize(value, reason); end - def reason; end - def to_sym; end - def value; end -end -class Concurrent::Promises::AbstractEventFuture < Concurrent::Synchronization::Object - def __initialize_atomic_fields__; end - def add_callback(method, *args); end - def add_callback_clear_delayed_node(node); end - def add_callback_notify_blocked(promise, index); end - def async_callback_on_resolution(state, executor, args, callback); end - def blocks; end - def call_callback(method, state, args); end - def call_callbacks(state); end - def callback_clear_delayed_node(state, node); end - def callback_notify_blocked(state, promise, index); end - def callbacks; end - def chain(*args, &task); end - def chain_on(executor, *args, &task); end - def chain_resolvable(resolvable); end - def compare_and_set_internal_state(expected, value); end - def default_executor; end - def initialize(promise, default_executor); end - def inspect; end - def internal_state; end - def internal_state=(value); end - def on_resolution!(*args, &callback); end - def on_resolution(*args, &callback); end - def on_resolution_using(executor, *args, &callback); end - def pending?; end - def promise; end - def resolve_with(state, raise_on_reassign = nil, reserved = nil); end - def resolved?; end - def state; end - def swap_internal_state(value); end - def tangle(resolvable); end - def to_s; end - def touch; end - def touched?; end - def update_internal_state(&block); end - def wait(timeout = nil); end - def wait_until_resolved(timeout); end - def waiting_threads; end - def with_async(executor, *args, &block); end - def with_default_executor(executor); end - def with_hidden_resolvable; end - extend Concurrent::Synchronization::SafeInitialization - include Concurrent::Promises::InternalStates -end -class Concurrent::Promises::Event < Concurrent::Promises::AbstractEventFuture - def &(other); end - def any(event_or_future); end - def callback_on_resolution(state, args, callback); end - def delay; end - def rejected_resolution(raise_on_reassign, state); end - def schedule(intended_time); end - def then(*args, &task); end - def to_event; end - def to_future; end - def with_default_executor(executor); end - def zip(other); end - def |(event_or_future); end -end -class Concurrent::Promises::Future < Concurrent::Promises::AbstractEventFuture - def &(other); end - def any(event_or_future); end - def apply(args, block); end - def async_callback_on_fulfillment(state, executor, args, callback); end - def async_callback_on_rejection(state, executor, args, callback); end - def callback_on_fulfillment(state, args, callback); end - def callback_on_rejection(state, args, callback); end - def callback_on_resolution(state, args, callback); end - def delay; end - def exception(*args); end - def flat(level = nil); end - def flat_event; end - def flat_future(level = nil); end - def fulfilled?; end - def inspect; end - def on_fulfillment!(*args, &callback); end - def on_fulfillment(*args, &callback); end - def on_fulfillment_using(executor, *args, &callback); end - def on_rejection!(*args, &callback); end - def on_rejection(*args, &callback); end - def on_rejection_using(executor, *args, &callback); end - def reason(timeout = nil, timeout_value = nil); end - def rejected?; end - def rejected_resolution(raise_on_reassign, state); end - def rescue(*args, &task); end - def rescue_on(executor, *args, &task); end - def result(timeout = nil); end - def run(run_test = nil); end - def run_test(v); end - def schedule(intended_time); end - def then(*args, &task); end - def then_on(executor, *args, &task); end - def to_event; end - def to_future; end - def to_s; end - def value!(timeout = nil, timeout_value = nil); end - def value(timeout = nil, timeout_value = nil); end - def wait!(timeout = nil); end - def wait_until_resolved!(timeout = nil); end - def with_default_executor(executor); end - def zip(other); end - def |(event_or_future); end -end -module Concurrent::Promises::Resolvable - include Concurrent::Promises::InternalStates -end -class Concurrent::Promises::ResolvableEvent < Concurrent::Promises::Event - def resolve(raise_on_reassign = nil, reserved = nil); end - def wait(timeout = nil, resolve_on_timeout = nil); end - def with_hidden_resolvable; end - include Concurrent::Promises::Resolvable -end -class Concurrent::Promises::ResolvableFuture < Concurrent::Promises::Future - def evaluate_to!(*args, &block); end - def evaluate_to(*args, &block); end - def fulfill(value, raise_on_reassign = nil, reserved = nil); end - def reason(timeout = nil, timeout_value = nil, resolve_on_timeout = nil); end - def reject(reason, raise_on_reassign = nil, reserved = nil); end - def resolve(fulfilled = nil, value = nil, reason = nil, raise_on_reassign = nil, reserved = nil); end - def result(timeout = nil, resolve_on_timeout = nil); end - def value!(timeout = nil, timeout_value = nil, resolve_on_timeout = nil); end - def value(timeout = nil, timeout_value = nil, resolve_on_timeout = nil); end - def wait!(timeout = nil, resolve_on_timeout = nil); end - def wait(timeout = nil, resolve_on_timeout = nil); end - def with_hidden_resolvable; end - include Concurrent::Promises::Resolvable -end -class Concurrent::Promises::AbstractPromise < Concurrent::Synchronization::Object - def default_executor; end - def delayed_because; end - def evaluate_to(*args, block); end - def event; end - def future; end - def initialize(future); end - def inspect; end - def resolve_with(new_state, raise_on_reassign = nil); end - def state; end - def to_s; end - def touch; end - extend Concurrent::Synchronization::SafeInitialization - include Concurrent::Promises::InternalStates -end -class Concurrent::Promises::ResolvableEventPromise < Concurrent::Promises::AbstractPromise - def initialize(default_executor); end -end -class Concurrent::Promises::ResolvableFuturePromise < Concurrent::Promises::AbstractPromise - def evaluate_to(*args, block); end - def initialize(default_executor); end -end -class Concurrent::Promises::InnerPromise < Concurrent::Promises::AbstractPromise -end -class Concurrent::Promises::BlockedPromise < Concurrent::Promises::InnerPromise - def blocked_by; end - def clear_and_propagate_touch(stack_or_element = nil); end - def delayed_because; end - def initialize(delayed, blockers_count, future); end - def on_blocker_resolution(future, index); end - def on_resolvable(resolved_future, index); end - def process_on_blocker_resolution(future, index); end - def resolvable?(countdown, future, index); end - def self.add_delayed(delayed1, delayed2); end - def self.new(*args, &block); end - def self.new_blocked_by(blockers, *args, &block); end - def self.new_blocked_by1(blocker, *args, &block); end - def self.new_blocked_by2(blocker1, blocker2, *args, &block); end - def touch; end -end -class Concurrent::Promises::BlockedTaskPromise < Concurrent::Promises::BlockedPromise - def executor; end - def initialize(delayed, blockers_count, default_executor, executor, args, &task); end -end -class Concurrent::Promises::ThenPromise < Concurrent::Promises::BlockedTaskPromise - def initialize(delayed, blockers_count, default_executor, executor, args, &task); end - def on_resolvable(resolved_future, index); end -end -class Concurrent::Promises::RescuePromise < Concurrent::Promises::BlockedTaskPromise - def initialize(delayed, blockers_count, default_executor, executor, args, &task); end - def on_resolvable(resolved_future, index); end -end -class Concurrent::Promises::ChainPromise < Concurrent::Promises::BlockedTaskPromise - def on_resolvable(resolved_future, index); end -end -class Concurrent::Promises::ImmediateEventPromise < Concurrent::Promises::InnerPromise - def initialize(default_executor); end -end -class Concurrent::Promises::ImmediateFuturePromise < Concurrent::Promises::InnerPromise - def initialize(default_executor, fulfilled, value, reason); end -end -class Concurrent::Promises::AbstractFlatPromise < Concurrent::Promises::BlockedPromise - def add_delayed_of(future); end - def initialize(delayed_because, blockers_count, event_or_future); end - def on_resolvable(resolved_future, index); end - def resolvable?(countdown, future, index); end - def touch; end - def touched?; end -end -class Concurrent::Promises::FlatEventPromise < Concurrent::Promises::AbstractFlatPromise - def initialize(delayed, blockers_count, default_executor); end - def process_on_blocker_resolution(future, index); end -end -class Concurrent::Promises::FlatFuturePromise < Concurrent::Promises::AbstractFlatPromise - def initialize(delayed, blockers_count, levels, default_executor); end - def process_on_blocker_resolution(future, index); end -end -class Concurrent::Promises::RunFuturePromise < Concurrent::Promises::AbstractFlatPromise - def initialize(delayed, blockers_count, default_executor, run_test); end - def process_on_blocker_resolution(future, index); end -end -class Concurrent::Promises::ZipEventEventPromise < Concurrent::Promises::BlockedPromise - def initialize(delayed, blockers_count, default_executor); end - def on_resolvable(resolved_future, index); end -end -class Concurrent::Promises::ZipFutureEventPromise < Concurrent::Promises::BlockedPromise - def initialize(delayed, blockers_count, default_executor); end - def on_resolvable(resolved_future, index); end - def process_on_blocker_resolution(future, index); end -end -class Concurrent::Promises::EventWrapperPromise < Concurrent::Promises::BlockedPromise - def initialize(delayed, blockers_count, default_executor); end - def on_resolvable(resolved_future, index); end -end -class Concurrent::Promises::FutureWrapperPromise < Concurrent::Promises::BlockedPromise - def initialize(delayed, blockers_count, default_executor); end - def on_resolvable(resolved_future, index); end -end -class Concurrent::Promises::ZipFuturesPromise < Concurrent::Promises::BlockedPromise - def initialize(delayed, blockers_count, default_executor); end - def on_resolvable(resolved_future, index); end - def process_on_blocker_resolution(future, index); end -end -class Concurrent::Promises::ZipEventsPromise < Concurrent::Promises::BlockedPromise - def initialize(delayed, blockers_count, default_executor); end - def on_resolvable(resolved_future, index); end -end -class Concurrent::Promises::AbstractAnyPromise < Concurrent::Promises::BlockedPromise -end -class Concurrent::Promises::AnyResolvedEventPromise < Concurrent::Promises::AbstractAnyPromise - def initialize(delayed, blockers_count, default_executor); end - def on_resolvable(resolved_future, index); end - def resolvable?(countdown, future, index); end -end -class Concurrent::Promises::AnyResolvedFuturePromise < Concurrent::Promises::AbstractAnyPromise - def initialize(delayed, blockers_count, default_executor); end - def on_resolvable(resolved_future, index); end - def resolvable?(countdown, future, index); end -end -class Concurrent::Promises::AnyFulfilledFuturePromise < Concurrent::Promises::AnyResolvedFuturePromise - def resolvable?(countdown, event_or_future, index); end -end -class Concurrent::Promises::DelayPromise < Concurrent::Promises::InnerPromise - def delayed_because; end - def initialize(default_executor); end - def touch; end -end -class Concurrent::Promises::ScheduledPromise < Concurrent::Promises::InnerPromise - def initialize(default_executor, intended_time); end - def inspect; end - def intended_time; end -end -class Concurrent::SynchronizedDelegator < SimpleDelegator - def initialize(obj); end - def method_missing(method, *args, &block); end - def setup; end - def teardown; end -end diff --git a/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi b/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi index 11d0bfb..e6a82d0 100644 --- a/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi +++ b/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi @@ -5,5 +5,11641 @@ # Please instead update this file by running `bin/tapioca gem concurrent-ruby`. -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem +# {include:file:README.md} +# +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/constants.rb#1 +module Concurrent + extend ::Concurrent::Utility::EngineDetector + extend ::Concurrent::Utility::NativeExtensionLoader + extend ::Logger::Severity + 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 + + # @return [Logger] Logger with provided level and output. + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#37 + def create_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end + + # @deprecated + # @return [Logger] Logger with provided level and output. + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#69 + 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#109 + def global_logger; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#113 + 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#63 + 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#96 + 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 ::Logger::Severity + 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 timout 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 timout 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/map.rb#7 +module Concurrent::Collection; end + +# A thread safe observer set implemented using copy-on-read approach: +# observers are added and removed from a thread safe collection; every time +# a notification is required the internal data structure is copied to +# prevent concurrency issues +# +# @api private +# +# 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 ::Logger::Severity + include ::Concurrent::Concern::Logging + extend ::Logger::Severity + 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#10 +module Concurrent::Concern::Logging + include ::Logger::Severity + + # Logs through {Concurrent.global_logger}, it can be overridden by setting @logger + # + # @param level [Integer] one of Logger::Severity 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#18 + def log(level, progname, message = T.unsafe(nil), &block); end +end + +# 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 opration 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 ::Logger::Severity + 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#106 +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#103 +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 intialization 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 explicitely 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 ::Logger::Severity + 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 instanciation. + # + # @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 ::Logger::Severity + 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 ::Logger::Severity + 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 ::Logger::Severity + 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 bahaviors. 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 oly 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/connection_pool.rbi b/sorbet/rbi/gems/connection_pool.rbi deleted file mode 100644 index 859194f..0000000 --- a/sorbet/rbi/gems/connection_pool.rbi +++ /dev/null @@ -1,60 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: strict -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/connection_pool/all/connection_pool.rbi -# -# connection_pool-2.4.1 - -class ConnectionPool - def auto_reload_after_fork; end - def available; end - def checkin(force: nil); end - def checkout(options = nil); end - def initialize(options = nil, &block); end - def reload(&block); end - def self.after_fork; end - def self.wrap(options, &block); end - def shutdown(&block); end - def size; end - def then(options = nil); end - def with(options = nil); end -end -class ConnectionPool::TimedStack - def <<(obj, options = nil); end - def connection_stored?(options = nil); end - def current_time; end - def empty?; end - def fetch_connection(options = nil); end - def initialize(size = nil, &block); end - def length; end - def max; end - def pop(timeout = nil, options = nil); end - def push(obj, options = nil); end - def shutdown(reload: nil, &block); end - def shutdown_connections(options = nil); end - def store_connection(obj, options = nil); end - def try_create(options = nil); end -end -class ConnectionPool::Wrapper < BasicObject - def initialize(options = nil, &block); end - def method_missing(name, *args, **kwargs, &block); end - def pool_available; end - def pool_shutdown(&block); end - def pool_size; end - def respond_to?(id, *args); end - def with(&block); end - def wrapped_pool; end -end -class ConnectionPool::Error < RuntimeError -end -class ConnectionPool::PoolShuttingDownError < ConnectionPool::Error -end -class ConnectionPool::TimeoutError < Timeout::Error -end -module ConnectionPool::ForkTracker - def _fork; end -end diff --git a/sorbet/rbi/gems/drb.rbi b/sorbet/rbi/gems/drb.rbi deleted file mode 100644 index 94252c1..0000000 --- a/sorbet/rbi/gems/drb.rbi +++ /dev/null @@ -1,220 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: false -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/drb/all/drb.rbi -# -# drb-2.2.1 - -module DRb - def config; end - def current_server; end - def fetch_server(uri); end - def front; end - def here?(uri); end - def install_acl(acl); end - def install_id_conv(idconv); end - def mutex; end - def primary_server; end - def primary_server=(arg0); end - def regist_server(server); end - def remove_server(server); end - def self.config; end - def self.current_server; end - def self.fetch_server(uri); end - def self.front; end - def self.here?(uri); end - def self.install_acl(acl); end - def self.install_id_conv(idconv); end - def self.mutex; end - def self.primary_server; end - def self.primary_server=(arg0); end - def self.regist_server(server); end - def self.remove_server(server); end - def self.start_service(uri = nil, front = nil, config = nil); end - def self.stop_service; end - def self.thread; end - def self.to_id(obj); end - def self.to_obj(ref); end - def self.uri; end - def start_service(uri = nil, front = nil, config = nil); end - def stop_service; end - def thread; end - def to_id(obj); end - def to_obj(ref); end - def uri; end -end -class DRb::DRbObject - def ==(other); end - def __drbref; end - def __drburi; end - def _dump(lv); end - def eql?(other); end - def hash; end - def initialize(obj, uri = nil); end - def method_missing(msg_id, *a, **, &b); end - def pretty_print(q); end - def pretty_print_cycle(q); end - def respond_to?(msg_id, priv = nil); end - def self._load(s); end - def self.new_with(uri, ref); end - def self.new_with_uri(uri); end - def self.prepare_backtrace(uri, result); end - def self.with_friend(uri); end -end -class DRb::DRbServer - def alive?; end - def any_to_s(obj); end - def check_insecure_method(obj, msg_id); end - def config; end - def error_print(exception); end - def front; end - def here?(uri); end - def initialize(uri = nil, front = nil, config_or_acl = nil); end - def insecure_method?(msg_id); end - def main_loop; end - def run; end - def self.default_acl(acl); end - def self.default_argc_limit(argc); end - def self.default_id_conv(idconv); end - def self.default_load_limit(sz); end - def self.make_config(hash = nil); end - def self.verbose; end - def self.verbose=(on); end - def shutdown; end - def stop_service; end - def thread; end - def to_id(obj); end - def to_obj(ref); end - def uri; end - def verbose; end - def verbose=(v); end -end -module DRb::DRbServer::InvokeMethod18Mixin - def block_yield(x); end - def perform_with_block; end -end -class DRb::DRbError < RuntimeError -end -class DRb::DRbConnError < DRb::DRbError -end -class DRb::DRbIdConv - def to_id(obj); end - def to_obj(ref); end -end -module DRb::DRbUndumped - def _dump(dummy); end -end -class DRb::DRbServerNotFound < DRb::DRbError -end -class DRb::DRbBadURI < DRb::DRbError -end -class DRb::DRbBadScheme < DRb::DRbError -end -class DRb::DRbUnknownError < DRb::DRbError - def _dump(lv); end - def initialize(unknown); end - def self._load(s); end - def unknown; end -end -class DRb::DRbRemoteError < DRb::DRbError - def initialize(error); end - def reason; end -end -class DRb::DRbUnknown - def _dump(lv); end - def buf; end - def exception; end - def initialize(err, buf); end - def name; end - def reload; end - def self._load(s); end -end -class DRb::DRbArray - def _dump(lv); end - def initialize(ary); end - def self._load(s); end -end -class DRb::DRbMessage - def dump(obj, error = nil); end - def initialize(config); end - def load(soc); end - def make_proxy(obj, error = nil); end - def recv_reply(stream); end - def recv_request(stream); end - def send_reply(stream, succ, result); end - def send_request(stream, ref, msg_id, arg, b); end -end -module DRb::DRbProtocol - def add_protocol(prot); end - def auto_load(uri); end - def open(uri, config, first = nil); end - def open_server(uri, config, first = nil); end - def self.add_protocol(prot); end - def self.auto_load(uri); end - def self.open(uri, config, first = nil); end - def self.open_server(uri, config, first = nil); end - def self.uri_option(uri, config, first = nil); end - def uri_option(uri, config, first = nil); end -end -class DRb::DRbTCPSocket - def accept; end - def accept_or_shutdown; end - def alive?; end - def close; end - def close_shutdown_pipe; end - def initialize(uri, soc, config = nil); end - def peeraddr; end - def recv_reply; end - def recv_request; end - def self.getservername; end - def self.open(uri, config); end - def self.open_server(uri, config); end - def self.open_server_inaddr_any(host, port); end - def self.parse_uri(uri); end - def self.uri_option(uri, config); end - def send_reply(succ, result); end - def send_request(ref, msg_id, arg, b); end - def set_sockopt(soc); end - def shutdown; end - def stream; end - def uri; end -end -class DRb::DRbURIOption - def ==(other); end - def eql?(other); end - def hash; end - def initialize(option); end - def option; end - def to_s; end -end -class DRb::ThreadObject - def _execute; end - def alive?; end - def initialize(&blk); end - def kill; end - def method_missing(msg, *arg, &blk); end - include MonitorMixin -end -class DRb::DRbConn - def alive?; end - def close; end - def initialize(remote_uri); end - def self.make_pool; end - def self.open(remote_uri); end - def self.stop_pool; end - def send_message(ref, msg_id, arg, block); end - def uri; end -end -class DRb::DRbServer::InvokeMethod - def check_insecure_method; end - def init_with_client; end - def initialize(drb_server, client); end - def perform; end - def perform_without_block; end - def setup_message; end - include DRb::DRbServer::InvokeMethod18Mixin -end diff --git a/sorbet/rbi/gems/drb@2.2.1.rbi b/sorbet/rbi/gems/drb@2.2.1.rbi index 4c77c96..d97695d 100644 --- a/sorbet/rbi/gems/drb@2.2.1.rbi +++ b/sorbet/rbi/gems/drb@2.2.1.rbi @@ -1133,6 +1133,52 @@ class DRb::DRbTCPSocket end end +# Implements DRb over a UNIX socket +# +# DRb UNIX socket URIs look like drbunix:?. The +# option is optional. +# +# source://drb//lib/drb/unix.rb#15 +class DRb::DRbUNIXSocket < ::DRb::DRbTCPSocket + # @return [DRbUNIXSocket] a new instance of DRbUNIXSocket + # + # source://drb//lib/drb/unix.rb#62 + def initialize(uri, soc, config = T.unsafe(nil), server_mode = T.unsafe(nil)); end + + # source://drb//lib/drb/unix.rb#105 + def accept; end + + # source://drb//lib/drb/unix.rb#95 + def close; end + + # source://drb//lib/drb/unix.rb#111 + def set_sockopt(soc); end + + class << self + # source://drb//lib/drb/unix.rb#28 + def open(uri, config); end + + # source://drb//lib/drb/unix.rb#34 + def open_server(uri, config); end + + # :stopdoc: + # + # source://drb//lib/drb/unix.rb#17 + def parse_uri(uri); end + + # source://drb//lib/drb/unix.rb#72 + def temp_server; end + + # source://drb//lib/drb/unix.rb#57 + def uri_option(uri, config); end + end +end + +# import from tempfile.rb +# +# source://drb//lib/drb/unix.rb#70 +DRb::DRbUNIXSocket::Max_try = T.let(T.unsafe(nil), Integer) + # source://drb//lib/drb/drb.rb#1021 class DRb::DRbURIOption # @return [DRbURIOption] a new instance of DRbURIOption diff --git a/sorbet/rbi/gems/i18n.rbi b/sorbet/rbi/gems/i18n.rbi deleted file mode 100644 index 39c764a..0000000 --- a/sorbet/rbi/gems/i18n.rbi +++ /dev/null @@ -1,322 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: true -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/i18n/all/i18n.rbi -# -# i18n-1.14.5 - -module I18n - def self.cache_key_digest; end - def self.cache_key_digest=(key_digest); end - def self.cache_namespace; end - def self.cache_namespace=(namespace); end - def self.cache_store; end - def self.cache_store=(store); end - def self.fallbacks; end - def self.fallbacks=(fallbacks); end - def self.interpolate(string, values); end - def self.interpolate_hash(string, values); end - def self.new_double_nested_cache; end - def self.perform_caching?; end - def self.reserve_key(key); end - def self.reserved_keys_pattern; end - extend I18n::Base -end -module I18n::Utils - def self.deep_merge!(hash, other_hash, &block); end - def self.deep_merge(hash, other_hash, &block); end - def self.deep_symbolize_keys(hash); end - def self.deep_symbolize_keys_in_object(value); end - def self.except(hash, *keys); end -end -class I18n::ExceptionHandler - def call(exception, _locale, _key, _options); end -end -class I18n::ArgumentError < ArgumentError -end -class I18n::Disabled < I18n::ArgumentError - def initialize(method); end -end -class I18n::InvalidLocale < I18n::ArgumentError - def initialize(locale); end - def locale; end -end -class I18n::InvalidLocaleData < I18n::ArgumentError - def filename; end - def initialize(filename, exception_message); end -end -class I18n::MissingTranslation < I18n::ArgumentError - include I18n::MissingTranslation::Base -end -module I18n::MissingTranslation::Base - def initialize(locale, key, options = nil); end - def key; end - def keys; end - def locale; end - def message; end - def normalized_option(key); end - def options; end - def to_exception; end - def to_s; end -end -class I18n::MissingTranslationData < I18n::ArgumentError - include I18n::MissingTranslation::Base -end -class I18n::InvalidPluralizationData < I18n::ArgumentError - def count; end - def entry; end - def initialize(entry, count, key); end - def key; end -end -class I18n::MissingInterpolationArgument < I18n::ArgumentError - def initialize(key, values, string); end - def key; end - def string; end - def values; end -end -class I18n::ReservedInterpolationKey < I18n::ArgumentError - def initialize(key, string); end - def key; end - def string; end -end -class I18n::UnknownFileType < I18n::ArgumentError - def filename; end - def initialize(type, filename); end - def type; end -end -class I18n::UnsupportedMethod < I18n::ArgumentError - def backend_klass; end - def initialize(method, backend_klass, msg); end - def method; end - def msg; end -end -class I18n::InvalidFilenames < I18n::ArgumentError - def initialize(file_errors); end -end -module I18n::Base - def available_locales; end - def available_locales=(value); end - def available_locales_initialized?; end - def backend; end - def backend=(value); end - def config; end - def config=(value); end - def default_locale; end - def default_locale=(value); end - def default_separator; end - def default_separator=(value); end - def eager_load!; end - def enforce_available_locales!(locale); end - def enforce_available_locales; end - def enforce_available_locales=(value); end - def exception_handler; end - def exception_handler=(value); end - def exists?(key, _locale = nil, locale: nil, **options); end - def handle_exception(handling, exception, locale, key, options); end - def interpolation_keys(key, **options); end - def interpolation_keys_from_translation(translation); end - def l(object, locale: nil, format: nil, **options); end - def load_path; end - def load_path=(value); end - def locale; end - def locale=(value); end - def locale_available?(locale); end - def localize(object, locale: nil, format: nil, **options); end - def normalize_key(key, separator); end - def normalize_keys(locale, key, scope, separator = nil); end - def reload!; end - def t!(key, **options); end - def t(key = nil, throw: nil, raise: nil, locale: nil, **options); end - def translate!(key, **options); end - def translate(key = nil, throw: nil, raise: nil, locale: nil, **options); end - def translate_key(key, throw, raise, locale, backend, options); end - def transliterate(key, throw: nil, raise: nil, locale: nil, replacement: nil, **options); end - def with_locale(tmp_locale = nil); end -end -module I18n::Backend -end -module I18n::Backend::Fallbacks - def exists?(locale, key, options = nil); end - def extract_non_symbol_default!(options); end - def on_fallback(_original_locale, _fallback_locale, _key, _options); end - def resolve_entry(locale, object, subject, options = nil); end - def translate(locale, key, options = nil); end -end -class I18n::Config - def available_locales; end - def available_locales=(locales); end - def available_locales_initialized?; end - def available_locales_set; end - def backend; end - def backend=(backend); end - def clear_available_locales_set; end - def default_locale; end - def default_locale=(locale); end - def default_separator; end - def default_separator=(separator); end - def enforce_available_locales; end - def enforce_available_locales=(enforce_available_locales); end - def exception_handler; end - def exception_handler=(exception_handler); end - def interpolation_patterns; end - def interpolation_patterns=(interpolation_patterns); end - def load_path; end - def load_path=(load_path); end - def locale; end - def locale=(locale); end - def missing_interpolation_argument_handler; end - def missing_interpolation_argument_handler=(exception_handler); end -end -module I18n::Locale -end -class I18n::Locale::Fallbacks < Hash - def [](locale); end - def compute(tags, include_defaults = nil, exclude = nil); end - def defaults; end - def defaults=(defaults); end - def empty?; end - def initialize(*mappings); end - def inspect; end - def map(*args, &block); end -end -module I18n::Locale::Tag - def self.implementation; end - def self.implementation=(implementation); end - def self.tag(tag); end -end -module I18n::Locale::Tag::Parents - def parent; end - def parents; end - def self_and_parents; end -end -class I18n::Locale::Tag::Simple - def initialize(*tag); end - def self.tag(tag); end - def subtags; end - def tag; end - def to_a; end - def to_s; end - def to_sym; end - include I18n::Locale::Tag::Parents -end -module I18n::Backend::Transliterator - def self.get(rule = nil); end - def transliterate(locale, string, replacement = nil); end -end -class I18n::Backend::Transliterator::ProcTransliterator - def initialize(rule); end - def transliterate(string, replacement = nil); end -end -class I18n::Backend::Transliterator::HashTransliterator - def add(hash); end - def add_default_approximations; end - def approximations; end - def initialize(rule = nil); end - def transliterate(string, replacement = nil); end -end -module I18n::Backend::Base - def available_locales; end - def deep_interpolate(locale, data, values = nil); end - def default(locale, object, subject, options = nil); end - def eager_load!; end - def eager_loaded?; end - def exists?(locale, key, options = nil); end - def interpolate(locale, subject, values = nil); end - def load_file(filename); end - def load_json(filename); end - def load_rb(filename); end - def load_translations(*filenames); end - def load_yaml(filename); end - def load_yml(filename); end - def localize(locale, object, format = nil, options = nil); end - def lookup(locale, key, scope = nil, options = nil); end - def pluralization_key(entry, count); end - def pluralize(locale, entry, count); end - def reload!; end - def resolve(locale, object, subject, options = nil); end - def resolve_entry(locale, object, subject, options = nil); end - def store_translations(locale, data, options = nil); end - def subtrees?; end - def translate(locale, key, options = nil); end - def translate_localization_format(locale, object, format, options); end - include I18n::Backend::Transliterator -end -module I18n::Backend::InterpolationCompiler - def compile_all_strings_in(data); end - def interpolate(locale, string, values); end - def store_translations(locale, data, options = nil); end -end -module I18n::Backend::InterpolationCompiler::Compiler - def compile_if_an_interpolation(string); end - def compile_interpolation_token(key); end - def compiled_interpolation_body(str); end - def direct_key(key); end - def escape_key_sym(key); end - def escape_plain_str(str); end - def handle_interpolation_token(token); end - def interpolate_key(key); end - def interpolate_or_raise_missing(key); end - def interpolated_str?(str); end - def missing_key(key); end - def nil_key(key); end - def reserved_key(key); end - def tokenize(str); end - extend I18n::Backend::InterpolationCompiler::Compiler -end -module I18n::Backend::Cache - def _fetch(cache_key, &block); end - def cache_key(locale, key, options); end - def digest_item(key); end - def fetch(cache_key, &block); end - def translate(locale, key, options = nil); end -end -module I18n::Backend::CacheFile - def load_file(filename); end - def normalized_path(file); end - def path_roots; end - def path_roots=(arg0); end -end -module I18n::Backend::Cascade - def lookup(locale, key, scope = nil, options = nil); end -end -class I18n::Backend::Chain - include I18n::Backend::Chain::Implementation -end -module I18n::Backend::Chain::Implementation - def _deep_merge(hash, other_hash); end - def available_locales; end - def backends; end - def backends=(arg0); end - def eager_load!; end - def exists?(locale, key, options = nil); end - def init_translations; end - def initialize(*backends); end - def initialized?; end - def localize(locale, object, format = nil, options = nil); end - def namespace_lookup?(result, options); end - def reload!; end - def store_translations(locale, data, options = nil); end - def translate(locale, key, default_options = nil); end - def translations; end - include I18n::Backend::Base -end -module I18n::Backend::Flatten - def escape_default_separator(key); end - def find_link(locale, key); end - def flatten_keys(hash, escape, prev_key = nil, &block); end - def flatten_translations(locale, data, escape, subtree); end - def links; end - def normalize_flat_keys(locale, key, scope, separator); end - def resolve_link(locale, key); end - def self.escape_default_separator(key); end - def self.normalize_flat_keys(locale, key, scope, separator); end - def store_link(locale, key, link); end -end -module I18n::Gettext - def self.extract_scope(msgid, separator); end - def self.plural_keys(*args); end -end diff --git a/sorbet/rbi/gems/minitest.rbi b/sorbet/rbi/gems/minitest.rbi deleted file mode 100644 index a375928..0000000 --- a/sorbet/rbi/gems/minitest.rbi +++ /dev/null @@ -1,440 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: true -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/minitest/all/minitest.rbi -# -# minitest-5.25.1 - -module Minitest - def self.__run(reporter, options); end - def self.after_run(&block); end - def self.allow_fork; end - def self.allow_fork=(arg0); end - def self.autorun; end - def self.backtrace_filter; end - def self.backtrace_filter=(arg0); end - def self.cattr_accessor(name); end - def self.clock_time; end - def self.empty_run!(options); end - def self.extensions; end - def self.extensions=(arg0); end - def self.filter_backtrace(bt); end - def self.info_signal; end - def self.info_signal=(arg0); end - def self.init_plugins(options); end - def self.load_plugins; end - def self.parallel_executor; end - def self.parallel_executor=(arg0); end - def self.process_args(args = nil); end - def self.register_plugin(name_or_mod); end - def self.reporter; end - def self.reporter=(arg0); end - def self.run(args = nil); end - def self.run_one_method(klass, method_name); end - def self.seed; end - def self.seed=(arg0); end -end -module Minitest::Parallel -end -class Minitest::Parallel::Executor - def <<(work); end - def initialize(size); end - def shutdown; end - def size; end - def start; end -end -module Minitest::Parallel::Test - def _synchronize; end -end -module Minitest::Parallel::Test::ClassMethods - def run_one_method(klass, method_name, reporter); end - def test_order; end -end -module Minitest::Compress - def compress(orig); end -end -module Minitest::Assertions - def _synchronize; end - def _where; end - def assert(test, msg = nil); end - def assert_empty(obj, msg = nil); end - def assert_equal(exp, act, msg = nil); end - def assert_in_delta(exp, act, delta = nil, msg = nil); end - def assert_in_epsilon(exp, act, epsilon = nil, msg = nil); end - def assert_includes(collection, obj, msg = nil); end - def assert_instance_of(cls, obj, msg = nil); end - def assert_kind_of(cls, obj, msg = nil); end - def assert_match(matcher, obj, msg = nil); end - def assert_mock(mock); end - def assert_nil(obj, msg = nil); end - def assert_operator(o1, op, o2 = nil, msg = nil); end - def assert_output(stdout = nil, stderr = nil); end - def assert_path_exists(path, msg = nil); end - def assert_pattern; end - def assert_predicate(o1, op, msg = nil); end - def assert_raises(*exp); end - def assert_respond_to(obj, meth, msg = nil, include_all: nil); end - def assert_same(exp, act, msg = nil); end - def assert_send(send_ary, m = nil); end - def assert_silent; end - def assert_throws(sym, msg = nil); end - def capture_io; end - def capture_subprocess_io; end - def diff(exp, act); end - def exception_details(e, msg); end - def fail_after(y, m, d, msg); end - def flunk(msg = nil); end - def message(msg = nil, ending = nil, &default); end - def mu_pp(obj); end - def mu_pp_for_diff(obj); end - def pass(_msg = nil); end - def refute(test, msg = nil); end - def refute_empty(obj, msg = nil); end - def refute_equal(exp, act, msg = nil); end - def refute_in_delta(exp, act, delta = nil, msg = nil); end - def refute_in_epsilon(a, b, epsilon = nil, msg = nil); end - def refute_includes(collection, obj, msg = nil); end - def refute_instance_of(cls, obj, msg = nil); end - def refute_kind_of(cls, obj, msg = nil); end - def refute_match(matcher, obj, msg = nil); end - def refute_nil(obj, msg = nil); end - def refute_operator(o1, op, o2 = nil, msg = nil); end - def refute_path_exists(path, msg = nil); end - def refute_pattern; end - def refute_predicate(o1, op, msg = nil); end - def refute_respond_to(obj, meth, msg = nil, include_all: nil); end - def refute_same(exp, act, msg = nil); end - def self.diff; end - def self.diff=(o); end - def skip(msg = nil, _ignored = nil); end - def skip_until(y, m, d, msg); end - def skipped?; end - def things_to_diff(exp, act); end -end -class Minitest::Test < Minitest::Runnable - def capture_exceptions; end - def class_name; end - def neuter_exception(e); end - def new_exception(klass, msg, bt, kill = nil); end - def run; end - def sanitize_exception(e); end - def self.i_suck_and_my_tests_are_order_dependent!; end - def self.io_lock; end - def self.io_lock=(arg0); end - def self.make_my_diffs_pretty!; end - def self.parallelize_me!; end - def self.runnable_methods; end - extend Minitest::Guard - include Minitest::Assertions - include Minitest::Guard - include Minitest::Reportable - include Minitest::Test::LifecycleHooks -end -module Minitest::Test::LifecycleHooks - def after_setup; end - def after_teardown; end - def before_setup; end - def before_teardown; end - def setup; end - def teardown; end -end -class Minitest::Runnable - def assertions; end - def assertions=(arg0); end - def failure; end - def failures; end - def failures=(arg0); end - def initialize(name); end - def marshal_dump; end - def marshal_load(ary); end - def metadata; end - def metadata=(arg0); end - def metadata?; end - def name; end - def name=(o); end - def passed?; end - def result_code; end - def run; end - def self.inherited(klass); end - def self.methods_matching(re); end - def self.on_signal(name, action); end - def self.reset; end - def self.run(reporter, options = nil); end - def self.run_one_method(klass, method_name, reporter); end - def self.runnable_methods; end - def self.runnables; end - def self.test_order; end - def self.with_info_handler(reporter, &block); end - def skipped?; end - def time; end - def time=(arg0); end - def time_it; end -end -module Minitest::Reportable - def class_name; end - def error?; end - def location; end - def passed?; end - def result_code; end - def skipped?; end -end -class Minitest::Result < Minitest::Runnable - def class_name; end - def klass; end - def klass=(arg0); end - def self.from(runnable); end - def source_location; end - def source_location=(arg0); end - def to_s; end - include Minitest::Reportable -end -class Minitest::AbstractReporter - def initialize; end - def passed?; end - def prerecord(klass, name); end - def record(result); end - def report; end - def start; end - def synchronize(&block); end -end -class Minitest::Reporter < Minitest::AbstractReporter - def initialize(io = nil, options = nil); end - def io; end - def io=(arg0); end - def options; end - def options=(arg0); end -end -class Minitest::ProgressReporter < Minitest::Reporter - def prerecord(klass, name); end - def record(result); end -end -class Minitest::StatisticsReporter < Minitest::Reporter - def assertions; end - def assertions=(arg0); end - def count; end - def count=(arg0); end - def errors; end - def errors=(arg0); end - def failures; end - def failures=(arg0); end - def initialize(io = nil, options = nil); end - def passed?; end - def record(result); end - def report; end - def results; end - def results=(arg0); end - def skips; end - def skips=(arg0); end - def start; end - def start_time; end - def start_time=(arg0); end - def total_time; end - def total_time=(arg0); end - def warnings; end - def warnings=(arg0); end -end -class Minitest::SummaryReporter < Minitest::StatisticsReporter - def aggregated_results(io); end - def old_sync; end - def old_sync=(arg0); end - def report; end - def start; end - def statistics; end - def summary; end - def sync; end - def sync=(arg0); end - def to_s; end -end -class Minitest::CompositeReporter < Minitest::AbstractReporter - def <<(reporter); end - def initialize(*reporters); end - def io; end - def passed?; end - def prerecord(klass, name); end - def record(result); end - def report; end - def reporters; end - def reporters=(arg0); end - def start; end -end -class Minitest::Assertion < Exception - def error; end - def location; end - def result_code; end - def result_label; end -end -class Minitest::Skip < Minitest::Assertion - def result_label; end -end -class Minitest::UnexpectedError < Minitest::Assertion - def backtrace; end - def error; end - def error=(arg0); end - def initialize(error); end - def message; end - def result_label; end - include Minitest::Compress -end -class Minitest::UnexpectedWarning < Minitest::Assertion - def result_label; end -end -module Minitest::Guard - def jruby?(platform = nil); end - def maglev?(platform = nil); end - def mri?(platform = nil); end - def osx?(platform = nil); end - def rubinius?(platform = nil); end - def windows?(platform = nil); end -end -class Minitest::BacktraceFilter - def filter(bt); end - def initialize(regexp = nil); end - def regexp; end - def regexp=(arg0); end -end -class MockExpectationError < StandardError -end -class Minitest::Mock - def ===(*args, **kwargs, &b); end - def __call(name, data); end - def __respond_to?(*arg0); end - def class(*args, **kwargs, &b); end - def expect(name, retval, args = nil, **kwargs, &blk); end - def initialize(delegator = nil); end - def inspect(*args, **kwargs, &b); end - def instance_eval(*args, **kwargs, &b); end - def instance_variables(*args, **kwargs, &b); end - def method_missing(sym, *args, **kwargs, &block); end - def object_id(*args, **kwargs, &b); end - def public_send(*args, **kwargs, &b); end - def respond_to?(sym, include_private = nil); end - def respond_to_missing?(*args, **kwargs, &b); end - def send(*args, **kwargs, &b); end - def to_s(*args, **kwargs, &b); end - def verify; end -end -class Object < BasicObject - def stub(name, val_or_callable, *block_args, **block_kwargs, &block); end - include Minitest::Expectations -end -module Minitest::Expectations - def must_be(*args, **); end - def must_be_close_to(*args, **); end - def must_be_empty(*args, **); end - def must_be_instance_of(*args, **); end - def must_be_kind_of(*args, **); end - def must_be_nil(*args, **); end - def must_be_same_as(*args, **); end - def must_be_silent(*args, **); end - def must_be_within_delta(*args, **); end - def must_be_within_epsilon(*args, **); end - def must_equal(*args, **); end - def must_include(*args, **); end - def must_match(*args, **); end - def must_output(*args, **); end - def must_pattern_match(*args, **); end - def must_raise(*args, **); end - def must_respond_to(*args, **); end - def must_throw(*args, **); end - def path_must_exist(*args, **); end - def path_wont_exist(*args, **); end - def wont_be(*args, **); end - def wont_be_close_to(*args, **); end - def wont_be_empty(*args, **); end - def wont_be_instance_of(*args, **); end - def wont_be_kind_of(*args, **); end - def wont_be_nil(*args, **); end - def wont_be_same_as(*args, **); end - def wont_be_within_delta(*args, **); end - def wont_be_within_epsilon(*args, **); end - def wont_equal(*args, **); end - def wont_include(*args, **); end - def wont_match(*args, **); end - def wont_pattern_match(*args, **); end - def wont_respond_to(*args, **); end -end -class Minitest::Expectation < Struct - def ctx; end - def ctx=(_); end - def must_be(*args, **); end - def must_be_close_to(*args, **); end - def must_be_empty(*args, **); end - def must_be_instance_of(*args, **); end - def must_be_kind_of(*args, **); end - def must_be_nil(*args, **); end - def must_be_same_as(*args, **); end - def must_be_silent(*args, **); end - def must_be_within_delta(*args, **); end - def must_be_within_epsilon(*args, **); end - def must_equal(*args, **); end - def must_include(*args, **); end - def must_match(*args, **); end - def must_output(*args, **); end - def must_pattern_match(*args, **); end - def must_raise(*args, **); end - def must_respond_to(*args, **); end - def must_throw(*args, **); end - def path_must_exist(*args, **); end - def path_wont_exist(*args, **); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end - def target; end - def target=(_); end - def wont_be(*args, **); end - def wont_be_close_to(*args, **); end - def wont_be_empty(*args, **); end - def wont_be_instance_of(*args, **); end - def wont_be_kind_of(*args, **); end - def wont_be_nil(*args, **); end - def wont_be_same_as(*args, **); end - def wont_be_within_delta(*args, **); end - def wont_be_within_epsilon(*args, **); end - def wont_equal(*args, **); end - def wont_include(*args, **); end - def wont_match(*args, **); end - def wont_pattern_match(*args, **); end - def wont_respond_to(*args, **); end -end -class Module - def infect_an_assertion(meth, new_name, dont_flip = nil); end -end -module Kernel - def describe(desc, *additional_desc, &block); end -end -class Minitest::Spec < Minitest::Test - def initialize(name); end - def self.current; end - extend Minitest::Spec::DSL - include Minitest::Spec::DSL::InstanceMethods -end -module Minitest::Spec::DSL - def after(_type = nil, &block); end - def before(_type = nil, &block); end - def children; end - def create(name, desc); end - def desc; end - def describe_stack; end - def it(desc = nil, &block); end - def let(name, &block); end - def name; end - def nuke_test_methods!; end - def register_spec_type(*args, &block); end - def self.extended(obj); end - def spec_type(desc, *additional); end - def specify(desc = nil, &block); end - def subject(&block); end - def to_s; end -end -module Minitest::Spec::DSL::InstanceMethods - def _(value = nil, &block); end - def before_setup; end - def expect(value = nil, &block); end - def value(value = nil, &block); end -end diff --git a/sorbet/rbi/gems/minitest@5.25.1.rbi b/sorbet/rbi/gems/minitest@5.25.1.rbi index 2536e9b..bc0cba2 100644 --- a/sorbet/rbi/gems/minitest@5.25.1.rbi +++ b/sorbet/rbi/gems/minitest@5.25.1.rbi @@ -5,5 +5,1542 @@ # Please instead update this file by running `bin/tapioca gem minitest`. -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem +# :include: README.rdoc +# +# source://minitest//lib/minitest/parallel.rb#1 +module Minitest + class << self + # Internal run method. Responsible for telling all Runnable + # sub-classes to run. + # + # source://minitest//lib/minitest.rb#322 + def __run(reporter, options); end + + # A simple hook allowing you to run a block of code after everything + # is done running. Eg: + # + # Minitest.after_run { p $debugging_info } + # + # source://minitest//lib/minitest.rb#96 + def after_run(&block); end + + # source://minitest//lib/minitest.rb#19 + def allow_fork; end + + # source://minitest//lib/minitest.rb#19 + def allow_fork=(_arg0); end + + # Registers Minitest to run at process exit + # + # source://minitest//lib/minitest.rb#69 + def autorun; end + + # source://minitest//lib/minitest.rb#19 + def backtrace_filter; end + + # source://minitest//lib/minitest.rb#19 + def backtrace_filter=(_arg0); end + + # source://minitest//lib/minitest.rb#18 + def cattr_accessor(name); end + + # source://minitest//lib/minitest.rb#1215 + def clock_time; end + + # source://minitest//lib/minitest.rb#302 + def empty_run!(options); end + + # source://minitest//lib/minitest.rb#19 + def extensions; end + + # source://minitest//lib/minitest.rb#19 + def extensions=(_arg0); end + + # source://minitest//lib/minitest.rb#335 + def filter_backtrace(bt); end + + # source://minitest//lib/minitest.rb#19 + def info_signal; end + + # source://minitest//lib/minitest.rb#19 + def info_signal=(_arg0); end + + # source://minitest//lib/minitest.rb#124 + def init_plugins(options); end + + # source://minitest//lib/minitest.rb#108 + def load_plugins; end + + # source://minitest//lib/minitest.rb#19 + def parallel_executor; end + + # source://minitest//lib/minitest.rb#19 + def parallel_executor=(_arg0); end + + # source://minitest//lib/minitest.rb#142 + def process_args(args = T.unsafe(nil)); end + + # Register a plugin to be used. Does NOT require / load it. + # + # source://minitest//lib/minitest.rb#103 + def register_plugin(name_or_mod); end + + # source://minitest//lib/minitest.rb#19 + def reporter; end + + # source://minitest//lib/minitest.rb#19 + def reporter=(_arg0); end + + # This is the top-level run method. Everything starts from here. It + # tells each Runnable sub-class to run, and each of those are + # responsible for doing whatever they do. + # + # The overall structure of a run looks like this: + # + # Minitest.autorun + # Minitest.run(args) + # Minitest.load_plugins + # Minitest.process_args + # Minitest.init_plugins + # Minitest.__run(reporter, options) + # Runnable.runnables.each + # runnable_klass.run(reporter, options) + # self.runnable_methods.each + # self.run_one_method(self, runnable_method, reporter) + # Minitest.run_one_method(klass, runnable_method) + # klass.new(runnable_method).run + # + # source://minitest//lib/minitest.rb#268 + def run(args = T.unsafe(nil)); end + + # source://minitest//lib/minitest.rb#1206 + def run_one_method(klass, method_name); end + + # source://minitest//lib/minitest.rb#19 + def seed; end + + # source://minitest//lib/minitest.rb#19 + def seed=(_arg0); end + end +end + +# Defines the API for Reporters. Subclass this and override whatever +# you want. Go nuts. +# +# source://minitest//lib/minitest.rb#686 +class Minitest::AbstractReporter + # @return [AbstractReporter] a new instance of AbstractReporter + # + # source://minitest//lib/minitest.rb#688 + def initialize; end + + # Did this run pass? + # + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#723 + def passed?; end + + # About to start running a test. This allows a reporter to show + # that it is starting or that we are in the middle of a test run. + # + # source://minitest//lib/minitest.rb#702 + def prerecord(klass, name); end + + # Output and record the result of the test. Call + # {result#result_code}[rdoc-ref:Runnable#result_code] to get the + # result character string. Stores the result of the run if the run + # did not pass. + # + # source://minitest//lib/minitest.rb#711 + def record(result); end + + # Outputs the summary of the run. + # + # source://minitest//lib/minitest.rb#717 + def report; end + + # Starts reporting on the run. + # + # source://minitest//lib/minitest.rb#695 + def start; end + + # source://minitest//lib/minitest.rb#727 + def synchronize(&block); end +end + +# Represents run failures. +# +# source://minitest//lib/minitest.rb#1019 +class Minitest::Assertion < ::Exception + # source://minitest//lib/minitest.rb#1022 + def error; end + + # Where was this run before an assertion was raised? + # + # source://minitest//lib/minitest.rb#1029 + def location; end + + # source://minitest//lib/minitest.rb#1037 + def result_code; end + + # source://minitest//lib/minitest.rb#1041 + def result_label; end +end + +# source://minitest//lib/minitest.rb#1020 +Minitest::Assertion::RE = T.let(T.unsafe(nil), Regexp) + +# Minitest Assertions. All assertion methods accept a +msg+ which is +# printed if the assertion fails. +# +# Protocol: Nearly everything here boils up to +assert+, which +# expects to be able to increment an instance accessor named +# +assertions+. This is not provided by Assertions and must be +# provided by the thing including Assertions. See Minitest::Runnable +# for an example. +# +# source://minitest//lib/minitest/assertions.rb#16 +module Minitest::Assertions + # source://minitest//lib/minitest/assertions.rb#181 + def _synchronize; end + + # source://minitest//lib/minitest/assertions.rb#194 + def _where; end + + # Fails unless +test+ is truthy. + # + # source://minitest//lib/minitest/assertions.rb#171 + def assert(test, msg = T.unsafe(nil)); end + + # Fails unless +obj+ is empty. + # + # source://minitest//lib/minitest/assertions.rb#188 + def assert_empty(obj, msg = T.unsafe(nil)); end + + # Fails unless exp == act printing the difference between + # the two, if possible. + # + # If there is no visible difference but the assertion fails, you + # should suspect that your #== is buggy, or your inspect output is + # missing crucial details. For nicer structural diffing, set + # Minitest::Test.make_my_diffs_pretty! + # + # For floats use assert_in_delta. + # + # See also: Minitest::Assertions.diff + # + # source://minitest//lib/minitest/assertions.rb#214 + def assert_equal(exp, act, msg = T.unsafe(nil)); end + + # For comparing Floats. Fails unless +exp+ and +act+ are within +delta+ + # of each other. + # + # assert_in_delta Math::PI, (22.0 / 7.0), 0.01 + # + # source://minitest//lib/minitest/assertions.rb#235 + def assert_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end + + # For comparing Floats. Fails unless +exp+ and +act+ have a relative + # error less than +epsilon+. + # + # source://minitest//lib/minitest/assertions.rb#247 + def assert_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Fails unless +collection+ includes +obj+. + # + # source://minitest//lib/minitest/assertions.rb#254 + def assert_includes(collection, obj, msg = T.unsafe(nil)); end + + # Fails unless +obj+ is an instance of +cls+. + # + # source://minitest//lib/minitest/assertions.rb#265 + def assert_instance_of(cls, obj, msg = T.unsafe(nil)); end + + # Fails unless +obj+ is a kind of +cls+. + # + # source://minitest//lib/minitest/assertions.rb#276 + def assert_kind_of(cls, obj, msg = T.unsafe(nil)); end + + # Fails unless +matcher+ =~ +obj+. + # + # source://minitest//lib/minitest/assertions.rb#287 + def assert_match(matcher, obj, msg = T.unsafe(nil)); end + + # Fails unless +obj+ is nil + # + # source://minitest//lib/minitest/assertions.rb#299 + def assert_nil(obj, msg = T.unsafe(nil)); end + + # For testing with binary operators. Eg: + # + # assert_operator 5, :<=, 4 + # + # source://minitest//lib/minitest/assertions.rb#309 + def assert_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Fails if stdout or stderr do not output the expected results. + # Pass in nil if you don't care about that streams output. Pass in + # "" if you require it to be silent. Pass in a regexp if you want + # to pattern match. + # + # assert_output(/hey/) { method_with_output } + # + # NOTE: this uses #capture_io, not #capture_subprocess_io. + # + # See also: #assert_silent + # + # source://minitest//lib/minitest/assertions.rb#327 + def assert_output(stdout = T.unsafe(nil), stderr = T.unsafe(nil)); end + + # Fails unless +path+ exists. + # + # source://minitest//lib/minitest/assertions.rb#351 + def assert_path_exists(path, msg = T.unsafe(nil)); end + + # For testing with pattern matching (only supported with Ruby 3.0 and later) + # + # # pass + # assert_pattern { [1,2,3] => [Integer, Integer, Integer] } + # + # # fail "length mismatch (given 3, expected 1)" + # assert_pattern { [1,2,3] => [Integer] } + # + # The bare => pattern will raise a NoMatchingPatternError on failure, which would + # normally be counted as a test error. This assertion rescues NoMatchingPatternError and + # generates a test failure. Any other exception will be raised as normal and generate a test + # error. + # + # @raise [NotImplementedError] + # + # source://minitest//lib/minitest/assertions.rb#370 + def assert_pattern; end + + # For testing with predicates. Eg: + # + # assert_predicate str, :empty? + # + # This is really meant for specs and is front-ended by assert_operator: + # + # str.must_be :empty? + # + # source://minitest//lib/minitest/assertions.rb#391 + def assert_predicate(o1, op, msg = T.unsafe(nil)); end + + # Fails unless the block raises one of +exp+. Returns the + # exception matched so you can check the message, attributes, etc. + # + # +exp+ takes an optional message on the end to help explain + # failures and defaults to StandardError if no exception class is + # passed. Eg: + # + # assert_raises(CustomError) { method_with_custom_error } + # + # With custom error message: + # + # assert_raises(CustomError, 'This should have raised CustomError') { method_with_custom_error } + # + # Using the returned object: + # + # error = assert_raises(CustomError) do + # raise CustomError, 'This is really bad' + # end + # + # assert_equal 'This is really bad', error.message + # + # source://minitest//lib/minitest/assertions.rb#418 + def assert_raises(*exp); end + + # Fails unless +obj+ responds to +meth+. + # include_all defaults to false to match Object#respond_to? + # + # source://minitest//lib/minitest/assertions.rb#450 + def assert_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end + + # Fails unless +exp+ and +act+ are #equal? + # + # source://minitest//lib/minitest/assertions.rb#460 + def assert_same(exp, act, msg = T.unsafe(nil)); end + + # +send_ary+ is a receiver, message and arguments. + # + # Fails unless the call returns a true value + # + # source://minitest//lib/minitest/assertions.rb#473 + def assert_send(send_ary, m = T.unsafe(nil)); end + + # Fails if the block outputs anything to stderr or stdout. + # + # See also: #assert_output + # + # source://minitest//lib/minitest/assertions.rb#488 + def assert_silent; end + + # Fails unless the block throws +sym+ + # + # source://minitest//lib/minitest/assertions.rb#497 + def assert_throws(sym, msg = T.unsafe(nil)); end + + # Captures $stdout and $stderr into strings: + # + # out, err = capture_io do + # puts "Some info" + # warn "You did a bad thing" + # end + # + # assert_match %r%info%, out + # assert_match %r%bad%, err + # + # NOTE: For efficiency, this method uses StringIO and does not + # capture IO for subprocesses. Use #capture_subprocess_io for + # that. + # + # source://minitest//lib/minitest/assertions.rb#538 + def capture_io; end + + # Captures $stdout and $stderr into strings, using Tempfile to + # ensure that subprocess IO is captured as well. + # + # out, err = capture_subprocess_io do + # system "echo Some info" + # system "echo You did a bad thing 1>&2" + # end + # + # assert_match %r%info%, out + # assert_match %r%bad%, err + # + # NOTE: This method is approximately 10x slower than #capture_io so + # only use it when you need to test the output of a subprocess. + # + # source://minitest//lib/minitest/assertions.rb#571 + def capture_subprocess_io; end + + # Returns a diff between +exp+ and +act+. If there is no known + # diff command or if it doesn't make sense to diff the output + # (single line, short output), then it simply returns a basic + # comparison between the two. + # + # See +things_to_diff+ for more info. + # + # source://minitest//lib/minitest/assertions.rb#57 + def diff(exp, act); end + + # Returns details for exception +e+ + # + # source://minitest//lib/minitest/assertions.rb#603 + def exception_details(e, msg); end + + # Fails after a given date (in the local time zone). This allows + # you to put time-bombs in your tests if you need to keep + # something around until a later date lest you forget about it. + # + # source://minitest//lib/minitest/assertions.rb#619 + def fail_after(y, m, d, msg); end + + # Fails with +msg+. + # + # source://minitest//lib/minitest/assertions.rb#626 + def flunk(msg = T.unsafe(nil)); end + + # Returns a proc that will output +msg+ along with the default message. + # + # source://minitest//lib/minitest/assertions.rb#634 + def message(msg = T.unsafe(nil), ending = T.unsafe(nil), &default); end + + # This returns a human-readable version of +obj+. By default + # #inspect is called. You can override this to use #pretty_inspect + # if you want. + # + # See Minitest::Test.make_my_diffs_pretty! + # + # source://minitest//lib/minitest/assertions.rb#127 + def mu_pp(obj); end + + # This returns a diff-able more human-readable version of +obj+. + # This differs from the regular mu_pp because it expands escaped + # newlines and makes hex-values (like object_ids) generic. This + # uses mu_pp to do the first pass and then cleans it up. + # + # source://minitest//lib/minitest/assertions.rb#145 + def mu_pp_for_diff(obj); end + + # used for counting assertions + # + # source://minitest//lib/minitest/assertions.rb#645 + def pass(_msg = T.unsafe(nil)); end + + # Fails if +test+ is truthy. + # + # source://minitest//lib/minitest/assertions.rb#652 + def refute(test, msg = T.unsafe(nil)); end + + # Fails if +obj+ is empty. + # + # source://minitest//lib/minitest/assertions.rb#660 + def refute_empty(obj, msg = T.unsafe(nil)); end + + # Fails if exp == act. + # + # For floats use refute_in_delta. + # + # source://minitest//lib/minitest/assertions.rb#671 + def refute_equal(exp, act, msg = T.unsafe(nil)); end + + # For comparing Floats. Fails if +exp+ is within +delta+ of +act+. + # + # refute_in_delta Math::PI, (22.0 / 7.0) + # + # source://minitest//lib/minitest/assertions.rb#683 + def refute_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end + + # For comparing Floats. Fails if +exp+ and +act+ have a relative error + # less than +epsilon+. + # + # source://minitest//lib/minitest/assertions.rb#695 + def refute_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Fails if +collection+ includes +obj+. + # + # source://minitest//lib/minitest/assertions.rb#702 + def refute_includes(collection, obj, msg = T.unsafe(nil)); end + + # Fails if +obj+ is an instance of +cls+. + # + # source://minitest//lib/minitest/assertions.rb#713 + def refute_instance_of(cls, obj, msg = T.unsafe(nil)); end + + # Fails if +obj+ is a kind of +cls+. + # + # source://minitest//lib/minitest/assertions.rb#723 + def refute_kind_of(cls, obj, msg = T.unsafe(nil)); end + + # Fails if +matcher+ =~ +obj+. + # + # source://minitest//lib/minitest/assertions.rb#731 + def refute_match(matcher, obj, msg = T.unsafe(nil)); end + + # Fails if +obj+ is nil. + # + # source://minitest//lib/minitest/assertions.rb#741 + def refute_nil(obj, msg = T.unsafe(nil)); end + + # Fails if +o1+ is not +op+ +o2+. Eg: + # + # refute_operator 1, :>, 2 #=> pass + # refute_operator 1, :<, 2 #=> fail + # + # source://minitest//lib/minitest/assertions.rb#776 + def refute_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Fails if +path+ exists. + # + # source://minitest//lib/minitest/assertions.rb#785 + def refute_path_exists(path, msg = T.unsafe(nil)); end + + # For testing with pattern matching (only supported with Ruby 3.0 and later) + # + # # pass + # refute_pattern { [1,2,3] => [String] } + # + # # fail "NoMatchingPatternError expected, but nothing was raised." + # refute_pattern { [1,2,3] => [Integer, Integer, Integer] } + # + # This assertion expects a NoMatchingPatternError exception, and will fail if none is raised. Any + # other exceptions will be raised as normal and generate a test error. + # + # @raise [NotImplementedError] + # + # source://minitest//lib/minitest/assertions.rb#758 + def refute_pattern; end + + # For testing with predicates. + # + # refute_predicate str, :empty? + # + # This is really meant for specs and is front-ended by refute_operator: + # + # str.wont_be :empty? + # + # source://minitest//lib/minitest/assertions.rb#799 + def refute_predicate(o1, op, msg = T.unsafe(nil)); end + + # Fails if +obj+ responds to the message +meth+. + # include_all defaults to false to match Object#respond_to? + # + # source://minitest//lib/minitest/assertions.rb#808 + def refute_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end + + # Fails if +exp+ is the same (by object identity) as +act+. + # + # source://minitest//lib/minitest/assertions.rb#817 + def refute_same(exp, act, msg = T.unsafe(nil)); end + + # Skips the current run. If run in verbose-mode, the skipped run + # gets listed at the end of the run but doesn't cause a failure + # exit code. + # + # @raise [Minitest::Skip] + # + # source://minitest//lib/minitest/assertions.rb#830 + def skip(msg = T.unsafe(nil), _ignored = T.unsafe(nil)); end + + # Skips the current run until a given date (in the local time + # zone). This allows you to put some fixes on hold until a later + # date, but still holds you accountable and prevents you from + # forgetting it. + # + # source://minitest//lib/minitest/assertions.rb#842 + def skip_until(y, m, d, msg); end + + # Was this testcase skipped? Meant for #teardown. + # + # @return [Boolean] + # + # source://minitest//lib/minitest/assertions.rb#851 + def skipped?; end + + # Returns things to diff [expect, butwas], or [nil, nil] if nothing to diff. + # + # Criterion: + # + # 1. Strings include newlines or escaped newlines, but not both. + # 2. or: String lengths are > 30 characters. + # 3. or: Strings are equal to each other (but maybe different encodings?). + # 4. and: we found a diff executable. + # + # source://minitest//lib/minitest/assertions.rb#102 + def things_to_diff(exp, act); end + + class << self + # Returns the diff command to use in #diff. Tries to intelligently + # figure out what diff to use. + # + # source://minitest//lib/minitest/assertions.rb#27 + def diff; end + + # Set the diff command to use in #diff. + # + # source://minitest//lib/minitest/assertions.rb#45 + def diff=(o); end + end +end + +# source://minitest//lib/minitest/assertions.rb#199 +Minitest::Assertions::E = T.let(T.unsafe(nil), String) + +# source://minitest//lib/minitest/assertions.rb#17 +Minitest::Assertions::UNDEFINED = T.let(T.unsafe(nil), Object) + +# The standard backtrace filter for minitest. +# +# See Minitest.backtrace_filter=. +# +# source://minitest//lib/minitest.rb#1174 +class Minitest::BacktraceFilter + # @return [BacktraceFilter] a new instance of BacktraceFilter + # + # source://minitest//lib/minitest.rb#1183 + def initialize(regexp = T.unsafe(nil)); end + + # Filter +bt+ to something useful. Returns the whole thing if + # $DEBUG (ruby) or $MT_DEBUG (env). + # + # source://minitest//lib/minitest.rb#1191 + def filter(bt); end + + # The regular expression to use to filter backtraces. Defaults to +MT_RE+. + # + # source://minitest//lib/minitest.rb#1181 + def regexp; end + + # The regular expression to use to filter backtraces. Defaults to +MT_RE+. + # + # source://minitest//lib/minitest.rb#1181 + def regexp=(_arg0); end +end + +# source://minitest//lib/minitest.rb#1176 +Minitest::BacktraceFilter::MT_RE = T.let(T.unsafe(nil), Regexp) + +# Dispatch to multiple reporters as one. +# +# source://minitest//lib/minitest.rb#968 +class Minitest::CompositeReporter < ::Minitest::AbstractReporter + # @return [CompositeReporter] a new instance of CompositeReporter + # + # source://minitest//lib/minitest.rb#974 + def initialize(*reporters); end + + # Add another reporter to the mix. + # + # source://minitest//lib/minitest.rb#986 + def <<(reporter); end + + # source://minitest//lib/minitest.rb#979 + def io; end + + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#990 + def passed?; end + + # source://minitest//lib/minitest.rb#998 + def prerecord(klass, name); end + + # source://minitest//lib/minitest.rb#1005 + def record(result); end + + # source://minitest//lib/minitest.rb#1011 + def report; end + + # The list of reporters to dispatch to. + # + # source://minitest//lib/minitest.rb#972 + def reporters; end + + # The list of reporters to dispatch to. + # + # source://minitest//lib/minitest.rb#972 + def reporters=(_arg0); end + + # source://minitest//lib/minitest.rb#994 + def start; end +end + +# Compresses backtraces. +# +# source://minitest//lib/minitest/compress.rb#5 +module Minitest::Compress + # Takes a backtrace (array of strings) and compresses repeating + # cycles in it to make it more readable. + # + # source://minitest//lib/minitest/compress.rb#11 + def compress(orig); end +end + +# Provides a simple set of guards that you can use in your tests +# to skip execution if it is not applicable. These methods are +# mixed into Test as both instance and class methods so you +# can use them inside or outside of the test methods. +# +# def test_something_for_mri +# skip "bug 1234" if jruby? +# # ... +# end +# +# if windows? then +# # ... lots of test methods ... +# end +# +# source://minitest//lib/minitest.rb#1118 +module Minitest::Guard + # Is this running on jruby? + # + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#1123 + def jruby?(platform = T.unsafe(nil)); end + + # Is this running on maglev? + # + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#1130 + def maglev?(platform = T.unsafe(nil)); end + + # Is this running on mri? + # + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#1140 + def mri?(platform = T.unsafe(nil)); end + + # Is this running on macOS? + # + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#1147 + def osx?(platform = T.unsafe(nil)); end + + # Is this running on rubinius? + # + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#1154 + def rubinius?(platform = T.unsafe(nil)); end + + # Is this running on windows? + # + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#1164 + def windows?(platform = T.unsafe(nil)); end +end + +# source://minitest//lib/minitest/parallel.rb#2 +module Minitest::Parallel; end + +# The engine used to run multiple tests in parallel. +# +# source://minitest//lib/minitest/parallel.rb#7 +class Minitest::Parallel::Executor + # Create a parallel test executor of with +size+ workers. + # + # @return [Executor] a new instance of Executor + # + # source://minitest//lib/minitest/parallel.rb#17 + def initialize(size); end + + # Add a job to the queue + # + # source://minitest//lib/minitest/parallel.rb#43 + def <<(work); end + + # Shuts down the pool of workers by signalling them to quit and + # waiting for them all to finish what they're currently working + # on. + # + # source://minitest//lib/minitest/parallel.rb#50 + def shutdown; end + + # The size of the pool of workers. + # + # source://minitest//lib/minitest/parallel.rb#12 + def size; end + + # Start the executor + # + # source://minitest//lib/minitest/parallel.rb#26 + def start; end +end + +# source://minitest//lib/minitest/parallel.rb#56 +module Minitest::Parallel::Test + # source://minitest//lib/minitest/parallel.rb#57 + def _synchronize; end +end + +# source://minitest//lib/minitest/parallel.rb#59 +module Minitest::Parallel::Test::ClassMethods + # source://minitest//lib/minitest/parallel.rb#60 + def run_one_method(klass, method_name, reporter); end + + # source://minitest//lib/minitest/parallel.rb#64 + def test_order; end +end + +# A very simple reporter that prints the "dots" during the run. +# +# This is added to the top-level CompositeReporter at the start of +# the run. If you want to change the output of minitest via a +# plugin, pull this out of the composite and replace it with your +# own. +# +# source://minitest//lib/minitest.rb#758 +class Minitest::ProgressReporter < ::Minitest::Reporter + # source://minitest//lib/minitest.rb#759 + def prerecord(klass, name); end + + # source://minitest//lib/minitest.rb#766 + def record(result); end +end + +# Shared code for anything that can get passed to a Reporter. See +# Minitest::Test & Minitest::Result. +# +# source://minitest//lib/minitest.rb#580 +module Minitest::Reportable + # @raise [NotImplementedError] + # + # source://minitest//lib/minitest.rb#602 + def class_name; end + + # Did this run error? + # + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#623 + def error?; end + + # The location identifier of this test. Depends on a method + # existing called class_name. + # + # source://minitest//lib/minitest.rb#597 + def location; end + + # Did this run pass? + # + # Note: skipped runs are not considered passing, but they don't + # cause the process to exit non-zero. + # + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#587 + def passed?; end + + # Returns ".", "F", or "E" based on the result of the run. + # + # source://minitest//lib/minitest.rb#609 + def result_code; end + + # Was this run skipped? + # + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#616 + def skipped?; end +end + +# source://minitest//lib/minitest.rb#591 +Minitest::Reportable::BASE_DIR = T.let(T.unsafe(nil), String) + +# source://minitest//lib/minitest.rb#734 +class Minitest::Reporter < ::Minitest::AbstractReporter + # @return [Reporter] a new instance of Reporter + # + # source://minitest//lib/minitest.rb#743 + def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end + + # The IO used to report. + # + # source://minitest//lib/minitest.rb#736 + def io; end + + # The IO used to report. + # + # source://minitest//lib/minitest.rb#736 + def io=(_arg0); end + + # Command-line options for this run. + # + # source://minitest//lib/minitest.rb#741 + def options; end + + # Command-line options for this run. + # + # source://minitest//lib/minitest.rb#741 + def options=(_arg0); end +end + +# This represents a test result in a clean way that can be +# marshalled over a wire. Tests can do anything they want to the +# test instance and can create conditions that cause Marshal.dump to +# blow up. By using Result.from(a_test) you can be reasonably sure +# that the test result can be marshalled. +# +# source://minitest//lib/minitest.rb#635 +class Minitest::Result < ::Minitest::Runnable + include ::Minitest::Reportable + + # source://minitest//lib/minitest.rb#669 + def class_name; end + + # The class name of the test result. + # + # source://minitest//lib/minitest.rb#644 + def klass; end + + # The class name of the test result. + # + # source://minitest//lib/minitest.rb#644 + def klass=(_arg0); end + + # The location of the test method. + # + # source://minitest//lib/minitest.rb#649 + def source_location; end + + # The location of the test method. + # + # source://minitest//lib/minitest.rb#649 + def source_location=(_arg0); end + + # source://minitest//lib/minitest.rb#673 + def to_s; end + + class << self + # Create a new test result from a Runnable instance. + # + # source://minitest//lib/minitest.rb#654 + def from(runnable); end + end +end + +# re-open +# +# source://minitest//lib/minitest.rb#348 +class Minitest::Runnable + # @return [Runnable] a new instance of Runnable + # + # source://minitest//lib/minitest.rb#511 + def initialize(name); end + + # Number of assertions executed in this run. + # + # source://minitest//lib/minitest.rb#352 + def assertions; end + + # Number of assertions executed in this run. + # + # source://minitest//lib/minitest.rb#352 + def assertions=(_arg0); end + + # source://minitest//lib/minitest.rb#507 + def failure; end + + # An assertion raised during the run, if any. + # + # source://minitest//lib/minitest.rb#357 + def failures; end + + # An assertion raised during the run, if any. + # + # source://minitest//lib/minitest.rb#357 + def failures=(_arg0); end + + # source://minitest//lib/minitest.rb#493 + def marshal_dump; end + + # source://minitest//lib/minitest.rb#503 + def marshal_load(ary); end + + # Metadata you attach to the test results that get sent to the reporter. + # + # Lazily initializes to a hash, to keep memory down. + # + # NOTE: this data *must* be plain (read: marshal-able) data! + # Hashes! Arrays! Strings! + # + # source://minitest//lib/minitest.rb#526 + def metadata; end + + # Sets metadata, mainly used for +Result.from+. + # + # source://minitest//lib/minitest.rb#533 + def metadata=(_arg0); end + + # Returns true if metadata exists. + # + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#538 + def metadata?; end + + # Name of the run. + # + # source://minitest//lib/minitest.rb#375 + def name; end + + # Set the name of the run. + # + # source://minitest//lib/minitest.rb#382 + def name=(o); end + + # Did this run pass? + # + # Note: skipped runs are not considered passing, but they don't + # cause the process to exit non-zero. + # + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#555 + def passed?; end + + # Returns a single character string to print based on the result + # of the run. One of ".", "F", + # "E" or "S". + # + # @raise [NotImplementedError] + # + # source://minitest//lib/minitest.rb#564 + def result_code; end + + # Runs a single method. Needs to return self. + # + # @raise [NotImplementedError] + # + # source://minitest//lib/minitest.rb#545 + def run; end + + # Was this run skipped? See #passed? for more information. + # + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#571 + def skipped?; end + + # The time it took to run. + # + # source://minitest//lib/minitest.rb#362 + def time; end + + # The time it took to run. + # + # source://minitest//lib/minitest.rb#362 + def time=(_arg0); end + + # source://minitest//lib/minitest.rb#364 + def time_it; end + + class << self + # source://minitest//lib/minitest.rb#1225 + def inherited(klass); end + + # Returns all instance methods matching the pattern +re+. + # + # source://minitest//lib/minitest.rb#389 + def methods_matching(re); end + + # source://minitest//lib/minitest.rb#463 + def on_signal(name, action); end + + # source://minitest//lib/minitest.rb#393 + def reset; end + + # Responsible for running all runnable methods in a given class, + # each in its own instance. Each instance is passed to the + # reporter to record. + # + # source://minitest//lib/minitest.rb#404 + def run(reporter, options = T.unsafe(nil)); end + + # Runs a single method and has the reporter record the result. + # This was considered internal API but is factored out of run so + # that subclasses can specialize the running of an individual + # test. See Minitest::ParallelTest::ClassMethods for an example. + # + # source://minitest//lib/minitest.rb#444 + def run_one_method(klass, method_name, reporter); end + + # Each subclass of Runnable is responsible for overriding this + # method to return all runnable methods. See #methods_matching. + # + # @raise [NotImplementedError] + # + # source://minitest//lib/minitest.rb#480 + def runnable_methods; end + + # Returns all subclasses of Runnable. + # + # source://minitest//lib/minitest.rb#487 + def runnables; end + + # Defines the order to run tests (:random by default). Override + # this or use a convenience method to change it for your tests. + # + # source://minitest//lib/minitest.rb#453 + def test_order; end + + # source://minitest//lib/minitest.rb#457 + def with_info_handler(reporter, &block); end + end +end + +# source://minitest//lib/minitest.rb#461 +Minitest::Runnable::SIGNALS = T.let(T.unsafe(nil), Hash) + +# Assertion raised when skipping a run. +# +# source://minitest//lib/minitest.rb#1049 +class Minitest::Skip < ::Minitest::Assertion + # source://minitest//lib/minitest.rb#1050 + def result_label; end +end + +# A reporter that gathers statistics about a test run. Does not do +# any IO because meant to be used as a parent class for a reporter +# that does. +# +# If you want to create an entirely different type of output (eg, +# CI, HTML, etc), this is the place to start. +# +# Example: +# +# class JenkinsCIReporter < StatisticsReporter +# def report +# super # Needed to calculate some statistics +# +# print "(other); end - def >=(other); end - def dig(head, *rest); end - def fetch_values(*keys); end - def to_proc; end -end -module Polyfill::V2_3::Enumerable - def chunk_while; end - def grep_v(pattern); end - def slice_before(*args); end -end -module Polyfill::V2_3::Enumerator -end -module Polyfill::V2_3::Enumerator::Lazy - def grep_v(pattern); end -end -module Polyfill::V2_3::Kernel - def loop; end -end -module Polyfill::V2_3::Numeric - def negative?; end - def positive?; end -end -module Polyfill::V2_3::String - def +@; end - def -@; end -end -module Polyfill::V2_3::String::ClassMethods - def new(*args); end -end -module Polyfill::V2_3::Struct - def dig(head, *rest); end -end -module Polyfill::V2_3::Prime -end -module Polyfill::V2_3::Prime::ClassMethods - def prime?(*args); end -end -module Polyfill::V2_4 -end -module Polyfill::V2_4::Numeric - def clone(freeze: nil); end - def dup; end - def finite?; end - def infinite?; end -end -module Polyfill::V2_4::Enumerable - def chunk(*); end - def sum(init = nil); end - def uniq; end -end -module Polyfill::Module::MezpOdW1lcmljPT5bIiNkdXAiXSwgOnZlcnNpb249PiIyLjQifQ__ -end -module Polyfill::V2_4::Array - def concat(*others); end - def sum(init = nil); end -end -module Polyfill::V2_4::Comparable - def clamp(min, max); end -end -module Polyfill::V2_4::Dir -end -module Polyfill::V2_4::Dir::ClassMethods - def empty?(path_name); end -end -module Polyfill::V2_4::Enumerator -end -module Polyfill::V2_4::Enumerator::Lazy - def chunk_while; end - def uniq; end -end -module Polyfill::Module::MezpFbnVtZXJhYmxlPT5bIiNjaHVua193aGlsZSJdLCA6dmVyc2lvbj0_1IjIuNCJ9 -end -module Polyfill::V2_4::File -end -module Polyfill::V2_4::File::ClassMethods - def empty?(file_name); end -end -module Polyfill::V2_4::Float - def ceil(ndigits = nil); end - def floor(ndigits = nil); end - def truncate(ndigits = nil); end -end -module Polyfill::V2_4::Hash - def compact!; end - def compact; end - def transform_values!; end - def transform_values; end -end -module Polyfill::V2_4::Integer - def ceil(ndigits = nil); end - def digits(base = nil); end - def floor(ndigits = nil); end - def round(ndigits = nil, half: nil); end - def truncate(ndigits = nil); end -end -module Polyfill::V2_4::IO - def each_line(*args); end - def gets(*args); end - def lines(*args); end - def readline(*args); end - def readlines(*args); end -end -module Polyfill::V2_4::IO::ClassMethods - def foreach(name, *args); end - def readlines(file_name, *args); end -end -module Polyfill::V2_4::MatchData - def named_captures; end - def values_at(*indexes); end -end -module Polyfill::V2_4::Object - def clone(freeze: nil); end -end -module Polyfill::V2_4::Regexp - def match?(string, position = nil); end -end -module Polyfill::V2_4::String - def casecmp?(other); end - def concat(*others); end - def each_line(*args); end - def lines(*args); end - def match?(pattern, position = nil); end - def prepend(*others); end - def unpack1(*args); end -end -module Polyfill::V2_4::String::ClassMethods - def new(*args); end -end -module Polyfill::V2_4::StringIO - def each_line(*args); end - def gets(*args); end - def lines(*args); end - def readline(*args); end - def readlines(*args); end -end -module Polyfill::V2_4::StringIO::ClassMethods - def foreach(name, *args); end - def readlines(file_name, *args); end -end -module Polyfill::V2_4::Symbol - def casecmp?(other); end - def match(*args); end - def match?(pattern, position = nil); end -end -module Polyfill::V2_4::IPAddr - def <=>(*); end - def ==(*); end -end -module Polyfill::V2_4::Pathname - def empty?; end -end -module Polyfill::V2_5 -end -module Polyfill::V2_5::Array - def append(*args); end - def prepend(*args); end -end -module Polyfill::V2_5::Dir -end -module Polyfill::V2_5::Dir::ClassMethods - def children(dirname, encoding: nil); end - def each_child(dirname, encoding: nil); end -end -module Polyfill::V2_5::Enumerable - def all?(*pattern); end - def any?(*pattern); end - def none?(*pattern); end - def one?(*pattern); end -end -module Polyfill::V2_5::Hash - def slice(*keys); end - def transform_keys; end -end -module Polyfill::V2_5::Integer - def allbits?(mask); end - def anybits?(mask); end - def ceil(*); end - def floor(*); end - def nobits?(mask); end - def round(*); end - def truncate(*); end -end -module Polyfill::Module::MezpJbnRlZ2VyPT5bIiNjZWlsIiwgIiNmbG9vciIsICIjcm91bmQiLCAiI3RydW5jYXRlIl0sIDp2ZXJzaW9uPT4iMi40In0_ -end -module Polyfill::V2_5::Integer::ClassMethods - def sqrt(n); end -end -module Polyfill::V2_5::Kernel - def yield_self; end -end -module Polyfill::V2_5::String - def casecmp(other_str); end - def casecmp?(other_str); end - def delete_prefix!(prefix); end - def delete_prefix(prefix); end - def delete_suffix!(suffix); end - def delete_suffix(suffix); end - def each_grapheme_cluster; end - def grapheme_clusters; end - def start_with?(*prefixes); end -end -module Polyfill::V2_5::Struct -end -module Polyfill::V2_5::Struct::ClassMethods - def new(*args, keyword_init: nil); end -end -module Polyfill::V2_5::Time -end -module Polyfill::V2_5::Time::ClassMethods - def at(*args); end -end -module Polyfill::V2_5::BigDecimal - def clone; end - def dup; end -end -module Polyfill::V2_5::Set - def ===(other); end - def to_s; end -end -module Polyfill::V2_6 -end -module Polyfill::V2_6::Array - def difference(*arrays); end - def to_h; end - def union(*arrays); end -end -module Polyfill::V2_6::Enumerable - def to_h; end -end -module Polyfill::V2_6::Hash - def merge!(*args); end - def merge(*args); end - def to_h; end - def update(*args); end -end -module Polyfill::V2_6::Kernel - def Complex(*args, exception: nil); end - def Float(arg, exception: nil); end - def Integer(arg, exception: nil); end - def Rational(*args, exception: nil); end - def then; end -end -module Polyfill::Module::MezpLZXJuZWw9PlsiI3lpZWxkX3NlbGYiXSwgOnZlcnNpb249PiIyLjUifQ__ -end -module Polyfill::V2_6::OpenStruct - def to_h; end -end -module Polyfill::V2_6::String - def split(*); end -end -module Polyfill::V2_6::Struct - def to_h; end -end -module Polyfill::Module -end -class Object < BasicObject - def Polyfill(options = nil); end -end diff --git a/sorbet/rbi/gems/rbi@0.1.13.rbi b/sorbet/rbi/gems/rbi@0.1.13.rbi index f307314..6f431af 100644 --- a/sorbet/rbi/gems/rbi@0.1.13.rbi +++ b/sorbet/rbi/gems/rbi@0.1.13.rbi @@ -1945,7 +1945,7 @@ class RBI::Rewriters::Merge::Conflict < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2162,7 +2162,7 @@ class RBI::Rewriters::RemoveKnownDefinitions::Operation < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end diff --git a/sorbet/rbi/gems/rspec-core.rbi b/sorbet/rbi/gems/rspec-core.rbi deleted file mode 100644 index 2289abc..0000000 --- a/sorbet/rbi/gems/rspec-core.rbi +++ /dev/null @@ -1,1982 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: true -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/rspec-core/all/rspec-core.rbi -# -# rspec-core-3.13.0 - -module RSpec - def self.clear_examples; end - def self.configuration; end - def self.configuration=(arg0); end - def self.configure; end - def self.const_missing(name); end - def self.context(*args, &example_group_block); end - def self.current_example; end - def self.current_example=(example); end - def self.current_scope; end - def self.current_scope=(scope); end - def self.describe(*args, &example_group_block); end - def self.example_group(*args, &example_group_block); end - def self.fcontext(*args, &example_group_block); end - def self.fdescribe(*args, &example_group_block); end - def self.reset; end - def self.shared_context(name, *args, &block); end - def self.shared_examples(name, *args, &block); end - def self.shared_examples_for(name, *args, &block); end - def self.world; end - def self.world=(arg0); end - def self.xcontext(*args, &example_group_block); end - def self.xdescribe(*args, &example_group_block); end - extend RSpec::Core::Warnings -end -module RSpec::Core - def self.path_to_executable; end -end -module RSpec::Core::Version -end -module RSpec::Core::Warnings - def deprecate(deprecated, data = nil); end - def warn_deprecation(message, opts = nil); end - def warn_with(message, options = nil); end -end -class RSpec::Core::Set - def <<(key); end - def clear; end - def delete(key); end - def each(&block); end - def empty?; end - def include?(key); end - def initialize(array = nil); end - def merge(values); end - include Enumerable -end -module RSpec::Core::FlatMap - def flat_map(array, &block); end - def self.flat_map(array, &block); end -end -class RSpec::Core::FilterManager - def add_ids(rerun_path, scoped_ids); end - def add_location(file_path, line_numbers); end - def add_path_to_arrays_filter(filter_key, path, values); end - def empty?; end - def exclude(*args); end - def exclude_only(*args); end - def exclude_with_low_priority(*args); end - def exclusions; end - def file_scoped_include?(ex_metadata, ids, locations); end - def include(*args); end - def include_only(*args); end - def include_with_low_priority(*args); end - def inclusions; end - def initialize; end - def prune(examples); end - def prune_conditionally_filtered_examples(examples); end -end -class RSpec::Core::FilterRules - def [](key); end - def add(updated); end - def add_with_low_priority(updated); end - def clear; end - def delete(key); end - def description; end - def each_pair(&block); end - def empty?; end - def fetch(*args, &block); end - def include_example?(example); end - def initialize(rules = nil); end - def opposite; end - def opposite=(arg0); end - def rules; end - def self.build; end - def use_only(updated); end -end -class RSpec::Core::InclusionRules < RSpec::Core::FilterRules - def add(*args); end - def add_with_low_priority(*args); end - def apply_standalone_filter(updated); end - def include_example?(example); end - def is_standalone_filter?(rules); end - def replace_filters(new_rules); end - def split_file_scoped_rules; end - def standalone?; end -end -module RSpec::Core::DSL - def self.change_global_dsl(&changes); end - def self.example_group_aliases; end - def self.expose_example_group_alias(name); end - def self.expose_example_group_alias_globally(method_name); end - def self.expose_globally!; end - def self.exposed_globally?; end - def self.remove_globally!; end - def self.top_level; end - def self.top_level=(arg0); end -end -module RSpec::Core::Formatters - def self.register(formatter_class, *notifications); end -end -module RSpec::Core::Formatters::ConsoleCodes - def config_colors_to_methods; end - def console_code_for(code_or_symbol); end - def self.config_colors_to_methods; end - def self.console_code_for(code_or_symbol); end - def self.wrap(text, code_or_symbol); end - def wrap(text, code_or_symbol); end -end -class RSpec::Core::Formatters::SnippetExtractor - def beginning_line_number; end - def expression_lines; end - def expression_node; end - def expression_outmost_node?(node); end - def initialize(source, beginning_line_number, max_line_count = nil); end - def line_range_of_expression; end - def line_range_of_location_nodes_in_expression; end - def location_nodes_at_beginning_line; end - def max_line_count; end - def self.extract_expression_lines_at(file_path, beginning_line_number, max_line_count = nil); end - def self.extract_line_at(file_path, line_number); end - def self.least_indentation_from(lines); end - def self.source_from_file(path); end - def source; end - def unclosed_tokens_in_line_range(line_range); end -end -class RSpec::Core::Formatters::SnippetExtractor::NoSuchFileError < StandardError -end -class RSpec::Core::Formatters::SnippetExtractor::NoSuchLineError < StandardError -end -class RSpec::Core::Formatters::SnippetExtractor::NoExpressionAtLineError < StandardError -end -class RSpec::Core::Formatters::SyntaxHighlighter - def color_enabled_implementation; end - def highlight(lines); end - def implementation; end - def initialize(configuration); end - def self.attempt_to_add_rspec_terms_to_coderay_keywords; end -end -module RSpec::Core::Formatters::SyntaxHighlighter::CodeRayImplementation - def self.highlight_syntax(lines); end -end -module RSpec::Core::Formatters::SyntaxHighlighter::NoSyntaxHighlightingImplementation - def self.highlight_syntax(lines); end -end -class RSpec::Core::Formatters::ExceptionPresenter - def add_shared_group_lines(lines, colorizer); end - def backtrace_formatter; end - def colorized_formatted_backtrace(colorizer = nil); end - def colorized_message_lines(colorizer = nil); end - def description; end - def detail_formatter; end - def encoded_description(description); end - def encoded_string(string); end - def encoding_of(string); end - def example; end - def exception; end - def exception_backtrace; end - def exception_class_name(exception = nil); end - def exception_lines; end - def exception_message_string(exception); end - def extra_detail_formatter; end - def extra_failure_lines; end - def failure_lines; end - def failure_slash_error_lines; end - def final_exception(exception, previous = nil); end - def find_failed_line; end - def formatted_backtrace(exception = nil); end - def formatted_cause(exception); end - def formatted_message_and_backtrace(colorizer); end - def fully_formatted(failure_number, colorizer = nil); end - def fully_formatted_lines(failure_number, colorizer); end - def indent_lines(lines, failure_number); end - def initialize(exception, example, options = nil); end - def message_color; end - def message_lines; end - def read_failed_lines; end -end -class RSpec::Core::Formatters::ExceptionPresenter::Factory - def build; end - def initialize(example); end - def multiple_exception_summarizer(exception, prior_detail_formatter, color); end - def multiple_exceptions_error?(exception); end - def options; end - def pending_options; end - def sub_failure_list_formatter(exception, message_color); end - def with_multiple_error_options_as_needed(exception, options); end -end -module RSpec::Core::Formatters::ExceptionPresenter::Factory::EmptyBacktraceFormatter - def self.format_backtrace(*); end -end -class RSpec::Core::Formatters::ExceptionPresenter::Factory::CommonBacktraceTruncater - def initialize(parent); end - def with_truncated_backtrace(child); end -end -class RSpec::Core::MultipleExceptionError < StandardError - def aggregation_block_label; end - def aggregation_metadata; end - def all_exceptions; end - def exception_count_description; end - def failures; end - def initialize(*exceptions); end - def message; end - def other_errors; end - def summary; end - include RSpec::Core::MultipleExceptionError::InterfaceTag -end -module RSpec::Core::MultipleExceptionError::InterfaceTag - def add(exception); end - def self.for(ex); end -end -module RSpec::Core::ShellEscape - def conditionally_quote(id); end - def escape(shell_command); end - def quote(argument); end - def self.conditionally_quote(id); end - def self.escape(shell_command); end - def self.quote(argument); end - def self.shell_allows_unquoted_ids?; end - def shell_allows_unquoted_ids?; end -end -module RSpec::Core::Formatters::Helpers - def self.format_duration(duration); end - def self.format_seconds(float, precision = nil); end - def self.organize_ids(ids); end - def self.pluralize(count, string); end - def self.strip_trailing_zeroes(string); end -end -module RSpec::Core::Notifications -end -module RSpec::Core::Notifications::NullColorizer - def self.wrap(line, _code_or_symbol); end - def wrap(line, _code_or_symbol); end -end -class RSpec::Core::Notifications::StartNotification < Struct - def count; end - def count=(_); end - def load_time; end - def load_time=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class RSpec::Core::Notifications::ExampleNotification < Struct - def example; end - def example=(_); end - def self.[](*arg0); end - def self.for(example); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class RSpec::Core::Notifications::ExamplesNotification - def examples; end - def failed_examples; end - def failure_notifications; end - def format_examples(examples); end - def fully_formatted_failed_examples(colorizer = nil); end - def fully_formatted_pending_examples(colorizer = nil); end - def initialize(reporter); end - def notifications; end - def pending_examples; end - def pending_notifications; end -end -class RSpec::Core::Notifications::FailedExampleNotification < RSpec::Core::Notifications::ExampleNotification - def colorized_formatted_backtrace(colorizer = nil); end - def colorized_message_lines(colorizer = nil); end - def description; end - def exception; end - def formatted_backtrace; end - def fully_formatted(failure_number, colorizer = nil); end - def fully_formatted_lines(failure_number, colorizer = nil); end - def initialize(example, exception_presenter = nil); end - def message_lines; end - def self.new(*arg0); end -end -class RSpec::Core::Notifications::PendingExampleFixedNotification < RSpec::Core::Notifications::FailedExampleNotification -end -class RSpec::Core::Notifications::PendingExampleFailedAsExpectedNotification < RSpec::Core::Notifications::FailedExampleNotification -end -class RSpec::Core::Notifications::SkippedExampleNotification < RSpec::Core::Notifications::ExampleNotification - def fully_formatted(pending_number, colorizer = nil); end - def self.new(*arg0); end -end -class RSpec::Core::Notifications::GroupNotification < Struct - def group; end - def group=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class RSpec::Core::Notifications::MessageNotification < Struct - def message; end - def message=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class RSpec::Core::Notifications::SeedNotification < Struct - def fully_formatted; end - def seed; end - def seed=(_); end - def seed_used?; end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end - def used; end - def used=(_); end -end -class RSpec::Core::Notifications::SummaryNotification < Struct - def colorized_rerun_commands(colorizer = nil); end - def colorized_totals_line(colorizer = nil); end - def duplicate_rerun_locations; end - def duration; end - def duration=(_); end - def errors_outside_of_examples_count; end - def errors_outside_of_examples_count=(_); end - def example_count; end - def examples; end - def examples=(_); end - def failed_examples; end - def failed_examples=(_); end - def failure_count; end - def formatted_duration; end - def formatted_load_time; end - def fully_formatted(colorizer = nil); end - def load_time; end - def load_time=(_); end - def pending_count; end - def pending_examples; end - def pending_examples=(_); end - def rerun_argument_for(example); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end - def totals_line; end - include RSpec::Core::ShellEscape -end -class RSpec::Core::Notifications::ProfileNotification - def calculate_slowest_groups; end - def duration; end - def examples; end - def initialize(duration, examples, number_of_examples, example_groups); end - def number_of_examples; end - def percentage; end - def slow_duration; end - def slowest_examples; end - def slowest_groups; end -end -class RSpec::Core::Notifications::DeprecationNotification < Struct - def call_site; end - def call_site=(_); end - def deprecated; end - def deprecated=(_); end - def message; end - def message=(_); end - def replacement; end - def replacement=(_); end - def self.[](*arg0); end - def self.from_hash(data); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class RSpec::Core::Notifications::NullNotification -end -class RSpec::Core::Notifications::CustomNotification < Struct - def self.for(options = nil); end -end -class RSpec::Core::Reporter - def abort_with(msg, exit_status); end - def close; end - def close_after; end - def deprecation(hash); end - def ensure_listeners_ready; end - def example_failed(example); end - def example_finished(example); end - def example_group_finished(group); end - def example_group_started(group); end - def example_passed(example); end - def example_pending(example); end - def example_started(example); end - def examples; end - def exit_early(exit_code); end - def fail_fast_limit_met?; end - def failed_examples; end - def finish; end - def initialize(configuration); end - def message(message); end - def mute_profile_output?; end - def notify(event, notification); end - def notify_non_example_exception(exception, context_description); end - def pending_examples; end - def prepare_default(loader, output_stream, deprecation_stream); end - def publish(event, options = nil); end - def register_listener(listener, *notifications); end - def registered_listeners(notification); end - def report(expected_example_count); end - def seed_used?; end - def start(expected_example_count, time = nil); end - def stop; end -end -class RSpec::Core::NullReporter - def self.method_missing(*); end -end -module RSpec::Core::Hooks - def after(*args, &block); end - def append_after(*args, &block); end - def append_before(*args, &block); end - def around(*args, &block); end - def before(*args, &block); end - def hooks; end - def prepend_after(*args, &block); end - def prepend_before(*args, &block); end -end -class RSpec::Core::Hooks::Hook < Struct - def block; end - def block=(_); end - def options; end - def options=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class RSpec::Core::Hooks::BeforeHook < RSpec::Core::Hooks::Hook - def run(example); end -end -class RSpec::Core::Hooks::AfterHook < RSpec::Core::Hooks::Hook - def run(example); end -end -class RSpec::Core::Hooks::AfterContextHook < RSpec::Core::Hooks::Hook - def run(example); end -end -class RSpec::Core::Hooks::AroundHook < RSpec::Core::Hooks::Hook - def execute_with(example, procsy); end - def hook_description; end -end -class RSpec::Core::Hooks::HookCollections - def all_hooks_for(position, scope); end - def ensure_hooks_initialized_for(position, scope); end - def extract_scope_from(args); end - def hooks_for(position, scope); end - def initialize(owner, filterable_item_repo_class); end - def known_scope?(scope); end - def matching_hooks_for(position, scope, example_or_group); end - def normalized_scope_for(scope); end - def owner_parent_groups; end - def process(host, parent_groups, globals, position, scope); end - def processable_hooks_for(position, scope, host); end - def register(prepend_or_append, position, *args, &block); end - def register_global_singleton_context_hooks(example, globals); end - def register_globals(host, globals); end - def run(position, scope, example_or_group); end - def run_around_example_hooks_for(example); end - def run_example_hooks_for(example, position, each_method); end - def run_owned_hooks_for(position, scope, example_or_group); end - def scope_and_options_from(*args); end -end -module RSpec::Core::MemoizedHelpers - def __init_memoized; end - def __memoized; end - def enforce_value_expectation(matcher, method_name); end - def initialize(*); end - def is_expected; end - def matcher_supports_value_expectations?(matcher); end - def self.define_helpers_on(example_group); end - def self.get_constant_or_yield(example_group, name); end - def self.module_for(example_group); end - def should(matcher = nil, message = nil); end - def should_not(matcher = nil, message = nil); end - def subject; end -end -class RSpec::Core::MemoizedHelpers::ThreadsafeMemoized - def fetch_or_store(key); end - def initialize; end -end -class RSpec::Core::MemoizedHelpers::NonThreadSafeMemoized - def fetch_or_store(key); end - def initialize; end -end -class RSpec::Core::MemoizedHelpers::ContextHookMemoized - def self.fetch_or_store(key, &_block); end - def self.isolate_for_context_hook(example_group_instance); end -end -class RSpec::Core::MemoizedHelpers::ContextHookMemoized::Before < RSpec::Core::MemoizedHelpers::ContextHookMemoized - def self.article; end - def self.hook_expression; end - def self.hook_intention; end -end -class RSpec::Core::MemoizedHelpers::ContextHookMemoized::After < RSpec::Core::MemoizedHelpers::ContextHookMemoized - def self.article; end - def self.hook_expression; end - def self.hook_intention; end -end -module RSpec::Core::MemoizedHelpers::ClassMethods - def let!(name, &block); end - def let(name, &block); end - def subject!(name = nil, &block); end - def subject(name = nil, &block); end -end -module RSpec::Core::Metadata - def self.ascend(metadata); end - def self.ascending(metadata); end - def self.build_hash_from(args, warn_about_example_group_filtering = nil); end - def self.deep_hash_dup(object); end - def self.id_from(metadata); end - def self.location_tuple_from(metadata); end - def self.relative_path(line); end - def self.relative_path_regex; end -end -class RSpec::Core::Metadata::HashPopulator - def block; end - def build_description_from(parent_description = nil, my_description = nil); end - def build_scoped_id_for(file_path); end - def description_args; end - def description_separator(parent_part, child_part); end - def ensure_valid_user_keys; end - def file_path_and_line_number_from(backtrace); end - def initialize(metadata, user_metadata, index_provider, description_args, block); end - def metadata; end - def populate; end - def populate_location_attributes; end - def user_metadata; end -end -class RSpec::Core::Metadata::ExampleHash < RSpec::Core::Metadata::HashPopulator - def described_class; end - def full_description; end - def self.create(group_metadata, user_metadata, index_provider, description, block); end -end -class RSpec::Core::Metadata::ExampleGroupHash < RSpec::Core::Metadata::HashPopulator - def described_class; end - def full_description; end - def self.backwards_compatibility_default_proc(&example_group_selector); end - def self.create(parent_group_metadata, user_metadata, example_group_index, *args, &block); end - def self.hash_with_backwards_compatibility_default_proc; end -end -module RSpec::Core::HashImitatable - def <(*args, &block); end - def <=(*args, &block); end - def >(*args, &block); end - def >=(*args, &block); end - def [](key); end - def []=(key, value); end - def all?(*args, &block); end - def any?(*args, &block); end - def assert_valid_keys(*args, &block); end - def assoc(*args, &block); end - def chain(*args, &block); end - def chunk(*args, &block); end - def chunk_while(*args, &block); end - def clear(*args, &block); end - def collect(*args, &block); end - def collect_concat(*args, &block); end - def compact!(*args, &block); end - def compact(*args, &block); end - def compact_blank!(*args, &block); end - def compact_blank(*args, &block); end - def compare_by_identity(*args, &block); end - def compare_by_identity?(*args, &block); end - def count(*args, &block); end - def cycle(*args, &block); end - def deconstruct_keys(*args, &block); end - def deep_merge!(*args, &block); end - def deep_merge(*args, &block); end - def deep_merge?(*args, &block); end - def deep_stringify_keys!(*args, &block); end - def deep_stringify_keys(*args, &block); end - def deep_symbolize_keys!(*args, &block); end - def deep_symbolize_keys(*args, &block); end - def deep_transform_keys!(*args, &block); end - def deep_transform_keys(*args, &block); end - def default(*args, &block); end - def default=(*args, &block); end - def default_proc(*args, &block); end - def default_proc=(*args, &block); end - def delete(*args, &block); end - def delete_if(*args, &block); end - def detect(*args, &block); end - def dig(*args, &block); end - def directly_supports_attribute?(name); end - def drop(*args, &block); end - def drop_while(*args, &block); end - def each(*args, &block); end - def each_cons(*args, &block); end - def each_entry(*args, &block); end - def each_key(*args, &block); end - def each_pair(*args, &block); end - def each_slice(*args, &block); end - def each_value(*args, &block); end - def each_with_index(*args, &block); end - def each_with_object(*args, &block); end - def empty?(*args, &block); end - def entries(*args, &block); end - def except!(*args, &block); end - def except(*args, &block); end - def exclude?(*args, &block); end - def excluding(*args, &block); end - def extra_hash_attributes; end - def extract!(*args, &block); end - def extractable_options?(*args, &block); end - def fetch(*args, &block); end - def fetch_values(*args, &block); end - def filter!(*args, &block); end - def filter(*args, &block); end - def filter_map(*args, &block); end - def find(*args, &block); end - def find_all(*args, &block); end - def find_index(*args, &block); end - def first(*args, &block); end - def flat_map(*args, &block); end - def flatten(*args, &block); end - def get_value(name); end - def grep(*args, &block); end - def grep_v(*args, &block); end - def group_by(*args, &block); end - def has_key?(*args, &block); end - def has_value?(*args, &block); end - def hash_for_delegation; end - def in_order_of(*args, &block); end - def include?(*args, &block); end - def including(*args, &block); end - def index_by(*args, &block); end - def index_with(*args, &block); end - def inject(*args, &block); end - def invert(*args, &block); end - def issue_deprecation(_method_name, *_args); end - def keep_if(*args, &block); end - def key(*args, &block); end - def key?(*args, &block); end - def keys(*args, &block); end - def lazy(*args, &block); end - def length(*args, &block); end - def many?(*args, &block); end - def map(*args, &block); end - def max(*args, &block); end - def max_by(*args, &block); end - def maximum(*args, &block); end - def member?(*args, &block); end - def merge!(*args, &block); end - def merge(*args, &block); end - def min(*args, &block); end - def min_by(*args, &block); end - def minimum(*args, &block); end - def minmax(*args, &block); end - def minmax_by(*args, &block); end - def none?(*args, &block); end - def one?(*args, &block); end - def partition(*args, &block); end - def pick(*args, &block); end - def pluck(*args, &block); end - def rassoc(*args, &block); end - def reduce(*args, &block); end - def rehash(*args, &block); end - def reject!(*args, &block); end - def reject(*args, &block); end - def replace(*args, &block); end - def reverse_each(*args, &block); end - def select!(*args, &block); end - def select(*args, &block); end - def self.included(klass); end - def set_value(name, value); end - def shift(*args, &block); end - def size(*args, &block); end - def slice!(*args, &block); end - def slice(*args, &block); end - def slice_after(*args, &block); end - def slice_before(*args, &block); end - def slice_when(*args, &block); end - def sole(*args, &block); end - def sort(*args, &block); end - def sort_by(*args, &block); end - def store(*args, &block); end - def stringify_keys!(*args, &block); end - def stringify_keys(*args, &block); end - def sum(*args, &block); end - def symbolize_keys!(*args, &block); end - def symbolize_keys(*args, &block); end - def take(*args, &block); end - def take_while(*args, &block); end - def tally(*args, &block); end - def to_a(*args, &block); end - def to_h; end - def to_hash(*args, &block); end - def to_options!(*args, &block); end - def to_options(*args, &block); end - def to_proc(*args, &block); end - def to_set(*args, &block); end - def transform_keys!(*args, &block); end - def transform_keys(*args, &block); end - def transform_values!(*args, &block); end - def transform_values(*args, &block); end - def uniq(*args, &block); end - def update(*args, &block); end - def value?(*args, &block); end - def values(*args, &block); end - def values_at(*args, &block); end - def without(*args, &block); end - def zip(*args, &block); end -end -module RSpec::Core::HashImitatable::ClassMethods - def attr_accessor(*names); end - def hash_attribute_names; end -end -class RSpec::Core::LegacyExampleGroupHash - def directly_supports_attribute?(name); end - def get_value(name); end - def initialize(metadata); end - def set_value(name, value); end - def to_h; end - extend RSpec::Core::HashImitatable::ClassMethods - include RSpec::Core::HashImitatable -end -module RSpec::Core::MetadataFilter - def self.apply?(predicate, filters, metadata); end - def self.filter_applies?(key, filter_value, metadata); end - def self.filter_applies_to_any_value?(key, value, metadata); end - def self.filters_apply?(key, value, metadata); end - def self.id_filter_applies?(rerun_paths_to_scoped_ids, metadata); end - def self.location_filter_applies?(locations, metadata); end - def self.proc_filter_applies?(key, proc, metadata); end - def self.silence_metadata_example_group_deprecations; end -end -module RSpec::Core::FilterableItemRepository -end -class RSpec::Core::FilterableItemRepository::UpdateOptimized - def append(item, metadata); end - def delete(item, metadata); end - def initialize(applies_predicate); end - def items_and_filters; end - def items_for(request_meta); end - def prepend(item, metadata); end -end -class RSpec::Core::FilterableItemRepository::QueryOptimized < RSpec::Core::FilterableItemRepository::UpdateOptimized - def append(item, metadata); end - def applicable_metadata_from(metadata); end - def delete(item, metadata); end - def find_items_for(request_meta); end - def handle_mutation(metadata); end - def initialize(applies_predicate); end - def items_for(metadata); end - def prepend(item, metadata); end - def proc_keys_from(metadata); end - def reconstruct_caches; end -end -module RSpec::Core::Pending - def pending(message = nil); end - def self.mark_fixed!(example); end - def self.mark_pending!(example, message_or_bool); end - def self.mark_skipped!(example, message_or_bool); end - def skip(message = nil); end -end -class RSpec::Core::Pending::SkipDeclaredInExample < StandardError - def argument; end - def initialize(argument); end -end -class RSpec::Core::Pending::PendingExampleFixedError < StandardError -end -class RSpec::Core::Formatters::Loader - def add(formatter_to_use, *paths); end - def built_in_formatter(key); end - def custom_formatter(formatter_ref); end - def default_formatter; end - def default_formatter=(arg0); end - def duplicate_formatter_exists?(new_formatter); end - def existing_formatter_implements?(notification); end - def find_formatter(formatter_to_use); end - def formatters; end - def has_matching_output?(formatter, new_formatter); end - def initialize(reporter); end - def notifications_for(formatter_class); end - def open_stream(path_or_wrapper); end - def path_for(const_ref); end - def prepare_default(output_stream, deprecation_stream); end - def register(formatter, notifications); end - def reporter; end - def self.formatters; end - def setup_default(output_stream, deprecation_stream); end - def string_const?(str); end - def underscore(camel_cased_word); end - def underscore_with_fix_for_non_standard_rspec_naming(string); end -end -module RSpec::Core::Ordering -end -class RSpec::Core::Ordering::Identity - def order(items); end -end -class RSpec::Core::Ordering::Random - def initialize(configuration); end - def jenkins_hash_digest(string); end - def order(items); end - def used?; end -end -class RSpec::Core::Ordering::RecentlyModified - def order(list); end -end -class RSpec::Core::Ordering::Custom - def initialize(callable); end - def order(list); end -end -class RSpec::Core::Ordering::Delayed - def initialize(registry, name); end - def lookup_strategy; end - def order(list); end - def strategy; end -end -class RSpec::Core::Ordering::Registry - def fetch(name, &fallback); end - def has_strategy?(name); end - def initialize(configuration); end - def register(sym, strategy); end - def used_random_seed?; end -end -class RSpec::Core::Ordering::ConfigurationManager - def force(hash); end - def initialize; end - def order=(type); end - def ordering_registry; end - def register_ordering(name, strategy = nil); end - def seed; end - def seed=(seed); end - def seed_used?; end -end -class RSpec::Core::World - def all_example_groups; end - def all_examples; end - def announce_exclusion_filter(announcements); end - def announce_filters; end - def announce_inclusion_filter(announcements); end - def descending_declaration_line_numbers_by_file; end - def everything_filtered_message; end - def example_count(groups = nil); end - def example_group_counts_by_spec_file; end - def example_groups; end - def exclusion_filter; end - def fail_if_config_and_cli_options_invalid; end - def filter_manager; end - def filtered_examples; end - def inclusion_filter; end - def initialize(configuration = nil); end - def non_example_failure; end - def non_example_failure=(arg0); end - def num_example_groups_defined_in(file); end - def ordered_example_groups; end - def preceding_declaration_line(absolute_file_name, filter_line); end - def prepare_example_filtering; end - def record(example_group); end - def registered_example_group_files; end - def report_filter_message(message); end - def reporter; end - def reset; end - def rspec_is_quitting; end - def rspec_is_quitting=(arg0); end - def shared_example_group_registry; end - def source_from_file(path); end - def syntax_highlighter; end - def traverse_example_group_trees_until(&block); end - def wants_to_quit; end - def wants_to_quit=(arg0); end -end -module RSpec::Core::World::Null - def self.all_example_groups; end - def self.example_groups; end - def self.non_example_failure; end - def self.non_example_failure=(_); end - def self.registered_example_group_files; end - def self.traverse_example_group_trees_until; end -end -class RSpec::Core::BacktraceFormatter - def backtrace_line(line); end - def exclude?(line); end - def exclusion_patterns; end - def exclusion_patterns=(arg0); end - def filter_gem(gem_name); end - def format_backtrace(backtrace, options = nil); end - def full_backtrace=(arg0); end - def full_backtrace?; end - def inclusion_patterns; end - def inclusion_patterns=(arg0); end - def initialize; end - def matches?(patterns, line); end -end -module RSpec::Core::RubyProject - def add_dir_to_load_path(dir); end - def add_to_load_path(*dirs); end - def ascend_until; end - def determine_root; end - def find_first_parent_containing(dir); end - def root; end - def self.add_dir_to_load_path(dir); end - def self.add_to_load_path(*dirs); end - def self.ascend_until; end - def self.determine_root; end - def self.find_first_parent_containing(dir); end - def self.root; end -end -class RSpec::Core::Formatters::DeprecationFormatter - def count; end - def deprecation(notification); end - def deprecation_message_for(data); end - def deprecation_stream; end - def deprecation_summary(_notification); end - def initialize(deprecation_stream, summary_stream); end - def output; end - def printer; end - def summary_stream; end -end -class RSpec::Core::Formatters::DeprecationFormatter::SpecifiedDeprecationMessage < Struct - def deprecation_type_for(data); end - def initialize(data); end - def output_formatted(str); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end - def to_s; end - def too_many_warnings_message; end - def type; end - def type=(_); end -end -class RSpec::Core::Formatters::DeprecationFormatter::GeneratedDeprecationMessage < Struct - def initialize(data); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end - def to_s; end - def too_many_warnings_message; end - def type; end - def type=(_); end -end -class RSpec::Core::Formatters::DeprecationFormatter::ImmediatePrinter - def deprecation_formatter; end - def deprecation_stream; end - def deprecation_summary; end - def initialize(deprecation_stream, summary_stream, deprecation_formatter); end - def print_deprecation_message(data); end - def summary_stream; end -end -class RSpec::Core::Formatters::DeprecationFormatter::DelayedPrinter - def deprecation_formatter; end - def deprecation_stream; end - def deprecation_summary; end - def initialize(deprecation_stream, summary_stream, deprecation_formatter); end - def print_deferred_deprecation_warnings; end - def print_deprecation_message(data); end - def stash_deprecation_message(deprecation_message); end - def summary_stream; end -end -class RSpec::Core::Formatters::DeprecationFormatter::RaiseErrorStream - def puts(message); end - def summarize(summary_stream, deprecation_count); end -end -class RSpec::Core::Formatters::DeprecationFormatter::FileStream - def initialize(file); end - def puts(*args); end - def summarize(summary_stream, deprecation_count); end -end -class RSpec::Core::DeprecationError < StandardError -end -class RSpec::Core::OutputWrapper - def <<(*args, &block); end - def advise(*args, &block); end - def autoclose=(*args, &block); end - def autoclose?(*args, &block); end - def binmode(*args, &block); end - def binmode?(*args, &block); end - def close(*args, &block); end - def close_on_exec=(*args, &block); end - def close_on_exec?(*args, &block); end - def close_read(*args, &block); end - def close_write(*args, &block); end - def closed?(*args, &block); end - def each(*args, &block); end - def each_byte(*args, &block); end - def each_char(*args, &block); end - def each_codepoint(*args, &block); end - def each_line(*args, &block); end - def eof(*args, &block); end - def eof?(*args, &block); end - def external_encoding(*args, &block); end - def fcntl(*args, &block); end - def fdatasync(*args, &block); end - def fileno(*args, &block); end - def flush(*args, &block); end - def fsync(*args, &block); end - def getbyte(*args, &block); end - def getc(*args, &block); end - def gets(*args, &block); end - def initialize(output); end - def inspect(*args, &block); end - def internal_encoding(*args, &block); end - def ioctl(*args, &block); end - def isatty(*args, &block); end - def lineno(*args, &block); end - def lineno=(*args, &block); end - def method_missing(name, *args, &block); end - def nonblock(*args, &block); end - def nonblock=(*args, &block); end - def nonblock?(*args, &block); end - def nread(*args, &block); end - def output; end - def output=(arg0); end - def path(*args, &block); end - def pathconf(*args, &block); end - def pid(*args, &block); end - def pos(*args, &block); end - def pos=(*args, &block); end - def pread(*args, &block); end - def print(*args, &block); end - def printf(*args, &block); end - def putc(*args, &block); end - def puts(*args, &block); end - def pwrite(*args, &block); end - def read(*args, &block); end - def read_nonblock(*args, &block); end - def readbyte(*args, &block); end - def readchar(*args, &block); end - def readline(*args, &block); end - def readlines(*args, &block); end - def readpartial(*args, &block); end - def ready?(*args, &block); end - def reopen(*args, &block); end - def respond_to?(name, priv = nil); end - def rewind(*args, &block); end - def seek(*args, &block); end - def set_encoding(*args, &block); end - def set_encoding_by_bom(*args, &block); end - def stat(*args, &block); end - def sync(*args, &block); end - def sync=(*args, &block); end - def sysread(*args, &block); end - def sysseek(*args, &block); end - def syswrite(*args, &block); end - def tell(*args, &block); end - def timeout(*args, &block); end - def timeout=(*args, &block); end - def to_i(*args, &block); end - def to_io(*args, &block); end - def to_path(*args, &block); end - def tty?(*args, &block); end - def ungetbyte(*args, &block); end - def ungetc(*args, &block); end - def wait(*args, &block); end - def wait_priority(*args, &block); end - def wait_readable(*args, &block); end - def wait_writable(*args, &block); end - def write(*args, &block); end - def write_nonblock(*args, &block); end -end -class RSpec::Core::Configuration - def absolute_pattern?(pattern); end - def add_formatter(formatter, output = nil); end - def add_hook_to_existing_matching_groups(meta, scope, &block); end - def add_setting(name, opts = nil); end - def after(scope = nil, *meta, &block); end - def alias_example_group_to(new_name, *args); end - def alias_example_to(name, *args); end - def alias_it_behaves_like_to(new_name, report_label = nil); end - def alias_it_should_behave_like_to(new_name, report_label = nil); end - def append_after(scope = nil, *meta, &block); end - def append_before(scope = nil, *meta, &block); end - def apply_derived_metadata_to(metadata); end - def around(scope = nil, *meta, &block); end - def assert_no_example_groups_defined(config_option); end - def backtrace_exclusion_patterns; end - def backtrace_exclusion_patterns=(patterns); end - def backtrace_formatter; end - def backtrace_inclusion_patterns; end - def backtrace_inclusion_patterns=(patterns); end - def before(scope = nil, *meta, &block); end - def bisect_runner; end - def bisect_runner=(value); end - def bisect_runner_class; end - def clear_values_derived_from_example_status_persistence_file_path; end - def color; end - def color=(arg0); end - def color_enabled?(output = nil); end - def color_mode; end - def color_mode=(arg0); end - def command; end - def conditionally_disable_expectations_monkey_patching; end - def conditionally_disable_mocks_monkey_patching; end - def configure_example(example, example_hooks); end - def configure_expectation_framework; end - def configure_group(group); end - def configure_group_with(group, module_list, application_method); end - def configure_mock_framework; end - def default_color; end - def default_color=(arg0); end - def default_color?; end - def default_formatter; end - def default_formatter=(value); end - def default_path; end - def default_path=(path); end - def default_path?; end - def define_built_in_hooks; end - def define_derived_metadata(*filters, &block); end - def define_mixed_in_module(mod, filters, mod_list, config_method, &block); end - def deprecation_stream; end - def deprecation_stream=(value); end - def detail_color; end - def detail_color=(arg0); end - def detail_color?; end - def disable_monkey_patching!; end - def disable_monkey_patching; end - def disable_monkey_patching=(arg0); end - def drb; end - def drb=(arg0); end - def drb?; end - def drb_port; end - def drb_port=(arg0); end - def drb_port?; end - def dry_run; end - def dry_run=(arg0); end - def dry_run?; end - def error_exit_code; end - def error_exit_code=(arg0); end - def error_exit_code?; end - def error_stream; end - def error_stream=(arg0); end - def error_stream?; end - def example_status_persistence_file_path; end - def example_status_persistence_file_path=(value); end - def exclude_pattern; end - def exclude_pattern=(value); end - def exclusion_filter; end - def exclusion_filter=(filter); end - def expect_with(*frameworks); end - def expectation_framework=(framework); end - def expectation_frameworks; end - def expose_current_running_example_as(method_name); end - def expose_dsl_globally=(value); end - def expose_dsl_globally?; end - def extend(mod, *filters); end - def extract_location(path); end - def fail_fast; end - def fail_fast=(value); end - def fail_if_no_examples; end - def fail_if_no_examples=(arg0); end - def fail_if_no_examples?; end - def failure_color; end - def failure_color=(arg0); end - def failure_color?; end - def failure_exit_code; end - def failure_exit_code=(arg0); end - def failure_exit_code?; end - def file_glob_from(path, pattern); end - def files_or_directories_to_run=(*files); end - def files_to_run; end - def files_to_run=(arg0); end - def filter; end - def filter=(filter); end - def filter_gems_from_backtrace(*gem_names); end - def filter_manager; end - def filter_manager=(arg0); end - def filter_run(*args); end - def filter_run_excluding(*args); end - def filter_run_including(*args); end - def filter_run_when_matching(*args); end - def fixed_color; end - def fixed_color=(arg0); end - def fixed_color?; end - def force(hash); end - def format_docstrings(&block); end - def format_docstrings_block; end - def formatter=(formatter, output = nil); end - def formatter_loader; end - def formatters; end - def full_backtrace=(true_or_false); end - def full_backtrace?; end - def full_cause_backtrace; end - def full_cause_backtrace=(arg0); end - def full_cause_backtrace?; end - def full_description; end - def full_description=(description); end - def gather_directories(path); end - def get_files_to_run(paths); end - def get_matching_files(path, pattern); end - def handle_suite_hook(scope, meta); end - def hooks; end - def in_project_source_dir_regex; end - def include(mod, *filters); end - def include_context(shared_group_name, *filters); end - def inclusion_filter; end - def inclusion_filter=(filter); end - def initialize; end - def last_run_statuses; end - def libs; end - def libs=(libs); end - def load_file_handling_errors(method, file); end - def load_spec_files; end - def loaded_spec_files; end - def max_displayed_failure_line_count; end - def max_displayed_failure_line_count=(arg0); end - def max_displayed_failure_line_count?; end - def metadata_applies_to_group?(meta, group); end - def mock_framework; end - def mock_framework=(framework); end - def mock_with(framework); end - def on_example_group_definition(&block); end - def on_example_group_definition_callbacks; end - def on_existing_matching_groups(meta); end - def only_failures; end - def only_failures?; end - def only_failures_but_not_configured?; end - def order=(*args, &block); end - def ordering_manager; end - def ordering_registry(*args, &block); end - def output_stream; end - def output_stream=(value); end - def output_to_tty?(output = nil); end - def output_wrapper; end - def paths_to_check(paths); end - def pattern; end - def pattern=(value); end - def pattern_might_load_specs_from_vendored_dirs?; end - def pending_color; end - def pending_color=(arg0); end - def pending_color?; end - def pending_failure_output; end - def pending_failure_output=(mode); end - def pending_failure_output?; end - def prepend(mod, *filters); end - def prepend_after(scope = nil, *meta, &block); end - def prepend_before(scope = nil, *meta, &block); end - def profile_examples; end - def profile_examples=(arg0); end - def profile_examples?; end - def project_source_dirs; end - def project_source_dirs=(arg0); end - def project_source_dirs?; end - def raise_errors_for_deprecations!; end - def raise_on_warning=(value); end - def register_ordering(*args, &block); end - def reporter; end - def requires; end - def requires=(paths); end - def reset; end - def reset_filters; end - def reset_reporter; end - def rspec_expectations_loaded?; end - def rspec_mocks_loaded?; end - def run_all_when_everything_filtered; end - def run_all_when_everything_filtered=(arg0); end - def run_all_when_everything_filtered?; end - def run_suite_hooks(hook_description, hooks); end - def safe_extend(mod, host); end - def safe_include(mod, host); end - def safe_prepend(mod, host); end - def seed(*args, &block); end - def seed=(*args, &block); end - def seed_used?(*args, &block); end - def self.add_read_only_setting(name, opts = nil); end - def self.add_setting(name, opts = nil); end - def self.define_alias(name, alias_name); end - def self.define_predicate(name); end - def self.define_reader(name); end - def self.delegate_to_ordering_manager(*methods); end - def shared_context_metadata_behavior; end - def shared_context_metadata_behavior=(value); end - def silence_filter_announcements; end - def silence_filter_announcements=(arg0); end - def silence_filter_announcements?; end - def spec_files_with_failures; end - def start_time; end - def start_time=(arg0); end - def start_time?; end - def static_config_filter_manager; end - def static_config_filter_manager=(arg0); end - def success_color; end - def success_color=(arg0); end - def success_color?; end - def threadsafe; end - def threadsafe=(arg0); end - def threadsafe?; end - def treat_symbols_as_metadata_keys_with_true_values=(_value); end - def tty; end - def tty=(arg0); end - def tty?; end - def update_pattern_attr(name, value); end - def value_for(key); end - def warnings=(value); end - def warnings?; end - def when_first_matching_example_defined(*filters); end - def with_suite_hooks; end - def world; end - def world=(arg0); end - include RSpec::Core::Configuration::Readers - include RSpec::Core::Hooks -end -module RSpec::Core::Configuration::Readers - def default_color; end - def default_path; end - def deprecation_stream; end - def detail_color; end - def drb; end - def drb_port; end - def dry_run; end - def error_exit_code; end - def error_stream; end - def example_status_persistence_file_path; end - def exclude_pattern; end - def fail_fast; end - def fail_if_no_examples; end - def failure_color; end - def failure_exit_code; end - def fixed_color; end - def full_cause_backtrace; end - def libs; end - def max_displayed_failure_line_count; end - def only_failures; end - def output_stream; end - def pattern; end - def pending_color; end - def pending_failure_output; end - def project_source_dirs; end - def requires; end - def run_all_when_everything_filtered; end - def shared_context_metadata_behavior; end - def silence_filter_announcements; end - def start_time; end - def success_color; end - def threadsafe; end - def tty; end -end -class RSpec::Core::Configuration::MustBeConfiguredBeforeExampleGroupsError < StandardError -end -class RSpec::Core::Configuration::DeprecationReporterBuffer - def deprecation(*args); end - def initialize; end - def play_onto(reporter); end -end -module RSpec::Core::Configuration::ExposeCurrentExample -end -class RSpec::Core::Parser - def add_tag_filter(options, filter_type, tag_name, value = nil); end - def configure_only_failures(options); end - def initialize(original_args); end - def original_args; end - def parse(source = nil); end - def parser(options); end - def self.parse(args, source = nil); end - def set_fail_fast(options, value); end -end -class RSpec::Core::ConfigurationOptions - def args; end - def args_from_options_file(path); end - def command_line_options; end - def configure(config); end - def configure_filter_manager(filter_manager); end - def custom_options; end - def custom_options_file; end - def env_options; end - def file_options; end - def force?(key); end - def global_options; end - def global_options_file; end - def home_options_file_path; end - def initialize(args); end - def load_formatters_into(config); end - def local_options; end - def local_options_file; end - def options; end - def options_file_as_erb_string(path); end - def options_from(path); end - def order(keys); end - def organize_options; end - def parse_args_ignoring_files_or_dirs_to_run(args, source); end - def process_options_into(config); end - def project_options; end - def project_options_file; end - def resolve_xdg_config_home; end - def xdg_options_file_if_exists; end - def xdg_options_file_path; end -end -class RSpec::Core::Runner - def configuration; end - def configure(err, out); end - def exit_code(examples_passed = nil); end - def initialize(options, configuration = nil, world = nil); end - def options; end - def persist_example_statuses; end - def run(err, out); end - def run_specs(example_groups); end - def self.autorun; end - def self.autorun_disabled?; end - def self.disable_autorun!; end - def self.handle_interrupt; end - def self.installed_at_exit?; end - def self.invoke; end - def self.perform_at_exit; end - def self.run(args, err = nil, out = nil); end - def self.running_in_drb?; end - def self.trap_interrupt; end - def setup(err, out); end - def world; end -end -module RSpec::Core::Invocations -end -class RSpec::Core::Invocations::InitializeProject - def call(*_args); end -end -class RSpec::Core::Invocations::DRbWithFallback - def call(options, err, out); end -end -class RSpec::Core::Invocations::Bisect - def bisect_formatter_klass_for(argument); end - def call(options, err, out); end -end -class RSpec::Core::Invocations::PrintVersion - def call(_options, _err, out); end -end -class RSpec::Core::Invocations::PrintHelp < Struct - def call(_options, _err, out); end - def hidden_options; end - def hidden_options=(_); end - def parser; end - def parser=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class RSpec::Core::Example - def assign_generated_description; end - def clock; end - def clock=(arg0); end - def description; end - def display_exception; end - def display_exception=(ex); end - def duplicate_with(metadata_overrides = nil); end - def example_group; end - def example_group_instance; end - def exception; end - def execution_result; end - def fail_with_exception(reporter, exception); end - def file_path; end - def finish(reporter); end - def full_description; end - def generate_description; end - def hooks; end - def id; end - def initialize(example_group_class, description, user_metadata, example_block = nil); end - def inspect; end - def inspect_output; end - def instance_exec(*args, &block); end - def location; end - def location_description; end - def location_rerun_argument; end - def metadata; end - def mocks_need_verification?; end - def pending; end - def pending?; end - def record_finished(status, reporter); end - def reporter; end - def rerun_argument; end - def run(example_group_instance, reporter); end - def run_after_example; end - def run_before_example; end - def self.delegate_to_metadata(key); end - def self.parse_id(id); end - def set_aggregate_failures_exception(exception); end - def set_exception(exception); end - def skip; end - def skip_with_exception(reporter, exception); end - def skipped?; end - def start(reporter); end - def to_s; end - def update_inherited_metadata(updates); end - def verify_mocks; end - def with_around_and_singleton_context_hooks; end - def with_around_example_hooks; end -end -class RSpec::Core::Example::Procsy - def <<(*a, &b); end - def ==(*a, &b); end - def ===(*a, &b); end - def >>(*a, &b); end - def [](*a, &b); end - def arity(*a, &b); end - def binding(*a, &b); end - def call(*args, &block); end - def clock(*a, &b); end - def clock=(*a, &b); end - def clone(*a, &b); end - def curry(*a, &b); end - def description(*a, &b); end - def dup(*a, &b); end - def duplicate_with(*a, &b); end - def eql?(*a, &b); end - def example; end - def example_group(*a, &b); end - def example_group_instance(*a, &b); end - def exception(*a, &b); end - def executed?; end - def execution_result(*a, &b); end - def file_path(*a, &b); end - def full_description(*a, &b); end - def hash(*a, &b); end - def id(*a, &b); end - def initialize(example, &block); end - def inspect; end - def inspect_output(*a, &b); end - def lambda?(*a, &b); end - def location(*a, &b); end - def location_rerun_argument(*a, &b); end - def metadata(*a, &b); end - def parameters(*a, &b); end - def pending(*a, &b); end - def pending?(*a, &b); end - def reporter(*a, &b); end - def rerun_argument(*a, &b); end - def ruby2_keywords(*a, &b); end - def run(*args, &block); end - def skip(*a, &b); end - def skipped?(*a, &b); end - def source_location(*a, &b); end - def to_proc; end - def update_inherited_metadata(*a, &b); end - def wrap(&block); end - def yield(*a, &b); end -end -class RSpec::Core::Example::ExecutionResult - def calculate_run_time(finished_at); end - def ensure_timing_set(clock); end - def example_skipped?; end - def exception; end - def exception=(arg0); end - def finished_at; end - def finished_at=(arg0); end - def get_value(name); end - def hash_for_delegation; end - def issue_deprecation(_method_name, *_args); end - def pending_exception; end - def pending_exception=(arg0); end - def pending_fixed; end - def pending_fixed=(arg0); end - def pending_fixed?; end - def pending_message; end - def pending_message=(arg0); end - def record_finished(status, finished_at); end - def run_time; end - def run_time=(arg0); end - def set_value(name, value); end - def started_at; end - def started_at=(arg0); end - def status; end - def status=(arg0); end - extend RSpec::Core::HashImitatable::ClassMethods - include RSpec::Core::HashImitatable -end -class RSpec::Core::SuiteHookContext < RSpec::Core::Example - def initialize(hook_description, reporter); end - def set_exception(exception); end -end -class RSpec::Core::SharedExampleGroupModule < Module - def definition; end - def include_in(klass, inclusion_line, args, customization_block); end - def included(klass); end - def initialize(description, definition, metadata); end - def inspect; end - def to_s; end -end -module RSpec::Core::SharedExampleGroup - def shared_context(name, *args, &block); end - def shared_examples(name, *args, &block); end - def shared_examples_for(name, *args, &block); end -end -module RSpec::Core::SharedExampleGroup::TopLevelDSL - def self.definitions; end - def self.expose_globally!; end - def self.exposed_globally?; end - def self.remove_globally!; end -end -class RSpec::Core::SharedExampleGroup::Registry - def add(context, name, *metadata_args, &block); end - def ensure_block_has_source_location(_block); end - def find(lookup_contexts, name); end - def formatted_location(block); end - def legacy_add(context, name, *metadata_args, &block); end - def shared_example_groups; end - def valid_name?(candidate); end - def warn_if_key_taken(context, key, new_block); end -end -class RSpec::Core::ExampleGroup - def described_class; end - def initialize(inspect_output = nil); end - def inspect; end - def method_missing(name, *args, **); end - def self.add_example(example); end - def self.before_context_ivars; end - def self.children; end - def self.context(*args, &example_group_block); end - def self.currently_executing_a_context_hook?; end - def self.declaration_locations; end - def self.define_example_group_method(name, metadata = nil); end - def self.define_example_method(name, extra_options = nil); end - def self.define_nested_shared_group_method(new_name, report_label = nil); end - def self.delegate_to_metadata(*names); end - def self.descendant_filtered_examples; end - def self.descendants; end - def self.describe(*args, &example_group_block); end - def self.described_class; end - def self.description; end - def self.each_instance_variable_for_example(group); end - def self.ensure_example_groups_are_configured; end - def self.example(*all_args, &block); end - def self.example_group(*args, &example_group_block); end - def self.examples; end - def self.fcontext(*args, &example_group_block); end - def self.fdescribe(*args, &example_group_block); end - def self.fexample(*all_args, &block); end - def self.file_path; end - def self.filtered_examples; end - def self.find_and_eval_shared(label, name, inclusion_location, *args, &customization_block); end - def self.fit(*all_args, &block); end - def self.focus(*all_args, &block); end - def self.for_filtered_examples(reporter, &block); end - def self.fspecify(*all_args, &block); end - def self.id; end - def self.idempotently_define_singleton_method(name, &definition); end - def self.include_context(name, *args, &block); end - def self.include_examples(name, *args, &block); end - def self.it(*all_args, &block); end - def self.it_behaves_like(name, *args, &customization_block); end - def self.it_should_behave_like(name, *args, &customization_block); end - def self.location; end - def self.metadata; end - def self.method_missing(name, *args); end - def self.next_runnable_index_for(file); end - def self.ordering_strategy; end - def self.parent_groups; end - def self.pending(*all_args, &block); end - def self.remove_example(example); end - def self.reset_memoized; end - def self.run(reporter = nil); end - def self.run_after_context_hooks(example_group_instance); end - def self.run_before_context_hooks(example_group_instance); end - def self.run_examples(reporter); end - def self.set_it_up(description, args, registration_collection, &example_group_block); end - def self.set_ivars(instance, ivars); end - def self.skip(*all_args, &block); end - def self.specify(*all_args, &block); end - def self.store_before_context_ivars(example_group_instance); end - def self.subclass(parent, description, args, registration_collection, &example_group_block); end - def self.superclass_before_context_ivars; end - def self.superclass_metadata; end - def self.top_level?; end - def self.top_level_description; end - def self.traverse_tree_until(&block); end - def self.update_inherited_metadata(updates); end - def self.with_replaced_metadata(meta); end - def self.xcontext(*args, &example_group_block); end - def self.xdescribe(*args, &example_group_block); end - def self.xexample(*all_args, &block); end - def self.xit(*all_args, &block); end - def self.xspecify(*all_args, &block); end - extend RSpec::Core::Hooks - extend RSpec::Core::MemoizedHelpers::ClassMethods - extend RSpec::Core::SharedExampleGroup - include RSpec::Core::MemoizedHelpers - include RSpec::Core::Pending -end -class RSpec::Core::ExampleGroup::WrongScopeError < NoMethodError -end -class RSpec::Core::AnonymousExampleGroup < RSpec::Core::ExampleGroup - def self.metadata; end -end -class RSpec::Core::SharedExampleGroupInclusionStackFrame - def description; end - def formatted_inclusion_location; end - def inclusion_location; end - def initialize(shared_group_name, inclusion_location); end - def self.current_backtrace; end - def self.shared_example_group_inclusions; end - def self.with_frame(name, location); end - def shared_group_name; end -end -module RSpec::ExampleGroups - def self.assign_const(group); end - def self.base_name_for(group); end - def self.constant_scope_for(group); end - def self.disambiguate(name, const_scope); end - def self.remove_all_constants; end - extend RSpec::Support::RecursiveConstMethods -end -module RSpec::Support - def self.require_rspec_core(f); end -end -class RSpec::Core::Time - def self.now(in: nil); end -end -class Module - def context(*a, &b); end - def describe(*a, &b); end - def example_group(*a, &b); end - def fcontext(*a, &b); end - def fdescribe(*a, &b); end - def shared_context(name, *args, &block); end - def shared_examples(name, *args, &block); end - def shared_examples_for(name, *args, &block); end - def xcontext(*a, &b); end - def xdescribe(*a, &b); end -end -module RSpec::Core::SharedContext - def __shared_context_recordings; end - def after(*args, &block); end - def append_after(*args, &block); end - def append_before(*args, &block); end - def around(*args, &block); end - def before(*args, &block); end - def context(*args, &block); end - def describe(*args, &block); end - def hooks(*args, &block); end - def included(group); end - def let!(*args, &block); end - def let(*args, &block); end - def prepend_after(*args, &block); end - def prepend_before(*args, &block); end - def self.record(methods); end - def subject!(*args, &block); end - def subject(*args, &block); end -end -class RSpec::Core::SharedContext::Recording < Struct - def args; end - def args=(_); end - def block; end - def block=(_); end - def method_name; end - def method_name=(_); end - def playback_onto(group); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class RSpec::Core::ExampleStatusPersister - def dump_statuses(unparsed_previous_runs); end - def initialize(examples, file_name); end - def persist; end - def self.load_from(file_name); end - def self.persist(examples, file_name); end - def statuses_from_this_run; end -end -class RSpec::Core::ExampleStatusMerger - def delete_previous_examples_that_no_longer_exist; end - def example_must_no_longer_exist?(ex_id); end - def hash_from(example_list); end - def initialize(this_run, from_previous_runs); end - def loaded_spec_files; end - def merge; end - def self.merge(this_run, from_previous_runs); end - def sort_value_from(example); end - def spec_file_from(ex_id); end -end -class RSpec::Core::ExampleStatusDumper - def column_widths; end - def dump; end - def formatted_header_rows; end - def formatted_row_from(row_values); end - def formatted_value_rows; end - def headers; end - def initialize(examples); end - def rows; end - def self.dump(examples); end -end -class RSpec::Core::ExampleStatusParser - def headers; end - def initialize(string); end - def parse; end - def parse_row(line); end - def self.parse(string); end - def split_line(line); end -end -class RSpec::Core::Profiler - def example_group_finished(notification); end - def example_group_started(notification); end - def example_groups; end - def example_started(notification); end - def initialize; end -end -class RSpec::Core::DidYouMean - def call; end - def formats(probables); end - def initialize(relative_file_name); end - def red_font(mytext); end - def relative_file_name; end - def top_and_tail(rspec_format); end -end -class RSpec::Core::Formatters::BaseFormatter - def close(_notification); end - def example_group; end - def example_group=(arg0); end - def example_group_started(notification); end - def initialize(output); end - def output; end - def output_supports_sync; end - def restore_sync_output; end - def start(notification); end - def start_sync_output; end -end -class RSpec::Core::Formatters::BaseTextFormatter < RSpec::Core::Formatters::BaseFormatter - def close(_notification); end - def dump_failures(notification); end - def dump_pending(notification); end - def dump_summary(summary); end - def message(notification); end - def seed(notification); end -end -class RSpec::Core::Formatters::DocumentationFormatter < RSpec::Core::Formatters::BaseTextFormatter - def current_indentation(offset = nil); end - def example_failed(failure); end - def example_group_finished(_notification); end - def example_group_started(notification); end - def example_passed(passed); end - def example_pending(pending); end - def example_started(_notification); end - def failure_output(example); end - def flush_messages; end - def initialize(output); end - def message(notification); end - def next_failure_index; end - def passed_output(example); end - def pending_output(example, message); end -end -class RSpec::Core::Formatters::HtmlPrinter - def flush; end - def indentation_style(number_of_parents); end - def initialize(output); end - def make_example_group_header_red(group_id); end - def make_example_group_header_yellow(group_id); end - def make_header_red; end - def make_header_yellow; end - def move_progress(percent_done); end - def print_example_failed(pending_fixed, description, run_time, failure_id, exception, extra_content); end - def print_example_group_end; end - def print_example_group_start(group_id, description, number_of_parents); end - def print_example_passed(description, run_time); end - def print_example_pending(description, pending_message); end - def print_html_start; end - def print_summary(duration, example_count, failure_count, pending_count); end - include ERB::Util -end -class RSpec::Core::Formatters::HtmlFormatter < RSpec::Core::Formatters::BaseFormatter - def dump_summary(summary); end - def example_failed(failure); end - def example_group_number; end - def example_group_started(notification); end - def example_number; end - def example_passed(passed); end - def example_pending(pending); end - def example_started(_notification); end - def extra_failure_content(failure); end - def initialize(output); end - def percent_done; end - def start(notification); end - def start_dump(_notification); end -end -class RSpec::Core::Formatters::FallbackMessageFormatter - def initialize(output); end - def message(notification); end - def output; end -end -class RSpec::Core::Formatters::ProgressFormatter < RSpec::Core::Formatters::BaseTextFormatter - def example_failed(_notification); end - def example_passed(_notification); end - def example_pending(_notification); end - def start_dump(_notification); end -end -class RSpec::Core::Formatters::ProfileFormatter - def bold(text); end - def dump_profile(profile); end - def dump_profile_slowest_example_groups(profile); end - def dump_profile_slowest_examples(profile); end - def format_caller(caller_info); end - def initialize(output); end - def output; end -end -class RSpec::Core::Formatters::JsonFormatter < RSpec::Core::Formatters::BaseFormatter - def close(_notification); end - def dump_profile(profile); end - def dump_profile_slowest_example_groups(profile); end - def dump_profile_slowest_examples(profile); end - def dump_summary(summary); end - def format_example(example); end - def initialize(output); end - def message(notification); end - def output_hash; end - def seed(notification); end - def stop(group_notification); end -end -module RSpec::Core::Bisect -end -class RSpec::Core::Bisect::ExampleSetDescriptor < Struct - def all_example_ids; end - def all_example_ids=(_); end - def failed_example_ids; end - def failed_example_ids=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class RSpec::Core::Bisect::BisectFailedError < StandardError - def self.for_failed_spec_run(spec_output); end -end -class RSpec::Core::Bisect::Notifier - def initialize(formatter); end - def publish(event, *args); end -end -class RSpec::Core::Bisect::Channel - def close; end - def initialize; end - def receive; end - def send(message); end -end -class RSpec::Core::Formatters::BaseBisectFormatter - def example_failed(notification); end - def example_finished(notification); end - def initialize(expected_failures); end - def self.inherited(formatter); end - def start_dump(_notification); end -end -class RSpec::Core::Formatters::BisectDRbFormatter < RSpec::Core::Formatters::BaseBisectFormatter - def initialize(_output); end - def notify_results(results); end -end -class RSpec::Core::Formatters::FailureListFormatter < RSpec::Core::Formatters::BaseFormatter - def dump_profile(_profile); end - def example_failed(failure); end - def message(_message); end -end -module RSpec::Core::MockingAdapters -end -module RSpec::Core::MockingAdapters::RSpec - def self.configuration; end - def self.framework_name; end - def setup_mocks_for_rspec; end - def teardown_mocks_for_rspec; end - def verify_mocks_for_rspec; end - include RSpec::Mocks::ExampleMethods - include RSpec::Mocks::ExampleMethods::ExpectHost -end diff --git a/sorbet/rbi/gems/rspec-core@3.13.0.rbi b/sorbet/rbi/gems/rspec-core@3.13.0.rbi index 69f9e69..84b736d 100644 --- a/sorbet/rbi/gems/rspec-core@3.13.0.rbi +++ b/sorbet/rbi/gems/rspec-core@3.13.0.rbi @@ -5732,6 +5732,8 @@ end class RSpec::Core::Formatters::HtmlPrinter include ::ERB::Escape include ::ERB::Util + include ::ActiveSupport::CoreExt::ERBUtil + include ::ActiveSupport::CoreExt::ERBUtilPrivate # @return [HtmlPrinter] a new instance of HtmlPrinter # @@ -6644,11 +6646,11 @@ module RSpec::Core::Hooks # invoked but before any `after` context hooks. # # @api public - # @note The `:example` and `:context` scopes are also available as - # `:each` and `:all`, respectively. Use whichever you prefer. # @note The `:suite` scope is only supported for hooks registered on # `RSpec.configuration` since they exist independently of any # example or example group. + # @note The `:example` and `:context` scopes are also available as + # `:each` and `:all`, respectively. Use whichever you prefer. # @overload after # @overload after # @overload after @@ -6873,6 +6875,7 @@ module RSpec::Core::Hooks # They are not a synonym for `before`/`after`. # # @api public + # @note `:example`/`:each` is the only supported scope. # @note the syntax of `around` is similar to that of `before` and `after` # but the semantics are quite different. `before` and `after` hooks are # run in the context of the examples with which they are associated, @@ -6880,7 +6883,6 @@ module RSpec::Core::Hooks # examples. Consequently, `around` hooks do not have direct access to # resources that are made available within the examples and their # associated `before` and `after` hooks. - # @note `:example`/`:each` is the only supported scope. # @overload around # @overload around # @overload around @@ -7106,11 +7108,11 @@ module RSpec::Core::Hooks # invoked but before any `after` context hooks. # # @api public - # @note The `:example` and `:context` scopes are also available as - # `:each` and `:all`, respectively. Use whichever you prefer. # @note The `:suite` scope is only supported for hooks registered on # `RSpec.configuration` since they exist independently of any # example or example group. + # @note The `:example` and `:context` scopes are also available as + # `:each` and `:all`, respectively. Use whichever you prefer. # @overload after # @overload after # @overload after diff --git a/sorbet/rbi/gems/rspec-expectations.rbi b/sorbet/rbi/gems/rspec-expectations.rbi deleted file mode 100644 index 48f6a4e..0000000 --- a/sorbet/rbi/gems/rspec-expectations.rbi +++ /dev/null @@ -1,1193 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: true -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/rspec-expectations/all/rspec-expectations.rbi -# -# rspec-expectations-3.13.1 - -module RSpec -end -module RSpec::Matchers - def a_block_changing(*args, **, &block); end - def a_block_outputting(*args, **, &block); end - def a_block_raising(*args, **, &block); end - def a_block_throwing(*args, **, &block); end - def a_block_yielding_control(*args, **, &block); end - def a_block_yielding_successive_args(*args, **, &block); end - def a_block_yielding_with_args(*args, **, &block); end - def a_block_yielding_with_no_args(*args, **, &block); end - def a_collection_containing_exactly(*args, **, &block); end - def a_collection_ending_with(*args, **, &block); end - def a_collection_including(*args, **, &block); end - def a_collection_starting_with(*args, **, &block); end - def a_falsey_value(*args, **, &block); end - def a_falsy_value(*args, **, &block); end - def a_hash_including(*args, **, &block); end - def a_kind_of(*args, **, &block); end - def a_nil_value(*args, **, &block); end - def a_range_covering(*args, **, &block); end - def a_string_ending_with(*args, **, &block); end - def a_string_including(*args, **, &block); end - def a_string_matching(*args, **, &block); end - def a_string_starting_with(*args, **, &block); end - def a_truthy_value(*args, **, &block); end - def a_value(*args, **, &block); end - def a_value_between(*args, **, &block); end - def a_value_within(*args, **, &block); end - def aggregate_failures(label = nil, metadata = nil, &block); end - def all(expected); end - def an_array_matching(*args, **, &block); end - def an_instance_of(*args, **, &block); end - def an_object_eq_to(*args, **, &block); end - def an_object_eql_to(*args, **, &block); end - def an_object_equal_to(*args, **, &block); end - def an_object_existing(*args, **, &block); end - def an_object_having_attributes(*args, **, &block); end - def an_object_matching(*args, **, &block); end - def an_object_responding_to(*args, **, &block); end - def an_object_satisfying(*args, **, &block); end - def be(*args); end - def be_a(klass); end - def be_a_kind_of(expected); end - def be_an(klass); end - def be_an_instance_of(expected); end - def be_between(min, max); end - def be_falsey; end - def be_falsy(*args, **, &block); end - def be_instance_of(expected); end - def be_kind_of(expected); end - def be_nil; end - def be_truthy; end - def be_within(delta); end - def change(receiver = nil, message = nil, &block); end - def changing(*args, **, &block); end - def contain_exactly(*items); end - def containing_exactly(*args, **, &block); end - def cover(*values); end - def covering(*args, **, &block); end - def end_with(*expected); end - def ending_with(*args, **, &block); end - def eq(expected); end - def eq_to(*args, **, &block); end - def eql(expected); end - def eql_to(*args, **, &block); end - def equal(expected); end - def equal_to(*args, **, &block); end - def exist(*args); end - def existing(*args, **, &block); end - def expect(value = nil, &block); end - def have_attributes(expected); end - def having_attributes(*args, **, &block); end - def include(*expected); end - def including(*args, **, &block); end - def match(expected); end - def match_array(items); end - def match_regex(*args, **, &block); end - def matching(*args, **, &block); end - def method_missing(method, *args, **, &block); end - def output(expected = nil); end - def raise_error(error = nil, message = nil, &block); end - def raise_exception(error = nil, message = nil, &block); end - def raising(*args, **, &block); end - def respond_to(*names); end - def respond_to_missing?(method, *); end - def responding_to(*args, **, &block); end - def satisfy(description = nil, &block); end - def satisfying(*args, **, &block); end - def self.alias_matcher(*args, &block); end - def self.clear_generated_description; end - def self.configuration; end - def self.generated_description; end - def self.is_a_describable_matcher?(obj); end - def self.is_a_matcher?(obj); end - def self.last_description; end - def self.last_expectation_handler; end - def self.last_expectation_handler=(arg0); end - def self.last_matcher; end - def self.last_matcher=(arg0); end - def start_with(*expected); end - def starting_with(*args, **, &block); end - def throw_symbol(expected_symbol = nil, expected_arg = nil); end - def throwing(*args, **, &block); end - def within(*args, **, &block); end - def yield_control; end - def yield_successive_args(*args); end - def yield_with_args(*args); end - def yield_with_no_args; end - def yielding_control(*args, **, &block); end - def yielding_successive_args(*args, **, &block); end - def yielding_with_args(*args, **, &block); end - def yielding_with_no_args(*args, **, &block); end - extend RSpec::Matchers::DSL -end -module RSpec::Matchers::EnglishPhrasing - def self.list(obj); end - def self.split_words(sym); end -end -module RSpec::Matchers::Composable - def &(matcher); end - def ===(value); end - def and(matcher); end - def description_of(object); end - def or(matcher); end - def self.should_enumerate?(item); end - def self.surface_descriptions_in(item); end - def self.unreadable_io?(object); end - def should_enumerate?(item); end - def surface_descriptions_in(item); end - def unreadable_io?(object); end - def values_match?(expected, actual); end - def with_matchers_cloned(object); end - def |(matcher); end -end -class RSpec::Matchers::Composable::DescribableItem < Struct - def inspect; end - def item; end - def item=(_); end - def pretty_print(pp); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -module RSpec::Matchers::BuiltIn -end -class RSpec::Matchers::BuiltIn::BaseMatcher - def actual; end - def actual_formatted; end - def assert_ivars(*expected_ivars); end - def description; end - def diffable?; end - def expected; end - def expected_formatted; end - def expects_call_stack_jump?; end - def initialize(expected = nil); end - def match_unless_raises(*exceptions); end - def matcher_name; end - def matcher_name=(arg0); end - def matches?(actual); end - def present_ivars; end - def rescued_exception; end - def self.matcher_name; end - def self.underscore(camel_cased_word); end - def supports_block_expectations?; end - def supports_value_expectations?; end - include RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages - include RSpec::Matchers::BuiltIn::BaseMatcher::HashFormatting - include RSpec::Matchers::BuiltIn::BaseMatcher::StringEncodingFormatting - include RSpec::Matchers::Composable -end -module RSpec::Matchers::BuiltIn::BaseMatcher::HashFormatting - def improve_hash_formatting(inspect_string); end - def self.improve_hash_formatting(inspect_string); end -end -module RSpec::Matchers::BuiltIn::BaseMatcher::StringEncodingFormatting - def format_encoding(value); end - def self.format_encoding(value); end - def self.string_encoding_differs?; end - def string_encoding_differs?; end -end -module RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages - def failure_message; end - def failure_message_when_negated; end - def self.has_default_failure_messages?(matcher); end -end -module RSpec::Matchers::DSL - def alias_matcher(new_name, old_name, options = nil, &description_override); end - def define(name, &declarations); end - def define_negated_matcher(negated_name, base_name, &description_override); end - def matcher(name, &declarations); end - def warn_about_block_args(name, declarations); end -end -module RSpec::Matchers::DSL::Macros - def assign_attributes(attr_names); end - def chain(method_name, *attr_names, &definition); end - def define_user_override(method_name, user_def, &our_def); end - def description(&definition); end - def diffable; end - def failure_message(&definition); end - def failure_message_when_negated(&definition); end - def match(options = nil, &match_block); end - def match_unless_raises(expected_exception = nil, &match_block); end - def match_when_negated(options = nil, &match_block); end - def supports_block_expectations; end -end -module RSpec::Matchers::DSL::Macros::Deprecated - def failure_message_for_should(&definition); end - def failure_message_for_should_not(&definition); end - def match_for_should(&definition); end - def match_for_should_not(&definition); end -end -module RSpec::Matchers::DSL::DefaultImplementations - def chained_method_clause_sentences; end - def description; end - def diffable?; end - def expects_call_stack_jump?; end - def supports_block_expectations?; end - def supports_value_expectations?; end - include RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages -end -class RSpec::Matchers::DSL::Matcher - def actual; end - def actual_arg_for(block); end - def block_arg; end - def expected; end - def expected_as_array; end - def initialize(name, declarations, matcher_execution_context, *expected, &block_arg); end - def inspect; end - def method_missing(method, *args, **, &block); end - def name; end - def rescued_exception; end - def respond_to_missing?(method, include_private = nil); end - extend RSpec::Matchers::DSL::Macros - extend RSpec::Matchers::DSL::Macros::Deprecated - include RSpec::Matchers - include RSpec::Matchers::Composable - include RSpec::Matchers::DSL::DefaultImplementations -end -class RSpec::Matchers::BaseDelegator -end -class RSpec::Matchers::MatcherDelegator < RSpec::Matchers::BaseDelegator - def base_matcher; end - def initialize(base_matcher); end - def initialize_copy(other); end - def method_missing(*args, &block); end - def respond_to_missing?(name, include_all = nil); end - include RSpec::Matchers::Composable -end -class RSpec::Matchers::AliasedMatcher < RSpec::Matchers::MatcherDelegator - def description; end - def failure_message; end - def failure_message_when_negated; end - def initialize(base_matcher, description_block); end - def method_missing(*); end -end -class RSpec::Matchers::AliasedMatcherWithOperatorSupport < RSpec::Matchers::AliasedMatcher -end -class RSpec::Matchers::AliasedNegatedMatcher < RSpec::Matchers::AliasedMatcher - def does_not_match?(*args, &block); end - def failure_message; end - def failure_message_when_negated; end - def matches?(*args, &block); end - def optimal_failure_message(same, inverted); end -end -class RSpec::Matchers::MultiMatcherDiff - def diffs(differ); end - def initialize(expected_list); end - def message_with_diff(message, differ); end - def self.diff_label_for(matcher); end - def self.for_many_matchers(matchers); end - def self.from(expected, actual); end - def self.truncated(description); end -end -module RSpec::Support - def self.require_rspec_expectations(f); end - def self.require_rspec_matchers(f); end -end -module RSpec::Expectations - def self.configuration; end - def self.differ; end - def self.fail_with(message, expected = nil, actual = nil); end -end -class RSpec::Expectations::ExpectationTarget - def initialize(value); end - def self.for(value, block); end - def target; end - include RSpec::Expectations::ExpectationTarget::InstanceMethods -end -module RSpec::Expectations::ExpectationTarget::UndefinedValue -end -module RSpec::Expectations::ExpectationTarget::InstanceMethods - def not_to(matcher = nil, message = nil, &block); end - def prevent_operator_matchers(verb); end - def to(matcher = nil, message = nil, &block); end - def to_not(matcher = nil, message = nil, &block); end -end -class RSpec::Expectations::ValueExpectationTarget < RSpec::Expectations::ExpectationTarget - def enforce_value_expectation(matcher); end - def not_to(matcher = nil, message = nil, &block); end - def supports_value_expectations?(matcher); end - def to(matcher = nil, message = nil, &block); end -end -class RSpec::Expectations::BlockExpectationTarget < RSpec::Expectations::ExpectationTarget - def enforce_block_expectation(matcher); end - def not_to(matcher, message = nil, &block); end - def supports_block_expectations?(matcher); end - def to(matcher, message = nil, &block); end - def to_not(matcher, message = nil, &block); end -end -module RSpec::Expectations::Syntax - def default_should_host; end - def disable_expect(syntax_host = nil); end - def disable_should(syntax_host = nil); end - def enable_expect(syntax_host = nil); end - def enable_should(syntax_host = nil); end - def expect_enabled?(syntax_host = nil); end - def self.default_should_host; end - def self.disable_expect(syntax_host = nil); end - def self.disable_should(syntax_host = nil); end - def self.enable_expect(syntax_host = nil); end - def self.enable_should(syntax_host = nil); end - def self.expect_enabled?(syntax_host = nil); end - def self.should_enabled?(syntax_host = nil); end - def self.warn_about_should!; end - def self.warn_about_should_unless_configured(method_name); end - def should_enabled?(syntax_host = nil); end - def warn_about_should!; end - def warn_about_should_unless_configured(method_name); end -end -class BasicObject - def should(matcher = nil, message = nil, &block); end - def should_not(matcher = nil, message = nil, &block); end -end -class RSpec::Expectations::Configuration - def add_should_and_should_not_to(*modules); end - def backtrace_formatter; end - def backtrace_formatter=(arg0); end - def color?; end - def false_positives_handler; end - def include_chain_clauses_in_custom_matcher_descriptions=(arg0); end - def include_chain_clauses_in_custom_matcher_descriptions?; end - def initialize; end - def max_formatted_output_length=(length); end - def on_potential_false_positives; end - def on_potential_false_positives=(behavior); end - def reset_syntaxes_to_default; end - def strict_predicate_matchers; end - def strict_predicate_matchers=(flag); end - def strict_predicate_matchers?; end - def syntax; end - def syntax=(values); end - def warn_about_potential_false_positives=(boolean); end - def warn_about_potential_false_positives?; end -end -module RSpec::Expectations::Configuration::NullBacktraceFormatter - def self.format_backtrace(backtrace); end -end -class InvalidName___Class_0x00___Differ_1 -end -module RSpec::Expectations::ExpectationHelper - def self.check_message(msg); end - def self.handle_failure(matcher, message, failure_message_method); end - def self.modern_matcher_from(matcher); end - def self.with_matcher(handler, matcher, message); end -end -class RSpec::Expectations::PositiveExpectationHandler - def self.handle_matcher(actual, initial_matcher, custom_message = nil, &block); end - def self.opposite_should_method; end - def self.should_method; end - def self.verb; end -end -class RSpec::Expectations::NegativeExpectationHandler - def self.does_not_match?(matcher, actual, &block); end - def self.handle_matcher(actual, initial_matcher, custom_message = nil, &block); end - def self.opposite_should_method; end - def self.should_method; end - def self.verb; end -end -class RSpec::Expectations::LegacyMatcherAdapter < RSpec::Matchers::MatcherDelegator - def initialize(matcher); end - def self.wrap(matcher); end -end -class RSpec::Expectations::LegacyMatcherAdapter::RSpec2 < RSpec::Expectations::LegacyMatcherAdapter - def failure_message; end - def failure_message_when_negated; end - def self.interface_matches?(matcher); end -end -class RSpec::Expectations::LegacyMatcherAdapter::RSpec1 < RSpec::Expectations::LegacyMatcherAdapter - def failure_message; end - def failure_message_when_negated; end - def self.interface_matches?(matcher); end -end -module RSpec::Expectations::Version -end -class RSpec::Expectations::ExpectationNotMetError < Exception -end -class RSpec::Expectations::MultipleExpectationsNotMetError < RSpec::Expectations::ExpectationNotMetError - def aggregation_block_label; end - def aggregation_metadata; end - def all_exceptions; end - def backtrace_line(line); end - def block_description; end - def enumerated(exceptions, index_offset); end - def enumerated_errors; end - def enumerated_failures; end - def exception_count_description; end - def exclusion_patterns; end - def failures; end - def format_backtrace(backtrace); end - def indentation; end - def indented(failure_message, index); end - def index_label(index); end - def initialize(failure_aggregator); end - def longest_index_label_width; end - def message; end - def other_errors; end - def pluralize(noun, count); end - def summary; end - def width_of_label(index); end -end -class RSpec::Expectations::BlockSnippetExtractor - def beginning_line_number; end - def block_token_extractor; end - def body_content_lines; end - def file_path; end - def initialize(proc, method_name); end - def method_name; end - def proc; end - def raw_body_lines; end - def raw_body_snippet; end - def self.try_extracting_single_line_body_of(proc, method_name); end - def source; end - def source_location; end -end -class RSpec::Expectations::BlockSnippetExtractor::Error < StandardError -end -class RSpec::Expectations::BlockSnippetExtractor::TargetNotFoundError < RSpec::Expectations::BlockSnippetExtractor::Error -end -class RSpec::Expectations::BlockSnippetExtractor::AmbiguousTargetError < RSpec::Expectations::BlockSnippetExtractor::Error -end -class RSpec::Expectations::BlockSnippetExtractor::BlockTokenExtractor < Struct - def after_beginning_of_args_state(token); end - def after_beginning_of_body_state(token); end - def after_method_call_state(token); end - def after_opener_state(token); end - def beginning_line_number; end - def beginning_line_number=(_); end - def block_locator; end - def body_tokens; end - def correct_block?(body_tokens); end - def finalize_pending_tokens!; end - def finish!; end - def finish_or_find_next_block_if_incorrect!; end - def handle_closer_token(token); end - def handle_opener_token(token); end - def initial_state(token); end - def initialize(*); end - def invoke_state_handler(token); end - def method_name; end - def method_name=(_); end - def opener_token?(token); end - def opener_token_stack; end - def parse!; end - def pending_tokens; end - def pipe_token?(token); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end - def source; end - def source=(_); end - def state; end -end -class RSpec::Expectations::BlockSnippetExtractor::BlockLocator < Struct - def beginning_line_number; end - def beginning_line_number=(_); end - def block_body_node; end - def block_wrapper_node; end - def body_content_locations; end - def candidate_block_wrapper_nodes; end - def candidate_method_ident_nodes; end - def method_call_location; end - def method_ident_node; end - def method_ident_node?(node); end - def method_name; end - def method_name=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end - def source; end - def source=(_); end -end -class RSpec::Expectations::FailureAggregator - def aggregate; end - def assign_backtrace(failure); end - def block_label; end - def call(failure, options); end - def failures; end - def initialize(block_label, metadata); end - def metadata; end - def notify_aggregated_failures; end - def other_errors; end -end -class RSpec::Expectations::FailureAggregator::AggregatedFailure - def inspect; end -end -class RSpec::Matchers::BuiltIn::BeAKindOf < RSpec::Matchers::BuiltIn::BaseMatcher - def match(expected, actual); end -end -class RSpec::Matchers::BuiltIn::BeAnInstanceOf < RSpec::Matchers::BuiltIn::BaseMatcher - def description; end - def match(expected, actual); end -end -class RSpec::Matchers::BuiltIn::BeBetween < RSpec::Matchers::BuiltIn::BaseMatcher - def comparable?; end - def compare; end - def description; end - def exclusive; end - def failure_message; end - def inclusive; end - def initialize(min, max); end - def matches?(actual); end - def not_comparable_clause; end -end -class RSpec::Matchers::BuiltIn::BeTruthy < RSpec::Matchers::BuiltIn::BaseMatcher - def failure_message; end - def failure_message_when_negated; end - def match(_, actual); end -end -class RSpec::Matchers::BuiltIn::BeFalsey < RSpec::Matchers::BuiltIn::BaseMatcher - def failure_message; end - def failure_message_when_negated; end - def match(_, actual); end -end -class RSpec::Matchers::BuiltIn::BeNil < RSpec::Matchers::BuiltIn::BaseMatcher - def failure_message; end - def failure_message_when_negated; end - def match(_, actual); end -end -module RSpec::Matchers::BuiltIn::BeHelpers - def args_to_s; end - def args_to_sentence; end - def expected_to_sentence; end - def inspected_args; end - def parenthesize(string); end -end -class RSpec::Matchers::BuiltIn::Be < RSpec::Matchers::BuiltIn::BaseMatcher - def <(operand); end - def <=(operand); end - def ==(operand); end - def ===(operand); end - def =~(operand); end - def >(operand); end - def >=(operand); end - def failure_message; end - def failure_message_when_negated; end - def initialize(*args); end - def match(_, actual); end - include RSpec::Matchers::BuiltIn::BeHelpers -end -class RSpec::Matchers::BuiltIn::BeComparedTo < RSpec::Matchers::BuiltIn::BaseMatcher - def description; end - def does_not_match?(actual); end - def failure_message; end - def failure_message_when_negated; end - def initialize(operand, operator); end - def matches?(actual); end - def perform_match(actual); end - include RSpec::Matchers::BuiltIn::BeHelpers -end -class RSpec::Matchers::BuiltIn::DynamicPredicate < RSpec::Matchers::BuiltIn::BaseMatcher - def description; end - def does_not_match?(actual, &block); end - def expectation_of(value); end - def failure_message; end - def failure_message_expecting(value); end - def failure_message_when_negated; end - def failure_to_respond_explanation; end - def initialize(method_name, *args, **, &block); end - def matches?(actual, &block); end - def method_description; end - def predicate_accessible?; end - def predicate_matches?(value = nil); end - def predicate_method_name; end - def predicate_result; end - def private_predicate?; end - def root; end - def validity_message; end - include RSpec::Matchers::BuiltIn::BeHelpers -end -class RSpec::Matchers::BuiltIn::Has < RSpec::Matchers::BuiltIn::DynamicPredicate - def predicate; end -end -class RSpec::Matchers::BuiltIn::BePredicate < RSpec::Matchers::BuiltIn::DynamicPredicate - def failure_to_respond_explanation; end - def predicate; end - def predicate_accessible?; end - def predicate_method_name; end - def present_tense_predicate; end -end -class RSpec::Matchers::BuiltIn::BeWithin < RSpec::Matchers::BuiltIn::BaseMatcher - def description; end - def failure_message; end - def failure_message_when_negated; end - def initialize(delta); end - def matches?(actual); end - def needs_expected; end - def not_numeric_clause; end - def numeric?; end - def of(expected); end - def percent_of(expected); end -end -class RSpec::Matchers::BuiltIn::Change < RSpec::Matchers::BuiltIn::BaseMatcher - def by(expected_delta); end - def by_at_least(minimum); end - def by_at_most(maximum); end - def change_details; end - def description; end - def does_not_match?(event_proc); end - def failure_message; end - def failure_message_when_negated; end - def from(value); end - def initialize(receiver = nil, message = nil, &block); end - def matches?(event_proc); end - def negative_failure_reason; end - def perform_change(event_proc); end - def positive_failure_reason; end - def raise_block_syntax_error; end - def supports_block_expectations?; end - def supports_value_expectations?; end - def to(value); end -end -class RSpec::Matchers::BuiltIn::ChangeRelatively < RSpec::Matchers::BuiltIn::BaseMatcher - def description; end - def does_not_match?(_event_proc); end - def failure_message; end - def failure_reason; end - def initialize(change_details, expected_delta, relativity, &comparer); end - def matches?(event_proc); end - def supports_block_expectations?; end - def supports_value_expectations?; end -end -class RSpec::Matchers::BuiltIn::SpecificValuesChange < RSpec::Matchers::BuiltIn::BaseMatcher - def after_value_failure; end - def before_value_failure; end - def description; end - def did_change_failure; end - def did_not_change_failure; end - def failure_message; end - def initialize(change_details, from, to); end - def matches?(event_proc); end - def matches_after?; end - def not_given_a_block_failure; end - def perform_change(event_proc); end - def supports_block_expectations?; end - def supports_value_expectations?; end -end -class RSpec::Matchers::BuiltIn::ChangeFromValue < RSpec::Matchers::BuiltIn::SpecificValuesChange - def change_description; end - def does_not_match?(event_proc); end - def failure_message_when_negated; end - def initialize(change_details, expected_before); end - def to(value); end -end -class RSpec::Matchers::BuiltIn::ChangeToValue < RSpec::Matchers::BuiltIn::SpecificValuesChange - def change_description; end - def does_not_match?(_event_proc); end - def from(value); end - def initialize(change_details, expected_after); end -end -class RSpec::Matchers::BuiltIn::ChangeDetails - def actual_after; end - def actual_delta; end - def changed?; end - def evaluate_value_proc; end - def extract_value_block_snippet; end - def initialize(matcher_name, receiver = nil, message = nil, &block); end - def message_notation(receiver, message); end - def perform_change(event_proc); end - def value_representation; end -end -module RSpec::Matchers::BuiltIn::ChangeDetails::UNDEFINED -end -class RSpec::Matchers::BuiltIn::Compound < RSpec::Matchers::BuiltIn::BaseMatcher - def compound_failure_message; end - def description; end - def diffable?; end - def diffable_matcher_list; end - def diffable_matcher_list_for(matcher); end - def does_not_match?(_actual); end - def evaluator; end - def expected; end - def expects_call_stack_jump?; end - def indent_multiline_message(message); end - def initialize(matcher_1, matcher_2); end - def initialize_copy(other); end - def match(_expected, actual); end - def matcher_1; end - def matcher_1_matches?; end - def matcher_2; end - def matcher_2_matches?; end - def matcher_is_diffable?(matcher); end - def matcher_supports_block_expectations?(matcher); end - def matcher_supports_value_expectations?(matcher); end - def supports_block_expectations?; end - def supports_value_expectations?; end -end -class RSpec::Matchers::BuiltIn::Compound::SequentialEvaluator - def initialize(actual, *); end - def matcher_matches?(matcher); end -end -class RSpec::Matchers::BuiltIn::Compound::NestedEvaluator - def initialize(actual, matcher_1, matcher_2); end - def inner_matcher_block(outer_args); end - def matcher_matches?(matcher); end - def order_block_matchers; end - def self.matcher_expects_call_stack_jump?(matcher); end -end -class RSpec::Matchers::BuiltIn::Compound::And < RSpec::Matchers::BuiltIn::Compound - def conjunction; end - def failure_message; end - def match(*); end -end -class RSpec::Matchers::BuiltIn::Compound::Or < RSpec::Matchers::BuiltIn::Compound - def conjunction; end - def failure_message; end - def match(*); end -end -class RSpec::Matchers::BuiltIn::ContainExactly < RSpec::Matchers::BuiltIn::BaseMatcher - def actual_collection_line; end - def best_solution; end - def convert_actual_to_an_array; end - def describe_collection(collection, surface_descriptions = nil); end - def description; end - def expected_collection_line; end - def extra_elements_line; end - def extra_items; end - def failure_message; end - def failure_message_when_negated; end - def generate_failure_message; end - def match(_expected, _actual); end - def match_when_sorted?; end - def matches?(actual); end - def message_line(prefix, collection, surface_descriptions = nil); end - def missing_elements_line; end - def missing_items; end - def pairings_maximizer; end - def safe_sort(array); end - def to_a_disallowed?(object); end -end -class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer - def actual_to_expected_matched_indexes; end - def apply_pairing_to(indeterminates, original_matches, other_list_index); end - def best_solution_for_pairing(expected_index, actual_index); end - def categorize_indexes(indexes_to_categorize, other_indexes); end - def expected_to_actual_matched_indexes; end - def find_best_solution; end - def initialize(expected_to_actual_matched_indexes, actual_to_expected_matched_indexes); end - def reciprocal_single_match?(matches, index, other_list); end - def solution; end -end -class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer::Solution < Struct - def +(derived_candidate_solution); end - def candidate?; end - def ideal?; end - def indeterminate_actual_indexes; end - def indeterminate_actual_indexes=(_); end - def indeterminate_expected_indexes; end - def indeterminate_expected_indexes=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end - def unmatched_actual_indexes; end - def unmatched_actual_indexes=(_); end - def unmatched_expected_indexes; end - def unmatched_expected_indexes=(_); end - def unmatched_item_count; end - def worse_than?(other); end -end -class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer::NullSolution - def self.worse_than?(_other); end -end -class RSpec::Matchers::BuiltIn::Cover < RSpec::Matchers::BuiltIn::BaseMatcher - def does_not_match?(range); end - def initialize(*expected); end - def matches?(range); end -end -class RSpec::Matchers::BuiltIn::StartOrEndWith < RSpec::Matchers::BuiltIn::BaseMatcher - def description; end - def failure_message; end - def initialize(*expected); end - def match(_expected, actual); end - def subsets_comparable?; end -end -class RSpec::Matchers::BuiltIn::StartWith < RSpec::Matchers::BuiltIn::StartOrEndWith - def element_matches?; end - def subset_matches?; end -end -class RSpec::Matchers::BuiltIn::EndWith < RSpec::Matchers::BuiltIn::StartOrEndWith - def element_matches?; end - def subset_matches?; end -end -class RSpec::Matchers::BuiltIn::Eq < RSpec::Matchers::BuiltIn::BaseMatcher - def description; end - def diffable?; end - def failure_message; end - def failure_message_when_negated; end - def match(expected, actual); end -end -class RSpec::Matchers::BuiltIn::Eql < RSpec::Matchers::BuiltIn::BaseMatcher - def diffable?; end - def failure_message; end - def failure_message_when_negated; end - def match(expected, actual); end -end -class RSpec::Matchers::BuiltIn::Equal < RSpec::Matchers::BuiltIn::BaseMatcher - def actual_inspected; end - def detailed_failure_message; end - def diffable?; end - def expected_is_a_literal_singleton?; end - def failure_message; end - def failure_message_when_negated; end - def inspect_object(o); end - def match(expected, actual); end - def simple_failure_message; end -end -class RSpec::Matchers::BuiltIn::Exist < RSpec::Matchers::BuiltIn::BaseMatcher - def does_not_match?(actual); end - def failure_message; end - def failure_message_when_negated; end - def initialize(*expected); end - def matches?(actual); end -end -class Anonymous_Struct_2 < Struct - def actual; end - def actual=(_); end - def expected; end - def expected=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class RSpec::Matchers::BuiltIn::Exist::ExistenceTest < Anonymous_Struct_2 - def actual_exists?; end - def deprecated(predicate, actual); end - def existence_values; end - def predicates; end - def uniq_truthy_values; end - def valid_test?; end - def validity_message; end -end -class RSpec::Matchers::BuiltIn::HaveAttributes < RSpec::Matchers::BuiltIn::BaseMatcher - def actual; end - def actual_has_attribute?(attribute_key, attribute_value); end - def cache_all_values; end - def description; end - def diffable?; end - def does_not_match?(actual); end - def failure_message; end - def failure_message_when_negated; end - def formatted_values; end - def initialize(expected); end - def matches?(actual); end - def perform_match(predicate); end - def respond_to_attributes?; end - def respond_to_failed; end - def respond_to_failure_message_or; end - def respond_to_matcher; end -end -module RSpec::Matchers::BuiltIn::CountExpectation - def at_least(number); end - def at_most(number); end - def count_constraint_to_number(n); end - def count_expectation_description; end - def count_expectation_type; end - def count_failure_reason(action); end - def cover?(count, number); end - def exactly(number); end - def expected_count; end - def expected_count_matches?(actual_count); end - def has_expected_count?; end - def human_readable_count(count); end - def human_readable_expectation_type; end - def once; end - def raise_impossible_count_expectation(count); end - def raise_unsupported_count_expectation; end - def set_expected_count(relativity, n); end - def thrice; end - def times; end - def twice; end - def unsupported_count_expectation?(relativity); end -end -class RSpec::Matchers::BuiltIn::Include < RSpec::Matchers::BuiltIn::BaseMatcher - def actual_collection_includes?(expected_item); end - def actual_hash_has_key?(expected_key); end - def actual_hash_includes?(expected_key, expected_value); end - def check_actual?(actual); end - def check_expected_count?; end - def comparing_hash_keys?(expected_item); end - def comparing_hash_to_a_subset?(expected_item); end - def convert_to_hash?(obj); end - def count_enumerable(expected_item); end - def count_inclusions; end - def description; end - def diff_would_wrongly_highlight_matched_item?; end - def diffable?; end - def does_not_match?(actual); end - def excluded_from_actual; end - def expected; end - def expecteds; end - def failure_message; end - def failure_message_when_negated; end - def format_failure_message(preposition); end - def initialize(*expecteds); end - def matches?(actual); end - def perform_match(&block); end - def readable_list_of(items); end - include RSpec::Matchers::BuiltIn::CountExpectation -end -class RSpec::Matchers::BuiltIn::All < RSpec::Matchers::BuiltIn::BaseMatcher - def add_new_line_if_needed(message); end - def description; end - def does_not_match?(_actual); end - def failed_objects; end - def failure_message; end - def failure_message_for_item(index, failure_message); end - def indent_multiline_message(message); end - def index_failed_objects; end - def initialize(matcher); end - def initialize_copy(other); end - def iterable?; end - def match(_expected, _actual); end - def matcher; end -end -class RSpec::Matchers::BuiltIn::Match < RSpec::Matchers::BuiltIn::BaseMatcher - def can_safely_call_match?(expected, actual); end - def description; end - def diffable?; end - def initialize(expected); end - def match(expected, actual); end - def match_captures(expected, actual); end - def with_captures(*captures); end -end -class RSpec::Matchers::BuiltIn::ReliableMatchData - def captures; end - def initialize(match_data); end - def match_data; end - def names; end -end -class RSpec::Matchers::BuiltIn::OperatorMatcher - def !=(_expected); end - def !~(_expected); end - def <(expected); end - def <=(expected); end - def ==(expected); end - def ===(expected); end - def =~(expected); end - def >(expected); end - def >=(expected); end - def description; end - def eval_match(actual, operator, expected); end - def fail_with_message(message); end - def has_non_generic_implementation_of?(op); end - def initialize(actual); end - def self.get(klass, operator); end - def self.register(klass, operator, matcher); end - def self.registry; end - def self.unregister(klass, operator); end - def self.use_custom_matcher_or_delegate(operator); end -end -class RSpec::Matchers::BuiltIn::PositiveOperatorMatcher < RSpec::Matchers::BuiltIn::OperatorMatcher - def __delegate_operator(actual, operator, expected); end -end -class RSpec::Matchers::BuiltIn::NegativeOperatorMatcher < RSpec::Matchers::BuiltIn::OperatorMatcher - def __delegate_operator(actual, operator, expected); end -end -class RSpec::Matchers::BuiltIn::Output < RSpec::Matchers::BuiltIn::BaseMatcher - def actual_output_description; end - def captured?; end - def description; end - def diffable?; end - def does_not_match?(block); end - def failure_message; end - def failure_message_when_negated; end - def initialize(expected); end - def matches?(block); end - def negative_failure_reason; end - def positive_failure_reason; end - def supports_block_expectations?; end - def supports_value_expectations?; end - def to_stderr; end - def to_stderr_from_any_process; end - def to_stdout; end - def to_stdout_from_any_process; end -end -module RSpec::Matchers::BuiltIn::NullCapture - def self.capture(_block); end - def self.name; end -end -module RSpec::Matchers::BuiltIn::CaptureStdout - def self.capture(block); end - def self.name; end -end -module RSpec::Matchers::BuiltIn::CaptureStderr - def self.capture(block); end - def self.name; end -end -class Anonymous_Struct_3 < Struct - def name; end - def name=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end - def stream; end - def stream=(_); end -end -class RSpec::Matchers::BuiltIn::CaptureStreamToTempfile < Anonymous_Struct_3 - def capture(block); end -end -class RSpec::Matchers::BuiltIn::RaiseError - def actual_error_message; end - def block_matches?; end - def description; end - def does_not_match?(given_proc); end - def error_and_message_match?; end - def eval_block; end - def expectation_matched?; end - def expected_error; end - def expecting_specific_exception?; end - def expects_call_stack_jump?; end - def failure_message; end - def failure_message_when_negated; end - def format_backtrace(backtrace); end - def given_error; end - def handle_warning(message); end - def initialize(expected_error_or_message, expected_message, &block); end - def matches?(given_proc, negative_expectation = nil, &block); end - def raise_message_already_set; end - def ready_to_eval_block?; end - def supports_block_expectations?; end - def supports_value_expectations?; end - def verify_message; end - def warn_about_bare_error!; end - def warn_about_bare_error?; end - def warn_about_negative_false_positive!(expression); end - def warn_about_nil_error!; end - def warn_about_nil_error?; end - def warn_for_negative_false_positives!; end - def warning; end - def with_message(expected_message); end - include RSpec::Matchers::Composable -end -class RSpec::Matchers::BuiltIn::RespondTo < RSpec::Matchers::BuiltIn::BaseMatcher - def and_any_keywords; end - def and_keywords(*keywords); end - def and_unlimited_arguments; end - def argument; end - def arguments; end - def description; end - def does_not_match?(actual); end - def failure_message; end - def failure_message_when_negated; end - def find_failing_method_names(actual, filter_method); end - def ignoring_method_signature_failure!; end - def initialize(*names); end - def matches?(actual); end - def matches_arity?(actual, name); end - def pp_names; end - def with(n); end - def with_any_keywords; end - def with_arity; end - def with_arity_string; end - def with_keywords(*keywords); end - def with_keywords_string; end - def with_unlimited_arguments; end -end -class RSpec::Matchers::BuiltIn::RespondTo::ArityCheck - def initialize(expected_arity, expected_keywords, arbitrary_keywords, unlimited_arguments); end - def matches?(actual, name); end - def method_signature_for(actual, name); end - def verifier_for(actual, name); end -end -class RSpec::Matchers::BuiltIn::Satisfy < RSpec::Matchers::BuiltIn::BaseMatcher - def block_representation; end - def description; end - def extract_block_snippet; end - def failure_message; end - def failure_message_when_negated; end - def initialize(description = nil, &block); end - def matches?(actual, &block); end -end -class RSpec::Matchers::BuiltIn::ThrowSymbol - def actual_result; end - def caught; end - def description; end - def does_not_match?(given_proc); end - def expected(symbol_desc = nil); end - def expects_call_stack_jump?; end - def failure_message; end - def failure_message_when_negated; end - def initialize(expected_symbol = nil, expected_arg = nil); end - def matches?(given_proc); end - def supports_block_expectations?; end - def supports_value_expectations?; end - def throw_description(symbol, arg); end - include RSpec::Matchers::Composable -end -class RSpec::Matchers::BuiltIn::YieldProbe - def assert_used!; end - def assert_valid_expect_block!; end - def has_block?; end - def initialize(block, &callback); end - def num_yields; end - def num_yields=(arg0); end - def probe; end - def self.probe(block, &callback); end - def single_yield_args; end - def to_proc; end - def yielded_args; end - def yielded_args=(arg0); end - def yielded_once?(matcher_name); end -end -class RSpec::Matchers::BuiltIn::YieldControl < RSpec::Matchers::BuiltIn::BaseMatcher - def does_not_match?(block); end - def failure_message; end - def failure_message_when_negated; end - def failure_reason; end - def matches?(block); end - def supports_block_expectations?; end - def supports_value_expectations?; end - include RSpec::Matchers::BuiltIn::CountExpectation -end -class RSpec::Matchers::BuiltIn::YieldWithNoArgs < RSpec::Matchers::BuiltIn::BaseMatcher - def does_not_match?(block); end - def failure_message; end - def failure_message_when_negated; end - def matches?(block); end - def negative_failure_reason; end - def positive_failure_reason; end - def supports_block_expectations?; end - def supports_value_expectations?; end -end -class RSpec::Matchers::BuiltIn::YieldWithArgs < RSpec::Matchers::BuiltIn::BaseMatcher - def all_args_match?; end - def args_currently_match?; end - def description; end - def does_not_match?(block); end - def expected_arg_description; end - def failure_message; end - def failure_message_when_negated; end - def initialize(*args); end - def matches?(block); end - def negative_failure_reason; end - def positive_failure_reason; end - def supports_block_expectations?; end - def supports_value_expectations?; end -end -class RSpec::Matchers::BuiltIn::YieldSuccessiveArgs < RSpec::Matchers::BuiltIn::BaseMatcher - def description; end - def does_not_match?(block); end - def expected_arg_description; end - def failure_message; end - def failure_message_when_negated; end - def initialize(*args); end - def matches?(block); end - def negative_failure_reason; end - def positive_failure_reason; end - def supports_block_expectations?; end - def supports_value_expectations?; end -end diff --git a/sorbet/rbi/gems/rspec-expectations@3.13.1.rbi b/sorbet/rbi/gems/rspec-expectations@3.13.1.rbi new file mode 100644 index 0000000..2a514d2 --- /dev/null +++ b/sorbet/rbi/gems/rspec-expectations@3.13.1.rbi @@ -0,0 +1,8167 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rspec-expectations` gem. +# Please instead update this file by running `bin/tapioca gem rspec-expectations`. + + +# RSpec's top level namespace. All of rspec-expectations is contained +# in the `RSpec::Expectations` and `RSpec::Matchers` namespaces. +# +# source://rspec-expectations//lib/rspec/matchers/english_phrasing.rb#1 +module RSpec + class << self + # source://rspec-core/3.13.0/lib/rspec/core.rb#70 + def clear_examples; end + + # source://rspec-core/3.13.0/lib/rspec/core.rb#85 + def configuration; end + + # source://rspec-core/3.13.0/lib/rspec/core.rb#49 + def configuration=(_arg0); end + + # source://rspec-core/3.13.0/lib/rspec/core.rb#97 + def configure; end + + # source://rspec-core/3.13.0/lib/rspec/core.rb#194 + def const_missing(name); end + + # source://rspec-core/3.13.0/lib/rspec/core/dsl.rb#42 + def context(*args, &example_group_block); end + + # source://rspec-core/3.13.0/lib/rspec/core.rb#122 + def current_example; end + + # source://rspec-core/3.13.0/lib/rspec/core.rb#128 + def current_example=(example); end + + # source://rspec-core/3.13.0/lib/rspec/core.rb#154 + def current_scope; end + + # source://rspec-core/3.13.0/lib/rspec/core.rb#134 + def current_scope=(scope); end + + # source://rspec-core/3.13.0/lib/rspec/core/dsl.rb#42 + def describe(*args, &example_group_block); end + + # source://rspec-core/3.13.0/lib/rspec/core/dsl.rb#42 + def example_group(*args, &example_group_block); end + + # source://rspec-core/3.13.0/lib/rspec/core/dsl.rb#42 + def fcontext(*args, &example_group_block); end + + # source://rspec-core/3.13.0/lib/rspec/core/dsl.rb#42 + def fdescribe(*args, &example_group_block); end + + # source://rspec-core/3.13.0/lib/rspec/core.rb#58 + def reset; end + + # source://rspec-core/3.13.0/lib/rspec/core/shared_example_group.rb#110 + def shared_context(name, *args, &block); end + + # source://rspec-core/3.13.0/lib/rspec/core/shared_example_group.rb#110 + def shared_examples(name, *args, &block); end + + # source://rspec-core/3.13.0/lib/rspec/core/shared_example_group.rb#110 + def shared_examples_for(name, *args, &block); end + + # source://rspec-core/3.13.0/lib/rspec/core.rb#160 + def world; end + + # source://rspec-core/3.13.0/lib/rspec/core.rb#49 + def world=(_arg0); end + + # source://rspec-core/3.13.0/lib/rspec/core/dsl.rb#42 + def xcontext(*args, &example_group_block); end + + # source://rspec-core/3.13.0/lib/rspec/core/dsl.rb#42 + def xdescribe(*args, &example_group_block); end + end +end + +# RSpec::Expectations provides a simple, readable API to express +# the expected outcomes in a code example. To express an expected +# outcome, wrap an object or block in `expect`, call `to` or `to_not` +# (aliased as `not_to`) and pass it a matcher object: +# +# expect(order.total).to eq(Money.new(5.55, :USD)) +# expect(list).to include(user) +# expect(message).not_to match(/foo/) +# expect { do_something }.to raise_error +# +# The last form (the block form) is needed to match against ruby constructs +# that are not objects, but can only be observed when executing a block +# of code. This includes raising errors, throwing symbols, yielding, +# and changing values. +# +# When `expect(...).to` is invoked with a matcher, it turns around +# and calls `matcher.matches?()`. For example, +# in the expression: +# +# expect(order.total).to eq(Money.new(5.55, :USD)) +# +# ...`eq(Money.new(5.55, :USD))` returns a matcher object, and it results +# in the equivalent of `eq.matches?(order.total)`. If `matches?` returns +# `true`, the expectation is met and execution continues. If `false`, then +# the spec fails with the message returned by `eq.failure_message`. +# +# Given the expression: +# +# expect(order.entries).not_to include(entry) +# +# ...the `not_to` method (also available as `to_not`) invokes the equivalent of +# `include.matches?(order.entries)`, but it interprets `false` as success, and +# `true` as a failure, using the message generated by +# `include.failure_message_when_negated`. +# +# rspec-expectations ships with a standard set of useful matchers, and writing +# your own matchers is quite simple. +# +# See [RSpec::Matchers](../RSpec/Matchers) for more information about the +# built-in matchers that ship with rspec-expectations, and how to write your +# own custom matchers. +# +# source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#2 +module RSpec::Expectations + class << self + # The configuration object. + # + # @return [RSpec::Expectations::Configuration] the configuration object + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#223 + def configuration; end + + # @private + # + # source://rspec-expectations//lib/rspec/expectations/fail_with.rb#13 + def differ; end + + # Raises an RSpec::Expectations::ExpectationNotMetError with message. + # Adds a diff to the failure message when `expected` and `actual` are + # both present. + # + # @param message [String] + # @param expected [Object] + # @param actual [Object] + # + # source://rspec-expectations//lib/rspec/expectations/fail_with.rb#27 + def fail_with(message, expected = T.unsafe(nil), actual = T.unsafe(nil)); end + end +end + +# Validates the provided matcher to ensure it supports block +# expectations, in order to avoid user confusion when they +# use a block thinking the expectation will be on the return +# value of the block rather than the block itself. +# +# @private +# +# source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#136 +class RSpec::Expectations::BlockExpectationTarget < ::RSpec::Expectations::ExpectationTarget + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#142 + def not_to(matcher, message = T.unsafe(nil), &block); end + + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#137 + def to(matcher, message = T.unsafe(nil), &block); end + + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#142 + def to_not(matcher, message = T.unsafe(nil), &block); end + + private + + # @raise [ExpectationNotMetError] + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#150 + def enforce_block_expectation(matcher); end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#158 + def supports_block_expectations?(matcher); end +end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#4 +class RSpec::Expectations::BlockSnippetExtractor + # @return [BlockSnippetExtractor] a new instance of BlockSnippetExtractor + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#17 + def initialize(proc, method_name); end + + # Ideally we should properly handle indentations of multiline snippet, + # but it's not implemented yet since because we use result of this method only when it's a + # single line and implementing the logic introduces additional complexity. + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#25 + def body_content_lines; end + + # rubocop should properly handle `Struct.new {}` as an inner class definition. + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#7 + def method_name; end + + # rubocop should properly handle `Struct.new {}` as an inner class definition. + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#7 + def proc; end + + private + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#60 + def beginning_line_number; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#39 + def block_token_extractor; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#56 + def file_path; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#31 + def raw_body_lines; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#35 + def raw_body_snippet; end + + # @raise [TargetNotFoundError] + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#44 + def source; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#64 + def source_location; end + + class << self + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#9 + def try_extracting_single_line_body_of(proc, method_name); end + end +end + +# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#70 +class RSpec::Expectations::BlockSnippetExtractor::AmbiguousTargetError < ::RSpec::Expectations::BlockSnippetExtractor::Error; end + +# Locates target block with node information (semantics), which tokens don't have. +# +# @private +# +# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#198 +class RSpec::Expectations::BlockSnippetExtractor::BlockLocator < ::Struct + # Returns the value of attribute beginning_line_number + # + # @return [Object] the current value of beginning_line_number + def beginning_line_number; end + + # Sets the attribute beginning_line_number + # + # @param value [Object] the value to set the attribute beginning_line_number to. + # @return [Object] the newly set value + def beginning_line_number=(_); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#203 + def body_content_locations; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#199 + def method_call_location; end + + # Returns the value of attribute method_name + # + # @return [Object] the current value of method_name + def method_name; end + + # Sets the attribute method_name + # + # @param value [Object] the value to set the attribute method_name to. + # @return [Object] the newly set value + def method_name=(_); end + + # Returns the value of attribute source + # + # @return [Object] the current value of source + def source; end + + # Sets the attribute source + # + # @param value [Object] the value to set the attribute source to. + # @return [Object] the newly set value + def source=(_); end + + private + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#216 + def block_body_node; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#221 + def block_wrapper_node; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#232 + def candidate_block_wrapper_nodes; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#241 + def candidate_method_ident_nodes; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#209 + def method_ident_node; end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#247 + def method_ident_node?(node); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# Performs extraction of block body snippet using tokens, +# which cannot be done with node information. +# +# @private +# +# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#75 +class RSpec::Expectations::BlockSnippetExtractor::BlockTokenExtractor < ::Struct + # @return [BlockTokenExtractor] a new instance of BlockTokenExtractor + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#78 + def initialize(*_arg0); end + + # Returns the value of attribute beginning_line_number + # + # @return [Object] the current value of beginning_line_number + def beginning_line_number; end + + # Sets the attribute beginning_line_number + # + # @param value [Object] the value to set the attribute beginning_line_number to. + # @return [Object] the newly set value + def beginning_line_number=(_); end + + # Returns the value of attribute body_tokens. + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#76 + def body_tokens; end + + # Returns the value of attribute method_name + # + # @return [Object] the current value of method_name + def method_name; end + + # Sets the attribute method_name + # + # @param value [Object] the value to set the attribute method_name to. + # @return [Object] the newly set value + def method_name=(_); end + + # Returns the value of attribute source + # + # @return [Object] the current value of source + def source; end + + # Sets the attribute source + # + # @param value [Object] the value to set the attribute source to. + # @return [Object] the newly set value + def source=(_); end + + # Returns the value of attribute state. + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#76 + def state; end + + private + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#124 + def after_beginning_of_args_state(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#128 + def after_beginning_of_body_state(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#107 + def after_method_call_state(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#111 + def after_opener_state(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#191 + def block_locator; end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#185 + def correct_block?(body_tokens); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#141 + def finalize_pending_tokens!; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#95 + def finish!; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#147 + def finish_or_find_next_block_if_incorrect!; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#168 + def handle_closer_token(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#158 + def handle_opener_token(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#103 + def initial_state(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#99 + def invoke_state_handler(token); end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#164 + def opener_token?(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#177 + def opener_token_stack; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#85 + def parse!; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#137 + def pending_tokens; end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#181 + def pipe_token?(token); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#68 +class RSpec::Expectations::BlockSnippetExtractor::Error < ::StandardError; end + +# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#69 +class RSpec::Expectations::BlockSnippetExtractor::TargetNotFoundError < ::RSpec::Expectations::BlockSnippetExtractor::Error; end + +# Provides configuration options for rspec-expectations. +# If you are using rspec-core, you can access this via a +# block passed to `RSpec::Core::Configuration#expect_with`. +# Otherwise, you can access it via RSpec::Expectations.configuration. +# +# @example +# RSpec.configure do |rspec| +# rspec.expect_with :rspec do |c| +# # c is the config object +# end +# end +# +# # or +# +# RSpec::Expectations.configuration +# +# source://rspec-expectations//lib/rspec/expectations/configuration.rb#20 +class RSpec::Expectations::Configuration + # @return [Configuration] a new instance of Configuration + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#29 + def initialize; end + + # Adds `should` and `should_not` to the given classes + # or modules. This can be used to ensure `should` works + # properly on things like proxy objects (particular + # `Delegator`-subclassed objects on 1.8). + # + # @param modules [Array] the list of classes or modules + # to add `should` and `should_not` to. + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#112 + def add_should_and_should_not_to(*modules); end + + # Sets or gets the backtrace formatter. The backtrace formatter should + # implement `#format_backtrace(Array)`. This is used + # to format backtraces of errors handled by the `raise_error` + # matcher. + # + # If you are using rspec-core, rspec-core's backtrace formatting + # will be used (including respecting the presence or absence of + # the `--backtrace` option). + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#129 + def backtrace_formatter; end + + # Sets or gets the backtrace formatter. The backtrace formatter should + # implement `#format_backtrace(Array)`. This is used + # to format backtraces of errors handled by the `raise_error` + # matcher. + # + # If you are using rspec-core, rspec-core's backtrace formatting + # will be used (including respecting the presence or absence of + # the `--backtrace` option). + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#128 + def backtrace_formatter=(_arg0); end + + # Indicates whether or not diffs should be colored. + # Delegates to rspec-core's color option if rspec-core + # is loaded; otherwise you can set it here. + # + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#88 + def color?; end + + # @private + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#216 + def false_positives_handler; end + + # Sets if custom matcher descriptions and failure messages + # should include clauses from methods defined using `chain`. + # + # @param value [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#140 + def include_chain_clauses_in_custom_matcher_descriptions=(_arg0); end + + # Indicates whether or not custom matcher descriptions and failure messages + # should include clauses from methods defined using `chain`. It is + # false by default for backwards compatibility. + # + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#145 + def include_chain_clauses_in_custom_matcher_descriptions?; end + + # Configures the maximum character length that RSpec will print while + # formatting an object. You can set length to nil to prevent RSpec from + # doing truncation. + # + # @example + # RSpec.configure do |rspec| + # rspec.expect_with :rspec do |c| + # c.max_formatted_output_length = 200 + # end + # end + # @param length [Fixnum] the number of characters to limit the formatted output to. + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#70 + def max_formatted_output_length=(length); end + + # Indicates what RSpec will do about matcher use which will + # potentially cause false positives in tests, generally you want to + # avoid such scenarios so this defaults to `true`. + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#206 + def on_potential_false_positives; end + + # Configures what RSpec will do about matcher use which will + # potentially cause false positives in tests. + # + # @param behavior [Symbol] can be set to :warn, :raise or :nothing + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#182 + def on_potential_false_positives=(behavior); end + + # @private + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#150 + def reset_syntaxes_to_default; end + + # Returns the value of attribute strict_predicate_matchers. + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#197 + def strict_predicate_matchers; end + + # Configures RSpec to check predicate matchers to `be(true)` / `be(false)` (strict), + # or `be_truthy` / `be_falsey` (not strict). + # Historically, the default was `false`, but `true` is recommended. + # + # @raise [ArgumentError] + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#192 + def strict_predicate_matchers=(flag); end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#199 + def strict_predicate_matchers?; end + + # The list of configured syntaxes. + # + # @example + # unless RSpec::Matchers.configuration.syntax.include?(:expect) + # raise "this RSpec extension gem requires the rspec-expectations `:expect` syntax" + # end + # @return [Array] the list of configured syntaxes. + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#80 + def syntax; end + + # Configures the supported syntax. + # + # @example + # RSpec.configure do |rspec| + # rspec.expect_with :rspec do |c| + # c.syntax = :should + # # or + # c.syntax = :expect + # # or + # c.syntax = [:should, :expect] + # end + # end + # @param values [Array, Symbol] the syntaxes to enable + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#46 + def syntax=(values); end + + # Configures whether RSpec will warn about matcher use which will + # potentially cause false positives in tests. + # + # @param boolean [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#168 + def warn_about_potential_false_positives=(boolean); end + + # Indicates whether RSpec will warn about matcher use which will + # potentially cause false positives in tests, generally you want to + # avoid such scenarios so this defaults to `true`. + # + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#211 + def warn_about_potential_false_positives?; end +end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/configuration.rb#22 +RSpec::Expectations::Configuration::FALSE_POSITIVE_BEHAVIOURS = T.let(T.unsafe(nil), Hash) + +# Null implementation of a backtrace formatter used by default +# when rspec-core is not loaded. Does no filtering. +# +# @api private +# +# source://rspec-expectations//lib/rspec/expectations/configuration.rb#158 +module RSpec::Expectations::Configuration::NullBacktraceFormatter + class << self + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#159 + def format_backtrace(backtrace); end + end +end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/handler.rb#4 +module RSpec::Expectations::ExpectationHelper + class << self + # source://rspec-expectations//lib/rspec/expectations/handler.rb#5 + def check_message(msg); end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#33 + def handle_failure(matcher, message, failure_message_method); end + + # Returns an RSpec-3+ compatible matcher, wrapping a legacy one + # in an adapter if necessary. + # + # @private + # + # source://rspec-expectations//lib/rspec/expectations/handler.rb#19 + def modern_matcher_from(matcher); end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#24 + def with_matcher(handler, matcher, message); end + end +end + +# Exception raised when an expectation fails. +# +# the user sets an expectation, it can't be caught in their +# code by a bare `rescue`. +# +# @api public +# @note We subclass Exception so that in a stub implementation if +# +# source://rspec-expectations//lib/rspec/expectations.rb#67 +class RSpec::Expectations::ExpectationNotMetError < ::Exception; end + +# Wraps the target of an expectation. +# +# @example +# expect(something) # => ExpectationTarget wrapping something +# expect { do_something } # => ExpectationTarget wrapping the block +# +# # used with `to` +# expect(actual).to eq(3) +# +# # with `not_to` +# expect(actual).not_to eq(3) +# @note `ExpectationTarget` is not intended to be instantiated +# directly by users. Use `expect` instead. +# +# source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#17 +class RSpec::Expectations::ExpectationTarget + include ::RSpec::Expectations::ExpectationTarget::InstanceMethods + + # @api private + # @return [ExpectationTarget] a new instance of ExpectationTarget + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#31 + def initialize(value); end + + # @note this name aligns with `Minitest::Expectation` so that our + # {InstanceMethods} module can be included in that class when + # used in a Minitest context. + # @return [Object] the target of the expectation + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#28 + def target; end + + class << self + # @private + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#36 + def for(value, block); end + end +end + +# Defines instance {ExpectationTarget} instance methods. These are defined +# in a module so we can include it in `Minitest::Expectation` when +# `rspec/expectations/minitest_integration` is loaded in order to +# support usage with Minitest. +# +# source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#53 +module RSpec::Expectations::ExpectationTarget::InstanceMethods + # Runs the given expectation, passing if `matcher` returns false. + # + # @example + # expect(value).not_to eq(5) + # @param matcher [Matcher] + # @param message [String, Proc] optional message to display when the expectation fails + # @return [Boolean] false if the negative expectation succeeds (else raises) + # @see RSpec::Matchers + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#76 + def not_to(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # Runs the given expectation, passing if `matcher` returns true. + # + # @example + # expect(value).to eq(5) + # expect { perform }.to raise_error + # @param matcher [Matcher] + # @param message [String, Proc] optional message to display when the expectation fails + # @return [Boolean] true if the expectation succeeds (else raises) + # @see RSpec::Matchers + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#63 + def to(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # Runs the given expectation, passing if `matcher` returns false. + # + # @example + # expect(value).not_to eq(5) + # @param matcher [Matcher] + # @param message [String, Proc] optional message to display when the expectation fails + # @return [Boolean] false if the negative expectation succeeds (else raises) + # @see RSpec::Matchers + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#76 + def to_not(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end + + private + + # @raise [ArgumentError] + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#84 + def prevent_operator_matchers(verb); end +end + +# Used as a sentinel value to be able to tell when the user +# did not pass an argument. We can't use `nil` for that because +# `nil` is a valid value to pass. +# +# @private +# +# source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#22 +module RSpec::Expectations::ExpectationTarget::UndefinedValue; end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#4 +class RSpec::Expectations::FailureAggregator + # @return [FailureAggregator] a new instance of FailureAggregator + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#90 + def initialize(block_label, metadata); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#22 + def aggregate; end + + # Returns the value of attribute block_label. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#5 + def block_label; end + + # This method is defined to satisfy the callable interface + # expected by `RSpec::Support.with_failure_notifier`. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#59 + def call(failure, options); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#49 + def failures; end + + # Returns the value of attribute metadata. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#5 + def metadata; end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#53 + def other_errors; end + + private + + # Using `caller` performs better (and is simpler) than `raise` on most Rubies. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#85 + def assign_backtrace(failure); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#96 + def notify_aggregated_failures; end +end + +# source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#20 +RSpec::Expectations::FailureAggregator::AGGREGATED_FAILURE = T.let(T.unsafe(nil), RSpec::Expectations::FailureAggregator::AggregatedFailure) + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#8 +class RSpec::Expectations::FailureAggregator::AggregatedFailure + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#15 + def inspect; end +end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#10 +RSpec::Expectations::FailureAggregator::AggregatedFailure::MESSAGE = T.let(T.unsafe(nil), String) + +# RSpec 3.0 was released with the class name misspelled. For SemVer compatibility, +# we will provide this misspelled alias until 4.0. +# +# @deprecated Use LegacyMatcherAdapter instead. +# @private +# +# source://rspec-expectations//lib/rspec/expectations/handler.rb#180 +RSpec::Expectations::LegacyMacherAdapter = RSpec::Expectations::LegacyMatcherAdapter + +# Wraps a matcher written against one of the legacy protocols in +# order to present the current protocol. +# +# @private +# +# source://rspec-expectations//lib/rspec/expectations/handler.rb#113 +class RSpec::Expectations::LegacyMatcherAdapter < ::RSpec::Matchers::MatcherDelegator + # @return [LegacyMatcherAdapter] a new instance of LegacyMatcherAdapter + # + # source://rspec-expectations//lib/rspec/expectations/handler.rb#114 + def initialize(matcher); end + + class << self + # source://rspec-expectations//lib/rspec/expectations/handler.rb#124 + def wrap(matcher); end + end +end + +# Before RSpec 1.2, the failure message protocol was: +# * `failure_message` +# * `negative_failure_message` +# +# @private +# +# source://rspec-expectations//lib/rspec/expectations/handler.rb#157 +class RSpec::Expectations::LegacyMatcherAdapter::RSpec1 < ::RSpec::Expectations::LegacyMatcherAdapter + # source://rspec-expectations//lib/rspec/expectations/handler.rb#158 + def failure_message; end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#162 + def failure_message_when_negated; end + + class << self + # Note: `failure_message` is part of the RSpec 3 protocol + # (paired with `failure_message_when_negated`), so we don't check + # for `failure_message` here. + # + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/handler.rb#169 + def interface_matches?(matcher); end + end +end + +# Starting in RSpec 1.2 (and continuing through all 2.x releases), +# the failure message protocol was: +# * `failure_message_for_should` +# * `failure_message_for_should_not` +# +# @private +# +# source://rspec-expectations//lib/rspec/expectations/handler.rb#133 +class RSpec::Expectations::LegacyMatcherAdapter::RSpec2 < ::RSpec::Expectations::LegacyMatcherAdapter + # source://rspec-expectations//lib/rspec/expectations/handler.rb#134 + def failure_message; end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#138 + def failure_message_when_negated; end + + class << self + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/handler.rb#142 + def interface_matches?(matcher); end + end +end + +# Exception raised from `aggregate_failures` when multiple expectations fail. +# +# @note The constant is defined here but the extensive logic of this class +# is lazily defined when `FailureAggregator` is autoloaded, since we do +# not need to waste time defining that functionality unless +# `aggregate_failures` is used. +# +# source://rspec-expectations//lib/rspec/expectations.rb#76 +class RSpec::Expectations::MultipleExpectationsNotMetError < ::RSpec::Expectations::ExpectationNotMetError + # @return [MultipleExpectationsNotMetError] a new instance of MultipleExpectationsNotMetError + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#153 + def initialize(failure_aggregator); end + + # @return [String] The user-assigned label for the aggregation block. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#128 + def aggregation_block_label; end + + # @return [Hash] The metadata hash passed to `aggregate_failures`. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#133 + def aggregation_metadata; end + + # @return [Array] The list of expectation failures and other exceptions, combined. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#125 + def all_exceptions; end + + # return [String] A description of the failure/error counts. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#144 + def exception_count_description; end + + # @return [Array] The list of expectation failures. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#115 + def failures; end + + # @return [String] The fully formatted exception message. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#110 + def message; end + + # @return [Array] The list of other exceptions. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#120 + def other_errors; end + + # @return [String] A summary of the failure, including the block label and a count of failures. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#138 + def summary; end + + private + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#185 + def backtrace_line(line); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#158 + def block_description; end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#167 + def enumerated(exceptions, index_offset); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#197 + def enumerated_errors; end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#193 + def enumerated_failures; end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#175 + def exclusion_patterns; end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#181 + def format_backtrace(backtrace); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#212 + def indentation; end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#203 + def indented(failure_message, index); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#224 + def index_label(index); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#216 + def longest_index_label_width; end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#163 + def pluralize(noun, count); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#220 + def width_of_label(index); end +end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/handler.rb#74 +class RSpec::Expectations::NegativeExpectationHandler + class << self + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/handler.rb#88 + def does_not_match?(matcher, actual, &block); end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#75 + def handle_matcher(actual, initial_matcher, custom_message = T.unsafe(nil), &block); end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#104 + def opposite_should_method; end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#100 + def should_method; end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#96 + def verb; end + end +end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/handler.rb#46 +class RSpec::Expectations::PositiveExpectationHandler + class << self + # source://rspec-expectations//lib/rspec/expectations/handler.rb#47 + def handle_matcher(actual, initial_matcher, custom_message = T.unsafe(nil), &block); end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#68 + def opposite_should_method; end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#64 + def should_method; end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#60 + def verb; end + end +end + +# Provides methods for enabling and disabling the available +# syntaxes provided by rspec-expectations. +# +# @api private +# +# source://rspec-expectations//lib/rspec/expectations/syntax.rb#6 +module RSpec::Expectations::Syntax + private + + # Determines where we add `should` and `should_not`. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#11 + def default_should_host; end + + # Disables the `expect` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#80 + def disable_expect(syntax_host = T.unsafe(nil)); end + + # Disables the `should` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#57 + def disable_should(syntax_host = T.unsafe(nil)); end + + # Enables the `expect` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#68 + def enable_expect(syntax_host = T.unsafe(nil)); end + + # Enables the `should` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#38 + def enable_should(syntax_host = T.unsafe(nil)); end + + # Indicates whether or not the `expect` syntax is enabled. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#96 + def expect_enabled?(syntax_host = T.unsafe(nil)); end + + # Indicates whether or not the `should` syntax is enabled. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#90 + def should_enabled?(syntax_host = T.unsafe(nil)); end + + # Instructs rspec-expectations to warn on first usage of `should` or `should_not`. + # Enabled by default. This is largely here to facilitate testing. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#18 + def warn_about_should!; end + + # Generates a deprecation warning for the given method if no warning + # has already been issued. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#25 + def warn_about_should_unless_configured(method_name); end + + class << self + # Determines where we add `should` and `should_not`. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#11 + def default_should_host; end + + # Disables the `expect` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#80 + def disable_expect(syntax_host = T.unsafe(nil)); end + + # Disables the `should` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#57 + def disable_should(syntax_host = T.unsafe(nil)); end + + # Enables the `expect` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#68 + def enable_expect(syntax_host = T.unsafe(nil)); end + + # Enables the `should` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#38 + def enable_should(syntax_host = T.unsafe(nil)); end + + # Indicates whether or not the `expect` syntax is enabled. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#96 + def expect_enabled?(syntax_host = T.unsafe(nil)); end + + # Indicates whether or not the `should` syntax is enabled. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#90 + def should_enabled?(syntax_host = T.unsafe(nil)); end + + # Instructs rspec-expectations to warn on first usage of `should` or `should_not`. + # Enabled by default. This is largely here to facilitate testing. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#18 + def warn_about_should!; end + + # Generates a deprecation warning for the given method if no warning + # has already been issued. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#25 + def warn_about_should_unless_configured(method_name); end + end +end + +# Validates the provided matcher to ensure it supports block +# expectations, in order to avoid user confusion when they +# use a block thinking the expectation will be on the return +# value of the block rather than the block itself. +# +# @private +# +# source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#98 +class RSpec::Expectations::ValueExpectationTarget < ::RSpec::Expectations::ExpectationTarget + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#104 + def not_to(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#99 + def to(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end + + private + + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#111 + def enforce_value_expectation(matcher); end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#126 + def supports_value_expectations?(matcher); end +end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/version.rb#4 +module RSpec::Expectations::Version; end + +# source://rspec-expectations//lib/rspec/expectations/version.rb#5 +RSpec::Expectations::Version::STRING = T.let(T.unsafe(nil), String) + +# RSpec::Matchers provides a number of useful matchers we use to define +# expectations. Any object that implements the [matcher protocol](Matchers/MatcherProtocol) +# can be used as a matcher. +# +# ## Predicates +# +# In addition to matchers that are defined explicitly, RSpec will create +# custom matchers on the fly for any arbitrary predicate, giving your specs a +# much more natural language feel. +# +# A Ruby predicate is a method that ends with a "?" and returns true or false. +# Common examples are `empty?`, `nil?`, and `instance_of?`. +# +# All you need to do is write `expect(..).to be_` followed by the predicate +# without the question mark, and RSpec will figure it out from there. +# For example: +# +# expect([]).to be_empty # => [].empty?() | passes +# expect([]).not_to be_empty # => [].empty?() | fails +# +# In addition to prefixing the predicate matchers with "be_", you can also use "be_a_" +# and "be_an_", making your specs read much more naturally: +# +# expect("a string").to be_an_instance_of(String) # =>"a string".instance_of?(String) # passes +# +# expect(3).to be_a_kind_of(Integer) # => 3.kind_of?(Numeric) | passes +# expect(3).to be_a_kind_of(Numeric) # => 3.kind_of?(Numeric) | passes +# expect(3).to be_an_instance_of(Integer) # => 3.instance_of?(Integer) | passes +# expect(3).not_to be_an_instance_of(Numeric) # => 3.instance_of?(Numeric) | fails +# +# RSpec will also create custom matchers for predicates like `has_key?`. To +# use this feature, just state that the object should have_key(:key) and RSpec will +# call has_key?(:key) on the target. For example: +# +# expect(:a => "A").to have_key(:a) +# expect(:a => "A").to have_key(:b) # fails +# +# You can use this feature to invoke any predicate that begins with "has_", whether it is +# part of the Ruby libraries (like `Hash#has_key?`) or a method you wrote on your own class. +# +# Note that RSpec does not provide composable aliases for these dynamic predicate +# matchers. You can easily define your own aliases, though: +# +# RSpec::Matchers.alias_matcher :a_user_who_is_an_admin, :be_an_admin +# expect(user_list).to include(a_user_who_is_an_admin) +# +# ## Alias Matchers +# +# With {RSpec::Matchers.alias_matcher}, you can easily create an +# alternate name for a given matcher. +# +# The description will also change according to the new name: +# +# RSpec::Matchers.alias_matcher :a_list_that_sums_to, :sum_to +# sum_to(3).description # => "sum to 3" +# a_list_that_sums_to(3).description # => "a list that sums to 3" +# +# or you can specify a custom description like this: +# +# RSpec::Matchers.alias_matcher :a_list_sorted_by, :be_sorted_by do |description| +# description.sub("be sorted by", "a list sorted by") +# end +# +# be_sorted_by(:age).description # => "be sorted by age" +# a_list_sorted_by(:age).description # => "a list sorted by age" +# +# ## Custom Matchers +# +# When you find that none of the stock matchers provide a natural feeling +# expectation, you can very easily write your own using RSpec's matcher DSL +# or writing one from scratch. +# +# ### Matcher DSL +# +# Imagine that you are writing a game in which players can be in various +# zones on a virtual board. To specify that bob should be in zone 4, you +# could say: +# +# expect(bob.current_zone).to eql(Zone.new("4")) +# +# But you might find it more expressive to say: +# +# expect(bob).to be_in_zone("4") +# +# and/or +# +# expect(bob).not_to be_in_zone("3") +# +# You can create such a matcher like so: +# +# RSpec::Matchers.define :be_in_zone do |zone| +# match do |player| +# player.in_zone?(zone) +# end +# end +# +# This will generate a be_in_zone method that returns a matcher +# with logical default messages for failures. You can override the failure +# messages and the generated description as follows: +# +# RSpec::Matchers.define :be_in_zone do |zone| +# match do |player| +# player.in_zone?(zone) +# end +# +# failure_message do |player| +# # generate and return the appropriate string. +# end +# +# failure_message_when_negated do |player| +# # generate and return the appropriate string. +# end +# +# description do +# # generate and return the appropriate string. +# end +# end +# +# Each of the message-generation methods has access to the block arguments +# passed to the create method (in this case, zone). The +# failure message methods (failure_message and +# failure_message_when_negated) are passed the actual value (the +# receiver of expect(..) or expect(..).not_to). +# +# ### Custom Matcher from scratch +# +# You could also write a custom matcher from scratch, as follows: +# +# class BeInZone +# def initialize(expected) +# @expected = expected +# end +# +# def matches?(target) +# @target = target +# @target.current_zone.eql?(Zone.new(@expected)) +# end +# +# def failure_message +# "expected #{@target.inspect} to be in Zone #{@expected}" +# end +# +# def failure_message_when_negated +# "expected #{@target.inspect} not to be in Zone #{@expected}" +# end +# end +# +# ... and a method like this: +# +# def be_in_zone(expected) +# BeInZone.new(expected) +# end +# +# And then expose the method to your specs. This is normally done +# by including the method and the class in a module, which is then +# included in your spec: +# +# module CustomGameMatchers +# class BeInZone +# # ... +# end +# +# def be_in_zone(expected) +# # ... +# end +# end +# +# describe "Player behaviour" do +# include CustomGameMatchers +# # ... +# end +# +# or you can include in globally in a spec_helper.rb file required +# from your spec file(s): +# +# RSpec::configure do |config| +# config.include(CustomGameMatchers) +# end +# +# ### Making custom matchers composable +# +# RSpec's built-in matchers are designed to be composed, in expressions like: +# +# expect(["barn", 2.45]).to contain_exactly( +# a_value_within(0.1).of(2.5), +# a_string_starting_with("bar") +# ) +# +# Custom matchers can easily participate in composed matcher expressions like these. +# Include {RSpec::Matchers::Composable} in your custom matcher to make it support +# being composed (matchers defined using the DSL have this included automatically). +# Within your matcher's `matches?` method (or the `match` block, if using the DSL), +# use `values_match?(expected, actual)` rather than `expected == actual`. +# Under the covers, `values_match?` is able to match arbitrary +# nested data structures containing a mix of both matchers and non-matcher objects. +# It uses `===` and `==` to perform the matching, considering the values to +# match if either returns `true`. The `Composable` mixin also provides some helper +# methods for surfacing the matcher descriptions within your matcher's description +# or failure messages. +# +# RSpec's built-in matchers each have a number of aliases that rephrase the matcher +# from a verb phrase (such as `be_within`) to a noun phrase (such as `a_value_within`), +# which reads better when the matcher is passed as an argument in a composed matcher +# expressions, and also uses the noun-phrase wording in the matcher's `description`, +# for readable failure messages. You can alias your custom matchers in similar fashion +# using {RSpec::Matchers.alias_matcher}. +# +# ## Negated Matchers +# +# Sometimes if you want to test for the opposite using a more descriptive name +# instead of using `not_to`, you can use {RSpec::Matchers.define_negated_matcher}: +# +# RSpec::Matchers.define_negated_matcher :exclude, :include +# include(1, 2).description # => "include 1 and 2" +# exclude(1, 2).description # => "exclude 1 and 2" +# +# While the most obvious negated form may be to add a `not_` prefix, +# the failure messages you get with that form can be confusing (e.g. +# "expected [actual] to not [verb], but did not"). We've found it works +# best to find a more positive name for the negated form, such as +# `avoid_changing` rather than `not_change`. +# +# source://rspec-expectations//lib/rspec/matchers/english_phrasing.rb#2 +module RSpec::Matchers + extend ::RSpec::Matchers::DSL + + # Applied to a proc, specifies that its execution will cause some value to + # change. + # + # You can either pass receiver and message, or a block, + # but not both. + # + # When passing a block, it must use the `{ ... }` format, not + # do/end, as `{ ... }` binds to the `change` method, whereas do/end + # would errantly bind to the `expect(..).to` or `expect(...).not_to` method. + # + # You can chain any of the following off of the end to specify details + # about the change: + # + # * `from` + # * `to` + # + # or any one of: + # + # * `by` + # * `by_at_least` + # * `by_at_most` + # + # == Notes + # + # Evaluates `receiver.message` or `block` before and after it + # evaluates the block passed to `expect`. If the value is the same + # object, its before/after `hash` value is used to see if it has changed. + # Therefore, your object needs to properly implement `hash` to work correctly + # with this matcher. + # + # `expect( ... ).not_to change` supports the form that specifies `from` + # (which specifies what you expect the starting, unchanged value to be) + # but does not support forms with subsequent calls to `by`, `by_at_least`, + # `by_at_most` or `to`. + # + # @example + # expect { + # team.add_player(player) + # }.to change(roster, :count) + # + # expect { + # team.add_player(player) + # }.to change(roster, :count).by(1) + # + # expect { + # team.add_player(player) + # }.to change(roster, :count).by_at_least(1) + # + # expect { + # team.add_player(player) + # }.to change(roster, :count).by_at_most(1) + # + # string = "string" + # expect { + # string.reverse! + # }.to change { string }.from("string").to("gnirts") + # + # string = "string" + # expect { + # string + # }.not_to change { string }.from("string") + # + # expect { + # person.happy_birthday + # }.to change(person, :birthday).from(32).to(33) + # + # expect { + # employee.develop_great_new_social_networking_app + # }.to change(employee, :title).from("Mail Clerk").to("CEO") + # + # expect { + # doctor.leave_office + # }.to change(doctor, :sign).from(/is in/).to(/is out/) + # + # user = User.new(:type => "admin") + # expect { + # user.symbolize_type + # }.to change(user, :type).from(String).to(Symbol) + # @param receiver [Object] + # @param message [Symbol] the message to send the receiver + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_changing(*args, **_arg1, &block); end + + # With no arg, passes if the block outputs `to_stdout` or `to_stderr`. + # With a string, passes if the block outputs that specific string `to_stdout` or `to_stderr`. + # With a regexp or matcher, passes if the block outputs a string `to_stdout` or `to_stderr` that matches. + # + # To capture output from any spawned subprocess as well, use `to_stdout_from_any_process` or + # `to_stderr_from_any_process`. Output from any process that inherits the main process's corresponding + # standard stream will be captured. + # + # @example + # expect { print 'foo' }.to output.to_stdout + # expect { print 'foo' }.to output('foo').to_stdout + # expect { print 'foo' }.to output(/foo/).to_stdout + # + # expect { do_something }.to_not output.to_stdout + # + # expect { warn('foo') }.to output.to_stderr + # expect { warn('foo') }.to output('foo').to_stderr + # expect { warn('foo') }.to output(/foo/).to_stderr + # + # expect { do_something }.to_not output.to_stderr + # + # expect { system('echo foo') }.to output("foo\n").to_stdout_from_any_process + # expect { system('echo foo', out: :err) }.to output("foo\n").to_stderr_from_any_process + # @note `to_stdout` and `to_stderr` work by temporarily replacing `$stdout` or `$stderr`, + # so they're not able to intercept stream output that explicitly uses `STDOUT`/`STDERR` + # or that uses a reference to `$stdout`/`$stderr` that was stored before the + # matcher was used. + # @note `to_stdout_from_any_process` and `to_stderr_from_any_process` use Tempfiles, and + # are thus significantly (~30x) slower than `to_stdout` and `to_stderr`. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_outputting(*args, **_arg1, &block); end + + # With no args, matches if any error is raised. + # With a named error, matches only if that specific error is raised. + # With a named error and message specified as a String, matches only if both match. + # With a named error and message specified as a Regexp, matches only if both match. + # Pass an optional block to perform extra verifications on the exception matched + # + # @example + # expect { do_something_risky }.to raise_error + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError) + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError) { |error| expect(error.data).to eq 42 } + # expect { do_something_risky }.to raise_error { |error| expect(error.data).to eq 42 } + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError, "that was too risky") + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError, /oo ri/) + # expect { do_something_risky }.to raise_error("that was too risky") + # + # expect { do_something_risky }.not_to raise_error + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_raising(*args, **_arg1, &block); end + + # Given no argument, matches if a proc throws any Symbol. + # + # Given a Symbol, matches if the given proc throws the specified Symbol. + # + # Given a Symbol and an arg, matches if the given proc throws the + # specified Symbol with the specified arg. + # + # @example + # expect { do_something_risky }.to throw_symbol + # expect { do_something_risky }.to throw_symbol(:that_was_risky) + # expect { do_something_risky }.to throw_symbol(:that_was_risky, 'culprit') + # + # expect { do_something_risky }.not_to throw_symbol + # expect { do_something_risky }.not_to throw_symbol(:that_was_risky) + # expect { do_something_risky }.not_to throw_symbol(:that_was_risky, 'culprit') + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_throwing(*args, **_arg1, &block); end + + # Passes if the method called in the expect block yields, regardless + # of whether or not arguments are yielded. + # + # @example + # expect { |b| 5.tap(&b) }.to yield_control + # expect { |b| "a".to_sym(&b) }.not_to yield_control + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_yielding_control(*args, **_arg1, &block); end + + # Designed for use with methods that repeatedly yield (such as + # iterators). Passes if the method called in the expect block yields + # multiple times with arguments matching those given. + # + # Argument matching is done using `===` (the case match operator) + # and `==`. If the expected and actual arguments match with either + # operator, the matcher will pass. + # + # @example + # expect { |b| [1, 2, 3].each(&b) }.to yield_successive_args(1, 2, 3) + # expect { |b| { :a => 1, :b => 2 }.each(&b) }.to yield_successive_args([:a, 1], [:b, 2]) + # expect { |b| [1, 2, 3].each(&b) }.not_to yield_successive_args(1, 2) + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_yielding_successive_args(*args, **_arg1, &block); end + + # Given no arguments, matches if the method called in the expect + # block yields with arguments (regardless of what they are or how + # many there are). + # + # Given arguments, matches if the method called in the expect block + # yields with arguments that match the given arguments. + # + # Argument matching is done using `===` (the case match operator) + # and `==`. If the expected and actual arguments match with either + # operator, the matcher will pass. + # + # @example + # expect { |b| 5.tap(&b) }.to yield_with_args # because #tap yields an arg + # expect { |b| 5.tap(&b) }.to yield_with_args(5) # because 5 == 5 + # expect { |b| 5.tap(&b) }.to yield_with_args(Integer) # because Integer === 5 + # expect { |b| File.open("f.txt", &b) }.to yield_with_args(/txt/) # because /txt/ === "f.txt" + # + # expect { |b| User.transaction(&b) }.not_to yield_with_args # because it yields no args + # expect { |b| 5.tap(&b) }.not_to yield_with_args(1, 2, 3) + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # @note This matcher is not designed for use with methods that yield + # multiple times. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_yielding_with_args(*args, **_arg1, &block); end + + # Passes if the method called in the expect block yields with + # no arguments. Fails if it does not yield, or yields with arguments. + # + # @example + # expect { |b| User.transaction(&b) }.to yield_with_no_args + # expect { |b| 5.tap(&b) }.not_to yield_with_no_args # because it yields with `5` + # expect { |b| "a".to_sym(&b) }.not_to yield_with_no_args # because it does not yield + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # @note This matcher is not designed for use with methods that yield + # multiple times. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_yielding_with_no_args(*args, **_arg1, &block); end + + # Passes if actual contains all of the expected regardless of order. + # This works for collections. Pass in multiple args and it will only + # pass if all args are found in collection. + # + # @example + # expect([1, 2, 3]).to contain_exactly(1, 2, 3) + # expect([1, 2, 3]).to contain_exactly(1, 3, 2) + # @note This is also available using the `=~` operator with `should`, + # but `=~` is not supported with `expect`. + # @see #match_array + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_collection_containing_exactly(*args, **_arg1, &block); end + + # Matches if the actual value ends with the expected value(s). In the case + # of a string, matches against the last `expected.length` characters of the + # actual string. In the case of an array, matches against the last + # `expected.length` elements of the actual array. + # + # @example + # expect("this string").to end_with "string" + # expect([0, 1, 2, 3, 4]).to end_with 4 + # expect([0, 2, 3, 4, 4]).to end_with 3, 4 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_collection_ending_with(*args, **_arg1, &block); end + + # Passes if actual includes expected. This works for + # collections and Strings. You can also pass in multiple args + # and it will only pass if all args are found in collection. + # + # @example + # expect([1,2,3]).to include(3) + # expect([1,2,3]).to include(2,3) + # expect([1,2,3]).to include(2,3,4) # fails + # expect([1,2,3]).not_to include(4) + # expect("spread").to include("read") + # expect("spread").not_to include("red") + # expect(:a => 1, :b => 2).to include(:a) + # expect(:a => 1, :b => 2).to include(:a, :b) + # expect(:a => 1, :b => 2).to include(:a => 1) + # expect(:a => 1, :b => 2).to include(:b => 2, :a => 1) + # expect(:a => 1, :b => 2).to include(:c) # fails + # expect(:a => 1, :b => 2).not_to include(:a => 2) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_collection_including(*args, **_arg1, &block); end + + # Matches if the actual value starts with the expected value(s). In the + # case of a string, matches against the first `expected.length` characters + # of the actual string. In the case of an array, matches against the first + # `expected.length` elements of the actual array. + # + # @example + # expect("this string").to start_with "this s" + # expect([0, 1, 2, 3, 4]).to start_with 0 + # expect([0, 2, 3, 4, 4]).to start_with 0, 1 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_collection_starting_with(*args, **_arg1, &block); end + + # Passes if actual is falsey (false or nil) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_falsey_value(*args, **_arg1, &block); end + + # Passes if actual is falsey (false or nil) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_falsy_value(*args, **_arg1, &block); end + + # Passes if actual includes expected. This works for + # collections and Strings. You can also pass in multiple args + # and it will only pass if all args are found in collection. + # + # @example + # expect([1,2,3]).to include(3) + # expect([1,2,3]).to include(2,3) + # expect([1,2,3]).to include(2,3,4) # fails + # expect([1,2,3]).not_to include(4) + # expect("spread").to include("read") + # expect("spread").not_to include("red") + # expect(:a => 1, :b => 2).to include(:a) + # expect(:a => 1, :b => 2).to include(:a, :b) + # expect(:a => 1, :b => 2).to include(:a => 1) + # expect(:a => 1, :b => 2).to include(:b => 2, :a => 1) + # expect(:a => 1, :b => 2).to include(:c) # fails + # expect(:a => 1, :b => 2).not_to include(:a => 2) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_hash_including(*args, **_arg1, &block); end + + # Passes if actual.kind_of?(expected) + # + # @example + # expect(5).to be_a_kind_of(Integer) + # expect(5).to be_a_kind_of(Numeric) + # expect(5).not_to be_a_kind_of(Float) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_kind_of(*args, **_arg1, &block); end + + # Passes if actual is nil + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_nil_value(*args, **_arg1, &block); end + + # Passes if actual covers expected. This works for + # Ranges. You can also pass in multiple args + # and it will only pass if all args are found in Range. + # + # ### Warning:: Ruby >= 1.9 only + # + # @example + # expect(1..10).to cover(5) + # expect(1..10).to cover(4, 6) + # expect(1..10).to cover(4, 6, 11) # fails + # expect(1..10).not_to cover(11) + # expect(1..10).not_to cover(5) # fails + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_range_covering(*args, **_arg1, &block); end + + # Matches if the actual value ends with the expected value(s). In the case + # of a string, matches against the last `expected.length` characters of the + # actual string. In the case of an array, matches against the last + # `expected.length` elements of the actual array. + # + # @example + # expect("this string").to end_with "string" + # expect([0, 1, 2, 3, 4]).to end_with 4 + # expect([0, 2, 3, 4, 4]).to end_with 3, 4 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_string_ending_with(*args, **_arg1, &block); end + + # Passes if actual includes expected. This works for + # collections and Strings. You can also pass in multiple args + # and it will only pass if all args are found in collection. + # + # @example + # expect([1,2,3]).to include(3) + # expect([1,2,3]).to include(2,3) + # expect([1,2,3]).to include(2,3,4) # fails + # expect([1,2,3]).not_to include(4) + # expect("spread").to include("read") + # expect("spread").not_to include("red") + # expect(:a => 1, :b => 2).to include(:a) + # expect(:a => 1, :b => 2).to include(:a, :b) + # expect(:a => 1, :b => 2).to include(:a => 1) + # expect(:a => 1, :b => 2).to include(:b => 2, :a => 1) + # expect(:a => 1, :b => 2).to include(:c) # fails + # expect(:a => 1, :b => 2).not_to include(:a => 2) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_string_including(*args, **_arg1, &block); end + + # Given a `Regexp` or `String`, passes if `actual.match(pattern)` + # Given an arbitrary nested data structure (e.g. arrays and hashes), + # matches if `expected === actual` || `actual == expected` for each + # pair of elements. + # + # @example + # expect(email).to match(/^([^\s]+)((?:[-a-z0-9]+\.)+[a-z]{2,})$/i) + # expect(email).to match("@example.com") + # @example + # hash = { + # :a => { + # :b => ["foo", 5], + # :c => { :d => 2.05 } + # } + # } + # + # expect(hash).to match( + # :a => { + # :b => a_collection_containing_exactly( + # a_string_starting_with("f"), + # an_instance_of(Integer) + # ), + # :c => { :d => (a_value < 3) } + # } + # ) + # @note The `match_regex` alias is deprecated and is not recommended for use. + # It was added in 2.12.1 to facilitate its use from within custom + # matchers (due to how the custom matcher DSL was evaluated in 2.x, + # `match` could not be used there), but is no longer needed in 3.x. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_string_matching(*args, **_arg1, &block); end + + # Matches if the actual value starts with the expected value(s). In the + # case of a string, matches against the first `expected.length` characters + # of the actual string. In the case of an array, matches against the first + # `expected.length` elements of the actual array. + # + # @example + # expect("this string").to start_with "this s" + # expect([0, 1, 2, 3, 4]).to start_with 0 + # expect([0, 2, 3, 4, 4]).to start_with 0, 1 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_string_starting_with(*args, **_arg1, &block); end + + # Passes if actual is truthy (anything but false or nil) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_truthy_value(*args, **_arg1, &block); end + + # Given true, false, or nil, will pass if actual value is true, false or + # nil (respectively). Given no args means the caller should satisfy an if + # condition (to be or not to be). + # + # Predicates are any Ruby method that ends in a "?" and returns true or + # false. Given be_ followed by arbitrary_predicate (without the "?"), + # RSpec will match convert that into a query against the target object. + # + # The arbitrary_predicate feature will handle any predicate prefixed with + # "be_an_" (e.g. be_an_instance_of), "be_a_" (e.g. be_a_kind_of) or "be_" + # (e.g. be_empty), letting you choose the prefix that best suits the + # predicate. + # + # @example + # expect(actual).to be_truthy + # expect(actual).to be_falsey + # expect(actual).to be_nil + # expect(actual).to be_[arbitrary_predicate](*args) + # expect(actual).not_to be_nil + # expect(actual).not_to be_[arbitrary_predicate](*args) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_value(*args, **_arg1, &block); end + + # Passes if actual.between?(min, max). Works with any Comparable object, + # including String, Symbol, Time, or Numeric (Fixnum, Bignum, Integer, + # Float, Complex, and Rational). + # + # By default, `be_between` is inclusive (i.e. passes when given either the max or min value), + # but you can make it `exclusive` by chaining that off the matcher. + # + # @example + # expect(5).to be_between(1, 10) + # expect(11).not_to be_between(1, 10) + # expect(10).not_to be_between(1, 10).exclusive + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_value_between(*args, **_arg1, &block); end + + # Passes if actual == expected +/- delta + # + # @example + # expect(result).to be_within(0.5).of(3.0) + # expect(result).not_to be_within(0.5).of(3.0) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_value_within(*args, **_arg1, &block); end + + # Allows multiple expectations in the provided block to fail, and then + # aggregates them into a single exception, rather than aborting on the + # first expectation failure like normal. This allows you to see all + # failures from an entire set of expectations without splitting each + # off into its own example (which may slow things down if the example + # setup is expensive). + # + # @example + # aggregate_failures("verifying response") do + # expect(response.status).to eq(200) + # expect(response.headers).to include("Content-Type" => "text/plain") + # expect(response.body).to include("Success") + # end + # @note The implementation of this feature uses a thread-local variable, + # which means that if you have an expectation failure in another thread, + # it'll abort like normal. + # @param label [String] label for this aggregation block, which will be + # included in the aggregated exception message. + # @param metadata [Hash] additional metadata about this failure aggregation + # block. If multiple expectations fail, it will be exposed from the + # {Expectations::MultipleExpectationsNotMetError} exception. Mostly + # intended for internal RSpec use but you can use it as well. + # @raise [Expectations::MultipleExpectationsNotMetError] raised when + # multiple expectations fail. + # @raise [Expectations::ExpectationNotMetError] raised when a single + # expectation fails. + # @raise [Exception] other sorts of exceptions will be raised as normal. + # @yield Block containing as many expectation as you want. The block is + # simply yielded to, so you can trust that anything that works outside + # the block should work within it. + # + # source://rspec-expectations//lib/rspec/matchers.rb#305 + def aggregate_failures(label = T.unsafe(nil), metadata = T.unsafe(nil), &block); end + + # Passes if the provided matcher passes when checked against all + # elements of the collection. + # + # @example + # expect([1, 3, 5]).to all be_odd + # expect([1, 3, 6]).to all be_odd # fails + # @example + # expect([1, 3, 5]).to all( be_odd.and be_an(Integer) ) + # @note The negative form `not_to all` is not supported. Instead + # use `not_to include` or pass a negative form of a matcher + # as the argument (e.g. `all exclude(:foo)`). + # @note You can also use this with compound matchers as well. + # + # source://rspec-expectations//lib/rspec/matchers.rb#662 + def all(expected); end + + # An alternate form of `contain_exactly` that accepts + # the expected contents as a single array arg rather + # than splatted out as individual items. + # + # @example + # expect(results).to contain_exactly(1, 2) + # # is identical to: + # expect(results).to match_array([1, 2]) + # @see #contain_exactly + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_array_matching(*args, **_arg1, &block); end + + # Passes if actual.instance_of?(expected) + # + # @example + # expect(5).to be_an_instance_of(Integer) + # expect(5).not_to be_an_instance_of(Numeric) + # expect(5).not_to be_an_instance_of(Float) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_instance_of(*args, **_arg1, &block); end + + # Passes if actual == expected. + # + # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more + # information about equality in Ruby. + # + # @example + # expect(5).to eq(5) + # expect(5).not_to eq(3) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_eq_to(*args, **_arg1, &block); end + + # Passes if `actual.eql?(expected)` + # + # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more + # information about equality in Ruby. + # + # @example + # expect(5).to eql(5) + # expect(5).not_to eql(3) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_eql_to(*args, **_arg1, &block); end + + # Passes if actual.equal?(expected) (object identity). + # + # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more + # information about equality in Ruby. + # + # @example + # expect(5).to equal(5) # Integers are equal + # expect("5").not_to equal("5") # Strings that look the same are not the same object + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_equal_to(*args, **_arg1, &block); end + + # Passes if `actual.exist?` or `actual.exists?` + # + # @example + # expect(File).to exist("path/to/file") + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_existing(*args, **_arg1, &block); end + + # Passes if actual's attribute values match the expected attributes hash. + # This works no matter how you define your attribute readers. + # + # @example + # Person = Struct.new(:name, :age) + # person = Person.new("Bob", 32) + # + # expect(person).to have_attributes(:name => "Bob", :age => 32) + # expect(person).to have_attributes(:name => a_string_starting_with("B"), :age => (a_value > 30) ) + # @example + # expect(person).to have_attributes(:color => "red") + # @note It will fail if actual doesn't respond to any of the expected attributes. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_having_attributes(*args, **_arg1, &block); end + + # Given a `Regexp` or `String`, passes if `actual.match(pattern)` + # Given an arbitrary nested data structure (e.g. arrays and hashes), + # matches if `expected === actual` || `actual == expected` for each + # pair of elements. + # + # @example + # expect(email).to match(/^([^\s]+)((?:[-a-z0-9]+\.)+[a-z]{2,})$/i) + # expect(email).to match("@example.com") + # @example + # hash = { + # :a => { + # :b => ["foo", 5], + # :c => { :d => 2.05 } + # } + # } + # + # expect(hash).to match( + # :a => { + # :b => a_collection_containing_exactly( + # a_string_starting_with("f"), + # an_instance_of(Integer) + # ), + # :c => { :d => (a_value < 3) } + # } + # ) + # @note The `match_regex` alias is deprecated and is not recommended for use. + # It was added in 2.12.1 to facilitate its use from within custom + # matchers (due to how the custom matcher DSL was evaluated in 2.x, + # `match` could not be used there), but is no longer needed in 3.x. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_matching(*args, **_arg1, &block); end + + # Matches if the target object responds to all of the names + # provided. Names can be Strings or Symbols. + # + # @example + # expect("string").to respond_to(:length) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_responding_to(*args, **_arg1, &block); end + + # Passes if the submitted block returns true. Yields target to the + # block. + # + # Generally speaking, this should be thought of as a last resort when + # you can't find any other way to specify the behaviour you wish to + # specify. + # + # If you do find yourself in such a situation, you could always write + # a custom matcher, which would likely make your specs more expressive. + # + # @example + # expect(5).to satisfy { |n| n > 3 } + # expect(5).to satisfy("be greater than 3") { |n| n > 3 } + # @param description [String] optional description to be used for this matcher. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_satisfying(*args, **_arg1, &block); end + + # Given true, false, or nil, will pass if actual value is true, false or + # nil (respectively). Given no args means the caller should satisfy an if + # condition (to be or not to be). + # + # Predicates are any Ruby method that ends in a "?" and returns true or + # false. Given be_ followed by arbitrary_predicate (without the "?"), + # RSpec will match convert that into a query against the target object. + # + # The arbitrary_predicate feature will handle any predicate prefixed with + # "be_an_" (e.g. be_an_instance_of), "be_a_" (e.g. be_a_kind_of) or "be_" + # (e.g. be_empty), letting you choose the prefix that best suits the + # predicate. + # + # @example + # expect(actual).to be_truthy + # expect(actual).to be_falsey + # expect(actual).to be_nil + # expect(actual).to be_[arbitrary_predicate](*args) + # expect(actual).not_to be_nil + # expect(actual).not_to be_[arbitrary_predicate](*args) + # + # source://rspec-expectations//lib/rspec/matchers.rb#349 + def be(*args); end + + # passes if target.kind_of?(klass) + # + # source://rspec-expectations//lib/rspec/matchers.rb#355 + def be_a(klass); end + + # Passes if actual.kind_of?(expected) + # + # @example + # expect(5).to be_a_kind_of(Integer) + # expect(5).to be_a_kind_of(Numeric) + # expect(5).not_to be_a_kind_of(Float) + # + # source://rspec-expectations//lib/rspec/matchers.rb#378 + def be_a_kind_of(expected); end + + # passes if target.kind_of?(klass) + # + # source://rspec-expectations//lib/rspec/matchers.rb#355 + def be_an(klass); end + + # Passes if actual.instance_of?(expected) + # + # @example + # expect(5).to be_an_instance_of(Integer) + # expect(5).not_to be_an_instance_of(Numeric) + # expect(5).not_to be_an_instance_of(Float) + # + # source://rspec-expectations//lib/rspec/matchers.rb#366 + def be_an_instance_of(expected); end + + # Passes if actual.between?(min, max). Works with any Comparable object, + # including String, Symbol, Time, or Numeric (Fixnum, Bignum, Integer, + # Float, Complex, and Rational). + # + # By default, `be_between` is inclusive (i.e. passes when given either the max or min value), + # but you can make it `exclusive` by chaining that off the matcher. + # + # @example + # expect(5).to be_between(1, 10) + # expect(11).not_to be_between(1, 10) + # expect(10).not_to be_between(1, 10).exclusive + # + # source://rspec-expectations//lib/rspec/matchers.rb#395 + def be_between(min, max); end + + # Passes if actual is falsey (false or nil) + # + # source://rspec-expectations//lib/rspec/matchers.rb#316 + def be_falsey; end + + # Passes if actual is falsey (false or nil) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def be_falsy(*args, **_arg1, &block); end + + # Passes if actual.instance_of?(expected) + # + # @example + # expect(5).to be_an_instance_of(Integer) + # expect(5).not_to be_an_instance_of(Numeric) + # expect(5).not_to be_an_instance_of(Float) + # + # source://rspec-expectations//lib/rspec/matchers.rb#366 + def be_instance_of(expected); end + + # Passes if actual.kind_of?(expected) + # + # @example + # expect(5).to be_a_kind_of(Integer) + # expect(5).to be_a_kind_of(Numeric) + # expect(5).not_to be_a_kind_of(Float) + # + # source://rspec-expectations//lib/rspec/matchers.rb#378 + def be_kind_of(expected); end + + # Passes if actual is nil + # + # source://rspec-expectations//lib/rspec/matchers.rb#324 + def be_nil; end + + # Passes if actual is truthy (anything but false or nil) + # + # source://rspec-expectations//lib/rspec/matchers.rb#310 + def be_truthy; end + + # Passes if actual == expected +/- delta + # + # @example + # expect(result).to be_within(0.5).of(3.0) + # expect(result).not_to be_within(0.5).of(3.0) + # + # source://rspec-expectations//lib/rspec/matchers.rb#405 + def be_within(delta); end + + # Applied to a proc, specifies that its execution will cause some value to + # change. + # + # You can either pass receiver and message, or a block, + # but not both. + # + # When passing a block, it must use the `{ ... }` format, not + # do/end, as `{ ... }` binds to the `change` method, whereas do/end + # would errantly bind to the `expect(..).to` or `expect(...).not_to` method. + # + # You can chain any of the following off of the end to specify details + # about the change: + # + # * `from` + # * `to` + # + # or any one of: + # + # * `by` + # * `by_at_least` + # * `by_at_most` + # + # == Notes + # + # Evaluates `receiver.message` or `block` before and after it + # evaluates the block passed to `expect`. If the value is the same + # object, its before/after `hash` value is used to see if it has changed. + # Therefore, your object needs to properly implement `hash` to work correctly + # with this matcher. + # + # `expect( ... ).not_to change` supports the form that specifies `from` + # (which specifies what you expect the starting, unchanged value to be) + # but does not support forms with subsequent calls to `by`, `by_at_least`, + # `by_at_most` or `to`. + # + # @example + # expect { + # team.add_player(player) + # }.to change(roster, :count) + # + # expect { + # team.add_player(player) + # }.to change(roster, :count).by(1) + # + # expect { + # team.add_player(player) + # }.to change(roster, :count).by_at_least(1) + # + # expect { + # team.add_player(player) + # }.to change(roster, :count).by_at_most(1) + # + # string = "string" + # expect { + # string.reverse! + # }.to change { string }.from("string").to("gnirts") + # + # string = "string" + # expect { + # string + # }.not_to change { string }.from("string") + # + # expect { + # person.happy_birthday + # }.to change(person, :birthday).from(32).to(33) + # + # expect { + # employee.develop_great_new_social_networking_app + # }.to change(employee, :title).from("Mail Clerk").to("CEO") + # + # expect { + # doctor.leave_office + # }.to change(doctor, :sign).from(/is in/).to(/is out/) + # + # user = User.new(:type => "admin") + # expect { + # user.symbolize_type + # }.to change(user, :type).from(String).to(Symbol) + # @param receiver [Object] + # @param message [Symbol] the message to send the receiver + # + # source://rspec-expectations//lib/rspec/matchers.rb#492 + def change(receiver = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # Applied to a proc, specifies that its execution will cause some value to + # change. + # + # You can either pass receiver and message, or a block, + # but not both. + # + # When passing a block, it must use the `{ ... }` format, not + # do/end, as `{ ... }` binds to the `change` method, whereas do/end + # would errantly bind to the `expect(..).to` or `expect(...).not_to` method. + # + # You can chain any of the following off of the end to specify details + # about the change: + # + # * `from` + # * `to` + # + # or any one of: + # + # * `by` + # * `by_at_least` + # * `by_at_most` + # + # == Notes + # + # Evaluates `receiver.message` or `block` before and after it + # evaluates the block passed to `expect`. If the value is the same + # object, its before/after `hash` value is used to see if it has changed. + # Therefore, your object needs to properly implement `hash` to work correctly + # with this matcher. + # + # `expect( ... ).not_to change` supports the form that specifies `from` + # (which specifies what you expect the starting, unchanged value to be) + # but does not support forms with subsequent calls to `by`, `by_at_least`, + # `by_at_most` or `to`. + # + # @example + # expect { + # team.add_player(player) + # }.to change(roster, :count) + # + # expect { + # team.add_player(player) + # }.to change(roster, :count).by(1) + # + # expect { + # team.add_player(player) + # }.to change(roster, :count).by_at_least(1) + # + # expect { + # team.add_player(player) + # }.to change(roster, :count).by_at_most(1) + # + # string = "string" + # expect { + # string.reverse! + # }.to change { string }.from("string").to("gnirts") + # + # string = "string" + # expect { + # string + # }.not_to change { string }.from("string") + # + # expect { + # person.happy_birthday + # }.to change(person, :birthday).from(32).to(33) + # + # expect { + # employee.develop_great_new_social_networking_app + # }.to change(employee, :title).from("Mail Clerk").to("CEO") + # + # expect { + # doctor.leave_office + # }.to change(doctor, :sign).from(/is in/).to(/is out/) + # + # user = User.new(:type => "admin") + # expect { + # user.symbolize_type + # }.to change(user, :type).from(String).to(Symbol) + # @param receiver [Object] + # @param message [Symbol] the message to send the receiver + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def changing(*args, **_arg1, &block); end + + # Passes if actual contains all of the expected regardless of order. + # This works for collections. Pass in multiple args and it will only + # pass if all args are found in collection. + # + # @example + # expect([1, 2, 3]).to contain_exactly(1, 2, 3) + # expect([1, 2, 3]).to contain_exactly(1, 3, 2) + # @note This is also available using the `=~` operator with `should`, + # but `=~` is not supported with `expect`. + # @see #match_array + # + # source://rspec-expectations//lib/rspec/matchers.rb#510 + def contain_exactly(*items); end + + # Passes if actual contains all of the expected regardless of order. + # This works for collections. Pass in multiple args and it will only + # pass if all args are found in collection. + # + # @example + # expect([1, 2, 3]).to contain_exactly(1, 2, 3) + # expect([1, 2, 3]).to contain_exactly(1, 3, 2) + # @note This is also available using the `=~` operator with `should`, + # but `=~` is not supported with `expect`. + # @see #match_array + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def containing_exactly(*args, **_arg1, &block); end + + # Passes if actual covers expected. This works for + # Ranges. You can also pass in multiple args + # and it will only pass if all args are found in Range. + # + # ### Warning:: Ruby >= 1.9 only + # + # @example + # expect(1..10).to cover(5) + # expect(1..10).to cover(4, 6) + # expect(1..10).to cover(4, 6, 11) # fails + # expect(1..10).not_to cover(11) + # expect(1..10).not_to cover(5) # fails + # + # source://rspec-expectations//lib/rspec/matchers.rb#528 + def cover(*values); end + + # Passes if actual covers expected. This works for + # Ranges. You can also pass in multiple args + # and it will only pass if all args are found in Range. + # + # ### Warning:: Ruby >= 1.9 only + # + # @example + # expect(1..10).to cover(5) + # expect(1..10).to cover(4, 6) + # expect(1..10).to cover(4, 6, 11) # fails + # expect(1..10).not_to cover(11) + # expect(1..10).not_to cover(5) # fails + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def covering(*args, **_arg1, &block); end + + # Matches if the actual value ends with the expected value(s). In the case + # of a string, matches against the last `expected.length` characters of the + # actual string. In the case of an array, matches against the last + # `expected.length` elements of the actual array. + # + # @example + # expect("this string").to end_with "string" + # expect([0, 1, 2, 3, 4]).to end_with 4 + # expect([0, 2, 3, 4, 4]).to end_with 3, 4 + # + # source://rspec-expectations//lib/rspec/matchers.rb#543 + def end_with(*expected); end + + # Matches if the actual value ends with the expected value(s). In the case + # of a string, matches against the last `expected.length` characters of the + # actual string. In the case of an array, matches against the last + # `expected.length` elements of the actual array. + # + # @example + # expect("this string").to end_with "string" + # expect([0, 1, 2, 3, 4]).to end_with 4 + # expect([0, 2, 3, 4, 4]).to end_with 3, 4 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def ending_with(*args, **_arg1, &block); end + + # Passes if actual == expected. + # + # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more + # information about equality in Ruby. + # + # @example + # expect(5).to eq(5) + # expect(5).not_to eq(3) + # + # source://rspec-expectations//lib/rspec/matchers.rb#558 + def eq(expected); end + + # Passes if actual == expected. + # + # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more + # information about equality in Ruby. + # + # @example + # expect(5).to eq(5) + # expect(5).not_to eq(3) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def eq_to(*args, **_arg1, &block); end + + # Passes if `actual.eql?(expected)` + # + # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more + # information about equality in Ruby. + # + # @example + # expect(5).to eql(5) + # expect(5).not_to eql(3) + # + # source://rspec-expectations//lib/rspec/matchers.rb#572 + def eql(expected); end + + # Passes if `actual.eql?(expected)` + # + # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more + # information about equality in Ruby. + # + # @example + # expect(5).to eql(5) + # expect(5).not_to eql(3) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def eql_to(*args, **_arg1, &block); end + + # Passes if actual.equal?(expected) (object identity). + # + # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more + # information about equality in Ruby. + # + # @example + # expect(5).to equal(5) # Integers are equal + # expect("5").not_to equal("5") # Strings that look the same are not the same object + # + # source://rspec-expectations//lib/rspec/matchers.rb#586 + def equal(expected); end + + # Passes if actual.equal?(expected) (object identity). + # + # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more + # information about equality in Ruby. + # + # @example + # expect(5).to equal(5) # Integers are equal + # expect("5").not_to equal("5") # Strings that look the same are not the same object + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def equal_to(*args, **_arg1, &block); end + + # Passes if `actual.exist?` or `actual.exists?` + # + # @example + # expect(File).to exist("path/to/file") + # + # source://rspec-expectations//lib/rspec/matchers.rb#596 + def exist(*args); end + + # Passes if `actual.exist?` or `actual.exists?` + # + # @example + # expect(File).to exist("path/to/file") + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def existing(*args, **_arg1, &block); end + + # Supports `expect(actual).to matcher` syntax by wrapping `actual` in an + # `ExpectationTarget`. + # + # @example + # expect(actual).to eq(expected) + # expect(actual).not_to eq(expected) + # @return [Expectations::ExpectationTarget] + # @see Expectations::ExpectationTarget#to + # @see Expectations::ExpectationTarget#not_to + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#72 + def expect(value = T.unsafe(nil), &block); end + + # Passes if actual's attribute values match the expected attributes hash. + # This works no matter how you define your attribute readers. + # + # @example + # Person = Struct.new(:name, :age) + # person = Person.new("Bob", 32) + # + # expect(person).to have_attributes(:name => "Bob", :age => 32) + # expect(person).to have_attributes(:name => a_string_starting_with("B"), :age => (a_value > 30) ) + # @example + # expect(person).to have_attributes(:color => "red") + # @note It will fail if actual doesn't respond to any of the expected attributes. + # + # source://rspec-expectations//lib/rspec/matchers.rb#616 + def have_attributes(expected); end + + # Passes if actual's attribute values match the expected attributes hash. + # This works no matter how you define your attribute readers. + # + # @example + # Person = Struct.new(:name, :age) + # person = Person.new("Bob", 32) + # + # expect(person).to have_attributes(:name => "Bob", :age => 32) + # expect(person).to have_attributes(:name => a_string_starting_with("B"), :age => (a_value > 30) ) + # @example + # expect(person).to have_attributes(:color => "red") + # @note It will fail if actual doesn't respond to any of the expected attributes. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def having_attributes(*args, **_arg1, &block); end + + # Passes if actual includes expected. This works for + # collections and Strings. You can also pass in multiple args + # and it will only pass if all args are found in collection. + # + # @example + # expect([1,2,3]).to include(3) + # expect([1,2,3]).to include(2,3) + # expect([1,2,3]).to include(2,3,4) # fails + # expect([1,2,3]).not_to include(4) + # expect("spread").to include("read") + # expect("spread").not_to include("red") + # expect(:a => 1, :b => 2).to include(:a) + # expect(:a => 1, :b => 2).to include(:a, :b) + # expect(:a => 1, :b => 2).to include(:a => 1) + # expect(:a => 1, :b => 2).to include(:b => 2, :a => 1) + # expect(:a => 1, :b => 2).to include(:c) # fails + # expect(:a => 1, :b => 2).not_to include(:a => 2) + # + # source://rspec-expectations//lib/rspec/matchers.rb#639 + def include(*expected); end + + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#75 + def include_json(*expected, &block_arg); end + + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#75 + def include_unordered_json(*expected, &block_arg); end + + # Passes if actual includes expected. This works for + # collections and Strings. You can also pass in multiple args + # and it will only pass if all args are found in collection. + # + # @example + # expect([1,2,3]).to include(3) + # expect([1,2,3]).to include(2,3) + # expect([1,2,3]).to include(2,3,4) # fails + # expect([1,2,3]).not_to include(4) + # expect("spread").to include("read") + # expect("spread").not_to include("red") + # expect(:a => 1, :b => 2).to include(:a) + # expect(:a => 1, :b => 2).to include(:a, :b) + # expect(:a => 1, :b => 2).to include(:a => 1) + # expect(:a => 1, :b => 2).to include(:b => 2, :a => 1) + # expect(:a => 1, :b => 2).to include(:c) # fails + # expect(:a => 1, :b => 2).not_to include(:a => 2) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def including(*args, **_arg1, &block); end + + # Given a `Regexp` or `String`, passes if `actual.match(pattern)` + # Given an arbitrary nested data structure (e.g. arrays and hashes), + # matches if `expected === actual` || `actual == expected` for each + # pair of elements. + # + # @example + # expect(email).to match(/^([^\s]+)((?:[-a-z0-9]+\.)+[a-z]{2,})$/i) + # expect(email).to match("@example.com") + # @example + # hash = { + # :a => { + # :b => ["foo", 5], + # :c => { :d => 2.05 } + # } + # } + # + # expect(hash).to match( + # :a => { + # :b => a_collection_containing_exactly( + # a_string_starting_with("f"), + # an_instance_of(Integer) + # ), + # :c => { :d => (a_value < 3) } + # } + # ) + # @note The `match_regex` alias is deprecated and is not recommended for use. + # It was added in 2.12.1 to facilitate its use from within custom + # matchers (due to how the custom matcher DSL was evaluated in 2.x, + # `match` could not be used there), but is no longer needed in 3.x. + # + # source://rspec-expectations//lib/rspec/matchers.rb#697 + def match(expected); end + + # An alternate form of `contain_exactly` that accepts + # the expected contents as a single array arg rather + # than splatted out as individual items. + # + # @example + # expect(results).to contain_exactly(1, 2) + # # is identical to: + # expect(results).to match_array([1, 2]) + # @see #contain_exactly + # + # source://rspec-expectations//lib/rspec/matchers.rb#715 + def match_array(items); end + + # Given a `Regexp` or `String`, passes if `actual.match(pattern)` + # Given an arbitrary nested data structure (e.g. arrays and hashes), + # matches if `expected === actual` || `actual == expected` for each + # pair of elements. + # + # @example + # expect(email).to match(/^([^\s]+)((?:[-a-z0-9]+\.)+[a-z]{2,})$/i) + # expect(email).to match("@example.com") + # @example + # hash = { + # :a => { + # :b => ["foo", 5], + # :c => { :d => 2.05 } + # } + # } + # + # expect(hash).to match( + # :a => { + # :b => a_collection_containing_exactly( + # a_string_starting_with("f"), + # an_instance_of(Integer) + # ), + # :c => { :d => (a_value < 3) } + # } + # ) + # @note The `match_regex` alias is deprecated and is not recommended for use. + # It was added in 2.12.1 to facilitate its use from within custom + # matchers (due to how the custom matcher DSL was evaluated in 2.x, + # `match` could not be used there), but is no longer needed in 3.x. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def match_regex(*args, **_arg1, &block); end + + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#75 + def match_unordered_json(*expected, &block_arg); end + + # Given a `Regexp` or `String`, passes if `actual.match(pattern)` + # Given an arbitrary nested data structure (e.g. arrays and hashes), + # matches if `expected === actual` || `actual == expected` for each + # pair of elements. + # + # @example + # expect(email).to match(/^([^\s]+)((?:[-a-z0-9]+\.)+[a-z]{2,})$/i) + # expect(email).to match("@example.com") + # @example + # hash = { + # :a => { + # :b => ["foo", 5], + # :c => { :d => 2.05 } + # } + # } + # + # expect(hash).to match( + # :a => { + # :b => a_collection_containing_exactly( + # a_string_starting_with("f"), + # an_instance_of(Integer) + # ), + # :c => { :d => (a_value < 3) } + # } + # ) + # @note The `match_regex` alias is deprecated and is not recommended for use. + # It was added in 2.12.1 to facilitate its use from within custom + # matchers (due to how the custom matcher DSL was evaluated in 2.x, + # `match` could not be used there), but is no longer needed in 3.x. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def matching(*args, **_arg1, &block); end + + # With no arg, passes if the block outputs `to_stdout` or `to_stderr`. + # With a string, passes if the block outputs that specific string `to_stdout` or `to_stderr`. + # With a regexp or matcher, passes if the block outputs a string `to_stdout` or `to_stderr` that matches. + # + # To capture output from any spawned subprocess as well, use `to_stdout_from_any_process` or + # `to_stderr_from_any_process`. Output from any process that inherits the main process's corresponding + # standard stream will be captured. + # + # @example + # expect { print 'foo' }.to output.to_stdout + # expect { print 'foo' }.to output('foo').to_stdout + # expect { print 'foo' }.to output(/foo/).to_stdout + # + # expect { do_something }.to_not output.to_stdout + # + # expect { warn('foo') }.to output.to_stderr + # expect { warn('foo') }.to output('foo').to_stderr + # expect { warn('foo') }.to output(/foo/).to_stderr + # + # expect { do_something }.to_not output.to_stderr + # + # expect { system('echo foo') }.to output("foo\n").to_stdout_from_any_process + # expect { system('echo foo', out: :err) }.to output("foo\n").to_stderr_from_any_process + # @note `to_stdout` and `to_stderr` work by temporarily replacing `$stdout` or `$stderr`, + # so they're not able to intercept stream output that explicitly uses `STDOUT`/`STDERR` + # or that uses a reference to `$stdout`/`$stderr` that was stored before the + # matcher was used. + # @note `to_stdout_from_any_process` and `to_stderr_from_any_process` use Tempfiles, and + # are thus significantly (~30x) slower than `to_stdout` and `to_stderr`. + # + # source://rspec-expectations//lib/rspec/matchers.rb#752 + def output(expected = T.unsafe(nil)); end + + # With no args, matches if any error is raised. + # With a named error, matches only if that specific error is raised. + # With a named error and message specified as a String, matches only if both match. + # With a named error and message specified as a Regexp, matches only if both match. + # Pass an optional block to perform extra verifications on the exception matched + # + # @example + # expect { do_something_risky }.to raise_error + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError) + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError) { |error| expect(error.data).to eq 42 } + # expect { do_something_risky }.to raise_error { |error| expect(error.data).to eq 42 } + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError, "that was too risky") + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError, /oo ri/) + # expect { do_something_risky }.to raise_error("that was too risky") + # + # expect { do_something_risky }.not_to raise_error + # + # source://rspec-expectations//lib/rspec/matchers.rb#773 + def raise_error(error = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # With no args, matches if any error is raised. + # With a named error, matches only if that specific error is raised. + # With a named error and message specified as a String, matches only if both match. + # With a named error and message specified as a Regexp, matches only if both match. + # Pass an optional block to perform extra verifications on the exception matched + # + # @example + # expect { do_something_risky }.to raise_error + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError) + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError) { |error| expect(error.data).to eq 42 } + # expect { do_something_risky }.to raise_error { |error| expect(error.data).to eq 42 } + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError, "that was too risky") + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError, /oo ri/) + # expect { do_something_risky }.to raise_error("that was too risky") + # + # expect { do_something_risky }.not_to raise_error + # + # source://rspec-expectations//lib/rspec/matchers.rb#773 + def raise_exception(error = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # With no args, matches if any error is raised. + # With a named error, matches only if that specific error is raised. + # With a named error and message specified as a String, matches only if both match. + # With a named error and message specified as a Regexp, matches only if both match. + # Pass an optional block to perform extra verifications on the exception matched + # + # @example + # expect { do_something_risky }.to raise_error + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError) + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError) { |error| expect(error.data).to eq 42 } + # expect { do_something_risky }.to raise_error { |error| expect(error.data).to eq 42 } + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError, "that was too risky") + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError, /oo ri/) + # expect { do_something_risky }.to raise_error("that was too risky") + # + # expect { do_something_risky }.not_to raise_error + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def raising(*args, **_arg1, &block); end + + # Matches if the target object responds to all of the names + # provided. Names can be Strings or Symbols. + # + # @example + # expect("string").to respond_to(:length) + # + # source://rspec-expectations//lib/rspec/matchers.rb#792 + def respond_to(*names); end + + # Matches if the target object responds to all of the names + # provided. Names can be Strings or Symbols. + # + # @example + # expect("string").to respond_to(:length) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def responding_to(*args, **_arg1, &block); end + + # Passes if the submitted block returns true. Yields target to the + # block. + # + # Generally speaking, this should be thought of as a last resort when + # you can't find any other way to specify the behaviour you wish to + # specify. + # + # If you do find yourself in such a situation, you could always write + # a custom matcher, which would likely make your specs more expressive. + # + # @example + # expect(5).to satisfy { |n| n > 3 } + # expect(5).to satisfy("be greater than 3") { |n| n > 3 } + # @param description [String] optional description to be used for this matcher. + # + # source://rspec-expectations//lib/rspec/matchers.rb#813 + def satisfy(description = T.unsafe(nil), &block); end + + # Passes if the submitted block returns true. Yields target to the + # block. + # + # Generally speaking, this should be thought of as a last resort when + # you can't find any other way to specify the behaviour you wish to + # specify. + # + # If you do find yourself in such a situation, you could always write + # a custom matcher, which would likely make your specs more expressive. + # + # @example + # expect(5).to satisfy { |n| n > 3 } + # expect(5).to satisfy("be greater than 3") { |n| n > 3 } + # @param description [String] optional description to be used for this matcher. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def satisfying(*args, **_arg1, &block); end + + # Matches if the actual value starts with the expected value(s). In the + # case of a string, matches against the first `expected.length` characters + # of the actual string. In the case of an array, matches against the first + # `expected.length` elements of the actual array. + # + # @example + # expect("this string").to start_with "this s" + # expect([0, 1, 2, 3, 4]).to start_with 0 + # expect([0, 2, 3, 4, 4]).to start_with 0, 1 + # + # source://rspec-expectations//lib/rspec/matchers.rb#828 + def start_with(*expected); end + + # Matches if the actual value starts with the expected value(s). In the + # case of a string, matches against the first `expected.length` characters + # of the actual string. In the case of an array, matches against the first + # `expected.length` elements of the actual array. + # + # @example + # expect("this string").to start_with "this s" + # expect([0, 1, 2, 3, 4]).to start_with 0 + # expect([0, 2, 3, 4, 4]).to start_with 0, 1 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def starting_with(*args, **_arg1, &block); end + + # Given no argument, matches if a proc throws any Symbol. + # + # Given a Symbol, matches if the given proc throws the specified Symbol. + # + # Given a Symbol and an arg, matches if the given proc throws the + # specified Symbol with the specified arg. + # + # @example + # expect { do_something_risky }.to throw_symbol + # expect { do_something_risky }.to throw_symbol(:that_was_risky) + # expect { do_something_risky }.to throw_symbol(:that_was_risky, 'culprit') + # + # expect { do_something_risky }.not_to throw_symbol + # expect { do_something_risky }.not_to throw_symbol(:that_was_risky) + # expect { do_something_risky }.not_to throw_symbol(:that_was_risky, 'culprit') + # + # source://rspec-expectations//lib/rspec/matchers.rb#850 + def throw_symbol(expected_symbol = T.unsafe(nil), expected_arg = T.unsafe(nil)); end + + # Given no argument, matches if a proc throws any Symbol. + # + # Given a Symbol, matches if the given proc throws the specified Symbol. + # + # Given a Symbol and an arg, matches if the given proc throws the + # specified Symbol with the specified arg. + # + # @example + # expect { do_something_risky }.to throw_symbol + # expect { do_something_risky }.to throw_symbol(:that_was_risky) + # expect { do_something_risky }.to throw_symbol(:that_was_risky, 'culprit') + # + # expect { do_something_risky }.not_to throw_symbol + # expect { do_something_risky }.not_to throw_symbol(:that_was_risky) + # expect { do_something_risky }.not_to throw_symbol(:that_was_risky, 'culprit') + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def throwing(*args, **_arg1, &block); end + + # Passes if actual == expected +/- delta + # + # @example + # expect(result).to be_within(0.5).of(3.0) + # expect(result).not_to be_within(0.5).of(3.0) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def within(*args, **_arg1, &block); end + + # Passes if the method called in the expect block yields, regardless + # of whether or not arguments are yielded. + # + # @example + # expect { |b| 5.tap(&b) }.to yield_control + # expect { |b| "a".to_sym(&b) }.not_to yield_control + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # + # source://rspec-expectations//lib/rspec/matchers.rb#871 + def yield_control; end + + # Designed for use with methods that repeatedly yield (such as + # iterators). Passes if the method called in the expect block yields + # multiple times with arguments matching those given. + # + # Argument matching is done using `===` (the case match operator) + # and `==`. If the expected and actual arguments match with either + # operator, the matcher will pass. + # + # @example + # expect { |b| [1, 2, 3].each(&b) }.to yield_successive_args(1, 2, 3) + # expect { |b| { :a => 1, :b => 2 }.each(&b) }.to yield_successive_args([:a, 1], [:b, 2]) + # expect { |b| [1, 2, 3].each(&b) }.not_to yield_successive_args(1, 2) + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # + # source://rspec-expectations//lib/rspec/matchers.rb#940 + def yield_successive_args(*args); end + + # Given no arguments, matches if the method called in the expect + # block yields with arguments (regardless of what they are or how + # many there are). + # + # Given arguments, matches if the method called in the expect block + # yields with arguments that match the given arguments. + # + # Argument matching is done using `===` (the case match operator) + # and `==`. If the expected and actual arguments match with either + # operator, the matcher will pass. + # + # @example + # expect { |b| 5.tap(&b) }.to yield_with_args # because #tap yields an arg + # expect { |b| 5.tap(&b) }.to yield_with_args(5) # because 5 == 5 + # expect { |b| 5.tap(&b) }.to yield_with_args(Integer) # because Integer === 5 + # expect { |b| File.open("f.txt", &b) }.to yield_with_args(/txt/) # because /txt/ === "f.txt" + # + # expect { |b| User.transaction(&b) }.not_to yield_with_args # because it yields no args + # expect { |b| 5.tap(&b) }.not_to yield_with_args(1, 2, 3) + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # @note This matcher is not designed for use with methods that yield + # multiple times. + # + # source://rspec-expectations//lib/rspec/matchers.rb#919 + def yield_with_args(*args); end + + # Passes if the method called in the expect block yields with + # no arguments. Fails if it does not yield, or yields with arguments. + # + # @example + # expect { |b| User.transaction(&b) }.to yield_with_no_args + # expect { |b| 5.tap(&b) }.not_to yield_with_no_args # because it yields with `5` + # expect { |b| "a".to_sym(&b) }.not_to yield_with_no_args # because it does not yield + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # @note This matcher is not designed for use with methods that yield + # multiple times. + # + # source://rspec-expectations//lib/rspec/matchers.rb#889 + def yield_with_no_args; end + + # Passes if the method called in the expect block yields, regardless + # of whether or not arguments are yielded. + # + # @example + # expect { |b| 5.tap(&b) }.to yield_control + # expect { |b| "a".to_sym(&b) }.not_to yield_control + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def yielding_control(*args, **_arg1, &block); end + + # Designed for use with methods that repeatedly yield (such as + # iterators). Passes if the method called in the expect block yields + # multiple times with arguments matching those given. + # + # Argument matching is done using `===` (the case match operator) + # and `==`. If the expected and actual arguments match with either + # operator, the matcher will pass. + # + # @example + # expect { |b| [1, 2, 3].each(&b) }.to yield_successive_args(1, 2, 3) + # expect { |b| { :a => 1, :b => 2 }.each(&b) }.to yield_successive_args([:a, 1], [:b, 2]) + # expect { |b| [1, 2, 3].each(&b) }.not_to yield_successive_args(1, 2) + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def yielding_successive_args(*args, **_arg1, &block); end + + # Given no arguments, matches if the method called in the expect + # block yields with arguments (regardless of what they are or how + # many there are). + # + # Given arguments, matches if the method called in the expect block + # yields with arguments that match the given arguments. + # + # Argument matching is done using `===` (the case match operator) + # and `==`. If the expected and actual arguments match with either + # operator, the matcher will pass. + # + # @example + # expect { |b| 5.tap(&b) }.to yield_with_args # because #tap yields an arg + # expect { |b| 5.tap(&b) }.to yield_with_args(5) # because 5 == 5 + # expect { |b| 5.tap(&b) }.to yield_with_args(Integer) # because Integer === 5 + # expect { |b| File.open("f.txt", &b) }.to yield_with_args(/txt/) # because /txt/ === "f.txt" + # + # expect { |b| User.transaction(&b) }.not_to yield_with_args # because it yields no args + # expect { |b| 5.tap(&b) }.not_to yield_with_args(1, 2, 3) + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # @note This matcher is not designed for use with methods that yield + # multiple times. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def yielding_with_args(*args, **_arg1, &block); end + + # Passes if the method called in the expect block yields with + # no arguments. Fails if it does not yield, or yields with arguments. + # + # @example + # expect { |b| User.transaction(&b) }.to yield_with_no_args + # expect { |b| 5.tap(&b) }.not_to yield_with_no_args # because it yields with `5` + # expect { |b| "a".to_sym(&b) }.not_to yield_with_no_args # because it does not yield + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # @note This matcher is not designed for use with methods that yield + # multiple times. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def yielding_with_no_args(*args, **_arg1, &block); end + + private + + # source://rspec-expectations//lib/rspec/matchers.rb#961 + def method_missing(method, *args, **_arg2, &block); end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers.rb#974 + def respond_to_missing?(method, *_arg1); end + + class << self + # Extended from {RSpec::Matchers::DSL#alias_matcher}. + # + # source://rspec-expectations//lib/rspec/matchers.rb#250 + def alias_matcher(*args, &block); end + + # Used by rspec-core to clear the state used to generate + # descriptions after an example. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/generated_descriptions.rb#11 + def clear_generated_description; end + + # Delegates to {RSpec::Expectations.configuration}. + # This is here because rspec-core's `expect_with` option + # looks for a `configuration` method on the mixin + # (`RSpec::Matchers`) to yield to a block. + # + # @return [RSpec::Expectations::Configuration] the configuration object + # + # source://rspec-expectations//lib/rspec/matchers.rb#951 + def configuration; end + + # Generates an an example description based on the last expectation. + # Used by rspec-core's one-liner syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/generated_descriptions.rb#19 + def generated_description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers.rb#1008 + def is_a_describable_matcher?(obj); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers.rb#988 + def is_a_matcher?(obj); end + + # @private + # + # source://rspec-expectations//lib/rspec/matchers/generated_descriptions.rb#25 + def last_description; end + + # @private + # + # source://rspec-expectations//lib/rspec/matchers/generated_descriptions.rb#5 + def last_expectation_handler; end + + # @private + # + # source://rspec-expectations//lib/rspec/matchers/generated_descriptions.rb#5 + def last_expectation_handler=(_arg0); end + + # @private + # + # source://rspec-expectations//lib/rspec/matchers/generated_descriptions.rb#5 + def last_matcher; end + + # @private + # + # source://rspec-expectations//lib/rspec/matchers/generated_descriptions.rb#5 + def last_matcher=(_arg0); end + end +end + +# Decorator that wraps a matcher and overrides `description` +# using the provided block in order to support an alias +# of a matcher. This is intended for use when composing +# matchers, so that you can use an expression like +# `include( a_value_within(0.1).of(3) )` rather than +# `include( be_within(0.1).of(3) )`, and have the corresponding +# description read naturally. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#12 +class RSpec::Matchers::AliasedMatcher < ::RSpec::Matchers::MatcherDelegator + # @api private + # @return [AliasedMatcher] a new instance of AliasedMatcher + # + # source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#13 + def initialize(base_matcher, description_block); end + + # Provides the description of the aliased matcher. Aliased matchers + # are designed to behave identically to the original matcher except + # for the description and failure messages. The description is different + # to reflect the aliased name. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#36 + def description; end + + # Provides the failure_message of the aliased matcher. Aliased matchers + # are designed to behave identically to the original matcher except + # for the description and failure messages. The failure_message is different + # to reflect the aliased name. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#46 + def failure_message; end + + # Provides the failure_message_when_negated of the aliased matcher. Aliased matchers + # are designed to behave identically to the original matcher except + # for the description and failure messages. The failure_message_when_negated is different + # to reflect the aliased name. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#56 + def failure_message_when_negated; end + + # Forward messages on to the wrapped matcher. + # Since many matchers provide a fluent interface + # (e.g. `a_value_within(0.1).of(3)`), we need to wrap + # the returned value if it responds to `description`, + # so that our override can be applied when it is eventually + # used. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#24 + def method_missing(*_arg0); end +end + +# Decorator used for matchers that have special implementations of +# operators like `==` and `===`. +# +# @private +# +# source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#64 +class RSpec::Matchers::AliasedMatcherWithOperatorSupport < ::RSpec::Matchers::AliasedMatcher; end + +# @private +# +# source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#71 +class RSpec::Matchers::AliasedNegatedMatcher < ::RSpec::Matchers::AliasedMatcher + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#80 + def does_not_match?(*args, &block); end + + # source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#84 + def failure_message; end + + # source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#88 + def failure_message_when_negated; end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#72 + def matches?(*args, &block); end + + private + + # For a matcher that uses the default failure messages, we prefer to + # use the override provided by the `description_block`, because it + # includes the phrasing that the user has expressed a preference for + # by going through the effort of defining a negated matcher. + # + # However, if the override didn't actually change anything, then we + # should return the opposite failure message instead -- the overridden + # message is going to be confusing if we return it as-is, as it represents + # the non-negated failure message for a negated match (or vice versa). + # + # source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#105 + def optimal_failure_message(same, inverted); end +end + +# source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#94 +RSpec::Matchers::AliasedNegatedMatcher::DefaultFailureMessages = RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages + +# source://rspec-expectations//lib/rspec/matchers.rb#957 +RSpec::Matchers::BE_PREDICATE_REGEX = T.let(T.unsafe(nil), Regexp) + +# Provides a base class with as little methods as possible, so that +# most methods can be delegated via `method_missing`. +# +# On Ruby 2.0+ BasicObject could be used for this purpose, but it +# introduce some extra complexity with constant resolution, so the +# BlankSlate pattern was prefered. +# +# @private +# +# source://rspec-expectations//lib/rspec/matchers/matcher_delegator.rb#10 +class RSpec::Matchers::BaseDelegator; end + +# Container module for all built-in matchers. The matcher classes are here +# (rather than directly under `RSpec::Matchers`) in order to prevent name +# collisions, since `RSpec::Matchers` gets included into the user's namespace. +# +# Autoloading is used to delay when the matcher classes get loaded, allowing +# rspec-matchers to boot faster, and avoiding loading matchers the user is +# not using. +# +# source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#3 +module RSpec::Matchers::BuiltIn; end + +# Provides the implementation for `all`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#7 +class RSpec::Matchers::BuiltIn::All < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [All] a new instance of All + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#11 + def initialize(matcher); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#37 + def description; end + + # @api private + # @private + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#17 + def does_not_match?(_actual); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#9 + def failed_objects; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#23 + def failure_message; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#9 + def matcher; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#63 + def add_new_line_if_needed(message); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#58 + def failure_message_for_item(index, failure_message); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#67 + def indent_multiline_message(message); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#50 + def index_failed_objects; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#74 + def initialize_copy(other); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#80 + def iterable?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#43 + def match(_expected, _actual); end +end + +# Used _internally_ as a base class for matchers that ship with +# rspec-expectations and rspec-rails. +# +# ### Warning: +# +# This class is for internal use, and subject to change without notice. +# We strongly recommend that you do not base your custom matchers on this +# class. If/when this changes, we will announce it and remove this warning. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#14 +class RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::Composable + include ::RSpec::Matchers::BuiltIn::BaseMatcher::HashFormatting + include ::RSpec::Matchers::BuiltIn::BaseMatcher::StringEncodingFormatting + include ::RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages + + # @api private + # @return [BaseMatcher] a new instance of BaseMatcher + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#28 + def initialize(expected = T.unsafe(nil)); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#23 + def actual; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#97 + def actual_formatted; end + + # Generates a description using {EnglishPhrasing}. + # + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#60 + def description; end + + # Matchers are not diffable by default. Override this to make your + # subclass diffable. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#69 + def diffable?; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#23 + def expected; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#92 + def expected_formatted; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#87 + def expects_call_stack_jump?; end + + # Used to wrap a block of code that will indicate failure by + # raising one of the named exceptions. + # + # This is used by rspec-rails for some of its matchers that + # wrap rails' assertions. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#47 + def match_unless_raises(*exceptions); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#107 + def matcher_name; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#26 + def matcher_name=(_arg0); end + + # Indicates if the match is successful. Delegates to `match`, which + # should be defined on a subclass. Takes care of consistently + # initializing the `actual` attribute. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#36 + def matches?(actual); end + + # :nocov: + # + # @api private + def present_ivars; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#23 + def rescued_exception; end + + # Most matchers are value matchers (i.e. meant to work with `expect(value)`) + # rather than block matchers (i.e. meant to work with `expect { }`), so + # this defaults to false. Block matchers must override this to return true. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#77 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#82 + def supports_value_expectations?; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#129 + def assert_ivars(*expected_ivars); end + + class << self + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#102 + def matcher_name; end + + private + + # Borrowed from ActiveSupport. + # + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#117 + def underscore(camel_cased_word); end + end +end + +# Provides default implementations of failure messages, based on the `description`. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#207 +module RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages + # Provides a good generic failure message. Based on `description`. + # When subclassing, if you are not satisfied with this failure message + # you often only need to override `description`. + # + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#213 + def failure_message; end + + # Provides a good generic negative failure message. Based on `description`. + # When subclassing, if you are not satisfied with this failure message + # you often only need to override `description`. + # + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#222 + def failure_message_when_negated; end + + class << self + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#227 + def has_default_failure_messages?(matcher); end + end +end + +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#146 +module RSpec::Matchers::BuiltIn::BaseMatcher::HashFormatting + private + + # `{ :a => 5, :b => 2 }.inspect` produces: + # + # {:a=>5, :b=>2} + # + # ...but it looks much better as: + # + # {:a => 5, :b => 2} + # + # This is idempotent and safe to run on a string multiple times. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#156 + def improve_hash_formatting(inspect_string); end + + class << self + # `{ :a => 5, :b => 2 }.inspect` produces: + # + # {:a=>5, :b=>2} + # + # ...but it looks much better as: + # + # {:a => 5, :b => 2} + # + # This is idempotent and safe to run on a string multiple times. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#156 + def improve_hash_formatting(inspect_string); end + end +end + +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#165 +module RSpec::Matchers::BuiltIn::BaseMatcher::StringEncodingFormatting + private + + # Formats a String's encoding as a human readable string + # + # @api private + # @param _value [String] + # @return [nil] nil as the curent Ruby version does not support String encoding + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#188 + def format_encoding(value); end + + # @api private + # @return [Boolean] False always as the curent Ruby version does not support String encoding + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#171 + def string_encoding_differs?; end + + class << self + # Formats a String's encoding as a human readable string + # + # @api private + # @param _value [String] + # @return [nil] nil as the curent Ruby version does not support String encoding + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#188 + def format_encoding(value); end + + # @api private + # @return [Boolean] False always as the curent Ruby version does not support String encoding + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#171 + def string_encoding_differs?; end + end +end + +# Used to detect when no arg is passed to `initialize`. +# `nil` cannot be used because it's a valid value to pass. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#20 +RSpec::Matchers::BuiltIn::BaseMatcher::UNDEFINED = T.let(T.unsafe(nil), Object) + +# Provides the implementation for `be`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#101 +class RSpec::Matchers::BuiltIn::Be < ::RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::BuiltIn::BeHelpers + + # @api private + # @return [Be] a new instance of Be + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#104 + def initialize(*args); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#121 + def <(operand); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#121 + def <=(operand); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#121 + def ==(operand); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#121 + def ===(operand); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#121 + def =~(operand); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#121 + def >(operand); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#121 + def >=(operand); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#110 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#116 + def failure_message_when_negated; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#128 + def match(_, actual); end +end + +# Provides the implementation for `be_a_kind_of`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be_kind_of.rb#7 +class RSpec::Matchers::BuiltIn::BeAKindOf < ::RSpec::Matchers::BuiltIn::BaseMatcher + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_kind_of.rb#10 + def match(expected, actual); end +end + +# Provides the implementation for `be_an_instance_of`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be_instance_of.rb#7 +class RSpec::Matchers::BuiltIn::BeAnInstanceOf < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_instance_of.rb#10 + def description; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_instance_of.rb#16 + def match(expected, actual); end +end + +# Provides the implementation for `be_between`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#7 +class RSpec::Matchers::BuiltIn::BeBetween < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [BeBetween] a new instance of BeBetween + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#8 + def initialize(min, max); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#57 + def description; end + + # Makes the between comparison exclusive. + # + # @api public + # @example + # expect(3).to be_between(2, 4).exclusive + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#33 + def exclusive; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#51 + def failure_message; end + + # Makes the between comparison inclusive. + # + # @api public + # @example + # expect(3).to be_between(2, 3).inclusive + # @note The matcher is inclusive by default; this simply provides + # a way to be more explicit about it. + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#21 + def inclusive; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#42 + def matches?(actual); end + + private + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#63 + def comparable?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#71 + def compare; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#67 + def not_comparable_clause; end +end + +# Provides the implementation of `be value`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#136 +class RSpec::Matchers::BuiltIn::BeComparedTo < ::RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::BuiltIn::BeHelpers + + # @api private + # @return [BeComparedTo] a new instance of BeComparedTo + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#139 + def initialize(operand, operator); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#178 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#151 + def does_not_match?(actual); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#159 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#166 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#145 + def matches?(actual); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#184 + def perform_match(actual); end +end + +# Provides the implementation for `be_falsey`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#30 +class RSpec::Matchers::BuiltIn::BeFalsey < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#33 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#39 + def failure_message_when_negated; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#45 + def match(_, actual); end +end + +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#74 +module RSpec::Matchers::BuiltIn::BeHelpers + private + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#77 + def args_to_s; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#93 + def args_to_sentence; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#89 + def expected_to_sentence; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#85 + def inspected_args; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#81 + def parenthesize(string); end +end + +# Provides the implementation for `be_nil`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#53 +class RSpec::Matchers::BuiltIn::BeNil < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#56 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#62 + def failure_message_when_negated; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#68 + def match(_, actual); end +end + +# Provides the implementation of `be_`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#137 +class RSpec::Matchers::BuiltIn::BePredicate < ::RSpec::Matchers::BuiltIn::DynamicPredicate + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#149 + def failure_to_respond_explanation; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#141 + def predicate; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#157 + def predicate_accessible?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#145 + def predicate_method_name; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#161 + def present_tense_predicate; end +end + +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#139 +RSpec::Matchers::BuiltIn::BePredicate::REGEX = T.let(T.unsafe(nil), Regexp) + +# Provides the implementation for `be_truthy`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#7 +class RSpec::Matchers::BuiltIn::BeTruthy < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#10 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#16 + def failure_message_when_negated; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#22 + def match(_, actual); end +end + +# Provides the implementation for `be_within`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#7 +class RSpec::Matchers::BuiltIn::BeWithin < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [BeWithin] a new instance of BeWithin + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#8 + def initialize(delta); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#52 + def description; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#40 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#46 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#32 + def matches?(actual); end + + # Sets the expected value. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#14 + def of(expected); end + + # Sets the expected value, and makes the matcher do + # a percent comparison. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#24 + def percent_of(expected); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#62 + def needs_expected; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#66 + def not_numeric_clause; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#58 + def numeric?; end +end + +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#159 +module RSpec::Matchers::BuiltIn::CaptureStderr + class << self + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#164 + def capture(block); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#160 + def name; end + end +end + +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#139 +module RSpec::Matchers::BuiltIn::CaptureStdout + class << self + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#144 + def capture(block); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#140 + def name; end + end +end + +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#179 +class RSpec::Matchers::BuiltIn::CaptureStreamToTempfile < ::Struct + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#180 + def capture(block); end +end + +# Provides the implementation for `change`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#7 +class RSpec::Matchers::BuiltIn::Change < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Change] a new instance of Change + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#87 + def initialize(receiver = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # Specifies the delta of the expected change. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#10 + def by(expected_delta); end + + # Specifies a minimum delta of the expected change. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#18 + def by_at_least(minimum); end + + # Specifies a maximum delta of the expected change. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#26 + def by_at_most(maximum); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#71 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#50 + def does_not_match?(event_proc); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#57 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#64 + def failure_message_when_negated; end + + # Specifies the original value. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#40 + def from(value); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#45 + def matches?(event_proc); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#76 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#81 + def supports_value_expectations?; end + + # Specifies the new value you expect. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#34 + def to(value); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#93 + def change_details; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#119 + def negative_failure_reason; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#97 + def perform_change(event_proc); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#114 + def positive_failure_reason; end + + # @api private + # @raise [SyntaxError] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#109 + def raise_block_syntax_error; end +end + +# Encapsulates the details of the before/after values. +# +# Note that this class exposes the `actual_after` value, to allow the +# matchers above to derive failure messages, etc from the value on demand +# as needed, but it intentionally does _not_ expose the `actual_before` +# value. Some usages of the `change` matcher mutate a specific object +# returned by the value proc, which means that failure message snippets, +# etc, which are derived from the `before` value may not be accurate if +# they are lazily computed as needed. We must pre-compute them before +# applying the change in the `expect` block. To ensure that all `change` +# matchers do that properly, we do not expose the `actual_before` value. +# Instead, matchers must pass a block to `perform_change`, which yields +# the `actual_before` value before applying the change. +# +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#352 +class RSpec::Matchers::BuiltIn::ChangeDetails + # @return [ChangeDetails] a new instance of ChangeDetails + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#357 + def initialize(matcher_name, receiver = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # Returns the value of attribute actual_after. + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#353 + def actual_after; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#418 + def actual_delta; end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#402 + def changed?; end + + # @yield [@actual_before] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#389 + def perform_change(event_proc); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#378 + def value_representation; end + + private + + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#424 + def evaluate_value_proc; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#438 + def extract_value_block_snippet; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#428 + def message_notation(receiver, message); end +end + +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#355 +module RSpec::Matchers::BuiltIn::ChangeDetails::UNDEFINED; end + +# Used to specify a change from a specific value +# (and, optionally, to a specific value). +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#270 +class RSpec::Matchers::BuiltIn::ChangeFromValue < ::RSpec::Matchers::BuiltIn::SpecificValuesChange + # @api private + # @return [ChangeFromValue] a new instance of ChangeFromValue + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#271 + def initialize(change_details, expected_before); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#285 + def does_not_match?(event_proc); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#295 + def failure_message_when_negated; end + + # Specifies the new value you expect. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#278 + def to(value); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#303 + def change_description; end +end + +# Used to specify a relative change. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#128 +class RSpec::Matchers::BuiltIn::ChangeRelatively < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [ChangeRelatively] a new instance of ChangeRelatively + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#129 + def initialize(change_details, expected_delta, relativity, &comparer); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#156 + def description; end + + # @api private + # @private + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#150 + def does_not_match?(_event_proc); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#137 + def failure_message; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#144 + def matches?(event_proc); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#162 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#167 + def supports_value_expectations?; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#173 + def failure_reason; end +end + +# Used to specify a change to a specific value +# (and, optionally, from a specific value). +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#311 +class RSpec::Matchers::BuiltIn::ChangeToValue < ::RSpec::Matchers::BuiltIn::SpecificValuesChange + # @api private + # @return [ChangeToValue] a new instance of ChangeToValue + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#312 + def initialize(change_details, expected_after); end + + # @api private + # @private + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#326 + def does_not_match?(_event_proc); end + + # Specifies the original value. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#319 + def from(value); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#333 + def change_description; end +end + +# Base class for `and` and `or` compound matchers. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#6 +class RSpec::Matchers::BuiltIn::Compound < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Compound] a new instance of Compound + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#10 + def initialize(matcher_1, matcher_2); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#25 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#49 + def diffable?; end + + # @api private + # @private + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#16 + def does_not_match?(_actual); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#8 + def evaluator; end + + # @api private + # @return [RSpec::Matchers::MultiMatcherDiff] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#55 + def expected; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#42 + def expects_call_stack_jump?; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#8 + def matcher_1; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#8 + def matcher_2; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#30 + def supports_block_expectations?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#36 + def supports_value_expectations?; end + + protected + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#62 + def diffable_matcher_list; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#93 + def compound_failure_message; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#125 + def diffable_matcher_list_for(matcher); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#87 + def indent_multiline_message(message); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#71 + def initialize_copy(other); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#77 + def match(_expected, actual); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#99 + def matcher_1_matches?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#103 + def matcher_2_matches?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#119 + def matcher_is_diffable?(matcher); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#107 + def matcher_supports_block_expectations?(matcher); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#113 + def matcher_supports_value_expectations?(matcher); end +end + +# Matcher used to represent a compound `and` expectation. +# +# @api public +# +# source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#242 +class RSpec::Matchers::BuiltIn::Compound::And < ::RSpec::Matchers::BuiltIn::Compound + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#245 + def failure_message; end + + private + + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#262 + def conjunction; end + + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#257 + def match(*_arg0); end +end + +# Normally, we evaluate the matching sequentially. For an expression like +# `expect(x).to foo.and bar`, this becomes: +# +# expect(x).to foo +# expect(x).to bar +# +# For block expectations, we need to nest them instead, so that +# `expect { x }.to foo.and bar` becomes: +# +# expect { +# expect { x }.to foo +# }.to bar +# +# This is necessary so that the `expect` block is only executed once. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#156 +class RSpec::Matchers::BuiltIn::Compound::NestedEvaluator + # @api private + # @return [NestedEvaluator] a new instance of NestedEvaluator + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#157 + def initialize(actual, matcher_1, matcher_2); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#170 + def matcher_matches?(matcher); end + + private + + # Some block matchers (such as `yield_xyz`) pass args to the `expect` block. + # When such a matcher is used as the outer matcher, we need to forward the + # the args on to the `expect` block. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#184 + def inner_matcher_block(outer_args); end + + # For a matcher like `raise_error` or `throw_symbol`, where the block will jump + # up the call stack, we need to order things so that it is the inner matcher. + # For example, we need it to be this: + # + # expect { + # expect { + # x += 1 + # raise "boom" + # }.to raise_error("boom") + # }.to change { x }.by(1) + # + # ...rather than: + # + # expect { + # expect { + # x += 1 + # raise "boom" + # }.to change { x }.by(1) + # }.to raise_error("boom") + # + # In the latter case, the after-block logic in the `change` matcher would never + # get executed because the `raise "boom"` line would jump to the `rescue` in the + # `raise_error` logic, so only the former case will work properly. + # + # This method figures out which matcher should be the inner matcher and which + # should be the outer matcher. + # + # @api private + # @raise [ArgumentError] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#224 + def order_block_matchers; end + + class << self + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#233 + def matcher_expects_call_stack_jump?(matcher); end + end +end + +# Matcher used to represent a compound `or` expectation. +# +# @api public +# +# source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#269 +class RSpec::Matchers::BuiltIn::Compound::Or < ::RSpec::Matchers::BuiltIn::Compound + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#272 + def failure_message; end + + private + + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#283 + def conjunction; end + + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#278 + def match(*_arg0); end +end + +# For value expectations, we can evaluate the matchers sequentially. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#132 +class RSpec::Matchers::BuiltIn::Compound::SequentialEvaluator + # @api private + # @return [SequentialEvaluator] a new instance of SequentialEvaluator + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#133 + def initialize(actual, *_arg1); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#137 + def matcher_matches?(matcher); end +end + +# Provides the implementation for `contain_exactly` and `match_array`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#8 +class RSpec::Matchers::BuiltIn::ContainExactly < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#29 + def description; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#11 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#22 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#34 + def matches?(actual); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#56 + def actual_collection_line; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#135 + def best_solution; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#94 + def convert_actual_to_an_array; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#68 + def describe_collection(collection, surface_descriptions = T.unsafe(nil)); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#52 + def expected_collection_line; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#64 + def extra_elements_line; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#129 + def extra_items; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#44 + def generate_failure_message; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#81 + def match(_expected, _actual); end + + # This cannot always work (e.g. when dealing with unsortable items, + # or matchers as expected items), but it's practically free compared to + # the slowness of the full matching algorithm, and in common cases this + # works, so it's worth a try. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#90 + def match_when_sorted?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#76 + def message_line(prefix, collection, surface_descriptions = T.unsafe(nil)); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#60 + def missing_elements_line; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#123 + def missing_items; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#139 + def pairings_maximizer; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#104 + def safe_sort(array); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#118 + def to_a_disallowed?(object); end +end + +# Once we started supporting composing matchers, the algorithm for this matcher got +# much more complicated. Consider this expression: +# +# expect(["fool", "food"]).to contain_exactly(/foo/, /fool/) +# +# This should pass (because we can pair /fool/ with "fool" and /foo/ with "food"), but +# the original algorithm used by this matcher would pair the first elements it could +# (/foo/ with "fool"), which would leave /fool/ and "food" unmatched. When we have +# an expected element which is a matcher that matches a superset of actual items +# compared to another expected element matcher, we need to consider every possible pairing. +# +# This class is designed to maximize the number of actual/expected pairings -- or, +# conversely, to minimize the number of unpaired items. It's essentially a brute +# force solution, but with a few heuristics applied to reduce the size of the +# problem space: +# +# * Any items which match none of the items in the other list are immediately +# placed into the `unmatched_expected_indexes` or `unmatched_actual_indexes` array. +# The extra items and missing items in the matcher failure message are derived +# from these arrays. +# * Any items which reciprocally match only each other are paired up and not +# considered further. +# +# What's left is only the items which match multiple items from the other list +# (or vice versa). From here, it performs a brute-force depth-first search, +# looking for a solution which pairs all elements in both lists, or, barring that, +# that produces the fewest unmatched items. +# +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#186 +class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer + # @api private + # @return [PairingsMaximizer] a new instance of PairingsMaximizer + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#223 + def initialize(expected_to_actual_matched_indexes, actual_to_expected_matched_indexes); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#221 + def actual_to_expected_matched_indexes; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#221 + def expected_to_actual_matched_indexes; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#237 + def find_best_solution; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#221 + def solution; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#299 + def apply_pairing_to(indeterminates, original_matches, other_list_index); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#283 + def best_solution_for_pairing(expected_index, actual_index); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#263 + def categorize_indexes(indexes_to_categorize, other_indexes); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#278 + def reciprocal_single_match?(matches, index, other_list); end +end + +# Starting solution that is worse than any other real solution. +# +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#257 +class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer::NullSolution + class << self + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#258 + def worse_than?(_other); end + end +end + +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#188 +class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer::Solution < ::Struct + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#210 + def +(derived_candidate_solution); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#194 + def candidate?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#199 + def ideal?; end + + # Returns the value of attribute indeterminate_actual_indexes + # + # @return [Object] the current value of indeterminate_actual_indexes + def indeterminate_actual_indexes; end + + # Sets the attribute indeterminate_actual_indexes + # + # @param value [Object] the value to set the attribute indeterminate_actual_indexes to. + # @return [Object] the newly set value + def indeterminate_actual_indexes=(_); end + + # Returns the value of attribute indeterminate_expected_indexes + # + # @return [Object] the current value of indeterminate_expected_indexes + def indeterminate_expected_indexes; end + + # Sets the attribute indeterminate_expected_indexes + # + # @param value [Object] the value to set the attribute indeterminate_expected_indexes to. + # @return [Object] the newly set value + def indeterminate_expected_indexes=(_); end + + # Returns the value of attribute unmatched_actual_indexes + # + # @return [Object] the current value of unmatched_actual_indexes + def unmatched_actual_indexes; end + + # Sets the attribute unmatched_actual_indexes + # + # @param value [Object] the value to set the attribute unmatched_actual_indexes to. + # @return [Object] the newly set value + def unmatched_actual_indexes=(_); end + + # Returns the value of attribute unmatched_expected_indexes + # + # @return [Object] the current value of unmatched_expected_indexes + def unmatched_expected_indexes; end + + # Sets the attribute unmatched_expected_indexes + # + # @param value [Object] the value to set the attribute unmatched_expected_indexes to. + # @return [Object] the newly set value + def unmatched_expected_indexes=(_); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#206 + def unmatched_item_count; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 + def worse_than?(other); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# Abstract class to implement `once`, `at_least` and other +# count constraints. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#7 +module RSpec::Matchers::BuiltIn::CountExpectation + # Specifies the minimum number of times the method is expected to match + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#42 + def at_least(number); end + + # Specifies the maximum number of times the method is expected to match + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#35 + def at_most(number); end + + # Specifies that the method is expected to match the given number of times. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#28 + def exactly(number); end + + # Specifies that the method is expected to match once. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#10 + def once; end + + # Specifies that the method is expected to match thrice. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#22 + def thrice; end + + # No-op. Provides syntactic sugar. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#49 + def times; end + + # Specifies that the method is expected to match twice. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#16 + def twice; end + + protected + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#55 + def count_expectation_type; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#55 + def expected_count; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#120 + def count_constraint_to_number(n); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#139 + def count_expectation_description; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#143 + def count_failure_reason(action); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#60 + def cover?(count, number); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#69 + def expected_count_matches?(actual_count); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#77 + def has_expected_count?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#157 + def human_readable_count(count); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#148 + def human_readable_expectation_type; end + + # @api private + # @raise [ArgumentError] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#100 + def raise_impossible_count_expectation(count); end + + # @api private + # @raise [ArgumentError] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#109 + def raise_unsupported_count_expectation; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#81 + def set_expected_count(relativity, n); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#132 + def unsupported_count_expectation?(relativity); end +end + +# Provides the implementation for `cover`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/cover.rb#7 +class RSpec::Matchers::BuiltIn::Cover < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Cover] a new instance of Cover + # + # source://rspec-expectations//lib/rspec/matchers/built_in/cover.rb#8 + def initialize(*expected); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/cover.rb#17 + def does_not_match?(range); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/cover.rb#12 + def matches?(range); end +end + +# Provides the implementation for dynamic predicate matchers. +# Not intended to be inherited directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#7 +class RSpec::Matchers::BuiltIn::DynamicPredicate < ::RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::BuiltIn::BeHelpers + + # @api private + # @return [DynamicPredicate] a new instance of DynamicPredicate + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#10 + def initialize(method_name, *args, **_arg2, &block); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#43 + def description; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#23 + def does_not_match?(actual, &block); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#31 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#37 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#16 + def matches?(actual, &block); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#99 + def expectation_of(value); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#94 + def failure_message_expecting(value); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#115 + def failure_to_respond_explanation; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#90 + def method_description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#49 + def predicate_accessible?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#74 + def predicate_matches?(value = T.unsafe(nil)); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#70 + def predicate_method_name; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#66 + def predicate_result; end + + # :nocov: + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#61 + def private_predicate?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#82 + def root; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#109 + def validity_message; end +end + +# Provides the implementation for `end_with`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#81 +class RSpec::Matchers::BuiltIn::EndWith < ::RSpec::Matchers::BuiltIn::StartOrEndWith + private + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#88 + def element_matches?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#84 + def subset_matches?; end +end + +# Provides the implementation for `eq`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/eq.rb#7 +class RSpec::Matchers::BuiltIn::Eq < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eq.rb#26 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eq.rb#32 + def diffable?; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eq.rb#10 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eq.rb#20 + def failure_message_when_negated; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eq.rb#38 + def match(expected, actual); end +end + +# Provides the implementation for `eql`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/eql.rb#7 +class RSpec::Matchers::BuiltIn::Eql < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eql.rb#26 + def diffable?; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eql.rb#10 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eql.rb#20 + def failure_message_when_negated; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eql.rb#32 + def match(expected, actual); end +end + +# Provides the implementation for `equal`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#7 +class RSpec::Matchers::BuiltIn::Equal < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#33 + def diffable?; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#10 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#20 + def failure_message_when_negated; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#49 + def actual_inspected; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#61 + def detailed_failure_message; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#45 + def expected_is_a_literal_singleton?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#75 + def inspect_object(o); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#39 + def match(expected, actual); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#57 + def simple_failure_message; end +end + +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#43 +RSpec::Matchers::BuiltIn::Equal::LITERAL_SINGLETONS = T.let(T.unsafe(nil), Array) + +# Provides the implementation for `exist`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#7 +class RSpec::Matchers::BuiltIn::Exist < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Exist] a new instance of Exist + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#8 + def initialize(*expected); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#22 + def does_not_match?(actual); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#30 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#36 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#14 + def matches?(actual); end +end + +# Simple class for memoizing actual/expected for this matcher +# and examining the match +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#43 +class RSpec::Matchers::BuiltIn::Exist::ExistenceTest < ::Struct + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#52 + def actual_exists?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#46 + def valid_test?; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#58 + def validity_message; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#83 + def deprecated(predicate, actual); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#75 + def existence_values; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#79 + def predicates; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#71 + def uniq_truthy_values; end +end + +# Provides the implementation for `has_`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#125 +class RSpec::Matchers::BuiltIn::Has < ::RSpec::Matchers::BuiltIn::DynamicPredicate + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#129 + def predicate; end +end + +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#127 +RSpec::Matchers::BuiltIn::Has::REGEX = T.let(T.unsafe(nil), Regexp) + +# Provides the implementation for `have_attributes`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#7 +class RSpec::Matchers::BuiltIn::HaveAttributes < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [HaveAttributes] a new instance of HaveAttributes + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#11 + def initialize(expected); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#19 + def actual; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#43 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#50 + def diffable?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#34 + def does_not_match?(actual); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#56 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#64 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#25 + def matches?(actual); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#9 + def respond_to_failed; end + + private + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#85 + def actual_has_attribute?(attribute_key, attribute_value); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#70 + def cache_all_values; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#107 + def formatted_values; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#78 + def perform_match(predicate); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#89 + def respond_to_attributes?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#99 + def respond_to_failure_message_or; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#95 + def respond_to_matcher; end +end + +# Provides the implementation for `include`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#9 +class RSpec::Matchers::BuiltIn::Include < ::RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::BuiltIn::CountExpectation + + # @api private + # @return [Include] a new instance of Include + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#15 + def initialize(*expecteds); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#43 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#61 + def diffable?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#32 + def does_not_match?(actual); end + + # @api private + # @return [Array, Hash] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#67 + def expected; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#12 + def expecteds; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#49 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#55 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#21 + def matches?(actual); end + + private + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#167 + def actual_collection_includes?(expected_item); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#153 + def actual_hash_has_key?(expected_key); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#141 + def actual_hash_includes?(expected_key, expected_value); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#77 + def check_actual?(actual); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#83 + def check_expected_count?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#149 + def comparing_hash_keys?(expected_item); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#137 + def comparing_hash_to_a_subset?(expected_item); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#207 + def convert_to_hash?(obj); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#181 + def count_enumerable(expected_item); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#186 + def count_inclusions; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#198 + def diff_would_wrongly_highlight_matched_item?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#120 + def excluded_from_actual; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#95 + def format_failure_message(preposition); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#115 + def perform_match(&block); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#106 + def readable_list_of(items); end +end + +# Provides the implementation for `match`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#7 +class RSpec::Matchers::BuiltIn::Match < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Match] a new instance of Match + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#8 + def initialize(expected); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#15 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#25 + def diffable?; end + + # Used to specify the captures we match against + # + # @api private + # @return [self] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#31 + def with_captures(*captures); end + + private + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#45 + def can_safely_call_match?(expected, actual); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#38 + def match(expected, actual); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#52 + def match_captures(expected, actual); end +end + +# Handles operator matcher for `should_not`. +# +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#116 +class RSpec::Matchers::BuiltIn::NegativeOperatorMatcher < ::RSpec::Matchers::BuiltIn::OperatorMatcher + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#117 + def __delegate_operator(actual, operator, expected); end +end + +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#128 +module RSpec::Matchers::BuiltIn::NullCapture + class << self + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#133 + def capture(_block); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#129 + def name; end + end +end + +# Provides the implementation for operator matchers. +# Not intended to be instantiated directly. +# Only available for use with `should`. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#10 +class RSpec::Matchers::BuiltIn::OperatorMatcher + # @api private + # @return [OperatorMatcher] a new instance of OperatorMatcher + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#41 + def initialize(actual); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#57 + def !=(_expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#57 + def !~(_expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#47 + def <(expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#47 + def <=(expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#47 + def ==(expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#47 + def ===(expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#47 + def =~(expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#47 + def >(expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#47 + def >=(expected); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#76 + def description; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#70 + def fail_with_message(message); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#88 + def eval_match(actual, operator, expected); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#82 + def has_non_generic_implementation_of?(op); end + + class << self + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#29 + def get(klass, operator); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#18 + def register(klass, operator, matcher); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#13 + def registry; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#24 + def unregister(klass, operator); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#46 + def use_custom_matcher_or_delegate(operator); end + end +end + +# Provides the implementation for `output`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#9 +class RSpec::Matchers::BuiltIn::Output < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Output] a new instance of Output + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#10 + def initialize(expected); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#76 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#86 + def diffable?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#24 + def does_not_match?(block); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#64 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#70 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#17 + def matches?(block); end + + # Indicates this matcher matches against a block. + # + # @api private + # @return [True] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#93 + def supports_block_expectations?; end + + # Indicates this matcher matches against a block only. + # + # @api private + # @return [False] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#100 + def supports_value_expectations?; end + + # Tells the matcher to match against stderr. + # Works only when the main Ruby process prints to stderr + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#39 + def to_stderr; end + + # Tells the matcher to match against stderr. + # Works when subprocesses print to stderr as well. + # This is significantly (~30x) slower than `to_stderr` + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#57 + def to_stderr_from_any_process; end + + # Tells the matcher to match against stdout. + # Works only when the main Ruby process prints to stdout + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#31 + def to_stdout; end + + # Tells the matcher to match against stdout. + # Works when subprocesses print to stdout as well. + # This is significantly (~30x) slower than `to_stdout` + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#48 + def to_stdout_from_any_process; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#121 + def actual_output_description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#106 + def captured?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#116 + def negative_failure_reason; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#110 + def positive_failure_reason; end +end + +# Handles operator matcher for `should`. +# +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#97 +class RSpec::Matchers::BuiltIn::PositiveOperatorMatcher < ::RSpec::Matchers::BuiltIn::OperatorMatcher + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#98 + def __delegate_operator(actual, operator, expected); end +end + +# Provides the implementation for `raise_error`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#9 +class RSpec::Matchers::BuiltIn::RaiseError + include ::RSpec::Matchers::Composable + + # @api private + # @return [RaiseError] a new instance of RaiseError + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#22 + def initialize(expected_error_or_message, expected_message, &block); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#117 + def description; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#83 + def does_not_match?(given_proc); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#99 + def expects_call_stack_jump?; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#105 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#111 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#52 + def matches?(given_proc, negative_expectation = T.unsafe(nil), &block); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#89 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#94 + def supports_value_expectations?; end + + # Specifies the expected error message. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#43 + def with_message(expected_message); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#123 + def actual_error_message; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#137 + def block_matches?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#133 + def error_and_message_match?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#145 + def eval_block; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#129 + def expectation_matched?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#226 + def expected_error; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#257 + def expecting_specific_exception?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#241 + def format_backtrace(backtrace); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#246 + def given_error; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#176 + def handle_warning(message); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#261 + def raise_message_already_set; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#141 + def ready_to_eval_block?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#155 + def verify_message; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#188 + def warn_about_bare_error!; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#180 + def warn_about_bare_error?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#214 + def warn_about_negative_false_positive!(expression); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#201 + def warn_about_nil_error!; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#184 + def warn_about_nil_error?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#160 + def warn_for_negative_false_positives!; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#266 + def warning; end +end + +# Used as a sentinel value to be able to tell when the user did not pass an +# argument. We can't use `nil` for that because we need to warn when `nil` is +# passed in a different way. It's an Object, not a Module, since Module's `===` +# does not evaluate to true when compared to itself. +# +# Note; this _is_ the default value supplied for expected_error_or_message, but +# because there are two method-calls involved, that default is actually supplied +# in the definition of the _matcher_ method, `RSpec::Matchers#raise_error` +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#20 +RSpec::Matchers::BuiltIn::RaiseError::UndefinedValue = T.let(T.unsafe(nil), Object) + +# Used to wrap match data and make it reliable for 1.8.7 +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#72 +class RSpec::Matchers::BuiltIn::ReliableMatchData + # @api private + # @return [ReliableMatchData] a new instance of ReliableMatchData + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#73 + def initialize(match_data); end + + # returns an array of captures from the match data + # + # @api private + # @return Array + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#96 + def captures; end + + # Returns match data names for named captures + # + # @api private + # @return Array + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#88 + def names; end + + protected + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#102 + def match_data; end +end + +# Provides the implementation for `respond_to`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#9 +class RSpec::Matchers::BuiltIn::RespondTo < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [RespondTo] a new instance of RespondTo + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#10 + def initialize(*names); end + + # Specifies that the method accepts any keyword, i.e. the method has + # a splatted keyword parameter of the form **kw_args. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with_any_keywords + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#48 + def and_any_keywords; end + + # Specifies keyword arguments, if any. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with_keywords(:color, :shape) + # @example with an expected number of arguments + # expect(obj).to respond_to(:message).with(3).arguments.and_keywords(:color, :shape) + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#36 + def and_keywords(*keywords); end + + # Specifies that the number of arguments has no upper limit, i.e. the + # method has a splatted parameter of the form *args. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with_unlimited_arguments + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#60 + def and_unlimited_arguments; end + + # No-op. Intended to be used as syntactic sugar when using `with`. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with(3).arguments + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#71 + def argument; end + + # No-op. Intended to be used as syntactic sugar when using `with`. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with(3).arguments + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#71 + def arguments; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#100 + def description; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#82 + def does_not_match?(actual); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#88 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#94 + def failure_message_when_negated; end + + # Used by other matchers to suppress a check + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#106 + def ignoring_method_signature_failure!; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#77 + def matches?(actual); end + + # Specifies the number of expected arguments. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with(3).arguments + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#24 + def with(n); end + + # Specifies that the method accepts any keyword, i.e. the method has + # a splatted keyword parameter of the form **kw_args. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with_any_keywords + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#48 + def with_any_keywords; end + + # Specifies keyword arguments, if any. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with_keywords(:color, :shape) + # @example with an expected number of arguments + # expect(obj).to respond_to(:message).with(3).arguments.and_keywords(:color, :shape) + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#36 + def with_keywords(*keywords); end + + # Specifies that the number of arguments has no upper limit, i.e. the + # method has a splatted parameter of the form *args. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with_unlimited_arguments + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#60 + def with_unlimited_arguments; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#112 + def find_failing_method_names(actual, filter_method); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#119 + def matches_arity?(actual, name); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#156 + def pp_names; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#130 + def with_arity; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#139 + def with_arity_string; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#143 + def with_keywords_string; end +end + +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#161 +class RSpec::Matchers::BuiltIn::RespondTo::ArityCheck + # @api private + # @return [ArityCheck] a new instance of ArityCheck + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#162 + def initialize(expected_arity, expected_keywords, arbitrary_keywords, unlimited_arguments); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#178 + def matches?(actual, name); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#187 + def method_signature_for(actual, name); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#183 + def verifier_for(actual, name); end +end + +# Provides the implementation for `satisfy`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#7 +class RSpec::Matchers::BuiltIn::Satisfy < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Satisfy] a new instance of Satisfy + # + # source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#8 + def initialize(description = T.unsafe(nil), &block); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#21 + def description; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#27 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#33 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#14 + def matches?(actual, &block); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#40 + def block_representation; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#48 + def extract_block_snippet; end +end + +# Base class for specifying a change from and/or to specific values. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#181 +class RSpec::Matchers::BuiltIn::SpecificValuesChange < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [SpecificValuesChange] a new instance of SpecificValuesChange + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#185 + def initialize(change_details, from, to); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#197 + def description; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#202 + def failure_message; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#192 + def matches?(event_proc); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#210 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#215 + def supports_value_expectations?; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#244 + def after_value_failure; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#238 + def before_value_failure; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#255 + def did_change_failure; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#250 + def did_not_change_failure; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#234 + def matches_after?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#261 + def not_given_a_block_failure; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#221 + def perform_change(event_proc); end +end + +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#183 +RSpec::Matchers::BuiltIn::SpecificValuesChange::MATCH_ANYTHING = BasicObject + +# For RSpec 3.1, the base class was named `StartAndEndWith`. For SemVer reasons, +# we still provide this constant until 4.0. +# +# @deprecated Use StartOrEndWith instead. +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#61 +RSpec::Matchers::BuiltIn::StartAndEndWith = RSpec::Matchers::BuiltIn::StartOrEndWith + +# Base class for the `end_with` and `start_with` matchers. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#7 +class RSpec::Matchers::BuiltIn::StartOrEndWith < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [StartOrEndWith] a new instance of StartOrEndWith + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#8 + def initialize(*expected); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#27 + def description; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#15 + def failure_message; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#36 + def match(_expected, actual); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#48 + def subsets_comparable?; end +end + +# Provides the implementation for `start_with`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#66 +class RSpec::Matchers::BuiltIn::StartWith < ::RSpec::Matchers::BuiltIn::StartOrEndWith + private + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#73 + def element_matches?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#69 + def subset_matches?; end +end + +# Provides the implementation for `throw_symbol`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#7 +class RSpec::Matchers::BuiltIn::ThrowSymbol + include ::RSpec::Matchers::Composable + + # @api private + # @return [ThrowSymbol] a new instance of ThrowSymbol + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#10 + def initialize(expected_symbol = T.unsafe(nil), expected_arg = T.unsafe(nil)); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#86 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#68 + def does_not_match?(given_proc); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#103 + def expects_call_stack_jump?; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#74 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#80 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#18 + def matches?(given_proc); end + + # Indicates this matcher matches against a block. + # + # @api private + # @return [True] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#93 + def supports_block_expectations?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#98 + def supports_value_expectations?; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#109 + def actual_result; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#118 + def caught; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#114 + def expected(symbol_desc = T.unsafe(nil)); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#122 + def throw_description(symbol, arg); end +end + +# Provides the implementation for `yield_control`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#101 +class RSpec::Matchers::BuiltIn::YieldControl < ::RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::BuiltIn::CountExpectation + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#111 + def does_not_match?(block); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#117 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#123 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#104 + def matches?(block); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#128 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#133 + def supports_value_expectations?; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#139 + def failure_reason; end +end + +# Object that is yielded to `expect` when one of the +# yield matchers is used. Provides information about +# the yield behavior of the object-under-test. +# +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#12 +class RSpec::Matchers::BuiltIn::YieldProbe + # @return [YieldProbe] a new instance of YieldProbe + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#21 + def initialize(block, &callback); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#68 + def assert_used!; end + + # :nocov: + # On 1.8.7, `lambda { }.arity` and `lambda { |*a| }.arity` both return -1, + # so we can't distinguish between accepting no args and an arg splat. + # It's OK to skip, this, though; it just provides a nice error message + # when the user forgets to accept an arg in their block. They'll still get + # the `assert_used!` error message from above, which is sufficient. + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#78 + def assert_valid_expect_block!; end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#29 + def has_block?; end + + # Returns the value of attribute num_yields. + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#19 + def num_yields; end + + # Sets the attribute num_yields + # + # @param value the value to set the attribute num_yields to. + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#19 + def num_yields=(_arg0); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#33 + def probe; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#53 + def single_yield_args; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#40 + def to_proc; end + + # Returns the value of attribute yielded_args. + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#19 + def yielded_args; end + + # Sets the attribute yielded_args + # + # @param value the value to set the attribute yielded_args to. + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#19 + def yielded_args=(_arg0); end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#57 + def yielded_once?(matcher_name); end + + class << self + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#13 + def probe(block, &callback); end + end +end + +# Provides the implementation for `yield_successive_args`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#296 +class RSpec::Matchers::BuiltIn::YieldSuccessiveArgs < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [YieldSuccessiveArgs] a new instance of YieldSuccessiveArgs + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#297 + def initialize(*args); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#337 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#320 + def does_not_match?(block); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#325 + def failure_message; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#331 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#302 + def matches?(block); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#342 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#347 + def supports_value_expectations?; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#353 + def expected_arg_description; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#365 + def negative_failure_reason; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#357 + def positive_failure_reason; end +end + +# Provides the implementation for `yield_with_args`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#199 +class RSpec::Matchers::BuiltIn::YieldWithArgs < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [YieldWithArgs] a new instance of YieldWithArgs + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#200 + def initialize(*args); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#233 + def description; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#218 + def does_not_match?(block); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#223 + def failure_message; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#228 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#205 + def matches?(block); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#240 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#245 + def supports_value_expectations?; end + + private + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#288 + def all_args_match?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#273 + def args_currently_match?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#257 + def expected_arg_description; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#261 + def negative_failure_reason; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#251 + def positive_failure_reason; end +end + +# Provides the implementation for `yield_with_no_args`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#149 +class RSpec::Matchers::BuiltIn::YieldWithNoArgs < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#158 + def does_not_match?(block); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#163 + def failure_message; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#168 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#151 + def matches?(block); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#173 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#178 + def supports_value_expectations?; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#190 + def negative_failure_reason; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#184 + def positive_failure_reason; end +end + +# Mixin designed to support the composable matcher features +# of RSpec 3+. Mix it into your custom matcher classes to +# allow them to be used in a composable fashion. +# +# @api public +# +# source://rspec-expectations//lib/rspec/matchers/composable.rb#10 +module RSpec::Matchers::Composable + # Creates a compound `and` expectation. The matcher will + # only pass if both sub-matchers pass. + # This can be chained together to form an arbitrarily long + # chain of matchers. + # + # @api public + # @example + # expect(alphabet).to start_with("a").and end_with("z") + # expect(alphabet).to start_with("a") & end_with("z") + # @note The negative form (`expect(...).not_to matcher.and other`) + # is not supported at this time. + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#22 + def &(matcher); end + + # Delegates to `#matches?`. Allows matchers to be used in composable + # fashion and also supports using matchers in case statements. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#45 + def ===(value); end + + # Creates a compound `and` expectation. The matcher will + # only pass if both sub-matchers pass. + # This can be chained together to form an arbitrarily long + # chain of matchers. + # + # @api public + # @example + # expect(alphabet).to start_with("a").and end_with("z") + # expect(alphabet).to start_with("a") & end_with("z") + # @note The negative form (`expect(...).not_to matcher.and other`) + # is not supported at this time. + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#22 + def and(matcher); end + + # Creates a compound `or` expectation. The matcher will + # pass if either sub-matcher passes. + # This can be chained together to form an arbitrarily long + # chain of matchers. + # + # @api public + # @example + # expect(stoplight.color).to eq("red").or eq("green").or eq("yellow") + # expect(stoplight.color).to eq("red") | eq("green") | eq("yellow") + # @note The negative form (`expect(...).not_to matcher.or other`) + # is not supported at this time. + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#38 + def or(matcher); end + + # Creates a compound `or` expectation. The matcher will + # pass if either sub-matcher passes. + # This can be chained together to form an arbitrarily long + # chain of matchers. + # + # @api public + # @example + # expect(stoplight.color).to eq("red").or eq("green").or eq("yellow") + # expect(stoplight.color).to eq("red") | eq("green") | eq("yellow") + # @note The negative form (`expect(...).not_to matcher.or other`) + # is not supported at this time. + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#38 + def |(matcher); end + + private + + # Returns the description of the given object in a way that is + # aware of composed matchers. If the object is a matcher with + # a `description` method, returns the description; otherwise + # returns `object.inspect`. + # + # You are encouraged to use this in your custom matcher's + # `description`, `failure_message` or + # `failure_message_when_negated` implementation if you are + # supporting matcher arguments. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#82 + def description_of(object); end + + # We should enumerate arrays as long as they are not recursive. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#142 + def should_enumerate?(item); end + + # Transforms the given data structure (typically a hash or array) + # into a new data structure that, when `#inspect` is called on it, + # will provide descriptions of any contained matchers rather than + # the normal `#inspect` output. + # + # You are encouraged to use this in your custom matcher's + # `description`, `failure_message` or + # `failure_message_when_negated` implementation if you are + # supporting any arguments which may be a data structure + # containing matchers. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#98 + def surface_descriptions_in(item); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#147 + def unreadable_io?(object); end + + # This provides a generic way to fuzzy-match an expected value against + # an actual value. It understands nested data structures (e.g. hashes + # and arrays) and is able to match against a matcher being used as + # the expected value or within the expected value at any level of + # nesting. + # + # Within a custom matcher you are encouraged to use this whenever your + # matcher needs to match two values, unless it needs more precise semantics. + # For example, the `eq` matcher _does not_ use this as it is meant to + # use `==` (and only `==`) for matching. + # + # @api public + # @param expected [Object] what is expected + # @param actual [Object] the actual value + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#66 + def values_match?(expected, actual); end + + # Historically, a single matcher instance was only checked + # against a single value. Given that the matcher was only + # used once, it's been common to memoize some intermediate + # calculation that is derived from the `actual` value in + # order to reuse that intermediate result in the failure + # message. + # + # This can cause a problem when using such a matcher as an + # argument to another matcher in a composed matcher expression, + # since the matcher instance may be checked against multiple + # values and produce invalid results due to the memoization. + # + # To deal with this, we clone any matchers in `expected` via + # this method when using `values_match?`, so that any memoization + # does not "leak" between checks. + # + # @api public + # @private + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#128 + def with_matchers_cloned(object); end + + class << self + # We should enumerate arrays as long as they are not recursive. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#142 + def should_enumerate?(item); end + + # Transforms the given data structure (typically a hash or array) + # into a new data structure that, when `#inspect` is called on it, + # will provide descriptions of any contained matchers rather than + # the normal `#inspect` output. + # + # You are encouraged to use this in your custom matcher's + # `description`, `failure_message` or + # `failure_message_when_negated` implementation if you are + # supporting any arguments which may be a data structure + # containing matchers. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#98 + def surface_descriptions_in(item); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#147 + def unreadable_io?(object); end + end +end + +# Wraps an item in order to surface its `description` via `inspect`. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/composable.rb#158 +class RSpec::Matchers::Composable::DescribableItem < ::Struct + # Inspectable version of the item description + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#160 + def inspect; end + + # Returns the value of attribute item + # + # @return [Object] the current value of item + def item; end + + # Sets the attribute item + # + # @param value [Object] the value to set the attribute item to. + # @return [Object] the newly set value + def item=(_); end + + # A pretty printed version of the item description. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#165 + def pretty_print(pp); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# Defines the custom matcher DSL. +# +# source://rspec-expectations//lib/rspec/matchers/dsl.rb#6 +module RSpec::Matchers::DSL + # Defines a matcher alias. The returned matcher's `description` will be overridden + # to reflect the phrasing of the new name, which will be used in failure messages + # when passed as an argument to another matcher in a composed matcher expression. + # + # @example + # RSpec::Matchers.alias_matcher :a_list_sorted_by, :be_sorted_by do |description| + # description.sub("be sorted by", "a list sorted by") + # end + # + # be_sorted_by(:age).description # => "be sorted by age" + # a_list_sorted_by(:age).description # => "a list sorted by age" + # @example + # RSpec::Matchers.alias_matcher :a_list_that_sums_to, :sum_to + # sum_to(3).description # => "sum to 3" + # a_list_that_sums_to(3).description # => "a list that sums to 3" + # @option options + # @param old_name [Symbol] the original name for the matcher + # @param new_name [Symbol] the new name for the matcher + # @param options [Hash] options for the aliased matcher + # @see RSpec::Matchers + # @yield [String] optional block that, when given, is used to define the overridden + # logic. The yielded arg is the original description or failure message. If no + # block is provided, a default override is used based on the old and new names. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#32 + def alias_matcher(new_name, old_name, options = T.unsafe(nil), &description_override); end + + # Defines a custom matcher. + # + # @param name [Symbol] the name for the matcher + # @see RSpec::Matchers + # @yield [Object] block that is used to define the matcher. + # The block is evaluated in the context of your custom matcher class. + # When args are passed to your matcher, they will be yielded here, + # usually representing the expected value(s). + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#73 + def define(name, &declarations); end + + # Defines a negated matcher. The returned matcher's `description` and `failure_message` + # will be overridden to reflect the phrasing of the new name, and the match logic will + # be based on the original matcher but negated. + # + # @example + # RSpec::Matchers.define_negated_matcher :exclude, :include + # include(1, 2).description # => "include 1 and 2" + # exclude(1, 2).description # => "exclude 1 and 2" + # @param negated_name [Symbol] the name for the negated matcher + # @param base_name [Symbol] the name of the original matcher that will be negated + # @see RSpec::Matchers + # @yield [String] optional block that, when given, is used to define the overridden + # logic. The yielded arg is the original description or failure message. If no + # block is provided, a default override is used based on the old and new names. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#61 + def define_negated_matcher(negated_name, base_name, &description_override); end + + # Defines a custom matcher. + # + # @param name [Symbol] the name for the matcher + # @see RSpec::Matchers + # @yield [Object] block that is used to define the matcher. + # The block is evaluated in the context of your custom matcher class. + # When args are passed to your matcher, they will be yielded here, + # usually representing the expected value(s). + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#73 + def matcher(name, &declarations); end + + private + + # :nocov: + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#84 + def warn_about_block_args(name, declarations); end +end + +# Defines default implementations of the matcher +# protocol methods for custom matchers. You can +# override any of these using the {RSpec::Matchers::DSL::Macros Macros} methods +# from within an `RSpec::Matchers.define` block. +# +# source://rspec-expectations//lib/rspec/matchers/dsl.rb#385 +module RSpec::Matchers::DSL::DefaultImplementations + include ::RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages + + # The default description. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#395 + def description; end + + # Used internally by objects returns by `should` and `should_not`. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#390 + def diffable?; end + + # Most matchers do not expect call stack jumps. + # + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#412 + def expects_call_stack_jump?; end + + # Matchers do not support block expectations by default. You + # must opt-in. + # + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#403 + def supports_block_expectations?; end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#407 + def supports_value_expectations?; end + + private + + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#418 + def chained_method_clause_sentences; end +end + +# Contains the methods that are available from within the +# `RSpec::Matchers.define` DSL for creating custom matchers. +# +# source://rspec-expectations//lib/rspec/matchers/dsl.rb#104 +module RSpec::Matchers::DSL::Macros + # Convenience for defining methods on this matcher to create a fluent + # interface. The trick about fluent interfaces is that each method must + # return self in order to chain methods together. `chain` handles that + # for you. If the method is invoked and the + # `include_chain_clauses_in_custom_matcher_descriptions` config option + # hash been enabled, the chained method name and args will be added to the + # default description and failure message. + # + # In the common case where you just want the chained method to store some + # value(s) for later use (e.g. in `match`), you can provide one or more + # attribute names instead of a block; the chained method will store its + # arguments in instance variables with those names, and the values will + # be exposed via getters. + # + # @example + # + # RSpec::Matchers.define :have_errors_on do |key| + # chain :with do |message| + # @message = message + # end + # + # match do |actual| + # actual.errors[key] == @message + # end + # end + # + # expect(minor).to have_errors_on(:age).with("Not old enough to participate") + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#298 + def chain(method_name, *attr_names, &definition); end + + # Customize the description to use for one-liners. Only use this when + # the description generated by default doesn't suit your needs. + # + # @example + # + # RSpec::Matchers.define :qualify_for do |expected| + # match { your_match_logic } + # + # description do + # "qualify for #{expected}" + # end + # end + # @yield [Object] actual the actual object (i.e. the value wrapped by `expect`) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#253 + def description(&definition); end + + # Tells the matcher to diff the actual and expected values in the failure + # message. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#259 + def diffable; end + + # Customizes the failure message to use when this matcher is + # asked to positively match. Only use this when the message + # generated by default doesn't suit your needs. + # + # @example + # + # RSpec::Matchers.define :have_strength do |expected| + # match { your_match_logic } + # + # failure_message do |actual| + # "Expected strength of #{expected}, but had #{actual.strength}" + # end + # end + # @yield [Object] actual the actual object (i.e. the value wrapped by `expect`) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#216 + def failure_message(&definition); end + + # Customize the failure message to use when this matcher is asked + # to negatively match. Only use this when the message generated by + # default doesn't suit your needs. + # + # @example + # + # RSpec::Matchers.define :have_strength do |expected| + # match { your_match_logic } + # + # failure_message_when_negated do |actual| + # "Expected not to have strength of #{expected}, but did" + # end + # end + # @yield [Object] actual the actual object (i.e. the value wrapped by `expect`) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#235 + def failure_message_when_negated(&definition); end + + # Stores the block that is used to determine whether this matcher passes + # or fails. The block should return a boolean value. When the matcher is + # passed to `expect(...).to` and the block returns `true`, then the expectation + # passes. Similarly, when the matcher is passed to `expect(...).not_to` and the + # block returns `false`, then the expectation passes. + # + # By default the match block will swallow expectation errors (e.g. + # caused by using an expectation such as `expect(1).to eq 2`), if you + # wish to allow these to bubble up, pass in the option + # `:notify_expectation_failures => true`. + # + # @example + # + # RSpec::Matchers.define :be_even do + # match do |actual| + # actual.even? + # end + # end + # + # expect(4).to be_even # passes + # expect(3).not_to be_even # passes + # expect(3).to be_even # fails + # expect(4).not_to be_even # fails + # @param options [Hash] for defining the behavior of the match block. + # @yield [Object] actual the actual value (i.e. the value wrapped by `expect`) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#131 + def match(options = T.unsafe(nil), &match_block); end + + # Use this instead of `match` when the block will raise an exception + # rather than returning false to indicate a failure. + # + # @example + # + # RSpec::Matchers.define :accept_as_valid do |candidate_address| + # match_unless_raises ValidationException do |validator| + # validator.validate(candidate_address) + # end + # end + # + # expect(email_validator).to accept_as_valid("person@company.com") + # @yield [Object] actual the actual object (i.e. the value wrapped by `expect`) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#188 + def match_unless_raises(expected_exception = T.unsafe(nil), &match_block); end + + # Use this to define the block for a negative expectation (`expect(...).not_to`) + # when the positive and negative forms require different handling. This + # is rarely necessary, but can be helpful, for example, when specifying + # asynchronous processes that require different timeouts. + # + # By default the match block will swallow expectation errors (e.g. + # caused by using an expectation such as `expect(1).to eq 2`), if you + # wish to allow these to bubble up, pass in the option + # `:notify_expectation_failures => true`. + # + # @param options [Hash] for defining the behavior of the match block. + # @yield [Object] actual the actual value (i.e. the value wrapped by `expect`) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#160 + def match_when_negated(options = T.unsafe(nil), &match_block); end + + # Declares that the matcher can be used in a block expectation. + # Users will not be able to use your matcher in a block + # expectation without declaring this. + # (e.g. `expect { do_something }.to matcher`). + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#267 + def supports_block_expectations; end + + private + + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#312 + def assign_attributes(attr_names); end + + # Does the following: + # + # - Defines the named method using a user-provided block + # in @user_method_defs, which is included as an ancestor + # in the singleton class in which we eval the `define` block. + # - Defines an overridden definition for the same method + # usign the provided `our_def` block. + # - Provides a default `our_def` block for the common case + # of needing to call the user's definition with `@actual` + # as an arg, but only if their block's arity can handle it. + # + # This compiles the user block into an actual method, allowing + # them to use normal method constructs like `return` + # (e.g. for an early guard statement), while allowing us to define + # an override that can provide the wrapped handling + # (e.g. assigning `@actual`, rescueing errors, etc) and + # can `super` to the user's definition. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#346 + def define_user_override(method_name, user_def, &our_def); end +end + +# Defines deprecated macro methods from RSpec 2 for backwards compatibility. +# +# @deprecated Use the methods from {Macros} instead. +# +# source://rspec-expectations//lib/rspec/matchers/dsl.rb#354 +module RSpec::Matchers::DSL::Macros::Deprecated + # @deprecated Use {Macros#failure_message} instead. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#368 + def failure_message_for_should(&definition); end + + # @deprecated Use {Macros#failure_message_when_negated} instead. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#374 + def failure_message_for_should_not(&definition); end + + # @deprecated Use {Macros#match} instead. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#356 + def match_for_should(&definition); end + + # @deprecated Use {Macros#match_when_negated} instead. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#362 + def match_for_should_not(&definition); end +end + +# @private +# +# source://rspec-expectations//lib/rspec/matchers/dsl.rb#146 +RSpec::Matchers::DSL::Macros::RAISE_NOTIFIER = T.let(T.unsafe(nil), Proc) + +# The class used for custom matchers. The block passed to +# `RSpec::Matchers.define` will be evaluated in the context +# of the singleton class of an instance, and will have the +# {RSpec::Matchers::DSL::Macros Macros} methods available. +# +# source://rspec-expectations//lib/rspec/matchers/dsl.rb#433 +class RSpec::Matchers::DSL::Matcher + include ::RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages + include ::RSpec::Matchers::DSL::DefaultImplementations + include ::RSpec::Matchers + include ::RSpec::Matchers::Composable + extend ::RSpec::Matchers::DSL::Macros + extend ::RSpec::Matchers::DSL::Macros::Deprecated + + # @api private + # @return [Matcher] a new instance of Matcher + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#462 + def initialize(name, declarations, matcher_execution_context, *expected, &block_arg); end + + # Exposes the value being matched against -- generally the object + # object wrapped by `expect`. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#449 + def actual; end + + # The block parameter used in the expectation + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#456 + def block_arg; end + + # Provides the expected value. This will return an array if + # multiple arguments were passed to the matcher; otherwise it + # will return a single value. + # + # @see #expected_as_array + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#482 + def expected; end + + # Returns the expected value as an an array. This exists primarily + # to aid in upgrading from RSpec 2.x, since in RSpec 2, `expected` + # always returned an array. + # + # @see #expected + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#494 + def expected_as_array; end + + # Adds the name (rather than a cryptic hex number) + # so we can identify an instance of + # the matcher in error messages (e.g. for `NoMethodError`) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#499 + def inspect; end + + # The name of the matcher. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#459 + def name; end + + # Exposes the exception raised during the matching by `match_unless_raises`. + # Could be useful to extract details for a failure message. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#453 + def rescued_exception; end + + private + + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#522 + def actual_arg_for(block); end + + # Takes care of forwarding unhandled messages to the + # `@matcher_execution_context` (typically the current + # running `RSpec::Core::Example`). This is needed by + # rspec-rails so that it can define matchers that wrap + # Rails' test helper methods, but it's also a useful + # feature in its own right. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#532 + def method_missing(method, *args, **_arg2, &block); end + + # Indicates that this matcher responds to messages + # from the `@matcher_execution_context` as well. + # Also, supports getting a method object for such methods. + # + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#507 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end +end + +# source://rspec-expectations//lib/rspec/matchers.rb#959 +RSpec::Matchers::DYNAMIC_MATCHER_REGEX = T.let(T.unsafe(nil), Regexp) + +# Facilitates converting ruby objects to English phrases. +# +# source://rspec-expectations//lib/rspec/matchers/english_phrasing.rb#4 +module RSpec::Matchers::EnglishPhrasing + class << self + # when given an empty list. + # + # Converts an object (often a collection of objects) + # into an English list. + # + # list(['banana', 'kiwi', 'mango']) + # #=> " \"banana\", \"kiwi\", and \"mango\"" + # + # Given an empty collection, returns the empty string. + # + # list([]) #=> "" + # + # @note The returned string has a leading space except + # + # source://rspec-expectations//lib/rspec/matchers/english_phrasing.rb#26 + def list(obj); end + + # Converts a symbol into an English expression. + # + # split_words(:banana_creme_pie) #=> "banana creme pie" + # + # source://rspec-expectations//lib/rspec/matchers/english_phrasing.rb#9 + def split_words(sym); end + end +end + +# source://rspec-expectations//lib/rspec/matchers.rb#958 +RSpec::Matchers::HAS_REGEX = T.let(T.unsafe(nil), Regexp) + +# Provides the necessary plumbing to wrap a matcher with a decorator. +# +# @private +# +# source://rspec-expectations//lib/rspec/matchers/matcher_delegator.rb#31 +class RSpec::Matchers::MatcherDelegator < ::RSpec::Matchers::BaseDelegator + include ::RSpec::Matchers::Composable + + # @return [MatcherDelegator] a new instance of MatcherDelegator + # + # source://rspec-expectations//lib/rspec/matchers/matcher_delegator.rb#35 + def initialize(base_matcher); end + + # Returns the value of attribute base_matcher. + # + # source://rspec-expectations//lib/rspec/matchers/matcher_delegator.rb#33 + def base_matcher; end + + # source://rspec-expectations//lib/rspec/matchers/matcher_delegator.rb#39 + def method_missing(*args, &block); end + + private + + # source://rspec-expectations//lib/rspec/matchers/matcher_delegator.rb#55 + def initialize_copy(other); end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/matcher_delegator.rb#44 + def respond_to_missing?(name, include_all = T.unsafe(nil)); end +end + +# Handles list of expected and actual value pairs when there is a need +# to render multiple diffs. Also can handle one pair. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#6 +class RSpec::Matchers::MultiMatcherDiff + # @api private + # @return [MultiMatcherDiff] a new instance of MultiMatcherDiff + # + # source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#16 + def initialize(expected_list); end + + # Returns message with diff(s) appended for provided differ + # factory and actual value if there are any + # + # @api private + # @param message [String] original failure message + # @param differ [Proc] + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#47 + def message_with_diff(message, differ); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#68 + def diffs(differ); end + + class << self + # Wraps provided matcher list in instance of + # MultiMatcherDiff. + # + # @api private + # @param matchers [Array] list of matchers to wrap + # @return [RSpec::Matchers::MultiMatcherDiff] + # + # source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#37 + def for_many_matchers(matchers); end + + # Wraps provided expected value in instance of + # MultiMatcherDiff. If provided value is already an + # MultiMatcherDiff then it just returns it. + # + # @api private + # @param expected [Any] value to be wrapped + # @param actual [Any] value + # @return [RSpec::Matchers::MultiMatcherDiff] + # + # source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#27 + def from(expected, actual); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#58 + def diff_label_for(matcher); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#62 + def truncated(description); end + end +end + +# Default diff label when there is only one matcher in diff +# output +# +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#10 +RSpec::Matchers::MultiMatcherDiff::DEFAULT_DIFF_LABEL = T.let(T.unsafe(nil), String) + +# Maximum readable matcher description length +# +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#14 +RSpec::Matchers::MultiMatcherDiff::DESCRIPTION_MAX_LENGTH = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/rspec-mocks.rbi b/sorbet/rbi/gems/rspec-mocks.rbi deleted file mode 100644 index 29d7550..0000000 --- a/sorbet/rbi/gems/rspec-mocks.rbi +++ /dev/null @@ -1,1115 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: false -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/rspec-mocks/all/rspec-mocks.rbi -# -# rspec-mocks-3.13.1 - -module RSpec -end -module RSpec::Mocks - def self.allow_message(subject, message, opts = nil, &block); end - def self.configuration; end - def self.error_generator; end - def self.expect_message(subject, message, opts = nil, &block); end - def self.setup; end - def self.space; end - def self.teardown; end - def self.verify; end - def self.with_temporary_scope; end -end -class RSpec::Mocks::InstanceMethodStasher - def handle_restoration_failures; end - def initialize(object, method); end - def method_defined_directly_on_klass?; end - def method_defined_on_klass?(klass = nil); end - def method_is_stashed?; end - def method_owned_by_klass?; end - def original_method; end - def restore; end - def stash; end -end -class RSpec::Mocks::MethodDouble - def add_default_stub(*args, &implementation); end - def add_expectation(error_generator, expectation_ordering, expected_from, opts, &implementation); end - def add_simple_expectation(method_name, response, error_generator, backtrace_line); end - def add_simple_stub(method_name, response); end - def add_stub(error_generator, expectation_ordering, expected_from, opts = nil, &implementation); end - def build_expectation(error_generator, expectation_ordering); end - def clear; end - def configure_method; end - def define_proxy_method; end - def definition_target; end - def expectations; end - def initialize(object, method_name, proxy); end - def message_expectation_class; end - def method_missing_block; end - def method_name; end - def method_stasher; end - def new_rspec_prepended_module; end - def object; end - def object_singleton_class; end - def original_implementation_callable; end - def original_method; end - def proxy_method_invoked(_obj, *args, **, &block); end - def raise_method_not_stubbed_error; end - def remove_method_from_definition_target; end - def remove_stub; end - def remove_stub_if_present; end - def reset; end - def restore_original_method; end - def restore_original_visibility; end - def save_original_implementation_callable!; end - def setup_simple_method_double(method_name, response, collection, error_generator = nil, backtrace_line = nil); end - def show_frozen_warning; end - def stubs; end - def usable_rspec_prepended_module; end - def verify; end - def visibility; end -end -class RSpec::Mocks::MethodDouble::RSpecPrependedModule < Module -end -module RSpec::Mocks::ArgumentMatchers - def a_kind_of(klass); end - def an_instance_of(klass); end - def any_args; end - def anything; end - def array_excluding(*args); end - def array_including(*args); end - def boolean; end - def duck_type(*args); end - def hash_excluding(*args); end - def hash_including(*args); end - def hash_not_including(*args); end - def instance_of(klass); end - def kind_of(klass); end - def no_args; end - def self.anythingize_lonely_keys(*args); end -end -class RSpec::Mocks::ArgumentMatchers::SingletonMatcher - def self.inherited(subklass); end - def self.new(*, **); end -end -class RSpec::Mocks::ArgumentMatchers::AnyArgsMatcher < RSpec::Mocks::ArgumentMatchers::SingletonMatcher - def description; end -end -class RSpec::Mocks::ArgumentMatchers::AnyArgMatcher < RSpec::Mocks::ArgumentMatchers::SingletonMatcher - def ===(_other); end - def description; end -end -class RSpec::Mocks::ArgumentMatchers::NoArgsMatcher < RSpec::Mocks::ArgumentMatchers::SingletonMatcher - def description; end -end -class RSpec::Mocks::ArgumentMatchers::BooleanMatcher < RSpec::Mocks::ArgumentMatchers::SingletonMatcher - def ===(value); end - def description; end -end -class RSpec::Mocks::ArgumentMatchers::BaseHashMatcher - def ===(predicate, actual); end - def description(name); end - def formatted_expected_hash; end - def initialize(expected); end -end -class RSpec::Mocks::ArgumentMatchers::HashIncludingMatcher < RSpec::Mocks::ArgumentMatchers::BaseHashMatcher - def ===(actual); end - def description; end -end -class RSpec::Mocks::ArgumentMatchers::HashExcludingMatcher < RSpec::Mocks::ArgumentMatchers::BaseHashMatcher - def ===(actual); end - def description; end -end -class RSpec::Mocks::ArgumentMatchers::ArrayIncludingMatcher - def ===(actual); end - def description; end - def formatted_expected_values; end - def initialize(expected); end -end -class RSpec::Mocks::ArgumentMatchers::ArrayExcludingMatcher - def ===(actual); end - def description; end - def formatted_unexpected_values; end - def initialize(unexpected); end -end -class RSpec::Mocks::ArgumentMatchers::DuckTypeMatcher - def ===(value); end - def description; end - def initialize(*methods_to_respond_to); end -end -class RSpec::Mocks::ArgumentMatchers::InstanceOf - def ===(actual); end - def description; end - def initialize(klass); end -end -class RSpec::Mocks::ArgumentMatchers::KindOf - def ===(actual); end - def description; end - def initialize(klass); end -end -class RSpec::Mocks::ObjectReference - def self.anonymous_module?(mod); end - def self.for(object_module_or_name, allow_direct_object_refs = nil); end - def self.name_of(mod); end -end -class RSpec::Mocks::DirectObjectReference - def const_to_replace; end - def defined?; end - def description; end - def initialize(object); end - def target; end - def when_loaded; end -end -class RSpec::Mocks::NamedObjectReference - def const_to_replace; end - def defined?; end - def description; end - def initialize(const_name); end - def object; end - def target; end - def when_loaded; end -end -module RSpec::Mocks::ExampleMethods - def allow(target); end - def allow_any_instance_of(klass); end - def allow_message_expectations_on_nil; end - def class_double(doubled_class, *args); end - def class_spy(*args); end - def double(*args); end - def expect_any_instance_of(klass); end - def have_received(method_name, &block); end - def hide_const(constant_name); end - def instance_double(doubled_class, *args); end - def instance_spy(*args); end - def object_double(object_or_name, *args); end - def object_spy(*args); end - def receive(method_name, &block); end - def receive_message_chain(*messages, &block); end - def receive_messages(message_return_value_hash); end - def self.declare_double(type, *args); end - def self.declare_verifying_double(type, ref, *args); end - def self.extended(object); end - def self.included(klass); end - def spy(*args); end - def stub_const(constant_name, value, options = nil); end - def without_partial_double_verification; end - include RSpec::Mocks::ArgumentMatchers -end -module RSpec::Mocks::ExampleMethods::ExpectHost - def expect(target); end -end -class RSpec::Mocks::Proxy - def add_message_expectation(method_name, opts = nil, &block); end - def add_simple_expectation(method_name, response, location); end - def add_simple_stub(method_name, response); end - def add_stub(method_name, opts = nil, &implementation); end - def as_null_object; end - def build_expectation(method_name); end - def check_for_unexpected_arguments(expectation); end - def ensure_can_be_proxied!(object); end - def ensure_implemented(*_args); end - def find_almost_matching_expectation(method_name, *args, **); end - def find_almost_matching_stub(method_name, *args, **); end - def find_best_matching_expectation_for(method_name); end - def find_matching_expectation(method_name, *args, **); end - def find_matching_method_stub(method_name, *args, **); end - def has_negative_expectation?(message); end - def initialize(object, order_group, options = nil); end - def message_received(message, *args, **, &block); end - def messages_arg_list; end - def method_double_for(message); end - def method_double_if_exists_for_message(message); end - def null_object?; end - def object; end - def original_method_handle_for(_message); end - def prepended_modules_of_singleton_class; end - def raise_missing_default_stub_error(expectation, args_for_multiple_calls); end - def raise_unexpected_message_error(method_name, args); end - def received_message?(method_name, *args, &block); end - def record_message_received(message, *args, **, &block); end - def remove_stub(method_name); end - def remove_stub_if_present(method_name); end - def replay_received_message_on(expectation, &block); end - def reset; end - def self.prepended_modules_of(klass); end - def verify; end - def visibility_for(_method_name); end -end -class RSpec::Mocks::Proxy::SpecificMessage < Struct - def ==(expectation); end - def args; end - def args=(_); end - def message; end - def message=(_); end - def object; end - def object=(_); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class RSpec::Mocks::TestDoubleProxy < RSpec::Mocks::Proxy - def reset; end -end -class RSpec::Mocks::PartialDoubleProxy < RSpec::Mocks::Proxy - def add_simple_expectation(method_name, response, location); end - def add_simple_stub(method_name, response); end - def any_instance_class_recorder_observing_method?(klass, method_name); end - def message_received(message, *args, **, &block); end - def original_method_handle_for(message); end - def reset; end - def visibility_for(method_name); end -end -module RSpec::Mocks::PartialClassDoubleProxyMethods - def initialize(source_space, *args); end - def method_double_from_ancestor_for(message); end - def original_method_handle_for(message); end - def original_unbound_method_handle_from_ancestor_for(message); end - def superclass_proxy; end -end -class RSpec::Mocks::PartialClassDoubleProxy < RSpec::Mocks::PartialDoubleProxy - include RSpec::Mocks::PartialClassDoubleProxyMethods -end -class RSpec::Mocks::ProxyForNil < RSpec::Mocks::PartialDoubleProxy - def add_message_expectation(method_name, opts = nil, &block); end - def add_stub(method_name, opts = nil, &implementation); end - def disallow_expectations; end - def disallow_expectations=(arg0); end - def initialize(order_group); end - def raise_error(method_name); end - def set_expectation_behavior; end - def warn(method_name); end - def warn_about_expectations; end - def warn_about_expectations=(arg0); end - def warn_or_raise!(method_name); end -end -module RSpec::Mocks::TestDouble - def ==(other); end - def __build_mock_proxy(order_group); end - def __build_mock_proxy_unless_expired(order_group); end - def __disallow_further_usage!; end - def __mock_proxy; end - def __raise_expired_error; end - def as_null_object; end - def assign_stubs(stubs); end - def freeze; end - def initialize(name = nil, stubs = nil); end - def initialize_copy(other); end - def inspect; end - def method_missing(message, *args, &block); end - def null_object?; end - def respond_to?(message, incl_private = nil); end - def to_s; end -end -class RSpec::Mocks::Double - include RSpec::Mocks::TestDouble -end -module RSpec::Mocks::TestDoubleFormatter - def self.format(dbl, unwrap = nil); end - def self.name_desc(dbl); end - def self.type_desc(dbl); end - def self.verified_module_desc(dbl); end -end -class RSpec::Mocks::ArgumentListMatcher - def args_match?(*actual_args, **); end - def ensure_expected_args_valid!; end - def expected_args; end - def initialize(*expected_args, **); end - def replace_any_args_with_splat_of_anything(before_count, actual_args_count); end - def resolve_expected_args_based_on(actual_args); end -end -class RSpec::Mocks::SimpleMessageExpectation - def called_max_times?; end - def initialize(message, response, error_generator, backtrace_line = nil); end - def invoke(*_); end - def matches?(message, *_); end - def unadvise(_); end - def verify_messages_received; end -end -class RSpec::Mocks::MessageExpectation - def and_call_original; end - def and_invoke(first_proc, *procs); end - def and_raise(*args); end - def and_return(first_value, *values); end - def and_throw(*args); end - def and_wrap_original(&block); end - def and_yield(*args, &block); end - def at_least(n, &block); end - def at_most(n, &block); end - def exactly(n, &block); end - def inspect; end - def never; end - def once(&block); end - def ordered(&block); end - def thrice(&block); end - def time(&block); end - def times(&block); end - def to_s; end - def twice(&block); end - def with(*args, **, &block); end - include RSpec::Mocks::MessageExpectation::ImplementationDetails -end -module RSpec::Mocks::MessageExpectation::ImplementationDetails - def actual_received_count_matters?; end - def additional_expected_calls; end - def advise(*args); end - def and_yield_receiver_to_implementation; end - def argument_list_matcher=(arg0); end - def called_max_times?; end - def description_for(verb); end - def ensure_expected_ordering_received!; end - def error_generator; end - def error_generator=(arg0); end - def exception_source_id; end - def expectation_count_type; end - def expected_args; end - def expected_from=(arg0); end - def expected_messages_received?; end - def expected_received_count=(arg0); end - def generate_error; end - def has_been_invoked?; end - def ignoring_args?; end - def implementation; end - def implementation=(arg0); end - def increase_actual_received_count!; end - def initial_implementation_action=(action); end - def initialize(error_generator, expectation_ordering, expected_from, method_double, type = nil, opts = nil, &implementation_block); end - def inner_implementation_action=(action); end - def invoke(parent_stub, *args, **, &block); end - def invoke_incrementing_actual_calls_by(increment, allowed_to_fail, parent_stub, *args, **, &block); end - def invoke_without_incrementing_received_count(parent_stub, *args, **, &block); end - def matches?(message, *args, **); end - def matches_at_least_count?; end - def matches_at_most_count?; end - def matches_exact_count?; end - def matches_name_but_not_args(message, *args); end - def message; end - def negative?; end - def negative_expectation_for?(message); end - def ordered?; end - def orig_object; end - def raise_already_invoked_error_if_necessary(calling_customization); end - def raise_out_of_order_error; end - def raise_unexpected_message_args_error(args_for_multiple_calls); end - def safe_invoke(parent_stub, *args, **, &block); end - def set_expected_received_count(relativity, n); end - def similar_messages; end - def terminal_implementation_action=(action); end - def type; end - def unadvise(args); end - def verify_messages_received; end - def warn_about_stub_override; end - def wrap_original(method_name, &block); end - def yield_receiver_to_implementation_block?; end -end -class RSpec::Mocks::AndYieldImplementation - def call(*_args_to_ignore, &block); end - def initialize(args_to_yield, eval_context, error_generator); end -end -class RSpec::Mocks::AndReturnImplementation - def call(*_args_to_ignore, &_block); end - def initialize(values_to_return); end -end -class RSpec::Mocks::AndInvokeImplementation - def call(*args, &block); end - def initialize(procs_to_invoke); end -end -class RSpec::Mocks::Implementation - def actions; end - def call(*args, **, &block); end - def initial_action; end - def initial_action=(arg0); end - def inner_action; end - def inner_action=(arg0); end - def present?; end - def terminal_action; end - def terminal_action=(arg0); end -end -class RSpec::Mocks::AndWrapOriginalImplementation - def call(*args, **, &block); end - def cannot_modify_further_error; end - def initial_action=(_value); end - def initialize(method, block); end - def inner_action; end - def inner_action=(_value); end - def present?; end - def terminal_action=(_value); end -end -class RSpec::Mocks::AndWrapOriginalImplementation::CannotModifyFurtherError < StandardError -end -class RSpec::Mocks::OrderGroup - def clear; end - def consume; end - def empty?; end - def expectation_for(message); end - def expectations_invoked_in_order?; end - def expected_invocations; end - def handle_order_constraint(expectation); end - def initialize; end - def invoked(message); end - def invoked_expectations; end - def ready_for?(expectation); end - def register(expectation); end - def remaining_expectations; end - def verify_invocation_order(expectation); end -end -class RSpec::Mocks::MockExpectationError < Exception -end -class RSpec::Mocks::ExpiredTestDoubleError < RSpec::Mocks::MockExpectationError -end -class RSpec::Mocks::OutsideOfExampleError < StandardError -end -class RSpec::Mocks::MockExpectationAlreadyInvokedError < Exception -end -class RSpec::Mocks::CannotSupportArgMutationsError < StandardError -end -class RSpec::Mocks::UnsupportedMatcherError < StandardError -end -class RSpec::Mocks::NegationUnsupportedError < StandardError -end -class RSpec::Mocks::VerifyingDoubleNotDefinedError < StandardError -end -class RSpec::Mocks::ErrorGenerator - def __raise(message, backtrace_line = nil, source_id = nil); end - def arg_list(args); end - def count_message(count, expectation_count_type = nil); end - def default_error_message(expectation, expected_args, actual_args); end - def describe_expectation(verb, message, expected_received_count, _actual_received_count, args); end - def diff_message(expected_args, actual_args); end - def differ; end - def error_message(expectation, args_for_multiple_calls); end - def expectation_on_nil_message(method_name); end - def expected_part_of_expectation_error(expected_received_count, expectation_count_type, argument_list_matcher); end - def format_args(args); end - def format_received_args(args_for_multiple_calls); end - def group_count(index, args); end - def grouped_args(args); end - def initialize(target = nil); end - def intro(unwrapped = nil); end - def list_of_exactly_one_string?(args); end - def method_call_args_description(args, generic_prefix = nil, matcher_prefix = nil); end - def notify(*args); end - def opts; end - def opts=(arg0); end - def prepend_to_backtrace(exception, line); end - def raise_already_invoked_error(message, calling_customization); end - def raise_cant_constrain_count_for_negated_have_received_error(count_constraint); end - def raise_double_negation_error(wrapped_expression); end - def raise_expectation_error(message, expected_received_count, argument_list_matcher, actual_received_count, expectation_count_type, args, backtrace_line = nil, source_id = nil); end - def raise_expectation_on_mocked_method(method); end - def raise_expectation_on_nil_error(method_name); end - def raise_expectation_on_unstubbed_method(method); end - def raise_expired_test_double_error; end - def raise_have_received_disallowed(type, reason); end - def raise_invalid_arguments_error(verifier); end - def raise_method_not_stubbed_error(method_name); end - def raise_missing_block_error(args_to_yield); end - def raise_missing_default_stub_error(expectation, args_for_multiple_calls); end - def raise_non_public_error(method_name, visibility); end - def raise_only_valid_on_a_partial_double(method); end - def raise_out_of_order_error(message); end - def raise_similar_message_args_error(expectation, args_for_multiple_calls, backtrace_line = nil); end - def raise_unexpected_message_args_error(expectation, args_for_multiple_calls, source_id = nil); end - def raise_unexpected_message_error(message, args); end - def raise_unimplemented_error(doubled_module, method_name, object); end - def raise_verifying_double_not_defined_error(ref); end - def raise_wrong_arity_error(args_to_yield, signature); end - def received_part_of_expectation_error(actual_received_count, args); end - def times(count); end - def unexpected_arguments_message(expected_args_string, actual_args_string); end - def unpack_string_args(formatted_expected_args, actual_args); end -end -class RSpec::Mocks::RootSpace - def any_instance_proxy_for(*_args); end - def any_instance_recorder_for(*_args); end - def any_instance_recorders_from_ancestry_of(_object); end - def new_scope; end - def proxy_for(*_args); end - def raise_lifecycle_message; end - def register_constant_mutator(_mutator); end - def registered?(_object); end - def reset_all; end - def superclass_proxy_for(*_args); end - def verify_all; end -end -class RSpec::Mocks::Space - def any_instance_mutex; end - def any_instance_proxy_for(klass); end - def any_instance_recorder_for(klass, only_return_existing = nil); end - def any_instance_recorder_not_found_for(id, klass); end - def any_instance_recorders; end - def any_instance_recorders_from_ancestry_of(object); end - def class_proxy_with_callback_verification_strategy(object, strategy); end - def constant_mutator_for(name); end - def ensure_registered(object); end - def id_for(object); end - def initialize; end - def new_mutex; end - def new_scope; end - def proxies; end - def proxies_of(klass); end - def proxy_for(object); end - def proxy_mutex; end - def proxy_not_found_for(id, object); end - def register_constant_mutator(mutator); end - def registered?(object); end - def reset_all; end - def superclass_proxy_for(klass); end - def superclass_proxy_not_found_for(id, object); end - def verify_all; end -end -class RSpec::Mocks::NestedSpace < RSpec::Mocks::Space - def any_instance_recorder_not_found_for(id, klass); end - def constant_mutator_for(name); end - def initialize(parent); end - def proxies_of(klass); end - def proxy_not_found_for(id, object); end - def registered?(object); end -end -class RSpec::Mocks::Constant - def hidden=(arg0); end - def hidden?; end - def initialize(name); end - def inspect; end - def mutated?; end - def name; end - def original_value; end - def original_value=(arg0); end - def previously_defined=(arg0); end - def previously_defined?; end - def self.original(name); end - def self.unmutated(name); end - def stubbed=(arg0); end - def stubbed?; end - def to_s; end - def valid_name=(arg0); end - def valid_name?; end - extend RSpec::Support::RecursiveConstMethods -end -class RSpec::Mocks::ConstantMutator - def self.hide(constant_name); end - def self.mutate(mutator); end - def self.raise_on_invalid_const; end - def self.stub(constant_name, value, options = nil); end - extend RSpec::Support::RecursiveConstMethods -end -class RSpec::Mocks::ConstantMutator::BaseMutator - def full_constant_name; end - def idempotently_reset; end - def initialize(full_constant_name, mutated_value, transfer_nested_constants); end - def original_value; end - def to_constant; end - include RSpec::Support::RecursiveConstMethods -end -class RSpec::Mocks::ConstantMutator::ConstantHider < RSpec::Mocks::ConstantMutator::BaseMutator - def mutate; end - def reset; end - def to_constant; end -end -class RSpec::Mocks::ConstantMutator::DefinedConstantReplacer < RSpec::Mocks::ConstantMutator::BaseMutator - def initialize(*args); end - def mutate; end - def reset; end - def should_transfer_nested_constants?; end - def to_constant; end - def transfer_nested_constants; end - def verify_constants_to_transfer!; end -end -class RSpec::Mocks::ConstantMutator::UndefinedConstantSetter < RSpec::Mocks::ConstantMutator::BaseMutator - def mutate; end - def name_for(parent, name); end - def reset; end - def to_constant; end -end -module RSpec::Mocks::TargetDelegationClassMethods - def delegate_not_to(matcher_method, options = nil); end - def delegate_to(matcher_method); end - def disallow_negation(method_name); end -end -module RSpec::Mocks::TargetDelegationInstanceMethods - def define_matcher(matcher, name, &block); end - def matcher_allowed?(matcher); end - def raise_negation_unsupported(method_name, matcher); end - def raise_unsupported_matcher(method_name, matcher); end - def target; end -end -class RSpec::Mocks::TargetBase - def initialize(target); end - extend RSpec::Mocks::TargetDelegationClassMethods - include RSpec::Mocks::TargetDelegationInstanceMethods -end -module RSpec::Mocks::ExpectationTargetMethods - def expression; end - def not_to(matcher, &block); end - def to(matcher, &block); end - def to_not(matcher, &block); end - extend RSpec::Mocks::TargetDelegationClassMethods - include RSpec::Mocks::TargetDelegationInstanceMethods -end -class RSpec::Mocks::ExpectationTarget < RSpec::Mocks::TargetBase - include RSpec::Mocks::ExpectationTargetMethods -end -class RSpec::Mocks::AllowanceTarget < RSpec::Mocks::TargetBase - def expression; end - def not_to(matcher, *_args); end - def to(matcher, &block); end - def to_not(matcher, *_args); end -end -class RSpec::Mocks::AnyInstanceAllowanceTarget < RSpec::Mocks::TargetBase - def expression; end - def not_to(matcher, *_args); end - def to(matcher, &block); end - def to_not(matcher, *_args); end -end -class RSpec::Mocks::AnyInstanceExpectationTarget < RSpec::Mocks::TargetBase - def expression; end - def not_to(matcher, &block); end - def to(matcher, &block); end - def to_not(matcher, &block); end -end -module RSpec::Mocks::Syntax - def self.default_should_syntax_host; end - def self.disable_expect(syntax_host = nil); end - def self.disable_should(syntax_host = nil); end - def self.enable_expect(syntax_host = nil); end - def self.enable_should(syntax_host = nil); end - def self.expect_enabled?(syntax_host = nil); end - def self.should_enabled?(syntax_host = nil); end - def self.warn_about_should!; end - def self.warn_unless_should_configured(method_name, replacement = nil); end -end -class BasicObject - def as_null_object; end - def null_object?; end - def received_message?(message, *args, &block); end - def should_not_receive(message, &block); end - def should_receive(message, opts = nil, &block); end - def stub(message_or_hash, opts = nil, &block); end - def stub_chain(*chain, &blk); end - def unstub(message); end -end -class Class < Module - def any_instance; end -end -class RSpec::Mocks::Configuration - def add_stub_and_should_receive_to(*modules); end - def allow_message_expectations_on_nil; end - def allow_message_expectations_on_nil=(arg0); end - def before_verifying_doubles(&block); end - def color?; end - def initialize; end - def patch_marshal_to_support_partial_doubles=(val); end - def reset_syntaxes_to_default; end - def syntax; end - def syntax=(*values); end - def temporarily_suppress_partial_double_verification; end - def temporarily_suppress_partial_double_verification=(arg0); end - def transfer_nested_constants=(arg0); end - def transfer_nested_constants?; end - def verify_doubled_constant_names=(arg0); end - def verify_doubled_constant_names?; end - def verify_partial_doubles=(val); end - def verify_partial_doubles?; end - def verifying_double_callbacks; end - def when_declaring_verifying_double(&block); end - def yield_receiver_to_any_instance_implementation_blocks=(arg0); end - def yield_receiver_to_any_instance_implementation_blocks?; end -end -class RSpec::Mocks::VerifyingMessageExpectation < RSpec::Mocks::MessageExpectation - def initialize(*args); end - def method_reference; end - def method_reference=(arg0); end - def validate_expected_arguments!; end - def with(*args, **, &block); end -end -class RSpec::Mocks::MethodReference - def defined?; end - def implemented?; end - def initialize(object_reference, method_name); end - def original_method; end - def self.for(object_reference, method_name); end - def self.instance_method_visibility_for(klass, method_name); end - def self.method_defined_at_any_visibility?(klass, method_name); end - def self.method_visibility_for(object, method_name); end - def unimplemented?; end - def visibility; end - def with_signature; end -end -class RSpec::Mocks::InstanceMethodReference < RSpec::Mocks::MethodReference - def find_method(mod); end - def method_defined?(mod); end - def method_implemented?(mod); end - def visibility_from(mod); end -end -class RSpec::Mocks::ObjectMethodReference < RSpec::Mocks::MethodReference - def find_method(object); end - def method_defined?(object); end - def method_implemented?(object); end - def self.for(object_reference, method_name); end - def visibility_from(object); end -end -class RSpec::Mocks::ClassNewMethodReference < RSpec::Mocks::ObjectMethodReference - def self.applies_to?(method_name); end - def self.uses_class_new?(klass); end - def with_signature; end -end -class RSpec::Mocks::CallbackInvocationStrategy - def call(doubled_module); end -end -class RSpec::Mocks::NoCallbackInvocationStrategy - def call(_doubled_module); end -end -module RSpec::Mocks::VerifyingProxyMethods - def add_message_expectation(method_name, opts = nil, &block); end - def add_simple_stub(method_name, *args); end - def add_stub(method_name, opts = nil, &implementation); end - def ensure_implemented(method_name); end - def ensure_publicly_implemented(method_name, _object); end -end -class RSpec::Mocks::VerifyingProxy < RSpec::Mocks::TestDoubleProxy - def initialize(object, order_group, doubled_module, method_reference_class); end - def method_reference; end - def validate_arguments!(method_name, args); end - def visibility_for(method_name); end - include RSpec::Mocks::VerifyingProxyMethods -end -class RSpec::Mocks::VerifyingPartialDoubleProxy < RSpec::Mocks::PartialDoubleProxy - def ensure_implemented(_method_name); end - def initialize(object, expectation_ordering, optional_callback_invocation_strategy = nil); end - def method_reference; end - include RSpec::Mocks::VerifyingProxyMethods -end -class RSpec::Mocks::VerifyingPartialClassDoubleProxy < RSpec::Mocks::VerifyingPartialDoubleProxy - include RSpec::Mocks::PartialClassDoubleProxyMethods -end -class RSpec::Mocks::VerifyingMethodDouble < RSpec::Mocks::MethodDouble - def add_expectation(*args, &block); end - def add_stub(*args, &block); end - def initialize(object, method_name, proxy, method_reference); end - def message_expectation_class; end - def proxy_method_invoked(obj, *args, **, &block); end - def validate_arguments!(actual_args); end -end -class RSpec::Mocks::VerifyingExistingMethodDouble < RSpec::Mocks::VerifyingMethodDouble - def initialize(object, method_name, proxy); end - def self.for(object, method_name, proxy); end - def unimplemented?; end - def with_signature; end -end -class RSpec::Mocks::VerifyingExistingClassNewMethodDouble < RSpec::Mocks::VerifyingExistingMethodDouble - def with_signature; end -end -module RSpec::Mocks::VerifyingDouble - def __send__(name, *args, **, &block); end - def initialize(doubled_module, *args); end - def method_missing(message, *args, &block); end - def respond_to?(message, include_private = nil); end - def send(name, *args, **, &block); end -end -class RSpec::Mocks::InstanceVerifyingDouble - def __build_mock_proxy(order_group); end - include RSpec::Mocks::TestDouble - include RSpec::Mocks::VerifyingDouble -end -module RSpec::Mocks::ObjectVerifyingDoubleMethods - def __build_mock_proxy(order_group); end - def as_stubbed_const(options = nil); end - include RSpec::Mocks::TestDouble - include RSpec::Mocks::VerifyingDouble -end -class RSpec::Mocks::ObjectVerifyingDouble - include RSpec::Mocks::ObjectVerifyingDoubleMethods -end -class RSpec::Mocks::ClassVerifyingDouble < Module - include RSpec::Mocks::ObjectVerifyingDoubleMethods -end -module RSpec::Mocks::Version -end -module RSpec::Support - def self.require_rspec_mocks(f); end -end -module RSpec::Mocks::Matchers -end -module RSpec::Mocks::Matchers::Matcher -end -module RSpec::Mocks::AnyInstance - def self.error_generator; end -end -class RSpec::Mocks::AnyInstance::Chain - def constrained_to_any_of?(*constraints); end - def expectation_fulfilled!; end - def initialize(recorder, *args, &block); end - def last_message; end - def matches_args?(*args); end - def messages; end - def negated?; end - def never; end - def playback!(instance); end - def record(rspec_method_name, *args, &block); end - def with(*args, &block); end - include RSpec::Mocks::AnyInstance::Chain::Customizations -end -module RSpec::Mocks::AnyInstance::Chain::Customizations - def and_call_original(*args, &block); end - def and_raise(*args, &block); end - def and_return(*args, &block); end - def and_throw(*args, &block); end - def and_wrap_original(*args, &block); end - def and_yield(*args, &block); end - def at_least(*args, &block); end - def at_most(*args, &block); end - def exactly(*args, &block); end - def never(*args, &block); end - def once(*args, &block); end - def self.record(method_name); end - def thrice(*args, &block); end - def time(*args, &block); end - def times(*args, &block); end - def twice(*args, &block); end - def with(*args, &block); end -end -class RSpec::Mocks::AnyInstance::ErrorGenerator < RSpec::Mocks::ErrorGenerator - def raise_does_not_implement_error(klass, method_name); end - def raise_message_already_received_by_other_instance_error(method_name, object_inspect, invoked_instance); end - def raise_not_supported_with_prepend_error(method_name, problem_mod); end - def raise_second_instance_received_message_error(unfulfilled_expectations); end -end -class RSpec::Mocks::AnyInstance::StubChain < RSpec::Mocks::AnyInstance::Chain - def create_message_expectation_on(instance); end - def expectation_fulfilled?; end - def invocation_order; end - def verify_invocation_order(rspec_method_name, *_args, &_block); end -end -class RSpec::Mocks::AnyInstance::StubChainChain < RSpec::Mocks::AnyInstance::StubChain - def create_message_expectation_on(instance); end - def initialize(*args); end - def invocation_order; end -end -class RSpec::Mocks::AnyInstance::ExpectChainChain < RSpec::Mocks::AnyInstance::StubChain - def create_message_expectation_on(instance); end - def expectation_fulfilled?; end - def initialize(*args); end - def invocation_order; end - def playback!(instance); end -end -class RSpec::Mocks::AnyInstance::ExpectationChain < RSpec::Mocks::AnyInstance::Chain - def expectation_fulfilled?; end - def initialize(*args, &block); end - def verify_invocation_order(_rspec_method_name, *_args, &_block); end -end -class RSpec::Mocks::AnyInstance::PositiveExpectationChain < RSpec::Mocks::AnyInstance::ExpectationChain - def create_message_expectation_on(instance); end - def invocation_order; end -end -class RSpec::Mocks::AnyInstance::MessageChains - def [](method_name); end - def add(method_name, chain); end - def all_expectations_fulfilled?; end - def each_unfulfilled_expectation_matching(method_name, *args); end - def has_expectation?(method_name); end - def initialize; end - def playback!(instance, method_name); end - def raise_if_second_instance_to_receive_message(instance); end - def received_expected_message!(method_name); end - def remove_stub_chains_for!(method_name); end - def unfulfilled_expectations; end -end -class RSpec::Mocks::AnyInstance::Recorder - def allow_no_prepended_module_definition_of(method_name); end - def already_observing?(method_name); end - def ancestor_is_an_observer?(ancestor, method_name); end - def backup_method!(method_name); end - def build_alias_method_name(method_name); end - def expect_chain(*method_names_and_optional_return_values, &block); end - def initialize(klass); end - def instance_that_received(method_name); end - def klass; end - def mark_invoked!(method_name); end - def message_chains; end - def normalize_chain(*args); end - def notify_received_message(_object, message, args, _blk); end - def observe!(method_name); end - def playback!(instance, method_name); end - def public_protected_or_private_method_defined?(method_name); end - def received_expected_message!(method_name); end - def remove_dummy_method!(method_name); end - def restore_method!(method_name); end - def restore_original_method!(method_name); end - def should_not_receive(method_name, &block); end - def should_receive(method_name, &block); end - def stop_all_observation!; end - def stop_observing!(method_name); end - def stub(method_name, &block); end - def stub_chain(*method_names_and_optional_return_values, &block); end - def stubs; end - def super_class_observers_for(method_name); end - def super_class_observing?(method_name); end - def unstub(method_name); end - def verify; end -end -class RSpec::Mocks::AnyInstance::Proxy - def expect_chain(*chain, &block); end - def initialize(recorder, target_proxies); end - def klass; end - def perform_proxying(method_name, args, block, &target_proxy_block); end - def should_not_receive(method_name, &block); end - def should_receive(method_name, &block); end - def stub(method_name_or_method_map, &block); end - def stub_chain(*chain, &block); end - def unstub(method_name); end -end -class RSpec::Mocks::AnyInstance::FluentInterfaceProxy < BasicObject - def initialize(targets); end - def method_missing(*args, &block); end - def respond_to_missing?(method_name, include_private = nil); end -end -class RSpec::Mocks::MessageChain - def block; end - def chain; end - def chain_on(object, *chain, &block); end - def find_matching_expectation; end - def find_matching_stub; end - def format_chain(*chain, &blk); end - def initialize(object, *chain, &blk); end - def object; end - def setup_chain; end -end -class RSpec::Mocks::ExpectChain < RSpec::Mocks::MessageChain - def expectation(object, message, &return_block); end - def self.expect_chain_on(object, *chain, &blk); end -end -class RSpec::Mocks::StubChain < RSpec::Mocks::MessageChain - def expectation(object, message, &return_block); end - def self.stub_chain_on(object, *chain, &blk); end -end -class RSpec::Mocks::MarshalExtension - def self.patch!; end - def self.unpatch!; end -end -class RSpec::Mocks::Matchers::HaveReceived - def apply_constraints_to(expectation); end - def at_least(*args); end - def at_most(*args); end - def capture_failure_message; end - def count_constraint; end - def description; end - def disallow(type, reason = nil); end - def does_not_match?(subject); end - def ensure_count_unconstrained; end - def exactly(*args); end - def expect; end - def expected_messages_received_in_order?; end - def failure_message; end - def failure_message_when_negated; end - def initialize(method_name, &block); end - def matcher_name; end - def matches?(subject, &block); end - def mock_proxy; end - def notify_failure_message; end - def once(*args); end - def ordered(*args); end - def setup_allowance(_subject, &_block); end - def setup_any_instance_allowance(_subject, &_block); end - def setup_any_instance_expectation(_subject, &_block); end - def setup_any_instance_negative_expectation(_subject, &_block); end - def setup_expectation(subject, &block); end - def setup_negative_expectation(subject, &block); end - def thrice(*args); end - def time(*args); end - def times(*args); end - def twice(*args); end - def with(*args); end - include RSpec::Mocks::Matchers::Matcher -end -class RSpec::Mocks::Matchers::ExpectationCustomization - def block; end - def block=(arg0); end - def initialize(method_name, args, block); end - def playback_onto(expectation); end -end -class RSpec::Mocks::Matchers::Receive - def and_call_original(*args, **, &block); end - def and_invoke(*args, **, &block); end - def and_raise(*args, **, &block); end - def and_return(*args, **, &block); end - def and_throw(*args, **, &block); end - def and_wrap_original(*args, **, &block); end - def and_yield(*args, **, &block); end - def at_least(*args, **, &block); end - def at_most(*args, **, &block); end - def describable; end - def description; end - def does_not_match?(subject, &block); end - def exactly(*args, **, &block); end - def initialize(message, block); end - def inspect(*args, **, &block); end - def matcher_name; end - def matches?(subject, &block); end - def move_block_to_last_customization(block); end - def never(*args, **, &block); end - def once(*args, **, &block); end - def ordered(*args, **, &block); end - def setup_allowance(subject, &block); end - def setup_any_instance_allowance(subject, &block); end - def setup_any_instance_expectation(subject, &block); end - def setup_any_instance_method_substitute(subject, method, block); end - def setup_any_instance_negative_expectation(subject, &block); end - def setup_expectation(subject, &block); end - def setup_method_substitute(host, method, block, *args); end - def setup_mock_proxy_method_substitute(subject, method, block); end - def setup_negative_expectation(subject, &block); end - def thrice(*args, **, &block); end - def time(*args, **, &block); end - def times(*args, **, &block); end - def to_s(*args, **, &block); end - def twice(*args, **, &block); end - def warn_if_any_instance(expression, subject); end - def with(*args, **, &block); end - include RSpec::Mocks::Matchers::Matcher -end -class RSpec::Mocks::Matchers::Receive::DefaultDescribable - def description_for(verb); end - def initialize(message); end -end -class RSpec::Mocks::Matchers::ReceiveMessageChain - def and_call_original(*args, &block); end - def and_invoke(*args, &block); end - def and_raise(*args, &block); end - def and_return(*args, &block); end - def and_throw(*args, &block); end - def and_yield(*args, &block); end - def description; end - def does_not_match?(*_args); end - def formatted_chain; end - def initialize(chain, &block); end - def matcher_name; end - def matches?(subject, &block); end - def replay_customizations(chain); end - def setup_allowance(subject, &block); end - def setup_any_instance_allowance(subject, &block); end - def setup_any_instance_expectation(subject, &block); end - def setup_expectation(subject, &block); end - def setup_negative_expectation(*_args); end - def with(*args, &block); end - include RSpec::Mocks::Matchers::Matcher -end -class RSpec::Mocks::Matchers::ReceiveMessages - def any_instance_of(subject); end - def description; end - def does_not_match?(_subject); end - def each_message_on(host); end - def initialize(message_return_value_hash); end - def matcher_name; end - def matches?(subject); end - def proxy_on(subject); end - def setup_allowance(subject); end - def setup_any_instance_allowance(subject); end - def setup_any_instance_expectation(subject); end - def setup_expectation(subject); end - def setup_negative_expectation(_subject); end - def warn_about_block; end - include RSpec::Mocks::Matchers::Matcher -end diff --git a/sorbet/rbi/gems/rspec-mocks@3.13.1.rbi b/sorbet/rbi/gems/rspec-mocks@3.13.1.rbi index 5147e7f..af2d69e 100644 --- a/sorbet/rbi/gems/rspec-mocks@3.13.1.rbi +++ b/sorbet/rbi/gems/rspec-mocks@3.13.1.rbi @@ -1,4 +1,4 @@ -# typed: false +# typed: true # DO NOT EDIT MANUALLY # This is an autogenerated file for types exported from the `rspec-mocks` gem. diff --git a/sorbet/rbi/gems/rspec-sorbet@1.9.2.rbi b/sorbet/rbi/gems/rspec-sorbet@1.9.2.rbi index 812fa80..d06c333 100644 --- a/sorbet/rbi/gems/rspec-sorbet@1.9.2.rbi +++ b/sorbet/rbi/gems/rspec-sorbet@1.9.2.rbi @@ -91,7 +91,7 @@ module RSpec::Sorbet::Doubles # @return [void] # - # source://sorbet-runtime/0.5.11609/lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11670/lib/types/private/methods/_methods.rb#257 def allow_instance_doubles!(*args, **_arg1, &blk); end # source://rspec-sorbet//lib/rspec/sorbet/doubles.rb#36 diff --git a/sorbet/rbi/gems/rspec-support.rbi b/sorbet/rbi/gems/rspec-support.rbi deleted file mode 100644 index fb53c50..0000000 --- a/sorbet/rbi/gems/rspec-support.rbi +++ /dev/null @@ -1,288 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: true -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/rspec-support/all/rspec-support.rbi -# -# rspec-support-3.13.1 - -module RSpec - extend RSpec::Support::Warnings -end -module RSpec::Support - def self.class_of(object); end - def self.define_optimized_require_for_rspec(lib, &require_relative); end - def self.deregister_matcher_definition(&block); end - def self.failure_notifier; end - def self.failure_notifier=(callable); end - def self.is_a_matcher?(object); end - def self.matcher_definitions; end - def self.method_handle_for(object, method_name); end - def self.notify_failure(failure, options = nil); end - def self.register_matcher_definition(&block); end - def self.require_rspec_support(f); end - def self.rspec_description_for_object(object); end - def self.thread_local_data; end - def self.warning_notifier; end - def self.warning_notifier=(arg0); end - def self.with_failure_notifier(callable); end -end -module RSpec::Support::Version -end -class RSpec::Support::ComparableVersion - def <=>(other); end - def initialize(string); end - def segments; end - def string; end - include Comparable -end -module RSpec::Support::OS - def self.windows?; end - def self.windows_file_path?; end - def windows?; end - def windows_file_path?; end -end -module RSpec::Support::Ruby - def jruby?; end - def jruby_9000?; end - def jruby_version; end - def mri?; end - def non_mri?; end - def rbx?; end - def self.jruby?; end - def self.jruby_9000?; end - def self.jruby_version; end - def self.mri?; end - def self.non_mri?; end - def self.rbx?; end - def self.truffleruby?; end - def truffleruby?; end -end -module RSpec::Support::RubyFeatures - def caller_locations_supported?; end - def distincts_kw_args_from_positional_hash?; end - def fork_supported?; end - def kw_arg_separation?; end - def kw_args_supported?; end - def module_prepends_supported?; end - def module_refinement_supported?; end - def optional_and_splat_args_supported?; end - def required_kw_args_supported?; end - def ripper_supported?; end - def self.caller_locations_supported?; end - def self.distincts_kw_args_from_positional_hash?; end - def self.fork_supported?; end - def self.kw_arg_separation?; end - def self.kw_args_supported?; end - def self.module_prepends_supported?; end - def self.module_refinement_supported?; end - def self.optional_and_splat_args_supported?; end - def self.required_kw_args_supported?; end - def self.ripper_supported?; end - def self.supports_exception_cause?; end - def self.supports_rebinding_module_methods?; end - def self.supports_syntax_suggest?; end - def self.supports_taint?; end - def supports_exception_cause?; end - def supports_rebinding_module_methods?; end - def supports_syntax_suggest?; end - def supports_taint?; end -end -module RSpec::Support::AllExceptionsExceptOnesWeMustNotRescue - def self.===(exception); end -end -class RSpec::CallerFilter - def self.first_non_rspec_line(skip_frames = nil, increment = nil); end -end -module RSpec::Support::Warnings - def deprecate(deprecated, options = nil); end - def warn_deprecation(message, options = nil); end - def warn_with(message, options = nil); end - def warning(text, options = nil); end -end -class RSpec::Support::EncodedString - def <<(string); end - def ==(*args, &block); end - def detect_source_encoding(string); end - def empty?(*args, &block); end - def encoding(*args, &block); end - def eql?(*args, &block); end - def initialize(string, encoding = nil); end - def lines(*args, &block); end - def matching_encoding(string); end - def remove_invalid_bytes(string); end - def self.pick_encoding(source_a, source_b); end - def source_encoding; end - def split(regex_or_string); end - def to_s; end - def to_str; end -end -class RSpec::Support::ReentrantMutex - def enter; end - def exit; end - def initialize; end - def synchronize; end -end -class RSpec::Support::Mutex < Thread::Mutex - def self.new; end -end -class RSpec::Support::DirectoryMaker - def self.directory_exists?(dirname); end - def self.generate_path(stack, part); end - def self.generate_stack(path); end - def self.mkdir_p(path); end -end -class RSpec::Support::MethodSignature - def arbitrary_kw_args?; end - def classify_arity(arity = nil); end - def classify_parameters; end - def could_contain_kw_args?(args); end - def description; end - def has_kw_args_in?(args); end - def initialize(method); end - def invalid_kw_args_from(given_kw_args); end - def max_non_kw_args; end - def min_non_kw_args; end - def missing_kw_args_from(given_kw_args); end - def non_kw_args_arity_description; end - def optional_kw_args; end - def required_kw_args; end - def unlimited_args?; end - def valid_non_kw_args?(positional_arg_count, optional_max_arg_count = nil); end -end -class RSpec::Support::MethodSignatureExpectation - def empty?; end - def expect_arbitrary_keywords; end - def expect_arbitrary_keywords=(arg0); end - def expect_unlimited_arguments; end - def expect_unlimited_arguments=(arg0); end - def initialize; end - def keywords; end - def keywords=(values); end - def max_count; end - def max_count=(number); end - def min_count; end - def min_count=(number); end -end -class RSpec::Support::BlockSignature < RSpec::Support::MethodSignature - def classify_parameters; end -end -class RSpec::Support::MethodSignatureVerifier - def arbitrary_kw_args?; end - def error_message; end - def initialize(signature, args = nil); end - def invalid_kw_args; end - def kw_args; end - def max_non_kw_args; end - def min_non_kw_args; end - def missing_kw_args; end - def non_kw_args; end - def split_args(*args); end - def unlimited_args?; end - def valid?; end - def valid_non_kw_args?; end - def with_expectation(expectation); end -end -class RSpec::Support::LooseSignatureVerifier < RSpec::Support::MethodSignatureVerifier - def split_args(*args); end -end -class RSpec::Support::LooseSignatureVerifier::SignatureWithKeywordArgumentsMatcher - def has_kw_args_in?(args); end - def initialize(signature); end - def invalid_kw_args_from(_kw_args); end - def missing_kw_args_from(_kw_args); end - def non_kw_args_arity_description; end - def valid_non_kw_args?(*args); end -end -module RSpec::Support::WithKeywordsWhenNeeded - def class_exec(klass, *args, **, &block); end - def self.class_exec(klass, *args, **, &block); end -end -module RSpec::Support::RecursiveConstMethods - def const_defined_on?(mod, const_name); end - def constants_defined_on(mod); end - def get_const_defined_on(mod, const_name); end - def normalize_const_name(const_name); end - def recursive_const_defined?(const_name); end - def recursive_const_get(const_name); end -end -class RSpec::Support::ObjectFormatter - def format(object); end - def initialize(max_formatted_output_length = nil); end - def max_formatted_output_length; end - def max_formatted_output_length=(arg0); end - def prepare_array(array); end - def prepare_element(element); end - def prepare_for_inspection(object); end - def prepare_hash(input_hash); end - def recursive_structure?(object); end - def self.default_instance; end - def self.format(object); end - def self.prepare_for_inspection(object); end - def sort_hash_keys(input_hash); end - def truncate_string(str, start_index, end_index); end - def with_entering_structure(structure); end -end -class RSpec::Support::ObjectFormatter::InspectableItem < Struct - def inspect; end - def pretty_print(pp); end - def self.[](*arg0); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end - def text; end - def text=(_); end -end -class RSpec::Support::ObjectFormatter::BaseInspector < Struct - def formatter; end - def formatter=(_); end - def inspect; end - def object; end - def object=(_); end - def pretty_print(pp); end - def self.[](*arg0); end - def self.can_inspect?(_object); end - def self.inspect; end - def self.keyword_init?; end - def self.members; end - def self.new(*arg0); end -end -class RSpec::Support::ObjectFormatter::TimeInspector < RSpec::Support::ObjectFormatter::BaseInspector - def inspect; end - def self.can_inspect?(object); end -end -class RSpec::Support::ObjectFormatter::DateTimeInspector < RSpec::Support::ObjectFormatter::BaseInspector - def inspect; end - def self.can_inspect?(object); end -end -class RSpec::Support::ObjectFormatter::BigDecimalInspector < RSpec::Support::ObjectFormatter::BaseInspector - def inspect; end - def self.can_inspect?(object); end -end -class RSpec::Support::ObjectFormatter::DescribableMatcherInspector < RSpec::Support::ObjectFormatter::BaseInspector - def inspect; end - def self.can_inspect?(object); end -end -class RSpec::Support::ObjectFormatter::UninspectableObjectInspector < RSpec::Support::ObjectFormatter::BaseInspector - def inspect; end - def klass; end - def native_object_id; end - def self.can_inspect?(object); end -end -class RSpec::Support::ObjectFormatter::DelegatorInspector < RSpec::Support::ObjectFormatter::BaseInspector - def inspect; end - def self.can_inspect?(object); end -end -class RSpec::Support::ObjectFormatter::InspectableObjectInspector < RSpec::Support::ObjectFormatter::BaseInspector - def inspect; end - def self.can_inspect?(object); end -end -module RSpec::Support::FuzzyMatcher - def self.arrays_match?(expected_list, actual_list); end - def self.hashes_match?(expected_hash, actual_hash); end - def self.values_match?(expected, actual); end -end diff --git a/sorbet/rbi/gems/rspec-support@3.13.1.rbi b/sorbet/rbi/gems/rspec-support@3.13.1.rbi index f8358bc..52dcf0d 100644 --- a/sorbet/rbi/gems/rspec-support@3.13.1.rbi +++ b/sorbet/rbi/gems/rspec-support@3.13.1.rbi @@ -188,6 +188,12 @@ module RSpec::Support # source://rspec-support//lib/rspec/support.rb#25 def require_rspec_core(f); end + # source://rspec-support//lib/rspec/support.rb#25 + def require_rspec_expectations(f); end + + # source://rspec-support//lib/rspec/support.rb#25 + def require_rspec_matchers(f); end + # source://rspec-support//lib/rspec/support.rb#25 def require_rspec_support(f); end @@ -537,6 +543,35 @@ RSpec::Support::EncodedString::US_ASCII = T.let(T.unsafe(nil), String) # source://rspec-support//lib/rspec/support/encoded_string.rb#8 RSpec::Support::EncodedString::UTF_8 = T.let(T.unsafe(nil), String) +# Provides a means to fuzzy-match between two arbitrary objects. +# Understands array/hash nesting. Uses `===` or `==` to +# perform the matching. +# +# source://rspec-support//lib/rspec/support/fuzzy_matcher.rb#8 +module RSpec::Support::FuzzyMatcher + class << self + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/fuzzy_matcher.rb#10 + def values_match?(expected, actual); end + + private + + # @private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/fuzzy_matcher.rb#29 + def arrays_match?(expected_list, actual_list); end + + # @private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/fuzzy_matcher.rb#38 + def hashes_match?(expected_hash, actual_hash); end + end +end + # @private # # source://rspec-support//lib/rspec/support/hunk_generator.rb#9 diff --git a/sorbet/rbi/gems/rspec.rbi b/sorbet/rbi/gems/rspec.rbi deleted file mode 100644 index f9a6d2c..0000000 --- a/sorbet/rbi/gems/rspec.rbi +++ /dev/null @@ -1,15 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: strict -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/rspec/all/rspec.rbi -# -# rspec-3.13.0 - -module RSpec -end -module RSpec::Version -end diff --git a/sorbet/rbi/gems/safe_type.rbi b/sorbet/rbi/gems/safe_type.rbi deleted file mode 100644 index c550626..0000000 --- a/sorbet/rbi/gems/safe_type.rbi +++ /dev/null @@ -1,112 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: strict -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/safe_type/all/safe_type.rbi -# -# safe_type-1.1.1 - -module SafeType - def self.coerce!(input, rule); end - def self.coerce(input, rule, coerce_key = nil); end -end -class SafeType::Converter - def self.to_bool(input); end - def self.to_date(input); end - def self.to_date_time(input); end - def self.to_false(input); end - def self.to_float(input); end - def self.to_int(input); end - def self.to_time(input); end - def self.to_true(input); end - def self.to_type(input, type); end -end -class SafeType::CoercionError < StandardError - def desired_type; end - def initialize(value, desired_type, key = nil); end - def key; end - def value; end -end -class SafeType::ValidationError < StandardError - def desired_type; end - def initialize(value, desired_type, key = nil); end - def key; end - def value; end -end -class SafeType::EmptyValueError < StandardError - def desired_type; end - def initialize(desired_type, key = nil); end - def key; end -end -class SafeType::InvalidRuleError < ArgumentError - def initialize; end -end -class SafeType::Rule - def after(input); end - def before(input); end - def coerce(input, key = nil); end - def initialize(type:, default: nil, required: nil, **args); end - def is_valid?(input); end - def self.coerce(input); end - def self.default; end - def self.strict; end -end -module SafeType::BooleanMixin -end -class TrueClass - include SafeType::BooleanMixin -end -class FalseClass - include SafeType::BooleanMixin -end -class SafeType::Boolean < SafeType::Rule - def initialize(type: nil, **args); end - def self.default(value = nil); end -end -class SafeType::Date < SafeType::Rule - def initialize(type: nil, from: nil, to: nil, **args); end - def is_valid?(input); end - def self.default(value = nil, from: nil, to: nil); end - def self.strict(from: nil, to: nil); end -end -class SafeType::DateTime < SafeType::Rule - def initialize(type: nil, from: nil, to: nil, **args); end - def is_valid?(input); end - def self.default(value = nil, from: nil, to: nil); end - def self.strict(from: nil, to: nil); end -end -class SafeType::Float < SafeType::Rule - def initialize(type: nil, min: nil, max: nil, **args); end - def is_valid?(input); end - def self.default(value = nil, min: nil, max: nil); end - def self.strict(min: nil, max: nil); end -end -class SafeType::Integer < SafeType::Rule - def initialize(type: nil, min: nil, max: nil, **args); end - def is_valid?(input); end - def self.default(value = nil, min: nil, max: nil); end - def self.strict(min: nil, max: nil); end -end -class SafeType::String < SafeType::Rule - def after(input); end - def initialize(type: nil, min_length: nil, max_length: nil, **args); end - def is_valid?(input); end - def self.default(value = nil, min_length: nil, max_length: nil); end - def self.strict(min_length: nil, max_length: nil); end -end -class SafeType::Symbol < SafeType::Rule - def after(input); end - def initialize(type: nil, min_length: nil, max_length: nil, **args); end - def is_valid?(input); end - def self.default(value = nil, min_length: nil, max_length: nil); end - def self.strict(min_length: nil, max_length: nil); end -end -class SafeType::Time < SafeType::Rule - def initialize(type: nil, from: nil, to: nil, **args); end - def is_valid?(input); end - def self.default(value = nil, from: nil, to: nil); end - def self.strict(from: nil, to: nil); end -end diff --git a/sorbet/rbi/gems/sorbet-coerce.rbi b/sorbet/rbi/gems/sorbet-coerce.rbi deleted file mode 100644 index 18c6385..0000000 --- a/sorbet/rbi/gems/sorbet-coerce.rbi +++ /dev/null @@ -1,37 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: false -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/sorbet-coerce/all/sorbet-coerce.rbi -# -# sorbet-coerce-0.7.0 - -module TypeCoerce - def self.[](type); end -end -module TypeCoerce::Configuration - def self.raise_coercion_error(*args, **, &blk); end - def self.raise_coercion_error=(arg0); end -end -module Polyfill::Module::MezpIYXNoPT5bIiNzbGljZSJdfQ__ -end -class TypeCoerce::CoercionError < SafeType::CoercionError -end -class TypeCoerce::ShapeError < SafeType::CoercionError -end -class TypeCoerce::Converter - def _build_args(args, type, raise_coercion_error, coerce_empty_to_nil); end - def _convert(value, type, raise_coercion_error, coerce_empty_to_nil); end - def _convert_enum(value, type, raise_coercion_error, coerce_empty_to_nil); end - def _convert_simple(value, type, raise_coercion_error, coerce_empty_to_nil); end - def _convert_to_a(ary, type, raise_coercion_error, coerce_empty_to_nil); end - def _nil_like?(value, type, coerce_empty_to_nil); end - def coerce_nil(value, type, coerce_empty_to_nil); end - def from(args, raise_coercion_error: nil, coerce_empty_to_nil: nil); end - def initialize(type); end - def new; end - def to_s; end -end diff --git a/sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi b/sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi index a4267f7..1c7d5fd 100644 --- a/sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi +++ b/sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi @@ -1,4 +1,4 @@ -# typed: false +# typed: true # DO NOT EDIT MANUALLY # This is an autogenerated file for types exported from the `sorbet-coerce` gem. diff --git a/sorbet/rbi/gems/spoom@1.4.2.rbi b/sorbet/rbi/gems/spoom@1.4.2.rbi index 09f416b..84b7876 100644 --- a/sorbet/rbi/gems/spoom@1.4.2.rbi +++ b/sorbet/rbi/gems/spoom@1.4.2.rbi @@ -1004,7 +1004,7 @@ class Spoom::Coverage::D3::ColorPalette < ::T::Struct prop :strong, ::String class << self - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -1344,7 +1344,7 @@ class Spoom::Coverage::Snapshot < ::T::Struct sig { params(obj: T::Hash[::String, T.untyped]).returns(::Spoom::Coverage::Snapshot) } def from_obj(obj); end - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -1480,7 +1480,7 @@ class Spoom::Deadcode::Definition < ::T::Struct def to_json(*args); end class << self - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2368,7 +2368,7 @@ class Spoom::Deadcode::Send < ::T::Struct def each_arg_assoc(&block); end class << self - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2388,7 +2388,7 @@ class Spoom::ExecResult < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2586,7 +2586,7 @@ class Spoom::FileTree::Node < ::T::Struct def path; end class << self - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2652,7 +2652,7 @@ class Spoom::Git::Commit < ::T::Struct def timestamp; end class << self - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end # Parse a line formatted as `%h %at` into a `Commit` @@ -2764,7 +2764,7 @@ class Spoom::LSP::Diagnostic < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Diagnostic) } def from_json(json); end - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2797,7 +2797,7 @@ class Spoom::LSP::DocumentSymbol < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::DocumentSymbol) } def from_json(json); end - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2855,7 +2855,7 @@ class Spoom::LSP::Hover < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Hover) } def from_json(json); end - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2880,7 +2880,7 @@ class Spoom::LSP::Location < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Location) } def from_json(json); end - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2943,7 +2943,7 @@ class Spoom::LSP::Position < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Position) } def from_json(json); end - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2981,7 +2981,7 @@ class Spoom::LSP::Range < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Range) } def from_json(json); end - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -3047,7 +3047,7 @@ class Spoom::LSP::SignatureHelp < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::SignatureHelp) } def from_json(json); end - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -3473,7 +3473,7 @@ class Spoom::Model::Reference < ::T::Struct sig { params(name: ::String, location: ::Spoom::Location).returns(::Spoom::Model::Reference) } def constant(name, location); end - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end # source://spoom//lib/spoom/model/reference.rb#29 diff --git a/sorbet/rbi/gems/tapioca@0.15.1.rbi b/sorbet/rbi/gems/tapioca@0.15.1.rbi index 3c9d288..f7eccaf 100644 --- a/sorbet/rbi/gems/tapioca@0.15.1.rbi +++ b/sorbet/rbi/gems/tapioca@0.15.1.rbi @@ -232,7 +232,7 @@ class RBI::TypedParam < ::T::Struct const :type, ::String class << self - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -1155,7 +1155,7 @@ class Tapioca::ConfigHelper::ConfigError < ::T::Struct const :message_parts, T::Array[::Tapioca::ConfigHelper::ConfigErrorMessagePart] class << self - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -1166,7 +1166,7 @@ class Tapioca::ConfigHelper::ConfigErrorMessagePart < ::T::Struct const :colors, T::Array[::Symbol] class << self - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2207,7 +2207,7 @@ class Tapioca::GemInfo < ::T::Struct sig { params(spec: ::Bundler::LazySpecification).returns(::Tapioca::GemInfo) } def from_spec(spec); end - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end @@ -2499,7 +2499,7 @@ class Tapioca::Loaders::Loader # @param engine [T.class_of(Rails::Engine)] # @return [Array] # - # source://sorbet-runtime/0.5.11531/lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11670/lib/types/private/methods/_methods.rb#257 def eager_load_paths(*args, **_arg1, &blk); end # source://tapioca//lib/tapioca/loaders/loader.rb#188 @@ -3407,7 +3407,7 @@ module Tapioca::Static::SymbolLoader # @return [Array] # - # source://sorbet-runtime/0.5.11531/lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11670/lib/types/private/methods/_methods.rb#257 def engines(*args, **_arg1, &blk); end # source://tapioca//lib/tapioca/static/symbol_loader.rb#82 diff --git a/sorbet/rbi/gems/tzinfo.rbi b/sorbet/rbi/gems/tzinfo.rbi deleted file mode 100644 index 259329f..0000000 --- a/sorbet/rbi/gems/tzinfo.rbi +++ /dev/null @@ -1,591 +0,0 @@ -# This file is autogenerated. Do not edit it by hand. Regenerate it with: -# srb rbi gems - -# typed: strict -# -# If you would like to make changes to this file, great! Please create the gem's shim here: -# -# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/tzinfo/all/tzinfo.rbi -# -# tzinfo-2.0.6 - -module TZInfo - def self.eager_load!; end -end -module TZInfo::RubyCoreSupport - def self.untaint(o); end -end -class TZInfo::StringDeduper - def create_hash(&block); end - def dedupe(string); end - def initialize; end - def self.global; end -end -class TZInfo::ConcurrentStringDeduper < TZInfo::StringDeduper - def create_hash(&block); end -end -class TZInfo::UnaryMinusGlobalStringDeduper - def dedupe(string); end -end -class TZInfo::Timestamp - def <=>(t); end - def add_and_set_utc_offset(seconds, utc_offset); end - def eql?(arg0); end - def hash; end - def initialize!(value, sub_second = nil, utc_offset = nil); end - def initialize(value, sub_second = nil, utc_offset = nil); end - def inspect; end - def new_datetime(klass = nil); end - def new_time(klass = nil); end - def self.create(year, month = nil, day = nil, hour = nil, minute = nil, second = nil, sub_second = nil, utc_offset = nil); end - def self.for(value, offset = nil); end - def self.for_datetime(datetime, ignore_offset, target_utc_offset); end - def self.for_time(time, ignore_offset, target_utc_offset); end - def self.for_time_like(time_like, ignore_offset, target_utc_offset); end - def self.for_timestamp(timestamp, ignore_offset, target_utc_offset); end - def self.is_time_like?(value); end - def self.new!(value, sub_second = nil, utc_offset = nil); end - def self.utc(value, sub_second = nil); end - def strftime(format); end - def sub_second; end - def sub_second_to_s; end - def to_datetime; end - def to_i; end - def to_s; end - def to_time; end - def utc; end - def utc?; end - def utc_offset; end - def value; end - def value_and_sub_second_to_s(offset = nil); end - include Comparable -end -module TZInfo::WithOffset - def if_timezone_offset(result = nil); end - def strftime(format); end -end -class TZInfo::DateTimeWithOffset < DateTime - def clear_timezone_offset; end - def downto(min); end - def england; end - def gregorian; end - def italy; end - def julian; end - def new_start(start = nil); end - def set_timezone_offset(timezone_offset); end - def step(limit, step = nil); end - def timezone_offset; end - def to_time; end - def upto(max); end - include TZInfo::WithOffset -end -class TZInfo::TimeWithOffset < Time - def clear_timezone_offset; end - def dst?; end - def getlocal(*args); end - def gmtime; end - def isdst; end - def localtime(*args); end - def round(ndigits = nil); end - def set_timezone_offset(timezone_offset); end - def timezone_offset; end - def to_a; end - def to_datetime; end - def utc; end - def zone; end - include TZInfo::WithOffset -end -class TZInfo::TimestampWithOffset < TZInfo::Timestamp - def self.set_timezone_offset(timestamp, timezone_offset); end - def set_timezone_offset(timezone_offset); end - def timezone_offset; end - def to_datetime; end - def to_time; end - include TZInfo::WithOffset -end -class TZInfo::TimezoneOffset - def ==(toi); end - def abbr; end - def abbreviation; end - def base_utc_offset; end - def dst?; end - def eql?(toi); end - def hash; end - def initialize(base_utc_offset, std_offset, abbreviation); end - def inspect; end - def observed_utc_offset; end - def std_offset; end - def utc_offset; end - def utc_total_offset; end -end -class TZInfo::TimezoneTransition - def ==(tti); end - def at; end - def eql?(tti); end - def hash; end - def initialize(offset, previous_offset, timestamp_value); end - def local_end_at; end - def local_start_at; end - def offset; end - def previous_offset; end - def timestamp_value; end -end -class TZInfo::TransitionRule - def ==(r); end - def at(offset, year); end - def eql?(r); end - def hash; end - def hash_args; end - def initialize(transition_at); end - def transition_at; end -end -class TZInfo::DayOfYearTransitionRule < TZInfo::TransitionRule - def ==(r); end - def eql?(r); end - def hash_args; end - def initialize(day, transition_at); end - def seconds; end -end -class TZInfo::AbsoluteDayOfYearTransitionRule < TZInfo::DayOfYearTransitionRule - def ==(r); end - def eql?(r); end - def get_day(offset, year); end - def hash_args; end - def initialize(day, transition_at = nil); end - def is_always_first_day_of_year?; end - def is_always_last_day_of_year?; end -end -class TZInfo::JulianDayOfYearTransitionRule < TZInfo::DayOfYearTransitionRule - def ==(r); end - def eql?(r); end - def get_day(offset, year); end - def hash_args; end - def initialize(day, transition_at = nil); end - def is_always_first_day_of_year?; end - def is_always_last_day_of_year?; end -end -class TZInfo::DayOfWeekTransitionRule < TZInfo::TransitionRule - def ==(r); end - def day_of_week; end - def eql?(r); end - def hash_args; end - def initialize(month, day_of_week, transition_at); end - def is_always_first_day_of_year?; end - def is_always_last_day_of_year?; end - def month; end -end -class TZInfo::DayOfMonthTransitionRule < TZInfo::DayOfWeekTransitionRule - def ==(r); end - def eql?(r); end - def get_day(offset, year); end - def hash_args; end - def initialize(month, week, day_of_week, transition_at = nil); end - def offset_start; end -end -class TZInfo::LastDayOfMonthTransitionRule < TZInfo::DayOfWeekTransitionRule - def ==(r); end - def eql?(r); end - def get_day(offset, year); end - def initialize(month, day_of_week, transition_at = nil); end -end -class TZInfo::AnnualRules - def apply_rule(rule, from_offset, to_offset, year); end - def dst_end_rule; end - def dst_offset; end - def dst_start_rule; end - def initialize(std_offset, dst_offset, dst_start_rule, dst_end_rule); end - def std_offset; end - def transitions(year); end -end -module TZInfo::DataSources -end -class TZInfo::DataSources::TimezoneInfo - def create_timezone; end - def identifier; end - def initialize(identifier); end - def inspect; end - def raise_not_implemented(method_name); end -end -class TZInfo::DataSources::DataTimezoneInfo < TZInfo::DataSources::TimezoneInfo - def create_timezone; end - def period_for(timestamp); end - def periods_for_local(local_timestamp); end - def raise_not_implemented(method_name); end - def transitions_up_to(to_timestamp, from_timestamp = nil); end -end -class TZInfo::DataSources::LinkedTimezoneInfo < TZInfo::DataSources::TimezoneInfo - def create_timezone; end - def initialize(identifier, link_to_identifier); end - def link_to_identifier; end -end -class TZInfo::DataSources::ConstantOffsetDataTimezoneInfo < TZInfo::DataSources::DataTimezoneInfo - def constant_offset; end - def constant_period; end - def initialize(identifier, constant_offset); end - def period_for(timestamp); end - def periods_for_local(local_timestamp); end - def transitions_up_to(to_timestamp, from_timestamp = nil); end -end -class TZInfo::DataSources::TransitionsDataTimezoneInfo < TZInfo::DataSources::DataTimezoneInfo - def find_minimum_transition(&block); end - def initialize(identifier, transitions); end - def period_for(timestamp); end - def periods_for_local(local_timestamp); end - def transition_on_or_after_timestamp?(transition, timestamp); end - def transitions; end - def transitions_up_to(to_timestamp, from_timestamp = nil); end -end -class TZInfo::DataSources::CountryInfo - def code; end - def initialize(code, name, zones); end - def inspect; end - def name; end - def zones; end -end -class TZInfo::DataSources::InvalidPosixTimeZone < StandardError -end -class TZInfo::DataSources::PosixTimeZoneParser - def check_scan(s, pattern); end - def get_offset_from_hms(h, m, s); end - def get_seconds_after_midnight_from_hms(h, m, s); end - def initialize(string_deduper); end - def parse(tz_string); end - def parse_rule(s, type); end -end -class TZInfo::DataSources::InvalidZoneinfoFile < StandardError -end -class TZInfo::DataSources::ZoneinfoReader - def apply_rules_with_transitions(file, transitions, offsets, rules); end - def apply_rules_without_transitions(file, first_offset, rules); end - def check_read(file, bytes); end - def derive_offsets(transitions, offsets); end - def find_existing_offset(offsets, offset); end - def initialize(posix_tz_parser, string_deduper); end - def make_signed_int32(long); end - def make_signed_int64(high, low); end - def offset_matches_rule?(offset, rule_offset); end - def parse(file); end - def read(file_path); end - def replace_with_existing_offsets(offsets, annual_rules); end - def validate_and_fix_last_defined_transition_offset(file, last_defined, first_rule_offset); end -end -class TZInfo::InvalidDataSource < StandardError -end -class TZInfo::DataSourceNotFound < StandardError -end -class TZInfo::DataSource - def build_timezone_identifiers; end - def country_codes; end - def data_timezone_identifiers; end - def eager_load!; end - def find_timezone_identifier(identifier); end - def get_country_info(code); end - def get_timezone_info(identifier); end - def initialize; end - def inspect; end - def linked_timezone_identifiers; end - def load_country_info(code); end - def load_timezone_info(identifier); end - def lookup_country_info(hash, code, encoding = nil); end - def raise_invalid_data_source(method_name); end - def self.create_default_data_source; end - def self.get; end - def self.set(data_source_or_type, *args); end - def timezone_identifier_encoding; end - def timezone_identifiers; end - def to_s; end - def try_with_encoding(string, encoding); end - def validate_timezone_identifier(identifier); end -end -class TZInfo::DataSources::TZInfoDataNotFound < StandardError -end -class TZInfo::DataSources::RubyDataSource < TZInfo::DataSource - def country_codes; end - def data_timezone_identifiers; end - def initialize; end - def inspect; end - def linked_timezone_identifiers; end - def load_country_info(code); end - def load_timezone_info(identifier); end - def require_data(*file); end - def require_definition(identifier); end - def require_index(name); end - def to_s; end - def version_info; end -end -class TZInfo::DataSources::InvalidZoneinfoDirectory < StandardError -end -class TZInfo::DataSources::ZoneinfoDirectoryNotFound < StandardError -end -class TZInfo::DataSources::ZoneinfoDataSource < TZInfo::DataSource - def country_codes; end - def data_timezone_identifiers; end - def dms_to_rational(sign, degrees, minutes, seconds = nil); end - def enum_timezones(dir, exclude = nil, &block); end - def find_zoneinfo_dir; end - def initialize(zoneinfo_dir = nil, alternate_iso3166_tab_path = nil); end - def inspect; end - def linked_timezone_identifiers; end - def load_countries(iso3166_tab_path, zone_tab_path); end - def load_country_info(code); end - def load_timezone_identifiers; end - def load_timezone_info(identifier); end - def resolve_tab_path(zoneinfo_path, standard_names, tab_name); end - def self.alternate_iso3166_tab_search_path; end - def self.alternate_iso3166_tab_search_path=(alternate_iso3166_tab_search_path); end - def self.process_search_path(path, default); end - def self.search_path; end - def self.search_path=(search_path); end - def to_s; end - def validate_zoneinfo_dir(path, iso3166_tab_path = nil); end - def zoneinfo_dir; end -end -class TZInfo::TimezonePeriod - def abbr; end - def abbreviation; end - def base_utc_offset; end - def dst?; end - def end_transition; end - def ends_at; end - def initialize(offset); end - def local_ends_at; end - def local_starts_at; end - def observed_utc_offset; end - def offset; end - def raise_not_implemented(method_name); end - def start_transition; end - def starts_at; end - def std_offset; end - def timestamp(transition); end - def timestamp_with_offset(transition); end - def utc_offset; end - def utc_total_offset; end - def zone_identifier; end -end -class TZInfo::OffsetTimezonePeriod < TZInfo::TimezonePeriod - def ==(p); end - def end_transition; end - def eql?(p); end - def hash; end - def initialize(offset); end - def start_transition; end -end -class TZInfo::TransitionsTimezonePeriod < TZInfo::TimezonePeriod - def ==(p); end - def end_transition; end - def eql?(p); end - def hash; end - def initialize(start_transition, end_transition); end - def inspect; end - def start_transition; end -end -class TZInfo::AmbiguousTime < StandardError -end -class TZInfo::PeriodNotFound < StandardError -end -class TZInfo::InvalidTimezoneIdentifier < StandardError -end -class TZInfo::UnknownTimezone < StandardError -end -class TZInfo::Timezone - def <=>(tz); end - def =~(regexp); end - def _dump(limit); end - def abbr(time = nil); end - def abbreviation(time = nil); end - def base_utc_offset(time = nil); end - def canonical_identifier; end - def canonical_zone; end - def current_period; end - def current_period_and_time; end - def current_time_and_period; end - def dst?(time = nil); end - def eql?(tz); end - def friendly_identifier(skip_first_part = nil); end - def hash; end - def identifier; end - def inspect; end - def local_datetime(year, month = nil, day = nil, hour = nil, minute = nil, second = nil, sub_second = nil, dst = nil, &block); end - def local_time(year, month = nil, day = nil, hour = nil, minute = nil, second = nil, sub_second = nil, dst = nil, &block); end - def local_timestamp(year, month = nil, day = nil, hour = nil, minute = nil, second = nil, sub_second = nil, dst = nil, &block); end - def local_to_utc(local_time, dst = nil); end - def name; end - def now; end - def observed_utc_offset(time = nil); end - def offsets_up_to(to, from = nil); end - def period_for(time); end - def period_for_local(local_time, dst = nil); end - def period_for_utc(utc_time); end - def periods_for_local(local_time); end - def raise_unknown_timezone; end - def self._load(data); end - def self.all; end - def self.all_country_zone_identifiers; end - def self.all_country_zones; end - def self.all_data_zone_identifiers; end - def self.all_data_zones; end - def self.all_identifiers; end - def self.all_linked_zone_identifiers; end - def self.all_linked_zones; end - def self.data_source; end - def self.default_dst; end - def self.default_dst=(value); end - def self.get(identifier); end - def self.get_proxies(identifiers); end - def self.get_proxy(identifier); end - def strftime(format, time = nil); end - def to_local(time); end - def to_s; end - def transitions_up_to(to, from = nil); end - def utc_offset(time = nil); end - def utc_to_local(utc_time); end - include Comparable -end -class TZInfo::InfoTimezone < TZInfo::Timezone - def identifier; end - def info; end - def initialize(info); end -end -class TZInfo::DataTimezone < TZInfo::InfoTimezone - def canonical_zone; end - def period_for(time); end - def periods_for_local(local_time); end - def transitions_up_to(to, from = nil); end -end -class TZInfo::LinkedTimezone < TZInfo::InfoTimezone - def canonical_zone; end - def initialize(info); end - def period_for(time); end - def periods_for_local(local_time); end - def transitions_up_to(to, from = nil); end -end -class TZInfo::TimezoneProxy < TZInfo::Timezone - def _dump(limit); end - def canonical_zone; end - def identifier; end - def initialize(identifier); end - def period_for(time); end - def periods_for_local(local_time); end - def real_timezone; end - def self._load(data); end - def transitions_up_to(to, from = nil); end -end -class TZInfo::InvalidCountryCode < StandardError -end -class TZInfo::Country - def <=>(c); end - def =~(regexp); end - def _dump(limit); end - def code; end - def eql?(c); end - def hash; end - def initialize(info); end - def inspect; end - def name; end - def self._load(data); end - def self.all; end - def self.all_codes; end - def self.data_source; end - def self.get(code); end - def to_s; end - def zone_identifiers; end - def zone_info; end - def zone_names; end - def zones; end - include Comparable -end -class TZInfo::CountryTimezone - def ==(ct); end - def description; end - def description_or_friendly_identifier; end - def eql?(ct); end - def hash; end - def identifier; end - def initialize(identifier, latitude, longitude, description = nil); end - def latitude; end - def longitude; end - def timezone; end -end -module TZInfo::Format2 -end -class TZInfo::Format2::CountryDefiner - def initialize(shared_timezones, identifier_deduper, description_deduper); end - def timezone(identifier_or_reference, latitude_numerator = nil, latitude_denominator = nil, longitude_numerator = nil, longitude_denominator = nil, description = nil); end - def timezones; end -end -class TZInfo::Format2::CountryIndexDefiner - def countries; end - def country(code, name); end - def initialize(identifier_deduper, description_deduper); end - def timezone(reference, identifier, latitude_numerator, latitude_denominator, longitude_numerator, longitude_denominator, description = nil); end -end -module TZInfo::Format2::CountryIndexDefinition - def self.append_features(base); end -end -module TZInfo::Format2::CountryIndexDefinition::ClassMethods - def countries; end - def country_index; end -end -class TZInfo::Format2::TimezoneDefiner - def first_offset; end - def initialize(string_deduper); end - def offset(id, base_utc_offset, std_offset, abbreviation); end - def subsequent_rules(*args); end - def transition(offset_id, timestamp_value); end - def transitions; end -end -module TZInfo::Format2::TimezoneDefinition - def self.append_features(base); end -end -module TZInfo::Format2::TimezoneDefinition::ClassMethods - def get; end - def linked_timezone(identifier, link_to_identifier); end - def timezone(identifier); end - def timezone_definer_class; end -end -class TZInfo::Format2::TimezoneIndexDefiner - def data_timezone(identifier); end - def data_timezones; end - def initialize(string_deduper); end - def linked_timezone(identifier); end - def linked_timezones; end -end -module TZInfo::Format2::TimezoneIndexDefinition - def self.append_features(base); end -end -module TZInfo::Format2::TimezoneIndexDefinition::ClassMethods - def data_timezones; end - def linked_timezones; end - def timezone_index; end -end -module TZInfo::Format1 -end -class TZInfo::Format1::CountryDefiner < TZInfo::Format2::CountryDefiner - def initialize(identifier_deduper, description_deduper); end -end -module TZInfo::Format1::CountryIndexDefinition - def self.append_features(base); end -end -module TZInfo::Format1::CountryIndexDefinition::ClassMethods - def countries; end - def country(code, name); end -end -class TZInfo::Format1::TimezoneDefiner < TZInfo::Format2::TimezoneDefiner - def offset(id, utc_offset, std_offset, abbreviation); end - def transition(year, month, offset_id, timestamp_value, datetime_numerator = nil, datetime_denominator = nil); end -end -module TZInfo::Format1::TimezoneDefinition - def self.append_features(base); end -end -module TZInfo::Format1::TimezoneDefinition::ClassMethods - def timezone_definer_class; end -end -module TZInfo::Format1::TimezoneIndexDefinition - def self.append_features(base); end -end -module TZInfo::Format1::TimezoneIndexDefinition::ClassMethods - def data_timezones; end - def linked_timezone(identifier); end - def linked_timezones; end - def timezone(identifier); end -end diff --git a/sorbet/rbi/gems/tzinfo@2.0.6.rbi b/sorbet/rbi/gems/tzinfo@2.0.6.rbi index 2d8ea9f..f8f9c81 100644 --- a/sorbet/rbi/gems/tzinfo@2.0.6.rbi +++ b/sorbet/rbi/gems/tzinfo@2.0.6.rbi @@ -5,5 +5,5914 @@ # Please instead update this file by running `bin/tapioca gem tzinfo`. -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem +# The top level module for TZInfo. +# +# source://tzinfo//lib/tzinfo.rb#5 +module TZInfo + class << self + # Instructs the current {DataSource} to load all timezone and country data + # into memory (initializing the {DataSource} first if not previously + # accessed or set). + # + # This may be desirable in production environments to improve copy-on-write + # performance and to avoid flushing the constant cache every time a new + # timezone or country is loaded from {DataSources::RubyDataSource}. + # + # source://tzinfo//lib/tzinfo.rb#14 + def eager_load!; end + end +end + +# Defines transitions that occur on the zero-based nth day of the year. +# +# Day 0 is 1 January. +# +# Leap days are counted. Day 59 will be 29 February on a leap year and 1 March +# on a non-leap year. Day 365 will be 31 December on a leap year and 1 January +# the following year on a non-leap year. +# +# @private +# +# source://tzinfo//lib/tzinfo/transition_rule.rb#129 +class TZInfo::AbsoluteDayOfYearTransitionRule < ::TZInfo::DayOfYearTransitionRule + # Initializes a new {AbsoluteDayOfYearTransitionRule}. + # + # @param day [Integer] the zero-based day of the year on which the + # transition occurs (0 to 365 inclusive). + # @param transition_at [Integer] the time in seconds after midnight local + # time at which the transition occurs. + # @raise [ArgumentError] if `transition_at` is not an `Integer`. + # @raise [ArgumentError] if `day` is not an `Integer`. + # @raise [ArgumentError] if `day` is less than 0 or greater than 365. + # @return [AbsoluteDayOfYearTransitionRule] a new instance of AbsoluteDayOfYearTransitionRule + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#130 + def initialize(day, transition_at = T.unsafe(nil)); end + + # Determines if this {AbsoluteDayOfYearTransitionRule} is equal to another + # instance. + # + # @param r [Object] the instance to test for equality. + # @return [Boolean] `true` if `r` is a {AbsoluteDayOfYearTransitionRule} + # with the same {transition_at} and day as this + # {AbsoluteDayOfYearTransitionRule}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#153 + def ==(r); end + + # Determines if this {AbsoluteDayOfYearTransitionRule} is equal to another + # instance. + # + # @param r [Object] the instance to test for equality. + # @return [Boolean] `true` if `r` is a {AbsoluteDayOfYearTransitionRule} + # with the same {transition_at} and day as this + # {AbsoluteDayOfYearTransitionRule}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#153 + def eql?(r); end + + # @return [Boolean] `true` if the day specified by this transition is the + # first in the year (a day number of 0), otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#137 + def is_always_first_day_of_year?; end + + # @return [Boolean] `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#142 + def is_always_last_day_of_year?; end + + protected + + # Returns a `Time` representing midnight local time on the day specified by + # the rule for the given offset and year. + # + # @param offset [TimezoneOffset] the current offset at the time of the + # transition. + # @param year [Integer] the year in which the transition occurs. + # @return [Time] midnight local time on the day specified by the rule for + # the given offset and year. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#168 + def get_day(offset, year); end + + # @return [Array] an `Array` of parameters that will influence the output of + # {hash}. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#173 + def hash_args; end +end + +# {AmbiguousTime} is raised to indicate that a specified local time has more +# than one possible equivalent UTC time. Such ambiguities arise when the +# clocks are set back in a time zone, most commonly during the repeated hour +# when transitioning from daylight savings time to standard time. +# +# {AmbiguousTime} is raised by {Timezone#local_datetime}, +# {Timezone#local_time}, {Timezone#local_timestamp}, {Timezone#local_to_utc} +# and {Timezone#period_for_local} when using an ambiguous time and not +# specifying how to resolve the ambiguity. +# +# source://tzinfo//lib/tzinfo/timezone.rb#16 +class TZInfo::AmbiguousTime < ::StandardError; end + +# A set of rules that define when transitions occur in time zones with +# annually occurring daylight savings time. +# +# @private +# +# source://tzinfo//lib/tzinfo/annual_rules.rb#9 +class TZInfo::AnnualRules + # Initializes a new {AnnualRules} instance. + # + # @param std_offset [TimezoneOffset] the standard offset that applies when + # daylight savings time is not in force. + # @param dst_offset [TimezoneOffset] the offset that applies when daylight + # savings time is in force. + # @param dst_start_rule [TransitionRule] the rule that determines when + # daylight savings time starts. + # @param dst_end_rule [TransitionRule] the rule that determines when daylight + # savings time ends. + # @return [AnnualRules] a new instance of AnnualRules + # + # source://tzinfo//lib/tzinfo/annual_rules.rb#36 + def initialize(std_offset, dst_offset, dst_start_rule, dst_end_rule); end + + # @return [TransitionRule] the rule that determines when daylight savings + # time ends. + # + # source://tzinfo//lib/tzinfo/annual_rules.rb#24 + def dst_end_rule; end + + # @return [TimezoneOffset] the offset that applies when daylight savings + # time is in force. + # + # source://tzinfo//lib/tzinfo/annual_rules.rb#16 + def dst_offset; end + + # @return [TransitionRule] the rule that determines when daylight savings + # time starts. + # + # source://tzinfo//lib/tzinfo/annual_rules.rb#20 + def dst_start_rule; end + + # @return [TimezoneOffset] the standard offset that applies when daylight + # savings time is not in force. + # + # source://tzinfo//lib/tzinfo/annual_rules.rb#12 + def std_offset; end + + # Returns the transitions between standard and daylight savings time for a + # given year. The results are ordered by time of occurrence (earliest to + # latest). + # + # @param year [Integer] the year to calculate transitions for. + # @return [Array] the transitions for the year. + # + # source://tzinfo//lib/tzinfo/annual_rules.rb#49 + def transitions(year); end + + private + + # Applies a given rule between offsets on a year. + # + # @param rule [TransitionRule] the rule to apply. + # @param from_offset [TimezoneOffset] the offset the rule transitions from. + # @param to_offset [TimezoneOffset] the offset the rule transitions to. + # @param year [Integer] the year when the transition occurs. + # @return [TimezoneTransition] the transition determined by the rule. + # + # source://tzinfo//lib/tzinfo/annual_rules.rb#65 + def apply_rule(rule, from_offset, to_offset, year); end +end + +# A thread-safe version of {StringDeduper}. +# +# @private +# +# source://tzinfo//lib/tzinfo/string_deduper.rb#50 +class TZInfo::ConcurrentStringDeduper < ::TZInfo::StringDeduper + protected + + # source://tzinfo//lib/tzinfo/string_deduper.rb#53 + def create_hash(&block); end +end + +# The {Country} class represents an ISO 3166-1 country. It can be used to +# obtain a list of time zones observed by a country. For example: +# +# united_states = Country.get('US') +# united_states.zone_identifiers +# united_states.zones +# united_states.zone_info +# +# The {Country} class is thread-safe. It is safe to use class and instance +# methods of {Country} in concurrently executing threads. Instances of +# {Country} can be shared across thread boundaries. +# +# Country information available through TZInfo is intended as an aid for +# users, to help them select time zone data appropriate for their practical +# needs. It is not intended to take or endorse any position on legal or +# territorial claims. +# +# source://tzinfo//lib/tzinfo/country.rb#26 +class TZInfo::Country + include ::Comparable + + # Initializes a new {Country} based upon a {DataSources::CountryInfo} + # instance. + # + # {Country} instances should not normally be constructed directly. Use + # the {Country.get} method to obtain instances instead. + # + # @param info [DataSources::CountryInfo] the data to base the new {Country} + # instance upon. + # @return [Country] a new instance of Country + # + # source://tzinfo//lib/tzinfo/country.rb#72 + def initialize(info); end + + # Compares this {Country} with another based on their {code}. + # + # @param c [Object] an `Object` to compare this {Country} with. + # @return [Integer] -1 if `c` is less than `self`, 0 if `c` is equal to + # `self` and +1 if `c` is greater than `self`, or `nil` if `c` is not an + # instance of {Country}. + # + # source://tzinfo//lib/tzinfo/country.rb#162 + def <=>(c); end + + # Matches `regexp` against the {code} of this {Country}. + # + # @param regexp [Regexp] a `Regexp` to match against the {code} of + # this {Country}. + # @return [Integer] the position the match starts, or `nil` if there is no + # match. + # + # source://tzinfo//lib/tzinfo/country.rb#185 + def =~(regexp); end + + # Returns a serialized representation of this {Country}. This method is + # called when using `Marshal.dump` with an instance of {Country}. + # + # @param limit [Integer] the maximum depth to dump - ignored. + # @return [String] a serialized representation of this {Country}. + # + # source://tzinfo//lib/tzinfo/country.rb#194 + def _dump(limit); end + + # @return [String] the ISO 3166-1 alpha-2 country code. + # + # source://tzinfo//lib/tzinfo/country.rb#77 + def code; end + + # @param c [Object] an `Object` to compare this {Country} with. + # @return [Boolean] `true` if `c` is an instance of {Country} and has the + # same code as `self`, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/country.rb#170 + def eql?(c); end + + # @return [Integer] a hash based on the {code}. + # + # source://tzinfo//lib/tzinfo/country.rb#175 + def hash; end + + # @return [String] the internal object state as a programmer-readable + # `String`. + # + # source://tzinfo//lib/tzinfo/country.rb#94 + def inspect; end + + # @return [String] the name of the country. + # + # source://tzinfo//lib/tzinfo/country.rb#82 + def name; end + + # @return [String] a `String` representation of this {Country} (the name of + # the country). + # + # source://tzinfo//lib/tzinfo/country.rb#88 + def to_s; end + + # Returns an `Array` containing the identifier for each time zone observed + # by the country. These are in an order that + # + # 1. makes some geographical sense, and + # 2. puts the most populous zones first, where that does not contradict 1. + # + # Returned zone identifiers may refer to cities and regions outside of the + # country. This will occur if the zone covers multiple countries. Any zones + # referring to a city or region in a different country will be listed after + # those relating to this country. + # + # @return [Array] an `Array` containing the identifier for each time + # zone observed by the country + # + # source://tzinfo//lib/tzinfo/country.rb#111 + def zone_identifiers; end + + # Returns a frozen `Array` containing a {CountryTimezone} instance for each + # time zone observed by the country. These are in an order that + # + # 1. makes some geographical sense, and + # 2. puts the most populous zones first, where that does not contradict 1. + # + # The {CountryTimezone} instances can be used to obtain the location and + # descriptions of the observed time zones. + # + # Identifiers and descriptions of the time zones returned may refer to + # cities and regions outside of the country. This will occur if the time + # zone covers multiple countries. Any zones referring to a city or region in + # a different country will be listed after those relating to this country. + # + # @return [Array] a frozen `Array` containing a + # {CountryTimezone} instance for each time zone observed by the country. + # + # source://tzinfo//lib/tzinfo/country.rb#152 + def zone_info; end + + # Returns an `Array` containing the identifier for each time zone observed + # by the country. These are in an order that + # + # 1. makes some geographical sense, and + # 2. puts the most populous zones first, where that does not contradict 1. + # + # Returned zone identifiers may refer to cities and regions outside of the + # country. This will occur if the zone covers multiple countries. Any zones + # referring to a city or region in a different country will be listed after + # those relating to this country. + # + # @return [Array] an `Array` containing the identifier for each time + # zone observed by the country + # + # source://tzinfo//lib/tzinfo/country.rb#111 + def zone_names; end + + # Returns An `Array` containing a {Timezone} instance for each time zone + # observed by the country. These are in an order that + # + # 1. makes some geographical sense, and + # 2. puts the most populous zones first, where that does not contradict 1. + # + # The identifiers of the time zones returned may refer to cities and regions + # outside of the country. This will occur if the time zone covers multiple + # countries. Any zones referring to a city or region in a different country + # will be listed after those relating to this country. + # + # The results are actually instances of {TimezoneProxy} in order to defer + # loading of the time zone transition data until it is first needed. + # + # @return [Array] an `Array` containing a {Timezone} instance for + # each time zone observed by the country. + # + # source://tzinfo//lib/tzinfo/country.rb#132 + def zones; end + + class << self + # Loads a {Country} from the serialized representation returned by {_dump}. + # This is method is called when using `Marshal.load` or `Marshal.restore` + # to restore a serialized {Country}. + # + # @param data [String] a serialized representation of a {Country}. + # @return [Country] the result of converting `data` back into a {Country}. + # + # source://tzinfo//lib/tzinfo/country.rb#204 + def _load(data); end + + # @return [Array] an `Array` containing one {Country} instance + # for each defined country. + # + # source://tzinfo//lib/tzinfo/country.rb#52 + def all; end + + # @return [Array] an `Array` containing all the valid ISO 3166-1 + # alpha-2 country codes. + # + # source://tzinfo//lib/tzinfo/country.rb#46 + def all_codes; end + + # Gets a {Country} by its ISO 3166-1 alpha-2 code. + # + # The {Country.all_codes} method can be used to obtain a list of valid ISO + # 3166-1 alpha-2 codes. + # + # @param code [String] An ISO 3166-1 alpha-2 code. + # @raise [InvalidCountryCode] If {code} is not a valid ISO 3166-1 alpha-2 + # code it couldn't be found. + # @return [Country] a {Country} instance representing the ISO-3166-1 + # country identified by the `code` parameter. + # + # source://tzinfo//lib/tzinfo/country.rb#40 + def get(code); end + + private + + # @return [DataSource] the current DataSource. + # + # source://tzinfo//lib/tzinfo/country.rb#59 + def data_source; end + end +end + +# Alias used by TZInfo::Data format1 releases. +# +# @private +# +# source://tzinfo//lib/tzinfo/format1/country_index_definition.rb#62 +TZInfo::CountryIndexDefinition = TZInfo::Format1::CountryIndexDefinition + +# Information about a time zone used by a {Country}. +# +# source://tzinfo//lib/tzinfo/country_timezone.rb#5 +class TZInfo::CountryTimezone + # Creates a new {CountryTimezone}. + # + # The passed in identifier and description instances will be frozen. + # + # {CountryTimezone} instances should normally only be constructed + # by implementations of {DataSource}. + # + # @param identifier [String] the {Timezone} identifier. + # @param latitude [Rational] the latitude of the time zone. + # @param longitude [Rational] the longitude of the time zone. + # @param description [String] an optional description of the time zone. + # @return [CountryTimezone] a new instance of CountryTimezone + # + # source://tzinfo//lib/tzinfo/country_timezone.rb#44 + def initialize(identifier, latitude, longitude, description = T.unsafe(nil)); end + + # Tests if the given object is equal to the current instance (has the same + # identifier, latitude, longitude and description). + # + # @param ct [Object] the object to be compared. + # @return [TrueClass] `true` if `ct` is equal to the current instance. + # + # source://tzinfo//lib/tzinfo/country_timezone.rb#72 + def ==(ct); end + + # A description of this time zone in relation to the country, e.g. "Eastern + # Time". This is usually `nil` for countries that have a single time zone. + # + # @return [String] an optional description of the time zone. + # + # source://tzinfo//lib/tzinfo/country_timezone.rb#31 + def description; end + + # @return [String] the {description} if present, otherwise a human-readable + # representation of the identifier (using {Timezone#friendly_identifier}). + # + # source://tzinfo//lib/tzinfo/country_timezone.rb#63 + def description_or_friendly_identifier; end + + # Tests if the given object is equal to the current instance (has the same + # identifier, latitude, longitude and description). + # + # @param ct [Object] the object to be compared. + # @return [Boolean] `true` if `ct` is equal to the current instance. + # + # source://tzinfo//lib/tzinfo/country_timezone.rb#83 + def eql?(ct); end + + # {longitude} and {description}. + # + # @return [Integer] a hash based on the {identifier}, {latitude}, + # + # source://tzinfo//lib/tzinfo/country_timezone.rb#89 + def hash; end + + # @return [String] the identifier of the {Timezone} being described. + # + # source://tzinfo//lib/tzinfo/country_timezone.rb#7 + def identifier; end + + # The latitude of this time zone in degrees. Positive numbers are degrees + # north and negative numbers are degrees south. + # + # Note that depending on the data source, the position given by {#latitude} + # and {#longitude} may not be within the country. + # + # @return [Rational] the latitude in degrees. + # + # source://tzinfo//lib/tzinfo/country_timezone.rb#16 + def latitude; end + + # The longitude of this time zone in degrees. Positive numbers are degrees + # east and negative numbers are degrees west. + # + # Note that depending on the data source, the position given by {#latitude} + # and {#longitude} may not be within the country. + # + # @return [Rational] the longitude in degrees. + # + # source://tzinfo//lib/tzinfo/country_timezone.rb#25 + def longitude; end + + # Returns the associated {Timezone}. + # + # The result is actually an instance of {TimezoneProxy} in order to defer + # loading of the time zone transition data until it is first needed. + # + # @return [Timezone] the associated {Timezone}. + # + # source://tzinfo//lib/tzinfo/country_timezone.rb#57 + def timezone; end +end + +# TZInfo can be used with different data sources for time zone and country +# data. Each source of data is implemented as a subclass of {DataSource}. +# +# To choose a data source and override the default selection, use the +# {DataSource.set} method. +# +# @abstract To create a custom data source, create a subclass of {DataSource} +# and implement the {load_timezone_info}, {data_timezone_identifiers}, +# {linked_timezone_identifiers}, {load_country_info} and {country_codes} +# methods. +# +# source://tzinfo//lib/tzinfo/data_source.rb#29 +class TZInfo::DataSource + # Initializes a new {DataSource} instance. Typically only called via + # subclasses of {DataSource}. + # + # @return [DataSource] a new instance of DataSource + # + # source://tzinfo//lib/tzinfo/data_source.rb#166 + def initialize; end + + # Returns a frozen `Array` of all the available ISO 3166-1 alpha-2 country + # codes. The identifiers are sorted according to `String#<=>`. + # + # @return [Array] a frozen `Array` of all the available ISO 3166-1 + # alpha-2 country codes. + # + # source://tzinfo//lib/tzinfo/data_source.rb#246 + def country_codes; end + + # Returns a frozen `Array` of all the available time zone identifiers for + # data time zones (i.e. those that actually contain definitions). The + # identifiers are sorted according to `String#<=>`. + # + # @return [Array] a frozen `Array` of all the available time zone + # identifiers for data time zones. + # + # source://tzinfo//lib/tzinfo/data_source.rb#218 + def data_timezone_identifiers; end + + # Loads all timezone and country data into memory. + # + # This may be desirable in production environments to improve copy-on-write + # performance and to avoid flushing the constant cache every time a new + # timezone or country is loaded from {DataSources::RubyDataSource}. + # + # source://tzinfo//lib/tzinfo/data_source.rb#255 + def eager_load!; end + + # @param code [String] an ISO 3166-1 alpha-2 country code. + # @raise [InvalidCountryCode] if the country could not be found or the code + # is invalid. + # @return [DataSources::CountryInfo] a {DataSources::CountryInfo} instance + # for the given ISO 3166-1 alpha-2 country code. + # + # source://tzinfo//lib/tzinfo/data_source.rb#237 + def get_country_info(code); end + + # Returns a {DataSources::TimezoneInfo} instance for the given identifier. + # The result will derive from either {DataSources::DataTimezoneInfo} for + # time zones that define their own data or {DataSources::LinkedTimezoneInfo} + # for links or aliases to other time zones. + # + # {get_timezone_info} calls {load_timezone_info} to create the + # {DataSources::TimezoneInfo} instance. The returned instance is cached and + # returned in subsequent calls to {get_timezone_info} for the identifier. + # + # @param identifier [String] A time zone identifier. + # @raise [InvalidTimezoneIdentifier] if the time zone is not found or the + # identifier is invalid. + # @return [DataSources::TimezoneInfo] a {DataSources::TimezoneInfo} instance + # for a given identifier. + # + # source://tzinfo//lib/tzinfo/data_source.rb#184 + def get_timezone_info(identifier); end + + # @return [String] the internal object state as a programmer-readable + # `String`. + # + # source://tzinfo//lib/tzinfo/data_source.rb#268 + def inspect; end + + # Returns a frozen `Array` of all the available time zone identifiers that + # are links to other time zones. The identifiers are sorted according to + # `String#<=>`. + # + # @return [Array] a frozen `Array` of all the available time zone + # identifiers that are links to other time zones. + # + # source://tzinfo//lib/tzinfo/data_source.rb#228 + def linked_timezone_identifiers; end + + # @return [Array] a frozen `Array`` of all the available time zone + # identifiers. The identifiers are sorted according to `String#<=>`. + # + # source://tzinfo//lib/tzinfo/data_source.rb#204 + def timezone_identifiers; end + + # @return [String] a description of the {DataSource}. + # + # source://tzinfo//lib/tzinfo/data_source.rb#262 + def to_s; end + + protected + + # @param code [String] an ISO 3166-1 alpha-2 country code. + # @raise [InvalidCountryCode] if the country could not be found or the code + # is invalid. + # @return [DataSources::CountryInfo] a {DataSources::CountryInfo} instance + # for the given ISO 3166-1 alpha-2 country code. + # + # source://tzinfo//lib/tzinfo/data_source.rb#294 + def load_country_info(code); end + + # Returns a {DataSources::TimezoneInfo} instance for the given time zone + # identifier. The result should derive from either + # {DataSources::DataTimezoneInfo} for time zones that define their own data + # or {DataSources::LinkedTimezoneInfo} for links to or aliases for other + # time zones. + # + # @param identifier [String] A time zone identifier. + # @raise [InvalidTimezoneIdentifier] if the time zone is not found or the + # identifier is invalid. + # @return [DataSources::TimezoneInfo] a {DataSources::TimezoneInfo} instance + # for the given time zone identifier. + # + # source://tzinfo//lib/tzinfo/data_source.rb#285 + def load_timezone_info(identifier); end + + # Looks up a given code in the given hash of code to + # {DataSources::CountryInfo} mappings. If the code is found the + # {DataSources::CountryInfo} is returned. Otherwise an {InvalidCountryCode} + # exception is raised. + # + # @param hash [String, DataSources::CountryInfo] a mapping from ISO 3166-1 + # alpha-2 country codes to {DataSources::CountryInfo} instances. + # @param code [String] a country code to lookup. + # @param encoding [Encoding] the encoding used for the country codes in + # `hash`. + # @raise [InvalidCountryCode] if `code` was not found in `hash`. + # @return [DataSources::CountryInfo] the {DataSources::CountryInfo} instance + # corresponding to `code`. + # + # source://tzinfo//lib/tzinfo/data_source.rb#337 + def lookup_country_info(hash, code, encoding = T.unsafe(nil)); end + + # @return [Encoding] the `Encoding` used by the `String` instances returned + # by {data_timezone_identifiers} and {linked_timezone_identifiers}. + # + # source://tzinfo//lib/tzinfo/data_source.rb#300 + def timezone_identifier_encoding; end + + # Checks that the given identifier is a valid time zone identifier (can be + # found in the {timezone_identifiers} `Array`). If the identifier is valid, + # the `String` instance representing that identifier from + # `timezone_identifiers` is returned. Otherwise an + # {InvalidTimezoneIdentifier} exception is raised. + # + # @param identifier [String] a time zone identifier to be validated. + # @raise [InvalidTimezoneIdentifier] if `identifier` was not found in + # {timezone_identifiers}. + # @return [String] the `String` instance equivalent to `identifier` from + # {timezone_identifiers}. + # + # source://tzinfo//lib/tzinfo/data_source.rb#315 + def validate_timezone_identifier(identifier); end + + private + + # Combines {data_timezone_identifiers} and {linked_timezone_identifiers} + # to create an `Array` containing all valid time zone identifiers. If + # {linked_timezone_identifiers} is empty, the {data_timezone_identifiers} + # instance is returned. + # + # The returned `Array` is frozen. The identifiers are sorted according to + # `String#<=>`. + # + # @return [Array] an `Array` containing all valid time zone + # identifiers. + # + # source://tzinfo//lib/tzinfo/data_source.rb#366 + def build_timezone_identifiers; end + + # If the given `identifier` is contained within the {timezone_identifiers} + # `Array`, the `String` instance representing that identifier from + # {timezone_identifiers} is returned. Otherwise, `nil` is returned. + # + # :nocov_array_bsearch: + # + # @param identifier [String] A time zone identifier to search for. + # @return [String] the `String` instance representing `identifier` from + # {timezone_identifiers} if found, or `nil` if not found. + # + # source://tzinfo//lib/tzinfo/data_source.rb#382 + def find_timezone_identifier(identifier); end + + # Raises {InvalidDataSource} to indicate that a method has not been + # overridden by a particular data source implementation. + # + # @raise [InvalidDataSource] always. + # + # source://tzinfo//lib/tzinfo/data_source.rb#352 + def raise_invalid_data_source(method_name); end + + # Tries an operation using `string` directly. If the operation fails, the + # string is copied and encoded with `encoding` and the operation is tried + # again. + # + # fails and `string` is already encoded with `encoding`. + # + # @param string [String] The `String` to perform the operation on. + # @param encoding [Encoding] The `Encoding` to use if the initial attempt + # fails. + # @return [Object] the result of the operation or `nil` if the first attempt + # @yield [s] the caller will be yielded to once or twice to attempt the + # operation. + # @yieldparam s [String] either `string` or an encoded copy of `string`. + # @yieldreturn [Object] The result of the operation. Must be truthy if + # successful. + # + # source://tzinfo//lib/tzinfo/data_source.rb#436 + def try_with_encoding(string, encoding); end + + class << self + # @return [DataSource] the currently selected source of data. + # + # source://tzinfo//lib/tzinfo/data_source.rb#42 + def get; end + + # Sets the currently selected data source for time zone and country data. + # + # This should usually be set to one of the two standard data source types: + # + # * `:ruby` - read data from the Ruby modules included in the TZInfo::Data + # library (tzinfo-data gem). + # * `:zoneinfo` - read data from the zoneinfo files included with most + # Unix-like operating systems (e.g. in /usr/share/zoneinfo). + # + # To set TZInfo to use one of the standard data source types, call + # `TZInfo::DataSource.set`` in one of the following ways: + # + # TZInfo::DataSource.set(:ruby) + # TZInfo::DataSource.set(:zoneinfo) + # TZInfo::DataSource.set(:zoneinfo, zoneinfo_dir) + # TZInfo::DataSource.set(:zoneinfo, zoneinfo_dir, iso3166_tab_file) + # + # `DataSource.set(:zoneinfo)` will automatically search for the zoneinfo + # directory by checking the paths specified in + # {DataSources::ZoneinfoDataSource.search_path}. + # {DataSources::ZoneinfoDirectoryNotFound} will be raised if no valid + # zoneinfo directory could be found. + # + # `DataSource.set(:zoneinfo, zoneinfo_dir)` uses the specified + # `zoneinfo_dir` directory as the data source. If the directory is not a + # valid zoneinfo directory, a {DataSources::InvalidZoneinfoDirectory} + # exception will be raised. + # + # `DataSource.set(:zoneinfo, zoneinfo_dir, iso3166_tab_file)` uses the + # specified `zoneinfo_dir` directory as the data source, but loads the + # `iso3166.tab` file from the path given by `iso3166_tab_file`. If the + # directory is not a valid zoneinfo directory, a + # {DataSources::InvalidZoneinfoDirectory} exception will be raised. + # + # Custom data sources can be created by subclassing TZInfo::DataSource and + # implementing the following methods: + # + # * {load_timezone_info} + # * {data_timezone_identifiers} + # * {linked_timezone_identifiers} + # * {load_country_info} + # * {country_codes} + # + # To have TZInfo use the custom data source, call {DataSource.set}, + # passing an instance of the custom data source implementation as follows: + # + # TZInfo::DataSource.set(CustomDataSource.new) + # + # Calling {DataSource.set} will only affect instances of {Timezone} and + # {Country} obtained with {Timezone.get} and {Country.get} subsequent to + # the {DataSource.set} call. Existing {Timezone} and {Country} instances + # will be unaffected. + # + # If {DataSource.set} is not called, TZInfo will by default attempt to use + # TZInfo::Data as the data source. If TZInfo::Data is not available (i.e. + # if `require 'tzinfo/data'` fails), then TZInfo will search for a + # zoneinfo directory instead (using the search path specified by + # {DataSources::ZoneinfoDataSource.search_path}). + # + # @param data_source_or_type [Object] either `:ruby`, `:zoneinfo` or an + # instance of a {DataSource}. + # @param args [Array] when `data_source_or_type` is a symbol, + # optional arguments to use when initializing the data source. + # @raise [ArgumentError] if `data_source_or_type` is not `:ruby`, + # `:zoneinfo` or an instance of {DataSource}. + # + # source://tzinfo//lib/tzinfo/data_source.rb#127 + def set(data_source_or_type, *args); end + + private + + # Creates a {DataSource} instance for use as the default. Used if no + # preference has been specified manually. + # + # @return [DataSource] the newly created default {DataSource} instance. + # + # source://tzinfo//lib/tzinfo/data_source.rb#145 + def create_default_data_source; end + end +end + +# {DataSourceNotFound} is raised if no data source could be found (i.e. if +# `'tzinfo/data'` cannot be found on the load path and no valid zoneinfo +# directory can be found on the system). +# +# source://tzinfo//lib/tzinfo/data_source.rb#16 +class TZInfo::DataSourceNotFound < ::StandardError; end + +# {DataSource} implementations and classes used by {DataSource} +# implementations. +# +# source://tzinfo//lib/tzinfo/data_sources.rb#6 +module TZInfo::DataSources; end + +# Represents a data time zone defined by a constantly observed offset. +# +# source://tzinfo//lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb#7 +class TZInfo::DataSources::ConstantOffsetDataTimezoneInfo < ::TZInfo::DataSources::DataTimezoneInfo + # Initializes a new {ConstantOffsetDataTimezoneInfo}. + # + # The passed in `identifier` instance will be frozen. A reference to the + # passed in {TimezoneOffset} will be retained. + # + # @param identifier [String] the identifier of the time zone. + # @param constant_offset [TimezoneOffset] the constantly observed offset. + # @raise [ArgumentError] if `identifier` or `constant_offset` is `nil`. + # @return [ConstantOffsetDataTimezoneInfo] a new instance of ConstantOffsetDataTimezoneInfo + # + # source://tzinfo//lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb#19 + def initialize(identifier, constant_offset); end + + # @return [TimezoneOffset] the offset that is constantly observed. + # + # source://tzinfo//lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb#9 + def constant_offset; end + + # @param timestamp [Timestamp] ignored. + # @return [TimezonePeriod] an unbounded {TimezonePeriod} for the time + # zone's constantly observed offset. + # + # source://tzinfo//lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb#28 + def period_for(timestamp); end + + # @param local_timestamp [Timestamp] ignored. + # @return [Array] an `Array` containing a single unbounded + # {TimezonePeriod} for the time zone's constantly observed offset. + # + # source://tzinfo//lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb#35 + def periods_for_local(local_timestamp); end + + # @param to_timestamp [Timestamp] ignored. + # @param from_timestamp [Timestamp] ignored. + # @return [Array] an empty `Array`, since there are no transitions in time + # zones that observe a constant offset. + # + # source://tzinfo//lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb#43 + def transitions_up_to(to_timestamp, from_timestamp = T.unsafe(nil)); end + + private + + # @return [TimezonePeriod] an unbounded {TimezonePeriod} with the constant + # offset of this timezone. + # + # source://tzinfo//lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb#51 + def constant_period; end +end + +# Represents a country and references to its time zones as returned by a +# {DataSource}. +# +# source://tzinfo//lib/tzinfo/data_sources/country_info.rb#8 +class TZInfo::DataSources::CountryInfo + # Initializes a new {CountryInfo}. The passed in `code`, `name` and + # `zones` instances will be frozen. + # + # @param code [String] an ISO 3166-1 alpha-2 country code. + # @param name [String] the name of the country. + # @param zones [Array] the time zones observed in the + # country. + # @raise [ArgumentError] if `code`, `name` or `zones` is `nil`. + # @return [CountryInfo] a new instance of CountryInfo + # + # source://tzinfo//lib/tzinfo/data_sources/country_info.rb#26 + def initialize(code, name, zones); end + + # @return [String] the ISO 3166-1 alpha-2 country code. + # + # source://tzinfo//lib/tzinfo/data_sources/country_info.rb#10 + def code; end + + # @return [String] the internal object state as a programmer-readable + # `String`. + # + # source://tzinfo//lib/tzinfo/data_sources/country_info.rb#37 + def inspect; end + + # @return [String] the name of the country. + # + # source://tzinfo//lib/tzinfo/data_sources/country_info.rb#13 + def name; end + + # @return [Array] the time zones observed in the country. + # + # source://tzinfo//lib/tzinfo/data_sources/country_info.rb#16 + def zones; end +end + +# The base class for time zones defined as either a series of transitions +# ({TransitionsDataTimezoneInfo}) or a constantly observed offset +# ({ConstantOffsetDataTimezoneInfo}). +# +# @abstract Data sources return instances of {DataTimezoneInfo} subclasses. +# +# source://tzinfo//lib/tzinfo/data_sources/data_timezone_info.rb#11 +class TZInfo::DataSources::DataTimezoneInfo < ::TZInfo::DataSources::TimezoneInfo + # @return [DataTimezone] a new {DataTimezone} instance for the time zone + # represented by this {DataTimezoneInfo}. + # + # source://tzinfo//lib/tzinfo/data_sources/data_timezone_info.rb#76 + def create_timezone; end + + # @param timestamp [Timestamp] a {Timestamp} with a specified + # {Timestamp#utc_offset utc_offset}. + # @raise [ArgumentError] may be raised if `timestamp` is `nil` or does not + # have a specified {Timestamp#utc_offset utc_offset}. + # @return [TimezonePeriod] the {TimezonePeriod} observed at the time + # specified by `timestamp`. + # + # source://tzinfo//lib/tzinfo/data_sources/data_timezone_info.rb#18 + def period_for(timestamp); end + + # Returns an `Array` containing the {TimezonePeriod TimezonePeriods} that + # could be observed at the local time specified by `local_timestamp`. The + # results are are ordered by increasing UTC start date. An empty `Array` + # is returned if no periods are found for the given local time. + # + # @param local_timestamp [Timestamp] a {Timestamp} representing a local + # time - must have an unspecified {Timestamp#utc_offset utc_offset}. + # @raise [ArgumentError] may be raised if `local_timestamp` is `nil`, or + # has a specified {Timestamp#utc_offset utc_offset}. + # @return [Array] an `Array` containing the + # {TimezonePeriod TimezonePeriods} that could be observed at the local + # time specified by `local_timestamp`. + # + # source://tzinfo//lib/tzinfo/data_sources/data_timezone_info.rb#34 + def periods_for_local(local_timestamp); end + + # Returns an `Array` of {TimezoneTransition} instances representing the + # times where the UTC offset of the time zone changes. + # + # Transitions are returned up to a given {Timestamp} (`to_timestamp`). + # + # A from {Timestamp} may also be supplied using the `from_timestamp` + # parameter. If `from_timestamp` is specified, only transitions from that + # time onwards will be returned. + # + # Comparisons with `to_timestamp` are exclusive. Comparisons with + # `from_timestamp` are inclusive. If a transition falls precisely on + # `to_timestamp`, it will be excluded. If a transition falls on + # `from_timestamp`, it will be included. + # + # Transitions returned are ordered by when they occur, from earliest to + # latest. + # + # @param to_timestamp [Timestamp] a {Timestamp} with a specified + # {Timestamp#utc_offset utc_offset}. Transitions are returned if they + # occur before this time. + # @param from_timestamp [Timestamp] an optional {Timestamp} with a + # specified {Timestamp#utc_offset utc_offset}. If specified, transitions + # are returned if they occur at or after this time. + # @raise [ArgumentError] may be raised if `to_timestamp` is `nil` or does + # not have a specified {Timestamp#utc_offset utc_offset}. + # @raise [ArgumentError] may be raised if `from_timestamp` is specified + # but does not have a specified {Timestamp#utc_offset utc_offset}. + # @raise [ArgumentError] may be raised if `from_timestamp` is specified + # but is not earlier than or at the same time as `to_timestamp`. + # @return [Array] an `Array` of {TimezoneTransition} + # instances representing the times where the UTC offset of the time zone + # changes. + # + # source://tzinfo//lib/tzinfo/data_sources/data_timezone_info.rb#70 + def transitions_up_to(to_timestamp, from_timestamp = T.unsafe(nil)); end + + private + + # Raises a {NotImplementedError} to indicate that the base class is + # incorrectly being used directly. + # + # raise [NotImplementedError] always. + # + # @raise [NotImplementedError] + # + # source://tzinfo//lib/tzinfo/data_sources/data_timezone_info.rb#86 + def raise_not_implemented(method_name); end +end + +# An {InvalidPosixTimeZone} exception is raised if an invalid POSIX-style +# time zone string is encountered. +# +# @private +# +# source://tzinfo//lib/tzinfo/data_sources/posix_time_zone_parser.rb#12 +class TZInfo::DataSources::InvalidPosixTimeZone < ::StandardError; end + +# An {InvalidZoneinfoDirectory} exception is raised if {ZoneinfoDataSource} +# is initialized with a specific zoneinfo path that is not a valid zoneinfo +# directory. A valid zoneinfo directory is one that contains time zone +# files, a country code index file named iso3166.tab and a time zone index +# file named zone1970.tab or zone.tab. +# +# source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#11 +class TZInfo::DataSources::InvalidZoneinfoDirectory < ::StandardError; end + +# An {InvalidZoneinfoFile} exception is raised if an attempt is made to load +# an invalid zoneinfo file. +# +# source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#8 +class TZInfo::DataSources::InvalidZoneinfoFile < ::StandardError; end + +# Represents a time zone that is defined as a link to or alias of another +# zone. +# +# source://tzinfo//lib/tzinfo/data_sources/linked_timezone_info.rb#7 +class TZInfo::DataSources::LinkedTimezoneInfo < ::TZInfo::DataSources::TimezoneInfo + # Initializes a new {LinkedTimezoneInfo}. The passed in `identifier` and + # `link_to_identifier` instances will be frozen. + # + # `nil`. + # + # @param identifier [String] the identifier of the time zone. + # @param link_to_identifier [String] the identifier of the time zone that + # this zone link to. + # @raise [ArgumentError] if `identifier` or `link_to_identifier` are + # @return [LinkedTimezoneInfo] a new instance of LinkedTimezoneInfo + # + # source://tzinfo//lib/tzinfo/data_sources/linked_timezone_info.rb#20 + def initialize(identifier, link_to_identifier); end + + # @return [LinkedTimezone] a new {LinkedTimezone} instance for the time + # zone represented by this {LinkedTimezoneInfo}. + # + # source://tzinfo//lib/tzinfo/data_sources/linked_timezone_info.rb#28 + def create_timezone; end + + # (that this zone links to or is an alias for). + # + # @return [String] the identifier of the time zone that provides the data + # + # source://tzinfo//lib/tzinfo/data_sources/linked_timezone_info.rb#10 + def link_to_identifier; end +end + +# A parser for POSIX-style TZ strings used in zoneinfo files and specified +# by tzfile.5 and tzset.3. +# +# @private +# +# source://tzinfo//lib/tzinfo/data_sources/posix_time_zone_parser.rb#20 +class TZInfo::DataSources::PosixTimeZoneParser + # Initializes a new {PosixTimeZoneParser}. + # + # @param string_deduper [StringDeduper] a {StringDeduper} instance to use + # to dedupe abbreviations. + # @return [PosixTimeZoneParser] a new instance of PosixTimeZoneParser + # + # source://tzinfo//lib/tzinfo/data_sources/posix_time_zone_parser.rb#25 + def initialize(string_deduper); end + + # Parses a POSIX-style TZ string. + # + # @param tz_string [String] the string to parse. + # @raise [InvalidPosixTimeZone] if `tz_string` is not a `String`. + # @raise [InvalidPosixTimeZone] if `tz_string` is is not valid. + # @return [Object] either a {TimezoneOffset} for a constantly applied + # offset or an {AnnualRules} instance representing the rules. + # + # source://tzinfo//lib/tzinfo/data_sources/posix_time_zone_parser.rb#36 + def parse(tz_string); end + + private + + # Scans for a pattern and raises an exception if the pattern does not + # match the input. + # + # @param s [StringScanner] the `StringScanner` to scan. + # @param pattern [Regexp] the pattern to match. + # @raise [InvalidPosixTimeZone] if the pattern does not match the input. + # @return [String] the result of the scan. + # + # source://tzinfo//lib/tzinfo/data_sources/posix_time_zone_parser.rb#169 + def check_scan(s, pattern); end + + # Returns an offset in seconds from hh:mm:ss values. The value can be + # negative. -02:33:12 would represent 2 hours, 33 minutes and 12 seconds + # ahead of UTC. + # + # @param h [String] the hours. + # @param m [String] the minutes. + # @param s [String] the seconds. + # @raise [InvalidPosixTimeZone] if the mm and ss values are greater than + # 59. + # @return [Integer] the offset. + # + # source://tzinfo//lib/tzinfo/data_sources/posix_time_zone_parser.rb#132 + def get_offset_from_hms(h, m, s); end + + # Returns the seconds from midnight from hh:mm:ss values. Hours can exceed + # 24 for a time on the following day. Hours can be negative to subtract + # hours from midnight on the given day. -02:33:12 represents 22:33:12 on + # the prior day. + # + # @param h [String] the hour. + # @param m [String] the minutes past the hour. + # @param s [String] the seconds past the minute. + # @raise [InvalidPosixTimeZone] if the mm and ss values are greater than + # 59. + # @return [Integer] the number of seconds after midnight. + # + # source://tzinfo//lib/tzinfo/data_sources/posix_time_zone_parser.rb#153 + def get_seconds_after_midnight_from_hms(h, m, s); end + + # Parses a rule. + # + # @param s [StringScanner] the `StringScanner` to read the rule from. + # @param type [String] the type of rule (either `'start'` or `'end'`). + # @raise [InvalidPosixTimeZone] if the rule is not valid. + # @return [TransitionRule] the parsed rule. + # + # source://tzinfo//lib/tzinfo/data_sources/posix_time_zone_parser.rb#92 + def parse_rule(s, type); end +end + +# A DataSource implementation that loads data from the set of Ruby modules +# included in the tzinfo-data gem. +# +# TZInfo will use {RubyDataSource} by default if the tzinfo-data gem +# is available on the load path. It can also be selected by calling +# {DataSource.set} as follows: +# +# TZInfo::DataSource.set(:ruby) +# +# source://tzinfo//lib/tzinfo/data_sources/ruby_data_source.rb#20 +class TZInfo::DataSources::RubyDataSource < ::TZInfo::DataSource + # Initializes a new {RubyDataSource} instance. + # + # @raise [TZInfoDataNotFound] if the tzinfo-data gem could not be found + # (i.e. `require 'tzinfo/data'` failed). + # @return [RubyDataSource] a new instance of RubyDataSource + # + # source://tzinfo//lib/tzinfo/data_sources/ruby_data_source.rb#34 + def initialize; end + + # Returns a frozen `Array` of all the available ISO 3166-1 alpha-2 country + # codes. The identifiers are sorted according to `String#<=>`. + # + # @return [Array] a frozen `Array` of all the available ISO 3166-1 + # alpha-2 country codes. + # + # source://tzinfo//lib/tzinfo/data_sources/ruby_data_source.rb#28 + def country_codes; end + + # Returns a frozen `Array` of all the available time zone identifiers for + # data time zones (i.e. those that actually contain definitions). The + # identifiers are sorted according to `String#<=>`. + # + # @return [Array] a frozen `Array` of all the available time zone + # identifiers for data time zones. + # + # source://tzinfo//lib/tzinfo/data_sources/ruby_data_source.rb#22 + def data_timezone_identifiers; end + + # @return [String] the internal object state as a programmer-readable + # `String`. + # + # source://tzinfo//lib/tzinfo/data_sources/ruby_data_source.rb#72 + def inspect; end + + # Returns a frozen `Array` of all the available time zone identifiers that + # are links to other time zones. The identifiers are sorted according to + # `String#<=>`. + # + # @return [Array] a frozen `Array` of all the available time zone + # identifiers that are links to other time zones. + # + # source://tzinfo//lib/tzinfo/data_sources/ruby_data_source.rb#25 + def linked_timezone_identifiers; end + + # @return [String] a description of the {DataSource}. + # + # source://tzinfo//lib/tzinfo/data_sources/ruby_data_source.rb#67 + def to_s; end + + protected + + # @param code [String] an ISO 3166-1 alpha-2 country code. + # @raise [InvalidCountryCode] if the country could not be found or the code + # is invalid. + # @return [DataSources::CountryInfo] a {DataSources::CountryInfo} instance + # for the given ISO 3166-1 alpha-2 country code. + # + # source://tzinfo//lib/tzinfo/data_sources/ruby_data_source.rb#104 + def load_country_info(code); end + + # Returns a {TimezoneInfo} instance for the given time zone identifier. + # The result will either be a {ConstantOffsetDataTimezoneInfo}, a + # {TransitionsDataTimezoneInfo} or a {LinkedTimezoneInfo} depending on the + # type of time zone. + # + # @param identifier [String] A time zone identifier. + # @raise [InvalidTimezoneIdentifier] if the time zone is not found or the + # identifier is invalid. + # @return [TimezoneInfo] a {TimezoneInfo} instance for the given time zone + # identifier. + # + # source://tzinfo//lib/tzinfo/data_sources/ruby_data_source.rb#88 + def load_timezone_info(identifier); end + + private + + # Requires a file from tzinfo/data. + # + # @param file [Array] a relative path to a file to be required. + # + # source://tzinfo//lib/tzinfo/data_sources/ruby_data_source.rb#128 + def require_data(*file); end + + # Requires a zone definition by its identifier (split on /). + # + # @param identifier [Array] the component parts of a time zone + # identifier (split on /). This must have already been validated. + # + # source://tzinfo//lib/tzinfo/data_sources/ruby_data_source.rb#114 + def require_definition(identifier); end + + # Requires an index by its name. + # + # @param name [String] an index name. + # + # source://tzinfo//lib/tzinfo/data_sources/ruby_data_source.rb#121 + def require_index(name); end + + # @return [String] a `String` containing TZInfo::Data version infomation + # for inclusion in the #to_s and #inspect output. + # + # source://tzinfo//lib/tzinfo/data_sources/ruby_data_source.rb#134 + def version_info; end +end + +# A {TZInfoDataNotFound} exception is raised if the tzinfo-data gem could +# not be found (i.e. `require 'tzinfo/data'` failed) when selecting the Ruby +# data source. +# +# source://tzinfo//lib/tzinfo/data_sources/ruby_data_source.rb#9 +class TZInfo::DataSources::TZInfoDataNotFound < ::StandardError; end + +# Represents a time zone defined by a data source. +# +# @abstract Data sources return instances of {TimezoneInfo} subclasses. +# +# source://tzinfo//lib/tzinfo/data_sources/timezone_info.rb#9 +class TZInfo::DataSources::TimezoneInfo + # Initializes a new TimezoneInfo. The passed in `identifier` instance will + # be frozen. + # + # @param identifier [String] the identifier of the time zone. + # @raise [ArgumentError] if `identifier` is `nil`. + # @return [TimezoneInfo] a new instance of TimezoneInfo + # + # source://tzinfo//lib/tzinfo/data_sources/timezone_info.rb#18 + def initialize(identifier); end + + # @return [Timezone] a new {Timezone} instance for the time zone + # represented by this {TimezoneInfo}. + # + # source://tzinfo//lib/tzinfo/data_sources/timezone_info.rb#31 + def create_timezone; end + + # @return [String] the identifier of the time zone. + # + # source://tzinfo//lib/tzinfo/data_sources/timezone_info.rb#11 + def identifier; end + + # @return [String] the internal object state as a programmer-readable + # `String`. + # + # source://tzinfo//lib/tzinfo/data_sources/timezone_info.rb#25 + def inspect; end + + private + + # Raises a {NotImplementedError}. + # + # @param method_name [String] the name of the method that must be + # overridden. + # @raise NotImplementedError always. + # + # source://tzinfo//lib/tzinfo/data_sources/timezone_info.rb#42 + def raise_not_implemented(method_name); end +end + +# Represents a data time zone defined by a list of transitions that change +# the locally observed time. +# +# source://tzinfo//lib/tzinfo/data_sources/transitions_data_timezone_info.rb#8 +class TZInfo::DataSources::TransitionsDataTimezoneInfo < ::TZInfo::DataSources::DataTimezoneInfo + # Initializes a new {TransitionsDataTimezoneInfo}. + # + # The passed in `identifier` instance will be frozen. A reference to the + # passed in `Array` will be retained. + # + # The `transitions` `Array` must be sorted in order of ascending + # timestamp. Each transition must have a + # {TimezoneTransition#timestamp_value timestamp_value} that is greater + # than the {TimezoneTransition#timestamp_value timestamp_value} of the + # prior transition. + # + # @param identifier [String] the identifier of the time zone. + # @param transitions [Array] an `Array` of + # transitions that each indicate when a change occurs in the locally + # observed time. + # @raise [ArgumentError] if `identifier` is `nil`. + # @raise [ArgumentError] if `transitions` is `nil`. + # @raise [ArgumentError] if `transitions` is an empty `Array`. + # @return [TransitionsDataTimezoneInfo] a new instance of TransitionsDataTimezoneInfo + # + # source://tzinfo//lib/tzinfo/data_sources/transitions_data_timezone_info.rb#31 + def initialize(identifier, transitions); end + + # @param timestamp [Timestamp] a {Timestamp} with a specified + # {Timestamp#utc_offset utc_offset}. + # @raise [ArgumentError] may be raised if `timestamp` is `nil` or does not + # have a specified {Timestamp#utc_offset utc_offset}. + # @return [TimezonePeriod] the {TimezonePeriod} observed at the time + # specified by `timestamp`. + # + # source://tzinfo//lib/tzinfo/data_sources/transitions_data_timezone_info.rb#39 + def period_for(timestamp); end + + # Returns an `Array` containing the {TimezonePeriod TimezonePeriods} that + # could be observed at the local time specified by `local_timestamp`. The + # results are are ordered by increasing UTC start date. An empty `Array` + # is returned if no periods are found for the given local time. + # + # @param local_timestamp [Timestamp] a {Timestamp} representing a local + # time - must have an unspecified {Timestamp#utc_offset utc_offset}. + # @raise [ArgumentError] may be raised if `local_timestamp` is `nil`, or + # has a specified {Timestamp#utc_offset utc_offset}. + # @return [Array] an `Array` containing the + # {TimezonePeriod TimezonePeriods} that could be observed at the local + # time specified by `local_timestamp`. + # + # source://tzinfo//lib/tzinfo/data_sources/transitions_data_timezone_info.rb#70 + def periods_for_local(local_timestamp); end + + # @return [Array] the transitions that define this + # time zone in order of ascending timestamp. + # + # source://tzinfo//lib/tzinfo/data_sources/transitions_data_timezone_info.rb#11 + def transitions; end + + # Returns an `Array` of {TimezoneTransition} instances representing the + # times where the UTC offset of the time zone changes. + # + # Transitions are returned up to a given {Timestamp} (`to_timestamp`). + # + # A from {Timestamp} may also be supplied using the `from_timestamp` + # parameter. If `from_timestamp` is specified, only transitions from that + # time onwards will be returned. + # + # Comparisons with `to_timestamp` are exclusive. Comparisons with + # `from_timestamp` are inclusive. If a transition falls precisely on + # `to_timestamp`, it will be excluded. If a transition falls on + # `from_timestamp`, it will be included. + # + # Transitions returned are ordered by when they occur, from earliest to + # latest. + # + # @param to_timestamp [Timestamp] a {Timestamp} with a specified + # {Timestamp#utc_offset utc_offset}. Transitions are returned if they + # occur before this time. + # @param from_timestamp [Timestamp] an optional {Timestamp} with a + # specified {Timestamp#utc_offset utc_offset}. If specified, transitions + # are returned if they occur at or after this time. + # @raise [ArgumentError] may be raised if `to_timestamp` is `nil` or does + # not have a specified {Timestamp#utc_offset utc_offset}. + # @raise [ArgumentError] may be raised if `from_timestamp` is specified + # but does not have a specified {Timestamp#utc_offset utc_offset}. + # @raise [ArgumentError] may be raised if `from_timestamp` is specified + # but is not earlier than or at the same time as `to_timestamp`. + # @return [Array] an `Array` of {TimezoneTransition} + # instances representing the times where the UTC offset of the time zone + # changes. + # + # source://tzinfo//lib/tzinfo/data_sources/transitions_data_timezone_info.rb#111 + def transitions_up_to(to_timestamp, from_timestamp = T.unsafe(nil)); end + + private + + # Performs a binary search on {transitions} to find the index of the + # earliest transition satisfying a condition. + # + # :nocov_array_bsearch_index: + # + # @return [Integer] the index of the earliest transition safisfying + # the condition or `nil` if there are no such transitions. + # @yield [transition] the caller will be yielded to to test the search + # condition. + # @yieldparam transition [TimezoneTransition] a {TimezoneTransition} + # instance from {transitions}. + # @yieldreturn [Boolean] `true` for the earliest transition that + # satisfies the condition and return `true` for all subsequent + # transitions. In all other cases, the result of the block must be + # `false`. + # + # source://tzinfo//lib/tzinfo/data_sources/transitions_data_timezone_info.rb#159 + def find_minimum_transition(&block); end + + # Determines if a transition occurs at or after a given {Timestamp}, + # taking the {Timestamp#sub_second sub_second} into consideration. + # + # @param transition [TimezoneTransition] the transition to compare. + # @param timestamp [Timestamp] the timestamp to compare. + # @return [Boolean] `true` if `transition` occurs at or after `timestamp`, + # otherwise `false`. + # + # source://tzinfo//lib/tzinfo/data_sources/transitions_data_timezone_info.rb#207 + def transition_on_or_after_timestamp?(transition, timestamp); end +end + +# A DataSource implementation that loads data from a 'zoneinfo' directory +# containing compiled "TZif" version 3 (or earlier) files in addition to +# iso3166.tab and zone1970.tab or zone.tab index files. +# +# To have TZInfo load the system zoneinfo files, call +# {TZInfo::DataSource.set} as follows: +# +# TZInfo::DataSource.set(:zoneinfo) +# +# To load zoneinfo files from a particular directory, pass the directory to +# {TZInfo::DataSource.set}: +# +# TZInfo::DataSource.set(:zoneinfo, directory) +# +# To load zoneinfo files from a particular directory, but load the +# iso3166.tab index file from a separate location, pass the directory and +# path to the iso3166.tab file to {TZInfo::DataSource.set}: +# +# TZInfo::DataSource.set(:zoneinfo, directory, iso3166_path) +# +# Please note that versions of the 'zic' tool (used to build zoneinfo files) +# that were released prior to February 2006 created zoneinfo files that used +# 32-bit integers for transition timestamps. Later versions of zic produce +# zoneinfo files that use 64-bit integers. If you have 32-bit zoneinfo files +# on your system, then any queries falling outside of the range 1901-12-13 +# 20:45:52 to 2038-01-19 03:14:07 may be inaccurate. +# +# Most modern platforms include 64-bit zoneinfo files. However, Mac OS X (up +# to at least 10.8.4) still uses 32-bit zoneinfo files. +# +# To check whether your zoneinfo files contain 32-bit or 64-bit transition +# data, you can run the following code (substituting the identifier of the +# zone you want to test for `zone_identifier`): +# +# TZInfo::DataSource.set(:zoneinfo) +# dir = TZInfo::DataSource.get.zoneinfo_dir +# File.open(File.join(dir, zone_identifier), 'r') {|f| f.read(5) } +# +# If the last line returns `"TZif\\x00"`, then you have a 32-bit zoneinfo +# file. If it returns `"TZif2"` or `"TZif3"` then you have a 64-bit zoneinfo +# file. +# +# It is also worth noting that as of the 2017c release of the IANA Time Zone +# Database, 64-bit zoneinfo files only include future transitions up to +# 2038-01-19 03:14:07. Any queries falling after this time may be +# inaccurate. +# +# source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#68 +class TZInfo::DataSources::ZoneinfoDataSource < ::TZInfo::DataSource + # Initializes a new {ZoneinfoDataSource}. + # + # If `zoneinfo_dir` is specified, it will be checked and used as the + # source of zoneinfo files. + # + # The directory must contain a file named iso3166.tab and a file named + # either zone1970.tab or zone.tab. These may either be included in the + # root of the directory or in a 'tab' sub-directory and named country.tab + # and zone_sun.tab respectively (as is the case on Solaris). + # + # Additionally, the path to iso3166.tab can be overridden using the + # `alternate_iso3166_tab_path` parameter. + # + # If `zoneinfo_dir` is not specified or `nil`, the paths referenced in + # {search_path} are searched in order to find a valid zoneinfo directory + # (one that contains zone1970.tab or zone.tab and iso3166.tab files as + # above). + # + # The paths referenced in {alternate_iso3166_tab_search_path} are also + # searched to find an iso3166.tab file if one of the searched zoneinfo + # directories doesn't contain an iso3166.tab file. + # + # @param zoneinfo_dir [String] an optional path to a directory to use as + # the source of zoneinfo files. + # @param alternate_iso3166_tab_path [String] an optional path to the + # iso3166.tab file. + # @raise [InvalidZoneinfoDirectory] if the iso3166.tab and zone1970.tab or + # zone.tab files cannot be found using the `zoneinfo_dir` and + # `alternate_iso3166_tab_path` parameters. + # @raise [ZoneinfoDirectoryNotFound] if no valid directory can be found + # by searching. + # @return [ZoneinfoDataSource] a new instance of ZoneinfoDataSource + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#237 + def initialize(zoneinfo_dir = T.unsafe(nil), alternate_iso3166_tab_path = T.unsafe(nil)); end + + # Returns a frozen `Array` of all the available ISO 3166-1 alpha-2 country + # codes. The identifiers are sorted according to `String#<=>`. + # + # @return [Array] a frozen `Array` of all the available ISO 3166-1 + # alpha-2 country codes. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#204 + def country_codes; end + + # Returns a frozen `Array` of all the available time zone identifiers. The + # identifiers are sorted according to `String#<=>`. + # + # @return [Array] a frozen `Array` of all the available time zone + # identifiers. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#271 + def data_timezone_identifiers; end + + # @return [String] the internal object state as a programmer-readable + # `String`. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#290 + def inspect; end + + # Returns an empty `Array`. There is no information about linked/aliased + # time zones in the zoneinfo files. When using {ZoneinfoDataSource}, every + # time zone will be returned as a {DataTimezone}. + # + # @return [Array] an empty `Array`. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#280 + def linked_timezone_identifiers; end + + # @return [String] a description of the {DataSource}. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#285 + def to_s; end + + # @return [String] the zoneinfo directory being used. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#201 + def zoneinfo_dir; end + + protected + + # @param code [String] an ISO 3166-1 alpha-2 country code. + # @raise [InvalidCountryCode] if the country could not be found or the code + # is invalid. + # @return [DataSources::CountryInfo] a {DataSources::CountryInfo} instance + # for the given ISO 3166-1 alpha-2 country code. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#326 + def load_country_info(code); end + + # Returns a {TimezoneInfo} instance for the given time zone identifier. + # The result will either be a {ConstantOffsetDataTimezoneInfo} or a + # {TransitionsDataTimezoneInfo}. + # + # @param identifier [String] A time zone identifier. + # @raise [InvalidTimezoneIdentifier] if the time zone is not found, the + # identifier is invalid, the zoneinfo file cannot be opened or the + # zoneinfo file is not valid. + # @return [TimezoneInfo] a {TimezoneInfo} instance for the given time zone + # identifier. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#306 + def load_timezone_info(identifier); end + + private + + # Converts degrees, minutes and seconds to a Rational. + # + # @param sign [String] `'-'` or `'+'`. + # @param degrees [String] the number of degrees. + # @param minutes [String] the number of minutes. + # @param seconds [String] the number of seconds (optional). + # @return [Rational] the result of converting from degrees, minutes and + # seconds to a `Rational`. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#579 + def dms_to_rational(sign, degrees, minutes, seconds = T.unsafe(nil)); end + + # Recursively enumerate a directory of time zones. + # + # @param dir [Array] the directory to enumerate as an `Array` of + # path components. + # @param exclude [Array] file names to exclude when scanning + # `dir`. + # @yield [path] the path of each time zone file found is passed to + # the block. + # @yieldparam path [Array] the path of a time zone file as an + # `Array` of path components. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#434 + def enum_timezones(dir, exclude = T.unsafe(nil), &block); end + + # Finds a zoneinfo directory using {search_path} and + # {alternate_iso3166_tab_search_path}. + # + # @return [Array] an `Array` containing the iso3166.tab and + # zone.tab paths if a zoneinfo directory was found, otherwise `nil`. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#389 + def find_zoneinfo_dir; end + + # Uses the iso3166.tab and zone1970.tab or zone.tab files to return a Hash + # mapping country codes to CountryInfo instances. + # + # @param iso3166_tab_path [String] the path to the iso3166.tab file. + # @param zone_tab_path [String] the path to the zone.tab file. + # @return [Hash] a mapping from ISO 3166-1 alpha-2 + # country codes to {CountryInfo} instances. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#463 + def load_countries(iso3166_tab_path, zone_tab_path); end + + # Scans @zoneinfo_dir and returns an `Array` of available time zone + # identifiers. The result is sorted according to `String#<=>`. + # + # @return [Array] an `Array` containing all the time zone + # identifiers found. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#414 + def load_timezone_identifiers; end + + # Attempts to resolve the path to a tab file given its standard names and + # tab sub-directory name (as used on Solaris). + # + # @param zoneinfo_path [String] the path to a zoneinfo directory. + # @param standard_names [Array] the standard names for the tab + # file. + # @param tab_name [String] the alternate name for the tab file to check in + # the tab sub-directory. + # @return [String] the path to the tab file. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#372 + def resolve_tab_path(zoneinfo_path, standard_names, tab_name); end + + # Validates a zoneinfo directory and returns the paths to the iso3166.tab + # and zone1970.tab or zone.tab files if valid. If the directory is not + # valid, returns `nil`. + # + # The path to the iso3166.tab file may be overridden by passing in a path. + # This is treated as either absolute or relative to the current working + # directory. + # + # @param path [String] the path to a possible zoneinfo directory. + # @param iso3166_tab_path [String] an optional path to an external + # iso3166.tab file. + # @return [Array] an `Array` containing the iso3166.tab and + # zone.tab paths if the directory is valid, otherwise `nil`. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#345 + def validate_zoneinfo_dir(path, iso3166_tab_path = T.unsafe(nil)); end + + class << self + # An `Array` of paths that will be checked to find an alternate + # iso3166.tab file if one was not included in the zoneinfo directory + # (for example, on FreeBSD and OpenBSD systems). + # + # Paths are checked in the order they appear in the `Array`. + # + # The default value is `['/usr/share/misc/iso3166.tab', + # '/usr/share/misc/iso3166']`. + # + # @return [Array] an `Array` of paths to check in order to + # locate an iso3166.tab file. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#156 + def alternate_iso3166_tab_search_path; end + + # Sets the paths to check to locate an alternate iso3166.tab file if one + # was not included in the zoneinfo directory. + # + # Can be set to an `Array` of paths or a `String` containing paths + # separated with `File::PATH_SEPARATOR`. + # + # Paths are checked in the order they appear in the array. + # + # Set to `nil` to revert to the default paths. + # + # @param alternate_iso3166_tab_search_path [Object] either `nil` or a + # list of paths to check as either an `Array` of `String` or a + # `File::PATH_SEPARATOR` separated `String`. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#173 + def alternate_iso3166_tab_search_path=(alternate_iso3166_tab_search_path); end + + # An `Array` of directories that will be checked to find the system + # zoneinfo directory. + # + # Directories are checked in the order they appear in the `Array`. + # + # The default value is `['/usr/share/zoneinfo', + # '/usr/share/lib/zoneinfo', '/etc/zoneinfo']`. + # + # @return [Array] an `Array` of directories to check in order to + # find the system zoneinfo directory. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#123 + def search_path; end + + # Sets the directories to be checked when locating the system zoneinfo + # directory. + # + # Can be set to an `Array` of directories or a `String` containing + # directories separated with `File::PATH_SEPARATOR`. + # + # Directories are checked in the order they appear in the `Array` or + # `String`. + # + # Set to `nil` to revert to the default paths. + # + # @param search_path [Object] either `nil` or a list of directories to + # check as either an `Array` of `String` or a `File::PATH_SEPARATOR` + # separated `String`. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#141 + def search_path=(search_path); end + + private + + # Processes a path for use as the {search_path} or + # {alternate_iso3166_tab_search_path}. + # + # @param path [Object] either `nil` or a list of paths to check as + # either an `Array` of `String` or a `File::PATH_SEPARATOR` separated + # `String`. + # @param default [Array] the default value. + # @return [Array] the processed path. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#187 + def process_search_path(path, default); end + end +end + +# The default value of {ZoneinfoDataSource.alternate_iso3166_tab_search_path}. +# +# source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#74 +TZInfo::DataSources::ZoneinfoDataSource::DEFAULT_ALTERNATE_ISO3166_TAB_SEARCH_PATH = T.let(T.unsafe(nil), Array) + +# The default value of {ZoneinfoDataSource.search_path}. +# +# source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#70 +TZInfo::DataSources::ZoneinfoDataSource::DEFAULT_SEARCH_PATH = T.let(T.unsafe(nil), Array) + +# Files and directories in the top level zoneinfo directory that will be +# excluded from the list of available time zones: +# +# - +VERSION is included on Mac OS X. +# - leapseconds is a list of leap seconds. +# - localtime is the current local timezone (may be a link). +# - posix, posixrules and right are directories containing other +# versions of the zoneinfo files. +# - SECURITY is included in the Arch Linux tzdata package. +# - src is a directory containing the tzdata source included on Solaris. +# - timeconfig is a symlink included on Slackware. +# +# source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#88 +TZInfo::DataSources::ZoneinfoDataSource::EXCLUDED_FILENAMES = T.let(T.unsafe(nil), Array) + +# A {ZoneinfoDirectoryNotFound} exception is raised if no valid zoneinfo +# directory could be found when checking the paths listed in +# {ZoneinfoDataSource.search_path}. A valid zoneinfo directory is one that +# contains time zone files, a country code index file named iso3166.tab and +# a time zone index file named zone1970.tab or zone.tab. +# +# source://tzinfo//lib/tzinfo/data_sources/zoneinfo_data_source.rb#19 +class TZInfo::DataSources::ZoneinfoDirectoryNotFound < ::StandardError; end + +# Reads compiled zoneinfo TZif (\0, 2 or 3) files. +# +# source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#12 +class TZInfo::DataSources::ZoneinfoReader + # Initializes a new {ZoneinfoReader}. + # + # @param posix_tz_parser [PosixTimeZoneParser] a {PosixTimeZoneParser} + # instance to use to parse POSIX-style TZ strings. + # @param string_deduper [StringDeduper] a {StringDeduper} instance to use + # to dedupe abbreviations. + # @return [ZoneinfoReader] a new instance of ZoneinfoReader + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#25 + def initialize(posix_tz_parser, string_deduper); end + + # Reads a zoneinfo structure from the given path. Returns either a + # {TimezoneOffset} that is constantly observed or an `Array` + # {TimezoneTransition}s. + # + # @param file_path [String] the path of a zoneinfo file. + # @raise [SecurityError] if safe mode is enabled and `file_path` is + # tainted. + # @raise [InvalidZoneinfoFile] if `file_path`` does not refer to a valid + # zoneinfo file. + # @return [Object] either a {TimezoneOffset} or an `Array` of + # {TimezoneTransition}s. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#41 + def read(file_path); end + + private + + # Apply the rules from the TZ string when there were defined + # transitions. Checks for a matching offset with the last transition. + # Redefines the last transition if required and if the rules don't + # specific a constant offset, generates transitions until 100 years into + # the future (at the time of loading zoneinfo_reader.rb). + # + # @param file [IO] the file being processed. + # @param transitions [Array] the defined transitions. + # @param offsets [Array] the offsets used by the defined + # transitions. + # @param rules [Object] a {TimezoneOffset} specifying a constant offset or + # {AnnualRules} instance specfying transitions. + # @raise [InvalidZoneinfoFile] if the first offset does not match the + # rules. + # @raise [InvalidZoneinfoFile] if the previous offset of the first + # generated transition does not match the offset of the last defined + # transition. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#311 + def apply_rules_with_transitions(file, transitions, offsets, rules); end + + # Apply the rules from the TZ string when there were no defined + # transitions. Checks for a matching offset. Returns the rules-based + # constant offset or generates transitions from 1970 until 100 years into + # the future (at the time of loading zoneinfo_reader.rb). + # + # @param file [IO] the file being processed. + # @param first_offset [TimezoneOffset] the first offset included in the + # file that would normally apply without the rules. + # @param rules [Object] a {TimezoneOffset} specifying a constant offset or + # {AnnualRules} instance specfying transitions. + # @raise [InvalidZoneinfoFile] if the first offset does not match the + # rules. + # @return [Object] either a {TimezoneOffset} or an `Array` of + # {TimezoneTransition}s. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#199 + def apply_rules_without_transitions(file, first_offset, rules); end + + # Reads the given number of bytes from the given file and checks that the + # correct number of bytes could be read. + # + # @param file [IO] the file to read from. + # @param bytes [Integer] the number of bytes to read. + # @raise [InvalidZoneinfoFile] if the number of bytes available didn't + # match the number requested. + # @return [String] the bytes that were read. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#76 + def check_read(file, bytes); end + + # Zoneinfo files don't include the offset from standard time (std_offset) + # for DST periods. Derive the base offset (base_utc_offset) where DST is + # observed from either the previous or next non-DST period. + # + # @param transitions [Array] an `Array` of transition hashes. + # @param offsets [Array] an `Array` of offset hashes. + # @return [Integer] the index of the offset to be used prior to the first + # transition. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#94 + def derive_offsets(transitions, offsets); end + + # Finds an offset that is equivalent to the one specified in the given + # `Array`. Matching is performed with {TimezoneOffset#==}. + # + # @param offsets [Array] an `Array` to search. + # @param offset [TimezoneOffset] the offset to search for. + # @return [TimezoneOffset] the matching offset from `offsets` or `nil` + # if not found. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#233 + def find_existing_offset(offsets, offset); end + + # Translates an unsigned 32-bit integer (as returned by unpack) to signed + # 32-bit. + # + # @param long [Integer] an unsigned 32-bit integer. + # @return [Integer] {long} translated to signed 32-bit. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#52 + def make_signed_int32(long); end + + # Translates a pair of unsigned 32-bit integers (as returned by unpack, + # most significant first) to a signed 64-bit integer. + # + # @param high [Integer] the most significant 32-bits. + # @param low [Integer] the least significant 32-bits. + # @return [Integer] {high} and {low} combined and translated to signed + # 64-bit. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#63 + def make_signed_int64(high, low); end + + # Determines if the offset from a transition matches the offset from a + # rule. This is a looser match than equality, not requiring that the + # base_utc_offset and std_offset both match (which have to be derived for + # transitions, but are known for rules. + # + # @param offset [TimezoneOffset] an offset from a transition. + # @param rule_offset [TimezoneOffset] an offset from a rule. + # @return [Boolean] whether the offsets match. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#179 + def offset_matches_rule?(offset, rule_offset); end + + # Parses a zoneinfo file and returns either a {TimezoneOffset} that is + # constantly observed or an `Array` of {TimezoneTransition}s. + # + # @param file [IO] the file to be read. + # @raise [InvalidZoneinfoFile] if the file is not a valid zoneinfo file. + # @return [Object] either a {TimezoneOffset} or an `Array` of + # {TimezoneTransition}s. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#343 + def parse(file); end + + # Returns a new AnnualRules instance with standard and daylight savings + # offsets replaced with equivalents from an array. This reduces the memory + # requirement for loaded time zones by reusing offsets for rule-generated + # transitions. + # + # @param offsets [Array] an `Array` to search for + # equivalent offsets. + # @param annual_rules [AnnualRules] the {AnnualRules} instance to check. + # @return [AnnualRules] either a new {AnnualRules} instance with either + # the {AnnualRules#std_offset std_offset} or {AnnualRules#dst_offset + # dst_offset} replaced, or the original instance if no equivalent for + # either {AnnualRules#std_offset std_offset} or {AnnualRules#dst_offset + # dst_offset} could be found. + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#250 + def replace_with_existing_offsets(offsets, annual_rules); end + + # Validates the offset indicated to be observed by the rules before the + # first generated transition against the offset of the last defined + # transition. + # + # Fix the last defined transition if it differ on just base/std offsets + # (which are derived). Raise an error if the observed UTC offset or + # abbreviations differ. + # + # @param file [IO] the file being processed. + # @param last_defined [TimezoneTransition] the last defined transition in + # the file. + # @param first_rule_offset [TimezoneOffset] the offset the rules indicate + # is observed prior to the first rules generated transition. + # @raise [InvalidZoneinfoFile] if the offset of {last_defined} and + # {first_rule_offset} do not match. + # @return [TimezoneTransition] the last defined transition (either the + # original instance or a replacement). + # + # source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#278 + def validate_and_fix_last_defined_transition_offset(file, last_defined, first_rule_offset); end +end + +# The year to generate transitions up to. +# +# @private +# +# source://tzinfo//lib/tzinfo/data_sources/zoneinfo_reader.rb#16 +TZInfo::DataSources::ZoneinfoReader::GENERATE_UP_TO = T.let(T.unsafe(nil), Integer) + +# Represents time zones that are defined by rules that set out when +# transitions occur. +# +# source://tzinfo//lib/tzinfo/data_timezone.rb#7 +class TZInfo::DataTimezone < ::TZInfo::InfoTimezone + # Returns the canonical {Timezone} instance for this {DataTimezone}. + # + # For a {DataTimezone}, this is always `self`. + # + # @return [Timezone] `self`. + # + # source://tzinfo//lib/tzinfo/data_timezone.rb#40 + def canonical_zone; end + + # Returns the {TimezonePeriod} that is valid at a given time. + # + # Unlike {period_for_local} and {period_for_utc}, the UTC offset of the + # `time` parameter is taken into consideration. + # + # @param time [Object] a `Time`, `DateTime` or {Timestamp}. + # @raise [ArgumentError] if `time` is `nil`. + # @raise [ArgumentError] if `time` is a {Timestamp} with an unspecified + # offset. + # @return [TimezonePeriod] the {TimezonePeriod} that is valid at `time`. + # + # source://tzinfo//lib/tzinfo/data_timezone.rb#9 + def period_for(time); end + + # Returns the set of {TimezonePeriod}s that are valid for the given + # local time as an `Array`. + # + # The UTC offset of the `local_time` parameter is ignored (it is treated as + # a time in the time zone represented by `self`). + # + # This will typically return an `Array` containing a single + # {TimezonePeriod}. More than one {TimezonePeriod} will be returned when the + # local time is ambiguous (for example, when daylight savings time ends). An + # empty `Array` will be returned when the local time is not valid (for + # example, when daylight savings time begins). + # + # To obtain just a single {TimezonePeriod} in all cases, use + # {period_for_local} instead and specify how ambiguities should be resolved. + # + # @param local_time [Object] a `Time`, `DateTime` or {Timestamp}. + # @raise [ArgumentError] if `local_time` is `nil`. + # @return [Array] the set of {TimezonePeriod}s that are + # valid at `local_time`. + # + # source://tzinfo//lib/tzinfo/data_timezone.rb#17 + def periods_for_local(local_time); end + + # Returns an `Array` of {TimezoneTransition} instances representing the + # times where the UTC offset of the timezone changes. + # + # Transitions are returned up to a given time (`to`). + # + # A from time may also be supplied using the `from` parameter. If from is + # not `nil`, only transitions from that time onwards will be returned. + # + # Comparisons with `to` are exclusive. Comparisons with `from` are + # inclusive. If a transition falls precisely on `to`, it will be excluded. + # If a transition falls on `from`, it will be included. + # + # @param to [Object] a `Time`, `DateTime` or {Timestamp} specifying the + # latest (exclusive) transition to return. + # @param from [Object] an optional `Time`, `DateTime` or {Timestamp} + # specifying the earliest (inclusive) transition to return. + # @raise [ArgumentError] if `from` is specified and `to` is not greater than + # `from`. + # @raise [ArgumentError] is raised if `to` is `nil`. + # @raise [ArgumentError] if either `to` or `from` is a {Timestamp} with an + # unspecified offset. + # @return [Array] the transitions that are earlier than + # `to` and, if specified, at or later than `from`. Transitions are ordered + # by when they occur, from earliest to latest. + # + # source://tzinfo//lib/tzinfo/data_timezone.rb#23 + def transitions_up_to(to, from = T.unsafe(nil)); end +end + +# A subclass of `DateTime` used to represent local times. {DateTimeWithOffset} +# holds a reference to the related {TimezoneOffset} and overrides various +# methods to return results appropriate for the {TimezoneOffset}. Certain +# operations will clear the associated {TimezoneOffset} (if the +# {TimezoneOffset} would not necessarily be valid for the result). Once the +# {TimezoneOffset} has been cleared, {DateTimeWithOffset} behaves identically +# to `DateTime`. +# +# Arithmetic performed on {DateTimeWithOffset} instances is _not_ time +# zone-aware. Regardless of whether transitions in the time zone are crossed, +# results of arithmetic operations will always maintain the same offset from +# UTC (`offset`). The associated {TimezoneOffset} will aways be cleared. +# +# source://tzinfo//lib/tzinfo/datetime_with_offset.rb#19 +class TZInfo::DateTimeWithOffset < ::DateTime + include ::TZInfo::WithOffset + + # An overridden version of `DateTime#downto` that clears the associated + # {TimezoneOffset} of the returned or yielded instances. + # + # source://tzinfo//lib/tzinfo/datetime_with_offset.rb#61 + def downto(min); end + + # An overridden version of `DateTime#england` that preserves the associated + # {TimezoneOffset}. + # + # @return [DateTime] + # + # source://tzinfo//lib/tzinfo/datetime_with_offset.rb#75 + def england; end + + # An overridden version of `DateTime#gregorian` that preserves the + # associated {TimezoneOffset}. + # + # @return [DateTime] + # + # source://tzinfo//lib/tzinfo/datetime_with_offset.rb#85 + def gregorian; end + + # An overridden version of `DateTime#italy` that preserves the associated + # {TimezoneOffset}. + # + # @return [DateTime] + # + # source://tzinfo//lib/tzinfo/datetime_with_offset.rb#95 + def italy; end + + # An overridden version of `DateTime#julian` that preserves the associated + # {TimezoneOffset}. + # + # @return [DateTime] + # + # source://tzinfo//lib/tzinfo/datetime_with_offset.rb#105 + def julian; end + + # An overridden version of `DateTime#new_start` that preserves the + # associated {TimezoneOffset}. + # + # @return [DateTime] + # + # source://tzinfo//lib/tzinfo/datetime_with_offset.rb#115 + def new_start(start = T.unsafe(nil)); end + + # Sets the associated {TimezoneOffset}. + # + # @param timezone_offset [TimezoneOffset] a {TimezoneOffset} valid at the + # time and for the offset of this {DateTimeWithOffset}. + # @raise [ArgumentError] if `timezone_offset` is `nil`. + # @raise [ArgumentError] if `timezone_offset.observed_utc_offset` does not + # equal `self.offset * 86400`. + # @return [DateTimeWithOffset] `self`. + # + # source://tzinfo//lib/tzinfo/datetime_with_offset.rb#34 + def set_timezone_offset(timezone_offset); end + + # An overridden version of `DateTime#step` that clears the associated + # {TimezoneOffset} of the returned or yielded instances. + # + # source://tzinfo//lib/tzinfo/datetime_with_offset.rb#121 + def step(limit, step = T.unsafe(nil)); end + + # @return [TimezoneOffset] the {TimezoneOffset} associated with this + # instance. + # + # source://tzinfo//lib/tzinfo/datetime_with_offset.rb#24 + def timezone_offset; end + + # An overridden version of `DateTime#to_time` that, if there is an + # associated {TimezoneOffset}, returns a {DateTimeWithOffset} with that + # offset. + # + # @return [Time] if there is an associated {TimezoneOffset}, a + # {TimeWithOffset} representation of this {DateTimeWithOffset}, otherwise + # a `Time` representation. + # + # source://tzinfo//lib/tzinfo/datetime_with_offset.rb#48 + def to_time; end + + # An overridden version of `DateTime#upto` that clears the associated + # {TimezoneOffset} of the returned or yielded instances. + # + # source://tzinfo//lib/tzinfo/datetime_with_offset.rb#133 + def upto(max); end + + protected + + # Clears the associated {TimezoneOffset}. + # + # @return [DateTimeWithOffset] `self`. + # + # source://tzinfo//lib/tzinfo/datetime_with_offset.rb#148 + def clear_timezone_offset; end +end + +# A rule that transitions on the nth occurrence of a particular day of week +# of a calendar month. +# +# @private +# +# source://tzinfo//lib/tzinfo/transition_rule.rb#339 +class TZInfo::DayOfMonthTransitionRule < ::TZInfo::DayOfWeekTransitionRule + # Initializes a new {DayOfMonthTransitionRule}. + # + # @param transition_at [Integer] the time in seconds after midnight local + # time at which the transition occurs. + # @param week [Integer] the week of the month when the transition occurs (1 + # to 4). + # @param day_of_week [Integer] the day of the week when the transition + # occurs. 0 is Sunday, 6 is Saturday. + # @param month [Integer] the month of the year when the transition occurs. + # @raise [ArgumentError] if `week` is less than 1 or greater than 4. + # @raise [ArgumentError] if `day_of_week` is not an `Integer`. + # @raise [ArgumentError] if `day_of_week` is less than 0 or greater than 6. + # @raise [ArgumentError] if `month` is less than 1 or greater than 12. + # @raise [ArgumentError] if `transition_at` is not an `Integer`. + # @raise [ArgumentError] if `month` is not an `Integer`. + # @raise [ArgumentError] if `week` is not an `Integer`. + # @return [DayOfMonthTransitionRule] a new instance of DayOfMonthTransitionRule + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#340 + def initialize(month, week, day_of_week, transition_at = T.unsafe(nil)); end + + # Determines if this {DayOfMonthTransitionRule} is equal to another + # instance. + # + # @param r [Object] the instance to test for equality. + # @return [Boolean] `true` if `r` is a {DayOfMonthTransitionRule} with the + # same {transition_at}, month, week and day of week as this + # {DayOfMonthTransitionRule}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#353 + def ==(r); end + + # Determines if this {DayOfMonthTransitionRule} is equal to another + # instance. + # + # @param r [Object] the instance to test for equality. + # @return [Boolean] `true` if `r` is a {DayOfMonthTransitionRule} with the + # same {transition_at}, month, week and day of week as this + # {DayOfMonthTransitionRule}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#353 + def eql?(r); end + + protected + + # Returns a `Time` representing midnight local time on the day specified by + # the rule for the given offset and year. + # + # @param offset [TimezoneOffset] the current offset at the time of the + # transition. + # @param year [Integer] the year in which the transition occurs. + # @return [Time] midnight local time on the day specified by the rule for + # the given offset and year. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#372 + def get_day(offset, year); end + + # @return [Array] an `Array` of parameters that will influence the output of + # {hash}. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#386 + def hash_args; end + + # @return [Integer] the day the week starts on for a month starting on a + # Sunday. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#362 + def offset_start; end +end + +# A base class for rules that transition on a particular day of week of a +# given week (subclasses specify which week of the month). +# +# @abstract +# @private +# +# source://tzinfo//lib/tzinfo/transition_rule.rb#273 +class TZInfo::DayOfWeekTransitionRule < ::TZInfo::TransitionRule + # Initializes a new {DayOfWeekTransitionRule}. + # + # @param transition_at [Integer] the time in seconds after midnight local + # time at which the transition occurs. + # @param day_of_week [Integer] the day of the week when the transition + # occurs. 0 is Sunday, 6 is Saturday. + # @param month [Integer] the month of the year when the transition occurs. + # @raise [ArgumentError] if `day_of_week` is not an `Integer`. + # @raise [ArgumentError] if `day_of_week` is less than 0 or greater than 6. + # @raise [ArgumentError] if `month` is not an `Integer`. + # @raise [ArgumentError] if `transition_at` is not an `Integer`. + # @raise [ArgumentError] if `month` is less than 1 or greater than 12. + # @return [DayOfWeekTransitionRule] a new instance of DayOfWeekTransitionRule + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#274 + def initialize(month, day_of_week, transition_at); end + + # Determines if this {DayOfWeekTransitionRule} is equal to another + # instance. + # + # @param r [Object] the instance to test for equality. + # @return [Boolean] `true` if `r` is a {DayOfWeekTransitionRule} with the + # same {transition_at}, month and day of week as this + # {DayOfWeekTransitionRule}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#299 + def ==(r); end + + # Determines if this {DayOfWeekTransitionRule} is equal to another + # instance. + # + # @param r [Object] the instance to test for equality. + # @return [Boolean] `true` if `r` is a {DayOfWeekTransitionRule} with the + # same {transition_at}, month and day of week as this + # {DayOfWeekTransitionRule}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#299 + def eql?(r); end + + # @return [Boolean] `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#283 + def is_always_first_day_of_year?; end + + # @return [Boolean] `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#288 + def is_always_last_day_of_year?; end + + protected + + # @return [Integer] the day of the week (0 to 6 for Sunday to Monday). + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#310 + def day_of_week; end + + # @return [Array] an `Array` of parameters that will influence the output of + # {hash}. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#313 + def hash_args; end + + # @return [Integer] the month of the year (1 to 12). + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#307 + def month; end +end + +# A base class for transition rules that activate based on an integer day of +# the year. +# +# @abstract +# @private +# +# source://tzinfo//lib/tzinfo/transition_rule.rb#81 +class TZInfo::DayOfYearTransitionRule < ::TZInfo::TransitionRule + # Initializes a new {DayOfYearTransitionRule}. + # + # @param day [Integer] the day of the year on which the transition occurs. + # The precise meaning is defined by subclasses. + # @param transition_at [Integer] the time in seconds after midnight local + # time at which the transition occurs. + # @raise [ArgumentError] if `transition_at` is not an `Integer`. + # @raise [ArgumentError] if `day` is not an `Integer`. + # @return [DayOfYearTransitionRule] a new instance of DayOfYearTransitionRule + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#82 + def initialize(day, transition_at); end + + # Determines if this {DayOfYearTransitionRule} is equal to another instance. + # + # @param r [Object] the instance to test for equality. + # @return [Boolean] `true` if `r` is a {DayOfYearTransitionRule} with the + # same {transition_at} and day as this {DayOfYearTransitionRule}, + # otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#94 + def ==(r); end + + # Determines if this {DayOfYearTransitionRule} is equal to another instance. + # + # @param r [Object] the instance to test for equality. + # @return [Boolean] `true` if `r` is a {DayOfYearTransitionRule} with the + # same {transition_at} and day as this {DayOfYearTransitionRule}, + # otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#94 + def eql?(r); end + + protected + + # @return [Array] an `Array` of parameters that will influence the output of + # {hash}. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#105 + def hash_args; end + + # @return [Integer] the day multipled by the number of seconds in a day. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#102 + def seconds; end +end + +# Modules and classes used by the format 1 version of TZInfo::Data. +# +# @private +# +# source://tzinfo//lib/tzinfo/format1.rb#7 +module TZInfo::Format1; end + +# Instances of {Format1::CountryDefiner} are yielded to the format 1 version +# of `TZInfo::Data::Indexes::Countries` by {CountryIndexDefinition} to allow +# the zones of a country to be specified. +# +# @private +# +# source://tzinfo//lib/tzinfo/format1/country_definer.rb#11 +class TZInfo::Format1::CountryDefiner < ::TZInfo::Format2::CountryDefiner + # Initializes a new {CountryDefiner}. + # + # @return [CountryDefiner] a new instance of CountryDefiner + # + # source://tzinfo//lib/tzinfo/format1/country_definer.rb#12 + def initialize(identifier_deduper, description_deduper); end +end + +# The format 1 TZInfo::Data country index file includes +# {Format1::CountryIndexDefinition}, which provides a +# {CountryIndexDefinition::ClassMethods#country country} method used to +# define each country in the index. +# +# @private +# +# source://tzinfo//lib/tzinfo/format1/country_index_definition.rb#11 +module TZInfo::Format1::CountryIndexDefinition + mixes_in_class_methods ::TZInfo::Format1::CountryIndexDefinition::ClassMethods + + class << self + # Adds class methods to the includee and initializes class instance + # variables. + # + # @param base [Module] the includee. + # + # source://tzinfo//lib/tzinfo/format1/country_index_definition.rb#16 + def append_features(base); end + end +end + +# Class methods for inclusion. +# +# @private +# +# source://tzinfo//lib/tzinfo/format1/country_index_definition.rb#25 +module TZInfo::Format1::CountryIndexDefinition::ClassMethods + # @return [Hash] a frozen `Hash` + # of all the countries that have been defined in the index keyed by + # their codes. + # + # source://tzinfo//lib/tzinfo/format1/country_index_definition.rb#29 + def countries; end + + private + + # Defines a country with an ISO 3166-1 alpha-2 country code and name. + # + # @param code [String] the ISO 3166-1 alpha-2 country code. + # @param name [String] the name of the country. + # @yield [definer] (optional) to obtain the time zones for the country. + # @yieldparam definer [CountryDefiner] a {CountryDefiner} instance. + # + # source://tzinfo//lib/tzinfo/format1/country_index_definition.rb#42 + def country(code, name); end +end + +# Instances of {Format1::TimezoneDefiner} are yielded to TZInfo::Data +# format 1 modules by {TimezoneDefinition} to allow the offsets and +# transitions of the time zone to be specified. +# +# @private +# +# source://tzinfo//lib/tzinfo/format1/timezone_definer.rb#11 +class TZInfo::Format1::TimezoneDefiner < ::TZInfo::Format2::TimezoneDefiner + # Defines an offset. + # + # @param id [Symbol] an arbitrary value used identify the offset in + # subsequent calls to transition. It must be unique. + # @param utc_offset [Integer] the base offset from UTC of the zone in + # seconds. This does not include daylight savings time. + # @param std_offset [Integer] the daylight savings offset from the base + # offset in seconds. Typically either 0 or 3600. + # @param abbreviation [Symbol] an abbreviation for the offset, for + # example, `:EST` or `:EDT`. + # @raise [ArgumentError] if another offset has already been defined with + # the given id. + # + # source://tzinfo//lib/tzinfo/format1/timezone_definer.rb#26 + def offset(id, utc_offset, std_offset, abbreviation); end + + # Defines a transition to a given offset. + # + # Transitions must be defined in increasing time order. + # + # @param year [Integer] the UTC year in which the transition occurs. Used + # in earlier versions of TZInfo, but now ignored. + # @param month [Integer] the UTC month in which the transition occurs. + # Used in earlier versions of TZInfo, but now ignored. + # @param offset_id [Symbol] references the id of a previously defined + # offset (see #offset). + # @param timestamp_value [Integer] the time the transition occurs as an + # Integer number of seconds since 1970-01-01 00:00:00 UTC ignoring leap + # seconds (i.e. each day is treated as if it were 86,400 seconds long). + # @param datetime_numerator [Integer] the time of the transition as the + # numerator of the `Rational` returned by `DateTime#ajd`. Used in + # earlier versions of TZInfo, but now ignored. + # @param datetime_denominator [Integer] the time of the transition as the + # denominator of the `Rational` returned by `DateTime#ajd`. Used in + # earlier versions of TZInfo, but now ignored. + # @raise [ArgumentError] if `offset_id` does not reference a defined + # offset. + # @raise [ArgumentError] if `timestamp_value` is not greater than the + # `timestamp_value` of the previously defined transition. + # @raise [ArgumentError] if `datetime_numerator` is specified, but + # `datetime_denominator` is not. In older versions of TZInfo, it was + # possible to define a transition with the `DateTime` numerator as the + # 4th parameter and the denominator as the 5th parameter. This style of + # definition is not used in released versions of TZInfo::Data. + # + # source://tzinfo//lib/tzinfo/format1/timezone_definer.rb#58 + def transition(year, month, offset_id, timestamp_value, datetime_numerator = T.unsafe(nil), datetime_denominator = T.unsafe(nil)); end +end + +# {Format1::TimezoneDefinition} is included into format 1 time zone +# definition modules and provides the methods for defining time zones. +# +# @private +# +# source://tzinfo//lib/tzinfo/format1/timezone_definition.rb#9 +module TZInfo::Format1::TimezoneDefinition + mixes_in_class_methods ::TZInfo::Format2::TimezoneDefinition::ClassMethods + mixes_in_class_methods ::TZInfo::Format1::TimezoneDefinition::ClassMethods + + class << self + # Adds class methods to the includee. + # + # @param base [Module] the includee. + # + # source://tzinfo//lib/tzinfo/format1/timezone_definition.rb#13 + def append_features(base); end + end +end + +# Class methods for inclusion. +# +# @private +# +# source://tzinfo//lib/tzinfo/format1/timezone_definition.rb#22 +module TZInfo::Format1::TimezoneDefinition::ClassMethods + private + + # {Format2::TimezoneDefinition::ClassMethods#timezone}. + # + # @return the class to be instantiated and yielded by + # + # source://tzinfo//lib/tzinfo/format1/timezone_definition.rb#27 + def timezone_definer_class; end +end + +# The format 1 TZInfo::Data time zone index file includes +# {Format1::TimezoneIndexDefinition}, which provides methods used to define +# time zones in the index. +# +# @private +# +# source://tzinfo//lib/tzinfo/format1/timezone_index_definition.rb#10 +module TZInfo::Format1::TimezoneIndexDefinition + mixes_in_class_methods ::TZInfo::Format1::TimezoneIndexDefinition::ClassMethods + + class << self + # Adds class methods to the includee and initializes class instance + # variables. + # + # @param base [Module] the includee. + # + # source://tzinfo//lib/tzinfo/format1/timezone_index_definition.rb#15 + def append_features(base); end + end +end + +# Class methods for inclusion. +# +# @private +# +# source://tzinfo//lib/tzinfo/format1/timezone_index_definition.rb#28 +module TZInfo::Format1::TimezoneIndexDefinition::ClassMethods + # @return [Array] a frozen `Array` containing the identifiers of + # all data time zones. Identifiers are sorted according to + # `String#<=>`. + # + # source://tzinfo//lib/tzinfo/format1/timezone_index_definition.rb#32 + def data_timezones; end + + # @return [Array] a frozen `Array` containing the identifiers of + # all linked time zones. Identifiers are sorted according to + # `String#<=>`. + # + # source://tzinfo//lib/tzinfo/format1/timezone_index_definition.rb#42 + def linked_timezones; end + + private + + # Adds a linked time zone to the index. + # + # @param identifier [String] the time zone identifier. + # + # source://tzinfo//lib/tzinfo/format1/timezone_index_definition.rb#63 + def linked_timezone(identifier); end + + # Adds a data time zone to the index. + # + # @param identifier [String] the time zone identifier. + # + # source://tzinfo//lib/tzinfo/format1/timezone_index_definition.rb#54 + def timezone(identifier); end +end + +# Modules and classes used by the format 2 version of TZInfo::Data. +# +# @private +# +# source://tzinfo//lib/tzinfo/format2.rb#7 +module TZInfo::Format2; end + +# Instances of {Format2::CountryDefiner} are yielded to the format 2 version +# of `TZInfo::Data::Indexes::Countries` by {CountryIndexDefiner} to allow +# the zones of a country to be specified. +# +# @private +# +# source://tzinfo//lib/tzinfo/format2/country_definer.rb#11 +class TZInfo::Format2::CountryDefiner + # Initializes a new {CountryDefiner}. + # + # @param shared_timezones [Hash] a `Hash` + # containing time zones shared by more than one country, keyed by a + # unique reference. + # @param identifier_deduper [StringDeduper] a {StringDeduper} instance to + # use when deduping time zone identifiers. + # @param description_deduper [StringDeduper] a {StringDeduper} instance to + # use when deduping time zone descriptions. + # @return [CountryDefiner] a new instance of CountryDefiner + # + # source://tzinfo//lib/tzinfo/format2/country_definer.rb#24 + def initialize(shared_timezones, identifier_deduper, description_deduper); end + + # @overload timezone + # @overload timezone + # + # source://tzinfo//lib/tzinfo/format2/country_definer.rb#46 + def timezone(identifier_or_reference, latitude_numerator = T.unsafe(nil), latitude_denominator = T.unsafe(nil), longitude_numerator = T.unsafe(nil), longitude_denominator = T.unsafe(nil), description = T.unsafe(nil)); end + + # @return [Array] the time zones observed in the country. + # + # source://tzinfo//lib/tzinfo/format2/country_definer.rb#13 + def timezones; end +end + +# Instances of {Format2::CountryIndexDefiner} are yielded to the format 2 +# version of `TZInfo::Data::Indexes::Countries` by {CountryIndexDefinition} +# to allow countries and their time zones to be specified. +# +# @private +# +# source://tzinfo//lib/tzinfo/format2/country_index_definer.rb#10 +class TZInfo::Format2::CountryIndexDefiner + # Initializes a new {CountryIndexDefiner}. + # + # @param identifier_deduper [StringDeduper] a {StringDeduper} instance to + # use when deduping time zone identifiers. + # @param description_deduper [StringDeduper] a {StringDeduper} instance to + # use when deduping time zone descriptions. + # @return [CountryIndexDefiner] a new instance of CountryIndexDefiner + # + # source://tzinfo//lib/tzinfo/format2/country_index_definer.rb#21 + def initialize(identifier_deduper, description_deduper); end + + # @return [Hash] a `Hash` of all the countries that + # have been defined in the index keyed by their codes. + # + # source://tzinfo//lib/tzinfo/format2/country_index_definer.rb#13 + def countries; end + + # Defines a country. + # + # @param code [String] The ISO 3166-1 alpha-2 code of the country. + # @param name [String] Then name of the country. + # @yield [definer] yields (optional) to obtain the time zones for the + # country. + # @yieldparam definer [CountryDefiner] a {CountryDefiner} + # instance that should be used to specify the time zones of the country. + # + # source://tzinfo//lib/tzinfo/format2/country_index_definer.rb#56 + def country(code, name); end + + # Defines a time zone shared by many countries with an reference for + # subsequent use in country definitions. The latitude and longitude are + # given as the numerator and denominator of a `Rational`. + # + # @param reference [Symbol] a unique reference for the time zone. + # @param identifier [String] the time zone identifier. + # @param latitude_numerator [Integer] the numerator of the latitude. + # @param latitude_denominator [Integer] the denominator of the latitude. + # @param longitude_numerator [Integer] the numerator of the longitude. + # @param longitude_denominator [Integer] the denominator of the longitude. + # @param description [String] an optional description for the time zone. + # + # source://tzinfo//lib/tzinfo/format2/country_index_definer.rb#39 + def timezone(reference, identifier, latitude_numerator, latitude_denominator, longitude_numerator, longitude_denominator, description = T.unsafe(nil)); end +end + +# The format 2 country index file includes +# {Format2::CountryIndexDefinition}, which provides a +# {CountryIndexDefinition::ClassMethods#country_index country_index} method +# used to define the country index. +# +# @private +# +# source://tzinfo//lib/tzinfo/format2/country_index_definition.rb#11 +module TZInfo::Format2::CountryIndexDefinition + mixes_in_class_methods ::TZInfo::Format2::CountryIndexDefinition::ClassMethods + + class << self + # Adds class methods to the includee and initializes class instance + # variables. + # + # @param base [Module] the includee. + # + # source://tzinfo//lib/tzinfo/format2/country_index_definition.rb#16 + def append_features(base); end + end +end + +# Class methods for inclusion. +# +# @private +# +# source://tzinfo//lib/tzinfo/format2/country_index_definition.rb#25 +module TZInfo::Format2::CountryIndexDefinition::ClassMethods + # @return [Hash] a frozen `Hash` + # of all the countries that have been defined in the index keyed by + # their codes. + # + # source://tzinfo//lib/tzinfo/format2/country_index_definition.rb#29 + def countries; end + + private + + # Defines the index. + # + # @yield [definer] yields to allow the index to be defined. + # @yieldparam definer [CountryIndexDefiner] a {CountryIndexDefiner} + # instance that should be used to define the index. + # + # source://tzinfo//lib/tzinfo/format2/country_index_definition.rb#38 + def country_index; end +end + +# Instances of {TimezoneDefiner} are yielded to TZInfo::Data modules by +# {TimezoneDefinition} to allow the offsets and transitions of the time zone +# to be specified. +# +# @private +# +# source://tzinfo//lib/tzinfo/format2/timezone_definer.rb#11 +class TZInfo::Format2::TimezoneDefiner + # Initializes a new TimezoneDefiner. + # + # @param string_deduper [StringDeduper] a {StringDeduper} instance to use + # when deduping abbreviations. + # @return [TimezoneDefiner] a new instance of TimezoneDefiner + # + # source://tzinfo//lib/tzinfo/format2/timezone_definer.rb#20 + def initialize(string_deduper); end + + # Returns the first offset to be defined or `nil` if no offsets have been + # defined. The first offset is observed before the time of the first + # transition. + # + # @return [TimezoneOffset] the first offset to be defined or `nil` if no + # offsets have been defined. + # + # source://tzinfo//lib/tzinfo/format2/timezone_definer.rb#32 + def first_offset; end + + # Defines an offset. + # + # @param id [Symbol] an arbitrary value used identify the offset in + # subsequent calls to transition. It must be unique. + # @param base_utc_offset [Integer] the base offset from UTC of the zone in + # seconds. This does not include daylight savings time. + # @param std_offset [Integer] the daylight savings offset from the base + # offset in seconds. Typically either 0 or 3600. + # @param abbreviation [String] an abbreviation for the offset, for + # example, EST or EDT. + # @raise [ArgumentError] if another offset has already been defined with + # the given id. + # + # source://tzinfo//lib/tzinfo/format2/timezone_definer.rb#49 + def offset(id, base_utc_offset, std_offset, abbreviation); end + + # Defines the rules that will be used for handling instants after the last + # transition. + # + # This method is currently just a placeholder for forward compatibility + # that accepts and ignores any arguments passed. + # + # Support for subsequent rules will be added in a future version of TZInfo + # and the rules will be included in format 2 releases of TZInfo::Data. + # + # source://tzinfo//lib/tzinfo/format2/timezone_definer.rb#90 + def subsequent_rules(*args); end + + # Defines a transition to a given offset. + # + # Transitions must be defined in increasing time order. + # + # @param offset_id [Symbol] references the id of a previously defined + # offset. + # @param timestamp_value [Integer] the time the transition occurs as a + # number of seconds since 1970-01-01 00:00:00 UTC ignoring leap seconds + # (i.e. each day is treated as if it were 86,400 seconds long). + # @raise [ArgumentError] if `offset_id` does not reference a defined + # offset. + # @raise [ArgumentError] if `timestamp_value` is not greater than the + # `timestamp_value` of the previously defined transition. + # + # source://tzinfo//lib/tzinfo/format2/timezone_definer.rb#74 + def transition(offset_id, timestamp_value); end + + # @return [Array] the defined transitions of the time + # zone. + # + # source://tzinfo//lib/tzinfo/format2/timezone_definer.rb#14 + def transitions; end +end + +# {Format2::TimezoneDefinition} is included into format 2 time zone +# definition modules and provides methods for defining time zones. +# +# @private +# +# source://tzinfo//lib/tzinfo/format2/timezone_definition.rb#9 +module TZInfo::Format2::TimezoneDefinition + mixes_in_class_methods ::TZInfo::Format2::TimezoneDefinition::ClassMethods + + class << self + # Adds class methods to the includee. + # + # @param base [Module] the includee. + # + # source://tzinfo//lib/tzinfo/format2/timezone_definition.rb#13 + def append_features(base); end + end +end + +# Class methods for inclusion. +# +# @private +# +# source://tzinfo//lib/tzinfo/format2/timezone_definition.rb#21 +module TZInfo::Format2::TimezoneDefinition::ClassMethods + # @return [TimezoneInfo] the last time zone to be defined. + # + # source://tzinfo//lib/tzinfo/format2/timezone_definition.rb#23 + def get; end + + private + + # Defines a linked time zone. + # + # @param identifier [String] the identifier of the time zone being + # defined. + # @param link_to_identifier [String] the identifier the new time zone + # links to (is an alias for). + # + # source://tzinfo//lib/tzinfo/format2/timezone_definition.rb#64 + def linked_timezone(identifier, link_to_identifier); end + + # Defines a data time zone. + # + # @param identifier [String] the identifier of the time zone. + # @yield [definer] yields to the caller to define the time zone. + # @yieldparam definer [Object] an instance of the class returned by + # {#timezone_definer_class}, typically {TimezoneDefiner}. + # + # source://tzinfo//lib/tzinfo/format2/timezone_definition.rb#41 + def timezone(identifier); end + + # @return [Class] the class to be instantiated and yielded by + # {#timezone}. + # + # source://tzinfo//lib/tzinfo/format2/timezone_definition.rb#31 + def timezone_definer_class; end +end + +# Instances of {TimezoneIndexDefiner} are yielded by +# {TimezoneIndexDefinition} to allow the time zone index to be defined. +# +# @private +# +# source://tzinfo//lib/tzinfo/format2/timezone_index_definer.rb#9 +class TZInfo::Format2::TimezoneIndexDefiner + # Initializes a new TimezoneDefiner. + # + # @param string_deduper [StringDeduper] a {StringDeduper} instance to use + # when deduping identifiers. + # @return [TimezoneIndexDefiner] a new instance of TimezoneIndexDefiner + # + # source://tzinfo//lib/tzinfo/format2/timezone_index_definer.rb#20 + def initialize(string_deduper); end + + # Adds a data time zone to the index. + # + # @param identifier [String] the time zone identifier. + # + # source://tzinfo//lib/tzinfo/format2/timezone_index_definer.rb#29 + def data_timezone(identifier); end + + # @return [Array] the identifiers of all data time zones. + # + # source://tzinfo//lib/tzinfo/format2/timezone_index_definer.rb#11 + def data_timezones; end + + # Adds a linked time zone to the index. + # + # @param identifier [String] the time zone identifier. + # + # source://tzinfo//lib/tzinfo/format2/timezone_index_definer.rb#38 + def linked_timezone(identifier); end + + # @return [Array] the identifiers of all linked time zones. + # + # source://tzinfo//lib/tzinfo/format2/timezone_index_definer.rb#14 + def linked_timezones; end +end + +# The format 2 time zone index file includes {TimezoneIndexDefinition}, +# which provides the {TimezoneIndexDefinition::ClassMethods#timezone_index +# timezone_index} method used to define the index. +# +# @private +# +# source://tzinfo//lib/tzinfo/format2/timezone_index_definition.rb#10 +module TZInfo::Format2::TimezoneIndexDefinition + mixes_in_class_methods ::TZInfo::Format2::TimezoneIndexDefinition::ClassMethods + + class << self + # Adds class methods to the includee and initializes class instance + # variables. + # + # @param base [Module] the includee. + # + # source://tzinfo//lib/tzinfo/format2/timezone_index_definition.rb#15 + def append_features(base); end + end +end + +# Class methods for inclusion. +# +# @private +# +# source://tzinfo//lib/tzinfo/format2/timezone_index_definition.rb#29 +module TZInfo::Format2::TimezoneIndexDefinition::ClassMethods + # @return [Array] a frozen `Array` containing the identifiers of + # all data time zones. Identifiers are sorted according to + # `String#<=>`. + # + # source://tzinfo//lib/tzinfo/format2/timezone_index_definition.rb#33 + def data_timezones; end + + # @return [Array] a frozen `Array` containing the identifiers of + # all linked time zones. Identifiers are sorted according to + # `String#<=>`. + # + # source://tzinfo//lib/tzinfo/format2/timezone_index_definition.rb#38 + def linked_timezones; end + + # Defines the index. + # + # @yield [definer] yields to the caller to allow the index to be + # defined. + # @yieldparam definer [TimezoneIndexDefiner] a {TimezoneIndexDefiner} + # instance that should be used to define the index. + # + # source://tzinfo//lib/tzinfo/format2/timezone_index_definition.rb#46 + def timezone_index; end +end + +# A {Timezone} based on a {DataSources::TimezoneInfo}. +# +# @abstract +# +# source://tzinfo//lib/tzinfo/info_timezone.rb#8 +class TZInfo::InfoTimezone < ::TZInfo::Timezone + # Initializes a new {InfoTimezone}. + # + # {InfoTimezone} instances should not normally be created directly. Use + # the {Timezone.get} method to obtain {Timezone} instances. + # + # @param info [DataSources::TimezoneInfo] a {DataSources::TimezoneInfo} + # instance supplied by a {DataSource} that will be used as the source of + # data for this {InfoTimezone}. + # @return [InfoTimezone] a new instance of InfoTimezone + # + # source://tzinfo//lib/tzinfo/info_timezone.rb#17 + def initialize(info); end + + # @return [String] the identifier of the time zone, for example, + # `"Europe/Paris"`. + # + # source://tzinfo//lib/tzinfo/info_timezone.rb#23 + def identifier; end + + protected + + # @return [DataSources::TimezoneInfo] the {DataSources::TimezoneInfo} this + # {InfoTimezone} is based on. + # + # source://tzinfo//lib/tzinfo/info_timezone.rb#31 + def info; end +end + +# {InvalidCountryCode} is raised by {Country#get} if the code given is not a +# valid ISO 3166-1 alpha-2 code. +# +# source://tzinfo//lib/tzinfo/country.rb#7 +class TZInfo::InvalidCountryCode < ::StandardError; end + +# {InvalidDataSource} is raised if the selected {DataSource} doesn't implement +# one of the required methods. +# +# source://tzinfo//lib/tzinfo/data_source.rb#10 +class TZInfo::InvalidDataSource < ::StandardError; end + +# {InvalidTimezoneIdentifier} is raised by {Timezone.get} if the identifier +# given is not valid. +# +# source://tzinfo//lib/tzinfo/timezone.rb#26 +class TZInfo::InvalidTimezoneIdentifier < ::StandardError; end + +# Defines transitions that occur on the one-based nth Julian day of the year. +# +# Leap days are not counted. Day 1 is 1 January. Day 60 is always 1 March. +# Day 365 is always 31 December. +# +# @private +# +# source://tzinfo//lib/tzinfo/transition_rule.rb#185 +class TZInfo::JulianDayOfYearTransitionRule < ::TZInfo::DayOfYearTransitionRule + # Initializes a new {JulianDayOfYearTransitionRule}. + # + # @param day [Integer] the one-based Julian day of the year on which the + # transition occurs (1 to 365 inclusive). + # @param transition_at [Integer] the time in seconds after midnight local + # time at which the transition occurs. + # @raise [ArgumentError] if `transition_at` is not an `Integer`. + # @raise [ArgumentError] if `day` is not an `Integer`. + # @raise [ArgumentError] if `day` is less than 1 or greater than 365. + # @return [JulianDayOfYearTransitionRule] a new instance of JulianDayOfYearTransitionRule + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#202 + def initialize(day, transition_at = T.unsafe(nil)); end + + # Determines if this {JulianDayOfYearTransitionRule} is equal to another + # instance. + # + # @param r [Object] the instance to test for equality. + # @return [Boolean] `true` if `r` is a {JulianDayOfYearTransitionRule} with + # the same {transition_at} and day as this + # {JulianDayOfYearTransitionRule}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#226 + def ==(r); end + + # Determines if this {JulianDayOfYearTransitionRule} is equal to another + # instance. + # + # @param r [Object] the instance to test for equality. + # @return [Boolean] `true` if `r` is a {JulianDayOfYearTransitionRule} with + # the same {transition_at} and day as this + # {JulianDayOfYearTransitionRule}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#226 + def eql?(r); end + + # @return [Boolean] `true` if the day specified by this transition is the + # first in the year (a day number of 1), otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#209 + def is_always_first_day_of_year?; end + + # @return [Boolean] `true` if the day specified by this transition is the + # last in the year (a day number of 365), otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#215 + def is_always_last_day_of_year?; end + + protected + + # Returns a `Time` representing midnight local time on the day specified by + # the rule for the given offset and year. + # + # @param offset [TimezoneOffset] the current offset at the time of the + # transition. + # @param year [Integer] the year in which the transition occurs. + # @return [Time] midnight local time on the day specified by the rule for + # the given offset and year. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#241 + def get_day(offset, year); end + + # @return [Array] an `Array` of parameters that will influence the output of + # {hash}. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#250 + def hash_args; end +end + +# The 60 days in seconds. +# +# source://tzinfo//lib/tzinfo/transition_rule.rb#186 +TZInfo::JulianDayOfYearTransitionRule::LEAP = T.let(T.unsafe(nil), Integer) + +# The length of a non-leap year in seconds. +# +# source://tzinfo//lib/tzinfo/transition_rule.rb#190 +TZInfo::JulianDayOfYearTransitionRule::YEAR = T.let(T.unsafe(nil), Integer) + +# A rule that transitions on the last occurrence of a particular day of week +# of a calendar month. +# +# @private +# +# source://tzinfo//lib/tzinfo/transition_rule.rb#408 +class TZInfo::LastDayOfMonthTransitionRule < ::TZInfo::DayOfWeekTransitionRule + # Initializes a new {LastDayOfMonthTransitionRule}. + # + # @param transition_at [Integer] the time in seconds after midnight local + # time at which the transition occurs. + # @param day_of_week [Integer] the day of the week when the transition + # occurs. 0 is Sunday, 6 is Saturday. + # @param month [Integer] the month of the year when the transition occurs. + # @raise [ArgumentError] if `day_of_week` is not an `Integer`. + # @raise [ArgumentError] if `day_of_week` is less than 0 or greater than 6. + # @raise [ArgumentError] if `month` is not an `Integer`. + # @raise [ArgumentError] if `transition_at` is not an `Integer`. + # @raise [ArgumentError] if `month` is less than 1 or greater than 12. + # @return [LastDayOfMonthTransitionRule] a new instance of LastDayOfMonthTransitionRule + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#409 + def initialize(month, day_of_week, transition_at = T.unsafe(nil)); end + + # Determines if this {LastDayOfMonthTransitionRule} is equal to another + # instance. + # + # @param r [Object] the instance to test for equality. + # @return [Boolean] `true` if `r` is a {LastDayOfMonthTransitionRule} with + # the same {transition_at}, month and day of week as this + # {LastDayOfMonthTransitionRule}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#420 + def ==(r); end + + # Determines if this {LastDayOfMonthTransitionRule} is equal to another + # instance. + # + # @param r [Object] the instance to test for equality. + # @return [Boolean] `true` if `r` is a {LastDayOfMonthTransitionRule} with + # the same {transition_at}, month and day of week as this + # {LastDayOfMonthTransitionRule}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#420 + def eql?(r); end + + protected + + # Returns a `Time` representing midnight local time on the day specified by + # the rule for the given offset and year. + # + # @param offset [TimezoneOffset] the current offset at the time of the + # transition. + # @param year [Integer] the year in which the transition occurs. + # @return [Time] midnight local time on the day specified by the rule for + # the given offset and year. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#435 + def get_day(offset, year); end +end + +# Represents time zones that are defined as a link to or alias for another +# time zone. +# +# source://tzinfo//lib/tzinfo/linked_timezone.rb#6 +class TZInfo::LinkedTimezone < ::TZInfo::InfoTimezone + # Initializes a new {LinkedTimezone}. + # + # {LinkedTimezone} instances should not normally be created directly. Use + # the {Timezone.get} method to obtain {Timezone} instances. + # + # @param info [DataSources::LinkedTimezoneInfo] a + # {DataSources::LinkedTimezoneInfo} instance supplied by a {DataSource} + # that will be used as the source of data for this {LinkedTimezone}. + # @return [LinkedTimezone] a new instance of LinkedTimezone + # + # source://tzinfo//lib/tzinfo/linked_timezone.rb#15 + def initialize(info); end + + # Returns the canonical {Timezone} instance for this {LinkedTimezone}. + # + # For a {LinkedTimezone}, this is the canonical zone of the link target. + # + # @return [Timezone] the canonical {Timezone} instance for this {Timezone}. + # + # source://tzinfo//lib/tzinfo/linked_timezone.rb#40 + def canonical_zone; end + + # Returns the {TimezonePeriod} that is valid at a given time. + # + # Unlike {period_for_local} and {period_for_utc}, the UTC offset of the + # `time` parameter is taken into consideration. + # + # @param time [Object] a `Time`, `DateTime` or {Timestamp}. + # @raise [ArgumentError] if `time` is `nil`. + # @raise [ArgumentError] if `time` is a {Timestamp} with an unspecified + # offset. + # @return [TimezonePeriod] the {TimezonePeriod} that is valid at `time`. + # + # source://tzinfo//lib/tzinfo/linked_timezone.rb#21 + def period_for(time); end + + # Returns the set of {TimezonePeriod}s that are valid for the given + # local time as an `Array`. + # + # The UTC offset of the `local_time` parameter is ignored (it is treated as + # a time in the time zone represented by `self`). + # + # This will typically return an `Array` containing a single + # {TimezonePeriod}. More than one {TimezonePeriod} will be returned when the + # local time is ambiguous (for example, when daylight savings time ends). An + # empty `Array` will be returned when the local time is not valid (for + # example, when daylight savings time begins). + # + # To obtain just a single {TimezonePeriod} in all cases, use + # {period_for_local} instead and specify how ambiguities should be resolved. + # + # @param local_time [Object] a `Time`, `DateTime` or {Timestamp}. + # @raise [ArgumentError] if `local_time` is `nil`. + # @return [Array] the set of {TimezonePeriod}s that are + # valid at `local_time`. + # + # source://tzinfo//lib/tzinfo/linked_timezone.rb#26 + def periods_for_local(local_time); end + + # Returns an `Array` of {TimezoneTransition} instances representing the + # times where the UTC offset of the timezone changes. + # + # Transitions are returned up to a given time (`to`). + # + # A from time may also be supplied using the `from` parameter. If from is + # not `nil`, only transitions from that time onwards will be returned. + # + # Comparisons with `to` are exclusive. Comparisons with `from` are + # inclusive. If a transition falls precisely on `to`, it will be excluded. + # If a transition falls on `from`, it will be included. + # + # @param to [Object] a `Time`, `DateTime` or {Timestamp} specifying the + # latest (exclusive) transition to return. + # @param from [Object] an optional `Time`, `DateTime` or {Timestamp} + # specifying the earliest (inclusive) transition to return. + # @raise [ArgumentError] if `from` is specified and `to` is not greater than + # `from`. + # @raise [ArgumentError] is raised if `to` is `nil`. + # @raise [ArgumentError] if either `to` or `from` is a {Timestamp} with an + # unspecified offset. + # @return [Array] the transitions that are earlier than + # `to` and, if specified, at or later than `from`. Transitions are ordered + # by when they occur, from earliest to latest. + # + # source://tzinfo//lib/tzinfo/linked_timezone.rb#31 + def transitions_up_to(to, from = T.unsafe(nil)); end +end + +# Represents the infinite period of time in a time zone that constantly +# observes the same offset from UTC (has an unbounded start and end). +# +# source://tzinfo//lib/tzinfo/offset_timezone_period.rb#6 +class TZInfo::OffsetTimezonePeriod < ::TZInfo::TimezonePeriod + # Initializes an {OffsetTimezonePeriod}. + # + # @param offset [TimezoneOffset] the offset that is constantly observed. + # @raise [ArgumentError] if `offset` is `nil`. + # @return [OffsetTimezonePeriod] a new instance of OffsetTimezonePeriod + # + # source://tzinfo//lib/tzinfo/offset_timezone_period.rb#11 + def initialize(offset); end + + # Determines if this {OffsetTimezonePeriod} is equal to another instance. + # + # @param p [Object] the instance to test for equality. + # @return [Boolean] `true` if `p` is a {OffsetTimezonePeriod} with the same + # {offset}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/offset_timezone_period.rb#32 + def ==(p); end + + # @return [TimezoneTransition] the transition that defines the end of this + # {TimezonePeriod}, always `nil` for {OffsetTimezonePeriod}. + # + # source://tzinfo//lib/tzinfo/offset_timezone_period.rb#23 + def end_transition; end + + # Determines if this {OffsetTimezonePeriod} is equal to another instance. + # + # @param p [Object] the instance to test for equality. + # @return [Boolean] `true` if `p` is a {OffsetTimezonePeriod} with the same + # {offset}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/offset_timezone_period.rb#32 + def eql?(p); end + + # @return [Integer] a hash based on {offset}. + # + # source://tzinfo//lib/tzinfo/offset_timezone_period.rb#38 + def hash; end + + # @return [TimezoneTransition] the transition that defines the start of this + # {TimezonePeriod}, always `nil` for {OffsetTimezonePeriod}. + # + # source://tzinfo//lib/tzinfo/offset_timezone_period.rb#17 + def start_transition; end +end + +# {PeriodNotFound} is raised to indicate that no {TimezonePeriod} matching a +# given time could be found. +# +# source://tzinfo//lib/tzinfo/timezone.rb#21 +class TZInfo::PeriodNotFound < ::StandardError; end + +# Methods to support different versions of Ruby. +# +# @private +# +# source://tzinfo//lib/tzinfo/ruby_core_support.rb#6 +module TZInfo::RubyCoreSupport + class << self + # source://tzinfo//lib/tzinfo/ruby_core_support.rb#17 + def untaint(o); end + end +end + +# Maintains a pool of `String` instances. The {#dedupe} method will return +# either a pooled copy of a given `String` or add the instance to the pool. +# +# @private +# +# source://tzinfo//lib/tzinfo/string_deduper.rb#11 +class TZInfo::StringDeduper + # Initializes a new {StringDeduper}. + # + # @return [StringDeduper] a new instance of StringDeduper + # + # source://tzinfo//lib/tzinfo/string_deduper.rb#20 + def initialize; end + + # @param string [String] the string to deduplicate. + # @return [bool] `string` if it is frozen, otherwise a frozen, possibly + # pre-existing copy of `string`. + # + # source://tzinfo//lib/tzinfo/string_deduper.rb#30 + def dedupe(string); end + + protected + + # Creates a `Hash` to store pooled `String` instances. + # + # @param block [Proc] Default value block to be passed to `Hash.new`. + # @return [Hash] a `Hash` to store pooled `String` instances. + # + # source://tzinfo//lib/tzinfo/string_deduper.rb#41 + def create_hash(&block); end + + class << self + # @return [StringDeduper] a globally available singleton instance of + # {StringDeduper}. This instance is safe for use in concurrently + # executing threads. + # + # source://tzinfo//lib/tzinfo/string_deduper.rb#16 + def global; end + end +end + +# A subclass of `Time` used to represent local times. {TimeWithOffset} holds a +# reference to the related {TimezoneOffset} and overrides various methods to +# return results appropriate for the {TimezoneOffset}. Certain operations will +# clear the associated {TimezoneOffset} (if the {TimezoneOffset} would not +# necessarily be valid for the result). Once the {TimezoneOffset} has been +# cleared, {TimeWithOffset} behaves identically to `Time`. +# +# Arithmetic performed on {TimeWithOffset} instances is _not_ time zone-aware. +# Regardless of whether transitions in the time zone are crossed, results of +# arithmetic operations will always maintain the same offset from UTC +# (`utc_offset`). The associated {TimezoneOffset} will aways be cleared. +# +# source://tzinfo//lib/tzinfo/time_with_offset.rb#16 +class TZInfo::TimeWithOffset < ::Time + include ::TZInfo::WithOffset + + # An overridden version of `Time#dst?` that, if there is an associated + # {TimezoneOffset}, returns the result of calling {TimezoneOffset#dst? dst?} + # on that offset. + # + # @return [Boolean] `true` if daylight savings time is being observed, + # otherwise `false`. + # + # source://tzinfo//lib/tzinfo/time_with_offset.rb#43 + def dst?; end + + # An overridden version of `Time#getlocal` that clears the associated + # {TimezoneOffset} if the base implementation of `getlocal` returns a + # {TimeWithOffset}. + # + # @return [Time] a representation of the {TimeWithOffset} using either the + # local time zone or the given offset. + # + # source://tzinfo//lib/tzinfo/time_with_offset.rb#55 + def getlocal(*args); end + + # An overridden version of `Time#gmtime` that clears the associated + # {TimezoneOffset}. + # + # @return [TimeWithOffset] `self`. + # + # source://tzinfo//lib/tzinfo/time_with_offset.rb#69 + def gmtime; end + + # An overridden version of `Time#dst?` that, if there is an associated + # {TimezoneOffset}, returns the result of calling {TimezoneOffset#dst? dst?} + # on that offset. + # + # @return [Boolean] `true` if daylight savings time is being observed, + # otherwise `false`. + # + # source://tzinfo//lib/tzinfo/time_with_offset.rb#43 + def isdst; end + + # An overridden version of `Time#localtime` that clears the associated + # {TimezoneOffset}. + # + # @return [TimeWithOffset] `self`. + # + # source://tzinfo//lib/tzinfo/time_with_offset.rb#79 + def localtime(*args); end + + # An overridden version of `Time#round` that, if there is an associated + # {TimezoneOffset}, returns a {TimeWithOffset} preserving that offset. + # + # @return [Time] the rounded time. + # + # source://tzinfo//lib/tzinfo/time_with_offset.rb#89 + def round(ndigits = T.unsafe(nil)); end + + # Marks this {TimeWithOffset} as a local time with the UTC offset of a given + # {TimezoneOffset} and sets the associated {TimezoneOffset}. + # + # @param timezone_offset [TimezoneOffset] the {TimezoneOffset} to use to set + # the offset of this {TimeWithOffset}. + # @raise [ArgumentError] if `timezone_offset` is `nil`. + # @return [TimeWithOffset] `self`. + # + # source://tzinfo//lib/tzinfo/time_with_offset.rb#30 + def set_timezone_offset(timezone_offset); end + + # @return [TimezoneOffset] the {TimezoneOffset} associated with this + # instance. + # + # source://tzinfo//lib/tzinfo/time_with_offset.rb#21 + def timezone_offset; end + + # An overridden version of `Time#to_a`. The `isdst` (index 8) and `zone` + # (index 9) elements of the array are set according to the associated + # {TimezoneOffset}. + # + # @return [Array] an `Array` representation of the {TimeWithOffset}. + # + # source://tzinfo//lib/tzinfo/time_with_offset.rb#98 + def to_a; end + + # An overridden version of `Time#to_datetime` that, if there is an + # associated {TimezoneOffset}, returns a {DateTimeWithOffset} with that + # offset. + # + # @return [DateTime] if there is an associated {TimezoneOffset}, a + # {DateTimeWithOffset} representation of this {TimeWithOffset}, otherwise + # a `Time` representation. + # + # source://tzinfo//lib/tzinfo/time_with_offset.rb#135 + def to_datetime; end + + # An overridden version of `Time#utc` that clears the associated + # {TimezoneOffset}. + # + # @return [TimeWithOffset] `self`. + # + # source://tzinfo//lib/tzinfo/time_with_offset.rb#110 + def utc; end + + # An overridden version of `Time#zone` that, if there is an associated + # {TimezoneOffset}, returns the {TimezoneOffset#abbreviation abbreviation} + # of that offset. + # + # @return [String] the {TimezoneOffset#abbreviation abbreviation} of the + # associated {TimezoneOffset}, or the result from `Time#zone` if there is + # no such offset. + # + # source://tzinfo//lib/tzinfo/time_with_offset.rb#123 + def zone; end + + protected + + # Clears the associated {TimezoneOffset}. + # + # @return [TimeWithOffset] `self`. + # + # source://tzinfo//lib/tzinfo/time_with_offset.rb#149 + def clear_timezone_offset; end +end + +# A time represented as an `Integer` number of seconds since 1970-01-01 +# 00:00:00 UTC (ignoring leap seconds and using the proleptic Gregorian +# calendar), the fraction through the second (sub_second as a `Rational`) and +# an optional UTC offset. Like Ruby's `Time` class, {Timestamp} can +# distinguish between a local time with a zero offset and a time specified +# explicitly as UTC. +# +# source://tzinfo//lib/tzinfo/timestamp.rb#11 +class TZInfo::Timestamp + include ::Comparable + + # Initializes a new {Timestamp}. + # + # @param value [Integer] the number of seconds since 1970-01-01 00:00:00 UTC + # ignoring leap seconds. + # @param utc_offset [Object] either `nil` for a {Timestamp} without a + # specified offset, an offset from UTC specified as an `Integer` number of + # seconds or the `Symbol` `:utc`). + # @param sub_second [Numeric] the fractional part of the second as either a + # `Rational` that is greater than or equal to 0 and less than 1, or + # the `Integer` 0. + # @raise [ArgumentError] if `utc_offset` is not `nil`, not an `Integer` and + # not the `Symbol` `:utc`. + # @raise [ArgumentError] if `sub_second` is not a `Rational`, or the + # `Integer` 0. + # @raise [ArgumentError] if `value` is not an `Integer`. + # @raise [RangeError] if `sub_second` is a `Rational` but that is less + # than 0 or greater than or equal to 1. + # @return [Timestamp] a new instance of Timestamp + # + # source://tzinfo//lib/tzinfo/timestamp.rb#344 + def initialize(value, sub_second = T.unsafe(nil), utc_offset = T.unsafe(nil)); end + + # Compares this {Timestamp} with another. + # + # {Timestamp} instances without a defined UTC offset are not comparable with + # {Timestamp} instances that have a defined UTC offset. + # + # @param t [Timestamp] the {Timestamp} to compare this instance with. + # @return [Integer] -1, 0 or 1 depending if this instance is earlier, equal + # or later than `t` respectively. Returns `nil` when comparing a + # {Timestamp} that does not have a defined UTC offset with a {Timestamp} + # that does have a defined UTC offset. Returns `nil` if `t` is not a + # {Timestamp}. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#454 + def <=>(t); end + + # Adds a number of seconds to the {Timestamp} value, setting the UTC offset + # of the result. + # + # @param seconds [Integer] the number of seconds to be added. + # @param utc_offset [Object] either `nil` for a {Timestamp} without a + # specified offset, an offset from UTC specified as an `Integer` number of + # seconds or the `Symbol` `:utc`). + # @raise [ArgumentError] if `seconds` is not an `Integer`. + # @raise [ArgumentError] if `utc_offset` is not `nil`, not an `Integer` and + # not the `Symbol` `:utc`. + # @return [Timestamp] the result of adding `seconds` to the + # {Timestamp} value as a new {Timestamp} instance with the chosen + # `utc_offset`. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#372 + def add_and_set_utc_offset(seconds, utc_offset); end + + def eql?(_arg0); end + + # @return [Integer] a hash based on the value, sub-second and whether there + # is a defined UTC offset. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#468 + def hash; end + + # @return [String] the internal object state as a programmer-readable + # `String`. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#474 + def inspect; end + + # Formats this {Timestamp} according to the directives in the given format + # string. + # + # @param format [String] the format string. Please refer to `Time#strftime` + # for a list of supported format directives. + # @raise [ArgumentError] if `format` is not specified. + # @return [String] the formatted {Timestamp}. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#426 + def strftime(format); end + + # @return [Numeric] the fraction of a second elapsed since timestamp as + # either a `Rational` or the `Integer` 0. Always greater than or equal to + # 0 and less than 1. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#321 + def sub_second; end + + # Converts this {Timestamp} to a Gregorian `DateTime`. + # + # @return [DateTime] a Gregorian `DateTime` representation of this + # {Timestamp}. If the UTC offset of this {Timestamp} is not specified, a + # UTC `DateTime` will be returned. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#406 + def to_datetime; end + + # Converts this {Timestamp} to an `Integer` number of seconds since + # 1970-01-01 00:00:00 UTC (ignoring leap seconds). + # + # @return [Integer] an `Integer` representation of this {Timestamp} (the + # number of seconds since 1970-01-01 00:00:00 UTC ignoring leap seconds). + # + # source://tzinfo//lib/tzinfo/timestamp.rb#415 + def to_i; end + + # @return [String] a `String` representation of this {Timestamp}. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#432 + def to_s; end + + # Converts this {Timestamp} to a `Time`. + # + # @return [Time] a `Time` representation of this {Timestamp}. If the UTC + # offset of this {Timestamp} is not specified, a UTC `Time` will be + # returned. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#391 + def to_time; end + + # @return [Timestamp] a UTC {Timestamp} equivalent to this instance. Returns + # `self` if {#utc? self.utc?} is `true`. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#381 + def utc; end + + # @return [Boolean] `true` if this {Timestamp} represents UTC, `false` if + # the {Timestamp} wasn't specified as UTC or `nil` if the {Timestamp} has + # no specified offset. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#355 + def utc?; end + + # @return [Integer] the offset from UTC in seconds or `nil` if the + # {Timestamp} doesn't have a specified offset. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#325 + def utc_offset; end + + # @return [Integer] the number of seconds since 1970-01-01 00:00:00 UTC + # ignoring leap seconds (i.e. each day is treated as if it were 86,400 + # seconds long). + # + # source://tzinfo//lib/tzinfo/timestamp.rb#316 + def value; end + + protected + + # Constructs a new instance of a `DateTime` or `DateTime`-like class with + # the same {value}, {sub_second} and {utc_offset} as this {Timestamp}. + # + # @param klass [Class] the class to instantiate. + # @private + # + # source://tzinfo//lib/tzinfo/timestamp.rb#496 + def new_datetime(klass = T.unsafe(nil)); end + + # Creates a new instance of a `Time` or `Time`-like class matching the + # {value} and {sub_second} of this {Timestamp}, but not setting the offset. + # + # @param klass [Class] the class to instantiate. + # @private + # + # source://tzinfo//lib/tzinfo/timestamp.rb#486 + def new_time(klass = T.unsafe(nil)); end + + private + + # Initializes a new {Timestamp} without validating the parameters. This + # method is used internally within {Timestamp} to avoid the overhead of + # checking parameters. + # + # @param value [Integer] the number of seconds since 1970-01-01 00:00:00 UTC + # ignoring leap seconds. + # @param sub_second [Numeric] the fractional part of the second as either a + # `Rational` that is greater than or equal to 0 and less than 1, or the + # `Integer` 0. + # @param utc_offset [Object] either `nil` for a {Timestamp} without a + # specified offset, an offset from UTC specified as an `Integer` number of + # seconds or the `Symbol` `:utc`). + # + # source://tzinfo//lib/tzinfo/timestamp.rb#538 + def initialize!(value, sub_second = T.unsafe(nil), utc_offset = T.unsafe(nil)); end + + # Converts the {sub_second} value to a `String` suitable for appending to + # the `String` representation of a {Timestamp}. + # + # @return [String] a `String` representation of {sub_second}. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#518 + def sub_second_to_s; end + + # Converts the value and sub-seconds to a `String`, adding on the given + # offset. + # + # @param offset [Integer] the offset to add to the value. + # @return [String] the value and sub-seconds. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#510 + def value_and_sub_second_to_s(offset = T.unsafe(nil)); end + + class << self + # Returns a new {Timestamp} representing the (proleptic Gregorian + # calendar) date and time specified by the supplied parameters. + # + # If `utc_offset` is `nil`, `:utc` or 0, the date and time parameters will + # be interpreted as representing a UTC date and time. Otherwise the date + # and time parameters will be interpreted as a local date and time with + # the given offset. + # + # @param month [Integer] the month (1-12). + # @param day [Integer] the day of the month (1-31). + # @param hour [Integer] the hour (0-23). + # @param minute [Integer] the minute (0-59). + # @param second [Integer] the second (0-59). + # @param sub_second [Numeric] the fractional part of the second as either + # a `Rational` that is greater than or equal to 0 and less than 1, or + # the `Integer` 0. + # @param utc_offset [Object] either `nil` for a {Timestamp} without a + # specified offset, an offset from UTC specified as an `Integer` number + # of seconds or the `Symbol` `:utc`). + # @param year [Integer] the year. + # @raise [RangeError] if `sub_second` is a `Rational` but that is less + # than 0 or greater than or equal to 1. + # @raise [ArgumentError] if `sub_second` is not a `Rational`, or the + # `Integer` 0. + # @raise [ArgumentError] if either of `year`, `month`, `day`, `hour`, + # `minute`, or `second` is not an `Integer`. + # @raise [ArgumentError] if `utc_offset` is not `nil`, not an `Integer` + # and not the `Symbol` `:utc`. + # @raise [RangeError] if `month` is not between 1 and 12. + # @raise [RangeError] if `day` is not between 1 and 31. + # @raise [RangeError] if `hour` is not between 0 and 23. + # @raise [RangeError] if `minute` is not between 0 and 59. + # @raise [RangeError] if `second` is not between 0 and 59. + # @return [Timestamp] a new {Timestamp} representing the specified + # (proleptic Gregorian calendar) date and time. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#55 + def create(year, month = T.unsafe(nil), day = T.unsafe(nil), hour = T.unsafe(nil), minute = T.unsafe(nil), second = T.unsafe(nil), sub_second = T.unsafe(nil), utc_offset = T.unsafe(nil)); end + + # When used without a block, returns a {Timestamp} representation of a + # given `Time`, `DateTime` or {Timestamp}. + # + # When called with a block, the {Timestamp} representation of `value` is + # passed to the block. The block must then return a {Timestamp}, which + # will be converted back to the type of the initial value. If the initial + # value was a {Timestamp}, the block result will be returned. If the + # initial value was a `DateTime`, a Gregorian `DateTime` will be returned. + # + # The UTC offset of `value` can either be preserved (the {Timestamp} + # representation will have the same UTC offset as `value`), ignored (the + # {Timestamp} representation will have no defined UTC offset), or treated + # as though it were UTC (the {Timestamp} representation will have a + # {utc_offset} of 0 and {utc?} will return `true`). + # + # @param value [Object] a `Time`, `DateTime` or {Timestamp}. + # @param offset [Symbol] either `:preserve` to preserve the offset of + # `value`, `:ignore` to ignore the offset of `value` and create a + # {Timestamp} with an unspecified offset, or `:treat_as_utc` to treat + # the offset of `value` as though it were UTC and create a UTC + # {Timestamp}. + # @raise [ArgumentError] + # @return [Object] if called without a block, the {Timestamp} + # representation of `value`, otherwise the result of the block, + # converted back to the type of `value`. + # @yield [timestamp] if a block is provided, the {Timestamp} + # representation is passed to the block. + # @yieldparam timestamp [Timestamp] the {Timestamp} representation of + # `value`. + # @yieldreturn [Timestamp] a {Timestamp} to be converted back to the type + # of `value`. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#112 + def for(value, offset = T.unsafe(nil)); end + + # Creates a new UTC {Timestamp}. + # + # @param value [Integer] the number of seconds since 1970-01-01 00:00:00 + # UTC ignoring leap seconds. + # @param sub_second [Numeric] the fractional part of the second as either + # a `Rational` that is greater than or equal to 0 and less than 1, or + # the `Integer` 0. + # @raise [ArgumentError] if `value` is not an `Integer`. + # @raise [ArgumentError] if `sub_second` is not a `Rational`, or the + # `Integer` 0. + # @raise [RangeError] if `sub_second` is a `Rational` but that is less + # than 0 or greater than or equal to 1. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#172 + def utc(value, sub_second = T.unsafe(nil)); end + + private + + # Creates a {Timestamp} that represents a given `DateTime`, optionally + # ignoring the offset. + # + # @param datetime [DateTime] a `DateTime`. + # @param ignore_offset [Boolean] whether to ignore the offset of + # `datetime`. + # @param target_utc_offset [Object] if `ignore_offset` is `true`, the UTC + # offset of the result (`:utc`, `nil` or an `Integer`). + # @return [Timestamp] the {Timestamp} representation of `datetime`. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#231 + def for_datetime(datetime, ignore_offset, target_utc_offset); end + + # Creates a {Timestamp} that represents a given `Time`, optionally + # ignoring the offset. + # + # @param time [Time] a `Time`. + # @param ignore_offset [Boolean] whether to ignore the offset of `time`. + # @param target_utc_offset [Object] if `ignore_offset` is `true`, the UTC + # offset of the result (`:utc`, `nil` or an `Integer`). + # @return [Timestamp] the {Timestamp} representation of `time`. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#206 + def for_time(time, ignore_offset, target_utc_offset); end + + # Creates a {Timestamp} that represents a given `Time`-like object, + # optionally ignoring the offset (if the `time_like` responds to + # `utc_offset`). + # + # @param time_like [Object] a `Time`-like object. + # @param ignore_offset [Boolean] whether to ignore the offset of `time`. + # @param target_utc_offset [Object] if `ignore_offset` is `true`, the UTC + # offset of the result (`:utc`, `nil` or an `Integer`). + # @return [Timestamp] the {Timestamp} representation of `time_like`. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#296 + def for_time_like(time_like, ignore_offset, target_utc_offset); end + + # Returns a {Timestamp} that represents another {Timestamp}, optionally + # ignoring the offset. If the result would be identical to `value`, the + # same instance is returned. If the passed in value is an instance of a + # subclass of {Timestamp}, then a new {Timestamp} will always be returned. + # + # @param timestamp [Timestamp] a {Timestamp}. + # @param ignore_offset [Boolean] whether to ignore the offset of + # `timestamp`. + # @param target_utc_offset [Object] if `ignore_offset` is `true`, the UTC + # offset of the result (`:utc`, `nil` or an `Integer`). + # @return [Timestamp] a [Timestamp] representation of `timestamp`. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#256 + def for_timestamp(timestamp, ignore_offset, target_utc_offset); end + + # Determines if an object is like a `Time` (for the purposes of converting + # to a {Timestamp} with {for}), responding to `to_i` and `subsec`. + # + # @param value [Object] an object to test. + # @return [Boolean] `true` if the object is `Time`-like, otherwise + # `false`. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#283 + def is_time_like?(value); end + + # Constructs a new instance of `self` (i.e. {Timestamp} or a subclass of + # {Timestamp}) without validating the parameters. This method is used + # internally within {Timestamp} to avoid the overhead of checking + # parameters. + # + # @param value [Integer] the number of seconds since 1970-01-01 00:00:00 + # UTC ignoring leap seconds. + # @param sub_second [Numeric] the fractional part of the second as either + # a `Rational` that is greater than or equal to 0 and less than 1, or + # the `Integer` 0. + # @param utc_offset [Object] either `nil` for a {Timestamp} without a + # specified offset, an offset from UTC specified as an `Integer` number + # of seconds or the `Symbol` `:utc`). + # @return [Timestamp] a new instance of `self`. + # + # source://tzinfo//lib/tzinfo/timestamp.rb#192 + def new!(value, sub_second = T.unsafe(nil), utc_offset = T.unsafe(nil)); end + end +end + +# The Unix epoch (1970-01-01 00:00:00 UTC) as a chronological Julian day +# number. +# +# source://tzinfo//lib/tzinfo/timestamp.rb#16 +TZInfo::Timestamp::JD_EPOCH = T.let(T.unsafe(nil), Integer) + +# A subclass of {Timestamp} used to represent local times. +# {TimestampWithOffset} holds a reference to the related {TimezoneOffset} and +# overrides various methods to return results appropriate for the +# {TimezoneOffset}. Certain operations will clear the associated +# {TimezoneOffset} (if the {TimezoneOffset} would not necessarily be valid for +# the result). Once the {TimezoneOffset} has been cleared, +# {TimestampWithOffset} behaves identically to {Timestamp}. +# +# source://tzinfo//lib/tzinfo/timestamp_with_offset.rb#12 +class TZInfo::TimestampWithOffset < ::TZInfo::Timestamp + include ::TZInfo::WithOffset + + # Sets the associated {TimezoneOffset} of this {TimestampWithOffset}. + # + # @param timezone_offset [TimezoneOffset] a {TimezoneOffset} valid at the time + # and for the offset of this {TimestampWithOffset}. + # @raise [ArgumentError] if `timezone_offset` is `nil`. + # @raise [ArgumentError] if {utc? self.utc?} is `true`. + # @raise [ArgumentError] if `timezone_offset.observed_utc_offset` does not equal + # `self.utc_offset`. + # @return [TimestampWithOffset] `self`. + # + # source://tzinfo//lib/tzinfo/timestamp_with_offset.rb#47 + def set_timezone_offset(timezone_offset); end + + # @return [TimezoneOffset] the {TimezoneOffset} associated with this + # instance. + # + # source://tzinfo//lib/tzinfo/timestamp_with_offset.rb#17 + def timezone_offset; end + + # An overridden version of {Timestamp#to_datetime}, if there is an + # associated {TimezoneOffset}, returns a {DateTimeWithOffset} with that + # offset. + # + # @return [DateTime] if there is an associated {TimezoneOffset}, a + # {DateTimeWithOffset} representation of this {TimestampWithOffset}, + # otherwise a `DateTime` representation. + # + # source://tzinfo//lib/tzinfo/timestamp_with_offset.rb#76 + def to_datetime; end + + # An overridden version of {Timestamp#to_time} that, if there is an + # associated {TimezoneOffset}, returns a {TimeWithOffset} with that offset. + # + # @return [Time] if there is an associated {TimezoneOffset}, a + # {TimeWithOffset} representation of this {TimestampWithOffset}, otherwise + # a `Time` representation. + # + # source://tzinfo//lib/tzinfo/timestamp_with_offset.rb#60 + def to_time; end + + class << self + # Creates a new {TimestampWithOffset} from a given {Timestamp} and + # {TimezoneOffset}. + # + # time of `timestamp`. + # + # @param timestamp [Timestamp] a {Timestamp}. + # @param timezone_offset [TimezoneOffset] a {TimezoneOffset} valid at the + # @raise [ArgumentError] if `timestamp` or `timezone_offset` is `nil`. + # @return [TimestampWithOffset] a {TimestampWithOffset} that has the same + # {value value} and {sub_second sub_second} as the `timestamp` parameter, + # a {utc_offset utc_offset} equal to the + # {TimezoneOffset#observed_utc_offset observed_utc_offset} of the + # `timezone_offset` parameter and {timezone_offset timezone_offset} set to + # the `timezone_offset` parameter. + # + # source://tzinfo//lib/tzinfo/timestamp_with_offset.rb#32 + def set_timezone_offset(timestamp, timezone_offset); end + end +end + +# The {Timezone} class represents a time zone. It provides a factory method, +# {get}, to retrieve {Timezone} instances by their identifier. +# +# The {Timezone#to_local} method can be used to convert `Time` and `DateTime` +# instances to the local time for the zone. For example: +# +# tz = TZInfo::Timezone.get('America/New_York') +# local_time = tz.to_local(Time.utc(2005,8,29,15,35,0)) +# local_datetime = tz.to_local(DateTime.new(2005,8,29,15,35,0)) +# +# Local `Time` and `DateTime` instances returned by `Timezone` have the +# correct local offset. +# +# The {Timezone#local_to_utc} method can by used to convert local `Time` and +# `DateTime` instances to UTC. {Timezone#local_to_utc} ignores the UTC offset +# of the supplied value and treats if it is a local time for the zone. For +# example: +# +# tz = TZInfo::Timezone.get('America/New_York') +# utc_time = tz.local_to_utc(Time.new(2005,8,29,11,35,0)) +# utc_datetime = tz.local_to_utc(DateTime.new(2005,8,29,11,35,0)) +# +# Each time zone is treated as sequence of periods of time ({TimezonePeriod}) +# that observe the same offset ({TimezoneOffset}). Transitions +# ({TimezoneTransition}) denote the end of one period and the start of the +# next. The {Timezone} class has methods that allow the periods, offsets and +# transitions of a time zone to be interrogated. +# +# All methods that take `Time` objects as parameters can be used with +# arbitrary `Time`-like objects that respond to both `to_i` and `subsec` and +# optionally `utc_offset`. +# +# The {Timezone} class is thread-safe. It is safe to use class and instance +# methods of {Timezone} in concurrently executing threads. Instances of +# {Timezone} can be shared across thread boundaries. +# +# The IANA Time Zone Database maintainers recommend that time zone identifiers +# are not made visible to end-users (see [Names of +# timezones](https://data.iana.org/time-zones/theory.html#naming)). The +# {Country} class can be used to obtain lists of time zones by country, +# including user-friendly descriptions and approximate locations. +# +# @abstract The {get} method returns an instance of either {DataTimezone} or +# {LinkedTimezone}. The {get_proxy} method and other methods returning +# collections of time zones return instances of {TimezoneProxy}. +# +# source://tzinfo//lib/tzinfo/timezone.rb#80 +class TZInfo::Timezone + include ::Comparable + + # Compares this {Timezone} with another based on the {identifier}. + # + # @param tz [Object] an `Object` to compare this {Timezone} with. + # @return [Integer] -1 if `tz` is less than `self`, 0 if `tz` is equal to + # `self` and +1 if `tz` is greater than `self`, or `nil` if `tz` is not an + # instance of {Timezone}. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1105 + def <=>(tz); end + + # Matches `regexp` against the {identifier} of this {Timezone}. + # + # @param regexp [Regexp] a `Regexp` to match against the {identifier} of + # this {Timezone}. + # @return [Integer] the position the match starts, or `nil` if there is no + # match. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1128 + def =~(regexp); end + + # Returns a serialized representation of this {Timezone}. This method is + # called when using `Marshal.dump` with an instance of {Timezone}. + # + # @param limit [Integer] the maximum depth to dump - ignored. + # @return [String] a serialized representation of this {Timezone}. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1137 + def _dump(limit); end + + # @param time [Object] a `Time`, `DateTime` or `Timestamp`. + # @raise [ArgumentError] if `time` is `nil`. + # @raise [ArgumentError] if `time` is a {Timestamp} with an unspecified UTC + # offset. + # @return [String] the abbreviation of this {Timezone} at the given time. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1048 + def abbr(time = T.unsafe(nil)); end + + # @param time [Object] a `Time`, `DateTime` or `Timestamp`. + # @raise [ArgumentError] if `time` is `nil`. + # @raise [ArgumentError] if `time` is a {Timestamp} with an unspecified UTC + # offset. + # @return [String] the abbreviation of this {Timezone} at the given time. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1048 + def abbreviation(time = T.unsafe(nil)); end + + # Returns the base offset from UTC in seconds at the given time. This does + # not include any adjustment made for daylight savings time and will + # typically remain constant throughout the year. + # + # To obtain the observed offset from UTC, including the effect of daylight + # savings time, use {observed_utc_offset} instead. + # + # If you require accurate {base_utc_offset} values, you should install the + # tzinfo-data gem and set {DataSources::RubyDataSource} as the {DataSource}. + # When using {DataSources::ZoneinfoDataSource}, the value of + # {base_utc_offset} has to be derived from changes to the observed UTC + # offset and DST status since it is not included in zoneinfo files. + # + # @param time [Object] a `Time`, `DateTime` or `Timestamp`. + # @raise [ArgumentError] if `time` is `nil`. + # @raise [ArgumentError] if `time` is a {Timestamp} with an unspecified UTC + # offset. + # @return [Integer] the base offset from UTC in seconds at the given time. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1081 + def base_utc_offset(time = T.unsafe(nil)); end + + # Returns the canonical identifier of this time zone. + # + # This is a shortcut for calling `canonical_zone.identifier`. Please refer + # to the {canonical_zone} documentation for further information. + # + # @return [String] the canonical identifier of this time zone. + # + # source://tzinfo//lib/tzinfo/timezone.rb#987 + def canonical_identifier; end + + # Returns the canonical {Timezone} instance for this {Timezone}. + # + # The IANA Time Zone database contains two types of definition: Zones and + # Links. Zones are defined by rules that set out when transitions occur. + # Links are just references to fully defined Zone, creating an alias for + # that Zone. + # + # Links are commonly used where a time zone has been renamed in a release of + # the Time Zone database. For example, the US/Eastern Zone was renamed as + # America/New_York. A US/Eastern Link was added in its place, linking to + # (and creating an alias for) America/New_York. + # + # Links are also used for time zones that are currently identical to a full + # Zone, but that are administered separately. For example, Europe/Vatican is + # a Link to (and alias for) Europe/Rome. + # + # For a full Zone (implemented by {DataTimezone}), {canonical_zone} returns + # self. + # + # For a Link (implemented by {LinkedTimezone}), {canonical_zone} returns a + # {Timezone} instance representing the full Zone that the link targets. + # + # TZInfo can be used with different data sources (see the documentation for + # {TZInfo::DataSource}). Some DataSource implementations may not support + # distinguishing between full Zones and Links and will treat all time zones + # as full Zones. In this case, {canonical_zone} will always return `self`. + # + # There are two built-in DataSource implementations. + # {DataSources::RubyDataSource} (which will be used if the tzinfo-data gem + # is available) supports Link zones. {DataSources::ZoneinfoDataSource} + # returns Link zones as if they were full Zones. If the {canonical_zone} or + # {canonical_identifier} methods are needed, the tzinfo-data gem should be + # installed. + # + # The {TZInfo::DataSource.get} method can be used to check which DataSource + # implementation is being used. + # + # @return [Timezone] the canonical {Timezone} instance for this {Timezone}. + # + # source://tzinfo//lib/tzinfo/timezone.rb#412 + def canonical_zone; end + + # @return [TimezonePeriod] the current {TimezonePeriod} for the time zone. + # + # source://tzinfo//lib/tzinfo/timezone.rb#997 + def current_period; end + + # Returns the current local time and {TimezonePeriod} for the time zone as + # an `Array`. The first element is the time as a {TimeWithOffset}. The + # second element is the period. + # + # @return [Array] an `Array` containing the current {TimeWithOffset} for the + # time zone as the first element and the current {TimezonePeriod} for the + # time zone as the second element. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1008 + def current_period_and_time; end + + # Returns the current local time and {TimezonePeriod} for the time zone as + # an `Array`. The first element is the time as a {TimeWithOffset}. The + # second element is the period. + # + # @return [Array] an `Array` containing the current {TimeWithOffset} for the + # time zone as the first element and the current {TimezonePeriod} for the + # time zone as the second element. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1008 + def current_time_and_period; end + + # @param time [Object] a `Time`, `DateTime` or `Timestamp`. + # @raise [ArgumentError] if `time` is `nil`. + # @raise [ArgumentError] if `time` is a {Timestamp} with an unspecified UTC + # offset. + # @return [Boolean] whether daylight savings time is in effect at the given + # time. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1059 + def dst?(time = T.unsafe(nil)); end + + # @param tz [Object] an `Object` to compare this {Timezone} with. + # @return [Boolean] `true` if `tz` is an instance of {Timezone} and has the + # same {identifier} as `self`, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1113 + def eql?(tz); end + + # Returns {identifier}, modified to make it more readable. Set + # `skip_first_part` to omit the first part of the identifier (typically a + # region name) where there is more than one part. + # + # For example: + # + # TZInfo::Timezone.get('Europe/Paris').friendly_identifier(false) #=> "Europe - Paris" + # TZInfo::Timezone.get('Europe/Paris').friendly_identifier(true) #=> "Paris" + # TZInfo::Timezone.get('America/Indiana/Knox').friendly_identifier(false) #=> "America - Knox, Indiana" + # TZInfo::Timezone.get('America/Indiana/Knox').friendly_identifier(true) #=> "Knox, Indiana" + # + # @param skip_first_part [Boolean] whether the first part of the identifier + # (typically a region name) should be omitted. + # @return [String] the modified identifier. + # + # source://tzinfo//lib/tzinfo/timezone.rb#277 + def friendly_identifier(skip_first_part = T.unsafe(nil)); end + + # @return [Integer] a hash based on the {identifier}. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1118 + def hash; end + + # @return [String] the identifier of the time zone, for example, + # `"Europe/Paris"`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#241 + def identifier; end + + # @return [String] the internal object state as a programmer-readable + # `String`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#259 + def inspect; end + + # Creates a `DateTime` object based on the given (Gregorian calendar) date + # and time parameters. The parameters are interpreted as a local time in the + # time zone. The result has the appropriate `offset` and + # {DateTimeWithOffset#timezone_offset timezone_offset}. + # + # _Warning:_ There are time values that are not valid as local times in a + # time zone (for example, during the transition from standard time to + # daylight savings time). There are also time values that are ambiguous, + # occurring more than once with different offsets to UTC (for example, + # during the transition from daylight savings time to standard time). + # + # In the first case (an invalid local time), a {PeriodNotFound} exception + # will be raised. + # + # In the second case (more than one occurrence), an {AmbiguousTime} + # exception will be raised unless the optional `dst` parameter or block + # handles the ambiguity. + # + # If the ambiguity is due to a transition from daylight savings time to + # standard time, the `dst` parameter can be used to select whether the + # daylight savings time or local time is used. For example, the following + # code would raise an {AmbiguousTime} exception: + # + # tz = TZInfo::Timezone.get('America/New_York') + # tz.local_datetime(2004,10,31,1,30,0,0) + # + # Specifying `dst = true` would return a `Time` with a UTC offset of -4 + # hours and abbreviation EDT (Eastern Daylight Time). Specifying `dst = + # false` would return a `Time` with a UTC offset of -5 hours and + # abbreviation EST (Eastern Standard Time). + # + # The `dst` parameter will not be able to resolve an ambiguity resulting + # from the clocks being set back without changing from daylight savings time + # to standard time. In this case, if a block is specified, it will be called + # to resolve the ambiguity. The block must take a single parameter - an + # `Array` of {TimezonePeriod}s that need to be resolved. The block can + # select and return a single {TimezonePeriod} or return `nil` or an empty + # `Array` to cause an {AmbiguousTime} exception to be raised. + # + # The default value of the `dst` parameter can be specified using + # {Timezone.default_dst=}. + # + # values, interpreted as a local time in the time zone. + # + # @param hour [Integer] the hour (0-23). + # @param minute [Integer] the minute (0-59). + # @param second [Integer] the second (0-59). + # @param sub_second [Numeric] the fractional part of the second as either + # a `Rational` that is greater than or equal to 0 and less than 1, or + # the `Integer` 0. + # @param dst [Boolean] whether to resolve ambiguous local times by always + # selecting the period observing daylight savings time (`true`), always + # selecting the period observing standard time (`false`), or leaving the + # ambiguity unresolved (`nil`). + # @param month [Integer] the month (1-12). + # @param day [Integer] the day of the month (1-31). + # @param year [Integer] the year. + # @raise [RangeError] if `sub_second` is a `Rational` but that is less + # than 0 or greater than or equal to 1. + # @raise [PeriodNotFound] if the date and time parameters do not specify a + # valid local time in the time zone. + # @raise [AmbiguousTime] if the date and time parameters are ambiguous for + # the time zone and the `dst` parameter or block did not resolve the + # ambiguity. + # @raise [RangeError] if `month` is not between 1 and 12. + # @raise [ArgumentError] if either of `year`, `month`, `day`, `hour`, + # `minute`, or `second` is not an `Integer`. + # @raise [ArgumentError] if `sub_second` is not a `Rational`, or the + # `Integer` 0. + # @raise [ArgumentError] if `utc_offset` is not `nil`, not an `Integer` + # and not the `Symbol` `:utc`. + # @raise [RangeError] if `day` is not between 1 and 31. + # @raise [RangeError] if `hour` is not between 0 and 23. + # @raise [RangeError] if `minute` is not between 0 and 59. + # @raise [RangeError] if `second` is not between 0 and 59. + # @return [DateTimeWithOffset] a new `DateTime` object based on the given + # @yield [periods] if the `dst` parameter did not resolve an ambiguity, an + # optional block is yielded to. + # @yieldparam periods [Array] an `Array` containing all + # the {TimezonePeriod}s that still match `local_time` after applying the + # `dst` parameter. + # @yieldreturn [Object] to resolve the ambiguity: a chosen {TimezonePeriod} + # or an `Array` containing a chosen {TimezonePeriod}; to leave the + # ambiguity unresolved: an empty `Array`, an `Array` containing more than + # one {TimezonePeriod}, or `nil`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#831 + def local_datetime(year, month = T.unsafe(nil), day = T.unsafe(nil), hour = T.unsafe(nil), minute = T.unsafe(nil), second = T.unsafe(nil), sub_second = T.unsafe(nil), dst = T.unsafe(nil), &block); end + + # Creates a `Time` object based on the given (Gregorian calendar) date and + # time parameters. The parameters are interpreted as a local time in the + # time zone. The result has the appropriate `utc_offset`, `zone` and + # {TimeWithOffset#timezone_offset timezone_offset}. + # + # _Warning:_ There are time values that are not valid as local times in a + # time zone (for example, during the transition from standard time to + # daylight savings time). There are also time values that are ambiguous, + # occurring more than once with different offsets to UTC (for example, + # during the transition from daylight savings time to standard time). + # + # In the first case (an invalid local time), a {PeriodNotFound} exception + # will be raised. + # + # In the second case (more than one occurrence), an {AmbiguousTime} + # exception will be raised unless the optional `dst` parameter or block + # handles the ambiguity. + # + # If the ambiguity is due to a transition from daylight savings time to + # standard time, the `dst` parameter can be used to select whether the + # daylight savings time or local time is used. For example, the following + # code would raise an {AmbiguousTime} exception: + # + # tz = TZInfo::Timezone.get('America/New_York') + # tz.local_time(2004,10,31,1,30,0,0) + # + # Specifying `dst = true` would return a `Time` with a UTC offset of -4 + # hours and abbreviation EDT (Eastern Daylight Time). Specifying `dst = + # false` would return a `Time` with a UTC offset of -5 hours and + # abbreviation EST (Eastern Standard Time). + # + # The `dst` parameter will not be able to resolve an ambiguity resulting + # from the clocks being set back without changing from daylight savings time + # to standard time. In this case, if a block is specified, it will be called + # to resolve the ambiguity. The block must take a single parameter - an + # `Array` of {TimezonePeriod}s that need to be resolved. The block can + # select and return a single {TimezonePeriod} or return `nil` or an empty + # `Array` to cause an {AmbiguousTime} exception to be raised. + # + # The default value of the `dst` parameter can be specified using + # {Timezone.default_dst=}. + # + # @param hour [Integer] the hour (0-23). + # @param minute [Integer] the minute (0-59). + # @param second [Integer] the second (0-59). + # @param sub_second [Numeric] the fractional part of the second as either + # a `Rational` that is greater than or equal to 0 and less than 1, or + # the `Integer` 0. + # @param dst [Boolean] whether to resolve ambiguous local times by always + # selecting the period observing daylight savings time (`true`), always + # selecting the period observing standard time (`false`), or leaving the + # ambiguity unresolved (`nil`). + # @param month [Integer] the month (1-12). + # @param day [Integer] the day of the month (1-31). + # @param year [Integer] the year. + # @raise [RangeError] if `sub_second` is a `Rational` but that is less + # than 0 or greater than or equal to 1. + # @raise [PeriodNotFound] if the date and time parameters do not specify a + # valid local time in the time zone. + # @raise [AmbiguousTime] if the date and time parameters are ambiguous for + # the time zone and the `dst` parameter or block did not resolve the + # ambiguity. + # @raise [RangeError] if `month` is not between 1 and 12. + # @raise [ArgumentError] if either of `year`, `month`, `day`, `hour`, + # `minute`, or `second` is not an `Integer`. + # @raise [ArgumentError] if `sub_second` is not a `Rational`, or the + # `Integer` 0. + # @raise [ArgumentError] if `utc_offset` is not `nil`, not an `Integer` + # and not the `Symbol` `:utc`. + # @raise [RangeError] if `day` is not between 1 and 31. + # @raise [RangeError] if `hour` is not between 0 and 23. + # @raise [RangeError] if `minute` is not between 0 and 59. + # @raise [RangeError] if `second` is not between 0 and 59. + # @return [TimeWithOffset] a new `Time` object based on the given values, + # interpreted as a local time in the time zone. + # @yield [periods] if the `dst` parameter did not resolve an ambiguity, an + # optional block is yielded to. + # @yieldparam periods [Array] an `Array` containing all + # the {TimezonePeriod}s that still match `local_time` after applying the + # `dst` parameter. + # @yieldreturn [Object] to resolve the ambiguity: a chosen {TimezonePeriod} + # or an `Array` containing a chosen {TimezonePeriod}; to leave the + # ambiguity unresolved: an empty `Array`, an `Array` containing more than + # one {TimezonePeriod}, or `nil`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#743 + def local_time(year, month = T.unsafe(nil), day = T.unsafe(nil), hour = T.unsafe(nil), minute = T.unsafe(nil), second = T.unsafe(nil), sub_second = T.unsafe(nil), dst = T.unsafe(nil), &block); end + + # Creates a {Timestamp} object based on the given (Gregorian calendar) date + # and time parameters. The parameters are interpreted as a local time in the + # time zone. The result has the appropriate {Timestamp#utc_offset + # utc_offset} and {TimestampWithOffset#timezone_offset timezone_offset}. + # + # _Warning:_ There are time values that are not valid as local times in a + # time zone (for example, during the transition from standard time to + # daylight savings time). There are also time values that are ambiguous, + # occurring more than once with different offsets to UTC (for example, + # during the transition from daylight savings time to standard time). + # + # In the first case (an invalid local time), a {PeriodNotFound} exception + # will be raised. + # + # In the second case (more than one occurrence), an {AmbiguousTime} + # exception will be raised unless the optional `dst` parameter or block + # handles the ambiguity. + # + # If the ambiguity is due to a transition from daylight savings time to + # standard time, the `dst` parameter can be used to select whether the + # daylight savings time or local time is used. For example, the following + # code would raise an {AmbiguousTime} exception: + # + # tz = TZInfo::Timezone.get('America/New_York') + # tz.local_timestamp(2004,10,31,1,30,0,0) + # + # Specifying `dst = true` would return a `Time` with a UTC offset of -4 + # hours and abbreviation EDT (Eastern Daylight Time). Specifying `dst = + # false` would return a `Time` with a UTC offset of -5 hours and + # abbreviation EST (Eastern Standard Time). + # + # The `dst` parameter will not be able to resolve an ambiguity resulting + # from the clocks being set back without changing from daylight savings time + # to standard time. In this case, if a block is specified, it will be called + # to resolve the ambiguity. The block must take a single parameter - an + # `Array` of {TimezonePeriod}s that need to be resolved. The block can + # select and return a single {TimezonePeriod} or return `nil` or an empty + # `Array` to cause an {AmbiguousTime} exception to be raised. + # + # The default value of the `dst` parameter can be specified using + # {Timezone.default_dst=}. + # + # @param hour [Integer] the hour (0-23). + # @param minute [Integer] the minute (0-59). + # @param second [Integer] the second (0-59). + # @param sub_second [Numeric] the fractional part of the second as either + # a `Rational` that is greater than or equal to 0 and less than 1, or + # the `Integer` 0. + # @param dst [Boolean] whether to resolve ambiguous local times by always + # selecting the period observing daylight savings time (`true`), always + # selecting the period observing standard time (`false`), or leaving the + # ambiguity unresolved (`nil`). + # @param month [Integer] the month (1-12). + # @param day [Integer] the day of the month (1-31). + # @param year [Integer] the year. + # @raise [RangeError] if `sub_second` is a `Rational` but that is less + # than 0 or greater than or equal to 1. + # @raise [PeriodNotFound] if the date and time parameters do not specify a + # valid local time in the time zone. + # @raise [AmbiguousTime] if the date and time parameters are ambiguous for + # the time zone and the `dst` parameter or block did not resolve the + # ambiguity. + # @raise [RangeError] if `month` is not between 1 and 12. + # @raise [ArgumentError] if either of `year`, `month`, `day`, `hour`, + # `minute`, or `second` is not an `Integer`. + # @raise [ArgumentError] if `sub_second` is not a `Rational`, or the + # `Integer` 0. + # @raise [ArgumentError] if `utc_offset` is not `nil`, not an `Integer` + # and not the `Symbol` `:utc`. + # @raise [RangeError] if `day` is not between 1 and 31. + # @raise [RangeError] if `hour` is not between 0 and 23. + # @raise [RangeError] if `minute` is not between 0 and 59. + # @raise [RangeError] if `second` is not between 0 and 59. + # @return [TimestampWithOffset] a new {Timestamp} object based on the given + # values, interpreted as a local time in the time zone. + # @yield [periods] if the `dst` parameter did not resolve an ambiguity, an + # optional block is yielded to. + # @yieldparam periods [Array] an `Array` containing all + # the {TimezonePeriod}s that still match `local_time` after applying the + # `dst` parameter. + # @yieldreturn [Object] to resolve the ambiguity: a chosen {TimezonePeriod} + # or an `Array` containing a chosen {TimezonePeriod}; to leave the + # ambiguity unresolved: an empty `Array`, an `Array` containing more than + # one {TimezonePeriod}, or `nil`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#919 + def local_timestamp(year, month = T.unsafe(nil), day = T.unsafe(nil), hour = T.unsafe(nil), minute = T.unsafe(nil), second = T.unsafe(nil), sub_second = T.unsafe(nil), dst = T.unsafe(nil), &block); end + + # Converts a local time for the time zone to UTC. + # + # The result will either be a `Time`, `DateTime` or {Timestamp} according to + # the type of the `local_time` parameter. + # + # The UTC offset of the `local_time` parameter is ignored (it is treated as + # a time in the time zone represented by `self`). + # + # _Warning:_ There are local times that have no equivalent UTC times (for + # example, during the transition from standard time to daylight savings + # time). There are also local times that have more than one UTC equivalent + # (for example, during the transition from daylight savings time to standard + # time). + # + # In the first case (no equivalent UTC time), a {PeriodNotFound} exception + # will be raised. + # + # In the second case (more than one equivalent UTC time), an {AmbiguousTime} + # exception will be raised unless the optional `dst` parameter or block + # handles the ambiguity. + # + # If the ambiguity is due to a transition from daylight savings time to + # standard time, the `dst` parameter can be used to select whether the + # daylight savings time or local time is used. For example, the following + # code would raise an {AmbiguousTime} exception: + # + # tz = TZInfo::Timezone.get('America/New_York') + # tz.period_for_local(Time.new(2004,10,31,1,30,0)) + # + # Specifying `dst = true` would select the daylight savings period from + # April to October 2004. Specifying `dst = false` would return the + # standard time period from October 2004 to April 2005. + # + # The `dst` parameter will not be able to resolve an ambiguity resulting + # from the clocks being set back without changing from daylight savings time + # to standard time. In this case, if a block is specified, it will be called + # to resolve the ambiguity. The block must take a single parameter - an + # `Array` of {TimezonePeriod}s that need to be resolved. The block can + # select and return a single {TimezonePeriod} or return `nil` or an empty + # `Array` to cause an {AmbiguousTime} exception to be raised. + # + # The default value of the `dst` parameter can be specified using + # {Timezone.default_dst=}. + # + # @param dst [Boolean] whether to resolve ambiguous local times by always + # selecting the period observing daylight savings time (`true`), always + # selecting the period observing standard time (`false`), or leaving the + # ambiguity unresolved (`nil`). + # @param local_time [Object] a `Time`, `DateTime` or {Timestamp}. + # @raise [PeriodNotFound] if `local_time` is not valid for the time zone + # (there is no equivalent UTC time). + # @raise [AmbiguousTime] if `local_time` was ambiguous for the time zone and + # the `dst` parameter or block did not resolve the ambiguity. + # @raise [ArgumentError] if `local_time` is `nil`. + # @return [Object] the UTC equivalent of `local_time` as a `Time`, + # `DateTime` or {Timestamp}. + # @yield [periods] if the `dst` parameter did not resolve an ambiguity, an + # optional block is yielded to. + # @yieldparam periods [Array] an `Array` containing all + # the {TimezonePeriod}s that still match `local_time` after applying the + # `dst` parameter. + # @yieldreturn [Object] to resolve the ambiguity: a chosen {TimezonePeriod} + # or an `Array` containing a chosen {TimezonePeriod}; to leave the + # ambiguity unresolved: an empty `Array`, an `Array` containing more than + # one {TimezonePeriod}, or `nil`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#645 + def local_to_utc(local_time, dst = T.unsafe(nil)); end + + # @return [String] the identifier of the time zone, for example, + # `"Europe/Paris"`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#247 + def name; end + + # @return [TimeWithOffset] the current local time in the time zone. + # + # source://tzinfo//lib/tzinfo/timezone.rb#992 + def now; end + + # Returns the observed offset from UTC in seconds at the given time. This + # includes adjustments made for daylight savings time. + # + # @param time [Object] a `Time`, `DateTime` or `Timestamp`. + # @raise [ArgumentError] if `time` is `nil`. + # @raise [ArgumentError] if `time` is a {Timestamp} with an unspecified UTC + # offset. + # @return [Integer] the observed offset from UTC in seconds at the given + # time. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1094 + def observed_utc_offset(time = T.unsafe(nil)); end + + # Returns the unique offsets used by the time zone up to a given time (`to`) + # as an `Array` of {TimezoneOffset} instances. + # + # A from time may also be supplied using the `from` parameter. If from is + # not `nil`, only offsets used from that time onwards will be returned. + # + # Comparisons with `to` are exclusive. Comparisons with `from` are + # inclusive. + # + # @param to [Object] a `Time`, `DateTime` or {Timestamp} specifying the + # latest (exclusive) offset to return. + # @param from [Object] an optional `Time`, `DateTime` or {Timestamp} + # specifying the earliest (inclusive) offset to return. + # @raise [ArgumentError] if `from` is specified and `to` is not greater than + # `from`. + # @raise [ArgumentError] is raised if `to` is `nil`. + # @raise [ArgumentError] if either `to` or `from` is a {Timestamp} with an + # unspecified offset. + # @return [Array] the offsets that are used earlier than + # `to` and, if specified, at or later than `from`. Offsets may be returned + # in any order. + # + # source://tzinfo//lib/tzinfo/timezone.rb#947 + def offsets_up_to(to, from = T.unsafe(nil)); end + + # Returns the {TimezonePeriod} that is valid at a given time. + # + # Unlike {period_for_local} and {period_for_utc}, the UTC offset of the + # `time` parameter is taken into consideration. + # + # @param time [Object] a `Time`, `DateTime` or {Timestamp}. + # @raise [ArgumentError] if `time` is `nil`. + # @raise [ArgumentError] if `time` is a {Timestamp} with an unspecified + # offset. + # @return [TimezonePeriod] the {TimezonePeriod} that is valid at `time`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#319 + def period_for(time); end + + # Returns the {TimezonePeriod} that is valid at the given local time. + # + # The UTC offset of the `local_time` parameter is ignored (it is treated as + # a time in the time zone represented by `self`). Use the {period_for} + # method instead if the the UTC offset of the time needs to be taken into + # consideration. + # + # _Warning:_ There are local times that have no equivalent UTC times (for + # example, during the transition from standard time to daylight savings + # time). There are also local times that have more than one UTC equivalent + # (for example, during the transition from daylight savings time to standard + # time). + # + # In the first case (no equivalent UTC time), a {PeriodNotFound} exception + # will be raised. + # + # In the second case (more than one equivalent UTC time), an {AmbiguousTime} + # exception will be raised unless the optional `dst` parameter or block + # handles the ambiguity. + # + # If the ambiguity is due to a transition from daylight savings time to + # standard time, the `dst` parameter can be used to select whether the + # daylight savings time or local time is used. For example, the following + # code would raise an {AmbiguousTime} exception: + # + # tz = TZInfo::Timezone.get('America/New_York') + # tz.period_for_local(Time.new(2004,10,31,1,30,0)) + # + # Specifying `dst = true` would select the daylight savings period from + # April to October 2004. Specifying `dst = false` would return the + # standard time period from October 2004 to April 2005. + # + # The `dst` parameter will not be able to resolve an ambiguity resulting + # from the clocks being set back without changing from daylight savings time + # to standard time. In this case, if a block is specified, it will be called + # to resolve the ambiguity. The block must take a single parameter - an + # `Array` of {TimezonePeriod}s that need to be resolved. The block can + # select and return a single {TimezonePeriod} or return `nil` or an empty + # `Array` to cause an {AmbiguousTime} exception to be raised. + # + # The default value of the `dst` parameter can be specified using + # {Timezone.default_dst=}. + # + # @param dst [Boolean] whether to resolve ambiguous local times by always + # selecting the period observing daylight savings time (`true`), always + # selecting the period observing standard time (`false`), or leaving the + # ambiguity unresolved (`nil`). + # @param local_time [Object] a `Time`, `DateTime` or {Timestamp}. + # @raise [PeriodNotFound] if `local_time` is not valid for the time zone + # (there is no equivalent UTC time). + # @raise [AmbiguousTime] if `local_time` was ambiguous for the time zone and + # the `dst` parameter or block did not resolve the ambiguity. + # @raise [ArgumentError] if `local_time` is `nil`. + # @return [TimezonePeriod] the {TimezonePeriod} that is valid at + # `local_time`. + # @yield [periods] if the `dst` parameter did not resolve an ambiguity, an + # optional block is yielded to. + # @yieldparam periods [Array] an `Array` containing all + # the {TimezonePeriod}s that still match `local_time` after applying the + # `dst` parameter. + # @yieldreturn [Object] to resolve the ambiguity: a chosen {TimezonePeriod} + # or an `Array` containing a chosen {TimezonePeriod}; to leave the + # ambiguity unresolved: an empty `Array`, an `Array` containing more than + # one {TimezonePeriod}, or `nil`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#494 + def period_for_local(local_time, dst = T.unsafe(nil)); end + + # Returns the {TimezonePeriod} that is valid at a given time. + # + # The UTC offset of the `utc_time` parameter is ignored (it is treated as a + # UTC time). Use the {period_for} method instead if the UTC offset of the + # time needs to be taken into consideration. + # + # @param utc_time [Object] a `Time`, `DateTime` or {Timestamp}. + # @raise [ArgumentError] if `utc_time` is `nil`. + # @return [TimezonePeriod] the {TimezonePeriod} that is valid at `utc_time`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#425 + def period_for_utc(utc_time); end + + # Returns the set of {TimezonePeriod}s that are valid for the given + # local time as an `Array`. + # + # The UTC offset of the `local_time` parameter is ignored (it is treated as + # a time in the time zone represented by `self`). + # + # This will typically return an `Array` containing a single + # {TimezonePeriod}. More than one {TimezonePeriod} will be returned when the + # local time is ambiguous (for example, when daylight savings time ends). An + # empty `Array` will be returned when the local time is not valid (for + # example, when daylight savings time begins). + # + # To obtain just a single {TimezonePeriod} in all cases, use + # {period_for_local} instead and specify how ambiguities should be resolved. + # + # @param local_time [Object] a `Time`, `DateTime` or {Timestamp}. + # @raise [ArgumentError] if `local_time` is `nil`. + # @return [Array] the set of {TimezonePeriod}s that are + # valid at `local_time`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#342 + def periods_for_local(local_time); end + + # Converts a time to local time for the time zone and returns a `String` + # representation of the local time according to the given format. + # + # `Timezone#strftime` first expands any occurrences of `%Z` in the format + # string to the time zone abbreviation for the local time (for example, EST + # or EDT). Depending on the type of `time` parameter, the result of the + # expansion is then passed to either `Time#strftime`, `DateTime#strftime` or + # `Timestamp#strftime` to handle any other format directives. + # + # This method is equivalent to the following: + # + # time_zone.to_local(time).strftime(format) + # + # @param format [String] the format string. + # @param time [Object] a `Time`, `DateTime` or `Timestamp`. + # @raise [ArgumentError] if `format` or `time` is `nil`. + # @raise [ArgumentError] if `time` is a {Timestamp} with an unspecified UTC + # offset. + # @return [String] the formatted local time. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1039 + def strftime(format, time = T.unsafe(nil)); end + + # Converts a time to the local time for the time zone. + # + # The result will be of type {TimeWithOffset} (if passed a `Time`), + # {DateTimeWithOffset} (if passed a `DateTime`) or {TimestampWithOffset} (if + # passed a {Timestamp}). {TimeWithOffset}, {DateTimeWithOffset} and + # {TimestampWithOffset} are subclasses of `Time`, `DateTime` and {Timestamp} + # that provide additional information about the local result. + # + # Unlike {utc_to_local}, {to_local} takes the UTC offset of the given time + # into consideration. + # + # @param time [Object] a `Time`, `DateTime` or {Timestamp}. + # @raise [ArgumentError] if `time` is `nil`. + # @raise [ArgumentError] if `time` is a {Timestamp} that does not have a + # specified UTC offset. + # @return [Object] the local equivalent of `time` as a {TimeWithOffset}, + # {DateTimeWithOffset} or {TimestampWithOffset}. + # + # source://tzinfo//lib/tzinfo/timezone.rb#548 + def to_local(time); end + + # @return [String] {identifier}, modified to make it more readable. + # + # source://tzinfo//lib/tzinfo/timezone.rb#253 + def to_s; end + + # Returns an `Array` of {TimezoneTransition} instances representing the + # times where the UTC offset of the timezone changes. + # + # Transitions are returned up to a given time (`to`). + # + # A from time may also be supplied using the `from` parameter. If from is + # not `nil`, only transitions from that time onwards will be returned. + # + # Comparisons with `to` are exclusive. Comparisons with `from` are + # inclusive. If a transition falls precisely on `to`, it will be excluded. + # If a transition falls on `from`, it will be included. + # + # @param to [Object] a `Time`, `DateTime` or {Timestamp} specifying the + # latest (exclusive) transition to return. + # @param from [Object] an optional `Time`, `DateTime` or {Timestamp} + # specifying the earliest (inclusive) transition to return. + # @raise [ArgumentError] if `from` is specified and `to` is not greater than + # `from`. + # @raise [ArgumentError] is raised if `to` is `nil`. + # @raise [ArgumentError] if either `to` or `from` is a {Timestamp} with an + # unspecified offset. + # @return [Array] the transitions that are earlier than + # `to` and, if specified, at or later than `from`. Transitions are ordered + # by when they occur, from earliest to latest. + # + # source://tzinfo//lib/tzinfo/timezone.rb#370 + def transitions_up_to(to, from = T.unsafe(nil)); end + + # Returns the observed offset from UTC in seconds at the given time. This + # includes adjustments made for daylight savings time. + # + # @param time [Object] a `Time`, `DateTime` or `Timestamp`. + # @raise [ArgumentError] if `time` is `nil`. + # @raise [ArgumentError] if `time` is a {Timestamp} with an unspecified UTC + # offset. + # @return [Integer] the observed offset from UTC in seconds at the given + # time. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1094 + def utc_offset(time = T.unsafe(nil)); end + + # Converts a time in UTC to the local time for the time zone. + # + # The result will be of type {TimeWithOffset} (if passed a `Time`), + # {DateTimeWithOffset} (if passed a `DateTime`) or {TimestampWithOffset} (if + # passed a {Timestamp}). {TimeWithOffset}, {DateTimeWithOffset} and + # {TimestampWithOffset} are subclasses of `Time`, `DateTime` and {Timestamp} + # that provide additional information about the local result. + # + # The UTC offset of the `utc_time` parameter is ignored (it is treated as a + # UTC time). Use the {to_local} method instead if the the UTC offset of the + # time needs to be taken into consideration. + # + # @param utc_time [Object] a `Time`, `DateTime` or {Timestamp}. + # @raise [ArgumentError] if `utc_time` is `nil`. + # @return [Object] the local equivalent of `utc_time` as a {TimeWithOffset}, + # {DateTimeWithOffset} or {TimestampWithOffset}. + # + # source://tzinfo//lib/tzinfo/timezone.rb#572 + def utc_to_local(utc_time); end + + private + + # Raises an {UnknownTimezone} exception. + # + # @raise [UnknownTimezone] always. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1156 + def raise_unknown_timezone; end + + class << self + # Loads a {Timezone} from the serialized representation returned by {_dump}. + # This is method is called when using `Marshal.load` or `Marshal.restore` + # to restore a serialized {Timezone}. + # + # @param data [String] a serialized representation of a {Timezone}. + # @return [Timezone] the result of converting `data` back into a {Timezone}. + # + # source://tzinfo//lib/tzinfo/timezone.rb#1147 + def _load(data); end + + # Returns an `Array` of all the available time zones. + # + # {TimezoneProxy} instances are returned to avoid the overhead of loading + # time zone data until it is first needed. + # + # @return [Array] all available time zones. + # + # source://tzinfo//lib/tzinfo/timezone.rb#151 + def all; end + + # Returns an `Array` of the identifiers of all the time zones that are + # observed by at least one {Country}. This is not the complete set of time + # zone identifiers as some are not country specific (e.g. `'Etc/GMT'`). + # + # {TimezoneProxy} instances are returned to avoid the overhead of loading + # time zone data until it is first needed. + # + # zones that are observed by at least one {Country}. + # + # @return [Array] an `Array` of the identifiers of all the time + # + # source://tzinfo//lib/tzinfo/timezone.rb#219 + def all_country_zone_identifiers; end + + # Returns an `Array` of all the time zones that are observed by at least + # one {Country}. This is not the complete set of time zones as some are + # not country specific (e.g. `'Etc/GMT'`). + # + # {TimezoneProxy} instances are returned to avoid the overhead of loading + # time zone data until it is first needed. + # + # @return [Array] an `Array` of all the time zones that are + # observed by at least one {Country}. + # + # source://tzinfo//lib/tzinfo/timezone.rb#206 + def all_country_zones; end + + # time zones that are defined by offsets and transitions. + # + # @return [Array] an `Array` of the identifiers of all available + # + # source://tzinfo//lib/tzinfo/timezone.rb#175 + def all_data_zone_identifiers; end + + # Returns an `Array` of all the available time zones that are + # defined by offsets and transitions. + # + # {TimezoneProxy} instances are returned to avoid the overhead of loading + # time zone data until it is first needed. + # + # @return [Array] an `Array` of all the available time zones + # that are defined by offsets and transitions. + # + # source://tzinfo//lib/tzinfo/timezone.rb#169 + def all_data_zones; end + + # @return [Array] an `Array` containing the identifiers of all the + # available time zones. + # + # source://tzinfo//lib/tzinfo/timezone.rb#157 + def all_identifiers; end + + # time zones that are defined as links to / aliases for other time zones. + # + # @return [Array] an `Array` of the identifiers of all available + # + # source://tzinfo//lib/tzinfo/timezone.rb#193 + def all_linked_zone_identifiers; end + + # Returns an `Array` of all the available time zones that are + # defined as links to / aliases for other time zones. + # + # {TimezoneProxy} instances are returned to avoid the overhead of loading + # time zone data until it is first needed. + # + # @return [Array] an `Array` of all the available time zones + # that are defined as links to / aliases for other time zones. + # + # source://tzinfo//lib/tzinfo/timezone.rb#187 + def all_linked_zones; end + + # Returns the default value of the optional `dst` parameter of the + # {local_time}, {local_datetime} and {local_timestamp}, {local_to_utc} + # and {period_for_local} methods (`nil`, `true` or `false`). + # + # {default_dst} defaults to `nil` unless changed with {default_dst=}. + # + # @return [Boolean] the default value of the optional `dst` parameter of + # the {local_time}, {local_datetime} and {local_timestamp}, + # {local_to_utc} and {period_for_local} methods (`nil`, `true` or + # `false`). + # + # source://tzinfo//lib/tzinfo/timezone.rb#110 + def default_dst; end + + # Sets the default value of the optional `dst` parameter of the + # {local_datetime}, {local_time}, {local_timestamp}, {local_to_utc} and + # {period_for_local} methods. Can be set to `nil`, `true` or `false`. + # + # @param value [Boolean] `nil`, `true` or `false`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#96 + def default_dst=(value); end + + # Returns a time zone by its IANA Time Zone Database identifier (e.g. + # `"Europe/London"` or `"America/Chicago"`). Call {all_identifiers} for a + # list of all the valid identifiers. + # + # The {get} method will return a subclass of {Timezone}, either a + # {DataTimezone} (for a time zone defined by rules that set out when + # transitions occur) or a {LinkedTimezone} (for a time zone that is just a + # link to or alias for a another time zone). + # + # @param identifier [String] an IANA Time Zone Database time zone + # identifier. + # @raise [InvalidTimezoneIdentifier] if the `identifier` is not valid. + # @return [Timezone] the {Timezone} with the given `identifier`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#127 + def get(identifier); end + + # Returns a proxy for the time zone with the given identifier. This allows + # loading of the time zone data to be deferred until it is first needed. + # + # The identifier will not be validated. If an invalid identifier is + # specified, no exception will be raised until the proxy is used. + # + # @param identifier [String] an IANA Time Zone Database time zone + # identifier. + # @return [TimezoneProxy] a proxy for the time zone with the given + # `identifier`. + # + # source://tzinfo//lib/tzinfo/timezone.rb#141 + def get_proxy(identifier); end + + private + + # @return [DataSource] the current DataSource. + # + # source://tzinfo//lib/tzinfo/timezone.rb#234 + def data_source; end + + # @param identifiers [Enumerable] an `Enumerable` of time zone + # identifiers. + # @return [Array] an `Array` of {TimezoneProxy} + # instances corresponding to the given identifiers. + # + # source://tzinfo//lib/tzinfo/timezone.rb#229 + def get_proxies(identifiers); end + end +end + +# Alias used by TZInfo::Data format1 releases. +# +# @private +# +# source://tzinfo//lib/tzinfo/format1/timezone_definition.rb#37 +TZInfo::TimezoneDefinition = TZInfo::Format1::TimezoneDefinition + +# Alias used by TZInfo::Data format 1 releases. +# +# @private +# +# source://tzinfo//lib/tzinfo/format1/timezone_index_definition.rb#75 +TZInfo::TimezoneIndexDefinition = TZInfo::Format1::TimezoneIndexDefinition + +# Represents an offset from UTC observed by a time zone. +# +# source://tzinfo//lib/tzinfo/timezone_offset.rb#6 +class TZInfo::TimezoneOffset + # Initializes a new {TimezoneOffset}. + # + # {TimezoneOffset} instances should not normally be constructed manually. + # + # The passed in `abbreviation` instance will be frozen. + # + # @param base_utc_offset [Integer] the base offset from UTC in seconds. + # @param std_offset [Integer] the offset from standard time in seconds. + # @param abbreviation [String] the abbreviation identifying the offset. + # @return [TimezoneOffset] a new instance of TimezoneOffset + # + # source://tzinfo//lib/tzinfo/timezone_offset.rb#62 + def initialize(base_utc_offset, std_offset, abbreviation); end + + # Determines if this {TimezoneOffset} is equal to another instance. + # + # @param toi [Object] the instance to test for equality. + # @return [Boolean] `true` if `toi` is a {TimezoneOffset} with the same + # {utc_offset}, {std_offset} and {abbreviation} as this {TimezoneOffset}, + # otherwise `false`. + # + # source://tzinfo//lib/tzinfo/timezone_offset.rb#84 + def ==(toi); end + + # The abbreviation that identifies this offset. For example GMT + # (Greenwich Mean Time) or BST (British Summer Time) for Europe/London. + # + # @return [String] the abbreviation that identifies this offset. + # + # source://tzinfo//lib/tzinfo/timezone_offset.rb#50 + def abbr; end + + # The abbreviation that identifies this offset. For example GMT + # (Greenwich Mean Time) or BST (British Summer Time) for Europe/London. + # + # @return [String] the abbreviation that identifies this offset. + # + # source://tzinfo//lib/tzinfo/timezone_offset.rb#50 + def abbreviation; end + + # Returns the base offset from UTC in seconds (`observed_utc_offset - + # std_offset`). This does not include any adjustment made for daylight + # savings time and will typically remain constant throughout the year. + # + # To obtain the currently observed offset from UTC, including the effect of + # daylight savings time, use {observed_utc_offset} instead. + # + # If you require accurate {base_utc_offset} values, you should install the + # tzinfo-data gem and set {DataSources::RubyDataSource} as the {DataSource}. + # When using {DataSources::ZoneinfoDataSource}, the value of + # {base_utc_offset} has to be derived from changes to the observed UTC + # offset and DST status since it is not included in zoneinfo files. + # + # @return [Integer] the base offset from UTC in seconds. + # + # source://tzinfo//lib/tzinfo/timezone_offset.rb#21 + def base_utc_offset; end + + # Determines if daylight savings is in effect (i.e. if {std_offset} is + # non-zero). + # + # @return [Boolean] `true` if {std_offset} is non-zero, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/timezone_offset.rb#74 + def dst?; end + + # Determines if this {TimezoneOffset} is equal to another instance. + # + # @param toi [Object] the instance to test for equality. + # @return [Boolean] `true` if `toi` is a {TimezoneOffset} with the same + # {utc_offset}, {std_offset} and {abbreviation} as this {TimezoneOffset}, + # otherwise `false`. + # + # source://tzinfo//lib/tzinfo/timezone_offset.rb#95 + def eql?(toi); end + + # @return [Integer] a hash based on {utc_offset}, {std_offset} and + # {abbreviation}. + # + # source://tzinfo//lib/tzinfo/timezone_offset.rb#101 + def hash; end + + # @return [String] the internal object state as a programmer-readable + # `String`. + # + # source://tzinfo//lib/tzinfo/timezone_offset.rb#107 + def inspect; end + + # Returns the observed offset from UTC in seconds (`base_utc_offset + + # std_offset`). This includes adjustments made for daylight savings time. + # + # @return [Integer] the observed offset from UTC in seconds. + # + # source://tzinfo//lib/tzinfo/timezone_offset.rb#43 + def observed_utc_offset; end + + # Returns the offset from the time zone's standard time in seconds + # (`observed_utc_offset - base_utc_offset`). Zero when daylight savings time + # is not in effect. Non-zero (usually 3600 = 1 hour) if daylight savings is + # being observed. + # + # If you require accurate {std_offset} values, you should install the + # tzinfo-data gem and set {DataSources::RubyDataSource} as the {DataSource}. + # When using {DataSources::ZoneinfoDataSource}, the value of {std_offset} + # has to be derived from changes to the observed UTC offset and DST status + # since it is not included in zoneinfo files. + # + # @return [Integer] the offset from the time zone's standard time in + # seconds. + # + # source://tzinfo//lib/tzinfo/timezone_offset.rb#37 + def std_offset; end + + # Returns the base offset from UTC in seconds (`observed_utc_offset - + # std_offset`). This does not include any adjustment made for daylight + # savings time and will typically remain constant throughout the year. + # + # To obtain the currently observed offset from UTC, including the effect of + # daylight savings time, use {observed_utc_offset} instead. + # + # If you require accurate {base_utc_offset} values, you should install the + # tzinfo-data gem and set {DataSources::RubyDataSource} as the {DataSource}. + # When using {DataSources::ZoneinfoDataSource}, the value of + # {base_utc_offset} has to be derived from changes to the observed UTC + # offset and DST status since it is not included in zoneinfo files. + # + # @return [Integer] the base offset from UTC in seconds. + # + # source://tzinfo//lib/tzinfo/timezone_offset.rb#21 + def utc_offset; end + + # Returns the observed offset from UTC in seconds (`base_utc_offset + + # std_offset`). This includes adjustments made for daylight savings time. + # + # @return [Integer] the observed offset from UTC in seconds. + # + # source://tzinfo//lib/tzinfo/timezone_offset.rb#43 + def utc_total_offset; end +end + +# {TimezonePeriod} represents a period of time for a time zone where the same +# offset from UTC applies. It provides access to the observed offset, time +# zone abbreviation, start time and end time. +# +# The period of time can be unbounded at the start, end, or both the start +# and end. +# +# @abstract Time zone period data will returned as an instance of one of the +# subclasses of {TimezonePeriod}. +# +# source://tzinfo//lib/tzinfo/timezone_period.rb#14 +class TZInfo::TimezonePeriod + # Initializes a {TimezonePeriod}. + # + # @param offset [TimezoneOffset] the offset that is observed for the period + # of time. + # @raise [ArgumentError] if `offset` is `nil`. + # @return [TimezonePeriod] a new instance of TimezonePeriod + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#23 + def initialize(offset); end + + # The abbreviation that identifies this offset. For example GMT + # (Greenwich Mean Time) or BST (British Summer Time) for Europe/London. + # + # @return [String] the abbreviation that identifies this offset. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#80 + def abbr; end + + # The abbreviation that identifies this offset. For example GMT + # (Greenwich Mean Time) or BST (British Summer Time) for Europe/London. + # + # @return [String] the abbreviation that identifies this offset. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#80 + def abbreviation; end + + # Returns the base offset from UTC in seconds (`observed_utc_offset - + # std_offset`). This does not include any adjustment made for daylight + # savings time and will typically remain constant throughout the year. + # + # To obtain the currently observed offset from UTC, including the effect of + # daylight savings time, use {observed_utc_offset} instead. + # + # If you require accurate {base_utc_offset} values, you should install the + # tzinfo-data gem and set {DataSources::RubyDataSource} as the {DataSource}. + # When using {DataSources::ZoneinfoDataSource}, the value of + # {base_utc_offset} has to be derived from changes to the observed UTC + # offset and DST status since it is not included in zoneinfo files. + # + # @return [Integer] the base offset from UTC in seconds. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#54 + def base_utc_offset; end + + # Determines if daylight savings is in effect (i.e. if {std_offset} is + # non-zero). + # + # @return [Boolean] `true` if {std_offset} is non-zero, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#99 + def dst?; end + + # @return [TimezoneTransition] the transition that defines the end of this + # {TimezonePeriod} (`nil` if the end is unbounded). + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#36 + def end_transition; end + + # Returns the UTC end time of the period or `nil` if the end of the period + # is unbounded. + # + # The result is returned as a {Timestamp}. To obtain the end time as a + # `Time` or `DateTime`, call either {Timestamp#to_time to_time} or + # {Timestamp#to_datetime to_datetime} on the result. + # + # @return [Timestamp] the UTC end time of the period or `nil` if the end of + # the period is unbounded. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#125 + def ends_at; end + + # Returns the local end time of the period or `nil` if the end of the period + # is unbounded. + # + # The result is returned as a {TimestampWithOffset}. To obtain the end time + # as a `Time` or `DateTime`, call either {TimestampWithOffset#to_time + # to_time} or {TimestampWithOffset#to_datetime to_datetime} on the result. + # + # @return [TimestampWithOffset] the local end time of the period or `nil` if + # the end of the period is unbounded. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#151 + def local_ends_at; end + + # Returns the local start time of the period or `nil` if the start of the + # period is unbounded. + # + # The result is returned as a {TimestampWithOffset}. To obtain the start + # time as a `Time` or `DateTime`, call either {TimestampWithOffset#to_time + # to_time} or {TimestampWithOffset#to_datetime to_datetime} on the result. + # + # @return [TimestampWithOffset] the local start time of the period or `nil` + # if the start of the period is unbounded. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#138 + def local_starts_at; end + + # Returns the observed offset from UTC in seconds (`base_utc_offset + + # std_offset`). This includes adjustments made for daylight savings time. + # + # @return [Integer] the observed offset from UTC in seconds. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#90 + def observed_utc_offset; end + + # @return [TimezoneOffset] the offset that applies in the period of time. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#16 + def offset; end + + # @return [TimezoneTransition] the transition that defines the start of this + # {TimezonePeriod} (`nil` if the start is unbounded). + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#30 + def start_transition; end + + # Returns the UTC start time of the period or `nil` if the start of the + # period is unbounded. + # + # The result is returned as a {Timestamp}. To obtain the start time as a + # `Time` or `DateTime`, call either {Timestamp#to_time to_time} or + # {Timestamp#to_datetime to_datetime} on the result. + # + # @return [Timestamp] the UTC start time of the period or `nil` if the start + # of the period is unbounded. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#112 + def starts_at; end + + # Returns the offset from the time zone's standard time in seconds + # (`observed_utc_offset - base_utc_offset`). Zero when daylight savings time + # is not in effect. Non-zero (usually 3600 = 1 hour) if daylight savings is + # being observed. + # + # If you require accurate {std_offset} values, you should install the + # tzinfo-data gem and set {DataSources::RubyDataSource} as the {DataSource}. + # When using {DataSources::ZoneinfoDataSource}, the value of {std_offset} + # has to be derived from changes to the observed UTC offset and DST status + # since it is not included in zoneinfo files. + # + # @return [Integer] the offset from the time zone's standard time in + # seconds. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#72 + def std_offset; end + + # Returns the base offset from UTC in seconds (`observed_utc_offset - + # std_offset`). This does not include any adjustment made for daylight + # savings time and will typically remain constant throughout the year. + # + # To obtain the currently observed offset from UTC, including the effect of + # daylight savings time, use {observed_utc_offset} instead. + # + # If you require accurate {base_utc_offset} values, you should install the + # tzinfo-data gem and set {DataSources::RubyDataSource} as the {DataSource}. + # When using {DataSources::ZoneinfoDataSource}, the value of + # {base_utc_offset} has to be derived from changes to the observed UTC + # offset and DST status since it is not included in zoneinfo files. + # + # @return [Integer] the base offset from UTC in seconds. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#54 + def utc_offset; end + + # Returns the observed offset from UTC in seconds (`base_utc_offset + + # std_offset`). This includes adjustments made for daylight savings time. + # + # @return [Integer] the observed offset from UTC in seconds. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#90 + def utc_total_offset; end + + # The abbreviation that identifies this offset. For example GMT + # (Greenwich Mean Time) or BST (British Summer Time) for Europe/London. + # + # @return [String] the abbreviation that identifies this offset. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#80 + def zone_identifier; end + + private + + # Raises a {NotImplementedError} to indicate that subclasses should override + # a method. + # + # @raise [NotImplementedError] always. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#161 + def raise_not_implemented(method_name); end + + # @param transition [TimezoneTransition] a transition or `nil`. + # @return [Timestamp] the {Timestamp} representing when a transition occurs, + # or `nil` if `transition` is `nil`. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#168 + def timestamp(transition); end + + # @param transition [TimezoneTransition] a transition or `nil`. + # @return [TimestampWithOffset] a {Timestamp} representing when a transition + # occurs with offset set to {#offset}, or `nil` if `transition` is `nil`. + # + # source://tzinfo//lib/tzinfo/timezone_period.rb#175 + def timestamp_with_offset(transition); end +end + +# A proxy class standing in for a {Timezone} with a given identifier. +# {TimezoneProxy} inherits from {Timezone} and can be treated identically to +# {Timezone} instances loaded with {Timezone.get}. +# +# {TimezoneProxy} instances are used to avoid the performance overhead of +# loading time zone data into memory, for example, by {Timezone.all}. +# +# The first time an attempt is made to access the data for the time zone, the +# real {Timezone} will be loaded is loaded. If the proxy's identifier was not +# valid, then an exception will be raised at this point. +# +# source://tzinfo//lib/tzinfo/timezone_proxy.rb#15 +class TZInfo::TimezoneProxy < ::TZInfo::Timezone + # Initializes a new {TimezoneProxy}. + # + # The `identifier` parameter is not checked when initializing the proxy. It + # will be validated when the real {Timezone} instance is loaded. + # + # @param identifier [String] an IANA Time Zone Database time zone + # identifier. + # @return [TimezoneProxy] a new instance of TimezoneProxy + # + # source://tzinfo//lib/tzinfo/timezone_proxy.rb#23 + def initialize(identifier); end + + # Returns a serialized representation of this {TimezoneProxy}. This method + # is called when using `Marshal.dump` with an instance of {TimezoneProxy}. + # + # @param limit [Integer] the maximum depth to dump - ignored. @return + # [String] a serialized representation of this {TimezoneProxy}. + # @return [String] a serialized representation of this {TimezoneProxy}. + # + # source://tzinfo//lib/tzinfo/timezone_proxy.rb#60 + def _dump(limit); end + + # Returns the canonical {Timezone} instance for this {Timezone}. + # + # The IANA Time Zone database contains two types of definition: Zones and + # Links. Zones are defined by rules that set out when transitions occur. + # Links are just references to fully defined Zone, creating an alias for + # that Zone. + # + # Links are commonly used where a time zone has been renamed in a release of + # the Time Zone database. For example, the US/Eastern Zone was renamed as + # America/New_York. A US/Eastern Link was added in its place, linking to + # (and creating an alias for) America/New_York. + # + # Links are also used for time zones that are currently identical to a full + # Zone, but that are administered separately. For example, Europe/Vatican is + # a Link to (and alias for) Europe/Rome. + # + # For a full Zone (implemented by {DataTimezone}), {canonical_zone} returns + # self. + # + # For a Link (implemented by {LinkedTimezone}), {canonical_zone} returns a + # {Timezone} instance representing the full Zone that the link targets. + # + # TZInfo can be used with different data sources (see the documentation for + # {TZInfo::DataSource}). Some DataSource implementations may not support + # distinguishing between full Zones and Links and will treat all time zones + # as full Zones. In this case, {canonical_zone} will always return `self`. + # + # There are two built-in DataSource implementations. + # {DataSources::RubyDataSource} (which will be used if the tzinfo-data gem + # is available) supports Link zones. {DataSources::ZoneinfoDataSource} + # returns Link zones as if they were full Zones. If the {canonical_zone} or + # {canonical_identifier} methods are needed, the tzinfo-data gem should be + # installed. + # + # The {TZInfo::DataSource.get} method can be used to check which DataSource + # implementation is being used. + # + # @return [Timezone] the canonical {Timezone} instance for this {Timezone}. + # + # source://tzinfo//lib/tzinfo/timezone_proxy.rb#50 + def canonical_zone; end + + # @return [String] the identifier of the time zone, for example, + # `"Europe/Paris"`. + # + # source://tzinfo//lib/tzinfo/timezone_proxy.rb#30 + def identifier; end + + # Returns the {TimezonePeriod} that is valid at a given time. + # + # Unlike {period_for_local} and {period_for_utc}, the UTC offset of the + # `time` parameter is taken into consideration. + # + # @param time [Object] a `Time`, `DateTime` or {Timestamp}. + # @raise [ArgumentError] if `time` is `nil`. + # @raise [ArgumentError] if `time` is a {Timestamp} with an unspecified + # offset. + # @return [TimezonePeriod] the {TimezonePeriod} that is valid at `time`. + # + # source://tzinfo//lib/tzinfo/timezone_proxy.rb#35 + def period_for(time); end + + # Returns the set of {TimezonePeriod}s that are valid for the given + # local time as an `Array`. + # + # The UTC offset of the `local_time` parameter is ignored (it is treated as + # a time in the time zone represented by `self`). + # + # This will typically return an `Array` containing a single + # {TimezonePeriod}. More than one {TimezonePeriod} will be returned when the + # local time is ambiguous (for example, when daylight savings time ends). An + # empty `Array` will be returned when the local time is not valid (for + # example, when daylight savings time begins). + # + # To obtain just a single {TimezonePeriod} in all cases, use + # {period_for_local} instead and specify how ambiguities should be resolved. + # + # @param local_time [Object] a `Time`, `DateTime` or {Timestamp}. + # @raise [ArgumentError] if `local_time` is `nil`. + # @return [Array] the set of {TimezonePeriod}s that are + # valid at `local_time`. + # + # source://tzinfo//lib/tzinfo/timezone_proxy.rb#40 + def periods_for_local(local_time); end + + # Returns an `Array` of {TimezoneTransition} instances representing the + # times where the UTC offset of the timezone changes. + # + # Transitions are returned up to a given time (`to`). + # + # A from time may also be supplied using the `from` parameter. If from is + # not `nil`, only transitions from that time onwards will be returned. + # + # Comparisons with `to` are exclusive. Comparisons with `from` are + # inclusive. If a transition falls precisely on `to`, it will be excluded. + # If a transition falls on `from`, it will be included. + # + # @param to [Object] a `Time`, `DateTime` or {Timestamp} specifying the + # latest (exclusive) transition to return. + # @param from [Object] an optional `Time`, `DateTime` or {Timestamp} + # specifying the earliest (inclusive) transition to return. + # @raise [ArgumentError] if `from` is specified and `to` is not greater than + # `from`. + # @raise [ArgumentError] is raised if `to` is `nil`. + # @raise [ArgumentError] if either `to` or `from` is a {Timestamp} with an + # unspecified offset. + # @return [Array] the transitions that are earlier than + # `to` and, if specified, at or later than `from`. Transitions are ordered + # by when they occur, from earliest to latest. + # + # source://tzinfo//lib/tzinfo/timezone_proxy.rb#45 + def transitions_up_to(to, from = T.unsafe(nil)); end + + private + + # Returns the real {Timezone} instance being proxied. + # + # The real {Timezone} is loaded using {Timezone.get} on the first access. + # + # @return [Timezone] the real {Timezone} instance being proxied. + # + # source://tzinfo//lib/tzinfo/timezone_proxy.rb#82 + def real_timezone; end + + class << self + # Loads a {TimezoneProxy} from the serialized representation returned by + # {_dump}. This is method is called when using `Marshal.load` or + # `Marshal.restore` to restore a serialized {Timezone}. + # + # @param data [String] a serialized representation of a {TimezoneProxy}. + # @return [TimezoneProxy] the result of converting `data` back into a + # {TimezoneProxy}. + # + # source://tzinfo//lib/tzinfo/timezone_proxy.rb#71 + def _load(data); end + end +end + +# Represents a transition from one observed UTC offset ({TimezoneOffset} to +# another for a time zone. +# +# source://tzinfo//lib/tzinfo/timezone_transition.rb#7 +class TZInfo::TimezoneTransition + # Initializes a new {TimezoneTransition}. + # + # {TimezoneTransition} instances should not normally be constructed + # manually. + # + # @param offset [TimezoneOffset] the offset the transition changes to. + # @param previous_offset [TimezoneOffset] the offset the transition changes + # from. + # @param timestamp_value [Integer] when the transition occurs as a + # number of seconds since 1970-01-01 00:00:00 UTC ignoring leap seconds + # (i.e. each day is treated as if it were 86,400 seconds long). + # @return [TimezoneTransition] a new instance of TimezoneTransition + # + # source://tzinfo//lib/tzinfo/timezone_transition.rb#34 + def initialize(offset, previous_offset, timestamp_value); end + + # Determines if this {TimezoneTransition} is equal to another instance. + # + # @param tti [Object] the instance to test for equality. + # @return [Boolean] `true` if `tti` is a {TimezoneTransition} with the same + # {offset}, {previous_offset} and {timestamp_value} as this + # {TimezoneTransition}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/timezone_transition.rb#86 + def ==(tti); end + + # Returns a {Timestamp} instance representing the UTC time when this + # transition occurs. + # + # To obtain the result as a `Time` or `DateTime`, call either + # {Timestamp#to_time to_time} or {Timestamp#to_datetime to_datetime} on the + # {Timestamp} instance that is returned. + # + # @return [Timestamp] the UTC time when this transition occurs. + # + # source://tzinfo//lib/tzinfo/timezone_transition.rb#48 + def at; end + + # Determines if this {TimezoneTransition} is equal to another instance. + # + # @param tti [Object] the instance to test for equality. + # @return [Boolean] `true` if `tti` is a {TimezoneTransition} with the same + # {offset}, {previous_offset} and {timestamp_value} as this + # {TimezoneTransition}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/timezone_transition.rb#86 + def eql?(tti); end + + # @return [Integer] a hash based on {offset}, {previous_offset} and + # {timestamp_value}. + # + # source://tzinfo//lib/tzinfo/timezone_transition.rb#94 + def hash; end + + # Returns a {TimestampWithOffset} instance representing the local time when + # this transition causes the previous observance to end (calculated from + # {at} using {previous_offset}). + # + # To obtain the result as a `Time` or `DateTime`, call either + # {TimestampWithOffset#to_time to_time} or {TimestampWithOffset#to_datetime + # to_datetime} on the {TimestampWithOffset} instance that is returned. + # + # @return [TimestampWithOffset] the local time when this transition causes + # the previous observance to end. + # + # source://tzinfo//lib/tzinfo/timezone_transition.rb#62 + def local_end_at; end + + # Returns a {TimestampWithOffset} instance representing the local time when + # this transition causes the next observance to start (calculated from {at} + # using {offset}). + # + # To obtain the result as a `Time` or `DateTime`, call either + # {TimestampWithOffset#to_time to_time} or {TimestampWithOffset#to_datetime + # to_datetime} on the {TimestampWithOffset} instance that is returned. + # + # @return [TimestampWithOffset] the local time when this transition causes + # the next observance to start. + # + # source://tzinfo//lib/tzinfo/timezone_transition.rb#76 + def local_start_at; end + + # @return [TimezoneOffset] the offset this transition changes to. + # + # source://tzinfo//lib/tzinfo/timezone_transition.rb#9 + def offset; end + + # @return [TimezoneOffset] the offset this transition changes from. + # + # source://tzinfo//lib/tzinfo/timezone_transition.rb#12 + def previous_offset; end + + # When this transition occurs as an `Integer` number of seconds since + # 1970-01-01 00:00:00 UTC ignoring leap seconds (i.e. each day is treated as + # if it were 86,400 seconds long). Equivalent to the result of calling the + # {Timestamp#value value} method on the {Timestamp} returned by {at}. + # + # @return [Integer] when this transition occurs as a number of seconds since + # 1970-01-01 00:00:00 UTC ignoring leap seconds. + # + # source://tzinfo//lib/tzinfo/timezone_transition.rb#21 + def timestamp_value; end +end + +# Base class for rules definining the transition between standard and daylight +# savings time. +# +# @abstract +# @private +# +# source://tzinfo//lib/tzinfo/transition_rule.rb#10 +class TZInfo::TransitionRule + # Initializes a new {TransitionRule}. + # + # @param transition_at [Integer] the time in seconds after midnight local + # time at which the transition occurs. + # @raise [ArgumentError] if `transition_at` is not an `Integer`. + # @return [TransitionRule] a new instance of TransitionRule + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#25 + def initialize(transition_at); end + + # Determines if this {TransitionRule} is equal to another instance. + # + # @param r [Object] the instance to test for equality. + # @return [Boolean] `true` if `r` is a {TransitionRule} with the same + # {transition_at} as this {TransitionRule}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#47 + def ==(r); end + + # Calculates the time of the transition from a given offset on a given year. + # + # @param offset [TimezoneOffset] the current offset at the time the rule + # will transition. + # @param year [Integer] the year in which the transition occurs (local + # time). + # @return [TimestampWithOffset] the time at which the transition occurs. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#37 + def at(offset, year); end + + # Determines if this {TransitionRule} is equal to another instance. + # + # @param r [Object] the instance to test for equality. + # @return [Boolean] `true` if `r` is a {TransitionRule} with the same + # {transition_at} as this {TransitionRule}, otherwise `false`. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#47 + def eql?(r); end + + # @return [Integer] a hash based on {hash_args} (defaulting to + # {transition_at}). + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#54 + def hash; end + + # Returns the number of seconds after midnight local time on the day + # identified by the rule at which the transition occurs. Can be negative to + # denote a time on the prior day. Can be greater than or equal to 86,400 to + # denote a time of the following day. + # + # @return [Integer] the time in seconds after midnight local time at which + # the transition occurs. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#18 + def transition_at; end + + protected + + # @return [Array] an `Array` of parameters that will influence the output of + # {hash}. + # + # source://tzinfo//lib/tzinfo/transition_rule.rb#62 + def hash_args; end +end + +# Represents a period of time in a time zone where the same offset from UTC +# applies. The period of time is bounded at at least one end, either having a +# start transition, end transition or both start and end transitions. +# +# source://tzinfo//lib/tzinfo/transitions_timezone_period.rb#8 +class TZInfo::TransitionsTimezonePeriod < ::TZInfo::TimezonePeriod + # Initializes a {TransitionsTimezonePeriod}. + # + # At least one of `start_transition` and `end_transition` must be specified. + # + # @param start_transition [TimezoneTransition] the transition that defines + # the start of the period, or `nil` if the start is unbounded. + # @param end_transition [TimezoneTransition] the transition that defines the + # end of the period, or `nil` if the end is unbounded. + # @raise [ArgumentError] if both `start_transition` and `end_transition` are + # `nil`. + # @return [TransitionsTimezonePeriod] a new instance of TransitionsTimezonePeriod + # + # source://tzinfo//lib/tzinfo/transitions_timezone_period.rb#27 + def initialize(start_transition, end_transition); end + + # Determines if this {TransitionsTimezonePeriod} is equal to another + # instance. + # + # @param p [Object] the instance to test for equality. + # @return [Boolean] `true` if `p` is a {TransitionsTimezonePeriod} with the + # same {offset}, {start_transition} and {end_transition}, otherwise + # `false`. + # + # source://tzinfo//lib/tzinfo/transitions_timezone_period.rb#47 + def ==(p); end + + # @return [TimezoneTransition] the transition that defines the end of this + # {TimezonePeriod} (`nil` if the end is unbounded). + # + # source://tzinfo//lib/tzinfo/transitions_timezone_period.rb#15 + def end_transition; end + + # Determines if this {TransitionsTimezonePeriod} is equal to another + # instance. + # + # @param p [Object] the instance to test for equality. + # @return [Boolean] `true` if `p` is a {TransitionsTimezonePeriod} with the + # same {offset}, {start_transition} and {end_transition}, otherwise + # `false`. + # + # source://tzinfo//lib/tzinfo/transitions_timezone_period.rb#47 + def eql?(p); end + + # @return [Integer] a hash based on {start_transition} and {end_transition}. + # + # source://tzinfo//lib/tzinfo/transitions_timezone_period.rb#53 + def hash; end + + # @return [String] the internal object state as a programmer-readable + # `String`. + # + # source://tzinfo//lib/tzinfo/transitions_timezone_period.rb#59 + def inspect; end + + # @return [TimezoneTransition] the transition that defines the start of this + # {TimezonePeriod} (`nil` if the start is unbounded). + # + # source://tzinfo//lib/tzinfo/transitions_timezone_period.rb#11 + def start_transition; end +end + +# An implementation of {StringDeduper} using the `String#-@` method where +# that method performs deduplication (Ruby 2.5 and later). +# +# Note that this is slightly different to the plain {StringDeduper} +# implementation. In this implementation, frozen literal strings are already +# in the pool and are candidates for being returned, even when passed +# another equal frozen non-literal string. {StringDeduper} will always +# return frozen strings. +# +# There are also differences in encoding handling. This implementation will +# treat strings with different encodings as different strings. +# {StringDeduper} will treat strings with the compatible encodings as the +# same string. +# +# @private +# +# source://tzinfo//lib/tzinfo/string_deduper.rb#90 +class TZInfo::UnaryMinusGlobalStringDeduper + # @param string [String] the string to deduplicate. + # @return [bool] `string` if it is frozen, otherwise a frozen, possibly + # pre-existing copy of `string`. + # + # source://tzinfo//lib/tzinfo/string_deduper.rb#94 + def dedupe(string); end +end + +# {UnknownTimezone} is raised when calling methods on an instance of +# {Timezone} that was created directly. To obtain {Timezone} instances the +# {Timezone.get} method should be used instead. +# +# source://tzinfo//lib/tzinfo/timezone.rb#32 +class TZInfo::UnknownTimezone < ::StandardError; end + +# The TZInfo version number. +# +# source://tzinfo//lib/tzinfo/version.rb#6 +TZInfo::VERSION = T.let(T.unsafe(nil), String) + +# The {WithOffset} module is included in {TimeWithOffset}, +# {DateTimeWithOffset} and {TimestampWithOffset}. It provides an override for +# the {strftime} method that handles expanding the `%Z` directive according to +# the {TimezoneOffset#abbreviation abbreviation} of the {TimezoneOffset} +# associated with a local time. +# +# source://tzinfo//lib/tzinfo/with_offset.rb#10 +module TZInfo::WithOffset + # Overrides the `Time`, `DateTime` or {Timestamp} version of `strftime`, + # replacing `%Z` with the {TimezoneOffset#abbreviation abbreviation} of the + # associated {TimezoneOffset}. If there is no associated offset, `%Z` is + # expanded by the base class instead. + # + # All the format directives handled by the base class are supported. + # + # @param format [String] the format string. + # @raise [ArgumentError] if `format` is `nil`. + # @return [String] the formatted time. + # + # source://tzinfo//lib/tzinfo/with_offset.rb#21 + def strftime(format); end + + protected + + # Performs a calculation if there is an associated {TimezoneOffset}. + # + # @param result [Object] a result value that can be manipulated by the block + # if there is an associated {TimezoneOffset}. + # @private + # @return [Object] the result of the block if there is an associated + # {TimezoneOffset}, otherwise the `result` parameter. + # @yield [period, result] if there is an associated {TimezoneOffset}, the + # block is yielded to in order to calculate the method result. + # @yieldparam period [TimezoneOffset] the associated {TimezoneOffset}. + # @yieldparam result [Object] the `result` parameter. + # @yieldreturn [Object] the result of the calculation performed if there is + # an associated {TimezoneOffset}. + # + # source://tzinfo//lib/tzinfo/with_offset.rb#56 + def if_timezone_offset(result = T.unsafe(nil)); end +end diff --git a/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi b/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi index f882502..3889d4b 100644 --- a/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +++ b/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi @@ -388,7 +388,7 @@ class YARDSorbet::TStructProp < ::T::Struct const :types, T::Array[::String] class << self - # source://sorbet-runtime/0.5.11531/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11670/lib/types/struct.rb#13 def inherited(s); end end end diff --git a/sorbet/rbi/gems/yard@0.9.36.rbi b/sorbet/rbi/gems/yard@0.9.36.rbi index c542c39..0dc045e 100644 --- a/sorbet/rbi/gems/yard@0.9.36.rbi +++ b/sorbet/rbi/gems/yard@0.9.36.rbi @@ -7407,13 +7407,13 @@ class YARD::I18n::Text # block separated by one or more empty lines. Empty line is a # line that contains only zero or more whitespaces. It may # called many times. + # @yieldparam text [String] the text of extracted paragraph. + # @yieldparam start_line_no [Integer] the start line number of + # extracted paragraph. # @yieldparam name [String] the name of extracted attribute. # @yieldparam value [String] the value of extracted attribute. # @yieldparam line_no [Integer] the defined line number of extracted # attribute. - # @yieldparam text [String] the text of extracted paragraph. - # @yieldparam start_line_no [Integer] the start line number of - # extracted paragraph. # # source://yard//lib/yard/i18n/text.rb#35 def extract_messages; end @@ -7637,7 +7637,7 @@ class YARD::Logger < ::Logger # source://yard//lib/yard/logging.rb#201 def format_log(sev, _time, _prog, msg); end - # source://logger/1.6.0/logger.rb#684 + # source://logger/1.6.1/lib/logger.rb#689 def print_no_newline(msg); end class << self @@ -11130,6 +11130,10 @@ class YARD::Parser::SourceParser # To register a callback that is called before the entire list of files # is processed, see {before_parse_list}. # + # @example Cancel parsing of any test_*.rb files + # SourceParser.before_parse_file do |parser| + # return false if parser.file =~ /^test_.+\.rb$/ + # end # @example Installing a simple callback # SourceParser.before_parse_file do |parser| # puts "I'm parsing #{parser.file}" @@ -11139,13 +11143,9 @@ class YARD::Parser::SourceParser # "I'm parsing lib/foo.rb" # "I'm parsing lib/foo_bar.rb" # "I'm parsing lib/last_file.rb" - # @example Cancel parsing of any test_*.rb files - # SourceParser.before_parse_file do |parser| - # return false if parser.file =~ /^test_.+\.rb$/ - # end # @return [Proc] the yielded block - # @see after_parse_file # @see before_parse_list + # @see after_parse_file # @since 0.7.0 # @yield [parser] the yielded block is called once before each # file that is parsed. This might happen many times for a single @@ -11169,12 +11169,6 @@ class YARD::Parser::SourceParser # via {parse}. The block passed to this method will be called on # subsequent parse calls. # - # @example Installing a simple callback - # SourceParser.before_parse_list do |files, globals| - # puts "Starting to parse..." - # end - # YARD.parse('lib/**/*.rb') - # # prints "Starting to parse..." # @example Setting global state # SourceParser.before_parse_list do |files, globals| # globals.method_count = 0 @@ -11188,6 +11182,12 @@ class YARD::Parser::SourceParser # end # YARD.parse # # Prints: "Found 37 methods" + # @example Installing a simple callback + # SourceParser.before_parse_list do |files, globals| + # puts "Starting to parse..." + # end + # YARD.parse('lib/**/*.rb') + # # prints "Starting to parse..." # @example Using a global callback to cancel parsing # SourceParser.before_parse_list do |files, globals| # return false if files.include?('foo.rb') @@ -11196,8 +11196,8 @@ class YARD::Parser::SourceParser # YARD.parse(['foo.rb', 'bar.rb']) # callback cancels this method # YARD.parse('bar.rb') # parses normally # @return [Proc] the yielded block - # @see after_parse_list # @see before_parse_file + # @see after_parse_list # @since 0.7.0 # @yield [files, globals] the yielded block is called once before # parsing all files @@ -11589,22 +11589,22 @@ module YARD::Registry # Attempts to find an object by name starting at +namespace+, performing # a lookup similar to Ruby's method of resolving a constant in a namespace. # - # @example Looks for instance method #reverse starting from A::B::C - # Registry.resolve(P("A::B::C"), "#reverse") # @example Looks for a constant in the root namespace # Registry.resolve(nil, 'CONSTANT') # @example Looks for a class method respecting the inheritance tree # Registry.resolve(myclass, 'mymethod', true) + # @example Looks for instance method #reverse starting from A::B::C + # Registry.resolve(P("A::B::C"), "#reverse") # @example Looks for a constant but returns a proxy if not found # Registry.resolve(P('A::B::C'), 'D', false, true) # => # # @example Looks for a complex path from a namespace # Registry.resolve(P('A::B'), 'B::D') # => # + # @param inheritance [Boolean] Follows inheritance chain (mixins, superclass) + # when performing name resolution if set to +true+. # @param namespace [CodeObjects::NamespaceObject, nil] the starting namespace # (module or class). If +nil+ or +:root+, starts from the {root} object. # @param name [String, Symbol] the name (or complex path) to look for from # +namespace+. - # @param inheritance [Boolean] Follows inheritance chain (mixins, superclass) - # when performing name resolution if set to +true+. # @param proxy_fallback [Boolean] If +true+, returns a proxy representing # the unresolved path (namespace + name) if no object is found. # @param type [Symbol, nil] the {CodeObjects::Base#type} that the resolved @@ -11762,12 +11762,12 @@ class YARD::RegistryResolver # object can be returned if the lookup fails for future resolution. The # proxy will be type hinted with the +type+ used in the original lookup. # + # @example A lookup on a method through the inheritance tree + # resolver.lookup_by_math("A::B#foo", inheritance: true) # @example A lookup from root # resolver.lookup_by_path("A::B::C") # @example A lookup from the A::B namespace # resolver.lookup_by_path("C", namespace: P("A::B")) - # @example A lookup on a method through the inheritance tree - # resolver.lookup_by_math("A::B#foo", inheritance: true) # @option opts # @option opts # @option opts