.
+ #
+ # CSS styles use classes, so you have to include a stylesheet
+ # in your output.
+ #
+ # See encode.
+ #
+ # source://coderay//lib/coderay.rb#232
+ def highlight(code, lang, options = T.unsafe(nil), format = T.unsafe(nil)); end
+
+ # Highlight a file into a HTML
.
+ #
+ # CSS styles use classes, so you have to include a stylesheet
+ # in your output.
+ #
+ # See encode.
+ #
+ # source://coderay//lib/coderay.rb#242
+ def highlight_file(filename, options = T.unsafe(nil), format = T.unsafe(nil)); end
+
+ # Scans the given +code+ (a String) with the Scanner for +lang+.
+ #
+ # This is a simple way to use CodeRay. Example:
+ # require 'coderay'
+ # page = CodeRay.scan("puts 'Hello, world!'", :ruby).html
+ #
+ # See also demo/demo_simple.
+ #
+ # source://coderay//lib/coderay.rb#168
+ def scan(code, lang, options = T.unsafe(nil), &block); end
+
+ # Scans +filename+ (a path to a code file) with the Scanner for +lang+.
+ #
+ # If +lang+ is :auto or omitted, the CodeRay::FileType module is used to
+ # determine it. If it cannot find out what type it is, it uses
+ # CodeRay::Scanners::Text.
+ #
+ # Calls CodeRay.scan.
+ #
+ # Example:
+ # require 'coderay'
+ # page = CodeRay.scan_file('some_c_code.c').html
+ #
+ # source://coderay//lib/coderay.rb#183
+ def scan_file(filename, lang = T.unsafe(nil), options = T.unsafe(nil), &block); end
+
+ # Finds the Scanner class for +lang+ and creates an instance, passing
+ # +options+ to it.
+ #
+ # See Scanner.new.
+ #
+ # source://coderay//lib/coderay.rb#268
+ def scanner(lang, options = T.unsafe(nil), &block); end
+ end
+end
+
+# source://coderay//lib/coderay.rb#130
+CodeRay::CODERAY_PATH = T.let(T.unsafe(nil), String)
+
+# = Duo
+#
+# A Duo is a convenient way to use CodeRay. You just create a Duo,
+# giving it a lang (language of the input code) and a format (desired
+# output format), and call Duo#highlight with the code.
+#
+# Duo makes it easy to re-use both scanner and encoder for a repetitive
+# task. It also provides a very easy interface syntax:
+#
+# require 'coderay'
+# CodeRay::Duo[:python, :div].highlight 'import this'
+#
+# Until you want to do uncommon things with CodeRay, I recommend to use
+# this method, since it takes care of everything.
+#
+# source://coderay//lib/coderay/duo.rb#17
+class CodeRay::Duo
+ # Create a new Duo, holding a lang and a format to highlight code.
+ #
+ # simple:
+ # CodeRay::Duo[:ruby, :html].highlight 'bla 42'
+ #
+ # with options:
+ # CodeRay::Duo[:ruby, :html, :hint => :debug].highlight '????::??'
+ #
+ # alternative syntax without options:
+ # CodeRay::Duo[:ruby => :statistic].encode 'class << self; end'
+ #
+ # alternative syntax with options:
+ # CodeRay::Duo[{ :ruby => :statistic }, :do => :something].encode 'abc'
+ #
+ # The options are forwarded to scanner and encoder
+ # (see CodeRay.get_scanner_options).
+ #
+ # @return [Duo] a new instance of Duo
+ #
+ # source://coderay//lib/coderay/duo.rb#37
+ def initialize(lang = T.unsafe(nil), format = T.unsafe(nil), options = T.unsafe(nil)); end
+
+ # Tokenize and highlight the code using +scanner+ and +encoder+.
+ # Allows to use Duo like a proc object:
+ #
+ # CodeRay::Duo[:python => :yaml].call(code)
+ #
+ # or, in Ruby 1.9 and later:
+ #
+ # CodeRay::Duo[:python => :yaml].(code)
+ #
+ # source://coderay//lib/coderay/duo.rb#77
+ def call(code, options = T.unsafe(nil)); end
+
+ # Tokenize and highlight the code using +scanner+ and +encoder+.
+ #
+ # source://coderay//lib/coderay/duo.rb#64
+ def encode(code, options = T.unsafe(nil)); end
+
+ # The encoder of the duo. Only created once.
+ #
+ # source://coderay//lib/coderay/duo.rb#59
+ def encoder; end
+
+ # Returns the value of attribute format.
+ #
+ # source://coderay//lib/coderay/duo.rb#19
+ def format; end
+
+ # Sets the attribute format
+ #
+ # @param value the value to set the attribute format to.
+ #
+ # source://coderay//lib/coderay/duo.rb#19
+ def format=(_arg0); end
+
+ # Tokenize and highlight the code using +scanner+ and +encoder+.
+ #
+ # source://coderay//lib/coderay/duo.rb#68
+ def highlight(code, options = T.unsafe(nil)); end
+
+ # Returns the value of attribute lang.
+ #
+ # source://coderay//lib/coderay/duo.rb#19
+ def lang; end
+
+ # Sets the attribute lang
+ #
+ # @param value the value to set the attribute lang to.
+ #
+ # source://coderay//lib/coderay/duo.rb#19
+ def lang=(_arg0); end
+
+ # Returns the value of attribute options.
+ #
+ # source://coderay//lib/coderay/duo.rb#19
+ def options; end
+
+ # Sets the attribute options
+ #
+ # @param value the value to set the attribute options to.
+ #
+ # source://coderay//lib/coderay/duo.rb#19
+ def options=(_arg0); end
+
+ # The scanner of the duo. Only created once.
+ #
+ # source://coderay//lib/coderay/duo.rb#54
+ def scanner; end
+
+ class << self
+ # To allow calls like Duo[:ruby, :html].highlight.
+ #
+ # source://coderay//lib/coderay/duo.rb#50
+ def [](*_arg0); end
+ end
+end
+
+# This module holds the Encoder class and its subclasses.
+# For example, the HTML encoder is named CodeRay::Encoders::HTML
+# can be found in coderay/encoders/html.
+#
+# Encoders also provides methods and constants for the register
+# mechanism and the [] method that returns the Encoder class
+# belonging to the given format.
+#
+# source://coderay//lib/coderay/encoders.rb#10
+module CodeRay::Encoders
+ extend ::CodeRay::PluginHost
+end
+
+# A simple Filter that removes all tokens of the :comment kind.
+#
+# Alias: +remove_comments+
+#
+# Usage:
+# CodeRay.scan('print # foo', :ruby).comment_filter.text
+# #-> "print "
+#
+# See also: TokenKindFilter, LinesOfCode
+#
+# source://coderay//lib/coderay/encoders/comment_filter.rb#15
+class CodeRay::Encoders::CommentFilter < ::CodeRay::Encoders::TokenKindFilter; end
+
+# source://coderay//lib/coderay/encoders/comment_filter.rb#19
+CodeRay::Encoders::CommentFilter::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
+
+# Returns the number of tokens.
+#
+# Text and block tokens are counted.
+#
+# source://coderay//lib/coderay/encoders/count.rb#7
+class CodeRay::Encoders::Count < ::CodeRay::Encoders::Encoder
+ # source://coderay//lib/coderay/encoders/count.rb#29
+ def begin_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/count.rb#33
+ def begin_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/count.rb#32
+ def end_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/count.rb#34
+ def end_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/count.rb#25
+ def text_token(text, kind); end
+
+ protected
+
+ # source://coderay//lib/coderay/encoders/count.rb#19
+ def finish(options); end
+
+ # source://coderay//lib/coderay/encoders/count.rb#13
+ def setup(options); end
+end
+
+# = Debug Encoder
+#
+# Fast encoder producing simple debug output.
+#
+# It is readable and diff-able and is used for testing.
+#
+# You cannot fully restore the tokens information from the
+# output, because consecutive :space tokens are merged.
+#
+# See also: Scanners::Debug
+#
+# source://coderay//lib/coderay/encoders/debug.rb#14
+class CodeRay::Encoders::Debug < ::CodeRay::Encoders::Encoder
+ # source://coderay//lib/coderay/encoders/debug.rb#30
+ def begin_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/debug.rb#38
+ def begin_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/debug.rb#34
+ def end_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/debug.rb#42
+ def end_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/debug.rb#20
+ def text_token(text, kind); end
+end
+
+# source://coderay//lib/coderay/encoders/debug.rb#18
+CodeRay::Encoders::Debug::FILE_EXTENSION = T.let(T.unsafe(nil), String)
+
+# = Debug Lint Encoder
+#
+# Debug encoder with additional checks for:
+#
+# - empty tokens
+# - incorrect nesting
+#
+# It will raise an InvalidTokenStream exception when any of the above occurs.
+#
+# See also: Encoders::Debug
+#
+# source://coderay//lib/coderay/encoders/debug_lint.rb#16
+class CodeRay::Encoders::DebugLint < ::CodeRay::Encoders::Debug
+ # source://coderay//lib/coderay/encoders/debug_lint.rb#26
+ def begin_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/debug_lint.rb#37
+ def begin_line(kind); end
+
+ # @raise [Lint::IncorrectTokenGroupNesting]
+ #
+ # source://coderay//lib/coderay/encoders/debug_lint.rb#31
+ def end_group(kind); end
+
+ # @raise [Lint::IncorrectTokenGroupNesting]
+ #
+ # source://coderay//lib/coderay/encoders/debug_lint.rb#42
+ def end_line(kind); end
+
+ # @raise [Lint::EmptyToken]
+ #
+ # source://coderay//lib/coderay/encoders/debug_lint.rb#20
+ def text_token(text, kind); end
+
+ protected
+
+ # source://coderay//lib/coderay/encoders/debug_lint.rb#55
+ def finish(options); end
+
+ # source://coderay//lib/coderay/encoders/debug_lint.rb#50
+ def setup(options); end
+end
+
+# Wraps HTML output into a DIV element, using inline styles by default.
+#
+# See Encoders::HTML for available options.
+#
+# source://coderay//lib/coderay/encoders/div.rb#9
+class CodeRay::Encoders::Div < ::CodeRay::Encoders::HTML; end
+
+# source://coderay//lib/coderay/encoders/div.rb#15
+CodeRay::Encoders::Div::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/encoders/div.rb#11
+CodeRay::Encoders::Div::FILE_EXTENSION = T.let(T.unsafe(nil), String)
+
+# = Encoder
+#
+# The Encoder base class. Together with Scanner and
+# Tokens, it forms the highlighting triad.
+#
+# Encoder instances take a Tokens object and do something with it.
+#
+# The most common Encoder is surely the HTML encoder
+# (CodeRay::Encoders::HTML). It highlights the code in a colorful
+# html page.
+# If you want the highlighted code in a div or a span instead,
+# use its subclasses Div and Span.
+#
+# source://coderay//lib/coderay/encoders/encoder.rb#16
+class CodeRay::Encoders::Encoder
+ extend ::CodeRay::Plugin
+
+ # Creates a new Encoder.
+ # +options+ is saved and used for all encode operations, as long
+ # as you don't overwrite it there by passing additional options.
+ #
+ # Encoder objects provide three encode methods:
+ # - encode simply takes a +code+ string and a +lang+
+ # - encode_tokens expects a +tokens+ object instead
+ #
+ # Each method has an optional +options+ parameter. These are
+ # added to the options you passed at creation.
+ #
+ # @return [Encoder] a new instance of Encoder
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#55
+ def initialize(options = T.unsafe(nil)); end
+
+ # source://coderay//lib/coderay/encoders/encoder.rb#87
+ def <<(token); end
+
+ # Starts a token group with the given +kind+.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#123
+ def begin_group(kind); end
+
+ # Starts a new line token group with the given +kind+.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#131
+ def begin_line(kind); end
+
+ # Encode the given +code+ using the Scanner for +lang+.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#70
+ def encode(code, lang, options = T.unsafe(nil)); end
+
+ # Encode a Tokens object.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#61
+ def encode_tokens(tokens, options = T.unsafe(nil)); end
+
+ # Ends a token group with the given +kind+.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#127
+ def end_group(kind); end
+
+ # Ends a new line token group with the given +kind+.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#135
+ def end_line(kind); end
+
+ # The default file extension for this encoder.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#83
+ def file_extension; end
+
+ # Encode the given +code+ using the Scanner for +lang+.
+ # You can use highlight instead of encode, if that seems
+ # more clear to you.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#80
+ def highlight(code, lang, options = T.unsafe(nil)); end
+
+ # The options you gave the Encoder at creating.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#43
+ def options; end
+
+ # The options you gave the Encoder at creating.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#43
+ def options=(_arg0); end
+
+ # The options you gave the Encoder at creating.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#43
+ def scanner; end
+
+ # The options you gave the Encoder at creating.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#43
+ def scanner=(_arg0); end
+
+ # Called for each text token ([text, kind]), where text is a String.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#118
+ def text_token(text, kind); end
+
+ # Called with +content+ and +kind+ of the currently scanned token.
+ # For simple scanners, it's enougth to implement this method.
+ #
+ # By default, it calls text_token, begin_group, end_group, begin_line,
+ # or end_line, depending on the +content+.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#100
+ def token(content, kind); end
+
+ # Do the encoding.
+ #
+ # The already created +tokens+ object must be used; it must be a
+ # Tokens object.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#184
+ def tokens(tokens, options = T.unsafe(nil)); end
+
+ protected
+
+ # Do the encoding.
+ #
+ # The already created +tokens+ object must be used; it must be a
+ # Tokens object.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#168
+ def compile(tokens, options = T.unsafe(nil)); end
+
+ # Called with merged options after encoding starts.
+ # The return value is the result of encoding, typically @out.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#160
+ def finish(options); end
+
+ # source://coderay//lib/coderay/encoders/encoder.rb#148
+ def get_output(options); end
+
+ # Append data.to_s to the output. Returns the argument.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#153
+ def output(data); end
+
+ # Called with merged options before encoding starts.
+ # Sets @out to an empty string.
+ #
+ # See the HTML Encoder for an example of option caching.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#144
+ def setup(options); end
+
+ class << self
+ # If FILE_EXTENSION isn't defined, this method returns the
+ # downcase class name instead.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#24
+ def const_missing(sym); end
+
+ # The default file extension for output file of this encoder class.
+ #
+ # source://coderay//lib/coderay/encoders/encoder.rb#33
+ def file_extension; end
+ end
+end
+
+# Subclasses are to store their default options in this constant.
+#
+# source://coderay//lib/coderay/encoders/encoder.rb#40
+CodeRay::Encoders::Encoder::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/helpers/plugin.rb#41
+CodeRay::Encoders::Encoder::PLUGIN_HOST = CodeRay::Encoders
+
+# A Filter encoder has another Tokens instance as output.
+# It can be subclass to select, remove, or modify tokens in the stream.
+#
+# Subclasses of Filter are called "Filters" and can be chained.
+#
+# == Options
+#
+# === :tokens
+#
+# The Tokens object which will receive the output.
+#
+# Default: Tokens.new
+#
+# See also: TokenKindFilter
+#
+# source://coderay//lib/coderay/encoders/filter.rb#18
+class CodeRay::Encoders::Filter < ::CodeRay::Encoders::Encoder
+ # source://coderay//lib/coderay/encoders/filter.rb#39
+ def begin_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/filter.rb#43
+ def begin_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/filter.rb#47
+ def end_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/filter.rb#51
+ def end_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/filter.rb#35
+ def text_token(text, kind); end
+
+ protected
+
+ # source://coderay//lib/coderay/encoders/filter.rb#29
+ def finish(options); end
+
+ # source://coderay//lib/coderay/encoders/filter.rb#23
+ def setup(options); end
+end
+
+# = HTML Encoder
+#
+# This is CodeRay's most important highlighter:
+# It provides save, fast XHTML generation and CSS support.
+#
+# == Usage
+#
+# require 'coderay'
+# puts CodeRay.scan('Some /code/', :ruby).html #-> a HTML page
+# puts CodeRay.scan('Some /code/', :ruby).html(:wrap => :span)
+# #->
Some /code/
+# puts CodeRay.scan('Some /code/', :ruby).span #-> the same
+#
+# puts CodeRay.scan('Some code', :ruby).html(
+# :wrap => nil,
+# :line_numbers => :inline,
+# :css => :style
+# )
+#
+# == Options
+#
+# === :tab_width
+# Convert \t characters to +n+ spaces (a number or false.)
+# false will keep tab characters untouched.
+#
+# Default: 8
+#
+# === :css
+# How to include the styles; can be :class or :style.
+#
+# Default: :class
+#
+# === :wrap
+# Wrap in :page, :div, :span or nil.
+#
+# You can also use Encoders::Div and Encoders::Span.
+#
+# Default: nil
+#
+# === :title
+#
+# The title of the HTML page (works only when :wrap is set to :page.)
+#
+# Default: 'CodeRay output'
+#
+# === :break_lines
+#
+# Split multiline blocks at line breaks.
+# Forced to true if :line_numbers option is set to :inline.
+#
+# Default: false
+#
+# === :line_numbers
+# Include line numbers in :table, :inline, or nil (no line numbers)
+#
+# Default: nil
+#
+# === :line_number_anchors
+# Adds anchors and links to the line numbers. Can be false (off), true (on),
+# or a prefix string that will be prepended to the anchor name.
+#
+# The prefix must consist only of letters, digits, and underscores.
+#
+# Default: true, default prefix name: "line"
+#
+# === :line_number_start
+# Where to start with line number counting.
+#
+# Default: 1
+#
+# === :bold_every
+# Make every +n+-th number appear bold.
+#
+# Default: 10
+#
+# === :highlight_lines
+#
+# Highlights certain line numbers.
+# Can be any Enumerable, typically just an Array or Range, of numbers.
+#
+# Bolding is deactivated when :highlight_lines is set. It only makes sense
+# in combination with :line_numbers.
+#
+# Default: nil
+#
+# === :hint
+# Include some information into the output using the title attribute.
+# Can be :info (show token kind on mouse-over), :info_long (with full path)
+# or :debug (via inspect).
+#
+# Default: false
+#
+# source://coderay//lib/coderay/encoders/html.rb#97
+class CodeRay::Encoders::HTML < ::CodeRay::Encoders::Encoder
+ # token groups, eg. strings
+ #
+ # source://coderay//lib/coderay/encoders/html.rb#235
+ def begin_group(kind); end
+
+ # whole lines to be highlighted, eg. a deleted line in a diff
+ #
+ # source://coderay//lib/coderay/encoders/html.rb#247
+ def begin_line(kind); end
+
+ # Returns the value of attribute css.
+ #
+ # source://coderay//lib/coderay/encoders/html.rb#126
+ def css; end
+
+ # source://coderay//lib/coderay/encoders/html.rb#241
+ def end_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/html.rb#261
+ def end_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/html.rb#221
+ def text_token(text, kind); end
+
+ protected
+
+ # source://coderay//lib/coderay/encoders/html.rb#316
+ def break_lines(text, style); end
+
+ # source://coderay//lib/coderay/encoders/html.rb#310
+ def check_group_nesting(name, kind); end
+
+ # source://coderay//lib/coderay/encoders/html.rb#268
+ def check_options!(options); end
+
+ # source://coderay//lib/coderay/encoders/html.rb#324
+ def close_span; end
+
+ # source://coderay//lib/coderay/encoders/html.rb#280
+ def css_class_for_kinds(kinds); end
+
+ # source://coderay//lib/coderay/encoders/html.rb#195
+ def finish(options); end
+
+ # source://coderay//lib/coderay/encoders/html.rb#289
+ def make_span_for_kinds(method, hint); end
+
+ # source://coderay//lib/coderay/encoders/html.rb#172
+ def setup(options); end
+
+ # source://coderay//lib/coderay/encoders/html.rb#284
+ def style_for_kinds(kinds); end
+
+ class << self
+ # source://coderay//lib/coderay/encoders/html.rb#130
+ def make_html_escape_hash; end
+
+ # Generate a hint about the given +kinds+ in a +hint+ style.
+ #
+ # +hint+ may be :info, :info_long or :debug.
+ #
+ # source://coderay//lib/coderay/encoders/html.rb#157
+ def token_path_to_hint(hint, kinds); end
+ end
+end
+
+# source://coderay//lib/coderay/encoders/html/css.rb#5
+class CodeRay::Encoders::HTML::CSS
+ # @return [CSS] a new instance of CSS
+ #
+ # source://coderay//lib/coderay/encoders/html/css.rb#13
+ def initialize(style = T.unsafe(nil)); end
+
+ # source://coderay//lib/coderay/encoders/html/css.rb#23
+ def get_style_for_css_classes(css_classes); end
+
+ # Returns the value of attribute stylesheet.
+ #
+ # source://coderay//lib/coderay/encoders/html/css.rb#7
+ def stylesheet; end
+
+ private
+
+ # source://coderay//lib/coderay/encoders/html/css.rb#49
+ def parse(stylesheet); end
+
+ class << self
+ # source://coderay//lib/coderay/encoders/html/css.rb#9
+ def load_stylesheet(style = T.unsafe(nil)); end
+ end
+end
+
+# source://coderay//lib/coderay/encoders/html/css.rb#36
+CodeRay::Encoders::HTML::CSS::CSS_CLASS_PATTERN = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/encoders/html.rb#103
+CodeRay::Encoders::HTML::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/encoders/html.rb#101
+CodeRay::Encoders::HTML::FILE_EXTENSION = T.let(T.unsafe(nil), String)
+
+# source://coderay//lib/coderay/encoders/html.rb#143
+CodeRay::Encoders::HTML::HTML_ESCAPE = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/encoders/html.rb#144
+CodeRay::Encoders::HTML::HTML_ESCAPE_PATTERN = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/encoders/html/numbering.rb#6
+module CodeRay::Encoders::HTML::Numbering
+ class << self
+ # source://coderay//lib/coderay/encoders/html/numbering.rb#8
+ def number!(output, mode = T.unsafe(nil), options = T.unsafe(nil)); end
+ end
+end
+
+# This module is included in the output String of the HTML Encoder.
+#
+# It provides methods like wrap, div, page etc.
+#
+# Remember to use #clone instead of #dup to keep the modules the object was
+# extended with.
+#
+# TODO: Rewrite this without monkey patching.
+#
+# source://coderay//lib/coderay/encoders/html/output.rb#14
+module CodeRay::Encoders::HTML::Output
+ # source://coderay//lib/coderay/encoders/html/output.rb#57
+ def apply_title!(title); end
+
+ # Returns the value of attribute css.
+ #
+ # source://coderay//lib/coderay/encoders/html/output.rb#16
+ def css; end
+
+ # Sets the attribute css
+ #
+ # @param value the value to set the attribute css to.
+ #
+ # source://coderay//lib/coderay/encoders/html/output.rb#16
+ def css=(_arg0); end
+
+ # source://coderay//lib/coderay/encoders/html/output.rb#86
+ def stylesheet(in_tag = T.unsafe(nil)); end
+
+ # source://coderay//lib/coderay/encoders/html/output.rb#62
+ def wrap!(element, *args); end
+
+ # source://coderay//lib/coderay/encoders/html/output.rb#52
+ def wrap_in!(template); end
+
+ # source://coderay//lib/coderay/encoders/html/output.rb#47
+ def wrapped_in; end
+
+ # Sets the attribute wrapped_in
+ #
+ # @param value the value to set the attribute wrapped_in to.
+ #
+ # source://coderay//lib/coderay/encoders/html/output.rb#50
+ def wrapped_in=(_arg0); end
+
+ # @return [Boolean]
+ #
+ # source://coderay//lib/coderay/encoders/html/output.rb#43
+ def wrapped_in?(element); end
+
+ class << self
+ # Raises an exception if an object that doesn't respond to to_str is extended by Output,
+ # to prevent users from misuse. Use Module#remove_method to disable.
+ #
+ # source://coderay//lib/coderay/encoders/html/output.rb#22
+ def extended(o); end
+
+ # source://coderay//lib/coderay/encoders/html/output.rb#26
+ def make_stylesheet(css, in_tag = T.unsafe(nil)); end
+
+ # source://coderay//lib/coderay/encoders/html/output.rb#36
+ def page_template_for_css(css); end
+ end
+end
+
+# source://coderay//lib/coderay/encoders/html/output.rb#117
+CodeRay::Encoders::HTML::Output::DIV = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template)
+
+# source://coderay//lib/coderay/encoders/html/output.rb#130
+CodeRay::Encoders::HTML::Output::PAGE = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template)
+
+# source://coderay//lib/coderay/encoders/html/output.rb#115
+CodeRay::Encoders::HTML::Output::SPAN = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template)
+
+# source://coderay//lib/coderay/encoders/html/output.rb#123
+CodeRay::Encoders::HTML::Output::TABLE = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template)
+
+# -- don't include the templates in docu
+#
+# source://coderay//lib/coderay/encoders/html/output.rb#92
+class CodeRay::Encoders::HTML::Output::Template < ::String
+ # source://coderay//lib/coderay/encoders/html/output.rb#104
+ def apply(target, replacement); end
+
+ class << self
+ # source://coderay//lib/coderay/encoders/html/output.rb#94
+ def wrap!(str, template, target); end
+ end
+end
+
+# source://coderay//lib/coderay/encoders/html.rb#146
+CodeRay::Encoders::HTML::TOKEN_KIND_TO_INFO = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/encoders/html.rb#150
+CodeRay::Encoders::HTML::TRANSPARENT_TOKEN_KINDS = T.let(T.unsafe(nil), Set)
+
+# A simple JSON Encoder.
+#
+# Example:
+# CodeRay.scan('puts "Hello world!"', :ruby).json
+# yields
+# [
+# {"type"=>"text", "text"=>"puts", "kind"=>"ident"},
+# {"type"=>"text", "text"=>" ", "kind"=>"space"},
+# {"type"=>"block", "action"=>"open", "kind"=>"string"},
+# {"type"=>"text", "text"=>"\"", "kind"=>"delimiter"},
+# {"type"=>"text", "text"=>"Hello world!", "kind"=>"content"},
+# {"type"=>"text", "text"=>"\"", "kind"=>"delimiter"},
+# {"type"=>"block", "action"=>"close", "kind"=>"string"},
+# ]
+#
+# source://coderay//lib/coderay/encoders/json.rb#18
+class CodeRay::Encoders::JSON < ::CodeRay::Encoders::Encoder
+ # source://coderay//lib/coderay/encoders/json.rb#64
+ def begin_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/json.rb#72
+ def begin_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/json.rb#68
+ def end_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/json.rb#76
+ def end_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/json.rb#60
+ def text_token(text, kind); end
+
+ protected
+
+ # source://coderay//lib/coderay/encoders/json.rb#49
+ def append(data); end
+
+ # source://coderay//lib/coderay/encoders/json.rb#45
+ def finish(options); end
+
+ # source://coderay//lib/coderay/encoders/json.rb#38
+ def setup(options); end
+end
+
+# source://coderay//lib/coderay/encoders/json.rb#35
+CodeRay::Encoders::JSON::FILE_EXTENSION = T.let(T.unsafe(nil), String)
+
+# Counts the LoC (Lines of Code). Returns an Integer >= 0.
+#
+# Alias: +loc+
+#
+# Everything that is not comment, markup, doctype/shebang, or an empty line,
+# is considered to be code.
+#
+# For example,
+# * HTML files not containing JavaScript have 0 LoC
+# * in a Java class without comments, LoC is the number of non-empty lines
+#
+# A Scanner class should define the token kinds that are not code in the
+# KINDS_NOT_LOC constant, which defaults to [:comment, :doctype].
+#
+# source://coderay//lib/coderay/encoders/lines_of_code.rb#17
+class CodeRay::Encoders::LinesOfCode < ::CodeRay::Encoders::TokenKindFilter
+ protected
+
+ # source://coderay//lib/coderay/encoders/lines_of_code.rb#38
+ def finish(options); end
+
+ # source://coderay//lib/coderay/encoders/lines_of_code.rb#25
+ def setup(options); end
+end
+
+# source://coderay//lib/coderay/encoders/lines_of_code.rb#21
+CodeRay::Encoders::LinesOfCode::NON_EMPTY_LINE = T.let(T.unsafe(nil), Regexp)
+
+# = Lint Encoder
+#
+# Checks for:
+#
+# - empty tokens
+# - incorrect nesting
+#
+# It will raise an InvalidTokenStream exception when any of the above occurs.
+#
+# See also: Encoders::DebugLint
+#
+# source://coderay//lib/coderay/encoders/lint.rb#14
+class CodeRay::Encoders::Lint < ::CodeRay::Encoders::Debug
+ # source://coderay//lib/coderay/encoders/lint.rb#28
+ def begin_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/lint.rb#37
+ def begin_line(kind); end
+
+ # @raise [IncorrectTokenGroupNesting]
+ #
+ # source://coderay//lib/coderay/encoders/lint.rb#32
+ def end_group(kind); end
+
+ # @raise [IncorrectTokenGroupNesting]
+ #
+ # source://coderay//lib/coderay/encoders/lint.rb#41
+ def end_line(kind); end
+
+ # @raise [EmptyToken]
+ #
+ # source://coderay//lib/coderay/encoders/lint.rb#23
+ def text_token(text, kind); end
+
+ protected
+
+ # source://coderay//lib/coderay/encoders/lint.rb#52
+ def finish(options); end
+
+ # source://coderay//lib/coderay/encoders/lint.rb#48
+ def setup(options); end
+end
+
+# source://coderay//lib/coderay/encoders/lint.rb#19
+class CodeRay::Encoders::Lint::EmptyToken < ::CodeRay::Encoders::Lint::InvalidTokenStream; end
+
+# source://coderay//lib/coderay/encoders/lint.rb#21
+class CodeRay::Encoders::Lint::IncorrectTokenGroupNesting < ::CodeRay::Encoders::Lint::InvalidTokenStream; end
+
+# source://coderay//lib/coderay/encoders/lint.rb#18
+class CodeRay::Encoders::Lint::InvalidTokenStream < ::StandardError; end
+
+# source://coderay//lib/coderay/encoders/lint.rb#20
+class CodeRay::Encoders::Lint::UnknownTokenKind < ::CodeRay::Encoders::Lint::InvalidTokenStream; end
+
+# = Null Encoder
+#
+# Does nothing and returns an empty string.
+#
+# source://coderay//lib/coderay/encoders/null.rb#7
+class CodeRay::Encoders::Null < ::CodeRay::Encoders::Encoder
+ # source://coderay//lib/coderay/encoders/null.rb#11
+ def text_token(text, kind); end
+end
+
+# Wraps the output into a HTML page, using CSS classes and
+# line numbers in the table format by default.
+#
+# See Encoders::HTML for available options.
+#
+# source://coderay//lib/coderay/encoders/page.rb#10
+class CodeRay::Encoders::Page < ::CodeRay::Encoders::HTML; end
+
+# source://coderay//lib/coderay/encoders/page.rb#16
+CodeRay::Encoders::Page::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/encoders/page.rb#12
+CodeRay::Encoders::Page::FILE_EXTENSION = T.let(T.unsafe(nil), String)
+
+# Wraps HTML output into a SPAN element, using inline styles by default.
+#
+# See Encoders::HTML for available options.
+#
+# source://coderay//lib/coderay/encoders/span.rb#9
+class CodeRay::Encoders::Span < ::CodeRay::Encoders::HTML; end
+
+# source://coderay//lib/coderay/encoders/span.rb#15
+CodeRay::Encoders::Span::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/encoders/span.rb#11
+CodeRay::Encoders::Span::FILE_EXTENSION = T.let(T.unsafe(nil), String)
+
+# Makes a statistic for the given tokens.
+#
+# Alias: +stats+
+#
+# source://coderay//lib/coderay/encoders/statistic.rb#7
+class CodeRay::Encoders::Statistic < ::CodeRay::Encoders::Encoder
+ # source://coderay//lib/coderay/encoders/statistic.rb#70
+ def begin_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/statistic.rb#78
+ def begin_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/statistic.rb#86
+ def block_token(action, kind); end
+
+ # source://coderay//lib/coderay/encoders/statistic.rb#74
+ def end_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/statistic.rb#82
+ def end_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/statistic.rb#11
+ def real_token_count; end
+
+ # source://coderay//lib/coderay/encoders/statistic.rb#62
+ def text_token(text, kind); end
+
+ # source://coderay//lib/coderay/encoders/statistic.rb#11
+ def type_stats; end
+
+ protected
+
+ # source://coderay//lib/coderay/encoders/statistic.rb#42
+ def finish(options); end
+
+ # source://coderay//lib/coderay/encoders/statistic.rb#17
+ def setup(options); end
+end
+
+# source://coderay//lib/coderay/encoders/statistic.rb#24
+CodeRay::Encoders::Statistic::STATS = T.let(T.unsafe(nil), String)
+
+# source://coderay//lib/coderay/encoders/statistic.rb#38
+CodeRay::Encoders::Statistic::TOKEN_TYPES_ROW = T.let(T.unsafe(nil), String)
+
+# source://coderay//lib/coderay/encoders/statistic.rb#13
+class CodeRay::Encoders::Statistic::TypeStats < ::Struct
+ # Returns the value of attribute count
+ #
+ # @return [Object] the current value of count
+ #
+ # source://coderay//lib/coderay/encoders/statistic.rb#13
+ def count; end
+
+ # Sets the attribute count
+ #
+ # @param value [Object] the value to set the attribute count to.
+ # @return [Object] the newly set value
+ #
+ # source://coderay//lib/coderay/encoders/statistic.rb#13
+ def count=(_); end
+
+ # Returns the value of attribute size
+ #
+ # @return [Object] the current value of size
+ #
+ # source://coderay//lib/coderay/encoders/statistic.rb#13
+ def size; end
+
+ # Sets the attribute size
+ #
+ # @param value [Object] the value to set the attribute size to.
+ # @return [Object] the newly set value
+ #
+ # source://coderay//lib/coderay/encoders/statistic.rb#13
+ def size=(_); end
+
+ class << self
+ # source://coderay//lib/coderay/encoders/statistic.rb#13
+ def [](*_arg0); end
+
+ # source://coderay//lib/coderay/encoders/statistic.rb#13
+ def inspect; end
+
+ # source://coderay//lib/coderay/encoders/statistic.rb#13
+ def keyword_init?; end
+
+ # source://coderay//lib/coderay/encoders/statistic.rb#13
+ def members; end
+
+ # source://coderay//lib/coderay/encoders/statistic.rb#13
+ def new(*_arg0); end
+ end
+end
+
+# source://coderay//lib/coderay/encoders/terminal.rb#17
+class CodeRay::Encoders::Terminal < ::CodeRay::Encoders::Encoder
+ # source://coderay//lib/coderay/encoders/terminal.rb#156
+ def begin_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/terminal.rb#160
+ def begin_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/terminal.rb#162
+ def end_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/terminal.rb#172
+ def end_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/terminal.rb#141
+ def text_token(text, kind); end
+
+ protected
+
+ # source://coderay//lib/coderay/encoders/terminal.rb#133
+ def setup(options); end
+
+ private
+
+ # source://coderay//lib/coderay/encoders/terminal.rb#179
+ def open_token(kind); end
+end
+
+# source://coderay//lib/coderay/encoders/terminal.rb#21
+CodeRay::Encoders::Terminal::TOKEN_COLORS = T.let(T.unsafe(nil), Hash)
+
+# Concats the tokens into a single string, resulting in the original
+# code string if no tokens were removed.
+#
+# Alias: +plain+, +plaintext+
+#
+# == Options
+#
+# === :separator
+# A separator string to join the tokens.
+#
+# Default: empty String
+#
+# source://coderay//lib/coderay/encoders/text.rb#15
+class CodeRay::Encoders::Text < ::CodeRay::Encoders::Encoder
+ # source://coderay//lib/coderay/encoders/text.rb#25
+ def text_token(text, kind); end
+
+ protected
+
+ # source://coderay//lib/coderay/encoders/text.rb#36
+ def setup(options); end
+end
+
+# source://coderay//lib/coderay/encoders/text.rb#21
+CodeRay::Encoders::Text::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/encoders/text.rb#19
+CodeRay::Encoders::Text::FILE_EXTENSION = T.let(T.unsafe(nil), String)
+
+# A Filter that selects tokens based on their token kind.
+#
+# == Options
+#
+# === :exclude
+#
+# One or many symbols (in an Array) which shall be excluded.
+#
+# Default: []
+#
+# === :include
+#
+# One or many symbols (in an array) which shall be included.
+#
+# Default: :all, which means all tokens are included.
+#
+# Exclusion wins over inclusion.
+#
+# See also: CommentFilter
+#
+# source://coderay//lib/coderay/encoders/token_kind_filter.rb#25
+class CodeRay::Encoders::TokenKindFilter < ::CodeRay::Encoders::Filter
+ # Add the token group to the output stream if +kind+ matches the
+ # conditions.
+ #
+ # If it does not, all tokens inside the group are excluded from the
+ # stream, even if their kinds match.
+ #
+ # source://coderay//lib/coderay/encoders/token_kind_filter.rb#66
+ def begin_group(kind); end
+
+ # See +begin_group+.
+ #
+ # source://coderay//lib/coderay/encoders/token_kind_filter.rb#77
+ def begin_line(kind); end
+
+ # Take care of re-enabling the delegation of tokens to the output stream
+ # if an exluded group has ended.
+ #
+ # source://coderay//lib/coderay/encoders/token_kind_filter.rb#89
+ def end_group(kind); end
+
+ # See +end_group+.
+ #
+ # source://coderay//lib/coderay/encoders/token_kind_filter.rb#99
+ def end_line(kind); end
+
+ # Add the token to the output stream if +kind+ matches the conditions.
+ #
+ # source://coderay//lib/coderay/encoders/token_kind_filter.rb#57
+ def text_token(text, kind); end
+
+ protected
+
+ # @return [Boolean]
+ #
+ # source://coderay//lib/coderay/encoders/token_kind_filter.rb#49
+ def include_group?(kind); end
+
+ # @return [Boolean]
+ #
+ # source://coderay//lib/coderay/encoders/token_kind_filter.rb#45
+ def include_text_token?(text, kind); end
+
+ # source://coderay//lib/coderay/encoders/token_kind_filter.rb#35
+ def setup(options); end
+end
+
+# source://coderay//lib/coderay/encoders/token_kind_filter.rb#29
+CodeRay::Encoders::TokenKindFilter::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
+
+# = XML Encoder
+#
+# Uses REXML. Very slow.
+#
+# source://coderay//lib/coderay/encoders/xml.rb#7
+class CodeRay::Encoders::XML < ::CodeRay::Encoders::Encoder
+ # source://coderay//lib/coderay/encoders/xml.rb#58
+ def begin_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/xml.rb#62
+ def end_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/xml.rb#38
+ def text_token(text, kind); end
+
+ protected
+
+ # source://coderay//lib/coderay/encoders/xml.rb#31
+ def finish(options); end
+
+ # source://coderay//lib/coderay/encoders/xml.rb#22
+ def setup(options); end
+end
+
+# source://coderay//lib/coderay/encoders/xml.rb#15
+CodeRay::Encoders::XML::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/encoders/xml.rb#11
+CodeRay::Encoders::XML::FILE_EXTENSION = T.let(T.unsafe(nil), String)
+
+# = YAML Encoder
+#
+# Slow.
+#
+# source://coderay//lib/coderay/encoders/yaml.rb#9
+class CodeRay::Encoders::YAML < ::CodeRay::Encoders::Encoder
+ # source://coderay//lib/coderay/encoders/yaml.rb#31
+ def begin_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/yaml.rb#39
+ def begin_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/yaml.rb#35
+ def end_group(kind); end
+
+ # source://coderay//lib/coderay/encoders/yaml.rb#43
+ def end_line(kind); end
+
+ # source://coderay//lib/coderay/encoders/yaml.rb#27
+ def text_token(text, kind); end
+
+ protected
+
+ # source://coderay//lib/coderay/encoders/yaml.rb#22
+ def finish(options); end
+
+ # source://coderay//lib/coderay/encoders/yaml.rb#16
+ def setup(options); end
+end
+
+# source://coderay//lib/coderay/encoders/yaml.rb#13
+CodeRay::Encoders::YAML::FILE_EXTENSION = T.let(T.unsafe(nil), String)
+
+# = FileType
+#
+# A simple filetype recognizer.
+#
+# == Usage
+#
+# # determine the type of the given
+# lang = FileType[file_name]
+#
+# # return :text if the file type is unknown
+# lang = FileType.fetch file_name, :text
+#
+# # try the shebang line, too
+# lang = FileType.fetch file_name, :text, true
+#
+# source://coderay//lib/coderay/helpers/file_type.rb#17
+module CodeRay::FileType
+ class << self
+ # Try to determine the file type of the file.
+ #
+ # +filename+ is a relative or absolute path to a file.
+ #
+ # The file itself is only accessed when +read_shebang+ is set to true.
+ # That means you can get filetypes from files that don't exist.
+ #
+ # source://coderay//lib/coderay/helpers/file_type.rb#29
+ def [](filename, read_shebang = T.unsafe(nil)); end
+
+ # This works like Hash#fetch.
+ #
+ # If the filetype cannot be found, the +default+ value
+ # is returned.
+ #
+ # source://coderay//lib/coderay/helpers/file_type.rb#50
+ def fetch(filename, default = T.unsafe(nil), read_shebang = T.unsafe(nil)); end
+
+ protected
+
+ # source://coderay//lib/coderay/helpers/file_type.rb#66
+ def type_from_shebang(filename); end
+ end
+end
+
+# source://coderay//lib/coderay/helpers/file_type.rb#79
+CodeRay::FileType::TypeFromExt = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/helpers/file_type.rb#139
+CodeRay::FileType::TypeFromName = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/helpers/file_type.rb#137
+CodeRay::FileType::TypeFromShebang = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/helpers/file_type.rb#19
+class CodeRay::FileType::UnknownFileType < ::Exception; end
+
+# = Plugin
+#
+# Plugins have to include this module.
+#
+# IMPORTANT: Use extend for this module.
+#
+# See CodeRay::PluginHost for examples.
+#
+# source://coderay//lib/coderay/helpers/plugin.rb#10
+module CodeRay::Plugin
+ # source://coderay//lib/coderay/helpers/plugin.rb#46
+ def aliases; end
+
+ # The PluginHost for this Plugin class.
+ #
+ # source://coderay//lib/coderay/helpers/plugin.rb#39
+ def plugin_host(host = T.unsafe(nil)); end
+
+ # Returns the value of attribute plugin_id.
+ #
+ # source://coderay//lib/coderay/helpers/plugin.rb#12
+ def plugin_id; end
+
+ # Register this class for the given +id+.
+ #
+ # Example:
+ # class MyPlugin < PluginHost::BaseClass
+ # register_for :my_id
+ # ...
+ # end
+ #
+ # See PluginHost.register.
+ #
+ # source://coderay//lib/coderay/helpers/plugin.rb#23
+ def register_for(id); end
+
+ # Returns the title of the plugin, or sets it to the
+ # optional argument +title+.
+ #
+ # source://coderay//lib/coderay/helpers/plugin.rb#30
+ def title(title = T.unsafe(nil)); end
+end
+
+# = PluginHost
+#
+# A simple subclass/subfolder plugin system.
+#
+# Example:
+# class Generators
+# extend PluginHost
+# plugin_path 'app/generators'
+# end
+#
+# class Generator
+# extend Plugin
+# PLUGIN_HOST = Generators
+# end
+#
+# class FancyGenerator < Generator
+# register_for :fancy
+# end
+#
+# Generators[:fancy] #-> FancyGenerator
+# # or
+# CodeRay.require_plugin 'Generators/fancy'
+# # or
+# Generators::Fancy
+#
+# source://coderay//lib/coderay/helpers/plugin_host.rb#27
+module CodeRay::PluginHost
+ # Returns the Plugin for +id+.
+ #
+ # Example:
+ # yaml_plugin = MyPluginHost[:yaml]
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#49
+ def [](id, *args, &blk); end
+
+ # Returns an array of all Plugins.
+ #
+ # Note: This loads all plugins using load_all.
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#151
+ def all_plugins; end
+
+ # Tries to +load+ the missing plugin by translating +const+ to the
+ # underscore form (eg. LinesOfCode becomes lines_of_code).
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#61
+ def const_missing(const); end
+
+ # Define the default plugin to use when no plugin is found
+ # for a given id, or return the default plugin.
+ #
+ # See also map.
+ #
+ # class MyColorHost < PluginHost
+ # map :navy => :dark_blue
+ # default :gray
+ # end
+ #
+ # MyColorHost.default # loads and returns the Gray plugin
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#114
+ def default(id = T.unsafe(nil)); end
+
+ # Returns an array of all .rb files in the plugin path.
+ #
+ # The extension .rb is not included.
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#140
+ def list; end
+
+ # Returns the Plugin for +id+.
+ #
+ # Example:
+ # yaml_plugin = MyPluginHost[:yaml]
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#57
+ def load(id, *args, &blk); end
+
+ # Loads all plugins using list and load.
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#39
+ def load_all; end
+
+ # Loads the map file (see map).
+ #
+ # This is done automatically when plugin_path is called.
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#159
+ def load_plugin_map; end
+
+ # Map a plugin_id to another.
+ #
+ # Usage: Put this in a file plugin_path/_map.rb.
+ #
+ # class MyColorHost < PluginHost
+ # map :navy => :dark_blue,
+ # :maroon => :brown,
+ # :luna => :moon
+ # end
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#95
+ def map(hash); end
+
+ # A Hash of plugion_id => Plugin pairs.
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#133
+ def plugin_hash; end
+
+ # The path where the plugins can be found.
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#79
+ def plugin_path(*args); end
+
+ # Every plugin must register itself for +id+ by calling register_for,
+ # which calls this method.
+ #
+ # See Plugin#register_for.
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#128
+ def register(plugin, id); end
+
+ protected
+
+ # Return a plugin hash that automatically loads plugins.
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#172
+ def make_plugin_hash; end
+
+ # Returns the expected path to the plugin file for the given id.
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#196
+ def path_to(plugin_id); end
+
+ # Converts +id+ to a valid plugin ID String, or returns +nil+.
+ #
+ # Raises +ArgumentError+ for all other objects, or if the
+ # given String includes non-alphanumeric characters (\W).
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#204
+ def validate_id(id); end
+
+ class << self
+ # Adds the module/class to the PLUGIN_HOSTS list.
+ #
+ # source://coderay//lib/coderay/helpers/plugin_host.rb#72
+ def extended(mod); end
+ end
+end
+
+# source://coderay//lib/coderay/helpers/plugin_host.rb#33
+class CodeRay::PluginHost::HostNotFound < ::LoadError; end
+
+# source://coderay//lib/coderay/helpers/plugin_host.rb#35
+CodeRay::PluginHost::PLUGIN_HOSTS = T.let(T.unsafe(nil), Array)
+
+# dummy hash
+#
+# source://coderay//lib/coderay/helpers/plugin_host.rb#36
+CodeRay::PluginHost::PLUGIN_HOSTS_BY_ID = T.let(T.unsafe(nil), Hash)
+
+# Raised if Encoders::[] fails because:
+# * a file could not be found
+# * the requested Plugin is not registered
+#
+# source://coderay//lib/coderay/helpers/plugin_host.rb#32
+class CodeRay::PluginHost::PluginNotFound < ::LoadError; end
+
+# = Scanners
+#
+# This module holds the Scanner class and its subclasses.
+# For example, the Ruby scanner is named CodeRay::Scanners::Ruby
+# can be found in coderay/scanners/ruby.
+#
+# Scanner also provides methods and constants for the register
+# mechanism and the [] method that returns the Scanner class
+# belonging to the given lang.
+#
+# See PluginHost.
+#
+# source://coderay//lib/coderay/scanners.rb#18
+module CodeRay::Scanners
+ extend ::CodeRay::PluginHost
+end
+
+# Scanner for C.
+#
+# source://coderay//lib/coderay/scanners/c.rb#5
+class CodeRay::Scanners::C < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/c.rb#44
+ def scan_tokens(encoder, options); end
+end
+
+# source://coderay//lib/coderay/scanners/c.rb#27
+CodeRay::Scanners::C::DIRECTIVES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/c.rb#39
+CodeRay::Scanners::C::ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/c.rb#33
+CodeRay::Scanners::C::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# source://coderay//lib/coderay/scanners/c.rb#10
+CodeRay::Scanners::C::KEYWORDS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/c.rb#23
+CodeRay::Scanners::C::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/c.rb#17
+CodeRay::Scanners::C::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/c.rb#40
+CodeRay::Scanners::C::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# Scanner for C++.
+#
+# Aliases: +cplusplus+, c++
+CodeRay::Scanners::CPlusPlus = CodeRay::Scanners::Text
+
+# source://coderay//lib/coderay/scanners/css.rb#4
+class CodeRay::Scanners::CSS < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/css.rb#55
+ def scan_tokens(encoder, options); end
+
+ # source://coderay//lib/coderay/scanners/css.rb#50
+ def setup; end
+end
+
+# source://coderay//lib/coderay/scanners/css.rb#8
+CodeRay::Scanners::CSS::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/css.rb#16
+module CodeRay::Scanners::CSS::RE; end
+
+# source://coderay//lib/coderay/scanners/css.rb#31
+CodeRay::Scanners::CSS::RE::AtKeyword = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#45
+CodeRay::Scanners::CSS::RE::AttributeSelector = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#43
+CodeRay::Scanners::CSS::RE::Class = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#38
+CodeRay::Scanners::CSS::RE::Dimension = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#19
+CodeRay::Scanners::CSS::RE::Escape = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#40
+CodeRay::Scanners::CSS::RE::Function = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#17
+CodeRay::Scanners::CSS::RE::Hex = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#26
+CodeRay::Scanners::CSS::RE::HexColor = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#42
+CodeRay::Scanners::CSS::RE::Id = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#30
+CodeRay::Scanners::CSS::RE::Ident = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#20
+CodeRay::Scanners::CSS::RE::NMChar = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#21
+CodeRay::Scanners::CSS::RE::NMStart = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#29
+CodeRay::Scanners::CSS::RE::Name = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#28
+CodeRay::Scanners::CSS::RE::Num = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#32
+CodeRay::Scanners::CSS::RE::Percentage = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#44
+CodeRay::Scanners::CSS::RE::PseudoClass = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#24
+CodeRay::Scanners::CSS::RE::String = T.let(T.unsafe(nil), Regexp)
+
+# TODO: buggy regexp
+#
+# source://coderay//lib/coderay/scanners/css.rb#22
+CodeRay::Scanners::CSS::RE::String1 = T.let(T.unsafe(nil), Regexp)
+
+# TODO: buggy regexp
+#
+# source://coderay//lib/coderay/scanners/css.rb#23
+CodeRay::Scanners::CSS::RE::String2 = T.let(T.unsafe(nil), Regexp)
+
+# differs from standard because it allows uppercase hex too
+#
+# source://coderay//lib/coderay/scanners/css.rb#18
+CodeRay::Scanners::CSS::RE::Unicode = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/css.rb#36
+CodeRay::Scanners::CSS::RE::Unit = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#6
+class CodeRay::Scanners::Clojure < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/clojure.rb#145
+ def scan_tokens(encoder, options); end
+end
+
+# source://coderay//lib/coderay/scanners/clojure.rb#95
+CodeRay::Scanners::Clojure::BASIC_IDENTIFIER = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#133
+CodeRay::Scanners::Clojure::COMPLEX10 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#134
+CodeRay::Scanners::Clojure::COMPLEX16 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#136
+CodeRay::Scanners::Clojure::COMPLEX2 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#135
+CodeRay::Scanners::Clojure::COMPLEX8 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#16
+CodeRay::Scanners::Clojure::CORE_FORMS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#120
+CodeRay::Scanners::Clojure::DECIMAL = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#98
+CodeRay::Scanners::Clojure::DIGIT = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#99
+CodeRay::Scanners::Clojure::DIGIT10 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#100
+CodeRay::Scanners::Clojure::DIGIT16 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#102
+CodeRay::Scanners::Clojure::DIGIT2 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#101
+CodeRay::Scanners::Clojure::DIGIT8 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#107
+CodeRay::Scanners::Clojure::EXACTNESS = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#110
+CodeRay::Scanners::Clojure::EXP = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#109
+CodeRay::Scanners::Clojure::EXP_MARK = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#96
+CodeRay::Scanners::Clojure::IDENTIFIER = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#85
+CodeRay::Scanners::Clojure::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#129
+CodeRay::Scanners::Clojure::IMAG10 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#130
+CodeRay::Scanners::Clojure::IMAG16 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#132
+CodeRay::Scanners::Clojure::IMAG2 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#131
+CodeRay::Scanners::Clojure::IMAG8 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#90
+CodeRay::Scanners::Clojure::KEYWORD_NEXT_TOKEN_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#141
+CodeRay::Scanners::Clojure::NUM = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#137
+CodeRay::Scanners::Clojure::NUM10 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#138
+CodeRay::Scanners::Clojure::NUM16 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#140
+CodeRay::Scanners::Clojure::NUM2 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#139
+CodeRay::Scanners::Clojure::NUM8 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#78
+CodeRay::Scanners::Clojure::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#112
+CodeRay::Scanners::Clojure::PREFIX10 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#113
+CodeRay::Scanners::Clojure::PREFIX16 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#115
+CodeRay::Scanners::Clojure::PREFIX2 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#114
+CodeRay::Scanners::Clojure::PREFIX8 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#106
+CodeRay::Scanners::Clojure::RADIX10 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#103
+CodeRay::Scanners::Clojure::RADIX16 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#105
+CodeRay::Scanners::Clojure::RADIX2 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#104
+CodeRay::Scanners::Clojure::RADIX8 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#125
+CodeRay::Scanners::Clojure::REAL10 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#126
+CodeRay::Scanners::Clojure::REAL16 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#128
+CodeRay::Scanners::Clojure::REAL2 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#127
+CodeRay::Scanners::Clojure::REAL8 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#108
+CodeRay::Scanners::Clojure::SIGN = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#11
+CodeRay::Scanners::Clojure::SPECIAL_FORMS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#111
+CodeRay::Scanners::Clojure::SUFFIX = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#97
+CodeRay::Scanners::Clojure::SYMBOL = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#116
+CodeRay::Scanners::Clojure::UINT10 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#117
+CodeRay::Scanners::Clojure::UINT16 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#119
+CodeRay::Scanners::Clojure::UINT2 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#118
+CodeRay::Scanners::Clojure::UINT8 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#121
+CodeRay::Scanners::Clojure::UREAL10 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#122
+CodeRay::Scanners::Clojure::UREAL16 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#124
+CodeRay::Scanners::Clojure::UREAL2 = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/clojure.rb#123
+CodeRay::Scanners::Clojure::UREAL8 = T.let(T.unsafe(nil), Regexp)
+
+# = Debug Scanner
+#
+# Interprets the output of the Encoders::Debug encoder (basically the inverse function).
+#
+# source://coderay//lib/coderay/scanners/debug.rb#9
+class CodeRay::Scanners::Debug < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/debug.rb#21
+ def scan_tokens(encoder, options); end
+
+ # source://coderay//lib/coderay/scanners/debug.rb#16
+ def setup; end
+end
+
+# Scanner for the Delphi language (Object Pascal).
+#
+# Alias: +pascal+
+#
+# source://coderay//lib/coderay/scanners/delphi.rb#7
+class CodeRay::Scanners::Delphi < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/delphi.rb#45
+ def scan_tokens(encoder, options); end
+end
+
+# source://coderay//lib/coderay/scanners/delphi.rb#25
+CodeRay::Scanners::Delphi::DIRECTIVES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/delphi.rb#36
+CodeRay::Scanners::Delphi::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring)
+
+# source://coderay//lib/coderay/scanners/delphi.rb#12
+CodeRay::Scanners::Delphi::KEYWORDS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/delphi.rb#40
+CodeRay::Scanners::Delphi::NAME_FOLLOWS = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring)
+
+# Scanner for output of the diff command.
+#
+# Alias: +patch+
+#
+# source://coderay//lib/coderay/scanners/diff.rb#7
+class CodeRay::Scanners::Diff < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/diff.rb#19
+ def scan_tokens(encoder, options); end
+
+ private
+
+ # source://coderay//lib/coderay/scanners/diff.rb#204
+ def diff(a, b); end
+end
+
+# source://coderay//lib/coderay/scanners/diff.rb#12
+CodeRay::Scanners::Diff::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
+
+# Scanner for HTML ERB templates.
+#
+# source://coderay//lib/coderay/scanners/erb.rb#8
+class CodeRay::Scanners::ERB < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/erb.rb#38
+ def reset_instance; end
+
+ # source://coderay//lib/coderay/scanners/erb.rb#43
+ def scan_tokens(encoder, options); end
+
+ # source://coderay//lib/coderay/scanners/erb.rb#33
+ def setup; end
+end
+
+# source://coderay//lib/coderay/scanners/erb.rb#15
+CodeRay::Scanners::ERB::ERB_RUBY_BLOCK = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/erb.rb#13
+CodeRay::Scanners::ERB::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/erb.rb#27
+CodeRay::Scanners::ERB::START_OF_ERB = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/go.rb#4
+class CodeRay::Scanners::Go < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/go.rb#50
+ def scan_tokens(encoder, options); end
+end
+
+# source://coderay//lib/coderay/scanners/go.rb#45
+CodeRay::Scanners::Go::ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/go.rb#39
+CodeRay::Scanners::Go::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# http://golang.org/ref/spec#Keywords
+#
+# source://coderay//lib/coderay/scanners/go.rb#10
+CodeRay::Scanners::Go::KEYWORDS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/go.rb#29
+CodeRay::Scanners::Go::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/go.rb#34
+CodeRay::Scanners::Go::PREDEFINED_FUNCTIONS = T.let(T.unsafe(nil), Array)
+
+# http://golang.org/ref/spec#Types
+#
+# source://coderay//lib/coderay/scanners/go.rb#19
+CodeRay::Scanners::Go::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/go.rb#46
+CodeRay::Scanners::Go::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# Scanner for Groovy.
+#
+# source://coderay//lib/coderay/scanners/groovy.rb#7
+class CodeRay::Scanners::Groovy < ::CodeRay::Scanners::Java
+ protected
+
+ # source://coderay//lib/coderay/scanners/groovy.rb#43
+ def scan_tokens(encoder, options); end
+
+ # source://coderay//lib/coderay/scanners/groovy.rb#39
+ def setup; end
+end
+
+# source://coderay//lib/coderay/scanners/groovy.rb#24
+CodeRay::Scanners::Groovy::ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# TODO: check list of keywords
+#
+# source://coderay//lib/coderay/scanners/groovy.rb#12
+CodeRay::Scanners::Groovy::GROOVY_KEYWORDS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/groovy.rb#18
+CodeRay::Scanners::Groovy::GROOVY_MAGIC_VARIABLES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/groovy.rb#20
+CodeRay::Scanners::Groovy::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# source://coderay//lib/coderay/scanners/groovy.rb#15
+CodeRay::Scanners::Groovy::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# source://coderay//lib/coderay/scanners/groovy.rb#26
+CodeRay::Scanners::Groovy::REGEXP_ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# TODO: interpretation inside ', ", /
+#
+# source://coderay//lib/coderay/scanners/groovy.rb#29
+CodeRay::Scanners::Groovy::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/scanners/groovy.rb#25
+CodeRay::Scanners::Groovy::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/haml.rb#8
+class CodeRay::Scanners::HAML < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/haml.rb#24
+ def scan_tokens(encoder, options); end
+
+ # source://coderay//lib/coderay/scanners/haml.rb#17
+ def setup; end
+end
+
+# source://coderay//lib/coderay/scanners/haml.rb#13
+CodeRay::Scanners::HAML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
+
+# HTML Scanner
+#
+# Alias: +xhtml+
+#
+# See also: Scanners::XML
+#
+# source://coderay//lib/coderay/scanners/html.rb#9
+class CodeRay::Scanners::HTML < ::CodeRay::Scanners::Scanner
+ # source://coderay//lib/coderay/scanners/html.rb#62
+ def reset; end
+
+ protected
+
+ # source://coderay//lib/coderay/scanners/html.rb#83
+ def scan_css(encoder, code, state = T.unsafe(nil)); end
+
+ # source://coderay//lib/coderay/scanners/html.rb#76
+ def scan_java_script(encoder, code); end
+
+ # source://coderay//lib/coderay/scanners/html.rb#90
+ def scan_tokens(encoder, options); end
+
+ # source://coderay//lib/coderay/scanners/html.rb#70
+ def setup; end
+end
+
+# source://coderay//lib/coderay/scanners/html.rb#39
+CodeRay::Scanners::HTML::ATTR_NAME = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/html.rb#42
+CodeRay::Scanners::HTML::ENTITY = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/html.rb#20
+CodeRay::Scanners::HTML::EVENT_ATTRIBUTES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/html.rb#41
+CodeRay::Scanners::HTML::HEX = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/html.rb#35
+CodeRay::Scanners::HTML::IN_ATTRIBUTE = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring)
+
+# source://coderay//lib/coderay/scanners/html.rb#13
+CodeRay::Scanners::HTML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/html.rb#57
+CodeRay::Scanners::HTML::PLAIN_STRING_CONTENT = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/scanners/html.rb#40
+CodeRay::Scanners::HTML::TAG_END = T.let(T.unsafe(nil), Regexp)
+
+# Scanner for JSON (JavaScript Object Notation).
+#
+# source://coderay//lib/coderay/scanners/json.rb#5
+class CodeRay::Scanners::JSON < ::CodeRay::Scanners::Scanner
+ protected
+
+ # See http://json.org/ for a definition of the JSON lexic/grammar.
+ #
+ # source://coderay//lib/coderay/scanners/json.rb#26
+ def scan_tokens(encoder, options); end
+
+ # source://coderay//lib/coderay/scanners/json.rb#21
+ def setup; end
+end
+
+# source://coderay//lib/coderay/scanners/json.rb#15
+CodeRay::Scanners::JSON::ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/json.rb#17
+CodeRay::Scanners::JSON::KEY = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/json.rb#10
+CodeRay::Scanners::JSON::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/json.rb#16
+CodeRay::Scanners::JSON::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# Scanner for Java.
+#
+# source://coderay//lib/coderay/scanners/java.rb#5
+class CodeRay::Scanners::Java < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/java.rb#51
+ def scan_tokens(encoder, options); end
+end
+
+# source://coderay//lib/coderay/scanners/java/builtin_types.rb#4
+module CodeRay::Scanners::Java::BuiltinTypes; end
+
+# source://coderay//lib/coderay/scanners/java/builtin_types.rb#7
+CodeRay::Scanners::Java::BuiltinTypes::List = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/java.rb#19
+CodeRay::Scanners::Java::CONSTANTS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/java.rb#25
+CodeRay::Scanners::Java::DIRECTIVES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/java.rb#40
+CodeRay::Scanners::Java::ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/java.rb#47
+CodeRay::Scanners::Java::IDENT = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/java.rb#30
+CodeRay::Scanners::Java::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html
+#
+# source://coderay//lib/coderay/scanners/java.rb#12
+CodeRay::Scanners::Java::KEYWORDS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/java.rb#20
+CodeRay::Scanners::Java::MAGIC_VARIABLES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/java.rb#18
+CodeRay::Scanners::Java::RESERVED = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/java.rb#42
+CodeRay::Scanners::Java::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/scanners/java.rb#21
+CodeRay::Scanners::Java::TYPES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/java.rb#41
+CodeRay::Scanners::Java::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# Scanner for JavaScript.
+#
+# Aliases: +ecmascript+, +ecma_script+, +javascript+
+#
+# source://coderay//lib/coderay/scanners/java_script.rb#7
+class CodeRay::Scanners::JavaScript < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/java_script.rb#224
+ def reset_instance; end
+
+ # source://coderay//lib/coderay/scanners/java_script.rb#61
+ def scan_tokens(encoder, options); end
+
+ # source://coderay//lib/coderay/scanners/java_script.rb#57
+ def setup; end
+
+ # source://coderay//lib/coderay/scanners/java_script.rb#229
+ def xml_scanner; end
+end
+
+# source://coderay//lib/coderay/scanners/java_script.rb#42
+CodeRay::Scanners::JavaScript::ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/java_script.rb#36
+CodeRay::Scanners::JavaScript::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# The actual JavaScript keywords.
+#
+# source://coderay//lib/coderay/scanners/java_script.rb#13
+CodeRay::Scanners::JavaScript::KEYWORDS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/java_script.rb#24
+CodeRay::Scanners::JavaScript::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# source://coderay//lib/coderay/scanners/java_script.rb#50
+CodeRay::Scanners::JavaScript::KEY_CHECK_PATTERN = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/scanners/java_script.rb#22
+CodeRay::Scanners::JavaScript::MAGIC_VARIABLES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/java_script.rb#18
+CodeRay::Scanners::JavaScript::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/java_script.rb#44
+CodeRay::Scanners::JavaScript::REGEXP_ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# Reserved for future use.
+#
+# source://coderay//lib/coderay/scanners/java_script.rb#29
+CodeRay::Scanners::JavaScript::RESERVED_WORDS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/java_script.rb#45
+CodeRay::Scanners::JavaScript::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/scanners/java_script.rb#43
+CodeRay::Scanners::JavaScript::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# Scanner for the Lua[http://lua.org] programming lanuage.
+#
+# The language’s complete syntax is defined in
+# {the Lua manual}[http://www.lua.org/manual/5.2/manual.html],
+# which is what this scanner tries to conform to.
+#
+# source://coderay//lib/coderay/scanners/lua.rb#11
+class CodeRay::Scanners::Lua < ::CodeRay::Scanners::Scanner
+ protected
+
+ # CodeRay entry hook. Starts parsing.
+ #
+ # source://coderay//lib/coderay/scanners/lua.rb#60
+ def scan_tokens(encoder, options); end
+
+ # Scanner initialization.
+ #
+ # source://coderay//lib/coderay/scanners/lua.rb#54
+ def setup; end
+end
+
+# Automatic token kind selection for normal words.
+#
+# source://coderay//lib/coderay/scanners/lua.rb#46
+CodeRay::Scanners::Lua::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# Keywords used in Lua.
+#
+# source://coderay//lib/coderay/scanners/lua.rb#18
+CodeRay::Scanners::Lua::KEYWORDS = T.let(T.unsafe(nil), Array)
+
+# Constants set by the Lua core.
+#
+# source://coderay//lib/coderay/scanners/lua.rb#25
+CodeRay::Scanners::Lua::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array)
+
+# The expressions contained in this array are parts of Lua’s `basic'
+# library. Although it’s not entirely necessary to load that library,
+# it is highly recommended and one would have to provide own implementations
+# of some of these expressions if one does not do so. They however aren’t
+# keywords, neither are they constants, but nearly predefined, so they
+# get tagged as `predefined' rather than anything else.
+#
+# This list excludes values of form `_UPPERCASE' because the Lua manual
+# requires such identifiers to be reserved by Lua anyway and they are
+# highlighted directly accordingly, without the need for specific
+# identifiers to be listed here.
+#
+# source://coderay//lib/coderay/scanners/lua.rb#38
+CodeRay::Scanners::Lua::PREDEFINED_EXPRESSIONS = T.let(T.unsafe(nil), Array)
+
+# Scanner for PHP.
+#
+# Original by Stefan Walk.
+#
+# source://coderay//lib/coderay/scanners/php.rb#10
+class CodeRay::Scanners::PHP < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/php.rb#23
+ def reset_instance; end
+
+ # source://coderay//lib/coderay/scanners/php.rb#234
+ def scan_tokens(encoder, options); end
+
+ # source://coderay//lib/coderay/scanners/php.rb#19
+ def setup; end
+end
+
+# source://coderay//lib/coderay/scanners/php.rb#15
+CodeRay::Scanners::PHP::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/php.rb#197
+module CodeRay::Scanners::PHP::RE; end
+
+# source://coderay//lib/coderay/scanners/php.rb#211
+CodeRay::Scanners::PHP::RE::HTML_INDICATOR = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/php.rb#213
+CodeRay::Scanners::PHP::RE::IDENTIFIER = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/php.rb#216
+CodeRay::Scanners::PHP::RE::OPERATOR = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/php.rb#206
+CodeRay::Scanners::PHP::RE::PHP_END = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/php.rb#199
+CodeRay::Scanners::PHP::RE::PHP_START = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/php.rb#214
+CodeRay::Scanners::PHP::RE::VARIABLE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/php.rb#28
+module CodeRay::Scanners::PHP::Words; end
+
+# according to http://php.net/quickref.php on 2009-04-21;
+# all functions with _ excluded (module functions) and selected additional functions
+#
+# source://coderay//lib/coderay/scanners/php.rb#50
+CodeRay::Scanners::PHP::Words::BUILTIN_FUNCTIONS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/php.rb#46
+CodeRay::Scanners::PHP::Words::CLASSES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/php.rb#145
+CodeRay::Scanners::PHP::Words::CONSTANTS = T.let(T.unsafe(nil), Array)
+
+# TODO: more built-in PHP functions?
+#
+# source://coderay//lib/coderay/scanners/php.rb#140
+CodeRay::Scanners::PHP::Words::EXCEPTIONS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/php.rb#184
+CodeRay::Scanners::PHP::Words::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring)
+
+# according to http://www.php.net/manual/en/reserved.keywords.php
+#
+# source://coderay//lib/coderay/scanners/php.rb#31
+CodeRay::Scanners::PHP::Words::KEYWORDS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/php.rb#41
+CodeRay::Scanners::PHP::Words::LANGUAGE_CONSTRUCTS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/php.rb#178
+CodeRay::Scanners::PHP::Words::PREDEFINED = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/php.rb#39
+CodeRay::Scanners::PHP::Words::TYPES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/php.rb#193
+CodeRay::Scanners::PHP::Words::VARIABLE_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# Scanner for Python. Supports Python 3.
+#
+# Based on pygments' PythonLexer, see
+# http://dev.pocoo.org/projects/pygments/browser/pygments/lexers/agile.py.
+#
+# source://coderay//lib/coderay/scanners/python.rb#8
+class CodeRay::Scanners::Python < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/python.rb#103
+ def scan_tokens(encoder, options); end
+end
+
+# source://coderay//lib/coderay/scanners/python.rb#86
+CodeRay::Scanners::Python::DEF_NEW_STATE = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# source://coderay//lib/coderay/scanners/python.rb#91
+CodeRay::Scanners::Python::DESCRIPTOR = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/python.rb#97
+CodeRay::Scanners::Python::DOCSTRING_COMING = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/python.rb#65
+CodeRay::Scanners::Python::ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/python.rb#57
+CodeRay::Scanners::Python::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# source://coderay//lib/coderay/scanners/python.rb#13
+CodeRay::Scanners::Python::KEYWORDS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/python.rb#64
+CodeRay::Scanners::Python::NAME = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/python.rb#21
+CodeRay::Scanners::Python::OLD_KEYWORDS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/python.rb#68
+CodeRay::Scanners::Python::OPERATOR = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/python.rb#37
+CodeRay::Scanners::Python::PREDEFINED_EXCEPTIONS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/python.rb#25
+CodeRay::Scanners::Python::PREDEFINED_METHODS_AND_TYPES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/python.rb#52
+CodeRay::Scanners::Python::PREDEFINED_VARIABLES_AND_CONSTANTS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/python.rb#82
+CodeRay::Scanners::Python::STRING_CONTENT_REGEXP = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/scanners/python.rb#78
+CodeRay::Scanners::Python::STRING_DELIMITER_REGEXP = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/scanners/python.rb#66
+CodeRay::Scanners::Python::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# = Raydebug Scanner
+#
+# Highlights the output of the Encoders::Debug encoder.
+#
+# source://coderay//lib/coderay/scanners/raydebug.rb#9
+class CodeRay::Scanners::Raydebug < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/raydebug.rb#22
+ def scan_tokens(encoder, options); end
+
+ # source://coderay//lib/coderay/scanners/raydebug.rb#17
+ def setup; end
+end
+
+# This scanner is really complex, since Ruby _is_ a complex language!
+#
+# It tries to highlight 100% of all common code,
+# and 90% of strange codes.
+#
+# It is optimized for HTML highlighting, and is not very useful for
+# parsing or pretty printing.
+#
+# source://coderay//lib/coderay/scanners/ruby.rb#11
+class CodeRay::Scanners::Ruby < ::CodeRay::Scanners::Scanner
+ # source://coderay//lib/coderay/scanners/ruby.rb#19
+ def interpreted_string_state; end
+
+ protected
+
+ # source://coderay//lib/coderay/scanners/ruby.rb#29
+ def scan_tokens(encoder, options); end
+
+ # source://coderay//lib/coderay/scanners/ruby.rb#25
+ def setup; end
+end
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#5
+module CodeRay::Scanners::Ruby::Patterns; end
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#72
+CodeRay::Scanners::Ruby::Patterns::BINARY = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#106
+CodeRay::Scanners::Ruby::Patterns::CHARACTER = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#55
+CodeRay::Scanners::Ruby::Patterns::CLASS_VARIABLE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#96
+CodeRay::Scanners::Ruby::Patterns::CONTROL_META_ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#132
+CodeRay::Scanners::Ruby::Patterns::DATA = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#69
+CodeRay::Scanners::Ruby::Patterns::DECIMAL = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#102
+CodeRay::Scanners::Ruby::Patterns::ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#74
+CodeRay::Scanners::Ruby::Patterns::EXPONENT = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#168
+CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_INTERPRETED = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#161
+CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_KIND = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#160
+CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_START = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#76
+CodeRay::Scanners::Ruby::Patterns::FLOAT_OR_INT = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#75
+CodeRay::Scanners::Ruby::Patterns::FLOAT_SUFFIX = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#57
+CodeRay::Scanners::Ruby::Patterns::GLOBAL_VARIABLE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#116
+CodeRay::Scanners::Ruby::Patterns::HEREDOC_OPEN = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#71
+CodeRay::Scanners::Ruby::Patterns::HEXADECIMAL = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#38
+CodeRay::Scanners::Ruby::Patterns::IDENT = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#28
+CodeRay::Scanners::Ruby::Patterns::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#54
+CodeRay::Scanners::Ruby::Patterns::INSTANCE_VARIABLE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#7
+CodeRay::Scanners::Ruby::Patterns::KEYWORDS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#151
+CodeRay::Scanners::Ruby::Patterns::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#32
+CodeRay::Scanners::Ruby::Patterns::KEYWORD_NEW_STATE = T.let(T.unsafe(nil), CodeRay::WordList)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#53
+CodeRay::Scanners::Ruby::Patterns::METHOD_AFTER_DOT = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#40
+CodeRay::Scanners::Ruby::Patterns::METHOD_NAME = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#52
+CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_EX = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#41
+CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_OPERATOR = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#87
+CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_OR_SYMBOL = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#51
+CodeRay::Scanners::Ruby::Patterns::METHOD_SUFFIX = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#77
+CodeRay::Scanners::Ruby::Patterns::NUMERIC = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#56
+CodeRay::Scanners::Ruby::Patterns::OBJECT_VARIABLE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#70
+CodeRay::Scanners::Ruby::Patterns::OCTAL = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#17
+CodeRay::Scanners::Ruby::Patterns::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#58
+CodeRay::Scanners::Ruby::Patterns::PREFIX_VARIABLE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#61
+CodeRay::Scanners::Ruby::Patterns::QUOTE_TO_TYPE = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#67
+CodeRay::Scanners::Ruby::Patterns::REGEXP_MODIFIERS = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#126
+CodeRay::Scanners::Ruby::Patterns::RUBYDOC = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#138
+CodeRay::Scanners::Ruby::Patterns::RUBYDOC_OR_DATA = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#89
+CodeRay::Scanners::Ruby::Patterns::SIMPLE_ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#79
+CodeRay::Scanners::Ruby::Patterns::SYMBOL = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#142
+CodeRay::Scanners::Ruby::Patterns::VALUE_FOLLOWS = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/patterns.rb#59
+CodeRay::Scanners::Ruby::Patterns::VARIABLE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/ruby/string_state.rb#8
+class CodeRay::Scanners::Ruby::StringState < ::Struct
+ # @return [StringState] a new instance of StringState
+ #
+ # source://coderay//lib/coderay/scanners/ruby/string_state.rb#48
+ def initialize(kind, interpreted, delim, heredoc = T.unsafe(nil)); end
+
+ # source://coderay//lib/coderay/scanners/ruby/string_state.rb#63
+ def heredoc_pattern(delim, interpreted, indented); end
+
+ class << self
+ # source://coderay//lib/coderay/scanners/ruby/string_state.rb#40
+ def simple_key_pattern(delim); end
+ end
+end
+
+# source://coderay//lib/coderay/scanners/ruby/string_state.rb#10
+CodeRay::Scanners::Ruby::StringState::CLOSING_PAREN = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/scanners/ruby/string_state.rb#17
+CodeRay::Scanners::Ruby::StringState::STRING_PATTERN = T.let(T.unsafe(nil), Hash)
+
+# by Josh Goebel
+#
+# source://coderay//lib/coderay/scanners/sql.rb#5
+class CodeRay::Scanners::SQL < ::CodeRay::Scanners::Scanner
+ # source://coderay//lib/coderay/scanners/sql.rb#66
+ def scan_tokens(encoder, options); end
+end
+
+# source://coderay//lib/coderay/scanners/sql.rb#23
+CodeRay::Scanners::SQL::COMMANDS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/sql.rb#38
+CodeRay::Scanners::SQL::DIRECTIVES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/sql.rb#55
+CodeRay::Scanners::SQL::ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/sql.rb#46
+CodeRay::Scanners::SQL::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring)
+
+# source://coderay//lib/coderay/scanners/sql.rb#9
+CodeRay::Scanners::SQL::KEYWORDS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/sql.rb#18
+CodeRay::Scanners::SQL::OBJECTS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/sql.rb#44
+CodeRay::Scanners::SQL::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/sql.rb#36
+CodeRay::Scanners::SQL::PREDEFINED_FUNCTIONS = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/sql.rb#28
+CodeRay::Scanners::SQL::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/scanners/sql.rb#60
+CodeRay::Scanners::SQL::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/scanners/sql.rb#58
+CodeRay::Scanners::SQL::STRING_PREFIXES = T.let(T.unsafe(nil), Regexp)
+
+# source://coderay//lib/coderay/scanners/sql.rb#56
+CodeRay::Scanners::SQL::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# A scanner for Sass.
+#
+# source://coderay//lib/coderay/scanners/sass.rb#5
+class CodeRay::Scanners::Sass < ::CodeRay::Scanners::CSS
+ protected
+
+ # source://coderay//lib/coderay/scanners/sass.rb#16
+ def scan_tokens(encoder, options); end
+
+ # source://coderay//lib/coderay/scanners/sass.rb#12
+ def setup; end
+end
+
+# = Scanner
+#
+# The base class for all Scanners.
+#
+# It is a subclass of Ruby's great +StringScanner+, which
+# makes it easy to access the scanning methods inside.
+#
+# It is also +Enumerable+, so you can use it like an Array of
+# Tokens:
+#
+# require 'coderay'
+#
+# c_scanner = CodeRay::Scanners[:c].new "if (*p == '{') nest++;"
+#
+# for text, kind in c_scanner
+# puts text if kind == :operator
+# end
+#
+# # prints: (*==)++;
+#
+# OK, this is a very simple example :)
+# You can also use +map+, +any?+, +find+ and even +sort_by+,
+# if you want.
+#
+# source://coderay//lib/coderay/scanners/scanner.rb#29
+class CodeRay::Scanners::Scanner < ::StringScanner
+ include ::Enumerable
+ extend ::CodeRay::Plugin
+
+ # Create a new Scanner.
+ #
+ # * +code+ is the input String and is handled by the superclass
+ # StringScanner.
+ # * +options+ is a Hash with Symbols as keys.
+ # It is merged with the default options of the class (you can
+ # overwrite default options here.)
+ #
+ # Else, a Tokens object is used.
+ #
+ # @return [Scanner] a new instance of Scanner
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#125
+ def initialize(code = T.unsafe(nil), options = T.unsafe(nil)); end
+
+ # The string in binary encoding.
+ #
+ # To be used with #pos, which is the index of the byte the scanner
+ # will scan next.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#218
+ def binary_string; end
+
+ # The current column position of the scanner, starting with 1.
+ # See also: #line.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#209
+ def column(pos = T.unsafe(nil)); end
+
+ # Traverse the tokens.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#192
+ def each(&block); end
+
+ # the default file extension for this scanner
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#160
+ def file_extension; end
+
+ # the Plugin ID for this scanner
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#155
+ def lang; end
+
+ # The current line position of the scanner, starting with 1.
+ # See also: #column.
+ #
+ # Beware, this is implemented inefficiently. It should be used
+ # for debugging only.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#202
+ def line(pos = T.unsafe(nil)); end
+
+ # Sets back the scanner. Subclasses should redefine the reset_instance
+ # method instead of this one.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#142
+ def reset; end
+
+ # Returns the value of attribute state.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#44
+ def state; end
+
+ # Sets the attribute state
+ #
+ # @param value the value to set the attribute state to.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#44
+ def state=(_arg0); end
+
+ # Set a new string to be scanned.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#148
+ def string=(code); end
+
+ # Scan the code and returns all tokens in a Tokens object.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#165
+ def tokenize(source = T.unsafe(nil), options = T.unsafe(nil)); end
+
+ # Cache the result of tokenize.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#187
+ def tokens; end
+
+ protected
+
+ # Scanner error with additional status information
+ #
+ # @raise [ScanError]
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#314
+ def raise_inspect(message, tokens, state = T.unsafe(nil), ambit = T.unsafe(nil), backtrace = T.unsafe(nil)); end
+
+ # source://coderay//lib/coderay/scanners/scanner.rb#289
+ def raise_inspect_arguments(message, tokens, state, ambit); end
+
+ # Resets the scanner.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#265
+ def reset_instance; end
+
+ # Shorthand for scan_until(/\z/).
+ # This method also avoids a JRuby 1.9 mode bug.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#328
+ def scan_rest; end
+
+ # This is the central method, and commonly the only one a
+ # subclass implements.
+ #
+ # Subclasses must implement this method; it must return +tokens+
+ # and must only use Tokens#<< for storing scanned tokens!
+ #
+ # @raise [NotImplementedError]
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#260
+ def scan_tokens(tokens, options); end
+
+ # source://coderay//lib/coderay/scanners/scanner.rb#305
+ def scanner_state_info(state); end
+
+ # source://coderay//lib/coderay/scanners/scanner.rb#239
+ def set_string_from_source(source); end
+
+ # source://coderay//lib/coderay/scanners/scanner.rb#250
+ def set_tokens_from_options(options); end
+
+ # Can be implemented by subclasses to do some initialization
+ # that has to be done once per instance.
+ #
+ # Use reset for initialization that has to be done once per
+ # scan.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#236
+ def setup; end
+
+ # source://coderay//lib/coderay/scanners/scanner.rb#322
+ def tokens_last(tokens, n); end
+
+ # source://coderay//lib/coderay/scanners/scanner.rb#318
+ def tokens_size(tokens); end
+
+ class << self
+ # The encoding used internally by this scanner.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#71
+ def encoding(name = T.unsafe(nil)); end
+
+ # The typical filename suffix for this scanner's language.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#66
+ def file_extension(extension = T.unsafe(nil)); end
+
+ # The lang of this Scanner class, which is equal to its Plugin ID.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#76
+ def lang; end
+
+ # Normalizes the given code into a string with UNIX newlines, in the
+ # scanner's internal encoding, with invalid and undefined charachters
+ # replaced by placeholders. Always returns a new object.
+ #
+ # source://coderay//lib/coderay/scanners/scanner.rb#51
+ def normalize(code); end
+
+ protected
+
+ # source://coderay//lib/coderay/scanners/scanner.rb#82
+ def encode_with_encoding(code, target_encoding); end
+
+ # source://coderay//lib/coderay/scanners/scanner.rb#100
+ def guess_encoding(s); end
+
+ # source://coderay//lib/coderay/scanners/scanner.rb#96
+ def to_unix(code); end
+ end
+end
+
+# The default options for all scanner classes.
+#
+# Define @default_options for subclasses.
+#
+# source://coderay//lib/coderay/scanners/scanner.rb#40
+CodeRay::Scanners::Scanner::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/scanners/scanner.rb#42
+CodeRay::Scanners::Scanner::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
+
+# source://coderay//lib/coderay/helpers/plugin.rb#41
+CodeRay::Scanners::Scanner::PLUGIN_HOST = CodeRay::Scanners
+
+# source://coderay//lib/coderay/scanners/scanner.rb#299
+CodeRay::Scanners::Scanner::SCANNER_STATE_INFO = T.let(T.unsafe(nil), String)
+
+# source://coderay//lib/coderay/scanners/scanner.rb#271
+CodeRay::Scanners::Scanner::SCAN_ERROR_MESSAGE = T.let(T.unsafe(nil), String)
+
+# Raised if a Scanner fails while scanning
+#
+# source://coderay//lib/coderay/scanners/scanner.rb#35
+class CodeRay::Scanners::Scanner::ScanError < ::StandardError; end
+
+# source://coderay//lib/coderay/scanners/taskpaper.rb#4
+class CodeRay::Scanners::Taskpaper < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/taskpaper.rb#11
+ def scan_tokens(encoder, options); end
+end
+
+# Scanner for plain text.
+#
+# Yields just one token of the kind :plain.
+#
+# Alias: +plaintext+, +plain+
+#
+# source://coderay//lib/coderay/scanners/text.rb#9
+class CodeRay::Scanners::Text < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/text.rb#18
+ def scan_tokens(encoder, options); end
+end
+
+# source://coderay//lib/coderay/scanners/text.rb#14
+CodeRay::Scanners::Text::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array)
+
+# Scanner for XML.
+#
+# Currently this is the same scanner as Scanners::HTML.
+#
+# source://coderay//lib/coderay/scanners/xml.rb#9
+class CodeRay::Scanners::XML < ::CodeRay::Scanners::HTML; end
+
+# Scanner for YAML.
+#
+# Based on the YAML scanner from Syntax by Jamis Buck.
+#
+# source://coderay//lib/coderay/scanners/yaml.rb#7
+class CodeRay::Scanners::YAML < ::CodeRay::Scanners::Scanner
+ protected
+
+ # source://coderay//lib/coderay/scanners/yaml.rb#16
+ def scan_tokens(encoder, options); end
+end
+
+# source://coderay//lib/coderay/scanners/yaml.rb#12
+CodeRay::Scanners::YAML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Symbol)
+
+# This module holds the Style class and its subclasses.
+#
+# See Plugin.
+#
+# source://coderay//lib/coderay/styles.rb#6
+module CodeRay::Styles
+ extend ::CodeRay::PluginHost
+end
+
+# A colorful theme using CSS 3 colors (with alpha channel).
+#
+# source://coderay//lib/coderay/styles/alpha.rb#5
+class CodeRay::Styles::Alpha < ::CodeRay::Styles::Style; end
+
+# source://coderay//lib/coderay/styles/alpha.rb#14
+CodeRay::Styles::Alpha::CSS_MAIN_STYLES = T.let(T.unsafe(nil), String)
+
+# source://coderay//lib/coderay/styles/alpha.rb#53
+CodeRay::Styles::Alpha::TOKEN_COLORS = T.let(T.unsafe(nil), String)
+
+# Base class for styles.
+#
+# Styles are used by Encoders::HTML to colorize tokens.
+#
+# source://coderay//lib/coderay/styles/style.rb#8
+class CodeRay::Styles::Style
+ extend ::CodeRay::Plugin
+end
+
+# source://coderay//lib/coderay/styles/style.rb#12
+CodeRay::Styles::Style::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
+
+# source://coderay//lib/coderay/helpers/plugin.rb#41
+CodeRay::Styles::Style::PLUGIN_HOST = CodeRay::Styles
+
+# A Hash of all known token kinds and their associated CSS classes.
+#
+# source://coderay//lib/coderay/token_kinds.rb#4
+CodeRay::TokenKinds = T.let(T.unsafe(nil), Hash)
+
+# The Tokens class represents a list of tokens returned from
+# a Scanner. It's actually just an Array with a few helper methods.
+#
+# A token itself is not a special object, just two elements in an Array:
+# * the _token_ _text_ (the original source of the token in a String) or
+# a _token_ _action_ (begin_group, end_group, begin_line, end_line)
+# * the _token_ _kind_ (a Symbol representing the type of the token)
+#
+# It looks like this:
+#
+# ..., '# It looks like this', :comment, ...
+# ..., '3.1415926', :float, ...
+# ..., '$^', :error, ...
+#
+# Some scanners also yield sub-tokens, represented by special
+# token actions, for example :begin_group and :end_group.
+#
+# The Ruby scanner, for example, splits "a string" into:
+#
+# [
+# :begin_group, :string,
+# '"', :delimiter,
+# 'a string', :content,
+# '"', :delimiter,
+# :end_group, :string
+# ]
+#
+# Tokens can be used to save the output of a Scanners in a simple
+# Ruby object that can be send to an Encoder later:
+#
+# tokens = CodeRay.scan('price = 2.59', :ruby).tokens
+# tokens.encode(:html)
+# tokens.html
+# CodeRay.encoder(:html).encode_tokens(tokens)
+#
+# Tokens gives you the power to handle pre-scanned code very easily:
+# You can serialize it to a JSON string and store it in a database, pass it
+# around to encode it more than once, send it to other algorithms...
+#
+# source://coderay//lib/coderay/tokens.rb#41
+class CodeRay::Tokens < ::Array
+ # source://coderay//lib/coderay/tokens.rb#156
+ def begin_group(kind); end
+
+ # source://coderay//lib/coderay/tokens.rb#158
+ def begin_line(kind); end
+
+ # Return the actual number of tokens.
+ #
+ # source://coderay//lib/coderay/tokens.rb#151
+ def count; end
+
+ # Encode the tokens using encoder.
+ #
+ # encoder can be
+ # * a plugin name like :html oder 'statistic'
+ # * an Encoder object
+ #
+ # options are passed to the encoder.
+ #
+ # source://coderay//lib/coderay/tokens.rb#56
+ def encode(encoder, options = T.unsafe(nil)); end
+
+ # source://coderay//lib/coderay/tokens.rb#157
+ def end_group(kind); end
+
+ # source://coderay//lib/coderay/tokens.rb#159
+ def end_line(kind); end
+
+ # Redirects unknown methods to encoder calls.
+ #
+ # For example, if you call +tokens.html+, the HTML encoder
+ # is used to highlight the tokens.
+ #
+ # source://coderay//lib/coderay/tokens.rb#70
+ def method_missing(meth, options = T.unsafe(nil)); end
+
+ # The Scanner instance that created the tokens.
+ #
+ # source://coderay//lib/coderay/tokens.rb#47
+ def scanner; end
+
+ # The Scanner instance that created the tokens.
+ #
+ # source://coderay//lib/coderay/tokens.rb#47
+ def scanner=(_arg0); end
+
+ # Split the tokens into parts of the given +sizes+.
+ #
+ # The result will be an Array of Tokens objects. The parts have
+ # the text size specified by the parameter. In addition, each
+ # part closes all opened tokens. This is useful to insert tokens
+ # betweem them.
+ #
+ # This method is used by @Scanner#tokenize@ when called with an Array
+ # of source strings. The Diff encoder uses it for inline highlighting.
+ #
+ # source://coderay//lib/coderay/tokens.rb#85
+ def split_into_parts(*sizes); end
+
+ # source://coderay//lib/coderay/tokens.rb#155
+ def text_token(*_arg0); end
+
+ # Turn tokens into a string by concatenating them.
+ #
+ # source://coderay//lib/coderay/tokens.rb#62
+ def to_s; end
+
+ # source://coderay//lib/coderay/tokens.rb#160
+ def tokens(*_arg0); end
+end
+
+# The result of a scan operation is a TokensProxy, but should act like Tokens.
+#
+# This proxy makes it possible to use the classic CodeRay.scan.encode API
+# while still providing the benefits of direct streaming.
+#
+# source://coderay//lib/coderay/tokens_proxy.rb#7
+class CodeRay::TokensProxy
+ # Create a new TokensProxy with the arguments of CodeRay.scan.
+ #
+ # @return [TokensProxy] a new instance of TokensProxy
+ #
+ # source://coderay//lib/coderay/tokens_proxy.rb#12
+ def initialize(input, lang, options = T.unsafe(nil), block = T.unsafe(nil)); end
+
+ # Returns the value of attribute block.
+ #
+ # source://coderay//lib/coderay/tokens_proxy.rb#9
+ def block; end
+
+ # Sets the attribute block
+ #
+ # @param value the value to set the attribute block to.
+ #
+ # source://coderay//lib/coderay/tokens_proxy.rb#9
+ def block=(_arg0); end
+
+ # Overwrite Struct#each.
+ #
+ # source://coderay//lib/coderay/tokens_proxy.rb#48
+ def each(*args, &blk); end
+
+ # Call CodeRay.encode if +encoder+ is a Symbol;
+ # otherwise, convert the receiver to tokens and call encoder.encode_tokens.
+ #
+ # source://coderay//lib/coderay/tokens_proxy.rb#21
+ def encode(encoder, options = T.unsafe(nil)); end
+
+ # Returns the value of attribute input.
+ #
+ # source://coderay//lib/coderay/tokens_proxy.rb#9
+ def input; end
+
+ # Sets the attribute input
+ #
+ # @param value the value to set the attribute input to.
+ #
+ # source://coderay//lib/coderay/tokens_proxy.rb#9
+ def input=(_arg0); end
+
+ # Returns the value of attribute lang.
+ #
+ # source://coderay//lib/coderay/tokens_proxy.rb#9
+ def lang; end
+
+ # Sets the attribute lang
+ #
+ # @param value the value to set the attribute lang to.
+ #
+ # source://coderay//lib/coderay/tokens_proxy.rb#9
+ def lang=(_arg0); end
+
+ # Tries to call encode;
+ # delegates to tokens otherwise.
+ #
+ # source://coderay//lib/coderay/tokens_proxy.rb#31
+ def method_missing(method, *args, &blk); end
+
+ # Returns the value of attribute options.
+ #
+ # source://coderay//lib/coderay/tokens_proxy.rb#9
+ def options; end
+
+ # Sets the attribute options
+ #
+ # @param value the value to set the attribute options to.
+ #
+ # source://coderay//lib/coderay/tokens_proxy.rb#9
+ def options=(_arg0); end
+
+ # A (cached) scanner instance to use for the scan task.
+ #
+ # source://coderay//lib/coderay/tokens_proxy.rb#43
+ def scanner; end
+
+ # The (cached) result of the tokenized input; a Tokens instance.
+ #
+ # source://coderay//lib/coderay/tokens_proxy.rb#38
+ def tokens; end
+end
+
+# source://coderay//lib/coderay/version.rb#2
+CodeRay::VERSION = T.let(T.unsafe(nil), String)
+
+# = WordList
+#
+#
A Hash subclass designed for mapping word lists to token types.
+#
+# A WordList is a Hash with some additional features.
+# It is intended to be used for keyword recognition.
+#
+# WordList is optimized to be used in Scanners,
+# typically to decide whether a given ident is a special token.
+#
+# For case insensitive words use WordList::CaseIgnoring.
+#
+# Example:
+#
+# # define word arrays
+# RESERVED_WORDS = %w[
+# asm break case continue default do else
+# ]
+#
+# PREDEFINED_TYPES = %w[
+# int long short char void
+# ]
+#
+# # make a WordList
+# IDENT_KIND = WordList.new(:ident).
+# add(RESERVED_WORDS, :reserved).
+# add(PREDEFINED_TYPES, :predefined_type)
+#
+# ...
+#
+# def scan_tokens tokens, options
+# ...
+#
+# elsif scan(/[A-Za-z_][A-Za-z_0-9]*/)
+# # use it
+# kind = IDENT_KIND[match]
+# ...
+#
+# source://coderay//lib/coderay/helpers/word_list.rb#40
+class CodeRay::WordList < ::Hash
+ # Create a new WordList with +default+ as default value.
+ #
+ # @return [WordList] a new instance of WordList
+ #
+ # source://coderay//lib/coderay/helpers/word_list.rb#43
+ def initialize(default = T.unsafe(nil)); end
+
+ # Add words to the list and associate them with +value+.
+ #
+ # Returns +self+, so you can concat add calls.
+ #
+ # source://coderay//lib/coderay/helpers/word_list.rb#50
+ def add(words, value = T.unsafe(nil)); end
+end
+
+# A CaseIgnoring WordList is like a WordList, only that
+# keys are compared case-insensitively (normalizing keys using +downcase+).
+#
+# source://coderay//lib/coderay/helpers/word_list.rb#60
+class CodeRay::WordList::CaseIgnoring < ::CodeRay::WordList
+ # source://coderay//lib/coderay/helpers/word_list.rb#62
+ def [](key); end
+
+ # source://coderay//lib/coderay/helpers/word_list.rb#66
+ def []=(key, value); end
+end
diff --git a/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi b/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi
deleted file mode 100644
index 56979c3..0000000
--- a/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi
+++ /dev/null
@@ -1,2396 +0,0 @@
-# typed: true
-
-# DO NOT EDIT MANUALLY
-# This is an autogenerated file for types exported from the `concurrent-ruby` gem.
-# Please instead update this file by running `bin/tapioca gem concurrent-ruby`.
-
-module Concurrent
- extend ::Concurrent::Utility::EngineDetector
- extend ::Concurrent::Utility::NativeExtensionLoader
- extend ::Logger::Severity
- extend ::Concurrent::Concern::Logging
- extend ::Concurrent::Concern::Deprecation
-
- private
-
- 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 = T.unsafe(nil)); end
-
- class << self
- def abort_transaction; end
- def atomically; end
- def call_dataflow(method, executor, *inputs, &block); end
- def create_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end
- def create_stdlib_logger(level = T.unsafe(nil), output = T.unsafe(nil)); 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 disable_at_exit_handlers!; end
- def executor(executor_identifier); end
- def global_fast_executor; end
- def global_immediate_executor; end
- def global_io_executor; end
- def global_logger; end
- def global_logger=(value); end
- def global_timer_set; end
- def leave_transaction; end
- def monotonic_time(unit = T.unsafe(nil)); end
- def new_fast_executor(opts = T.unsafe(nil)); end
- def new_io_executor(opts = T.unsafe(nil)); end
- def physical_processor_count; end
- def processor_count; end
- def processor_counter; end
- def use_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end
- def use_stdlib_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end
- end
-end
-
-class Concurrent::AbstractExchanger < ::Concurrent::Synchronization::Object
- def initialize; end
-
- def exchange(value, timeout = T.unsafe(nil)); end
- def exchange!(value, timeout = T.unsafe(nil)); end
- def try_exchange(value, timeout = T.unsafe(nil)); end
-
- private
-
- def do_exchange(value, timeout); end
-end
-
-Concurrent::AbstractExchanger::CANCEL = T.let(T.unsafe(nil), Object)
-
-class Concurrent::AbstractExecutorService < ::Concurrent::Synchronization::LockableObject
- include ::Logger::Severity
- include ::Concurrent::Concern::Logging
- include ::Concurrent::ExecutorService
- include ::Concurrent::Concern::Deprecation
-
- def initialize(opts = T.unsafe(nil), &block); end
-
- def auto_terminate=(value); end
- def auto_terminate?; end
- def fallback_policy; end
- def kill; end
- def name; end
- def running?; end
- def shutdown; end
- def shutdown?; end
- def shuttingdown?; end
- def to_s; end
- def wait_for_termination(timeout = T.unsafe(nil)); end
-
- private
-
- def fallback_action(*args); end
- def ns_auto_terminate?; end
- def ns_execute(*args, &task); end
- def ns_kill_execution; end
- def ns_shutdown_execution; end
-end
-
-Concurrent::AbstractExecutorService::FALLBACK_POLICIES = T.let(T.unsafe(nil), Array)
-
-class Concurrent::AbstractThreadLocalVar
- def initialize(default = T.unsafe(nil), &default_block); end
-
- def bind(value, &block); end
- def value; end
- def value=(value); end
-
- protected
-
- def allocate_storage; end
- def default; end
-end
-
-class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject
- include ::Concurrent::Concern::Observable
-
- def initialize(initial, opts = T.unsafe(nil)); end
-
- def <<(action); end
- def await; end
- def await_for(timeout); end
- def await_for!(timeout); end
- def deref; end
- def error; end
- def error_mode; end
- def failed?; end
- def post(*args, &action); end
- def reason; end
- def restart(new_value, opts = T.unsafe(nil)); 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 = T.unsafe(nil)); end
-
- private
-
- def enqueue_action_job(action, args, executor); end
- def enqueue_await_job(latch); end
- def execute_next_job; end
- def handle_error(error); end
- def ns_enqueue_job(job, index = T.unsafe(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
-
- class << self
- def await(*agents); end
- def await_for(timeout, *agents); end
- def await_for!(timeout, *agents); end
- end
-end
-
-Concurrent::Agent::AWAIT_ACTION = T.let(T.unsafe(nil), Proc)
-Concurrent::Agent::AWAIT_FLAG = T.let(T.unsafe(nil), Object)
-Concurrent::Agent::DEFAULT_ERROR_HANDLER = T.let(T.unsafe(nil), Proc)
-Concurrent::Agent::DEFAULT_VALIDATOR = T.let(T.unsafe(nil), Proc)
-Concurrent::Agent::ERROR_MODES = T.let(T.unsafe(nil), Array)
-
-class Concurrent::Agent::Error < ::StandardError
- def initialize(message = T.unsafe(nil)); end
-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
-
- class << self
- def [](*_arg0); end
- def inspect; end
- def members; end
- def new(*_arg0); end
- end
-end
-
-class Concurrent::Agent::ValidationError < ::Concurrent::Agent::Error
- def initialize(message = T.unsafe(nil)); end
-end
-
-class Concurrent::Array < ::Array; end
-Concurrent::ArrayImplementation = Array
-
-module Concurrent::Async
- mixes_in_class_methods ::Concurrent::Async::ClassMethods
-
- def async; end
- def await; end
- def call; end
- def cast; end
- def init_synchronization; end
-
- class << self
- def included(base); end
- def validate_argc(obj, method, *args); end
- 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
-
- private
-
- def respond_to_missing?(method, include_private = T.unsafe(nil)); end
-end
-
-class Concurrent::Async::AwaitDelegator
- def initialize(delegate); end
-
- def method_missing(method, *args, &block); end
-
- private
-
- def respond_to_missing?(method, include_private = T.unsafe(nil)); end
-end
-
-module Concurrent::Async::ClassMethods
- def new(*args, &block); end
-end
-
-class Concurrent::Atom < ::Concurrent::Synchronization::Object
- include ::Concurrent::Concern::Observable
-
- def initialize(value, opts = T.unsafe(nil)); end
-
- def __initialize_atomic_fields__; end
- def compare_and_set(old_value, new_value); end
- def deref; end
- def reset(new_value); end
- def swap(*args); end
- def value; end
-
- private
-
- def compare_and_set_value(expected, value); end
- def swap_value(value); end
- def update_value(&block); end
- def valid?(new_value); end
- def value=(value); end
-
- class << self
- def new(*args, &block); end
- end
-end
-
-class Concurrent::AtomicBoolean < ::Concurrent::MutexAtomicBoolean
- def inspect; end
- def to_s; end
-end
-
-Concurrent::AtomicBooleanImplementation = Concurrent::MutexAtomicBoolean
-
-module Concurrent::AtomicDirectUpdate
- def try_update; end
- def try_update!; end
- def update; end
-end
-
-class Concurrent::AtomicFixnum < ::Concurrent::MutexAtomicFixnum
- def inspect; end
- def to_s; end
-end
-
-Concurrent::AtomicFixnumImplementation = Concurrent::MutexAtomicFixnum
-
-class Concurrent::AtomicMarkableReference < ::Concurrent::Synchronization::Object
- def initialize(value = T.unsafe(nil), mark = T.unsafe(nil)); end
-
- def __initialize_atomic_fields__; end
- def compare_and_set(expected_val, new_val, expected_mark, new_mark); end
- def compare_and_swap(expected_val, new_val, expected_mark, new_mark); end
- def get; end
- def mark; end
- def marked?; end
- def set(new_val, new_mark); end
- def try_update; end
- def try_update!; end
- def update; end
- def value; end
-
- private
-
- def compare_and_set_reference(expected, value); end
- def immutable_array(*args); end
- def reference; end
- def reference=(value); end
- def swap_reference(value); end
- def update_reference(&block); end
-
- class << self
- def new(*args, &block); end
- end
-end
-
-module Concurrent::AtomicNumericCompareAndSetWrapper
- def compare_and_set(old_value, new_value); end
-end
-
-class Concurrent::AtomicReference < ::Concurrent::MutexAtomicReference
- def inspect; end
- def to_s; end
-end
-
-Concurrent::AtomicReferenceImplementation = Concurrent::MutexAtomicReference
-
-class Concurrent::CRubySet < ::Set
- def initialize(*args, &block); 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 inspect(*args); end
- def intersect?(*args); end
- def intersection(*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
-
- private
-
- def initialize_copy(other); end
-end
-
-class Concurrent::CachedThreadPool < ::Concurrent::ThreadPoolExecutor
- def initialize(opts = T.unsafe(nil)); end
-
- private
-
- def ns_initialize(opts); end
-end
-
-class Concurrent::CancelledOperationError < ::Concurrent::Error; end
-module Concurrent::Collection; end
-
-class Concurrent::Collection::CopyOnNotifyObserverSet < ::Concurrent::Synchronization::LockableObject
- def initialize; end
-
- def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end
- def count_observers; end
- def delete_observer(observer); end
- def delete_observers; end
- def notify_and_delete_observers(*args, &block); end
- def notify_observers(*args, &block); end
-
- protected
-
- def ns_initialize; end
-
- private
-
- def duplicate_and_clear_observers; end
- def duplicate_observers; end
- def notify_to(observers, *args); end
-end
-
-class Concurrent::Collection::CopyOnWriteObserverSet < ::Concurrent::Synchronization::LockableObject
- def initialize; end
-
- def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end
- def count_observers; end
- def delete_observer(observer); end
- def delete_observers; end
- def notify_and_delete_observers(*args, &block); end
- def notify_observers(*args, &block); end
-
- protected
-
- def ns_initialize; end
-
- private
-
- def clear_observers_and_return_old; end
- def notify_to(observers, *args); end
- def observers; end
- def observers=(new_set); end
-end
-
-Concurrent::Collection::MapImplementation = Concurrent::Collection::MriMapBackend
-
-class Concurrent::Collection::MriMapBackend < ::Concurrent::Collection::NonConcurrentMapBackend
- def initialize(options = T.unsafe(nil)); 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 get_and_set(key, value); 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::Collection::NonConcurrentMapBackend
- def initialize(options = T.unsafe(nil)); end
-
- 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 each_pair; end
- def get_and_set(key, value); end
- def get_or_default(key, default_value); end
- def key?(key); end
- def merge_pair(key, value); end
- def replace_if_exists(key, new_value); end
- def replace_pair(key, old_value, new_value); end
- def size; end
-
- private
-
- def _get(key); end
- def _set(key, value); end
- def dupped_backend; end
- def initialize_copy(other); end
- def pair?(key, expected_value); end
- def store_computed_value(key, new_value); 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
-
-Concurrent::Collection::NonConcurrentPriorityQueueImplementation = Concurrent::Collection::RubyNonConcurrentPriorityQueue
-
-class Concurrent::Collection::RubyNonConcurrentPriorityQueue
- def initialize(opts = T.unsafe(nil)); end
-
- 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 length; end
- def peek; end
- def pop; end
- def push(item); end
- def shift; end
- def size; end
-
- private
-
- def ordered?(x, y); end
- def sink(k); end
- def swap(x, y); end
- def swim(k); end
-
- class << self
- def from_list(list, opts = T.unsafe(nil)); end
- end
-end
-
-module Concurrent::Concern; end
-
-module Concurrent::Concern::Deprecation
- include ::Logger::Severity
- include ::Concurrent::Concern::Logging
- extend ::Logger::Severity
- extend ::Concurrent::Concern::Logging
- extend ::Concurrent::Concern::Deprecation
-
- def deprecated(message, strip = T.unsafe(nil)); end
- def deprecated_method(old_name, new_name); end
-end
-
-module Concurrent::Concern::Dereferenceable
- def deref; end
- def value; end
-
- protected
-
- def apply_deref_options(value); end
- def ns_set_deref_options(opts); end
- def set_deref_options(opts = T.unsafe(nil)); end
- def value=(value); end
-end
-
-module Concurrent::Concern::Logging
- include ::Logger::Severity
-
- def log(level, progname, message = T.unsafe(nil), &block); end
-end
-
-module Concurrent::Concern::Obligation
- include ::Concurrent::Concern::Dereferenceable
-
- def complete?; end
- def exception(*args); end
- def fulfilled?; end
- def incomplete?; end
- def no_error!(timeout = T.unsafe(nil)); end
- def pending?; end
- def realized?; end
- def reason; end
- def rejected?; end
- def state; end
- def unscheduled?; end
- def value(timeout = T.unsafe(nil)); end
- def value!(timeout = T.unsafe(nil)); end
- def wait(timeout = T.unsafe(nil)); end
- def wait!(timeout = T.unsafe(nil)); end
-
- protected
-
- def compare_and_set_state(next_state, *expected_current); end
- def event; end
- def get_arguments_from(opts = T.unsafe(nil)); end
- def if_state(*expected_states); end
- def init_obligation; end
- def ns_check_state?(expected); end
- def ns_set_state(value); end
- def set_state(success, value, reason); end
- def state=(value); end
-end
-
-module Concurrent::Concern::Observable
- def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end
- def count_observers; end
- def delete_observer(observer); end
- def delete_observers; end
- def with_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end
-
- protected
-
- def observers; end
- def observers=(_arg0); end
-end
-
-class Concurrent::ConcurrentUpdateError < ::ThreadError; end
-Concurrent::ConcurrentUpdateError::CONC_UP_ERR_BACKTRACE = T.let(T.unsafe(nil), Array)
-class Concurrent::ConfigurationError < ::Concurrent::Error; end
-class Concurrent::CountDownLatch < ::Concurrent::MutexCountDownLatch; end
-Concurrent::CountDownLatchImplementation = Concurrent::MutexCountDownLatch
-
-class Concurrent::CyclicBarrier < ::Concurrent::Synchronization::LockableObject
- def initialize(parties, &block); end
-
- def broken?; end
- def number_waiting; end
- def parties; end
- def reset; end
- def wait(timeout = T.unsafe(nil)); end
-
- protected
-
- def ns_generation_done(generation, status, continue = T.unsafe(nil)); end
- def ns_initialize(parties, &block); end
- def ns_next_generation; end
-end
-
-class Concurrent::CyclicBarrier::Generation < ::Struct
- def status; end
- def status=(_); end
-
- class << self
- def [](*_arg0); end
- def inspect; end
- def members; end
- def new(*_arg0); end
- end
-end
-
-class Concurrent::Delay < ::Concurrent::Synchronization::LockableObject
- include ::Concurrent::Concern::Dereferenceable
- include ::Concurrent::Concern::Obligation
-
- def initialize(opts = T.unsafe(nil), &block); end
-
- def reconfigure(&block); end
- def value(timeout = T.unsafe(nil)); end
- def value!(timeout = T.unsafe(nil)); end
- def wait(timeout = T.unsafe(nil)); end
-
- protected
-
- def ns_initialize(opts, &block); end
-
- private
-
- def execute_task_once; end
-end
-
-class Concurrent::DependencyCounter
- def initialize(count, &block); end
-
- def update(time, value, reason); end
-end
-
-class Concurrent::Error < ::StandardError; end
-
-class Concurrent::Event < ::Concurrent::Synchronization::LockableObject
- def initialize; end
-
- def reset; end
- def set; end
- def set?; end
- def try?; end
- def wait(timeout = T.unsafe(nil)); end
-
- protected
-
- def ns_initialize; end
- def ns_set; end
-end
-
-class Concurrent::Exchanger < ::Concurrent::RubyExchanger; end
-Concurrent::ExchangerImplementation = Concurrent::RubyExchanger
-
-module Concurrent::ExecutorService
- include ::Logger::Severity
- include ::Concurrent::Concern::Logging
-
- def <<(task); end
- def can_overflow?; end
- def post(*args, &task); end
- def serialized?; end
-end
-
-class Concurrent::FixedThreadPool < ::Concurrent::ThreadPoolExecutor
- def initialize(num_threads, opts = T.unsafe(nil)); end
-end
-
-class Concurrent::Future < ::Concurrent::IVar
- def initialize(opts = T.unsafe(nil), &block); end
-
- def cancel; end
- def cancelled?; end
- def execute; end
- def set(value = T.unsafe(nil), &block); end
- def wait_or_cancel(timeout); end
-
- protected
-
- def ns_initialize(value, opts); end
-
- class << self
- def execute(opts = T.unsafe(nil), &block); end
- end
-end
-
-Concurrent::GLOBAL_FAST_EXECUTOR = T.let(T.unsafe(nil), Concurrent::Delay)
-Concurrent::GLOBAL_IMMEDIATE_EXECUTOR = T.let(T.unsafe(nil), Concurrent::ImmediateExecutor)
-Concurrent::GLOBAL_IO_EXECUTOR = T.let(T.unsafe(nil), Concurrent::Delay)
-Concurrent::GLOBAL_LOGGER = T.let(T.unsafe(nil), Concurrent::AtomicReference)
-Concurrent::GLOBAL_TIMER_SET = T.let(T.unsafe(nil), Concurrent::Delay)
-class Concurrent::Hash < ::Hash; end
-Concurrent::HashImplementation = Hash
-
-class Concurrent::IVar < ::Concurrent::Synchronization::LockableObject
- include ::Concurrent::Concern::Dereferenceable
- include ::Concurrent::Concern::Obligation
- include ::Concurrent::Concern::Observable
-
- def initialize(value = T.unsafe(nil), opts = T.unsafe(nil), &block); end
-
- def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end
- def fail(reason = T.unsafe(nil)); end
- def set(value = T.unsafe(nil)); end
- def try_set(value = T.unsafe(nil), &block); end
-
- protected
-
- 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 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 = T.unsafe(nil)); end
-end
-
-class Concurrent::IllegalOperationError < ::Concurrent::Error; end
-
-class Concurrent::ImmediateExecutor < ::Concurrent::AbstractExecutorService
- include ::Concurrent::SerialExecutorService
-
- def initialize; end
-
- def <<(task); 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 = T.unsafe(nil)); end
-end
-
-class Concurrent::ImmutabilityError < ::Concurrent::Error; end
-
-module Concurrent::ImmutableStruct
- include ::Concurrent::Synchronization::AbstractStruct
-
- def ==(other); end
- def [](member); end
- def each(&block); end
- def each_pair(&block); end
- def inspect; end
- def merge(other, &block); end
- def select(&block); end
- def to_a; end
- def to_h; end
- def to_s; end
- def values; end
- def values_at(*indexes); end
-
- private
-
- def initialize_copy(original); end
-
- class << self
- def included(base); end
- def new(*args, &block); end
- end
-end
-
-Concurrent::ImmutableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped)
-
-class Concurrent::IndirectImmediateExecutor < ::Concurrent::ImmediateExecutor
- def initialize; end
-
- def post(*args, &task); end
-end
-
-class Concurrent::InitializationError < ::Concurrent::Error; end
-class Concurrent::LifecycleError < ::Concurrent::Error; end
-
-class Concurrent::LockFreeStack < ::Concurrent::Synchronization::Object
- include ::Enumerable
-
- def initialize(head = T.unsafe(nil)); end
-
- 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 each(head = T.unsafe(nil)); end
- def empty?(head = T.unsafe(nil)); end
- def inspect; end
- def peek; end
- def pop; end
- def push(value); end
- def replace_if(head, new_head); end
- def to_s; end
-
- private
-
- def compare_and_set_head(expected, value); end
- def head; end
- def head=(value); end
- def swap_head(value); end
- def update_head(&block); end
-
- class << self
- def new(*args, &block); end
- def of1(value); end
- def of2(value1, value2); end
- end
-end
-
-Concurrent::LockFreeStack::EMPTY = T.let(T.unsafe(nil), Concurrent::LockFreeStack::Node)
-
-class Concurrent::LockFreeStack::Node
- def initialize(value, next_node); end
-
- def next_node; end
- def value; end
- def value=(_arg0); end
-
- class << self
- def [](*_arg0); end
- end
-end
-
-class Concurrent::MVar < ::Concurrent::Synchronization::Object
- include ::Concurrent::Concern::Dereferenceable
-
- def initialize(value = T.unsafe(nil), opts = T.unsafe(nil)); end
-
- def borrow(timeout = T.unsafe(nil)); end
- def empty?; end
- def full?; end
- def modify(timeout = T.unsafe(nil)); end
- def modify!; end
- def put(value, timeout = T.unsafe(nil)); end
- def set!(value); end
- def take(timeout = T.unsafe(nil)); end
- def try_put!(value); end
- def try_take!; end
-
- protected
-
- def synchronize(&block); end
-
- private
-
- 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
-
- class << self
- def new(*args, &block); end
- end
-end
-
-Concurrent::MVar::EMPTY = T.let(T.unsafe(nil), Object)
-Concurrent::MVar::TIMEOUT = T.let(T.unsafe(nil), Object)
-
-class Concurrent::Map < ::Concurrent::Collection::MriMapBackend
- def initialize(options = T.unsafe(nil), &block); end
-
- def [](key); end
- def []=(key, value); end
- def each; end
- def each_key; end
- def each_pair; end
- def each_value; end
- def empty?; end
- def fetch(key, default_value = T.unsafe(nil)); end
- def fetch_or_store(key, default_value = T.unsafe(nil)); end
- def get(key); end
- def inspect; end
- def key(value); end
- def keys; end
- def marshal_dump; end
- def marshal_load(hash); end
- def put(key, value); end
- def put_if_absent(key, value); end
- def value?(value); end
- def values; end
-
- private
-
- def initialize_copy(other); end
- def populate_from(hash); end
- def raise_fetch_no_key; end
- def validate_options_hash!(options); end
-end
-
-class Concurrent::MaxRestartFrequencyError < ::Concurrent::Error; end
-
-class Concurrent::Maybe < ::Concurrent::Synchronization::Object
- include ::Comparable
-
- def initialize(just, nothing); end
-
- def <=>(other); end
- def fulfilled?; end
- def just; end
- def just?; end
- def nothing; end
- def nothing?; end
- def or(other); end
- def reason; end
- def rejected?; end
- def value; end
-
- class << self
- def from(*args); end
- def just(value); end
- def nothing(error = T.unsafe(nil)); end
-
- private
-
- def new(*args, &block); end
- end
-end
-
-Concurrent::Maybe::NONE = T.let(T.unsafe(nil), Object)
-
-class Concurrent::MultipleAssignmentError < ::Concurrent::Error
- def initialize(message = T.unsafe(nil), inspection_data = T.unsafe(nil)); end
-
- def inspect; end
- def inspection_data; end
-end
-
-class Concurrent::MultipleErrors < ::Concurrent::Error
- def initialize(errors, message = T.unsafe(nil)); end
-
- def errors; end
-end
-
-module Concurrent::MutableStruct
- include ::Concurrent::Synchronization::AbstractStruct
-
- def ==(other); end
- def [](member); end
- def []=(member, value); end
- def each(&block); end
- def each_pair(&block); end
- def inspect; end
- def merge(other, &block); end
- def select(&block); end
- def to_a; end
- def to_h; end
- def to_s; end
- def values; end
- def values_at(*indexes); end
-
- private
-
- def initialize_copy(original); end
-
- class << self
- def new(*args, &block); end
- end
-end
-
-Concurrent::MutableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped)
-
-class Concurrent::MutexAtomicBoolean < ::Concurrent::Synchronization::LockableObject
- def initialize(initial = T.unsafe(nil)); end
-
- def false?; end
- def make_false; end
- def make_true; end
- def true?; end
- def value; end
- def value=(value); end
-
- protected
-
- def ns_initialize(initial); end
-
- private
-
- def ns_make_value(value); end
-end
-
-class Concurrent::MutexAtomicFixnum < ::Concurrent::Synchronization::LockableObject
- def initialize(initial = T.unsafe(nil)); end
-
- def compare_and_set(expect, update); end
- def decrement(delta = T.unsafe(nil)); end
- def down(delta = T.unsafe(nil)); end
- def increment(delta = T.unsafe(nil)); end
- def up(delta = T.unsafe(nil)); end
- def update; end
- def value; end
- def value=(value); end
-
- protected
-
- def ns_initialize(initial); end
-
- private
-
- def ns_set(value); end
-end
-
-class Concurrent::MutexAtomicReference < ::Concurrent::Synchronization::LockableObject
- include ::Concurrent::AtomicDirectUpdate
- include ::Concurrent::AtomicNumericCompareAndSetWrapper
-
- def initialize(value = T.unsafe(nil)); end
-
- 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 set(new_value); end
- def swap(new_value); end
- def value; end
- def value=(new_value); end
-
- protected
-
- def ns_initialize(value); end
-end
-
-class Concurrent::MutexCountDownLatch < ::Concurrent::Synchronization::LockableObject
- def initialize(count = T.unsafe(nil)); end
-
- def count; end
- def count_down; end
- def wait(timeout = T.unsafe(nil)); end
-
- protected
-
- def ns_initialize(count); end
-end
-
-class Concurrent::MutexSemaphore < ::Concurrent::Synchronization::LockableObject
- def initialize(count); end
-
- def acquire(permits = T.unsafe(nil)); end
- def available_permits; end
- def drain_permits; end
- def reduce_permits(reduction); end
- def release(permits = T.unsafe(nil)); end
- def try_acquire(permits = T.unsafe(nil), timeout = T.unsafe(nil)); end
-
- protected
-
- def ns_initialize(count); end
-
- private
-
- def try_acquire_now(permits); end
- def try_acquire_timed(permits, timeout); end
-end
-
-Concurrent::NULL = T.let(T.unsafe(nil), Object)
-Concurrent::NULL_LOGGER = T.let(T.unsafe(nil), Proc)
-
-module Concurrent::Options
- class << self
- def executor(executor_identifier); end
- def executor_from_options(opts = T.unsafe(nil)); end
- end
-end
-
-class Concurrent::Promise < ::Concurrent::IVar
- def initialize(opts = T.unsafe(nil), &block); end
-
- def catch(&block); end
- def execute; end
- def fail(reason = T.unsafe(nil)); end
- def flat_map(&block); end
- def on_error(&block); end
- def on_success(&block); end
- def rescue(&block); end
- def set(value = T.unsafe(nil), &block); end
- def then(*args, &block); end
- def zip(*others); end
-
- protected
-
- def complete(success, value, reason); end
- def notify_child(child); end
- def ns_initialize(value, opts); end
- def on_fulfill(result); end
- def on_reject(reason); end
- def realize(task); end
- def root?; end
- def set_pending; end
- def set_state!(success, value, reason); end
- def synchronized_set_state!(success, value, reason); end
-
- class << self
- def aggregate(method, *promises); end
- def all?(*promises); end
- def any?(*promises); end
- def execute(opts = T.unsafe(nil), &block); end
- def fulfill(value, opts = T.unsafe(nil)); end
- def reject(reason, opts = T.unsafe(nil)); end
- def zip(*promises); end
- end
-end
-
-class Concurrent::PromiseExecutionError < ::StandardError; end
-
-module Concurrent::Promises
- extend ::Concurrent::Promises::FactoryMethods::Configuration
- extend ::Concurrent::Promises::FactoryMethods
-end
-
-class Concurrent::Promises::AbstractAnyPromise < ::Concurrent::Promises::BlockedPromise; end
-
-class Concurrent::Promises::AbstractEventFuture < ::Concurrent::Synchronization::Object
- include ::Concurrent::Promises::InternalStates
-
- def initialize(promise, default_executor); end
-
- def __initialize_atomic_fields__; end
- def add_callback_clear_delayed_node(node); end
- def add_callback_notify_blocked(promise, index); end
- def blocks; end
- def callbacks; end
- def chain(*args, &task); end
- def chain_on(executor, *args, &task); end
- def chain_resolvable(resolvable); end
- def default_executor; end
- def inspect; end
- def internal_state; 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 = T.unsafe(nil), reserved = T.unsafe(nil)); end
- def resolved?; end
- def state; end
- def tangle(resolvable); end
- def to_s; end
- def touch; end
- def touched?; end
- def wait(timeout = T.unsafe(nil)); end
- def waiting_threads; end
- def with_default_executor(executor); end
- def with_hidden_resolvable; end
-
- private
-
- def add_callback(method, *args); end
- def async_callback_on_resolution(state, executor, args, callback); 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 compare_and_set_internal_state(expected, value); end
- def internal_state=(value); end
- def swap_internal_state(value); end
- def update_internal_state(&block); end
- def wait_until_resolved(timeout); end
- def with_async(executor, *args, &block); end
-
- class << self
- def new(*args, &block); end
- end
-end
-
-class Concurrent::Promises::AbstractFlatPromise < ::Concurrent::Promises::BlockedPromise
- def initialize(delayed_because, blockers_count, event_or_future); end
-
- def touch; end
-
- private
-
- def add_delayed_of(future); end
- def on_resolvable(resolved_future, index); end
- def resolvable?(countdown, future, index); end
- def touched?; end
-end
-
-class Concurrent::Promises::AbstractPromise < ::Concurrent::Synchronization::Object
- include ::Concurrent::Promises::InternalStates
-
- def initialize(future); end
-
- def default_executor; end
- def delayed_because; end
- def event; end
- def future; end
- def inspect; end
- def state; end
- def to_s; end
- def touch; end
-
- private
-
- def evaluate_to(*args, block); end
- def resolve_with(new_state, raise_on_reassign = T.unsafe(nil)); end
-
- class << self
- def new(*args, &block); end
- end
-end
-
-class Concurrent::Promises::AnyFulfilledFuturePromise < ::Concurrent::Promises::AnyResolvedFuturePromise
- private
-
- def resolvable?(countdown, future, index); end
-end
-
-class Concurrent::Promises::AnyResolvedEventPromise < ::Concurrent::Promises::AbstractAnyPromise
- def initialize(delayed, blockers_count, default_executor); end
-
- private
-
- 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
-
- private
-
- def on_resolvable(resolved_future, index); end
- def resolvable?(countdown, future, index); end
-end
-
-class Concurrent::Promises::BlockedPromise < ::Concurrent::Promises::InnerPromise
- def initialize(delayed, blockers_count, future); end
-
- def blocked_by; end
- def delayed_because; end
- def on_blocker_resolution(future, index); end
- def touch; end
-
- private
-
- def clear_and_propagate_touch(stack_or_element = T.unsafe(nil)); end
- def on_resolvable(resolved_future, index); end
- def process_on_blocker_resolution(future, index); end
- def resolvable?(countdown, future, index); end
-
- class << self
- def add_delayed(delayed1, delayed2); end
- def new_blocked_by(blockers, *args, &block); end
- def new_blocked_by1(blocker, *args, &block); end
- def new_blocked_by2(blocker1, blocker2, *args, &block); end
- end
-end
-
-class Concurrent::Promises::BlockedTaskPromise < ::Concurrent::Promises::BlockedPromise
- def initialize(delayed, blockers_count, default_executor, executor, args, &task); end
-
- def executor; end
-end
-
-class Concurrent::Promises::ChainPromise < ::Concurrent::Promises::BlockedTaskPromise
- private
-
- def on_resolvable(resolved_future, index); end
-end
-
-class Concurrent::Promises::DelayPromise < ::Concurrent::Promises::InnerPromise
- def initialize(default_executor); end
-
- def delayed_because; end
- def touch; end
-end
-
-class Concurrent::Promises::Event < ::Concurrent::Promises::AbstractEventFuture
- def &(other); end
- def any(event_or_future); end
- def delay; 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
-
- private
-
- def callback_on_resolution(state, args, callback); end
- def rejected_resolution(raise_on_reassign, state); end
-end
-
-class Concurrent::Promises::EventWrapperPromise < ::Concurrent::Promises::BlockedPromise
- def initialize(delayed, blockers_count, default_executor); end
-
- private
-
- def on_resolvable(resolved_future, index); end
-end
-
-module Concurrent::Promises::FactoryMethods
- include ::Concurrent::Promises::FactoryMethods::Configuration
- extend ::Concurrent::ReInclude
- extend ::Concurrent::Promises::FactoryMethods
- extend ::Concurrent::Promises::FactoryMethods::Configuration
-
- 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 = T.unsafe(nil)); end
- def future(*args, &task); end
- def future_on(default_executor, *args, &task); end
- def make_future(argument = T.unsafe(nil), default_executor = T.unsafe(nil)); end
- def rejected_future(reason, default_executor = T.unsafe(nil)); end
- def resolvable_event; end
- def resolvable_event_on(default_executor = T.unsafe(nil)); end
- def resolvable_future; end
- def resolvable_future_on(default_executor = T.unsafe(nil)); end
- def resolved_event(default_executor = T.unsafe(nil)); end
- def resolved_future(fulfilled, value, reason, default_executor = T.unsafe(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
-end
-
-module Concurrent::Promises::FactoryMethods::Configuration
- def default_executor; end
-end
-
-class Concurrent::Promises::FlatEventPromise < ::Concurrent::Promises::AbstractFlatPromise
- def initialize(delayed, blockers_count, default_executor); end
-
- private
-
- 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
-
- private
-
- def process_on_blocker_resolution(future, index); end
-end
-
-class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture
- def &(other); end
- def any(event_or_future); end
- def apply(args, block); end
- def delay; end
- def exception(*args); end
- def flat(level = T.unsafe(nil)); end
- def flat_event; end
- def flat_future(level = T.unsafe(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 = T.unsafe(nil), timeout_value = T.unsafe(nil)); end
- def rejected?; end
- def rescue(*args, &task); end
- def rescue_on(executor, *args, &task); end
- def result(timeout = T.unsafe(nil)); end
- def run(run_test = T.unsafe(nil)); 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 = T.unsafe(nil), timeout_value = T.unsafe(nil)); end
- def value!(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end
- def wait!(timeout = T.unsafe(nil)); end
- def with_default_executor(executor); end
- def zip(other); end
- def |(event_or_future); end
-
- private
-
- 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 rejected_resolution(raise_on_reassign, state); end
- def run_test(v); end
- def wait_until_resolved!(timeout = T.unsafe(nil)); end
-end
-
-class Concurrent::Promises::FutureWrapperPromise < ::Concurrent::Promises::BlockedPromise
- def initialize(delayed, blockers_count, default_executor); end
-
- private
-
- 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::InnerPromise < ::Concurrent::Promises::AbstractPromise; end
-module Concurrent::Promises::InternalStates; end
-
-class Concurrent::Promises::InternalStates::Fulfilled < ::Concurrent::Promises::InternalStates::ResolvedWithResult
- def initialize(value); end
-
- def apply(args, block); end
- def fulfilled?; 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
-
-Concurrent::Promises::InternalStates::PENDING = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Pending)
-
-class Concurrent::Promises::InternalStates::PartiallyRejected < ::Concurrent::Promises::InternalStates::ResolvedWithResult
- def initialize(value, reason); end
-
- def apply(args, block); end
- def fulfilled?; end
- def reason; end
- def to_sym; end
- def value; end
-end
-
-class Concurrent::Promises::InternalStates::Pending < ::Concurrent::Promises::InternalStates::State
- def resolved?; end
- def to_sym; end
-end
-
-Concurrent::Promises::InternalStates::RESERVED = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Reserved)
-Concurrent::Promises::InternalStates::RESOLVED = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Fulfilled)
-
-class Concurrent::Promises::InternalStates::Rejected < ::Concurrent::Promises::InternalStates::ResolvedWithResult
- def initialize(reason); end
-
- def apply(args, block); end
- def fulfilled?; end
- def reason; end
- def to_sym; end
- def value; 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::State
- def resolved?; end
- def to_sym; end
-end
-
-class Concurrent::Promises::RescuePromise < ::Concurrent::Promises::BlockedTaskPromise
- def initialize(delayed, blockers_count, default_executor, executor, args, &task); end
-
- private
-
- def on_resolvable(resolved_future, index); end
-end
-
-module Concurrent::Promises::Resolvable
- include ::Concurrent::Promises::InternalStates
-end
-
-class Concurrent::Promises::ResolvableEvent < ::Concurrent::Promises::Event
- include ::Concurrent::Promises::Resolvable
-
- def resolve(raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end
- def wait(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end
- def with_hidden_resolvable; end
-end
-
-class Concurrent::Promises::ResolvableEventPromise < ::Concurrent::Promises::AbstractPromise
- def initialize(default_executor); end
-end
-
-class Concurrent::Promises::ResolvableFuture < ::Concurrent::Promises::Future
- include ::Concurrent::Promises::Resolvable
-
- def evaluate_to(*args, &block); end
- def evaluate_to!(*args, &block); end
- def fulfill(value, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end
- def reason(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end
- def reject(reason, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end
- 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
- def result(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end
- def value(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end
- def value!(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end
- def wait(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end
- def wait!(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end
- def with_hidden_resolvable; end
-end
-
-class Concurrent::Promises::ResolvableFuturePromise < ::Concurrent::Promises::AbstractPromise
- def initialize(default_executor); end
-end
-
-class Concurrent::Promises::RunFuturePromise < ::Concurrent::Promises::AbstractFlatPromise
- def initialize(delayed, blockers_count, default_executor, run_test); end
-
- private
-
- def process_on_blocker_resolution(future, index); 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::Promises::ThenPromise < ::Concurrent::Promises::BlockedTaskPromise
- def initialize(delayed, blockers_count, default_executor, executor, args, &task); end
-
- private
-
- def on_resolvable(resolved_future, index); end
-end
-
-class Concurrent::Promises::ZipEventEventPromise < ::Concurrent::Promises::BlockedPromise
- def initialize(delayed, blockers_count, default_executor); end
-
- private
-
- def on_resolvable(resolved_future, index); end
-end
-
-class Concurrent::Promises::ZipEventsPromise < ::Concurrent::Promises::BlockedPromise
- def initialize(delayed, blockers_count, default_executor); end
-
- private
-
- def on_resolvable(resolved_future, index); end
-end
-
-class Concurrent::Promises::ZipFutureEventPromise < ::Concurrent::Promises::BlockedPromise
- def initialize(delayed, blockers_count, default_executor); end
-
- private
-
- def on_resolvable(resolved_future, index); end
- def process_on_blocker_resolution(future, index); end
-end
-
-class Concurrent::Promises::ZipFuturesPromise < ::Concurrent::Promises::BlockedPromise
- def initialize(delayed, blockers_count, default_executor); end
-
- private
-
- def on_resolvable(resolved_future, index); end
- def process_on_blocker_resolution(future, index); end
-end
-
-module Concurrent::ReInclude
- def extended(base); end
- def include(*modules); end
- def included(base); end
-end
-
-class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object
- def initialize; end
-
- def acquire_read_lock; end
- def acquire_write_lock; end
- def has_waiters?; end
- def release_read_lock; end
- def release_write_lock; end
- def with_read_lock; end
- def with_write_lock; end
- def write_locked?; end
-
- private
-
- def max_readers?(c = T.unsafe(nil)); end
- def max_writers?(c = T.unsafe(nil)); end
- def running_readers(c = T.unsafe(nil)); end
- def running_readers?(c = T.unsafe(nil)); end
- def running_writer?(c = T.unsafe(nil)); end
- def waiting_writer?(c = T.unsafe(nil)); end
- def waiting_writers(c = T.unsafe(nil)); end
-
- class << self
- def new(*args, &block); end
- end
-end
-
-Concurrent::ReadWriteLock::MAX_READERS = T.let(T.unsafe(nil), Integer)
-Concurrent::ReadWriteLock::MAX_WRITERS = T.let(T.unsafe(nil), Integer)
-Concurrent::ReadWriteLock::RUNNING_WRITER = T.let(T.unsafe(nil), Integer)
-Concurrent::ReadWriteLock::WAITING_WRITER = T.let(T.unsafe(nil), Integer)
-
-class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object
- def initialize; end
-
- def acquire_read_lock; end
- def acquire_write_lock; end
- def release_read_lock; end
- def release_write_lock; end
- def try_read_lock; end
- def try_write_lock; end
- def with_read_lock; end
- def with_write_lock; end
-
- private
-
- def max_readers?(c = T.unsafe(nil)); end
- def max_writers?(c = T.unsafe(nil)); end
- def running_readers(c = T.unsafe(nil)); end
- def running_readers?(c = T.unsafe(nil)); end
- def running_writer?(c = T.unsafe(nil)); end
- def waiting_or_running_writer?(c = T.unsafe(nil)); end
- def waiting_writers(c = T.unsafe(nil)); end
-
- class << self
- def new(*args, &block); end
- end
-end
-
-Concurrent::ReentrantReadWriteLock::MAX_READERS = T.let(T.unsafe(nil), Integer)
-Concurrent::ReentrantReadWriteLock::MAX_WRITERS = T.let(T.unsafe(nil), Integer)
-Concurrent::ReentrantReadWriteLock::READER_BITS = T.let(T.unsafe(nil), Integer)
-Concurrent::ReentrantReadWriteLock::READ_LOCK_MASK = T.let(T.unsafe(nil), Integer)
-Concurrent::ReentrantReadWriteLock::RUNNING_WRITER = T.let(T.unsafe(nil), Integer)
-Concurrent::ReentrantReadWriteLock::WAITING_WRITER = T.let(T.unsafe(nil), Integer)
-Concurrent::ReentrantReadWriteLock::WRITER_BITS = T.let(T.unsafe(nil), Integer)
-Concurrent::ReentrantReadWriteLock::WRITE_LOCK_HELD = T.let(T.unsafe(nil), Integer)
-Concurrent::ReentrantReadWriteLock::WRITE_LOCK_MASK = T.let(T.unsafe(nil), Integer)
-class Concurrent::RejectedExecutionError < ::Concurrent::Error; end
-class Concurrent::ResourceLimitError < ::Concurrent::Error; end
-
-class Concurrent::RubyExchanger < ::Concurrent::AbstractExchanger
- def initialize; end
-
- def __initialize_atomic_fields__; end
- def compare_and_set_slot(expected, value); end
- def slot; end
- def slot=(value); end
- def swap_slot(value); end
- def update_slot(&block); end
-
- private
-
- def do_exchange(value, timeout); end
-
- class << self
- def new(*args, &block); end
- end
-end
-
-class Concurrent::RubyExchanger::Node < ::Concurrent::Synchronization::Object
- def initialize(item); end
-
- def __initialize_atomic_fields__; end
- def compare_and_set_value(expected, value); end
- def item; end
- def latch; end
- def swap_value(value); end
- def update_value(&block); end
- def value; end
- def value=(value); end
-
- class << self
- def new(*args, &block); end
- end
-end
-
-class Concurrent::RubyExecutorService < ::Concurrent::AbstractExecutorService
- def initialize(*args, &block); end
-
- def kill; end
- def post(*args, &task); end
- def shutdown; end
- def wait_for_termination(timeout = T.unsafe(nil)); end
-
- private
-
- def ns_running?; end
- def ns_shutdown?; end
- def ns_shutdown_execution; end
- def ns_shuttingdown?; end
- def stop_event; end
- def stopped_event; end
-end
-
-class Concurrent::RubySingleThreadExecutor < ::Concurrent::RubyThreadPoolExecutor
- def initialize(opts = T.unsafe(nil)); end
-end
-
-class Concurrent::RubyThreadLocalVar < ::Concurrent::AbstractThreadLocalVar
- def value; end
- def value=(value); end
-
- protected
-
- def allocate_storage; end
-
- private
-
- def get_default; end
- def get_threadlocal_array(thread = T.unsafe(nil)); end
- def next_index; end
- def set_threadlocal_array(array, thread = T.unsafe(nil)); end
- def value_for(thread); end
-
- class << self
- def semi_sync(&block); end
- def thread_finalizer(id); end
- def thread_local_finalizer(index); end
- end
-end
-
-Concurrent::RubyThreadLocalVar::FREE = T.let(T.unsafe(nil), Array)
-Concurrent::RubyThreadLocalVar::LOCK = T.let(T.unsafe(nil), Thread::Mutex)
-Concurrent::RubyThreadLocalVar::THREAD_LOCAL_ARRAYS = T.let(T.unsafe(nil), Hash)
-
-class Concurrent::RubyThreadPoolExecutor < ::Concurrent::RubyExecutorService
- def initialize(opts = T.unsafe(nil)); end
-
- def can_overflow?; end
- def completed_task_count; end
- def idletime; end
- def largest_length; end
- def length; end
- def max_length; end
- def max_queue; end
- def min_length; 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
-
- private
-
- 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 = T.unsafe(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
-end
-
-Concurrent::RubyThreadPoolExecutor::DEFAULT_MAX_POOL_SIZE = T.let(T.unsafe(nil), Integer)
-Concurrent::RubyThreadPoolExecutor::DEFAULT_MAX_QUEUE_SIZE = T.let(T.unsafe(nil), Integer)
-Concurrent::RubyThreadPoolExecutor::DEFAULT_MIN_POOL_SIZE = T.let(T.unsafe(nil), Integer)
-Concurrent::RubyThreadPoolExecutor::DEFAULT_THREAD_IDLETIMEOUT = T.let(T.unsafe(nil), Integer)
-
-class Concurrent::RubyThreadPoolExecutor::Worker
- include ::Logger::Severity
- include ::Concurrent::Concern::Logging
-
- def initialize(pool, id); end
-
- def <<(message); end
- def kill; end
- def stop; end
-
- private
-
- def create_worker(queue, pool, idletime); end
- def run_task(pool, task, args); end
-end
-
-class Concurrent::SafeTaskExecutor < ::Concurrent::Synchronization::LockableObject
- def initialize(task, opts = T.unsafe(nil)); end
-
- def execute(*args); end
-end
-
-class Concurrent::ScheduledTask < ::Concurrent::IVar
- include ::Comparable
-
- def initialize(delay, opts = T.unsafe(nil), &task); end
-
- def <=>(other); end
- def cancel; end
- def cancelled?; end
- def execute; end
- def executor; end
- def initial_delay; end
- def process_task; end
- def processing?; end
- def reschedule(delay); end
- def reset; end
- def schedule_time; end
-
- protected
-
- def ns_reschedule(delay); end
- def ns_schedule(delay); end
-
- class << self
- def execute(delay, opts = T.unsafe(nil), &task); end
- end
-end
-
-class Concurrent::Semaphore < ::Concurrent::MutexSemaphore; end
-Concurrent::SemaphoreImplementation = Concurrent::MutexSemaphore
-
-module Concurrent::SerialExecutorService
- include ::Logger::Severity
- include ::Concurrent::Concern::Logging
- include ::Concurrent::ExecutorService
-
- def serialized?; end
-end
-
-class Concurrent::SerializedExecution < ::Concurrent::Synchronization::LockableObject
- include ::Logger::Severity
- include ::Concurrent::Concern::Logging
-
- def initialize; end
-
- def post(executor, *args, &task); end
- def posts(posts); end
-
- private
-
- def call_job(job); end
- def ns_initialize; end
- def work(job); end
-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
-
- class << self
- def [](*_arg0); end
- def inspect; end
- def members; end
- def new(*_arg0); end
- end
-end
-
-class Concurrent::SerializedExecutionDelegator < ::SimpleDelegator
- include ::Logger::Severity
- include ::Concurrent::Concern::Logging
- include ::Concurrent::ExecutorService
- include ::Concurrent::SerialExecutorService
-
- def initialize(executor); end
-
- def post(*args, &task); end
-end
-
-class Concurrent::Set < ::Concurrent::CRubySet; end
-Concurrent::SetImplementation = Concurrent::CRubySet
-
-module Concurrent::SettableStruct
- include ::Concurrent::Synchronization::AbstractStruct
-
- def ==(other); end
- def [](member); end
- def []=(member, value); end
- def each(&block); end
- def each_pair(&block); end
- def inspect; end
- def merge(other, &block); end
- def select(&block); end
- def to_a; end
- def to_h; end
- def to_s; end
- def values; end
- def values_at(*indexes); end
-
- private
-
- def initialize_copy(original); end
-
- class << self
- def new(*args, &block); end
- end
-end
-
-Concurrent::SettableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped)
-
-class Concurrent::SimpleExecutorService < ::Concurrent::RubyExecutorService
- def <<(task); 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 = T.unsafe(nil)); end
-
- private
-
- def ns_initialize(*args); end
-
- class << self
- def <<(task); end
- def post(*args); end
- end
-end
-
-class Concurrent::SingleThreadExecutor < ::Concurrent::RubySingleThreadExecutor; end
-Concurrent::SingleThreadExecutorImplementation = Concurrent::RubySingleThreadExecutor
-module Concurrent::Synchronization; end
-
-class Concurrent::Synchronization::AbstractLockableObject < ::Concurrent::Synchronization::Object
- protected
-
- def ns_broadcast; end
- def ns_signal; end
- def ns_wait(timeout = T.unsafe(nil)); end
- def ns_wait_until(timeout = T.unsafe(nil), &condition); end
- def synchronize; end
-end
-
-class Concurrent::Synchronization::AbstractObject
- def initialize; end
-
- def full_memory_barrier; end
-
- class << self
- def attr_volatile(*names); end
- end
-end
-
-module Concurrent::Synchronization::AbstractStruct
- def initialize(*values); end
-
- def length; end
- def members; end
- def size; end
-
- protected
-
- 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
-
- class << self
- def define_struct_class(parent, base, name, members, &block); end
- end
-end
-
-class Concurrent::Synchronization::Condition < ::Concurrent::Synchronization::LockableObject
- def initialize(lock); end
-
- def broadcast; end
- def ns_broadcast; end
- def ns_signal; end
- def ns_wait(timeout = T.unsafe(nil)); end
- def ns_wait_until(timeout = T.unsafe(nil), &condition); end
- def signal; end
- def wait(timeout = T.unsafe(nil)); end
- def wait_until(timeout = T.unsafe(nil), &condition); end
-
- class << self
- def private_new(*args, &block); end
- end
-end
-
-module Concurrent::Synchronization::ConditionSignalling
- protected
-
- def ns_broadcast; end
- def ns_signal; end
-end
-
-class Concurrent::Synchronization::Lock < ::Concurrent::Synchronization::LockableObject
- def broadcast; end
- def signal; end
- def wait(timeout = T.unsafe(nil)); end
- def wait_until(timeout = T.unsafe(nil), &condition); end
-end
-
-class Concurrent::Synchronization::LockableObject < ::Concurrent::Synchronization::MutexLockableObject
- def new_condition; end
-end
-
-Concurrent::Synchronization::LockableObjectImplementation = Concurrent::Synchronization::MutexLockableObject
-
-class Concurrent::Synchronization::MonitorLockableObject < ::Concurrent::Synchronization::AbstractLockableObject
- include ::Concurrent::Synchronization::ConditionSignalling
-
- def initialize(*defaults); end
-
- protected
-
- def ns_wait(timeout = T.unsafe(nil)); end
- def synchronize; end
-
- private
-
- def initialize_copy(other); end
-
- class << self
- def new(*args, &block); end
- end
-end
-
-module Concurrent::Synchronization::MriAttrVolatile
- mixes_in_class_methods ::Concurrent::Synchronization::MriAttrVolatile::ClassMethods
-
- def full_memory_barrier; end
-
- class << self
- def included(base); end
- end
-end
-
-module Concurrent::Synchronization::MriAttrVolatile::ClassMethods
- def attr_volatile(*names); end
-end
-
-class Concurrent::Synchronization::MriObject < ::Concurrent::Synchronization::AbstractObject
- include ::Concurrent::Synchronization::MriAttrVolatile
- extend ::Concurrent::Synchronization::MriAttrVolatile::ClassMethods
-
- def initialize; end
-end
-
-class Concurrent::Synchronization::MutexLockableObject < ::Concurrent::Synchronization::AbstractLockableObject
- include ::Concurrent::Synchronization::ConditionSignalling
-
- def initialize(*defaults); end
-
- protected
-
- def ns_wait(timeout = T.unsafe(nil)); end
- def synchronize; end
-
- private
-
- def initialize_copy(other); end
-
- class << self
- def new(*args, &block); end
- end
-end
-
-class Concurrent::Synchronization::Object < ::Concurrent::Synchronization::MriObject
- def initialize; end
-
- private
-
- def __initialize_atomic_fields__; end
-
- class << self
- def atomic_attribute?(name); end
- def atomic_attributes(inherited = T.unsafe(nil)); end
- def attr_atomic(*names); end
- def ensure_safe_initialization_when_final_fields_are_present; end
- def safe_initialization!; end
- def safe_initialization?; end
-
- private
-
- def define_initialize_atomic_fields; end
- end
-end
-
-Concurrent::Synchronization::ObjectImplementation = Concurrent::Synchronization::MriObject
-
-module Concurrent::Synchronization::RbxAttrVolatile
- mixes_in_class_methods ::Concurrent::Synchronization::RbxAttrVolatile::ClassMethods
-
- def full_memory_barrier; end
-
- class << self
- def included(base); end
- end
-end
-
-module Concurrent::Synchronization::RbxAttrVolatile::ClassMethods
- def attr_volatile(*names); end
-end
-
-class Concurrent::Synchronization::RbxLockableObject < ::Concurrent::Synchronization::AbstractLockableObject
- def initialize(*defaults); end
-
- protected
-
- def ns_broadcast; end
- def ns_signal; end
- def ns_wait(timeout = T.unsafe(nil)); end
- def synchronize(&block); end
-
- private
-
- def initialize_copy(other); end
-
- class << self
- def new(*args, &block); end
- end
-end
-
-class Concurrent::Synchronization::RbxObject < ::Concurrent::Synchronization::AbstractObject
- include ::Concurrent::Synchronization::RbxAttrVolatile
- extend ::Concurrent::Synchronization::RbxAttrVolatile::ClassMethods
-
- def initialize; end
-end
-
-module Concurrent::Synchronization::TruffleRubyAttrVolatile
- mixes_in_class_methods ::Concurrent::Synchronization::TruffleRubyAttrVolatile::ClassMethods
-
- def full_memory_barrier; end
-
- class << self
- def included(base); end
- end
-end
-
-module Concurrent::Synchronization::TruffleRubyAttrVolatile::ClassMethods
- def attr_volatile(*names); end
-end
-
-class Concurrent::Synchronization::TruffleRubyObject < ::Concurrent::Synchronization::AbstractObject
- include ::Concurrent::Synchronization::TruffleRubyAttrVolatile
- extend ::Concurrent::Synchronization::TruffleRubyAttrVolatile::ClassMethods
-
- def initialize; end
-end
-
-Concurrent::Synchronization::Volatile = Concurrent::Synchronization::MriAttrVolatile
-
-class Concurrent::SynchronizedDelegator < ::SimpleDelegator
- def initialize(obj); end
-
- def method_missing(method, *args, &block); end
- def setup; end
- def teardown; end
-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
-
- class << self
- def new(*args, &block); end
- end
-end
-
-class Concurrent::ThreadLocalVar < ::Concurrent::RubyThreadLocalVar; end
-Concurrent::ThreadLocalVarImplementation = Concurrent::RubyThreadLocalVar
-class Concurrent::ThreadPoolExecutor < ::Concurrent::RubyThreadPoolExecutor; end
-Concurrent::ThreadPoolExecutorImplementation = Concurrent::RubyThreadPoolExecutor
-module Concurrent::ThreadSafe; end
-
-module Concurrent::ThreadSafe::Util
- class << self
- def make_synchronized_on_cruby(klass); end
- def make_synchronized_on_rbx(klass); end
- def make_synchronized_on_truffleruby(klass); end
- end
-end
-
-Concurrent::ThreadSafe::Util::CPU_COUNT = T.let(T.unsafe(nil), Integer)
-Concurrent::ThreadSafe::Util::FIXNUM_BIT_SIZE = T.let(T.unsafe(nil), Integer)
-Concurrent::ThreadSafe::Util::MAX_INT = T.let(T.unsafe(nil), Integer)
-class Concurrent::TimeoutError < ::Concurrent::Error; end
-
-class Concurrent::TimerSet < ::Concurrent::RubyExecutorService
- def initialize(opts = T.unsafe(nil)); end
-
- def kill; end
- def post(delay, *args, &task); end
-
- private
-
- def ns_initialize(opts); end
- def ns_post_task(task); end
- def ns_reset_if_forked; end
- def ns_shutdown_execution; end
- def post_task(task); end
- def process_tasks; end
- def remove_task(task); end
-end
-
-class Concurrent::TimerTask < ::Concurrent::RubyExecutorService
- include ::Concurrent::Concern::Dereferenceable
- include ::Concurrent::Concern::Observable
-
- def initialize(opts = T.unsafe(nil), &task); end
-
- def execute; end
- def execution_interval; end
- def execution_interval=(value); end
- def running?; end
- def timeout_interval; end
- def timeout_interval=(value); end
-
- private
-
- def execute_task(completion); end
- def ns_initialize(opts, &task); end
- def ns_kill_execution; end
- def ns_shutdown_execution; end
- def schedule_next_task(interval = T.unsafe(nil)); end
-
- class << self
- def execute(opts = T.unsafe(nil), &task); end
- end
-end
-
-Concurrent::TimerTask::EXECUTION_INTERVAL = T.let(T.unsafe(nil), Integer)
-Concurrent::TimerTask::TIMEOUT_INTERVAL = T.let(T.unsafe(nil), Integer)
-
-class Concurrent::Transaction
- def initialize; end
-
- def abort; end
- def commit; end
- def open(tvar); end
- def read(tvar); end
- def unlock; end
- def write(tvar, value); end
-
- class << self
- def current; end
- def current=(transaction); end
- end
-end
-
-Concurrent::Transaction::ABORTED = T.let(T.unsafe(nil), Object)
-class Concurrent::Transaction::AbortError < ::StandardError; end
-class Concurrent::Transaction::LeaveError < ::StandardError; end
-
-class Concurrent::Transaction::OpenEntry < ::Struct
- def modified; end
- def modified=(_); end
- def value; end
- def value=(_); end
-
- class << self
- def [](*_arg0); end
- def inspect; end
- def members; end
- def new(*_arg0); end
- end
-end
-
-class Concurrent::Tuple
- include ::Enumerable
-
- def initialize(size); end
-
- 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 set(i, value); end
- def size; end
- def volatile_get(i); end
- def volatile_set(i, value); end
-end
-
-Concurrent::Tuple::Tuple = Array
-module Concurrent::Utility; end
-
-module Concurrent::Utility::EngineDetector
- def on_cruby?; end
- def on_jruby?; end
- def on_jruby_9000?; end
- def on_linux?; end
- def on_osx?; end
- def on_rbx?; end
- def on_truffleruby?; end
- def on_windows?; end
- def ruby_engine; end
- def ruby_version(version = T.unsafe(nil), comparison, major, minor, patch); end
-end
-
-module Concurrent::Utility::NativeExtensionLoader
- def allow_c_extensions?; end
- def c_extensions_loaded?; end
- def java_extensions_loaded?; end
- def load_native_extensions; end
-
- private
-
- def load_error_path(error); end
- def set_c_extensions_loaded; end
- def set_java_extensions_loaded; end
- def try_load_c_extension(path); end
-end
-
-module Concurrent::Utility::NativeInteger
- extend ::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
-end
-
-Concurrent::Utility::NativeInteger::MAX_VALUE = T.let(T.unsafe(nil), Integer)
-Concurrent::Utility::NativeInteger::MIN_VALUE = T.let(T.unsafe(nil), Integer)
-
-class Concurrent::Utility::ProcessorCounter
- def initialize; end
-
- def physical_processor_count; end
- def processor_count; end
-
- private
-
- def compute_physical_processor_count; end
- def compute_processor_count; end
-end
-
-Concurrent::VERSION = T.let(T.unsafe(nil), String)
diff --git a/sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi b/sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi
new file mode 100644
index 0000000..98fdf89
--- /dev/null
+++ b/sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi
@@ -0,0 +1,11751 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `concurrent-ruby` gem.
+# Please instead update this file by running `bin/tapioca gem concurrent-ruby`.
+
+
+# {include:file:README.md}
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/constants.rb#1
+module Concurrent
+ extend ::Concurrent::Utility::EngineDetector
+ extend ::Concurrent::Utility::NativeExtensionLoader
+ extend ::Concurrent::Concern::Logging
+ extend ::Concurrent::Concern::Deprecation
+
+ private
+
+ # Abort a currently running transaction - see `Concurrent::atomically`.
+ #
+ # @raise [Transaction::AbortError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#139
+ def abort_transaction; end
+
+ # Run a block that reads and writes `TVar`s as a single atomic transaction.
+ # With respect to the value of `TVar` objects, the transaction is atomic, in
+ # that it either happens or it does not, consistent, in that the `TVar`
+ # objects involved will never enter an illegal state, and isolated, in that
+ # transactions never interfere with each other. You may recognise these
+ # properties from database transactions.
+ #
+ # There are some very important and unusual semantics that you must be aware of:
+ #
+ # * Most importantly, the block that you pass to atomically may be executed
+ # more than once. In most cases your code should be free of
+ # side-effects, except for via TVar.
+ #
+ # * If an exception escapes an atomically block it will abort the transaction.
+ #
+ # * It is undefined behaviour to use callcc or Fiber with atomically.
+ #
+ # * If you create a new thread within an atomically, it will not be part of
+ # the transaction. Creating a thread counts as a side-effect.
+ #
+ # Transactions within transactions are flattened to a single transaction.
+ #
+ # @example
+ # a = new TVar(100_000)
+ # b = new TVar(100)
+ #
+ # Concurrent::atomically do
+ # a.value -= 10
+ # b.value += 10
+ # end
+ # @raise [ArgumentError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#82
+ def atomically; end
+
+ # @raise [ArgumentError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#56
+ def call_dataflow(method, executor, *inputs, &block); end
+
+ # Dataflow allows you to create a task that will be scheduled when all of its data dependencies are available.
+ # {include:file:docs-source/dataflow.md}
+ #
+ # @param inputs [Future] zero or more `Future` operations that this dataflow depends upon
+ # @raise [ArgumentError] if no block is given
+ # @raise [ArgumentError] if any of the inputs are not `IVar`s
+ # @return [Object] the result of all the operations
+ # @yield The operation to perform once all the dependencies are met
+ # @yieldparam inputs [Future] each of the `Future` inputs to the dataflow
+ # @yieldreturn [Object] the result of the block operation
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#34
+ def dataflow(*inputs, &block); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#44
+ def dataflow!(*inputs, &block); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#39
+ def dataflow_with(executor, *inputs, &block); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#49
+ def dataflow_with!(executor, *inputs, &block); end
+
+ # Leave a transaction without committing or aborting - see `Concurrent::atomically`.
+ #
+ # @raise [Transaction::LeaveError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#144
+ def leave_transaction; end
+
+ # Returns the current time as tracked by the application monotonic clock.
+ #
+ # @param unit [Symbol] the time unit to be returned, can be either
+ # :float_second, :float_millisecond, :float_microsecond, :second,
+ # :millisecond, :microsecond, or :nanosecond default to :float_second.
+ # @return [Float] The current monotonic time since some unspecified
+ # starting point
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/monotonic_time.rb#15
+ def monotonic_time(unit = T.unsafe(nil)); end
+
+ class << self
+ # Abort a currently running transaction - see `Concurrent::atomically`.
+ #
+ # @raise [Transaction::AbortError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#148
+ def abort_transaction; end
+
+ # Run a block that reads and writes `TVar`s as a single atomic transaction.
+ # With respect to the value of `TVar` objects, the transaction is atomic, in
+ # that it either happens or it does not, consistent, in that the `TVar`
+ # objects involved will never enter an illegal state, and isolated, in that
+ # transactions never interfere with each other. You may recognise these
+ # properties from database transactions.
+ #
+ # There are some very important and unusual semantics that you must be aware of:
+ #
+ # * Most importantly, the block that you pass to atomically may be executed
+ # more than once. In most cases your code should be free of
+ # side-effects, except for via TVar.
+ #
+ # * If an exception escapes an atomically block it will abort the transaction.
+ #
+ # * It is undefined behaviour to use callcc or Fiber with atomically.
+ #
+ # * If you create a new thread within an atomically, it will not be part of
+ # the transaction. Creating a thread counts as a side-effect.
+ #
+ # Transactions within transactions are flattened to a single transaction.
+ #
+ # @example
+ # a = new TVar(100_000)
+ # b = new TVar(100)
+ #
+ # Concurrent::atomically do
+ # a.value -= 10
+ # b.value += 10
+ # end
+ # @raise [ArgumentError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#148
+ def atomically; end
+
+ # Number of processors cores available for process scheduling.
+ # This method takes in account the CPU quota if the process is inside a cgroup with a
+ # dedicated CPU quota (typically Docker).
+ # Otherwise it returns the same value as #processor_count but as a Float.
+ #
+ # For performance reasons the calculated value will be memoized on the first
+ # call.
+ #
+ # @return [Float] number of available processors
+ #
+ # 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#80
+ def call_dataflow(method, executor, *inputs, &block); end
+
+ # The maximum number of processors cores available for process scheduling.
+ # Returns `nil` if there is no enforced limit, or a `Float` if the
+ # process is inside a cgroup with a dedicated CPU quota (typically Docker).
+ #
+ # Note that nothing prevents setting a CPU quota higher than the actual number of
+ # cores on the system.
+ #
+ # For performance reasons the calculated value will be memoized on the first
+ # call.
+ #
+ # @return [nil, Float] Maximum number of available processors as set by a cgroup CPU quota, or nil if none set
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#209
+ def cpu_quota; end
+
+ # The CPU shares requested by the process. For performance reasons the calculated
+ # value will be memoized on the first call.
+ #
+ # @return [Float, nil] CPU shares requested by the process, or nil if not set
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#217
+ def cpu_shares; end
+
+ # Create a simple logger with provided level and output.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#38
+ def create_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end
+
+ # Create a stdlib logger with provided level and output.
+ # If you use this deprecated method you might need to add logger to your Gemfile to avoid warnings from Ruby 3.3.5+.
+ #
+ # @deprecated
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#73
+ def create_stdlib_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end
+
+ # Dataflow allows you to create a task that will be scheduled when all of its data dependencies are available.
+ # {include:file:docs-source/dataflow.md}
+ #
+ # @param inputs [Future] zero or more `Future` operations that this dataflow depends upon
+ # @raise [ArgumentError] if no block is given
+ # @raise [ArgumentError] if any of the inputs are not `IVar`s
+ # @return [Object] the result of all the operations
+ # @yield The operation to perform once all the dependencies are met
+ # @yieldparam inputs [Future] each of the `Future` inputs to the dataflow
+ # @yieldreturn [Object] the result of the block operation
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#37
+ def dataflow(*inputs, &block); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#47
+ def dataflow!(*inputs, &block); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#42
+ def dataflow_with(executor, *inputs, &block); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#52
+ def dataflow_with!(executor, *inputs, &block); end
+
+ # Disables AtExit handlers including pool auto-termination handlers.
+ # When disabled it will be the application programmer's responsibility
+ # to ensure that the handlers are shutdown properly prior to application
+ # exit by calling `AtExit.run` method.
+ #
+ # @deprecated Has no effect since it is no longer needed, see https://github.com/ruby-concurrency/concurrent-ruby/pull/841.
+ # @note this option should be needed only because of `at_exit` ordering
+ # issues which may arise when running some of the testing frameworks.
+ # E.g. Minitest's test-suite runs itself in `at_exit` callback which
+ # executes after the pools are already terminated. Then auto termination
+ # needs to be disabled and called manually after test-suite ends.
+ # @note This method should *never* be called
+ # from within a gem. It should *only* be used from within the main
+ # application and even then it should be used only when necessary.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#48
+ def disable_at_exit_handlers!; end
+
+ # General access point to global executors.
+ #
+ # @param executor_identifier [Symbol, Executor] symbols:
+ # - :fast - {Concurrent.global_fast_executor}
+ # - :io - {Concurrent.global_io_executor}
+ # - :immediate - {Concurrent.global_immediate_executor}
+ # @return [Executor]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#83
+ def executor(executor_identifier); end
+
+ # Global thread pool optimized for short, fast *operations*.
+ #
+ # @return [ThreadPoolExecutor] the thread pool
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#55
+ def global_fast_executor; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#66
+ def global_immediate_executor; end
+
+ # Global thread pool optimized for long, blocking (IO) *tasks*.
+ #
+ # @return [ThreadPoolExecutor] the thread pool
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#62
+ def global_io_executor; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#114
+ def global_logger; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#118
+ def global_logger=(value); end
+
+ # Global thread pool user for global *timers*.
+ #
+ # @return [Concurrent::TimerSet] the thread pool
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#73
+ def global_timer_set; end
+
+ # Leave a transaction without committing or aborting - see `Concurrent::atomically`.
+ #
+ # @raise [Transaction::LeaveError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#148
+ 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#18
+ 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 http://linux.die.net/man/8/sysctl
+ # @see http://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx
+ # @see http://www.unix.com/man-page/osx/1/HWPREFS/
+ # @see https://github.com/grosser/parallel/blob/4fc8b89d08c7091fe0419ca8fba1ec3ce5a8d185/lib/parallel.rb
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#181
+ def physical_processor_count; end
+
+ # Number of processors seen by the OS and used for process scheduling. For
+ # performance reasons the calculated value will be memoized on the first
+ # call.
+ #
+ # When running under JRuby the Java runtime call
+ # `java.lang.Runtime.getRuntime.availableProcessors` will be used. According
+ # to the Java documentation this "value may change during a particular
+ # invocation of the virtual machine... [applications] should therefore
+ # occasionally poll this property." We still memoize this value once under
+ # JRuby.
+ #
+ # Otherwise Ruby's Etc.nprocessors will be used.
+ #
+ # @return [Integer] number of processors seen by the OS or Java runtime
+ # @see http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#availableProcessors()
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#160
+ def processor_count; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#142
+ def processor_counter; end
+
+ # Use logger created by #create_simple_logger to log concurrent-ruby messages.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#66
+ def use_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end
+
+ # Use logger created by #create_stdlib_logger to log concurrent-ruby messages.
+ #
+ # @deprecated
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#101
+ def use_stdlib_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end
+ end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#38
+class Concurrent::AbstractExchanger < ::Concurrent::Synchronization::Object
+ # @return [AbstractExchanger] a new instance of AbstractExchanger
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#44
+ def initialize; end
+
+ # Waits for another thread to arrive at this exchange point (unless the
+ # current thread is interrupted), and then transfers the given object to
+ # it, receiving its object in return. The timeout value indicates the
+ # approximate number of seconds the method should block while waiting
+ # for the exchange. When the timeout value is `nil` the method will
+ # block indefinitely.
+ #
+ #
+ # In some edge cases when a `timeout` is given a return value of `nil` may be
+ # ambiguous. Specifically, if `nil` is a valid value in the exchange it will
+ # be impossible to tell whether `nil` is the actual return value or if it
+ # signifies timeout. When `nil` is a valid value in the exchange consider
+ # using {#exchange!} or {#try_exchange} instead.
+ #
+ # @param timeout [Numeric, nil] in seconds, `nil` blocks indefinitely
+ # @param value [Object] the value to exchange with another thread
+ # @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 timeout [Numeric, nil] in seconds, `nil` blocks indefinitely
+ # @param value [Object] the value to exchange with another thread
+ # @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 timeout [Numeric, nil] in seconds, `nil` blocks indefinitely
+ # @param value [Object] the value to exchange with another thread
+ # @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 timeout [Numeric, nil] in seconds, `nil` blocks indefinitely
+ # @param value [Object] the value to exchange with another thread
+ # @raise [NotImplementedError]
+ # @return [Object, CANCEL] the value exchanged by the other thread; {CANCEL} on timeout
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#122
+ def do_exchange(value, timeout); end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#41
+Concurrent::AbstractExchanger::CANCEL = T.let(T.unsafe(nil), Object)
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#10
+class Concurrent::AbstractExecutorService < ::Concurrent::Synchronization::LockableObject
+ include ::Concurrent::Concern::Logging
+ include ::Concurrent::ExecutorService
+ include ::Concurrent::Concern::Deprecation
+
+ # Create a new thread pool.
+ #
+ # @return [AbstractExecutorService] a new instance of AbstractExecutorService
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#23
+ def initialize(opts = T.unsafe(nil), &block); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#72
+ def auto_terminate=(value); end
+
+ # @return [Boolean]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#67
+ def auto_terminate?; end
+
+ # Returns the value of attribute fallback_policy.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#18
+ def fallback_policy; end
+
+ # @raise [NotImplementedError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#42
+ def kill; end
+
+ # Returns the value of attribute name.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#20
+ def name; end
+
+ # @return [Boolean]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#52
+ def running?; end
+
+ # @raise [NotImplementedError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#37
+ def shutdown; end
+
+ # @return [Boolean]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#62
+ def shutdown?; end
+
+ # @return [Boolean]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#57
+ def shuttingdown?; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#32
+ def to_s; end
+
+ # @raise [NotImplementedError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#47
+ def wait_for_termination(timeout = T.unsafe(nil)); end
+
+ private
+
+ # Returns an action which executes the `fallback_policy` once the queue
+ # size reaches `max_queue`. The reason for the indirection of an action
+ # is so that the work can be deferred outside of synchronization.
+ #
+ # @param args [Array] the arguments to the task which is being handled.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#85
+ def fallback_action(*args); end
+
+ # @return [Boolean]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#126
+ def ns_auto_terminate?; end
+
+ # @raise [NotImplementedError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#106
+ def ns_execute(*args, &task); end
+
+ # Callback method called when the executor has been killed.
+ # The default behavior is to do nothing.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#122
+ def ns_kill_execution; end
+
+ # Callback method called when an orderly shutdown has completed.
+ # The default behavior is to signal all waiting threads.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#114
+ def ns_shutdown_execution; end
+end
+
+# The set of possible fallback policies that may be set at thread pool creation.
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#15
+Concurrent::AbstractExecutorService::FALLBACK_POLICIES = T.let(T.unsafe(nil), Array)
+
+# An abstract implementation of local storage, with sub-classes for
+# per-thread and per-fiber locals.
+#
+# Each execution context (EC, thread or fiber) has a lazily initialized array
+# of local variable values. Each time a new local variable is created, we
+# allocate an "index" for it.
+#
+# For example, if the allocated index is 1, that means slot #1 in EVERY EC's
+# locals array will be used for the value of that variable.
+#
+# The good thing about using a per-EC structure to hold values, rather than
+# a global, is that no synchronization is needed when reading and writing
+# those values (since the structure is only ever accessed by a single
+# thread).
+#
+# Of course, when a local variable is GC'd, 1) we need to recover its index
+# for use by other new local variables (otherwise the locals arrays could
+# get bigger and bigger with time), and 2) we need to null out all the
+# references held in the now-unused slots (both to avoid blocking GC of those
+# objects, and also to prevent "stale" values from being passed on to a new
+# local when the index is reused).
+#
+# Because we need to null out freed slots, we need to keep references to
+# ALL the locals arrays, so we can null out the appropriate slots in all of
+# them. This is why we need to use a finalizer to clean up the locals array
+# when the EC goes out of scope.
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#35
+class Concurrent::AbstractLocals
+ # @return [AbstractLocals] a new instance of AbstractLocals
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#36
+ def initialize; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#89
+ def fetch(index); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#71
+ def free_index(index); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#55
+ def next_index(local); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#102
+ def set(index, value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#43
+ def synchronize; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#48
+ def weak_synchronize; end
+
+ private
+
+ # When the local goes out of scope, clean up that slot across all locals currently assigned.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#112
+ def local_finalizer(index); end
+
+ # Returns the locals for the current scope, or nil if none exist.
+ #
+ # @raise [NotImplementedError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#128
+ def locals; end
+
+ # Returns the locals for the current scope, creating them if necessary.
+ #
+ # @raise [NotImplementedError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#133
+ def locals!; end
+
+ # When a thread/fiber goes out of scope, remove the array from @all_arrays.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#119
+ def thread_fiber_finalizer(array_object_id); end
+end
+
+# `Agent` is inspired by Clojure's [agent](http://clojure.org/agents)
+# function. An agent is a shared, mutable variable providing independent,
+# uncoordinated, *asynchronous* change of individual values. Best used when
+# the value will undergo frequent, complex updates. Suitable when the result
+# of an update does not need to be known immediately. `Agent` is (mostly)
+# functionally equivalent to Clojure's agent, except where the runtime
+# prevents parity.
+#
+# Agents are reactive, not autonomous - there is no imperative message loop
+# and no blocking receive. The state of an Agent should be itself immutable
+# and the `#value` of an Agent is always immediately available for reading by
+# any thread without any messages, i.e. observation does not require
+# cooperation or coordination.
+#
+# Agent action dispatches are made using the various `#send` methods. These
+# methods always return immediately. At some point later, in another thread,
+# the following will happen:
+#
+# 1. The given `action` will be applied to the state of the Agent and the
+# `args`, if any were supplied.
+# 2. The return value of `action` will be passed to the validator lambda,
+# if one has been set on the Agent.
+# 3. If the validator succeeds or if no validator was given, the return value
+# of the given `action` will become the new `#value` of the Agent. See
+# `#initialize` for details.
+# 4. If any observers were added to the Agent, they will be notified. See
+# `#add_observer` for details.
+# 5. If during the `action` execution any other dispatches are made (directly
+# or indirectly), they will be held until after the `#value` of the Agent
+# has been changed.
+#
+# If any exceptions are thrown by an action function, no nested dispatches
+# will occur, and the exception will be cached in the Agent itself. When an
+# Agent has errors cached, any subsequent interactions will immediately throw
+# an exception, until the agent's errors are cleared. Agent errors can be
+# examined with `#error` and the agent restarted with `#restart`.
+#
+# The actions of all Agents get interleaved amongst threads in a thread pool.
+# At any point in time, at most one action for each Agent is being executed.
+# Actions dispatched to an agent from another single agent or thread will
+# occur in the order they were sent, potentially interleaved with actions
+# dispatched to the same agent from other sources. The `#send` method should
+# be used for actions that are CPU limited, while the `#send_off` method is
+# appropriate for actions that may block on IO.
+#
+# Unlike in Clojure, `Agent` cannot participate in `Concurrent::TVar` transactions.
+#
+# ## Example
+#
+# ```
+# def next_fibonacci(set = nil)
+# return [0, 1] if set.nil?
+# set + [set[-2..-1].reduce{|sum,x| sum + x }]
+# end
+#
+# # create an agent with an initial value
+# agent = Concurrent::Agent.new(next_fibonacci)
+#
+# # send a few update requests
+# 5.times do
+# agent.send{|set| next_fibonacci(set) }
+# end
+#
+# # wait for them to complete
+# agent.await
+#
+# # get the current value
+# agent.value #=> [0, 1, 1, 2, 3, 5, 8]
+# ```
+#
+# ## Observation
+#
+# Agents support observers through the {Concurrent::Observable} mixin module.
+# Notification of observers occurs every time an action dispatch returns and
+# the new value is successfully validated. Observation will *not* occur if the
+# action raises an exception, if validation fails, or when a {#restart} occurs.
+#
+# When notified the observer will receive three arguments: `time`, `old_value`,
+# and `new_value`. The `time` argument is the time at which the value change
+# occurred. The `old_value` is the value of the Agent when the action began
+# processing. The `new_value` is the value to which the Agent was set when the
+# action completed. Note that `old_value` and `new_value` may be the same.
+# This is not an error. It simply means that the action returned the same
+# value.
+#
+# ## Nested Actions
+#
+# It is possible for an Agent action to post further actions back to itself.
+# The nested actions will be enqueued normally then processed *after* the
+# outer action completes, in the order they were sent, possibly interleaved
+# with action dispatches from other threads. Nested actions never deadlock
+# with one another and a failure in a nested action will never affect the
+# outer action.
+#
+# Nested actions can be called using the Agent reference from the enclosing
+# scope or by passing the reference in as a "send" argument. Nested actions
+# cannot be post using `self` from within the action block/proc/lambda; `self`
+# in this context will not reference the Agent. The preferred method for
+# dispatching nested actions is to pass the Agent as an argument. This allows
+# Ruby to more effectively manage the closing scope.
+#
+# Prefer this:
+#
+# ```
+# agent = Concurrent::Agent.new(0)
+# agent.send(agent) do |value, this|
+# this.send {|v| v + 42 }
+# 3.14
+# end
+# agent.value #=> 45.14
+# ```
+#
+# Over this:
+#
+# ```
+# agent = Concurrent::Agent.new(0)
+# agent.send do |value|
+# agent.send {|v| v + 42 }
+# 3.14
+# end
+# ```
+#
+#
+# **NOTE** Never, *under any circumstances*, call any of the "await" methods
+# ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action
+# block/proc/lambda. The call will block the Agent and will always fail.
+# Calling either {#await} or {#wait} (with a timeout of `nil`) will
+# hopelessly deadlock the Agent with no possibility of recovery.
+#
+# @see http://clojure.org/Agents Clojure Agents
+# @see http://clojure.org/state Values and Change - Clojure's approach to Identity and State
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#145
+class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject
+ include ::Concurrent::Concern::Observable
+
+ # Create a new `Agent` with the given initial value and options.
+ #
+ # The `:validator` option must be `nil` or a side-effect free proc/lambda
+ # which takes one argument. On any intended value change the validator, if
+ # provided, will be called. If the new value is invalid the validator should
+ # return `false` or raise an error.
+ #
+ # The `:error_handler` option must be `nil` or a proc/lambda which takes two
+ # arguments. When an action raises an error or validation fails, either by
+ # returning false or raising an error, the error handler will be called. The
+ # arguments to the error handler will be a reference to the agent itself and
+ # the error object which was raised.
+ #
+ # The `:error_mode` may be either `:continue` (the default if an error
+ # handler is given) or `:fail` (the default if error handler nil or not
+ # given).
+ #
+ # If an action being run by the agent throws an error or doesn't pass
+ # validation the error handler, if present, will be called. After the
+ # handler executes if the error mode is `:continue` the Agent will continue
+ # as if neither the action that caused the error nor the error itself ever
+ # happened.
+ #
+ # If the mode is `:fail` the Agent will become {#failed?} and will stop
+ # accepting new action dispatches. Any previously queued actions will be
+ # held until {#restart} is called. The {#value} method will still work,
+ # returning the value of the Agent before the error.
+ #
+ # @option opts
+ # @option opts
+ # @option opts
+ # @param initial [Object] the initial value
+ # @param opts [Hash] the configuration options
+ # @return [Agent] a new instance of Agent
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#220
+ def initialize(initial, opts = T.unsafe(nil)); end
+
+ # Dispatches an action to the Agent and returns immediately. Subsequently,
+ # in a thread from a thread pool, the {#value} will be set to the return
+ # value of the action. Appropriate for actions that may block on IO.
+ #
+ # @param action [Proc] the action dispatch to be enqueued
+ # @return [Concurrent::Agent] self
+ # @see #send_off
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#331
+ def <<(action); end
+
+ # Blocks the current thread (indefinitely!) until all actions dispatched
+ # thus far, from this thread or nested by the Agent, have occurred. Will
+ # block when {#failed?}. Will never return if a failed Agent is {#restart}
+ # with `:clear_actions` true.
+ #
+ # Returns a reference to `self` to support method chaining:
+ #
+ # ```
+ # current_value = agent.await.value
+ # ```
+ #
+ #
+ # **NOTE** Never, *under any circumstances*, call any of the "await" methods
+ # ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action
+ # block/proc/lambda. The call will block the Agent and will always fail.
+ # Calling either {#await} or {#wait} (with a timeout of `nil`) will
+ # hopelessly deadlock the Agent with no possibility of recovery.
+ #
+ # @return [Boolean] self
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#350
+ def await; end
+
+ # Blocks the current thread until all actions dispatched thus far, from this
+ # thread or nested by the Agent, have occurred, or the timeout (in seconds)
+ # has elapsed.
+ #
+ #
+ # **NOTE** Never, *under any circumstances*, call any of the "await" methods
+ # ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action
+ # block/proc/lambda. The call will block the Agent and will always fail.
+ # Calling either {#await} or {#wait} (with a timeout of `nil`) will
+ # hopelessly deadlock the Agent with no possibility of recovery.
+ #
+ # @param timeout [Float] the maximum number of seconds to wait
+ # @return [Boolean] true if all actions complete before timeout else false
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#363
+ def await_for(timeout); end
+
+ # Blocks the current thread until all actions dispatched thus far, from this
+ # thread or nested by the Agent, have occurred, or the timeout (in seconds)
+ # has elapsed.
+ #
+ #
+ # **NOTE** Never, *under any circumstances*, call any of the "await" methods
+ # ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action
+ # block/proc/lambda. The call will block the Agent and will always fail.
+ # Calling either {#await} or {#wait} (with a timeout of `nil`) will
+ # hopelessly deadlock the Agent with no possibility of recovery.
+ #
+ # @param timeout [Float] the maximum number of seconds to wait
+ # @raise [Concurrent::TimeoutError] when timeout is reached
+ # @return [Boolean] true if all actions complete before timeout
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#377
+ def await_for!(timeout); end
+
+ # The current value (state) of the Agent, irrespective of any pending or
+ # in-progress actions. The value is always available and is non-blocking.
+ #
+ # @return [Object] the current value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#233
+ def deref; end
+
+ # When {#failed?} and {#error_mode} is `:fail`, returns the error object
+ # which caused the failure, else `nil`. When {#error_mode} is `:continue`
+ # will *always* return `nil`.
+ #
+ # @return [nil, Error] the error which caused the failure when {#failed?}
+ #
+ # 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 action [Proc] the action dispatch to be enqueued
+ # @param args [Array
] zero or more arguments to be passed to
+ # the action
+ # @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 args [Array] zero or more arguments to pass to the
+ # action
+ # @yieldparam value [Object] the current {#value} of the Agent
+ # @yieldreturn [Object] the new value of the Agent
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#298
+ 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#244
+ def reason; end
+
+ # When an Agent is {#failed?}, changes the Agent {#value} to `new_value`
+ # then un-fails the Agent so that action dispatches are allowed again. If
+ # the `:clear_actions` option is give and true, any actions queued on the
+ # Agent that were being held while it was failed will be discarded,
+ # otherwise those held actions will proceed. The `new_value` must pass the
+ # validator if any, or `restart` will raise an exception and the Agent will
+ # remain failed with its old {#value} and {#error}. Observers, if any, will
+ # not be notified of the new state.
+ #
+ # @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 action [Proc] the action dispatch to be enqueued
+ # @param args [Array] zero or more arguments to be passed to
+ # the action
+ # @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 args [Array] zero or more arguments to pass to the
+ # action
+ # @yieldparam value [Object] the current {#value} of the Agent
+ # @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 action [Proc] the action dispatch to be enqueued
+ # @param args [Array] zero or more arguments to be passed to
+ # the action
+ # @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 args [Array] zero or more arguments to pass to the
+ # action
+ # @yieldparam value [Object] the current {#value} of the Agent
+ # @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 action [Proc] the action dispatch to be enqueued
+ # @param args [Array] zero or more arguments to be passed to
+ # the action
+ # @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 args [Array] zero or more arguments to pass to the
+ # action
+ # @yieldparam value [Object] the current {#value} of the Agent
+ # @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 action [Proc] the action dispatch to be enqueued
+ # @param args [Array] zero or more arguments to be passed to
+ # the action
+ # @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 args [Array] zero or more arguments to pass to the
+ # action
+ # @yieldparam value [Object] the current {#value} of the Agent
+ # @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 action [Proc] the action dispatch to be enqueued
+ # @param args [Array] zero or more arguments to be passed to
+ # the action
+ # @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 args [Array] zero or more arguments to pass to the
+ # action
+ # @yieldparam value [Object] the current {#value} of the Agent
+ # @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 action [Proc] the action dispatch to be enqueued
+ # @param args [Array] zero or more arguments to be passed to
+ # the action
+ # @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 args [Array] zero or more arguments to pass to the
+ # action
+ # @yieldparam value [Object] the current {#value} of the Agent
+ # @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#406
+ def stopped?; end
+
+ # The current value (state) of the Agent, irrespective of any pending or
+ # in-progress actions. The value is always available and is non-blocking.
+ #
+ # @return [Object] the current value
+ #
+ # 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 agents [Array] the Agents on which to wait
+ # @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#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 agents [Array] the Agents on which to wait
+ # @param timeout [Float] the maximum number of seconds to wait
+ # @raise [Concurrent::TimeoutError] when timeout is reached
+ # @return [Boolean] true if all actions complete before timeout
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#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
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163
+ def action; end
+
+ # Sets the attribute action
+ #
+ # @param value [Object] the value to set the attribute action to.
+ # @return [Object] the newly set value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163
+ def action=(_); end
+
+ # Returns the value of attribute args
+ #
+ # @return [Object] the current value of args
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163
+ def args; end
+
+ # Sets the attribute args
+ #
+ # @param value [Object] the value to set the attribute args to.
+ # @return [Object] the newly set value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163
+ def args=(_); end
+
+ # Returns the value of attribute caller
+ #
+ # @return [Object] the current value of caller
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163
+ def caller; end
+
+ # Sets the attribute caller
+ #
+ # @param value [Object] the value to set the attribute caller to.
+ # @return [Object] the newly set value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163
+ def caller=(_); end
+
+ # Returns the value of attribute executor
+ #
+ # @return [Object] the current value of executor
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163
+ def executor; end
+
+ # Sets the attribute executor
+ #
+ # @param value [Object] the value to set the attribute executor to.
+ # @return [Object] the newly set value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163
+ def executor=(_); end
+
+ class << self
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163
+ def [](*_arg0); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163
+ def inspect; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163
+ def keyword_init?; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163
+ def members; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163
+ def new(*_arg0); end
+ end
+end
+
+# Raised when a new value obtained during action processing or at `#restart`
+# fails validation.
+#
+# 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 http://c2.com/cgi/wiki?LetItCrash "Let It Crash" at http://c2.com/
+# @see http://www.erlang.org/doc/man/gen_server.html Erlang gen_server
+# @see https://en.wikipedia.org/wiki/Actor_model "Actor Model" at Wikipedia
+#
+# 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#433
+ 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#415
+ def cast; end
+
+ # Initialize the internal serializer and other stnchronization mechanisms.
+ #
+ # @note This method *must* be called immediately upon object construction.
+ # This is the only way thread-safe initialization can be guaranteed.
+ #
+ # 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 args [Array] zero or more arguments for the arity check
+ # @param method [Symbol] the method to check the object for
+ # @param obj [Object] the object to check against
+ # @raise [NameError] the object does not respond to `method` method
+ # @raise [ArgumentError] the given `args` do not match the arity of `method`
+ # @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
+ # @see http://www.ruby-doc.org/core-2.1.1/Method.html#method-i-arity Method#arity
+ #
+ # 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 args [Array] zero or more arguments to the method
+ # @param method [Symbol] the method being called
+ # @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 args [Array] zero or more arguments to the method
+ # @param method [Symbol] the method being called
+ # @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 opts [Hash] The options used to configure the atom
+ # @param value [Object] The initial value
+ # @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/atom.rb#99
+ def __initialize_atomic_fields__; end
+
+ # Atomically sets the value of atom to the new value if and only if the
+ # current value of the atom is identical to the old value and the new
+ # value successfully validates against the (optional) validator given
+ # at construction.
+ #
+ # @param new_value [Object] The intended new value.
+ # @param old_value [Object] The expected current 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/atom.rb#102
+ def deref; end
+
+ # Atomically sets the value of atom to the new value without regard for the
+ # current value so long as the new value successfully validates against the
+ # (optional) validator given at construction.
+ #
+ # @param 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 args [Object] All arguments passed to the function, in order.
+ # @yieldparam value [Object] The current value of the atom.
+ # @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/atom.rb#99
+ def value; end
+
+ private
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#99
+ def compare_and_set_value(expected, value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#99
+ def swap_value(value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#99
+ 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/atom.rb#99
+ 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#125
+ 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#142
+ 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/atomic/atomic_markable_reference.rb#12
+ def __initialize_atomic_fields__; end
+
+ # Atomically sets the value and mark to the given updated value and
+ # mark given both:
+ # - the current value == the expected value &&
+ # - the current mark == the expected mark
+ #
+ # that the actual value was not equal to the expected value or the
+ # actual mark was not equal to the expected mark
+ #
+ # @param expected_mark [Boolean] the expected mark
+ # @param expected_val [Object] the expected value
+ # @param new_mark [Boolean] the new mark
+ # @param new_val [Object] the new value
+ # @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_mark [Boolean] the expected mark
+ # @param expected_val [Object] the expected value
+ # @param new_mark [Boolean] the new mark
+ # @param new_val [Object] the new value
+ # @return [Boolean] `true` if successful. A `false` return indicates
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#59
+ def compare_and_swap(expected_val, new_val, expected_mark, new_mark); end
+
+ # Gets the current reference and marked values.
+ #
+ # @return [Array] the current reference and marked values
+ #
+ # 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#82
+ def marked?; end
+
+ # _Unconditionally_ sets to the given value of both the reference and
+ # the mark.
+ #
+ # @param new_mark [Boolean] the new mark
+ # @param new_val [Object] the new value
+ # @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_mark [Boolean] the starting state of marked
+ # @yieldparam old_val [Object] the starting value of the atomic reference
+ #
+ # 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_mark [Boolean] the starting state of marked
+ # @yieldparam old_val [Object] the starting value of the atomic reference
+ #
+ # 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_mark [Boolean] the starting state of marked
+ # @yieldparam old_val [Object] the starting value of the atomic reference
+ #
+ # 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/atomic/atomic_markable_reference.rb#12
+ 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/atomic/atomic_markable_reference.rb#12
+ def reference; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#12
+ def reference=(value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#12
+ def swap_reference(value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#12
+ def update_reference(&block); end
+end
+
+# Special "compare and set" handling of numeric values.
+#
+# 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 new_value [Object] the new value
+ # @param old_value [Object] the expected 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#133
+ 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/set.rb#33
+ def initialize(*args, &block); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def &(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def +(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def -(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def <(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def <<(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def <=(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def <=>(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def ==(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def ===(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def >(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def >=(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def ^(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def add(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def add?(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def classify(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def clear(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def collect!(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def compare_by_identity(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def compare_by_identity?(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def delete(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def delete?(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def delete_if(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def difference(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def disjoint?(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def divide(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def each(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def empty?(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def eql?(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def filter!(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def flatten(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def flatten!(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def flatten_merge(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def freeze(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def hash(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def include?(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def inspect(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def intersect?(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def intersection(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def join(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def keep_if(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def length(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def map!(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def member?(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def merge(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def pretty_print(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def pretty_print_cycle(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def proper_subset?(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def proper_superset?(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def reject!(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def replace(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def reset(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def select!(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def size(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def subset?(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def subtract(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def superset?(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def to_a(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def to_s(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def to_set(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def union(*args); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def |(*args); end
+
+ private
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33
+ def initialize_copy(other); end
+end
+
+# A thread pool that dynamically grows and shrinks to fit the current workload.
+# New threads are created as needed, existing threads are reused, and threads
+# that remain idle for too long are killed and removed from the pool. These
+# pools are particularly suited to applications that perform a high volume of
+# short-lived tasks.
+#
+# On creation a `CachedThreadPool` has zero running threads. New threads are
+# created on the pool as new operations are `#post`. The size of the pool
+# will grow until `#max_length` threads are in the pool or until the number
+# of threads exceeds the number of running and pending operations. When a new
+# operation is post to the pool the first available idle thread will be tasked
+# with the new operation.
+#
+# Should a thread crash for any reason the thread will immediately be removed
+# from the pool. Similarly, threads which remain idle for an extended period
+# of time will be killed and reclaimed. Thus these thread pools are very
+# efficient at reclaiming unused resources.
+#
+# The API and behavior of this class are based on Java's `CachedThreadPool`
+#
+# 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://algs4.cs.princeton.edu/24pq/MaxPQ.java.html
+# @see http://algs4.cs.princeton.edu/24pq/index.php#2.6
+# @see http://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html
+# @see http://en.wikipedia.org/wiki/Priority_queue
+# @see http://ruby-doc.org/stdlib-2.0.0/libdoc/thread/rdoc/Queue.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/non_concurrent_priority_queue.rb#59
+ def <<(item); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb#56
+ def deq; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb#60
+ def enq(item); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb#52
+ def has_priority?(item); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb#57
+ def shift; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/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://algs4.cs.princeton.edu/24pq/MaxPQ.java.html
+# @see http://algs4.cs.princeton.edu/24pq/index.php#2.6
+# @see http://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html
+# @see http://en.wikipedia.org/wiki/Priority_queue
+# @see http://ruby-doc.org/stdlib-2.0.0/libdoc/thread/rdoc/Queue.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#85
+ 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#74
+ 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#86
+ 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#51
+ 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#75
+ 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#57
+ 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/collection/timeout_queue.rb#15
+class Concurrent::Collection::TimeoutQueue < ::Thread::Queue; end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/timeout_queue.rb#5
+Concurrent::Collection::TimeoutQueueImplementation = Thread::Queue
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#2
+module Concurrent::Concern; end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/deprecation.rb#8
+module Concurrent::Concern::Deprecation
+ include ::Concurrent::Concern::Logging
+ extend ::Concurrent::Concern::Logging
+ extend ::Concurrent::Concern::Deprecation
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/deprecation.rb#12
+ def deprecated(message, strip = T.unsafe(nil)); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/deprecation.rb#27
+ def deprecated_method(old_name, new_name); end
+end
+
+# Object references in Ruby are mutable. This can lead to serious problems when
+# the `#value` of a concurrent object is a mutable reference. Which is always the
+# case unless the value is a `Fixnum`, `Symbol`, or similar "primitive" data type.
+# Most classes in this library that expose a `#value` getter method do so using the
+# `Dereferenceable` mixin module.
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#11
+module Concurrent::Concern::Dereferenceable
+ # Return the value this object represents after applying the options specified
+ # by the `#set_deref_options` method.
+ #
+ # @return [Object] the current value of the object
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#24
+ def deref; end
+
+ # Return the value this object represents after applying the options specified
+ # by the `#set_deref_options` method.
+ #
+ # @return [Object] the current value of the object
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#21
+ def value; end
+
+ protected
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#63
+ def apply_deref_options(value); end
+
+ # Set the options which define the operations #value performs before
+ # returning data to the caller (dereferencing).
+ #
+ # @note Most classes that include this module will call `#set_deref_options`
+ # from within the constructor, thus allowing these options to be set at
+ # object creation.
+ # @option opts
+ # @option opts
+ # @option opts
+ # @param opts [Hash] the options defining dereference behavior.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#54
+ def ns_set_deref_options(opts); end
+
+ # Set the options which define the operations #value performs before
+ # returning data to the caller (dereferencing).
+ #
+ # @note Most classes that include this module will call `#set_deref_options`
+ # from within the constructor, thus allowing these options to be set at
+ # object creation.
+ # @option opts
+ # @option opts
+ # @option opts
+ # @param opts [Hash] the options defining dereference behavior.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#48
+ def set_deref_options(opts = T.unsafe(nil)); end
+
+ # Set the internal value of this object
+ #
+ # @param value [Object] the new value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#31
+ def value=(value); end
+end
+
+# Include where logging is needed
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#9
+module Concurrent::Concern::Logging
+ # Logs through {Concurrent.global_logger}, it can be overridden by setting @logger
+ #
+ # @param level [Integer] one of Concurrent::Concern::Logging constants
+ # @param message [String, nil] when nil block is used to generate the message
+ # @param progname [String] e.g. a path of an Actor
+ # @yieldreturn [String] a message
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#19
+ def log(level, progname, message = T.unsafe(nil), &block); end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11
+Concurrent::Concern::Logging::DEBUG = T.let(T.unsafe(nil), Integer)
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11
+Concurrent::Concern::Logging::ERROR = T.let(T.unsafe(nil), Integer)
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11
+Concurrent::Concern::Logging::FATAL = T.let(T.unsafe(nil), Integer)
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11
+Concurrent::Concern::Logging::INFO = T.let(T.unsafe(nil), Integer)
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#12
+Concurrent::Concern::Logging::SEV_LABEL = T.let(T.unsafe(nil), Array)
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11
+Concurrent::Concern::Logging::UNKNOWN = T.let(T.unsafe(nil), Integer)
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11
+Concurrent::Concern::Logging::WARN = T.let(T.unsafe(nil), Integer)
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#10
+module Concurrent::Concern::Obligation
+ include ::Concurrent::Concern::Dereferenceable
+
+ # Has the obligation completed processing?
+ #
+ # @return [Boolean]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#49
+ def complete?; end
+
+ # @example allows Obligation to be risen
+ # rejected_ivar = Ivar.new.fail
+ # raise rejected_ivar
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#126
+ def exception(*args); end
+
+ # Has the obligation been fulfilled?
+ #
+ # @return [Boolean]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#20
+ def fulfilled?; end
+
+ # Is the obligation still awaiting completion of processing?
+ #
+ # @return [Boolean]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#56
+ def incomplete?; end
+
+ # Wait until obligation is complete or the timeout is reached. Will re-raise
+ # any exceptions raised during processing (but will not raise an exception
+ # on timeout).
+ #
+ # @param timeout [Numeric] the maximum time in seconds to wait.
+ # @raise [Exception] raises the reason when rejected
+ # @return [Obligation] self
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#89
+ 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#23
+ def realized?; end
+
+ # If an exception was raised during processing this will return the
+ # exception object. Will return `nil` when the state is pending or if
+ # the obligation has been successfully fulfilled.
+ #
+ # @return [Exception] the exception raised during processing or `nil`
+ #
+ # 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 expected_current [Symbol]
+ # @param next_state [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 func [Symbol] the function to call on the observer during notification.
+ # Default is :update
+ # @param observer [Object] the observer to add
+ # @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 func [Symbol] the function to call on the observer during notification.
+ # @param observer [Object] the observer to add
+ # @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
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#30
+ def status; end
+
+ # Sets the attribute status
+ #
+ # @param value [Object] the value to set the attribute status to.
+ # @return [Object] the newly set value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#30
+ def status=(_); end
+
+ class << self
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#30
+ def [](*_arg0); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#30
+ def inspect; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#30
+ def keyword_init?; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#30
+ def members; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#30
+ def new(*_arg0); end
+ end
+end
+
+# Lazy evaluation of a block yielding an immutable result. Useful for
+# expensive operations that may never be needed. It may be non-blocking,
+# supports the `Concern::Obligation` interface, and accepts the injection of
+# custom executor upon which to execute the block. Processing of
+# block will be deferred until the first time `#value` is called.
+# At that time the caller can choose to return immediately and let
+# the block execute asynchronously, block indefinitely, or block
+# with a timeout.
+#
+# When a `Delay` is created its state is set to `pending`. The value and
+# reason are both `nil`. The first time the `#value` method is called the
+# enclosed operation will be run and the calling thread will block. Other
+# threads attempting to call `#value` will block as well. Once the operation
+# is complete the *value* will be set to the result of the operation or the
+# *reason* will be set to the raised exception, as appropriate. All threads
+# blocked on `#value` will return. Subsequent calls to `#value` will immediately
+# return the cached value. The operation will only be run once. This means that
+# any side effects created by the operation will only happen once as well.
+#
+# `Delay` includes the `Concurrent::Concern::Dereferenceable` mixin to support thread
+# safety of the reference returned by `#value`.
+#
+# @note The default behavior of `Delay` is to block indefinitely when
+# calling either `value` or `wait`, executing the delayed operation on
+# the current thread. This makes the `timeout` value completely
+# irrelevant. To enable non-blocking behavior, use the `executor`
+# constructor option. This will cause the delayed operation to be
+# execute on the given executor, allowing the call to timeout.
+# @see Concurrent::Concern::Dereferenceable
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#44
+class Concurrent::Delay < ::Concurrent::Synchronization::LockableObject
+ include ::Concurrent::Concern::Dereferenceable
+ include ::Concurrent::Concern::Obligation
+
+ # Create a new `Delay` in the `:pending` state.
+ #
+ # @raise [ArgumentError] if no block is given
+ # @return [Delay] a new instance of Delay
+ # @yield the delayed operation to perform
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#62
+ def initialize(opts = T.unsafe(nil), &block); end
+
+ # Reconfigures the block returning the value if still `#incomplete?`
+ #
+ # @return [true, false] if success
+ # @yield the delayed operation to perform
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#146
+ def reconfigure(&block); end
+
+ # Return the value this object represents after applying the options
+ # specified by the `#set_deref_options` method. If the delayed operation
+ # raised an exception this method will return nil. The exception object
+ # can be accessed via the `#reason` method.
+ #
+ # @note The default behavior of `Delay` is to block indefinitely when
+ # calling either `value` or `wait`, executing the delayed operation on
+ # the current thread. This makes the `timeout` value completely
+ # irrelevant. To enable non-blocking behavior, use the `executor`
+ # constructor option. This will cause the delayed operation to be
+ # execute on the given executor, allowing the call to timeout.
+ # @param timeout [Numeric] the maximum number of seconds to wait
+ # @return [Object] the current value of the object
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#77
+ def value(timeout = T.unsafe(nil)); end
+
+ # Return the value this object represents after applying the options
+ # specified by the `#set_deref_options` method. If the delayed operation
+ # raised an exception, this method will raise that exception (even when)
+ # the operation has already been executed).
+ #
+ # @note The default behavior of `Delay` is to block indefinitely when
+ # calling either `value` or `wait`, executing the delayed operation on
+ # the current thread. This makes the `timeout` value completely
+ # irrelevant. To enable non-blocking behavior, use the `executor`
+ # constructor option. This will cause the delayed operation to be
+ # execute on the given executor, allowing the call to timeout.
+ # @param timeout [Numeric] the maximum number of seconds to wait
+ # @raise [Exception] when `#rejected?` raises `#reason`
+ # @return [Object] the current value of the object
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#113
+ def value!(timeout = T.unsafe(nil)); end
+
+ # Return the value this object represents after applying the options
+ # specified by the `#set_deref_options` method.
+ #
+ # @note The default behavior of `Delay` is to block indefinitely when
+ # calling either `value` or `wait`, executing the delayed operation on
+ # the current thread. This makes the `timeout` value completely
+ # irrelevant. To enable non-blocking behavior, use the `executor`
+ # constructor option. This will cause the delayed operation to be
+ # execute on the given executor, allowing the call to timeout.
+ # @param timeout [Integer] (nil) the maximum number of seconds to wait for
+ # the value to be computed. When `nil` the caller will block indefinitely.
+ # @return [Object] self
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#132
+ def wait(timeout = T.unsafe(nil)); end
+
+ protected
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#160
+ def ns_initialize(opts, &block); end
+
+ private
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/delay.rb#173
+ def execute_task_once; end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#7
+class Concurrent::DependencyCounter
+ # @return [DependencyCounter] a new instance of DependencyCounter
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#9
+ def initialize(count, &block); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#14
+ def update(time, value, reason); end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#3
+class Concurrent::Error < ::StandardError; end
+
+# Old school kernel-style event reminiscent of Win32 programming in C++.
+#
+# When an `Event` is created it is in the `unset` state. Threads can choose to
+# `#wait` on the event, blocking until released by another thread. When one
+# thread wants to alert all blocking threads it calls the `#set` method which
+# will then wake up all listeners. Once an `Event` has been set it remains set.
+# New threads calling `#wait` will return immediately. An `Event` may be
+# `#reset` at any time once it has been set.
+#
+# @example
+# event = Concurrent::Event.new
+#
+# t1 = Thread.new do
+# puts "t1 is waiting"
+# event.wait(1)
+# puts "event occurred"
+# end
+#
+# t2 = Thread.new do
+# puts "t2 calling set"
+# event.set
+# end
+#
+# [t1, t2].each(&:join)
+#
+# # prints:
+# # t1 is waiting
+# # t2 calling set
+# # event occurred
+# @see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682655.aspx
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#36
+class Concurrent::Event < ::Concurrent::Synchronization::LockableObject
+ # Creates a new `Event` in the unset state. Threads calling `#wait` on the
+ # `Event` will block.
+ #
+ # @return [Event] a new instance of Event
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#40
+ def initialize; end
+
+ # Reset a previously set event back to the `unset` state.
+ # Has no effect if the `Event` has not yet been set.
+ #
+ # @return [Boolean] should always return `true`
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#68
+ def reset; end
+
+ # Trigger the event, setting the state to `set` and releasing all threads
+ # waiting on the event. Has no effect if the `Event` has already been set.
+ #
+ # @return [Boolean] should always return `true`
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#56
+ def set; end
+
+ # Is the object in the set state?
+ #
+ # @return [Boolean] indicating whether or not the `Event` has been set
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#48
+ def set?; end
+
+ # @return [Boolean]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#60
+ def try?; end
+
+ # Wait a given number of seconds for the `Event` to be set by another
+ # thread. Will wait forever when no `timeout` value is given. Returns
+ # immediately if the `Event` has already been set.
+ #
+ # @return [Boolean] true if the `Event` was set before timeout else false
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#83
+ def wait(timeout = T.unsafe(nil)); end
+
+ protected
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#104
+ def ns_initialize; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/event.rb#96
+ def ns_set; end
+end
+
+# A synchronization point at which threads can pair and swap elements within
+# pairs. Each thread presents some object on entry to the exchange method,
+# matches with a partner thread, and receives its partner's object on return.
+#
+#
+# ## Thread-safe Variable Classes
+#
+# Each of the thread-safe variable classes is designed to solve a different
+# problem. In general:
+#
+# * *{Concurrent::Agent}:* Shared, mutable variable providing independent,
+# uncoordinated, *asynchronous* change of individual values. Best used when
+# the value will undergo frequent, complex updates. Suitable when the result
+# of an update does not need to be known immediately.
+# * *{Concurrent::Atom}:* Shared, mutable variable providing independent,
+# uncoordinated, *synchronous* change of individual values. Best used when
+# the value will undergo frequent reads but only occasional, though complex,
+# updates. Suitable when the result of an update must be known immediately.
+# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated
+# atomically. Updates are synchronous but fast. Best used when updates a
+# simple set operations. Not suitable when updates are complex.
+# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar
+# but optimized for the given data type.
+# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used
+# when two or more threads need to exchange data. The threads will pair then
+# block on each other until the exchange is complete.
+# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread
+# must give a value to another, which must take the value. The threads will
+# block on each other until the exchange is complete.
+# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which
+# holds a different value for each thread which has access. Often used as
+# an instance variable in objects which must maintain different state
+# for different threads.
+# * *{Concurrent::TVar}:* Shared, mutable variables which provide
+# *coordinated*, *synchronous*, change of *many* stated. Used when multiple
+# value must change together, in an all-or-nothing transaction.
+# This implementation is very simple, using only a single slot for each
+# exchanger (unlike more advanced implementations which use an "arena").
+# This approach will work perfectly fine when there are only a few threads
+# accessing a single `Exchanger`. Beyond a handful of threads the performance
+# will degrade rapidly due to contention on the single slot, but the algorithm
+# will remain correct.
+#
+# @example
+#
+# exchanger = Concurrent::Exchanger.new
+#
+# threads = [
+# Thread.new { puts "first: " << exchanger.exchange('foo', 1) }, #=> "first: bar"
+# Thread.new { puts "second: " << exchanger.exchange('bar', 1) } #=> "second: foo"
+# ]
+# threads.each {|t| t.join(2) }
+# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Exchanger.html java.util.concurrent.Exchanger
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#336
+class Concurrent::Exchanger < ::Concurrent::RubyExchanger; end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#327
+Concurrent::ExchangerImplementation = Concurrent::RubyExchanger
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/executor_service.rb#157
+module Concurrent::ExecutorService
+ include ::Concurrent::Concern::Logging
+
+ # Submit a task to the executor for asynchronous processing.
+ #
+ # @param task [Proc] the asynchronous task to perform
+ # @return [self] returns itself
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/executor_service.rb#166
+ def <<(task); end
+
+ # Does the task queue have a maximum size?
+ #
+ # @note Always returns `false`
+ # @return [Boolean] True if the task queue has a maximum size else false.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/executor_service.rb#174
+ def can_overflow?; end
+
+ # Submit a task to the executor for asynchronous processing.
+ #
+ # @param args [Array] zero or more arguments to be passed to the task
+ # @raise [ArgumentError] if no task is given
+ # @return [Boolean] `true` if the task is queued, `false` if the executor
+ # is not running
+ # @yield the asynchronous task to perform
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/executor_service.rb#161
+ def post(*args, &task); end
+
+ # Does this executor guarantee serialization of its operations?
+ #
+ # @note Always returns `false`
+ # @return [Boolean] True if the executor guarantees that all operations
+ # will be post in the order they are received and no two operations may
+ # occur simultaneously. Else false.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/executor_service.rb#181
+ def serialized?; end
+end
+
+# A `FiberLocalVar` is a variable where the value is different for each fiber.
+# Each variable may have a default value, but when you modify the variable only
+# the current fiber will ever see that change.
+#
+# This is similar to Ruby's built-in fiber-local variables (`Thread.current[:name]`),
+# but with these major advantages:
+# * `FiberLocalVar` has its own identity, it doesn't need a Symbol.
+# * Each Ruby's built-in fiber-local variable leaks some memory forever (it's a Symbol held forever on the fiber),
+# so it's only OK to create a small amount of them.
+# `FiberLocalVar` has no such issue and it is fine to create many of them.
+# * Ruby's built-in fiber-local variables leak forever the value set on each fiber (unless set to nil explicitly).
+# `FiberLocalVar` automatically removes the mapping for each fiber once the `FiberLocalVar` instance is GC'd.
+#
+# @example
+# v = FiberLocalVar.new(14)
+# v.value #=> 14
+# v.value = 2
+# v.value #=> 2
+# @example
+# v = FiberLocalVar.new(14)
+#
+# Fiber.new do
+# v.value #=> 14
+# v.value = 1
+# v.value #=> 1
+# end.resume
+#
+# Fiber.new do
+# v.value #=> 14
+# v.value = 2
+# v.value #=> 2
+# end.resume
+#
+# v.value #=> 14
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#41
+class Concurrent::FiberLocalVar
+ # Creates a fiber local variable.
+ #
+ # @param default [Object] the default value when otherwise unset
+ # @param default_block [Proc] Optional block that gets called to obtain the
+ # default value for each fiber
+ # @return [FiberLocalVar] a new instance of FiberLocalVar
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#49
+ def initialize(default = T.unsafe(nil), &default_block); end
+
+ # Bind the given value to fiber local storage during
+ # execution of the given block.
+ #
+ # @param value [Object] the value to bind
+ # @return [Object] the value
+ # @yield the operation to be performed with the bound variable
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#86
+ def bind(value); end
+
+ # Returns the value in the current fiber's copy of this fiber-local variable.
+ #
+ # @return [Object] the current value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#68
+ def value; end
+
+ # Sets the current fiber's copy of this fiber-local variable to the specified value.
+ #
+ # @param value [Object] the value to set
+ # @return [Object] the new value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#76
+ def value=(value); end
+
+ protected
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#101
+ def default; end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#42
+Concurrent::FiberLocalVar::LOCALS = T.let(T.unsafe(nil), Concurrent::FiberLocals)
+
+# An array-backed storage of indexed variables per fiber.
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#166
+class Concurrent::FiberLocals < ::Concurrent::AbstractLocals
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#167
+ def locals; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#171
+ def locals!; end
+end
+
+# A thread pool that reuses a fixed number of threads operating off an unbounded queue.
+# At any point, at most `num_threads` will be active processing tasks. When all threads are busy new
+# tasks `#post` to the thread pool are enqueued until a thread becomes available.
+# Should a thread crash for any reason the thread will immediately be removed
+# from the pool and replaced.
+#
+# The API and behavior of this class are based on Java's `FixedThreadPool`
+#
+# **Thread Pool Options**
+#
+# Thread pools support several configuration options:
+#
+# * `idletime`: The number of seconds that a thread may be idle before being reclaimed.
+# * `name`: The name of the executor (optional). Printed in the executor's `#to_s` output and
+# a `-worker-` name is given to its threads if supported by used Ruby
+# implementation. `` is uniq for each thread.
+# * `max_queue`: The maximum number of tasks that may be waiting in the work queue at
+# any one time. When the queue size reaches `max_queue` and no new threads can be created,
+# subsequent tasks will be rejected in accordance with the configured `fallback_policy`.
+# * `auto_terminate`: When true (default), the threads started will be marked as daemon.
+# * `fallback_policy`: The policy defining how rejected tasks are handled.
+#
+# Three fallback policies are supported:
+#
+# * `:abort`: Raise a `RejectedExecutionError` exception and discard the task.
+# * `:discard`: Discard the task and return false.
+# * `:caller_runs`: Execute the task on the calling thread.
+#
+# **Shutting Down Thread Pools**
+#
+# Killing a thread pool while tasks are still being processed, either by calling
+# the `#kill` method or at application exit, will have unpredictable results. There
+# is no way for the thread pool to know what resources are being used by the
+# in-progress tasks. When those tasks are killed the impact on those resources
+# cannot be predicted. The *best* practice is to explicitly shutdown all thread
+# pools using the provided methods:
+#
+# * Call `#shutdown` to initiate an orderly termination of all in-progress tasks
+# * Call `#wait_for_termination` with an appropriate timeout interval an allow
+# the orderly shutdown to complete
+# * Call `#kill` *only when* the thread pool fails to shutdown in the allotted time
+#
+# On some runtime platforms (most notably the JVM) the application will not
+# exit until all thread pools have been shutdown. To prevent applications from
+# "hanging" on exit, all threads can be marked as daemon according to the
+# `:auto_terminate` option.
+#
+# ```ruby
+# pool1 = Concurrent::FixedThreadPool.new(5) # threads will be marked as daemon
+# pool2 = Concurrent::FixedThreadPool.new(5, auto_terminate: false) # mark threads as non-daemon
+# ```
+#
+# @note Failure to properly shutdown a thread pool can lead to unpredictable results.
+# Please read *Shutting Down Thread Pools* for more information.
+# @see http://docs.oracle.com/javase/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 http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html Java Tutorials: Thread Pools
+# @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#199
+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#213
+ def initialize(num_threads, opts = T.unsafe(nil)); end
+end
+
+# {include:file:docs-source/future.md}
+#
+# @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
+# @see http://ruby-doc.org/stdlib-2.1.1/libdoc/observer/rdoc/Observable.html Ruby Observable module
+#
+# 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 one line
+ # future = Concurrent::Future.new{ sleep(1); 42 }.execute
+ # future.state #=> :pending
+ # @example Instance and execute in separate steps
+ # future = Concurrent::Future.new{ sleep(1); 42 }
+ # future.state #=> :unscheduled
+ # future.execute
+ # future.state #=> :pending
+ # @return [Future] a reference to `self`
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#53
+ def execute; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#82
+ def set(value = T.unsafe(nil), &block); end
+
+ # Wait the given number of seconds for the operation to complete.
+ # On timeout attempt to cancel the operation.
+ #
+ # @param timeout [Numeric] the maximum time in seconds to wait.
+ # @return [Boolean] true if the operation completed before the timeout
+ # else false
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#121
+ def wait_or_cancel(timeout); end
+
+ protected
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#133
+ def ns_initialize(value, opts); end
+
+ class << self
+ # Create a new `Future` object with the given block, execute it, and return the
+ # `:pending` object.
+ #
+ # @example
+ # future = Concurrent::Future.execute{ sleep(1); 42 }
+ # future.state #=> :pending
+ # @option opts
+ # @param opts [Hash] a customizable set of options
+ # @raise [ArgumentError] if no block is given
+ # @return [Future] the newly created `Future` in the `:pending` state
+ # @yield the asynchronous operation to perform
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#77
+ def execute(opts = T.unsafe(nil), &block); end
+ end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#18
+Concurrent::GLOBAL_FAST_EXECUTOR = T.let(T.unsafe(nil), Concurrent::Delay)
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#30
+Concurrent::GLOBAL_IMMEDIATE_EXECUTOR = T.let(T.unsafe(nil), Concurrent::ImmediateExecutor)
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#22
+Concurrent::GLOBAL_IO_EXECUTOR = T.let(T.unsafe(nil), Concurrent::Delay)
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#111
+Concurrent::GLOBAL_LOGGER = T.let(T.unsafe(nil), Concurrent::AtomicReference)
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#26
+Concurrent::GLOBAL_TIMER_SET = T.let(T.unsafe(nil), Concurrent::Delay)
+
+# A thread-safe subclass of Hash. This version locks against the object
+# itself for every method call, ensuring only one thread can be reading
+# or writing at a time. This includes iteration methods like `#each`,
+# which takes the lock repeatedly when reading an item.
+#
+# @see http://ruby-doc.org/core/Hash.html Ruby standard library `Hash`
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/hash.rb#49
+class Concurrent::Hash < ::Hash; end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/hash.rb#16
+Concurrent::HashImplementation = Hash
+
+# An `IVar` is like a future that you can assign. As a future is a value that
+# is being computed that you can wait on, an `IVar` is a value that is waiting
+# to be assigned, that you can wait on. `IVars` are single assignment and
+# deterministic.
+#
+# Then, express futures as an asynchronous computation that assigns an `IVar`.
+# The `IVar` becomes the primitive on which [futures](Future) and
+# [dataflow](Dataflow) are built.
+#
+# An `IVar` is a single-element container that is normally created empty, and
+# can only be set once. The I in `IVar` stands for immutable. Reading an
+# `IVar` normally blocks until it is set. It is safe to set and read an `IVar`
+# from different threads.
+#
+# If you want to have some parallel task set the value in an `IVar`, you want
+# a `Future`. If you want to create a graph of parallel tasks all executed
+# when the values they depend on are ready you want `dataflow`. `IVar` is
+# generally a low-level primitive.
+#
+# ## Examples
+#
+# Create, set and get an `IVar`
+#
+# ```ruby
+# ivar = Concurrent::IVar.new
+# ivar.set 14
+# ivar.value #=> 14
+# ivar.set 2 # would now be an error
+# ```
+#
+# ## See Also
+#
+# 1. For the theory: Arvind, R. Nikhil, and K. Pingali.
+# [I-Structures: Data structures for parallel computing](http://dl.acm.org/citation.cfm?id=69562).
+# In Proceedings of Workshop on Graph Reduction, 1986.
+# 2. For recent application:
+# [DataDrivenFuture in Habanero Java from Rice](http://www.cs.rice.edu/~vs3/hjlib/doc/edu/rice/hj/api/HjDataDrivenFuture.html).
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#48
+class Concurrent::IVar < ::Concurrent::Synchronization::LockableObject
+ include ::Concurrent::Concern::Dereferenceable
+ include ::Concurrent::Concern::Obligation
+ include ::Concurrent::Concern::Observable
+
+ # Create a new `IVar` in the `:pending` state with the (optional) initial value.
+ #
+ # @option opts
+ # @option opts
+ # @option opts
+ # @param opts [Hash] the options to create a message with
+ # @param value [Object] the initial value
+ # @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 func [Symbol] symbol naming the method to call when this
+ # `Observable` has changes`
+ # @param observer [Object] the object that will be notified of 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#59
+ 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#21
+ 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#33
+ 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/collection/lock_free_stack.rb#37
+ 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#158
+ 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/collection/lock_free_stack.rb#37
+ def compare_and_set_head(expected, value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#37
+ def head; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#37
+ def head=(value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#37
+ def swap_head(value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#37
+ 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
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#28
+ def [](*_arg0); end
+ end
+end
+
+# Either {FiberLocalVar} or {ThreadLocalVar} depending on whether Mutex (and Monitor)
+# are held, respectively, per Fiber or per Thread.
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb#22
+Concurrent::LockLocalVar = Concurrent::FiberLocalVar
+
+# An `MVar` is a synchronized single element container. They are empty or
+# contain one item. Taking a value from an empty `MVar` blocks, as does
+# putting a value into a full one. You can either think of them as blocking
+# queue of length one, or a special kind of mutable variable.
+#
+# On top of the fundamental `#put` and `#take` operations, we also provide a
+# `#modify` that is atomic with respect to operations on the same instance.
+# These operations all support timeouts.
+#
+# We also support non-blocking operations `#try_put!` and `#try_take!`, a
+# `#set!` that ignores existing values, a `#value` that returns the value
+# without removing it or returns `MVar::EMPTY`, and a `#modify!` that yields
+# `MVar::EMPTY` if the `MVar` is empty and can be used to set `MVar::EMPTY`.
+# You shouldn't use these operations in the first instance.
+#
+# `MVar` is a [Dereferenceable](Dereferenceable).
+#
+# `MVar` is related to M-structures in Id, `MVar` in Haskell and `SyncVar` in Scala.
+#
+# Note that unlike the original Haskell paper, our `#take` is blocking. This is how
+# Haskell and Scala do it today.
+#
+# ## 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 pre-transform value. A timeout can
+ # be set to limit the time spent blocked, in which case it returns `TIMEOUT`
+ # if the time is exceeded.
+ #
+ # @raise [ArgumentError]
+ # @return [Object] the pre-transform 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#279
+ 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 default_value [Object]
+ # @param key [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 default_value [Object]
+ # @param key [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/map.rb#162
+ 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/map.rb#163
+ 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://github.com/purescript/purescript-maybe/blob/master/docs/Data.Maybe.md PureScript Data.Maybe
+# @see https://hackage.haskell.org/package/base-4.2.0.1/docs/Data-Maybe.html Haskell 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#179
+ 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#191
+ 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#187
+ def rejected?; end
+
+ # The value of a `Maybe` when `Just`. Will be `NONE` when `Nothing`.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#189
+ def value; end
+
+ class << self
+ # Create a new `Maybe` using the given block.
+ #
+ # Runs the given block passing all function arguments to the block as block
+ # arguments. If the block runs to completion without raising an exception
+ # a new `Just` is created with the value set to the return value of the
+ # block. If the block raises an exception a new `Nothing` is created with
+ # the reason being set to the raised exception.
+ #
+ # @param 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/maybe.rb#119
+ def new(*args, &block); end
+ end
+end
+
+# Indicates that the given attribute has not been set.
+# When `Just` the {#nothing} getter will return `NONE`.
+# When `Nothing` the {#just} getter will return `NONE`.
+#
+# 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 othervalue [Object] the value of the member in `other`
+ # @yieldparam selfvalue [Object] the value of the member in `self`
+ #
+ # 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#54
+ 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#75
+ 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#41
+ 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#34
+ 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 new_value [Object] the new value
+ # @param old_value [Object] the expected 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/mutex_atomic.rb#13
+ 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#42
+ 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#26
+ 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#32
+ def value=(new_value); end
+
+ protected
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#59
+ def synchronize; end
+end
+
+# A synchronization object that allows one thread to wait on multiple other threads.
+# The thread that will wait creates a `CountDownLatch` and sets the initial value
+# (normally equal to the number of other threads). The initiating thread passes the
+# latch to the other threads then waits for the other threads by calling the `#wait`
+# method. Each of the other threads calls `#count_down` when done with its work.
+# When the latch counter reaches zero the waiting thread is unblocked and continues
+# with its work. A `CountDownLatch` can be used only once. Its value cannot be reset.
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb#9
+class Concurrent::MutexCountDownLatch < ::Concurrent::Synchronization::LockableObject
+ # Create a new `CountDownLatch` with the initial `count`.
+ #
+ # @param count [new] the initial count
+ # @raise [ArgumentError] if `count` is not an integer or is less than zero
+ # @return [MutexCountDownLatch] a new instance of MutexCountDownLatch
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb#12
+ def initialize(count = T.unsafe(nil)); end
+
+ # The current value of the counter.
+ #
+ # @return [Fixnum] the current value of the counter
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb#34
+ def count; end
+
+ # Signal the latch to decrement the counter. Will signal all blocked threads when
+ # the `count` reaches zero.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb#26
+ def count_down; end
+
+ # Block on the latch until the counter reaches zero or until `timeout` is reached.
+ #
+ # @param timeout [Fixnum] the number of seconds to wait for the counter or `nil`
+ # to block indefinitely
+ # @return [Boolean] `true` if the `count` reaches zero else false on `timeout`
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb#21
+ def wait(timeout = T.unsafe(nil)); end
+
+ protected
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb#40
+ def ns_initialize(count); end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#9
+class Concurrent::MutexSemaphore < ::Concurrent::Synchronization::LockableObject
+ # @return [MutexSemaphore] a new instance of MutexSemaphore
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#12
+ def initialize(count); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#20
+ def acquire(permits = T.unsafe(nil)); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#38
+ def available_permits; end
+
+ # Acquires and returns all permits that are immediately available.
+ #
+ # @return [Integer]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#47
+ def drain_permits; end
+
+ # Shrinks the number of available permits by the indicated reduction.
+ #
+ # @param reduction [Fixnum] Number of permits to remove.
+ # @raise [ArgumentError] if `reduction` is not an integer or is negative
+ # @raise [ArgumentError] if `@free` - `@reduction` is less than zero
+ # @return [nil]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#99
+ def reduce_permits(reduction); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#77
+ def release(permits = T.unsafe(nil)); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#54
+ def try_acquire(permits = T.unsafe(nil), timeout = T.unsafe(nil)); end
+
+ protected
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#110
+ def ns_initialize(count); end
+
+ private
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#117
+ def try_acquire_now(permits); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#127
+ def try_acquire_timed(permits, timeout); end
+end
+
+# Various classes within allows for +nil+ values to be stored,
+# so a special +NULL+ token is required to indicate the "nil-ness".
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/constants.rb#6
+Concurrent::NULL = T.let(T.unsafe(nil), Object)
+
+# Suppresses all output when used for logging.
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#108
+Concurrent::NULL_LOGGER = T.let(T.unsafe(nil), Proc)
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/options.rb#6
+module Concurrent::Options
+ class << self
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/options.rb#27
+ def executor(executor_identifier); end
+
+ # Get the requested `Executor` based on the values set in the options hash.
+ #
+ # @option opts
+ # @param opts [Hash] the options defining the requested executor
+ # @return [Executor, nil] the requested thread pool, or nil when no option specified
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/options.rb#19
+ def executor_from_options(opts = T.unsafe(nil)); end
+ end
+end
+
+# Promises are inspired by the JavaScript [Promises/A](http://wiki.commonjs.org/wiki/Promises/A)
+# and [Promises/A+](http://promises-aplus.github.io/promises-spec/) specifications.
+#
+# > A promise represents the eventual value returned from the single
+# > completion of an operation.
+#
+# Promises are similar to futures and share many of the same behaviours.
+# Promises are far more robust, however. Promises can be chained in a tree
+# structure where each promise may have zero or more children. Promises are
+# chained using the `then` method. The result of a call to `then` is always
+# another promise. Promises are resolved asynchronously (with respect to the
+# main thread) but in a strict order: parents are guaranteed to be resolved
+# before their children, children before their younger siblings. The `then`
+# method takes two parameters: an optional block to be executed upon parent
+# resolution and an optional callable to be executed upon parent failure. The
+# result of each promise is passed to each of its children upon resolution.
+# When a promise is rejected all its children will be summarily rejected and
+# will receive the reason.
+#
+# Promises have several possible states: *:unscheduled*, *:pending*,
+# *:processing*, *:rejected*, or *:fulfilled*. These are also aggregated as
+# `#incomplete?` and `#complete?`. When a Promise is created it is set to
+# *:unscheduled*. Once the `#execute` method is called the state becomes
+# *:pending*. Once a job is pulled from the thread pool's queue and is given
+# to a thread for processing (often immediately upon `#post`) the state
+# becomes *:processing*. The future will remain in this state until processing
+# is complete. A future that is in the *:unscheduled*, *:pending*, or
+# *:processing* is considered `#incomplete?`. A `#complete?` Promise is either
+# *:rejected*, indicating that an exception was thrown during processing, or
+# *:fulfilled*, indicating success. If a Promise is *:fulfilled* its `#value`
+# will be updated to reflect the result of the operation. If *:rejected* the
+# `reason` will be updated with a reference to the thrown exception. The
+# predicate methods `#unscheduled?`, `#pending?`, `#rejected?`, and
+# `#fulfilled?` can be called at any time to obtain the state of the Promise,
+# as can the `#state` method, which returns a symbol.
+#
+# Retrieving the value of a promise is done through the `value` (alias:
+# `deref`) method. Obtaining the value of a promise is a potentially blocking
+# operation. When a promise is *rejected* a call to `value` will return `nil`
+# immediately. When a promise is *fulfilled* a call to `value` will
+# immediately return the current value. When a promise is *pending* a call to
+# `value` will block until the promise is either *rejected* or *fulfilled*. A
+# *timeout* value can be passed to `value` to limit how long the call will
+# block. If `nil` the call will block indefinitely. If `0` the call will not
+# block. Any other integer or float value will indicate the maximum number of
+# seconds to block.
+#
+# Promises run on the global thread pool.
+#
+# ### Examples
+#
+# Start by requiring promises
+#
+# ```ruby
+# require 'concurrent/promise'
+# ```
+#
+# Then create one
+#
+# ```ruby
+# p = Concurrent::Promise.execute do
+# # do something
+# 42
+# end
+# ```
+#
+# Promises can be chained using the `then` method. The `then` method accepts a
+# block and an executor, to be executed on fulfillment, and a callable argument to be executed
+# on rejection. The result of the each promise is passed as the block argument
+# to chained promises.
+#
+# ```ruby
+# p = Concurrent::Promise.new{10}.then{|x| x * 2}.then{|result| result - 10 }.execute
+# ```
+#
+# And so on, and so on, and so on...
+#
+# ```ruby
+# p = Concurrent::Promise.fulfill(20).
+# then{|result| result - 10 }.
+# then{|result| result * 3 }.
+# then(executor: different_executor){|result| result % 5 }.execute
+# ```
+#
+# The initial state of a newly created Promise depends on the state of its parent:
+# - if parent is *unscheduled* the child will be *unscheduled*
+# - if parent is *pending* the child will be *pending*
+# - if parent is *fulfilled* the child will be *pending*
+# - if parent is *rejected* the child will be *pending* (but will ultimately be *rejected*)
+#
+# Promises are executed asynchronously from the main thread. By the time a
+# child Promise finishes initialization it may be in a different state than its
+# parent (by the time a child is created its parent may have completed
+# execution and changed state). Despite being asynchronous, however, the order
+# of execution of Promise objects in a chain (or tree) is strictly defined.
+#
+# There are multiple ways to create and execute a new `Promise`. Both ways
+# provide identical behavior:
+#
+# ```ruby
+# # create, operate, then execute
+# p1 = Concurrent::Promise.new{ "Hello World!" }
+# p1.state #=> :unscheduled
+# p1.execute
+#
+# # create and immediately execute
+# p2 = Concurrent::Promise.new{ "Hello World!" }.execute
+#
+# # execute during creation
+# p3 = Concurrent::Promise.execute{ "Hello World!" }
+# ```
+#
+# Once the `execute` method is called a `Promise` becomes `pending`:
+#
+# ```ruby
+# p = Concurrent::Promise.execute{ "Hello, world!" }
+# p.state #=> :pending
+# p.pending? #=> true
+# ```
+#
+# Wait a little bit, and the promise will resolve and provide a value:
+#
+# ```ruby
+# p = Concurrent::Promise.execute{ "Hello, world!" }
+# sleep(0.1)
+#
+# p.state #=> :fulfilled
+# p.fulfilled? #=> true
+# p.value #=> "Hello, world!"
+# ```
+#
+# If an exception occurs, the promise will be rejected and will provide
+# a reason for the rejection:
+#
+# ```ruby
+# p = Concurrent::Promise.execute{ raise StandardError.new("Here comes the Boom!") }
+# sleep(0.1)
+#
+# p.state #=> :rejected
+# p.rejected? #=> true
+# p.reason #=> "#"
+# ```
+#
+# #### Rejection
+#
+# When a promise is rejected all its children will be rejected and will
+# receive the rejection `reason` as the rejection callable parameter:
+#
+# ```ruby
+# p = Concurrent::Promise.execute { Thread.pass; raise StandardError }
+#
+# c1 = p.then(-> reason { 42 })
+# c2 = p.then(-> reason { raise 'Boom!' })
+#
+# c1.wait.state #=> :fulfilled
+# c1.value #=> 42
+# c2.wait.state #=> :rejected
+# c2.reason #=> #
+# ```
+#
+# Once a promise is rejected it will continue to accept children that will
+# receive immediately rejection (they will be executed asynchronously).
+#
+# #### Aliases
+#
+# The `then` method is the most generic alias: it accepts a block to be
+# executed upon parent fulfillment and a callable to be executed upon parent
+# rejection. At least one of them should be passed. The default block is `{
+# |result| result }` that fulfills the child with the parent value. The
+# default callable is `{ |reason| raise reason }` that rejects the child with
+# the parent reason.
+#
+# - `on_success { |result| ... }` is the same as `then {|result| ... }`
+# - `rescue { |reason| ... }` is the same as `then(Proc.new { |reason| ... } )`
+# - `rescue` is aliased by `catch` and `on_error`
+#
+# 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://promises-aplus.github.io/promises-spec/
+ # @see http://wiki.commonjs.org/wiki/Promises/A
+ # @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#364
+ def catch(&block); end
+
+ # Execute an `:unscheduled` `Promise`. Immediately sets the state to `:pending` and
+ # passes the block to a new thread/thread pool for eventual execution.
+ # Does nothing if the `Promise` is in any state other than `:unscheduled`.
+ #
+ # @return [Promise] a reference to `self`
+ #
+ # 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#365
+ 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/promises.rb#515
+ 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 a_future.chain_on
+ # @overload an_event.chain_on
+ # @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).
+ # @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.
+ # @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#any_fulfilled_future_on
+ # @see FactoryMethods#future_on
+ # @see FactoryMethods#resolvable_future
+ # @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#623
+ def inspect; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#515
+ 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 a_future.on_resolution!
+ # @overload an_event.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 a_future.on_resolution_using
+ # @overload an_event.on_resolution_using
+ # @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).
+ # @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.
+ # @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 a_future.state
+ # @overload an_event.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#633
+ 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/promises.rb#515
+ def compare_and_set_internal_state(expected, value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#515
+ def internal_state=(value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#515
+ def swap_internal_state(value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#515
+ 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#1562
+ 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#1579
+ 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/promises.rb#1621
+ 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#847
+ 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#828
+ 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#857
+ 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#282
+ 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 args [Object] arguments which are passed to the task when it's executed.
+ # (It might be prepended with other arguments, see the @yield section).
+ # @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]
+ # @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 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 fulfilled [true, false]
+ # @param reason [Object]
+ # @param value [Object]
+ # @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#258
+ 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#1078
+ def &(other); end
+
+ # Creates a new event which will be resolved when the first of receiver, `event_or_future`
+ # resolves. Returning future will have value nil if event_or_future is event and resolves
+ # first.
+ #
+ # @return [Future]
+ #
+ # 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#1124
+ def flat(level = T.unsafe(nil)); end
+
+ # Creates new event which will be resolved when the returned event by receiver is.
+ # Be careful if the receiver rejects it will just resolve since Event does not hold reason.
+ #
+ # @return [Event]
+ #
+ # 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#1243
+ 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 args [Object] arguments which are passed to the task when it's executed.
+ # (It might be prepended with other arguments, see the @yield section).
+ # @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.
+ # @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 args [Object] arguments which are passed to the task when it's executed.
+ # (It might be prepended with other arguments, see the @yield section).
+ # @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.
+ # @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 args [Object] arguments which are passed to the task when it's executed.
+ # (It might be prepended with other arguments, see the @yield section).
+ # @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.
+ # @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 args [Object] arguments which are passed to the task when it's executed.
+ # (It might be prepended with other arguments, see the @yield section).
+ # @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.
+ # @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#1089
+ 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 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.
+ # @param value [Object]
+ # @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 raise_on_reassign [Boolean] should method raise exception if already resolved
+ # @param reason [Object]
+ # @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 raise_on_reassign [Boolean] should method raise exception if already resolved
+ # @param reason [Object]
+ # @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.
+ # @param value [Object]
+ # @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#1611
+ 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/exchanger.rb#165
+ def __initialize_atomic_fields__; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#165
+ def compare_and_set_slot(expected, value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#165
+ def slot; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#165
+ def slot=(value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#165
+ def swap_slot(value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#165
+ 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 timeout [Numeric, nil] in seconds, `nil` blocks indefinitely
+ # @param value [Object] the value to exchange with another thread
+ # @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/exchanger.rb#139
+ def __initialize_atomic_fields__; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#139
+ 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/exchanger.rb#139
+ def swap_value(value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#139
+ def update_value(&block); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#139
+ def value; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#139
+ 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#9
+class Concurrent::RubySingleThreadExecutor < ::Concurrent::RubyThreadPoolExecutor
+ include ::Concurrent::SerialExecutorService
+
+ # @return [RubySingleThreadExecutor] a new instance of RubySingleThreadExecutor
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb#13
+ 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/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 http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html Java Tutorials: Thread Pools
+# @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#13
+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#47
+ 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#67
+ 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#74
+ 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#62
+ 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#38
+ 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#52
+ 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#79
+ 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#32
+ 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#41
+ 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#35
+ 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 all pool implementations as they prune themselves
+ # automatically, and has been deprecated.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#139
+ def prune_pool; end
+
+ # removes the worker if it can be pruned
+ #
+ # @return [true, false] if the worker was pruned
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#104
+ def prune_worker(worker); 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#84
+ def queue_length; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#124
+ 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#89
+ def remaining_capacity; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#116
+ def remove_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#57
+ 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#44
+ def synchronous; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#129
+ def worker_died(worker); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#134
+ def worker_task_completed; end
+
+ private
+
+ # creates new worker which has to receive work to do after it's added
+ #
+ # @return [nil, Worker] nil of max capacity is reached
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#257
+ def ns_add_busy_worker; end
+
+ # tries to assign task to a worker, tries to get one from @ready or to create new one
+ #
+ # @return [true, false] if task is assigned to a worker
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#217
+ def ns_assign_worker(*args, &task); end
+
+ # tries to enqueue task
+ #
+ # @return [true, false] if enqueued
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#235
+ def ns_enqueue(*args, &task); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#178
+ def ns_execute(*args, &task); end
+
+ # @raise [ArgumentError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#146
+ def ns_initialize(opts); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#205
+ def ns_kill_execution; end
+
+ # @return [Boolean]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#173
+ def ns_limited_queue?; end
+
+ # @return [Integer] number of excess idle workers which can be removed without
+ # going below min_length, or all workers if not running
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#305
+ def ns_prunable_capacity; end
+
+ # handle ready worker, giving it new job or assigning back to @ready
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#269
+ def ns_ready_worker(worker, last_message, success = T.unsafe(nil)); end
+
+ # removes a worker which is not tracked in @ready
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#287
+ def ns_remove_busy_worker(worker); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#294
+ def ns_remove_ready_worker(worker); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#314
+ def ns_reset_if_forked; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#190
+ def ns_shutdown_execution; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#247
+ 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#17
+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#23
+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#20
+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#29
+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#26
+Concurrent::RubyThreadPoolExecutor::DEFAULT_THREAD_IDLETIMEOUT = T.let(T.unsafe(nil), Integer)
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#328
+class Concurrent::RubyThreadPoolExecutor::Worker
+ include ::Concurrent::Concern::Logging
+
+ # @return [Worker] a new instance of Worker
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#331
+ def initialize(pool, id); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#342
+ def <<(message); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#350
+ def kill; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#346
+ def stop; end
+
+ private
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#356
+ def create_worker(queue, pool, idletime); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#381
+ def run_task(pool, task, args); end
+end
+
+# A simple utility class that executes a callable and returns and array of three elements:
+# success - indicating if the callable has been executed without errors
+# value - filled by the callable result if it has been executed without errors, nil otherwise
+# reason - the error risen by the callable if it has been executed with errors, nil otherwise
+#
+# 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 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 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 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 Task execution with observation
+#
+# observer = Class.new{
+# def update(time, value, reason)
+# puts "The task completed at #{time} with value '#{value}'"
+# end
+# }.new
+#
+# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' }
+# task.add_observer(observer)
+# task.execute
+# task.pending? #=> true
+#
+# # wait for it...
+# sleep(3)
+#
+# #>> The task completed at 2013-11-07 12:26:09 -0500 with value 'What does the fox say?'
+# @see Concurrent.timer
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#158
+class Concurrent::ScheduledTask < ::Concurrent::IVar
+ include ::Comparable
+
+ # Schedule a task for execution at a specified future time.
+ #
+ # @option opts
+ # @param delay [Float] the number of seconds to wait for before executing the task
+ # @param opts [Hash] a customizable set of options
+ # @raise [ArgumentError] When no block is given
+ # @raise [ArgumentError] When given a time that is in the past
+ # @return [ScheduledTask] a new instance of ScheduledTask
+ # @yield the task to be performed
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#178
+ def initialize(delay, opts = T.unsafe(nil), &task); end
+
+ # Comparator which orders by schedule time.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#213
+ def <=>(other); end
+
+ # Cancel this task and prevent it from executing. A task can only be
+ # cancelled if it is pending or unscheduled.
+ #
+ # @return [Boolean] true if successfully cancelled else false
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#235
+ def cancel; end
+
+ # Has the task been cancelled?
+ #
+ # @return [Boolean] true if the task is in the given state else false
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#220
+ def cancelled?; end
+
+ # Execute an `:unscheduled` `ScheduledTask`. Immediately sets the state to `:pending`
+ # and starts counting down toward execution. Does nothing if the `ScheduledTask` is
+ # in any state other than `:unscheduled`.
+ #
+ # @return [ScheduledTask] a reference to `self`
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#273
+ def execute; end
+
+ # The executor on which to execute the task.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#163
+ def executor; end
+
+ # The `delay` value given at instantiation.
+ #
+ # @return [Float] the initial delay.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#199
+ def initial_delay; end
+
+ # Execute the task.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#297
+ def process_task; end
+
+ # In the task execution in progress?
+ #
+ # @return [Boolean] true if the task is in the given state else false
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#227
+ def processing?; end
+
+ # Reschedule the task using the given delay and the current time.
+ # A task can only be reset while it is `:pending`.
+ #
+ # @param delay [Float] the number of seconds to wait for before executing the task
+ # @raise [ArgumentError] When given a time that is in the past
+ # @return [Boolean] true if successfully rescheduled else false
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#262
+ def reschedule(delay); end
+
+ # Reschedule the task using the original delay and the current time.
+ # A task can only be reset while it is `:pending`.
+ #
+ # @return [Boolean] true if successfully rescheduled else false
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#250
+ def reset; end
+
+ # The monotonic time at which the the task is scheduled to be executed.
+ #
+ # @return [Float] the schedule time or nil if `unscheduled`
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#206
+ def schedule_time; end
+
+ protected
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#301
+ def fail(reason = T.unsafe(nil)); end
+
+ # Reschedule the task using the given delay and the current time.
+ # A task can only be reset while it is `:pending`.
+ #
+ # @param 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/scheduled_task.rb#301
+ def set(value = T.unsafe(nil)); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#301
+ def try_set(value = T.unsafe(nil), &block); end
+
+ class << self
+ # Create a new `ScheduledTask` object with the given block, execute it, and return the
+ # `:pending` object.
+ #
+ # @param delay [Float] the number of seconds to wait for before executing the task
+ # @raise [ArgumentError] if no block is given
+ # @return [ScheduledTask] the newly created `ScheduledTask` in the `:pending` state
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#290
+ def execute(delay, opts = T.unsafe(nil), &task); end
+ end
+end
+
+# A counting semaphore. Conceptually, a semaphore maintains a set of
+# permits. Each {#acquire} blocks if necessary until a permit is
+# available, and then takes it. Each {#release} adds a permit, potentially
+# releasing a blocking acquirer.
+# However, no actual permit objects are used; the Semaphore just keeps a
+# count of the number available and acts accordingly.
+# Alternatively, permits may be acquired within a block, and automatically
+# released after the block finishes executing.
+#
+# @example
+# semaphore = Concurrent::Semaphore.new(2)
+#
+# t1 = Thread.new do
+# semaphore.acquire
+# puts "Thread 1 acquired semaphore"
+# end
+#
+# t2 = Thread.new do
+# semaphore.acquire
+# puts "Thread 2 acquired semaphore"
+# end
+#
+# t3 = Thread.new do
+# semaphore.acquire
+# puts "Thread 3 acquired semaphore"
+# end
+#
+# t4 = Thread.new do
+# sleep(2)
+# puts "Thread 4 releasing semaphore"
+# semaphore.release
+# end
+#
+# [t1, t2, t3, t4].each(&:join)
+#
+# # prints:
+# # Thread 3 acquired semaphore
+# # Thread 2 acquired semaphore
+# # Thread 4 releasing semaphore
+# # Thread 1 acquired semaphore
+# @example
+# semaphore = Concurrent::Semaphore.new(1)
+#
+# puts semaphore.available_permits
+# semaphore.acquire do
+# puts semaphore.available_permits
+# end
+# puts semaphore.available_permits
+#
+# # prints:
+# # 1
+# # 0
+# # 1
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/semaphore.rb#161
+class Concurrent::Semaphore < ::Concurrent::MutexSemaphore; end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/semaphore.rb#96
+Concurrent::SemaphoreImplementation = Concurrent::MutexSemaphore
+
+# Indicates that the including `ExecutorService` guarantees
+# that all operations will occur in the order they are post and that no
+# two operations may occur simultaneously. This module provides no
+# functionality and provides no guarantees. That is the responsibility
+# of the including class. This module exists solely to allow the including
+# object to be interrogated for its serialization status.
+#
+# @example
+# class Foo
+# include Concurrent::SerialExecutor
+# end
+#
+# foo = Foo.new
+#
+# foo.is_a? Concurrent::ExecutorService #=> true
+# foo.is_a? Concurrent::SerialExecutor #=> true
+# foo.serialized? #=> true
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb#24
+module Concurrent::SerialExecutorService
+ include ::Concurrent::Concern::Logging
+ include ::Concurrent::ExecutorService
+
+ # Does this executor guarantee serialization of its operations?
+ #
+ # @note Always returns `true`
+ # @return [Boolean] True if the executor guarantees that all operations
+ # will be post in the order they are received and no two operations may
+ # occur simultaneously. Else false.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb#30
+ def serialized?; end
+end
+
+# Ensures passed jobs in a serialized order never running at the same time.
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#8
+class Concurrent::SerializedExecution < ::Concurrent::Synchronization::LockableObject
+ include ::Concurrent::Concern::Logging
+
+ # @return [SerializedExecution] a new instance of SerializedExecution
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#11
+ def initialize; end
+
+ # Submit a task to the executor for asynchronous processing.
+ #
+ # @param args [Array] zero or more arguments to be passed to the task
+ # @param executor [Executor] to be used for this job
+ # @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
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16
+ def args; end
+
+ # Sets the attribute args
+ #
+ # @param value [Object] the value to set the attribute args to.
+ # @return [Object] the newly set value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16
+ def args=(_); end
+
+ # Returns the value of attribute block
+ #
+ # @return [Object] the current value of block
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16
+ def block; end
+
+ # Sets the attribute block
+ #
+ # @param value [Object] the value to set the attribute block to.
+ # @return [Object] the newly set value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16
+ 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
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16
+ def executor; end
+
+ # Sets the attribute executor
+ #
+ # @param value [Object] the value to set the attribute executor to.
+ # @return [Object] the newly set value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16
+ def executor=(_); end
+
+ class << self
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16
+ def [](*_arg0); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16
+ def inspect; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16
+ def keyword_init?; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16
+ def members; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16
+ def new(*_arg0); end
+ end
+end
+
+# A wrapper/delegator for any `ExecutorService` that
+# guarantees serialized execution of tasks.
+#
+# @see Concurrent::SerializedExecution
+# @see [SimpleDelegator](http://www.ruby-doc.org/stdlib-2.1.2/libdoc/delegate/rdoc/SimpleDelegator.html)
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb#12
+class Concurrent::SerializedExecutionDelegator < ::SimpleDelegator
+ include ::Concurrent::Concern::Logging
+ include ::Concurrent::ExecutorService
+ include ::Concurrent::SerialExecutorService
+
+ # @return [SerializedExecutionDelegator] a new instance of SerializedExecutionDelegator
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb#15
+ def initialize(executor); end
+
+ # Submit a task to the executor for asynchronous processing.
+ #
+ # @param args [Array] zero or more arguments to be passed to the task
+ # @raise [ArgumentError] if no task is given
+ # @return [Boolean] `true` if the task is queued, `false` if the executor
+ # is not running
+ # @yield the asynchronous task to perform
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb#22
+ def post(*args, &task); end
+end
+
+# A thread-safe subclass of Set. This version locks against the object
+# itself for every method call, ensuring only one thread can be reading
+# or writing at a time. This includes iteration methods like `#each`.
+#
+# @note `a += b` is **not** a **thread-safe** operation on
+# `Concurrent::Set`. It reads Set `a`, then it creates new `Concurrent::Set`
+# which is union of `a` and `b`, then it writes the union to `a`.
+# The read and write are independent operations they do not form a single atomic
+# operation therefore when two `+=` operations are executed concurrently updates
+# may be lost. Use `#merge` instead.
+# @see http://ruby-doc.org/stdlib-2.4.0/libdoc/set/rdoc/Set.html Ruby standard library `Set`
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#61
+class Concurrent::Set < ::Concurrent::CRubySet; end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#23
+Concurrent::SetImplementation = Concurrent::CRubySet
+
+# An thread-safe, write-once variation of Ruby's standard `Struct`.
+# Each member can have its value set at most once, either at construction
+# or any time thereafter. Attempting to assign a value to a member
+# that has already been set will result in a `Concurrent::ImmutabilityError`.
+#
+# @see http://en.wikipedia.org/wiki/Final_(Java) Java `final` keyword
+# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct`
+#
+# 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 othervalue [Object] the value of the member in `other`
+ # @yieldparam selfvalue [Object] the value of the member in `self`
+ #
+ # 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#21
+ 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#32
+ def to_s; end
+
+ # Returns the values for this struct as an Array.
+ #
+ # @return [Array] the values for this struct
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#18
+ def values; end
+
+ # Returns the struct member values for each selector as an Array.
+ #
+ # A selector may be either an Integer offset or a Range of offsets (as in `Array#values_at`).
+ #
+ # @param indexes [Fixnum, Range] the index(es) from which to obatin the values (in order)
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#24
+ def values_at(*indexes); end
+
+ private
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#97
+ def initialize_copy(original); end
+
+ class << self
+ # Factory for creating new struct classes.
+ #
+ # ```
+ # new([class_name] [, member_name]+>) -> StructClass click to toggle source
+ # new([class_name] [, member_name]+>) {|StructClass| block } -> StructClass
+ # new(value, ...) -> obj
+ # StructClass[value, ...] -> obj
+ # ```
+ #
+ # The first two forms are used to create a new struct subclass `class_name`
+ # that can contain a value for each member_name . This subclass can be
+ # used to create instances of the structure like any other Class .
+ #
+ # If the `class_name` is omitted an anonymous struct class will be created.
+ # Otherwise, the name of this struct will appear as a constant in the struct class,
+ # so it must be unique for all structs under this base class and must start with a
+ # capital letter. Assigning a struct class to a constant also gives the class
+ # the name of the constant.
+ #
+ # If a block is given it will be evaluated in the context of `StructClass`, passing
+ # the created class as a parameter. This is the recommended way to customize a struct.
+ # Subclassing an anonymous struct creates an extra anonymous class that will never be used.
+ #
+ # The last two forms create a new instance of a struct subclass. The number of value
+ # parameters must be less than or equal to the number of attributes defined for the
+ # struct. Unset parameters default to nil. Passing more parameters than number of attributes
+ # will raise an `ArgumentError`.
+ #
+ # @see http://ruby-doc.org/core/Struct.html#method-c-new Ruby standard library `Struct#new`
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#105
+ def new(*args, &block); end
+ end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#115
+Concurrent::SettableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped)
+
+# An executor service in which every operation spawns a new,
+# independently operating thread.
+#
+# This is perhaps the most inefficient executor service in this
+# library. It exists mainly for testing an debugging. Thread creation
+# and management is expensive in Ruby and this executor performs no
+# resource pooling. This can be very beneficial during testing and
+# debugging because it decouples the using code from the underlying
+# executor implementation. In production this executor will likely
+# lead to suboptimal performance.
+#
+# @note Intended for use primarily in testing and debugging.
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#21
+class Concurrent::SimpleExecutorService < ::Concurrent::RubyExecutorService
+ # Submit a task to the executor for asynchronous processing.
+ #
+ # @param task [Proc] the asynchronous task to perform
+ # @return [self] returns itself
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#56
+ def <<(task); end
+
+ # Begin an immediate shutdown. In-progress tasks will be allowed to
+ # complete but enqueued tasks will be dismissed and no new tasks
+ # will be accepted. Has no additional effect if the thread pool is
+ # not running.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#84
+ def kill; end
+
+ # Submit a task to the executor for asynchronous processing.
+ #
+ # @param args [Array] zero or more arguments to be passed to the task
+ # @raise [ArgumentError] if no task is given
+ # @return [Boolean] `true` if the task is queued, `false` if the executor
+ # is not running
+ # @yield the asynchronous task to perform
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#40
+ def post(*args, &task); end
+
+ # Is the executor running?
+ #
+ # @return [Boolean] `true` when running, `false` when shutting down or shutdown
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#62
+ def running?; end
+
+ # Begin an orderly shutdown. Tasks already in the queue will be executed,
+ # but no new tasks will be accepted. Has no additional effect if the
+ # thread pool is not running.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#77
+ def shutdown; end
+
+ # Is the executor shutdown?
+ #
+ # @return [Boolean] `true` when shutdown, `false` when shutting down or running
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#72
+ def shutdown?; end
+
+ # Is the executor shuttingdown?
+ #
+ # @return [Boolean] `true` when not running and not shutdown, else `false`
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#67
+ def shuttingdown?; end
+
+ # Block until executor shutdown is complete or until `timeout` seconds have
+ # passed.
+ #
+ # @note Does not initiate shutdown or termination. Either `shutdown` or `kill`
+ # must be called before this method (or on another thread).
+ # @param timeout [Integer] the maximum number of seconds to wait for shutdown to complete
+ # @return [Boolean] `true` if shutdown complete or false on `timeout`
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#91
+ def wait_for_termination(timeout = T.unsafe(nil)); end
+
+ private
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#97
+ def ns_initialize(*args); end
+
+ class << self
+ # Submit a task to the executor for asynchronous processing.
+ #
+ # @param task [Proc] the asynchronous task to perform
+ # @return [self] returns itself
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#34
+ def <<(task); end
+
+ # Submit a task to the executor for asynchronous processing.
+ #
+ # @param args [Array] zero or more arguments to be passed to the task
+ # @raise [ArgumentError] if no task is given
+ # @return [Boolean] `true` if the task is queued, `false` if the executor
+ # is not running
+ # @yield the asynchronous task to perform
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#24
+ def post(*args); end
+ end
+end
+
+# A thread pool with a single thread an unlimited queue. Should the thread
+# die for any reason it will be removed and replaced, thus ensuring that
+# the executor will always remain viable and available to process jobs.
+#
+# A common pattern for background processing is to create a single thread
+# on which an infinite loop is run. The thread's loop blocks on an input
+# source (perhaps blocking I/O or a queue) and processes each input as it
+# is received. This pattern has several issues. The thread itself is highly
+# susceptible to errors during processing. Also, the thread itself must be
+# constantly monitored and restarted should it die. `SingleThreadExecutor`
+# encapsulates all these behaviors. The task processor is highly resilient
+# to errors from within tasks. Also, should the thread die it will
+# automatically be restarted.
+#
+# The API and behavior of this class are based on Java's `SingleThreadExecutor`.
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb#37
+class Concurrent::SingleThreadExecutor < ::Concurrent::RubySingleThreadExecutor; end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb#10
+Concurrent::SingleThreadExecutorImplementation = Concurrent::RubySingleThreadExecutor
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#2
+module Concurrent::Synchronization
+ class << self
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/full_memory_barrier.rb#7
+ def full_memory_barrier; end
+ end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#9
+class Concurrent::Synchronization::AbstractLockableObject < ::Concurrent::Synchronization::Object
+ protected
+
+ # Broadcast to all waiting threads.
+ #
+ # @note only to be used inside synchronized block
+ # @note to provide direct access to this method in a descendant add method
+ # ```
+ # def broadcast
+ # synchronize { ns_broadcast }
+ # end
+ # ```
+ # @raise [NotImplementedError]
+ # @return [self]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#96
+ def ns_broadcast; end
+
+ # Signal one waiting thread.
+ #
+ # @note only to be used inside synchronized block
+ # @note to provide direct access to this method in a descendant add method
+ # ```
+ # def signal
+ # synchronize { ns_signal }
+ # end
+ # ```
+ # @raise [NotImplementedError]
+ # @return [self]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#81
+ def ns_signal; end
+
+ # Wait until another thread calls #signal or #broadcast,
+ # spurious wake-ups can happen.
+ #
+ # @note only to be used inside synchronized block
+ # @note to provide direct access to this method in a descendant add method
+ # ```
+ # def wait(timeout = nil)
+ # synchronize { ns_wait(timeout) }
+ # end
+ # ```
+ # @param timeout [Numeric, nil] in seconds, `nil` means no timeout
+ # @raise [NotImplementedError]
+ # @return [self]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#66
+ def ns_wait(timeout = T.unsafe(nil)); end
+
+ # Wait until condition is met or timeout passes,
+ # protects against spurious wake-ups.
+ #
+ # @note only to be used inside synchronized block
+ # @note to provide direct access to this method in a descendant add method
+ # ```
+ # def wait_until(timeout = nil, &condition)
+ # synchronize { ns_wait_until(timeout, &condition) }
+ # end
+ # ```
+ # @param timeout [Numeric, nil] in seconds, `nil` means no timeout
+ # @return [true, false] if condition met
+ # @yield condition to be met
+ # @yieldreturn [true, false]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#37
+ def ns_wait_until(timeout = T.unsafe(nil), &condition); end
+
+ # @note can by made public in descendants if required by `public :synchronize`
+ # @raise [NotImplementedError]
+ # @yield runs the block synchronized against this object,
+ # equivalent of java's `synchronize(this) {}`
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#18
+ def synchronize; end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#6
+class Concurrent::Synchronization::AbstractObject
+ # @return [AbstractObject] a new instance of AbstractObject
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#7
+ def initialize; end
+
+ # @abstract
+ # @raise [NotImplementedError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#13
+ def full_memory_barrier; end
+
+ class << self
+ # @raise [NotImplementedError]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#17
+ def attr_volatile(*names); end
+ end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#6
+module Concurrent::Synchronization::AbstractStruct
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#9
+ def initialize(*values); end
+
+ # Returns the number of struct members.
+ #
+ # @return [Fixnum] the number of struct members
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#19
+ def length; end
+
+ # Returns the struct members as an array of symbols.
+ #
+ # @return [Array] the struct members as an array of symbols
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#29
+ def members; end
+
+ # Returns the number of struct members.
+ #
+ # @return [Fixnum] the number of struct members
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#22
+ 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 othervalue [Object] the value of the member in `other`
+ # @yieldparam selfvalue [Object] the value of the member in `self`
+ #
+ # 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/condition.rb#15
+ def private_new(*args, &block); end
+
+ private
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#16
+ 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/lock.rb#35
+ def ns_broadcast; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#29
+ def ns_signal; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#17
+ def ns_wait(timeout = T.unsafe(nil)); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#23
+ 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/lock.rb#11
+ def synchronize; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#13
+ def wait(timeout = T.unsafe(nil)); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#19
+ def wait_until(timeout = T.unsafe(nil), &condition); end
+end
+
+# Safe synchronization under any Ruby implementation.
+# It provides methods like {#synchronize}, {#wait}, {#signal} and {#broadcast}.
+# Provides a single layer which can improve its implementation over time without changes needed to
+# the classes using it. Use {Synchronization::Object} not this abstract class.
+#
+# @note this object does not support usage together with
+# [`Thread#wakeup`](http://ruby-doc.org/core/Thread.html#method-i-wakeup)
+# and [`Thread#raise`](http://ruby-doc.org/core/Thread.html#method-i-raise).
+# `Thread#sleep` and `Thread#wakeup` will work as expected but mixing `Synchronization::Object#wait` and
+# `Thread#wakeup` will not work on all platforms.
+#
+# @see Event implementation as an example of this class use
+#
+# @example simple
+# class AnClass < Synchronization::Object
+# def initialize
+# super
+# synchronize { @value = 'asd' }
+# end
+#
+# def value
+# synchronize { @value }
+# end
+# end
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb#50
+class Concurrent::Synchronization::LockableObject < ::Concurrent::Synchronization::MutexLockableObject
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#57
+ def new_condition; end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb#11
+Concurrent::Synchronization::LockableObjectImplementation = Concurrent::Synchronization::MutexLockableObject
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#60
+class Concurrent::Synchronization::MonitorLockableObject < ::Concurrent::Synchronization::AbstractLockableObject
+ include ::Concurrent::Synchronization::ConditionSignalling
+ extend ::Concurrent::Synchronization::SafeInitialization
+
+ # @return [MonitorLockableObject] a new instance of MonitorLockableObject
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#65
+ def initialize; end
+
+ protected
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#83
+ def ns_wait(timeout = T.unsafe(nil)); end
+
+ # TODO may be a problem with lock.synchronize { lock.wait }
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#79
+ def synchronize; end
+
+ private
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#71
+ def initialize_copy(other); end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#25
+class Concurrent::Synchronization::MutexLockableObject < ::Concurrent::Synchronization::AbstractLockableObject
+ include ::Concurrent::Synchronization::ConditionSignalling
+ extend ::Concurrent::Synchronization::SafeInitialization
+
+ # @return [MutexLockableObject] a new instance of MutexLockableObject
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#30
+ def initialize; end
+
+ protected
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#52
+ def ns_wait(timeout = T.unsafe(nil)); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#44
+ def synchronize; end
+
+ private
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#36
+ def initialize_copy(other); end
+end
+
+# Abstract object providing final, volatile, ans CAS extensions to build other concurrent abstractions.
+# - final instance variables see {Object.safe_initialization!}
+# - volatile instance variables see {Object.attr_volatile}
+# - volatile instance variables see {Object.attr_atomic}
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#15
+class Concurrent::Synchronization::Object < ::Concurrent::Synchronization::AbstractObject
+ include ::Concurrent::Synchronization::Volatile
+ extend ::Concurrent::Synchronization::Volatile::ClassMethods
+
+ # Has to be called by children.
+ #
+ # @return [Object] a new instance of Object
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#28
+ def initialize; end
+
+ private
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#146
+ def __initialize_atomic_fields__; end
+
+ class << self
+ # @return [true, false] is the attribute with name atomic?
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#125
+ def atomic_attribute?(name); end
+
+ # @param inherited [true, false] should inherited volatile with CAS fields be returned?
+ # @return [::Array] Returns defined volatile with CAS fields on this class.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#119
+ def atomic_attributes(inherited = T.unsafe(nil)); end
+
+ # Creates methods for reading and writing to a instance variable with
+ # volatile (Java) semantic as {.attr_volatile} does.
+ # The instance variable should be accessed only through generated methods.
+ # This method generates following methods: `value`, `value=(new_value) #=> new_value`,
+ # `swap_value(new_value) #=> old_value`,
+ # `compare_and_set_value(expected, value) #=> true || false`, `update_value(&block)`.
+ #
+ # @param names [::Array] of the instance variables to be volatile with CAS.
+ # @return [::Array] names of defined method names.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#84
+ def attr_atomic(*names); end
+
+ # For testing purposes, quite slow. Injects assert code to new method which will raise if class instance contains
+ # any instance variables with CamelCase names and isn't {.safe_initialization?}.
+ #
+ # @raise when offend found
+ # @return [true]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#45
+ def ensure_safe_initialization_when_final_fields_are_present; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#33
+ def safe_initialization!; end
+
+ # @return [Boolean]
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#37
+ def safe_initialization?; end
+
+ private
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#131
+ def define_initialize_atomic_fields; end
+ end
+end
+
+# By extending this module, a class and all its children are marked to be constructed safely. Meaning that
+# all writes (ivar initializations) are made visible to all readers of newly constructed object. It ensures
+# same behaviour as Java's final fields.
+#
+# Due to using Kernel#extend, the module is not included again if already present in the ancestors,
+# which avoids extra overhead.
+#
+# @example
+# class AClass < Concurrent::Synchronization::Object
+# extend Concurrent::Synchronization::SafeInitialization
+#
+# def initialize
+# @AFinalValue = 'value' # published safely, #foo will never return nil
+# end
+#
+# def foo
+# @AFinalValue
+# end
+# end
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb#28
+module Concurrent::Synchronization::SafeInitialization
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb#29
+ def new(*args, &block); end
+end
+
+# Volatile adds the attr_volatile class method when included.
+#
+# foo = Foo.new
+# foo.bar
+# => 1
+# foo.bar = 2
+# => 2
+#
+# @example
+# class Foo
+# include Concurrent::Synchronization::Volatile
+#
+# attr_volatile :bar
+#
+# def initialize
+# self.bar = 1
+# end
+# end
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#28
+module Concurrent::Synchronization::Volatile
+ mixes_in_class_methods ::Concurrent::Synchronization::Volatile::ClassMethods
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#33
+ def full_memory_barrier; end
+
+ class << self
+ # @private
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#29
+ def included(base); end
+ end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#37
+module Concurrent::Synchronization::Volatile::ClassMethods
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#39
+ def attr_volatile(*names); end
+end
+
+# This class provides a trivial way to synchronize all calls to a given object
+# by wrapping it with a `Delegator` that performs `Monitor#enter/exit` calls
+# around the delegated `#send`. Example:
+#
+# array = [] # not thread-safe on many impls
+# array = SynchronizedDelegator.new([]) # thread-safe
+#
+# A simple `Monitor` provides a very coarse-grained way to synchronize a given
+# object, in that it will cause synchronization for methods that have no need
+# for it, but this is a trivial way to get thread-safety where none may exist
+# currently on some implementations.
+#
+# This class is currently being considered for inclusion into stdlib, via
+# https://bugs.ruby-lang.org/issues/8556
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#21
+class Concurrent::SynchronizedDelegator < ::SimpleDelegator
+ # @return [SynchronizedDelegator] a new instance of SynchronizedDelegator
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#31
+ def initialize(obj); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#36
+ def method_missing(method, *args, &block); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#22
+ def setup; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#27
+ def teardown; end
+end
+
+# A `TVar` is a transactional variable - a single-element container that
+# is used as part of a transaction - see `Concurrent::atomically`.
+#
+#
+# ## Thread-safe Variable Classes
+#
+# Each of the thread-safe variable classes is designed to solve a different
+# problem. In general:
+#
+# * *{Concurrent::Agent}:* Shared, mutable variable providing independent,
+# uncoordinated, *asynchronous* change of individual values. Best used when
+# the value will undergo frequent, complex updates. Suitable when the result
+# of an update does not need to be known immediately.
+# * *{Concurrent::Atom}:* Shared, mutable variable providing independent,
+# uncoordinated, *synchronous* change of individual values. Best used when
+# the value will undergo frequent reads but only occasional, though complex,
+# updates. Suitable when the result of an update must be known immediately.
+# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated
+# atomically. Updates are synchronous but fast. Best used when updates a
+# simple set operations. Not suitable when updates are complex.
+# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar
+# but optimized for the given data type.
+# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used
+# when two or more threads need to exchange data. The threads will pair then
+# block on each other until the exchange is complete.
+# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread
+# must give a value to another, which must take the value. The threads will
+# block on each other until the exchange is complete.
+# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which
+# holds a different value for each thread which has access. Often used as
+# an instance variable in objects which must maintain different state
+# for different threads.
+# * *{Concurrent::TVar}:* Shared, mutable variables which provide
+# *coordinated*, *synchronous*, change of *many* stated. Used when multiple
+# value must change together, in an all-or-nothing transaction.
+# {include:file:docs-source/tvar.md}
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#12
+class Concurrent::TVar < ::Concurrent::Synchronization::Object
+ extend ::Concurrent::Synchronization::SafeInitialization
+
+ # Create a new `TVar` with an initial value.
+ #
+ # @return [TVar] a new instance of TVar
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#16
+ def initialize(value); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#46
+ def unsafe_lock; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#36
+ def unsafe_value; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#41
+ def unsafe_value=(value); end
+
+ # Get the value of a `TVar`.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#22
+ def value; end
+
+ # Set the value of a `TVar`.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#29
+ def value=(value); end
+end
+
+# A `ThreadLocalVar` is a variable where the value is different for each thread.
+# Each variable may have a default value, but when you modify the variable only
+# the current thread will ever see that change.
+#
+# This is similar to Ruby's built-in thread-local variables (`Thread#thread_variable_get`),
+# but with these major advantages:
+# * `ThreadLocalVar` has its own identity, it doesn't need a Symbol.
+# * Each Ruby's built-in thread-local variable leaks some memory forever (it's a Symbol held forever on the thread),
+# so it's only OK to create a small amount of them.
+# `ThreadLocalVar` has no such issue and it is fine to create many of them.
+# * Ruby's built-in thread-local variables leak forever the value set on each thread (unless set to nil explicitly).
+# `ThreadLocalVar` automatically removes the mapping for each thread once the `ThreadLocalVar` instance is GC'd.
+#
+#
+# ## Thread-safe Variable Classes
+#
+# Each of the thread-safe variable classes is designed to solve a different
+# problem. In general:
+#
+# * *{Concurrent::Agent}:* Shared, mutable variable providing independent,
+# uncoordinated, *asynchronous* change of individual values. Best used when
+# the value will undergo frequent, complex updates. Suitable when the result
+# of an update does not need to be known immediately.
+# * *{Concurrent::Atom}:* Shared, mutable variable providing independent,
+# uncoordinated, *synchronous* change of individual values. Best used when
+# the value will undergo frequent reads but only occasional, though complex,
+# updates. Suitable when the result of an update must be known immediately.
+# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated
+# atomically. Updates are synchronous but fast. Best used when updates a
+# simple set operations. Not suitable when updates are complex.
+# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar
+# but optimized for the given data type.
+# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used
+# when two or more threads need to exchange data. The threads will pair then
+# block on each other until the exchange is complete.
+# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread
+# must give a value to another, which must take the value. The threads will
+# block on each other until the exchange is complete.
+# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which
+# holds a different value for each thread which has access. Often used as
+# an instance variable in objects which must maintain different state
+# for different threads.
+# * *{Concurrent::TVar}:* Shared, mutable variables which provide
+# *coordinated*, *synchronous*, change of *many* stated. Used when multiple
+# value must change together, in an all-or-nothing transaction.
+#
+# @example
+# v = ThreadLocalVar.new(14)
+# v.value #=> 14
+# v.value = 2
+# v.value #=> 2
+# @example
+# v = ThreadLocalVar.new(14)
+#
+# t1 = Thread.new do
+# v.value #=> 14
+# v.value = 1
+# v.value #=> 1
+# end
+#
+# t2 = Thread.new do
+# v.value #=> 14
+# v.value = 2
+# v.value #=> 2
+# end
+#
+# v.value #=> 14
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#43
+class Concurrent::ThreadLocalVar
+ # Creates a thread local variable.
+ #
+ # @param default [Object] the default value when otherwise unset
+ # @param default_block [Proc] Optional block that gets called to obtain the
+ # default value for each thread
+ # @return [ThreadLocalVar] a new instance of ThreadLocalVar
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#51
+ def initialize(default = T.unsafe(nil), &default_block); end
+
+ # Bind the given value to thread local storage during
+ # execution of the given block.
+ #
+ # @param value [Object] the value to bind
+ # @return [Object] the value
+ # @yield the operation to be performed with the bound variable
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#88
+ def bind(value); end
+
+ # Returns the value in the current thread's copy of this thread-local variable.
+ #
+ # @return [Object] the current value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#70
+ def value; end
+
+ # Sets the current thread's copy of this thread-local variable to the specified value.
+ #
+ # @param value [Object] the value to set
+ # @return [Object] the new value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#78
+ def value=(value); end
+
+ protected
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#103
+ def default; end
+end
+
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#44
+Concurrent::ThreadLocalVar::LOCALS = T.let(T.unsafe(nil), Concurrent::ThreadLocals)
+
+# An array-backed storage of indexed variables per thread.
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#141
+class Concurrent::ThreadLocals < ::Concurrent::AbstractLocals
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#142
+ def locals; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#146
+ def locals!; end
+end
+
+# An abstraction composed of one or more threads and a task queue. Tasks
+# (blocks or `proc` objects) are submitted to the pool and added to the queue.
+# The threads in the pool remove the tasks and execute them in the order
+# they were received.
+#
+# A `ThreadPoolExecutor` will automatically adjust the pool size according
+# to the bounds set by `min-threads` and `max-threads`. When a new task is
+# submitted and fewer than `min-threads` threads are running, a new thread
+# is created to handle the request, even if other worker threads are idle.
+# If there are more than `min-threads` but less than `max-threads` threads
+# running, a new thread will be created only if the queue is full.
+#
+# Threads that are idle for too long will be garbage collected, down to the
+# configured minimum options. Should a thread crash it, too, will be garbage collected.
+#
+# `ThreadPoolExecutor` is based on the Java class of the same name. From
+# the official Java documentation;
+#
+# > Thread pools address two different problems: they usually provide
+# > improved performance when executing large numbers of asynchronous tasks,
+# > due to reduced per-task invocation overhead, and they provide a means
+# > of bounding and managing the resources, including threads, consumed
+# > when executing a collection of tasks. Each ThreadPoolExecutor also
+# > maintains some basic statistics, such as the number of completed tasks.
+# >
+# > To be useful across a wide range of contexts, this class provides many
+# > adjustable parameters and extensibility hooks. However, programmers are
+# > urged to use the more convenient Executors factory methods
+# > [CachedThreadPool] (unbounded thread pool, with automatic thread reclamation),
+# > [FixedThreadPool] (fixed size thread pool) and [SingleThreadExecutor] (single
+# > background thread), that preconfigure settings for the most common usage
+# > scenarios.
+#
+# **Thread Pool Options**
+#
+# Thread pools support several configuration options:
+#
+# * `idletime`: The number of seconds that a thread may be idle before being reclaimed.
+# * `name`: The name of the executor (optional). Printed in the executor's `#to_s` output and
+# a `-worker-` name is given to its threads if supported by used Ruby
+# implementation. `` is uniq for each thread.
+# * `max_queue`: The maximum number of tasks that may be waiting in the work queue at
+# any one time. When the queue size reaches `max_queue` and no new threads can be created,
+# subsequent tasks will be rejected in accordance with the configured `fallback_policy`.
+# * `auto_terminate`: When true (default), the threads started will be marked as daemon.
+# * `fallback_policy`: The policy defining how rejected tasks are handled.
+#
+# Three fallback policies are supported:
+#
+# * `:abort`: Raise a `RejectedExecutionError` exception and discard the task.
+# * `:discard`: Discard the task and return false.
+# * `:caller_runs`: Execute the task on the calling thread.
+#
+# **Shutting Down Thread Pools**
+#
+# Killing a thread pool while tasks are still being processed, either by calling
+# the `#kill` method or at application exit, will have unpredictable results. There
+# is no way for the thread pool to know what resources are being used by the
+# in-progress tasks. When those tasks are killed the impact on those resources
+# cannot be predicted. The *best* practice is to explicitly shutdown all thread
+# pools using the provided methods:
+#
+# * Call `#shutdown` to initiate an orderly termination of all in-progress tasks
+# * Call `#wait_for_termination` with an appropriate timeout interval an allow
+# the orderly shutdown to complete
+# * Call `#kill` *only when* the thread pool fails to shutdown in the allotted time
+#
+# On some runtime platforms (most notably the JVM) the application will not
+# exit until all thread pools have been shutdown. To prevent applications from
+# "hanging" on exit, all threads can be marked as daemon according to the
+# `:auto_terminate` option.
+#
+# ```ruby
+# pool1 = Concurrent::FixedThreadPool.new(5) # threads will be marked as daemon
+# pool2 = Concurrent::FixedThreadPool.new(5, auto_terminate: false) # mark threads as non-daemon
+# ```
+#
+# @note Failure to properly shutdown a thread pool can lead to unpredictable results.
+# Please read *Shutting Down Thread Pools* for more information.
+# @see http://docs.oracle.com/javase/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 http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html Java Tutorials: Thread Pools
+# @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 args [Array] the arguments passed to the task on execution.
+ # @param delay [Float] the number of seconds to wait for before executing the task.
+ # @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/timer_set.rb#67
+ 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#75
+ def ns_initialize(opts); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#95
+ def ns_post_task(task); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#132
+ def ns_reset_if_forked; end
+
+ # `ExecutorService` callback called during shutdown.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#123
+ def ns_shutdown_execution; end
+
+ # Post the task to the internal queue.
+ #
+ # @note This is intended as a callback method from ScheduledTask
+ # only. It is not intended to be used directly. Post a task
+ # by using the `SchedulesTask#execute` method.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#90
+ def post_task(task); end
+
+ # Run a loop and execute tasks in the scheduled order and at the approximate
+ # scheduled time. If no tasks remain the thread will exit gracefully so that
+ # garbage collection can occur. If there are no ready tasks it will sleep
+ # for up to 60 seconds waiting for the next scheduled task.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#146
+ def process_tasks; end
+
+ # Remove the given task from the queue.
+ #
+ # @note This is intended as a callback method from `ScheduledTask`
+ # only. It is not intended to be used directly. Cancel a task
+ # by using the `ScheduledTask#cancel` method.
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#116
+ def remove_task(task); end
+end
+
+# A very common concurrency pattern is to run a thread that performs a task at
+# regular intervals. The thread that performs the task sleeps for the given
+# interval then wakes up and performs the task. Lather, rinse, repeat... This
+# pattern causes two problems. First, it is difficult to test the business
+# logic of the task because the task itself is tightly coupled with the
+# concurrency logic. Second, an exception raised while performing the task can
+# cause the entire thread to abend. In a long-running application where the
+# task thread is intended to run for days/weeks/years a crashed task thread
+# can pose a significant problem. `TimerTask` alleviates both problems.
+#
+# When a `TimerTask` is launched it starts a thread for monitoring the
+# execution interval. The `TimerTask` thread does not perform the task,
+# however. Instead, the TimerTask launches the task on a separate thread.
+# Should the task experience an unrecoverable crash only the task thread will
+# crash. This makes the `TimerTask` very fault tolerant. Additionally, the
+# `TimerTask` thread can respond to the success or failure of the task,
+# performing logging or ancillary operations.
+#
+# One other advantage of `TimerTask` is that it forces the business logic to
+# be completely decoupled from the concurrency logic. The business logic can
+# be tested separately then passed to the `TimerTask` for scheduling and
+# running.
+#
+# A `TimerTask` supports two different types of interval calculations.
+# A fixed delay will always wait the same amount of time between the
+# completion of one task and the start of the next. A fixed rate will
+# attempt to maintain a constant rate of execution regardless of the
+# duration of the task. For example, if a fixed rate task is scheduled
+# to run every 60 seconds but the task itself takes 10 seconds to
+# complete, the next task will be scheduled to run 50 seconds after
+# the start of the previous task. If the task takes 70 seconds to
+# complete, the next task will be start immediately after the previous
+# task completes. Tasks will not be executed concurrently.
+#
+# In some cases it may be necessary for a `TimerTask` to affect its own
+# execution cycle. To facilitate this, a reference to the TimerTask instance
+# is passed as an argument to the provided block every time the task is
+# executed.
+#
+# The `TimerTask` class includes the `Dereferenceable` mixin module so the
+# result of the last execution is always available via the `#value` method.
+# Dereferencing options can be passed to the `TimerTask` during construction or
+# at any later time using the `#set_deref_options` method.
+#
+# `TimerTask` supports notification through the Ruby standard library
+# {http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html
+# Observable} module. On execution the `TimerTask` will notify the observers
+# with three arguments: time of execution, the result of the block (or nil on
+# failure), and any raised exceptions (or nil on success).
+#
+# @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 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 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 Immediate execution with `:run_now`
+# task = Concurrent::TimerTask.new(run_now: true){ puts 'Boom!' }
+# task.execute
+#
+# #=> 'Boom!'
+# @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 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://docs.oracle.com/javase/7/docs/api/java/util/TimerTask.html
+# @see http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#166
+class Concurrent::TimerTask < ::Concurrent::RubyExecutorService
+ include ::Concurrent::Concern::Dereferenceable
+ include ::Concurrent::Concern::Observable
+
+ # Create a new TimerTask with the given task and configuration.
+ #
+ # @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#210
+ def initialize(opts = T.unsafe(nil), &task); end
+
+ # Execute a previously created `TimerTask`.
+ #
+ # @example Instance and execute in one line
+ # task = Concurrent::TimerTask.new(execution_interval: 10){ print "Hello World\n" }.execute
+ # task.running? #=> true
+ # @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
+ # @return [TimerTask] a reference to `self`
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#236
+ 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#261
+ 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#268
+ def execution_interval=(value); end
+
+ # @return [Symbol] method to calculate the interval between executions
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#278
+ def interval_type; end
+
+ # Is the executor running?
+ #
+ # @return [Boolean] `true` when running, `false` when shutting down or shutdown
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#219
+ 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#283
+ 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#290
+ def timeout_interval=(value); end
+
+ private
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#294
+ def <<(task); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#357
+ def calculate_next_interval(start_time); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#339
+ def execute_task(completion, age_when_scheduled); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#298
+ def ns_initialize(opts, &task); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#327
+ def ns_kill_execution; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#321
+ def ns_shutdown_execution; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#294
+ def post(*args, &task); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#333
+ def schedule_next_task(interval = T.unsafe(nil)); end
+
+ class << self
+ # Create and execute a new `TimerTask`.
+ #
+ # @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#254
+ def execute(opts = T.unsafe(nil), &task); end
+ end
+end
+
+# Default `:interval_type`
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#182
+Concurrent::TimerTask::DEFAULT_INTERVAL_TYPE = T.let(T.unsafe(nil), Symbol)
+
+# Default `:execution_interval` in seconds.
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#171
+Concurrent::TimerTask::EXECUTION_INTERVAL = T.let(T.unsafe(nil), Integer)
+
+# Maintain the interval between the end of one execution and the start of the next execution.
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#174
+Concurrent::TimerTask::FIXED_DELAY = T.let(T.unsafe(nil), Symbol)
+
+# Maintain the interval between the start of one execution and the start of the next.
+# If execution time exceeds the interval, the next execution will start immediately
+# after the previous execution finishes. Executions will not run concurrently.
+#
+# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#179
+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
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157
+ def modified; end
+
+ # Sets the attribute modified
+ #
+ # @param value [Object] the value to set the attribute modified to.
+ # @return [Object] the newly set value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157
+ def modified=(_); end
+
+ # Returns the value of attribute value
+ #
+ # @return [Object] the current value of value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157
+ def value; end
+
+ # Sets the attribute value
+ #
+ # @param value [Object] the value to set the attribute value to.
+ # @return [Object] the newly set value
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157
+ def value=(_); end
+
+ class << self
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157
+ def [](*_arg0); end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157
+ def inspect; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157
+ def keyword_init?; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157
+ def members; end
+
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157
+ def new(*_arg0); end
+ end
+end
+
+# A fixed size array with volatile (synchronized, thread safe) getters/setters.
+# Mixes in Ruby's `Enumerable` module for enhanced search, sort, and traversal.
+#
+# @example
+# tuple = Concurrent::Tuple.new(16)
+#
+# tuple.set(0, :foo) #=> :foo | volatile write
+# tuple.get(0) #=> :foo | volatile read
+# tuple.compare_and_set(0, :foo, :bar) #=> true | strong CAS
+# tuple.cas(0, :foo, :baz) #=> false | strong CAS
+# tuple.get(0) #=> :bar | volatile read
+# @see http://ruby-doc.org/core-2.2.2/Enumerable.html Enumerable
+# @see http://www.erlang.org/doc/reference_manual/data_types.html#id70396 Erlang Tuple
+# @see https://en.wikipedia.org/wiki/Tuple Tuple entry at Wikipedia
+#
+# 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 new_value [Object] the value to set at the given index
+ # @param old_value [Object] the value to compare against the current value
+ # @return [Boolean] true if the value at the given element was set else false
+ #
+ # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#73
+ def cas(i, old_value, new_value); end
+
+ # Set the value at the given index to the new value if and only if the current
+ # value matches the given old value.
+ #
+ # @param i [Integer] the index for the element to set
+ # @param new_value [Object] the value to set at the given index
+ # @param old_value [Object] the value to compare against the current value
+ # @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#47
+ 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#59
+ 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@3.0.2.rbi b/sorbet/rbi/gems/connection_pool@3.0.2.rbi
new file mode 100644
index 0000000..3d9f595
--- /dev/null
+++ b/sorbet/rbi/gems/connection_pool@3.0.2.rbi
@@ -0,0 +1,9 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `connection_pool` gem.
+# Please instead update this file by running `bin/tapioca gem connection_pool`.
+
+
+# THIS IS AN EMPTY RBI FILE.
+# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
diff --git a/sorbet/rbi/gems/constant_resolver@0.2.0.rbi b/sorbet/rbi/gems/constant_resolver@0.2.0.rbi
deleted file mode 100644
index 4fc1ad1..0000000
--- a/sorbet/rbi/gems/constant_resolver@0.2.0.rbi
+++ /dev/null
@@ -1,30 +0,0 @@
-# typed: true
-
-# DO NOT EDIT MANUALLY
-# This is an autogenerated file for types exported from the `constant_resolver` gem.
-# Please instead update this file by running `bin/tapioca gem constant_resolver`.
-
-class ConstantResolver
- def initialize(root_path:, load_paths:, inflector: T.unsafe(nil)); end
-
- def config; end
- def file_map; end
- def resolve(const_name, current_namespace_path: T.unsafe(nil)); end
-
- private
-
- def ambiguous_constant_message(const_name, paths); end
- def coerce_load_paths(load_paths); end
- def glob_path(path); end
- def resolve_constant(const_name, current_namespace_path, original_name: T.unsafe(nil)); end
- def resolve_traversing_namespace_path(const_name, current_namespace_path); end
-end
-
-class ConstantResolver::ConstantContext < ::Struct; end
-
-class ConstantResolver::DefaultInflector
- def camelize(string); end
-end
-
-class ConstantResolver::Error < ::StandardError; end
-ConstantResolver::VERSION = T.let(T.unsafe(nil), String)
diff --git a/sorbet/rbi/gems/constant_resolver@0.3.0.rbi b/sorbet/rbi/gems/constant_resolver@0.3.0.rbi
new file mode 100644
index 0000000..a80924e
--- /dev/null
+++ b/sorbet/rbi/gems/constant_resolver@0.3.0.rbi
@@ -0,0 +1,100 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `constant_resolver` gem.
+# Please instead update this file by running `bin/tapioca gem constant_resolver`.
+
+
+# Get information about (partially qualified) constants without loading the application code.
+# We infer the fully qualified name and the filepath.
+#
+# The implementation makes a few assumptions about the code base:
+# - `Something::SomeOtherThing` is defined in a path of either `something/some_other_thing.rb` or `something.rb`,
+# relative to the load path. Constants that have their own file do not have all-uppercase names like MAGIC_NUMBER or
+# all-uppercase parts like SomeID. Rails' `zeitwerk` autoloader makes the same assumption.
+# - It is OK to not always infer the exact file defining the constant. For example, when a constant is inherited, we
+# have no way of inferring the file it is defined in. You could argue though that inheritance means that another
+# constant with the same name exists in the inheriting class, and this view is sufficient for all our use cases.
+#
+# source://constant_resolver//lib/constant_resolver/version.rb#3
+class ConstantResolver
+ # @example usage in a Rails app
+ # config = Rails.application.config
+ # load_paths = (config.eager_load_paths + config.autoload_paths + config.autoload_once_paths)
+ # .map { |p| Pathname.new(p).relative_path_from(Rails.root).to_s }
+ # ConstantResolver.new(
+ # root_path: Rails.root.to_s,
+ # load_paths: load_paths
+ # )
+ # @param exclude [Array] Paths to exclude to scan for constants.
+ # @param inflector [Object] Any object that implements a `camelize` function.
+ # @param load_paths [Array] The autoload paths of the application.
+ # @param root_path [String] The root path of the application to analyze
+ # @return [ConstantResolver] a new instance of ConstantResolver
+ #
+ # source://constant_resolver//lib/constant_resolver.rb#46
+ def initialize(root_path:, load_paths:, exclude: T.unsafe(nil), inflector: T.unsafe(nil)); end
+
+ # @api private
+ #
+ # source://constant_resolver//lib/constant_resolver.rb#122
+ def config; end
+
+ # Maps constant names to file paths.
+ #
+ # @return [Hash]
+ #
+ # source://constant_resolver//lib/constant_resolver.rb#78
+ def file_map; end
+
+ # Resolve a constant via its name.
+ # If the name is partially qualified, we need the current namespace path to correctly infer its full name
+ #
+ # @param const_name [String] The constant's name, fully or partially qualified.
+ # @param current_namespace_path [Array] (optional) The namespace of the context in which the constant is
+ # used, e.g. ["Apps", "Models"] for `Apps::Models`. Defaults to [] which means top level.
+ # @return [ConstantResolver::ConstantContext]
+ #
+ # source://constant_resolver//lib/constant_resolver.rb#63
+ def resolve(const_name, current_namespace_path: T.unsafe(nil)); end
+
+ private
+
+ # @return [Boolean]
+ #
+ # source://constant_resolver//lib/constant_resolver.rb#131
+ def allowed?(path); end
+
+ # source://constant_resolver//lib/constant_resolver.rb#144
+ def ambiguous_constant_message(const_name, paths); end
+
+ # source://constant_resolver//lib/constant_resolver.rb#135
+ def coerce_load_paths(load_paths); end
+
+ # source://constant_resolver//lib/constant_resolver.rb#151
+ def glob_path(path); end
+
+ # source://constant_resolver//lib/constant_resolver.rb#155
+ def resolve_constant(const_name, current_namespace_path, original_name: T.unsafe(nil)); end
+
+ # source://constant_resolver//lib/constant_resolver.rb#168
+ def resolve_traversing_namespace_path(const_name, current_namespace_path); end
+end
+
+# source://constant_resolver//lib/constant_resolver.rb#19
+class ConstantResolver::ConstantContext < ::Struct; end
+
+# source://constant_resolver//lib/constant_resolver.rb#21
+class ConstantResolver::DefaultInflector
+ # source://constant_resolver//lib/constant_resolver.rb#22
+ def camelize(string); end
+end
+
+# source://constant_resolver//lib/constant_resolver.rb#18
+class ConstantResolver::Error < ::StandardError; end
+
+# source://constant_resolver//lib/constant_resolver.rb#16
+ConstantResolver::RUBY_FILES_GLOB = T.let(T.unsafe(nil), String)
+
+# source://constant_resolver//lib/constant_resolver/version.rb#4
+ConstantResolver::VERSION = T.let(T.unsafe(nil), String)
diff --git a/sorbet/rbi/gems/crass@1.0.6.rbi b/sorbet/rbi/gems/crass@1.0.6.rbi
new file mode 100644
index 0000000..0979e2f
--- /dev/null
+++ b/sorbet/rbi/gems/crass@1.0.6.rbi
@@ -0,0 +1,623 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `crass` gem.
+# Please instead update this file by running `bin/tapioca gem crass`.
+
+
+# A CSS parser based on the CSS Syntax Module Level 3 spec.
+#
+# source://crass//lib/crass/token-scanner.rb#3
+module Crass
+ class << self
+ # Parses _input_ as a CSS stylesheet and returns a parse tree.
+ #
+ # See {Tokenizer#initialize} for _options_.
+ #
+ # source://crass//lib/crass.rb#10
+ def parse(input, options = T.unsafe(nil)); end
+
+ # Parses _input_ as a string of CSS properties (such as the contents of an
+ # HTML element's `style` attribute) and returns a parse tree.
+ #
+ # See {Tokenizer#initialize} for _options_.
+ #
+ # source://crass//lib/crass.rb#18
+ def parse_properties(input, options = T.unsafe(nil)); end
+ end
+end
+
+# Parses a CSS string or list of tokens.
+#
+# 5. http://dev.w3.org/csswg/css-syntax/#parsing
+#
+# source://crass//lib/crass/parser.rb#10
+class Crass::Parser
+ # Initializes a parser based on the given _input_, which may be a CSS string
+ # or an array of tokens.
+ #
+ # See {Tokenizer#initialize} for _options_.
+ #
+ # @return [Parser] a new instance of Parser
+ #
+ # source://crass//lib/crass/parser.rb#126
+ def initialize(input, options = T.unsafe(nil)); end
+
+ # Consumes an at-rule and returns it.
+ #
+ # 5.4.2. http://dev.w3.org/csswg/css-syntax-3/#consume-at-rule
+ #
+ # source://crass//lib/crass/parser.rb#137
+ def consume_at_rule(input = T.unsafe(nil)); end
+
+ # Consumes a component value and returns it, or `nil` if there are no more
+ # tokens.
+ #
+ # 5.4.6. http://dev.w3.org/csswg/css-syntax-3/#consume-a-component-value
+ #
+ # source://crass//lib/crass/parser.rb#184
+ def consume_component_value(input = T.unsafe(nil)); end
+
+ # Consumes a declaration and returns it, or `nil` on parse error.
+ #
+ # 5.4.5. http://dev.w3.org/csswg/css-syntax-3/#consume-a-declaration
+ #
+ # source://crass//lib/crass/parser.rb#209
+ def consume_declaration(input = T.unsafe(nil)); end
+
+ # Consumes a list of declarations and returns them.
+ #
+ # By default, the returned list may include `:comment`, `:semicolon`, and
+ # `:whitespace` nodes, which is non-standard.
+ #
+ # Options:
+ #
+ # * **:strict** - Set to `true` to exclude non-standard `:comment`,
+ # `:semicolon`, and `:whitespace` nodes.
+ #
+ # 5.4.4. http://dev.w3.org/csswg/css-syntax/#consume-a-list-of-declarations
+ #
+ # source://crass//lib/crass/parser.rb#276
+ def consume_declarations(input = T.unsafe(nil), options = T.unsafe(nil)); end
+
+ # Consumes a function and returns it.
+ #
+ # 5.4.8. http://dev.w3.org/csswg/css-syntax-3/#consume-a-function
+ #
+ # source://crass//lib/crass/parser.rb#326
+ def consume_function(input = T.unsafe(nil)); end
+
+ # Consumes a qualified rule and returns it, or `nil` if a parse error
+ # occurs.
+ #
+ # 5.4.3. http://dev.w3.org/csswg/css-syntax-3/#consume-a-qualified-rule
+ #
+ # source://crass//lib/crass/parser.rb#357
+ def consume_qualified_rule(input = T.unsafe(nil)); end
+
+ # Consumes a list of rules and returns them.
+ #
+ # 5.4.1. http://dev.w3.org/csswg/css-syntax/#consume-a-list-of-rules
+ #
+ # source://crass//lib/crass/parser.rb#398
+ def consume_rules(flags = T.unsafe(nil)); end
+
+ # Consumes and returns a simple block associated with the current input
+ # token.
+ #
+ # 5.4.7. http://dev.w3.org/csswg/css-syntax/#consume-a-simple-block
+ #
+ # source://crass//lib/crass/parser.rb#434
+ def consume_simple_block(input = T.unsafe(nil)); end
+
+ # Creates and returns a new parse node with the given _properties_.
+ #
+ # source://crass//lib/crass/parser.rb#458
+ def create_node(type, properties = T.unsafe(nil)); end
+
+ # Parses the given _input_ tokens into a selector node and returns it.
+ #
+ # Doesn't bother splitting the selector list into individual selectors or
+ # validating them. Feel free to do that yourself! It'll be fun!
+ #
+ # source://crass//lib/crass/parser.rb#466
+ def create_selector(input); end
+
+ # Creates a `:style_rule` node from the given qualified _rule_, and returns
+ # it.
+ #
+ # source://crass//lib/crass/parser.rb#474
+ def create_style_rule(rule); end
+
+ # Parses a single component value and returns it.
+ #
+ # 5.3.7. http://dev.w3.org/csswg/css-syntax-3/#parse-a-component-value
+ #
+ # source://crass//lib/crass/parser.rb#483
+ def parse_component_value(input = T.unsafe(nil)); end
+
+ # Parses a list of component values and returns an array of parsed tokens.
+ #
+ # 5.3.8. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-component-values
+ #
+ # source://crass//lib/crass/parser.rb#510
+ def parse_component_values(input = T.unsafe(nil)); end
+
+ # Parses a single declaration and returns it.
+ #
+ # 5.3.5. http://dev.w3.org/csswg/css-syntax/#parse-a-declaration
+ #
+ # source://crass//lib/crass/parser.rb#524
+ def parse_declaration(input = T.unsafe(nil)); end
+
+ # Parses a list of declarations and returns them.
+ #
+ # See {#consume_declarations} for _options_.
+ #
+ # 5.3.6. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-declarations
+ #
+ # source://crass//lib/crass/parser.rb#552
+ def parse_declarations(input = T.unsafe(nil), options = T.unsafe(nil)); end
+
+ # Parses a list of declarations and returns an array of `:property` nodes
+ # (and any non-declaration nodes that were in the input). This is useful for
+ # parsing the contents of an HTML element's `style` attribute.
+ #
+ # source://crass//lib/crass/parser.rb#560
+ def parse_properties(input = T.unsafe(nil)); end
+
+ # Parses a single rule and returns it.
+ #
+ # 5.3.4. http://dev.w3.org/csswg/css-syntax-3/#parse-a-rule
+ #
+ # source://crass//lib/crass/parser.rb#586
+ def parse_rule(input = T.unsafe(nil)); end
+
+ # Returns the unescaped value of a selector name or property declaration.
+ #
+ # source://crass//lib/crass/parser.rb#615
+ def parse_value(nodes); end
+
+ # {TokenScanner} wrapping the tokens generated from this parser's input.
+ #
+ # source://crass//lib/crass/parser.rb#120
+ def tokens; end
+
+ class << self
+ # Parses CSS properties (such as the contents of an HTML element's `style`
+ # attribute) and returns a parse tree.
+ #
+ # See {Tokenizer#initialize} for _options_.
+ #
+ # 5.3.6. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-declarations
+ #
+ # source://crass//lib/crass/parser.rb#25
+ def parse_properties(input, options = T.unsafe(nil)); end
+
+ # Parses CSS rules (such as the content of a `@media` block) and returns a
+ # parse tree. The only difference from {parse_stylesheet} is that CDO/CDC
+ # nodes (``) aren't ignored.
+ #
+ # See {Tokenizer#initialize} for _options_.
+ #
+ # 5.3.3. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-rules
+ #
+ # source://crass//lib/crass/parser.rb#36
+ def parse_rules(input, options = T.unsafe(nil)); end
+
+ # Parses a CSS stylesheet and returns a parse tree.
+ #
+ # See {Tokenizer#initialize} for _options_.
+ #
+ # 5.3.2. http://dev.w3.org/csswg/css-syntax/#parse-a-stylesheet
+ #
+ # source://crass//lib/crass/parser.rb#54
+ def parse_stylesheet(input, options = T.unsafe(nil)); end
+
+ # Converts a node or array of nodes into a CSS string based on their
+ # original tokenized input.
+ #
+ # Options:
+ #
+ # * **:exclude_comments** - When `true`, comments will be excluded.
+ #
+ # source://crass//lib/crass/parser.rb#74
+ def stringify(nodes, options = T.unsafe(nil)); end
+ end
+end
+
+# source://crass//lib/crass/parser.rb#11
+Crass::Parser::BLOCK_END_TOKENS = T.let(T.unsafe(nil), Hash)
+
+# Similar to a StringScanner, but with extra functionality needed to tokenize
+# CSS while preserving the original text.
+#
+# source://crass//lib/crass/scanner.rb#8
+class Crass::Scanner
+ # Creates a Scanner instance for the given _input_ string or IO instance.
+ #
+ # @return [Scanner] a new instance of Scanner
+ #
+ # source://crass//lib/crass/scanner.rb#25
+ def initialize(input); end
+
+ # Consumes the next character and returns it, advancing the pointer, or
+ # an empty string if the end of the string has been reached.
+ #
+ # source://crass//lib/crass/scanner.rb#34
+ def consume; end
+
+ # Consumes the rest of the string and returns it, advancing the pointer to
+ # the end of the string. Returns an empty string is the end of the string
+ # has already been reached.
+ #
+ # source://crass//lib/crass/scanner.rb#46
+ def consume_rest; end
+
+ # Current character, or `nil` if the scanner hasn't yet consumed a
+ # character, or is at the end of the string.
+ #
+ # source://crass//lib/crass/scanner.rb#11
+ def current; end
+
+ # Returns `true` if the end of the string has been reached, `false`
+ # otherwise.
+ #
+ # @return [Boolean]
+ #
+ # source://crass//lib/crass/scanner.rb#57
+ def eos?; end
+
+ # Sets the marker to the position of the next character that will be
+ # consumed.
+ #
+ # source://crass//lib/crass/scanner.rb#63
+ def mark; end
+
+ # Returns the substring between {#marker} and {#pos}, without altering the
+ # pointer.
+ #
+ # source://crass//lib/crass/scanner.rb#69
+ def marked; end
+
+ # Current marker position. Use {#marked} to get the substring between
+ # {#marker} and {#pos}.
+ #
+ # source://crass//lib/crass/scanner.rb#15
+ def marker; end
+
+ # Current marker position. Use {#marked} to get the substring between
+ # {#marker} and {#pos}.
+ #
+ # source://crass//lib/crass/scanner.rb#15
+ def marker=(_arg0); end
+
+ # Returns up to _length_ characters starting at the current position, but
+ # doesn't consume them. The number of characters returned may be less than
+ # _length_ if the end of the string is reached.
+ #
+ # source://crass//lib/crass/scanner.rb#80
+ def peek(length = T.unsafe(nil)); end
+
+ # Position of the next character that will be consumed. This is a character
+ # position, not a byte position, so it accounts for multi-byte characters.
+ #
+ # source://crass//lib/crass/scanner.rb#19
+ def pos; end
+
+ # Position of the next character that will be consumed. This is a character
+ # position, not a byte position, so it accounts for multi-byte characters.
+ #
+ # source://crass//lib/crass/scanner.rb#19
+ def pos=(_arg0); end
+
+ # Moves the pointer back one character without changing the value of
+ # {#current}. The next call to {#consume} will re-consume the current
+ # character.
+ #
+ # source://crass//lib/crass/scanner.rb#87
+ def reconsume; end
+
+ # Resets the pointer to the beginning of the string.
+ #
+ # source://crass//lib/crass/scanner.rb#93
+ def reset; end
+
+ # Tries to match _pattern_ at the current position. If it matches, the
+ # matched substring will be returned and the pointer will be advanced.
+ # Otherwise, `nil` will be returned.
+ #
+ # source://crass//lib/crass/scanner.rb#103
+ def scan(pattern); end
+
+ # Scans the string until the _pattern_ is matched. Returns the substring up
+ # to and including the end of the match, and advances the pointer. If there
+ # is no match, `nil` is returned and the pointer is not advanced.
+ #
+ # source://crass//lib/crass/scanner.rb#115
+ def scan_until(pattern); end
+
+ # String being scanned.
+ #
+ # source://crass//lib/crass/scanner.rb#22
+ def string; end
+end
+
+# Like {Scanner}, but for tokens!
+#
+# source://crass//lib/crass/token-scanner.rb#6
+class Crass::TokenScanner
+ # @return [TokenScanner] a new instance of TokenScanner
+ #
+ # source://crass//lib/crass/token-scanner.rb#9
+ def initialize(tokens); end
+
+ # Executes the given block, collects all tokens that are consumed during its
+ # execution, and returns them.
+ #
+ # source://crass//lib/crass/token-scanner.rb#16
+ def collect; end
+
+ # Consumes the next token and returns it, advancing the pointer. Returns
+ # `nil` if there is no next token.
+ #
+ # source://crass//lib/crass/token-scanner.rb#24
+ def consume; end
+
+ # Returns the value of attribute current.
+ #
+ # source://crass//lib/crass/token-scanner.rb#7
+ def current; end
+
+ # Returns the next token without consuming it, or `nil` if there is no next
+ # token.
+ #
+ # source://crass//lib/crass/token-scanner.rb#32
+ def peek; end
+
+ # Returns the value of attribute pos.
+ #
+ # source://crass//lib/crass/token-scanner.rb#7
+ def pos; end
+
+ # Reconsumes the current token, moving the pointer back one position.
+ #
+ # http://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#reconsume-the-current-input-token
+ #
+ # source://crass//lib/crass/token-scanner.rb#39
+ def reconsume; end
+
+ # Resets the pointer to the first token in the list.
+ #
+ # source://crass//lib/crass/token-scanner.rb#44
+ def reset; end
+
+ # Returns the value of attribute tokens.
+ #
+ # source://crass//lib/crass/token-scanner.rb#7
+ def tokens; end
+end
+
+# Tokenizes a CSS string.
+#
+# 4. http://dev.w3.org/csswg/css-syntax/#tokenization
+#
+# source://crass//lib/crass/tokenizer.rb#9
+class Crass::Tokenizer
+ # Initializes a new Tokenizer.
+ #
+ # Options:
+ #
+ # * **:preserve_comments** - If `true`, comments will be preserved as
+ # `:comment` tokens.
+ #
+ # * **:preserve_hacks** - If `true`, certain non-standard browser hacks
+ # such as the IE "*" hack will be preserved even though they violate
+ # CSS 3 syntax rules.
+ #
+ # @return [Tokenizer] a new instance of Tokenizer
+ #
+ # source://crass//lib/crass/tokenizer.rb#62
+ def initialize(input, options = T.unsafe(nil)); end
+
+ # Consumes a token and returns the token that was consumed.
+ #
+ # 4.3.1. http://dev.w3.org/csswg/css-syntax/#consume-a-token
+ #
+ # source://crass//lib/crass/tokenizer.rb#70
+ def consume; end
+
+ # Consumes the remnants of a bad URL and returns the consumed text.
+ #
+ # 4.3.15. http://dev.w3.org/csswg/css-syntax/#consume-the-remnants-of-a-bad-url
+ #
+ # source://crass//lib/crass/tokenizer.rb#275
+ def consume_bad_url; end
+
+ # Consumes comments and returns them, or `nil` if no comments were consumed.
+ #
+ # 4.3.2. http://dev.w3.org/csswg/css-syntax/#consume-comments
+ #
+ # source://crass//lib/crass/tokenizer.rb#301
+ def consume_comments; end
+
+ # Consumes an escaped code point and returns its unescaped value.
+ #
+ # This method assumes that the `\` has already been consumed, and that the
+ # next character in the input has already been verified not to be a newline
+ # or EOF.
+ #
+ # 4.3.8. http://dev.w3.org/csswg/css-syntax/#consume-an-escaped-code-point
+ #
+ # source://crass//lib/crass/tokenizer.rb#326
+ def consume_escaped; end
+
+ # Consumes an ident-like token and returns it.
+ #
+ # 4.3.4. http://dev.w3.org/csswg/css-syntax/#consume-an-ident-like-token
+ #
+ # source://crass//lib/crass/tokenizer.rb#350
+ def consume_ident; end
+
+ # Consumes a name and returns it.
+ #
+ # 4.3.12. http://dev.w3.org/csswg/css-syntax/#consume-a-name
+ #
+ # source://crass//lib/crass/tokenizer.rb#375
+ def consume_name; end
+
+ # Consumes a number and returns a 3-element array containing the number's
+ # original representation, its numeric value, and its type (either
+ # `:integer` or `:number`).
+ #
+ # 4.3.13. http://dev.w3.org/csswg/css-syntax/#consume-a-number
+ #
+ # source://crass//lib/crass/tokenizer.rb#407
+ def consume_number; end
+
+ # Consumes a numeric token and returns it.
+ #
+ # 4.3.3. http://dev.w3.org/csswg/css-syntax/#consume-a-numeric-token
+ #
+ # source://crass//lib/crass/tokenizer.rb#430
+ def consume_numeric; end
+
+ # Consumes a string token that ends at the given character, and returns the
+ # token.
+ #
+ # 4.3.5. http://dev.w3.org/csswg/css-syntax/#consume-a-string-token
+ #
+ # source://crass//lib/crass/tokenizer.rb#469
+ def consume_string(ending = T.unsafe(nil)); end
+
+ # Consumes a Unicode range token and returns it. Assumes the initial "u+" or
+ # "U+" has already been consumed.
+ #
+ # 4.3.7. http://dev.w3.org/csswg/css-syntax/#consume-a-unicode-range-token
+ #
+ # source://crass//lib/crass/tokenizer.rb#510
+ def consume_unicode_range; end
+
+ # Consumes a URL token and returns it. Assumes the original "url(" has
+ # already been consumed.
+ #
+ # 4.3.6. http://dev.w3.org/csswg/css-syntax/#consume-a-url-token
+ #
+ # source://crass//lib/crass/tokenizer.rb#542
+ def consume_url; end
+
+ # Converts a valid CSS number string into a number and returns the number.
+ #
+ # 4.3.14. http://dev.w3.org/csswg/css-syntax/#convert-a-string-to-a-number
+ #
+ # source://crass//lib/crass/tokenizer.rb#590
+ def convert_string_to_number(str); end
+
+ # Creates and returns a new token with the given _properties_.
+ #
+ # source://crass//lib/crass/tokenizer.rb#616
+ def create_token(type, properties = T.unsafe(nil)); end
+
+ # Preprocesses _input_ to prepare it for the tokenizer.
+ #
+ # 3.3. http://dev.w3.org/csswg/css-syntax/#input-preprocessing
+ #
+ # source://crass//lib/crass/tokenizer.rb#627
+ def preprocess(input); end
+
+ # Returns `true` if the given three-character _text_ would start an
+ # identifier. If _text_ is `nil`, the current and next two characters in the
+ # input stream will be checked, but will not be consumed.
+ #
+ # 4.3.10. http://dev.w3.org/csswg/css-syntax/#would-start-an-identifier
+ #
+ # @return [Boolean]
+ #
+ # source://crass//lib/crass/tokenizer.rb#642
+ def start_identifier?(text = T.unsafe(nil)); end
+
+ # Returns `true` if the given three-character _text_ would start a number.
+ # If _text_ is `nil`, the current and next two characters in the input
+ # stream will be checked, but will not be consumed.
+ #
+ # 4.3.11. http://dev.w3.org/csswg/css-syntax/#starts-with-a-number
+ #
+ # @return [Boolean]
+ #
+ # source://crass//lib/crass/tokenizer.rb#666
+ def start_number?(text = T.unsafe(nil)); end
+
+ # Tokenizes the input stream and returns an array of tokens.
+ #
+ # source://crass//lib/crass/tokenizer.rb#685
+ def tokenize; end
+
+ # Returns `true` if the given two-character _text_ is the beginning of a
+ # valid escape sequence. If _text_ is `nil`, the current and next character
+ # in the input stream will be checked, but will not be consumed.
+ #
+ # 4.3.9. http://dev.w3.org/csswg/css-syntax/#starts-with-a-valid-escape
+ #
+ # @return [Boolean]
+ #
+ # source://crass//lib/crass/tokenizer.rb#702
+ def valid_escape?(text = T.unsafe(nil)); end
+
+ class << self
+ # Tokenizes the given _input_ as a CSS string and returns an array of
+ # tokens.
+ #
+ # See {#initialize} for _options_.
+ #
+ # source://crass//lib/crass/tokenizer.rb#45
+ def tokenize(input, options = T.unsafe(nil)); end
+ end
+end
+
+# source://crass//lib/crass/tokenizer.rb#10
+Crass::Tokenizer::RE_COMMENT_CLOSE = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#11
+Crass::Tokenizer::RE_DIGIT = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#12
+Crass::Tokenizer::RE_ESCAPE = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#13
+Crass::Tokenizer::RE_HEX = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#14
+Crass::Tokenizer::RE_NAME = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#15
+Crass::Tokenizer::RE_NAME_START = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#16
+Crass::Tokenizer::RE_NON_PRINTABLE = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#17
+Crass::Tokenizer::RE_NUMBER_DECIMAL = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#18
+Crass::Tokenizer::RE_NUMBER_EXPONENT = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#19
+Crass::Tokenizer::RE_NUMBER_SIGN = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#21
+Crass::Tokenizer::RE_NUMBER_STR = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#33
+Crass::Tokenizer::RE_QUOTED_URL_START = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#35
+Crass::Tokenizer::RE_UNICODE_RANGE_END = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#34
+Crass::Tokenizer::RE_UNICODE_RANGE_START = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#36
+Crass::Tokenizer::RE_WHITESPACE = T.let(T.unsafe(nil), Regexp)
+
+# source://crass//lib/crass/tokenizer.rb#37
+Crass::Tokenizer::RE_WHITESPACE_ANCHORED = T.let(T.unsafe(nil), Regexp)
diff --git a/sorbet/rbi/gems/diff-lcs@1.6.2.rbi b/sorbet/rbi/gems/diff-lcs@1.6.2.rbi
new file mode 100644
index 0000000..db35dab
--- /dev/null
+++ b/sorbet/rbi/gems/diff-lcs@1.6.2.rbi
@@ -0,0 +1,1135 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `diff-lcs` gem.
+# Please instead update this file by running `bin/tapioca gem diff-lcs`.
+
+
+# source://diff-lcs//lib/diff/lcs.rb#3
+module Diff; end
+
+# == How Diff Works (by Mark-Jason Dominus)
+#
+# I once read an article written by the authors of +diff+; they said that they
+# hard worked very hard on the algorithm until they found the right one.
+#
+# I think what they ended up using (and I hope someone will correct me, because
+# I am not very confident about this) was the `longest common subsequence'
+# method. In the LCS problem, you have two sequences of items:
+#
+# a b c d f g h j q z
+# a b c d e f g i j k r x y z
+#
+# and you want to find the longest sequence of items that is present in both
+# original sequences in the same order. That is, you want to find a new
+# sequence *S* which can be obtained from the first sequence by deleting some
+# items, and from the second sequence by deleting other items. You also want
+# *S* to be as long as possible. In this case *S* is:
+#
+# a b c d f g j z
+#
+# From there it's only a small step to get diff-like output:
+#
+# e h i k q r x y
+# + - + + - + + +
+#
+# This module solves the LCS problem. It also includes a canned function to
+# generate +diff+-like output.
+#
+# It might seem from the example above that the LCS of two sequences is always
+# pretty obvious, but that's not always the case, especially when the two
+# sequences have many repeated elements. For example, consider
+#
+# a x b y c z p d q
+# a b c a x b y c z
+#
+# A naive approach might start by matching up the +a+ and +b+ that appear at
+# the beginning of each sequence, like this:
+#
+# a x b y c z p d q
+# a b c a b y c z
+#
+# This finds the common subsequence +a b c z+. But actually, the LCS is +a x b
+# y c z+:
+#
+# a x b y c z p d q
+# a b c a x b y c z
+#
+# source://diff-lcs//lib/diff/lcs.rb#51
+module Diff::LCS
+ # Returns the difference set between +self+ and +other+. See Diff::LCS#diff.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#76
+ def diff(other, callbacks = T.unsafe(nil), &block); end
+
+ # Returns an Array containing the longest common subsequence(s) between
+ # +self+ and +other+. See Diff::LCS#lcs.
+ #
+ # lcs = seq1.lcs(seq2)
+ #
+ # A note when using objects: Diff::LCS only works properly when each object
+ # can be used as a key in a Hash. This means that those objects must implement
+ # the methods +#hash+ and +#eql?+ such that two objects containing identical values
+ # compare identically for key purposes. That is:
+ #
+ # O.new('a').eql?(O.new('a')) == true &&
+ # O.new('a').hash == O.new('a').hash
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#71
+ def lcs(other, &block); end
+
+ # Attempts to patch +self+ with the provided +patchset+. A new sequence based
+ # on +self+ and the +patchset+ will be created. See Diff::LCS#patch. Attempts
+ # to autodiscover the direction of the patch.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#102
+ def patch(patchset); end
+
+ # Attempts to patch +self+ with the provided +patchset+. A new sequence based
+ # on +self+ and the +patchset+ will be created. See Diff::LCS#patch. Does no
+ # patch direction autodiscovery.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#110
+ def patch!(patchset); end
+
+ # Attempts to patch +self+ with the provided +patchset+, using #patch!. If
+ # the sequence this is used on supports #replace, the value of +self+ will be
+ # replaced. See Diff::LCS#patch. Does no patch direction autodiscovery.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#124
+ def patch_me(patchset); end
+
+ # Returns the balanced ("side-by-side") difference set between +self+ and
+ # +other+. See Diff::LCS#sdiff.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#82
+ def sdiff(other, callbacks = T.unsafe(nil), &block); end
+
+ # Traverses the discovered longest common subsequences between +self+ and
+ # +other+ using the alternate, balanced algorithm. See
+ # Diff::LCS#traverse_balanced.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#95
+ def traverse_balanced(other, callbacks = T.unsafe(nil), &block); end
+
+ # Traverses the discovered longest common subsequences between +self+ and
+ # +other+. See Diff::LCS#traverse_sequences.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#88
+ def traverse_sequences(other, callbacks = T.unsafe(nil), &block); end
+
+ # Attempts to patch +self+ with the provided +patchset+. A new sequence based
+ # on +self+ and the +patchset+ will be created. See Diff::LCS#patch. Attempts
+ # to autodiscover the direction of the patch.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#105
+ def unpatch(patchset); end
+
+ # Attempts to unpatch +self+ with the provided +patchset+. A new sequence
+ # based on +self+ and the +patchset+ will be created. See Diff::LCS#unpatch.
+ # Does no patch direction autodiscovery.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#117
+ def unpatch!(patchset); end
+
+ # Attempts to unpatch +self+ with the provided +patchset+, using #unpatch!.
+ # If the sequence this is used on supports #replace, the value of +self+ will
+ # be replaced. See Diff::LCS#unpatch. Does no patch direction autodiscovery.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#135
+ def unpatch_me(patchset); end
+
+ class << self
+ # :yields: seq1[i] for each matched
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#158
+ def LCS(seq1, seq2, &block); end
+
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#52
+ def callbacks_for(callbacks); end
+
+ # #diff computes the smallest set of additions and deletions necessary to
+ # turn the first sequence into the second, and returns a description of these
+ # changes.
+ #
+ # See Diff::LCS::DiffCallbacks for the default behaviour. An alternate
+ # behaviour may be implemented with Diff::LCS::ContextDiffCallbacks. If a
+ # Class argument is provided for +callbacks+, #diff will attempt to
+ # initialise it. If the +callbacks+ object (possibly initialised) responds to
+ # #finish, it will be called.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#169
+ def diff(seq1, seq2, callbacks = T.unsafe(nil), &block); end
+
+ # :yields: seq1[i] for each matched
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#145
+ def lcs(seq1, seq2, &block); end
+
+ # Applies a +patchset+ to the sequence +src+ according to the +direction+
+ # (:patch or :unpatch ), producing a new sequence.
+ #
+ # If the +direction+ is not specified, Diff::LCS::patch will attempt to
+ # discover the direction of the +patchset+.
+ #
+ # A +patchset+ can be considered to apply forward (:patch ) if the
+ # following expression is true:
+ #
+ # patch(s1, diff(s1, s2)) -> s2
+ #
+ # A +patchset+ can be considered to apply backward (:unpatch ) if the
+ # following expression is true:
+ #
+ # patch(s2, diff(s1, s2)) -> s1
+ #
+ # If the +patchset+ contains no changes, the +src+ value will be returned as
+ # either src.dup or +src+. A +patchset+ can be deemed as having no
+ # changes if the following predicate returns true:
+ #
+ # patchset.empty? or
+ # patchset.flatten(1).all? { |change| change.unchanged? }
+ #
+ # === Patchsets
+ #
+ # A +patchset+ is always an enumerable sequence of changes, hunks of changes,
+ # or a mix of the two. A hunk of changes is an enumerable sequence of
+ # changes:
+ #
+ # [ # patchset
+ # # change
+ # [ # hunk
+ # # change
+ # ]
+ # ]
+ #
+ # The +patch+ method accepts patchset s that are enumerable sequences
+ # containing either Diff::LCS::Change objects (or a subclass) or the array
+ # representations of those objects. Prior to application, array
+ # representations of Diff::LCS::Change objects will be reified.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#627
+ def patch(src, patchset, direction = T.unsafe(nil)); end
+
+ # Given a set of patchset, convert the current version to the next version.
+ # Does no auto-discovery.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#737
+ def patch!(src, patchset); end
+
+ # #sdiff computes all necessary components to show two sequences and their
+ # minimized differences side by side, just like the Unix utility
+ # sdiff does:
+ #
+ # old < -
+ # same same
+ # before | after
+ # - > new
+ #
+ # See Diff::LCS::SDiffCallbacks for the default behaviour. An alternate
+ # behaviour may be implemented with Diff::LCS::ContextDiffCallbacks. If a
+ # Class argument is provided for +callbacks+, #diff will attempt to
+ # initialise it. If the +callbacks+ object (possibly initialised) responds to
+ # #finish, it will be called.
+ #
+ # Each element of a returned array is a Diff::LCS::ContextChange object,
+ # which can be implicitly converted to an array.
+ #
+ # Diff::LCS.sdiff(a, b).each do |action, (old_pos, old_element), (new_pos, new_element)|
+ # case action
+ # when '!'
+ # # replace
+ # when '-'
+ # # delete
+ # when '+'
+ # # insert
+ # end
+ # end
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#201
+ def sdiff(seq1, seq2, callbacks = T.unsafe(nil), &block); end
+
+ # #traverse_balanced is an alternative to #traverse_sequences. It uses a
+ # different algorithm to iterate through the entries in the computed longest
+ # common subsequence. Instead of viewing the changes as insertions or
+ # deletions from one of the sequences, #traverse_balanced will report
+ # changes between the sequences.
+ #
+ # The arguments to #traverse_balanced are the two sequences to traverse and a
+ # callback object, like this:
+ #
+ # traverse_balanced(seq1, seq2, Diff::LCS::ContextDiffCallbacks.new)
+ #
+ # #sdiff is implemented with #traverse_balanced.
+ #
+ # == Callback Methods
+ #
+ # Optional callback methods are emphasized .
+ #
+ # callbacks#match:: Called when +a+ and +b+ are pointing to
+ # common elements in +A+ and +B+.
+ # callbacks#discard_a:: Called when +a+ is pointing to an
+ # element not in +B+.
+ # callbacks#discard_b:: Called when +b+ is pointing to an
+ # element not in +A+.
+ # callbacks#change :: Called when +a+ and +b+ are pointing to
+ # the same relative position, but
+ # A[a] and B[b] are not
+ # the same; a change has
+ # occurred.
+ #
+ # #traverse_balanced might be a bit slower than #traverse_sequences,
+ # noticeable only while processing huge amounts of data.
+ #
+ # == Algorithm
+ #
+ # a---+
+ # v
+ # A = a b c e h j l m n p
+ # B = b c d e f j k l m r s t
+ # ^
+ # b---+
+ #
+ # === Matches
+ #
+ # If there are two arrows (+a+ and +b+) pointing to elements of sequences +A+
+ # and +B+, the arrows will initially point to the first elements of their
+ # respective sequences. #traverse_sequences will advance the arrows through
+ # the sequences one element at a time, calling a method on the user-specified
+ # callback object before each advance. It will advance the arrows in such a
+ # way that if there are elements A[i] and B[j] which are
+ # both equal and part of the longest common subsequence, there will be some
+ # moment during the execution of #traverse_sequences when arrow +a+ is
+ # pointing to A[i] and arrow +b+ is pointing to B[j] . When
+ # this happens, #traverse_sequences will call callbacks#match and
+ # then it will advance both arrows.
+ #
+ # === Discards
+ #
+ # Otherwise, one of the arrows is pointing to an element of its sequence that
+ # is not part of the longest common subsequence. #traverse_sequences will
+ # advance that arrow and will call callbacks#discard_a or
+ # callbacks#discard_b , depending on which arrow it advanced.
+ #
+ # === Changes
+ #
+ # If both +a+ and +b+ point to elements that are not part of the longest
+ # common subsequence, then #traverse_sequences will try to call
+ # callbacks#change and advance both arrows. If
+ # callbacks#change is not implemented, then
+ # callbacks#discard_a and callbacks#discard_b will be
+ # called in turn.
+ #
+ # The methods for callbacks#match , callbacks#discard_a ,
+ # callbacks#discard_b , and callbacks#change are invoked
+ # with an event comprising the action ("=", "+", "-", or "!", respectively),
+ # the indexes +i+ and +j+, and the elements A[i] and B[j] .
+ # Return values are discarded by #traverse_balanced.
+ #
+ # === Context
+ #
+ # Note that +i+ and +j+ may not be the same index position, even if +a+ and
+ # +b+ are considered to be pointing to matching or changed elements.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#476
+ def traverse_balanced(seq1, seq2, callbacks = T.unsafe(nil)); end
+
+ # #traverse_sequences is the most general facility provided by this module;
+ # #diff and #lcs are implemented as calls to it.
+ #
+ # The arguments to #traverse_sequences are the two sequences to traverse, and
+ # a callback object, like this:
+ #
+ # traverse_sequences(seq1, seq2, Diff::LCS::ContextDiffCallbacks.new)
+ #
+ # == Callback Methods
+ #
+ # Optional callback methods are emphasized .
+ #
+ # callbacks#match:: Called when +a+ and +b+ are pointing to
+ # common elements in +A+ and +B+.
+ # callbacks#discard_a:: Called when +a+ is pointing to an
+ # element not in +B+.
+ # callbacks#discard_b:: Called when +b+ is pointing to an
+ # element not in +A+.
+ # callbacks#finished_a :: Called when +a+ has reached the end of
+ # sequence +A+.
+ # callbacks#finished_b :: Called when +b+ has reached the end of
+ # sequence +B+.
+ #
+ # == Algorithm
+ #
+ # a---+
+ # v
+ # A = a b c e h j l m n p
+ # B = b c d e f j k l m r s t
+ # ^
+ # b---+
+ #
+ # If there are two arrows (+a+ and +b+) pointing to elements of sequences +A+
+ # and +B+, the arrows will initially point to the first elements of their
+ # respective sequences. #traverse_sequences will advance the arrows through
+ # the sequences one element at a time, calling a method on the user-specified
+ # callback object before each advance. It will advance the arrows in such a
+ # way that if there are elements A[i] and B[j] which are
+ # both equal and part of the longest common subsequence, there will be some
+ # moment during the execution of #traverse_sequences when arrow +a+ is
+ # pointing to A[i] and arrow +b+ is pointing to B[j] . When
+ # this happens, #traverse_sequences will call callbacks#match and
+ # then it will advance both arrows.
+ #
+ # Otherwise, one of the arrows is pointing to an element of its sequence that
+ # is not part of the longest common subsequence. #traverse_sequences will
+ # advance that arrow and will call callbacks#discard_a or
+ # callbacks#discard_b , depending on which arrow it advanced. If both
+ # arrows point to elements that are not part of the longest common
+ # subsequence, then #traverse_sequences will advance arrow +a+ and call the
+ # appropriate callback, then it will advance arrow +b+ and call the appropriate
+ # callback.
+ #
+ # The methods for callbacks#match , callbacks#discard_a , and
+ # callbacks#discard_b are invoked with an event comprising the
+ # action ("=", "+", or "-", respectively), the indexes +i+ and +j+, and the
+ # elements A[i] and B[j] . Return values are discarded by
+ # #traverse_sequences.
+ #
+ # === End of Sequences
+ #
+ # If arrow +a+ reaches the end of its sequence before arrow +b+ does,
+ # #traverse_sequence will try to call callbacks#finished_a with the
+ # last index and element of +A+ (A[-1] ) and the current index and
+ # element of +B+ (B[j] ). If callbacks#finished_a does not
+ # exist, then callbacks#discard_b will be called on each element of
+ # +B+ until the end of the sequence is reached (the call will be done with
+ # A[-1] and B[j] for each element).
+ #
+ # If +b+ reaches the end of +B+ before +a+ reaches the end of +A+,
+ # callbacks#finished_b will be called with the current index and
+ # element of +A+ (A[i] ) and the last index and element of +B+
+ # (A[-1] ). Again, if callbacks#finished_b does not exist on
+ # the callback object, then callbacks#discard_a will be called on
+ # each element of +A+ until the end of the sequence is reached (A[i]
+ # and B[-1] ).
+ #
+ # There is a chance that one additional callbacks#discard_a or
+ # callbacks#discard_b will be called after the end of the sequence
+ # is reached, if +a+ has not yet reached the end of +A+ or +b+ has not yet
+ # reached the end of +B+.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#286
+ def traverse_sequences(seq1, seq2, callbacks = T.unsafe(nil)); end
+
+ # Given a set of patchset, convert the current version to the prior version.
+ # Does no auto-discovery.
+ #
+ # source://diff-lcs//lib/diff/lcs.rb#731
+ def unpatch!(src, patchset); end
+
+ private
+
+ # source://diff-lcs//lib/diff/lcs/internals.rb#4
+ def diff_traversal(method, seq1, seq2, callbacks, &block); end
+ end
+end
+
+# An alias for DefaultCallbacks that is used in
+# Diff::LCS#traverse_balanced.
+#
+# Diff::LCS.LCS(seq1, seq2, Diff::LCS::BalancedCallbacks)
+#
+# source://diff-lcs//lib/diff/lcs/callbacks.rb#50
+Diff::LCS::BalancedCallbacks = Diff::LCS::DefaultCallbacks
+
+# A block is an operation removing, adding, or changing a group of items.
+# Basically, this is just a list of changes, where each change adds or
+# deletes a single item. Used by bin/ldiff.
+#
+# source://diff-lcs//lib/diff/lcs/block.rb#6
+class Diff::LCS::Block
+ # @return [Block] a new instance of Block
+ #
+ # source://diff-lcs//lib/diff/lcs/block.rb#9
+ def initialize(chunk); end
+
+ # Returns the value of attribute changes.
+ #
+ # source://diff-lcs//lib/diff/lcs/block.rb#7
+ def changes; end
+
+ # source://diff-lcs//lib/diff/lcs/block.rb#21
+ def diff_size; end
+
+ # Returns the value of attribute insert.
+ #
+ # source://diff-lcs//lib/diff/lcs/block.rb#7
+ def insert; end
+
+ # source://diff-lcs//lib/diff/lcs/block.rb#25
+ def op; end
+
+ # Returns the value of attribute remove.
+ #
+ # source://diff-lcs//lib/diff/lcs/block.rb#7
+ def remove; end
+end
+
+# Represents a simplistic (non-contextual) change. Represents the removal or
+# addition of an element from either the old or the new sequenced
+# enumerable.
+#
+# source://diff-lcs//lib/diff/lcs/change.rb#6
+class Diff::LCS::Change
+ include ::Comparable
+
+ # @return [Change] a new instance of Change
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#27
+ def initialize(*args); end
+
+ # source://diff-lcs//lib/diff/lcs/change.rb#65
+ def <=>(other); end
+
+ # source://diff-lcs//lib/diff/lcs/change.rb#58
+ def ==(other); end
+
+ # Returns the action this Change represents.
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#20
+ def action; end
+
+ # @return [Boolean]
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#72
+ def adding?; end
+
+ # @return [Boolean]
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#84
+ def changed?; end
+
+ # @return [Boolean]
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#76
+ def deleting?; end
+
+ # Returns the sequence element of the Change.
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#25
+ def element; end
+
+ # @return [Boolean]
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#88
+ def finished_a?; end
+
+ # @return [Boolean]
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#92
+ def finished_b?; end
+
+ # source://diff-lcs//lib/diff/lcs/change.rb#34
+ def inspect(*_args); end
+
+ # Returns the position of the Change.
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#23
+ def position; end
+
+ # source://diff-lcs//lib/diff/lcs/change.rb#38
+ def to_a; end
+
+ # source://diff-lcs//lib/diff/lcs/change.rb#42
+ def to_ary; end
+
+ # @return [Boolean]
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#80
+ def unchanged?; end
+
+ class << self
+ # source://diff-lcs//lib/diff/lcs/change.rb#44
+ def from_a(arr); end
+
+ # @return [Boolean]
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#15
+ def valid_action?(action); end
+ end
+end
+
+# Fixnum is deprecated in Ruby 2.4 # standard:disable Naming/ConstantName
+#
+# source://diff-lcs//lib/diff/lcs/change.rb#7
+Diff::LCS::Change::IntClass = Integer
+
+# The only actions valid for changes are '+' (add), '-' (delete), '='
+# (no change), '!' (changed), '<' (tail changes from first sequence), or
+# '>' (tail changes from second sequence). The last two ('<>') are only
+# found with Diff::LCS::diff and Diff::LCS::sdiff.
+#
+# source://diff-lcs//lib/diff/lcs/change.rb#13
+Diff::LCS::Change::VALID_ACTIONS = T.let(T.unsafe(nil), Array)
+
+# Represents a contextual change. Contains the position and values of the
+# elements in the old and the new sequenced enumerables as well as the action
+# taken.
+#
+# source://diff-lcs//lib/diff/lcs/change.rb#100
+class Diff::LCS::ContextChange < ::Diff::LCS::Change
+ # @return [ContextChange] a new instance of ContextChange
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#114
+ def initialize(*args); end
+
+ # source://diff-lcs//lib/diff/lcs/change.rb#166
+ def <=>(other); end
+
+ # source://diff-lcs//lib/diff/lcs/change.rb#157
+ def ==(other); end
+
+ # Returns the new element being changed.
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#112
+ def new_element; end
+
+ # Returns the new position being changed.
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#108
+ def new_position; end
+
+ # Returns the old element being changed.
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#110
+ def old_element; end
+
+ # Returns the old position being changed.
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#106
+ def old_position; end
+
+ # source://diff-lcs//lib/diff/lcs/change.rb#122
+ def to_a; end
+
+ # source://diff-lcs//lib/diff/lcs/change.rb#130
+ def to_ary; end
+
+ class << self
+ # source://diff-lcs//lib/diff/lcs/change.rb#132
+ def from_a(arr); end
+
+ # Simplifies a context change for use in some diff callbacks. '<' actions
+ # are converted to '-' and '>' actions are converted to '+'.
+ #
+ # source://diff-lcs//lib/diff/lcs/change.rb#138
+ def simplify(event); end
+ end
+end
+
+# This will produce a compound array of contextual diff change objects. Each
+# element in the #diffs array is a "hunk" array, where each element in each
+# "hunk" array is a single change. Each change is a Diff::LCS::ContextChange
+# that contains both the old index and new index values for the change. The
+# "hunk" provides the full context for the changes. Both old and new objects
+# will be presented for changed objects. +nil+ will be substituted for a
+# discarded object.
+#
+# seq1 = %w(a b c e h j l m n p)
+# seq2 = %w(b c d e f j k l m r s t)
+#
+# diffs = Diff::LCS.diff(seq1, seq2, Diff::LCS::ContextDiffCallbacks)
+# # This example shows a simplified array format.
+# # [ [ [ '-', [ 0, 'a' ], [ 0, nil ] ] ], # 1
+# # [ [ '+', [ 3, nil ], [ 2, 'd' ] ] ], # 2
+# # [ [ '-', [ 4, 'h' ], [ 4, nil ] ], # 3
+# # [ '+', [ 5, nil ], [ 4, 'f' ] ] ],
+# # [ [ '+', [ 6, nil ], [ 6, 'k' ] ] ], # 4
+# # [ [ '-', [ 8, 'n' ], [ 9, nil ] ], # 5
+# # [ '+', [ 9, nil ], [ 9, 'r' ] ],
+# # [ '-', [ 9, 'p' ], [ 10, nil ] ],
+# # [ '+', [ 10, nil ], [ 10, 's' ] ],
+# # [ '+', [ 10, nil ], [ 11, 't' ] ] ] ]
+#
+# The five hunks shown are comprised of individual changes; if there is a
+# related set of changes, they are still shown individually.
+#
+# This callback can also be used with Diff::LCS#sdiff, which will produce
+# results like:
+#
+# diffs = Diff::LCS.sdiff(seq1, seq2, Diff::LCS::ContextCallbacks)
+# # This example shows a simplified array format.
+# # [ [ [ "-", [ 0, "a" ], [ 0, nil ] ] ], # 1
+# # [ [ "+", [ 3, nil ], [ 2, "d" ] ] ], # 2
+# # [ [ "!", [ 4, "h" ], [ 4, "f" ] ] ], # 3
+# # [ [ "+", [ 6, nil ], [ 6, "k" ] ] ], # 4
+# # [ [ "!", [ 8, "n" ], [ 9, "r" ] ], # 5
+# # [ "!", [ 9, "p" ], [ 10, "s" ] ],
+# # [ "+", [ 10, nil ], [ 11, "t" ] ] ] ]
+#
+# The five hunks are still present, but are significantly shorter in total
+# presentation, because changed items are shown as changes ("!") instead of
+# potentially "mismatched" pairs of additions and deletions.
+#
+# The result of this operation is similar to that of
+# Diff::LCS::SDiffCallbacks. They may be compared as:
+#
+# s = Diff::LCS.sdiff(seq1, seq2).reject { |e| e.action == "=" }
+# c = Diff::LCS.sdiff(seq1, seq2, Diff::LCS::ContextDiffCallbacks).flatten(1)
+#
+# s == c # -> true
+#
+# === Use
+#
+# This callback object must be initialised and can be used by the
+# Diff::LCS#diff or Diff::LCS#sdiff methods.
+#
+# cbo = Diff::LCS::ContextDiffCallbacks.new
+# Diff::LCS.LCS(seq1, seq2, cbo)
+# cbo.finish
+#
+# Note that the call to #finish is absolutely necessary, or the last set of
+# changes will not be visible. Alternatively, can be used as:
+#
+# cbo = Diff::LCS::ContextDiffCallbacks.new { |tcbo| Diff::LCS.LCS(seq1, seq2, tcbo) }
+#
+# The necessary #finish call will be made.
+#
+# === Simplified Array Format
+#
+# The simplified array format used in the example above can be obtained
+# with:
+#
+# require 'pp'
+# pp diffs.map { |e| e.map { |f| f.to_a } }
+#
+# source://diff-lcs//lib/diff/lcs/callbacks.rb#225
+class Diff::LCS::ContextDiffCallbacks < ::Diff::LCS::DiffCallbacks
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#234
+ def change(event); end
+
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#226
+ def discard_a(event); end
+
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#230
+ def discard_b(event); end
+end
+
+# This callback object implements the default set of callback events,
+# which only returns the event itself. Note that #finished_a and
+# #finished_b are not implemented -- I haven't yet figured out where they
+# would be useful.
+#
+# Note that this is intended to be called as is, e.g.,
+#
+# Diff::LCS.LCS(seq1, seq2, Diff::LCS::DefaultCallbacks)
+#
+# source://diff-lcs//lib/diff/lcs/callbacks.rb#14
+class Diff::LCS::DefaultCallbacks
+ class << self
+ # Called when both the old and new values have changed.
+ #
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#32
+ def change(event); end
+
+ # Called when the old value is discarded in favour of the new value.
+ #
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#22
+ def discard_a(event); end
+
+ # Called when the new value is discarded in favour of the old value.
+ #
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#27
+ def discard_b(event); end
+
+ # Called when two items match.
+ #
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#17
+ def match(event); end
+
+ private
+
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#36
+ def new(*_arg0); end
+ end
+end
+
+# This will produce a compound array of simple diff change objects. Each
+# element in the #diffs array is a +hunk+ or +hunk+ array, where each
+# element in each +hunk+ array is a single Change object representing the
+# addition or removal of a single element from one of the two tested
+# sequences. The +hunk+ provides the full context for the changes.
+#
+# diffs = Diff::LCS.diff(seq1, seq2)
+# # This example shows a simplified array format.
+# # [ [ [ '-', 0, 'a' ] ], # 1
+# # [ [ '+', 2, 'd' ] ], # 2
+# # [ [ '-', 4, 'h' ], # 3
+# # [ '+', 4, 'f' ] ],
+# # [ [ '+', 6, 'k' ] ], # 4
+# # [ [ '-', 8, 'n' ], # 5
+# # [ '-', 9, 'p' ],
+# # [ '+', 9, 'r' ],
+# # [ '+', 10, 's' ],
+# # [ '+', 11, 't' ] ] ]
+#
+# There are five hunks here. The first hunk says that the +a+ at position 0
+# of the first sequence should be deleted ('-' ). The second hunk
+# says that the +d+ at position 2 of the second sequence should be inserted
+# ('+' ). The third hunk says that the +h+ at position 4 of the
+# first sequence should be removed and replaced with the +f+ from position 4
+# of the second sequence. The other two hunks are described similarly.
+#
+# === Use
+#
+# This callback object must be initialised and is used by the Diff::LCS#diff
+# method.
+#
+# cbo = Diff::LCS::DiffCallbacks.new
+# Diff::LCS.LCS(seq1, seq2, cbo)
+# cbo.finish
+#
+# Note that the call to #finish is absolutely necessary, or the last set of
+# changes will not be visible. Alternatively, can be used as:
+#
+# cbo = Diff::LCS::DiffCallbacks.new { |tcbo| Diff::LCS.LCS(seq1, seq2, tcbo) }
+#
+# The necessary #finish call will be made.
+#
+# === Simplified Array Format
+#
+# The simplified array format used in the example above can be obtained
+# with:
+#
+# require 'pp'
+# pp diffs.map { |e| e.map { |f| f.to_a } }
+#
+# source://diff-lcs//lib/diff/lcs/callbacks.rb#108
+class Diff::LCS::DiffCallbacks
+ # :yields: self
+ #
+ # @return [DiffCallbacks] a new instance of DiffCallbacks
+ #
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#112
+ def initialize; end
+
+ # Returns the difference set collected during the diff process.
+ #
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#110
+ def diffs; end
+
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#135
+ def discard_a(event); end
+
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#139
+ def discard_b(event); end
+
+ # Finalizes the diff process. If an unprocessed hunk still exists, then it
+ # is appended to the diff list.
+ #
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#127
+ def finish; end
+
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#131
+ def match(_event); end
+
+ private
+
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#143
+ def finish_hunk; end
+end
+
+# A Hunk is a group of Blocks which overlap because of the context surrounding
+# each block. (So if we're not using context, every hunk will contain one
+# block.) Used in the diff program (bin/ldiff).
+#
+# source://diff-lcs//lib/diff/lcs/hunk.rb#8
+class Diff::LCS::Hunk
+ # Create a hunk using references to both the old and new data, as well as the
+ # piece of data.
+ #
+ # @return [Hunk] a new instance of Hunk
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#16
+ def initialize(data_old, data_new, piece, flag_context, file_length_difference); end
+
+ # Returns the value of attribute blocks.
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#64
+ def blocks; end
+
+ # Returns a diff string based on a format.
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#115
+ def diff(format, last = T.unsafe(nil)); end
+
+ # Returns the value of attribute end_new.
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#66
+ def end_new; end
+
+ # Returns the value of attribute end_old.
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#66
+ def end_old; end
+
+ # Returns the value of attribute file_length_difference.
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#67
+ def file_length_difference; end
+
+ # Change the "start" and "end" fields to note that context should be added
+ # to this hunk.
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#71
+ def flag_context; end
+
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#71
+ def flag_context=(context); end
+
+ # Merges this hunk and the provided hunk together if they overlap. Returns
+ # a truthy value so that if there is no overlap, you can know the merge
+ # was skipped.
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#97
+ def merge(hunk); end
+
+ # @return [Boolean]
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#347
+ def missing_last_newline?(data); end
+
+ # Determines whether there is an overlap between this hunk and the
+ # provided hunk. This will be true if the difference between the two hunks
+ # start or end positions is within one position of each other.
+ #
+ # @return [Boolean]
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#109
+ def overlaps?(hunk); end
+
+ # Returns the value of attribute start_new.
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#65
+ def start_new; end
+
+ # Returns the value of attribute start_old.
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#65
+ def start_old; end
+
+ # Merges this hunk and the provided hunk together if they overlap. Returns
+ # a truthy value so that if there is no overlap, you can know the merge
+ # was skipped.
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#104
+ def unshift(hunk); end
+
+ private
+
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#222
+ def context_diff(last = T.unsafe(nil)); end
+
+ # Generate a range of item numbers to print. Only print 1 number if the
+ # range has only one item in it. Otherwise, it's 'start,end'
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#316
+ def context_range(mode, op); end
+
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#284
+ def ed_diff(format, last); end
+
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#360
+ def encode(literal, target_encoding = T.unsafe(nil)); end
+
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#364
+ def encode_as(string, *args); end
+
+ # Note that an old diff can't have any context. Therefore, we know that
+ # there's only one block in the hunk.
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#134
+ def old_diff(last = T.unsafe(nil)); end
+
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#167
+ def unified_diff(last = T.unsafe(nil)); end
+
+ # Generate a range of item numbers to print for unified diff. Print number
+ # where block starts, followed by number of lines in the block
+ # (don't print number of lines if it's 1)
+ #
+ # source://diff-lcs//lib/diff/lcs/hunk.rb#331
+ def unified_range(mode); end
+end
+
+# source://diff-lcs//lib/diff/lcs/hunk.rb#10
+Diff::LCS::Hunk::ED_DIFF_OP_ACTION = T.let(T.unsafe(nil), Hash)
+
+# source://diff-lcs//lib/diff/lcs/hunk.rb#9
+Diff::LCS::Hunk::OLD_DIFF_OP_ACTION = T.let(T.unsafe(nil), Hash)
+
+# source://diff-lcs//lib/diff/lcs/internals.rb#29
+module Diff::LCS::Internals
+ class << self
+ # This method will analyze the provided patchset to provide a single-pass
+ # normalization (conversion of the array form of Diff::LCS::Change objects to
+ # the object form of same) and detection of whether the patchset represents
+ # changes to be made.
+ #
+ # source://diff-lcs//lib/diff/lcs/internals.rb#102
+ def analyze_patchset(patchset, depth = T.unsafe(nil)); end
+
+ # Examine the patchset and the source to see in which direction the
+ # patch should be applied.
+ #
+ # WARNING: By default, this examines the whole patch, so this could take
+ # some time. This also works better with Diff::LCS::ContextChange or
+ # Diff::LCS::Change as its source, as an array will cause the creation
+ # of one of the above.
+ #
+ # source://diff-lcs//lib/diff/lcs/internals.rb#147
+ def intuit_diff_direction(src, patchset, limit = T.unsafe(nil)); end
+
+ # Compute the longest common subsequence between the sequenced
+ # Enumerables +a+ and +b+. The result is an array whose contents is such
+ # that
+ #
+ # result = Diff::LCS::Internals.lcs(a, b)
+ # result.each_with_index do |e, i|
+ # assert_equal(a[i], b[e]) unless e.nil?
+ # end
+ #
+ # source://diff-lcs//lib/diff/lcs/internals.rb#41
+ def lcs(a, b); end
+
+ private
+
+ # If +vector+ maps the matching elements of another collection onto this
+ # Enumerable, compute the inverse of +vector+ that maps this Enumerable
+ # onto the collection. (Currently unused.)
+ #
+ # source://diff-lcs//lib/diff/lcs/internals.rb#286
+ def inverse_vector(a, vector); end
+
+ # Returns a hash mapping each element of an Enumerable to the set of
+ # positions it occupies in the Enumerable, optionally restricted to the
+ # elements specified in the range of indexes specified by +interval+.
+ #
+ # source://diff-lcs//lib/diff/lcs/internals.rb#298
+ def position_hash(enum, interval); end
+
+ # Find the place at which +value+ would normally be inserted into the
+ # Enumerable. If that place is already occupied by +value+, do nothing
+ # and return +nil+. If the place does not exist (i.e., it is off the end
+ # of the Enumerable), add it to the end. Otherwise, replace the element
+ # at that point with +value+. It is assumed that the Enumerable's values
+ # are numeric.
+ #
+ # This operation preserves the sort order.
+ #
+ # source://diff-lcs//lib/diff/lcs/internals.rb#252
+ def replace_next_larger(enum, value, last_index = T.unsafe(nil)); end
+ end
+end
+
+# This will produce a simple array of diff change objects. Each element in
+# the #diffs array is a single ContextChange. In the set of #diffs provided
+# by SDiffCallbacks, both old and new objects will be presented for both
+# changed and unchanged objects. +nil+ will be substituted
+# for a discarded object.
+#
+# The diffset produced by this callback, when provided to Diff::LCS#sdiff,
+# will compute and display the necessary components to show two sequences
+# and their minimized differences side by side, just like the Unix utility
+# +sdiff+.
+#
+# same same
+# before | after
+# old < -
+# - > new
+#
+# seq1 = %w(a b c e h j l m n p)
+# seq2 = %w(b c d e f j k l m r s t)
+#
+# diffs = Diff::LCS.sdiff(seq1, seq2)
+# # This example shows a simplified array format.
+# # [ [ "-", [ 0, "a"], [ 0, nil ] ],
+# # [ "=", [ 1, "b"], [ 0, "b" ] ],
+# # [ "=", [ 2, "c"], [ 1, "c" ] ],
+# # [ "+", [ 3, nil], [ 2, "d" ] ],
+# # [ "=", [ 3, "e"], [ 3, "e" ] ],
+# # [ "!", [ 4, "h"], [ 4, "f" ] ],
+# # [ "=", [ 5, "j"], [ 5, "j" ] ],
+# # [ "+", [ 6, nil], [ 6, "k" ] ],
+# # [ "=", [ 6, "l"], [ 7, "l" ] ],
+# # [ "=", [ 7, "m"], [ 8, "m" ] ],
+# # [ "!", [ 8, "n"], [ 9, "r" ] ],
+# # [ "!", [ 9, "p"], [ 10, "s" ] ],
+# # [ "+", [ 10, nil], [ 11, "t" ] ] ]
+#
+# The result of this operation is similar to that of
+# Diff::LCS::ContextDiffCallbacks. They may be compared as:
+#
+# s = Diff::LCS.sdiff(seq1, seq2).reject { |e| e.action == "=" }
+# c = Diff::LCS.sdiff(seq1, seq2, Diff::LCS::ContextDiffCallbacks).flatten(1)
+#
+# s == c # -> true
+#
+# === Use
+#
+# This callback object must be initialised and is used by the Diff::LCS#sdiff
+# method.
+#
+# cbo = Diff::LCS::SDiffCallbacks.new
+# Diff::LCS.LCS(seq1, seq2, cbo)
+#
+# As with the other initialisable callback objects,
+# Diff::LCS::SDiffCallbacks can be initialised with a block. As there is no
+# "fininishing" to be done, this has no effect on the state of the object.
+#
+# cbo = Diff::LCS::SDiffCallbacks.new { |tcbo| Diff::LCS.LCS(seq1, seq2, tcbo) }
+#
+# === Simplified Array Format
+#
+# The simplified array format used in the example above can be obtained
+# with:
+#
+# require 'pp'
+# pp diffs.map { |e| e.to_a }
+#
+# source://diff-lcs//lib/diff/lcs/callbacks.rb#303
+class Diff::LCS::SDiffCallbacks
+ # :yields: self
+ #
+ # @return [SDiffCallbacks] a new instance of SDiffCallbacks
+ # @yield [_self]
+ # @yieldparam _self [Diff::LCS::SDiffCallbacks] the object that the method was called on
+ #
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#307
+ def initialize; end
+
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#324
+ def change(event); end
+
+ # Returns the difference set collected during the diff process.
+ #
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#305
+ def diffs; end
+
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#316
+ def discard_a(event); end
+
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#320
+ def discard_b(event); end
+
+ # source://diff-lcs//lib/diff/lcs/callbacks.rb#312
+ def match(event); end
+end
+
+# An alias for DefaultCallbacks that is used in
+# Diff::LCS#traverse_sequences.
+#
+# Diff::LCS.LCS(seq1, seq2, Diff::LCS::SequenceCallbacks)
+#
+# source://diff-lcs//lib/diff/lcs/callbacks.rb#44
+Diff::LCS::SequenceCallbacks = Diff::LCS::DefaultCallbacks
+
+# source://diff-lcs//lib/diff/lcs/version.rb#5
+Diff::LCS::VERSION = T.let(T.unsafe(nil), String)
diff --git a/sorbet/rbi/gems/erubi@1.13.1.rbi b/sorbet/rbi/gems/erubi@1.13.1.rbi
new file mode 100644
index 0000000..3a6982f
--- /dev/null
+++ b/sorbet/rbi/gems/erubi@1.13.1.rbi
@@ -0,0 +1,157 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `erubi` gem.
+# Please instead update this file by running `bin/tapioca gem erubi`.
+
+
+# source://erubi//lib/erubi.rb#3
+module Erubi
+ private
+
+ # source://erubi//lib/erubi.rb#22
+ def h(_arg0); end
+
+ class << self
+ # source://erubi//lib/erubi.rb#49
+ def h(_arg0); end
+ end
+end
+
+# source://erubi//lib/erubi.rb#51
+class Erubi::Engine
+ # Initialize a new Erubi::Engine. Options:
+ # +:bufval+ :: The value to use for the buffer variable, as a string (default '::String.new' ).
+ # +:bufvar+ :: The variable name to use for the buffer variable, as a string.
+ # +:chain_appends+ :: Whether to chain << calls to the buffer variable. Offers better
+ # performance, but can cause issues when the buffer variable is reassigned during
+ # template rendering (default +false+).
+ # +:ensure+ :: Wrap the template in a begin/ensure block restoring the previous value of bufvar.
+ # +:escapefunc+ :: The function to use for escaping, as a string (default: '::Erubi.h' ).
+ # +:escape+ :: Whether to make <%= escape by default, and <%== not escape by default.
+ # +:escape_html+ :: Same as +:escape+, with lower priority.
+ # +:filename+ :: The filename for the template.
+ # the resulting source code. Note this may cause problems if you are wrapping the resulting
+ # source code in other code, because the magic comment only has an effect at the beginning of
+ # the file, and having the magic comment later in the file can trigger warnings.
+ # +:freeze_template_literals+ :: Whether to suffix all literal strings for template code with .freeze
+ # (default: +true+ on Ruby 2.1+, +false+ on Ruby 2.0 and older).
+ # Can be set to +false+ on Ruby 2.3+ when frozen string literals are enabled
+ # in order to improve performance.
+ # +:literal_prefix+ :: The prefix to output when using escaped tag delimiters (default '<%' ).
+ # +:literal_postfix+ :: The postfix to output when using escaped tag delimiters (default '%>' ).
+ # +:outvar+ :: Same as +:bufvar+, with lower priority.
+ # +:postamble+ :: The postamble for the template, by default returns the resulting source code.
+ # +:preamble+ :: The preamble for the template, by default initializes the buffer variable.
+ # +:regexp+ :: The regexp to use for scanning.
+ # +:src+ :: The initial value to use for the source code, an empty string by default.
+ # +:trim+ :: Whether to trim leading and trailing whitespace, true by default.
+ #
+ # @return [Engine] a new instance of Engine
+ #
+ # source://erubi//lib/erubi.rb#91
+ def initialize(input, properties = T.unsafe(nil)); end
+
+ # The variable name used for the buffer variable.
+ #
+ # source://erubi//lib/erubi.rb#62
+ def bufvar; end
+
+ # The filename of the template, if one was given.
+ #
+ # source://erubi//lib/erubi.rb#59
+ def filename; end
+
+ # The frozen ruby source code generated from the template, which can be evaled.
+ #
+ # source://erubi//lib/erubi.rb#56
+ def src; end
+
+ private
+
+ # :nocov:
+ #
+ # source://erubi//lib/erubi.rb#209
+ def _dup_string_if_frozen(string); end
+
+ # Add ruby code to the template
+ #
+ # source://erubi//lib/erubi.rb#232
+ def add_code(code); end
+
+ # Add the given ruby expression result to the template,
+ # escaping it based on the indicator given and escape flag.
+ #
+ # source://erubi//lib/erubi.rb#241
+ def add_expression(indicator, code); end
+
+ # Add the result of Ruby expression to the template
+ #
+ # source://erubi//lib/erubi.rb#250
+ def add_expression_result(code); end
+
+ # Add the escaped result of Ruby expression to the template
+ #
+ # source://erubi//lib/erubi.rb#255
+ def add_expression_result_escaped(code); end
+
+ # Add the given postamble to the src. Can be overridden in subclasses
+ # to make additional changes to src that depend on the current state.
+ #
+ # source://erubi//lib/erubi.rb#261
+ def add_postamble(postamble); end
+
+ # Add raw text to the template. Modifies argument if argument is mutable as a memory optimization.
+ # Must be called with a string, cannot be called with nil (Rails's subclass depends on it).
+ #
+ # source://erubi//lib/erubi.rb#222
+ def add_text(text); end
+
+ # Raise an exception, as the base engine class does not support handling other indicators.
+ #
+ # @raise [ArgumentError]
+ #
+ # source://erubi//lib/erubi.rb#267
+ def handle(indicator, code, tailch, rspace, lspace); end
+
+ # Make sure that any current expression has been terminated.
+ # The default is to terminate all expressions, but when
+ # the chain_appends option is used, expressions may not be
+ # terminated.
+ #
+ # source://erubi//lib/erubi.rb#295
+ def terminate_expression; end
+
+ # Make sure the buffer variable is the target of the next append
+ # before yielding to the block. Mark that the buffer is the target
+ # of the next append after the block executes.
+ #
+ # This method should only be called if the block will result in
+ # code where << will append to the bufvar.
+ #
+ # source://erubi//lib/erubi.rb#277
+ def with_buffer; end
+end
+
+# The default regular expression used for scanning.
+#
+# source://erubi//lib/erubi.rb#53
+Erubi::Engine::DEFAULT_REGEXP = T.let(T.unsafe(nil), Regexp)
+
+# source://erubi//lib/erubi.rb#17
+Erubi::FREEZE_TEMPLATE_LITERALS = T.let(T.unsafe(nil), TrueClass)
+
+# source://erubi//lib/erubi.rb#15
+Erubi::MATCH_METHOD = T.let(T.unsafe(nil), Symbol)
+
+# source://erubi//lib/erubi.rb#8
+Erubi::RANGE_FIRST = T.let(T.unsafe(nil), Integer)
+
+# source://erubi//lib/erubi.rb#9
+Erubi::RANGE_LAST = T.let(T.unsafe(nil), Integer)
+
+# source://erubi//lib/erubi.rb#16
+Erubi::SKIP_DEFINED_FOR_INSTANCE_VARIABLE = T.let(T.unsafe(nil), TrueClass)
+
+# source://erubi//lib/erubi.rb#4
+Erubi::VERSION = T.let(T.unsafe(nil), String)
diff --git a/sorbet/rbi/gems/i18n@1.14.8.rbi b/sorbet/rbi/gems/i18n@1.14.8.rbi
new file mode 100644
index 0000000..0dea2a9
--- /dev/null
+++ b/sorbet/rbi/gems/i18n@1.14.8.rbi
@@ -0,0 +1,2383 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `i18n` gem.
+# Please instead update this file by running `bin/tapioca gem i18n`.
+
+
+# source://i18n//lib/i18n/gettext/po_parser.rb#15
+module GetText; end
+
+# source://i18n//lib/i18n/gettext/po_parser.rb#17
+class GetText::PoParser < ::Racc::Parser
+ # source://i18n//lib/i18n/gettext/po_parser.rb#19
+ def _(x); end
+
+ # source://i18n//lib/i18n/gettext/po_parser.rb#282
+ def _reduce_10(val, _values, result); end
+
+ # source://i18n//lib/i18n/gettext/po_parser.rb#295
+ def _reduce_12(val, _values, result); end
+
+ # source://i18n//lib/i18n/gettext/po_parser.rb#302
+ def _reduce_13(val, _values, result); end
+
+ # source://i18n//lib/i18n/gettext/po_parser.rb#309
+ def _reduce_14(val, _values, result); end
+
+ # source://i18n//lib/i18n/gettext/po_parser.rb#316
+ def _reduce_15(val, _values, result); end
+
+ # source://i18n//lib/i18n/gettext/po_parser.rb#235
+ def _reduce_5(val, _values, result); end
+
+ # source://i18n//lib/i18n/gettext/po_parser.rb#246
+ def _reduce_8(val, _values, result); end
+
+ # source://i18n//lib/i18n/gettext/po_parser.rb#264
+ def _reduce_9(val, _values, result); end
+
+ # source://i18n//lib/i18n/gettext/po_parser.rb#323
+ def _reduce_none(val, _values, result); end
+
+ # source://i18n//lib/i18n/gettext/po_parser.rb#23
+ def next_token; end
+
+ # source://i18n//lib/i18n/gettext/po_parser.rb#23
+ def on_comment(comment); end
+
+ # source://i18n//lib/i18n/gettext/po_parser.rb#23
+ def on_message(msgid, msgstr); end
+
+ # source://i18n//lib/i18n/gettext/po_parser.rb#23
+ def parse(str, data, ignore_fuzzy = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/gettext/po_parser.rb#23
+ def unescape(orig); end
+end
+
+# source://i18n//lib/i18n/gettext/po_parser.rb#184
+GetText::PoParser::Racc_arg = T.let(T.unsafe(nil), Array)
+
+# source://i18n//lib/i18n/gettext/po_parser.rb#221
+GetText::PoParser::Racc_debug_parser = T.let(T.unsafe(nil), TrueClass)
+
+# source://i18n//lib/i18n/gettext/po_parser.rb#200
+GetText::PoParser::Racc_token_to_s_table = T.let(T.unsafe(nil), Array)
+
+# Simple Locale tag implementation that computes subtags by simply splitting
+# the locale tag at '-' occurrences.
+#
+# source://i18n//lib/i18n/version.rb#3
+module I18n
+ extend ::I18n::Base
+
+ class << self
+ # source://i18n//lib/i18n/backend/cache.rb#64
+ def cache_key_digest; end
+
+ # source://i18n//lib/i18n/backend/cache.rb#68
+ def cache_key_digest=(key_digest); end
+
+ # source://i18n//lib/i18n/backend/cache.rb#56
+ def cache_namespace; end
+
+ # source://i18n//lib/i18n/backend/cache.rb#60
+ def cache_namespace=(namespace); end
+
+ # source://i18n//lib/i18n/backend/cache.rb#48
+ def cache_store; end
+
+ # source://i18n//lib/i18n/backend/cache.rb#52
+ def cache_store=(store); end
+
+ # Returns the current fallbacks implementation. Defaults to +I18n::Locale::Fallbacks+.
+ #
+ # source://i18n//lib/i18n/backend/fallbacks.rb#17
+ def fallbacks; end
+
+ # Sets the current fallbacks implementation. Use this to set a different fallbacks implementation.
+ #
+ # source://i18n//lib/i18n/backend/fallbacks.rb#23
+ def fallbacks=(fallbacks); end
+
+ # Return String or raises MissingInterpolationArgument exception.
+ # Missing argument's logic is handled by I18n.config.missing_interpolation_argument_handler.
+ #
+ # @raise [ReservedInterpolationKey]
+ #
+ # source://i18n//lib/i18n/interpolate/ruby.rb#23
+ def interpolate(string, values); end
+
+ # source://i18n//lib/i18n/interpolate/ruby.rb#29
+ def interpolate_hash(string, values); end
+
+ # source://i18n//lib/i18n.rb#38
+ def new_double_nested_cache; end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/cache.rb#72
+ def perform_caching?; end
+
+ # Marks a key as reserved. Reserved keys are used internally,
+ # and can't also be used for interpolation. If you are using any
+ # extra keys as I18n options, you should call I18n.reserve_key
+ # before any I18n.translate (etc) calls are made.
+ #
+ # source://i18n//lib/i18n.rb#46
+ def reserve_key(key); end
+
+ # source://i18n//lib/i18n.rb#51
+ def reserved_keys_pattern; end
+ end
+end
+
+# source://i18n//lib/i18n/exceptions.rb#14
+class I18n::ArgumentError < ::ArgumentError; end
+
+# source://i18n//lib/i18n/backend.rb#4
+module I18n::Backend; end
+
+# source://i18n//lib/i18n/backend/base.rb#8
+module I18n::Backend::Base
+ include ::I18n::Backend::Transliterator
+
+ # Returns an array of locales for which translations are available
+ # ignoring the reserved translation meta data key :i18n.
+ #
+ # @raise [NotImplementedError]
+ #
+ # source://i18n//lib/i18n/backend/base.rb#97
+ def available_locales; end
+
+ # source://i18n//lib/i18n/backend/base.rb#105
+ def eager_load!; end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/base.rb#71
+ def exists?(locale, key, options = T.unsafe(nil)); end
+
+ # Accepts a list of paths to translation files. Loads translations from
+ # plain Ruby (*.rb), YAML files (*.yml), or JSON files (*.json). See #load_rb, #load_yml, and #load_json
+ # for details.
+ #
+ # source://i18n//lib/i18n/backend/base.rb#14
+ def load_translations(*filenames); end
+
+ # Acts the same as +strftime+, but uses a localized version of the
+ # format string. Takes a key from the date/time formats translations as
+ # a format argument (e.g. , :short in :'date.formats' ).
+ #
+ # @raise [ArgumentError]
+ #
+ # source://i18n//lib/i18n/backend/base.rb#78
+ def localize(locale, object, format = T.unsafe(nil), options = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/backend/base.rb#101
+ def reload!; end
+
+ # This method receives a locale, a data hash and options for storing translations.
+ # Should be implemented
+ #
+ # @raise [NotImplementedError]
+ #
+ # source://i18n//lib/i18n/backend/base.rb#24
+ def store_translations(locale, data, options = T.unsafe(nil)); end
+
+ # @raise [I18n::ArgumentError]
+ #
+ # source://i18n//lib/i18n/backend/base.rb#28
+ def translate(locale, key, options = T.unsafe(nil)); end
+
+ protected
+
+ # Deep interpolation
+ #
+ # deep_interpolate { people: { ann: "Ann is %{ann}", john: "John is %{john}" } },
+ # ann: 'good', john: 'big'
+ # #=> { people: { ann: "Ann is good", john: "John is big" } }
+ #
+ # source://i18n//lib/i18n/backend/base.rb#217
+ def deep_interpolate(locale, data, values = T.unsafe(nil)); end
+
+ # Evaluates defaults.
+ # If given subject is an Array, it walks the array and returns the
+ # first translation that can be resolved. Otherwise it tries to resolve
+ # the translation directly.
+ #
+ # source://i18n//lib/i18n/backend/base.rb#128
+ def default(locale, object, subject, options = T.unsafe(nil)); end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/base.rb#111
+ def eager_loaded?; end
+
+ # Interpolates values into a given subject.
+ #
+ # if the given subject is a string then:
+ # method interpolates "file %{file} opened by %%{user}", :file => 'test.txt', :user => 'Mr. X'
+ # # => "file test.txt opened by %{user}"
+ #
+ # if the given subject is an array then:
+ # each element of the array is recursively interpolated (until it finds a string)
+ # method interpolates ["yes, %{user}", ["maybe no, %{user}", "no, %{user}"]], :user => "bartuz"
+ # # => ["yes, bartuz", ["maybe no, bartuz", "no, bartuz"]]
+ #
+ # source://i18n//lib/i18n/backend/base.rb#201
+ def interpolate(locale, subject, values = T.unsafe(nil)); end
+
+ # Loads a single translations file by delegating to #load_rb or
+ # #load_yml depending on the file extension and directly merges the
+ # data to the existing translations. Raises I18n::UnknownFileType
+ # for all other file extensions.
+ #
+ # @raise [UnknownFileType]
+ #
+ # source://i18n//lib/i18n/backend/base.rb#240
+ def load_file(filename); end
+
+ # Loads a JSON translations file. The data must have locales as
+ # toplevel keys.
+ #
+ # source://i18n//lib/i18n/backend/base.rb#276
+ def load_json(filename); end
+
+ # Loads a plain Ruby translations file. eval'ing the file must yield
+ # a Hash containing translation data with locales as toplevel keys.
+ #
+ # source://i18n//lib/i18n/backend/base.rb#254
+ def load_rb(filename); end
+
+ # Loads a YAML translations file. The data must have locales as
+ # toplevel keys.
+ #
+ # source://i18n//lib/i18n/backend/base.rb#272
+ def load_yaml(filename); end
+
+ # Loads a YAML translations file. The data must have locales as
+ # toplevel keys.
+ #
+ # source://i18n//lib/i18n/backend/base.rb#261
+ def load_yml(filename); end
+
+ # The method which actually looks up for the translation in the store.
+ #
+ # @raise [NotImplementedError]
+ #
+ # source://i18n//lib/i18n/backend/base.rb#116
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/backend/base.rb#308
+ def pluralization_key(entry, count); end
+
+ # Picks a translation from a pluralized mnemonic subkey according to English
+ # pluralization rules :
+ # - It will pick the :one subkey if count is equal to 1.
+ # - It will pick the :other subkey otherwise.
+ # - It will pick the :zero subkey in the special case where count is
+ # equal to 0 and there is a :zero subkey present. This behaviour is
+ # not standard with regards to the CLDR pluralization rules.
+ # Other backends can implement more flexible or complex pluralization rules.
+ #
+ # @raise [InvalidPluralizationData]
+ #
+ # source://i18n//lib/i18n/backend/base.rb#182
+ def pluralize(locale, entry, count); end
+
+ # Resolves a translation.
+ # If the given subject is a Symbol, it will be translated with the
+ # given options. If it is a Proc then it will be evaluated. All other
+ # subjects will be returned directly.
+ #
+ # source://i18n//lib/i18n/backend/base.rb#150
+ def resolve(locale, object, subject, options = T.unsafe(nil)); end
+
+ # Resolves a translation.
+ # If the given subject is a Symbol, it will be translated with the
+ # given options. If it is a Proc then it will be evaluated. All other
+ # subjects will be returned directly.
+ #
+ # source://i18n//lib/i18n/backend/base.rb#172
+ def resolve_entry(locale, object, subject, options = T.unsafe(nil)); end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/base.rb#120
+ def subtrees?; end
+
+ # source://i18n//lib/i18n/backend/base.rb#289
+ def translate_localization_format(locale, object, format, options); end
+end
+
+# TODO Should the cache be cleared if new translations are stored?
+#
+# source://i18n//lib/i18n/backend/cache.rb#79
+module I18n::Backend::Cache
+ # source://i18n//lib/i18n/backend/cache.rb#80
+ def translate(locale, key, options = T.unsafe(nil)); end
+
+ protected
+
+ # source://i18n//lib/i18n/backend/cache.rb#93
+ def _fetch(cache_key, &block); end
+
+ # source://i18n//lib/i18n/backend/cache.rb#101
+ def cache_key(locale, key, options); end
+
+ # source://i18n//lib/i18n/backend/cache.rb#86
+ def fetch(cache_key, &block); end
+
+ private
+
+ # source://i18n//lib/i18n/backend/cache.rb#108
+ def digest_item(key); end
+end
+
+# Overwrites the Base load_file method to cache loaded file contents.
+#
+# source://i18n//lib/i18n/backend/cache_file.rb#8
+module I18n::Backend::CacheFile
+ # Optionally provide path_roots array to normalize filename paths,
+ # to make the cached i18n data portable across environments.
+ #
+ # source://i18n//lib/i18n/backend/cache_file.rb#11
+ def path_roots; end
+
+ # Optionally provide path_roots array to normalize filename paths,
+ # to make the cached i18n data portable across environments.
+ #
+ # source://i18n//lib/i18n/backend/cache_file.rb#11
+ def path_roots=(_arg0); end
+
+ protected
+
+ # Track loaded translation files in the `i18n.load_file` scope,
+ # and skip loading the file if its contents are still up-to-date.
+ #
+ # source://i18n//lib/i18n/backend/cache_file.rb#17
+ def load_file(filename); end
+
+ # Translate absolute filename to relative path for i18n key.
+ #
+ # source://i18n//lib/i18n/backend/cache_file.rb#28
+ def normalized_path(file); end
+end
+
+# source://i18n//lib/i18n/backend/cascade.rb#35
+module I18n::Backend::Cascade
+ # source://i18n//lib/i18n/backend/cascade.rb#36
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
+end
+
+# Backend that chains multiple other backends and checks each of them when
+# a translation needs to be looked up. This is useful when you want to use
+# standard translations with a Simple backend but store custom application
+# translations in a database or other backends.
+#
+# To use the Chain backend instantiate it and set it to the I18n module.
+# You can add chained backends through the initializer or backends
+# accessor:
+#
+# # preserves the existing Simple backend set to I18n.backend
+# I18n.backend = I18n::Backend::Chain.new(I18n::Backend::ActiveRecord.new, I18n.backend)
+#
+# The implementation assumes that all backends added to the Chain implement
+# a lookup method with the same API as Simple backend does.
+#
+# Fallback translations using the :default option are only used by the last backend of a chain.
+#
+# source://i18n//lib/i18n/backend/chain.rb#21
+class I18n::Backend::Chain
+ include ::I18n::Backend::Transliterator
+ include ::I18n::Backend::Base
+ include ::I18n::Backend::Chain::Implementation
+end
+
+# source://i18n//lib/i18n/backend/chain.rb#22
+module I18n::Backend::Chain::Implementation
+ include ::I18n::Backend::Transliterator
+ include ::I18n::Backend::Base
+
+ # source://i18n//lib/i18n/backend/chain.rb#27
+ def initialize(*backends); end
+
+ # source://i18n//lib/i18n/backend/chain.rb#52
+ def available_locales; end
+
+ # Returns the value of attribute backends.
+ #
+ # source://i18n//lib/i18n/backend/chain.rb#25
+ def backends; end
+
+ # Sets the attribute backends
+ #
+ # @param value the value to set the attribute backends to.
+ #
+ # source://i18n//lib/i18n/backend/chain.rb#25
+ def backends=(_arg0); end
+
+ # source://i18n//lib/i18n/backend/chain.rb#44
+ def eager_load!; end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/chain.rb#76
+ def exists?(locale, key, options = T.unsafe(nil)); end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/chain.rb#31
+ def initialized?; end
+
+ # source://i18n//lib/i18n/backend/chain.rb#82
+ def localize(locale, object, format = T.unsafe(nil), options = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/backend/chain.rb#40
+ def reload!; end
+
+ # source://i18n//lib/i18n/backend/chain.rb#48
+ def store_translations(locale, data, options = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/backend/chain.rb#56
+ def translate(locale, key, default_options = T.unsafe(nil)); end
+
+ protected
+
+ # source://i18n//lib/i18n/backend/chain.rb#92
+ def init_translations; end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/chain.rb#108
+ def namespace_lookup?(result, options); end
+
+ # source://i18n//lib/i18n/backend/chain.rb#98
+ def translations; end
+
+ private
+
+ # This is approximately what gets used in ActiveSupport.
+ # However since we are not guaranteed to run in an ActiveSupport context
+ # it is wise to have our own copy. We underscore it
+ # to not pollute the namespace of the including class.
+ #
+ # source://i18n//lib/i18n/backend/chain.rb#117
+ def _deep_merge(hash, other_hash); end
+end
+
+# source://i18n//lib/i18n/backend/fallbacks.rb#30
+module I18n::Backend::Fallbacks
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/fallbacks.rb#98
+ def exists?(locale, key, options = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/backend/fallbacks.rb#89
+ def extract_non_symbol_default!(options); end
+
+ # source://i18n//lib/i18n/backend/fallbacks.rb#67
+ def resolve_entry(locale, object, subject, options = T.unsafe(nil)); end
+
+ # Overwrites the Base backend translate method so that it will try each
+ # locale given by I18n.fallbacks for the given locale. E.g. for the
+ # locale :"de-DE" it might try the locales :"de-DE", :de and :en
+ # (depends on the fallbacks implementation) until it finds a result with
+ # the given options. If it does not find any result for any of the
+ # locales it will then throw MissingTranslation as usual.
+ #
+ # The default option takes precedence over fallback locales only when
+ # it's a Symbol. When the default contains a String, Proc or Hash
+ # it is evaluated last after all the fallback locales have been tried.
+ #
+ # source://i18n//lib/i18n/backend/fallbacks.rb#41
+ def translate(locale, key, options = T.unsafe(nil)); end
+
+ private
+
+ # Overwrite on_fallback to add specified logic when the fallback succeeds.
+ #
+ # source://i18n//lib/i18n/backend/fallbacks.rb#114
+ def on_fallback(_original_locale, _fallback_locale, _key, _options); end
+end
+
+# This module contains several helpers to assist flattening translations.
+# You may want to flatten translations for:
+#
+# 1) speed up lookups, as in the Memoize backend;
+# 2) In case you want to store translations in a data store, as in ActiveRecord backend;
+#
+# You can check both backends above for some examples.
+# This module also keeps all links in a hash so they can be properly resolved when flattened.
+#
+# source://i18n//lib/i18n/backend/flatten.rb#13
+module I18n::Backend::Flatten
+ # Flatten keys for nested Hashes by chaining up keys:
+ #
+ # >> { "a" => { "b" => { "c" => "d", "e" => "f" }, "g" => "h" }, "i" => "j"}.wind
+ # => { "a.b.c" => "d", "a.b.e" => "f", "a.g" => "h", "i" => "j" }
+ #
+ # source://i18n//lib/i18n/backend/flatten.rb#59
+ def flatten_keys(hash, escape, prev_key = T.unsafe(nil), &block); end
+
+ # Receives a hash of translations (where the key is a locale and
+ # the value is another hash) and return a hash with all
+ # translations flattened.
+ #
+ # Nested hashes are included in the flattened hash just if subtree
+ # is true and Symbols are automatically stored as links.
+ #
+ # source://i18n//lib/i18n/backend/flatten.rb#74
+ def flatten_translations(locale, data, escape, subtree); end
+
+ # Store flattened links.
+ #
+ # source://i18n//lib/i18n/backend/flatten.rb#50
+ def links; end
+
+ # Shortcut to I18n::Backend::Flatten.normalize_flat_keys
+ # and then resolve_links.
+ #
+ # source://i18n//lib/i18n/backend/flatten.rb#44
+ def normalize_flat_keys(locale, key, scope, separator); end
+
+ protected
+
+ # source://i18n//lib/i18n/backend/flatten.rb#112
+ def escape_default_separator(key); end
+
+ # source://i18n//lib/i18n/backend/flatten.rb#106
+ def find_link(locale, key); end
+
+ # source://i18n//lib/i18n/backend/flatten.rb#93
+ def resolve_link(locale, key); end
+
+ # source://i18n//lib/i18n/backend/flatten.rb#89
+ def store_link(locale, key, link); end
+
+ class << self
+ # Receives a string and escape the default separator.
+ #
+ # source://i18n//lib/i18n/backend/flatten.rb#38
+ def escape_default_separator(key); end
+
+ # normalize_keys the flatten way. This method is significantly faster
+ # and creates way less objects than the one at I18n.normalize_keys.
+ # It also handles escaping the translation keys.
+ #
+ # source://i18n//lib/i18n/backend/flatten.rb#20
+ def normalize_flat_keys(locale, key, scope, separator); end
+ end
+end
+
+# source://i18n//lib/i18n/backend/flatten.rb#15
+I18n::Backend::Flatten::FLATTEN_SEPARATOR = T.let(T.unsafe(nil), String)
+
+# source://i18n//lib/i18n/backend/flatten.rb#14
+I18n::Backend::Flatten::SEPARATOR_ESCAPE_CHAR = T.let(T.unsafe(nil), String)
+
+# Experimental support for using Gettext po files to store translations.
+#
+# To use this you can simply include the module to the Simple backend - or
+# whatever other backend you are using.
+#
+# I18n::Backend::Simple.include(I18n::Backend::Gettext)
+#
+# Now you should be able to include your Gettext translation (*.po) files to
+# the +I18n.load_path+ so they're loaded to the backend and you can use them as
+# usual:
+#
+# I18n.load_path += Dir["path/to/locales/*.po"]
+#
+# Following the Gettext convention this implementation expects that your
+# translation files are named by their locales. E.g. the file en.po would
+# contain the translations for the English locale.
+#
+# To translate text you must use one of the translate methods provided by
+# I18n::Gettext::Helpers.
+#
+# include I18n::Gettext::Helpers
+# puts _("some string")
+#
+# Without it strings containing periods (".") will not be translated.
+#
+# source://i18n//lib/i18n/backend/gettext.rb#33
+module I18n::Backend::Gettext
+ protected
+
+ # source://i18n//lib/i18n/backend/gettext.rb#41
+ def load_po(filename); end
+
+ # source://i18n//lib/i18n/backend/gettext.rb#51
+ def normalize(locale, data); end
+
+ # source://i18n//lib/i18n/backend/gettext.rb#68
+ def normalize_pluralization(locale, key, value); end
+
+ # source://i18n//lib/i18n/backend/gettext.rb#47
+ def parse(filename); end
+end
+
+# source://i18n//lib/i18n/backend/gettext.rb#34
+class I18n::Backend::Gettext::PoData < ::Hash
+ # source://i18n//lib/i18n/backend/gettext.rb#35
+ def set_comment(msgid_or_sym, comment); end
+end
+
+# source://i18n//lib/i18n/backend/interpolation_compiler.rb#20
+module I18n::Backend::InterpolationCompiler
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#98
+ def interpolate(locale, string, values); end
+
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#108
+ def store_translations(locale, data, options = T.unsafe(nil)); end
+
+ protected
+
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#114
+ def compile_all_strings_in(data); end
+end
+
+# source://i18n//lib/i18n/backend/interpolation_compiler.rb#21
+module I18n::Backend::InterpolationCompiler::Compiler
+ extend ::I18n::Backend::InterpolationCompiler::Compiler
+
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#26
+ def compile_if_an_interpolation(string); end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#39
+ def interpolated_str?(str); end
+
+ protected
+
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#59
+ def compile_interpolation_token(key); end
+
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#49
+ def compiled_interpolation_body(str); end
+
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#72
+ def direct_key(key); end
+
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#92
+ def escape_key_sym(key); end
+
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#88
+ def escape_plain_str(str); end
+
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#55
+ def handle_interpolation_token(token); end
+
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#68
+ def interpolate_key(key); end
+
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#63
+ def interpolate_or_raise_missing(key); end
+
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#80
+ def missing_key(key); end
+
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#76
+ def nil_key(key); end
+
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#84
+ def reserved_key(key); end
+
+ # tokenize("foo %{bar} baz %%{buz}") # => ["foo ", "%{bar}", " baz ", "%%{buz}"]
+ #
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#45
+ def tokenize(str); end
+end
+
+# source://i18n//lib/i18n/backend/interpolation_compiler.rb#24
+I18n::Backend::InterpolationCompiler::Compiler::TOKENIZER = T.let(T.unsafe(nil), Regexp)
+
+# This is a basic backend for key value stores. It receives on
+# initialization the store, which should respond to three methods:
+#
+# * store#[](key) - Used to get a value
+# * store#[]=(key, value) - Used to set a value
+# * store#keys - Used to get all keys
+#
+# Since these stores only supports string, all values are converted
+# to JSON before being stored, allowing it to also store booleans,
+# hashes and arrays. However, this store does not support Procs.
+#
+# As the ActiveRecord backend, Symbols are just supported when loading
+# translations from the filesystem or through explicit store translations.
+#
+# Also, avoid calling I18n.available_locales since it's a somehow
+# expensive operation in most stores.
+#
+# == Example
+#
+# To setup I18n to use TokyoCabinet in memory is quite straightforward:
+#
+# require 'rufus/tokyo/cabinet' # gem install rufus-tokyo
+# I18n.backend = I18n::Backend::KeyValue.new(Rufus::Tokyo::Cabinet.new('*'))
+#
+# == Performance
+#
+# You may make this backend even faster by including the Memoize module.
+# However, notice that you should properly clear the cache if you change
+# values directly in the key-store.
+#
+# == Subtrees
+#
+# In most backends, you are allowed to retrieve part of a translation tree:
+#
+# I18n.backend.store_translations :en, :foo => { :bar => :baz }
+# I18n.t "foo" #=> { :bar => :baz }
+#
+# This backend supports this feature by default, but it slows down the storage
+# of new data considerably and makes hard to delete entries. That said, you are
+# allowed to disable the storage of subtrees on initialization:
+#
+# I18n::Backend::KeyValue.new(@store, false)
+#
+# This is useful if you are using a KeyValue backend chained to a Simple backend.
+#
+# source://i18n//lib/i18n/backend/key_value.rb#69
+class I18n::Backend::KeyValue
+ include ::I18n::Backend::Flatten
+ include ::I18n::Backend::Transliterator
+ include ::I18n::Backend::Base
+ include ::I18n::Backend::KeyValue::Implementation
+end
+
+# source://i18n//lib/i18n/backend/key_value.rb#70
+module I18n::Backend::KeyValue::Implementation
+ include ::I18n::Backend::Flatten
+ include ::I18n::Backend::Transliterator
+ include ::I18n::Backend::Base
+
+ # source://i18n//lib/i18n/backend/key_value.rb#75
+ def initialize(store, subtrees = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/backend/key_value.rb#102
+ def available_locales; end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/key_value.rb#79
+ def initialized?; end
+
+ # Returns the value of attribute store.
+ #
+ # source://i18n//lib/i18n/backend/key_value.rb#71
+ def store; end
+
+ # Sets the attribute store
+ #
+ # @param value the value to set the attribute store to.
+ #
+ # source://i18n//lib/i18n/backend/key_value.rb#71
+ def store=(_arg0); end
+
+ # source://i18n//lib/i18n/backend/key_value.rb#83
+ def store_translations(locale, data, options = T.unsafe(nil)); end
+
+ protected
+
+ # source://i18n//lib/i18n/backend/key_value.rb#124
+ def init_translations; end
+
+ # source://i18n//lib/i18n/backend/key_value.rb#136
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/backend/key_value.rb#150
+ def pluralize(locale, entry, count); end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/key_value.rb#132
+ def subtrees?; end
+
+ # Queries the translations from the key-value store and converts
+ # them into a hash such as the one returned from loading the
+ # haml files
+ #
+ # source://i18n//lib/i18n/backend/key_value.rb#115
+ def translations; end
+end
+
+# source://i18n//lib/i18n/backend/key_value.rb#161
+class I18n::Backend::KeyValue::SubtreeProxy
+ # @return [SubtreeProxy] a new instance of SubtreeProxy
+ #
+ # source://i18n//lib/i18n/backend/key_value.rb#162
+ def initialize(master_key, store); end
+
+ # source://i18n//lib/i18n/backend/key_value.rb#172
+ def [](key); end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/key_value.rb#168
+ def has_key?(key); end
+
+ # source://i18n//lib/i18n/backend/key_value.rb#196
+ def inspect; end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/key_value.rb#188
+ def instance_of?(klass); end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/key_value.rb#183
+ def is_a?(klass); end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/key_value.rb#186
+ def kind_of?(klass); end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/key_value.rb#192
+ def nil?; end
+end
+
+# source://i18n//lib/i18n/backend/lazy_loadable.rb#65
+class I18n::Backend::LazyLoadable < ::I18n::Backend::Simple
+ # @return [LazyLoadable] a new instance of LazyLoadable
+ #
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#66
+ def initialize(lazy_load: T.unsafe(nil)); end
+
+ # Parse the load path and extract all locales.
+ #
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#99
+ def available_locales; end
+
+ # Eager loading is not supported in the lazy context.
+ #
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#90
+ def eager_load!; end
+
+ # Returns whether the current locale is initialized.
+ #
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#71
+ def initialized?; end
+
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#107
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
+
+ # Clean up translations and uninitialize all locales.
+ #
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#80
+ def reload!; end
+
+ protected
+
+ # Load translations from files that belong to the current locale.
+ #
+ # @raise [InvalidFilenames]
+ #
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#121
+ def init_translations; end
+
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#133
+ def initialized_locales; end
+
+ private
+
+ # Checks if a filename is named in correspondence to the translations it loaded.
+ # The locale extracted from the path must be the single locale loaded in the translations.
+ #
+ # @raise [FilenameIncorrect]
+ #
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#175
+ def assert_file_named_correctly!(file, translations); end
+
+ # Select all files from I18n load path that belong to current locale.
+ # These files must start with the locale identifier (ie. "en", "pt-BR"),
+ # followed by an "_" demarcation to separate proceeding text.
+ #
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#167
+ def filenames_for_current_locale; end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#139
+ def lazy_load?; end
+
+ # Loads each file supplied and asserts that the file only loads
+ # translations as expected by the name. The method returns a list of
+ # errors corresponding to offending files.
+ #
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#152
+ def load_translations_and_collect_file_errors(files); end
+end
+
+# source://i18n//lib/i18n/backend/lazy_loadable.rb#143
+class I18n::Backend::LazyLoadable::FilenameIncorrect < ::StandardError
+ # @return [FilenameIncorrect] a new instance of FilenameIncorrect
+ #
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#144
+ def initialize(file, expected_locale, unexpected_locales); end
+end
+
+# Backend that lazy loads translations based on the current locale. This
+# implementation avoids loading all translations up front. Instead, it only
+# loads the translations that belong to the current locale. This offers a
+# performance incentive in local development and test environments for
+# applications with many translations for many different locales. It's
+# particularly useful when the application only refers to a single locales'
+# translations at a time (ex. A Rails workload). The implementation
+# identifies which translation files from the load path belong to the
+# current locale by pattern matching against their path name.
+#
+# Specifically, a translation file is considered to belong to a locale if:
+# a) the filename is in the I18n load path
+# b) the filename ends in a supported extension (ie. .yml, .json, .po, .rb)
+# c) the filename starts with the locale identifier
+# d) the locale identifier and optional proceeding text is separated by an underscore, ie. "_".
+#
+# Examples:
+# Valid files that will be selected by this backend:
+#
+# "files/locales/en_translation.yml" (Selected for locale "en")
+# "files/locales/fr.po" (Selected for locale "fr")
+#
+# Invalid files that won't be selected by this backend:
+#
+# "files/locales/translation-file"
+# "files/locales/en-translation.unsupported"
+# "files/locales/french/translation.yml"
+# "files/locales/fr/translation.yml"
+#
+# The implementation uses this assumption to defer the loading of
+# translation files until the current locale actually requires them.
+#
+# The backend has two working modes: lazy_load and eager_load.
+#
+# Note: This backend should only be enabled in test environments!
+# When the mode is set to false, the backend behaves exactly like the
+# Simple backend, with an additional check that the paths being loaded
+# abide by the format. If paths can't be matched to the format, an error is raised.
+#
+# You can configure lazy loaded backends through the initializer or backends
+# accessor:
+#
+# # In test environments
+#
+# I18n.backend = I18n::Backend::LazyLoadable.new(lazy_load: true)
+#
+# # In other environments, such as production and CI
+#
+# I18n.backend = I18n::Backend::LazyLoadable.new(lazy_load: false) # default
+#
+# source://i18n//lib/i18n/backend/lazy_loadable.rb#55
+class I18n::Backend::LocaleExtractor
+ class << self
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#57
+ def locale_from_path(path); end
+ end
+end
+
+# source://i18n//lib/i18n/backend/memoize.rb#14
+module I18n::Backend::Memoize
+ # source://i18n//lib/i18n/backend/memoize.rb#15
+ def available_locales; end
+
+ # source://i18n//lib/i18n/backend/memoize.rb#29
+ def eager_load!; end
+
+ # source://i18n//lib/i18n/backend/memoize.rb#24
+ def reload!; end
+
+ # source://i18n//lib/i18n/backend/memoize.rb#19
+ def store_translations(locale, data, options = T.unsafe(nil)); end
+
+ protected
+
+ # source://i18n//lib/i18n/backend/memoize.rb#37
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/backend/memoize.rb#44
+ def memoized_lookup; end
+
+ # source://i18n//lib/i18n/backend/memoize.rb#48
+ def reset_memoizations!(locale = T.unsafe(nil)); end
+end
+
+# source://i18n//lib/i18n/backend/metadata.rb#21
+module I18n::Backend::Metadata
+ # source://i18n//lib/i18n/backend/metadata.rb#52
+ def interpolate(locale, entry, values = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/backend/metadata.rb#57
+ def pluralize(locale, entry, count); end
+
+ # source://i18n//lib/i18n/backend/metadata.rb#40
+ def translate(locale, key, options = T.unsafe(nil)); end
+
+ protected
+
+ # source://i18n//lib/i18n/backend/metadata.rb#63
+ def with_metadata(metadata, &block); end
+
+ class << self
+ # @private
+ #
+ # source://i18n//lib/i18n/backend/metadata.rb#23
+ def included(base); end
+ end
+end
+
+# source://i18n//lib/i18n/backend/pluralization.rb#16
+module I18n::Backend::Pluralization
+ # Overwrites the Base backend translate method so that it will check the
+ # translation meta data space (:i18n) for a locale specific pluralization
+ # rule and use it to pluralize the given entry. I.e., the library expects
+ # pluralization rules to be stored at I18n.t(:'i18n.plural.rule')
+ #
+ # Pluralization rules are expected to respond to #call(count) and
+ # return a pluralization key. Valid keys depend on the pluralization
+ # rules for the locale, as defined in the CLDR.
+ # As of v41, 6 locale-specific plural categories are defined:
+ # :few, :many, :one, :other, :two, :zero
+ #
+ # n.b., The :one plural category does not imply the number 1.
+ # Instead, :one is a category for any number that behaves like 1 in
+ # that locale. For example, in some locales, :one is used for numbers
+ # that end in "1" (like 1, 21, 151) but that don't end in
+ # 11 (like 11, 111, 10311).
+ # Similar notes apply to the :two, and :zero plural categories.
+ #
+ # If you want to have different strings for the categories of count == 0
+ # (e.g. "I don't have any cars") or count == 1 (e.g. "I have a single car")
+ # use the explicit `"0"` and `"1"` keys.
+ # https://unicode-org.github.io/cldr/ldml/tr35-numbers.html#Explicit_0_1_rules
+ #
+ # source://i18n//lib/i18n/backend/pluralization.rb#39
+ def pluralize(locale, entry, count); end
+
+ protected
+
+ # source://i18n//lib/i18n/backend/pluralization.rb#81
+ def pluralizer(locale); end
+
+ # source://i18n//lib/i18n/backend/pluralization.rb#77
+ def pluralizers; end
+
+ private
+
+ # Normalizes categories of 0.0 and 1.0
+ # and returns the symbolic version
+ #
+ # source://i18n//lib/i18n/backend/pluralization.rb#89
+ def symbolic_count(count); end
+end
+
+# A simple backend that reads translations from YAML files and stores them in
+# an in-memory hash. Relies on the Base backend.
+#
+# The implementation is provided by a Implementation module allowing to easily
+# extend Simple backend's behavior by including modules. E.g.:
+#
+# module I18n::Backend::Pluralization
+# def pluralize(*args)
+# # extended pluralization logic
+# super
+# end
+# end
+#
+# I18n::Backend::Simple.include(I18n::Backend::Pluralization)
+#
+# source://i18n//lib/i18n/backend/simple.rb#21
+class I18n::Backend::Simple
+ include ::I18n::Backend::Transliterator
+ include ::I18n::Backend::Base
+ include ::I18n::Backend::Simple::Implementation
+end
+
+# source://i18n//lib/i18n/backend/simple.rb#22
+module I18n::Backend::Simple::Implementation
+ include ::I18n::Backend::Transliterator
+ include ::I18n::Backend::Base
+
+ # Get available locales from the translations hash
+ #
+ # source://i18n//lib/i18n/backend/simple.rb#49
+ def available_locales; end
+
+ # source://i18n//lib/i18n/backend/simple.rb#64
+ def eager_load!; end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/backend/simple.rb#28
+ def initialized?; end
+
+ # Clean up translations hash and set initialized to false on reload!
+ #
+ # source://i18n//lib/i18n/backend/simple.rb#58
+ def reload!; end
+
+ # Stores translations for the given locale in memory.
+ # This uses a deep merge for the translations hash, so existing
+ # translations will be overwritten by new ones only at the deepest
+ # level of the hash.
+ #
+ # source://i18n//lib/i18n/backend/simple.rb#36
+ def store_translations(locale, data, options = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/backend/simple.rb#69
+ def translations(do_init: T.unsafe(nil)); end
+
+ protected
+
+ # source://i18n//lib/i18n/backend/simple.rb#83
+ def init_translations; end
+
+ # Looks up a translation from the translations hash. Returns nil if
+ # either key is nil, or locale, scope or key do not exist as a key in the
+ # nested translations hash. Splits keys or scopes containing dots
+ # into multiple keys, i.e. currency.format is regarded the same as
+ # %w(currency format) .
+ #
+ # source://i18n//lib/i18n/backend/simple.rb#93
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
+end
+
+# Mutex to ensure that concurrent translations loading will be thread-safe
+#
+# source://i18n//lib/i18n/backend/simple.rb#26
+I18n::Backend::Simple::Implementation::MUTEX = T.let(T.unsafe(nil), Thread::Mutex)
+
+# source://i18n//lib/i18n/backend/transliterator.rb#6
+module I18n::Backend::Transliterator
+ # Given a locale and a UTF-8 string, return the locale's ASCII
+ # approximation for the string.
+ #
+ # source://i18n//lib/i18n/backend/transliterator.rb#11
+ def transliterate(locale, string, replacement = T.unsafe(nil)); end
+
+ class << self
+ # Get a transliterator instance.
+ #
+ # source://i18n//lib/i18n/backend/transliterator.rb#19
+ def get(rule = T.unsafe(nil)); end
+ end
+end
+
+# source://i18n//lib/i18n/backend/transliterator.rb#7
+I18n::Backend::Transliterator::DEFAULT_REPLACEMENT_CHAR = T.let(T.unsafe(nil), String)
+
+# A transliterator which accepts a Hash of characters as its translation
+# rule.
+#
+# source://i18n//lib/i18n/backend/transliterator.rb#42
+class I18n::Backend::Transliterator::HashTransliterator
+ # @return [HashTransliterator] a new instance of HashTransliterator
+ #
+ # source://i18n//lib/i18n/backend/transliterator.rb#74
+ def initialize(rule = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/backend/transliterator.rb#80
+ def transliterate(string, replacement = T.unsafe(nil)); end
+
+ private
+
+ # Add transliteration rules to the approximations hash.
+ #
+ # source://i18n//lib/i18n/backend/transliterator.rb#100
+ def add(hash); end
+
+ # source://i18n//lib/i18n/backend/transliterator.rb#93
+ def add_default_approximations; end
+
+ # source://i18n//lib/i18n/backend/transliterator.rb#89
+ def approximations; end
+end
+
+# source://i18n//lib/i18n/backend/transliterator.rb#43
+I18n::Backend::Transliterator::HashTransliterator::DEFAULT_APPROXIMATIONS = T.let(T.unsafe(nil), Hash)
+
+# A transliterator which accepts a Proc as its transliteration rule.
+#
+# source://i18n//lib/i18n/backend/transliterator.rb#30
+class I18n::Backend::Transliterator::ProcTransliterator
+ # @return [ProcTransliterator] a new instance of ProcTransliterator
+ #
+ # source://i18n//lib/i18n/backend/transliterator.rb#31
+ def initialize(rule); end
+
+ # source://i18n//lib/i18n/backend/transliterator.rb#35
+ def transliterate(string, replacement = T.unsafe(nil)); end
+end
+
+# source://i18n//lib/i18n.rb#55
+module I18n::Base
+ # source://i18n//lib/i18n.rb#70
+ def available_locales; end
+
+ # source://i18n//lib/i18n.rb#70
+ def available_locales=(value); end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n.rb#387
+ def available_locales_initialized?; end
+
+ # source://i18n//lib/i18n.rb#70
+ def backend; end
+
+ # source://i18n//lib/i18n.rb#70
+ def backend=(value); end
+
+ # Gets I18n configuration object.
+ #
+ # source://i18n//lib/i18n.rb#57
+ def config; end
+
+ # Sets I18n configuration object.
+ #
+ # source://i18n//lib/i18n.rb#63
+ def config=(value); end
+
+ # source://i18n//lib/i18n.rb#70
+ def default_locale; end
+
+ # source://i18n//lib/i18n.rb#70
+ def default_locale=(value); end
+
+ # source://i18n//lib/i18n.rb#70
+ def default_separator; end
+
+ # source://i18n//lib/i18n.rb#70
+ def default_separator=(value); end
+
+ # Tells the backend to load translations now. Used in situations like the
+ # Rails production environment. Backends can implement whatever strategy
+ # is useful.
+ #
+ # source://i18n//lib/i18n.rb#92
+ def eager_load!; end
+
+ # source://i18n//lib/i18n.rb#70
+ def enforce_available_locales; end
+
+ # Raises an InvalidLocale exception when the passed locale is not available.
+ #
+ # source://i18n//lib/i18n.rb#381
+ def enforce_available_locales!(locale); end
+
+ # source://i18n//lib/i18n.rb#70
+ def enforce_available_locales=(value); end
+
+ # source://i18n//lib/i18n.rb#70
+ def exception_handler; end
+
+ # source://i18n//lib/i18n.rb#70
+ def exception_handler=(value); end
+
+ # Returns true if a translation exists for a given key, otherwise returns false.
+ #
+ # @raise [Disabled]
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n.rb#266
+ def exists?(key, _locale = T.unsafe(nil), locale: T.unsafe(nil), **options); end
+
+ # Returns an array of interpolation keys for the given translation key
+ #
+ # *Examples*
+ #
+ # Suppose we have the following:
+ # I18n.t 'example.zero' == 'Zero interpolations'
+ # I18n.t 'example.one' == 'One interpolation %{foo}'
+ # I18n.t 'example.two' == 'Two interpolations %{foo} %{bar}'
+ # I18n.t 'example.three' == ['One %{foo}', 'Two %{bar}', 'Three %{baz}']
+ # I18n.t 'example.one', locale: :other == 'One interpolation %{baz}'
+ #
+ # Then we can expect the following results:
+ # I18n.interpolation_keys('example.zero') #=> []
+ # I18n.interpolation_keys('example.one') #=> ['foo']
+ # I18n.interpolation_keys('example.two') #=> ['foo', 'bar']
+ # I18n.interpolation_keys('example.three') #=> ['foo', 'bar', 'baz']
+ # I18n.interpolation_keys('one', scope: 'example', locale: :other) #=> ['baz']
+ # I18n.interpolation_keys('does-not-exist') #=> []
+ # I18n.interpolation_keys('example') #=> []
+ #
+ # @raise [I18n::ArgumentError]
+ #
+ # source://i18n//lib/i18n.rb#255
+ def interpolation_keys(key, **options); end
+
+ # Localizes certain objects, such as dates and numbers to local formatting.
+ #
+ # @raise [Disabled]
+ #
+ # source://i18n//lib/i18n.rb#344
+ def l(object, locale: T.unsafe(nil), format: T.unsafe(nil), **options); end
+
+ # source://i18n//lib/i18n.rb#70
+ def load_path; end
+
+ # source://i18n//lib/i18n.rb#70
+ def load_path=(value); end
+
+ # source://i18n//lib/i18n.rb#70
+ def locale; end
+
+ # source://i18n//lib/i18n.rb#70
+ def locale=(value); end
+
+ # Returns true when the passed locale, which can be either a String or a
+ # Symbol, is in the list of available locales. Returns false otherwise.
+ #
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n.rb#376
+ def locale_available?(locale); end
+
+ # Localizes certain objects, such as dates and numbers to local formatting.
+ #
+ # @raise [Disabled]
+ #
+ # source://i18n//lib/i18n.rb#336
+ def localize(object, locale: T.unsafe(nil), format: T.unsafe(nil), **options); end
+
+ # Merges the given locale, key and scope into a single array of keys.
+ # Splits keys that contain dots into multiple keys. Makes sure all
+ # keys are Symbols.
+ #
+ # source://i18n//lib/i18n.rb#364
+ def normalize_keys(locale, key, scope, separator = T.unsafe(nil)); end
+
+ # Tells the backend to reload translations. Used in situations like the
+ # Rails development environment. Backends can implement whatever strategy
+ # is useful.
+ #
+ # source://i18n//lib/i18n.rb#84
+ def reload!; end
+
+ # Translates, pluralizes and interpolates a given key using a given locale,
+ # scope, and default, as well as interpolation values.
+ #
+ # *LOOKUP*
+ #
+ # Translation data is organized as a nested hash using the upper-level keys
+ # as namespaces. E.g. , ActionView ships with the translation:
+ # :date => {:formats => {:short => "%b %d"}} .
+ #
+ # Translations can be looked up at any level of this hash using the key argument
+ # and the scope option. E.g. , in this example I18n.t :date
+ # returns the whole translations hash {:formats => {:short => "%b %d"}} .
+ #
+ # Key can be either a single key or a dot-separated key (both Strings and Symbols
+ # work). E.g. , the short format can be looked up using both:
+ # I18n.t 'date.formats.short'
+ # I18n.t :'date.formats.short'
+ #
+ # Scope can be either a single key, a dot-separated key or an array of keys
+ # or dot-separated keys. Keys and scopes can be combined freely. So these
+ # examples will all look up the same short date format:
+ # I18n.t 'date.formats.short'
+ # I18n.t 'formats.short', :scope => 'date'
+ # I18n.t 'short', :scope => 'date.formats'
+ # I18n.t 'short', :scope => %w(date formats)
+ #
+ # *INTERPOLATION*
+ #
+ # Translations can contain interpolation variables which will be replaced by
+ # values passed to #translate as part of the options hash, with the keys matching
+ # the interpolation variable names.
+ #
+ # E.g. , with a translation :foo => "foo %{bar}" the option
+ # value for the key +bar+ will be interpolated into the translation:
+ # I18n.t :foo, :bar => 'baz' # => 'foo baz'
+ #
+ # *PLURALIZATION*
+ #
+ # Translation data can contain pluralized translations. Pluralized translations
+ # are arrays of singular/plural versions of translations like ['Foo', 'Foos'] .
+ #
+ # Note that I18n::Backend::Simple only supports an algorithm for English
+ # pluralization rules. Other algorithms can be supported by custom backends.
+ #
+ # This returns the singular version of a pluralized translation:
+ # I18n.t :foo, :count => 1 # => 'Foo'
+ #
+ # These both return the plural version of a pluralized translation:
+ # I18n.t :foo, :count => 0 # => 'Foos'
+ # I18n.t :foo, :count => 2 # => 'Foos'
+ #
+ # The :count option can be used both for pluralization and interpolation.
+ # E.g. , with the translation
+ # :foo => ['%{count} foo', '%{count} foos'] , count will
+ # be interpolated to the pluralized translation:
+ # I18n.t :foo, :count => 1 # => '1 foo'
+ #
+ # *DEFAULTS*
+ #
+ # This returns the translation for :foo or default if no translation was found:
+ # I18n.t :foo, :default => 'default'
+ #
+ # This returns the translation for :foo or the translation for :bar if no
+ # translation for :foo was found:
+ # I18n.t :foo, :default => :bar
+ #
+ # Returns the translation for :foo or the translation for :bar
+ # or default if no translations for :foo and :bar were found.
+ # I18n.t :foo, :default => [:bar, 'default']
+ #
+ # BULK LOOKUP
+ #
+ # This returns an array with the translations for :foo and :bar .
+ # I18n.t [:foo, :bar]
+ #
+ # Can be used with dot-separated nested keys:
+ # I18n.t [:'baz.foo', :'baz.bar']
+ #
+ # Which is the same as using a scope option:
+ # I18n.t [:foo, :bar], :scope => :baz
+ #
+ # *LAMBDAS*
+ #
+ # Both translations and defaults can be given as Ruby lambdas. Lambdas will be
+ # called and passed the key and options.
+ #
+ # E.g. assuming the key :salutation resolves to:
+ # lambda { |key, options| options[:gender] == 'm' ? "Mr. #{options[:name]}" : "Mrs. #{options[:name]}" }
+ #
+ # Then I18n.t(:salutation, :gender => 'w', :name => 'Smith') will result in "Mrs. Smith".
+ #
+ # Note that the string returned by lambda will go through string interpolation too,
+ # so the following lambda would give the same result:
+ # lambda { |key, options| options[:gender] == 'm' ? "Mr. %{name}" : "Mrs. %{name}" }
+ #
+ # It is recommended to use/implement lambdas in an "idempotent" way. E.g. when
+ # a cache layer is put in front of I18n.translate it will generate a cache key
+ # from the argument values passed to #translate. Therefore your lambdas should
+ # always return the same translations/values per unique combination of argument
+ # values.
+ #
+ # Ruby 2.7+ keyword arguments warning
+ #
+ # This method uses keyword arguments.
+ # There is a breaking change in ruby that produces warning with ruby 2.7 and won't work as expected with ruby 3.0
+ # The "hash" parameter must be passed as keyword argument.
+ #
+ # Good:
+ # I18n.t(:salutation, :gender => 'w', :name => 'Smith')
+ # I18n.t(:salutation, **{ :gender => 'w', :name => 'Smith' })
+ # I18n.t(:salutation, **any_hash)
+ #
+ # Bad:
+ # I18n.t(:salutation, { :gender => 'w', :name => 'Smith' })
+ # I18n.t(:salutation, any_hash)
+ #
+ # @raise [Disabled]
+ #
+ # source://i18n//lib/i18n.rb#227
+ def t(key = T.unsafe(nil), throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), **options); end
+
+ # Wrapper for translate that adds :raise => true . With
+ # this option, if no translation is found, it will raise I18n::MissingTranslationData
+ #
+ # source://i18n//lib/i18n.rb#234
+ def t!(key, **options); end
+
+ # Translates, pluralizes and interpolates a given key using a given locale,
+ # scope, and default, as well as interpolation values.
+ #
+ # *LOOKUP*
+ #
+ # Translation data is organized as a nested hash using the upper-level keys
+ # as namespaces. E.g. , ActionView ships with the translation:
+ # :date => {:formats => {:short => "%b %d"}} .
+ #
+ # Translations can be looked up at any level of this hash using the key argument
+ # and the scope option. E.g. , in this example I18n.t :date
+ # returns the whole translations hash {:formats => {:short => "%b %d"}} .
+ #
+ # Key can be either a single key or a dot-separated key (both Strings and Symbols
+ # work). E.g. , the short format can be looked up using both:
+ # I18n.t 'date.formats.short'
+ # I18n.t :'date.formats.short'
+ #
+ # Scope can be either a single key, a dot-separated key or an array of keys
+ # or dot-separated keys. Keys and scopes can be combined freely. So these
+ # examples will all look up the same short date format:
+ # I18n.t 'date.formats.short'
+ # I18n.t 'formats.short', :scope => 'date'
+ # I18n.t 'short', :scope => 'date.formats'
+ # I18n.t 'short', :scope => %w(date formats)
+ #
+ # *INTERPOLATION*
+ #
+ # Translations can contain interpolation variables which will be replaced by
+ # values passed to #translate as part of the options hash, with the keys matching
+ # the interpolation variable names.
+ #
+ # E.g. , with a translation :foo => "foo %{bar}" the option
+ # value for the key +bar+ will be interpolated into the translation:
+ # I18n.t :foo, :bar => 'baz' # => 'foo baz'
+ #
+ # *PLURALIZATION*
+ #
+ # Translation data can contain pluralized translations. Pluralized translations
+ # are arrays of singular/plural versions of translations like ['Foo', 'Foos'] .
+ #
+ # Note that I18n::Backend::Simple only supports an algorithm for English
+ # pluralization rules. Other algorithms can be supported by custom backends.
+ #
+ # This returns the singular version of a pluralized translation:
+ # I18n.t :foo, :count => 1 # => 'Foo'
+ #
+ # These both return the plural version of a pluralized translation:
+ # I18n.t :foo, :count => 0 # => 'Foos'
+ # I18n.t :foo, :count => 2 # => 'Foos'
+ #
+ # The :count option can be used both for pluralization and interpolation.
+ # E.g. , with the translation
+ # :foo => ['%{count} foo', '%{count} foos'] , count will
+ # be interpolated to the pluralized translation:
+ # I18n.t :foo, :count => 1 # => '1 foo'
+ #
+ # *DEFAULTS*
+ #
+ # This returns the translation for :foo or default if no translation was found:
+ # I18n.t :foo, :default => 'default'
+ #
+ # This returns the translation for :foo or the translation for :bar if no
+ # translation for :foo was found:
+ # I18n.t :foo, :default => :bar
+ #
+ # Returns the translation for :foo or the translation for :bar
+ # or default if no translations for :foo and :bar were found.
+ # I18n.t :foo, :default => [:bar, 'default']
+ #
+ # BULK LOOKUP
+ #
+ # This returns an array with the translations for :foo and :bar .
+ # I18n.t [:foo, :bar]
+ #
+ # Can be used with dot-separated nested keys:
+ # I18n.t [:'baz.foo', :'baz.bar']
+ #
+ # Which is the same as using a scope option:
+ # I18n.t [:foo, :bar], :scope => :baz
+ #
+ # *LAMBDAS*
+ #
+ # Both translations and defaults can be given as Ruby lambdas. Lambdas will be
+ # called and passed the key and options.
+ #
+ # E.g. assuming the key :salutation resolves to:
+ # lambda { |key, options| options[:gender] == 'm' ? "Mr. #{options[:name]}" : "Mrs. #{options[:name]}" }
+ #
+ # Then I18n.t(:salutation, :gender => 'w', :name => 'Smith') will result in "Mrs. Smith".
+ #
+ # Note that the string returned by lambda will go through string interpolation too,
+ # so the following lambda would give the same result:
+ # lambda { |key, options| options[:gender] == 'm' ? "Mr. %{name}" : "Mrs. %{name}" }
+ #
+ # It is recommended to use/implement lambdas in an "idempotent" way. E.g. when
+ # a cache layer is put in front of I18n.translate it will generate a cache key
+ # from the argument values passed to #translate. Therefore your lambdas should
+ # always return the same translations/values per unique combination of argument
+ # values.
+ #
+ # Ruby 2.7+ keyword arguments warning
+ #
+ # This method uses keyword arguments.
+ # There is a breaking change in ruby that produces warning with ruby 2.7 and won't work as expected with ruby 3.0
+ # The "hash" parameter must be passed as keyword argument.
+ #
+ # Good:
+ # I18n.t(:salutation, :gender => 'w', :name => 'Smith')
+ # I18n.t(:salutation, **{ :gender => 'w', :name => 'Smith' })
+ # I18n.t(:salutation, **any_hash)
+ #
+ # Bad:
+ # I18n.t(:salutation, { :gender => 'w', :name => 'Smith' })
+ # I18n.t(:salutation, any_hash)
+ #
+ # @raise [Disabled]
+ #
+ # source://i18n//lib/i18n.rb#212
+ def translate(key = T.unsafe(nil), throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), **options); end
+
+ # Wrapper for translate that adds :raise => true . With
+ # this option, if no translation is found, it will raise I18n::MissingTranslationData
+ #
+ # source://i18n//lib/i18n.rb#231
+ def translate!(key, **options); end
+
+ # Transliterates UTF-8 characters to ASCII. By default this method will
+ # transliterate only Latin strings to an ASCII approximation:
+ #
+ # I18n.transliterate("Ærøskøbing")
+ # # => "AEroskobing"
+ #
+ # I18n.transliterate("日本語")
+ # # => "???"
+ #
+ # It's also possible to add support for per-locale transliterations. I18n
+ # expects transliteration rules to be stored at
+ # i18n.transliterate.rule .
+ #
+ # Transliteration rules can either be a Hash or a Proc. Procs must accept a
+ # single string argument. Hash rules inherit the default transliteration
+ # rules, while Procs do not.
+ #
+ # *Examples*
+ #
+ # Setting a Hash in .yml:
+ #
+ # i18n:
+ # transliterate:
+ # rule:
+ # ü: "ue"
+ # ö: "oe"
+ #
+ # Setting a Hash using Ruby:
+ #
+ # store_translations(:de, i18n: {
+ # transliterate: {
+ # rule: {
+ # 'ü' => 'ue',
+ # 'ö' => 'oe'
+ # }
+ # }
+ # })
+ #
+ # Setting a Proc:
+ #
+ # translit = lambda {|string| MyTransliterator.transliterate(string) }
+ # store_translations(:xx, :i18n => {:transliterate => {:rule => translit})
+ #
+ # Transliterating strings:
+ #
+ # I18n.locale = :en
+ # I18n.transliterate("Jürgen") # => "Jurgen"
+ # I18n.locale = :de
+ # I18n.transliterate("Jürgen") # => "Juergen"
+ # I18n.transliterate("Jürgen", :locale => :en) # => "Jurgen"
+ # I18n.transliterate("Jürgen", :locale => :de) # => "Juergen"
+ #
+ # source://i18n//lib/i18n.rb#325
+ def transliterate(key, throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), replacement: T.unsafe(nil), **options); end
+
+ # Executes block with given I18n.locale set.
+ #
+ # source://i18n//lib/i18n.rb#347
+ def with_locale(tmp_locale = T.unsafe(nil)); end
+
+ private
+
+ # Any exceptions thrown in translate will be sent to the @@exception_handler
+ # which can be a Symbol, a Proc or any other Object unless they're forced to
+ # be raised or thrown (MissingTranslation).
+ #
+ # If exception_handler is a Symbol then it will simply be sent to I18n as
+ # a method call. A Proc will simply be called. In any other case the
+ # method #call will be called on the exception_handler object.
+ #
+ # Examples:
+ #
+ # I18n.exception_handler = :custom_exception_handler # this is the default
+ # I18n.custom_exception_handler(exception, locale, key, options) # will be called like this
+ #
+ # I18n.exception_handler = lambda { |*args| ... } # a lambda
+ # I18n.exception_handler.call(exception, locale, key, options) # will be called like this
+ #
+ # I18n.exception_handler = I18nExceptionHandler.new # an object
+ # I18n.exception_handler.call(exception, locale, key, options) # will be called like this
+ #
+ # source://i18n//lib/i18n.rb#423
+ def handle_exception(handling, exception, locale, key, options); end
+
+ # source://i18n//lib/i18n.rb#465
+ def interpolation_keys_from_translation(translation); end
+
+ # source://i18n//lib/i18n.rb#441
+ def normalize_key(key, separator); end
+
+ # source://i18n//lib/i18n.rb#393
+ def translate_key(key, throw, raise, locale, backend, options); end
+end
+
+# source://i18n//lib/i18n/config.rb#6
+class I18n::Config
+ # Returns an array of locales for which translations are available.
+ # Unless you explicitly set these through I18n.available_locales=
+ # the call will be delegated to the backend.
+ #
+ # source://i18n//lib/i18n/config.rb#43
+ def available_locales; end
+
+ # Sets the available locales.
+ #
+ # source://i18n//lib/i18n/config.rb#57
+ def available_locales=(locales); end
+
+ # Returns true if the available_locales have been initialized
+ #
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/config.rb#64
+ def available_locales_initialized?; end
+
+ # Caches the available locales list as both strings and symbols in a Set, so
+ # that we can have faster lookups to do the available locales enforce check.
+ #
+ # source://i18n//lib/i18n/config.rb#50
+ def available_locales_set; end
+
+ # Returns the current backend. Defaults to +Backend::Simple+.
+ #
+ # source://i18n//lib/i18n/config.rb#20
+ def backend; end
+
+ # Sets the current backend. Used to set a custom backend.
+ #
+ # source://i18n//lib/i18n/config.rb#25
+ def backend=(backend); end
+
+ # Clears the available locales set so it can be recomputed again after I18n
+ # gets reloaded.
+ #
+ # source://i18n//lib/i18n/config.rb#70
+ def clear_available_locales_set; end
+
+ # Returns the current default locale. Defaults to :'en'
+ #
+ # source://i18n//lib/i18n/config.rb#30
+ def default_locale; end
+
+ # Sets the current default locale. Used to set a custom default locale.
+ #
+ # source://i18n//lib/i18n/config.rb#35
+ def default_locale=(locale); end
+
+ # Returns the current default scope separator. Defaults to '.'
+ #
+ # source://i18n//lib/i18n/config.rb#75
+ def default_separator; end
+
+ # Sets the current default scope separator.
+ #
+ # source://i18n//lib/i18n/config.rb#80
+ def default_separator=(separator); end
+
+ # source://i18n//lib/i18n/config.rb#141
+ def enforce_available_locales; end
+
+ # source://i18n//lib/i18n/config.rb#145
+ def enforce_available_locales=(enforce_available_locales); end
+
+ # Returns the current exception handler. Defaults to an instance of
+ # I18n::ExceptionHandler.
+ #
+ # source://i18n//lib/i18n/config.rb#86
+ def exception_handler; end
+
+ # Sets the exception handler.
+ #
+ # source://i18n//lib/i18n/config.rb#91
+ def exception_handler=(exception_handler); end
+
+ # Returns the current interpolation patterns. Defaults to
+ # I18n::DEFAULT_INTERPOLATION_PATTERNS.
+ #
+ # source://i18n//lib/i18n/config.rb#151
+ def interpolation_patterns; end
+
+ # Sets the current interpolation patterns. Used to set a interpolation
+ # patterns.
+ #
+ # E.g. using {{}} as a placeholder like "{{hello}}, world!":
+ #
+ # I18n.config.interpolation_patterns << /\{\{(\w+)\}\}/
+ #
+ # source://i18n//lib/i18n/config.rb#161
+ def interpolation_patterns=(interpolation_patterns); end
+
+ # Allow clients to register paths providing translation data sources. The
+ # backend defines acceptable sources.
+ #
+ # E.g. the provided SimpleBackend accepts a list of paths to translation
+ # files which are either named *.rb and contain plain Ruby Hashes or are
+ # named *.yml and contain YAML data. So for the SimpleBackend clients may
+ # register translation files like this:
+ # I18n.load_path << 'path/to/locale/en.yml'
+ #
+ # source://i18n//lib/i18n/config.rb#126
+ def load_path; end
+
+ # Sets the load path instance. Custom implementations are expected to
+ # behave like a Ruby Array.
+ #
+ # source://i18n//lib/i18n/config.rb#132
+ def load_path=(load_path); end
+
+ # The only configuration value that is not global and scoped to thread is :locale.
+ # It defaults to the default_locale.
+ #
+ # source://i18n//lib/i18n/config.rb#9
+ def locale; end
+
+ # Sets the current locale pseudo-globally, i.e. in the Thread.current hash.
+ #
+ # source://i18n//lib/i18n/config.rb#14
+ def locale=(locale); end
+
+ # Returns the current handler for situations when interpolation argument
+ # is missing. MissingInterpolationArgument will be raised by default.
+ #
+ # source://i18n//lib/i18n/config.rb#97
+ def missing_interpolation_argument_handler; end
+
+ # Sets the missing interpolation argument handler. It can be any
+ # object that responds to #call. The arguments that will be passed to #call
+ # are the same as for MissingInterpolationArgument initializer. Use +Proc.new+
+ # if you don't care about arity.
+ #
+ # == Example:
+ # You can suppress raising an exception and return string instead:
+ #
+ # I18n.config.missing_interpolation_argument_handler = Proc.new do |key|
+ # "#{key} is missing"
+ # end
+ #
+ # source://i18n//lib/i18n/config.rb#114
+ def missing_interpolation_argument_handler=(exception_handler); end
+end
+
+# source://i18n//lib/i18n/interpolate/ruby.rb#7
+I18n::DEFAULT_INTERPOLATION_PATTERNS = T.let(T.unsafe(nil), Array)
+
+# source://i18n//lib/i18n/exceptions.rb#16
+class I18n::Disabled < ::I18n::ArgumentError
+ # @return [Disabled] a new instance of Disabled
+ #
+ # source://i18n//lib/i18n/exceptions.rb#17
+ def initialize(method); end
+end
+
+# source://i18n//lib/i18n.rb#36
+I18n::EMPTY_HASH = T.let(T.unsafe(nil), Hash)
+
+# source://i18n//lib/i18n/exceptions.rb#4
+class I18n::ExceptionHandler
+ # source://i18n//lib/i18n/exceptions.rb#5
+ def call(exception, _locale, _key, _options); end
+end
+
+# source://i18n//lib/i18n/gettext.rb#4
+module I18n::Gettext
+ class << self
+ # source://i18n//lib/i18n/gettext.rb#21
+ def extract_scope(msgid, separator); end
+
+ # returns an array of plural keys for the given locale or the whole hash
+ # of locale mappings to plural keys so that we can convert from gettext's
+ # integer-index based style
+ # TODO move this information to the pluralization module
+ #
+ # source://i18n//lib/i18n/gettext.rb#17
+ def plural_keys(*args); end
+ end
+end
+
+# source://i18n//lib/i18n/gettext.rb#6
+I18n::Gettext::CONTEXT_SEPARATOR = T.let(T.unsafe(nil), String)
+
+# Implements classical Gettext style accessors. To use this include the
+# module to the global namespace or wherever you want to use it.
+#
+# include I18n::Gettext::Helpers
+#
+# source://i18n//lib/i18n/gettext/helpers.rb#11
+module I18n::Gettext::Helpers
+ # Makes dynamic translation messages readable for the gettext parser.
+ # _(fruit) cannot be understood by the gettext parser. To help the parser find all your translations,
+ # you can add fruit = N_("Apple") which does not translate, but tells the parser: "Apple" needs translation.
+ # * msgid: the message id.
+ # * Returns: msgid.
+ #
+ # source://i18n//lib/i18n/gettext/helpers.rb#17
+ def N_(msgsid); end
+
+ # source://i18n//lib/i18n/gettext/helpers.rb#24
+ def _(msgid, options = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/gettext/helpers.rb#21
+ def gettext(msgid, options = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/gettext/helpers.rb#41
+ def n_(msgid, msgid_plural, n = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/gettext/helpers.rb#38
+ def ngettext(msgid, msgid_plural, n = T.unsafe(nil)); end
+
+ # Method signatures:
+ # npgettext('Fruits', 'apple', 'apples', 2)
+ # npgettext('Fruits', ['apple', 'apples'], 2)
+ #
+ # source://i18n//lib/i18n/gettext/helpers.rb#72
+ def np_(msgctxt, msgid, msgid_plural, n = T.unsafe(nil)); end
+
+ # Method signatures:
+ # npgettext('Fruits', 'apple', 'apples', 2)
+ # npgettext('Fruits', ['apple', 'apples'], 2)
+ #
+ # source://i18n//lib/i18n/gettext/helpers.rb#61
+ def npgettext(msgctxt, msgid, msgid_plural, n = T.unsafe(nil)); end
+
+ # Method signatures:
+ # nsgettext('Fruits|apple', 'apples', 2)
+ # nsgettext(['Fruits|apple', 'apples'], 2)
+ #
+ # source://i18n//lib/i18n/gettext/helpers.rb#56
+ def ns_(msgid, msgid_plural, n = T.unsafe(nil), separator = T.unsafe(nil)); end
+
+ # Method signatures:
+ # nsgettext('Fruits|apple', 'apples', 2)
+ # nsgettext(['Fruits|apple', 'apples'], 2)
+ #
+ # source://i18n//lib/i18n/gettext/helpers.rb#46
+ def nsgettext(msgid, msgid_plural, n = T.unsafe(nil), separator = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/gettext/helpers.rb#36
+ def p_(msgctxt, msgid); end
+
+ # source://i18n//lib/i18n/gettext/helpers.rb#32
+ def pgettext(msgctxt, msgid); end
+
+ # source://i18n//lib/i18n/gettext/helpers.rb#30
+ def s_(msgid, separator = T.unsafe(nil)); end
+
+ # source://i18n//lib/i18n/gettext/helpers.rb#26
+ def sgettext(msgid, separator = T.unsafe(nil)); end
+end
+
+# source://i18n//lib/i18n/gettext.rb#5
+I18n::Gettext::PLURAL_SEPARATOR = T.let(T.unsafe(nil), String)
+
+# source://i18n//lib/i18n/interpolate/ruby.rb#12
+I18n::INTERPOLATION_PATTERN = T.let(T.unsafe(nil), Regexp)
+
+# source://i18n//lib/i18n/interpolate/ruby.rb#15
+I18n::INTERPOLATION_PATTERNS_CACHE = T.let(T.unsafe(nil), Hash)
+
+# source://i18n//lib/i18n/exceptions.rb#132
+class I18n::InvalidFilenames < ::I18n::ArgumentError
+ # @return [InvalidFilenames] a new instance of InvalidFilenames
+ #
+ # source://i18n//lib/i18n/exceptions.rb#134
+ def initialize(file_errors); end
+end
+
+# source://i18n//lib/i18n/exceptions.rb#133
+I18n::InvalidFilenames::NUMBER_OF_ERRORS_SHOWN = T.let(T.unsafe(nil), Integer)
+
+# source://i18n//lib/i18n/exceptions.rb#30
+class I18n::InvalidLocale < ::I18n::ArgumentError
+ # @return [InvalidLocale] a new instance of InvalidLocale
+ #
+ # source://i18n//lib/i18n/exceptions.rb#32
+ def initialize(locale); end
+
+ # Returns the value of attribute locale.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#31
+ def locale; end
+end
+
+# source://i18n//lib/i18n/exceptions.rb#38
+class I18n::InvalidLocaleData < ::I18n::ArgumentError
+ # @return [InvalidLocaleData] a new instance of InvalidLocaleData
+ #
+ # source://i18n//lib/i18n/exceptions.rb#40
+ def initialize(filename, exception_message); end
+
+ # Returns the value of attribute filename.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#39
+ def filename; end
+end
+
+# source://i18n//lib/i18n/exceptions.rb#90
+class I18n::InvalidPluralizationData < ::I18n::ArgumentError
+ # @return [InvalidPluralizationData] a new instance of InvalidPluralizationData
+ #
+ # source://i18n//lib/i18n/exceptions.rb#92
+ def initialize(entry, count, key); end
+
+ # Returns the value of attribute count.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#91
+ def count; end
+
+ # Returns the value of attribute entry.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#91
+ def entry; end
+
+ # Returns the value of attribute key.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#91
+ def key; end
+end
+
+# source://i18n//lib/i18n/backend/key_value.rb#21
+I18n::JSON = ActiveSupport::JSON
+
+# source://i18n//lib/i18n/locale.rb#4
+module I18n::Locale; end
+
+# source://i18n//lib/i18n/locale/fallbacks.rb#48
+class I18n::Locale::Fallbacks < ::Hash
+ # @return [Fallbacks] a new instance of Fallbacks
+ #
+ # source://i18n//lib/i18n/locale/fallbacks.rb#49
+ def initialize(*mappings); end
+
+ # @raise [InvalidLocale]
+ #
+ # source://i18n//lib/i18n/locale/fallbacks.rb#60
+ def [](locale); end
+
+ # Returns the value of attribute defaults.
+ #
+ # source://i18n//lib/i18n/locale/fallbacks.rb#58
+ def defaults; end
+
+ # source://i18n//lib/i18n/locale/fallbacks.rb#55
+ def defaults=(defaults); end
+
+ # @return [Boolean]
+ #
+ # source://i18n//lib/i18n/locale/fallbacks.rb#82
+ def empty?; end
+
+ # source://i18n//lib/i18n/locale/fallbacks.rb#86
+ def inspect; end
+
+ # source://i18n//lib/i18n/locale/fallbacks.rb#67
+ def map(*args, &block); end
+
+ protected
+
+ # source://i18n//lib/i18n/locale/fallbacks.rb#92
+ def compute(tags, include_defaults = T.unsafe(nil), exclude = T.unsafe(nil)); end
+end
+
+# source://i18n//lib/i18n/locale/tag.rb#5
+module I18n::Locale::Tag
+ class << self
+ # Returns the current locale tag implementation. Defaults to +I18n::Locale::Tag::Simple+.
+ #
+ # source://i18n//lib/i18n/locale/tag.rb#12
+ def implementation; end
+
+ # Sets the current locale tag implementation. Use this to set a different locale tag implementation.
+ #
+ # source://i18n//lib/i18n/locale/tag.rb#17
+ def implementation=(implementation); end
+
+ # Factory method for locale tags. Delegates to the current locale tag implementation.
+ #
+ # source://i18n//lib/i18n/locale/tag.rb#22
+ def tag(tag); end
+ end
+end
+
+# source://i18n//lib/i18n/locale/tag/parents.rb#4
+module I18n::Locale::Tag::Parents
+ # source://i18n//lib/i18n/locale/tag/parents.rb#5
+ def parent; end
+
+ # source://i18n//lib/i18n/locale/tag/parents.rb#18
+ def parents; end
+
+ # source://i18n//lib/i18n/locale/tag/parents.rb#14
+ def self_and_parents; end
+end
+
+# source://i18n//lib/i18n/locale/tag/rfc4646.rb#12
+I18n::Locale::Tag::RFC4646_FORMATS = T.let(T.unsafe(nil), Hash)
+
+# source://i18n//lib/i18n/locale/tag/rfc4646.rb#11
+I18n::Locale::Tag::RFC4646_SUBTAGS = T.let(T.unsafe(nil), Array)
+
+# source://i18n//lib/i18n/locale/tag/rfc4646.rb#14
+class I18n::Locale::Tag::Rfc4646 < ::Struct
+ include ::I18n::Locale::Tag::Parents
+
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#35
+ def language; end
+
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#35
+ def region; end
+
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#35
+ def script; end
+
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#46
+ def to_a; end
+
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#42
+ def to_s; end
+
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#38
+ def to_sym; end
+
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#35
+ def variant; end
+
+ class << self
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#23
+ def parser; end
+
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#27
+ def parser=(parser); end
+
+ # Parses the given tag and returns a Tag instance if it is valid.
+ # Returns false if the given tag is not valid according to RFC 4646.
+ #
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#18
+ def tag(tag); end
+ end
+end
+
+# source://i18n//lib/i18n/locale/tag/rfc4646.rb#50
+module I18n::Locale::Tag::Rfc4646::Parser
+ class << self
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#63
+ def match(tag); end
+ end
+end
+
+# source://i18n//lib/i18n/locale/tag/rfc4646.rb#51
+I18n::Locale::Tag::Rfc4646::Parser::PATTERN = T.let(T.unsafe(nil), Regexp)
+
+# source://i18n//lib/i18n/locale/tag/simple.rb#6
+class I18n::Locale::Tag::Simple
+ include ::I18n::Locale::Tag::Parents
+
+ # @return [Simple] a new instance of Simple
+ #
+ # source://i18n//lib/i18n/locale/tag/simple.rb#17
+ def initialize(*tag); end
+
+ # source://i18n//lib/i18n/locale/tag/simple.rb#21
+ def subtags; end
+
+ # Returns the value of attribute tag.
+ #
+ # source://i18n//lib/i18n/locale/tag/simple.rb#15
+ def tag; end
+
+ # source://i18n//lib/i18n/locale/tag/simple.rb#33
+ def to_a; end
+
+ # source://i18n//lib/i18n/locale/tag/simple.rb#29
+ def to_s; end
+
+ # source://i18n//lib/i18n/locale/tag/simple.rb#25
+ def to_sym; end
+
+ class << self
+ # source://i18n//lib/i18n/locale/tag/simple.rb#8
+ def tag(tag); end
+ end
+end
+
+# source://i18n//lib/i18n/middleware.rb#4
+class I18n::Middleware
+ # @return [Middleware] a new instance of Middleware
+ #
+ # source://i18n//lib/i18n/middleware.rb#6
+ def initialize(app); end
+
+ # source://i18n//lib/i18n/middleware.rb#10
+ def call(env); end
+end
+
+# source://i18n//lib/i18n/exceptions.rb#98
+class I18n::MissingInterpolationArgument < ::I18n::ArgumentError
+ # @return [MissingInterpolationArgument] a new instance of MissingInterpolationArgument
+ #
+ # source://i18n//lib/i18n/exceptions.rb#100
+ def initialize(key, values, string); end
+
+ # Returns the value of attribute key.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#99
+ def key; end
+
+ # Returns the value of attribute string.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#99
+ def string; end
+
+ # Returns the value of attribute values.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#99
+ def values; end
+end
+
+# source://i18n//lib/i18n/exceptions.rb#46
+class I18n::MissingTranslation < ::I18n::ArgumentError
+ include ::I18n::MissingTranslation::Base
+end
+
+# source://i18n//lib/i18n/exceptions.rb#47
+module I18n::MissingTranslation::Base
+ # source://i18n//lib/i18n/exceptions.rb#52
+ def initialize(locale, key, options = T.unsafe(nil)); end
+
+ # Returns the value of attribute key.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#50
+ def key; end
+
+ # source://i18n//lib/i18n/exceptions.rb#57
+ def keys; end
+
+ # Returns the value of attribute locale.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#50
+ def locale; end
+
+ # source://i18n//lib/i18n/exceptions.rb#63
+ def message; end
+
+ # source://i18n//lib/i18n/exceptions.rb#72
+ def normalized_option(key); end
+
+ # Returns the value of attribute options.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#50
+ def options; end
+
+ # source://i18n//lib/i18n/exceptions.rb#78
+ def to_exception; end
+
+ # source://i18n//lib/i18n/exceptions.rb#76
+ def to_s; end
+end
+
+# source://i18n//lib/i18n/exceptions.rb#48
+I18n::MissingTranslation::Base::PERMITTED_KEYS = T.let(T.unsafe(nil), Array)
+
+# source://i18n//lib/i18n/exceptions.rb#86
+class I18n::MissingTranslationData < ::I18n::ArgumentError
+ include ::I18n::MissingTranslation::Base
+end
+
+# source://i18n//lib/i18n.rb#19
+I18n::RESERVED_KEYS = T.let(T.unsafe(nil), Array)
+
+# source://i18n//lib/i18n/exceptions.rb#106
+class I18n::ReservedInterpolationKey < ::I18n::ArgumentError
+ # @return [ReservedInterpolationKey] a new instance of ReservedInterpolationKey
+ #
+ # source://i18n//lib/i18n/exceptions.rb#108
+ def initialize(key, string); end
+
+ # Returns the value of attribute key.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#107
+ def key; end
+
+ # Returns the value of attribute string.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#107
+ def string; end
+end
+
+# source://i18n//lib/i18n/tests.rb#4
+module I18n::Tests; end
+
+# source://i18n//lib/i18n/tests/localization.rb#3
+module I18n::Tests::Localization
+ class << self
+ # @private
+ #
+ # source://i18n//lib/i18n/tests/localization.rb#9
+ def included(base); end
+ end
+end
+
+# source://i18n//lib/i18n/exceptions.rb#114
+class I18n::UnknownFileType < ::I18n::ArgumentError
+ # @return [UnknownFileType] a new instance of UnknownFileType
+ #
+ # source://i18n//lib/i18n/exceptions.rb#116
+ def initialize(type, filename); end
+
+ # Returns the value of attribute filename.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#115
+ def filename; end
+
+ # Returns the value of attribute type.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#115
+ def type; end
+end
+
+# source://i18n//lib/i18n/exceptions.rb#122
+class I18n::UnsupportedMethod < ::I18n::ArgumentError
+ # @return [UnsupportedMethod] a new instance of UnsupportedMethod
+ #
+ # source://i18n//lib/i18n/exceptions.rb#124
+ def initialize(method, backend_klass, msg); end
+
+ # Returns the value of attribute backend_klass.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#123
+ def backend_klass; end
+
+ # Returns the value of attribute method.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#123
+ def method; end
+
+ # Returns the value of attribute msg.
+ #
+ # source://i18n//lib/i18n/exceptions.rb#123
+ def msg; end
+end
+
+# source://i18n//lib/i18n/utils.rb#4
+module I18n::Utils
+ class << self
+ # source://i18n//lib/i18n/utils.rb#18
+ def deep_merge(hash, other_hash, &block); end
+
+ # source://i18n//lib/i18n/utils.rb#22
+ def deep_merge!(hash, other_hash, &block); end
+
+ # source://i18n//lib/i18n/utils.rb#34
+ def deep_symbolize_keys(hash); end
+
+ # source://i18n//lib/i18n/utils.rb#7
+ def except(hash, *keys); end
+
+ private
+
+ # source://i18n//lib/i18n/utils.rb#43
+ def deep_symbolize_keys_in_object(value); end
+ end
+end
+
+# source://i18n//lib/i18n/version.rb#4
+I18n::VERSION = T.let(T.unsafe(nil), String)
diff --git a/sorbet/rbi/gems/io-console@0.8.2.rbi b/sorbet/rbi/gems/io-console@0.8.2.rbi
new file mode 100644
index 0000000..73616ab
--- /dev/null
+++ b/sorbet/rbi/gems/io-console@0.8.2.rbi
@@ -0,0 +1,9 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `io-console` gem.
+# Please instead update this file by running `bin/tapioca gem io-console`.
+
+
+# THIS IS AN EMPTY RBI FILE.
+# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
diff --git a/sorbet/rbi/gems/json-schema@6.1.0.rbi b/sorbet/rbi/gems/json-schema@6.1.0.rbi
new file mode 100644
index 0000000..048dbc8
--- /dev/null
+++ b/sorbet/rbi/gems/json-schema@6.1.0.rbi
@@ -0,0 +1,9 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `json-schema` gem.
+# Please instead update this file by running `bin/tapioca gem json-schema`.
+
+
+# THIS IS AN EMPTY RBI FILE.
+# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
diff --git a/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi b/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi
new file mode 100644
index 0000000..5f91e74
--- /dev/null
+++ b/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi
@@ -0,0 +1,9 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `language_server-protocol` gem.
+# Please instead update this file by running `bin/tapioca gem language_server-protocol`.
+
+
+# THIS IS AN EMPTY RBI FILE.
+# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
diff --git a/sorbet/rbi/gems/lint_roller@1.1.0.rbi b/sorbet/rbi/gems/lint_roller@1.1.0.rbi
new file mode 100644
index 0000000..789c5c9
--- /dev/null
+++ b/sorbet/rbi/gems/lint_roller@1.1.0.rbi
@@ -0,0 +1,119 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `lint_roller` gem.
+# Please instead update this file by running `bin/tapioca gem lint_roller`.
+
+
+# source://lint_roller//lib/lint_roller/context.rb#1
+module LintRoller; end
+
+# source://lint_roller//lib/lint_roller/context.rb#2
+class LintRoller::Context < ::Struct
+ # Returns the value of attribute engine
+ #
+ # @return [Object] the current value of engine
+ #
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def engine; end
+
+ # Sets the attribute engine
+ #
+ # @param value [Object] the value to set the attribute engine to.
+ # @return [Object] the newly set value
+ #
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def engine=(_); end
+
+ # Returns the value of attribute engine_version
+ #
+ # @return [Object] the current value of engine_version
+ #
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def engine_version; end
+
+ # Sets the attribute engine_version
+ #
+ # @param value [Object] the value to set the attribute engine_version to.
+ # @return [Object] the newly set value
+ #
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def engine_version=(_); end
+
+ # Returns the value of attribute rule_format
+ #
+ # @return [Object] the current value of rule_format
+ #
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def rule_format; end
+
+ # Sets the attribute rule_format
+ #
+ # @param value [Object] the value to set the attribute rule_format to.
+ # @return [Object] the newly set value
+ #
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def rule_format=(_); end
+
+ # Returns the value of attribute runner
+ #
+ # @return [Object] the current value of runner
+ #
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def runner; end
+
+ # Sets the attribute runner
+ #
+ # @param value [Object] the value to set the attribute runner to.
+ # @return [Object] the newly set value
+ #
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def runner=(_); end
+
+ # Returns the value of attribute runner_version
+ #
+ # @return [Object] the current value of runner_version
+ #
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def runner_version; end
+
+ # Sets the attribute runner_version
+ #
+ # @param value [Object] the value to set the attribute runner_version to.
+ # @return [Object] the newly set value
+ #
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def runner_version=(_); end
+
+ # Returns the value of attribute target_ruby_version
+ #
+ # @return [Object] the current value of target_ruby_version
+ #
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def target_ruby_version; end
+
+ # Sets the attribute target_ruby_version
+ #
+ # @param value [Object] the value to set the attribute target_ruby_version to.
+ # @return [Object] the newly set value
+ #
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def target_ruby_version=(_); end
+
+ class << self
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def [](*_arg0); end
+
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def inspect; end
+
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def keyword_init?; end
+
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def members; end
+
+ # source://lint_roller//lib/lint_roller/context.rb#2
+ def new(*_arg0); end
+ end
+end
diff --git a/sorbet/rbi/gems/loofah@2.25.0.rbi b/sorbet/rbi/gems/loofah@2.25.0.rbi
new file mode 100644
index 0000000..4ff9aa2
--- /dev/null
+++ b/sorbet/rbi/gems/loofah@2.25.0.rbi
@@ -0,0 +1,1119 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `loofah` gem.
+# Please instead update this file by running `bin/tapioca gem loofah`.
+
+
+# == Strings and IO Objects as Input
+#
+# The following methods accept any IO object in addition to accepting a string:
+#
+# - Loofah.html4_document
+# - Loofah.html4_fragment
+# - Loofah.scrub_html4_document
+# - Loofah.scrub_html4_fragment
+#
+# - Loofah.html5_document
+# - Loofah.html5_fragment
+# - Loofah.scrub_html5_document
+# - Loofah.scrub_html5_fragment
+#
+# - Loofah.xml_document
+# - Loofah.xml_fragment
+# - Loofah.scrub_xml_document
+# - Loofah.scrub_xml_fragment
+#
+# - Loofah.document
+# - Loofah.fragment
+# - Loofah.scrub_document
+# - Loofah.scrub_fragment
+#
+# That IO object could be a file, or a socket, or a StringIO, or anything that responds to +read+
+# and +close+.
+#
+# source://loofah//lib/loofah.rb#5
+module Loofah
+ class << self
+ # Shortcut for Loofah::HTML4::Document.parse(*args, &block)
+ #
+ # This method accepts the same parameters as Nokogiri::HTML4::Document.parse
+ #
+ # source://loofah//lib/loofah.rb#139
+ def document(*args, &block); end
+
+ # Shortcut for Loofah::HTML4::DocumentFragment.parse(*args, &block)
+ #
+ # This method accepts the same parameters as Nokogiri::HTML4::DocumentFragment.parse
+ #
+ # source://loofah//lib/loofah.rb#140
+ def fragment(*args, &block); end
+
+ # Shortcut for Loofah::HTML4::Document.parse(*args, &block)
+ #
+ # This method accepts the same parameters as Nokogiri::HTML4::Document.parse
+ #
+ # source://loofah//lib/loofah.rb#76
+ def html4_document(*args, &block); end
+
+ # Shortcut for Loofah::HTML4::DocumentFragment.parse(*args, &block)
+ #
+ # This method accepts the same parameters as Nokogiri::HTML4::DocumentFragment.parse
+ #
+ # source://loofah//lib/loofah.rb#83
+ def html4_fragment(*args, &block); end
+
+ # source://loofah//lib/loofah.rb#101
+ def html5_document(*args, &block); end
+
+ # source://loofah//lib/loofah.rb#108
+ def html5_fragment(*args, &block); end
+
+ # @return [Boolean]
+ #
+ # source://loofah//lib/loofah.rb#7
+ def html5_support?; end
+
+ # A helper to remove extraneous whitespace from text-ified HTML
+ #
+ # source://loofah//lib/loofah.rb#169
+ def remove_extraneous_whitespace(string); end
+
+ # Shortcut for Loofah::HTML4::Document.parse(string_or_io).scrub!(method)
+ #
+ # source://loofah//lib/loofah.rb#141
+ def scrub_document(string_or_io, method); end
+
+ # Shortcut for Loofah::HTML4::DocumentFragment.parse(string_or_io).scrub!(method)
+ #
+ # source://loofah//lib/loofah.rb#142
+ def scrub_fragment(string_or_io, method); end
+
+ # Shortcut for Loofah::HTML4::Document.parse(string_or_io).scrub!(method)
+ #
+ # source://loofah//lib/loofah.rb#88
+ def scrub_html4_document(string_or_io, method); end
+
+ # Shortcut for Loofah::HTML4::DocumentFragment.parse(string_or_io).scrub!(method)
+ #
+ # source://loofah//lib/loofah.rb#93
+ def scrub_html4_fragment(string_or_io, method); end
+
+ # source://loofah//lib/loofah.rb#113
+ def scrub_html5_document(string_or_io, method); end
+
+ # source://loofah//lib/loofah.rb#118
+ def scrub_html5_fragment(string_or_io, method); end
+
+ # Shortcut for Loofah.xml_document(string_or_io).scrub!(method)
+ #
+ # source://loofah//lib/loofah.rb#164
+ def scrub_xml_document(string_or_io, method); end
+
+ # Shortcut for Loofah.xml_fragment(string_or_io).scrub!(method)
+ #
+ # source://loofah//lib/loofah.rb#159
+ def scrub_xml_fragment(string_or_io, method); end
+
+ # Shortcut for Loofah::XML::Document.parse(*args, &block)
+ #
+ # This method accepts the same parameters as Nokogiri::XML::Document.parse
+ #
+ # source://loofah//lib/loofah.rb#147
+ def xml_document(*args, &block); end
+
+ # Shortcut for Loofah::XML::DocumentFragment.parse(*args, &block)
+ #
+ # This method accepts the same parameters as Nokogiri::XML::DocumentFragment.parse
+ #
+ # source://loofah//lib/loofah.rb#154
+ def xml_fragment(*args, &block); end
+ end
+end
+
+# source://loofah//lib/loofah/concerns.rb#125
+module Loofah::DocumentDecorator
+ # source://loofah//lib/loofah/concerns.rb#126
+ def initialize(*args, &block); end
+end
+
+# source://loofah//lib/loofah/elements.rb#6
+module Loofah::Elements; end
+
+# source://loofah//lib/loofah/elements.rb#93
+Loofah::Elements::BLOCK_LEVEL = T.let(T.unsafe(nil), Set)
+
+# Elements that aren't block but should generate a newline in #to_text
+#
+# source://loofah//lib/loofah/elements.rb#90
+Loofah::Elements::INLINE_LINE_BREAK = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/elements.rb#94
+Loofah::Elements::LINEBREAKERS = T.let(T.unsafe(nil), Set)
+
+# The following elements may also be considered block-level
+# elements since they may contain block-level elements
+#
+# source://loofah//lib/loofah/elements.rb#76
+Loofah::Elements::LOOSE_BLOCK_LEVEL = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/elements.rb#92
+Loofah::Elements::STRICT_BLOCK_LEVEL = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/elements.rb#7
+Loofah::Elements::STRICT_BLOCK_LEVEL_HTML4 = T.let(T.unsafe(nil), Set)
+
+# https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
+#
+# source://loofah//lib/loofah/elements.rb#35
+Loofah::Elements::STRICT_BLOCK_LEVEL_HTML5 = T.let(T.unsafe(nil), Set)
+
+# Alias for Loofah::HTML4
+#
+# source://loofah//lib/loofah.rb#70
+Loofah::HTML = Loofah::HTML4
+
+# source://loofah//lib/loofah/html4/document.rb#4
+module Loofah::HTML4; end
+
+# Subclass of Nokogiri::HTML4::Document.
+#
+# See Loofah::ScrubBehavior and Loofah::TextBehavior for additional methods.
+#
+# source://loofah//lib/loofah/html4/document.rb#10
+class Loofah::HTML4::Document < ::Nokogiri::HTML4::Document
+ include ::Loofah::ScrubBehavior::Node
+ include ::Loofah::DocumentDecorator
+ include ::Loofah::TextBehavior
+ include ::Loofah::HtmlDocumentBehavior
+ extend ::Loofah::HtmlDocumentBehavior::ClassMethods
+end
+
+# Subclass of Nokogiri::HTML4::DocumentFragment.
+#
+# See Loofah::ScrubBehavior and Loofah::TextBehavior for additional methods.
+#
+# source://loofah//lib/loofah/html4/document_fragment.rb#10
+class Loofah::HTML4::DocumentFragment < ::Nokogiri::HTML4::DocumentFragment
+ include ::Loofah::TextBehavior
+ include ::Loofah::HtmlFragmentBehavior
+ extend ::Loofah::HtmlFragmentBehavior::ClassMethods
+end
+
+# source://loofah//lib/loofah/html5/safelist.rb#6
+module Loofah::HTML5; end
+
+# Subclass of Nokogiri::HTML5::Document.
+#
+# See Loofah::ScrubBehavior and Loofah::TextBehavior for additional methods.
+#
+# source://loofah//lib/loofah/html5/document.rb#10
+class Loofah::HTML5::Document < ::Nokogiri::HTML5::Document
+ include ::Loofah::ScrubBehavior::Node
+ include ::Loofah::DocumentDecorator
+ include ::Loofah::TextBehavior
+ include ::Loofah::HtmlDocumentBehavior
+ extend ::Loofah::HtmlDocumentBehavior::ClassMethods
+end
+
+# Subclass of Nokogiri::HTML5::DocumentFragment.
+#
+# See Loofah::ScrubBehavior and Loofah::TextBehavior for additional methods.
+#
+# source://loofah//lib/loofah/html5/document_fragment.rb#10
+class Loofah::HTML5::DocumentFragment < ::Nokogiri::HTML5::DocumentFragment
+ include ::Loofah::TextBehavior
+ include ::Loofah::HtmlFragmentBehavior
+ extend ::Loofah::HtmlFragmentBehavior::ClassMethods
+end
+
+# source://loofah//lib/loofah/html5/safelist.rb#49
+module Loofah::HTML5::SafeList; end
+
+# source://loofah//lib/loofah/html5/safelist.rb#232
+Loofah::HTML5::SafeList::ACCEPTABLE_ATTRIBUTES = T.let(T.unsafe(nil), Set)
+
+# https://www.w3.org/TR/css-color-3/#html4
+#
+# source://loofah//lib/loofah/html5/safelist.rb#738
+Loofah::HTML5::SafeList::ACCEPTABLE_CSS_COLORS = T.let(T.unsafe(nil), Set)
+
+# https://www.w3.org/TR/css-color-3/#svg-color
+#
+# source://loofah//lib/loofah/html5/safelist.rb#758
+Loofah::HTML5::SafeList::ACCEPTABLE_CSS_EXTENDED_COLORS = T.let(T.unsafe(nil), Set)
+
+# see https://www.quackit.com/css/functions/
+# omit `url` and `image` from that list
+#
+# source://loofah//lib/loofah/html5/safelist.rb#910
+Loofah::HTML5::SafeList::ACCEPTABLE_CSS_FUNCTIONS = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#699
+Loofah::HTML5::SafeList::ACCEPTABLE_CSS_KEYWORDS = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#626
+Loofah::HTML5::SafeList::ACCEPTABLE_CSS_PROPERTIES = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#50
+Loofah::HTML5::SafeList::ACCEPTABLE_ELEMENTS = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#983
+Loofah::HTML5::SafeList::ACCEPTABLE_PROTOCOLS = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#970
+Loofah::HTML5::SafeList::ACCEPTABLE_SVG_PROPERTIES = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#1014
+Loofah::HTML5::SafeList::ACCEPTABLE_URI_DATA_MEDIATYPES = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#1024
+Loofah::HTML5::SafeList::ALLOWED_ATTRIBUTES = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#1027
+Loofah::HTML5::SafeList::ALLOWED_CSS_FUNCTIONS = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#1026
+Loofah::HTML5::SafeList::ALLOWED_CSS_KEYWORDS = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#1025
+Loofah::HTML5::SafeList::ALLOWED_CSS_PROPERTIES = T.let(T.unsafe(nil), Set)
+
+# subclasses may define their own versions of these constants
+#
+# source://loofah//lib/loofah/html5/safelist.rb#1023
+Loofah::HTML5::SafeList::ALLOWED_ELEMENTS = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#1048
+Loofah::HTML5::SafeList::ALLOWED_ELEMENTS_WITH_LIBXML2 = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#1029
+Loofah::HTML5::SafeList::ALLOWED_PROTOCOLS = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#1028
+Loofah::HTML5::SafeList::ALLOWED_SVG_PROPERTIES = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#1030
+Loofah::HTML5::SafeList::ALLOWED_URI_DATA_MEDIATYPES = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#526
+Loofah::HTML5::SafeList::ARIA_ATTRIBUTES = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#582
+Loofah::HTML5::SafeList::ATTR_VAL_IS_URI = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#315
+Loofah::HTML5::SafeList::MATHML_ATTRIBUTES = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#147
+Loofah::HTML5::SafeList::MATHML_ELEMENTS = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#981
+Loofah::HTML5::SafeList::PROTOCOL_SEPARATOR = T.let(T.unsafe(nil), Regexp)
+
+# source://loofah//lib/loofah/html5/safelist.rb#963
+Loofah::HTML5::SafeList::SHORTHAND_CSS_PROPERTIES = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#608
+Loofah::HTML5::SafeList::SVG_ALLOW_LOCAL_HREF = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#367
+Loofah::HTML5::SafeList::SVG_ATTRIBUTES = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#594
+Loofah::HTML5::SafeList::SVG_ATTR_VAL_ALLOWS_REF = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/safelist.rb#183
+Loofah::HTML5::SafeList::SVG_ELEMENTS = T.let(T.unsafe(nil), Set)
+
+# additional tags we should consider safe since we have libxml2 fixing up our documents.
+#
+# source://loofah//lib/loofah/html5/safelist.rb#1043
+Loofah::HTML5::SafeList::TAGS_SAFE_WITH_LIBXML2 = T.let(T.unsafe(nil), Set)
+
+# TODO: remove VOID_ELEMENTS in a future major release
+# and put it in the tests (it is used only for testing, not for functional behavior)
+#
+# source://loofah//lib/loofah/html5/safelist.rb#1034
+Loofah::HTML5::SafeList::VOID_ELEMENTS = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/scrub.rb#9
+module Loofah::HTML5::Scrub
+ class << self
+ # @return [Boolean]
+ #
+ # source://loofah//lib/loofah/html5/scrub.rb#20
+ def allowed_element?(element_name); end
+
+ # Returns true if the given URI string is safe, false otherwise.
+ # This method can be used to validate URI attribute values without
+ # requiring a Nokogiri DOM node.
+ #
+ # @return [Boolean]
+ #
+ # source://loofah//lib/loofah/html5/scrub.rb#147
+ def allowed_uri?(uri_string); end
+
+ # source://loofah//lib/loofah/html5/scrub.rb#204
+ def cdata_escape(node); end
+
+ # @return [Boolean]
+ #
+ # source://loofah//lib/loofah/html5/scrub.rb#199
+ def cdata_needs_escaping?(node); end
+
+ # source://loofah//lib/loofah/html5/scrub.rb#219
+ def escape_tags(string); end
+
+ # libxml2 >= 2.9.2 fails to escape comments within some attributes.
+ #
+ # see comments about CVE-2018-8048 within the tests for more information
+ #
+ # source://loofah//lib/loofah/html5/scrub.rb#178
+ def force_correct_attribute_escaping!(node); end
+
+ # source://loofah//lib/loofah/html5/scrub.rb#125
+ def scrub_attribute_that_allows_local_ref(attr_node); end
+
+ # alternative implementation of the html5lib attribute scrubbing algorithm
+ #
+ # source://loofah//lib/loofah/html5/scrub.rb#25
+ def scrub_attributes(node); end
+
+ # source://loofah//lib/loofah/html5/scrub.rb#74
+ def scrub_css(style); end
+
+ # source://loofah//lib/loofah/html5/scrub.rb#69
+ def scrub_css_attribute(node); end
+
+ # source://loofah//lib/loofah/html5/scrub.rb#164
+ def scrub_uri_attribute(attr_node); end
+ end
+end
+
+# source://loofah//lib/loofah/html5/scrub.rb#10
+Loofah::HTML5::Scrub::CONTROL_CHARACTERS = T.let(T.unsafe(nil), Regexp)
+
+# source://loofah//lib/loofah/html5/scrub.rb#12
+Loofah::HTML5::Scrub::CRASS_SEMICOLON = T.let(T.unsafe(nil), Hash)
+
+# source://loofah//lib/loofah/html5/scrub.rb#13
+Loofah::HTML5::Scrub::CSS_IMPORTANT = T.let(T.unsafe(nil), String)
+
+# source://loofah//lib/loofah/html5/scrub.rb#11
+Loofah::HTML5::Scrub::CSS_KEYWORDISH = T.let(T.unsafe(nil), Regexp)
+
+# source://loofah//lib/loofah/html5/scrub.rb#15
+Loofah::HTML5::Scrub::CSS_PROPERTY_STRING_WITHOUT_EMBEDDED_QUOTES = T.let(T.unsafe(nil), Regexp)
+
+# source://loofah//lib/loofah/html5/scrub.rb#14
+Loofah::HTML5::Scrub::CSS_WHITESPACE = T.let(T.unsafe(nil), String)
+
+# source://loofah//lib/loofah/html5/scrub.rb#16
+Loofah::HTML5::Scrub::DATA_ATTRIBUTE_NAME = T.let(T.unsafe(nil), Regexp)
+
+# RFC 3986
+#
+# source://loofah//lib/loofah/html5/scrub.rb#17
+Loofah::HTML5::Scrub::URI_PROTOCOL_REGEX = T.let(T.unsafe(nil), Regexp)
+
+# source://loofah//lib/loofah/html5/safelist.rb#1051
+Loofah::HTML5::WhiteList = Loofah::HTML5::SafeList
+
+# source://loofah//lib/loofah/concerns.rb#133
+module Loofah::HtmlDocumentBehavior
+ mixes_in_class_methods ::Loofah::HtmlDocumentBehavior::ClassMethods
+
+ # source://loofah//lib/loofah/concerns.rb#164
+ def serialize_root; end
+
+ class << self
+ # @private
+ #
+ # source://loofah//lib/loofah/concerns.rb#159
+ def included(base); end
+ end
+end
+
+# source://loofah//lib/loofah/concerns.rb#134
+module Loofah::HtmlDocumentBehavior::ClassMethods
+ # source://loofah//lib/loofah/concerns.rb#135
+ def parse(*args, &block); end
+
+ private
+
+ # remove comments that exist outside of the HTML element.
+ #
+ # these comments are allowed by the HTML spec:
+ #
+ # https://www.w3.org/TR/html401/struct/global.html#h-7.1
+ #
+ # but are not scrubbed by Loofah because these nodes don't meet
+ # the contract that scrubbers expect of a node (e.g., it can be
+ # replaced, sibling and children nodes can be created).
+ #
+ # source://loofah//lib/loofah/concerns.rb#150
+ def remove_comments_before_html_element(doc); end
+end
+
+# source://loofah//lib/loofah/concerns.rb#169
+module Loofah::HtmlFragmentBehavior
+ mixes_in_class_methods ::Loofah::HtmlFragmentBehavior::ClassMethods
+
+ # source://loofah//lib/loofah/concerns.rb#201
+ def serialize; end
+
+ # source://loofah//lib/loofah/concerns.rb#203
+ def serialize_root; end
+
+ # source://loofah//lib/loofah/concerns.rb#197
+ def to_s; end
+
+ class << self
+ # @private
+ #
+ # source://loofah//lib/loofah/concerns.rb#192
+ def included(base); end
+ end
+end
+
+# source://loofah//lib/loofah/concerns.rb#170
+module Loofah::HtmlFragmentBehavior::ClassMethods
+ # source://loofah//lib/loofah/concerns.rb#180
+ def document_klass; end
+
+ # source://loofah//lib/loofah/concerns.rb#171
+ def parse(tags, encoding = T.unsafe(nil)); end
+end
+
+# constants related to working around unhelpful libxml2 behavior
+#
+# ಠ_ಠ
+#
+# source://loofah//lib/loofah/html5/libxml2_workarounds.rb#12
+module Loofah::LibxmlWorkarounds; end
+
+# these attributes and qualifying parent tags are determined by the code at:
+#
+# https://git.gnome.org/browse/libxml2/tree/HTMLtree.c?h=v2.9.2#n714
+#
+# see comments about CVE-2018-8048 within the tests for more information
+#
+# source://loofah//lib/loofah/html5/libxml2_workarounds.rb#20
+Loofah::LibxmlWorkarounds::BROKEN_ESCAPING_ATTRIBUTES = T.let(T.unsafe(nil), Set)
+
+# source://loofah//lib/loofah/html5/libxml2_workarounds.rb#26
+Loofah::LibxmlWorkarounds::BROKEN_ESCAPING_ATTRIBUTES_QUALIFYING_TAG = T.let(T.unsafe(nil), Hash)
+
+# source://loofah//lib/loofah/metahelpers.rb#4
+module Loofah::MetaHelpers
+ class << self
+ # source://loofah//lib/loofah/metahelpers.rb#6
+ def add_downcased_set_members_to_all_set_constants(mojule); end
+ end
+end
+
+# Mixes +scrub!+ into Document, DocumentFragment, Node and NodeSet.
+#
+# Traverse the document or fragment, invoking the +scrubber+ on each node.
+#
+# +scrubber+ must either be one of the symbols representing the built-in scrubbers (see
+# Scrubbers), or a Scrubber instance.
+#
+# span2div = Loofah::Scrubber.new do |node|
+# node.name = "div" if node.name == "span"
+# end
+# Loofah.html5_fragment("foo bar
").scrub!(span2div).to_s
+# # => "foo
bar
"
+#
+# or
+#
+# unsafe_html = "ohai! div is safe
"
+# Loofah.html5_fragment(unsafe_html).scrub!(:strip).to_s
+# # => "ohai! div is safe
"
+#
+# Note that this method is called implicitly from the shortcuts Loofah.scrub_html5_fragment et
+# al.
+#
+# Please see Scrubber for more information on implementation and traversal, and README.rdoc for
+# more example usage.
+#
+# source://loofah//lib/loofah/concerns.rb#30
+module Loofah::ScrubBehavior
+ class << self
+ # source://loofah//lib/loofah/concerns.rb#59
+ def resolve_scrubber(scrubber); end
+ end
+end
+
+# source://loofah//lib/loofah/concerns.rb#31
+module Loofah::ScrubBehavior::Node
+ # source://loofah//lib/loofah/concerns.rb#32
+ def scrub!(scrubber); end
+end
+
+# source://loofah//lib/loofah/concerns.rb#51
+module Loofah::ScrubBehavior::NodeSet
+ # source://loofah//lib/loofah/concerns.rb#52
+ def scrub!(scrubber); end
+end
+
+# A Scrubber wraps up a block (or method) that is run on an HTML node (element):
+#
+# # change all tags to tags
+# span2div = Loofah::Scrubber.new do |node|
+# node.name = "div" if node.name == "span"
+# end
+#
+# Alternatively, this scrubber could have been implemented as:
+#
+# class Span2Div < Loofah::Scrubber
+# def scrub(node)
+# node.name = "div" if node.name == "span"
+# end
+# end
+# span2div = Span2Div.new
+#
+# This can then be run on a document:
+#
+# Loofah.html5_fragment("
foo bar
").scrub!(span2div).to_s
+# # => "
foo
bar
"
+#
+# Scrubbers can be run on a document in either a top-down traversal (the
+# default) or bottom-up. Top-down scrubbers can optionally return
+# Scrubber::STOP to terminate the traversal of a subtree.
+#
+# source://loofah//lib/loofah/scrubber.rb#35
+class Loofah::Scrubber
+ # Options may include
+ # :direction => :top_down (the default)
+ # or
+ # :direction => :bottom_up
+ #
+ # For top_down traversals, if the block returns
+ # Loofah::Scrubber::STOP, then the traversal will be terminated
+ # for the current node's subtree.
+ #
+ # Alternatively, a Scrubber may inherit from Loofah::Scrubber,
+ # and implement +scrub+, which is slightly faster than using a
+ # block.
+ #
+ # @return [Scrubber] a new instance of Scrubber
+ #
+ # source://loofah//lib/loofah/scrubber.rb#65
+ def initialize(options = T.unsafe(nil), &block); end
+
+ # If the attribute is not set, add it
+ # If the attribute is set, don't overwrite the existing value
+ #
+ # source://loofah//lib/loofah/scrubber.rb#96
+ def append_attribute(node, attribute, value); end
+
+ # When a scrubber is initialized, the optional block is saved as
+ # :block. Note that, if no block is passed, then the +scrub+
+ # method is assumed to have been implemented.
+ #
+ # source://loofah//lib/loofah/scrubber.rb#49
+ def block; end
+
+ # When a scrubber is initialized, the :direction may be specified
+ # as :top_down (the default) or :bottom_up.
+ #
+ # source://loofah//lib/loofah/scrubber.rb#44
+ def direction; end
+
+ # When +new+ is not passed a block, the class may implement
+ # +scrub+, which will be called for each document node.
+ #
+ # @raise [ScrubberNotFound]
+ #
+ # source://loofah//lib/loofah/scrubber.rb#88
+ def scrub(node); end
+
+ # Calling +traverse+ will cause the document to be traversed by
+ # either the lambda passed to the initializer or the +scrub+
+ # method, in the direction specified at +new+ time.
+ #
+ # source://loofah//lib/loofah/scrubber.rb#80
+ def traverse(node); end
+
+ private
+
+ # source://loofah//lib/loofah/scrubber.rb#105
+ def html5lib_sanitize(node); end
+
+ # source://loofah//lib/loofah/scrubber.rb#131
+ def traverse_conditionally_bottom_up(node); end
+
+ # source://loofah//lib/loofah/scrubber.rb#122
+ def traverse_conditionally_top_down(node); end
+end
+
+# Top-down Scrubbers may return CONTINUE to indicate that the subtree should be traversed.
+#
+# source://loofah//lib/loofah/scrubber.rb#37
+Loofah::Scrubber::CONTINUE = T.let(T.unsafe(nil), Object)
+
+# Top-down Scrubbers may return STOP to indicate that the subtree should not be traversed.
+#
+# source://loofah//lib/loofah/scrubber.rb#40
+Loofah::Scrubber::STOP = T.let(T.unsafe(nil), Object)
+
+# A RuntimeError raised when Loofah could not find an appropriate scrubber.
+#
+# source://loofah//lib/loofah/scrubber.rb#7
+class Loofah::ScrubberNotFound < ::RuntimeError; end
+
+# Loofah provides some built-in scrubbers for sanitizing with
+# HTML5lib's safelist and for accomplishing some common
+# transformation tasks.
+#
+#
+# === Loofah::Scrubbers::Strip / scrub!(:strip)
+#
+# +:strip+ removes unknown/unsafe tags, but leaves behind the pristine contents:
+#
+# unsafe_html = "ohai!
div is safe
but foo is not "
+# Loofah.html5_fragment(unsafe_html).scrub!(:strip)
+# => "ohai!
div is safe
but foo is
not "
+#
+#
+# === Loofah::Scrubbers::Prune / scrub!(:prune)
+#
+# +:prune+ removes unknown/unsafe tags and their contents (including their subtrees):
+#
+# unsafe_html = "ohai!
div is safe
but foo is not "
+# Loofah.html5_fragment(unsafe_html).scrub!(:prune)
+# => "ohai!
div is safe
"
+#
+#
+# === Loofah::Scrubbers::Escape / scrub!(:escape)
+#
+# +:escape+ performs HTML entity escaping on the unknown/unsafe tags:
+#
+# unsafe_html = "ohai!
div is safe
but foo is not "
+# Loofah.html5_fragment(unsafe_html).scrub!(:escape)
+# => "ohai!
div is safe
<foo>but foo is <b>not</b></foo>"
+#
+#
+# === Loofah::Scrubbers::Whitewash / scrub!(:whitewash)
+#
+# +:whitewash+ removes all comments, styling and attributes in
+# addition to doing markup-fixer-uppery and pruning unsafe tags. I
+# like to call this "whitewashing", since it's like putting a new
+# layer of paint on top of the HTML input to make it look nice.
+#
+# messy_markup = "ohai!
div with attributes
"
+# Loofah.html5_fragment(messy_markup).scrub!(:whitewash)
+# => "ohai!
div with attributes
"
+#
+# One use case for this scrubber is to clean up HTML that was
+# cut-and-pasted from Microsoft Word into a WYSIWYG editor or a
+# rich text editor. Microsoft's software is famous for injecting
+# all kinds of cruft into its HTML output. Who needs that crap?
+# Certainly not me.
+#
+#
+# === Loofah::Scrubbers::NoFollow / scrub!(:nofollow)
+#
+# +:nofollow+ adds a rel="nofollow" attribute to all links
+#
+# link_farmers_markup = "ohai!
I like your blog post "
+# Loofah.html5_fragment(link_farmers_markup).scrub!(:nofollow)
+# => "ohai!
I like your blog post "
+#
+#
+# === Loofah::Scrubbers::TargetBlank / scrub!(:targetblank)
+#
+# +:targetblank+ adds a target="_blank" attribute to all links
+#
+# link_farmers_markup = "ohai!
I like your blog post "
+# Loofah.html5_fragment(link_farmers_markup).scrub!(:targetblank)
+# => "ohai!
I like your blog post "
+#
+#
+# === Loofah::Scrubbers::NoOpener / scrub!(:noopener)
+#
+# +:noopener+ adds a rel="noopener" attribute to all links
+#
+# link_farmers_markup = "ohai!
I like your blog post "
+# Loofah.html5_fragment(link_farmers_markup).scrub!(:noopener)
+# => "ohai!
I like your blog post "
+#
+# === Loofah::Scrubbers::NoReferrer / scrub!(:noreferrer)
+#
+# +:noreferrer+ adds a rel="noreferrer" attribute to all links
+#
+# link_farmers_markup = "ohai!
I like your blog post "
+# Loofah.html5_fragment(link_farmers_markup).scrub!(:noreferrer)
+# => "ohai!
I like your blog post "
+#
+#
+# === Loofah::Scrubbers::Unprintable / scrub!(:unprintable)
+#
+# +:unprintable+ removes unprintable Unicode characters.
+#
+# markup = "
Some text with an unprintable character at the end\u2028
"
+# Loofah.html5_fragment(markup).scrub!(:unprintable)
+# => "
Some text with an unprintable character at the end
"
+#
+# You may not be able to see the unprintable character in the above example, but there is a
+# U+2028 character right before the closing tag. These characters can cause issues if
+# the content is ever parsed by JavaScript - more information here:
+#
+# http://timelessrepo.com/json-isnt-a-javascript-subset
+#
+# source://loofah//lib/loofah/scrubbers.rb#104
+module Loofah::Scrubbers
+ class << self
+ # Returns an array of symbols representing the built-in scrubbers
+ #
+ # source://loofah//lib/loofah/scrubbers.rb#425
+ def scrubber_symbols; end
+ end
+end
+
+# === scrub!(:double_breakpoint)
+#
+# +:double_breakpoint+ replaces double-break tags with closing/opening paragraph tags.
+#
+# markup = "
Some text here in a logical paragraph. Some more text, apparently a second paragraph.
"
+# Loofah.html5_fragment(markup).scrub!(:double_breakpoint)
+# => "
Some text here in a logical paragraph.
Some more text, apparently a second paragraph.
"
+#
+# source://loofah//lib/loofah/scrubbers.rb#362
+class Loofah::Scrubbers::DoubleBreakpoint < ::Loofah::Scrubber
+ # @return [DoubleBreakpoint] a new instance of DoubleBreakpoint
+ #
+ # source://loofah//lib/loofah/scrubbers.rb#363
+ def initialize; end
+
+ # source://loofah//lib/loofah/scrubbers.rb#367
+ def scrub(node); end
+
+ private
+
+ # source://loofah//lib/loofah/scrubbers.rb#400
+ def remove_blank_text_nodes(node); end
+end
+
+# === scrub!(:escape)
+#
+# +:escape+ performs HTML entity escaping on the unknown/unsafe tags:
+#
+# unsafe_html = "ohai!
div is safe
but foo is not "
+# Loofah.html5_fragment(unsafe_html).scrub!(:escape)
+# => "ohai!
div is safe
<foo>but foo is <b>not</b></foo>"
+#
+# source://loofah//lib/loofah/scrubbers.rb#159
+class Loofah::Scrubbers::Escape < ::Loofah::Scrubber
+ # @return [Escape] a new instance of Escape
+ #
+ # source://loofah//lib/loofah/scrubbers.rb#160
+ def initialize; end
+
+ # source://loofah//lib/loofah/scrubbers.rb#164
+ def scrub(node); end
+end
+
+# A hash that maps a symbol (like +:prune+) to the appropriate Scrubber (Loofah::Scrubbers::Prune).
+#
+# source://loofah//lib/loofah/scrubbers.rb#407
+Loofah::Scrubbers::MAP = T.let(T.unsafe(nil), Hash)
+
+# This class probably isn't useful publicly, but is used for #to_text's current implemention
+#
+# source://loofah//lib/loofah/scrubbers.rb#307
+class Loofah::Scrubbers::NewlineBlockElements < ::Loofah::Scrubber
+ # @return [NewlineBlockElements] a new instance of NewlineBlockElements
+ #
+ # source://loofah//lib/loofah/scrubbers.rb#308
+ def initialize; end
+
+ # source://loofah//lib/loofah/scrubbers.rb#312
+ def scrub(node); end
+end
+
+# === scrub!(:nofollow)
+#
+# +:nofollow+ adds a rel="nofollow" attribute to all links
+#
+# link_farmers_markup = "ohai!
I like your blog post "
+# Loofah.html5_fragment(link_farmers_markup).scrub!(:nofollow)
+# => "ohai!
I like your blog post "
+#
+# source://loofah//lib/loofah/scrubbers.rb#220
+class Loofah::Scrubbers::NoFollow < ::Loofah::Scrubber
+ # @return [NoFollow] a new instance of NoFollow
+ #
+ # source://loofah//lib/loofah/scrubbers.rb#221
+ def initialize; end
+
+ # source://loofah//lib/loofah/scrubbers.rb#225
+ def scrub(node); end
+end
+
+# === scrub!(:noopener)
+#
+# +:noopener+ adds a rel="noopener" attribute to all links
+#
+# link_farmers_markup = "ohai!
I like your blog post "
+# Loofah.html5_fragment(link_farmers_markup).scrub!(:noopener)
+# => "ohai!
I like your blog post "
+#
+# source://loofah//lib/loofah/scrubbers.rb#271
+class Loofah::Scrubbers::NoOpener < ::Loofah::Scrubber
+ # @return [NoOpener] a new instance of NoOpener
+ #
+ # source://loofah//lib/loofah/scrubbers.rb#272
+ def initialize; end
+
+ # source://loofah//lib/loofah/scrubbers.rb#276
+ def scrub(node); end
+end
+
+# === scrub!(:noreferrer)
+#
+# +:noreferrer+ adds a rel="noreferrer" attribute to all links
+#
+# link_farmers_markup = "ohai!
I like your blog post "
+# Loofah.html5_fragment(link_farmers_markup).scrub!(:noreferrer)
+# => "ohai!
I like your blog post "
+#
+# source://loofah//lib/loofah/scrubbers.rb#293
+class Loofah::Scrubbers::NoReferrer < ::Loofah::Scrubber
+ # @return [NoReferrer] a new instance of NoReferrer
+ #
+ # source://loofah//lib/loofah/scrubbers.rb#294
+ def initialize; end
+
+ # source://loofah//lib/loofah/scrubbers.rb#298
+ def scrub(node); end
+end
+
+# === scrub!(:prune)
+#
+# +:prune+ removes unknown/unsafe tags and their contents (including their subtrees):
+#
+# unsafe_html = "ohai!
div is safe
but foo is not "
+# Loofah.html5_fragment(unsafe_html).scrub!(:prune)
+# => "ohai!
div is safe
"
+#
+# source://loofah//lib/loofah/scrubbers.rb#137
+class Loofah::Scrubbers::Prune < ::Loofah::Scrubber
+ # @return [Prune] a new instance of Prune
+ #
+ # source://loofah//lib/loofah/scrubbers.rb#138
+ def initialize; end
+
+ # source://loofah//lib/loofah/scrubbers.rb#142
+ def scrub(node); end
+end
+
+# === scrub!(:strip)
+#
+# +:strip+ removes unknown/unsafe tags, but leaves behind the pristine contents:
+#
+# unsafe_html = "ohai!
div is safe
but foo is not "
+# Loofah.html5_fragment(unsafe_html).scrub!(:strip)
+# => "ohai!
div is safe
but foo is
not "
+#
+# source://loofah//lib/loofah/scrubbers.rb#114
+class Loofah::Scrubbers::Strip < ::Loofah::Scrubber
+ # @return [Strip] a new instance of Strip
+ #
+ # source://loofah//lib/loofah/scrubbers.rb#115
+ def initialize; end
+
+ # source://loofah//lib/loofah/scrubbers.rb#119
+ def scrub(node); end
+end
+
+# === scrub!(:targetblank)
+#
+# +:targetblank+ adds a target="_blank" attribute to all links.
+# If there is a target already set, replaces it with target="_blank".
+#
+# link_farmers_markup = "ohai!
I like your blog post "
+# Loofah.html5_fragment(link_farmers_markup).scrub!(:targetblank)
+# => "ohai!
I like your blog post "
+#
+# On modern browsers, setting target="_blank" on anchor elements implicitly provides the same
+# behavior as setting rel="noopener".
+#
+# source://loofah//lib/loofah/scrubbers.rb#246
+class Loofah::Scrubbers::TargetBlank < ::Loofah::Scrubber
+ # @return [TargetBlank] a new instance of TargetBlank
+ #
+ # source://loofah//lib/loofah/scrubbers.rb#247
+ def initialize; end
+
+ # source://loofah//lib/loofah/scrubbers.rb#251
+ def scrub(node); end
+end
+
+# === scrub!(:unprintable)
+#
+# +:unprintable+ removes unprintable Unicode characters.
+#
+# markup = "
Some text with an unprintable character at the end\u2028
"
+# Loofah.html5_fragment(markup).scrub!(:unprintable)
+# => "
Some text with an unprintable character at the end
"
+#
+# You may not be able to see the unprintable character in the above example, but there is a
+# U+2028 character right before the closing tag. These characters can cause issues if
+# the content is ever parsed by JavaScript - more information here:
+#
+# http://timelessrepo.com/json-isnt-a-javascript-subset
+#
+# source://loofah//lib/loofah/scrubbers.rb#340
+class Loofah::Scrubbers::Unprintable < ::Loofah::Scrubber
+ # @return [Unprintable] a new instance of Unprintable
+ #
+ # source://loofah//lib/loofah/scrubbers.rb#341
+ def initialize; end
+
+ # source://loofah//lib/loofah/scrubbers.rb#345
+ def scrub(node); end
+end
+
+# === scrub!(:whitewash)
+#
+# +:whitewash+ removes all comments, styling and attributes in
+# addition to doing markup-fixer-uppery and pruning unsafe tags. I
+# like to call this "whitewashing", since it's like putting a new
+# layer of paint on top of the HTML input to make it look nice.
+#
+# messy_markup = "ohai!
div with attributes
"
+# Loofah.html5_fragment(messy_markup).scrub!(:whitewash)
+# => "ohai!
div with attributes
"
+#
+# One use case for this scrubber is to clean up HTML that was
+# cut-and-pasted from Microsoft Word into a WYSIWYG editor or a
+# rich text editor. Microsoft's software is famous for injecting
+# all kinds of cruft into its HTML output. Who needs that crap?
+# Certainly not me.
+#
+# source://loofah//lib/loofah/scrubbers.rb#191
+class Loofah::Scrubbers::Whitewash < ::Loofah::Scrubber
+ # @return [Whitewash] a new instance of Whitewash
+ #
+ # source://loofah//lib/loofah/scrubbers.rb#192
+ def initialize; end
+
+ # source://loofah//lib/loofah/scrubbers.rb#196
+ def scrub(node); end
+end
+
+# Overrides +text+ in Document and DocumentFragment classes, and mixes in +to_text+.
+#
+# source://loofah//lib/loofah/concerns.rb#73
+module Loofah::TextBehavior
+ # Returns a plain-text version of the markup contained by the document, with HTML entities
+ # encoded.
+ #
+ # This method is significantly faster than #to_text, but isn't clever about whitespace around
+ # block elements.
+ #
+ # Loofah.html5_document("
Title Content
").text
+ # # => "TitleContent"
+ #
+ # By default, the returned text will have HTML entities escaped. If you want unescaped
+ # entities, and you understand that the result is unsafe to render in a browser, then you can
+ # pass an argument as shown:
+ #
+ # frag = Loofah.html5_fragment("<script>alert('EVIL');</script>")
+ # # ok for browser:
+ # frag.text # => "<script>alert('EVIL');</script>"
+ # # decidedly not ok for browser:
+ # frag.text(:encode_special_chars => false) # => ""
+ #
+ # source://loofah//lib/loofah/concerns.rb#107
+ def inner_text(options = T.unsafe(nil)); end
+
+ # Returns a plain-text version of the markup contained by the document, with HTML entities
+ # encoded.
+ #
+ # This method is significantly faster than #to_text, but isn't clever about whitespace around
+ # block elements.
+ #
+ # Loofah.html5_document("
Title Content
").text
+ # # => "TitleContent"
+ #
+ # By default, the returned text will have HTML entities escaped. If you want unescaped
+ # entities, and you understand that the result is unsafe to render in a browser, then you can
+ # pass an argument as shown:
+ #
+ # frag = Loofah.html5_fragment("<script>alert('EVIL');</script>")
+ # # ok for browser:
+ # frag.text # => "<script>alert('EVIL');</script>"
+ # # decidedly not ok for browser:
+ # frag.text(:encode_special_chars => false) # => ""
+ #
+ # source://loofah//lib/loofah/concerns.rb#94
+ def text(options = T.unsafe(nil)); end
+
+ # Returns a plain-text version of the markup contained by the document, with HTML entities
+ # encoded.
+ #
+ # This method is significantly faster than #to_text, but isn't clever about whitespace around
+ # block elements.
+ #
+ # Loofah.html5_document("
Title Content
").text
+ # # => "TitleContent"
+ #
+ # By default, the returned text will have HTML entities escaped. If you want unescaped
+ # entities, and you understand that the result is unsafe to render in a browser, then you can
+ # pass an argument as shown:
+ #
+ # frag = Loofah.html5_fragment("<script>alert('EVIL');</script>")
+ # # ok for browser:
+ # frag.text # => "<script>alert('EVIL');</script>"
+ # # decidedly not ok for browser:
+ # frag.text(:encode_special_chars => false) # => ""
+ #
+ # source://loofah//lib/loofah/concerns.rb#108
+ def to_str(options = T.unsafe(nil)); end
+
+ # Returns a plain-text version of the markup contained by the fragment, with HTML entities
+ # encoded.
+ #
+ # This method is slower than #text, but is clever about whitespace around block elements and
+ # line break elements.
+ #
+ # Loofah.html5_document("
Title Content Next line
").to_text
+ # # => "\nTitle\n\nContent\nNext line\n"
+ #
+ # source://loofah//lib/loofah/concerns.rb#120
+ def to_text(options = T.unsafe(nil)); end
+end
+
+# The version of Loofah you are using
+#
+# source://loofah//lib/loofah/version.rb#5
+Loofah::VERSION = T.let(T.unsafe(nil), String)
+
+# source://loofah//lib/loofah/xml/document.rb#4
+module Loofah::XML; end
+
+# Subclass of Nokogiri::XML::Document.
+#
+# See Loofah::ScrubBehavior and Loofah::DocumentDecorator for additional methods.
+#
+# source://loofah//lib/loofah/xml/document.rb#10
+class Loofah::XML::Document < ::Nokogiri::XML::Document
+ include ::Loofah::ScrubBehavior::Node
+ include ::Loofah::DocumentDecorator
+end
+
+# Subclass of Nokogiri::XML::DocumentFragment.
+#
+# See Loofah::ScrubBehavior for additional methods.
+#
+# source://loofah//lib/loofah/xml/document_fragment.rb#10
+class Loofah::XML::DocumentFragment < ::Nokogiri::XML::DocumentFragment
+ class << self
+ # source://loofah//lib/loofah/xml/document_fragment.rb#12
+ def parse(tags); end
+ end
+end
diff --git a/sorbet/rbi/gems/mcp@0.8.0.rbi b/sorbet/rbi/gems/mcp@0.8.0.rbi
new file mode 100644
index 0000000..26f0769
--- /dev/null
+++ b/sorbet/rbi/gems/mcp@0.8.0.rbi
@@ -0,0 +1,9 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `mcp` gem.
+# Please instead update this file by running `bin/tapioca gem mcp`.
+
+
+# THIS IS AN EMPTY RBI FILE.
+# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
diff --git a/sorbet/rbi/gems/method_source@1.1.0.rbi b/sorbet/rbi/gems/method_source@1.1.0.rbi
new file mode 100644
index 0000000..6010d0b
--- /dev/null
+++ b/sorbet/rbi/gems/method_source@1.1.0.rbi
@@ -0,0 +1,304 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `method_source` gem.
+# Please instead update this file by running `bin/tapioca gem method_source`.
+
+
+# source://method_source//lib/method_source.rb#163
+class Method
+ include ::MethodSource::SourceLocation::MethodExtensions
+ include ::MethodSource::MethodExtensions
+end
+
+# source://method_source//lib/method_source/version.rb#1
+module MethodSource
+ extend ::MethodSource::CodeHelpers
+
+ class << self
+ # Clear cache.
+ #
+ # source://method_source//lib/method_source.rb#59
+ def clear_cache; end
+
+ # Helper method responsible for opening source file and buffering up
+ # the comments for a specified method. Defined here to avoid polluting
+ # `Method` class.
+ #
+ # @param method_name [String]
+ # @param source_location [Array] The array returned by Method#source_location
+ # @raise [SourceNotFoundError]
+ # @return [String] The comments up to the point of the method.
+ #
+ # source://method_source//lib/method_source.rb#38
+ def comment_helper(source_location, name = T.unsafe(nil)); end
+
+ # @deprecated — use MethodSource::CodeHelpers#expression_at
+ #
+ # source://method_source//lib/method_source.rb#71
+ def extract_code(source_location); end
+
+ # Load a memoized copy of the lines in a file.
+ #
+ # @param file_name [String]
+ # @param method_name [String]
+ # @raise [SourceNotFoundError]
+ # @return [Array
] the contents of the file
+ #
+ # source://method_source//lib/method_source.rb#51
+ def lines_for(file_name, name = T.unsafe(nil)); end
+
+ # Helper method responsible for extracting method body.
+ # Defined here to avoid polluting `Method` class.
+ #
+ # @param method_name [String]
+ # @param source_location [Array] The array returned by Method#source_location
+ # @return [String] The method body
+ #
+ # source://method_source//lib/method_source.rb#23
+ def source_helper(source_location, name = T.unsafe(nil)); end
+
+ # @deprecated — use MethodSource::CodeHelpers#complete_expression?
+ # @return [Boolean]
+ #
+ # source://method_source//lib/method_source.rb#64
+ def valid_expression?(str); end
+ end
+end
+
+# source://method_source//lib/method_source/code_helpers.rb#3
+module MethodSource::CodeHelpers
+ # Retrieve the comment describing the expression on the given line of the given file.
+ #
+ # This is useful to get module or method documentation.
+ #
+ # @param file [Array, File, String] The file to parse, either as a File or as
+ # a String or an Array of lines.
+ # @param line_number [Integer] The line number at which to look.
+ # NOTE: The first line in a file is line 1!
+ # @return [String] The comment
+ #
+ # source://method_source//lib/method_source/code_helpers.rb#52
+ def comment_describing(file, line_number); end
+
+ # Determine if a string of code is a complete Ruby expression.
+ #
+ # @example
+ # complete_expression?("class Hello") #=> false
+ # complete_expression?("class Hello; end") #=> true
+ # complete_expression?("class 123") #=> SyntaxError: unexpected tINTEGER
+ # @param code [String] The code to validate.
+ # @raise [SyntaxError] Any SyntaxError that does not represent incompleteness.
+ # @return [Boolean] Whether or not the code is a complete Ruby expression.
+ #
+ # source://method_source//lib/method_source/code_helpers.rb#66
+ def complete_expression?(str); end
+
+ # Retrieve the first expression starting on the given line of the given file.
+ #
+ # This is useful to get module or method source code.
+ #
+ # line 1!
+ #
+ # @option options
+ # @option options
+ # @param file [Array, File, String] The file to parse, either as a File or as
+ # @param line_number [Integer] The line number at which to look.
+ # NOTE: The first line in a file is
+ # @param options [Hash] The optional configuration parameters.
+ # @raise [SyntaxError] If the first complete expression can't be identified
+ # @return [String] The first complete expression
+ #
+ # source://method_source//lib/method_source/code_helpers.rb#20
+ def expression_at(file, line_number, options = T.unsafe(nil)); end
+
+ private
+
+ # Get the first expression from the input.
+ #
+ # @param consume [Integer] A number of lines to automatically
+ # consume (add to the expression buffer) without checking for validity.
+ # @param lines [Array]
+ # @raise [SyntaxError]
+ # @return [String] a valid ruby expression
+ # @yield a clean-up function to run before checking for complete_expression
+ #
+ # source://method_source//lib/method_source/code_helpers.rb#92
+ def extract_first_expression(lines, consume = T.unsafe(nil), &block); end
+
+ # Get the last comment from the input.
+ #
+ # @param lines [Array]
+ # @return [String]
+ #
+ # source://method_source//lib/method_source/code_helpers.rb#106
+ def extract_last_comment(lines); end
+end
+
+# An exception matcher that matches only subsets of SyntaxErrors that can be
+# fixed by adding more input to the buffer.
+#
+# source://method_source//lib/method_source/code_helpers.rb#124
+module MethodSource::CodeHelpers::IncompleteExpression
+ class << self
+ # source://method_source//lib/method_source/code_helpers.rb#137
+ def ===(ex); end
+
+ # @return [Boolean]
+ #
+ # source://method_source//lib/method_source/code_helpers.rb#149
+ def rbx?; end
+ end
+end
+
+# source://method_source//lib/method_source/code_helpers.rb#125
+MethodSource::CodeHelpers::IncompleteExpression::GENERIC_REGEXPS = T.let(T.unsafe(nil), Array)
+
+# source://method_source//lib/method_source/code_helpers.rb#133
+MethodSource::CodeHelpers::IncompleteExpression::RBX_ONLY_REGEXPS = T.let(T.unsafe(nil), Array)
+
+# This module is to be included by `Method` and `UnboundMethod` and
+# provides the `#source` functionality
+#
+# source://method_source//lib/method_source.rb#77
+module MethodSource::MethodExtensions
+ # Return the comments associated with the method class/module.
+ #
+ # @example
+ # MethodSource::MethodExtensions.method(:included).module_comment
+ # =>
+ # # This module is to be included by `Method` and `UnboundMethod` and
+ # # provides the `#source` functionality
+ # @raise SourceNotFoundException
+ # @return [String] The method's comments as a string
+ #
+ # source://method_source//lib/method_source.rb#139
+ def class_comment; end
+
+ # Return the comments associated with the method as a string.
+ #
+ # @example
+ # Set.instance_method(:clear).comment.display
+ # =>
+ # # Removes all elements and returns self.
+ # @raise SourceNotFoundException
+ # @return [String] The method's comments as a string
+ #
+ # source://method_source//lib/method_source.rb#126
+ def comment; end
+
+ # Return the comments associated with the method class/module.
+ #
+ # @example
+ # MethodSource::MethodExtensions.method(:included).module_comment
+ # =>
+ # # This module is to be included by `Method` and `UnboundMethod` and
+ # # provides the `#source` functionality
+ # @raise SourceNotFoundException
+ # @return [String] The method's comments as a string
+ #
+ # source://method_source//lib/method_source.rb#159
+ def module_comment; end
+
+ # Return the sourcecode for the method as a string
+ #
+ # @example
+ # Set.instance_method(:clear).source.display
+ # =>
+ # def clear
+ # @hash.clear
+ # self
+ # end
+ # @raise SourceNotFoundException
+ # @return [String] The method sourcecode as a string
+ #
+ # source://method_source//lib/method_source.rb#114
+ def source; end
+
+ class << self
+ # We use the included hook to patch Method#source on rubinius.
+ # We need to use the included hook as Rubinius defines a `source`
+ # on Method so including a module will have no effect (as it's
+ # higher up the MRO).
+ #
+ # @param klass [Class] The class that includes the module.
+ #
+ # source://method_source//lib/method_source.rb#84
+ def included(klass); end
+ end
+end
+
+# source://method_source//lib/method_source/source_location.rb#2
+module MethodSource::ReeSourceLocation
+ # Ruby enterprise edition provides all the information that's
+ # needed, in a slightly different way.
+ #
+ # source://method_source//lib/method_source/source_location.rb#5
+ def source_location; end
+end
+
+# source://method_source//lib/method_source/source_location.rb#10
+module MethodSource::SourceLocation; end
+
+# source://method_source//lib/method_source/source_location.rb#11
+module MethodSource::SourceLocation::MethodExtensions
+ # Return the source location of a method for Ruby 1.8.
+ #
+ # @return [Array] A two element array. First element is the
+ # file, second element is the line in the file where the
+ # method definition is found.
+ #
+ # source://method_source//lib/method_source/source_location.rb#40
+ def source_location; end
+
+ private
+
+ # source://method_source//lib/method_source/source_location.rb#26
+ def trace_func(event, file, line, id, binding, classname); end
+end
+
+# source://method_source//lib/method_source/source_location.rb#54
+module MethodSource::SourceLocation::ProcExtensions
+ # Return the source location for a Proc (in implementations
+ # without Proc#source_location)
+ #
+ # @return [Array] A two element array. First element is the
+ # file, second element is the line in the file where the
+ # proc definition is found.
+ #
+ # source://method_source//lib/method_source/source_location.rb#74
+ def source_location; end
+end
+
+# source://method_source//lib/method_source/source_location.rb#81
+module MethodSource::SourceLocation::UnboundMethodExtensions
+ # Return the source location of an instance method for Ruby 1.8.
+ #
+ # @return [Array] A two element array. First element is the
+ # file, second element is the line in the file where the
+ # method definition is found.
+ #
+ # source://method_source//lib/method_source/source_location.rb#101
+ def source_location; end
+end
+
+# An Exception to mark errors that were raised trying to find the source from
+# a given source_location.
+#
+# source://method_source//lib/method_source.rb#16
+class MethodSource::SourceNotFoundError < ::StandardError; end
+
+# source://method_source//lib/method_source/version.rb#2
+MethodSource::VERSION = T.let(T.unsafe(nil), String)
+
+# source://method_source//lib/method_source.rb#173
+class Proc
+ include ::MethodSource::SourceLocation::ProcExtensions
+ include ::MethodSource::MethodExtensions
+end
+
+# source://method_source//lib/method_source.rb#168
+class UnboundMethod
+ include ::MethodSource::SourceLocation::UnboundMethodExtensions
+ include ::MethodSource::MethodExtensions
+end
diff --git a/sorbet/rbi/gems/minitest@5.16.3.rbi b/sorbet/rbi/gems/minitest@5.16.3.rbi
deleted file mode 100644
index 8a4ceb6..0000000
--- a/sorbet/rbi/gems/minitest@5.16.3.rbi
+++ /dev/null
@@ -1,348 +0,0 @@
-# typed: true
-
-# DO NOT EDIT MANUALLY
-# This is an autogenerated file for types exported from the `minitest` gem.
-# Please instead update this file by running `bin/tapioca gem minitest`.
-
-module Minitest
- class << self
- def __run(reporter, options); end
- def after_run(&block); end
- def autorun; end
- def backtrace_filter; end
- def backtrace_filter=(_arg0); end
- def cattr_accessor(name); end
- def clock_time; end
- def extensions; end
- def extensions=(_arg0); end
- def filter_backtrace(bt); end
- def info_signal; end
- def info_signal=(_arg0); end
- def init_plugins(options); end
- def load_plugins; end
- def parallel_executor; end
- def parallel_executor=(_arg0); end
- def process_args(args = T.unsafe(nil)); end
- def reporter; end
- def reporter=(_arg0); end
- def run(args = T.unsafe(nil)); end
- def run_one_method(klass, method_name); end
- def seed; end
- def seed=(_arg0); end
- end
-end
-
-class Minitest::AbstractReporter
- include ::Mutex_m
-
- def lock; end
- def locked?; end
- def passed?; end
- def prerecord(klass, name); end
- def record(result); end
- def report; end
- def start; end
- def synchronize(&block); end
- def try_lock; end
- def unlock; end
-end
-
-class Minitest::Assertion < ::Exception
- def error; end
- def location; end
- def result_code; end
- def result_label; end
-end
-
-module Minitest::Assertions
- def _synchronize; end
- def assert(test, msg = T.unsafe(nil)); end
- def assert_empty(obj, msg = T.unsafe(nil)); end
- def assert_equal(exp, act, msg = T.unsafe(nil)); end
- def assert_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end
- def assert_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end
- def assert_includes(collection, obj, msg = T.unsafe(nil)); end
- def assert_instance_of(cls, obj, msg = T.unsafe(nil)); end
- def assert_kind_of(cls, obj, msg = T.unsafe(nil)); end
- def assert_match(matcher, obj, msg = T.unsafe(nil)); end
- def assert_nil(obj, msg = T.unsafe(nil)); end
- def assert_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end
- def assert_output(stdout = T.unsafe(nil), stderr = T.unsafe(nil)); end
- def assert_path_exists(path, msg = T.unsafe(nil)); end
- def assert_predicate(o1, op, msg = T.unsafe(nil)); end
- def assert_raises(*exp); end
- def assert_respond_to(obj, meth, msg = T.unsafe(nil)); end
- def assert_same(exp, act, msg = T.unsafe(nil)); end
- def assert_send(send_ary, m = T.unsafe(nil)); end
- def assert_silent; end
- def assert_throws(sym, msg = T.unsafe(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 = T.unsafe(nil)); end
- def message(msg = T.unsafe(nil), ending = T.unsafe(nil), &default); end
- def mu_pp(obj); end
- def mu_pp_for_diff(obj); end
- def pass(_msg = T.unsafe(nil)); end
- def refute(test, msg = T.unsafe(nil)); end
- def refute_empty(obj, msg = T.unsafe(nil)); end
- def refute_equal(exp, act, msg = T.unsafe(nil)); end
- def refute_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end
- def refute_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end
- def refute_includes(collection, obj, msg = T.unsafe(nil)); end
- def refute_instance_of(cls, obj, msg = T.unsafe(nil)); end
- def refute_kind_of(cls, obj, msg = T.unsafe(nil)); end
- def refute_match(matcher, obj, msg = T.unsafe(nil)); end
- def refute_nil(obj, msg = T.unsafe(nil)); end
- def refute_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end
- def refute_path_exists(path, msg = T.unsafe(nil)); end
- def refute_predicate(o1, op, msg = T.unsafe(nil)); end
- def refute_respond_to(obj, meth, msg = T.unsafe(nil)); end
- def refute_same(exp, act, msg = T.unsafe(nil)); end
- def skip(msg = T.unsafe(nil), bt = T.unsafe(nil)); end
- def skip_until(y, m, d, msg); end
- def skipped?; end
- def things_to_diff(exp, act); end
-
- class << self
- def diff; end
- def diff=(o); end
- end
-end
-
-Minitest::Assertions::E = T.let(T.unsafe(nil), String)
-Minitest::Assertions::UNDEFINED = T.let(T.unsafe(nil), Object)
-
-class Minitest::BacktraceFilter
- def filter(bt); end
-end
-
-Minitest::BacktraceFilter::MT_RE = T.let(T.unsafe(nil), Regexp)
-
-class Minitest::CompositeReporter < ::Minitest::AbstractReporter
- def initialize(*reporters); end
-
- def <<(reporter); 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
-
-module Minitest::Guard
- def jruby?(platform = T.unsafe(nil)); end
- def maglev?(platform = T.unsafe(nil)); end
- def mri?(platform = T.unsafe(nil)); end
- def osx?(platform = T.unsafe(nil)); end
- def rubinius?(platform = T.unsafe(nil)); end
- def windows?(platform = T.unsafe(nil)); end
-end
-
-module Minitest::Parallel; end
-
-class Minitest::Parallel::Executor
- def initialize(size); end
-
- def <<(work); 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
-
-class Minitest::ProgressReporter < ::Minitest::Reporter
- def prerecord(klass, name); end
- def record(result); 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::Reporter < ::Minitest::AbstractReporter
- def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end
-
- def io; end
- def io=(_arg0); end
- def options; end
- def options=(_arg0); end
-end
-
-class Minitest::Result < ::Minitest::Runnable
- include ::Minitest::Reportable
-
- def class_name; end
- def klass; end
- def klass=(_arg0); end
- def source_location; end
- def source_location=(_arg0); end
- def to_s; end
-
- class << self
- def from(runnable); end
- end
-end
-
-class Minitest::Runnable
- def initialize(name); end
-
- def assertions; end
- def assertions=(_arg0); end
- def failure; end
- def failures; end
- def failures=(_arg0); end
- def marshal_dump; end
- def marshal_load(ary); end
- def name; end
- def name=(o); end
- def passed?; end
- def result_code; end
- def run; end
- def skipped?; end
- def time; end
- def time=(_arg0); end
- def time_it; end
-
- class << self
- def inherited(klass); end
- def methods_matching(re); end
- def on_signal(name, action); end
- def reset; end
- def run(reporter, options = T.unsafe(nil)); end
- def run_one_method(klass, method_name, reporter); end
- def runnable_methods; end
- def runnables; end
- def with_info_handler(reporter, &block); end
- end
-end
-
-Minitest::Runnable::SIGNALS = T.let(T.unsafe(nil), Hash)
-
-class Minitest::Skip < ::Minitest::Assertion
- def result_label; end
-end
-
-class Minitest::StatisticsReporter < ::Minitest::Reporter
- def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end
-
- 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 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
-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
-
- private
-
- def binary_string; end
-end
-
-class Minitest::Test < ::Minitest::Runnable
- include ::Minitest::Assertions
- include ::Minitest::Reportable
- include ::Minitest::Test::LifecycleHooks
- include ::Minitest::Guard
- extend ::Minitest::Guard
-
- def capture_exceptions; end
- def class_name; end
- def neuter_exception(e); end
- def new_exception(klass, msg, bt, kill = T.unsafe(nil)); end
- def run; end
- def sanitize_exception(e); end
- def with_info_handler(&block); end
-
- class << self
- def i_suck_and_my_tests_are_order_dependent!; end
- def io_lock; end
- def io_lock=(_arg0); end
- def make_my_diffs_pretty!; end
- def parallelize_me!; end
- def runnable_methods; end
- def test_order; end
- end
-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
-
-Minitest::Test::PASSTHROUGH_EXCEPTIONS = T.let(T.unsafe(nil), Array)
-Minitest::Test::TEARDOWN_METHODS = T.let(T.unsafe(nil), Array)
-
-class Minitest::UnexpectedError < ::Minitest::Assertion
- def initialize(error); end
-
- def backtrace; end
- def error; end
- def error=(_arg0); end
- def message; end
- def result_label; end
-end
-
-class Minitest::Unit
- class << self
- def after_tests(&b); end
- def autorun; end
- end
-end
-
-class Minitest::Unit::TestCase < ::Minitest::Test
- class << self
- def inherited(klass); end
- end
-end
-
-Minitest::Unit::VERSION = T.let(T.unsafe(nil), String)
-Minitest::VERSION = T.let(T.unsafe(nil), String)
diff --git a/sorbet/rbi/gems/minitest@6.0.2.rbi b/sorbet/rbi/gems/minitest@6.0.2.rbi
new file mode 100644
index 0000000..c705eb1
--- /dev/null
+++ b/sorbet/rbi/gems/minitest@6.0.2.rbi
@@ -0,0 +1,1524 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `minitest` gem.
+# Please instead update this file by running `bin/tapioca gem minitest`.
+
+
+# The top-level namespace for Minitest. Also the location of the main
+# runtime. See +Minitest.run+ for more information.
+#
+# source://minitest//lib/minitest/parallel.rb#3
+module Minitest
+ class << self
+ # 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#95
+ def after_run(&block); end
+
+ # source://minitest//lib/minitest.rb#20
+ def allow_fork; end
+
+ # source://minitest//lib/minitest.rb#20
+ 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#20
+ def backtrace_filter; end
+
+ # source://minitest//lib/minitest.rb#20
+ def backtrace_filter=(_arg0); end
+
+ # source://minitest//lib/minitest.rb#19
+ def cattr_accessor(name); end
+
+ # source://minitest//lib/minitest.rb#1209
+ def clock_time; end
+
+ # source://minitest//lib/minitest.rb#332
+ def empty_run!(options); end
+
+ # source://minitest//lib/minitest.rb#20
+ def extensions; end
+
+ # source://minitest//lib/minitest.rb#20
+ def extensions=(_arg0); end
+
+ # source://minitest//lib/minitest.rb#365
+ def filter_backtrace(bt); end
+
+ # source://minitest//lib/minitest.rb#20
+ def info_signal; end
+
+ # source://minitest//lib/minitest.rb#20
+ def info_signal=(_arg0); end
+
+ # source://minitest//lib/minitest.rb#134
+ def init_plugins(options); end
+
+ # Manually load plugins by name.
+ #
+ # source://minitest//lib/minitest.rb#102
+ def load(*names); end
+
+ # source://minitest//lib/minitest.rb#118
+ def load_plugins; end
+
+ # source://minitest//lib/minitest.rb#20
+ def parallel_executor; end
+
+ # source://minitest//lib/minitest.rb#20
+ def parallel_executor=(_arg0); end
+
+ # source://minitest//lib/minitest.rb#152
+ def process_args(args = T.unsafe(nil)); end
+
+ # Register a plugin to be used. Does NOT require / load it.
+ #
+ # source://minitest//lib/minitest.rb#113
+ def register_plugin(name_or_mod); end
+
+ # source://minitest//lib/minitest.rb#20
+ def reporter; end
+
+ # source://minitest//lib/minitest.rb#20
+ 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.load_plugins] optional, called by user, or require what you want
+ # Minitest.autorun
+ # Minitest.run(args)
+ # Minitest.process_args
+ # Minitest.init_plugins
+ # Minitest.run_all_suites(reporter, options)
+ # Runnable.runnables.each |runnable_klass|
+ # runnable_klass.run_suite(reporter, options)
+ # filtered_methods = runnable_klass.filter_runnable_methods options
+ # filtered_methods.each |runnable_method|
+ # runnable_klass.run(self, runnable_method, reporter)
+ # runnable_klass.new(runnable_method).run
+ #
+ # source://minitest//lib/minitest.rb#299
+ def run(args = T.unsafe(nil)); end
+
+ # Internal run method. Responsible for telling all Runnable
+ # sub-classes to run.
+ #
+ # source://minitest//lib/minitest.rb#352
+ def run_all_suites(reporter, options); end
+
+ # source://minitest//lib/minitest.rb#20
+ def seed; end
+
+ # source://minitest//lib/minitest.rb#20
+ 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#707
+class Minitest::AbstractReporter
+ # @return [AbstractReporter] a new instance of AbstractReporter
+ #
+ # source://minitest//lib/minitest.rb#709
+ def initialize; end
+
+ # Did this run pass?
+ #
+ # @return [Boolean]
+ #
+ # source://minitest//lib/minitest.rb#744
+ 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#723
+ 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#732
+ def record(result); end
+
+ # Outputs the summary of the run.
+ #
+ # source://minitest//lib/minitest.rb#738
+ def report; end
+
+ # Starts reporting on the run.
+ #
+ # source://minitest//lib/minitest.rb#716
+ def start; end
+
+ # source://minitest//lib/minitest.rb#748
+ def synchronize(&block); end
+end
+
+# Represents run failures.
+#
+# source://minitest//lib/minitest.rb#1039
+class Minitest::Assertion < ::Exception
+ # source://minitest//lib/minitest.rb#1042
+ def error; end
+
+ # Where was this run before an assertion was raised?
+ #
+ # source://minitest//lib/minitest.rb#1049
+ def location; end
+
+ # source://minitest//lib/minitest.rb#1057
+ def result_code; end
+
+ # source://minitest//lib/minitest.rb#1061
+ def result_label; end
+end
+
+# source://minitest//lib/minitest.rb#1040
+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#193
+ 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#211
+ 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#225
+ 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#237
+ 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#244
+ def assert_includes(collection, obj, msg = T.unsafe(nil)); end
+
+ # Fails unless +obj+ is an instance of +cls+.
+ #
+ # source://minitest//lib/minitest/assertions.rb#254
+ 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#265
+ def assert_kind_of(cls, obj, msg = T.unsafe(nil)); end
+
+ # Fails unless +matcher+ =~ +obj+.
+ #
+ # source://minitest//lib/minitest/assertions.rb#276
+ def assert_match(matcher, obj, msg = T.unsafe(nil)); end
+
+ # Fails unless +obj+ is nil
+ #
+ # source://minitest//lib/minitest/assertions.rb#288
+ 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#298
+ 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#317
+ def assert_output(stdout = T.unsafe(nil), stderr = T.unsafe(nil)); end
+
+ # Fails unless +path+ exists.
+ #
+ # source://minitest//lib/minitest/assertions.rb#341
+ 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.
+ #
+ # source://minitest//lib/minitest/assertions.rb#360
+ 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#378
+ 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#406
+ 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#438
+ 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#446
+ def assert_same(exp, act, msg = T.unsafe(nil)); end
+
+ # Fails if the block outputs anything to stderr or stdout.
+ #
+ # See also: #assert_output
+ #
+ # source://minitest//lib/minitest/assertions.rb#459
+ def assert_silent; end
+
+ # Fails unless the block throws +sym+
+ #
+ # source://minitest//lib/minitest/assertions.rb#468
+ 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#504
+ 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#537
+ 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#569
+ 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#585
+ def fail_after(y, m, d, msg); end
+
+ # Fails with +msg+.
+ #
+ # source://minitest//lib/minitest/assertions.rb#592
+ def flunk(msg = T.unsafe(nil)); end
+
+ # Returns a proc that delays generation of an output message. If
+ # +msg+ is a proc (eg, from another +message+ call) return +msg+
+ # as-is. Otherwise, return a proc that will output +msg+ along
+ # with the value of the result of the block passed to +message+.
+ #
+ # source://minitest//lib/minitest/assertions.rb#603
+ 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#614
+ def pass(_msg = T.unsafe(nil)); end
+
+ # Fails if +test+ is truthy.
+ #
+ # source://minitest//lib/minitest/assertions.rb#621
+ def refute(test, msg = T.unsafe(nil)); end
+
+ # Fails if +obj+ is empty.
+ #
+ # source://minitest//lib/minitest/assertions.rb#629
+ 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#639
+ 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#651
+ 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#663
+ def refute_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end
+
+ # Fails if +obj+ includes +sub+.
+ #
+ # source://minitest//lib/minitest/assertions.rb#670
+ def refute_includes(obj, sub, msg = T.unsafe(nil)); end
+
+ # Fails if +obj+ is an instance of +cls+.
+ #
+ # source://minitest//lib/minitest/assertions.rb#678
+ 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#688
+ def refute_kind_of(cls, obj, msg = T.unsafe(nil)); end
+
+ # Fails if +matcher+ =~ +obj+.
+ #
+ # source://minitest//lib/minitest/assertions.rb#696
+ def refute_match(matcher, obj, msg = T.unsafe(nil)); end
+
+ # Fails if +obj+ is nil.
+ #
+ # source://minitest//lib/minitest/assertions.rb#705
+ 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#737
+ def refute_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end
+
+ # Fails if +path+ exists.
+ #
+ # source://minitest//lib/minitest/assertions.rb#747
+ 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.
+ #
+ # source://minitest//lib/minitest/assertions.rb#722
+ 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#761
+ 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#771
+ 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#780
+ 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#793
+ 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#805
+ def skip_until(y, m, d, msg); end
+
+ # Was this testcase skipped? Meant for #teardown.
+ #
+ # @return [Boolean]
+ #
+ # source://minitest//lib/minitest/assertions.rb#814
+ 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#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#989
+class Minitest::CompositeReporter < ::Minitest::AbstractReporter
+ # @return [CompositeReporter] a new instance of CompositeReporter
+ #
+ # source://minitest//lib/minitest.rb#995
+ def initialize(*reporters); end
+
+ # Add another reporter to the mix.
+ #
+ # source://minitest//lib/minitest.rb#1007
+ def <<(reporter); end
+
+ # source://minitest//lib/minitest.rb#1000
+ def io; end
+
+ # @return [Boolean]
+ #
+ # source://minitest//lib/minitest.rb#1011
+ def passed?; end
+
+ # source://minitest//lib/minitest.rb#1019
+ def prerecord(klass, name); end
+
+ # source://minitest//lib/minitest.rb#1025
+ def record(result); end
+
+ # source://minitest//lib/minitest.rb#1031
+ def report; end
+
+ # The list of reporters to dispatch to.
+ #
+ # source://minitest//lib/minitest.rb#993
+ def reporters; end
+
+ # The list of reporters to dispatch to.
+ #
+ # source://minitest//lib/minitest.rb#993
+ def reporters=(_arg0); end
+
+ # source://minitest//lib/minitest.rb#1015
+ 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#1138
+module Minitest::Guard
+ # Is this running on jruby?
+ #
+ # @return [Boolean]
+ #
+ # source://minitest//lib/minitest.rb#1143
+ def jruby?(platform = T.unsafe(nil)); end
+
+ # Is this running on mri?
+ #
+ # @return [Boolean]
+ #
+ # source://minitest//lib/minitest.rb#1150
+ def mri?(platform = T.unsafe(nil)); end
+
+ # Is this running on macOS?
+ #
+ # @return [Boolean]
+ #
+ # source://minitest//lib/minitest.rb#1157
+ def osx?(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#4
+module Minitest::Parallel; end
+
+# The engine used to run multiple tests in parallel.
+#
+# source://minitest//lib/minitest/parallel.rb#9
+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#19
+ def initialize(size); end
+
+ # Add a job to the queue
+ #
+ # source://minitest//lib/minitest/parallel.rb#45
+ 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#52
+ def shutdown; end
+
+ # The size of the pool of workers.
+ #
+ # source://minitest//lib/minitest/parallel.rb#14
+ def size; end
+
+ # Start the executor
+ #
+ # source://minitest//lib/minitest/parallel.rb#28
+ def start; end
+end
+
+# source://minitest//lib/minitest/parallel.rb#58
+module Minitest::Parallel::Test
+ # source://minitest//lib/minitest/parallel.rb#59
+ def _synchronize; end
+end
+
+# source://minitest//lib/minitest/parallel.rb#61
+module Minitest::Parallel::Test::ClassMethods
+ # source://minitest//lib/minitest/parallel.rb#62
+ def run(klass, method_name, reporter); end
+
+ # source://minitest//lib/minitest/parallel.rb#66
+ def run_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#779
+class Minitest::ProgressReporter < ::Minitest::Reporter
+ # source://minitest//lib/minitest.rb#780
+ def prerecord(klass, name); end
+
+ # source://minitest//lib/minitest.rb#787
+ 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#604
+module Minitest::Reportable
+ # @raise [NotImplementedError]
+ #
+ # source://minitest//lib/minitest.rb#626
+ def class_name; end
+
+ # Did this run error?
+ #
+ # @return [Boolean]
+ #
+ # source://minitest//lib/minitest.rb#647
+ def error?; end
+
+ # The location identifier of this test. Depends on a method
+ # existing called class_name.
+ #
+ # source://minitest//lib/minitest.rb#621
+ 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#611
+ def passed?; end
+
+ # Returns ".", "F", or "E" based on the result of the run.
+ #
+ # source://minitest//lib/minitest.rb#633
+ def result_code; end
+
+ # Was this run skipped?
+ #
+ # @return [Boolean]
+ #
+ # source://minitest//lib/minitest.rb#640
+ def skipped?; end
+end
+
+# source://minitest//lib/minitest.rb#615
+Minitest::Reportable::BASE_DIR = T.let(T.unsafe(nil), String)
+
+# AbstractReportera
+#
+# source://minitest//lib/minitest.rb#755
+class Minitest::Reporter < ::Minitest::AbstractReporter
+ # @return [Reporter] a new instance of Reporter
+ #
+ # source://minitest//lib/minitest.rb#764
+ def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end
+
+ # The IO used to report.
+ #
+ # source://minitest//lib/minitest.rb#757
+ def io; end
+
+ # The IO used to report.
+ #
+ # source://minitest//lib/minitest.rb#757
+ def io=(_arg0); end
+
+ # Command-line options for this run.
+ #
+ # source://minitest//lib/minitest.rb#762
+ def options; end
+
+ # Command-line options for this run.
+ #
+ # source://minitest//lib/minitest.rb#762
+ 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#659
+class Minitest::Result < ::Minitest::Runnable
+ include ::Minitest::Reportable
+
+ # source://minitest//lib/minitest.rb#690
+ def class_name; end
+
+ # The class name of the test result.
+ #
+ # source://minitest//lib/minitest.rb#665
+ def klass; end
+
+ # The class name of the test result.
+ #
+ # source://minitest//lib/minitest.rb#665
+ def klass=(_arg0); end
+
+ # The location of the test method.
+ #
+ # source://minitest//lib/minitest.rb#670
+ def source_location; end
+
+ # The location of the test method.
+ #
+ # source://minitest//lib/minitest.rb#670
+ def source_location=(_arg0); end
+
+ # source://minitest//lib/minitest.rb#694
+ def to_s; end
+
+ class << self
+ # Create a new test result from a Runnable instance.
+ #
+ # source://minitest//lib/minitest.rb#675
+ def from(runnable); end
+ end
+end
+
+# re-open
+#
+# source://minitest//lib/minitest.rb#378
+class Minitest::Runnable
+ # @return [Runnable] a new instance of Runnable
+ #
+ # source://minitest//lib/minitest.rb#535
+ def initialize(name); end
+
+ # Number of assertions executed in this run.
+ #
+ # source://minitest//lib/minitest.rb#382
+ def assertions; end
+
+ # Number of assertions executed in this run.
+ #
+ # source://minitest//lib/minitest.rb#382
+ def assertions=(_arg0); end
+
+ # source://minitest//lib/minitest.rb#531
+ def failure; end
+
+ # An assertion raised during the run, if any.
+ #
+ # source://minitest//lib/minitest.rb#387
+ def failures; end
+
+ # An assertion raised during the run, if any.
+ #
+ # source://minitest//lib/minitest.rb#387
+ def failures=(_arg0); 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#550
+ def metadata; end
+
+ # Sets metadata, mainly used for +Result.from+.
+ #
+ # source://minitest//lib/minitest.rb#557
+ def metadata=(_arg0); end
+
+ # Returns true if metadata exists.
+ #
+ # @return [Boolean]
+ #
+ # source://minitest//lib/minitest.rb#562
+ def metadata?; end
+
+ # Name of the run.
+ #
+ # source://minitest//lib/minitest.rb#405
+ def name; end
+
+ # Set the name of the run.
+ #
+ # source://minitest//lib/minitest.rb#412
+ 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#579
+ 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#588
+ def result_code; end
+
+ # Runs a single method. Needs to return self.
+ #
+ # @raise [NotImplementedError]
+ #
+ # source://minitest//lib/minitest.rb#569
+ def run; end
+
+ # Was this run skipped? See #passed? for more information.
+ #
+ # @raise [NotImplementedError]
+ # @return [Boolean]
+ #
+ # source://minitest//lib/minitest.rb#595
+ def skipped?; end
+
+ # The time it took to run.
+ #
+ # source://minitest//lib/minitest.rb#392
+ def time; end
+
+ # The time it took to run.
+ #
+ # source://minitest//lib/minitest.rb#392
+ def time=(_arg0); end
+
+ # source://minitest//lib/minitest.rb#394
+ def time_it; end
+
+ class << self
+ # Returns an array of filtered +runnable_methods+. Uses
+ # options[:include] (--include arguments) and options[:exclude]
+ # (--exclude arguments) values to filter.
+ #
+ # source://minitest//lib/minitest.rb#434
+ def filter_runnable_methods(options = T.unsafe(nil)); end
+
+ # source://minitest//lib/minitest.rb#1219
+ def inherited(klass); end
+
+ # Returns all instance methods matching the pattern +re+.
+ #
+ # source://minitest//lib/minitest.rb#419
+ def methods_matching(re); end
+
+ # source://minitest//lib/minitest.rb#503
+ def on_signal(name, action); end
+
+ # source://minitest//lib/minitest.rb#423
+ def reset; 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#484
+ def run(klass, method_name, reporter); 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#493
+ def run_order; 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#452
+ def run_suite(reporter, options = T.unsafe(nil)); 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#520
+ def runnable_methods; end
+
+ # Returns all subclasses of Runnable.
+ #
+ # source://minitest//lib/minitest.rb#527
+ def runnables; end
+
+ # source://minitest//lib/minitest.rb#497
+ def with_info_handler(_reporter = T.unsafe(nil), &block); end
+ end
+end
+
+# source://minitest//lib/minitest.rb#501
+Minitest::Runnable::SIGNALS = T.let(T.unsafe(nil), Hash)
+
+# Assertion raised when skipping a run.
+#
+# source://minitest//lib/minitest.rb#1069
+class Minitest::Skip < ::Minitest::Assertion
+ # source://minitest//lib/minitest.rb#1070
+ 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 "
+ #
+ # first
+ # second
+ #
+ #