diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..400039e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: [develop, master, main] + pull_request: + +jobs: + test: + name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: ['3.2', '3.3', '3.4'] + rails: ['7.1', '8.0', '8.1'] + include: + - ruby: '4.0' + rails: '8.1' + env: + RAILS_VERSION: "~> ${{ matrix.rails }}.0" + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Run tests + run: bundle exec rake test + + lint: + name: Rubocop and Sorbet + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '4.0' + bundler-cache: true + - name: Rubocop + run: bundle exec rubocop + - name: Sorbet + run: bundle exec srb tc diff --git a/.gitignore b/.gitignore index 50875e4..11f7bd0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *.swp -pkg -spec/_cases_output -spec/test_app/log/*.log -spec/test_app/tmp/ +/pkg/ +/tmp/ Gemfile.lock +sorbet/tapioca/ diff --git a/.rubocop.yml b/.rubocop.yml index fcc8d46..e08a9e1 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,160 +1,47 @@ AllCops: - DisplayCopNames: true - TargetRubyVersion: 2.2 -# Relaxed.Ruby.Style - -Style/Alias: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylealias - -Style/BeginBlock: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylebeginblock + TargetRubyVersion: 3.2 + NewCops: enable + SuggestExtensions: false + Exclude: + - 'sorbet/**/*' + - 'vendor/**/*' + - 'tmp/**/*' + - 'lib/generators/inky/templates/**/*' -Style/BlockDelimiters: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#styleblockdelimiters +Layout/LineLength: + Max: 160 + Exclude: + - 'test/**/*' Style/Documentation: Enabled: false - StyleGuide: http://relaxed.ruby.style/#styledocumentation - -Layout/DotPosition: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#styledotposition - -Style/DoubleNegation: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#styledoublenegation - -Style/EndBlock: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#styleendblock - -Style/FormatString: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#styleformatstring - -Style/IfUnlessModifier: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#styleifunlessmodifier - -Style/Lambda: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylelambda - -Style/ModuleFunction: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylemodulefunction - -Style/MultilineBlockChain: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylemultilineblockchain - -Style/NegatedIf: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylenegatedif - -Style/NegatedWhile: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylenegatedwhile - -Style/ParallelAssignment: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#styleparallelassignment - -Style/PercentLiteralDelimiters: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylepercentliteraldelimiters - -Style/PerlBackrefs: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#styleperlbackrefs - -Style/Semicolon: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylesemicolon - -Style/SignalException: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylesignalexception - -Style/SingleLineBlockParams: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylesinglelineblockparams - -Style/SingleLineMethods: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylesinglelinemethods - -Layout/SpaceBeforeBlockBraces: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylespacebeforeblockbraces - -Layout/SpaceInsideParens: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylespaceinsideparens - -Style/SpecialGlobalVars: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylespecialglobalvars - -Style/StringLiterals: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylestringliterals - -Style/WhileUntilModifier: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#stylewhileuntilmodifier - -Lint/AmbiguousRegexpLiteral: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#lintambiguousregexpliteral - -Lint/AssignmentInCondition: - Enabled: false - StyleGuide: http://relaxed.ruby.style/#lintassignmentincondition -Metrics/AbcSize: - Enabled: false +Style/FrozenStringLiteralComment: + Enabled: true -Metrics/BlockNesting: - Enabled: false +Metrics/BlockLength: + Exclude: + - 'test/**/*' + - 'inky.gemspec' +# Test files: autofix only, relaxed metrics. Metrics/ClassLength: - Enabled: false - -Metrics/ModuleLength: - Enabled: false - -Metrics/CyclomaticComplexity: - Enabled: false - -Metrics/LineLength: - Enabled: false + Exclude: + - 'test/**/*' Metrics/MethodLength: - Enabled: false - -Metrics/ParameterLists: - Enabled: false - -Metrics/PerceivedComplexity: - Enabled: false - -# inky-rb gem specifics -Lint/HandleExceptions: Exclude: - - 'Rakefile' - - 'lib/inky.rb' + - 'test/**/*' -Metrics/BlockLength: +Metrics/AbcSize: Exclude: - - 'Rakefile' - - 'spec/**/*.rb' + - 'test/**/*' -Style/MutableConstant: - Enabled: false +Naming/VariableNumber: + Exclude: + - 'test/**/*' -Style/Encoding: - Enabled: false +# Test classes share a file by component; that is intentional grouping. +Style/ClassAndModuleChildren: + Exclude: + - 'test/**/*' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d76af25..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -sudo: false -language: ruby -rvm: - - 2.0.0 - - 2.6.1 -gemfile: - - gemfiles/rails_3.gemfile - - gemfiles/rails_4.gemfile - - gemfiles/rails_5.gemfile - - gemfiles/rails_6.gemfile -matrix: - exclude: - - rvm: 2.0.0 - gemfile: gemfiles/rails_5.gemfile - - rvm: 2.0.0 - gemfile: gemfiles/rails_6.gemfile -before_install: - - 'npm install -g inky-cli' diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..91098f1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,77 @@ +# Changelog + +All notable changes to this project are documented here. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [2.0.0] - 2026-06-11 + +A full modernization. v2 is a generalist gem usable by any Rails project, with +markup updated to 2026 email best practices. + +### Added + +- **Extensible component registry (open/closed).** Each component is now a class + (`Inky::Components::*`) inheriting from `Inky::Components::Base`. Register your + own tags with `Inky.configuration.register_component('my-tag', MyComponent)`; + custom components receive the matched Nokogiri node and full DOM access. +- **`role="presentation"` on every generated layout table** for accessibility. +- **MSO ghost tables/cells** around ``, ``/``, so the + fluid-hybrid layout still renders as a grid in Outlook (Word engine). +- **`container_width` configuration** (default `600`), settable globally or per + `Inky::Core.new(container_width:)`. +- **Bulletproof ` + # + # button_tag 'Reset', type: 'reset' + # # => + # + # button_tag 'Button', type: 'button' + # # => + # + # button_tag 'Reset', type: 'reset', disabled: true + # # => + # + # button_tag(type: 'button') do + # content_tag(:strong, 'Ask me!') + # end + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:571 + def button_tag(content_or_options = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:469 + def check_box_tag(name, *args); end + + # :call-seq: + # checkbox_tag(name, options = {}) + # checkbox_tag(name, value, options = {}) + # checkbox_tag(name, value, checked, options = {}) + # + # Creates a check box form input tag. + # + # ==== Options + # * :value - The value of the input. Defaults to "1". + # * :checked - If set to true, the checkbox will be checked by default. + # * :disabled - If set to true, the user will not be able to use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Examples + # checkbox_tag 'accept' + # # => + # + # checkbox_tag 'rock', 'rock music' + # # => + # + # checkbox_tag 'receive_email', 'yes', true + # # => + # + # checkbox_tag 'tos', 'yes', false, class: 'accept_tos' + # # => + # + # checkbox_tag 'eula', 'accepted', false, disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:459 + def checkbox_tag(name, *args); end + + # Creates a text field of type "color". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # color_field_tag 'name' + # # => + # + # color_field_tag 'color', '#DEF726' + # # => + # + # color_field_tag 'color', nil, class: 'special_input' + # # => + # + # color_field_tag 'color', '#DEF726', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:671 + def color_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "date". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # date_field_tag 'name' + # # => + # + # date_field_tag 'date', '2014-12-31' + # # => + # + # date_field_tag 'date', nil, class: 'special_input' + # # => + # + # date_field_tag 'date', '2014-12-31', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:741 + def date_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "datetime-local". + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :step - The acceptable value granularity. + # * :include_seconds - Include seconds in the output timestamp format (true by default). + # + # ==== Examples + # + # datetime_field_tag 'name' + # # => + # + # datetime_field_tag 'datetime', '2014-01-01T01:01' + # # => + # + # datetime_field_tag 'datetime', nil, class: 'special_input' + # # => + # + # datetime_field_tag 'datetime', '2014-01-01T01:01', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:800 + def datetime_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:804 + def datetime_local_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:28 + def default_enforce_utf8; end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:28 + def default_enforce_utf8=(val); end + + # Creates a text field of type "email". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # email_field_tag 'name' + # # => + # + # email_field_tag 'email', 'email@example.com' + # # => + # + # email_field_tag 'email', nil, class: 'special_input' + # # => + # + # email_field_tag 'email', 'email@example.com', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:902 + def email_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:25 + def embed_authenticity_token_in_remote_forms; end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:25 + def embed_authenticity_token_in_remote_forms=(val); end + + # Generate an HTML id attribute value for the given name and + # field combination + # + # Return the value generated by the FormBuilder for the given + # attribute name. + # + # <%= label_tag :post, :title %> + # <%= text_field :post, :title, aria: { describedby: field_id(:post, :title, :error) } %> + # <%= tag.span("is blank", id: field_id(:post, :title, :error) %> + # + # In the example above, the element built by + # the call to text_field declares an + # aria-describedby attribute referencing the + # element, sharing a common id root (post_title, in this + # case). + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:101 + def field_id(object_name, method_name, *suffixes, index: T.unsafe(nil), namespace: T.unsafe(nil)); end + + # Generate an HTML name attribute value for the given name and + # field combination + # + # Return the value generated by the FormBuilder for the given + # attribute name. + # + # <%= text_field :post, :title, name: field_name(:post, :title, :subtitle) %> + # <%# => %> + # + # <%= text_field :post, :tag, name: field_name(:post, :tag, multiple: true) %> + # <%# => %> + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:131 + def field_name(object_name, method_name, *method_names, multiple: T.unsafe(nil), index: T.unsafe(nil)); end + + # Creates a field set for grouping HTML form elements. + # + # legend will become the fieldset's title (optional as per W3C). + # options accept the same values as tag. + # + # ==== Examples + # <%= field_set_tag do %> + #

<%= text_field_tag 'name' %>

+ # <% end %> + # # =>

+ # + # <%= field_set_tag 'Your details' do %> + #

<%= text_field_tag 'name' %>

+ # <% end %> + # # =>
Your details

+ # + # <%= field_set_tag nil, class: 'format' do %> + #

<%= text_field_tag 'name' %>

+ # <% end %> + # # =>

+ # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:643 + def field_set_tag(legend = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:650 + def fieldset_tag(legend = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Creates a file upload field. If you are using file uploads then you will also need + # to set the multipart option for the form tag: + # + # <%= form_tag '/upload', multipart: true do %> + # <%= file_field_tag "file" %> + # <%= submit_tag %> + # <% end %> + # + # The specified URL will then be passed a File object containing the selected file, or if the field + # was left blank, a StringIO object. + # + # ==== Options + # * Creates standard HTML attributes for the tag. + # * :disabled - If set to true, the user will not be able to use this input. + # * :multiple - If set to true, *in most updated browsers* the user will be allowed to select multiple files. + # * :accept - If set to one or multiple mime-types, the user will be suggested a filter when choosing a file. You still need to set up model validations. + # + # ==== Examples + # file_field_tag 'attachment' + # # => + # + # file_field_tag 'avatar', class: 'profile_input' + # # => + # + # file_field_tag 'picture', disabled: true + # # => + # + # file_field_tag 'resume', value: '~/resume.doc' + # # => + # + # file_field_tag 'user_pic', accept: 'image/png,image/gif,image/jpeg' + # # => + # + # file_field_tag 'file', accept: 'text/html', class: 'upload', value: 'index.html' + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:350 + def file_field_tag(name, options = T.unsafe(nil)); end + + # Starts a form tag that points the action to a URL configured with url_for_options just like + # ActionController::Base#url_for. The method for the form defaults to POST. + # + # ==== Options + # * :multipart - If set to true, the enctype is set to "multipart/form-data". + # * :method - The method to use when submitting the form, usually either "get" or "post". + # If "patch", "put", "delete", or another verb is used, a hidden input with name _method + # is added to simulate the verb over post. + # * :authenticity_token - Authenticity token to use in the form. Use only if you need to + # pass custom authenticity token string, or to not add authenticity_token field at all + # (by passing false). Remote forms may omit the embedded authenticity token + # by setting config.action_view.embed_authenticity_token_in_remote_forms = false. + # This is helpful when you're fragment-caching the form. Remote forms get the + # authenticity token from the meta tag, so embedding is unnecessary unless you + # support browsers without JavaScript. + # * :remote - If set to true, will allow the Unobtrusive JavaScript drivers to control the + # submit behavior. By default this behavior is an ajax submit. + # * :enforce_utf8 - If set to false, a hidden input with name utf8 is not output. + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # form_tag('/posts') + # # => + # + # form_tag('/posts/1', method: :put) + # # => ... ... + # + # form_tag('/upload', multipart: true) + # # => + # + # <%= form_tag('/posts') do -%> + #
<%= submit_tag 'Save' %>
+ # <% end -%> + # # =>
+ # + # <%= form_tag('/posts', remote: true) %> + # # =>
+ # + # form_tag(false, method: :get) + # # => + # + # form_tag('http://far.away.com/form', authenticity_token: false) + # # form without authenticity token + # + # form_tag('http://far.away.com/form', authenticity_token: "cf50faa3fe97702ca1ae") + # # form with custom authenticity token + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:77 + def form_tag(url_for_options = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Creates a hidden form input field used to transmit data that would be lost due to HTTP's statelessness or + # data that should be hidden from the user. + # + # ==== Options + # * Creates standard HTML attributes for the tag. + # + # ==== Examples + # hidden_field_tag 'tags_list' + # # => + # + # hidden_field_tag 'token', 'VUBJKB23UIVI1UU1VOBVI@' + # # => + # + # hidden_field_tag 'collected_input', '', onchange: "alert('Input collected!')" + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:307 + def hidden_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Displays an image which when clicked will submit the form. + # + # source is passed to AssetTagHelper#path_to_image + # + # ==== Options + # * :data - This option can be used to add custom data attributes. + # * :disabled - If set to true, the user will not be able to use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Data attributes + # + # * confirm: 'question?' - This will add a JavaScript confirm + # prompt with the question specified. If the user accepts, the form is + # processed normally, otherwise no action is taken. + # + # ==== Examples + # image_submit_tag("login.png") + # # => + # + # image_submit_tag("purchase.png", disabled: true) + # # => + # + # image_submit_tag("search.png", class: 'search_button', alt: 'Find') + # # => + # + # image_submit_tag("agree.png", disabled: true, class: "agree_disagree_button") + # # => + # + # image_submit_tag("save.png", data: { confirm: "Are you sure?" }) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:617 + def image_submit_tag(source, options = T.unsafe(nil)); end + + # Creates a label element. Accepts a block. + # + # ==== Options + # * Creates standard HTML attributes for the tag. + # + # ==== Examples + # label_tag 'name' + # # => + # + # label_tag 'name', 'Your name' + # # => + # + # label_tag 'name', nil, class: 'small_label' + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:280 + def label_tag(name = T.unsafe(nil), content_or_options = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Creates a text field of type "month". + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :step - The acceptable value granularity. + # + # ==== Examples + # + # month_field_tag 'name' + # # => + # + # month_field_tag 'month', '2014-01' + # # => + # + # month_field_tag 'month', nil, class: 'special_input' + # # => + # + # month_field_tag 'month', '2014-01', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:829 + def month_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a number field. + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :in - A range specifying the :min and + # :max values. + # * :within - Same as :in. + # * :step - The acceptable value granularity. + # + # ==== Examples + # + # number_field_tag 'quantity' + # # => + # + # number_field_tag 'quantity', '1' + # # => + # + # number_field_tag 'quantity', nil, class: 'special_input' + # # => + # + # number_field_tag 'quantity', nil, min: 1 + # # => + # + # number_field_tag 'quantity', nil, max: 9 + # # => + # + # number_field_tag 'quantity', nil, in: 1...10 + # # => + # + # number_field_tag 'quantity', nil, within: 1...10 + # # => + # + # number_field_tag 'quantity', nil, min: 1, max: 10 + # # => + # + # number_field_tag 'quantity', nil, min: 1, max: 10, step: 2 + # # => + # + # number_field_tag 'quantity', '1', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:950 + def number_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a password field, a masked text field that will hide the users input behind a mask character. + # + # ==== Options + # * :disabled - If set to true, the user will not be able to use this input. + # * :size - The number of visible characters that will fit in the input. + # * :maxlength - The maximum number of characters that the browser will allow the user to enter. + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # password_field_tag 'pass' + # # => + # + # password_field_tag 'secret', 'Your secret here' + # # => + # + # password_field_tag 'masked', nil, class: 'masked_input_field' + # # => + # + # password_field_tag 'token', '', size: 15 + # # => + # + # password_field_tag 'key', nil, maxlength: 16 + # # => + # + # password_field_tag 'confirm_pass', nil, disabled: true + # # => + # + # password_field_tag 'pin', '1234', maxlength: 4, size: 6, class: "pin_input" + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:383 + def password_field_tag(name = T.unsafe(nil), value = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:720 + def phone_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # :call-seq: + # radio_button_tag(name, value, options = {}) + # radio_button_tag(name, value, checked, options = {}) + # + # Creates a radio button; use groups of radio buttons named the same to allow users to + # select from a group of options. + # + # ==== Options + # * :checked - If set to true, the radio button will be selected by default. + # * :disabled - If set to true, the user will not be able to use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Examples + # radio_button_tag 'favorite_color', 'maroon' + # # => + # + # radio_button_tag 'receive_updates', 'no', true + # # => + # + # radio_button_tag 'time_slot', "3:00 p.m.", false, disabled: true + # # => + # + # radio_button_tag 'color', "green", true, class: "color_input" + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:496 + def radio_button_tag(name, value, *args); end + + # Creates a range form element. + # + # ==== Options + # + # Supports the same options as #number_field_tag. + # + # ==== Examples + # + # range_field_tag 'quantity', '1' + # # => + # + # range_field_tag 'quantity', in: 1...10 + # # => + # + # range_field_tag 'quantity', min: 1, max: 10, step: 2 + # # => + # + # search_field_tag 'search', 'Enter your search query here' + # # => + # + # search_field_tag 'search', nil, class: 'special_input' + # # => + # + # search_field_tag 'search', 'Enter your search query here', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:694 + def search_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a dropdown selection box, or if the :multiple option is set to true, a multiple + # choice selection box. + # + # Helpers::FormOptions can be used to create common select boxes such as countries, time zones, or + # associated records. option_tags is a string containing the option tags for the select box. + # + # ==== Options + # * :multiple - If set to true, the selection will allow multiple choices. + # * :disabled - If set to true, the user will not be able to use this input. + # * :include_blank - If set to true, an empty option will be created. If set to a string, the string will be used as the option's content and the value will be empty. + # * :prompt - Create a prompt option with blank value and the text asking user to select something. + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # select_tag "people", options_from_collection_for_select(@people, "id", "name") + # # + # + # select_tag "people", options_from_collection_for_select(@people, "id", "name", "1") + # # + # + # select_tag "people", raw("") + # # => + # + # select_tag "count", raw("") + # # => + # + # select_tag "colors", raw(""), multiple: true + # # => + # + # select_tag "locations", raw("") + # # => + # + # select_tag "access", raw(""), multiple: true, class: 'form_input', id: 'unique_id' + # # => + # + # select_tag "people", options_from_collection_for_select(@people, "id", "name"), include_blank: true + # # => + # + # select_tag "people", options_from_collection_for_select(@people, "id", "name"), include_blank: "All" + # # => + # + # select_tag "people", options_from_collection_for_select(@people, "id", "name"), prompt: "Select something" + # # => + # + # select_tag "destination", raw(""), disabled: true + # # => + # + # select_tag "credit_card", options_for_select([ "VISA", "MasterCard" ], "MasterCard") + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:200 + def select_tag(name, option_tags = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a submit button with the text value as the caption. + # + # ==== Options + # * :data - This option can be used to add custom data attributes. + # * :disabled - If true, the user will not be able to use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Examples + # submit_tag + # # => + # + # submit_tag "Edit this article" + # # => + # + # submit_tag "Save edits", disabled: true + # # => + # + # submit_tag nil, class: "form_submit" + # # => + # + # submit_tag "Edit", class: "edit_button" + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:530 + def submit_tag(value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "tel". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # telephone_field_tag 'name' + # # => + # + # telephone_field_tag 'tel', '0123456789' + # # => + # + # telephone_field_tag 'tel', nil, class: 'special_input' + # # => + # + # telephone_field_tag 'tel', '0123456789', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:717 + def telephone_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:428 + def text_area_tag(name, content = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a standard text field; use these text fields to input smaller chunks of text like a username + # or a search query. + # + # ==== Options + # * :disabled - If set to true, the user will not be able to use this input. + # * :size - The number of visible characters that will fit in the input. + # * :maxlength - The maximum number of characters that the browser will allow the user to enter. + # * :placeholder - The text contained in the field by default which is removed when the field receives focus. + # If set to true, use the translation found in the current I18n locale + # (through helpers.placeholder..). + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # text_field_tag 'name' + # # => + # + # text_field_tag 'query', 'Enter your search query here' + # # => + # + # text_field_tag 'search', nil, placeholder: 'Enter search term...' + # # => + # + # text_field_tag 'request', nil, class: 'special_input' + # # => + # + # text_field_tag 'address', '', size: 75 + # # => + # + # text_field_tag 'zip', nil, maxlength: 5 + # # => + # + # text_field_tag 'payment_amount', '$0.00', disabled: true + # # => + # + # text_field_tag 'ip', '0.0.0.0', maxlength: 15, size: 20, class: "ip-input" + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:262 + def text_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text input area; use a textarea for longer text inputs such as blog posts or descriptions. + # + # ==== Options + # * :size - A string specifying the dimensions (columns by rows) of the textarea (e.g., "25x10"). + # * :rows - Specify the number of rows in the textarea + # * :cols - Specify the number of columns in the textarea + # * :disabled - If set to true, the user will not be able to use this input. + # * :escape - By default, the contents of the text input are HTML escaped. + # If you need unescaped contents, set this to false. + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # textarea_tag 'post' + # # => + # + # textarea_tag 'bio', @user.bio + # # => + # + # textarea_tag 'body', nil, rows: 10, cols: 25 + # # => + # + # textarea_tag 'body', nil, size: "25x10" + # # => + # + # textarea_tag 'description', "Description goes here.", disabled: true + # # => + # + # textarea_tag 'comment', nil, class: 'comment_input' + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:416 + def textarea_tag(name, content = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "time". + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :step - The acceptable value granularity. + # * :include_seconds - Include seconds and ms in the output timestamp format (true by default). + # + # ==== Examples + # + # time_field_tag 'name' + # # => + # + # time_field_tag 'time', '01:01' + # # => + # + # time_field_tag 'time', nil, class: 'special_input' + # # => + # + # time_field_tag 'time', '01:01', include_seconds: true + # # => + # + # time_field_tag 'time', '01:01', min: '00:00', max: '23:59', step: 1 + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:772 + def time_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "url". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # url_field_tag 'name' + # # => + # + # url_field_tag 'url', 'http://rubyonrails.org' + # # => + # + # url_field_tag 'url', nil, class: 'special_input' + # # => + # + # url_field_tag 'url', 'http://rubyonrails.org', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:879 + def url_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates the hidden UTF-8 enforcer tag. Override this method in a helper + # to customize the tag. + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:981 + def utf8_enforcer_tag; end + + # Creates a text field of type "week". + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :step - The acceptable value granularity. + # + # ==== Examples + # + # week_field_tag 'name' + # # => + # + # week_field_tag 'week', '2014-W01' + # # => + # + # week_field_tag 'week', nil, class: 'special_input' + # # => + # + # week_field_tag 'week', '2014-W01', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:856 + def week_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1083 + def convert_direct_upload_option_to_url(options); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1021 + def extra_tags_for_form(html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1051 + def form_tag_html(html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1057 + def form_tag_with_body(html_options, content); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:994 + def html_options_for_form(url_for_options, options); end + + # see http://www.w3.org/TR/html4/types.html#type-name + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1064 + def sanitize_to_id(name); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1068 + def set_default_disable_with(value, tag_options); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:28 + def default_enforce_utf8; end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:28 + def default_enforce_utf8=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:25 + def embed_authenticity_token_in_remote_forms; end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:25 + def embed_authenticity_token_in_remote_forms=(val); end + end +end + +# = Action View JavaScript \Helpers +# +# pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:6 +module ActionView::Helpers::JavaScriptHelper + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:7 + def auto_include_nonce; end + + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:7 + def auto_include_nonce=(val); end + + # Escapes carriage returns and single and double quotes for JavaScript segments. + # + # Also available through the alias j(). This is particularly helpful in JavaScript + # responses, like: + # + # $('some_element').replaceWith('<%= j render 'some/element_template' %>'); + # + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:30 + def escape_javascript(javascript); end + + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:40 + def j(javascript); end + + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:95 + def javascript_cdata_section(content); end + + # Returns a JavaScript tag with the +content+ inside. Example: + # javascript_tag "alert('All is good')" + # + # Returns: + # + # + # +html_options+ may be a hash of attributes for the \ + # + # Instead of passing the content as an argument, you can also use a block + # in which case, you pass your +html_options+ as the first parameter. + # + # <%= javascript_tag type: 'application/javascript' do -%> + # alert('All is good') + # <% end -%> + # + # If you have a content security policy enabled then you can add an automatic + # nonce value by passing nonce: true as part of +html_options+. Example: + # + # <%= javascript_tag nonce: true do -%> + # alert('All is good') + # <% end -%> + # + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:77 + def javascript_tag(content_or_options_with_block = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:7 + def auto_include_nonce; end + + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:7 + def auto_include_nonce=(val); end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:9 +ActionView::Helpers::JavaScriptHelper::JS_ESCAPE_MAP = T.let(T.unsafe(nil), Hash) + +# = Action View Number \Helpers +# +# Provides methods for converting numbers into formatted strings. +# Methods are provided for phone numbers, currency, percentage, +# precision, positional notation, file size, and pretty printing. +# +# Most methods expect a +number+ argument, and will return it +# unchanged if can't be converted into a valid number. +# +# pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:17 +module ActionView::Helpers::NumberHelper + # Delegates to ActiveSupport::NumberHelper#number_to_currency. + # + # number_to_currency("1234") # => "$1234.00" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_currency("12x34") # => "$12x34" + # number_to_currency("12x34", raise: true) # => InvalidNumberError + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:55 + def number_to_currency(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_human. + # + # number_to_human("1234") # => "1.23 Thousand" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_human("12x34") # => "12x34" + # number_to_human("12x34", raise: true) # => InvalidNumberError + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:125 + def number_to_human(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_human_size. + # + # number_to_human_size("1234") # => "1.21 KB" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_human_size("12x34") # => "12x34" + # number_to_human_size("12x34", raise: true) # => InvalidNumberError + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:111 + def number_to_human_size(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_percentage. + # + # number_to_percentage("99") # => "99.000%" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_percentage("99x") # => "99x%" + # number_to_percentage("99x", raise: true) # => InvalidNumberError + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:69 + def number_to_percentage(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_phone. + # + # number_to_phone("1234567890") # => "123-456-7890" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_phone("12x34") # => "12x34" + # number_to_phone("12x34", raise: true) # => InvalidNumberError + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:37 + def number_to_phone(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_delimited. + # + # number_with_delimiter("1234") # => "1,234" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_with_delimiter("12x34") # => "12x34" + # number_with_delimiter("12x34", raise: true) # => InvalidNumberError + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:83 + def number_with_delimiter(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_rounded. + # + # number_with_precision("1234") # => "1234.000" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_with_precision("12x34") # => "12x34" + # number_with_precision("12x34", raise: true) # => InvalidNumberError + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:97 + def number_with_precision(number, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:130 + def delegate_number_helper_method(method, number, options); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:149 + def escape_units(units); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:139 + def escape_unsafe_options(options); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:172 + def parse_float(number, raise_error); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:168 + def valid_float?(number); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:155 + def wrap_with_output_safety_handling(number, raise_on_invalid, &block); end +end + +# Raised when argument +number+ param given to the helpers is invalid and +# the option +:raise+ is set to +true+. +# +# pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:20 +class ActionView::Helpers::NumberHelper::InvalidNumberError < ::StandardError + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:22 + def initialize(number); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:21 + def number; end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:21 + def number=(_arg0); end +end + +# = Action View Raw Output \Helpers +# +# pkg:gem/actionview#lib/action_view/helpers/output_safety_helper.rb:8 +module ActionView::Helpers::OutputSafetyHelper + # This method outputs without escaping a string. Since escaping tags is + # now default, this can be used when you don't want \Rails to automatically + # escape tags. This is not recommended if the data is coming from the user's + # input. + # + # For example: + # + # raw @user.name + # # => 'Jimmy Tables' + # + # pkg:gem/actionview#lib/action_view/helpers/output_safety_helper.rb:18 + def raw(stringish); end + + # This method returns an HTML safe string similar to what Array#join + # would return. The array is flattened, and all items, including + # the supplied separator, are HTML escaped unless they are HTML + # safe, and the returned string is marked as HTML safe. + # + # safe_join([tag.p("foo"), "

bar

"], "
") + # # => "

foo

<br><p>bar</p>" + # + # safe_join([tag.p("foo"), tag.p("bar")], tag.br) + # # => "

foo


bar

" + # + # pkg:gem/actionview#lib/action_view/helpers/output_safety_helper.rb:33 + def safe_join(array, sep = T.unsafe(nil)); end + + # Converts the array to a comma-separated sentence where the last element is + # joined by the connector word. This is the html_safe-aware version of + # ActiveSupport's Array#to_sentence. + # + # pkg:gem/actionview#lib/action_view/helpers/output_safety_helper.rb:42 + def to_sentence(array, options = T.unsafe(nil)); end +end + +# # Action View Rendering Helpers +# +# Implements methods that allow rendering from a view context. In order to use +# this module, all you need is to implement view_renderer that returns an +# ActionView::Renderer object. +# +# pkg:gem/actionview#lib/action_view/helpers/rendering_helper.rb:12 +module ActionView::Helpers::RenderingHelper + # Overrides _layout_for in the context object so it supports the case a block is + # passed to a partial. Returns the contents that are yielded to a layout, given + # a name or a block. + # + # You can think of a layout as a method that is called with a block. If the user + # calls `yield :some_name`, the block, by default, returns + # `content_for(:some_name)`. If the user calls simply `yield`, the default block + # returns `content_for(:layout)`. + # + # The user can override this default by passing a block to the layout: + # + # # The template + # <%= render layout: "my_layout" do %> + # Content + # <% end %> + # + # # The layout + # + # <%= yield %> + # + # + # In this case, instead of the default block, which would return `content_for(:layout)`, + # this method returns the block that was passed in to `render :layout`, and the response + # would be + # + # + # Content + # + # + # Finally, the block can take block arguments, which can be passed in by + # `yield`: + # + # # The template + # <%= render layout: "my_layout" do |customer| %> + # Hello <%= customer.name %> + # <% end %> + # + # # The layout + # + # <%= yield Struct.new(:name).new("David") %> + # + # + # In this case, the layout would receive the block passed into `render :layout`, + # and the struct specified would be passed into the block as an argument. The result + # would be + # + # + # Hello David + # + # + # pkg:gem/actionview#lib/action_view/helpers/rendering_helper.rb:207 + def _layout_for(*args, &block); end + + # Renders a template and returns the result. + # + # Pass the template to render as the first argument. This is shorthand + # syntax for partial rendering, so the template filename should be + # prefixed with an underscore. The partial renderer looks for the partial + # template in the directory of the calling template first. + # + # <% # app/views/posts/new.html.erb %> + # <%= render "form" %> + # # => renders app/views/posts/_form.html.erb + # + # Use the complete view path to render a partial from another directory. + # + # <% # app/views/posts/show.html.erb %> + # <%= render "comments/form" %> + # # => renders app/views/comments/_form.html.erb + # + # Without the rendering mode, the second argument can be a Hash of local + # variable assignments for the template. + # + # <% # app/views/posts/new.html.erb %> + # <%= render "form", post: Post.new %> + # # => renders app/views/posts/_form.html.erb + # + # If the first argument responds to `render_in`, the template will be rendered + # by calling `render_in` with the current view context. + # + # class Greeting + # def render_in(view_context) + # view_context.render html: "

Hello, World

" + # end + # + # def format + # :html + # end + # end + # + # <%= render Greeting.new %> + # # => "

Hello, World

" + # + # #### Rendering Mode + # + # Pass the rendering mode as first argument to override it. + # + # `:partial` + # + # <%= render partial: "form", locals: { post: Post.new } %> + # # => renders app/views/posts/_form.html.erb + # + # `:file` + # unsanitized user input. + # + # <%= render file: "/path/to/some/file" %> + # # => renders /path/to/some/file + # + # `:inline` + # + # <% name = "World" %> + # <%= render inline: "

Hello, <%= name %>!

" %> + # # => renders "

Hello, World!

" + # + # `:body` + # + # <%= render body: "Hello, World!" %> + # # => renders "Hello, World!" + # + # `:plain` + # + # <%= render plain: "Hello, World!" %> + # # => renders "Hello, World!" + # + # `:html` + # `:html`. If the string is not `html_safe?`, performs HTML escaping on + # the string before rendering. + # + # <%= render html: "

Hello, World!

".html_safe %> + # # => renders "

Hello, World!

" + # + # <%= render html: "

Hello, World!

" %> + # # => renders "<h1>Hello, World!</h1>" + # + # `:renderable` + # context. The format is determined by calling `format` on the + # renderable if it responds to `format`, falling back to `:html` by + # default. + # + # <%= render renderable: Greeting.new %> + # # => renders "

Hello, World

" + # + # + # #### Options + # + # `:locals` + # + # <%= render inline: "

Hello, <%= name %>!

", locals: { name: "World" } %> + # # => renders "

Hello, World!

" + # + # `:formats` + # + # <% # app/views/posts/show.html.erb %> + # <%= render template: "posts/content", formats: [:text] %> + # # => renders app/views/posts/content.text.erb + # + # `:variants` + # + # <% # app/views/posts/show.html.erb %> + # <%= render template: "posts/content", variants: [:tablet] %> + # # => renders app/views/posts/content.html+tablet.erb + # + # `:handlers` + # + # <% # app/views/posts/show.html.erb %> + # <%= render template: "posts/content", handlers: [:builder] %> + # # => renders app/views/posts/content.html.builder + # + # pkg:gem/actionview#lib/action_view/helpers/rendering_helper.rb:138 + def render(options = T.unsafe(nil), locals = T.unsafe(nil), &block); end +end + +# = Action View Sanitize \Helpers +# +# The SanitizeHelper module provides a set of methods for scrubbing text of undesired HTML elements. +# These helper methods extend Action View making them callable within your template files. +# +# pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:11 +module ActionView::Helpers::SanitizeHelper + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # Sanitizes HTML input, stripping all but known-safe tags and attributes. + # + # It also strips +href+ / +src+ attributes with unsafe protocols like +javascript:+, while + # also protecting against attempts to use Unicode, ASCII, and hex character references to work + # around these protocol filters. + # + # The default sanitizer is +Rails::HTML5::SafeListSanitizer+. See {Rails HTML + # Sanitizers}[https://github.com/rails/rails-html-sanitizer] for more information. + # + # Custom sanitization rules can also be provided. + # + # Warning: Adding disallowed tags or attributes to the allowlists may introduce + # vulnerabilities into your application. Please rely on the default allowlists whenever + # possible, because they are curated to maintain security and safety. If you think that the + # default allowlists should be expanded, please {open an issue on the rails-html-sanitizer + # project}[https://github.com/rails/rails-html-sanitizer/issues]. + # + # Please note that sanitizing user-provided text does not guarantee that the + # resulting markup is valid or even well-formed. + # + # ==== Options + # + # [+:tags+] + # An array of allowed tags. + # + # [+:attributes+] + # An array of allowed attributes. + # + # [+:scrubber+] + # A {Rails::HTML scrubber}[https://github.com/rails/rails-html-sanitizer] + # or {Loofah::Scrubber}[https://github.com/flavorjones/loofah] object that + # defines custom sanitization rules. A custom scrubber takes precedence over + # custom tags and attributes. + # + # ==== Examples + # + # ===== Normal use + # + # <%= sanitize @comment.body %> + # + # ===== Providing custom lists of permitted tags and attributes + # + # <%= sanitize @comment.body, tags: %w(strong em a), attributes: %w(href) %> + # + # ===== Providing a custom +Rails::HTML+ scrubber + # + # class CommentScrubber < Rails::HTML::PermitScrubber + # def initialize + # super + # self.tags = %w( form script comment blockquote ) + # self.attributes = %w( style ) + # end + # + # def skip_node?(node) + # node.text? + # end + # end + # + # + # + # <%= sanitize @comment.body, scrubber: CommentScrubber.new %> + # + # See {Rails HTML Sanitizer}[https://github.com/rails/rails-html-sanitizer] for + # documentation about +Rails::HTML+ scrubbers. + # + # ===== Providing a custom +Loofah::Scrubber+ + # + # scrubber = Loofah::Scrubber.new do |node| + # node.remove if node.name == 'script' + # end + # + # + # + # <%= sanitize @comment.body, scrubber: scrubber %> + # + # See {Loofah's documentation}[https://github.com/flavorjones/loofah] for more + # information about defining custom +Loofah::Scrubber+ objects. + # + # ==== Global Configuration + # + # To set the default allowed tags or attributes across your application: + # + # # In config/application.rb + # config.action_view.sanitized_allowed_tags = ['strong', 'em', 'a'] + # config.action_view.sanitized_allowed_attributes = ['href', 'title'] + # + # The default, starting in \Rails 7.1, is to use an HTML5 parser for sanitization (if it is + # available, see NOTE below). If you wish to revert back to the previous HTML4 behavior, you + # can do so by setting the following in your application configuration: + # + # # In config/application.rb + # config.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer + # + # Or, if you're upgrading from a previous version of \Rails and wish to opt into the HTML5 + # behavior: + # + # # In config/application.rb + # config.action_view.sanitizer_vendor = Rails::HTML5::Sanitizer + # + # NOTE: +Rails::HTML5::Sanitizer+ is not supported on JRuby, so on JRuby platforms \Rails will + # fall back to using +Rails::HTML4::Sanitizer+. + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:117 + def sanitize(html, options = T.unsafe(nil)); end + + # Sanitizes a block of CSS code. Used by #sanitize when it comes across a style attribute. + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:122 + def sanitize_css(style); end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:12 + def sanitizer_vendor; end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:12 + def sanitizer_vendor=(val); end + + # Strips all link tags from +html+ leaving just the link text. + # + # strip_links('Ruby on Rails') + # # => Ruby on Rails + # + # strip_links('Please e-mail me at me@email.com.') + # # => Please e-mail me at me@email.com. + # + # strip_links('Blog: Visit.') + # # => Blog: Visit. + # + # strip_links('<malformed & link') + # # => <malformed & link + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:156 + def strip_links(html); end + + # Strips all HTML tags from +html+, including comments and special characters. + # + # strip_tags("Strip these tags!") + # # => Strip these tags! + # + # strip_tags("Bold no more! See more here...") + # # => Bold no more! See more here... + # + # strip_tags("
Welcome to my website!
") + # # => Welcome to my website! + # + # strip_tags("> A quote from Smith & Wesson") + # # => > A quote from Smith & Wesson + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:139 + def strip_tags(html); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:12 + def sanitizer_vendor; end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:12 + def sanitizer_vendor=(val); end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:160 +module ActionView::Helpers::SanitizeHelper::ClassMethods + # Gets the Rails::HTML::FullSanitizer instance used by +strip_tags+. Replace with + # any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.full_sanitizer = MySpecialSanitizer.new + # end + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:181 + def full_sanitizer; end + + # Gets the Rails::HTML::FullSanitizer instance used by +strip_tags+. Replace with + # any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.full_sanitizer = MySpecialSanitizer.new + # end + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:161 + def full_sanitizer=(_arg0); end + + # Gets the Rails::HTML::LinkSanitizer instance used by +strip_links+. + # Replace with any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.link_sanitizer = MySpecialSanitizer.new + # end + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:191 + def link_sanitizer; end + + # Gets the Rails::HTML::LinkSanitizer instance used by +strip_links+. + # Replace with any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.link_sanitizer = MySpecialSanitizer.new + # end + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:161 + def link_sanitizer=(_arg0); end + + # Gets the Rails::HTML::SafeListSanitizer instance used by sanitize and +sanitize_css+. + # Replace with any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.safe_list_sanitizer = MySpecialSanitizer.new + # end + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:201 + def safe_list_sanitizer; end + + # Gets the Rails::HTML::SafeListSanitizer instance used by sanitize and +sanitize_css+. + # Replace with any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.safe_list_sanitizer = MySpecialSanitizer.new + # end + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:161 + def safe_list_sanitizer=(_arg0); end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:171 + def sanitized_allowed_attributes; end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:167 + def sanitized_allowed_tags; end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:163 + def sanitizer_vendor; end +end + +# = Action View Tag \Helpers +# +# Provides methods to generate HTML tags programmatically both as a modern +# HTML5 compliant builder style and legacy XHTML compliant tags. +# +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:16 +module ActionView::Helpers::TagHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + + # Returns a CDATA section with the given +content+. CDATA sections + # are used to escape blocks of text containing characters which would + # otherwise be recognized as markup. CDATA sections begin with the string + # and end with (and may not contain) the string ]]>. + # + # cdata_section("") + # # => ]]> + # + # cdata_section(File.read("hello_world.txt")) + # # => + # + # cdata_section("hello]]>world") + # # => world]]> + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:558 + def cdata_section(content); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:543 + def class_names(*args); end + + # Returns an HTML block tag of type +name+ surrounding the +content+. Add + # HTML attributes by passing an attributes hash to +options+. + # Instead of passing the content as an argument, you can also use a block + # in which case, you pass your +options+ as the second parameter. + # Set escape to false to disable escaping. + # Note: this is legacy syntax, see +tag+ method description for details. + # + # ==== Options + # The +options+ hash can be used with attributes with no value like (disabled and + # readonly), which you can give a value of true in the +options+ hash. You can use + # symbols or strings for the attribute names. + # + # ==== Examples + # content_tag(:p, "Hello world!") + # # =>

Hello world!

+ # content_tag(:div, content_tag(:p, "Hello world!"), class: "strong") + # # =>

Hello world!

+ # content_tag(:div, "Hello world!", class: ["strong", "highlight"]) + # # =>
Hello world!
+ # content_tag(:div, "Hello world!", class: ["strong", { highlight: current_user.admin? }]) + # # =>
Hello world!
+ # content_tag("select", options, multiple: true) + # # => + # + # <%= content_tag :div, class: "strong" do -%> + # Hello world! + # <% end -%> + # # =>
Hello world!
+ # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:516 + def content_tag(name, content_or_options_with_block = T.unsafe(nil), options = T.unsafe(nil), escape = T.unsafe(nil), &block); end + + # Returns an escaped version of +html+ without affecting existing escaped entities. + # + # escape_once("1 < 2 & 3") + # # => "1 < 2 & 3" + # + # escape_once("<< Accept & Checkout") + # # => "<< Accept & Checkout" + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:570 + def escape_once(html); end + + # Returns an HTML tag. + # + # === Building HTML tags + # + # Builds HTML5 compliant tags with a tag proxy. Every tag can be built with: + # + # tag.(optional content, options) + # + # where tag name can be e.g. br, div, section, article, or any tag really. + # + # ==== Passing content + # + # Tags can pass content to embed within it: + # + # tag.h1 'All titles fit to print' # =>

All titles fit to print

+ # + # tag.div tag.p('Hello world!') # =>

Hello world!

+ # + # Content can also be captured with a block, which is useful in templates: + # + # <%= tag.p do %> + # The next great American novel starts here. + # <% end %> + # # =>

The next great American novel starts here.

+ # + # ==== Options + # + # Use symbol keyed options to add attributes to the generated tag. + # + # tag.section class: %w( kitties puppies ) + # # =>
+ # + # tag.section id: dom_id(@post) + # # =>
+ # + # Pass +true+ for any attributes that can render with no values, like +disabled+ and +readonly+. + # + # tag.input type: 'text', disabled: true + # # => + # + # HTML5 data-* and aria-* attributes can be set with a + # single +data+ or +aria+ key pointing to a hash of sub-attributes. + # + # To play nicely with JavaScript conventions, sub-attributes are dasherized. + # + # tag.article data: { user_id: 123 } + # # =>
+ # + # Thus data-user-id can be accessed as dataset.userId. + # + # Data attribute values are encoded to JSON, with the exception of strings, symbols, and + # BigDecimals. + # This may come in handy when using jQuery's HTML5-aware .data() + # from 1.4.3. + # + # tag.div data: { city_state: %w( Chicago IL ) } + # # =>
+ # + # The generated tag names and attributes are escaped by default. This can be disabled using + # +escape+. + # + # tag.img src: 'open & shut.png' + # # => + # + # tag.img src: 'open & shut.png', escape: false + # # => + # + # The tag builder respects + # {HTML5 void elements}[https://www.w3.org/TR/html5/syntax.html#void-elements] + # if no content is passed, and omits closing tags for those elements. + # + # # A standard element: + # tag.div # =>
+ # + # # A void element: + # tag.br # =>
+ # + # Note that when using the block form options should be wrapped in + # parenthesis. + # + # <%= tag.a(href: "/about", class: "font-bold") do %> + # About the author + # <% end %> + # # => About the author + # + # === Building HTML attributes + # + # Transforms a Hash into HTML attributes, ready to be interpolated into + # ERB. Includes or omits boolean attributes based on their truthiness. + # Transforms keys nested within + # aria: or data: objects into aria- and data- + # prefixed attributes: + # + # > + # # => + # + # + # # => + # + # === Legacy syntax + # + # The following format is for legacy syntax support. It will be deprecated in future versions of \Rails. + # + # tag(name, options = nil, open = false, escape = true) + # + # It returns an empty HTML tag of type +name+ which by default is XHTML + # compliant. Set +open+ to true to create an open tag compatible + # with HTML 4.0 and below. Add HTML attributes by passing an attributes + # hash to +options+. Set +escape+ to false to disable attribute value + # escaping. + # + # ==== Options + # + # You can use symbols or strings for the attribute names. + # + # Use +true+ with boolean attributes that can render with no value, like + # +disabled+ and +readonly+. + # + # HTML5 data-* attributes can be set with a single +data+ key + # pointing to a hash of sub-attributes. + # + # ==== Examples + # + # tag("br") + # # =>
+ # + # tag("br", nil, true) + # # =>
+ # + # tag("input", type: 'text', disabled: true) + # # => + # + # tag("input", type: 'text', class: ["strong", "highlight"]) + # # => + # + # tag("img", src: "open & shut.png") + # # => + # + # tag("img", { src: "open & shut.png" }, false, false) + # # => + # + # tag("div", data: { name: 'Stephen', city_state: %w(Chicago IL) }) + # # =>
+ # + # tag("div", class: { highlight: current_user.admin? }) + # # =>
+ # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:479 + def tag(name = T.unsafe(nil), options = T.unsafe(nil), open = T.unsafe(nil), escape = T.unsafe(nil)); end + + # Returns a string of tokens built from +args+. + # + # ==== Examples + # token_list("foo", "bar") + # # => "foo bar" + # token_list("foo", "foo bar") + # # => "foo bar" + # token_list({ foo: true, bar: false }) + # # => "foo" + # token_list(nil, false, 123, "", "foo", { bar: true }) + # # => "123 foo bar" + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:538 + def token_list(*args); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:580 + def build_tag_values(*args); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:575 + def ensure_valid_html5_tag_name(name); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:600 + def tag_builder; end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:598 + def build_tag_values(*args); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:578 + def ensure_valid_html5_tag_name(name); end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:33 +ActionView::Helpers::TagHelper::ARIA_PREFIXES = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:20 +ActionView::Helpers::TagHelper::BOOLEAN_ATTRIBUTES = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:34 +ActionView::Helpers::TagHelper::DATA_PREFIXES = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:42 +ActionView::Helpers::TagHelper::PRE_CONTENT_STRINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:36 +ActionView::Helpers::TagHelper::TAG_TYPES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:46 +class ActionView::Helpers::TagHelper::TagBuilder + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:213 + def initialize(view_context); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def a(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def abbr(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def address(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def animate(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def animate_motion(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def animate_transform(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def area(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def article(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def aside(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # Transforms a Hash into HTML Attributes, ready to be interpolated into + # ERB. + # + # > + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:222 + def attributes(attributes); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def audio(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def b(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def base(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def bdi(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def bdo(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def blockquote(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def body(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def br(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def button(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def canvas(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def caption(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def circle(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def cite(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def code(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def col(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def colgroup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:226 + def content_tag_string(name, content, options, escape = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def data(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def datalist(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def dd(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def del(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def details(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def dfn(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def dialog(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def div(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def dl(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def dt(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def ellipse(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def em(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def embed(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def fieldset(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def figcaption(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def figure(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def footer(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def form(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def h1(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def h2(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def h3(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def h4(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def h5(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def h6(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def head(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def header(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def hgroup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def hr(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def html(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def i(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def iframe(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def img(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def input(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def ins(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def kbd(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def keygen(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def label(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def legend(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def li(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def line(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def link(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def main(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def map(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def mark(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def menu(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def meta(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def meter(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def nav(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def noscript(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def object(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def ol(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def optgroup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def option(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def output(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def p(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def path(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def picture(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def polygon(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def polyline(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def portal(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def pre(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def progress(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def q(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def rect(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def rp(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def rt(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def ruby(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def s(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def samp(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def script(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def search(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def section(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def select(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def set(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def slot(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def small(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def source(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def span(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def stop(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def strong(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def style(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def sub(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def summary(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def sup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def table(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:235 + def tag_options(options, escape = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def tbody(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def td(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def template(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def textarea(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def tfoot(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def th(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def thead(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def time(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def title(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def tr(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def track(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def u(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def ul(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def use(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def var(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def video(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def view(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def wbr(escape: T.unsafe(nil), **options, &block); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:291 + def boolean_tag_option(key); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:324 + def method_missing(called, *args, escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:312 + def prefix_tag_option(prefix, key, value, escape); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:320 + def respond_to_missing?(*args); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:287 + def self_closing_tag_string(name, options, escape = T.unsafe(nil), tag_suffix = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:295 + def tag_option(key, value, escape); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:281 + def tag_string(name, content = T.unsafe(nil), options, escape: T.unsafe(nil), &block); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:47 + def define_element(name, code_generator:, method_name: T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:67 + def define_self_closing_element(name, code_generator:, method_name: T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:58 + def define_void_element(name, code_generator:, method_name: T.unsafe(nil)); end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags.rb:5 +module ActionView::Helpers::Tags + extend ::ActiveSupport::Autoload +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:6 +class ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::ActiveModelInstanceTag + extend ::ActionView::Helpers::UrlHelper::ClassMethods + extend ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:11 + def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:9 + def object; end + + # This is what child classes implement. + # + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:31 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:97 + def add_default_name_and_field(options, field = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:83 + def add_default_name_and_field_for_value(tag_value, options, field = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:108 + def add_default_name_and_id(options, field = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:95 + def add_default_name_and_id_for_value(tag_value, options, field = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:134 + def generate_ids?; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:126 + def name_and_id_index(options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:74 + def retrieve_autoindex(pre_match); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:63 + def retrieve_object(object); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:118 + def sanitized_method_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:122 + def sanitized_value(value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:114 + def tag_id(index = T.unsafe(nil), namespace = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:110 + def tag_name(multiple = T.unsafe(nil), index = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:36 + def value; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:46 + def value_before_type_cast; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:58 + def value_came_from_user?; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:8 +class ActionView::Helpers::Tags::CheckBox < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Checkable + + # pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:11 + def initialize(object_name, method_name, template_object, checked_value, unchecked_value, options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:17 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:42 + def checked?(value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:59 + def hidden_field_for_checkbox(options); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/checkable.rb:6 +module ActionView::Helpers::Tags::Checkable + # pkg:gem/actionview#lib/action_view/helpers/tags/checkable.rb:7 + def input_checked?(options); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:8 +class ActionView::Helpers::Tags::CollectionCheckBoxes < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::CollectionHelpers + include ::ActionView::Helpers::FormOptionsHelper + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:22 + def render(&block); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:31 + def hidden_field_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:27 + def render_component(builder); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:12 +class ActionView::Helpers::Tags::CollectionCheckBoxes::CheckBoxBuilder < ::ActionView::Helpers::Tags::CollectionHelpers::Builder + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:19 + def check_box(extra_html_options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:13 + def checkbox(extra_html_options = T.unsafe(nil)); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:6 +module ActionView::Helpers::Tags::CollectionHelpers + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:30 + def initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options); end + + private + + # Generate default options for collection helpers, such as :checked and + # :disabled. + # + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:47 + def default_html_options_for_collection(item, value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:107 + def hidden_field; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:113 + def hidden_field_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:40 + def instantiate_builder(builder_class, item, value, text, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:75 + def render_collection; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:86 + def render_collection_for(builder_class, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:71 + def sanitize_attribute_name(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:7 +class ActionView::Helpers::Tags::CollectionHelpers::Builder + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:10 + def initialize(template_object, object_name, method_name, object, sanitized_attribute_name, text, value, input_html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:22 + def label(label_html_options = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:8 + def object; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:8 + def text; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:8 + def value; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_radio_buttons.rb:8 +class ActionView::Helpers::Tags::CollectionRadioButtons < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::CollectionHelpers + include ::ActionView::Helpers::FormOptionsHelper + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_radio_buttons.rb:20 + def render(&block); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_radio_buttons.rb:25 + def render_component(builder); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_radio_buttons.rb:12 +class ActionView::Helpers::Tags::CollectionRadioButtons::RadioButtonBuilder < ::ActionView::Helpers::Tags::CollectionHelpers::Builder + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_radio_buttons.rb:13 + def radio_button(extra_html_options = T.unsafe(nil)); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_select.rb:6 +class ActionView::Helpers::Tags::CollectionSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_select.rb:10 + def initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_select.rb:19 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/color_field.rb:6 +class ActionView::Helpers::Tags::ColorField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/color_field.rb:7 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/color_field.rb:15 + def validate_color_string(string); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/date_field.rb:6 +class ActionView::Helpers::Tags::DateField < ::ActionView::Helpers::Tags::DatetimeField + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_field.rb:8 + def format_datetime(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:8 +class ActionView::Helpers::Tags::DateSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:11 + def initialize(object_name, method_name, template_object, options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:17 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:32 + def datetime_selector(options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:45 + def default_datetime(options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:28 + def select_type; end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:22 + def select_type; end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:6 +class ActionView::Helpers::Tags::DatetimeField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:7 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:17 + def datetime_value(value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:25 + def format_datetime(value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:29 + def parse_datetime(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/datetime_local_field.rb:6 +class ActionView::Helpers::Tags::DatetimeLocalField < ::ActionView::Helpers::Tags::DatetimeField + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_local_field.rb:7 + def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_local_field.rb:19 + def format_datetime(value); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_local_field.rb:13 + def field_type; end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/datetime_select.rb:6 +class ActionView::Helpers::Tags::DatetimeSelect < ::ActionView::Helpers::Tags::DateSelect; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/email_field.rb:6 +class ActionView::Helpers::Tags::EmailField < ::ActionView::Helpers::Tags::TextField; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/file_field.rb:6 +class ActionView::Helpers::Tags::FileField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/file_field.rb:7 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/file_field.rb:23 + def hidden_field_for_multiple_file(options); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/grouped_collection_select.rb:6 +class ActionView::Helpers::Tags::GroupedCollectionSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # pkg:gem/actionview#lib/action_view/helpers/tags/grouped_collection_select.rb:10 + def initialize(object_name, method_name, template_object, collection, group_method, group_label_method, option_key_method, option_value_method, options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/grouped_collection_select.rb:21 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/hidden_field.rb:6 +class ActionView::Helpers::Tags::HiddenField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/hidden_field.rb:7 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:6 +class ActionView::Helpers::Tags::Label < ::ActionView::Helpers::Tags::Base + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:34 + def initialize(object_name, method_name, template_object, content_or_options = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:48 + def render(&block); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:71 + def render_component(builder); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:7 +class ActionView::Helpers::Tags::Label::LabelBuilder + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:10 + def initialize(template_object, object_name, method_name, object, tag_value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:8 + def object; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:29 + def to_s; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:18 + def translation; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/month_field.rb:6 +class ActionView::Helpers::Tags::MonthField < ::ActionView::Helpers::Tags::DatetimeField + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/month_field.rb:8 + def format_datetime(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/number_field.rb:6 +class ActionView::Helpers::Tags::NumberField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/number_field.rb:7 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/password_field.rb:6 +class ActionView::Helpers::Tags::PasswordField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/password_field.rb:7 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/placeholderable.rb:6 +module ActionView::Helpers::Tags::Placeholderable + # pkg:gem/actionview#lib/action_view/helpers/tags/placeholderable.rb:7 + def initialize(*_arg0); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/radio_button.rb:8 +class ActionView::Helpers::Tags::RadioButton < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Checkable + + # pkg:gem/actionview#lib/action_view/helpers/tags/radio_button.rb:11 + def initialize(object_name, method_name, template_object, tag_value, options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/radio_button.rb:16 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/radio_button.rb:26 + def checked?(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/range_field.rb:6 +class ActionView::Helpers::Tags::RangeField < ::ActionView::Helpers::Tags::NumberField; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/search_field.rb:6 +class ActionView::Helpers::Tags::SearchField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/search_field.rb:7 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/select.rb:6 +class ActionView::Helpers::Tags::Select < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # pkg:gem/actionview#lib/action_view/helpers/tags/select.rb:10 + def initialize(object_name, method_name, template_object, choices, options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/select.rb:19 + def render; end + + private + + # Grouped choices look like this: + # + # [nil, []] + # { nil => [] } + # + # pkg:gem/actionview#lib/action_view/helpers/tags/select.rb:39 + def grouped_choices?; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/select_renderer.rb:6 +module ActionView::Helpers::Tags::SelectRenderer + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/select_renderer.rb:38 + def add_options(option_tags, options, value = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/select_renderer.rb:33 + def placeholder_required?(html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/select_renderer.rb:8 + def select_content_tag(option_tags, options, html_options); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/tel_field.rb:6 +class ActionView::Helpers::Tags::TelField < ::ActionView::Helpers::Tags::TextField; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/text_area.rb:8 +class ActionView::Helpers::Tags::TextArea < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Placeholderable + + # pkg:gem/actionview#lib/action_view/helpers/tags/text_area.rb:11 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/text_field.rb:8 +class ActionView::Helpers::Tags::TextField < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Placeholderable + + # pkg:gem/actionview#lib/action_view/helpers/tags/text_field.rb:11 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/text_field.rb:27 + def field_type; end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/tags/text_field.rb:21 + def field_type; end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/time_field.rb:6 +class ActionView::Helpers::Tags::TimeField < ::ActionView::Helpers::Tags::DatetimeField + # pkg:gem/actionview#lib/action_view/helpers/tags/time_field.rb:7 + def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/time_field.rb:13 + def format_datetime(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/time_select.rb:6 +class ActionView::Helpers::Tags::TimeSelect < ::ActionView::Helpers::Tags::DateSelect; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/time_zone_select.rb:6 +class ActionView::Helpers::Tags::TimeZoneSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # pkg:gem/actionview#lib/action_view/helpers/tags/time_zone_select.rb:10 + def initialize(object_name, method_name, template_object, priority_zones, options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/time_zone_select.rb:17 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:6 +class ActionView::Helpers::Tags::Translator + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:7 + def initialize(object, object_name, method_and_value, scope:); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:14 + def translate; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:31 + def human_attribute_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:22 + def i18n_default; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:20 + def method_and_value; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:20 + def model; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:20 + def object_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:20 + def scope; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/url_field.rb:6 +class ActionView::Helpers::Tags::UrlField < ::ActionView::Helpers::Tags::TextField; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/week_field.rb:6 +class ActionView::Helpers::Tags::WeekField < ::ActionView::Helpers::Tags::DatetimeField + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/week_field.rb:8 + def format_datetime(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/weekday_select.rb:6 +class ActionView::Helpers::Tags::WeekdaySelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # pkg:gem/actionview#lib/action_view/helpers/tags/weekday_select.rb:10 + def initialize(object_name, method_name, template_object, options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/weekday_select.rb:16 + def render; end +end + +# = Action View Text \Helpers +# +# The TextHelper module provides a set of methods for filtering, formatting +# and transforming strings, which can reduce the amount of inline Ruby code in +# your views. These helper methods extend Action View making them callable +# within your template files. +# +# ==== Sanitization +# +# Most text helpers that generate HTML output sanitize the given input by default, +# but do not escape it. This means HTML tags will appear in the page but all malicious +# code will be removed. Let's look at some examples using the +simple_format+ method: +# +# simple_format('Example') +# # => "

Example

" +# +# simple_format('Example') +# # => "

Example

" +# +# If you want to escape all content, you should invoke the +h+ method before +# calling the text helper. +# +# simple_format h('Example') +# # => "

<a href=\"http://example.com/\">Example</a>

" +# +# pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:36 +module ActionView::Helpers::TextHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + extend ::ActiveSupport::Concern + include ::ActionView::Helpers::SanitizeHelper + + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # The preferred method of outputting text in your views is to use the + # <%= "text" %> eRuby syntax. The regular +puts+ and +print+ methods + # do not operate as expected in an eRuby code block. If you absolutely must + # output text within a non-output code block (i.e., <% %>), you + # can use the +concat+ method. + # + # <% concat "hello" %> is equivalent to <%= "hello" %> + # + # <% + # unless signed_in? + # concat link_to("Sign In", action: :sign_in) + # end + # %> + # + # is equivalent to + # + # <% unless signed_in? %> + # <%= link_to "Sign In", action: :sign_in %> + # <% end %> + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:63 + def concat(string); end + + # Returns the current cycle string after a cycle has been started. Useful + # for complex table highlighting or any other design need which requires + # the current cycle string in more than one place. + # + # <%# Alternate background colors %> + # <% @items = [1,2,3,4] %> + # <% @items.each do |item| %> + #
"> + # <%= item %> + #
+ # <% end %> + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:461 + def current_cycle(name = T.unsafe(nil)); end + + # Creates a Cycle object whose +to_s+ method cycles through elements of an + # array every time it is called. This can be used for example, to alternate + # classes for table rows. You can use named cycles to allow nesting in loops. + # Passing a Hash as the last parameter with a :name key will create a + # named cycle. The default name for a cycle without a +:name+ key is + # "default". You can manually reset a cycle by calling reset_cycle + # and passing the name of the cycle. The current cycle string can be obtained + # anytime using the current_cycle method. + # + # <%# Alternate CSS classes for even and odd numbers... %> + # <% @items = [1,2,3,4] %> + # + # <% @items.each do |item| %> + # "> + # + # + # <% end %> + #
<%= item %>
+ # + # + # <%# Cycle CSS classes for rows, and text colors for values within each row %> + # <% @items = [ + # { first: "Robert", middle: "Daniel", last: "James" }, + # { first: "Emily", middle: "Shannon", maiden: "Pike", last: "Hicks" }, + # { first: "June", middle: "Dae", last: "Jones" }, + # ] %> + # <% @items.each do |item| %> + # "> + # + # <% item.values.each do |value| %> + # <%# Create a named cycle "colors" %> + # "> + # <%= value %> + # + # <% end %> + # <% reset_cycle("colors") %> + # + # + # <% end %> + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:437 + def cycle(first_value, *values); end + + # Extracts the first occurrence of +phrase+ plus surrounding text from + # +text+. An omission marker is prepended / appended if the start / end of + # the result does not coincide with the start / end of +text+. The result + # is always stripped in any case. Returns +nil+ if +phrase+ isn't found. + # + # ==== Options + # + # [+:radius+] + # The number of characters (or tokens — see +:separator+ option) around + # +phrase+ to include in the result. Defaults to 100. + # + # [+:omission+] + # The marker to prepend / append when the start / end of the excerpt + # does not coincide with the start / end of +text+. Defaults to + # "...". + # + # [+:separator+] + # The separator between tokens to count for +:radius+. Defaults to + # "", which treats each character as a token. + # + # ==== Examples + # + # excerpt('This is an example', 'an', radius: 5) + # # => "...s is an exam..." + # + # excerpt('This is an example', 'is', radius: 5) + # # => "This is a..." + # + # excerpt('This is an example', 'is') + # # => "This is an example" + # + # excerpt('This next thing is an example', 'ex', radius: 2) + # # => "...next..." + # + # excerpt('This is also an example', 'an', radius: 8, omission: ' ') + # # => " is also an example" + # + # excerpt('This is a very beautiful morning', 'very', separator: ' ', radius: 1) + # # => "...a very beautiful..." + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:235 + def excerpt(text, phrase, options = T.unsafe(nil)); end + + # Highlights occurrences of +phrases+ in +text+ by formatting them with a + # highlighter string. +phrases+ can be one or more strings or regular + # expressions. The result will be marked HTML safe. By default, +text+ is + # sanitized before highlighting to prevent possible XSS attacks. + # + # If a block is specified, it will be used instead of the highlighter + # string. Each occurrence of a phrase will be passed to the block, and its + # return value will be inserted into the final result. + # + # ==== Options + # + # [+:highlighter+] + # The highlighter string. Uses \1 as the placeholder for a + # phrase, similar to +String#sub+. Defaults to "\1". + # This option is ignored if a block is specified. + # + # [+:sanitize+] + # Whether to sanitize +text+ before highlighting. Defaults to true. + # + # ==== Examples + # + # highlight('You searched for: rails', 'rails') + # # => "You searched for: rails" + # + # highlight('You searched for: rails', /for|rails/) + # # => "You searched for: rails" + # + # highlight('You searched for: ruby, rails, dhh', 'actionpack') + # # => "You searched for: ruby, rails, dhh" + # + # highlight('You searched for: rails', ['for', 'rails'], highlighter: '\1') + # # => "You searched for: rails" + # + # highlight('You searched for: rails', 'rails', highlighter: '\1') + # # => "You searched for: rails" + # + # highlight('You searched for: rails', 'rails') { |match| link_to(search_path(q: match)) } + # # => "You searched for: rails" + # + # highlight('ruby on rails', 'rails', sanitize: false) + # # => "ruby on rails" + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:174 + def highlight(text, phrases, options = T.unsafe(nil), &block); end + + # Attempts to pluralize the +singular+ word unless +count+ is 1. If + # +plural+ is supplied, it will use that when count is > 1, otherwise + # it will use the Inflector to determine the plural form for the given locale, + # which defaults to +I18n.locale+. + # + # The word will be pluralized using rules defined for the locale + # (you must define your own inflection rules for languages other than English). + # See ActiveSupport::Inflector.pluralize. + # + # pluralize(1, 'person') + # # => "1 person" + # + # pluralize(2, 'person') + # # => "2 people" + # + # pluralize(3, 'person', plural: 'users') + # # => "3 users" + # + # pluralize(0, 'person') + # # => "0 people" + # + # pluralize(2, 'Person', locale: :de) + # # => "2 Personen" + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:297 + def pluralize(count, singular, plural_arg = T.unsafe(nil), plural: T.unsafe(nil), locale: T.unsafe(nil)); end + + # Resets a cycle so that it starts from the first element the next time + # it is called. Pass in +name+ to reset a named cycle. + # + # <%# Alternate CSS classes for even and odd numbers... %> + # <% @items = [[1,2,3,4], [5,6,3], [3,4,5,6,7,4]] %> + # + # <% @items.each do |item| %> + # "> + # <% item.each do |value| %> + # "> + # <%= value %> + # + # <% end %> + # + # <% reset_cycle("colors") %> + # + # <% end %> + #
+ # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:484 + def reset_cycle(name = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:67 + def safe_concat(string); end + + # Returns +text+ transformed into HTML using simple formatting rules. + # Two or more consecutive newlines (\n\n or \r\n\r\n) are + # considered a paragraph and wrapped in

tags. One newline + # (\n or \r\n) is considered a linebreak and a + #
tag is appended. This method does not remove the + # newlines from the +text+. + # + # You can pass any HTML attributes into html_options. These + # will be added to all created paragraphs. + # + # ==== Options + # * :sanitize - If +false+, does not sanitize +text+. + # * :sanitize_options - Any extra options you want appended to the sanitize. + # * :wrapper_tag - String representing the wrapper tag, defaults to "p". + # + # ==== Examples + # my_text = "Here is some basic text...\n...with a line break." + # + # simple_format(my_text) + # # => "

Here is some basic text...\n
...with a line break.

" + # + # simple_format(my_text, {}, wrapper_tag: "div") + # # => "
Here is some basic text...\n
...with a line break.
" + # + # more_text = "We want to put a paragraph...\n\n...right there." + # + # simple_format(more_text) + # # => "

We want to put a paragraph...

\n\n

...right there.

" + # + # simple_format("Look ma! A class!", class: 'description') + # # => "

Look ma! A class!

" + # + # simple_format("Unblinkable.") + # # => "

Unblinkable.

" + # + # simple_format("Blinkable! It's true.", {}, sanitize: false) + # # => "

Blinkable! It's true.

" + # + # simple_format("Continue", {}, { sanitize_options: { attributes: %w[target href] } }) + # # => "

Continue

" + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:383 + def simple_format(text, html_options = T.unsafe(nil), options = T.unsafe(nil)); end + + # Truncates +text+ if it is longer than a specified +:length+. If +text+ + # is truncated, an omission marker will be appended to the result for a + # total length not exceeding +:length+. + # + # You can also pass a block to render and append extra content after the + # omission marker when +text+ is truncated. However, this content _can_ + # cause the total length to exceed +:length+ characters. + # + # The result will be escaped unless escape: false is specified. + # In any case, the result will be marked HTML-safe. Care should be taken + # if +text+ might contain HTML tags or entities, because truncation could + # produce invalid HTML, such as unbalanced or incomplete tags. + # + # ==== Options + # + # [+:length+] + # The maximum number of characters that should be returned, excluding + # any extra content from the block. Defaults to 30. + # + # [+:omission+] + # The string to append after truncating. Defaults to "...". + # + # [+:separator+] + # A string or regexp used to find a breaking point at which to truncate. + # By default, truncation can occur at any character in +text+. + # + # [+:escape+] + # Whether to escape the result. Defaults to true. + # + # ==== Examples + # + # truncate("Once upon a time in a world far far away") + # # => "Once upon a time in a world..." + # + # truncate("Once upon a time in a world far far away", length: 17) + # # => "Once upon a ti..." + # + # truncate("Once upon a time in a world far far away", length: 17, separator: ' ') + # # => "Once upon a..." + # + # truncate("And they found that many people were sleeping better.", length: 25, omission: '... (continued)') + # # => "And they f... (continued)" + # + # truncate("

Once upon a time in a world far far away

") + # # => "<p>Once upon a time in a wo..." + # + # truncate("

Once upon a time in a world far far away

", escape: false) + # # => "

Once upon a time in a wo..." + # + # truncate("Once upon a time in a world far far away") { link_to "Continue", "#" } + # # => "Once upon a time in a world...Continue" + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:122 + def truncate(text, options = T.unsafe(nil), &block); end + + # Wraps the +text+ into lines no longer than +line_width+ width. This method + # breaks on the first whitespace character that does not exceed +line_width+ + # (which is 80 by default). + # + # word_wrap('Once upon a time') + # # => "Once upon a time" + # + # word_wrap('Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding a successor to the throne turned out to be more trouble than anyone could have imagined...') + # # => "Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding\na successor to the throne turned out to be more trouble than anyone could have\nimagined..." + # + # word_wrap('Once upon a time', line_width: 8) + # # => "Once\nupon a\ntime" + # + # word_wrap('Once upon a time', line_width: 1) + # # => "Once\nupon\na\ntime" + # + # You can also specify a custom +break_sequence+ ("\n" by default): + # + # word_wrap('Once upon a time', line_width: 1, break_sequence: "\r\n") + # # => "Once\r\nupon\r\na\r\ntime" + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:327 + def word_wrap(text, line_width: T.unsafe(nil), break_sequence: T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:547 + def cut_excerpt_part(part_position, part, separator, options); end + + # The cycle helpers need to store the cycles in a place that is + # guaranteed to be reset every time a page is rendered, so it + # uses an instance variable of ActionView::Base. + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:529 + def get_cycle(name); end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:534 + def set_cycle(name, cycle_object); end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:539 + def split_paragraphs(text); end +end + +# pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:489 +class ActionView::Helpers::TextHelper::Cycle + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:492 + def initialize(first_value, *values); end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:501 + def current_value; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:497 + def reset; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:505 + def to_s; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:490 + def values; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:512 + def next_index; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:516 + def previous_index; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:520 + def step_index(n); end +end + +# = Action View Translation \Helpers +# +# pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:9 +module ActionView::Helpers::TranslationHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + extend ::ActiveSupport::Concern + + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:119 + def l(object, **options); end + + # Delegates to I18n.localize with no additional functionality. + # + # See https://www.rubydoc.info/gems/i18n/I18n/Backend/Base:localize + # for more information. + # + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:116 + def localize(object, **options); end + + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:110 + def t(key, **options); end + + # Delegates to I18n#translate but also performs three additional + # functions. + # + # First, it will ensure that any thrown +MissingTranslation+ messages will + # be rendered as inline spans that: + # + # * Have a translation-missing class applied + # * Contain the missing key as the value of the +title+ attribute + # * Have a titleized version of the last key segment as text + # + # For example, the value returned for the missing translation key + # "blog.post.title" will be: + # + # Title + # + # This allows for views to display rather reasonable strings while still + # giving developers a way to find missing translations. + # + # If you would prefer missing translations to raise an error, you can + # opt out of span-wrapping behavior globally by setting + # config.i18n.raise_on_missing_translations = true or + # individually by passing raise: true as an option to + # translate. + # + # Second, if the key starts with a period translate will scope + # the key by the current partial. Calling translate(".foo") from + # the people/index.html.erb template is equivalent to calling + # translate("people.index.foo"). This makes it less + # repetitive to translate many keys within the same partial and provides + # a convention to scope keys consistently. + # + # Third, the translation will be marked as html_safe if the key + # has the suffix "_html" or the last element of the key is "html". Calling + # translate("footer_html") or translate("footer.html") + # will return an HTML safe string that won't be escaped by other HTML + # helper methods. This naming convention helps to identify translations + # that include HTML tags so that you know what kind of output to expect + # when you call translate in a template and translators know which keys + # they can provide HTML values for. + # + # To access the translated text along with the fully resolved + # translation key, translate accepts a block: + # + # <%= translate(".relative_key") do |translation, resolved_key| %> + # <%= translation %> + # <% end %> + # + # This enables annotate translated text to be aware of the scope it was + # resolved against. + # + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:73 + def translate(key, **options); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:142 + def missing_translation(key, options); end + + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:128 + def scope_key_by_partial(key); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:15 + def raise_on_missing_translations; end + + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:15 + def raise_on_missing_translations=(_arg0); end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:122 +ActionView::Helpers::TranslationHelper::MISSING_TRANSLATION = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:125 +ActionView::Helpers::TranslationHelper::NO_DEFAULT = T.let(T.unsafe(nil), Array) + +# = Action View URL \Helpers +# +# Provides a set of methods for making links and getting URLs that +# depend on the routing subsystem (see ActionDispatch::Routing). +# This allows you to use the same format for links in views +# and controllers. +# +# pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:17 +module ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + + # Generates a form containing a single button that submits to the URL created + # by the set of +options+. This is the safest method to ensure links that + # cause changes to your data are not triggered by search bots or accelerators. + # + # You can control the form and button behavior with +html_options+. Most + # values in +html_options+ are passed through to the button element. For + # example, passing a +:class+ option within +html_options+ will set the + # class attribute of the button element. + # + # The class attribute of the form element can be set by passing a + # +:form_class+ option within +html_options+. It defaults to + # "button_to" to allow styling of the form and its children. + # + # The form submits a POST request by default if the object is not persisted; + # conversely, if the object is persisted, it will submit a PATCH request. + # To specify a different HTTP verb use the +:method+ option within +html_options+. + # + # If the HTML button generated from +button_to+ does not work with your layout, you can + # consider using the +link_to+ method with the +data-turbo-method+ + # attribute as described in the +link_to+ documentation. + # + # ==== Options + # The +options+ hash accepts the same options as +url_for+. To generate a + # element without an [action] attribute, pass + # false: + # + # <%= button_to "New", false %> + # # => " + # # + # # + # #

" + # + # Most values in +html_options+ are passed through to the button element, + # but there are a few special options: + # + # * :method - \Symbol of HTTP verb. Supported verbs are :post, :get, + # :delete, :patch, and :put. By default it will be :post. + # * :disabled - If set to true, it will generate a disabled button. + # * :data - This option can be used to add custom data attributes. + # * :form - This hash will be form attributes + # * :form_class - This controls the class of the form within which the submit button will + # be placed + # * :params - \Hash of parameters to be rendered as hidden fields within the form. + # + # ==== Examples + # <%= button_to "New", action: "new" %> + # # => "
+ # # + # # + # #
" + # + # <%= button_to "New", new_article_path %> + # # => "
+ # # + # # + # #
" + # + # <%= button_to "New", new_article_path, params: { time: Time.now } %> + # # => "
+ # # + # # + # # + # #
" + # + # <%= button_to [:make_happy, @user] do %> + # Make happy <%= @user.name %> + # <% end %> + # # => "
+ # # + # # + # #
" + # + # <%= button_to "New", { action: "new" }, form_class: "new-thing" %> + # # => "
+ # # + # # + # #
" + # + # <%= button_to "Create", { action: "create" }, form: { "data-type" => "json" } %> + # # => "
+ # # + # # + # #
" + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:296 + def button_to(name = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:35 + def button_to_generates_button_tag; end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:35 + def button_to_generates_button_tag=(val); end + + # True if the current request URI was generated by the given +options+. + # + # ==== Examples + # Let's say we're in the http://www.example.com/shop/checkout?order=desc&page=1 action. + # + # current_page?(action: 'process') + # # => false + # + # current_page?(action: 'checkout') + # # => true + # + # current_page?(controller: 'library', action: 'checkout') + # # => false + # + # current_page?(controller: 'shop', action: 'checkout') + # # => true + # + # current_page?(controller: 'shop', action: 'checkout', order: 'asc') + # # => false + # + # current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '1') + # # => true + # + # current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '2') + # # => false + # + # current_page?('http://www.example.com/shop/checkout') + # # => true + # + # current_page?('http://www.example.com/shop/checkout', check_parameters: true) + # # => false + # + # current_page?('/shop/checkout') + # # => true + # + # current_page?('http://www.example.com/shop/checkout?order=desc&page=1') + # # => true + # + # Different actions may share the same URL path but have a different HTTP method. Let's say we + # sent a POST to http://www.example.com/products and rendered a validation error. + # + # current_page?(controller: 'product', action: 'index') + # # => false + # + # current_page?(controller: 'product', action: 'create') + # # => false + # + # current_page?(controller: 'product', action: 'create', method: :post) + # # => true + # + # current_page?(controller: 'product', action: 'index', method: [:get, :post]) + # # => true + # + # We can also pass in the symbol arguments instead of strings. + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:559 + def current_page?(options = T.unsafe(nil), check_parameters: T.unsafe(nil), method: T.unsafe(nil), **options_as_kwargs); end + + # Creates an anchor element of the given +name+ using a URL created by the set of +options+. + # See the valid options in the documentation for +url_for+. It's also possible to + # pass a \String instead of an options hash, which generates an anchor element that uses the + # value of the \String as the href for the link. Using a :back \Symbol instead + # of an options hash will generate a link to the referrer (a JavaScript back link + # will be used in place of a referrer if none exists). If +nil+ is passed as the name + # the value of the link itself will become the name. + # + # ==== Signatures + # + # link_to(body, url, html_options = {}) + # # url is a String; you can use URL helpers like + # # posts_path + # + # link_to(body, url_options = {}, html_options = {}) + # # url_options, except :method, is passed to url_for + # + # link_to(options = {}, html_options = {}) do + # # name + # end + # + # link_to(url, html_options = {}) do + # # name + # end + # + # link_to(active_record_model) + # + # ==== Options + # * :data - This option can be used to add custom data attributes. + # + # ==== Examples + # + # Because it relies on +url_for+, +link_to+ supports both older-style controller/action/id arguments + # and newer RESTful routes. Current \Rails style favors RESTful routes whenever possible, so base + # your application on resources and use + # + # link_to "Profile", profile_path(@profile) + # # => Profile + # + # or the even pithier + # + # link_to "Profile", @profile + # # => Profile + # + # in place of the older more verbose, non-resource-oriented + # + # link_to "Profile", controller: "profiles", action: "show", id: @profile + # # => Profile + # + # Similarly, + # + # link_to "Profiles", profiles_path + # # => Profiles + # + # is better than + # + # link_to "Profiles", controller: "profiles" + # # => Profiles + # + # When name is +nil+ the href is presented instead + # + # link_to nil, "http://example.com" + # # => http://www.example.com + # + # More concise yet, when +name+ is an Active Record model that defines a + # +to_s+ method returning a default value or a model instance attribute + # + # link_to @profile + # # => Eileen + # + # You can use a block as well if your link target is hard to fit into the name parameter. ERB example: + # + # <%= link_to(@profile) do %> + # <%= @profile.name %> -- Check it out! + # <% end %> + # # => + # David -- Check it out! + # + # + # Classes and ids for CSS are easy to produce: + # + # link_to "Articles", articles_path, id: "news", class: "article" + # # => Articles + # + # Be careful when using the older argument style, as an extra literal hash is needed: + # + # link_to "Articles", { controller: "articles" }, id: "news", class: "article" + # # => Articles + # + # Leaving the hash off gives the wrong link: + # + # link_to "WRONG!", controller: "articles", id: "news", class: "article" + # # => WRONG! + # + # +link_to+ can also produce links with anchors or query strings: + # + # link_to "Comment wall", profile_path(@profile, anchor: "wall") + # # => Comment wall + # + # link_to "Ruby on Rails search", controller: "searches", query: "ruby on rails" + # # => Ruby on Rails search + # + # link_to "Nonsense search", searches_path(foo: "bar", baz: "quux") + # # => Nonsense search + # + # You can set any link attributes such as target, rel, type: + # + # link_to "External link", "http://www.rubyonrails.org/", target: "_blank", rel: "nofollow" + # # => External link + # + # ==== Turbo + # + # Rails 7 ships with Turbo enabled by default. Turbo provides the following +:data+ options: + # + # * turbo_method: symbol of HTTP verb - Performs a Turbo link visit + # with the given HTTP verb. Forms are recommended when performing non-+GET+ requests. + # Only use data-turbo-method where a form is not possible. + # + # * turbo_confirm: "question?" - Adds a confirmation dialog to the link with the + # given value. + # + # {Consult the Turbo Handbook for more information on the options + # above.}[https://turbo.hotwired.dev/handbook/drive#performing-visits-with-a-different-method] + # + # ===== \Examples + # + # link_to "Delete profile", @profile, data: { turbo_method: :delete } + # # => Delete profile + # + # link_to "Visit Other Site", "https://rubyonrails.org/", data: { turbo_confirm: "Are you sure?" } + # # => Visit Other Site + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:198 + def link_to(name = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a link tag of the given +name+ using a URL created by the set of + # +options+ if +condition+ is true, otherwise only the name is + # returned. To specialize the default behavior, you can pass a block that + # accepts the name or the full argument list for +link_to_if+. + # + # ==== Examples + # <%= link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) %> + # # If the user isn't logged in... + # # => Login + # + # <%= + # link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) do + # link_to(@current_user.login, { controller: "accounts", action: "show", id: @current_user }) + # end + # %> + # # If the user isn't logged in... + # # => Login + # # If they are logged in... + # # => my_username + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:438 + def link_to_if(condition, name, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a link tag of the given +name+ using a URL created by the set of + # +options+ unless +condition+ is true, in which case only the name is + # returned. To specialize the default behavior (i.e., show a login link rather + # than just the plaintext link text), you can pass a block that + # accepts the name or the full argument list for +link_to_unless+. + # + # ==== Examples + # <%= link_to_unless(@current_user.nil?, "Reply", { action: "reply" }) %> + # # If the user is logged in... + # # => Reply + # + # <%= + # link_to_unless(@current_user.nil?, "Reply", { action: "reply" }) do |name| + # link_to(name, { controller: "accounts", action: "signup" }) + # end + # %> + # # If the user is logged in... + # # => Reply + # # If not... + # # => Reply + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:415 + def link_to_unless(condition, name, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a link tag of the given +name+ using a URL created by the set of + # +options+ unless the current request URI is the same as the links, in + # which case only the name is returned (or the given block is yielded, if + # one exists). You can give +link_to_unless_current+ a block which will + # specialize the default behavior (e.g., show a "Start Here" link rather + # than the link's text). + # + # ==== Examples + # Let's say you have a navigation menu... + # + # + # + # If in the "about" action, it will render... + # + # + # + # ...but if in the "index" action, it will render: + # + # + # + # The implicit block given to +link_to_unless_current+ is evaluated if the current + # action is the action given. So, if we had a comments page and wanted to render a + # "Go Back" link instead of a link to the comments page, we could do something like this... + # + # <%= + # link_to_unless_current("Comment", { controller: "comments", action: "new" }) do + # link_to("Go back", { controller: "posts", action: "index" }) + # end + # %> + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:391 + def link_to_unless_current(name, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a mailto link tag to the specified +email_address+, which is + # also used as the name of the link unless +name+ is specified. Additional + # HTML attributes for the link can be passed in +html_options+. + # + # +mail_to+ has several methods for customizing the email itself by + # passing special keys to +html_options+. + # + # ==== Options + # * :subject - Preset the subject line of the email. + # * :body - Preset the body of the email. + # * :cc - Carbon Copy additional recipients on the email. + # * :bcc - Blind Carbon Copy additional recipients on the email. + # * :reply_to - Preset the +Reply-To+ field of the email. + # + # ==== Obfuscation + # Prior to \Rails 4.0, +mail_to+ provided options for encoding the address + # in order to hinder email harvesters. To take advantage of these options, + # install the +actionview-encoded_mail_to+ gem. + # + # ==== Examples + # mail_to "me@domain.com" + # # => me@domain.com + # + # mail_to "me@domain.com", "My email" + # # => My email + # + # mail_to "me@domain.com", cc: "ccaddress@domain.com", + # subject: "This is an example email" + # # => me@domain.com + # + # You can use a block as well if your link target is hard to fit into the name parameter. ERB example: + # + # <%= mail_to "me@domain.com" do %> + # Email me: me@domain.com + # <% end %> + # # => + # Email me: me@domain.com + # + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:488 + def mail_to(email_address, name = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a TEL anchor link tag to the specified +phone_number+. When the + # link is clicked, the default app to make phone calls is opened and + # prepopulated with the phone number. + # + # If +name+ is not specified, +phone_number+ will be used as the name of + # the link. + # + # A +country_code+ option is supported, which prepends a plus sign and the + # given country code to the linked phone number. For example, + # country_code: "01" will prepend +01 to the linked + # phone number. + # + # Additional HTML attributes for the link can be passed via +html_options+. + # + # ==== Options + # * :country_code - Prepends the country code to the phone number + # + # ==== Examples + # phone_to "1234567890" + # # => 1234567890 + # + # phone_to "1234567890", "Phone me" + # # => Phone me + # + # phone_to "1234567890", country_code: "01" + # # => 1234567890 + # + # You can use a block as well if your link target is hard to fit into the name parameter. \ERB example: + # + # <%= phone_to "1234567890" do %> + # Phone me: + # <% end %> + # # => + # Phone me: + # + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:693 + def phone_to(phone_number, name = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates an SMS anchor link tag to the specified +phone_number+. When the + # link is clicked, the default SMS messaging app is opened ready to send a + # message to the linked phone number. If the +body+ option is specified, + # the contents of the message will be preset to +body+. + # + # If +name+ is not specified, +phone_number+ will be used as the name of + # the link. + # + # A +country_code+ option is supported, which prepends a plus sign and the + # given country code to the linked phone number. For example, + # country_code: "01" will prepend +01 to the linked + # phone number. + # + # Additional HTML attributes for the link can be passed via +html_options+. + # + # ==== Options + # * :country_code - Prepend the country code to the phone number. + # * :body - Preset the body of the message. + # + # ==== Examples + # sms_to "5155555785" + # # => 5155555785 + # + # sms_to "5155555785", country_code: "01" + # # => 5155555785 + # + # sms_to "5155555785", "Text me" + # # => Text me + # + # sms_to "5155555785", body: "I have a question about your product." + # # => 5155555785 + # + # You can use a block as well if your link target is hard to fit into the name parameter. \ERB example: + # + # <%= sms_to "5155555785" do %> + # Text me: + # <% end %> + # # => + # Text me: + # + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:642 + def sms_to(phone_number, name = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Basic implementation of url_for to allow use helpers without routes existence + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:38 + def url_for(options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:50 + def _back_url; end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:55 + def _filtered_referrer; end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:736 + def add_method_to_attributes!(html_options, method); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:707 + def convert_options_to_data_attributes(options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:730 + def link_to_remote_options?(options); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:747 + def method_for_options(options); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:765 + def method_not_get_method?(method); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:786 + def method_tag(method); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:834 + def remove_trailing_slash!(url_string); end + + # Returns an array of hashes each containing :name and :value keys + # suitable for use as the names and values of form input fields: + # + # to_form_params(name: 'David', nationality: 'Danish') + # # => [{name: 'name', value: 'David'}, {name: 'nationality', value: 'Danish'}] + # + # to_form_params(country: { name: 'Denmark' }) + # # => [{name: 'country[name]', value: 'Denmark'}] + # + # to_form_params(countries: ['Denmark', 'Sweden']}) + # # => [{name: 'countries[]', value: 'Denmark'}, {name: 'countries[]', value: 'Sweden'}] + # + # An optional namespace can be passed to enclose key names: + # + # to_form_params({ name: 'Denmark' }, 'country') + # # => [{name: 'country[name]', value: 'Denmark'}] + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:808 + def to_form_params(attribute, namespace = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:770 + def token_tag(token = T.unsafe(nil), form_options: T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:722 + def url_target(name, options); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:35 + def button_to_generates_button_tag; end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:35 + def button_to_generates_button_tag=(val); end + end +end + +# This helper may be included in any class that includes the +# URL helpers of a routes (routes.url_helpers). Some methods +# provided here will only work in the context of a request +# (link_to_unless_current, for instance), which must be provided +# as a method called #request on the context. +# +# pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:23 +ActionView::Helpers::UrlHelper::BUTTON_TAG_METHOD_VERBS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:29 +module ActionView::Helpers::UrlHelper::ClassMethods + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:30 + def _url_for_modules; end +end + +# pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:757 +ActionView::Helpers::UrlHelper::STRINGIFIED_COMMON_METHODS = T.let(T.unsafe(nil), Hash) + +# This is a class to fix I18n global state. Whenever you provide I18n.locale during a request, +# it will trigger the lookup_context and consequently expire the cache. +# +# pkg:gem/actionview#lib/action_view/rendering.rb:8 +class ActionView::I18nProxy < ::I18n::Config + # pkg:gem/actionview#lib/action_view/rendering.rb:11 + def initialize(original_config, lookup_context); end + + # pkg:gem/actionview#lib/action_view/rendering.rb:17 + def locale; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:21 + def locale=(value); end + + # pkg:gem/actionview#lib/action_view/rendering.rb:9 + def lookup_context; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:9 + def original_config; end +end + +# = Action View \Layouts +# +# Layouts reverse the common pattern of including shared headers and footers in many templates to isolate changes in +# repeated setups. The inclusion pattern has pages that look like this: +# +# <%= render "application/header" %> +# Hello World +# <%= render "application/footer" %> +# +# This approach is a decent way of keeping common structures isolated from the changing content, but it's verbose +# and if you ever want to change the structure of these two includes, you'll have to change all the templates. +# +# With layouts, you can flip it around and have the common structure know where to insert changing content. This means +# that the header and footer are only mentioned in one place, like this: +# +# // The header part of this layout +# <%= yield %> +# // The footer part of this layout +# +# And then you have content pages that look like this: +# +# hello world +# +# At rendering time, the content page is computed and then inserted in the layout, like this: +# +# // The header part of this layout +# hello world +# // The footer part of this layout +# +# == Accessing shared variables +# +# Layouts have access to variables specified in the content pages and vice versa. This allows you to have layouts with +# references that won't materialize before rendering time: +# +#

<%= @page_title %>

+# <%= yield %> +# +# ...and content pages that fulfill these references _at_ rendering time: +# +# <% @page_title = "Welcome" %> +# Off-world colonies offers you a chance to start a new life +# +# The result after rendering is: +# +#

Welcome

+# Off-world colonies offers you a chance to start a new life +# +# == Layout assignment +# +# You can either specify a layout declaratively (using the #layout class method) or give +# it the same name as your controller, and place it in app/views/layouts. +# If a subclass does not have a layout specified, it inherits its layout using normal Ruby inheritance. +# +# For instance, if you have PostsController and a template named app/views/layouts/posts.html.erb, +# that template will be used for all actions in PostsController and controllers inheriting +# from PostsController. +# +# If you use a module, for instance Weblog::PostsController, you will need a template named +# app/views/layouts/weblog/posts.html.erb. +# +# Since all your controllers inherit from ApplicationController, they will use +# app/views/layouts/application.html.erb if no other layout is specified +# or provided. +# +# == Inheritance Examples +# +# class BankController < ActionController::Base +# # bank.html.erb exists +# +# class ExchangeController < BankController +# # exchange.html.erb exists +# +# class CurrencyController < BankController +# +# class InformationController < BankController +# layout "information" +# +# class TellerController < InformationController +# # teller.html.erb exists +# +# class EmployeeController < InformationController +# # employee.html.erb exists +# layout nil +# +# class VaultController < BankController +# layout :access_level_layout +# +# class TillController < BankController +# layout false +# +# In these examples, we have three implicit lookup scenarios: +# * The +BankController+ uses the "bank" layout. +# * The +ExchangeController+ uses the "exchange" layout. +# * The +CurrencyController+ inherits the layout from BankController. +# +# However, when a layout is explicitly set, the explicitly set layout wins: +# * The +InformationController+ uses the "information" layout, explicitly set. +# * The +TellerController+ also uses the "information" layout, because the parent explicitly set it. +# * The +EmployeeController+ uses the "employee" layout, because it set the layout to +nil+, resetting the parent configuration. +# * The +VaultController+ chooses a layout dynamically by calling the access_level_layout method. +# * The +TillController+ does not use a layout at all. +# +# == Types of layouts +# +# Layouts are basically just regular templates, but the name of this template needs not be specified statically. Sometimes +# you want to alternate layouts depending on runtime information, such as whether someone is logged in or not. This can +# be done either by specifying a method reference as a symbol or using an inline method (as a proc). +# +# The method reference is the preferred approach to variable layouts and is used like this: +# +# class WeblogController < ActionController::Base +# layout :writers_and_readers +# +# def index +# # fetching posts +# end +# +# private +# def writers_and_readers +# logged_in? ? "writer_layout" : "reader_layout" +# end +# end +# +# Now when a new request for the index action is processed, the layout will vary depending on whether the person accessing +# is logged in or not. +# +# If you want to use an inline method, such as a proc, do something like this: +# +# class WeblogController < ActionController::Base +# layout proc { |controller| controller.logged_in? ? "writer_layout" : "reader_layout" } +# end +# +# If an argument isn't given to the proc, it's evaluated in the context of +# the current controller anyway. +# +# class WeblogController < ActionController::Base +# layout proc { logged_in? ? "writer_layout" : "reader_layout" } +# end +# +# Of course, the most common way of specifying a layout is still just as a plain template name: +# +# class WeblogController < ActionController::Base +# layout "weblog_standard" +# end +# +# The template will be looked always in app/views/layouts/ folder. But you can point +# layouts folder direct also. layout "layouts/demo" is the same as layout "demo". +# +# Setting the layout to +nil+ forces it to be looked up in the filesystem and falls back to the parent behavior if none exists. +# Setting it to +nil+ is useful to re-enable template lookup overriding a previous configuration set in the parent: +# +# class ApplicationController < ActionController::Base +# layout "application" +# end +# +# class PostsController < ApplicationController +# # Will use "application" layout +# end +# +# class CommentsController < ApplicationController +# # Will search for "comments" layout and fall back to "application" layout +# layout nil +# end +# +# == Conditional layouts +# +# If you have a layout that by default is applied to all the actions of a controller, you still have the option of rendering +# a given action or set of actions without a layout, or restricting a layout to only a single action or a set of actions. The +# :only and :except options can be passed to the layout call. For example: +# +# class WeblogController < ActionController::Base +# layout "weblog_standard", except: :rss +# +# # ... +# +# end +# +# This will assign "weblog_standard" as the WeblogController's layout for all actions except for the +rss+ action, which will +# be rendered directly, without wrapping a layout around the rendered view. +# +# Both the :only and :except condition can accept an arbitrary number of method references, so +# except: [ :rss, :text_only ] is valid, as is except: :rss. +# +# == Using a different layout in the action render call +# +# If most of your actions use the same layout, it makes perfect sense to define a controller-wide layout as described above. +# Sometimes you'll have exceptions where one action wants to use a different layout than the rest of the controller. +# You can do this by passing a :layout option to the render call. For example: +# +# class WeblogController < ActionController::Base +# layout "weblog_standard" +# +# def help +# render action: "help", layout: "help" +# end +# end +# +# This will override the controller-wide "weblog_standard" layout, and will render the help action with the "help" layout instead. +# +# pkg:gem/actionview#lib/action_view/layouts.rb:205 +module ActionView::Layouts + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionView::ViewPaths + include ::ActionView::Rendering + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + mixes_in_class_methods ::ActionView::Rendering::ClassMethods + mixes_in_class_methods ::ActionView::Layouts::ClassMethods + + # pkg:gem/actionview#lib/action_view/layouts.rb:361 + def initialize(*_arg0); end + + # pkg:gem/actionview#lib/action_view/layouts.rb:350 + def _process_render_template_options(options); end + + # pkg:gem/actionview#lib/action_view/layouts.rb:359 + def action_has_layout=(_arg0); end + + # Controls whether an action should be rendered using a layout. + # If you want to disable any layout settings for the + # current action so that it is rendered without a layout then + # either override this method in your controller to return false + # for that action or set the action_has_layout attribute + # to false before rendering. + # + # pkg:gem/actionview#lib/action_view/layouts.rb:372 + def action_has_layout?; end + + private + + # pkg:gem/actionview#lib/action_view/layouts.rb:377 + def _conditional_layout?; end + + # Returns the default layout for this controller. + # Optionally raises an exception if the layout could not be found. + # + # ==== Parameters + # * formats - The formats accepted to this layout + # * require_layout - If set to +true+ and layout is not found, + # an +ArgumentError+ exception is raised (defaults to +false+) + # + # ==== Returns + # * template - The template object for the default layout (or +nil+) + # + # pkg:gem/actionview#lib/action_view/layouts.rb:415 + def _default_layout(lookup_context, formats, keys, require_layout = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/layouts.rb:430 + def _include_layout?(options); end + + # This will be overwritten by _write_layout_method + # + # pkg:gem/actionview#lib/action_view/layouts.rb:382 + def _layout(*_arg0); end + + # Determine the layout for a given name, taking into account the name type. + # + # ==== Parameters + # * name - The name of the template + # + # pkg:gem/actionview#lib/action_view/layouts.rb:388 + def _layout_for_option(name); end + + # pkg:gem/actionview#lib/action_view/layouts.rb:401 + def _normalize_layout(value); end + + module GeneratedClassMethods + def _layout; end + def _layout=(value); end + def _layout?; end + def _layout_conditions; end + def _layout_conditions=(value); end + def _layout_conditions?; end + end + + module GeneratedInstanceMethods + def _layout_conditions; end + def _layout_conditions?; end + end +end + +# pkg:gem/actionview#lib/action_view/layouts.rb:217 +module ActionView::Layouts::ClassMethods + # Creates a _layout method to be called by _default_layout . + # + # If a layout is not explicitly mentioned then look for a layout with the controller's name. + # if nothing is found then try same procedure to find super class's layout. + # + # pkg:gem/actionview#lib/action_view/layouts.rb:283 + def _write_layout_method; end + + # pkg:gem/actionview#lib/action_view/layouts.rb:218 + def inherited(klass); end + + # Specify the layout to use for this class. + # + # If the specified layout is a: + # String:: the String is the template name + # Symbol:: call the method specified by the symbol + # Proc:: call the passed Proc + # false:: There is no layout + # true:: raise an ArgumentError + # nil:: Force default layout behavior with inheritance + # + # Return value of +Proc+ and +Symbol+ arguments should be +String+, +false+, +true+, or +nil+ + # with the same meaning as described above. + # + # ==== Parameters + # + # * layout - The layout to use. + # + # ==== Options (conditions) + # + # * +:only+ - A list of actions to apply this layout to. + # * +:except+ - Apply this layout to all actions but this one. + # + # pkg:gem/actionview#lib/action_view/layouts.rb:269 + def layout(layout, conditions = T.unsafe(nil)); end + + private + + # If no layout is supplied, look for a template named the return + # value of this method. + # + # ==== Returns + # * String - A template name + # + # pkg:gem/actionview#lib/action_view/layouts.rb:345 + def _implied_layout_name; end +end + +# This module is mixed in if layout conditions are provided. This means +# that if no layout conditions are used, this method is not used +# +# pkg:gem/actionview#lib/action_view/layouts.rb:225 +module ActionView::Layouts::ClassMethods::LayoutConditions + private + + # Determines whether the current action has a layout definition by + # checking the action name against the :only and :except conditions + # set by the layout method. + # + # ==== Returns + # * Boolean - True if the action has a layout definition, false otherwise. + # + # pkg:gem/actionview#lib/action_view/layouts.rb:233 + def _conditional_layout?; end +end + +# pkg:gem/actionview#lib/action_view/log_subscriber.rb:6 +class ActionView::LogSubscriber < ::ActiveSupport::LogSubscriber + include ::ActionView::LogSubscriber::Utils + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:9 + def initialize; end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:42 + def render_collection(event); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:34 + def render_layout(event); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:23 + def render_partial(event); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:14 + def render_template(event); end + + private + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:118 + def cache_message(payload); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:110 + def render_count(payload); end + + class << self + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:102 + def attach_to(*_arg0); end + + private + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:21 + def __class_attr_log_levels; end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:21 + def __class_attr_log_levels=(new_value); end + end +end + +# pkg:gem/actionview#lib/action_view/log_subscriber.rb:73 +class ActionView::LogSubscriber::Start + include ::ActionView::LogSubscriber::Utils + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:94 + def finish(name, id, payload); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:97 + def silenced?(_); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:76 + def start(name, id, payload); end +end + +# pkg:gem/actionview#lib/action_view/log_subscriber.rb:54 +module ActionView::LogSubscriber::Utils + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:55 + def logger; end + + private + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:60 + def from_rails_root(string); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:66 + def rails_root; end +end + +# pkg:gem/actionview#lib/action_view/log_subscriber.rb:7 +ActionView::LogSubscriber::VIEWS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# = Action View Lookup Context +# +# LookupContext is the object responsible for holding all information +# required for looking up templates, i.e. view paths and details. +# LookupContext is also responsible for generating a key, given to +# view paths, used in the resolver cache lookup. Since this key is generated +# only once during the request, it speeds up all cache accesses. +# +# pkg:gem/actionview#lib/action_view/lookup_context.rb:15 +class ActionView::LookupContext + include ::ActionView::LookupContext::Accessors + include ::ActionView::LookupContext::DetailsCache + include ::ActionView::LookupContext::ViewPaths + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:232 + def initialize(view_paths, details = T.unsafe(nil), prefixes = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:242 + def digest_cache; end + + # Override formats= to expand ["*/*"] values and automatically + # add :html as fallback to :js. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:263 + def formats=(values); end + + # Override locale to return a symbol instead of array. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:283 + def locale; end + + # Overload locale= to also set the I18n.locale. If the current I18n.config object responds + # to original_config, it means that it has a copy of the original I18n configuration and it's + # acting as proxy, which we need to skip. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:290 + def locale=(value); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:16 + def prefixes; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:16 + def prefixes=(_arg0); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:246 + def with_prepended_formats(formats); end + + private + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:253 + def initialize_details(target, details); end + + class << self + # pkg:gem/actionview#lib/action_view/lookup_context.rb:21 + def register_detail(name, &block); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:18 + def registered_details; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:18 + def registered_details=(_arg0); end + end +end + +# Holds accessors for the registered details. +# +# pkg:gem/actionview#lib/action_view/lookup_context.rb:39 +module ActionView::LookupContext::Accessors + # pkg:gem/actionview#lib/action_view/lookup_context.rb:25 + def default_formats; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:25 + def default_handlers; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:25 + def default_locale; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:25 + def default_variants; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def formats; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def formats=(value); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def handlers; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def handlers=(value); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def locale; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def locale=(value); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def variants; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def variants=(value); end +end + +# pkg:gem/actionview#lib/action_view/lookup_context.rb:40 +ActionView::LookupContext::Accessors::DEFAULT_PROCS = T.let(T.unsafe(nil), Hash) + +# Add caching behavior on top of Details. +# +# pkg:gem/actionview#lib/action_view/lookup_context.rb:98 +module ActionView::LookupContext::DetailsCache + # pkg:gem/actionview#lib/action_view/lookup_context.rb:99 + def cache; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:99 + def cache=(_arg0); end + + # Calculate the details key. Remove the handlers from calculation to improve performance + # since the user cannot modify it explicitly. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:103 + def details_key; end + + # Temporary skip passing the details_key forward. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:108 + def disable_cache; end + + private + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:116 + def _set_detail(key, value); end +end + +# pkg:gem/actionview#lib/action_view/lookup_context.rb:54 +class ActionView::LookupContext::DetailsKey + # pkg:gem/actionview#lib/action_view/lookup_context.rb:55 + def eql?(_arg0); end + + class << self + # pkg:gem/actionview#lib/action_view/lookup_context.rb:77 + def clear; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:65 + def details_cache_key(details); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:61 + def digest_cache(details); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:86 + def digest_caches; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:90 + def view_context_class; end + end +end + +# Helpers related to template lookup using the lookup context information. +# +# pkg:gem/actionview#lib/action_view/lookup_context.rb:125 +module ActionView::LookupContext::ViewPaths + # pkg:gem/actionview#lib/action_view/lookup_context.rb:148 + def any?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:153 + def any_templates?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:155 + def append_view_paths(paths); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:141 + def exists?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), **options); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:128 + def find(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:135 + def find_all(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:133 + def find_template(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:126 + def html_fallback_for_js; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:159 + def prepend_view_paths(paths); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:146 + def template_exists?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), **options); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:126 + def view_paths; end + + private + + # Whenever setting view paths, makes a copy so that we can manipulate them in + # instance objects as we wish. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:166 + def build_view_paths(paths); end + + # Compute details hash and key according to user options (e.g. passed from #render). + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:175 + def detail_args_for(options); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:188 + def detail_args_for_any; end + + # Fix when prefix is specified as part of the template name + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:209 + def normalize_name(name, prefixes); end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:41 +class ActionView::MissingTemplate < ::ActionView::ActionViewError + include ::DidYouMean::Correctable + + # pkg:gem/actionview#lib/action_view/template/error.rb:44 + def initialize(paths, path, prefixes, partial, details, *_arg5); end + + # Apps may have thousands of candidate templates so we attempt to + # generate the suggestions as efficiently as possible. + # First we split templates into prefixes and basenames, so that those can + # be matched separately. + # + # pkg:gem/actionview#lib/action_view/template/error.rb:104 + def corrections; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:42 + def partial; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:42 + def path; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:42 + def paths; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:42 + def prefixes; end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:71 +class ActionView::MissingTemplate::Results + # pkg:gem/actionview#lib/action_view/template/error.rb:74 + def initialize(size); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:91 + def add(path, score); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:83 + def should_record?(score); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:79 + def to_a; end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:72 +class ActionView::MissingTemplate::Results::Result < ::Struct + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def path; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def path=(_); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def score; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def score=(_); end + + class << self + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def [](*_arg0); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def inspect; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def keyword_init?; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def members; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def new(*_arg0); end + end +end + +# pkg:gem/actionview#lib/action_view/model_naming.rb:4 +module ActionView::ModelNaming + # Converts the given object to an Active Model compliant one. + # + # pkg:gem/actionview#lib/action_view/model_naming.rb:6 + def convert_to_model(object); end + + # pkg:gem/actionview#lib/action_view/model_naming.rb:10 + def model_name_from_record_or_class(record_or_class); end +end + +# pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:4 +class ActionView::ObjectRenderer < ::ActionView::PartialRenderer + include ::ActionView::AbstractRenderer::ObjectRendering + + # pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:7 + def initialize(lookup_context, options); end + + # pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:19 + def render_object_derive_partial(object, context, block); end + + # pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:13 + def render_object_with_partial(object, partial, context, block); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:29 + def render_partial_template(view, locals, template, layout, block); end + + # pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:25 + def template_keys(path); end +end + +# Used as a buffer for views +# +# The main difference between this and ActiveSupport::SafeBuffer +# is for the methods `<<` and `safe_expr_append=` the inputs are +# checked for nil before they are assigned and `to_s` is called on +# the input. For example: +# +# obuf = ActionView::OutputBuffer.new "hello" +# obuf << 5 +# puts obuf # => "hello5" +# +# sbuf = ActiveSupport::SafeBuffer.new "hello" +# sbuf << 5 +# puts sbuf # => "hello\u0005" +# +# pkg:gem/actionview#lib/action_view/buffers.rb:21 +class ActionView::OutputBuffer + # pkg:gem/actionview#lib/action_view/buffers.rb:22 + def initialize(buffer = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:42 + def <<(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:81 + def ==(other); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:54 + def append=(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def blank?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:72 + def capture(*args); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:53 + def concat(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def empty?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def encode!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def encoding(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def force_encoding(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:32 + def html_safe; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:38 + def html_safe?; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def length(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:85 + def raw; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:89 + def raw_buffer; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:60 + def safe_append=(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:56 + def safe_concat(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:62 + def safe_expr_append=(val); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:29 + def to_s; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:34 + def to_str; end + + private + + # pkg:gem/actionview#lib/action_view/buffers.rb:68 + def initialize_copy(other); end +end + +# pkg:gem/actionview#lib/action_view/flows.rb:6 +class ActionView::OutputFlow + # pkg:gem/actionview#lib/action_view/flows.rb:9 + def initialize; end + + # Called by content_for + # + # pkg:gem/actionview#lib/action_view/flows.rb:24 + def append(key, value); end + + # pkg:gem/actionview#lib/action_view/flows.rb:27 + def append!(key, value); end + + # pkg:gem/actionview#lib/action_view/flows.rb:7 + def content; end + + # Called by _layout_for to read stored values. + # + # pkg:gem/actionview#lib/action_view/flows.rb:14 + def get(key); end + + # Called by each renderer object to set the layout contents. + # + # pkg:gem/actionview#lib/action_view/flows.rb:19 + def set(key, value); end +end + +# pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:6 +class ActionView::PartialIteration + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:13 + def initialize(size); end + + # Check if this is the first iteration of the partial. + # + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:19 + def first?; end + + # The current iteration of the partial. + # + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:11 + def index; end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:28 + def iterate!; end + + # Check if this is the last iteration of the partial. + # + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:24 + def last?; end + + # The number of iterations that will be done by the partial. + # + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:8 + def size; end +end + +# = Action View Partials +# +# There's also a convenience method for rendering sub templates within the current controller that depends on a +# single object (we call this kind of sub templates for partials). It relies on the fact that partials should +# follow the naming convention of being prefixed with an underscore -- as to separate them from regular +# templates that could be rendered on their own. +# +# In a template for Advertiser#account: +# +# <%= render partial: "account" %> +# +# This would render "advertiser/_account.html.erb". +# +# In another template for Advertiser#buy, we could have: +# +# <%= render partial: "account", locals: { account: @buyer } %> +# +# <% @advertisements.each do |ad| %> +# <%= render partial: "ad", locals: { ad: ad } %> +# <% end %> +# +# This would first render advertiser/_account.html.erb with @buyer passed in as the local variable +account+, then +# render advertiser/_ad.html.erb and pass the local variable +ad+ to the template for display. +# +# == The +:as+ and +:object+ options +# +# By default ActionView::PartialRenderer doesn't have any local variables. +# The :object option can be used to pass an object to the partial. For instance: +# +# <%= render partial: "account", object: @buyer %> +# +# would provide the @buyer object to the partial, available under the local variable +account+ and is +# equivalent to: +# +# <%= render partial: "account", locals: { account: @buyer } %> +# +# With the :as option we can specify a different name for said local variable. For example, if we +# wanted it to be +user+ instead of +account+ we'd do: +# +# <%= render partial: "account", object: @buyer, as: 'user' %> +# +# This is equivalent to +# +# <%= render partial: "account", locals: { user: @buyer } %> +# +# == \Rendering variants of a partial +# +# The :variants option can be used to render a different template variant of a partial. For instance: +# +# <%= render partial: "account", variants: :mobile %> +# +# This will render _account.html+mobile.erb. This option also accepts multiple variants +# like so: +# +# <%= render partial: "account", variants: [:desktop, :mobile] %> +# +# This will look for the following templates and render the first one that exists: +# * _account.html+desktop.erb +# * _account.html+mobile.erb +# * _account.html.erb +# +# == \Rendering a collection of partials +# +# The example of partial use describes a familiar pattern where a template needs to iterate over an array and +# render a sub template for each of the elements. This pattern has been implemented as a single method that +# accepts an array and renders a partial by the same name as the elements contained within. So the three-lined +# example in "Using partials" can be rewritten with a single line: +# +# <%= render partial: "ad", collection: @advertisements %> +# +# This will render advertiser/_ad.html.erb and pass the local variable +ad+ to the template for display. An +# iteration object will automatically be made available to the template with a name of the form +# +partial_name_iteration+. The iteration object has knowledge about which index the current object has in +# the collection and the total size of the collection. The iteration object also has two convenience methods, +# +first?+ and +last?+. In the case of the example above, the template would be fed +ad_iteration+. +# For backwards compatibility the +partial_name_counter+ is still present and is mapped to the iteration's +# +index+ method. +# +# The :as option may be used when rendering partials. +# +# You can specify a partial to be rendered between elements via the :spacer_template option. +# The following example will render advertiser/_ad_divider.html.erb between each ad partial: +# +# <%= render partial: "ad", collection: @advertisements, spacer_template: "ad_divider" %> +# +# If the given :collection is +nil+ or empty, render will return +nil+. This will allow you +# to specify a text which will be displayed instead by using this form: +# +# <%= render(partial: "ad", collection: @advertisements) || "There's no ad to be displayed" %> +# +# == \Rendering shared partials +# +# Two controllers can share a set of partials and render them like this: +# +# <%= render partial: "advertisement/ad", locals: { ad: @advertisement } %> +# +# This will render the partial advertisement/_ad.html.erb regardless of which controller this is being called from. +# +# == \Rendering objects that respond to +to_partial_path+ +# +# Instead of explicitly naming the location of a partial, you can also let PartialRenderer do the work +# and pick the proper path by checking +to_partial_path+ method. +# +# # @account.to_partial_path returns 'accounts/account', so it can be used to replace: +# # <%= render partial: "accounts/account", locals: { account: @account} %> +# <%= render partial: @account %> +# +# # @posts is an array of Post instances, so every post record returns 'posts/post' on #to_partial_path, +# # that's why we can replace: +# # <%= render partial: "posts/post", collection: @posts %> +# <%= render partial: @posts %> +# +# == \Rendering the default case +# +# If you're not going to be using any of the options like collections or layouts, you can also use the short-hand +# defaults of render to render partials. Examples: +# +# # Instead of <%= render partial: "account" %> +# <%= render "account" %> +# +# # Instead of <%= render partial: "account", locals: { account: @buyer } %> +# <%= render "account", account: @buyer %> +# +# # @account.to_partial_path returns 'accounts/account', so it can be used to replace: +# # <%= render partial: "accounts/account", locals: { account: @account} %> +# <%= render @account %> +# +# # @posts is an array of Post instances, so every post record returns 'posts/post' on #to_partial_path, +# # that's why we can replace: +# # <%= render partial: "posts/post", collection: @posts %> +# <%= render @posts %> +# +# == \Rendering partials with layouts +# +# Partials can have their own layouts applied to them. These layouts are different than the ones that are +# specified globally for the entire action, but they work in a similar fashion. Imagine a list with two types +# of users: +# +# <%# app/views/users/index.html.erb %> +# Here's the administrator: +# <%= render partial: "user", layout: "administrator", locals: { user: administrator } %> +# +# Here's the editor: +# <%= render partial: "user", layout: "editor", locals: { user: editor } %> +# +# <%# app/views/users/_user.html.erb %> +# Name: <%= user.name %> +# +# <%# app/views/users/_administrator.html.erb %> +#
+# Budget: $<%= user.budget %> +# <%= yield %> +#
+# +# <%# app/views/users/_editor.html.erb %> +#
+# Deadline: <%= user.deadline %> +# <%= yield %> +#
+# +# ...this will return: +# +# Here's the administrator: +#
+# Budget: $<%= user.budget %> +# Name: <%= user.name %> +#
+# +# Here's the editor: +#
+# Deadline: <%= user.deadline %> +# Name: <%= user.name %> +#
+# +# If a collection is given, the layout will be rendered once for each item in +# the collection. For example, these two snippets have the same output: +# +# <%# app/views/users/_user.html.erb %> +# Name: <%= user.name %> +# +# <%# app/views/users/index.html.erb %> +# <%# This does not use layouts %> +#
    +# <% users.each do |user| -%> +#
  • +# <%= render partial: "user", locals: { user: user } %> +#
  • +# <% end -%> +#
+# +# <%# app/views/users/_li_layout.html.erb %> +#
  • +# <%= yield %> +#
  • +# +# <%# app/views/users/index.html.erb %> +#
      +# <%= render partial: "user", layout: "li_layout", collection: users %> +#
    +# +# Given two users whose names are Alice and Bob, these snippets return: +# +#
      +#
    • +# Name: Alice +#
    • +#
    • +# Name: Bob +#
    • +#
    +# +# The current object being rendered, as well as the object_counter, will be +# available as local variables inside the layout template under the same names +# as available in the partial. +# +# You can also apply a layout to a block within any template: +# +# <%# app/views/users/_chief.html.erb %> +# <%= render(layout: "administrator", locals: { user: chief }) do %> +# Title: <%= chief.title %> +# <% end %> +# +# ...this will return: +# +#
    +# Budget: $<%= user.budget %> +# Title: <%= chief.name %> +#
    +# +# As you can see, the :locals hash is shared between both the partial and its layout. +# +# pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:236 +class ActionView::PartialRenderer < ::ActionView::AbstractRenderer + include ::ActionView::CollectionCaching + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:239 + def initialize(lookup_context, options); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:237 + def collection_cache; end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:237 + def collection_cache=(val); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:246 + def render(partial, context, block); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:278 + def find_template(path, locals); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:261 + def render_partial_template(view, locals, template, layout, block); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:257 + def template_keys(_); end + + class << self + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:237 + def collection_cache; end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:237 + def collection_cache=(val); end + end +end + +# pkg:gem/actionview#lib/action_view/path_registry.rb:4 +module ActionView::PathRegistry + class << self + # pkg:gem/actionview#lib/action_view/path_registry.rb:53 + def all_file_system_resolvers; end + + # pkg:gem/actionview#lib/action_view/path_registry.rb:47 + def all_resolvers; end + + # pkg:gem/actionview#lib/action_view/path_registry.rb:22 + def cast_file_system_resolvers(paths); end + + # pkg:gem/actionview#lib/action_view/path_registry.rb:11 + def file_system_resolver_hooks; end + + # pkg:gem/actionview#lib/action_view/path_registry.rb:14 + def get_view_paths(klass); end + + # pkg:gem/actionview#lib/action_view/path_registry.rb:18 + def set_view_paths(klass, paths); end + end +end + +# = Action View PathSet +# +# This class is used to store and access paths in Action View. A number of +# operations are defined so that you can search among the paths in this +# set and also perform operations on other +PathSet+ objects. +# +# A +LookupContext+ will use a +PathSet+ to store the paths in its context. +# +# pkg:gem/actionview#lib/action_view/path_set.rb:11 +class ActionView::PathSet + include ::Enumerable + + # pkg:gem/actionview#lib/action_view/path_set.rb:18 + def initialize(paths = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:35 + def +(other); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:16 + def [](*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:31 + def compact; end + + # pkg:gem/actionview#lib/action_view/path_set.rb:16 + def each(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:53 + def exists?(path, prefixes, partial, details, details_key, locals); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:40 + def find(path, prefixes, partial, details, details_key, locals); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:45 + def find_all(path, prefixes, partial, details, details_key, locals); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:16 + def include?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:14 + def paths; end + + # pkg:gem/actionview#lib/action_view/path_set.rb:16 + def size(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:27 + def to_ary; end + + private + + # pkg:gem/actionview#lib/action_view/path_set.rb:22 + def initialize_copy(other); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:58 + def search_combinations(prefixes); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:67 + def typecast(paths); end +end + +# pkg:gem/actionview#lib/action_view/buffers.rb:92 +class ActionView::RawOutputBuffer + # pkg:gem/actionview#lib/action_view/buffers.rb:93 + def initialize(buffer); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:97 + def <<(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:103 + def raw; end +end + +# pkg:gem/actionview#lib/action_view/buffers.rb:150 +class ActionView::RawStreamingBuffer + # pkg:gem/actionview#lib/action_view/buffers.rb:151 + def initialize(buffer); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:155 + def <<(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:161 + def raw; end +end + +# = Action View \Record \Identifier +# +# RecordIdentifier encapsulates methods used by various ActionView helpers +# to associate records with DOM elements. +# +# Consider for example the following code that form of post: +# +# <%= form_with(model: post) do |f| %> +# <%= f.text_field :body %> +# <% end %> +# +# When +post+ is a new, unsaved ActiveRecord::Base instance, the resulting HTML +# is: +# +#
    +# +#
    +# +# When +post+ is a persisted ActiveRecord::Base instance, the resulting HTML +# is: +# +#
    +# +#
    +# +# In both cases, the +id+ and +class+ of the wrapping DOM element are +# automatically generated, following naming conventions encapsulated by the +# RecordIdentifier methods #dom_id and #dom_class: +# +# dom_id(Post) # => "new_post" +# dom_class(Post) # => "post" +# dom_id(Post.new) # => "new_post" +# dom_class(Post.new) # => "post" +# dom_id(Post.find 42) # => "post_42" +# dom_class(Post.find 42) # => "post" +# +# Note that these methods do not strictly require +Post+ to be a subclass of +# ActiveRecord::Base. +# Any +Post+ class will work as long as its instances respond to +to_key+ +# and +model_name+, given that +model_name+ responds to +param_key+. +# For instance: +# +# class Post +# attr_accessor :to_key +# +# def model_name +# OpenStruct.new param_key: 'post' +# end +# +# def self.find(id) +# new.tap { |post| post.to_key = [id] } +# end +# end +# +# pkg:gem/actionview#lib/action_view/record_identifier.rb:60 +module ActionView::RecordIdentifier + include ::ActionView::ModelNaming + extend ::ActionView::RecordIdentifier + extend ::ActionView::ModelNaming + + # The DOM class convention is to use the singular form of an object or class. + # + # dom_class(post) # => "post" + # dom_class(Person) # => "person" + # + # If you need to address multiple instances of the same class in the same view, you can prefix the dom_class: + # + # dom_class(post, :edit) # => "edit_post" + # dom_class(Person, :edit) # => "edit_person" + # + # pkg:gem/actionview#lib/action_view/record_identifier.rb:78 + def dom_class(record_or_class, prefix = T.unsafe(nil)); end + + # The DOM id convention is to use the singular form of an object or class with the id following an underscore. + # If no id is found, prefix with "new_" instead. + # + # dom_id(Post.find(45)) # => "post_45" + # dom_id(Post) # => "new_post" + # + # If you need to address multiple instances of the same class in the same view, you can prefix the dom_id: + # + # dom_id(Post.find(45), :edit) # => "edit_post_45" + # dom_id(Post, :custom) # => "custom_post" + # + # pkg:gem/actionview#lib/action_view/record_identifier.rb:93 + def dom_id(record_or_class, prefix = T.unsafe(nil)); end + + # The DOM target convention is to concatenate any number of parameters into a string. + # Records are passed through dom_id, while string and symbols are retained. + # + # dom_target(Post.find(45)) # => "post_45" + # dom_target(Post.find(45), :edit) # => "post_45_edit" + # dom_target(Post.find(45), :edit, :special) # => "post_45_edit_special" + # dom_target(Post.find(45), Comment.find(1)) # => "post_45_comment_1" + # + # pkg:gem/actionview#lib/action_view/record_identifier.rb:111 + def dom_target(*objects); end + + private + + # Returns a string representation of the key attribute(s) that is suitable for use in an HTML DOM id. + # This can be overwritten to customize the default generated string representation if desired. + # If you need to read back a key from a dom_id in order to query for the underlying database record, + # you should write a helper like 'person_record_from_dom_id' that will extract the key either based + # on the default implementation (which just joins all key attributes with '_') or on your own + # overwritten version of the method. By default, this implementation passes the key string through a + # method that replaces all characters that are invalid inside DOM ids, with valid ones. You need to + # make sure yourself that your dom ids are valid, in case you override this method. + # + # pkg:gem/actionview#lib/action_view/record_identifier.rb:134 + def record_key_for_dom_id(record); end +end + +# pkg:gem/actionview#lib/action_view/record_identifier.rb:66 +ActionView::RecordIdentifier::JOIN = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/record_identifier.rb:67 +ActionView::RecordIdentifier::NEW = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/render_parser.rb:4 +module ActionView::RenderParser; end + +# pkg:gem/actionview#lib/action_view/render_parser.rb:5 +ActionView::RenderParser::ALL_KNOWN_KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionview#lib/action_view/render_parser.rb:8 +class ActionView::RenderParser::Base + # pkg:gem/actionview#lib/action_view/render_parser.rb:9 + def initialize(name, code); end + + private + + # pkg:gem/actionview#lib/action_view/render_parser.rb:15 + def directory; end + + # pkg:gem/actionview#lib/action_view/render_parser.rb:19 + def partial_to_virtual_path(render_type, partial_path); end +end + +# pkg:gem/actionview#lib/action_view/render_parser.rb:37 +ActionView::RenderParser::Default = ActionView::RenderParser::PrismRenderParser + +# pkg:gem/actionview#lib/action_view/render_parser/prism_render_parser.rb:5 +class ActionView::RenderParser::PrismRenderParser < ::ActionView::RenderParser::Base + # pkg:gem/actionview#lib/action_view/render_parser/prism_render_parser.rb:6 + def render_calls; end + + private + + # Accept a call node and return a hash of options for the render call. + # If it doesn't match the expected format, return nil. + # + # pkg:gem/actionview#lib/action_view/render_parser/prism_render_parser.rb:43 + def render_call_options(node); end + + # Accept the node that is being passed in the position of the template + # and return the template name and whether or not it is an object + # template. + # + # pkg:gem/actionview#lib/action_view/render_parser/prism_render_parser.rb:97 + def render_call_template(node); end +end + +# pkg:gem/actionview#lib/action_view/render_parser.rb:6 +ActionView::RenderParser::RENDER_TYPE_KEYS = T.let(T.unsafe(nil), Array) + +# = Action View \Renderer +# +# This is the main entry point for rendering. It basically delegates +# to other objects like TemplateRenderer and PartialRenderer which +# actually renders the template. +# +# The Renderer will parse the options from the +render+ or +render_body+ +# method and render a partial or a template based on the options. The +# +TemplateRenderer+ and +PartialRenderer+ objects are wrappers which do all +# the setup and logic necessary to render a view and a new object is created +# each time +render+ is called. +# +# pkg:gem/actionview#lib/action_view/renderer/renderer.rb:15 +class ActionView::Renderer + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:18 + def initialize(lookup_context); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:52 + def cache_hits; end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:16 + def lookup_context; end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:16 + def lookup_context=(_arg0); end + + # Main render entry point shared by Action View and Action Controller. + # + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:23 + def render(context, options); end + + # Render but returns a valid Rack body. If fibers are defined, we return + # a streaming body that renders the template piece by piece. + # + # Note that partials are not supported to be rendered with streaming, + # so in such cases, we just wrap them in an array. + # + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:40 + def render_body(context, options); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:48 + def render_partial(context, options, &block); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:27 + def render_to_object(context, options); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:103 + def collection_from_object(object); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:96 + def collection_from_options(options); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:61 + def render_partial_to_object(context, options, &block); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:57 + def render_template_to_object(context, options); end +end + +# pkg:gem/actionview#lib/action_view/rendering.rb:26 +module ActionView::Rendering + extend ::ActiveSupport::Concern + include ::ActionView::ViewPaths + + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + mixes_in_class_methods ::ActionView::Rendering::ClassMethods + + # pkg:gem/actionview#lib/action_view/rendering.rb:32 + def initialize; end + + # Override process to set up I18n proxy. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:38 + def process(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/rendering.rb:119 + def render_to_body(options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/rendering.rb:30 + def rendered_format; end + + # An instance of a view class. The default view class is ActionView::Base. + # + # The view class must have the following methods: + # + # * View.new(lookup_context, assigns, controller) — Create a new + # ActionView instance for a controller and we can also pass the arguments. + # + # * View#render(option) — Returns String with the rendered template. + # + # Override this method in a module to change the default behavior. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:109 + def view_context; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:95 + def view_context_class; end + + # Returns an object that is able to render templates. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:114 + def view_renderer; end + + private + + # Normalize args by converting render "foo" to render action: "foo" and + # render "foo/bar" to render template: "foo/bar". + # + # pkg:gem/actionview#lib/action_view/rendering.rb:153 + def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end + + # Assign the rendered format to look up context. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:146 + def _process_format(format); end + + # Normalize options. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:177 + def _process_render_template_options(options); end + + # Find and render a template based on the options given. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:127 + def _render_template(options); end +end + +# pkg:gem/actionview#lib/action_view/rendering.rb:45 +module ActionView::Rendering::ClassMethods + # pkg:gem/actionview#lib/action_view/rendering.rb:49 + def _helpers; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:46 + def _routes; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:59 + def build_view_context_class(klass, supports_path, routes, helpers); end + + # pkg:gem/actionview#lib/action_view/rendering.rb:76 + def eager_load!; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:52 + def inherit_view_context_class?; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:82 + def view_context_class; end +end + +# = Action View Resolver +# +# pkg:gem/actionview#lib/action_view/template/resolver.rb:11 +class ActionView::Resolver + # pkg:gem/actionview#lib/action_view/template/resolver.rb:69 + def all_template_paths; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:64 + def built_templates; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:50 + def caching; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:50 + def caching=(val); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:79 + def caching?(&_arg0); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:56 + def clear_cache; end + + # Normalizes the arguments and passes it on to find_templates. + # + # pkg:gem/actionview#lib/action_view/template/resolver.rb:60 + def find_all(name, prefix = T.unsafe(nil), partial = T.unsafe(nil), details = T.unsafe(nil), key = T.unsafe(nil), locals = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:75 + def _find_all(name, prefix, partial, details, key, locals); end + + # This is what child classes implement. No defaults are needed + # because Resolver guarantees that the arguments are present and + # normalized. + # + # pkg:gem/actionview#lib/action_view/template/resolver.rb:84 + def find_templates(name, prefix, partial, details, locals = T.unsafe(nil)); end + + class << self + # pkg:gem/actionview#lib/action_view/template/resolver.rb:50 + def caching; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:50 + def caching=(val); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:53 + def caching?; end + end +end + +# pkg:gem/actionview#lib/action_view/template/resolver.rb:12 +class ActionView::Resolver::PathParser + # pkg:gem/actionview#lib/action_view/template/resolver.rb:15 + def build_path_regex; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:36 + def parse(path); end +end + +# pkg:gem/actionview#lib/action_view/template/resolver.rb:13 +class ActionView::Resolver::PathParser::ParsedPath < ::Struct + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def details; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def details=(_); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def path; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def path=(_); end + + class << self + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def [](*_arg0); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def inspect; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def keyword_init?; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def members; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def new(*_arg0); end + end +end + +# pkg:gem/actionview#lib/action_view/routing_url_for.rb:6 +module ActionView::RoutingUrlFor + # Returns the URL for the set of +options+ provided. This takes the + # same options as +url_for+ in Action Controller (see the + # documentation for ActionDispatch::Routing::UrlFor#url_for). Note that by default + # :only_path is true so you'll get the relative "/controller/action" + # instead of the fully qualified URL like "http://example.com/controller/action". + # + # ==== Options + # * :anchor - Specifies the anchor name to be appended to the path. + # * :only_path - If true, returns the relative URL (omitting the protocol, host name, and port) (true by default unless :host is specified). + # * :trailing_slash - If true, adds a trailing slash, as in "/archive/2005/". Note that this + # is currently not recommended since it breaks caching. + # * :host - Overrides the default (current) host if provided. + # * :protocol - Overrides the default (current) protocol if provided. + # * :user - Inline HTTP authentication (only plucked out if :password is also present). + # * :password - Inline HTTP authentication (only plucked out if :user is also present). + # + # ==== Relying on named routes + # + # Passing a record (like an Active Record) instead of a hash as the options parameter will + # trigger the named route for that record. The lookup will happen on the name of the class. So passing a + # Workshop object will attempt to use the +workshop_path+ route. If you have a nested route, such as + # +admin_workshop_path+ you'll have to call that explicitly (it's impossible for +url_for+ to guess that route). + # + # ==== Implicit Controller Namespacing + # + # Controllers passed in using the +:controller+ option will retain their namespace unless it is an absolute one. + # + # ==== Examples + # <%= url_for(action: 'index') %> + # # => /blogs/ + # + # <%= url_for(action: 'find', controller: 'books') %> + # # => /books/find + # + # <%= url_for(action: 'login', controller: 'members', only_path: false, protocol: 'https') %> + # # => https://www.example.com/members/login/ + # + # <%= url_for(action: 'play', anchor: 'player') %> + # # => /messages/play/#player + # + # <%= url_for(action: 'jump', anchor: 'tax&ship') %> + # # => /testing/jump/#tax&ship + # + # <%= url_for(Workshop) %> + # # => /workshops + # + # <%= url_for(Workshop.new) %> + # # relies on Workshop answering a persisted? call (and in this case returning false) + # # => /workshops + # + # <%= url_for(@workshop) %> + # # calls @workshop.to_param which by default returns the id + # # => /workshops/5 + # + # # to_param can be re-defined in a model to provide different URL names: + # # => /workshops/1-workshop-name + # + # <%= url_for("http://www.example.com") %> + # # => http://www.example.com + # + # <%= url_for(:back) %> + # # if request.env["HTTP_REFERER"] is set to "http://www.example.com" + # # => http://www.example.com + # + # <%= url_for(:back) %> + # # if request.env["HTTP_REFERER"] is not set or is blank + # # => javascript:history.back() + # + # <%= url_for(action: 'index', controller: 'users') %> + # # Assuming an "admin" namespace + # # => /admin/users + # + # <%= url_for(action: 'index', controller: '/users') %> + # # Specify absolute path with beginning slash + # # => /users + # + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:82 + def url_for(options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:124 + def url_options; end + + private + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:139 + def _generate_paths_by_default; end + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:130 + def _routes_context; end + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:143 + def ensure_only_path_option(options); end + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:134 + def optimize_routes_generation?; end +end + +# pkg:gem/actionview#lib/action_view/buffers.rb:108 +class ActionView::StreamingBuffer + # pkg:gem/actionview#lib/action_view/buffers.rb:109 + def initialize(block); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:113 + def <<(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:119 + def append=(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:147 + def block; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:126 + def capture; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:118 + def concat(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:139 + def html_safe; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:135 + def html_safe?; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:143 + def raw; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:124 + def safe_append=(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:121 + def safe_concat(value); end +end + +# pkg:gem/actionview#lib/action_view/flows.rb:30 +class ActionView::StreamingFlow < ::ActionView::OutputFlow + # pkg:gem/actionview#lib/action_view/flows.rb:31 + def initialize(view, fiber); end + + # Appends the contents for the given key. This is called + # by providing and resuming back to the fiber, + # if that's the key it's waiting for. + # + # pkg:gem/actionview#lib/action_view/flows.rb:65 + def append!(key, value); end + + # Try to get stored content. If the content + # is not available and we're inside the layout fiber, + # then it will begin waiting for the given key and yield. + # + # pkg:gem/actionview#lib/action_view/flows.rb:43 + def get(key); end + + private + + # pkg:gem/actionview#lib/action_view/flows.rb:71 + def inside_fiber?; end +end + +# == TODO +# +# * Support streaming from child templates, partials and so on. +# * Rack::Cache needs to support streaming bodies +# +# pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:12 +class ActionView::StreamingTemplateRenderer < ::ActionView::TemplateRenderer + # For streaming, instead of rendering a given a template, we return a Body + # object that responds to each. This object is initialized with a block + # that knows how to render the template. + # + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:51 + def render_template(view, template, layout_name = T.unsafe(nil), locals = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:63 + def delayed_render(buffer, template, layout, view, locals); end +end + +# A valid Rack::Body (i.e. it responds to each). +# It is initialized with a block that, when called, starts +# rendering the template. +# +# pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:13 +class ActionView::StreamingTemplateRenderer::Body + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:14 + def initialize(&start); end + + # Returns the complete body as a string. + # + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:29 + def body; end + + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:18 + def each(&block); end + + private + + # This is the same logging logic as in ShowExceptions middleware. + # + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:37 + def log_error(exception); end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:30 +class ActionView::StrictLocalsError < ::ArgumentError + # pkg:gem/actionview#lib/action_view/template/error.rb:31 + def initialize(argument_error, template); end +end + +# pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:6 +class ActionView::StructuredEventSubscriber < ::ActiveSupport::StructuredEventSubscriber + include ::ActionView::StructuredEventSubscriber::Utils + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:9 + def initialize; end + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:44 + def render_collection(event); end + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:35 + def render_layout(event); end + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:24 + def render_partial(event); end + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:14 + def render_template(event); end + + class << self + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:88 + def attach_to(*_arg0); end + end +end + +# pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:73 +class ActionView::StructuredEventSubscriber::Start + include ::ActionView::StructuredEventSubscriber::Utils + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:84 + def finish(name, id, payload); end + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:76 + def start(name, id, payload); end +end + +# pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:56 +module ActionView::StructuredEventSubscriber::Utils + private + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:58 + def from_rails_root(string); end + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:66 + def rails_root; end +end + +# pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:7 +ActionView::StructuredEventSubscriber::VIEWS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/template/error.rb:256 +class ActionView::SyntaxErrorInTemplate < ::ActionView::Template::Error + # pkg:gem/actionview#lib/action_view/template/error.rb:257 + def initialize(template, offending_code_string); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:272 + def annotated_source_code; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:262 + def message; end +end + +# = Action View \Template +# +# pkg:gem/actionview#lib/action_view/template.rb:7 +class ActionView::Template + extend ::ActiveSupport::Autoload + extend ::ActionView::Template::Handlers + + # pkg:gem/actionview#lib/action_view/template.rb:199 + def initialize(source, identifier, handler, locals:, format: T.unsafe(nil), variant: T.unsafe(nil), virtual_path: T.unsafe(nil)); end + + # This method is responsible for properly setting the encoding of the + # source. Until this point, we assume that the source is BINARY data. + # If no additional information is supplied, we assume the encoding is + # the same as Encoding.default_external. + # + # The user can also specify the encoding via a comment on the first + # with any template engine, as we process out the encoding comment + # before passing the source on to the template engine, leaving a + # blank line in its stead. + # + # pkg:gem/actionview#lib/action_view/template.rb:321 + def encode!; end + + # pkg:gem/actionview#lib/action_view/template.rb:195 + def format; end + + # pkg:gem/actionview#lib/action_view/template.rb:194 + def handler; end + + # pkg:gem/actionview#lib/action_view/template.rb:194 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template.rb:300 + def inspect; end + + # The locals this template has been or will be compiled for, or nil if this + # is a strict locals template. + # + # pkg:gem/actionview#lib/action_view/template.rb:223 + def locals; end + + # Exceptions are marshalled when using the parallel test runner with DRb, so we need + # to ensure that references to the template object can be marshalled as well. This means forgoing + # the marshalling of the compiler mutex and instantiating that again on unmarshalling. + # + # pkg:gem/actionview#lib/action_view/template.rb:393 + def marshal_dump; end + + # pkg:gem/actionview#lib/action_view/template.rb:397 + def marshal_load(array); end + + # pkg:gem/actionview#lib/action_view/template.rb:402 + def method_name; end + + # Render a template. If the template was not compiled yet, it is done + # exactly before rendering. + # + # This method is instrumented as "!render_template.action_view". Notice that + # we use a bang in this instrumentation because you don't want to + # consume this in production. This is only slow if it's being listened to. + # + # pkg:gem/actionview#lib/action_view/template.rb:271 + def render(view, locals, buffer = T.unsafe(nil), implicit_locals: T.unsafe(nil), add_to_stack: T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/template.rb:296 + def short_identifier; end + + # pkg:gem/actionview#lib/action_view/template.rb:304 + def source; end + + # pkg:gem/actionview#lib/action_view/template.rb:231 + def spot(location); end + + # This method is responsible for marking a template as having strict locals + # which means the template can only accept the locals defined in a magic + # comment. For example, if your template accepts the locals +title+ and + # +comment_count+, add the following to your template file: + # + # <%# locals: (title: "Default title", comment_count: 0) %> + # + # Strict locals are useful for validating template arguments and for + # specifying defaults. + # + # pkg:gem/actionview#lib/action_view/template.rb:366 + def strict_locals!; end + + # Returns whether a template is using strict locals. + # + # pkg:gem/actionview#lib/action_view/template.rb:386 + def strict_locals?; end + + # Returns whether the underlying handler supports streaming. If so, + # a streaming buffer *may* be passed when it starts rendering. + # + # pkg:gem/actionview#lib/action_view/template.rb:261 + def supports_streaming?; end + + # Translate an error location returned by ErrorHighlight to the correct + # source location inside the template. + # + # pkg:gem/actionview#lib/action_view/template.rb:251 + def translate_location(backtrace_location, spot); end + + # pkg:gem/actionview#lib/action_view/template.rb:292 + def type; end + + # pkg:gem/actionview#lib/action_view/template.rb:195 + def variable; end + + # pkg:gem/actionview#lib/action_view/template.rb:195 + def variant; end + + # pkg:gem/actionview#lib/action_view/template.rb:195 + def virtual_path; end + + private + + # Among other things, this method is responsible for properly setting + # the encoding of the compiled template. + # + # If the template engine handles encodings, we send the encoded + # String to the engine without further processing. This allows + # the template engine to support additional mechanisms for + # + # Otherwise, after we figure out the correct encoding, we then + # encode the source into Encoding.default_internal. + # In general, this means that templates will be UTF-8 inside of Rails, + # regardless of the original source encoding. + # + # pkg:gem/actionview#lib/action_view/template.rb:506 + def compile(mod); end + + # Compile a template. This method ensures a template is compiled + # just once and removes the source after it is compiled. + # + # pkg:gem/actionview#lib/action_view/template.rb:424 + def compile!(view); end + + # This method compiles the source of the template. The compilation of templates + # involves setting strict_locals! if applicable, encoding the template, and setting + # frozen string literal. + # + # pkg:gem/actionview#lib/action_view/template.rb:449 + def compiled_source; end + + # pkg:gem/actionview#lib/action_view/template.rb:411 + def find_node_by_id(node, node_id); end + + # pkg:gem/actionview#lib/action_view/template.rb:555 + def handle_render_error(view, e); end + + # pkg:gem/actionview#lib/action_view/template.rb:580 + def identifier_method_name; end + + # pkg:gem/actionview#lib/action_view/template.rb:584 + def instrument(action, &block); end + + # pkg:gem/actionview#lib/action_view/template.rb:592 + def instrument_payload; end + + # pkg:gem/actionview#lib/action_view/template.rb:588 + def instrument_render_template(&block); end + + # pkg:gem/actionview#lib/action_view/template.rb:567 + def locals_code; end + + # pkg:gem/actionview#lib/action_view/template.rb:547 + def offset; end + + class << self + # pkg:gem/actionview#lib/action_view/template.rb:180 + def frozen_string_literal; end + + # pkg:gem/actionview#lib/action_view/template.rb:180 + def frozen_string_literal=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template.rb:184 + def mime_types_implementation=(implementation); end + end +end + +# The Template::Error exception is raised when the compilation or rendering of the template +# fails. This exception then gathers a bunch of intimate details and uses it to report a +# precise exception message. +# +# pkg:gem/actionview#lib/action_view/template/error.rb:165 +class ActionView::Template::Error < ::ActionView::ActionViewError + # pkg:gem/actionview#lib/action_view/template/error.rb:173 + def initialize(template); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:231 + def annotated_source_code; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:182 + def backtrace; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:186 + def backtrace_locations; end + + # Override to prevent #cause resetting during re-raise. + # + # pkg:gem/actionview#lib/action_view/template/error.rb:169 + def cause; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:190 + def file_name; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:223 + def line_number; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:203 + def source_extract(indentation = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:194 + def sub_template_message; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:218 + def sub_template_of(template_path); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:171 + def template; end + + private + + # pkg:gem/actionview#lib/action_view/template/error.rb:244 + def formatted_code_for(source_code, line_counter, indent); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:236 + def source_location; end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:166 +ActionView::Template::Error::SOURCE_CODE_RADIUS = T.let(T.unsafe(nil), Integer) + +# = Action View HTML Template +# +# pkg:gem/actionview#lib/action_view/template/html.rb:6 +class ActionView::Template::HTML + # pkg:gem/actionview#lib/action_view/template/html.rb:9 + def initialize(string, type); end + + # pkg:gem/actionview#lib/action_view/template/html.rb:28 + def format; end + + # pkg:gem/actionview#lib/action_view/template/html.rb:14 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template/html.rb:18 + def inspect; end + + # pkg:gem/actionview#lib/action_view/template/html.rb:24 + def render(*args); end + + # pkg:gem/actionview#lib/action_view/template/html.rb:20 + def to_str; end + + # pkg:gem/actionview#lib/action_view/template/html.rb:7 + def type; end +end + +# = Action View Template Handlers +# +# pkg:gem/actionview#lib/action_view/template/handlers.rb:6 +module ActionView::Template::Handlers + # pkg:gem/actionview#lib/action_view/template/handlers.rb:61 + def handler_for_extension(extension); end + + # pkg:gem/actionview#lib/action_view/template/handlers.rb:56 + def register_default_template_handler(extension, klass); end + + # Register an object that knows how to handle template files with the given + # extensions. This can be used to implement new template types. + # The handler must respond to +:call+, which will be passed the template + # and should return the rendered template as a String. + # + # pkg:gem/actionview#lib/action_view/template/handlers.rb:31 + def register_template_handler(*extensions, handler); end + + # pkg:gem/actionview#lib/action_view/template/handlers.rb:52 + def registered_template_handler(extension); end + + # pkg:gem/actionview#lib/action_view/template/handlers.rb:48 + def template_handler_extensions; end + + # Opposite to register_template_handler. + # + # pkg:gem/actionview#lib/action_view/template/handlers.rb:40 + def unregister_template_handler(*extensions); end + + class << self + # pkg:gem/actionview#lib/action_view/template/handlers.rb:12 + def extended(base); end + + # pkg:gem/actionview#lib/action_view/template/handlers.rb:23 + def extensions; end + end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:5 +class ActionView::Template::Handlers::Builder + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:8 + def call(template, source); end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format; end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format?; end + + private + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:17 + def require_engine; end + + class << self + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format; end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format?; end + + private + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def __class_attr_default_format; end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def __class_attr_default_format=(new_value); end + end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:9 +class ActionView::Template::Handlers::ERB + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:65 + def call(template, source); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:37 + def handles_encoding?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:33 + def supports_streaming?; end + + # Translate an error location returned by ErrorHighlight to the correct + # source location inside the template. + # + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:43 + def translate_location(spot, _backtrace_location, source); end + + private + + # Return the offset between the error lineno and the source lineno. + # Searches in reverse from the backtrace lineno so we have a better + # chance of finding the correct line + # + # The compiled template is likely to be longer than the source. + # Use the difference between the compiled and source sizes to + # determine the earliest line that could contain the highlight. + # + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:119 + def find_lineno_offset(compiled, source_lines, highlight, error_lineno); end + + # Find which token in the source template spans the byte range that + # contains the error_column, then return the offset compared to the + # original source template. + # + # Iterate consecutive pairs of CODE or TEXT tokens, requiring + # a match of the first token before matching either token. + # + # For example, if we want to find tokens A, B, C, we do the following: + # 1. Find a match for A: test error_column or advance scanner. + # 2. Find a match for B or A: + # a. If B: start over with next token set (B, C). + # b. If A: test error_column or advance scanner. + # c. Otherwise: Advance 1 byte + # + # Prioritize matching the next token over the current token once + # a match for the current token has been found. This is to prevent + # the current token from looping past the next token if they both + # match (i.e. if the current token is a single space character). + # + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:152 + def find_offset(compiled, source_tokens, error_column); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:177 + def offset_source_tokens(source_tokens); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:97 + def valid_encoding(string, encoding); end + + class << self + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:29 + def call(template, source); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines?; end + + private + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def __class_attr_erb_implementation; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def __class_attr_erb_implementation=(new_value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def __class_attr_erb_trim_mode; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def __class_attr_erb_trim_mode=(new_value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def __class_attr_escape_ignore_list; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def __class_attr_escape_ignore_list=(new_value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def __class_attr_strip_trailing_newlines; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def __class_attr_strip_trailing_newlines=(new_value); end + end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:25 +ActionView::Template::Handlers::ERB::ENCODING_TAG = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:9 +class ActionView::Template::Handlers::ERB::Erubi < ::Erubi::Engine + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:11 + def initialize(input, properties = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:65 + def add_code(code); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:47 + def add_expression(indicator, code); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:70 + def add_postamble(_); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:30 + def add_text(text); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:75 + def flush_newline_if_pending(src); end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:45 +ActionView::Template::Handlers::ERB::Erubi::BLOCK_EXPR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:27 +class ActionView::Template::Handlers::ERB::LocationParsingError < ::StandardError; end + +# pkg:gem/actionview#lib/action_view/template/handlers/html.rb:5 +class ActionView::Template::Handlers::Html < ::ActionView::Template::Handlers::Raw + # pkg:gem/actionview#lib/action_view/template/handlers/html.rb:6 + def call(template, source); end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/raw.rb:5 +class ActionView::Template::Handlers::Raw + # pkg:gem/actionview#lib/action_view/template/handlers/raw.rb:6 + def call(template, source); end +end + +# pkg:gem/actionview#lib/action_view/template/inline.rb:7 +class ActionView::Template::Inline < ::ActionView::Template + # pkg:gem/actionview#lib/action_view/template/inline.rb:16 + def compile(mod); end +end + +# This finalizer is needed (and exactly with a proc inside another proc) +# otherwise templates leak in development. +# +# pkg:gem/actionview#lib/action_view/template/inline.rb:8 +ActionView::Template::Inline::Finalizer = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionview#lib/action_view/template.rb:308 +ActionView::Template::LEADING_ENCODING_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/template.rb:197 +ActionView::Template::NONE = T.let(T.unsafe(nil), Object) + +# pkg:gem/actionview#lib/action_view/template.rb:564 +ActionView::Template::RUBY_RESERVED_KEYWORDS = T.let(T.unsafe(nil), Array) + +# = Action View RawFile Template +# +# pkg:gem/actionview#lib/action_view/template/raw_file.rb:6 +class ActionView::Template::RawFile + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:9 + def initialize(filename); end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:7 + def format; end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:7 + def format=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:16 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:20 + def render(*args); end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:24 + def supports_streaming?; end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:7 + def type; end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:7 + def type=(_arg0); end +end + +# = Action View Renderable Template for objects that respond to #render_in +# +# pkg:gem/actionview#lib/action_view/template/renderable.rb:6 +class ActionView::Template::Renderable + # pkg:gem/actionview#lib/action_view/template/renderable.rb:7 + def initialize(renderable); end + + # pkg:gem/actionview#lib/action_view/template/renderable.rb:25 + def format; end + + # pkg:gem/actionview#lib/action_view/template/renderable.rb:11 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template/renderable.rb:15 + def render(context, *args); end +end + +# pkg:gem/actionview#lib/action_view/template.rb:10 +ActionView::Template::STRICT_LOCALS_REGEX = T.let(T.unsafe(nil), Regexp) + +# SimpleType is mostly just a stub implementation for when Action View +# is used without Action Dispatch. +# +# pkg:gem/actionview#lib/action_view/template/types.rb:9 +class ActionView::Template::SimpleType + # pkg:gem/actionview#lib/action_view/template/types.rb:29 + def initialize(symbol); end + + # pkg:gem/actionview#lib/action_view/template/types.rb:43 + def ==(type); end + + # pkg:gem/actionview#lib/action_view/template/types.rb:38 + def ref; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:27 + def symbol; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:33 + def to_s; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:36 + def to_str; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:41 + def to_sym; end + + class << self + # pkg:gem/actionview#lib/action_view/template/types.rb:14 + def [](type); end + + # pkg:gem/actionview#lib/action_view/template/types.rb:12 + def symbols; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:22 + def valid_symbols?(symbols); end + end +end + +# pkg:gem/actionview#lib/action_view/template/sources.rb:5 +module ActionView::Template::Sources + extend ::ActiveSupport::Autoload +end + +# pkg:gem/actionview#lib/action_view/template/sources/file.rb:6 +class ActionView::Template::Sources::File + # pkg:gem/actionview#lib/action_view/template/sources/file.rb:7 + def initialize(filename); end + + # pkg:gem/actionview#lib/action_view/template/sources/file.rb:11 + def to_s; end +end + +# = Action View Text Template +# +# pkg:gem/actionview#lib/action_view/template/text.rb:6 +class ActionView::Template::Text + # pkg:gem/actionview#lib/action_view/template/text.rb:9 + def initialize(string); end + + # pkg:gem/actionview#lib/action_view/template/text.rb:27 + def format; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:13 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:17 + def inspect; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:23 + def render(*args); end + + # pkg:gem/actionview#lib/action_view/template/text.rb:19 + def to_str; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:7 + def type; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:7 + def type=(_arg0); end +end + +# pkg:gem/actionview#lib/action_view/template.rb:189 +ActionView::Template::Types = Mime + +# pkg:gem/actionview#lib/action_view/template_details.rb:4 +class ActionView::TemplateDetails + # pkg:gem/actionview#lib/action_view/template_details.rb:35 + def initialize(locale, handler, format, variant); end + + # pkg:gem/actionview#lib/action_view/template_details.rb:33 + def format; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:62 + def format_or_default; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:33 + def handler; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:58 + def handler_class; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:33 + def locale; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:42 + def matches?(requested); end + + # pkg:gem/actionview#lib/action_view/template_details.rb:49 + def sort_key_for(requested); end + + # pkg:gem/actionview#lib/action_view/template_details.rb:33 + def variant; end +end + +# pkg:gem/actionview#lib/action_view/template_details.rb:5 +class ActionView::TemplateDetails::Requested + # pkg:gem/actionview#lib/action_view/template_details.rb:11 + def initialize(locale:, handlers:, formats:, variants:); end + + # pkg:gem/actionview#lib/action_view/template_details.rb:6 + def formats; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:7 + def formats_idx; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:6 + def handlers; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:7 + def handlers_idx; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:6 + def locale; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:7 + def locale_idx; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:6 + def variants; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:7 + def variants_idx; end + + private + + # pkg:gem/actionview#lib/action_view/template_details.rb:28 + def build_idx_hash(arr); end +end + +# pkg:gem/actionview#lib/action_view/template_details.rb:9 +ActionView::TemplateDetails::Requested::ANY_HASH = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionview#lib/action_view/template/error.rb:254 +ActionView::TemplateError = ActionView::Template::Error + +# = Action View \TemplatePath +# +# Represents a template path within ActionView's lookup and rendering system, +# like "users/show" +# +# TemplatePath makes it convenient to convert between separate name, prefix, +# partial arguments and the virtual path. +# +# pkg:gem/actionview#lib/action_view/template_path.rb:11 +class ActionView::TemplatePath + # pkg:gem/actionview#lib/action_view/template_path.rb:47 + def initialize(name, prefix, partial, virtual); end + + # pkg:gem/actionview#lib/action_view/template_path.rb:64 + def ==(other); end + + # pkg:gem/actionview#lib/action_view/template_path.rb:61 + def eql?(other); end + + # pkg:gem/actionview#lib/action_view/template_path.rb:57 + def hash; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:12 + def name; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:12 + def partial; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:13 + def partial?; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:12 + def prefix; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:55 + def to_s; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:54 + def to_str; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:12 + def virtual; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:14 + def virtual_path; end + + class << self + # Convert name, prefix, and partial into a TemplatePath + # + # pkg:gem/actionview#lib/action_view/template_path.rb:43 + def build(name, prefix, partial); end + + # Build a TemplatePath form a virtual path + # + # pkg:gem/actionview#lib/action_view/template_path.rb:28 + def parse(virtual); end + + # Convert name, prefix, and partial into a virtual path string + # + # pkg:gem/actionview#lib/action_view/template_path.rb:17 + def virtual(name, prefix, partial); end + end +end + +# pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:4 +class ActionView::TemplateRenderer < ::ActionView::AbstractRenderer + # pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:5 + def render(context, options); end + + private + + # Determine the template to be rendered using the given options. + # + # pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:16 + def determine_template(options); end + + # This is the method which actually finds the layout using details in the lookup + # context object. If no layout is found, it checks if at least a layout with + # the given name exists across all details before raising the error. + # + # pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:88 + def find_layout(layout, keys, formats); end + + # Renders the given template. A string representing the layout can be + # supplied as well. + # + # pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:58 + def render_template(view, template, layout_name, locals); end + + # pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:71 + def render_with_layout(view, template, path, locals); end + + # pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:92 + def resolve_layout(layout, keys, formats); end +end + +# = Action View Test Case +# +# Read more about ActionView::TestCase in {Testing Rails Applications}[https://guides.rubyonrails.org/testing.html#testing-view-partials] +# in the guides. +# +# pkg:gem/actionview#lib/action_view/test_case.rb:15 +class ActionView::TestCase < ::ActiveSupport::TestCase + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + include ::AbstractController::Helpers + include ::ActiveSupport::Benchmarkable + include ::ActionView::Helpers::ActiveModelHelper + include ::ActionView::Helpers::AssetUrlHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::AssetTagHelper + include ::ActionView::Helpers::AtomFeedHelper + include ::ActionView::Helpers::CacheHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::ControllerHelper + include ::ActionView::Helpers::CspHelper + include ::ActionView::Helpers::CsrfHelper + include ::ActionView::Helpers::DateHelper + include ::ActionView::Helpers::DebugHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionController::TemplateAssertions + include ::ActionView::Context + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionView::ModelNaming + include ::ActionView::RecordIdentifier + include ::ActionView::Helpers::FormHelper + include ::ActionView::Helpers::TranslationHelper + include ::ActionView::Helpers::FormOptionsHelper + include ::ActionView::Helpers::JavaScriptHelper + include ::ActionView::Helpers::NumberHelper + include ::ActionView::Helpers::RenderingHelper + include ::ActionView::Helpers + include ::ActiveSupport::Testing::ConstantLookup + include ::ActionView::RoutingUrlFor + include ::ActionView::TestCase::Behavior + extend ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + extend ::AbstractController::Helpers::Resolution + extend ::AbstractController::Helpers::ClassMethods + extend ::ActionView::Helpers::UrlHelper::ClassMethods + extend ::ActionView::Helpers::SanitizeHelper::ClassMethods + extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods + extend ::ActionView::TestCase::Behavior::ClassMethods + + # pkg:gem/actionview#lib/action_view/test_case.rb:444 + def _helper_methods; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:444 + def _helper_methods=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:444 + def _helper_methods?; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:251 + def _run_setup_callbacks(&block); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:444 + def debug_missing_translation; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:444 + def debug_missing_translation=(val); end + + class << self + # pkg:gem/actionview#lib/action_view/test_case.rb:444 + def _helper_methods; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:444 + def _helper_methods=(value); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:444 + def _helper_methods?; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:444 + def _helpers; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:249 + def content_class; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:249 + def content_class=(value); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:249 + def content_class?; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:444 + def debug_missing_translation; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:444 + def debug_missing_translation=(val); end + + private + + # pkg:gem/actionview#lib/action_view/test_case.rb:251 + def __class_attr___callbacks; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:251 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:444 + def __class_attr__helper_methods; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:444 + def __class_attr__helper_methods=(new_value); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:249 + def __class_attr_content_class; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:249 + def __class_attr_content_class=(new_value); end + end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:45 +module ActionView::TestCase::Behavior + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionController::TemplateAssertions + include ::ActionView::Context + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionView::ModelNaming + include ::ActionView::RecordIdentifier + include ::ActionView::RoutingUrlFor + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions + include ::AbstractController::Helpers + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::FormHelper + include ::ActionView::Helpers::TranslationHelper + include ::ActionView::Helpers + include ::ActiveSupport::Testing::ConstantLookup + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods + mixes_in_class_methods ::ActionView::TestCase::Behavior::ClassMethods + + # pkg:gem/actionview#lib/action_view/test_case.rb:295 + def _routes; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:281 + def config; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def controller; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def controller=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:62 + def lookup_context(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def output_buffer; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def output_buffer=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:285 + def render(options = T.unsafe(nil), local_assigns = T.unsafe(nil), &block); end + + # Returns the content rendered by the last +render+ call. + # + # The returned object behaves like a string but also exposes a number of methods + # that allows you to parse the content string in formats registered using + # .register_parser. + # + # By default includes the following parsers: + # + # +.html+ + # + # Parse the rendered content String into HTML. By default, this means + # a Nokogiri::XML::Node. + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.html.at("main h1") => { content: "Hello, world" } } + # end + # + # To parse the rendered content into a Capybara::Simple::Node, + # re-register an :html parser with a call to + # Capybara.string: + # + # register_parser :html, -> rendered { Capybara.string(rendered) } + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: article + # + # rendered.html.assert_css "h1", text: "Hello, world" + # end + # + # +.json+ + # + # Parse the rendered content String into JSON. By default, this means + # a ActiveSupport::HashWithIndifferentAccess. + # + # test "renders JSON" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :json, partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.json => { title: "Hello, world" } } + # end + # + # pkg:gem/actionview#lib/action_view/test_case.rb:112 + def rendered; end + + # Returns the content rendered by the last +render+ call. + # + # The returned object behaves like a string but also exposes a number of methods + # that allows you to parse the content string in formats registered using + # .register_parser. + # + # By default includes the following parsers: + # + # +.html+ + # + # Parse the rendered content String into HTML. By default, this means + # a Nokogiri::XML::Node. + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.html.at("main h1") => { content: "Hello, world" } } + # end + # + # To parse the rendered content into a Capybara::Simple::Node, + # re-register an :html parser with a call to + # Capybara.string: + # + # register_parser :html, -> rendered { Capybara.string(rendered) } + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: article + # + # rendered.html.assert_css "h1", text: "Hello, world" + # end + # + # +.json+ + # + # Parse the rendered content String into JSON. By default, this means + # a ActiveSupport::HashWithIndifferentAccess. + # + # test "renders JSON" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :json, partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.json => { title: "Hello, world" } } + # end + # + # pkg:gem/actionview#lib/action_view/test_case.rb:112 + def rendered=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:291 + def rendered_views; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def request; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def request=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:269 + def setup_with_controller; end + + private + + # pkg:gem/actionview#lib/action_view/test_case.rb:401 + def _user_defined_ivars; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:364 + def _view; end + + # Need to experiment if this priority is the best one: rendered => output_buffer + # + # pkg:gem/actionview#lib/action_view/test_case.rb:329 + def document_root_element; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:415 + def method_missing(selector, *_arg1, **_arg2, &_arg3); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:431 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end + + # The instance of ActionView::Base that is used by +render+. + # + # pkg:gem/actionview#lib/action_view/test_case.rb:353 + def view; end + + # Returns a Hash of instance variables and their values, as defined by + # the user in the test case, which are then assigned to the view being + # rendered. This is generally intended for internal use and extension + # frameworks. + # + # pkg:gem/actionview#lib/action_view/test_case.rb:409 + def view_assigns; end + + module GeneratedClassMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + def content_class; end + def content_class=(value); end + def content_class?; end + end + + module GeneratedInstanceMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:114 +module ActionView::TestCase::Behavior::ClassMethods + # pkg:gem/actionview#lib/action_view/test_case.rb:213 + def determine_default_helper_class(name); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:232 + def helper_class; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:230 + def helper_class=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:219 + def helper_method(*methods); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:115 + def inherited(descendant); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:236 + def new(*_arg0); end + + # Register a callable to parse rendered content for a given template + # format. + # + # Each registered parser will also define a +#rendered.[FORMAT]+ helper + # method, where +[FORMAT]+ corresponds to the value of the + # +format+ argument. + # + # By default, ActionView::TestCase defines parsers for: + # + # * +:html+ - returns an instance of +Nokogiri::XML::Node+ + # * +:json+ - returns an instance of ActiveSupport::HashWithIndifferentAccess + # + # These pre-registered parsers also define corresponding helpers: + # + # * +:html+ - defines +rendered.html+ + # * +:json+ - defines +rendered.json+ + # + # ==== Parameters + # + # [+format+] + # The name (as a +Symbol+) of the format used to render the content. + # + # [+callable+] + # The parser. A callable object that accepts the rendered string as + # its sole argument. Alternatively, the parser can be specified as a + # block. + # + # ==== Examples + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.html.at("main h1") => { content: "Hello, world" } } + # end + # + # test "renders JSON" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :json, partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.json => { title: "Hello, world" } } + # end + # + # To parse the rendered content into RSS, register a call to +RSS::Parser.parse+: + # + # register_parser :rss, -> rendered { RSS::Parser.parse(rendered) } + # + # test "renders RSS" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :rss, partial: article + # + # assert_equal "Hello, world", rendered.rss.items.last.title + # end + # + # To parse the rendered content into a +Capybara::Simple::Node+, + # re-register an +:html+ parser with a call to +Capybara.string+: + # + # register_parser :html, -> rendered { Capybara.string(rendered) } + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: article + # + # rendered.html.assert_css "h1", text: "Hello, world" + # end + # + # pkg:gem/actionview#lib/action_view/test_case.rb:197 + def register_parser(format, callable = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:204 + def tests(helper_class); end + + private + + # pkg:gem/actionview#lib/action_view/test_case.rb:242 + def include_helper_modules!; end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:366 +ActionView::TestCase::Behavior::INTERNAL_IVARS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionview#lib/action_view/test_case.rb:333 +module ActionView::TestCase::Behavior::Locals + # pkg:gem/actionview#lib/action_view/test_case.rb:336 + def render(options = T.unsafe(nil), local_assigns = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:334 + def rendered_views; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:334 + def rendered_views=(_arg0); end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:299 +class ActionView::TestCase::Behavior::RenderedViewContent < ::String + # pkg:gem/actionview#lib/action_view/test_case.rb:199 + def html; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:199 + def json; end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:302 +class ActionView::TestCase::Behavior::RenderedViewsCollection + # pkg:gem/actionview#lib/action_view/test_case.rb:303 + def initialize; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:307 + def add(view, locals); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:312 + def locals_for(view); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:316 + def rendered_views; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:320 + def view_rendered?(view, expected_locals); end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:444 +module ActionView::TestCase::HelperMethods + # pkg:gem/actionview#lib/action_view/test_case.rb:263 + def _test_case; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:259 + def protect_against_forgery?; end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:16 +class ActionView::TestCase::TestController < ::ActionController::Base + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + + # pkg:gem/actionview#lib/action_view/test_case.rb:34 + def initialize; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:26 + def controller_path=(path); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def params; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def params=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def request; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def request=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def response; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def response=(_arg0); end + + private + + # pkg:gem/actionview#lib/action_view/test_case.rb:16 + def _layout(lookup_context, formats, keys); end + + class << self + # pkg:gem/actionview#lib/action_view/test_case.rb:30 + def controller_name; end + + # Overrides AbstractController::Base#controller_path + # + # pkg:gem/actionview#lib/action_view/test_case.rb:23 + def controller_path; end + + # Overrides AbstractController::Base#controller_path + # + # pkg:gem/actionview#lib/action_view/test_case.rb:23 + def controller_path=(_arg0); end + + private + + # pkg:gem/actionview#lib/action_view/test_case.rb:16 + def __class_attr_config; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:16 + def __class_attr_config=(new_value); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:16 + def __class_attr_middleware_stack; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:16 + def __class_attr_middleware_stack=(new_value); end + end +end + +# pkg:gem/actionview#lib/action_view/unbound_template.rb:6 +class ActionView::UnboundTemplate + # pkg:gem/actionview#lib/action_view/unbound_template.rb:10 + def initialize(source, identifier, details:, virtual_path:); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:20 + def bind_locals(locals); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:44 + def built_templates; end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:7 + def details; end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def format(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def handler(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def locale(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def variant(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:7 + def virtual_path; end + + private + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:49 + def build_template(locals); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:63 + def normalize_locals(locals); end +end + +# pkg:gem/actionview#lib/action_view/gem_version.rb:9 +module ActionView::VERSION; end + +# pkg:gem/actionview#lib/action_view/gem_version.rb:10 +ActionView::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionview#lib/action_view/gem_version.rb:11 +ActionView::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionview#lib/action_view/gem_version.rb:13 +ActionView::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# pkg:gem/actionview#lib/action_view/gem_version.rb:15 +ActionView::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/gem_version.rb:12 +ActionView::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionview#lib/action_view/view_paths.rb:4 +module ActionView::ViewPaths + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + + # The prefixes used in render "foo" shortcuts. + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:81 + def _prefixes; end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def any_templates?(*_arg0, **_arg1, &_arg2); end + + # Append a path to the list of view paths for the current LookupContext. + # + # ==== Parameters + # * path - If a String is provided, it gets converted into + # the default view path. You may also provide a custom view path + # (see ActionView::PathSet for more information) + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:103 + def append_view_path(path); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:93 + def details_for_lookup; end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def formats(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def formats=(arg); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def locale(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def locale=(arg); end + + # LookupContext is the object responsible for holding all + # information required for looking up templates, i.e. view paths and + # details. Check ActionView::LookupContext for more information. + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:88 + def lookup_context; end + + # Prepend a path to the list of view paths for the current LookupContext. + # + # ==== Parameters + # * path - If a String is provided, it gets converted into + # the default view path. You may also provide a custom view path + # (see ActionView::PathSet for more information) + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:113 + def prepend_view_path(path); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def template_exists?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def view_paths(*_arg0, **_arg1, &_arg2); end +end + +# pkg:gem/actionview#lib/action_view/view_paths.rb:14 +module ActionView::ViewPaths::ClassMethods + # pkg:gem/actionview#lib/action_view/view_paths.rb:31 + def _build_view_paths(paths); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:23 + def _prefixes; end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:15 + def _view_paths; end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:19 + def _view_paths=(paths); end + + # Append a path to the list of view paths for this controller. + # + # ==== Parameters + # * path - If a String is provided, it gets converted into + # the default view path. You may also provide a custom view path + # (see ActionView::PathSet for more information) + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:44 + def append_view_path(path); end + + # Prepend a path to the list of view paths for this controller. + # + # ==== Parameters + # * path - If a String is provided, it gets converted into + # the default view path. You may also provide a custom view path + # (see ActionView::PathSet for more information) + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:54 + def prepend_view_path(path); end + + # A list of all of the default view paths for this controller. + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:59 + def view_paths; end + + # Set the view paths. + # + # ==== Parameters + # * paths - If a PathSet is provided, use that; + # otherwise, process the parameter into a PathSet. + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:68 + def view_paths=(paths); end + + private + + # Override this method in your controller if you want to change paths prefixes for finding views. + # Prefixes defined here will still be added to parents' ._prefixes. + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:75 + def local_prefixes; end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:14 +class ActionView::WrongEncodingError < ::ActionView::EncodingError + # pkg:gem/actionview#lib/action_view/template/error.rb:15 + def initialize(string, encoding); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:19 + def message; end +end diff --git a/sorbet/rbi/gems/activejob@8.1.3.rbi b/sorbet/rbi/gems/activejob@8.1.3.rbi new file mode 100644 index 0000000..fac66ed --- /dev/null +++ b/sorbet/rbi/gems/activejob@8.1.3.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `activejob` gem. +# Please instead update this file by running `bin/tapioca gem activejob`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/activemodel@8.1.3.rbi b/sorbet/rbi/gems/activemodel@8.1.3.rbi new file mode 100644 index 0000000..3c0e1ee --- /dev/null +++ b/sorbet/rbi/gems/activemodel@8.1.3.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `activemodel` gem. +# Please instead update this file by running `bin/tapioca gem activemodel`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/activerecord@8.1.3.rbi b/sorbet/rbi/gems/activerecord@8.1.3.rbi new file mode 100644 index 0000000..185a37e --- /dev/null +++ b/sorbet/rbi/gems/activerecord@8.1.3.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `activerecord` gem. +# Please instead update this file by running `bin/tapioca gem activerecord`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/activestorage@8.1.3.rbi b/sorbet/rbi/gems/activestorage@8.1.3.rbi new file mode 100644 index 0000000..983f0cd --- /dev/null +++ b/sorbet/rbi/gems/activestorage@8.1.3.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `activestorage` gem. +# Please instead update this file by running `bin/tapioca gem activestorage`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/activesupport@8.1.3.rbi b/sorbet/rbi/gems/activesupport@8.1.3.rbi new file mode 100644 index 0000000..fb28500 --- /dev/null +++ b/sorbet/rbi/gems/activesupport@8.1.3.rbi @@ -0,0 +1,20150 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `activesupport` gem. +# Please instead update this file by running `bin/tapioca gem activesupport`. + + +# :include: ../README.rdoc +# -- +# The JSON gem adds a few modules to Ruby core classes containing :to_json definition, overwriting +# their default behavior. That said, we need to define the basic to_json method in all of them, +# otherwise they will always use to_json gem implementation, which is backwards incompatible in +# several cases (for instance, the JSON implementation for Hash does not work) with inheritance. +# +# On the other hand, we should avoid conflict with ::JSON.{generate,dump}(obj). Unfortunately, the +# JSON gem's encoder relies on its own to_json implementation to encode objects. Since it always +# passes a ::JSON::State object as the only argument to to_json, we can detect that and forward the +# calls to the original to_json method. +# +# It should be noted that when using ::JSON.{generate,dump} directly, ActiveSupport's encoder is +# bypassed completely. This means that as_json won't be invoked and the JSON gem will simply +# ignore any options it does not natively understand. This also means that ::JSON.{generate,dump} +# should give exactly the same results with or without Active Support. +# :markup: markdown +# -- +# Defines the standard inflection rules. These are the starting point for +# new projects and are not considered complete. The current set of inflection +# rules is frozen. This means, we do not change them to become more complete. +# This is a safety measure to keep existing applications from breaking. +# ++ +# +# pkg:gem/activesupport#lib/active_support/delegation.rb:3 +module ActiveSupport + extend ::ActiveSupport::LazyLoadHooks + extend ::ActiveSupport::Autoload + + # pkg:gem/activesupport#lib/active_support.rb:114 + def filter_parameters; end + + # pkg:gem/activesupport#lib/active_support.rb:114 + def filter_parameters=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:106 + def parallelize_test_databases; end + + # pkg:gem/activesupport#lib/active_support.rb:106 + def parallelize_test_databases=(val); end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 + def parse_json_times; end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 + def parse_json_times=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:104 + def test_order; end + + # pkg:gem/activesupport#lib/active_support.rb:104 + def test_order=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:105 + def test_parallelization_threshold; end + + # pkg:gem/activesupport#lib/active_support.rb:105 + def test_parallelization_threshold=(val); end + + class << self + # pkg:gem/activesupport#lib/active_support.rb:116 + def cache_format_version; end + + # pkg:gem/activesupport#lib/active_support.rb:120 + def cache_format_version=(value); end + + # pkg:gem/activesupport#lib/active_support/deprecator.rb:4 + def deprecator; end + + # pkg:gem/activesupport#lib/active_support.rb:98 + def eager_load!; end + + # pkg:gem/activesupport#lib/active_support.rb:109 + def error_reporter; end + + # pkg:gem/activesupport#lib/active_support.rb:109 + def error_reporter=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def escape_html_entities_in_json(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def escape_html_entities_in_json=(arg); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def escape_js_separators_in_json(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def escape_js_separators_in_json=(arg); end + + # pkg:gem/activesupport#lib/active_support.rb:112 + def event_reporter; end + + # pkg:gem/activesupport#lib/active_support.rb:112 + def event_reporter=(_arg0); end + + # pkg:gem/activesupport#lib/active_support.rb:114 + def filter_parameters; end + + # pkg:gem/activesupport#lib/active_support.rb:114 + def filter_parameters=(val); end + + # Returns the currently loaded version of Active Support as a +Gem::Version+. + # + # pkg:gem/activesupport#lib/active_support/gem_version.rb:5 + def gem_version; end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def json_encoder(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def json_encoder=(arg); end + + # pkg:gem/activesupport#lib/active_support.rb:106 + def parallelize_test_databases; end + + # pkg:gem/activesupport#lib/active_support.rb:106 + def parallelize_test_databases=(val); end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 + def parse_json_times; end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 + def parse_json_times=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:104 + def test_order; end + + # pkg:gem/activesupport#lib/active_support.rb:104 + def test_order=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:105 + def test_parallelization_threshold; end + + # pkg:gem/activesupport#lib/active_support.rb:105 + def test_parallelization_threshold=(val); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def time_precision(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def time_precision=(arg); end + + # pkg:gem/activesupport#lib/active_support.rb:124 + def to_time_preserves_timezone; end + + # pkg:gem/activesupport#lib/active_support.rb:131 + def to_time_preserves_timezone=(value); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def use_standard_json_time_format(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def use_standard_json_time_format=(arg); end + + # pkg:gem/activesupport#lib/active_support.rb:139 + def utc_to_local_returns_utc_offset_times; end + + # pkg:gem/activesupport#lib/active_support.rb:143 + def utc_to_local_returns_utc_offset_times=(value); end + + # Returns the currently loaded version of Active Support as a +Gem::Version+. + # + # pkg:gem/activesupport#lib/active_support/version.rb:7 + def version; end + end +end + +# = Actionable Errors +# +# Actionable errors lets you define actions to resolve an error. +# +# To make an error actionable, include the +ActiveSupport::ActionableError+ +# module and invoke the +action+ class macro to define the action. An action +# needs a name and a block to execute. +# +# pkg:gem/activesupport#lib/active_support/actionable_error.rb:11 +module ActiveSupport::ActionableError + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::ActionableError::ClassMethods + + class << self + # pkg:gem/activesupport#lib/active_support/actionable_error.rb:20 + def actions(error); end + + # pkg:gem/activesupport#lib/active_support/actionable_error.rb:29 + def dispatch(error, name); end + end + + module GeneratedClassMethods + def _actions; end + def _actions=(value); end + def _actions?; end + end + + module GeneratedInstanceMethods + def _actions; end + def _actions=(value); end + def _actions?; end + end +end + +# pkg:gem/activesupport#lib/active_support/actionable_error.rb:35 +module ActiveSupport::ActionableError::ClassMethods + # Defines an action that can resolve the error. + # + # class PendingMigrationError < MigrationError + # include ActiveSupport::ActionableError + # + # action "Run pending migrations" do + # ActiveRecord::Tasks::DatabaseTasks.migrate + # end + # end + # + # pkg:gem/activesupport#lib/active_support/actionable_error.rb:45 + def action(name, &block); end +end + +# pkg:gem/activesupport#lib/active_support/actionable_error.rb:14 +class ActiveSupport::ActionableError::NonActionable < ::StandardError; end + +# = \Array Inquirer +# +# Wrapping an array in an +ArrayInquirer+ gives a friendlier way to check +# its string-like contents: +# +# variants = ActiveSupport::ArrayInquirer.new([:phone, :tablet]) +# +# variants.phone? # => true +# variants.tablet? # => true +# variants.desktop? # => false +# +# pkg:gem/activesupport#lib/active_support/array_inquirer.rb:14 +class ActiveSupport::ArrayInquirer < ::Array + # Passes each element of +candidates+ collection to ArrayInquirer collection. + # The method returns true if any element from the ArrayInquirer collection + # is equal to the stringified or symbolized form of any element in the +candidates+ collection. + # + # If +candidates+ collection is not given, method returns true. + # + # variants = ActiveSupport::ArrayInquirer.new([:phone, :tablet]) + # + # variants.any? # => true + # variants.any?(:phone, :tablet) # => true + # variants.any?('phone', 'desktop') # => true + # variants.any?(:desktop, :watch) # => false + # + # pkg:gem/activesupport#lib/active_support/array_inquirer.rb:27 + def any?(*candidates); end + + private + + # pkg:gem/activesupport#lib/active_support/array_inquirer.rb:42 + def method_missing(name, *_arg1, **_arg2, &_arg3); end + + # pkg:gem/activesupport#lib/active_support/array_inquirer.rb:38 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# = Active Support \Autoload +# +# Autoload and eager load conveniences for your library. +# +# This module allows you to define autoloads based on +# \Rails conventions (i.e. no need to define the path +# it is automatically guessed based on the filename) +# and also define a set of constants that needs to be +# eager loaded: +# +# module MyLib +# extend ActiveSupport::Autoload +# +# autoload :Model +# +# eager_autoload do +# autoload :Cache +# end +# end +# +# Then your library can be eager loaded by simply calling: +# +# MyLib.eager_load! +# +# pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:29 +module ActiveSupport::Autoload + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:30 + def autoload(const_name, path = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:51 + def autoload_at(path); end + + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:44 + def autoload_under(path); end + + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:58 + def eager_autoload; end + + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:65 + def eager_load!; end +end + +# = Backtrace Cleaner +# +# Backtraces often include many lines that are not relevant for the context +# under review. This makes it hard to find the signal amongst the backtrace +# noise, and adds debugging time. With a BacktraceCleaner, filters and +# silencers are used to remove the noisy lines, so that only the most relevant +# lines remain. +# +# Filters are used to modify lines of data, while silencers are used to remove +# lines entirely. The typical filter use case is to remove lengthy path +# information from the start of each line, and view file paths relevant to the +# app directory instead of the file system root. The typical silencer use case +# is to exclude the output of a noisy library from the backtrace, so that you +# can focus on the rest. +# +# bc = ActiveSupport::BacktraceCleaner.new +# root = "#{Rails.root}/" +# bc.add_filter { |line| line.delete_prefix(root) } # strip the Rails.root prefix +# bc.add_silencer { |line| /puma|rubygems/.match?(line) } # skip any lines from puma or rubygems +# bc.clean(exception.backtrace) # perform the cleanup +# +# To reconfigure an existing BacktraceCleaner (like the default one in \Rails) +# and show as much data as possible, you can always call +# BacktraceCleaner#remove_silencers!, which will restore the +# backtrace to a pristine state. If you need to reconfigure an existing +# BacktraceCleaner so that it does not filter or modify the paths of any lines +# of the backtrace, you can call BacktraceCleaner#remove_filters! +# These two methods will give you a completely untouched backtrace. +# +# Inspired by the Quiet Backtrace gem by thoughtbot. +# +# pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:34 +class ActiveSupport::BacktraceCleaner + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:35 + def initialize; end + + # Adds a filter from the block provided. Each line in the backtrace will be + # mapped against this filter. + # + # # Will turn "/my/rails/root/app/models/person.rb" into "app/models/person.rb" + # root = "#{Rails.root}/" + # backtrace_cleaner.add_filter { |line| line.delete_prefix(root) } + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:154 + def add_filter(&block); end + + # Adds a silencer from the block provided. If the silencer returns +true+ + # for a given line, it will be excluded from the clean backtrace. + # + # # Will reject all lines that include the word "puma", like "/gems/puma/server.rb" or "/app/my_puma_server/rb" + # backtrace_cleaner.add_silencer { |line| /puma/.match?(line) } + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:163 + def add_silencer(&block); end + + # Returns the backtrace after all filters and silencers have been run + # against it. Filters run first, then silencers. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:45 + def clean(backtrace, kind = T.unsafe(nil)); end + + # Returns the frame with all filters applied. + # returns +nil+ if the frame was silenced. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:73 + def clean_frame(frame, kind = T.unsafe(nil)); end + + # Given an array of Thread::Backtrace::Location objects, returns an array + # with the clean ones: + # + # clean_locations = backtrace_cleaner.clean_locations(caller_locations) + # + # Filters and silencers receive strings as usual. However, the +path+ + # attributes of the locations in the returned array are the original, + # unfiltered ones, since locations are immutable. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:67 + def clean_locations(locations, kind = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:57 + def filter(backtrace, kind = T.unsafe(nil)); end + + # Returns the first clean frame of the caller's backtrace, or +nil+. + # + # Frames are strings. + # Returns the first clean frame of the caller's backtrace, or +nil+. + # + # Frames are strings. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:129 + def first_clean_frame(kind = T.unsafe(nil)); end + + # Returns the first clean location of the caller's call stack, or +nil+. + # + # Locations are Thread::Backtrace::Location objects. Since they are + # immutable, their +path+ attributes are the original ones, but filters + # are applied internally so silencers can still rely on them. + # Returns the first clean location of the caller's call stack, or +nil+. + # + # Locations are Thread::Backtrace::Location objects. Since they are + # immutable, their +path+ attributes are the original ones, but filters + # are applied internally so silencers can still rely on them. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:141 + def first_clean_location(kind = T.unsafe(nil)); end + + # Removes all filters, but leaves in the silencers. Useful if you suddenly + # need to see entire filepaths in the backtrace that you had already + # filtered out. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:177 + def remove_filters!; end + + # Removes all silencers, but leaves in the filters. Useful if your + # context of debugging suddenly expands as you suspect a bug in one of + # the libraries you use. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:170 + def remove_silencers!; end + + private + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:198 + def add_core_silencer; end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:189 + def add_gem_filter; end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:202 + def add_gem_silencer; end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:206 + def add_stdlib_silencer; end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:210 + def filter_backtrace(backtrace); end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:184 + def initialize_copy(_other); end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:226 + def noise(backtrace); end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:218 + def silence(backtrace); end +end + +# pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:182 +ActiveSupport::BacktraceCleaner::FORMATTED_GEMS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/benchmark.rb:4 +module ActiveSupport::Benchmark + class << self + # Benchmark realtime in the specified time unit. By default, + # the returned unit is in seconds. + # + # ActiveSupport::Benchmark.realtime { sleep 0.1 } + # # => 0.10007 + # + # ActiveSupport::Benchmark.realtime(:float_millisecond) { sleep 0.1 } + # # => 100.07 + # + # `unit` can be any of the values accepted by Ruby's `Process.clock_gettime`. + # + # pkg:gem/activesupport#lib/active_support/benchmark.rb:15 + def realtime(unit = T.unsafe(nil), &block); end + end +end + +# = \Benchmarkable +# +# pkg:gem/activesupport#lib/active_support/benchmarkable.rb:7 +module ActiveSupport::Benchmarkable + # Allows you to measure the execution time of a block in a template and + # records the result to the log. Wrap this block around expensive operations + # or possible bottlenecks to get a time reading for the operation. For + # example, let's say you thought your file processing method was taking too + # long; you could wrap it in a benchmark block. + # + # <% benchmark 'Process data files' do %> + # <%= expensive_files_operation %> + # <% end %> + # + # That would add something like "Process data files (345.2ms)" to the log, + # which you can then use to compare timings when optimizing your code. + # + # You may give an optional logger level (:debug, :info, + # :warn, :error) as the :level option. The + # default logger level value is :info. + # + # <% benchmark 'Low-level files', level: :debug do %> + # <%= lowlevel_files_operation %> + # <% end %> + # + # Finally, you can pass true as the third argument to silence all log + # activity (other than the timing information) from inside the block. This + # is great for boiling down a noisy block to just a single statement that + # produces one log line: + # + # <% benchmark 'Process data files', level: :info, silence: true do %> + # <%= expensive_and_chatty_files_operation %> + # <% end %> + # + # pkg:gem/activesupport#lib/active_support/benchmarkable.rb:37 + def benchmark(message = T.unsafe(nil), options = T.unsafe(nil), &block); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/big_decimal/conversions.rb:7 +module ActiveSupport::BigDecimalWithDefaultFormat + # pkg:gem/activesupport#lib/active_support/core_ext/big_decimal/conversions.rb:8 + def to_s(format = T.unsafe(nil)); end +end + +# = Active Support Broadcast Logger +# +# The Broadcast logger is a logger used to write messages to multiple IO. It is commonly used +# in development to display messages on STDOUT and also write them to a file (development.log). +# With the Broadcast logger, you can broadcast your logs to a unlimited number of sinks. +# +# The BroadcastLogger acts as a standard logger and all methods you are used to are available. +# However, all the methods on this logger will propagate and be delegated to the other loggers +# that are part of the broadcast. +# +# Broadcasting your logs. +# +# stdout_logger = Logger.new(STDOUT) +# file_logger = Logger.new("development.log") +# broadcast = BroadcastLogger.new(stdout_logger, file_logger) +# +# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file. +# +# Add a logger to the broadcast. +# +# stdout_logger = Logger.new(STDOUT) +# broadcast = BroadcastLogger.new(stdout_logger) +# file_logger = Logger.new("development.log") +# broadcast.broadcast_to(file_logger) +# +# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file. +# +# Modifying the log level for all broadcasted loggers. +# +# stdout_logger = Logger.new(STDOUT) +# file_logger = Logger.new("development.log") +# broadcast = BroadcastLogger.new(stdout_logger, file_logger) +# +# broadcast.level = Logger::FATAL # Modify the log level for the whole broadcast. +# +# Stop broadcasting log to a sink. +# +# stdout_logger = Logger.new(STDOUT) +# file_logger = Logger.new("development.log") +# broadcast = BroadcastLogger.new(stdout_logger, file_logger) +# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file. +# +# broadcast.stop_broadcasting_to(file_logger) +# broadcast.info("Hello world!") # Writes the log *only* to STDOUT. +# +# At least one sink has to be part of the broadcast. Otherwise, your logs will not +# be written anywhere. For instance: +# +# broadcast = BroadcastLogger.new +# broadcast.info("Hello world") # The log message will appear nowhere. +# +# If you are adding a custom logger with custom methods to the broadcast, +# the `BroadcastLogger` will proxy them and return the raw value, or an array +# of raw values, depending on how many loggers in the broadcasts responded to +# the method: +# +# class MyLogger < ::Logger +# def loggable? +# true +# end +# end +# +# logger = BroadcastLogger.new +# logger.loggable? # => A NoMethodError exception is raised because no loggers in the broadcasts could respond. +# +# logger.broadcast_to(MyLogger.new(STDOUT)) +# logger.loggable? # => true +# logger.broadcast_to(MyLogger.new(STDOUT)) +# puts logger.broadcasts # => [MyLogger, MyLogger] +# logger.loggable? # [true, true] +# +# pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:74 +class ActiveSupport::BroadcastLogger + include ::ActiveSupport::LoggerSilence + include ::ActiveSupport::LoggerThreadSafeLevel + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:81 + def initialize(*loggers); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def <<(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def add(*_arg0, **_arg1, &_arg2); end + + # Add logger(s) to the broadcast. + # + # broadcast_logger = ActiveSupport::BroadcastLogger.new + # broadcast_logger.broadcast_to(Logger.new(STDOUT), Logger.new(STDERR)) + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:92 + def broadcast_to(*loggers); end + + # Returns all the logger that are part of this broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:78 + def broadcasts; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def close(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def debug(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::DEBUG+ for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:146 + def debug!; end + + # True if the log level allows entries with severity +Logger::DEBUG+ to be written + # to at least one broadcast. False otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:141 + def debug?; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def error(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::ERROR+ for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:179 + def error!; end + + # True if the log level allows entries with severity +Logger::ERROR+ to be written + # to at least one broadcast. False otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:174 + def error?; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def fatal(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::FATAL+ for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:190 + def fatal!; end + + # True if the log level allows entries with severity +Logger::FATAL+ to be written + # to at least one broadcast. False otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:185 + def fatal?; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def formatter(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def formatter=(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def info(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::INFO+ for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:157 + def info!; end + + # True if the log level allows entries with severity +Logger::INFO+ to be written + # to at least one broadcast. False otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:152 + def info?; end + + # Returns the lowest level of all the loggers in the broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:135 + def level; end + + # Returns the lowest level of all the loggers in the broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def level=(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:113 + def local_level; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:107 + def local_level=(level); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def log(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:79 + def progname; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:79 + def progname=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def sev_threshold=(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 + def silencer; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 + def silencer=(val); end + + # Remove a logger from the broadcast. When a logger is removed, messages sent to + # the broadcast will no longer be written to its sink. + # + # sink = Logger.new(STDOUT) + # broadcast_logger = ActiveSupport::BroadcastLogger.new + # + # broadcast_logger.stop_broadcasting_to(sink) + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:103 + def stop_broadcasting_to(logger); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def unknown(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def warn(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::WARN+ for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:168 + def warn!; end + + # True if the log level allows entries with severity +Logger::WARN+ to be written + # to at least one broadcast. False otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:163 + def warn?; end + + private + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:202 + def dispatch(method, *args, **kwargs, &block); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:194 + def initialize_copy(other); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:222 + def method_missing(name, *_arg1, **_arg2, &_arg3); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:234 + def respond_to_missing?(method, include_all); end + + class << self + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 + def silencer; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 + def silencer=(val); end + end +end + +# pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:121 +ActiveSupport::BroadcastLogger::LOGGER_METHODS = T.let(T.unsafe(nil), Array) + +# See ActiveSupport::Cache::Store for documentation. +# +# pkg:gem/activesupport#lib/active_support/cache/entry.rb:6 +module ActiveSupport::Cache + class << self + # Expands out the +key+ argument into a key that can be used for the + # cache store. Optionally accepts a namespace, and all keys will be + # scoped within that namespace. + # + # If the +key+ argument provided is an array, or responds to +to_a+, then + # each of elements in the array will be turned into parameters/keys and + # concatenated into a single key. For example: + # + # ActiveSupport::Cache.expand_cache_key([:foo, :bar]) # => "foo/bar" + # ActiveSupport::Cache.expand_cache_key([:foo, :bar], "namespace") # => "namespace/foo/bar" + # + # The +key+ argument can also respond to +cache_key+ or +to_param+. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:113 + def expand_cache_key(key, namespace = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:60 + def format_version; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:60 + def format_version=(_arg0); end + + # Creates a new Store object according to the given options. + # + # If no arguments are passed to this method, then a new + # ActiveSupport::Cache::MemoryStore object will be returned. + # + # If you pass a Symbol as the first argument, then a corresponding cache + # store class under the ActiveSupport::Cache namespace will be created. + # For example: + # + # ActiveSupport::Cache.lookup_store(:memory_store) + # # => returns a new ActiveSupport::Cache::MemoryStore object + # + # ActiveSupport::Cache.lookup_store(:mem_cache_store) + # # => returns a new ActiveSupport::Cache::MemCacheStore object + # + # Any additional arguments will be passed to the corresponding cache store + # class's constructor: + # + # ActiveSupport::Cache.lookup_store(:file_store, '/tmp/cache') + # # => same as: ActiveSupport::Cache::FileStore.new('/tmp/cache') + # + # If the first argument is not a Symbol, then it will simply be returned: + # + # ActiveSupport::Cache.lookup_store(MyOwnCacheStore.new) + # # => returns MyOwnCacheStore.new + # + # pkg:gem/activesupport#lib/active_support/cache.rb:87 + def lookup_store(store = T.unsafe(nil), *parameters); end + + private + + # pkg:gem/activesupport#lib/active_support/cache.rb:125 + def retrieve_cache_key(key); end + + # Obtains the specified cache store class, given the name of the +store+. + # Raises an error when the store class cannot be found. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:137 + def retrieve_store_class(store); end + end +end + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:7 +class ActiveSupport::Cache::Coder + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:8 + def initialize(serializer, compressor, legacy_serializer: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:14 + def dump(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:20 + def dump_compressed(entry, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:48 + def load(dumped); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:136 + def dump_version(version); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:144 + def load_version(dumped_version); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:121 + def signature?(dumped); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:129 + def try_compress(string, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:125 + def type_for_string(value); end +end + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:76 +ActiveSupport::Cache::Coder::COMPRESSED_FLAG = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:98 +class ActiveSupport::Cache::Coder::LazyEntry < ::ActiveSupport::Cache::Entry + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:99 + def initialize(serializer, compressor, payload, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:114 + def mismatched?(version); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:106 + def value; end +end + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:84 +ActiveSupport::Cache::Coder::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:68 +ActiveSupport::Cache::Coder::OBJECT_DUMP_TYPE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:80 +ActiveSupport::Cache::Coder::PACKED_EXPIRES_AT_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:78 +ActiveSupport::Cache::Coder::PACKED_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:79 +ActiveSupport::Cache::Coder::PACKED_TYPE_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:82 +ActiveSupport::Cache::Coder::PACKED_VERSION_INDEX = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:81 +ActiveSupport::Cache::Coder::PACKED_VERSION_LENGTH_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:66 +ActiveSupport::Cache::Coder::SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:96 +ActiveSupport::Cache::Coder::STRING_DESERIALIZERS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:70 +ActiveSupport::Cache::Coder::STRING_ENCODINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:86 +class ActiveSupport::Cache::Coder::StringDeserializer + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:87 + def initialize(encoding); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:91 + def load(payload); end +end + +# pkg:gem/activesupport#lib/active_support/cache.rb:47 +ActiveSupport::Cache::DEFAULT_COMPRESS_LIMIT = T.let(T.unsafe(nil), Integer) + +# Raised by coders when the cache entry can't be deserialized. +# This error is treated as a cache miss. +# +# pkg:gem/activesupport#lib/active_support/cache.rb:51 +class ActiveSupport::Cache::DeserializationError < ::StandardError; end + +# This class is used to represent cache entries. Cache entries have a value, an optional +# expiration time, and an optional version. The expiration time is used to support the :race_condition_ttl option +# on the cache. The version is used to support the :version option on the cache for rejecting +# mismatches. +# +# Since cache entries in most instances will be serialized, the internals of this class are highly optimized +# using short instance variable names that are lazily defined. +# +# pkg:gem/activesupport#lib/active_support/cache/entry.rb:14 +class ActiveSupport::Cache::Entry + # Creates a new cache entry for the specified value. Options supported are + # +:compressed+, +:version+, +:expires_at+ and +:expires_in+. + # + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:25 + def initialize(value, compressed: T.unsafe(nil), version: T.unsafe(nil), expires_in: T.unsafe(nil), expires_at: T.unsafe(nil), **_arg5); end + + # Returns the size of the cached value. This could be less than + # value.bytesize if the data is compressed. + # + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:61 + def bytesize; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:76 + def compressed(compress_threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:72 + def compressed?; end + + # Duplicates the value in a class. This is used by cache implementations that don't natively + # serialize entries to protect against accidental cache modifications. + # + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:106 + def dup_value!; end + + # Checks if the entry is expired. The +expires_in+ parameter can override + # the value set when the entry was created. + # + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:43 + def expired?; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:47 + def expires_at; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:51 + def expires_at=(value); end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:100 + def local?; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:37 + def mismatched?(version); end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:116 + def pack; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:33 + def value; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:21 + def version; end + + private + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:127 + def marshal_load(payload); end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:123 + def uncompress(value); end + + class << self + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:16 + def unpack(members); end + end +end + +# = \File \Cache \Store +# +# A cache store implementation which stores everything on the filesystem. +# +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:12 +class ActiveSupport::Cache::FileStore < ::ActiveSupport::Cache::Store + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:20 + def initialize(cache_path, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:13 + def cache_path; end + + # Preemptively iterates through all stored keys and removes the ones which have expired. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:40 + def cleanup(options = T.unsafe(nil)); end + + # Deletes all items from the cache. In this case it deletes all the entries in the specified + # file store directory except for .keep or .gitkeep. Be careful which directory is specified in your + # config file when using +FileStore+ because everything in that directory will be deleted. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:33 + def clear(options = T.unsafe(nil)); end + + # Decrement a cached integer value. Returns the updated value. + # + # If the key is unset, it will be set to +-amount+. + # + # cache.decrement("foo") # => -1 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.decrement("baz") # => 4 + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:80 + def decrement(name, amount = T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:89 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # Increment a cached integer value. Returns the updated value. + # + # If the key is unset, it starts from +0+: + # + # cache.increment("foo") # => 1 + # cache.increment("bar", 100) # => 100 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.increment("baz") # => 6 + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:60 + def increment(name, amount = T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:101 + def inspect; end + + private + + # Delete empty directories in the cache. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:195 + def delete_empty_directories(dir); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:131 + def delete_entry(key, **options); end + + # Make sure a file path's directories exist. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:204 + def ensure_cache_path(path); end + + # Translate a file path into a key. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:189 + def file_path_key(path); end + + # Lock a file for a block so only one process can modify it at a time. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:148 + def lock_file(file_name, &block); end + + # Modifies the amount of an integer value that is stored in the cache. + # If the key is not found it is created and set to +amount+. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:222 + def modify_value(name, amount, options); end + + # Translate a key into a file path. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:162 + def normalize_key(key, options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:106 + def read_entry(key, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:113 + def read_serialized_entry(key, **_arg1); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:208 + def search_dir(dir, &callback); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:120 + def write_entry(key, entry, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:124 + def write_serialized_entry(key, payload, **options); end + + class << self + # Advertise cache versioning support. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:26 + def supports_cache_versioning?; end + end +end + +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:15 +ActiveSupport::Cache::FileStore::DIR_FORMATTER = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:16 +ActiveSupport::Cache::FileStore::FILENAME_MAX_SIZE = T.let(T.unsafe(nil), Integer) + +# max filename size on file system is 255, minus room for timestamp, pid, and random characters appended by Tempfile (used by atomic write) +# +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:17 +ActiveSupport::Cache::FileStore::FILEPATH_MAX_SIZE = T.let(T.unsafe(nil), Integer) + +# max is 1024, plus some room +# +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:18 +ActiveSupport::Cache::FileStore::GITKEEP_FILES = T.let(T.unsafe(nil), Array) + +# = Memory \Cache \Store +# +# A cache store implementation which stores everything into memory in the +# same process. If you're running multiple Ruby on \Rails server processes +# (which is the case if you're using Phusion Passenger or puma clustered mode), +# then this means that \Rails server process instances won't be able +# to share cache data with each other and this may not be the most +# appropriate cache in that scenario. +# +# This cache has a bounded size specified by the +:size+ options to the +# initializer (default is 32Mb). When the cache exceeds the allotted size, +# a cleanup will occur which tries to prune the cache down to three quarters +# of the maximum size by removing the least recently used entries. +# +# Unlike other Cache store implementations, +MemoryStore+ does not compress +# values by default. +MemoryStore+ does not benefit from compression as much +# as other Store implementations, as it does not send data over a network. +# However, when compression is enabled, it still pays the full cost of +# compression in terms of cpu use. +# +# +MemoryStore+ is thread-safe. +# +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:28 +class ActiveSupport::Cache::MemoryStore < ::ActiveSupport::Cache::Store + include ::ActiveSupport::Cache::Strategy::LocalCache + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:75 + def initialize(options = T.unsafe(nil)); end + + # Preemptively iterates through all stored keys and removes the ones which have expired. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:103 + def cleanup(options = T.unsafe(nil)); end + + # Delete all data stored in a given cache store. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:95 + def clear(options = T.unsafe(nil)); end + + # Decrement a cached integer value. Returns the updated value. + # + # If the key is unset or has expired, it will be set to +-amount+. + # + # cache.decrement("foo") # => -1 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.decrement("baz") # => 4 + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:168 + def decrement(name, amount = T.unsafe(nil), **options); end + + # Deletes cache entries if the cache key matches a given pattern. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:175 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # Increment a cached integer value. Returns the updated value. + # + # If the key is unset, it will be set to +amount+: + # + # cache.increment("foo") # => 1 + # cache.increment("bar", 100) # => 100 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.increment("baz") # => 6 + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:151 + def increment(name, amount = T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:187 + def inspect; end + + # To ensure entries fit within the specified memory prune the cache by removing the least + # recently accessed entries. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:116 + def prune(target_size, max_time = T.unsafe(nil)); end + + # Returns true if the cache is currently being pruned. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:135 + def pruning?; end + + # Synchronize calls to the cache. This should be called wherever the underlying cache implementation + # is not thread safe. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:193 + def synchronize(&block); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:200 + def cached_size(key, payload); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:233 + def delete_entry(key, **_arg1); end + + # Modifies the amount of an integer value that is stored in the cache. + # If the key is not found it is created and set to +amount+. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:243 + def modify_value(name, amount, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:204 + def read_entry(key, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:216 + def write_entry(key, entry, **options); end + + class << self + # Advertise cache versioning support. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:90 + def supports_cache_versioning?; end + end +end + +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:31 +module ActiveSupport::Cache::MemoryStore::DupCoder + extend ::ActiveSupport::Cache::MemoryStore::DupCoder + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:34 + def dump(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:42 + def dump_compressed(entry, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:47 + def load(entry); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:58 + def dump_value(value); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:66 + def load_value(string); end +end + +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:56 +ActiveSupport::Cache::MemoryStore::DupCoder::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:198 +ActiveSupport::Cache::MemoryStore::PER_ENTRY_OVERHEAD = T.let(T.unsafe(nil), Integer) + +# = Null \Cache \Store +# +# A cache store implementation which doesn't actually store anything. Useful in +# development and test environments where you don't want caching turned on but +# need to go through the caching interface. +# +# This cache does implement the local cache strategy, so values will actually +# be cached inside blocks that utilize this strategy. See +# ActiveSupport::Cache::Strategy::LocalCache for more details. +# +# pkg:gem/activesupport#lib/active_support/cache/null_store.rb:14 +class ActiveSupport::Cache::NullStore < ::ActiveSupport::Cache::Store + include ::ActiveSupport::Cache::Strategy::LocalCache + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:25 + def cleanup(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:22 + def clear(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:31 + def decrement(name, amount = T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:34 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:28 + def increment(name, amount = T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:37 + def inspect; end + + private + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:57 + def delete_entry(key, **_arg1); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:42 + def read_entry(key, **s); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:46 + def read_serialized_entry(key, raw: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:49 + def write_entry(key, entry, **_arg2); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:53 + def write_serialized_entry(key, payload, **_arg2); end + + class << self + # Advertise cache versioning support. + # + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:18 + def supports_cache_versioning?; end + end +end + +# Mapping of canonical option names to aliases that a store will recognize. +# +# pkg:gem/activesupport#lib/active_support/cache.rb:43 +ActiveSupport::Cache::OPTION_ALIASES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:8 +module ActiveSupport::Cache::SerializerWithFallback + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:17 + def load(dumped); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:39 + def marshal_load(payload); end + + class << self + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:9 + def [](format); end + end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:66 +module ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:88 + def _load(marked); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:73 + def dump(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:77 + def dump_compressed(entry, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:94 + def dumped?(dumped); end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:71 +ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback::MARK_COMPRESSED = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:70 +ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback::MARK_UNCOMPRESSED = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:99 +module ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:109 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:105 + def dump(value); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:113 + def dumped?(dumped); end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:103 +ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:118 +module ActiveSupport::Cache::SerializerWithFallback::MessagePackWithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::MessagePackWithFallback + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:126 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:122 + def dump(value); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:130 + def dumped?(dumped); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:135 + def available?; end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:45 +module ActiveSupport::Cache::SerializerWithFallback::PassthroughWithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::PassthroughWithFallback + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:57 + def _load(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:49 + def dump(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:53 + def dump_compressed(entry, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:61 + def dumped?(dumped); end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:144 +ActiveSupport::Cache::SerializerWithFallback::SERIALIZERS = T.let(T.unsafe(nil), Hash) + +# = Active Support \Cache \Store +# +# An abstract cache store class. There are multiple cache store +# implementations, each having its own additional features. See the classes +# under the ActiveSupport::Cache module, e.g. +# ActiveSupport::Cache::MemCacheStore. MemCacheStore is currently the most +# popular cache store for large production websites. +# +# Some implementations may not support all methods beyond the basic cache +# methods of #fetch, #write, #read, #exist?, and #delete. +# +# +ActiveSupport::Cache::Store+ can store any Ruby object that is supported +# by its +coder+'s +dump+ and +load+ methods. +# +# cache = ActiveSupport::Cache::MemoryStore.new +# +# cache.read('city') # => nil +# cache.write('city', "Duckburgh") # => true +# cache.read('city') # => "Duckburgh" +# +# cache.write('not serializable', Proc.new {}) # => TypeError +# +# Keys are always translated into Strings and are case sensitive. When an +# object is specified as a key and has a +cache_key+ method defined, this +# method will be called to define the key. Otherwise, the +to_param+ +# method will be called. Hashes and Arrays can also be used as keys. The +# elements will be delimited by slashes, and the elements within a Hash +# will be sorted by key so they are consistent. +# +# cache.read('city') == cache.read(:city) # => true +# +# Nil values can be cached. +# +# If your cache is on a shared infrastructure, you can define a namespace +# for your cache entries. If a namespace is defined, it will be prefixed on +# to every key. The namespace can be either a static value or a Proc. If it +# is a Proc, it will be invoked when each key is evaluated so that you can +# use application logic to invalidate keys. +# +# cache.namespace = -> { @last_mod_time } # Set the namespace to a variable +# @last_mod_time = Time.now # Invalidate the entire cache by changing namespace +# +# pkg:gem/activesupport#lib/active_support/cache.rb:190 +class ActiveSupport::Cache::Store + # Creates a new cache. + # + # ==== Options + # + # [+:namespace+] + # Sets the namespace for the cache. This option is especially useful if + # your application shares a cache with other applications. + # + # [+:serializer+] + # The serializer for cached values. Must respond to +dump+ and +load+. + # + # The default serializer depends on the cache format version (set via + # +config.active_support.cache_format_version+ when using Rails). The + # default serializer for each format version includes a fallback + # mechanism to deserialize values from any format version. This behavior + # makes it easy to migrate between format versions without invalidating + # the entire cache. + # + # You can also specify serializer: :message_pack to use a + # preconfigured serializer based on ActiveSupport::MessagePack. The + # +:message_pack+ serializer includes the same deserialization fallback + # mechanism, allowing easy migration from (or to) the default + # serializer. The +:message_pack+ serializer may improve performance, + # but it requires the +msgpack+ gem. + # + # [+:compressor+] + # The compressor for serialized cache values. Must respond to +deflate+ + # and +inflate+. + # + # The default compressor is +Zlib+. To define a new custom compressor + # that also decompresses old cache entries, you can check compressed + # values for Zlib's "\x78" signature: + # + # module MyCompressor + # def self.deflate(dumped) + # # compression logic... (make sure result does not start with "\x78"!) + # end + # + # def self.inflate(compressed) + # if compressed.start_with?("\x78") + # Zlib.inflate(compressed) + # else + # # decompression logic... + # end + # end + # end + # + # ActiveSupport::Cache.lookup_store(:redis_cache_store, compressor: MyCompressor) + # + # [+:coder+] + # The coder for serializing and (optionally) compressing cache entries. + # Must respond to +dump+ and +load+. + # + # The default coder composes the serializer and compressor, and includes + # some performance optimizations. If you only need to override the + # serializer or compressor, you should specify the +:serializer+ or + # +:compressor+ options instead. + # + # If the store can handle cache entries directly, you may also specify + # coder: nil to omit the serializer, compressor, and coder. For + # example, if you are using ActiveSupport::Cache::MemoryStore and can + # guarantee that cache values will not be mutated, you can specify + # coder: nil to avoid the overhead of safeguarding against + # mutation. + # + # The +:coder+ option is mutually exclusive with the +:serializer+ and + # +:compressor+ options. Specifying them together will raise an + # +ArgumentError+. + # + # Any other specified options are treated as default options for the + # relevant cache operations, such as #read, #write, and #fetch. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:300 + def initialize(options = T.unsafe(nil)); end + + # Cleans up the cache by removing expired entries. + # + # Options are passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:785 + def cleanup(options = T.unsafe(nil)); end + + # Clears the entire cache. Be careful with this method since it could + # affect other processes if shared cache is being used. + # + # The options hash is passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:795 + def clear(options = T.unsafe(nil)); end + + # Decrements an integer value in the cache. + # + # Options are passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:750 + def decrement(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # Deletes an entry in the cache. Returns +true+ if an entry is deleted + # and +false+ otherwise. + # + # Options are passed to the underlying cache implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:686 + def delete(name, options = T.unsafe(nil)); end + + # Deletes all entries with keys matching the pattern. + # + # Options are passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:732 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # Deletes multiple entries in the cache. Returns the number of deleted + # entries. + # + # Options are passed to the underlying cache implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:699 + def delete_multi(names, options = T.unsafe(nil)); end + + # Returns +true+ if the cache contains an entry for the given key. + # + # Options are passed to the underlying cache implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:713 + def exist?(name, options = T.unsafe(nil)); end + + # Fetches data from the cache, using the given key. If there is data in + # the cache with the given key, then that data is returned. + # + # If there is no such data in the cache (a cache miss), then +nil+ will be + # returned. However, if a block has been passed, that block will be passed + # the key and executed in the event of a cache miss. The return value of the + # block will be written to the cache under the given cache key, and that + # return value will be returned. + # + # cache.write('today', 'Monday') + # cache.fetch('today') # => "Monday" + # + # cache.fetch('city') # => nil + # cache.fetch('city') do + # 'Duckburgh' + # end + # cache.fetch('city') # => "Duckburgh" + # + # ==== Options + # + # Internally, +fetch+ calls +read_entry+, and calls +write_entry+ on a + # cache miss. Thus, +fetch+ supports the same options as #read and #write. + # Additionally, +fetch+ supports the following options: + # + # * force: true - Forces a cache "miss," meaning we treat the + # cache value as missing even if it's present. Passing a block is + # required when +force+ is true so this always results in a cache write. + # + # cache.write('today', 'Monday') + # cache.fetch('today', force: true) { 'Tuesday' } # => 'Tuesday' + # cache.fetch('today', force: true) # => ArgumentError + # + # The +:force+ option is useful when you're calling some other method to + # ask whether you should force a cache write. Otherwise, it's clearer to + # just call +write+. + # + # * skip_nil: true - Prevents caching a nil result: + # + # cache.fetch('foo') { nil } + # cache.fetch('bar', skip_nil: true) { nil } + # cache.exist?('foo') # => true + # cache.exist?('bar') # => false + # + # * +:race_condition_ttl+ - Specifies the number of seconds during which + # an expired value can be reused while a new value is being generated. + # This can be used to prevent race conditions when cache entries expire, + # by preventing multiple processes from simultaneously regenerating the + # same entry (also known as the dog pile effect). + # + # When a process encounters a cache entry that has expired less than + # +:race_condition_ttl+ seconds ago, it will bump the expiration time by + # +:race_condition_ttl+ seconds before generating a new value. During + # this extended time window, while the process generates a new value, + # other processes will continue to use the old value. After the first + # process writes the new value, other processes will then use it. + # + # If the first process errors out while generating a new value, another + # process can try to generate a new value after the extended time window + # has elapsed. + # + # # Set all values to expire after one second. + # cache = ActiveSupport::Cache::MemoryStore.new(expires_in: 1) + # + # cache.write("foo", "original value") + # val_1 = nil + # val_2 = nil + # p cache.read("foo") # => "original value" + # + # sleep 1 # wait until the cache expires + # + # t1 = Thread.new do + # # fetch does the following: + # # 1. gets an recent expired entry + # # 2. extends the expiry by 2 seconds (race_condition_ttl) + # # 3. regenerates the new value + # val_1 = cache.fetch("foo", race_condition_ttl: 2) do + # sleep 1 + # "new value 1" + # end + # end + # + # # Wait until t1 extends the expiry of the entry + # # but before generating the new value + # sleep 0.1 + # + # val_2 = cache.fetch("foo", race_condition_ttl: 2) do + # # This block won't be executed because t1 extended the expiry + # "new value 2" + # end + # + # t1.join + # + # p val_1 # => "new value 1" + # p val_2 # => "original value" + # p cache.fetch("foo") # => "new value 1" + # + # # The entry requires 3 seconds to expire (expires_in + race_condition_ttl) + # # We have waited 2 seconds already (sleep(1) + t1.join) thus we need to wait 1 + # # more second to see the entry expire. + # sleep 1 + # + # p cache.fetch("foo") # => nil + # + # ==== Dynamic Options + # + # In some cases it may be necessary to dynamically compute options based + # on the cached value. To support this, an ActiveSupport::Cache::WriteOptions + # instance is passed as the second argument to the block. For example: + # + # cache.fetch("authentication-token:#{user.id}") do |key, options| + # token = authenticate_to_service + # options.expires_at = token.expires_at + # token + # end + # + # pkg:gem/activesupport#lib/active_support/cache.rb:452 + def fetch(name, options = T.unsafe(nil), &block); end + + # Fetches data from the cache, using the given keys. If there is data in + # the cache with the given keys, then that data is returned. Otherwise, + # the supplied block is called for each key for which there was no data, + # and the result will be written to the cache and returned. + # Therefore, you need to pass a block that returns the data to be written + # to the cache. If you do not want to write the cache when the cache is + # not found, use #read_multi. + # + # Returns a hash with the data for each of the names. For example: + # + # cache.write("bim", "bam") + # cache.fetch_multi("bim", "unknown_key") do |key| + # "Fallback value for key: #{key}" + # end + # # => { "bim" => "bam", + # # "unknown_key" => "Fallback value for key: unknown_key" } + # + # You may also specify additional options via the +options+ argument. See #fetch for details. + # Other options are passed to the underlying cache implementation. For example: + # + # cache.fetch_multi("fizz", expires_in: 5.seconds) do |key| + # "buzz" + # end + # # => {"fizz"=>"buzz"} + # cache.read("fizz") + # # => "buzz" + # sleep(6) + # cache.read("fizz") + # # => nil + # + # pkg:gem/activesupport#lib/active_support/cache.rb:603 + def fetch_multi(*names); end + + # Increments an integer value in the cache. + # + # Options are passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:741 + def increment(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:197 + def logger; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:197 + def logger=(val); end + + # Silences the logger within a block. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:330 + def mute; end + + # Get the current namespace + # + # pkg:gem/activesupport#lib/active_support/cache.rb:800 + def namespace; end + + # Set the current namespace. Note, this will be ignored if custom + # options are passed to cache wills with a namespace key. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:806 + def namespace=(namespace); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:723 + def new_entry(value, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:200 + def options; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:198 + def raise_on_invalid_cache_expiration_time; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:198 + def raise_on_invalid_cache_expiration_time=(val); end + + # Reads data from the cache, using the given key. If there is data in + # the cache with the given key, then that data is returned. Otherwise, + # +nil+ is returned. + # + # Note, if data was written with the :expires_in or + # :version options, both of these conditions are applied before + # the data is returned. + # + # ==== Options + # + # * +:namespace+ - Replace the store namespace for this call. + # * +:version+ - Specifies a version for the cache entry. If the cached + # version does not match the requested version, the read will be treated + # as a cache miss. This feature is used to support recyclable cache keys. + # + # Other options will be handled by the specific cache store implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:506 + def read(name, options = T.unsafe(nil)); end + + # Reads a counter that was set by #increment / #decrement. + # + # cache.write_counter("foo", 1) + # cache.read_counter("foo") # => 1 + # cache.increment("foo") + # cache.read_counter("foo") # => 2 + # + # Options are passed to the underlying cache implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:762 + def read_counter(name, **options); end + + # Reads multiple values at once from the cache. Options can be passed + # in the last argument. + # + # Some cache implementation may optimize this method. + # + # Returns a hash mapping the names provided to the values found. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:544 + def read_multi(*names); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:200 + def silence; end + + # Silences the logger. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:324 + def silence!; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:201 + def silence?; end + + # Writes the value to the cache with the key. The value must be supported + # by the +coder+'s +dump+ and +load+ methods. + # + # Returns +true+ if the write succeeded, +nil+ if there was an error talking + # to the cache backend, or +false+ if the write failed for another reason. + # + # By default, cache entries larger than 1kB are compressed. Compression + # allows more data to be stored in the same memory footprint, leading to + # fewer cache evictions and higher hit rates. + # + # ==== Options + # + # * compress: false - Disables compression of the cache entry. + # + # * +:compress_threshold+ - The compression threshold, specified in bytes. + # \Cache entries larger than this threshold will be compressed. Defaults + # to +1.kilobyte+. + # + # * +:expires_in+ - Sets a relative expiration time for the cache entry, + # specified in seconds. +:expire_in+ and +:expired_in+ are aliases for + # +:expires_in+. + # + # cache = ActiveSupport::Cache::MemoryStore.new(expires_in: 5.minutes) + # cache.write(key, value, expires_in: 1.minute) # Set a lower value for one entry + # + # * +:expires_at+ - Sets an absolute expiration time for the cache entry. + # + # cache = ActiveSupport::Cache::MemoryStore.new + # cache.write(key, value, expires_at: Time.now.at_end_of_hour) + # + # * +:version+ - Specifies a version for the cache entry. When reading + # from the cache, if the cached version does not match the requested + # version, the read will be treated as a cache miss. This feature is + # used to support recyclable cache keys. + # + # * +:unless_exist+ - Prevents overwriting an existing cache entry. + # + # Other options will be handled by the specific cache store implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:672 + def write(name, value, options = T.unsafe(nil)); end + + # Writes a counter that can then be modified by #increment / #decrement. + # + # cache.write_counter("foo", 1) + # cache.read_counter("foo") # => 1 + # cache.increment("foo") + # cache.read_counter("foo") # => 2 + # + # Options are passed to the underlying cache implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:775 + def write_counter(name, value, **options); end + + # Cache Storage API to write multiple values at once. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:559 + def write_multi(hash, options = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/cache.rb:1074 + def _instrument(operation, multi: T.unsafe(nil), options: T.unsafe(nil), **payload, &block); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:811 + def default_serializer; end + + # Deletes an entry from the cache implementation. Subclasses must + # implement this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:897 + def delete_entry(key, **options); end + + # Deletes multiples entries in the cache implementation. Subclasses MAY + # implement this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:903 + def delete_multi_entries(entries, **options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:862 + def deserialize_entry(payload, **_arg1); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:984 + def expand_and_namespace_key(key, options = T.unsafe(nil)); end + + # Expands key to be a consistent string value. Invokes +cache_key+ if + # object responds to +cache_key+. Otherwise, +to_param+ method will be + # called. If the key is a Hash, then keys will be sorted alphabetically. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:1037 + def expanded_key(key); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1058 + def expanded_version(key); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1111 + def get_entry_value(entry, name, options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1095 + def handle_expired_entry(entry, key, options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:937 + def handle_invalid_expires_in(message); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1066 + def instrument(operation, key, options = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1070 + def instrument_multi(operation, keys, options = T.unsafe(nil), &block); end + + # Adds the namespace defined in the options to a pattern designed to + # match keys. Implementations that support delete_matched should call + # this method to translate a pattern that matches names into one that + # matches namespaced keys. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:826 + def key_matcher(pattern, options); end + + # Merges the default options with ones specific to a method call. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:908 + def merged_options(call_options); end + + # Prefix the key with a namespace string: + # + # namespace_key 'foo', namespace: 'cache' + # # => 'cache:foo' + # + # With a namespace block: + # + # namespace_key 'foo', namespace: -> { 'cache' } + # # => 'cache:foo' + # + # pkg:gem/activesupport#lib/active_support/cache.rb:1012 + def namespace_key(key, call_options = T.unsafe(nil)); end + + # Expands, namespaces and truncates the cache key. + # Raises an exception when the key is +nil+ or an empty string. + # May be overridden by cache stores to do additional normalization. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:979 + def normalize_key(key, options = T.unsafe(nil)); end + + # Normalize aliased options to their canonical form + # + # pkg:gem/activesupport#lib/active_support/cache.rb:948 + def normalize_options(options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1054 + def normalize_version(key, options = T.unsafe(nil)); end + + # Reads an entry from the cache implementation. Subclasses must implement + # this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:843 + def read_entry(key, **options); end + + # Reads multiple entries from the cache implementation. Subclasses MAY + # implement this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:870 + def read_multi_entries(names, **options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1116 + def save_block_result_to_cache(name, key, options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:853 + def serialize_entry(entry, **options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:991 + def truncate_key(key); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:959 + def validate_options(options); end + + # Writes an entry to the cache implementation. Subclasses must implement + # this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:849 + def write_entry(key, entry, **options); end + + # Writes multiple entries to the cache implementation. Subclasses MAY + # implement this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:889 + def write_multi_entries(hash, **options); end + + class << self + # pkg:gem/activesupport#lib/active_support/cache.rb:197 + def logger; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:197 + def logger=(val); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:198 + def raise_on_invalid_cache_expiration_time; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:198 + def raise_on_invalid_cache_expiration_time=(val); end + + private + + # pkg:gem/activesupport#lib/active_support/cache.rb:205 + def retrieve_pool_options(options); end + end +end + +# Default +ConnectionPool+ options +# +# pkg:gem/activesupport#lib/active_support/cache.rb:192 +ActiveSupport::Cache::Store::DEFAULT_POOL_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Keys are truncated with the Active Support digest if they exceed the limit. +# +# pkg:gem/activesupport#lib/active_support/cache.rb:195 +ActiveSupport::Cache::Store::MAX_KEY_SIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/cache.rb:53 +module ActiveSupport::Cache::Strategy; end + +# = Local \Cache \Strategy +# +# Caches that implement LocalCache will be backed by an in-memory cache for the +# duration of a block. Repeated calls to the cache for the same key will hit the +# in-memory cache for faster access. +# +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:13 +module ActiveSupport::Cache::Strategy::LocalCache + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:98 + def cleanup(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:92 + def clear(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:117 + def decrement(name, amount = T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:104 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:124 + def fetch_multi(*names, &block); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:110 + def increment(name, amount = T.unsafe(nil), **options); end + + # The current local cache. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:82 + def local_cache; end + + # Middleware class can be inserted as a Rack handler to be local cache for the + # duration of request. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:88 + def middleware; end + + # Set a new local cache. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:72 + def new_local_cache; end + + # Unset the current local cache. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:77 + def unset_local_cache; end + + # Use a local cache for the duration of block. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:67 + def with_local_cache(&block); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:230 + def bypass_local_cache(&block); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:211 + def delete_entry(key, **_arg1); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:226 + def local_cache_key; end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:173 + def read_multi_entries(names, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:159 + def read_serialized_entry(key, raw: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:234 + def use_temporary_local_cache(temporary_cache); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:216 + def write_cache_value(name, value, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:202 + def write_serialized_entry(key, payload, **_arg2); end +end + +# Class for storing and registering the local caches. +# +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:17 +module ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry + extend ::ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:20 + def cache_for(local_cache_key); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:25 + def set_cache_for(local_cache_key, value); end +end + +# = Local \Cache \Store +# +# Simple memory backed cache. This cache is not thread safe and is intended only +# for serving as a temporary memory cache for a single thread. +# +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:35 +class ActiveSupport::Cache::Strategy::LocalCache::LocalStore + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:36 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:40 + def clear(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:57 + def delete_entry(key); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:61 + def fetch_entry(key); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:44 + def read_entry(key); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:48 + def read_multi_entries(keys); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:52 + def write_entry(key, entry); end +end + +# -- +# This class wraps up local storage for middlewares. Only the middleware method should +# construct them. +# +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:13 +class ActiveSupport::Cache::Strategy::LocalCache::Middleware + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:17 + def initialize(name, cache); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:15 + def cache; end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:15 + def cache=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:28 + def call(env); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:14 + def name; end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:23 + def new(app); end +end + +# These options mean something to all cache implementations. Individual cache +# implementations may support additional options. +# +# pkg:gem/activesupport#lib/active_support/cache.rb:26 +ActiveSupport::Cache::UNIVERSAL_OPTIONS = T.let(T.unsafe(nil), Array) + +# Enables the dynamic configuration of Cache entry options while ensuring +# that conflicting options are not both set. When a block is given to +# ActiveSupport::Cache::Store#fetch, the second argument will be an +# instance of +WriteOptions+. +# +# pkg:gem/activesupport#lib/active_support/cache.rb:1132 +class ActiveSupport::Cache::WriteOptions + # pkg:gem/activesupport#lib/active_support/cache.rb:1133 + def initialize(options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1157 + def expires_at; end + + # Sets the Cache entry's +expires_at+ value. If an +expires_in+ option was + # previously set, this will unset it since +expires_at+ and +expires_in+ + # cannot both be set. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:1164 + def expires_at=(expires_at); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1145 + def expires_in; end + + # Sets the Cache entry's +expires_in+ value. If an +expires_at+ option was + # previously set, this will unset it since +expires_in+ and +expires_at+ + # cannot both be set. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:1152 + def expires_in=(expires_in); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1137 + def version; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1141 + def version=(version); end +end + +# = Caching Key Generator +# +# CachingKeyGenerator is a wrapper around KeyGenerator which allows users to avoid +# re-executing the key generation process when it's called using the same +salt+ and +# +key_size+. +# +# pkg:gem/activesupport#lib/active_support/key_generator.rb:55 +class ActiveSupport::CachingKeyGenerator + # pkg:gem/activesupport#lib/active_support/key_generator.rb:56 + def initialize(key_generator); end + + # Returns a derived key suitable for use. + # + # pkg:gem/activesupport#lib/active_support/key_generator.rb:62 + def generate_key(*args); end +end + +# = Active Support \Callbacks +# +# \Callbacks are code hooks that are run at key points in an object's life cycle. +# The typical use case is to have a base class define a set of callbacks +# relevant to the other functionality it supplies, so that subclasses can +# install callbacks that enhance or modify the base functionality without +# needing to override or redefine methods of the base class. +# +# Mixing in this module allows you to define the events in the object's +# life cycle that will support callbacks (via ClassMethods#define_callbacks), +# set the instance methods, procs, or callback objects to be called (via +# ClassMethods#set_callback), and run the installed callbacks at the +# appropriate times (via +run_callbacks+). +# +# By default callbacks are halted by throwing +:abort+. +# See ClassMethods#define_callbacks for details. +# +# Three kinds of callbacks are supported: before callbacks, run before a +# certain event; after callbacks, run after the event; and around callbacks, +# blocks that surround the event, triggering it when they yield. Callback code +# can be contained in instance methods, procs or lambdas, or callback objects +# that respond to certain predetermined methods. See ClassMethods#set_callback +# for details. +# +# class Record +# include ActiveSupport::Callbacks +# define_callbacks :save +# +# def save +# run_callbacks :save do +# puts "- save" +# end +# end +# end +# +# class PersonRecord < Record +# set_callback :save, :before, :saving_message +# def saving_message +# puts "saving..." +# end +# +# set_callback :save, :after do |object| +# puts "saved" +# end +# end +# +# person = PersonRecord.new +# person.save +# +# Output: +# saving... +# - save +# saved +# +# pkg:gem/activesupport#lib/active_support/callbacks.rb:65 +module ActiveSupport::Callbacks + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + + # Runs the callbacks for the given event. + # + # Calls the before and around callbacks in the order they were set, yields + # the block (if given one), and then runs the after callbacks in reverse + # order. + # + # If the callback chain was halted, returns +false+. Otherwise returns the + # result of the block, +nil+ if no callbacks have been set, or +true+ + # if callbacks have been set but no block is given. + # + # run_callbacks :save do + # save + # end + # + # -- + # + # As this method is used in many places, and often wraps large portions of + # user code, it has an additional design goal of minimizing its impact on + # the visible call stack. An exception from inside a :before or :after + # callback can be as noisy as it likes -- but when control has passed + # smoothly through and into the supplied block, we want as little evidence + # as possible that we were here. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:97 + def run_callbacks(kind, type = T.unsafe(nil)); end + + private + + # A hook invoked every time a before callback is halted. + # This can be overridden in ActiveSupport::Callbacks implementors in order + # to provide better debugging/logging. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:150 + def halted_callback_hook(filter, name); end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:73 +ActiveSupport::Callbacks::CALLBACK_FILTER_TYPES = T.let(T.unsafe(nil), Array) + +# A future invocation of user-supplied code (either as a callback, +# or a condition filter). +# +# pkg:gem/activesupport#lib/active_support/callbacks.rb:337 +module ActiveSupport::Callbacks::CallTemplate + class << self + # Filters support: + # + # Symbols:: A method to call. + # Procs:: A proc to call with the object. + # Objects:: An object with a before_foo method on it to call. + # + # All of these objects are converted into a CallTemplate and handled + # the same after this point. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:495 + def build(filter, callback); end + end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:396 +class ActiveSupport::Callbacks::CallTemplate::InstanceExec0 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:397 + def initialize(block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:401 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:411 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:405 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:418 +class ActiveSupport::Callbacks::CallTemplate::InstanceExec1 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:419 + def initialize(block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:423 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:433 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:427 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:440 +class ActiveSupport::Callbacks::CallTemplate::InstanceExec2 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:441 + def initialize(block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:445 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:457 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:450 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:338 +class ActiveSupport::Callbacks::CallTemplate::MethodCall + # pkg:gem/activesupport#lib/active_support/callbacks.rb:339 + def initialize(method); end + + # Return the parts needed to make this call, with the given + # input values. + # + # Returns an array of the form: + # + # [target, block, method, *arguments] + # + # This array can be used as such: + # + # target.send(method, *arguments, &block) + # + # The actual invocation is left up to the caller to minimize + # call stack pollution. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:356 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:366 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:360 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:373 +class ActiveSupport::Callbacks::CallTemplate::ObjectCall + # pkg:gem/activesupport#lib/active_support/callbacks.rb:374 + def initialize(target, method); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:379 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:389 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:383 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:465 +class ActiveSupport::Callbacks::CallTemplate::ProcCall + # pkg:gem/activesupport#lib/active_support/callbacks.rb:466 + def initialize(target); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:470 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:480 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:474 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:231 +class ActiveSupport::Callbacks::Callback + # pkg:gem/activesupport#lib/active_support/callbacks.rb:246 + def initialize(name, filter, kind, options, chain_config); end + + # Wraps code with filter + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:300 + def apply(callback_sequence); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:244 + def chain_config; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:282 + def compiled; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:304 + def current_scopes; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:273 + def duplicates?(other); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:244 + def filter; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:243 + def kind; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:243 + def kind=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:269 + def matches?(_kind, _filter); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:257 + def merge_conditional_options(chain, if_option:, unless_option:); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:243 + def name; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:243 + def name=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:312 + def check_conditionals(conditionals); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:327 + def conditions_lambdas; end + + class << self + # pkg:gem/activesupport#lib/active_support/callbacks.rb:232 + def build(chain, filter, kind, options); end + end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:309 +ActiveSupport::Callbacks::Callback::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:568 +class ActiveSupport::Callbacks::CallbackChain + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:573 + def initialize(name, config); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:633 + def append(*callbacks); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:601 + def clear; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:615 + def compile(type); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:571 + def config; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:595 + def delete(o); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:585 + def each(&block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:587 + def empty?; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:586 + def index(o); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:589 + def insert(index, o); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:571 + def name; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:637 + def prepend(*callbacks); end + + protected + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:642 + def chain; end + + private + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:645 + def append_one(callback); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:608 + def initialize_copy(other); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:652 + def prepend_one(callback); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:659 + def remove_duplicates(callback); end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:675 +ActiveSupport::Callbacks::CallbackChain::DEFAULT_TERMINATOR = T.let(T.unsafe(nil), ActiveSupport::Callbacks::CallbackChain::DefaultTerminator) + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:665 +class ActiveSupport::Callbacks::CallbackChain::DefaultTerminator + # pkg:gem/activesupport#lib/active_support/callbacks.rb:666 + def call(target, result_lambda); end +end + +# Execute before and after filters in a sequence instead of +# chaining them with nested lambda calls, see: +# https://github.com/rails/rails/issues/18011 +# +# pkg:gem/activesupport#lib/active_support/callbacks.rb:519 +class ActiveSupport::Callbacks::CallbackSequence + # pkg:gem/activesupport#lib/active_support/callbacks.rb:520 + def initialize(nested = T.unsafe(nil), call_template = T.unsafe(nil), user_conditions = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:535 + def after(after); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:541 + def around(call_template, user_conditions); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:529 + def before(before); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:555 + def expand_call_template(arg, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:551 + def final?; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:563 + def invoke_after(arg); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:559 + def invoke_before(arg); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:549 + def nested; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:545 + def skip?(arg); end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:678 +module ActiveSupport::Callbacks::ClassMethods + # This is used internally to append, prepend and skip callbacks to the + # CallbackChain. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:688 + def __update_callbacks(name); end + + # Define sets of events in the object life cycle that support callbacks. + # + # define_callbacks :validate + # define_callbacks :initialize, :save, :destroy + # + # ===== Options + # + # * :terminator - Determines when a before filter will halt the + # callback chain, preventing following before and around callbacks from + # being called and the event from being triggered. + # This should be a lambda to be executed. + # The current object and the result lambda of the callback will be provided + # to the terminator lambda. + # + # define_callbacks :validate, terminator: ->(target, result_lambda) { result_lambda.call == false } + # + # In this example, if any before validate callbacks returns +false+, + # any successive before and around callback is not executed. + # + # The default terminator halts the chain when a callback throws +:abort+. + # + # * :skip_after_callbacks_if_terminated - Determines if after + # callbacks should be terminated by the :terminator option. By + # default after callbacks are executed no matter if callback chain was + # terminated or not. This option has no effect if :terminator + # option is set to +nil+. + # + # * :scope - Indicates which methods should be executed when an + # object is used as a callback. + # + # class Audit + # def before(caller) + # puts 'Audit: before is called' + # end + # + # def before_save(caller) + # puts 'Audit: before_save is called' + # end + # end + # + # class Account + # include ActiveSupport::Callbacks + # + # define_callbacks :save + # set_callback :save, :before, Audit.new + # + # def save + # run_callbacks :save do + # puts 'save in main' + # end + # end + # end + # + # In the above case whenever you save an account the method + # Audit#before will be called. On the other hand + # + # define_callbacks :save, scope: [:kind, :name] + # + # would trigger Audit#before_save instead. That's constructed + # by calling #{kind}_#{name} on the given instance. In this + # case "kind" is "before" and "name" is "save". In this context +:kind+ + # and +:name+ have special meanings: +:kind+ refers to the kind of + # callback (before/after/around) and +:name+ refers to the method on + # which callbacks are being defined. + # + # A declaration like + # + # define_callbacks :save, scope: [:name] + # + # would call Audit#save. + # + # ===== Notes + # + # +names+ passed to +define_callbacks+ must not end with + # !, ? or =. + # + # Calling +define_callbacks+ multiple times with the same +names+ will + # overwrite previous callbacks registered with #set_callback. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:903 + def define_callbacks(*names); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:679 + def normalize_callback_params(filters, block); end + + # Remove all set callbacks for the given event. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:813 + def reset_callbacks(name); end + + # Install a callback for the given event. + # + # set_callback :save, :before, :before_method + # set_callback :save, :after, :after_method, if: :condition + # set_callback :save, :around, ->(r, block) { stuff; result = block.call; stuff } + # + # The second argument indicates whether the callback is to be run +:before+, + # +:after+, or +:around+ the event. If omitted, +:before+ is assumed. This + # means the first example above can also be written as: + # + # set_callback :save, :before_method + # + # The callback can be specified as a symbol naming an instance method; as a + # proc, lambda, or block; or as an object that responds to a certain method + # determined by the :scope argument to #define_callbacks. + # + # If a proc, lambda, or block is given, its body is evaluated in the context + # of the current object. It can also optionally accept the current object as + # an argument. + # + # Before and around callbacks are called in the order that they are set; + # after callbacks are called in the reverse order. + # + # Around callbacks can access the return value from the event, if it + # wasn't halted, from the +yield+ call. + # + # ===== Options + # + # * :if - A symbol or an array of symbols, each naming an instance + # method or a proc; the callback will be called only when they all return + # a true value. + # + # If a proc is given, its body is evaluated in the context of the + # current object. It can also optionally accept the current object as + # an argument. + # * :unless - A symbol or an array of symbols, each naming an + # instance method or a proc; the callback will be called only when they + # all return a false value. + # + # If a proc is given, its body is evaluated in the context of the + # current object. It can also optionally accept the current object as + # an argument. + # * :prepend - If +true+, the callback will be prepended to the + # existing chain rather than appended. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:739 + def set_callback(name, *filter_list, &block); end + + # Skip a previously set callback. Like #set_callback, :if or + # :unless options may be passed in order to control when the + # callback is skipped. + # + # Note: this example uses +PersonRecord+ and +#saving_message+, which you + # can see defined here[rdoc-ref:ActiveSupport::Callbacks] + # + # class Writer < PersonRecord + # attr_accessor :age + # skip_callback :save, :before, :saving_message, if: -> { age > 18 } + # end + # + # When if option returns true, callback is skipped. + # + # writer = Writer.new + # writer.age = 20 + # writer.save + # + # Output: + # - save + # saved + # + # When if option returns false, callback is NOT skipped. + # + # young_writer = Writer.new + # young_writer.age = 17 + # young_writer.save + # + # Output: + # saving... + # - save + # saved + # + # An ArgumentError will be raised if the callback has not + # already been set (unless the :raise option is set to false). + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:788 + def skip_callback(name, *filter_list, &block); end + + protected + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:939 + def get_callbacks(name); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:943 + def set_callbacks(name, callbacks); end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:153 +module ActiveSupport::Callbacks::Conditionals; end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:154 +class ActiveSupport::Callbacks::Conditionals::Value + # pkg:gem/activesupport#lib/active_support/callbacks.rb:155 + def initialize(&block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:158 + def call(target, value); end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:162 +module ActiveSupport::Callbacks::Filters; end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:194 +class ActiveSupport::Callbacks::Filters::After + # pkg:gem/activesupport#lib/active_support/callbacks.rb:196 + def initialize(user_callback, user_conditions, chain_config); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:214 + def apply(callback_sequence); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:202 + def call(env); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:195 + def halting; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:195 + def user_callback; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:195 + def user_conditions; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:219 +class ActiveSupport::Callbacks::Filters::Around + # pkg:gem/activesupport#lib/active_support/callbacks.rb:220 + def initialize(user_callback, user_conditions); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:225 + def apply(callback_sequence); end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:165 +class ActiveSupport::Callbacks::Filters::Before + # pkg:gem/activesupport#lib/active_support/callbacks.rb:166 + def initialize(user_callback, user_conditions, chain_config, filter, name); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:189 + def apply(callback_sequence); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:173 + def call(env); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 + def filter; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 + def halted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 + def name; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 + def user_callback; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 + def user_conditions; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:163 +class ActiveSupport::Callbacks::Filters::Environment < ::Struct + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def halted; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def halted=(_); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def target; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def target=(_); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def value; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def value=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def members; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def new(*_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/class_attribute.rb:4 +module ActiveSupport::ClassAttribute + class << self + # pkg:gem/activesupport#lib/active_support/class_attribute.rb:6 + def redefine(owner, name, namespaced_name, value); end + + # pkg:gem/activesupport#lib/active_support/class_attribute.rb:26 + def redefine_method(owner, name, private: T.unsafe(nil), &block); end + end +end + +# pkg:gem/activesupport#lib/active_support/code_generator.rb:4 +class ActiveSupport::CodeGenerator + # pkg:gem/activesupport#lib/active_support/code_generator.rb:53 + def initialize(owner, path, line); end + + # pkg:gem/activesupport#lib/active_support/code_generator.rb:61 + def class_eval; end + + # pkg:gem/activesupport#lib/active_support/code_generator.rb:65 + def define_cached_method(canonical_name, namespace:, as: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/code_generator.rb:69 + def execute; end + + class << self + # pkg:gem/activesupport#lib/active_support/code_generator.rb:41 + def batch(owner, path, line); end + end +end + +# pkg:gem/activesupport#lib/active_support/code_generator.rb:5 +class ActiveSupport::CodeGenerator::MethodSet + # pkg:gem/activesupport#lib/active_support/code_generator.rb:8 + def initialize(namespace); end + + # pkg:gem/activesupport#lib/active_support/code_generator.rb:28 + def apply(owner, path, line); end + + # pkg:gem/activesupport#lib/active_support/code_generator.rb:15 + def define_cached_method(canonical_name, as: T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/code_generator.rb:6 +ActiveSupport::CodeGenerator::MethodSet::METHOD_CACHES = T.let(T.unsafe(nil), Hash) + +# = Active Support \Concern +# +# A typical module looks like this: +# +# module M +# def self.included(base) +# base.extend ClassMethods +# base.class_eval do +# scope :disabled, -> { where(disabled: true) } +# end +# end +# +# module ClassMethods +# ... +# end +# end +# +# By using +ActiveSupport::Concern+ the above module could instead be +# written as: +# +# require "active_support/concern" +# +# module M +# extend ActiveSupport::Concern +# +# included do +# scope :disabled, -> { where(disabled: true) } +# end +# +# class_methods do +# ... +# end +# end +# +# Moreover, it gracefully handles module dependencies. Given a +Foo+ module +# and a +Bar+ module which depends on the former, we would typically write the +# following: +# +# module Foo +# def self.included(base) +# base.class_eval do +# def self.method_injected_by_foo +# ... +# end +# end +# end +# end +# +# module Bar +# def self.included(base) +# base.method_injected_by_foo +# end +# end +# +# class Host +# include Foo # We need to include this dependency for Bar +# include Bar # Bar is the module that Host really needs +# end +# +# But why should +Host+ care about +Bar+'s dependencies, namely +Foo+? We +# could try to hide these from +Host+ directly including +Foo+ in +Bar+: +# +# module Bar +# include Foo +# def self.included(base) +# base.method_injected_by_foo +# end +# end +# +# class Host +# include Bar +# end +# +# Unfortunately this won't work, since when +Foo+ is included, its base +# is the +Bar+ module, not the +Host+ class. With +ActiveSupport::Concern+, +# module dependencies are properly resolved: +# +# require "active_support/concern" +# +# module Foo +# extend ActiveSupport::Concern +# included do +# def self.method_injected_by_foo +# ... +# end +# end +# end +# +# module Bar +# extend ActiveSupport::Concern +# include Foo +# +# included do +# self.method_injected_by_foo +# end +# end +# +# class Host +# include Bar # It works, now Bar takes care of its dependencies +# end +# +# === Prepending concerns +# +# Just like include, concerns also support prepend with a corresponding +# prepended do callback. module ClassMethods or class_methods do are +# prepended as well. +# +# prepend is also used for any dependencies. +# +# pkg:gem/activesupport#lib/active_support/concern.rb:112 +module ActiveSupport::Concern + # pkg:gem/activesupport#lib/active_support/concern.rb:129 + def append_features(base); end + + # Define class methods from given block. + # You can define private class methods as well. + # + # module Example + # extend ActiveSupport::Concern + # + # class_methods do + # def foo; puts 'foo'; end + # + # private + # def bar; puts 'bar'; end + # end + # end + # + # class Buzz + # include Example + # end + # + # Buzz.foo # => "foo" + # Buzz.bar # => private method 'bar' called for Buzz:Class(NoMethodError) + # + # pkg:gem/activesupport#lib/active_support/concern.rb:209 + def class_methods(&class_methods_module_definition); end + + # Evaluate given block in context of base class, + # so that you can write class macros here. + # When you define more than one +included+ block, it raises an exception. + # + # pkg:gem/activesupport#lib/active_support/concern.rb:158 + def included(base = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/concern.rb:142 + def prepend_features(base); end + + # Evaluate given block in context of base class, + # so that you can write class macros here. + # When you define more than one +prepended+ block, it raises an exception. + # + # pkg:gem/activesupport#lib/active_support/concern.rb:175 + def prepended(base = T.unsafe(nil), &block); end + + class << self + # pkg:gem/activesupport#lib/active_support/concern.rb:125 + def extended(base); end + end +end + +# pkg:gem/activesupport#lib/active_support/concern.rb:113 +class ActiveSupport::Concern::MultipleIncludedBlocks < ::StandardError + # pkg:gem/activesupport#lib/active_support/concern.rb:114 + def initialize; end +end + +# pkg:gem/activesupport#lib/active_support/concern.rb:119 +class ActiveSupport::Concern::MultiplePrependBlocks < ::StandardError + # pkg:gem/activesupport#lib/active_support/concern.rb:120 + def initialize; end +end + +# pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:6 +module ActiveSupport::Concurrency; end + +# A share/exclusive lock, otherwise known as a read/write lock. +# +# https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock +# +# pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:10 +class ActiveSupport::Concurrency::ShareLock + include ::MonitorMixin + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:49 + def initialize; end + + # Execute the supplied block while holding the Exclusive lock. If + # +no_wait+ is set and the lock is not immediately available, + # returns +nil+ without yielding. Otherwise, returns the result of + # the block. + # + # See +start_exclusive+ for other options. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:147 + def exclusive(purpose: T.unsafe(nil), compatible: T.unsafe(nil), after_compatible: T.unsafe(nil), no_wait: T.unsafe(nil)); end + + # We track Thread objects, instead of just using counters, because + # we need exclusive locks to be reentrant, and we need to be able + # to upgrade share locks to exclusive. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:17 + def raw_state; end + + # Execute the supplied block while holding the Share lock. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:158 + def sharing; end + + # Returns false if +no_wait+ is set and the lock is not + # immediately available. Otherwise, returns true after the lock + # has been acquired. + # + # +purpose+ and +compatible+ work together; while this thread is + # waiting for the exclusive lock, it will yield its share (if any) + # to any other attempt whose +purpose+ appears in this attempt's + # +compatible+ list. This allows a "loose" upgrade, which, being + # less strict, prevents some classes of deadlocks. + # + # For many resources, loose upgrades are sufficient: if a thread + # is awaiting a lock, it is not running any other code. With + # +purpose+ matching, it is possible to yield only to other + # threads whose activity will not interfere. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:75 + def start_exclusive(purpose: T.unsafe(nil), compatible: T.unsafe(nil), no_wait: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:113 + def start_sharing; end + + # Relinquish the exclusive lock. Must only be called by the thread + # that called start_exclusive (and currently holds the lock). + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:95 + def stop_exclusive(compatible: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:130 + def stop_sharing; end + + # Temporarily give up all held Share locks while executing the + # supplied block, allowing any +compatible+ exclusive lock request + # to proceed. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:170 + def yield_shares(purpose: T.unsafe(nil), compatible: T.unsafe(nil), block_share: T.unsafe(nil)); end + + private + + # Must be called within synchronize + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:203 + def busy_for_exclusive?(purpose); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:208 + def busy_for_sharing?(purpose); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:213 + def eligible_waiters?(compatible); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:217 + def wait_for(method, &block); end +end + +# = Active Support \Configurable +# +# Configurable provides a config method to store and retrieve +# configuration options as an OrderedOptions. +# +# pkg:gem/activesupport#lib/active_support/configurable.rb:17 +module ActiveSupport::Configurable + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveSupport::Configurable::ClassMethods + + # Reads and writes attributes from a configuration OrderedOptions. + # + # require "active_support/configurable" + # + # class User + # include ActiveSupport::Configurable + # end + # + # user = User.new + # + # user.config.allowed_access = true + # user.config.level = 1 + # + # user.config.allowed_access # => true + # user.config.level # => 1 + # + # pkg:gem/activesupport#lib/active_support/configurable.rb:189 + def config; end +end + +# pkg:gem/activesupport#lib/active_support/configurable.rb:35 +module ActiveSupport::Configurable::ClassMethods + # Reads and writes attributes from a configuration OrderedOptions. + # + # require "active_support/configurable" + # + # class User + # include ActiveSupport::Configurable + # end + # + # User.config.allowed_access = true + # User.config.level = 1 + # + # User.config.allowed_access # => true + # User.config.level # => 1 + # + # pkg:gem/activesupport#lib/active_support/configurable.rb:49 + def config; end + + # Configure values from within the passed block. + # + # require "active_support/configurable" + # + # class User + # include ActiveSupport::Configurable + # end + # + # User.allowed_access # => nil + # + # User.configure do |config| + # config.allowed_access = true + # end + # + # User.allowed_access # => true + # + # pkg:gem/activesupport#lib/active_support/configurable.rb:73 + def configure; end + + private + + # Allows you to add shortcut so that you don't have to refer to attribute + # through config. Also look at the example for config to contrast. + # + # Defines both class and instance config accessors. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :allowed_access + # end + # + # User.allowed_access # => nil + # User.allowed_access = false + # User.allowed_access # => false + # + # user = User.new + # user.allowed_access # => false + # user.allowed_access = true + # user.allowed_access # => true + # + # User.allowed_access # => false + # + # The attribute name must be a valid method name in Ruby. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :"1_Badname" + # end + # # => NameError: invalid config attribute name + # + # To omit the instance writer method, pass instance_writer: false. + # To omit the instance reader method, pass instance_reader: false. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :allowed_access, instance_reader: false, instance_writer: false + # end + # + # User.allowed_access = false + # User.allowed_access # => false + # + # User.new.allowed_access = true # => NoMethodError + # User.new.allowed_access # => NoMethodError + # + # Or pass instance_accessor: false, to omit both instance methods. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :allowed_access, instance_accessor: false + # end + # + # User.allowed_access = false + # User.allowed_access # => false + # + # User.new.allowed_access = true # => NoMethodError + # User.new.allowed_access # => NoMethodError + # + # Also you can pass default or a block to set up the attribute with a default value. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :allowed_access, default: false + # config_accessor :hair_colors do + # [:brown, :black, :blonde, :red] + # end + # end + # + # User.allowed_access # => false + # User.hair_colors # => [:brown, :black, :blonde, :red] + # + # pkg:gem/activesupport#lib/active_support/configurable.rb:145 + def config_accessor(*names, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/configurable.rb:166 + def inherited(subclass); end +end + +# pkg:gem/activesupport#lib/active_support/configurable.rb:20 +class ActiveSupport::Configurable::Configuration < ::ActiveSupport::InheritableOptions + # pkg:gem/activesupport#lib/active_support/configurable.rb:21 + def compile_methods!; end + + class << self + # Compiles reader methods so we don't have to go through method_missing. + # + # pkg:gem/activesupport#lib/active_support/configurable.rb:26 + def compile_methods!(keys); end + end +end + +# Reads a YAML configuration file, evaluating any ERB, then +# parsing the resulting YAML. +# +# Warns in case of YAML confusing characters, like invisible +# non-breaking spaces. +# +# pkg:gem/activesupport#lib/active_support/configuration_file.rb:9 +class ActiveSupport::ConfigurationFile + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:12 + def initialize(content_path); end + + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:21 + def parse(context: T.unsafe(nil), **options); end + + private + + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:44 + def read(content_path); end + + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:54 + def render(context); end + + class << self + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:17 + def parse(content_path, **options); end + end +end + +# pkg:gem/activesupport#lib/active_support/configuration_file.rb:10 +class ActiveSupport::ConfigurationFile::FormatError < ::StandardError; end + +# Provides a DSL for declaring a continuous integration workflow that can be run either locally or in the cloud. +# Each step is timed, reports success/error, and is aggregated into a collective report that reports total runtime, +# as well as whether the entire run was successful or not. +# +# Example: +# +# ActiveSupport::ContinuousIntegration.run do +# step "Setup", "bin/setup --skip-server" +# step "Style: Ruby", "bin/rubocop" +# step "Security: Gem audit", "bin/bundler-audit" +# step "Tests: Rails", "bin/rails test test:system" +# +# if success? +# step "Signoff: Ready for merge and deploy", "gh signoff" +# else +# failure "Skipping signoff; CI failed.", "Fix the issues and try again." +# end +# end +# +# Starting with Rails 8.1, a default `bin/ci` and `config/ci.rb` file are created to provide out-of-the-box CI. +# +# pkg:gem/activesupport#lib/active_support/continuous_integration.rb:24 +class ActiveSupport::ContinuousIntegration + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:64 + def initialize; end + + # Echo text to the terminal in the color corresponding to the type of the text. + # + # Examples: + # + # echo "This is going to be green!", type: :success + # echo "This is going to be red!", type: :error + # + # See ActiveSupport::ContinuousIntegration::COLORS for a complete list of options. + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:111 + def echo(text, type:); end + + # Display an error heading with the title and optional subtitle to reflect that the run failed. + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:86 + def failure(title, subtitle = T.unsafe(nil)); end + + # Display a colorized heading followed by an optional subtitle. + # + # Examples: + # + # heading "Smoke Testing", "End-to-end tests verifying key functionality", padding: false + # heading "Skipping video encoding tests", "Install FFmpeg to run these tests", type: :error + # + # See ActiveSupport::ContinuousIntegration::COLORS for a complete list of options. + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:98 + def heading(heading, subtitle = T.unsafe(nil), type: T.unsafe(nil), padding: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:116 + def report(title, &block); end + + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:33 + def results; end + + # Declare a step with a title and a command. The command can either be given as a single string or as multiple + # strings that will be passed to `system` as individual arguments (and therefore correctly escaped for paths etc). + # + # Examples: + # + # step "Setup", "bin/setup" + # step "Single test", "bin/rails", "test", "--name", "test_that_is_one" + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:75 + def step(title, *command); end + + # Returns true if all steps were successful. + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:81 + def success?; end + + private + + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:141 + def colorize(text, type); end + + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:134 + def timing; end + + class << self + # Perform a CI run. Execute each step, show their results and runtime, and exit with a non-zero status if there are any failures. + # + # Pass an optional title, subtitle, and a block that declares the steps to be executed. + # + # Sets the CI environment variable to "true" to allow for conditional behavior in the app, like enabling eager loading and disabling logging. + # + # Example: + # + # ActiveSupport::ContinuousIntegration.run do + # step "Setup", "bin/setup --skip-server" + # step "Style: Ruby", "bin/rubocop" + # step "Security: Gem audit", "bin/bundler-audit" + # step "Tests: Rails", "bin/rails test test:system" + # + # if success? + # step "Signoff: Ready for merge and deploy", "gh signoff" + # else + # failure "Skipping signoff; CI failed.", "Fix the issues and try again." + # end + # end + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:55 + def run(title = T.unsafe(nil), subtitle = T.unsafe(nil), &block); end + end +end + +# pkg:gem/activesupport#lib/active_support/continuous_integration.rb:25 +ActiveSupport::ContinuousIntegration::COLORS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:6 +module ActiveSupport::CoreExt; end + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:7 +module ActiveSupport::CoreExt::ERBUtil + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:28 + def h(s); end + + # HTML escapes strings but doesn't wrap them with an ActiveSupport::SafeBuffer. + # This method is not for public consumption! Seriously! + # A utility method for escaping HTML tag characters. + # This method is also aliased as h. + # + # puts html_escape('is a > 0 & a < 10?') + # # => is a > 0 & a < 10? + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:10 + def html_escape(s); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:18 + def unwrapped_html_escape(s); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:31 +module ActiveSupport::CoreExt::ERBUtilPrivate + include ::ActiveSupport::CoreExt::ERBUtil + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:33 + def h(s); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:33 + def html_escape(s); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:33 + def unwrapped_html_escape(s); end +end + +# = Current Attributes +# +# Abstract super class that provides a thread-isolated attributes singleton, which resets automatically +# before and after each request. This allows you to keep all the per-request attributes easily +# available to the whole system. +# +# The following full app-like example demonstrates how to use a Current class to +# facilitate easy access to the global, per-request attributes without passing them deeply +# around everywhere: +# +# # app/models/current.rb +# class Current < ActiveSupport::CurrentAttributes +# attribute :account, :user +# attribute :request_id, :user_agent, :ip_address +# +# resets { Time.zone = nil } +# +# def user=(user) +# super +# self.account = user.account +# Time.zone = user.time_zone +# end +# end +# +# # app/controllers/concerns/authentication.rb +# module Authentication +# extend ActiveSupport::Concern +# +# included do +# before_action :authenticate +# end +# +# private +# def authenticate +# if authenticated_user = User.find_by(id: cookies.encrypted[:user_id]) +# Current.user = authenticated_user +# else +# redirect_to new_session_url +# end +# end +# end +# +# # app/controllers/concerns/set_current_request_details.rb +# module SetCurrentRequestDetails +# extend ActiveSupport::Concern +# +# included do +# before_action do +# Current.request_id = request.uuid +# Current.user_agent = request.user_agent +# Current.ip_address = request.ip +# end +# end +# end +# +# class ApplicationController < ActionController::Base +# include Authentication +# include SetCurrentRequestDetails +# end +# +# class MessagesController < ApplicationController +# def create +# Current.account.messages.create(message_params) +# end +# end +# +# class Message < ApplicationRecord +# belongs_to :creator, default: -> { Current.user } +# after_create { |message| Event.create(record: message) } +# end +# +# class Event < ApplicationRecord +# before_create do +# self.request_id = Current.request_id +# self.user_agent = Current.user_agent +# self.ip_address = Current.ip_address +# end +# end +# +# A word of caution: It's easy to overdo a global singleton like Current and tangle your model as a result. +# Current should only be used for a few, top-level globals, like account, user, and request details. +# The attributes stuck in Current should be used by more or less all actions on all requests. If you start +# sticking controller-specific attributes in there, you're going to create a mess. +# +# pkg:gem/activesupport#lib/active_support/current_attributes.rb:93 +class ActiveSupport::CurrentAttributes + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 + def _reset_callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 + def _run_reset_callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 + def _run_reset_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def attributes; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def attributes=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def defaults; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def defaults?; end + + # Reset all attributes. Should be called before and after actions, when used as a per-request singleton. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def reset; end + + # Expose one or more attributes within a block. Old values are returned after the block concludes. + # Example demonstrating the common use of needing to set Current attributes outside the request-cycle: + # + # class Chat::PublicationJob < ApplicationJob + # def perform(attributes, room_number, creator) + # Current.set(person: creator) do + # Chat::Publisher.publish(attributes: attributes, room_number: room_number) + # end + # end + # end + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def set(attributes, &block); end + + private + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def resolve_defaults; end + + class << self + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 + def __callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 + def _reset_callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 + def _reset_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:153 + def after_reset(*methods, &block); end + + # Declares one or more attributes that will be given both class and instance accessor methods. + # + # ==== Options + # + # * :default - The default value for the attributes. If the value + # is a proc or lambda, it will be called whenever an instance is + # constructed. Otherwise, the value will be duplicated with +#dup+. + # Default values are re-assigned when the attributes are reset. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:115 + def attribute(*names, default: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:197 + def attributes(&_arg0); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:197 + def attributes=(arg); end + + # Calls this callback before #reset is called on the instance. Used for resetting external collaborators that depend on current values. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:145 + def before_reset(*methods, &block); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:157 + def clear_all; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 + def defaults; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 + def defaults=(value); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 + def defaults?; end + + # Returns singleton instance for this class in this thread. If none exists, one is created. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:103 + def instance; end + + # Reset all attributes. Should be called before and after actions, when used as a per-request singleton. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:155 + def reset(*_arg0, **_arg1, &_arg2); end + + # Calls this callback after #reset is called on the instance. Used for resetting external collaborators, like Time.zone. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:150 + def resets(*methods, &block); end + + # Expose one or more attributes within a block. Old values are returned after the block concludes. + # Example demonstrating the common use of needing to set Current attributes outside the request-cycle: + # + # class Chat::PublicationJob < ApplicationJob + # def perform(attributes, room_number, creator) + # Current.set(person: creator) do + # Chat::Publisher.publish(attributes: attributes, room_number: room_number) + # end + # end + # end + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:155 + def set(*_arg0, **_arg1, &_arg2); end + + private + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 + def __class_attr___callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 + def __class_attr_defaults; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 + def __class_attr_defaults=(new_value); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:169 + def current_instances; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:173 + def current_instances_key; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:165 + def generated_attribute_methods; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:185 + def method_added(name); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:177 + def method_missing(name, *_arg1, **_arg2, &_arg3); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:181 + def respond_to_missing?(name, _); end + end +end + +# pkg:gem/activesupport#lib/active_support/current_attributes.rb:97 +ActiveSupport::CurrentAttributes::INVALID_ATTRIBUTE_NAMES = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/current_attributes.rb:99 +ActiveSupport::CurrentAttributes::NOT_SET = T.let(T.unsafe(nil), Object) + +# Provides +deep_merge+ and +deep_merge!+ methods. Expects the including class +# to provide a merge!(other, &block) method. +# +# pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:6 +module ActiveSupport::DeepMergeable + # Returns a new instance with the values from +other+ merged recursively. + # + # class Hash + # include ActiveSupport::DeepMergeable + # end + # + # hash_1 = { a: true, b: { c: [1, 2, 3] } } + # hash_2 = { a: false, b: { x: [3, 4, 5] } } + # + # hash_1.deep_merge(hash_2) + # # => { a: false, b: { c: [1, 2, 3], x: [3, 4, 5] } } + # + # A block can be provided to merge non-DeepMergeable values: + # + # hash_1 = { a: 100, b: 200, c: { c1: 100 } } + # hash_2 = { b: 250, c: { c1: 200 } } + # + # hash_1.deep_merge(hash_2) do |key, this_val, other_val| + # this_val + other_val + # end + # # => { a: 100, b: 450, c: { c1: 300 } } + # + # pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:29 + def deep_merge(other, &block); end + + # Same as #deep_merge, but modifies +self+. + # + # pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:34 + def deep_merge!(other, &block); end + + # Returns true if +other+ can be deep merged into +self+. Classes may + # override this method to restrict or expand the domain of deep mergeable + # values. Defaults to checking that +other+ is of type +self.class+. + # + # pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:49 + def deep_merge?(other); end +end + +# pkg:gem/activesupport#lib/active_support/delegation.rb:14 +module ActiveSupport::Delegation + class << self + # pkg:gem/activesupport#lib/active_support/delegation.rb:21 + def generate(owner, methods, location: T.unsafe(nil), to: T.unsafe(nil), prefix: T.unsafe(nil), allow_nil: T.unsafe(nil), nilable: T.unsafe(nil), private: T.unsafe(nil), as: T.unsafe(nil), signature: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/delegation.rb:150 + def generate_method_missing(owner, target, allow_nil: T.unsafe(nil)); end + end +end + +# pkg:gem/activesupport#lib/active_support/delegation.rb:18 +ActiveSupport::Delegation::RESERVED_METHOD_NAMES = T.let(T.unsafe(nil), Set) + +# pkg:gem/activesupport#lib/active_support/delegation.rb:15 +ActiveSupport::Delegation::RUBY_RESERVED_KEYWORDS = T.let(T.unsafe(nil), Array) + +# Error generated by +delegate+ when a method is called on +nil+ and +allow_nil+ +# option is not used. +# +# pkg:gem/activesupport#lib/active_support/delegation.rb:6 +class ActiveSupport::DelegationError < ::NoMethodError + class << self + # pkg:gem/activesupport#lib/active_support/delegation.rb:8 + def nil_target(method_name, target); end + end +end + +# pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:6 +module ActiveSupport::Dependencies + class << self + # pkg:gem/activesupport#lib/active_support/dependencies.rb:66 + def _autoloaded_tracked_classes; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:66 + def _autoloaded_tracked_classes=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:60 + def _eager_load_paths; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:60 + def _eager_load_paths=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:53 + def autoload_once_paths; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:53 + def autoload_once_paths=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:47 + def autoload_paths; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:47 + def autoload_paths=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:73 + def autoloader; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:73 + def autoloader=(_arg0); end + + # Private method that reloads constants autoloaded by the main autoloader. + # + # Rails.application.reloader.reload! is the public interface for application + # reload. That involves more things, like deleting unloaded classes from the + # internal state of the descendants tracker, or reloading routes. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:80 + def clear; end + + # Private method that helps configuring the autoloaders. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:98 + def eager_load?(path); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:9 + def interlock; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:9 + def interlock=(_arg0); end + + # Execute the supplied block while holding an exclusive lock, + # preventing any other thread from being inside a #run_interlock + # block at the same time. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:23 + def load_interlock(&block); end + + # Execute the supplied block without interference from any + # concurrent loads. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:16 + def run_interlock(&block); end + + # Private method used by require_dependency. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:88 + def search_for_file(relpath); end + + # Execute the supplied block while holding an exclusive lock, + # preventing any other thread from being inside a #run_interlock + # block at the same time. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:35 + def unload_interlock(&block); end + end +end + +# pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:7 +class ActiveSupport::Dependencies::Interlock + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:8 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:37 + def done_running; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:29 + def done_unloading; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:12 + def loading(&block); end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:45 + def permit_concurrent_loads(&block); end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:50 + def raw_state(&block); end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:41 + def running(&block); end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:33 + def start_running; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:25 + def start_unloading; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:21 + def unloading(&block); end +end + +# pkg:gem/activesupport#lib/active_support/dependencies/require_dependency.rb:3 +module ActiveSupport::Dependencies::RequireDependency + # Warning: This method is obsolete. The semantics of the autoloader + # match Ruby's and you do not need to be defensive with load order anymore. + # Just refer to classes and modules normally. + # + # Engines that do not control the mode in which their parent application runs + # should call +require_dependency+ where needed in case the runtime mode is + # +:classic+. + # + # pkg:gem/activesupport#lib/active_support/dependencies/require_dependency.rb:11 + def require_dependency(filename); end +end + +# = Active Support \Deprecation +# +# \Deprecation specifies the API used by \Rails to deprecate methods, instance variables, objects, and constants. It's +# also available for gems or applications. +# +# For a gem, use Deprecation.new to create a Deprecation object and store it in your module or class (in order for +# users to be able to configure it). +# +# module MyLibrary +# def self.deprecator +# @deprecator ||= ActiveSupport::Deprecation.new("2.0", "MyLibrary") +# end +# end +# +# For a Railtie or Engine, you may also want to add it to the application's deprecators, so that the application's +# configuration can be applied to it. +# +# module MyLibrary +# class Railtie < Rails::Railtie +# initializer "my_library.deprecator" do |app| +# app.deprecators[:my_library] = MyLibrary.deprecator +# end +# end +# end +# +# With the above initializer, configuration settings like the following will affect +MyLibrary.deprecator+: +# +# # in config/environments/test.rb +# config.active_support.deprecation = :raise +# +# pkg:gem/activesupport#lib/active_support/deprecation.rb:33 +class ActiveSupport::Deprecation + include ::ActiveSupport::Deprecation::Behavior + include ::ActiveSupport::Deprecation::Reporting + include ::ActiveSupport::Deprecation::Disallowed + include ::ActiveSupport::Deprecation::MethodWrapper + + # It accepts two parameters on initialization. The first is a version of library + # and the second is a library name. + # + # ActiveSupport::Deprecation.new('2.0', 'MyLibrary') + # + # pkg:gem/activesupport#lib/active_support/deprecation.rb:71 + def initialize(deprecation_horizon = T.unsafe(nil), gem_name = T.unsafe(nil)); end + + # The version number in which the deprecated behavior will be removed, by default. + # + # pkg:gem/activesupport#lib/active_support/deprecation.rb:65 + def deprecation_horizon; end + + # The version number in which the deprecated behavior will be removed, by default. + # + # pkg:gem/activesupport#lib/active_support/deprecation.rb:65 + def deprecation_horizon=(_arg0); end + + class << self + # pkg:gem/activesupport#lib/active_support/deprecation.rb:60 + def _instance; end + end +end + +# Behavior module allows to determine how to display deprecation messages. +# You can create a custom behavior or set any from the +DEFAULT_BEHAVIORS+ +# constant. Available behaviors are: +# +# [+:raise+] Raise ActiveSupport::DeprecationException. +# [+:stderr+] Log all deprecation warnings to $stderr. +# [+:log+] Log all deprecation warnings to +Rails.logger+. +# [+:notify+] Use ActiveSupport::Notifications to notify +deprecation.rails+. +# [+:report+] Use ActiveSupport::ErrorReporter to report deprecations. +# [+:silence+] Do nothing. On \Rails, set config.active_support.report_deprecations = false to disable all behaviors. +# +# Setting behaviors only affects deprecations that happen after boot time. +# For more information you can read the documentation of the #behavior= method. +# +# pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:69 +module ActiveSupport::Deprecation::Behavior + # Returns the current behavior or if one isn't set, defaults to +:stderr+. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:74 + def behavior; end + + # Sets the behavior to the specified value. Can be a single value, array, + # or an object that responds to +call+. + # + # Available behaviors: + # + # [+:raise+] Raise ActiveSupport::DeprecationException. + # [+:stderr+] Log all deprecation warnings to $stderr. + # [+:log+] Log all deprecation warnings to +Rails.logger+. + # [+:notify+] Use ActiveSupport::Notifications to notify +deprecation.rails+. + # [+:report+] Use ActiveSupport::ErrorReporter to report deprecations. + # [+:silence+] Do nothing. + # + # Setting behaviors only affects deprecations that happen after boot time. + # Deprecation warnings raised by gems are not affected by this setting + # because they happen before \Rails boots up. + # + # deprecator = ActiveSupport::Deprecation.new + # deprecator.behavior = :stderr + # deprecator.behavior = [:stderr, :log] + # deprecator.behavior = MyCustomHandler + # deprecator.behavior = ->(message, callstack, deprecation_horizon, gem_name) { + # # custom stuff + # } + # + # If you are using \Rails, you can set + # config.active_support.report_deprecations = false to disable + # all deprecation behaviors. This is similar to the +:silence+ option but + # more performant. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:111 + def behavior=(behavior); end + + # Whether to print a backtrace along with the warning. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:71 + def debug; end + + # Whether to print a backtrace along with the warning. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:71 + def debug=(_arg0); end + + # Returns the current behavior for disallowed deprecations or if one isn't set, defaults to +:raise+. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:79 + def disallowed_behavior; end + + # Sets the behavior for disallowed deprecations (those configured by + # ActiveSupport::Deprecation#disallowed_warnings=) to the specified + # value. As with #behavior=, this can be a single value, array, or an + # object that responds to +call+. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:119 + def disallowed_behavior=(behavior); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:124 + def arity_coerce(behavior); end + + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:143 + def arity_of_callable(callable); end +end + +# Default warning behaviors per Rails.env. +# +# pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:13 +ActiveSupport::Deprecation::DEFAULT_BEHAVIORS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/deprecation/constant_accessor.rb:5 +module ActiveSupport::Deprecation::DeprecatedConstantAccessor + class << self + # pkg:gem/activesupport#lib/active_support/deprecation/constant_accessor.rb:6 + def included(base); end + end +end + +# DeprecatedConstantProxy transforms a constant into a deprecated one. It takes the full names of an old +# (deprecated) constant and of a new constant (both in string form) and a deprecator. The deprecated constant now +# returns the value of the new one. +# +# PLANETS = %w(mercury venus earth mars jupiter saturn uranus neptune pluto) +# +# # (In a later update, the original implementation of `PLANETS` has been removed.) +# +# PLANETS_POST_2006 = %w(mercury venus earth mars jupiter saturn uranus neptune) +# PLANETS = ActiveSupport::Deprecation::DeprecatedConstantProxy.new("PLANETS", "PLANETS_POST_2006", ActiveSupport::Deprecation.new) +# +# PLANETS.map { |planet| planet.capitalize } +# # => DEPRECATION WARNING: PLANETS is deprecated! Use PLANETS_POST_2006 instead. +# (Backtrace information…) +# ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"] +# +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:120 +class ActiveSupport::Deprecation::DeprecatedConstantProxy < ::Module + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:128 + def initialize(old_const, new_const, deprecator, message: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:158 + def append_features(base); end + + # Returns the class of the new constant. + # + # PLANETS_POST_2006 = %w(mercury venus earth mars jupiter saturn uranus neptune) + # PLANETS = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('PLANETS', 'PLANETS_POST_2006') + # PLANETS.class # => Array + # + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:154 + def class; end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:168 + def extended(base); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:147 + def hash(*_arg0, **_arg1, &_arg2); end + + # Don't give a deprecation warning on inspect since test/unit and error + # logs rely on it for diagnostics. + # + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:141 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:147 + def instance_methods(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:147 + def name(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:163 + def prepend_features(base); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:147 + def respond_to?(*_arg0, **_arg1, &_arg2); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:178 + def const_missing(name); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:183 + def method_missing(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:174 + def target; end + + class << self + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:121 + def new(*args, **options, &block); end + end +end + +# DeprecatedInstanceVariableProxy transforms an instance variable into a deprecated one. It takes an instance of a +# class, a method on that class, an instance variable, and a deprecator as the last argument. +# +# Trying to use the deprecated instance variable will result in a deprecation warning, pointing to the method as a +# replacement. +# +# class Example +# def initialize +# @request = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(self, :request, :@request, ActiveSupport::Deprecation.new) +# @_request = :special_request +# end +# +# def request +# @_request +# end +# +# def old_request +# @request +# end +# end +# +# example = Example.new +# # => # +# +# example.old_request.to_s +# # => DEPRECATION WARNING: @request is deprecated! Call request.to_s instead of +# @request.to_s +# (Backtrace information…) +# "special_request" +# +# example.request.to_s +# # => "special_request" +# +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:87 +class ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy < ::ActiveSupport::Deprecation::DeprecationProxy + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:88 + def initialize(instance, method, var = T.unsafe(nil), deprecator:); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:96 + def target; end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:100 + def warn(callstack, called, args); end +end + +# DeprecatedObjectProxy transforms an object into a deprecated one. It takes an object, a deprecation message, and +# a deprecator. +# +# deprecated_object = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(Object.new, "This object is now deprecated", ActiveSupport::Deprecation.new) +# # => # +# +# deprecated_object.to_s +# DEPRECATION WARNING: This object is now deprecated. +# (Backtrace) +# # => "#" +# +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:38 +class ActiveSupport::Deprecation::DeprecatedObjectProxy < ::ActiveSupport::Deprecation::DeprecationProxy + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:39 + def initialize(object, message, deprecator); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:46 + def target; end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:50 + def warn(callstack, called, args); end +end + +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:5 +class ActiveSupport::Deprecation::DeprecationProxy + # Don't give a deprecation warning on inspect since test/unit and error + # logs rely on it for diagnostics. + # + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:17 + def inspect; end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:22 + def method_missing(called, *args, &block); end + + class << self + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:6 + def new(*args, **kwargs, &block); end + end +end + +# A managed collection of deprecators. Configuration methods, such as +# #behavior=, affect all deprecators in the collection. Additionally, the +# #silence method silences all deprecators in the collection for the +# duration of a given block. +# +# pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:9 +class ActiveSupport::Deprecation::Deprecators + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:10 + def initialize; end + + # Returns a deprecator added to this collection via #[]=. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:16 + def [](name); end + + # Adds a given +deprecator+ to this collection. The deprecator will be + # immediately configured with any options previously set on this + # collection. + # + # deprecators = ActiveSupport::Deprecation::Deprecators.new + # deprecators.debug = true + # + # foo_deprecator = ActiveSupport::Deprecation.new("2.0", "Foo") + # foo_deprecator.debug # => false + # + # deprecators[:foo] = foo_deprecator + # deprecators[:foo].debug # => true + # foo_deprecator.debug # => true + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:34 + def []=(name, deprecator); end + + # Sets the deprecation warning behavior for all deprecators in this + # collection. + # + # See ActiveSupport::Deprecation#behavior=. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:60 + def behavior=(behavior); end + + # Sets the debug flag for all deprecators in this collection. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:52 + def debug=(debug); end + + # Sets the disallowed deprecation warning behavior for all deprecators in + # this collection. + # + # See ActiveSupport::Deprecation#disallowed_behavior=. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:68 + def disallowed_behavior=(disallowed_behavior); end + + # Sets the disallowed deprecation warnings for all deprecators in this + # collection. + # + # See ActiveSupport::Deprecation#disallowed_warnings=. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:76 + def disallowed_warnings=(disallowed_warnings); end + + # Iterates over all deprecators in this collection. If no block is given, + # returns an +Enumerator+. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:41 + def each(&block); end + + # Silences all deprecators in this collection for the duration of the + # given block. + # + # See ActiveSupport::Deprecation#silence. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:84 + def silence(&block); end + + # Sets the silenced flag for all deprecators in this collection. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:47 + def silenced=(silenced); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:97 + def apply_options(deprecator); end + + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:92 + def set_option(name, value); end +end + +# pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:5 +module ActiveSupport::Deprecation::Disallowed + # Sets the criteria used to identify deprecation messages which should be + # disallowed. Can be an array containing strings, symbols, or regular + # expressions. (Symbols are treated as strings.) These are compared against + # the text of the generated deprecation warning. + # + # Additionally the scalar symbol +:all+ may be used to treat all + # deprecations as disallowed. + # + # Deprecations matching a substring or regular expression will be handled + # using the configured Behavior#disallowed_behavior rather than + # Behavior#behavior. + # Returns the configured criteria used to identify deprecation messages + # which should be treated as disallowed. + # + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:21 + def disallowed_warnings; end + + # Sets the criteria used to identify deprecation messages which should be + # disallowed. Can be an array containing strings, symbols, or regular + # expressions. (Symbols are treated as strings.) These are compared against + # the text of the generated deprecation warning. + # + # Additionally the scalar symbol +:all+ may be used to treat all + # deprecations as disallowed. + # + # Deprecations matching a substring or regular expression will be handled + # using the configured Behavior#disallowed_behavior rather than + # Behavior#behavior. + # Returns the configured criteria used to identify deprecation messages + # which should be treated as disallowed. + # + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:17 + def disallowed_warnings=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:26 + def deprecation_disallowed?(message); end + + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:39 + def explicitly_allowed?(message); end +end + +# pkg:gem/activesupport#lib/active_support/deprecation.rb:57 +ActiveSupport::Deprecation::MUTEX = T.let(T.unsafe(nil), Thread::Mutex) + +# pkg:gem/activesupport#lib/active_support/deprecation/method_wrappers.rb:8 +module ActiveSupport::Deprecation::MethodWrapper + # Declare that a method has been deprecated. + # + # class Fred + # def aaa; end + # def bbb; end + # def ccc; end + # def ddd; end + # def eee; end + # end + # + # deprecator = ActiveSupport::Deprecation.new('next-release', 'MyGem') + # + # deprecator.deprecate_methods(Fred, :aaa, bbb: :zzz, ccc: 'use Bar#ccc instead') + # # => Fred + # + # Fred.new.aaa + # # DEPRECATION WARNING: aaa is deprecated and will be removed from MyGem next-release. (called from irb_binding at (irb):10) + # # => nil + # + # Fred.new.bbb + # # DEPRECATION WARNING: bbb is deprecated and will be removed from MyGem next-release (use zzz instead). (called from irb_binding at (irb):11) + # # => nil + # + # Fred.new.ccc + # # DEPRECATION WARNING: ccc is deprecated and will be removed from MyGem next-release (use Bar#ccc instead). (called from irb_binding at (irb):12) + # # => nil + # + # pkg:gem/activesupport#lib/active_support/deprecation/method_wrappers.rb:35 + def deprecate_methods(target_module, *method_names); end +end + +# pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:7 +module ActiveSupport::Deprecation::Reporting + # Allow previously disallowed deprecation warnings within the block. + # allowed_warnings can be an array containing strings, symbols, or regular + # expressions. (Symbols are treated as strings). These are compared against + # the text of deprecation warning messages generated within the block. + # Matching warnings will be exempt from the rules set by + # ActiveSupport::Deprecation#disallowed_warnings. + # + # The optional if: argument accepts a truthy/falsy value or an object that + # responds to .call. If truthy, then matching warnings will be allowed. + # If falsey then the method yields to the block without allowing the warning. + # + # deprecator = ActiveSupport::Deprecation.new + # deprecator.disallowed_behavior = :raise + # deprecator.disallowed_warnings = [ + # "something broke" + # ] + # + # deprecator.warn('something broke!') + # # => ActiveSupport::DeprecationException + # + # deprecator.allow ['something broke'] do + # deprecator.warn('something broke!') + # end + # # => nil + # + # deprecator.allow ['something broke'], if: Rails.env.production? do + # deprecator.warn('something broke!') + # end + # # => ActiveSupport::DeprecationException for dev/test, nil for production + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:89 + def allow(allowed_warnings = T.unsafe(nil), if: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:48 + def begin_silence; end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:99 + def deprecation_warning(deprecated_method_name, message = T.unsafe(nil), caller_backtrace = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:52 + def end_silence; end + + # Name of gem where method is deprecated + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:11 + def gem_name; end + + # Name of gem where method is deprecated + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:11 + def gem_name=(_arg0); end + + # Silence deprecation warnings within the block. + # + # deprecator = ActiveSupport::Deprecation.new + # deprecator.warn('something broke!') + # # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)" + # + # deprecator.silence do + # deprecator.warn('something broke!') + # end + # # => nil + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:41 + def silence(&block); end + + # Whether to print a message (silent mode) + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:56 + def silenced; end + + # Whether to print a message (silent mode) + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:9 + def silenced=(_arg0); end + + # Outputs a deprecation warning to the output configured by + # ActiveSupport::Deprecation#behavior. + # + # ActiveSupport::Deprecation.new.warn('something broke!') + # # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)" + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:18 + def warn(message = T.unsafe(nil), callstack = T.unsafe(nil)); end + + private + + # Outputs a deprecation warning message + # + # deprecated_method_warning(:method_name) + # # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon}" + # deprecated_method_warning(:method_name, :another_method) + # # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon} (use another_method instead)" + # deprecated_method_warning(:method_name, "Optional message") + # # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon} (Optional message)" + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:115 + def deprecated_method_warning(method_name, message = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:129 + def deprecation_caller_message(callstack); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:124 + def deprecation_message(callstack, message = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:140 + def extract_callstack(callstack); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:157 + def ignored_callstack?(path); end +end + +# pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:154 +ActiveSupport::Deprecation::Reporting::LIB_DIR = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:152 +ActiveSupport::Deprecation::Reporting::RAILS_GEM_ROOT = T.let(T.unsafe(nil), String) + +# Raised when ActiveSupport::Deprecation::Behavior#behavior is set with :raise. +# You would set :raise, as a behavior to raise errors and proactively report exceptions from deprecations. +# +# pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:8 +class ActiveSupport::DeprecationException < ::StandardError; end + +# = Active Support Descendants Tracker +# +# This module provides an internal implementation to track descendants +# which is faster than iterating through +ObjectSpace+. +# +# However Ruby 3.1 provide a fast native +Class#subclasses+ method, +# so if you know your code won't be executed on older rubies, including +# +ActiveSupport::DescendantsTracker+ does not provide any benefit. +# +# pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:14 +module ActiveSupport::DescendantsTracker + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:107 + def descendants; end + + class << self + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:78 + def clear(classes); end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:102 + def descendants(klass); end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:69 + def disable_clear!; end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:89 + def reject!(classes); end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:98 + def subclasses(klass); end + end +end + +# pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:58 +module ActiveSupport::DescendantsTracker::ReloadedClassesFiltering + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:63 + def descendants; end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:59 + def subclasses; end +end + +# On MRI `ObjectSpace::WeakMap` keys are weak references. +# So we can simply use WeakMap as a `Set`. +# On TruffleRuby `ObjectSpace::WeakMap` keys are strong references. +# So we use `object_id` as a key and the actual object as a value. +# +# JRuby for now doesn't have Class#descendant, but when it will, it will likely +# have the same WeakMap semantic than Truffle so we future proof this as much as possible. +# +# pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:20 +class ActiveSupport::DescendantsTracker::WeakSet < ::ObjectSpace::WeakMap + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:23 + def <<(object); end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:21 + def to_a; end +end + +# pkg:gem/activesupport#lib/active_support/digest.rb:6 +class ActiveSupport::Digest + class << self + # pkg:gem/activesupport#lib/active_support/digest.rb:8 + def hash_digest_class; end + + # pkg:gem/activesupport#lib/active_support/digest.rb:12 + def hash_digest_class=(klass); end + + # pkg:gem/activesupport#lib/active_support/digest.rb:17 + def hexdigest(arg); end + end +end + +# = Active Support \Duration +# +# Provides accurate date and time measurements using Date#advance and +# Time#advance, respectively. It mainly supports the methods on Numeric. +# +# 1.month.ago # equivalent to Time.now.advance(months: -1) +# +# pkg:gem/activesupport#lib/active_support/duration.rb:14 +class ActiveSupport::Duration + # pkg:gem/activesupport#lib/active_support/duration.rb:226 + def initialize(value, parts, variable = T.unsafe(nil)); end + + # Returns the modulo of this Duration by another Duration or Numeric. + # Numeric values are treated as seconds. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:312 + def %(other); end + + # Multiplies this Duration by a Numeric and returns a new Duration. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:287 + def *(other); end + + # Adds another Duration or a Numeric to this Duration. Numeric values + # are treated as seconds. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:268 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:326 + def +@; end + + # Subtracts another Duration or a Numeric from this Duration. Numeric + # values are treated as seconds. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:282 + def -(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:322 + def -@; end + + # Divides this Duration by a Numeric and returns a new Duration. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:298 + def /(other); end + + # Compares one Duration with another or a Numeric to this Duration. + # Numeric values are treated as seconds. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:258 + def <=>(other); end + + # Returns +true+ if +other+ is also a Duration instance with the + # same +value+, or if other == value. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:341 + def ==(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:481 + def _parts; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:224 + def abs(&_arg0); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:440 + def after(time = T.unsafe(nil)); end + + # Calculates a new Time or Date that is as far in the past + # as this Duration represents. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:444 + def ago(time = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:459 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:448 + def before(time = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:245 + def coerce(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:467 + def encode_with(coder); end + + # Returns +true+ if +other+ is also a Duration instance, which has the + # same parts as this one. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:426 + def eql?(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:439 + def from_now(time = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:430 + def hash; end + + # Returns the amount of days a duration covers as a float + # + # 12.hours.in_days # => 0.5 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:399 + def in_days; end + + # Returns the amount of hours a duration covers as a float + # + # 1.day.in_hours # => 24.0 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:392 + def in_hours; end + + # Returns the amount of minutes a duration covers as a float + # + # 1.day.in_minutes # => 1440.0 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:385 + def in_minutes; end + + # Returns the amount of months a duration covers as a float + # + # 9.weeks.in_months # => 2.07 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:413 + def in_months; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:380 + def in_seconds; end + + # Returns the amount of weeks a duration covers as a float + # + # 2.months.in_weeks # => 8.696 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:406 + def in_weeks; end + + # Returns the amount of years a duration covers as a float + # + # 30.days.in_years # => 0.082 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:420 + def in_years; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:463 + def init_with(coder); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:450 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:335 + def instance_of?(klass); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:330 + def is_a?(klass); end + + # Build ISO 8601 Duration string for this duration. + # The +precision+ parameter can be used to limit seconds' precision of duration. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:473 + def iso8601(precision: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:333 + def kind_of?(klass); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:224 + def negative?(&_arg0); end + + # Returns a copy of the parts hash that defines the duration. + # + # 5.minutes.parts # => {:minutes=>5} + # 3.years.parts # => {:years=>3} + # + # pkg:gem/activesupport#lib/active_support/duration.rb:241 + def parts; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:224 + def positive?(&_arg0); end + + # Calculates a new Time or Date that is as far in the future + # as this Duration represents. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:436 + def since(time = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:224 + def to_f(&_arg0); end + + # Returns the number of seconds that this Duration represents. + # + # 1.minute.to_i # => 60 + # 1.hour.to_i # => 3600 + # 1.day.to_i # => 86400 + # + # Note that this conversion makes some assumptions about the + # duration of some periods, e.g. months are always 1/12 of year + # and years are 365.2425 days: + # + # # equivalent to (1.year / 12).to_i + # 1.month.to_i # => 2629746 + # + # # equivalent to 365.2425.days.to_i + # 1.year.to_i # => 31556952 + # + # In such cases, Ruby's core + # Date[https://docs.ruby-lang.org/en/master/Date.html] and + # Time[https://docs.ruby-lang.org/en/master/Time.html] should be used for precision + # date and time arithmetic. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:377 + def to_i; end + + # Returns the amount of seconds a duration covers as a string. + # For more information check to_i method. + # + # 1.day.to_s # => "86400" + # + # pkg:gem/activesupport#lib/active_support/duration.rb:353 + def to_s; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:447 + def until(time = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:133 + def value; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:477 + def variable?; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:224 + def zero?(&_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/duration.rb:516 + def method_missing(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:520 + def raise_type_error(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:512 + def respond_to_missing?(method, _); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:486 + def sum(sign, time = T.unsafe(nil)); end + + class << self + # pkg:gem/activesupport#lib/active_support/duration.rb:149 + def ===(other); end + + # Creates a new Duration from a seconds value that is converted + # to the individual parts: + # + # ActiveSupport::Duration.build(31556952).parts # => {:years=>1} + # ActiveSupport::Duration.build(2716146).parts # => {:months=>1, :days=>1} + # + # pkg:gem/activesupport#lib/active_support/duration.rb:189 + def build(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:167 + def days(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:163 + def hours(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:159 + def minutes(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:175 + def months(value); end + + # Creates a new Duration from string formatted according to ISO 8601 Duration. + # + # See {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601#Durations] for more information. + # This method allows negative parts to be present in pattern. + # If invalid string is provided, it will raise +ActiveSupport::Duration::ISO8601Parser::ParsingError+. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:144 + def parse(iso8601duration); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:155 + def seconds(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:171 + def weeks(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:179 + def years(value); end + + private + + # pkg:gem/activesupport#lib/active_support/duration.rb:217 + def calculate_total_seconds(parts); end + end +end + +# Parses a string formatted according to ISO 8601 Duration into the hash. +# +# See {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601#Durations] for more information. +# +# This parser allows negative parts to be present in pattern. +# +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:12 +class ActiveSupport::Duration::ISO8601Parser + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:34 + def initialize(string); end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 + def mode; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 + def mode=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:41 + def parse!; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:31 + def parts; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:31 + def scanner; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 + def sign; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 + def sign=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:83 + def finished?; end + + # Parses number which can be a float with either comma or period. + # + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:88 + def number; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:96 + def raise_parsing_error(reason = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:92 + def scan(pattern); end + + # Checks for various semantic errors as stated in ISO 8601 standard. + # + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:101 + def validate!; end +end + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:17 +ActiveSupport::Duration::ISO8601Parser::COMMA = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:22 +ActiveSupport::Duration::ISO8601Parser::DATE_COMPONENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:28 +ActiveSupport::Duration::ISO8601Parser::DATE_COMPONENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:20 +ActiveSupport::Duration::ISO8601Parser::DATE_MARKER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:25 +ActiveSupport::Duration::ISO8601Parser::DATE_TO_PART = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:16 +ActiveSupport::Duration::ISO8601Parser::PERIOD = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:15 +ActiveSupport::Duration::ISO8601Parser::PERIOD_OR_COMMA = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:13 +class ActiveSupport::Duration::ISO8601Parser::ParsingError < ::ArgumentError; end + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:19 +ActiveSupport::Duration::ISO8601Parser::SIGN_MARKER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:23 +ActiveSupport::Duration::ISO8601Parser::TIME_COMPONENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:29 +ActiveSupport::Duration::ISO8601Parser::TIME_COMPONENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:21 +ActiveSupport::Duration::ISO8601Parser::TIME_MARKER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:26 +ActiveSupport::Duration::ISO8601Parser::TIME_TO_PART = T.let(T.unsafe(nil), Hash) + +# Serializes duration to string according to ISO 8601 Duration format. +# +# pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:6 +class ActiveSupport::Duration::ISO8601Serializer + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:9 + def initialize(duration, precision: T.unsafe(nil)); end + + # Builds and returns output string. + # + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:15 + def serialize; end + + private + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:55 + def format_seconds(seconds); end + + # Return pair of duration's parts and whole duration sign. + # Parts are summarized (as they can become repetitive due to addition, etc). + # Zero parts are removed as not significant. + # + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:38 + def normalize; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:51 + def week_mixed_with_date?(parts); end +end + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:7 +ActiveSupport::Duration::ISO8601Serializer::DATE_COMPONENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/duration.rb:130 +ActiveSupport::Duration::PARTS = T.let(T.unsafe(nil), Array) + +# length of a gregorian year (365.2425 days) +# +# pkg:gem/activesupport#lib/active_support/duration.rb:120 +ActiveSupport::Duration::PARTS_IN_SECONDS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/duration.rb:115 +ActiveSupport::Duration::SECONDS_PER_DAY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:114 +ActiveSupport::Duration::SECONDS_PER_HOUR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:113 +ActiveSupport::Duration::SECONDS_PER_MINUTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:117 +ActiveSupport::Duration::SECONDS_PER_MONTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:116 +ActiveSupport::Duration::SECONDS_PER_WEEK = T.let(T.unsafe(nil), Integer) + +# 1/12 of a gregorian year +# +# pkg:gem/activesupport#lib/active_support/duration.rb:118 +ActiveSupport::Duration::SECONDS_PER_YEAR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:15 +class ActiveSupport::Duration::Scalar < ::Numeric + # pkg:gem/activesupport#lib/active_support/duration.rb:19 + def initialize(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:85 + def %(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:66 + def *(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:41 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:53 + def -(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:27 + def -@; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:77 + def /(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:31 + def <=>(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:23 + def coerce(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:17 + def to_f(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:17 + def to_i(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:17 + def to_s(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:16 + def value; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:93 + def variable?; end + + private + + # pkg:gem/activesupport#lib/active_support/duration.rb:98 + def calculate(op, other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:108 + def raise_type_error(other); end +end + +# pkg:gem/activesupport#lib/active_support/duration.rb:131 +ActiveSupport::Duration::VARIABLE_PARTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/editor.rb:6 +class ActiveSupport::Editor + # pkg:gem/activesupport#lib/active_support/editor.rb:48 + def initialize(url_pattern); end + + # pkg:gem/activesupport#lib/active_support/editor.rb:52 + def url_for(path, line); end + + class << self + # Returns the current editor pattern if it is known. + # First check for the `RAILS_EDITOR` environment variable, and if it's + # missing, check for the `EDITOR` environment variable. + # + # pkg:gem/activesupport#lib/active_support/editor.rb:28 + def current; end + + # pkg:gem/activesupport#lib/active_support/editor.rb:39 + def find(name); end + + # Registers a URL pattern for opening file in a given editor. + # This allows Rails to generate clickable links to control known editors. + # + # Example: + # + # ActiveSupport::Editor.register("myeditor", "myeditor://%s:%d") + # + # pkg:gem/activesupport#lib/active_support/editor.rb:17 + def register(name, url_pattern, aliases: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/editor.rb:43 + def reset; end + end +end + +# = Encrypted Configuration +# +# Provides convenience methods on top of EncryptedFile to access values stored +# as encrypted YAML. +# +# Values can be accessed via +Hash+ methods, such as +fetch+ and +dig+, or via +# dynamic accessor methods, similar to OrderedOptions. +# +# my_config = ActiveSupport::EncryptedConfiguration.new(...) +# my_config.read # => "some_secret: 123\nsome_namespace:\n another_secret: 456" +# +# my_config[:some_secret] +# # => 123 +# my_config.some_secret +# # => 123 +# my_config.dig(:some_namespace, :another_secret) +# # => 456 +# my_config.some_namespace.another_secret +# # => 456 +# my_config.fetch(:foo) +# # => KeyError +# my_config.foo! +# # => KeyError +# +# pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:35 +class ActiveSupport::EncryptedConfiguration < ::ActiveSupport::EncryptedFile + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:54 + def initialize(config_path:, key_path:, env_key:, raise_if_missing_key:); end + + # Returns the decrypted content as a Hash with symbolized keys. + # + # my_config = ActiveSupport::EncryptedConfiguration.new(...) + # my_config.read # => "some_secret: 123\nsome_namespace:\n another_secret: 456" + # + # my_config.config + # # => { some_secret: 123, some_namespace: { another_secret: 789 } } + # + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:85 + def config; end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:89 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:52 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # Reads the file and returns the decrypted content. See EncryptedFile#read. + # + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:62 + def read; end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:69 + def validate!; end + + private + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:94 + def deep_symbolize_keys(hash); end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:102 + def deep_transform(hash); end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:116 + def deserialize(content); end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:112 + def options; end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:52 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:36 +class ActiveSupport::EncryptedConfiguration::InvalidContentError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:37 + def initialize(content_path); end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:41 + def message; end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:46 +class ActiveSupport::EncryptedConfiguration::InvalidKeyError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:47 + def initialize(content_path, key); end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:8 +class ActiveSupport::EncryptedFile + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:42 + def initialize(content_path:, key_path:, env_key:, raise_if_missing_key:); end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:83 + def change(&block); end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:40 + def content_path; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:40 + def env_key; end + + # Returns the encryption key, first trying the environment variable + # specified by +env_key+, then trying the key file specified by +key_path+. + # If +raise_if_missing_key+ is true, raises MissingKeyError if the + # environment variable is not set and the key file does not exist. + # + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:52 + def key; end + + # Returns truthy if #key is truthy. Returns falsy otherwise. Unlike #key, + # does not raise MissingKeyError when +raise_if_missing_key+ is true. + # + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:58 + def key?; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:40 + def key_path; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:40 + def raise_if_missing_key; end + + # Reads the file and returns the decrypted content. + # + # Raises: + # - MissingKeyError if the key is missing and +raise_if_missing_key+ is true. + # - MissingContentError if the encrypted file does not exist or otherwise + # if the key is missing. + # - ActiveSupport::MessageEncryptor::InvalidMessage if the content cannot be + # decrypted or verified. + # + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:70 + def read; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:78 + def write(contents); end + + private + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:129 + def check_key_length; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:108 + def decrypt(contents); end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:103 + def encrypt(contents); end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:112 + def encryptor; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:125 + def handle_missing_key; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:117 + def read_env_key; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:121 + def read_key_file; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:89 + def writing(contents); end + + class << self + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:35 + def expected_key_length; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:31 + def generate_key; end + end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:29 +ActiveSupport::EncryptedFile::CIPHER = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:23 +class ActiveSupport::EncryptedFile::InvalidKeyLengthError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:24 + def initialize; end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:9 +class ActiveSupport::EncryptedFile::MissingContentError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:10 + def initialize(content_path); end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:15 +class ActiveSupport::EncryptedFile::MissingKeyError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:16 + def initialize(key_path:, env_key:); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:4 +module ActiveSupport::EnumerableCoreExt; end + +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:5 +module ActiveSupport::EnumerableCoreExt::Constants + private + + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:7 + def const_missing(name); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:25 +ActiveSupport::EnumerableCoreExt::SoleItemExpectedError = Enumerable::SoleItemExpectedError + +# pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:9 +class ActiveSupport::EnvironmentInquirer < ::ActiveSupport::StringInquirer + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:15 + def initialize(env); end + + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:28 + def development?; end + + # Returns true if we're in the development or test environment. + # + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:36 + def local?; end + + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:28 + def production?; end + + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:28 + def test?; end +end + +# Optimization for the three default environments, so this inquirer doesn't need to rely on +# the slower delegation through method_missing that StringInquirer would normally entail. +# +# pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:10 +ActiveSupport::EnvironmentInquirer::DEFAULT_ENVIRONMENTS = T.let(T.unsafe(nil), Array) + +# Environments that'll respond true for #local? +# +# pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:13 +ActiveSupport::EnvironmentInquirer::LOCAL_ENVIRONMENTS = T.let(T.unsafe(nil), Array) + +# = Active Support \Error Reporter +# +# +ActiveSupport::ErrorReporter+ is a common interface for error reporting services. +# +# To rescue and report any unhandled error, you can use the #handle method: +# +# Rails.error.handle do +# do_something! +# end +# +# If an error is raised, it will be reported and swallowed. +# +# Alternatively, if you want to report the error but not swallow it, you can use #record: +# +# Rails.error.record do +# do_something! +# end +# +# Both methods can be restricted to handle only a specific error class: +# +# maybe_tags = Rails.error.handle(Redis::BaseError) { redis.get("tags") } +# +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:26 +class ActiveSupport::ErrorReporter + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:35 + def initialize(*subscribers, logger: T.unsafe(nil)); end + + # Add a middleware to modify the error context before it is sent to subscribers. + # + # Middleware is added to a stack of callables run on an error's execution context + # before passing to subscribers. Allows creation of entries in error context that + # are shared by all subscribers. + # + # A context middleware receives the same parameters as #report. + # It must return a hash - the middleware stack returns the hash after it has + # run through all middlewares. A middleware can mutate or replace the hash. + # + # Rails.error.add_middleware(-> (error, context) { context.merge({ foo: :bar }) }) + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:218 + def add_middleware(middleware); end + + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:31 + def debug_mode; end + + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:31 + def debug_mode=(_arg0); end + + # Prevent a subscriber from being notified of errors for the + # duration of the block. You may pass in the subscriber itself, or its class. + # + # This can be helpful for error reporting service integrations, when they wish + # to handle any errors higher in the stack. + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:186 + def disable(subscriber); end + + # Evaluates the given block, reporting and swallowing any unhandled error. + # If no error is raised, returns the return value of the block. Otherwise, + # returns the result of +fallback.call+, or +nil+ if +fallback+ is not + # specified. + # + # # Will report a TypeError to all subscribers and return nil. + # Rails.error.handle do + # 1 + '1' + # end + # + # Can be restricted to handle only specific error classes: + # + # maybe_tags = Rails.error.handle(Redis::BaseError) { redis.get("tags") } + # + # ==== Options + # + # * +:severity+ - This value is passed along to subscribers to indicate how + # important the error report is. Can be +:error+, +:warning+, or +:info+. + # Defaults to +:warning+. + # + # * +:context+ - Extra information that is passed along to subscribers. For + # example: + # + # Rails.error.handle(context: { section: "admin" }) do + # # ... + # end + # + # * +:fallback+ - A callable that provides +handle+'s return value when an + # unhandled error is raised. For example: + # + # user = Rails.error.handle(fallback: -> { User.anonymous }) do + # User.find_by(params) + # end + # + # * +:source+ - This value is passed along to subscribers to indicate the + # source of the error. Subscribers can use this value to ignore certain + # errors. Defaults to "application". + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:79 + def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:31 + def logger; end + + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:31 + def logger=(_arg0); end + + # Evaluates the given block, reporting and re-raising any unhandled error. + # If no error is raised, returns the return value of the block. + # + # # Will report a TypeError to all subscribers and re-raise it. + # Rails.error.record do + # 1 + '1' + # end + # + # Can be restricted to handle only specific error classes: + # + # tags = Rails.error.record(Redis::BaseError) { redis.get("tags") } + # + # ==== Options + # + # * +:severity+ - This value is passed along to subscribers to indicate how + # important the error report is. Can be +:error+, +:warning+, or +:info+. + # Defaults to +:error+. + # + # * +:context+ - Extra information that is passed along to subscribers. For + # example: + # + # Rails.error.record(context: { section: "admin" }) do + # # ... + # end + # + # * +:source+ - This value is passed along to subscribers to indicate the + # source of the error. Subscribers can use this value to ignore certain + # errors. Defaults to "application". + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:115 + def record(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end + + # Report an error directly to subscribers. You can use this method when the + # block-based #handle and #record methods are not suitable. + # + # Rails.error.report(error) + # + # The +error+ argument must be an instance of Exception. + # + # Rails.error.report(Exception.new("Something went wrong")) + # + # Otherwise you can use #unexpected to report an error which does accept a + # string argument. + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:233 + def report(error, handled: T.unsafe(nil), severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end + + # Update the execution context that is accessible to error subscribers. Any + # context passed to #handle, #record, or #report will be merged with the + # context set here. + # + # Rails.error.set_context(section: "checkout", user_id: @user.id) + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:202 + def set_context(*_arg0, **_arg1, &_arg2); end + + # Register a new error subscriber. The subscriber must respond to + # + # report(Exception, handled: Boolean, severity: (:error OR :warning OR :info), context: Hash, source: String) + # + # The +report+ method should never raise an error. + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:162 + def subscribe(subscriber); end + + # Either report the given error when in production, or raise it when in development or test. + # + # When called in production, after the error is reported, this method will return + # nil and execution will continue. + # + # When called in development, the original error is wrapped in a different error class to ensure + # it's not being rescued higher in the stack and will be surfaced to the developer. + # + # This method is intended for reporting violated assertions about preconditions, or similar + # cases that can and should be gracefully handled in production, but that aren't supposed to happen. + # + # The error can be either an exception instance or a String. + # + # example: + # + # def edit + # if published? + # Rails.error.unexpected("[BUG] Attempting to edit a published article, that shouldn't be possible") + # return false + # end + # # ... + # end + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:146 + def unexpected(error, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end + + # Unregister an error subscriber. Accepts either a subscriber or a class. + # + # subscriber = MyErrorSubscriber.new + # Rails.error.subscribe(subscriber) + # + # Rails.error.unsubscribe(subscriber) + # # or + # Rails.error.unsubscribe(MyErrorSubscriber) + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:177 + def unsubscribe(subscriber); end + + private + + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:278 + def ensure_backtrace(error); end +end + +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:29 +ActiveSupport::ErrorReporter::DEFAULT_RESCUE = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:28 +ActiveSupport::ErrorReporter::DEFAULT_SOURCE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:298 +class ActiveSupport::ErrorReporter::ErrorContextMiddlewareStack + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:299 + def initialize; end + + # Run all middlewares in the stack + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:313 + def execute(error, handled:, severity:, context:, source:); end + + # Add a middleware to the error context stack. + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:304 + def use(middleware); end +end + +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:27 +ActiveSupport::ErrorReporter::SEVERITIES = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:33 +class ActiveSupport::ErrorReporter::UnexpectedError < ::Exception; end + +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:49 +class ActiveSupport::EventContext + class << self + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:65 + def clear; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:54 + def context; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:58 + def set_context(context_hash); end + end +end + +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:50 +ActiveSupport::EventContext::EMPTY_CONTEXT = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:51 +ActiveSupport::EventContext::FIBER_KEY = T.let(T.unsafe(nil), Symbol) + +# = Active Support \Event Reporter +# +# +ActiveSupport::EventReporter+ provides an interface for reporting structured events to subscribers. +# +# To report an event, you can use the +notify+ method: +# +# Rails.event.notify("user_created", { id: 123 }) +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# The +notify+ API can receive either an event name and a payload hash, or an event object. Names are coerced to strings. +# +# === Event Objects +# +# If an event object is passed to the +notify+ API, it will be passed through to subscribers as-is, and the name of the +# object's class will be used as the event name. +# +# class UserCreatedEvent +# def initialize(id:, name:) +# @id = id +# @name = name +# end +# +# def serialize +# { +# id: @id, +# name: @name +# } +# end +# end +# +# Rails.event.notify(UserCreatedEvent.new(id: 123, name: "John Doe")) +# # Emits event: +# # { +# # name: "UserCreatedEvent", +# # payload: #, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# An event is any Ruby object representing a schematized event. While payload hashes allow arbitrary, +# implicitly-structured data, event objects are intended to enforce a particular schema. +# +# Subscribers are responsible for serializing event objects. +# +# === Subscribers +# +# Subscribers must implement the +emit+ method, which will be called with the event hash. +# +# The event hash has the following keys: +# +# name: String (The name of the event) +# payload: Hash, Object (The payload of the event, or the event object itself) +# tags: Hash (The tags of the event) +# context: Hash (The context of the event) +# timestamp: Float (The timestamp of the event, in nanoseconds) +# source_location: Hash (The source location of the event, containing the filepath, lineno, and label) +# +# Subscribers are responsible for encoding events to their desired format before emitting them to their +# target destination, such as a streaming platform, a log device, or an alerting service. +# +# class JSONEventSubscriber +# def emit(event) +# json_data = JSON.generate(event) +# LogExporter.export(json_data) +# end +# end +# +# class LogSubscriber +# def emit(event) +# payload = event[:payload].map { |key, value| "#{key}=#{value}" }.join(" ") +# source_location = event[:source_location] +# log = "[#{event[:name]}] #{payload} at #{source_location[:filepath]}:#{source_location[:lineno]}" +# Rails.logger.info(log) +# end +# end +# +# Note that event objects are passed through to subscribers as-is, and may need to be serialized before being encoded: +# +# class UserCreatedEvent +# def initialize(id:, name:) +# @id = id +# @name = name +# end +# +# def serialize +# { +# id: @id, +# name: @name +# } +# end +# end +# +# class LogSubscriber +# def emit(event) +# payload = event[:payload] +# json_data = JSON.generate(payload.serialize) +# LogExporter.export(json_data) +# end +# end +# +# ==== Filtered Subscriptions +# +# Subscribers can be configured with an optional filter proc to only receive a subset of events: +# +# # Only receive events with names starting with "user." +# Rails.event.subscribe(user_subscriber) { |event| event[:name].start_with?("user.") } +# +# # Only receive events with specific payload types +# Rails.event.subscribe(audit_subscriber) { |event| event[:payload].is_a?(AuditEvent) } +# +# === Debug Events +# +# You can use the +debug+ method to report an event that will only be reported if the +# event reporter is in debug mode: +# +# Rails.event.debug("my_debug_event", { foo: "bar" }) +# +# === Tags +# +# To add additional context to an event, separate from the event payload, you can add +# tags via the +tagged+ method: +# +# Rails.event.tagged("graphql") do +# Rails.event.notify("user_created", { id: 123 }) +# end +# +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # tags: { graphql: true }, +# # context: {}, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# === Context Store +# +# You may want to attach metadata to every event emitted by the reporter. While tags +# provide domain-specific context for a series of events, context is scoped to the job / request +# and should be used for metadata associated with the execution context. +# Context can be set via the +set_context+ method: +# +# Rails.event.set_context(request_id: "abcd123", user_agent: "TestAgent") +# Rails.event.notify("user_created", { id: 123 }) +# +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # tags: {}, +# # context: { request_id: "abcd123", user_agent: "TestAgent" }, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# Context is reset automatically before and after each request. +# +# A custom context store can be configured via +config.active_support.event_reporter_context_store+. +# +# # config/application.rb +# config.active_support.event_reporter_context_store = CustomContextStore +# +# class CustomContextStore +# class << self +# def context +# # Return the context. +# end +# +# def set_context(context_hash) +# # Append context_hash to the existing context store. +# end +# +# def clear +# # Delete the stored context. +# end +# end +# end +# +# The Event Reporter standardizes on symbol keys for all payload data, tags, and context store entries. +# String keys are automatically converted to symbols for consistency. +# +# Rails.event.notify("user.created", { "id" => 123 }) +# # Emits event: +# # { +# # name: "user.created", +# # payload: { id: 123 }, +# # } +# +# === Security +# +# When reporting events, Hash-based payloads are automatically filtered to remove sensitive data based on {Rails.application.filter_parameters}[https://guides.rubyonrails.org/configuring.html#config-filter-parameters]. +# +# If an {event object}[rdoc-ref:EventReporter@Event+Objects] is given instead, subscribers will need to filter sensitive data themselves, e.g. with ActiveSupport::ParameterFilter. +# +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:271 +class ActiveSupport::EventReporter + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:286 + def initialize(*subscribers, raise_on_error: T.unsafe(nil)); end + + # Clears all context data. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:525 + def clear_context; end + + # Returns the current context data. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:530 + def context; end + + # Report an event only when in debug mode. For example: + # + # Rails.event.debug("sql.query", { sql: "SELECT * FROM users" }) + # + # ==== Arguments + # + # * +:payload+ - The event payload when using string/symbol event names. + # + # * +:caller_depth+ - The stack depth to use for source location (default: 1). + # + # * +:kwargs+ - Additional payload data when using string/symbol event names. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:435 + def debug(name_or_object, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:276 + def debug_mode=(_arg0); end + + # Check if debug mode is currently enabled. Debug mode is enabled on the reporter + # via +with_debug+, and in local environments. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:420 + def debug_mode?; end + + # Reports an event to all registered subscribers. An event name and payload can be provided: + # + # Rails.event.notify("user.created", { id: 123 }) + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: {}, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # Alternatively, an event object can be provided: + # + # Rails.event.notify(UserCreatedEvent.new(id: 123)) + # # Emits event: + # # { + # # name: "UserCreatedEvent", + # # payload: #, + # # tags: {}, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # ==== Arguments + # + # * +:payload+ - The event payload when using string/symbol event names. + # + # * +:caller_depth+ - The stack depth to use for source location (default: 1). + # + # * +:kwargs+ - Additional payload data when using string/symbol event names. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:363 + def notify(name_or_object, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # Sets whether to raise an error if a subscriber raises an error during + # event emission, or when unexpected arguments are passed to +notify+. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:274 + def raise_on_error=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:534 + def reload_payload_filter; end + + # Sets context data that will be included with all events emitted by the reporter. + # Context data should be scoped to the job or request, and is reset automatically + # before and after each request and job. + # + # Rails.event.set_context(user_agent: "TestAgent") + # Rails.event.set_context(job_id: "abc123") + # Rails.event.tagged("graphql") do + # Rails.event.notify("user_created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user_created", + # # payload: { id: 123 }, + # # tags: { graphql: true }, + # # context: { user_agent: "TestAgent", job_id: "abc123" }, + # # timestamp: 1738964843208679035 + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:520 + def set_context(context); end + + # Registers a new event subscriber. The subscriber must respond to + # + # emit(event: Hash) + # + # The event hash will have the following keys: + # + # name: String (The name of the event) + # payload: Hash, Object (The payload of the event, or the event object itself) + # tags: Hash (The tags of the event) + # context: Hash (The context of the event) + # timestamp: Float (The timestamp of the event, in nanoseconds) + # source_location: Hash (The source location of the event, containing the filepath, lineno, and label) + # + # An optional filter proc can be provided to only receive a subset of events: + # + # Rails.event.subscribe(subscriber) { |event| event[:name].start_with?("user.") } + # Rails.event.subscribe(subscriber) { |event| event[:payload].is_a?(UserEvent) } + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:311 + def subscribe(subscriber, &filter); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:278 + def subscribers; end + + # Add tags to events to supply additional context. Tags operate in a stack-oriented manner, + # so all events emitted within the block inherit the same set of tags. For example: + # + # Rails.event.tagged("graphql") do + # Rails.event.notify("user.created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { graphql: true }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # Tags can be provided as arguments or as keyword arguments, and can be nested: + # + # Rails.event.tagged("graphql") do + # # Other code here... + # Rails.event.tagged(section: "admin") do + # Rails.event.notify("user.created", { id: 123 }) + # end + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { section: "admin", graphql: true }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # The +tagged+ API can also receive a tag object: + # + # graphql_tag = GraphqlTag.new(operation_name: "user_created", operation_type: "mutation") + # Rails.event.tagged(graphql_tag) do + # Rails.event.notify("user.created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { "GraphqlTag": # }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:497 + def tagged(*args, **kwargs, &block); end + + # Unregister an event subscriber. Accepts either a subscriber or a class. + # + # subscriber = MyEventSubscriber.new + # Rails.event.subscribe(subscriber) + # + # Rails.event.unsubscribe(subscriber) + # # or + # Rails.event.unsubscribe(MyEventSubscriber) + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:326 + def unsubscribe(subscriber); end + + # Temporarily enables debug mode for the duration of the block. + # Calls to +debug+ will only be reported if debug mode is enabled. + # + # Rails.event.with_debug do + # Rails.event.debug("sql.query", { sql: "SELECT * FROM users" }) + # end + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:410 + def with_debug; end + + private + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:544 + def context_store; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:579 + def handle_unexpected_args(name_or_object, payload, kwargs); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:548 + def payload_filter; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:540 + def raise_on_error?; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:555 + def resolve_name(name_or_object); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:564 + def resolve_payload(name_or_object, payload, **kwargs); end + + class << self + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:281 + def context_store; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:281 + def context_store=(_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/execution_context.rb:4 +module ActiveSupport::ExecutionContext + class << self + # pkg:gem/activesupport#lib/active_support/execution_context.rb:76 + def []=(key, value); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:47 + def after_change(&block); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:103 + def clear; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:111 + def current_attributes_instances; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:107 + def flush; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:45 + def nestable; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:45 + def nestable=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:94 + def pop; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:85 + def push; end + + # Updates the execution context. If a block is given, it resets the provided keys to their + # previous value once the block exits. + # + # pkg:gem/activesupport#lib/active_support/execution_context.rb:53 + def set(**options); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:81 + def to_h; end + + private + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:116 + def record; end + end +end + +# pkg:gem/activesupport#lib/active_support/execution_context.rb:5 +class ActiveSupport::ExecutionContext::Record + # pkg:gem/activesupport#lib/active_support/execution_context.rb:8 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:6 + def current_attributes_instances; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:27 + def flush; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:21 + def pop; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:14 + def push; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:6 + def store; end +end + +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:7 +class ActiveSupport::ExecutionWrapper + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _complete_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _run_complete_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _run_complete_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_run_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_run_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:141 + def complete; end + + # Complete this in-flight execution. This method *must* be called + # exactly once on the result of any call to +run!+. + # + # Where possible, prefer +wrap+. + # + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:135 + def complete!; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:127 + def run; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:122 + def run!; end + + private + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:146 + def hook_state; end + + class << self + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 + def __callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _complete_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _complete_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:118 + def active?; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:114 + def active_key; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:110 + def error_reporter; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:100 + def perform; end + + # Register an object to be invoked during both the +run+ and + # +complete+ steps. + # + # +hook.complete+ will be passed the value returned from +hook.run+, + # and will only be invoked if +run+ has previously been called. + # (Mostly, this means it won't be invoked if an exception occurs in + # a preceding +to_run+ block; all ordinary +to_complete+ blocks are + # invoked in that situation.) + # + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:50 + def register_hook(hook, outer: T.unsafe(nil)); end + + # Run this execution. + # + # Returns an instance, whose +complete!+ method *must* be invoked + # after the work has been performed. + # + # Where possible, prefer +wrap+. + # + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:66 + def run!(reset: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:21 + def to_complete(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:17 + def to_run(*args, &block); end + + # Perform the work in the supplied block as an execution. + # + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:86 + def wrap(source: T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 + def __class_attr___callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 + def __class_attr___callbacks=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 +class ActiveSupport::ExecutionWrapper::CompleteHook < ::Struct + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:39 + def after(target); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:33 + def before(target); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 + def hook; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 + def hook=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 + def members; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 + def new(*_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:10 +ActiveSupport::ExecutionWrapper::Null = T.let(T.unsafe(nil), Object) + +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 +class ActiveSupport::ExecutionWrapper::RunHook < ::Struct + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:26 + def before(target); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 + def hook; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 + def hook=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 + def members; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 + def new(*_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/executor.rb:6 +class ActiveSupport::Executor < ::ActiveSupport::ExecutionWrapper; end + +# = \File Update Checker +# +# FileUpdateChecker specifies the API used by \Rails to watch files +# and control reloading. The API depends on four methods: +# +# * +initialize+ which expects two parameters and one block as +# described below. +# +# * +updated?+ which returns a boolean if there were updates in +# the filesystem or not. +# +# * +execute+ which executes the given block on initialization +# and updates the latest watched files and timestamp. +# +# * +execute_if_updated+ which just executes the block if it was updated. +# +# After initialization, a call to +execute_if_updated+ must execute +# the block only if there was really a change in the filesystem. +# +# This class is used by \Rails to reload the I18n framework whenever +# they are changed upon a new request. +# +# i18n_reloader = ActiveSupport::FileUpdateChecker.new(paths) do +# I18n.reload! +# end +# +# ActiveSupport::Reloader.to_prepare do +# i18n_reloader.execute_if_updated +# end +# +# pkg:gem/activesupport#lib/active_support/file_update_checker.rb:35 +class ActiveSupport::FileUpdateChecker + # It accepts two parameters on initialization. The first is an array + # of files and the second is an optional hash of directories. The hash must + # have directories as keys and the value is an array of extensions to be + # watched under that directory. + # + # This method must also receive a block that will be called once a path + # changes. The array of files and list of directories cannot be changed + # after FileUpdateChecker has been initialized. + # + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:44 + def initialize(files, dirs = T.unsafe(nil), &block); end + + # Executes the given block and updates the latest watched files and + # timestamp. + # + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:85 + def execute; end + + # Execute the block given if updated. + # + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:95 + def execute_if_updated; end + + # Check if any of the entries were updated. If so, the watched and/or + # updated_at values are cached until the block is executed via +execute+ + # or +execute_if_updated+. + # + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:66 + def updated?; end + + private + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:160 + def compile_ext(array); end + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:147 + def compile_glob(hash); end + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:156 + def escape(key); end + + # This method returns the maximum mtime of the files in +paths+, or +nil+ + # if the array is empty. + # + # Files with a mtime in the future are ignored. Such abnormal situation + # can happen for example if the user changes the clock by hand. It is + # healthy to consider this edge case because with mtimes in the future + # reloading is not triggered. + # + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:125 + def max_mtime(paths); end + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:114 + def updated_at(paths); end + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:106 + def watched; end +end + +# pkg:gem/activesupport#lib/active_support/fork_tracker.rb:4 +module ActiveSupport::ForkTracker + class << self + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:31 + def after_fork(&block); end + + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:19 + def after_fork_callback; end + + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:27 + def hook!; end + + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:36 + def unregister(callback); end + end +end + +# pkg:gem/activesupport#lib/active_support/fork_tracker.rb:5 +module ActiveSupport::ForkTracker::CoreExt + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:6 + def _fork; end +end + +# = Active Support \Gzip +# +# A convenient wrapper for the zlib standard library that allows +# compression/decompression of strings with gzip. +# +# gzip = ActiveSupport::Gzip.compress('compress me!') +# # => "\x1F\x8B\b\x00o\x8D\xCDO\x00\x03K\xCE\xCF-(J-.V\xC8MU\x04\x00R>n\x83\f\x00\x00\x00" +# +# ActiveSupport::Gzip.decompress(gzip) +# # => "compress me!" +# +# pkg:gem/activesupport#lib/active_support/gzip.rb:17 +module ActiveSupport::Gzip + class << self + # Compresses a string using gzip. + # + # pkg:gem/activesupport#lib/active_support/gzip.rb:32 + def compress(source, level = T.unsafe(nil), strategy = T.unsafe(nil)); end + + # Decompresses a gzipped string. + # + # pkg:gem/activesupport#lib/active_support/gzip.rb:27 + def decompress(source); end + end +end + +# pkg:gem/activesupport#lib/active_support/gzip.rb:18 +class ActiveSupport::Gzip::Stream < ::StringIO + # pkg:gem/activesupport#lib/active_support/gzip.rb:19 + def initialize(*_arg0); end + + # pkg:gem/activesupport#lib/active_support/gzip.rb:23 + def close; end +end + +# = \Hash With Indifferent Access +# +# Implements a hash where keys :foo and "foo" are considered +# to be the same. +# +# rgb = ActiveSupport::HashWithIndifferentAccess.new +# +# rgb[:black] = '#000000' +# rgb[:black] # => '#000000' +# rgb['black'] # => '#000000' +# +# rgb['white'] = '#FFFFFF' +# rgb[:white] # => '#FFFFFF' +# rgb['white'] # => '#FFFFFF' +# +# Internally symbols are mapped to strings when used as keys in the entire +# writing interface (calling []=, merge, etc). This +# mapping belongs to the public interface. For example, given: +# +# hash = ActiveSupport::HashWithIndifferentAccess.new(a: 1) +# +# You are guaranteed that the key is returned as a string: +# +# hash.keys # => ["a"] +# +# Technically other types of keys are accepted: +# +# hash = ActiveSupport::HashWithIndifferentAccess.new(a: 1) +# hash[0] = 0 +# hash # => {"a"=>1, 0=>0} +# +# but this class is intended for use cases where strings or symbols are the +# expected keys and it is convenient to understand both as the same. For +# example the +params+ hash in Ruby on \Rails. +# +# Note that core extensions define Hash#with_indifferent_access: +# +# rgb = { black: '#000000', white: '#FFFFFF' }.with_indifferent_access +# +# which may be handy. +# +# To access this class outside of \Rails, require the core extension with: +# +# require "active_support/core_ext/hash/indifferent_access" +# +# which will, in turn, require this file. +# +# pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:55 +class ActiveSupport::HashWithIndifferentAccess < ::Hash + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:70 + def initialize(constructor = T.unsafe(nil)); end + + # Same as Hash#[] where the key passed as argument can be + # either a string or a symbol: + # + # counters = ActiveSupport::HashWithIndifferentAccess.new + # counters[:foo] = 1 + # + # counters['foo'] # => 1 + # counters[:foo] # => 1 + # counters[:zoo] # => nil + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:184 + def [](key); end + + # Assigns a new value to the hash: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash[:key] = 'value' + # + # This value can be later fetched using either +:key+ or 'key'. + # + # If the value is a Hash or contains one or multiple Hashes, they will be + # converted to +HashWithIndifferentAccess+. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:101 + def []=(key, value); end + + # Same as Hash#assoc where the key passed as argument can be + # either a string or a symbol: + # + # counters = ActiveSupport::HashWithIndifferentAccess.new + # counters[:foo] = 1 + # + # counters.assoc('foo') # => ["foo", 1] + # counters.assoc(:foo) # => ["foo", 1] + # counters.assoc(:zoo) # => nil + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:197 + def assoc(key); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:390 + def compact; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:334 + def deep_symbolize_keys; end + + # Same as Hash#default where the key passed as argument can be + # either a string or a symbol: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new(1) + # hash.default # => 1 + # + # hash = ActiveSupport::HashWithIndifferentAccess.new { |hash, key| key } + # hash.default # => nil + # hash.default('foo') # => 'foo' + # hash.default(:foo) # => 'foo' + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:239 + def default(key = T.unsafe(nil)); end + + # Removes the specified key from the hash. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:317 + def delete(key); end + + # Same as Hash#dig where the key passed as argument can be + # either a string or a symbol: + # + # counters = ActiveSupport::HashWithIndifferentAccess.new + # counters[:foo] = { bar: 1 } + # + # counters.dig('foo', 'bar') # => 1 + # counters.dig(:foo, :bar) # => 1 + # counters.dig(:zoo) # => nil + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:224 + def dig(*args); end + + # Returns a shallow copy of the hash. + # + # hash = ActiveSupport::HashWithIndifferentAccess.new({ a: { b: 'b' } }) + # dup = hash.dup + # dup[:a][:c] = 'c' + # + # hash[:a][:c] # => "c" + # dup[:a][:c] # => "c" + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:280 + def dup; end + + # Returns a hash with indifferent access that includes everything except given keys. + # hash = { a: "x", b: "y", c: 10 }.with_indifferent_access + # hash.except(:a, "b") # => {c: 10}.with_indifferent_access + # hash # => { a: "x", b: "y", c: 10 }.with_indifferent_access + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:325 + def except(*keys); end + + # Returns +true+ so that Array#extract_options! finds members of + # this class. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:58 + def extractable_options?; end + + # Same as Hash#fetch where the key passed as argument can be + # either a string or a symbol: + # + # counters = ActiveSupport::HashWithIndifferentAccess.new + # counters[:foo] = 1 + # + # counters.fetch('foo') # => 1 + # counters.fetch(:bar, 0) # => 0 + # counters.fetch(:bar) { |key| 0 } # => 0 + # counters.fetch(:zoo) # => KeyError: key not found: "zoo" + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:211 + def fetch(key, *extras); end + + # Returns an array of the values at the specified indices, but also + # raises an exception when one of the keys can't be found. + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash[:a] = 'x' + # hash[:b] = 'y' + # hash.fetch_values('a', 'b') # => ["x", "y"] + # hash.fetch_values('a', 'c') { |key| 'z' } # => ["x", "z"] + # hash.fetch_values('a', 'c') # => KeyError: key not found: "c" + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:267 + def fetch_values(*indices, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:172 + def has_key?(key); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:171 + def include?(key); end + + # Checks the hash for a key matching the argument passed in: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash['key'] = 'value' + # hash.key?(:key) # => true + # hash.key?('key') # => true + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:167 + def key?(key); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:173 + def member?(key); end + + # This method has the same semantics of +update+, except it does not + # modify the receiver but rather returns a new hash with indifferent + # access with the result of the merge. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:287 + def merge(*hashes, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:159 + def merge!(*other_hashes, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:66 + def nested_under_indifferent_access; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:90 + def regular_update(*_arg0); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:89 + def regular_writer(_arg0, _arg1); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:342 + def reject(*args, &block); end + + # Replaces the contents of this hash with other_hash. + # + # h = { "a" => 100, "b" => 200 } + # h.replace({ "c" => 300, "d" => 400 }) # => {"c"=>300, "d"=>400} + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:312 + def replace(other_hash); end + + # Like +merge+ but the other way around: Merges the receiver into the + # argument and returns a new hash with indifferent access as result: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash['a'] = nil + # hash.reverse_merge(a: 0, b: 1) # => {"a"=>nil, "b"=>1} + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:297 + def reverse_merge(other_hash); end + + # Same semantics as +reverse_merge+ but modifies the receiver in-place. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:303 + def reverse_merge!(other_hash); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:337 + def select(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:380 + def slice(*keys); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:385 + def slice!(*keys); end + + # Assigns a new value to the hash: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash[:key] = 'value' + # + # This value can be later fetched using either +:key+ or 'key'. + # + # If the value is a Hash or contains one or multiple Hashes, they will be + # converted to +HashWithIndifferentAccess+. unless `convert_value: false` + # is set. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:115 + def store(key, value, convert_value: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:332 + def symbolize_keys; end + + # Convert to a regular hash with string keys. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:395 + def to_hash; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:333 + def to_options; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:335 + def to_options!; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:401 + def to_proc; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:354 + def transform_keys(hash = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:366 + def transform_keys!(hash = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:347 + def transform_values(&block); end + + # Updates the receiver in-place, merging in the hashes passed as arguments: + # + # hash_1 = ActiveSupport::HashWithIndifferentAccess.new + # hash_1[:key] = 'value' + # + # hash_2 = ActiveSupport::HashWithIndifferentAccess.new + # hash_2[:key] = 'New Value!' + # + # hash_1.update(hash_2) # => {"key"=>"New Value!"} + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash.update({ "a" => 1 }, { "b" => 2 }) # => { "a" => 1, "b" => 2 } + # + # The arguments can be either an + # +ActiveSupport::HashWithIndifferentAccess+ or a regular +Hash+. + # In either case the merge respects the semantics of indifferent access. + # + # If the argument is a regular hash with keys +:key+ and "key" only one + # of the values end up in the receiver, but which one is unspecified. + # + # When given a block, the value for duplicated keys will be determined + # by the result of invoking the block with the duplicated key, the value + # in the receiver, and the value in +other_hash+. The rules for duplicated + # keys follow the semantics of indifferent access: + # + # hash_1[:key] = 10 + # hash_2['key'] = 12 + # hash_1.update(hash_2) { |key, old, new| old + new } # => {"key"=>22} + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:148 + def update(*other_hashes, &block); end + + # Returns an array of the values at the specified indices: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash[:a] = 'x' + # hash[:b] = 'y' + # hash.values_at('a', 'b') # => ["x", "y"] + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:253 + def values_at(*keys); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:300 + def with_defaults(other_hash); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:306 + def with_defaults!(other_hash); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:62 + def with_indifferent_access; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:328 + def without(*keys); end + + private + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:406 + def cast(other); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:410 + def convert_key(key); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:414 + def convert_value(value, conversion: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:427 + def convert_value_to_hash(value); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:438 + def copy_defaults(target); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:447 + def update_with_single_argument(other_hash, block); end + + class << self + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:85 + def [](*args); end + end +end + +# pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:352 +ActiveSupport::HashWithIndifferentAccess::NOT_GIVEN = T.let(T.unsafe(nil), Object) + +# pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:4 +module ActiveSupport::HtmlSafeTranslation + extend ::ActiveSupport::HtmlSafeTranslation + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:30 + def html_safe_translation_key?(key); end + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:7 + def translate(key, **options); end + + private + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:35 + def html_escape_translation_options(options); end + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:48 + def html_safe_translation(translation); end + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:43 + def i18n_option?(name); end +end + +# = Active Support \Inflector +# +# The Inflector transforms words from singular to plural, class names to table +# names, modularized class names to ones without, and class names to foreign +# keys. The default inflections for pluralization, singularization, and +# uncountable words are kept in inflections.rb. +# +# The \Rails core team has stated patches for the inflections library will not +# be accepted in order to avoid breaking legacy applications which may be +# relying on errant inflections. If you discover an incorrect inflection and +# require it for your application or wish to define rules for languages other +# than English, please correct or add them yourself (explained below). +# +# pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:8 +module ActiveSupport::Inflector + extend ::ActiveSupport::Inflector + + # Converts strings to UpperCamelCase. + # If the +uppercase_first_letter+ parameter is set to false, then produces + # lowerCamelCase. + # + # Also converts '/' to '::' which is useful for converting + # paths to namespaces. + # + # camelize('active_model') # => "ActiveModel" + # camelize('active_model', false) # => "activeModel" + # camelize('active_model/errors') # => "ActiveModel::Errors" + # camelize('active_model/errors', false) # => "activeModel::Errors" + # + # As a rule of thumb you can think of +camelize+ as the inverse of + # #underscore, though there are cases where that does not hold: + # + # camelize(underscore('SSLError')) # => "SslError" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:70 + def camelize(term, uppercase_first_letter = T.unsafe(nil)); end + + # Creates a class name from a plural table name like \Rails does for table + # names to models. Note that this returns a string and not a Class. (To + # convert to an actual class follow +classify+ with #constantize.) + # + # classify('ham_and_eggs') # => "HamAndEgg" + # classify('posts') # => "Post" + # + # Singular names are not handled correctly: + # + # classify('calculus') # => "Calculu" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:218 + def classify(table_name); end + + # Tries to find a constant with the name specified in the argument string. + # + # constantize('Module') # => Module + # constantize('Foo::Bar') # => Foo::Bar + # + # The name is assumed to be the one of a top-level constant, no matter + # whether it starts with "::" or not. No lexical context is taken into + # account: + # + # C = 'outside' + # module M + # C = 'inside' + # C # => 'inside' + # constantize('C') # => 'outside', same as ::C + # end + # + # NameError is raised when the name is not in CamelCase or the constant is + # unknown. + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:289 + def constantize(camel_cased_word); end + + # Replaces underscores with dashes in the string. + # + # dasherize('puni_puni') # => "puni-puni" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:226 + def dasherize(underscored_word); end + + # Removes the rightmost segment from the constant expression in the string. + # + # deconstantize('Net::HTTP') # => "Net" + # deconstantize('::Net::HTTP') # => "::Net" + # deconstantize('String') # => "" + # deconstantize('::String') # => "" + # deconstantize('') # => "" + # + # See also #demodulize. + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:256 + def deconstantize(path); end + + # Removes the module part from the expression in the string. + # + # demodulize('ActiveSupport::Inflector::Inflections') # => "Inflections" + # demodulize('Inflections') # => "Inflections" + # demodulize('::Inflections') # => "Inflections" + # demodulize('') # => "" + # + # See also #deconstantize. + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:238 + def demodulize(path); end + + # Converts the first character in the string to lowercase. + # + # downcase_first('If they enjoyed The Matrix') # => "if they enjoyed The Matrix" + # downcase_first('I') # => "i" + # downcase_first('') # => "" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:175 + def downcase_first(string); end + + # Creates a foreign key name from a class name. + # +separate_class_name_and_id_with_underscore+ sets whether + # the method should put '_' between the name and 'id'. + # + # foreign_key('Message') # => "message_id" + # foreign_key('Message', false) # => "messageid" + # foreign_key('Admin::Post') # => "post_id" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:267 + def foreign_key(class_name, separate_class_name_and_id_with_underscore = T.unsafe(nil)); end + + # Tweaks an attribute name for display to end users. + # + # Specifically, performs these transformations: + # + # * Applies human inflection rules to the argument. + # * Deletes leading underscores, if any. + # * Removes an "_id" suffix if present. + # * Replaces underscores with spaces, if any. + # * Downcases all words except acronyms. + # * Capitalizes the first word. + # The capitalization of the first word can be turned off by setting the + # +:capitalize+ option to false (default is true). + # + # The trailing '_id' can be kept by setting the + # optional parameter +keep_id_suffix+ to true (default is false). + # + # humanize('employee_salary') # => "Employee salary" + # humanize('author_id') # => "Author" + # humanize('author_id', capitalize: false) # => "author" + # humanize('_id') # => "Id" + # humanize('author_id', keep_id_suffix: true) # => "Author id" + # + # If "SSL" was defined to be an acronym: + # + # humanize('ssl_error') # => "SSL error" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:135 + def humanize(lower_case_and_underscored_word, capitalize: T.unsafe(nil), keep_id_suffix: T.unsafe(nil)); end + + # Yields a singleton instance of Inflector::Inflections so you can specify + # additional inflector rules. If passed an optional locale, rules for other + # languages can be specified. If not specified, defaults to :en. + # Only rules for English are provided. + # + # ActiveSupport::Inflector.inflections(:en) do |inflect| + # inflect.uncountable 'rails' + # end + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:283 + def inflections(locale = T.unsafe(nil)); end + + # Returns the suffix that should be added to a number to denote the position + # in an ordered sequence such as 1st, 2nd, 3rd, 4th. + # + # ordinal(1) # => "st" + # ordinal(2) # => "nd" + # ordinal(1002) # => "nd" + # ordinal(1003) # => "rd" + # ordinal(-11) # => "th" + # ordinal(-1021) # => "st" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:334 + def ordinal(number); end + + # Turns a number into an ordinal string used to denote the position in an + # ordered sequence such as 1st, 2nd, 3rd, 4th. + # + # ordinalize(1) # => "1st" + # ordinalize(2) # => "2nd" + # ordinalize(1002) # => "1002nd" + # ordinalize(1003) # => "1003rd" + # ordinalize(-11) # => "-11th" + # ordinalize(-1021) # => "-1021st" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:347 + def ordinalize(number); end + + # Replaces special characters in a string so that it may be used as part of + # a 'pretty' URL. + # + # parameterize("Donald E. Knuth") # => "donald-e-knuth" + # parameterize("^très|Jolie-- ") # => "tres-jolie" + # + # To use a custom separator, override the +separator+ argument. + # + # parameterize("Donald E. Knuth", separator: '_') # => "donald_e_knuth" + # parameterize("^très|Jolie__ ", separator: '_') # => "tres_jolie" + # + # To preserve the case of the characters in a string, use the +preserve_case+ argument. + # + # parameterize("Donald E. Knuth", preserve_case: true) # => "Donald-E-Knuth" + # parameterize("^très|Jolie-- ", preserve_case: true) # => "tres-Jolie" + # + # It preserves dashes and underscores unless they are used as separators: + # + # parameterize("^très|Jolie__ ") # => "tres-jolie__" + # parameterize("^très|Jolie-- ", separator: "_") # => "tres_jolie--" + # parameterize("^très_Jolie-- ", separator: ".") # => "tres_jolie--" + # + # If the optional parameter +locale+ is specified, + # the word will be parameterized as a word of that language. + # By default, this parameter is set to nil and it will use + # the configured I18n.locale. + # + # pkg:gem/activesupport#lib/active_support/inflector/transliterate.rb:123 + def parameterize(string, separator: T.unsafe(nil), preserve_case: T.unsafe(nil), locale: T.unsafe(nil)); end + + # Returns the plural form of the word in the string. + # + # If passed an optional +locale+ parameter, the word will be + # pluralized using rules defined for that language. By default, + # this parameter is set to :en. + # + # pluralize('post') # => "posts" + # pluralize('octopus') # => "octopi" + # pluralize('sheep') # => "sheep" + # pluralize('words') # => "words" + # pluralize('CamelOctopus') # => "CamelOctopi" + # pluralize('ley', :es) # => "leyes" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:33 + def pluralize(word, locale = T.unsafe(nil)); end + + # Tries to find a constant with the name specified in the argument string. + # + # safe_constantize('Module') # => Module + # safe_constantize('Foo::Bar') # => Foo::Bar + # + # The name is assumed to be the one of a top-level constant, no matter + # whether it starts with "::" or not. No lexical context is taken into + # account: + # + # C = 'outside' + # module M + # C = 'inside' + # C # => 'inside' + # safe_constantize('C') # => 'outside', same as ::C + # end + # + # +nil+ is returned when the name is not in CamelCase or the constant (or + # part of it) is unknown. + # + # safe_constantize('blargle') # => nil + # safe_constantize('UnknownModule') # => nil + # safe_constantize('UnknownModule::Foo::Bar') # => nil + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:315 + def safe_constantize(camel_cased_word); end + + # The reverse of #pluralize, returns the singular form of a word in a + # string. + # + # If passed an optional +locale+ parameter, the word will be + # singularized using rules defined for that language. By default, + # this parameter is set to :en. + # + # singularize('posts') # => "post" + # singularize('octopi') # => "octopus" + # singularize('sheep') # => "sheep" + # singularize('word') # => "word" + # singularize('CamelOctopi') # => "CamelOctopus" + # singularize('leyes', :es) # => "ley" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:50 + def singularize(word, locale = T.unsafe(nil)); end + + # Creates the name of a table like \Rails does for models to table names. + # This method uses the #pluralize method on the last word in the string. + # + # tableize('RawScaledScorer') # => "raw_scaled_scorers" + # tableize('ham_and_egg') # => "ham_and_eggs" + # tableize('fancyCategory') # => "fancy_categories" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:204 + def tableize(class_name); end + + # Capitalizes all the words and replaces some characters in the string to + # create a nicer looking title. +titleize+ is meant for creating pretty + # output. It is not used in the \Rails internals. + # + # The trailing '_id','Id'.. can be kept and capitalized by setting the + # optional parameter +keep_id_suffix+ to true. + # By default, this parameter is false. + # + # titleize('man from the boondocks') # => "Man From The Boondocks" + # titleize('x-men: the last stand') # => "X Men: The Last Stand" + # titleize('TheManWithoutAPast') # => "The Man Without A Past" + # titleize('raiders_of_the_lost_ark') # => "Raiders Of The Lost Ark" + # titleize('string_ending_with_id', keep_id_suffix: true) # => "String Ending With Id" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:192 + def titleize(word, keep_id_suffix: T.unsafe(nil)); end + + # Replaces non-ASCII characters with an ASCII approximation, or if none + # exists, a replacement character which defaults to "?". + # + # transliterate('Ærøskøbing') + # # => "AEroskobing" + # + # Default approximations are provided for Western/Latin characters, + # e.g, "ø", "ñ", "é", "ß", etc. + # + # This method is I18n aware, so you can set up custom approximations for a + # locale. This can be useful, for example, to transliterate German's "ü" + # and "ö" to "ue" and "oe", or to add support for transliterating Russian + # to ASCII. + # + # In order to make your custom transliterations available, you must set + # them as the i18n.transliterate.rule i18n key: + # + # # Store the transliterations in locales/de.yml + # i18n: + # transliterate: + # rule: + # ü: "ue" + # ö: "oe" + # + # # Or set them using Ruby + # I18n.backend.store_translations(:de, i18n: { + # transliterate: { + # rule: { + # 'ü' => 'ue', + # 'ö' => 'oe' + # } + # } + # }) + # + # The value for i18n.transliterate.rule can be a simple Hash that + # maps characters to ASCII approximations as shown above, or, for more + # complex requirements, a Proc: + # + # I18n.backend.store_translations(:de, i18n: { + # transliterate: { + # rule: ->(string) { MyTransliterator.transliterate(string) } + # } + # }) + # + # Now you can have different transliterations for each locale: + # + # transliterate('Jürgen', locale: :en) + # # => "Jurgen" + # + # transliterate('Jürgen', locale: :de) + # # => "Juergen" + # + # Transliteration is restricted to UTF-8, US-ASCII, and GB18030 strings. + # Other encodings will raise an ArgumentError. + # + # pkg:gem/activesupport#lib/active_support/inflector/transliterate.rb:64 + def transliterate(string, replacement = T.unsafe(nil), locale: T.unsafe(nil)); end + + # Makes an underscored, lowercase form from the expression in the string. + # + # Changes '::' to '/' to convert namespaces to paths. + # + # underscore('ActiveModel') # => "active_model" + # underscore('ActiveModel::Errors') # => "active_model/errors" + # + # As a rule of thumb you can think of +underscore+ as the inverse of + # #camelize, though there are cases where that does not hold: + # + # camelize(underscore('SSLError')) # => "SslError" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:99 + def underscore(camel_cased_word); end + + # Converts the first character in the string to uppercase. + # + # upcase_first('what a Lovely Day') # => "What a Lovely Day" + # upcase_first('w') # => "W" + # upcase_first('') # => "" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:166 + def upcase_first(string); end + + private + + # Applies inflection rules for +singularize+ and +pluralize+. + # + # If passed an optional +locale+ parameter, the uncountables will be + # found for that locale. + # + # apply_inflections('post', inflections.plurals, :en) # => "posts" + # apply_inflections('posts', inflections.singulars, :en) # => "post" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:376 + def apply_inflections(word, rules, locale = T.unsafe(nil)); end + + # Mounts a regular expression, returned as a string to ease interpolation, + # that will match part by part the given constant. + # + # const_regexp("Foo::Bar::Baz") # => "Foo(::Bar(::Baz)?)?" + # const_regexp("::") # => "::" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:357 + def const_regexp(camel_cased_word); end +end + +# pkg:gem/activesupport#lib/active_support/inflector/transliterate.rb:8 +ActiveSupport::Inflector::ALLOWED_ENCODINGS_FOR_TRANSLITERATE = T.let(T.unsafe(nil), Array) + +# = Active Support \Inflections +# +# A singleton instance of this class is yielded by Inflector.inflections, +# which can then be used to specify additional inflection rules. If passed +# an optional locale, rules for other languages can be specified. The +# default locale is :en. Only rules for English are provided. +# +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1\2en' +# inflect.singular /^(ox)en/i, '\1' +# +# inflect.irregular 'cactus', 'cacti' +# +# inflect.uncountable 'equipment' +# end +# +# New rules are added at the top. So in the example above, the irregular +# rule for cactus will now be the first of the pluralization and +# singularization rules that is runs. This guarantees that your rules run +# before any of the rules that may already have been loaded. +# +# pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:31 +class ActiveSupport::Inflector::Inflections + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:97 + def initialize; end + + # Specifies a new acronym. An acronym must be specified as it will appear + # in a camelized string. An underscore string that contains the acronym + # will retain the acronym when passed to +camelize+, +humanize+, or + # +titleize+. A camelized string that contains the acronym will maintain + # the acronym when titleized or humanized, and will convert the acronym + # into a non-delimited single lowercase word when passed to +underscore+. + # + # acronym 'HTML' + # titleize 'html' # => 'HTML' + # camelize 'html' # => 'HTML' + # underscore 'MyHTML' # => 'my_html' + # + # The acronym, however, must occur as a delimited unit and not be part of + # another word for conversions to recognize it: + # + # acronym 'HTTP' + # camelize 'my_http_delimited' # => 'MyHTTPDelimited' + # camelize 'https' # => 'Https', not 'HTTPs' + # underscore 'HTTPS' # => 'http_s', not 'https' + # + # acronym 'HTTPS' + # camelize 'https' # => 'HTTPS' + # underscore 'HTTPS' # => 'https' + # + # Note: Acronyms that are passed to +pluralize+ will no longer be + # recognized, since the acronym will not occur as a delimited unit in the + # pluralized result. To work around this, you must specify the pluralized + # form as an acronym as well: + # + # acronym 'API' + # camelize(pluralize('api')) # => 'Apis' + # + # acronym 'APIs' + # camelize(pluralize('api')) # => 'APIs' + # + # +acronym+ may be used to specify any word that contains an acronym or + # otherwise needs to maintain a non-standard capitalization. The only + # restriction is that the word must begin with a capital letter. + # + # acronym 'RESTful' + # underscore 'RESTful' # => 'restful' + # underscore 'RESTfulController' # => 'restful_controller' + # titleize 'RESTfulController' # => 'RESTful Controller' + # camelize 'restful' # => 'RESTful' + # camelize 'restful_controller' # => 'RESTfulController' + # + # acronym 'McDonald' + # underscore 'McDonald' # => 'mcdonald' + # camelize 'mcdonald' # => 'McDonald' + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:159 + def acronym(word); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 + def acronyms; end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:95 + def acronyms_camelize_regex; end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:95 + def acronyms_underscore_regex; end + + # Clears the loaded inflections within a given scope (default is + # :all). Give the scope as a symbol of the inflection type, the + # options are: :plurals, :singulars, :uncountables, + # :humans, :acronyms. + # + # clear :all + # clear :plurals + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:248 + def clear(scope = T.unsafe(nil)); end + + # Specifies a humanized form of a string by a regular expression rule or + # by a string mapping. When using a regular expression based replacement, + # the normal humanize formatting is called after the replacement. When a + # string is used, the human form should be specified as desired (example: + # 'The name', not 'the_name'). + # + # human /_cnt$/i, '\1_count' + # human 'legacy_col_person_name', 'Name' + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:237 + def human(rule, replacement); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 + def humans; end + + # Specifies a new irregular that applies to both pluralization and + # singularization at the same time. This can only be used for strings, not + # regular expressions. You simply pass the irregular in singular and + # plural form. + # + # irregular 'cactus', 'cacti' + # irregular 'person', 'people' + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:191 + def irregular(singular, plural); end + + # Specifies a new pluralization rule and its replacement. The rule can + # either be a string or a regular expression. The replacement should + # always be a string that may include references to the matched data from + # the rule. + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:168 + def plural(rule, replacement); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 + def plurals; end + + # Specifies a new singularization rule and its replacement. The rule can + # either be a string or a regular expression. The replacement should + # always be a string that may include references to the matched data from + # the rule. + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:178 + def singular(rule, replacement); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 + def singulars; end + + # Specifies words that are uncountable and should not be inflected. + # + # uncountable 'money' + # uncountable 'money', 'information' + # uncountable %w( money information rice ) + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:225 + def uncountable(*words); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 + def uncountables; end + + private + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:267 + def define_acronym_regex_patterns; end + + # Private, for the test suite. + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:103 + def initialize_dup(orig); end + + class << self + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:77 + def instance(locale = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:83 + def instance_or_fallback(locale); end + end +end + +# pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:35 +class ActiveSupport::Inflector::Inflections::Uncountables + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:40 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:50 + def <<(word); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def ==(arg); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:61 + def add(words); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:45 + def delete(entry); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def each(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def empty?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:57 + def flatten; end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def pop(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def to_a(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def to_ary(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def to_s(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:68 + def uncountable?(str); end +end + +# = Inheritable Options +# +# +InheritableOptions+ provides a constructor to build an OrderedOptions +# hash inherited from another hash. +# +# Use this if you already have some hash and you want to create a new one based on it. +# +# h = ActiveSupport::InheritableOptions.new({ girl: 'Mary', boy: 'John' }) +# h.girl # => 'Mary' +# h.boy # => 'John' +# +# If the existing hash has string keys, call Hash#symbolize_keys on it. +# +# h = ActiveSupport::InheritableOptions.new({ 'girl' => 'Mary', 'boy' => 'John' }.symbolize_keys) +# h.girl # => 'Mary' +# h.boy # => 'John' +# +# pkg:gem/activesupport#lib/active_support/ordered_options.rb:89 +class ActiveSupport::InheritableOptions < ::ActiveSupport::OrderedOptions + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:90 + def initialize(parent = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:107 + def ==(other); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:142 + def each(&block); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:134 + def inheritable_copy; end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:111 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:126 + def key?(key); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:130 + def overridden?(key); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:119 + def pretty_print(pp); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:138 + def to_a; end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:103 + def to_h; end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:115 + def to_s; end + + private + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:123 + def own_key?(_arg0); end +end + +# pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:4 +module ActiveSupport::IsolatedExecutionState + class << self + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:31 + def [](key); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:37 + def []=(key, value); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:50 + def clear; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:54 + def context; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:46 + def delete(key); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:11 + def isolation_level; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:13 + def isolation_level=(level); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:42 + def key?(key); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:11 + def scope; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:58 + def share_with(other, except: T.unsafe(nil), &block); end + end +end + +# pkg:gem/activesupport#lib/active_support/json/decoding.rb:11 +module ActiveSupport::JSON + class << self + # Parses a JSON string (JavaScript Object Notation) into a Ruby object. + # See http://www.json.org for more info. + # + # ActiveSupport::JSON.decode("{\"team\":\"rails\",\"players\":\"36\"}") + # # => {"team" => "rails", "players" => "36"} + # ActiveSupport::JSON.decode("2.39") + # # => 2.39 + # + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:24 + def decode(json, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:56 + def dump(value, options = T.unsafe(nil)); end + + # Dumps objects in JSON (JavaScript Object Notation). + # See http://www.json.org for more info. + # + # ActiveSupport::JSON.encode({ team: 'rails', players: '36' }) + # # => "{\"team\":\"rails\",\"players\":\"36\"}" + # + # By default, it generates JSON that is safe to include in JavaScript, as + # it escapes U+2028 (Line Separator) and U+2029 (Paragraph Separator): + # + # ActiveSupport::JSON.encode({ key: "\u2028" }) + # # => "{\"key\":\"\\u2028\"}" + # + # By default, it also generates JSON that is safe to include in HTML, as + # it escapes <, >, and &: + # + # ActiveSupport::JSON.encode({ key: "<>&" }) + # # => "{\"key\":\"\\u003c\\u003e\\u0026\"}" + # + # This behavior can be changed with the +escape_html_entities+ option, or the + # global escape_html_entities_in_json configuration option. + # + # ActiveSupport::JSON.encode({ key: "<>&" }, escape_html_entities: false) + # # => "{\"key\":\"<>&\"}" + # + # For performance reasons, you can set the +escape+ option to false, + # which will skip all escaping: + # + # ActiveSupport::JSON.encode({ key: "\u2028<>&" }, escape: false) + # # => "{\"key\":\"\u2028<>&\"}" + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:47 + def encode(value, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:33 + def load(json, options = T.unsafe(nil)); end + + # Returns the class of the error that will be raised when there is an + # error in decoding JSON. Using this method means you won't directly + # depend on the ActiveSupport's JSON implementation, in case it changes + # in the future. + # + # begin + # obj = ActiveSupport::JSON.decode(some_string) + # rescue ActiveSupport::JSON.parse_error + # Rails.logger.warn("Attempted to decode invalid JSON: #{some_string}") + # end + # + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:45 + def parse_error; end + + private + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:50 + def convert_dates_from(data); end + end +end + +# pkg:gem/activesupport#lib/active_support/json/decoding.rb:14 +ActiveSupport::JSON::DATETIME_REGEX = T.let(T.unsafe(nil), Regexp) + +# matches YAML-formatted dates +# +# pkg:gem/activesupport#lib/active_support/json/decoding.rb:13 +ActiveSupport::JSON::DATE_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:59 +module ActiveSupport::JSON::Encoding + class << self + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:241 + def encode_without_escape(value); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:237 + def encode_without_options(value); end + + # If true, encode >, <, & as escaped unicode sequences (e.g. > as \u003e) + # as a safety measure. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:214 + def escape_html_entities_in_json; end + + # If true, encode >, <, & as escaped unicode sequences (e.g. > as \u003e) + # as a safety measure. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:214 + def escape_html_entities_in_json=(_arg0); end + + # If true, encode LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) + # as escaped unicode sequences ('\u2028' and '\u2029'). + # Historically these characters were not valid inside JavaScript strings + # but that changed in ECMAScript 2019. As such it's no longer a concern in + # modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:221 + def escape_js_separators_in_json; end + + # If true, encode LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) + # as escaped unicode sequences ('\u2028' and '\u2029'). + # Historically these characters were not valid inside JavaScript strings + # but that changed in ECMAScript 2019. As such it's no longer a concern in + # modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:221 + def escape_js_separators_in_json=(_arg0); end + + # Sets the encoder used by \Rails to encode Ruby objects into JSON strings + # in +Object#to_json+ and +ActiveSupport::JSON.encode+. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:229 + def json_encoder; end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:231 + def json_encoder=(encoder); end + + # Sets the precision of encoded time values. + # Defaults to 3 (equivalent to millisecond precision) + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:225 + def time_precision; end + + # Sets the precision of encoded time values. + # Defaults to 3 (equivalent to millisecond precision) + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:225 + def time_precision=(_arg0); end + + # If true, use ISO 8601 format for dates and times. Otherwise, fall back + # to the Active Support legacy format. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:210 + def use_standard_json_time_format; end + + # If true, use ISO 8601 format for dates and times. Otherwise, fall back + # to the Active Support legacy format. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:210 + def use_standard_json_time_format=(_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:63 +ActiveSupport::JSON::Encoding::ESCAPED_CHARS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:72 +ActiveSupport::JSON::Encoding::FULL_ESCAPE_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:71 +ActiveSupport::JSON::Encoding::HTML_ENTITIES_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:150 +class ActiveSupport::JSON::Encoding::JSONGemCoderEncoder + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:173 + def initialize(options = T.unsafe(nil)); end + + # Encode the given object into a JSON string + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:185 + def encode(value); end +end + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:152 +ActiveSupport::JSON::Encoding::JSONGemCoderEncoder::CODER = T.let(T.unsafe(nil), JSON::Coder) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:151 +ActiveSupport::JSON::Encoding::JSONGemCoderEncoder::JSON_NATIVE_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:75 +class ActiveSupport::JSON::Encoding::JSONGemEncoder + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:78 + def initialize(options = T.unsafe(nil)); end + + # Encode the given object into a JSON string + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:83 + def encode(value); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:76 + def options; end + + private + + # Convert an object into a "JSON-ready" representation composed of + # primitives like Hash, Array, String, Symbol, Numeric, + # and +true+/+false+/+nil+. + # Recursively calls #as_json to the object to recursively build a + # fully JSON-ready object. + # + # This allows developers to implement #as_json without having to + # worry about what base types of objects they are allowed to return + # or having to remember to call #as_json recursively. + # + # Note: the +options+ hash passed to +object.to_json+ is only passed + # to +object.as_json+, not any of this method's recursive +#as_json+ + # calls. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:118 + def jsonify(value); end + + # Encode a "jsonified" Ruby data structure using the JSON gem + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:143 + def stringify(jsonified); end +end + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:73 +ActiveSupport::JSON::Encoding::JS_SEPARATORS_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:60 +ActiveSupport::JSON::Encoding::U2028 = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:61 +ActiveSupport::JSON::Encoding::U2029 = T.let(T.unsafe(nil), String) + +# = Key Generator +# +# KeyGenerator is a simple wrapper around OpenSSL's implementation of PBKDF2. +# It can be used to derive a number of keys for various purposes from a given secret. +# This lets \Rails applications have a single secure secret, but avoid reusing that +# key in multiple incompatible contexts. +# +# pkg:gem/activesupport#lib/active_support/key_generator.rb:13 +class ActiveSupport::KeyGenerator + # pkg:gem/activesupport#lib/active_support/key_generator.rb:28 + def initialize(secret, options = T.unsafe(nil)); end + + # Returns a derived key suitable for use. The default +key_size+ is chosen + # to be compatible with the default settings of ActiveSupport::MessageVerifier. + # i.e. OpenSSL::Digest::SHA1#block_length + # + # pkg:gem/activesupport#lib/active_support/key_generator.rb:41 + def generate_key(salt, key_size = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/key_generator.rb:45 + def inspect; end + + class << self + # pkg:gem/activesupport#lib/active_support/key_generator.rb:23 + def hash_digest_class; end + + # pkg:gem/activesupport#lib/active_support/key_generator.rb:15 + def hash_digest_class=(klass); end + end +end + +# = Lazy Load Hooks +# +# LazyLoadHooks allows \Rails to lazily load a lot of components and thus +# making the app boot faster. Because of this feature now there is no need to +# require +ActiveRecord::Base+ at boot time purely to apply +# configuration. Instead a hook is registered that applies configuration once +# +ActiveRecord::Base+ is loaded. Here +ActiveRecord::Base+ is +# used as example but this feature can be applied elsewhere too. +# +# Here is an example where on_load method is called to register a hook. +# +# initializer 'active_record.initialize_timezone' do +# ActiveSupport.on_load(:active_record) do +# self.time_zone_aware_attributes = true +# self.default_timezone = :utc +# end +# end +# +# When the entirety of +ActiveRecord::Base+ has been +# evaluated then run_load_hooks is invoked. The very last line of +# +ActiveRecord::Base+ is: +# +# ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base) +# +# run_load_hooks will then execute all the hooks that were registered +# with the on_load method. In the case of the above example, it will +# execute the block of code that is in the +initializer+. +# +# Registering a hook that has already run results in that hook executing +# immediately. This allows hooks to be nested for code that relies on +# multiple lazily loaded components: +# +# initializer "action_text.renderer" do +# ActiveSupport.on_load(:action_controller_base) do +# ActiveSupport.on_load(:action_text_content) do +# self.default_renderer = Class.new(ActionController::Base).renderer +# end +# end +# end +# +# pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:43 +module ActiveSupport::LazyLoadHooks + # Declares a block that will be executed when a \Rails component is fully + # loaded. If the component has already loaded, the block is executed + # immediately. + # + # ==== Options + # + # * :yield - Yields the object that run_load_hooks to +block+. + # * :run_once - Given +block+ will run only once. + # + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:60 + def on_load(name, options = T.unsafe(nil), &block); end + + # Executes all blocks registered to +name+ via on_load, using +base+ as the + # evaluation context. + # + # ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base) + # + # In the case of the above example, it will execute all hooks registered + # for +:active_record+ within the class +ActiveRecord::Base+. + # + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:75 + def run_load_hooks(name, base = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:91 + def execute_hook(name, base, options, block); end + + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:83 + def with_execution_control(name, block, once); end + + class << self + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:44 + def extended(base); end + end +end + +# = Active Support Log \Subscriber +# +# +ActiveSupport::LogSubscriber+ is an object set to consume +# ActiveSupport::Notifications with the sole purpose of logging them. +# The log subscriber dispatches notifications to a registered object based +# on its given namespace. +# +# An example would be Active Record log subscriber responsible for logging +# queries: +# +# module ActiveRecord +# class LogSubscriber < ActiveSupport::LogSubscriber +# attach_to :active_record +# +# def sql(event) +# info "#{event.payload[:name]} (#{event.duration}) #{event.payload[:sql]}" +# end +# end +# end +# +# ActiveRecord::LogSubscriber.logger must be set as well, but it is assigned +# automatically in a \Rails environment. +# +# After configured, whenever a "sql.active_record" notification is +# published, it will properly dispatch the event +# (ActiveSupport::Notifications::Event) to the +sql+ method. +# +# Being an ActiveSupport::Notifications consumer, +# +ActiveSupport::LogSubscriber+ exposes a simple interface to check if +# instrumented code raises an exception. It is common to log a different +# message in case of an error, and this can be achieved by extending +# the previous example: +# +# module ActiveRecord +# class LogSubscriber < ActiveSupport::LogSubscriber +# def sql(event) +# exception = event.payload[:exception] +# +# if exception +# exception_object = event.payload[:exception_object] +# +# error "[ERROR] #{event.payload[:name]}: #{exception.join(', ')} " \ +# "(#{exception_object.backtrace.first})" +# else +# # standard logger code +# end +# end +# end +# end +# +# +ActiveSupport::LogSubscriber+ also has some helpers to deal with +# logging. For example, ActiveSupport::LogSubscriber.flush_all! will ensure +# that all logs are flushed, and it is called in Rails::Rack::Logger after a +# request finishes. +# +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:64 +class ActiveSupport::LogSubscriber < ::ActiveSupport::Subscriber + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:133 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:146 + def call(event); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:83 + def colorize_logging; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:83 + def colorize_logging=(val); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 + def debug(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 + def error(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:152 + def event_levels=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 + def fatal(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 + def info(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:138 + def logger; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:142 + def silenced?(event); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 + def unknown(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 + def warn(progname = T.unsafe(nil), &block); end + + private + + # Set color by using a symbol or one of the defined constants. Set modes + # by specifying bold, italic, or underline options. Inspired by Highline, + # this method will automatically clear formatting at the end of the returned String. + # + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:166 + def color(text, color, mode_options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:180 + def log_exception(name, e); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:174 + def mode_from(options); end + + class << self + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:99 + def attach_to(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:83 + def colorize_logging; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:83 + def colorize_logging=(val); end + + # Flush all log_subscribers' logger. + # + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:112 + def flush_all!; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 + def log_levels; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 + def log_levels=(value); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 + def log_levels?; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:107 + def log_subscribers; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:93 + def logger; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:105 + def logger=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 + def __class_attr_log_levels; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 + def __class_attr_log_levels=(new_value); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:117 + def fetch_public_methods(subscriber, inherit_all); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:121 + def set_event_levels; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:127 + def subscribe_log_level(method, level); end + end +end + +# ANSI sequence colors +# +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:74 +ActiveSupport::LogSubscriber::BLACK = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:78 +ActiveSupport::LogSubscriber::BLUE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:80 +ActiveSupport::LogSubscriber::CYAN = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:76 +ActiveSupport::LogSubscriber::GREEN = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:86 +ActiveSupport::LogSubscriber::LEVEL_CHECKS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:79 +ActiveSupport::LogSubscriber::MAGENTA = T.let(T.unsafe(nil), String) + +# ANSI sequence modes +# +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:66 +ActiveSupport::LogSubscriber::MODES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:75 +ActiveSupport::LogSubscriber::RED = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:81 +ActiveSupport::LogSubscriber::WHITE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:77 +ActiveSupport::LogSubscriber::YELLOW = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/logger.rb:8 +class ActiveSupport::Logger < ::Logger + include ::ActiveSupport::LoggerSilence + include ::ActiveSupport::LoggerThreadSafeLevel + + # pkg:gem/activesupport#lib/active_support/logger.rb:33 + def initialize(*args, **kwargs); end + + # pkg:gem/activesupport#lib/active_support/logger.rb:9 + def silencer; end + + # pkg:gem/activesupport#lib/active_support/logger.rb:9 + def silencer=(val); end + + class << self + # Returns true if the logger destination matches one of the sources + # + # logger = Logger.new(STDOUT) + # ActiveSupport::Logger.logger_outputs_to?(logger, STDOUT) + # # => true + # + # logger = Logger.new('/var/log/rails.log') + # ActiveSupport::Logger.logger_outputs_to?(logger, '/var/log/rails.log') + # # => true + # + # pkg:gem/activesupport#lib/active_support/logger.rb:20 + def logger_outputs_to?(logger, *sources); end + + # pkg:gem/activesupport#lib/active_support/logger.rb:47 + def normalize_sources(sources); end + + # pkg:gem/activesupport#lib/active_support/logger.rb:9 + def silencer; end + + # pkg:gem/activesupport#lib/active_support/logger.rb:9 + def silencer=(val); end + end +end + +# Simple formatter which only displays the message. +# +# pkg:gem/activesupport#lib/active_support/logger.rb:39 +class ActiveSupport::Logger::SimpleFormatter < ::Logger::Formatter + # This method is invoked when a log event occurs + # + # pkg:gem/activesupport#lib/active_support/logger.rb:41 + def call(severity, timestamp, progname, msg); end +end + +# pkg:gem/activesupport#lib/active_support/logger_silence.rb:8 +module ActiveSupport::LoggerSilence + extend ::ActiveSupport::Concern + include ::ActiveSupport::LoggerThreadSafeLevel + + # Silences the logger for the duration of the block. + # + # pkg:gem/activesupport#lib/active_support/logger_silence.rb:17 + def silence(severity = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:7 +module ActiveSupport::LoggerThreadSafeLevel + extend ::ActiveSupport::Concern + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:10 + def initialize(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:35 + def level; end + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:15 + def local_level; end + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:19 + def local_level=(level); end + + # Change the thread-local level for the duration of the given block. + # + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:40 + def log_at(level); end + + private + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:48 + def local_level_key; end +end + +# = Active Support Message Encryptor +# +# MessageEncryptor is a simple way to encrypt values which get stored +# somewhere you don't trust. +# +# The cipher text and initialization vector are base64 encoded and returned +# to you. +# +# This can be used in situations similar to the MessageVerifier, but +# where you don't want users to be able to determine the value of the payload. +# +# len = ActiveSupport::MessageEncryptor.key_len +# salt = SecureRandom.random_bytes(len) +# key = ActiveSupport::KeyGenerator.new('password').generate_key(salt, len) # => "\x89\xE0\x156\xAC..." +# crypt = ActiveSupport::MessageEncryptor.new(key) # => # +# encrypted_data = crypt.encrypt_and_sign('my secret data') # => "NlFBTTMwOUV5UlA1QlNEN2xkY2d6eThYWWh..." +# crypt.decrypt_and_verify(encrypted_data) # => "my secret data" +# +# The +decrypt_and_verify+ method will raise an +# +ActiveSupport::MessageEncryptor::InvalidMessage+ exception if the data +# provided cannot be decrypted or verified. +# +# crypt.decrypt_and_verify('not encrypted data') # => ActiveSupport::MessageEncryptor::InvalidMessage +# +# === Confining messages to a specific purpose +# +# By default any message can be used throughout your app. But they can also be +# confined to a specific +:purpose+. +# +# token = crypt.encrypt_and_sign("this is the chair", purpose: :login) +# +# Then that same purpose must be passed when verifying to get the data back out: +# +# crypt.decrypt_and_verify(token, purpose: :login) # => "this is the chair" +# crypt.decrypt_and_verify(token, purpose: :shipping) # => nil +# crypt.decrypt_and_verify(token) # => nil +# +# Likewise, if a message has no purpose it won't be returned when verifying with +# a specific purpose. +# +# token = crypt.encrypt_and_sign("the conversation is lively") +# crypt.decrypt_and_verify(token, purpose: :scare_tactics) # => nil +# crypt.decrypt_and_verify(token) # => "the conversation is lively" +# +# === Making messages expire +# +# By default messages last forever and verifying one year from now will still +# return the original value. But messages can be set to expire at a given +# time with +:expires_in+ or +:expires_at+. +# +# crypt.encrypt_and_sign(parcel, expires_in: 1.month) +# crypt.encrypt_and_sign(doowad, expires_at: Time.now.end_of_year) +# +# Then the messages can be verified and returned up to the expire time. +# Thereafter, verifying returns +nil+. +# +# === Rotating keys +# +# MessageEncryptor also supports rotating out old configurations by falling +# back to a stack of encryptors. Call +rotate+ to build and add an encryptor +# so +decrypt_and_verify+ will also try the fallback. +# +# By default any rotated encryptors use the values of the primary +# encryptor unless specified otherwise. +# +# You'd give your encryptor the new defaults: +# +# crypt = ActiveSupport::MessageEncryptor.new(@secret, cipher: "aes-256-gcm") +# +# Then gradually rotate the old values out by adding them as fallbacks. Any message +# generated with the old values will then work until the rotation is removed. +# +# crypt.rotate old_secret # Fallback to an old secret instead of @secret. +# crypt.rotate cipher: "aes-256-cbc" # Fallback to an old cipher instead of aes-256-gcm. +# +# Though if both the secret and the cipher was changed at the same time, +# the above should be combined into: +# +# crypt.rotate old_secret, cipher: "aes-256-cbc" +# +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:90 +class ActiveSupport::MessageEncryptor < ::ActiveSupport::Messages::Codec + include ::ActiveSupport::Messages::Rotator + + # Initialize a new MessageEncryptor. +secret+ must be at least as long as + # the cipher key size. For the default 'aes-256-gcm' cipher, this is 256 + # bits. If you are using a user-entered secret, you can generate a suitable + # key by using ActiveSupport::KeyGenerator or a similar key + # derivation function. + # + # The first additional parameter is used as the signature key for + # MessageVerifier. This allows you to specify keys to encrypt and sign + # data. Ignored when using an AEAD cipher like 'aes-256-gcm'. + # + # ActiveSupport::MessageEncryptor.new('secret', 'signature_secret') + # + # ==== Options + # + # [+:cipher+] + # Cipher to use. Can be any cipher returned by +OpenSSL::Cipher.ciphers+. + # Default is 'aes-256-gcm'. + # + # [+:digest+] + # Digest used for signing. Ignored when using an AEAD cipher like + # 'aes-256-gcm'. + # + # [+:serializer+] + # The serializer used to serialize message data. You can specify any + # object that responds to +dump+ and +load+, or you can choose from + # several preconfigured serializers: +:marshal+, +:json_allow_marshal+, + # +:json+, +:message_pack_allow_marshal+, +:message_pack+. + # + # The preconfigured serializers include a fallback mechanism to support + # multiple deserialization formats. For example, the +:marshal+ serializer + # will serialize using +Marshal+, but can deserialize using +Marshal+, + # ActiveSupport::JSON, or ActiveSupport::MessagePack. This makes it easy + # to migrate between serializers. + # + # The +:marshal+, +:json_allow_marshal+, and +:message_pack_allow_marshal+ + # serializers support deserializing using +Marshal+, but the others do + # not. Beware that +Marshal+ is a potential vector for deserialization + # attacks in cases where a message signing secret has been leaked. If + # possible, choose a serializer that does not support +Marshal+. + # + # The +:message_pack+ and +:message_pack_allow_marshal+ serializers use + # ActiveSupport::MessagePack, which can roundtrip some Ruby types that are + # not supported by JSON, and may provide improved performance. However, + # these require the +msgpack+ gem. + # + # When using \Rails, the default depends on +config.active_support.message_serializer+. + # Otherwise, the default is +:marshal+. + # + # [+:url_safe+] + # By default, MessageEncryptor generates RFC 4648 compliant strings + # which are not URL-safe. In other words, they can contain "+" and "/". + # If you want to generate URL-safe strings (in compliance with "Base 64 + # Encoding with URL and Filename Safe Alphabet" in RFC 4648), you can + # pass +true+. + # + # [+:force_legacy_metadata_serializer+] + # Whether to use the legacy metadata serializer, which serializes the + # message first, then wraps it in an envelope which is also serialized. This + # was the default in \Rails 7.0 and below. + # + # If you don't pass a truthy value, the default is set using + # +config.active_support.use_message_serializer_for_metadata+. + # + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:183 + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:256 + def create_message(value, **options); end + + # Decrypt and verify a message. We need to verify the message in order to + # avoid padding attacks. Reference: https://www.limited-entropy.com/padding-oracle-attacks/. + # + # ==== Options + # + # [+:purpose+] + # The purpose that the message was generated with. If the purpose does not + # match, +decrypt_and_verify+ will return +nil+. + # + # message = encryptor.encrypt_and_sign("hello", purpose: "greeting") + # encryptor.decrypt_and_verify(message, purpose: "greeting") # => "hello" + # encryptor.decrypt_and_verify(message) # => nil + # + # message = encryptor.encrypt_and_sign("bye") + # encryptor.decrypt_and_verify(message) # => "bye" + # encryptor.decrypt_and_verify(message, purpose: "greeting") # => nil + # + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:241 + def decrypt_and_verify(message, **options); end + + # Encrypt and sign a message. We need to sign the message in order to avoid + # padding attacks. Reference: https://www.limited-entropy.com/padding-oracle-attacks/. + # + # ==== Options + # + # [+:expires_at+] + # The datetime at which the message expires. After this datetime, + # verification of the message will fail. + # + # message = encryptor.encrypt_and_sign("hello", expires_at: Time.now.tomorrow) + # encryptor.decrypt_and_verify(message) # => "hello" + # # 24 hours later... + # encryptor.decrypt_and_verify(message) # => nil + # + # [+:expires_in+] + # The duration for which the message is valid. After this duration has + # elapsed, verification of the message will fail. + # + # message = encryptor.encrypt_and_sign("hello", expires_in: 24.hours) + # encryptor.decrypt_and_verify(message) # => "hello" + # # 24 hours later... + # encryptor.decrypt_and_verify(message) # => nil + # + # [+:purpose+] + # The purpose of the message. If specified, the same purpose must be + # specified when verifying the message; otherwise, verification will fail. + # (See #decrypt_and_verify.) + # + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:220 + def encrypt_and_sign(value, **options); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:264 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:260 + def read_message(message, on_rotation: T.unsafe(nil), **options); end + + private + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:371 + def aead_mode; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:372 + def aead_mode?; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:295 + def decrypt(encrypted_message); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:277 + def encrypt(data); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:340 + def extract_part(encrypted_message, rindex, length); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:350 + def extract_parts(encrypted_message); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:336 + def join_parts(parts); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:320 + def length_after_encode(length_before_encode); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:332 + def length_of_encoded_auth_tag; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:328 + def length_of_encoded_iv; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:367 + def new_cipher; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:269 + def sign(data); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:273 + def verify(data); end + + class << self + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:96 + def default_cipher; end + + # Given a cipher, returns the key length of the cipher to help generate the key of desired size + # + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:252 + def key_len(cipher = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:93 + def use_authenticated_message_encryption; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:93 + def use_authenticated_message_encryption=(val); end + end +end + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:118 +ActiveSupport::MessageEncryptor::AUTH_TAG_LENGTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:115 +class ActiveSupport::MessageEncryptor::InvalidMessage < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:105 +module ActiveSupport::MessageEncryptor::NullSerializer + class << self + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:110 + def dump(value); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:106 + def load(value); end + end +end + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:116 +ActiveSupport::MessageEncryptor::OpenSSLCipherError = OpenSSL::Cipher::CipherError + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:119 +ActiveSupport::MessageEncryptor::SEPARATOR = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/message_encryptors.rb:6 +class ActiveSupport::MessageEncryptors < ::ActiveSupport::Messages::RotationCoordinator + private + + # pkg:gem/activesupport#lib/active_support/message_encryptors.rb:187 + def build(salt, secret_generator:, secret_generator_options:, **options); end +end + +# = Active Support Message Verifier +# +# +MessageVerifier+ makes it easy to generate and verify messages which are +# signed to prevent tampering. +# +# In a \Rails application, you can use +Rails.application.message_verifier+ +# to manage unique instances of verifiers for each use case. +# {Learn more}[link:classes/Rails/Application.html#method-i-message_verifier]. +# +# This is useful for cases like remember-me tokens and auto-unsubscribe links +# where the session store isn't suitable or available. +# +# First, generate a signed message: +# cookies[:remember_me] = Rails.application.message_verifier(:remember_me).generate([@user.id, 2.weeks.from_now]) +# +# Later verify that message: +# +# id, time = Rails.application.message_verifier(:remember_me).verify(cookies[:remember_me]) +# if time.future? +# self.current_user = User.find(id) +# end +# +# === Signing is not encryption +# +# The signed messages are not encrypted. The payload is merely encoded (Base64 by default) and can be decoded by +# anyone. The signature is just assuring that the message wasn't tampered with. For example: +# +# message = Rails.application.message_verifier('my_purpose').generate('never put secrets here') +# # => "BAhJIhtuZXZlciBwdXQgc2VjcmV0cyBoZXJlBjoGRVQ=--a0c1c0827919da5e949e989c971249355735e140" +# Base64.decode64(message.split("--").first) # no key needed +# # => 'never put secrets here' +# +# If you also need to encrypt the contents, you must use ActiveSupport::MessageEncryptor instead. +# +# === Confine messages to a specific purpose +# +# It's not recommended to use the same verifier for different purposes in your application. +# Doing so could allow a malicious actor to re-use a signed message to perform an unauthorized +# action. +# You can reduce this risk by confining signed messages to a specific +:purpose+. +# +# token = @verifier.generate("signed message", purpose: :login) +# +# Then that same purpose must be passed when verifying to get the data back out: +# +# @verifier.verified(token, purpose: :login) # => "signed message" +# @verifier.verified(token, purpose: :shipping) # => nil +# @verifier.verified(token) # => nil +# +# @verifier.verify(token, purpose: :login) # => "signed message" +# @verifier.verify(token, purpose: :shipping) # => raises ActiveSupport::MessageVerifier::InvalidSignature +# @verifier.verify(token) # => raises ActiveSupport::MessageVerifier::InvalidSignature +# +# Likewise, if a message has no purpose it won't be returned when verifying with +# a specific purpose. +# +# token = @verifier.generate("signed message") +# @verifier.verified(token, purpose: :redirect) # => nil +# @verifier.verified(token) # => "signed message" +# +# @verifier.verify(token, purpose: :redirect) # => raises ActiveSupport::MessageVerifier::InvalidSignature +# @verifier.verify(token) # => "signed message" +# +# === Expiring messages +# +# By default messages last forever and verifying one year from now will still +# return the original value. But messages can be set to expire at a given +# time with +:expires_in+ or +:expires_at+. +# +# @verifier.generate("signed message", expires_in: 1.month) +# @verifier.generate("signed message", expires_at: Time.now.end_of_year) +# +# Messages can then be verified and returned until expiry. +# Thereafter, the +verified+ method returns +nil+ while +verify+ raises +# +ActiveSupport::MessageVerifier::InvalidSignature+. +# +# === Rotating keys +# +# MessageVerifier also supports rotating out old configurations by falling +# back to a stack of verifiers. Call +rotate+ to build and add a verifier so +# either +verified+ or +verify+ will also try verifying with the fallback. +# +# By default any rotated verifiers use the values of the primary +# verifier unless specified otherwise. +# +# You'd give your verifier the new defaults: +# +# verifier = ActiveSupport::MessageVerifier.new(@secret, digest: "SHA512", serializer: JSON) +# +# Then gradually rotate the old values out by adding them as fallbacks. Any message +# generated with the old values will then work until the rotation is removed. +# +# verifier.rotate(old_secret) # Fallback to an old secret instead of @secret. +# verifier.rotate(digest: "SHA256") # Fallback to an old digest instead of SHA512. +# verifier.rotate(serializer: Marshal) # Fallback to an old serializer instead of JSON. +# +# Though the above would most likely be combined into one rotation: +# +# verifier.rotate(old_secret, digest: "SHA256", serializer: Marshal) +# +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:110 +class ActiveSupport::MessageVerifier < ::ActiveSupport::Messages::Codec + include ::ActiveSupport::Messages::Rotator + + # Initialize a new MessageVerifier with a secret for the signature. + # + # ==== Options + # + # [+:digest+] + # Digest used for signing. The default is "SHA1". See + # +OpenSSL::Digest+ for alternatives. + # + # [+:serializer+] + # The serializer used to serialize message data. You can specify any + # object that responds to +dump+ and +load+, or you can choose from + # several preconfigured serializers: +:marshal+, +:json_allow_marshal+, + # +:json+, +:message_pack_allow_marshal+, +:message_pack+. + # + # The preconfigured serializers include a fallback mechanism to support + # multiple deserialization formats. For example, the +:marshal+ serializer + # will serialize using +Marshal+, but can deserialize using +Marshal+, + # ActiveSupport::JSON, or ActiveSupport::MessagePack. This makes it easy + # to migrate between serializers. + # + # The +:marshal+, +:json_allow_marshal+, and +:message_pack_allow_marshal+ + # serializers support deserializing using +Marshal+, but the others do + # not. Beware that +Marshal+ is a potential vector for deserialization + # attacks in cases where a message signing secret has been leaked. If + # possible, choose a serializer that does not support +Marshal+. + # + # The +:message_pack+ and +:message_pack_allow_marshal+ serializers use + # ActiveSupport::MessagePack, which can roundtrip some Ruby types that are + # not supported by JSON, and may provide improved performance. However, + # these require the +msgpack+ gem. + # + # When using \Rails, the default depends on +config.active_support.message_serializer+. + # Otherwise, the default is +:marshal+. + # + # [+:url_safe+] + # By default, MessageVerifier generates RFC 4648 compliant strings which are + # not URL-safe. In other words, they can contain "+" and "/". If you want to + # generate URL-safe strings (in compliance with "Base 64 Encoding with URL + # and Filename Safe Alphabet" in RFC 4648), you can pass +true+. + # Note that MessageVerifier will always accept both URL-safe and URL-unsafe + # encoded messages, to allow a smooth transition between the two settings. + # + # [+:force_legacy_metadata_serializer+] + # Whether to use the legacy metadata serializer, which serializes the + # message first, then wraps it in an envelope which is also serialized. This + # was the default in \Rails 7.0 and below. + # + # If you don't pass a truthy value, the default is set using + # +config.active_support.use_message_serializer_for_metadata+. + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:167 + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:310 + def create_message(value, **options); end + + # Generates a signed message for the provided value. + # + # The message is signed with the +MessageVerifier+'s secret. + # Returns Base64-encoded message joined with the generated signature. + # + # verifier = ActiveSupport::MessageVerifier.new("secret") + # verifier.generate("signed message") # => "BAhJIhNzaWduZWQgbWVzc2FnZQY6BkVU--f67d5f27c3ee0b8483cebf2103757455e947493b" + # + # ==== Options + # + # [+:expires_at+] + # The datetime at which the message expires. After this datetime, + # verification of the message will fail. + # + # message = verifier.generate("hello", expires_at: Time.now.tomorrow) + # verifier.verified(message) # => "hello" + # # 24 hours later... + # verifier.verified(message) # => nil + # verifier.verify(message) # => raises ActiveSupport::MessageVerifier::InvalidSignature + # + # [+:expires_in+] + # The duration for which the message is valid. After this duration has + # elapsed, verification of the message will fail. + # + # message = verifier.generate("hello", expires_in: 24.hours) + # verifier.verified(message) # => "hello" + # # 24 hours later... + # verifier.verified(message) # => nil + # verifier.verify(message) # => raises ActiveSupport::MessageVerifier::InvalidSignature + # + # [+:purpose+] + # The purpose of the message. If specified, the same purpose must be + # specified when verifying the message; otherwise, verification will fail. + # (See #verified and #verify.) + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:306 + def generate(value, **options); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:318 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:314 + def read_message(message, on_rotation: T.unsafe(nil), **options); end + + # Checks if a signed message could have been generated by signing an object + # with the +MessageVerifier+'s secret. + # + # verifier = ActiveSupport::MessageVerifier.new("secret") + # signed_message = verifier.generate("signed message") + # verifier.valid_message?(signed_message) # => true + # + # tampered_message = signed_message.chop # editing the message invalidates the signature + # verifier.valid_message?(tampered_message) # => false + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:183 + def valid_message?(message); end + + # Decodes the signed message using the +MessageVerifier+'s secret. + # + # verifier = ActiveSupport::MessageVerifier.new("secret") + # + # signed_message = verifier.generate("signed message") + # verifier.verified(signed_message) # => "signed message" + # + # Returns +nil+ if the message was not signed with the same secret. + # + # other_verifier = ActiveSupport::MessageVerifier.new("different_secret") + # other_verifier.verified(signed_message) # => nil + # + # Returns +nil+ if the message is not Base64-encoded. + # + # invalid_message = "f--46a0120593880c733a53b6dad75b42ddc1c8996d" + # verifier.verified(invalid_message) # => nil + # + # Raises any error raised while decoding the signed message. + # + # incompatible_message = "test--dad7b06c94abba8d46a15fafaef56c327665d5ff" + # verifier.verified(incompatible_message) # => TypeError: incompatible marshal file format + # + # ==== Options + # + # [+:purpose+] + # The purpose that the message was generated with. If the purpose does not + # match, +verified+ will return +nil+. + # + # message = verifier.generate("hello", purpose: "greeting") + # verifier.verified(message, purpose: "greeting") # => "hello" + # verifier.verified(message, purpose: "chatting") # => nil + # verifier.verified(message) # => nil + # + # message = verifier.generate("bye") + # verifier.verified(message) # => "bye" + # verifier.verified(message, purpose: "greeting") # => nil + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:224 + def verified(message, **options); end + + # Decodes the signed message using the +MessageVerifier+'s secret. + # + # verifier = ActiveSupport::MessageVerifier.new("secret") + # signed_message = verifier.generate("signed message") + # + # verifier.verify(signed_message) # => "signed message" + # + # Raises +InvalidSignature+ if the message was not signed with the same + # secret or was not Base64-encoded. + # + # other_verifier = ActiveSupport::MessageVerifier.new("different_secret") + # other_verifier.verify(signed_message) # => ActiveSupport::MessageVerifier::InvalidSignature + # + # ==== Options + # + # [+:purpose+] + # The purpose that the message was generated with. If the purpose does not + # match, +verify+ will raise ActiveSupport::MessageVerifier::InvalidSignature. + # + # message = verifier.generate("hello", purpose: "greeting") + # verifier.verify(message, purpose: "greeting") # => "hello" + # verifier.verify(message, purpose: "chatting") # => raises InvalidSignature + # verifier.verify(message) # => raises InvalidSignature + # + # message = verifier.generate("bye") + # verifier.verify(message) # => "bye" + # verifier.verify(message, purpose: "greeting") # => raises InvalidSignature + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:262 + def verify(message, **options); end + + private + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:323 + def decode(encoded, url_safe: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:356 + def digest_length_in_hex; end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:373 + def digest_matches_data?(digest, data); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:335 + def extract_encoded(signed); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:352 + def generate_digest(data); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:364 + def separator_at?(signed_message, index); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:368 + def separator_index_for(signed_message); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:330 + def sign_encoded(encoded); end +end + +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:113 +class ActiveSupport::MessageVerifier::InvalidSignature < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:115 +ActiveSupport::MessageVerifier::SEPARATOR = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:116 +ActiveSupport::MessageVerifier::SEPARATOR_LENGTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/message_verifiers.rb:6 +class ActiveSupport::MessageVerifiers < ::ActiveSupport::Messages::RotationCoordinator + private + + # pkg:gem/activesupport#lib/active_support/message_verifiers.rb:185 + def build(salt, secret_generator:, secret_generator_options:, **options); end +end + +# pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:6 +module ActiveSupport::Messages; end + +# pkg:gem/activesupport#lib/active_support/messages/codec.rb:9 +class ActiveSupport::Messages::Codec + include ::ActiveSupport::Messages::Metadata + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:15 + def initialize(**options); end + + private + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:45 + def catch_and_ignore(throwable, &block); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:52 + def catch_and_raise(throwable, as: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:29 + def decode(encoded, url_safe: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:39 + def deserialize(serialized); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:25 + def encode(data, url_safe: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:35 + def serialize(data); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:23 + def serializer; end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:60 + def use_message_serializer_for_metadata?; end + + class << self + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:12 + def default_serializer; end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:12 + def default_serializer=(value); end + + private + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:12 + def __class_attr_default_serializer; end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:12 + def __class_attr_default_serializer=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/messages/metadata.rb:9 +module ActiveSupport::Messages::Metadata + private + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:128 + def deserialize_from_json(serialized); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:141 + def deserialize_from_json_safe_string(string); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:43 + def deserialize_with_metadata(message, **expected_metadata); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:96 + def dual_serialized_metadata_envelope_json?(string); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:78 + def extract_from_metadata_envelope(envelope, purpose: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:92 + def metadata_envelope?(object); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:114 + def parse_expiry(expires_at); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:100 + def pick_expiry(expires_at, expires_in); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:124 + def serialize_to_json(data); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:137 + def serialize_to_json_safe_string(data); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:30 + def serialize_with_metadata(data, **metadata); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:60 + def use_message_serializer_for_metadata?; end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:64 + def wrap_in_metadata_envelope(hash, expires_at: T.unsafe(nil), expires_in: T.unsafe(nil), purpose: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:71 + def wrap_in_metadata_legacy_envelope(hash, expires_at: T.unsafe(nil), expires_in: T.unsafe(nil), purpose: T.unsafe(nil)); end + + class << self + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:10 + def use_message_serializer_for_metadata; end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:10 + def use_message_serializer_for_metadata=(_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/messages/metadata.rb:12 +ActiveSupport::Messages::Metadata::ENVELOPE_SERIALIZERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/messages/metadata.rb:19 +ActiveSupport::Messages::Metadata::TIMESTAMP_SERIALIZERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:5 +class ActiveSupport::Messages::RotationConfiguration + # pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:8 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:6 + def encrypted; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:12 + def rotate(kind, *args, **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:6 + def signed; end +end + +# pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:7 +class ActiveSupport::Messages::RotationCoordinator + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:10 + def initialize(&secret_generator); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:18 + def [](salt); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:22 + def []=(salt, codec); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:48 + def clear_rotations; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:54 + def on_rotation(&callback); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:35 + def prepend(**options, &block); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:26 + def rotate(**options, &block); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:44 + def rotate_defaults; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:8 + def transitional; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:8 + def transitional=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:97 + def build(salt, secret_generator:, secret_generator_options:, **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:85 + def build_with_rotations(salt); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:60 + def changing_configuration!; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:71 + def normalize_options(options); end +end + +# pkg:gem/activesupport#lib/active_support/messages/rotator.rb:5 +module ActiveSupport::Messages::Rotator + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:6 + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:23 + def fall_back_to(fallback); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:18 + def on_rotation(&on_rotation); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:28 + def read_message(message, on_rotation: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:14 + def rotate(*args, **options); end + + private + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:54 + def build_rotation(*args, **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:58 + def catch_rotation_error(&block); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:48 + def initialize_dup(*_arg0); end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:8 +module ActiveSupport::Messages::SerializerWithFallback + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:17 + def load(dumped); end + + private + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:33 + def detect_format(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:44 + def fallback?(format); end + + class << self + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:9 + def [](format); end + end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:48 +module ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + private + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:50 + def fallback?(format); end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:78 +module ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:90 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:86 + def dump(object); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:96 + def dumped?(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:82 + def format; end + + private + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:101 + def detect_format(dumped); end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:94 +ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback::JSON_START_WITH = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:107 +module ActiveSupport::Messages::SerializerWithFallback::JsonWithFallbackAllowMarshal + include ::ActiveSupport::Messages::SerializerWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallbackAllowMarshal +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:55 +module ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:67 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:63 + def dump(object); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:73 + def dumped?(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:59 + def format; end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:71 +ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:113 +module ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:125 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:121 + def dump(object); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:129 + def dumped?(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:117 + def format; end + + private + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:134 + def available?; end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:143 +module ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallbackAllowMarshal + include ::ActiveSupport::Messages::SerializerWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallbackAllowMarshal +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:149 +ActiveSupport::Messages::SerializerWithFallback::SERIALIZERS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/multibyte.rb:4 +module ActiveSupport::Multibyte + class << self + # Returns the current proxy class. + # + # pkg:gem/activesupport#lib/active_support/multibyte.rb:23 + def proxy_class; end + + # The proxy class returned when calling mb_chars. You can use this accessor + # to configure your own proxy class so you can support other encodings. See + # the ActiveSupport::Multibyte::Chars implementation for an example how to + # do this. + # + # ActiveSupport::Multibyte.proxy_class = CharsForUTF32 + # + # pkg:gem/activesupport#lib/active_support/multibyte.rb:14 + def proxy_class=(klass); end + end +end + +# = Active Support \Multibyte \Chars +# +# Chars enables you to work transparently with UTF-8 encoding in the Ruby +# String class without having extensive knowledge about the encoding. A +# Chars object accepts a string upon initialization and proxies String +# methods in an encoding safe manner. All the normal String methods are also +# implemented on the proxy. +# +# String methods are proxied through the Chars object, and can be accessed +# through the +mb_chars+ method. Methods which would normally return a +# String object now return a Chars object so methods can be chained. +# +# 'The Perfect String '.mb_chars.downcase.strip +# # => # +# +# Chars objects are perfectly interchangeable with String objects as long as +# no explicit class checks are made. If certain methods do explicitly check +# the class, call +to_s+ before you pass chars objects to them. +# +# bad.explicit_checking_method 'T'.mb_chars.downcase.to_s +# +# The default Chars implementation assumes that the encoding of the string +# is UTF-8, if you want to handle different encodings you can write your own +# multibyte string handler and configure it through +# ActiveSupport::Multibyte.proxy_class. +# +# class CharsForUTF32 +# def size +# @wrapped_string.size / 4 +# end +# +# def self.accepts?(string) +# string.length % 4 == 0 +# end +# end +# +# ActiveSupport::Multibyte.proxy_class = CharsForUTF32 +# +# pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:47 +class ActiveSupport::Multibyte::Chars + include ::Comparable + + # Creates a new Chars instance by wrapping _string_. + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:56 + def initialize(string, deprecation: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 + def <=>(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 + def =~(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 + def acts_like_string?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:171 + def as_json(options = T.unsafe(nil)); end + + # Performs composition on all the characters. + # + # 'é'.length # => 1 + # 'é'.mb_chars.compose.to_s.length # => 1 + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:150 + def compose; end + + # Performs canonical decomposition on all the characters. + # + # 'é'.length # => 1 + # 'é'.mb_chars.decompose.to_s.length # => 2 + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:142 + def decompose; end + + # Returns the number of grapheme clusters in the string. + # + # 'क्षि'.mb_chars.length # => 4 + # 'क्षि'.mb_chars.grapheme_length # => 2 + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:158 + def grapheme_length; end + + # Limits the byte size of the string to a number of bytes without breaking + # characters. Usable when the storage for a string is limited for some + # reason. + # + # 'こんにちは'.mb_chars.limit(7).to_s # => "こん" + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:125 + def limit(limit); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 + def match?(*_arg0, **_arg1, &_arg2); end + + # Forward all undefined methods to the wrapped string. + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:72 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # Reverses all characters in the string. + # + # 'Café'.mb_chars.reverse.to_s # => 'éfaC' + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:116 + def reverse; end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:176 + def reverse!(*args); end + + # Works like String#slice!, but returns an instance of + # Chars, or +nil+ if the string was not modified. The string will not be + # modified if the range given is out of bounds + # + # string = 'Welcome' + # string.mb_chars.slice!(3) # => # + # string # => 'Welome' + # string.mb_chars.slice!(0..3) # => # + # string # => 'me' + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:106 + def slice!(*args); end + + # Works just like String#split, with the exception that the items + # in the resulting list are Chars instances instead of String. This makes + # chaining methods easier. + # + # 'Café périferôl'.mb_chars.split(/é/).map { |part| part.upcase.to_s } # => ["CAF", " P", "RIFERÔL"] + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:93 + def split(*args); end + + # Replaces all ISO-8859-1 or CP1252 characters by their UTF-8 equivalent + # resulting in a valid UTF-8 string. + # + # Passing +true+ will forcibly tidy all bytes, assuming that the string's + # encoding is entirely CP1252 or ISO-8859-1. + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:167 + def tidy_bytes(force = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:176 + def tidy_bytes!(*args); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:136 + def titlecase; end + + # Capitalizes the first letter of every word, when possible. + # + # "ÉL QUE SE ENTERÓ".mb_chars.titleize.to_s # => "Él Que Se Enteró" + # "日本語".mb_chars.titleize.to_s # => "日本語" + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:133 + def titleize; end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:50 + def to_s; end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:51 + def to_str; end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:49 + def wrapped_string; end + + private + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:183 + def chars(string); end + + # Returns +true+ if _obj_ responds to the given method. Private methods + # are included in the search only if the optional second parameter + # evaluates to +true+. + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:84 + def respond_to_missing?(method, include_private); end +end + +# pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:5 +module ActiveSupport::Multibyte::Unicode + extend ::ActiveSupport::Multibyte::Unicode + + # Compose decomposed characters to the composed form. + # + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:21 + def compose(codepoints); end + + # Decompose composed characters to the decomposed form. + # + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:12 + def decompose(type, codepoints); end + + # Replaces all ISO-8859-1 or CP1252 characters by their UTF-8 equivalent + # resulting in a valid UTF-8 string. + # + # Passing +true+ will forcibly tidy all bytes, assuming that the string's + # encoding is entirely CP1252 or ISO-8859-1. + # + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:30 + def tidy_bytes(string, force = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:37 + def recode_windows1252_chars(string); end +end + +# The Unicode version that is supported by the implementation +# +# pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:9 +ActiveSupport::Multibyte::Unicode::UNICODE_VERSION = T.let(T.unsafe(nil), String) + +# = \Notifications +# +# +ActiveSupport::Notifications+ provides an instrumentation API for +# Ruby. +# +# == Instrumenters +# +# To instrument an event you just need to do: +# +# ActiveSupport::Notifications.instrument('render', extra: :information) do +# render plain: 'Foo' +# end +# +# That first executes the block and then notifies all subscribers once done. +# +# In the example above +render+ is the name of the event, and the rest is called +# the _payload_. The payload is a mechanism that allows instrumenters to pass +# extra information to subscribers. Payloads consist of a hash whose contents +# are arbitrary and generally depend on the event. +# +# == Subscribers +# +# You can consume those events and the information they provide by registering +# a subscriber. +# +# ActiveSupport::Notifications.subscribe('render') do |event| +# event.name # => "render" +# event.duration # => 10 (in milliseconds) +# event.payload # => { extra: :information } +# event.allocations # => 1826 (objects) +# end +# +# +Event+ objects record CPU time and allocations. If you don't need this +# it's also possible to pass a block that accepts five arguments: +# +# ActiveSupport::Notifications.subscribe('render') do |name, start, finish, id, payload| +# name # => String, name of the event (such as 'render' from above) +# start # => Time, when the instrumented block started execution +# finish # => Time, when the instrumented block ended execution +# id # => String, unique ID for the instrumenter that fired the event +# payload # => Hash, the payload +# end +# +# Here, the +start+ and +finish+ values represent wall-clock time. If you are +# concerned about accuracy, you can register a monotonic subscriber. +# +# ActiveSupport::Notifications.monotonic_subscribe('render') do |name, start, finish, id, payload| +# name # => String, name of the event (such as 'render' from above) +# start # => Float, monotonic time when the instrumented block started execution +# finish # => Float, monotonic time when the instrumented block ended execution +# id # => String, unique ID for the instrumenter that fired the event +# payload # => Hash, the payload +# end +# +# For instance, let's store all "render" events in an array: +# +# events = [] +# +# ActiveSupport::Notifications.subscribe('render') do |event| +# events << event +# end +# +# That code returns right away, you are just subscribing to "render" events. +# The block is saved and will be called whenever someone instruments "render": +# +# ActiveSupport::Notifications.instrument('render', extra: :information) do +# render plain: 'Foo' +# end +# +# event = events.first +# event.name # => "render" +# event.duration # => 10 (in milliseconds) +# event.payload # => { extra: :information } +# event.allocations # => 1826 (objects) +# +# If an exception happens during that particular instrumentation the payload will +# have a key :exception with an array of two elements as value: a string with +# the name of the exception class, and the exception message. +# The :exception_object key of the payload will have the exception +# itself as the value: +# +# event.payload[:exception] # => ["ArgumentError", "Invalid value"] +# event.payload[:exception_object] # => # +# +# As the earlier example depicts, the class ActiveSupport::Notifications::Event +# is able to take the arguments as they come and provide an object-oriented +# interface to that data. +# +# It is also possible to pass an object which responds to call method +# as the second parameter to the subscribe method instead of a block: +# +# module ActionController +# class PageRequest +# def call(name, started, finished, unique_id, payload) +# Rails.logger.debug ['notification:', name, started, finished, unique_id, payload].join(' ') +# end +# end +# end +# +# ActiveSupport::Notifications.subscribe('process_action.action_controller', ActionController::PageRequest.new) +# +# resulting in the following output within the logs including a hash with the payload: +# +# notification: process_action.action_controller 2012-04-13 01:08:35 +0300 2012-04-13 01:08:35 +0300 af358ed7fab884532ec7 { +# controller: "Devise::SessionsController", +# action: "new", +# params: {"action"=>"new", "controller"=>"devise/sessions"}, +# format: :html, +# method: "GET", +# path: "/login/sign_in", +# status: 200, +# view_runtime: 279.3080806732178, +# db_runtime: 40.053 +# } +# +# You can also subscribe to all events whose name matches a certain regexp: +# +# ActiveSupport::Notifications.subscribe(/render/) do |*args| +# ... +# end +# +# and even pass no argument to subscribe, in which case you are subscribing +# to all events. +# +# == Temporary Subscriptions +# +# Sometimes you do not want to subscribe to an event for the entire life of +# the application. There are two ways to unsubscribe. +# +# WARNING: The instrumentation framework is designed for long-running subscribers, +# use this feature sparingly because it wipes some internal caches and that has +# a negative impact on performance. +# +# === Subscribe While a Block Runs +# +# You can subscribe to some event temporarily while some block runs. For +# example, in +# +# callback = lambda {|event| ... } +# ActiveSupport::Notifications.subscribed(callback, "sql.active_record") do +# ... +# end +# +# the callback will be called for all "sql.active_record" events instrumented +# during the execution of the block. The callback is unsubscribed automatically +# after that. +# +# To record +started+ and +finished+ values with monotonic time, +# specify the optional :monotonic option to the +# subscribed method. The :monotonic option is set +# to +false+ by default. +# +# callback = lambda {|name, started, finished, unique_id, payload| ... } +# ActiveSupport::Notifications.subscribed(callback, "sql.active_record", monotonic: true) do +# ... +# end +# +# === Manual Unsubscription +# +# The +subscribe+ method returns a subscriber object: +# +# subscriber = ActiveSupport::Notifications.subscribe("render") do |event| +# ... +# end +# +# To prevent that block from being called anymore, just unsubscribe passing +# that reference: +# +# ActiveSupport::Notifications.unsubscribe(subscriber) +# +# You can also unsubscribe by passing the name of the subscriber object. Note +# that this will unsubscribe all subscriptions with the given name: +# +# ActiveSupport::Notifications.unsubscribe("render") +# +# Subscribers using a regexp or other pattern-matching object will remain subscribed +# to all events that match their original pattern, unless those events match a string +# passed to +unsubscribe+: +# +# subscriber = ActiveSupport::Notifications.subscribe(/render/) { } +# ActiveSupport::Notifications.unsubscribe('render_template.action_view') +# subscriber.matches?('render_template.action_view') # => false +# subscriber.matches?('render_partial.action_view') # => true +# +# == Default Queue +# +# Notifications ships with a queue implementation that consumes and publishes events +# to all log subscribers. You can use any queue implementation you want. +# +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:7 +module ActiveSupport::Notifications + class << self + # pkg:gem/activesupport#lib/active_support/notifications.rb:208 + def instrument(name, payload = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:269 + def instrumenter; end + + # Performs the same functionality as #subscribe, but the +start+ and + # +finish+ block arguments are in monotonic time instead of wall-clock + # time. Monotonic time will not jump forward or backward (due to NTP or + # Daylights Savings). Use +monotonic_subscribe+ when accuracy of time + # duration is important. For example, computing elapsed time between + # two events. + # + # pkg:gem/activesupport#lib/active_support/notifications.rb:254 + def monotonic_subscribe(pattern = T.unsafe(nil), callback = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:198 + def notifier; end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:198 + def notifier=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:200 + def publish(name, *args); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:204 + def publish_event(event); end + + # Subscribe to a given event name with the passed +block+. + # + # You can subscribe to events by passing a String to match exact event + # names, or by passing a Regexp to match all events that match a pattern. + # + # If the block passed to the method only takes one argument, + # it will yield an +Event+ object to the block: + # + # ActiveSupport::Notifications.subscribe(/render/) do |event| + # @event = event + # end + # + # Otherwise the +block+ will receive five arguments with information + # about the event: + # + # ActiveSupport::Notifications.subscribe('render') do |name, start, finish, id, payload| + # name # => String, name of the event (such as 'render' from above) + # start # => Time, when the instrumented block started execution + # finish # => Time, when the instrumented block ended execution + # id # => String, unique ID for the instrumenter that fired the event + # payload # => Hash, the payload + # end + # + # Raises an error if invalid event name type is passed: + # + # ActiveSupport::Notifications.subscribe(:render) {|event| ...} + # #=> ArgumentError (pattern must be specified as a String, Regexp or empty) + # + # pkg:gem/activesupport#lib/active_support/notifications.rb:244 + def subscribe(pattern = T.unsafe(nil), callback = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:258 + def subscribed(callback, pattern = T.unsafe(nil), monotonic: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:265 + def unsubscribe(subscriber_or_name); end + + private + + # pkg:gem/activesupport#lib/active_support/notifications.rb:274 + def registry; end + end +end + +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:106 +class ActiveSupport::Notifications::Event + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:110 + def initialize(name, start, ending, transaction_id, payload); end + + # Returns the number of allocations made between the call to #start! and + # the call to #finish!. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:176 + def allocations; end + + # Returns the CPU time (in milliseconds) passed between the call to + # #start! and the call to #finish!. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:163 + def cpu_time; end + + # Returns the difference in milliseconds between when the execution of the + # event started and when it ended. + # + # ActiveSupport::Notifications.subscribe('wait') do |event| + # @event = event + # end + # + # ActiveSupport::Notifications.instrument('wait') do + # sleep 1 + # end + # + # @event.duration # => 1000.138 + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:198 + def duration; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:128 + def end; end + + # Record information at the time this event finishes + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:154 + def finish!; end + + # Returns the time spent in GC (in milliseconds) between the call to #start! + # and the call to #finish! + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:182 + def gc_time; end + + # Returns the idle time (in milliseconds) passed between the call to + # #start! and the call to #finish!. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:169 + def idle_time; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:107 + def name; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:108 + def payload; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:108 + def payload=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:132 + def record; end + + # Record information at the time this event starts + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:146 + def start!; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:124 + def time; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:107 + def transaction_id; end + + private + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:203 + def now; end + + # Likely on JRuby, TruffleRuby + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:230 + def now_allocations; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:210 + def now_cpu; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:220 + def now_gc; end +end + +# This is a default queue implementation that ships with Notifications. +# It just pushes events to all registered log subscribers. +# +# This class is thread safe. All methods are reentrant. +# +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:55 +class ActiveSupport::Notifications::Fanout + include ::ActiveSupport::Notifications::FanoutIteration + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:56 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:319 + def all_listeners_for(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:286 + def build_handle(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:106 + def clear_cache(key = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:305 + def finish(name, id, payload, listeners = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:190 + def group_listeners(listeners); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:196 + def groups_for(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:64 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:328 + def listeners_for(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:332 + def listening?(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:311 + def publish(name, *_arg1, **_arg2, &_arg3); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:315 + def publish_event(event); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:298 + def start(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:69 + def subscribe(pattern = T.unsafe(nil), callable = T.unsafe(nil), monotonic: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:86 + def unsubscribe(subscriber_or_name); end + + # This is a sync queue, so there is no waiting. + # + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:337 + def wait; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:116 +class ActiveSupport::Notifications::Fanout::BaseGroup + include ::ActiveSupport::Notifications::FanoutIteration + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:119 + def initialize(listeners, name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:123 + def each(&block); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:128 +class ActiveSupport::Notifications::Fanout::BaseTimeGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:133 + def finish(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:129 + def start(name, id, payload); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:169 +class ActiveSupport::Notifications::Fanout::EventObjectGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:175 + def finish(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:170 + def start(name, id, payload); end + + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:185 + def build_event(name, id, payload); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:155 +class ActiveSupport::Notifications::Fanout::EventedGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:162 + def finish(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:156 + def start(name, id, payload); end +end + +# A +Handle+ is used to record the start and finish time of event. +# +# Both #start and #finish must each be called exactly once. +# +# Where possible, it's best to use the block form: ActiveSupport::Notifications.instrument. +# +Handle+ is a low-level API intended for cases where the block form can't be used. +# +# handle = ActiveSupport::Notifications.instrumenter.build_handle("my.event", {}) +# begin +# handle.start +# # work to be instrumented +# ensure +# handle.finish +# end +# +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:230 +class ActiveSupport::Notifications::Fanout::Handle + include ::ActiveSupport::Notifications::FanoutIteration + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:233 + def initialize(notifier, name, id, groups, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:250 + def finish; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:254 + def finish_with_values(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:241 + def start; end + + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:264 + def ensure_state!(expected); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:141 +class ActiveSupport::Notifications::Fanout::MonotonicTimedGroup < ::ActiveSupport::Notifications::Fanout::BaseTimeGroup + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:143 + def now; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:271 +module ActiveSupport::Notifications::Fanout::NullHandle + extend ::ActiveSupport::Notifications::Fanout::NullHandle + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:277 + def finish; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:280 + def finish_with_values(_name, _id, _payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:274 + def start; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:340 +module ActiveSupport::Notifications::Fanout::Subscribers + class << self + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:341 + def new(pattern, listener, monotonic); end + end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:455 +class ActiveSupport::Notifications::Fanout::Subscribers::EventObject < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:456 + def group_class; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:460 + def publish_event(event); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:397 +class ActiveSupport::Notifications::Fanout::Subscribers::Evented + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:400 + def initialize(pattern, delegate); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:398 + def delegate; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:408 + def group_class; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:398 + def pattern; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:412 + def publish(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:418 + def publish_event(event); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:398 + def silenceable; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:426 + def silenced?(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:430 + def subscribed_to?(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:434 + def unsubscribe!(name); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:360 +class ActiveSupport::Notifications::Fanout::Subscribers::Matcher + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:373 + def initialize(pattern); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:382 + def ===(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:361 + def exclusions; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:361 + def pattern; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:378 + def unsubscribe!(name); end + + class << self + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:363 + def wrap(pattern); end + end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:386 +class ActiveSupport::Notifications::Fanout::Subscribers::Matcher::AllMessages + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:387 + def ===(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:391 + def unsubscribe!(*_arg0); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:449 +class ActiveSupport::Notifications::Fanout::Subscribers::MonotonicTimed < ::ActiveSupport::Notifications::Fanout::Subscribers::Timed + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:450 + def group_class; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:439 +class ActiveSupport::Notifications::Fanout::Subscribers::Timed < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:440 + def group_class; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:444 + def publish(*_arg0, **_arg1, &_arg2); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:148 +class ActiveSupport::Notifications::Fanout::TimedGroup < ::ActiveSupport::Notifications::Fanout::BaseTimeGroup + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:150 + def now; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:18 +module ActiveSupport::Notifications::FanoutIteration + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:20 + def iterate_guarding_exceptions(collection, &block); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:8 +class ActiveSupport::Notifications::InstrumentationSubscriberError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:11 + def initialize(exceptions); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:9 + def exceptions; end +end + +# Instrumenters are stored in a thread local. +# +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:9 +class ActiveSupport::Notifications::Instrumenter + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:12 + def initialize(notifier); end + + # Returns a "handle" for an event with the given +name+ and +payload+. + # + # #start and #finish must each be called exactly once on the returned object. + # + # Where possible, it's best to use #instrument, which will record the + # start and finish of the event and correctly handle any exceptions. + # +build_handle+ is a low-level API intended for cases where using + # +instrument+ isn't possible. + # + # See ActiveSupport::Notifications::Fanout::Handle. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:78 + def build_handle(name, payload); end + + # Send a finish notification with +name+ and +payload+. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:92 + def finish(name, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:96 + def finish_with_state(listeners_state, name, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:10 + def id; end + + # Given a block, instrument it by measuring the time taken to execute + # and publish it. Without a block, simply send a message via the + # notifier. Notice that events get sent even if an error occurs in the + # passed-in block. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:54 + def instrument(name, payload = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:82 + def new_event(name, payload = T.unsafe(nil)); end + + # Send a start notification with +name+ and +payload+. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:87 + def start(name, payload); end + + private + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:101 + def unique_id; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:21 +class ActiveSupport::Notifications::Instrumenter::LegacyHandle + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:34 + def initialize(notifier, name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:45 + def finish; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:41 + def start; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:22 +class ActiveSupport::Notifications::Instrumenter::LegacyHandle::Wrapper + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:23 + def initialize(notifier); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:27 + def build_handle(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:31 + def finish(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:31 + def start(*_arg0, **_arg1, &_arg2); end +end + +# = Number Helper +# +# Provides methods for formatting numbers into currencies, percentages, +# phone numbers, and more. +# +# Example usage in a class: +# class Topic +# include ActiveSupport::NumberHelper +# +# def price +# number_to_currency(@price) +# end +# end +# +# Example usage in a module: +# require "active_support/number_helper" +# +# module NumberFormatting +# def format_price(price) +# ActiveSupport::NumberHelper.number_to_currency(price) +# end +# end +# +# pkg:gem/activesupport#lib/active_support/number_helper.rb:26 +module ActiveSupport::NumberHelper + extend ::ActiveSupport::Autoload + extend ::ActiveSupport::NumberHelper + + # Formats a +number+ into a currency string. + # + # number_to_currency(1234567890.50) # => "$1,234,567,890.50" + # number_to_currency(1234567890.506) # => "$1,234,567,890.51" + # number_to_currency("12x34") # => "$12x34" + # + # number_to_currency(1234567890.50, unit: "£", separator: ",", delimiter: "") + # # => "£1234567890,50" + # + # The currency unit and number formatting of the current locale will be used + # unless otherwise specified via options. No currency conversion is + # performed. If the user is given a way to change their locale, they will + # also be able to change the relative value of the currency displayed with + # this helper. If your application will ever support multiple locales, you + # may want to specify a constant +:locale+ option or consider using a + # library capable of currency conversion. + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # number_to_currency(1234567890.506, locale: :fr) + # # => "1 234 567 890,51 €" + # + # [+:precision+] + # The level of precision. Defaults to 2. + # + # number_to_currency(1234567890.123, precision: 3) # => "$1,234,567,890.123" + # number_to_currency(0.456789, precision: 0) # => "$0" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_currency(1234567890.01, precision: 0, round_mode: :up) + # # => "$1,234,567,891" + # + # [+:unit+] + # The denomination of the currency. Defaults to "$". + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:format+] + # The format for non-negative numbers. %u represents the currency, + # and %n represents the number. Defaults to "%u%n". + # + # number_to_currency(1234567890.50, format: "%n %u") + # # => "1,234,567,890.50 $" + # + # [+:negative_format+] + # The format for negative numbers. %u and %n behave the + # same as in +:format+, but %n represents the absolute value of + # the number. Defaults to the value of +:format+ prepended with -. + # + # number_to_currency(-1234567890.50, negative_format: "(%u%n)") + # # => "($1,234,567,890.50)" + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to false. + # + # number_to_currency(1234567890.50, strip_insignificant_zeros: true) + # # => "$1,234,567,890.5" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:161 + def number_to_currency(number, options = T.unsafe(nil)); end + + # Formats +number+ by grouping thousands with a delimiter. + # + # number_to_delimited(12345678) # => "12,345,678" + # number_to_delimited("123456") # => "123,456" + # number_to_delimited(12345678.9876) # => "12,345,678.9876" + # number_to_delimited("12x34") # => "12x34" + # + # number_to_delimited(12345678.9876, delimiter: ".", separator: ",") + # # => "12.345.678,9876" + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # number_to_delimited(12345678.05, locale: :fr) + # # => "12 345 678,05" + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # number_to_delimited(12345678, delimiter: ".") + # # => "12.345.678" + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # number_to_delimited(12345678.05, separator: " ") + # # => "12,345,678 05" + # + # [+:delimiter_pattern+] + # A regexp to determine the placement of delimiters. Helpful when using + # currency formats like INR. + # + # number_to_delimited("123456.78", delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/) + # # => "1,23,456.78" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:264 + def number_to_delimited(number, options = T.unsafe(nil)); end + + # Formats +number+ into a more human-friendly representation. Useful for + # numbers that can become very large and too hard to read. + # + # number_to_human(123) # => "123" + # number_to_human(1234) # => "1.23 Thousand" + # number_to_human(12345) # => "12.3 Thousand" + # number_to_human(1234567) # => "1.23 Million" + # number_to_human(1234567890) # => "1.23 Billion" + # number_to_human(1234567890123) # => "1.23 Trillion" + # number_to_human(1234567890123456) # => "1.23 Quadrillion" + # number_to_human(1234567890123456789) # => "1230 Quadrillion" + # + # See #number_to_human_size if you want to pretty-print a file size. + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # [+:precision+] + # The level of precision. Defaults to 3. + # + # number_to_human(123456, precision: 2) # => "120 Thousand" + # number_to_human(123456, precision: 4) # => "123.5 Thousand" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_human(123456, precision: 2, round_mode: :up) + # # => "130 Thousand" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to true. + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # number_to_human(123456, precision: 4, separator: ",") + # # => "123,5 Thousand" + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to true. + # + # number_to_human(1000000) # => "1 Million" + # number_to_human(1000000, strip_insignificant_zeros: false) # => "1.00 Million" + # number_to_human(10.01) # => "10" + # number_to_human(10.01, strip_insignificant_zeros: false) # => "10.0" + # + # [+:format+] + # The format of the output. %n represents the number, and + # %u represents the quantifier (e.g., "Thousand"). Defaults to + # "%n %u". + # + # [+:units+] + # A Hash of custom unit quantifier names. + # + # number_to_human(1, units: { unit: "m", thousand: "km" }) # => "1 m" + # number_to_human(100, units: { unit: "m", thousand: "km" }) # => "100 m" + # number_to_human(1000, units: { unit: "m", thousand: "km" }) # => "1 km" + # number_to_human(100000, units: { unit: "m", thousand: "km" }) # => "100 km" + # number_to_human(10000000, units: { unit: "m", thousand: "km" }) # => "10000 km" + # + # The following keys are supported for integer units: +:unit+, +:ten+, + # +:hundred+, +:thousand+, +:million+, +:billion+, +:trillion+, + # +:quadrillion+. Additionally, the following keys are supported for + # fractional units: +:deci+, +:centi+, +:mili+, +:micro+, +:nano+, + # +:pico+, +:femto+. + # + # The Hash can also be defined as a scope in an I18n locale. For example: + # + # en: + # distance: + # centi: + # one: "centimeter" + # other: "centimeters" + # unit: + # one: "meter" + # other: "meters" + # thousand: + # one: "kilometer" + # other: "kilometers" + # + # Then it can be specified by name: + # + # number_to_human(1, units: :distance) # => "1 meter" + # number_to_human(100, units: :distance) # => "100 meters" + # number_to_human(1000, units: :distance) # => "1 kilometer" + # number_to_human(100000, units: :distance) # => "100 kilometers" + # number_to_human(10000000, units: :distance) # => "10000 kilometers" + # number_to_human(0.1, units: :distance) # => "10 centimeters" + # number_to_human(0.01, units: :distance) # => "1 centimeter" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:475 + def number_to_human(number, options = T.unsafe(nil)); end + + # Formats +number+ as bytes into a more human-friendly representation. + # Useful for reporting file sizes to users. + # + # number_to_human_size(123) # => "123 Bytes" + # number_to_human_size(1234) # => "1.21 KB" + # number_to_human_size(12345) # => "12.1 KB" + # number_to_human_size(1234567) # => "1.18 MB" + # number_to_human_size(1234567890) # => "1.15 GB" + # number_to_human_size(1234567890123) # => "1.12 TB" + # number_to_human_size(1234567890123456) # => "1.1 PB" + # number_to_human_size(1234567890123456789) # => "1.07 EB" + # + # See #number_to_human if you want to pretty-print a generic number. + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # [+:precision+] + # The level of precision. Defaults to 3. + # + # number_to_human_size(123456, precision: 2) # => "120 KB" + # number_to_human_size(1234567, precision: 2) # => "1.2 MB" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_human_size(123456, precision: 2, round_mode: :up) + # # => "130 KB" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to true. + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # number_to_human_size(1234567, separator: ",") + # # => "1,18 MB" + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to true. + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:373 + def number_to_human_size(number, options = T.unsafe(nil)); end + + # Formats +number+ as a percentage string. + # + # number_to_percentage(100) # => "100.000%" + # number_to_percentage("99") # => "99.000%" + # number_to_percentage("99x") # => "99x%" + # + # number_to_percentage(12345.6789, delimiter: ".", separator: ",", precision: 2) + # # => "12.345,68%" + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # number_to_percentage(1000, locale: :fr) + # # => "1000,000%" + # + # [+:precision+] + # The level of precision, or +nil+ to preserve +number+'s precision. + # Defaults to 2. + # + # number_to_percentage(12.3456789, precision: 4) # => "12.3457%" + # number_to_percentage(99.999, precision: 0) # => "100%" + # number_to_percentage(99.999, precision: nil) # => "99.999%" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_percentage(12.3456789, precision: 4, round_mode: :down) + # # => "12.3456%" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to false. + # + # number_to_percentage(12345.6789) # => "12345.679%" + # number_to_percentage(12345.6789, significant: true) # => "12300%" + # number_to_percentage(12345.6789, precision: 2) # => "12345.68%" + # number_to_percentage(12345.6789, precision: 2, significant: true) # => "12000%" + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to false. + # + # [+:format+] + # The format of the output. %n represents the number. Defaults to + # "%n%". + # + # number_to_percentage(100, format: "%n %") + # # => "100.000 %" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:223 + def number_to_percentage(number, options = T.unsafe(nil)); end + + # Formats +number+ into a phone number. + # + # number_to_phone(5551234) # => "555-1234" + # number_to_phone("5551234") # => "555-1234" + # number_to_phone(1235551234) # => "123-555-1234" + # number_to_phone("12x34") # => "12x34" + # + # number_to_phone(1235551234, delimiter: ".", country_code: 1, extension: 1343) + # # => "+1.123.555.1234 x 1343" + # + # ==== Options + # + # [+:area_code+] + # Whether to use parentheses for the area code. Defaults to false. + # + # number_to_phone(1235551234, area_code: true) + # # => "(123) 555-1234" + # + # [+:delimiter+] + # The digit group delimiter to use. Defaults to "-". + # + # number_to_phone(1235551234, delimiter: " ") + # # => "123 555 1234" + # + # [+:country_code+] + # A country code to prepend. + # + # number_to_phone(1235551234, country_code: 1) + # # => "+1-123-555-1234" + # + # [+:extension+] + # An extension to append. + # + # number_to_phone(1235551234, extension: 555) + # # => "123-555-1234 x 555" + # + # [+:pattern+] + # A regexp that specifies how the digits should be grouped. The first + # three captures from the regexp are treated as digit groups. + # + # number_to_phone(13312345678, pattern: /(\d{3})(\d{4})(\d{4})$/) + # # => "133-1234-5678" + # number_to_phone(75561234567, pattern: /(\d{1,4})(\d{4})(\d{4})$/, area_code: true) + # # => "(755) 6123-4567" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:88 + def number_to_phone(number, options = T.unsafe(nil)); end + + # Formats +number+ to a specific level of precision. + # + # number_to_rounded(12345.6789) # => "12345.679" + # number_to_rounded(12345.6789, precision: 2) # => "12345.68" + # number_to_rounded(12345.6789, precision: 0) # => "12345" + # number_to_rounded(12345, precision: 5) # => "12345.00000" + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # number_to_rounded(111.234, locale: :fr) + # # => "111,234" + # + # [+:precision+] + # The level of precision, or +nil+ to preserve +number+'s precision. + # Defaults to 3. + # + # number_to_rounded(12345.6789, precision: nil) + # # => "12345.6789" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_rounded(12.34, precision: 0, round_mode: :up) + # # => "13" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to false. + # + # number_to_rounded(12345.6789) # => "12345.679" + # number_to_rounded(12345.6789, significant: true) # => "12300" + # number_to_rounded(12345.6789, precision: 2) # => "12345.68" + # number_to_rounded(12345.6789, precision: 2, significant: true) # => "12000" + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to false. + # + # number_to_rounded(12.34, strip_insignificant_zeros: false) # => "12.340" + # number_to_rounded(12.34, strip_insignificant_zeros: true) # => "12.34" + # number_to_rounded(12.3456, strip_insignificant_zeros: true) # => "12.346" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:320 + def number_to_rounded(number, options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:12 +class ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:124 + def initialize(number, options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:130 + def execute; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace?; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:19 + def number; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:19 + def opts; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float?; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:149 + def default_format_options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:174 + def default_value(key); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:145 + def format_options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:155 + def i18n_format_options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:141 + def options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:170 + def translate_in_locale(key, **i18n_options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:166 + def translate_number_value_with_default(key, **i18n_options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:178 + def valid_bigdecimal; end + + class << self + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:120 + def convert(number, options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace=(value); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace?; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float=(value); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float?; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def __class_attr_namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def __class_attr_namespace=(new_value); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def __class_attr_validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def __class_attr_validate_float=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:21 +ActiveSupport::NumberHelper::NumberConverter::DEFAULTS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToCurrencyConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:10 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:38 + def i18n_opts; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:29 + def options; end + + class << self + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:8 + def __class_attr_namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:8 + def __class_attr_namespace=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToDelimitedConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:12 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:40 + def delimiter_pattern; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:17 + def parts; end + + class << self + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:8 + def __class_attr_validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:8 + def __class_attr_validate_float=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:10 +ActiveSupport::NumberHelper::NumberToDelimitedConverter::DEFAULT_DELIMITER_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToHumanConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:15 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:50 + def calculate_exponent(units); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:38 + def determine_unit(units, exponent); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:34 + def format; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:55 + def unit_exponents(units); end + + class << self + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:12 + def __class_attr_namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:12 + def __class_attr_namespace=(new_value); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:13 + def __class_attr_validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:13 + def __class_attr_validate_float=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:8 +ActiveSupport::NumberHelper::NumberToHumanConverter::DECIMAL_UNITS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:10 +ActiveSupport::NumberHelper::NumberToHumanConverter::INVERTED_DECIMAL_UNITS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToHumanSizeConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:13 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:55 + def base; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:31 + def conversion_format; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:44 + def exponent; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:51 + def smaller_than_base?; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:39 + def storage_unit_key; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:35 + def unit; end + + class << self + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:10 + def __class_attr_namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:10 + def __class_attr_namespace=(new_value); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:11 + def __class_attr_validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:11 + def __class_attr_validate_float=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:8 +ActiveSupport::NumberHelper::NumberToHumanSizeConverter::STORAGE_UNITS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToPercentageConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:10 + def convert; end + + class << self + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:8 + def __class_attr_namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:8 + def __class_attr_namespace=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:8 +class ActiveSupport::NumberHelper::NumberToPhoneConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:9 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:16 + def convert_to_phone_number(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:24 + def convert_with_area_code(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:31 + def convert_without_area_code(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:47 + def country_code(code); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:43 + def delimiter; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:51 + def phone_ext(ext); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:55 + def regexp_pattern(default_pattern); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:39 + def start_with_delimiter?(number); end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToRoundedConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:11 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:49 + def format_number(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:45 + def strip_insignificant_zeros; end + + class << self + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:8 + def __class_attr_namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:8 + def __class_attr_namespace=(new_value); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:9 + def __class_attr_validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:9 + def __class_attr_validate_float=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:5 +class ActiveSupport::NumberHelper::RoundingHelper + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:8 + def initialize(options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:20 + def digit_count(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:6 + def options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:12 + def round(number); end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:37 + def absolute_precision(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:26 + def convert_to_decimal(number); end +end + +# pkg:gem/activesupport#lib/active_support/option_merger.rb:6 +class ActiveSupport::OptionMerger + # pkg:gem/activesupport#lib/active_support/option_merger.rb:11 + def initialize(context, options); end + + private + + # pkg:gem/activesupport#lib/active_support/option_merger.rb:16 + def method_missing(method, *arguments, &block); end + + # pkg:gem/activesupport#lib/active_support/option_merger.rb:34 + def respond_to_missing?(*_arg0, **_arg1, &_arg2); end +end + +# DEPRECATED: +ActiveSupport::OrderedHash+ implements a hash that preserves +# insertion order. +# +# oh = ActiveSupport::OrderedHash.new +# oh[:a] = 1 +# oh[:b] = 2 +# oh.keys # => [:a, :b], this order is guaranteed +# +# Also, maps the +omap+ feature for YAML files +# (See https://yaml.org/type/omap.html) to support ordered items +# when loading from YAML. +# +# +ActiveSupport::OrderedHash+ is namespaced to prevent conflicts +# with other implementations. +# +# pkg:gem/activesupport#lib/active_support/ordered_hash.rb:24 +class ActiveSupport::OrderedHash < ::Hash + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:29 + def encode_with(coder); end + + # Returns true to make sure that this hash is extractable via Array#extract_options! + # + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:46 + def extractable_options?; end + + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:41 + def nested_under_indifferent_access; end + + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:37 + def reject(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:33 + def select(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:25 + def to_yaml_type; end +end + +# = Ordered Options +# +# +OrderedOptions+ inherits from +Hash+ and provides dynamic accessor methods. +# +# With a +Hash+, key-value pairs are typically managed like this: +# +# h = {} +# h[:boy] = 'John' +# h[:girl] = 'Mary' +# h[:boy] # => 'John' +# h[:girl] # => 'Mary' +# h[:dog] # => nil +# +# Using +OrderedOptions+, the above code can be written as: +# +# h = ActiveSupport::OrderedOptions.new +# h.boy = 'John' +# h.girl = 'Mary' +# h.boy # => 'John' +# h.girl # => 'Mary' +# h.dog # => nil +# +# To raise an exception when the value is blank, append a +# bang to the key name, like: +# +# h.dog! # => raises KeyError: :dog is blank +# +# pkg:gem/activesupport#lib/active_support/ordered_options.rb:33 +class ActiveSupport::OrderedOptions < ::Hash + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:41 + def [](key); end + + # make it protected + # + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:37 + def []=(key, value); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:45 + def dig(key, *identifiers); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:64 + def extractable_options?; end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:68 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:49 + def method_missing(method, *args); end + + protected + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:34 + def _get(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:60 + def respond_to_missing?(name, include_private); end +end + +# = Active Support Parameter Filter +# +# +ParameterFilter+ replaces values in a Hash-like object if their +# keys match one of the specified filters. +# +# Matching based on nested keys is possible by using dot notation, e.g. +# "credit_card.number". +# +# If a proc is given as a filter, each key and value of the Hash-like +# and of any nested Hashes will be passed to it. The value or key can +# then be mutated as desired using methods such as String#replace. +# +# # Replaces values with "[FILTERED]" for keys that match /password/i. +# ActiveSupport::ParameterFilter.new([:password]) +# +# # Replaces values with "[FILTERED]" for keys that match /foo|bar/i. +# ActiveSupport::ParameterFilter.new([:foo, "bar"]) +# +# # Replaces values for the exact key "pin" and for keys that begin with +# # "pin_". Does not match keys that otherwise include "pin" as a +# # substring, such as "shipping_id". +# ActiveSupport::ParameterFilter.new([/\Apin\z/, /\Apin_/]) +# +# # Replaces the value for :code in `{ credit_card: { code: "xxxx" } }`. +# # Does not change `{ file: { code: "xxxx" } }`. +# ActiveSupport::ParameterFilter.new(["credit_card.code"]) +# +# # Reverses values for keys that match /secret/i. +# ActiveSupport::ParameterFilter.new([-> (k, v) do +# v.reverse! if /secret/i.match?(k) +# end]) +# +# pkg:gem/activesupport#lib/active_support/parameter_filter.rb:39 +class ActiveSupport::ParameterFilter + # Create instance with given filters. Supported type of filters are +String+, +Regexp+, and +Proc+. + # Other types of filters are treated as +String+ using +to_s+. + # For +Proc+ filters, key, value, and optional original hash is passed to block arguments. + # + # ==== Options + # + # * :mask - A replaced object when filtered. Defaults to "[FILTERED]". + # + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:77 + def initialize(filters = T.unsafe(nil), mask: T.unsafe(nil)); end + + # Mask value of +params+ if key matches one of filters. + # + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:83 + def filter(params); end + + # Returns filtered value for given key. For +Proc+ filters, third block argument is not populated. + # + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:88 + def filter_param(key, value); end + + private + + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:125 + def call(params, full_parent_key = T.unsafe(nil), original_params = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:93 + def compile_filters!(filters); end + + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:135 + def value_for_key(key, value, full_parent_key = T.unsafe(nil), original_params = T.unsafe(nil)); end + + class << self + # Precompiles an array of filters that otherwise would be passed directly to + # #initialize. Depending on the quantity and types of filters, + # precompilation can improve filtering performance, especially in the case + # where the ParameterFilter instance itself cannot be retained (but the + # precompiled filters can be retained). + # + # filters = [/foo/, :bar, "nested.baz", /nested\.qux/] + # + # precompiled = ActiveSupport::ParameterFilter.precompile_filters(filters) + # # => [/(?-mix:foo)|(?i:bar)/, /(?i:nested\.baz)|(?-mix:nested\.qux)/] + # + # ActiveSupport::ParameterFilter.new(precompiled) + # + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:55 + def precompile_filters(filters); end + end +end + +# pkg:gem/activesupport#lib/active_support/parameter_filter.rb:40 +ActiveSupport::ParameterFilter::FILTERED = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/railtie.rb:7 +class ActiveSupport::Railtie < ::Rails::Railtie; end + +# = Active Support \Reloader +# +# This class defines several callbacks: +# +# to_prepare -- Run once at application startup, and also from +# +to_run+. +# +# to_run -- Run before a work run that is reloading. If +# +reload_classes_only_on_change+ is true (the default), the class +# unload will have already occurred. +# +# to_complete -- Run after a work run that has reloaded. If +# +reload_classes_only_on_change+ is false, the class unload will +# have occurred after the work run, but before this callback. +# +# before_class_unload -- Run immediately before the classes are +# unloaded. +# +# after_class_unload -- Run immediately after the classes are +# unloaded. +# +# pkg:gem/activesupport#lib/active_support/reloader.rb:28 +class ActiveSupport::Reloader < ::ActiveSupport::ExecutionWrapper + # pkg:gem/activesupport#lib/active_support/reloader.rb:99 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _class_unload_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _prepare_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _run_class_unload_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _run_class_unload_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _run_prepare_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _run_prepare_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:48 + def _run_run_callbacks(&block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check?; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:126 + def class_unload!(&block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:131 + def complete!; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor?; end + + # Release the unload lock if it has been previously obtained + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:114 + def release_unload_lock!; end + + # Acquire the ActiveSupport::Dependencies::Interlock unload lock, + # ensuring it will be released automatically + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:106 + def require_unload_lock!; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:121 + def run!; end + + class << self + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _class_unload_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _class_unload_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _prepare_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _prepare_callbacks=(value); end + + # Registers a callback that will run immediately after the classes are unloaded. + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:44 + def after_class_unload(*args, &block); end + + # Registers a callback that will run immediately before the classes are unloaded. + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:39 + def before_class_unload(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:87 + def check!; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check=(value); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check?; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor=(value); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor?; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:95 + def prepare!; end + + # Initiate a manual reload + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:51 + def reload!; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:91 + def reloaded!; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:62 + def run!(reset: T.unsafe(nil)); end + + # Registers a callback that will run once at application startup and every time the code is reloaded. + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:34 + def to_prepare(*args, &block); end + + # Run the supplied block as a work unit, reloading code as needed + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:71 + def wrap(**kwargs); end + + private + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def __class_attr___callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def __class_attr_check; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def __class_attr_check=(new_value); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def __class_attr_executor; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def __class_attr_executor=(new_value); end + end +end + +# = Active Support \Rescuable +# +# Rescuable module adds support for easier exception handling. +# +# pkg:gem/activesupport#lib/active_support/rescuable.rb:11 +module ActiveSupport::Rescuable + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Rescuable::ClassMethods + + # Internal handler lookup. Delegates to class method. Some libraries call + # this directly, so keeping it around for compatibility. + # + # pkg:gem/activesupport#lib/active_support/rescuable.rb:172 + def handler_for_rescue(exception); end + + # Delegates to the class method, but uses the instance as the subject for + # rescue_from handlers (method calls, +instance_exec+ blocks). + # + # pkg:gem/activesupport#lib/active_support/rescuable.rb:166 + def rescue_with_handler(exception); end + + module GeneratedClassMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end + + module GeneratedInstanceMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end +end + +# pkg:gem/activesupport#lib/active_support/rescuable.rb:18 +module ActiveSupport::Rescuable::ClassMethods + # pkg:gem/activesupport#lib/active_support/rescuable.rb:105 + def handler_for_rescue(exception, object: T.unsafe(nil)); end + + # Registers exception classes with a handler to be called by rescue_with_handler. + # + # rescue_from receives a series of exception classes or class + # names, and an exception handler specified by a trailing :with + # option containing the name of a method or a Proc object. Alternatively, a block + # can be given as the handler. + # + # Handlers that take one argument will be called with the exception, so + # that the exception can be inspected when dealing with it. + # + # Handlers are inherited. They are searched from right to left, from + # bottom to top, and up the hierarchy. The handler of the first class for + # which exception.is_a?(klass) holds true is the one invoked, if + # any. + # + # class ApplicationController < ActionController::Base + # rescue_from User::NotAuthorized, with: :deny_access + # rescue_from ActiveRecord::RecordInvalid, with: :show_record_errors + # + # rescue_from "MyApp::BaseError" do |exception| + # redirect_to root_url, alert: exception.message + # end + # + # private + # def deny_access + # head :forbidden + # end + # + # def show_record_errors(exception) + # redirect_back_or_to root_url, alert: exception.record.errors.full_messages.to_sentence + # end + # end + # + # Exceptions raised inside exception handlers are not propagated up. + # + # pkg:gem/activesupport#lib/active_support/rescuable.rb:53 + def rescue_from(*klasses, with: T.unsafe(nil), &block); end + + # Matches an exception to a handler based on the exception class. + # + # If no handler matches the exception, check for a handler matching the + # (optional) +exception.cause+. If no handler matches the exception or its + # cause, this returns +nil+, so you can deal with unhandled exceptions. + # Be sure to re-raise unhandled exceptions if this is what you expect. + # + # begin + # # ... + # rescue => exception + # rescue_with_handler(exception) || raise + # end + # + # Returns the exception if it was handled and +nil+ if it was not. + # + # pkg:gem/activesupport#lib/active_support/rescuable.rb:90 + def rescue_with_handler(exception, object: T.unsafe(nil), visited_exceptions: T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/rescuable.rb:139 + def constantize_rescue_handler_class(class_or_name); end + + # pkg:gem/activesupport#lib/active_support/rescuable.rb:124 + def find_rescue_handler(exception); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:19 +class ActiveSupport::SafeBuffer < ::String + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:70 + def initialize(_str = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:124 + def %(args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:115 + def *(_); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:111 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:85 + def <<(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:38 + def [](*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:103 + def []=(arg1, arg2, arg3 = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:147 + def as_json(*_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:87 + def bytesplice(*args, value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def capitalize(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def capitalize!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def chomp(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def chomp!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def chop(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def chop!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:59 + def chr; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:79 + def concat(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def delete(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def delete!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def delete_prefix(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def delete_prefix!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def delete_suffix(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def delete_suffix!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def downcase(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def downcase!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:155 + def encode_with(coder); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:175 + def gsub(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:175 + def gsub!(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:139 + def html_safe?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:91 + def insert(index, value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def lstrip(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def lstrip!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def next(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def next!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:95 + def prepend(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:99 + def replace(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def reverse(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def reverse!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def rstrip(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def rstrip!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:65 + def safe_concat(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def scrub(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def scrub!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:49 + def slice(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:51 + def slice!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def squeeze(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def squeeze!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def strip(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def strip!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:175 + def sub(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:175 + def sub!(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def succ(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def succ!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def swapcase(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def swapcase!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:151 + def to_param; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:143 + def to_s; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def tr(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def tr!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def tr_s(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def tr_s!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def unicode_normalize(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def unicode_normalize!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def upcase(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def upcase!(*args); end + + protected + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:202 + def mark_unsafe!; end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:207 + def explicit_html_escape_interpolated_argument(arg); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:211 + def implicit_html_escape_interpolated_argument(arg); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:74 + def initialize_copy(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:28 + def original_concat(*_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:219 + def set_block_back_references(block, match_data); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:225 + def string_into_safe_buffer(new_string, is_html_safe); end +end + +# Raised when ActiveSupport::SafeBuffer#safe_concat is called on unsafe buffers. +# +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:32 +class ActiveSupport::SafeBuffer::SafeConcatError < ::StandardError + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:33 + def initialize; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:20 +ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:26 +ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS_WITH_BACKREF = T.let(T.unsafe(nil), Array) + +# = Secure Compare Rotator +# +# The ActiveSupport::SecureCompareRotator is a wrapper around ActiveSupport::SecurityUtils.secure_compare +# and allows you to rotate a previously defined value to a new one. +# +# It can be used as follow: +# +# rotator = ActiveSupport::SecureCompareRotator.new('new_production_value') +# rotator.rotate('previous_production_value') +# rotator.secure_compare!('previous_production_value') +# +# One real use case example would be to rotate a basic auth credentials: +# +# class MyController < ApplicationController +# def authenticate_request +# rotator = ActiveSupport::SecureCompareRotator.new('new_password') +# rotator.rotate('old_password') +# +# authenticate_or_request_with_http_basic do |username, password| +# rotator.secure_compare!(password) +# rescue ActiveSupport::SecureCompareRotator::InvalidMatch +# false +# end +# end +# end +# +# pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:32 +class ActiveSupport::SecureCompareRotator + include ::ActiveSupport::SecurityUtils + + # pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:37 + def initialize(value, on_rotation: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:43 + def rotate(previous_value); end + + # pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:47 + def secure_compare!(other_value, on_rotation: T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:35 +class ActiveSupport::SecureCompareRotator::InvalidMatch < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/security_utils.rb:4 +module ActiveSupport::SecurityUtils + private + + # pkg:gem/activesupport#lib/active_support/security_utils.rb:11 + def fixed_length_secure_compare(a, b); end + + # Secure string comparison for strings of variable length. + # + # While a timing attack would not be able to discern the content of + # a secret compared via secure_compare, it is possible to determine + # the secret length. This should be considered when using secure_compare + # to compare weak, short secrets to user input. + # + # pkg:gem/activesupport#lib/active_support/security_utils.rb:33 + def secure_compare(a, b); end + + class << self + # pkg:gem/activesupport#lib/active_support/security_utils.rb:25 + def fixed_length_secure_compare(a, b); end + + # Secure string comparison for strings of variable length. + # + # While a timing attack would not be able to discern the content of + # a secret compared via secure_compare, it is possible to determine + # the secret length. This should be considered when using secure_compare + # to compare weak, short secrets to user input. + # + # pkg:gem/activesupport#lib/active_support/security_utils.rb:36 + def secure_compare(a, b); end + end +end + +# = \String Inquirer +# +# Wrapping a string in this class gives you a prettier way to test +# for equality. The value returned by Rails.env is wrapped +# in a StringInquirer object, so instead of calling this: +# +# Rails.env == 'production' +# +# you can call this: +# +# Rails.env.production? +# +# == Instantiating a new \StringInquirer +# +# vehicle = ActiveSupport::StringInquirer.new('car') +# vehicle.car? # => true +# vehicle.bike? # => false +# +# pkg:gem/activesupport#lib/active_support/string_inquirer.rb:21 +class ActiveSupport::StringInquirer < ::String + private + + # pkg:gem/activesupport#lib/active_support/string_inquirer.rb:27 + def method_missing(method_name, *_arg1, **_arg2, &_arg3); end + + # pkg:gem/activesupport#lib/active_support/string_inquirer.rb:23 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end +end + +# = Active Support Structured Event \Subscriber +# +# +ActiveSupport::StructuredEventSubscriber+ consumes ActiveSupport::Notifications +# in order to emit structured events via +Rails.event+. +# +# An example would be the Action Controller structured event subscriber, responsible for +# emitting request processing events: +# +# module ActionController +# class StructuredEventSubscriber < ActiveSupport::StructuredEventSubscriber +# attach_to :action_controller +# +# def start_processing(event) +# emit_event("controller.request_started", +# controller: event.payload[:controller], +# action: event.payload[:action], +# format: event.payload[:format] +# ) +# end +# end +# end +# +# After configured, whenever a "start_processing.action_controller" notification is published, +# it will properly dispatch the event (+ActiveSupport::Notifications::Event+) to the +start_processing+ method. +# The subscriber can then emit a structured event via the +emit_event+ method. +# +# pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:31 +class ActiveSupport::StructuredEventSubscriber < ::ActiveSupport::Subscriber + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:56 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:88 + def call(event); end + + # Like +emit_event+, but only emits when the event reporter is in debug mode + # + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:82 + def emit_debug_event(name, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # Emit a structured event via Rails.event.notify. + # + # ==== Arguments + # + # * +name+ - The event name as a string or symbol + # * +payload+ - The event payload as a hash or object + # * +caller_depth+ - Stack depth for source location (default: 1) + # * +kwargs+ - Additional payload data merged with the payload hash + # + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:75 + def emit_event(name, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:61 + def silenced?(event); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:65 + def silenced_events=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:95 + def handle_event_error(name, error); end + + class << self + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:37 + def attach_to(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def debug_methods; end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def debug_methods=(value); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def debug_methods?; end + + private + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def __class_attr_debug_methods; end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def __class_attr_debug_methods=(new_value); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:50 + def debug_only(method); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:44 + def set_silenced_events; end + end +end + +# pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:34 +ActiveSupport::StructuredEventSubscriber::DEBUG_CHECK = T.let(T.unsafe(nil), Proc) + +# = Active Support \Subscriber +# +# +ActiveSupport::Subscriber+ is an object set to consume +# ActiveSupport::Notifications. The subscriber dispatches notifications to +# a registered object based on its given namespace. +# +# An example would be an Active Record subscriber responsible for collecting +# statistics about queries: +# +# module ActiveRecord +# class StatsSubscriber < ActiveSupport::Subscriber +# attach_to :active_record +# +# def sql(event) +# Statsd.timing("sql.#{event.payload[:name]}", event.duration) +# end +# end +# end +# +# After configured, whenever a "sql.active_record" notification is +# published, it will properly dispatch the event +# (ActiveSupport::Notifications::Event) to the +sql+ method. +# +# We can detach a subscriber as well: +# +# ActiveRecord::StatsSubscriber.detach_from(:active_record) +# +# pkg:gem/activesupport#lib/active_support/subscriber.rb:32 +class ActiveSupport::Subscriber + # pkg:gem/activesupport#lib/active_support/subscriber.rb:70 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:70 + def call(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:70 + def patterns; end + + class << self + # Attach the subscriber to a namespace. + # + # pkg:gem/activesupport#lib/active_support/subscriber.rb:35 + def attach_to(namespace, subscriber = T.unsafe(nil), notifier = T.unsafe(nil), inherit_all: T.unsafe(nil)); end + + # Detach the subscriber from a namespace. + # + # pkg:gem/activesupport#lib/active_support/subscriber.rb:50 + def detach_from(namespace, notifier = T.unsafe(nil)); end + + # Adds event subscribers for all new methods added to the class. + # + # pkg:gem/activesupport#lib/active_support/subscriber.rb:69 + def method_added(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:79 + def subscribers; end + + private + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:86 + def add_event_subscriber(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:124 + def fetch_public_methods(subscriber, inherit_all); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:108 + def find_attached_subscriber; end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:112 + def invalid_event?(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:84 + def namespace; end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:84 + def notifier; end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:120 + def pattern_subscribed?(pattern); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:116 + def prepare_pattern(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:97 + def remove_event_subscriber(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:84 + def subscriber; end + end +end + +# This is a class for wrapping syntax errors. The purpose of this class +# is to enhance the backtraces on SyntaxError exceptions to include the +# source location of the syntax error. That way we can display the error +# source on error pages in development. +# +# pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:10 +class ActiveSupport::SyntaxErrorProxy + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:11 + def backtrace; end + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:41 + def backtrace_locations; end + + private + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:54 + def parse_message_for_trace; end +end + +# pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:15 +class ActiveSupport::SyntaxErrorProxy::BacktraceLocation < ::Struct + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:25 + def absolute_path; end + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:22 + def base_label; end + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:19 + def label; end + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:16 + def spot(_); end +end + +# pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:30 +class ActiveSupport::SyntaxErrorProxy::BacktraceLocationProxy + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:31 + def initialize(loc, ex); end + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:36 + def spot(_); end +end + +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:6 +class ActiveSupport::TagStack + class << self + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:11 + def tags; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:15 + def with_tags(*args, **kwargs); end + + private + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:30 + def resolve_tags(args, kwargs); end + end +end + +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:7 +ActiveSupport::TagStack::EMPTY_TAGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:8 +ActiveSupport::TagStack::FIBER_KEY = T.let(T.unsafe(nil), Symbol) + +# = Active Support Tagged Logging +# +# Wraps any standard Logger object to provide tagging capabilities. +# +# May be called with a block: +# +# logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT)) +# logger.tagged('BCX') { logger.info 'Stuff' } # Logs "[BCX] Stuff" +# logger.tagged('BCX', "Jason") { |tagged_logger| tagged_logger.info 'Stuff' } # Logs "[BCX] [Jason] Stuff" +# logger.tagged('BCX') { logger.tagged('Jason') { logger.info 'Stuff' } } # Logs "[BCX] [Jason] Stuff" +# +# If called without a block, a new logger will be returned with applied tags: +# +# logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT)) +# logger.tagged("BCX").info "Stuff" # Logs "[BCX] Stuff" +# logger.tagged("BCX", "Jason").info "Stuff" # Logs "[BCX] [Jason] Stuff" +# logger.tagged("BCX").tagged("Jason").info "Stuff" # Logs "[BCX] [Jason] Stuff" +# +# This is used by the default Rails.logger as configured by Railties to make +# it easy to stamp log lines with subdomains, request ids, and anything else +# to aid debugging of multi-user production applications. +# +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:29 +module ActiveSupport::TaggedLogging + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:139 + def clear_tags!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:152 + def flush; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:139 + def pop_tags(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:139 + def push_tags(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:141 + def tagged(*tags); end + + class << self + # Returns an `ActiveSupport::Logger` that has already been wrapped with tagged logging concern. + # + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:117 + def logger(*args, **kwargs); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:121 + def new(logger); end + end +end + +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:30 +module ActiveSupport::TaggedLogging::Formatter + # This method is invoked when a log event occurs. + # + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:32 + def call(severity, timestamp, progname, msg); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:51 + def clear_tags!; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:61 + def current_tags; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:47 + def pop_tags(count = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:43 + def push_tags(*tags); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:55 + def tag_stack; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:36 + def tagged(*tags); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:65 + def tags_text; end +end + +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:108 +module ActiveSupport::TaggedLogging::LocalTagStorage + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:109 + def tag_stack; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:109 + def tag_stack=(_arg0); end + + class << self + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:111 + def extended(base); end + end +end + +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:70 +class ActiveSupport::TaggedLogging::TagStack + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:73 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:91 + def clear; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:96 + def format_message(message); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:86 + def pop_tags(count); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:78 + def push_tags(tags); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:71 + def tags; end +end + +# pkg:gem/activesupport#lib/active_support/test_case.rb:23 +class ActiveSupport::TestCase < ::Minitest::Test + include ::ActiveSupport::Testing::SetupAndTeardown + include ::ActiveSupport::Testing::TestsWithoutAssertions + include ::ActiveSupport::Testing::TaggedLogging + include ::ActiveSupport::Callbacks + include ::ActiveSupport::Testing::Assertions + include ::ActiveSupport::Testing::ErrorReporterAssertions + include ::ActiveSupport::Testing::EventReporterAssertions + include ::ActiveSupport::Testing::NotificationAssertions + include ::ActiveSupport::Testing::Deprecation + include ::ActiveSupport::Testing::ConstantStubbing + include ::ActiveSupport::Testing::TimeHelpers + include ::ActiveSupport::Testing::FileFixtures + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + extend ::ActiveSupport::Testing::SetupAndTeardown::ClassMethods + extend ::ActiveSupport::Testing::Declarative + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _run_setup_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _run_setup_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _run_teardown_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _run_teardown_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _setup_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _teardown_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:302 + def assert_no_match(matcher, obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:225 + def assert_not_empty(obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:236 + def assert_not_equal(exp, act, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:247 + def assert_not_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:258 + def assert_not_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:269 + def assert_not_includes(collection, obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:280 + def assert_not_instance_of(cls, obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:291 + def assert_not_kind_of(cls, obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:313 + def assert_not_nil(obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:324 + def assert_not_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:335 + def assert_not_predicate(o1, op, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:346 + def assert_not_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:357 + def assert_not_same(exp, act, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 + def file_fixture_path; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 + def file_fixture_path?; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:361 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:196 + def method_name; end + + # Returns the current parallel worker ID if tests are running in parallel + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:199 + def parallel_worker_id; end + + class << self + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def __callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _setup_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _setup_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _teardown_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _teardown_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 + def file_fixture_path; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 + def file_fixture_path=(value); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 + def file_fixture_path?; end + + # Returns the current parallel worker ID if tests are running in parallel, + # nil otherwise. + # + # ActiveSupport::TestCase.parallel_worker_id # => 2 + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:34 + def parallel_worker_id; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:38 + def parallel_worker_id=(value); end + + # Parallelizes the test suite. + # + # Takes a +workers+ argument that controls how many times the process + # is forked. For each process a new database will be created suffixed + # with the worker number. + # + # test-database_0 + # test-database_1 + # + # If ENV["PARALLEL_WORKERS"] is set the workers argument will be ignored + # and the environment variable will be used instead. This is useful for CI + # environments, or other environments where you may need more workers than + # you do for local testing. + # + # If the number of workers is set to +1+ or fewer, the tests will not be + # parallelized. + # + # If +workers+ is set to +:number_of_processors+, the number of workers will be + # set to the actual core count on the machine you are on. + # + # The default parallelization method is to fork processes. If you'd like to + # use threads instead you can pass with: :threads to the +parallelize+ + # method. Note the threaded parallelization does not create multiple + # databases and will not work with system tests. + # + # parallelize(workers: :number_of_processors, with: :threads) + # + # The threaded parallelization uses minitest's parallel executor directly. + # The processes parallelization uses a Ruby DRb server. + # + # Because parallelization presents an overhead, it is only enabled when the + # number of tests to run is above the +threshold+ param. The default value is + # 50, and it's configurable via +config.active_support.test_parallelization_threshold+. + # + # If you want to skip Rails default creation of one database per process in favor of + # writing your own implementation, you can set +parallelize_databases+, or configure it + # via +config.active_support.parallelize_test_databases+. + # + # parallelize(workers: :number_of_processors, parallelize_databases: false) + # + # Note that your test suite may deadlock if you attempt to use only one database + # with multiple processes. + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:113 + def parallelize(workers: T.unsafe(nil), with: T.unsafe(nil), threshold: T.unsafe(nil), parallelize_databases: T.unsafe(nil)); end + + # Before fork hook for parallel testing. This can be used to run anything + # before the processes are forked. + # + # In your +test_helper.rb+ add the following: + # + # class ActiveSupport::TestCase + # parallelize_before_fork do + # # run this before fork + # end + # end + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:138 + def parallelize_before_fork(&block); end + + # Setup hook for parallel testing. This can be used if you have multiple + # databases or any behavior that needs to be run after the process is forked + # but before the tests run. + # + # Note: this feature is not available with the threaded parallelization. + # + # In your +test_helper.rb+ add the following: + # + # class ActiveSupport::TestCase + # parallelize_setup do + # # create databases + # end + # end + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:155 + def parallelize_setup(&block); end + + # Clean up hook for parallel testing. This can be used to drop databases + # if your app uses multiple write/read databases or other clean up before + # the tests finish. This runs before the forked process is closed. + # + # Note: this feature is not available with the threaded parallelization. + # + # In your +test_helper.rb+ add the following: + # + # class ActiveSupport::TestCase + # parallelize_teardown do + # # drop databases + # end + # end + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:172 + def parallelize_teardown(&block); end + + # Returns the order in which test cases are run. + # + # ActiveSupport::TestCase.test_order # => :random + # + # Possible values are +:random+, +:parallel+, +:alpha+, +:sorted+. + # Defaults to +:random+. + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:61 + def test_order; end + + # Sets the order in which test cases are run. + # + # ActiveSupport::TestCase.test_order = :random # => :random + # + # Valid values are: + # * +:random+ (to run tests in random order) + # * +:parallel+ (to run tests in parallel) + # * +:sorted+ (to run tests alphabetically by method name) + # * +:alpha+ (equivalent to +:sorted+) + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:51 + def test_order=(new_order); end + + private + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def __class_attr___callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 + def __class_attr_file_fixture_path; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 + def __class_attr_file_fixture_path=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/test_case.rb:24 +ActiveSupport::TestCase::Assertion = Minitest::Assertion + +# pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:4 +module ActiveSupport::Testing; end + +# pkg:gem/activesupport#lib/active_support/testing/assertions.rb:7 +module ActiveSupport::Testing::Assertions + # Assertion that the result of evaluating an expression is changed before + # and after invoking the passed in block. + # + # assert_changes 'Status.all_good?' do + # post :create, params: { status: { ok: false } } + # end + # + # You can pass the block as a string to be evaluated in the context of + # the block. A lambda can be passed for the block as well. + # + # assert_changes -> { Status.all_good? } do + # post :create, params: { status: { ok: false } } + # end + # + # The assertion is useful to test side effects. The passed block can be + # anything that can be converted to string with #to_s. + # + # assert_changes :@object do + # @object = 42 + # end + # + # The keyword arguments +:from+ and +:to+ can be given to specify the + # expected initial value and the expected value after the block was + # executed. The comparison is done using case equality (===), which means + # you can specify patterns or classes: + # + # # Exact value match + # assert_changes :@object, from: nil, to: :foo do + # @object = :foo + # end + # + # # Case equality + # assert_changes -> { user.token }, to: /\w{32}/ do + # user.generate_token + # end + # + # # Type check + # assert_changes -> { current_error }, from: nil, to: RuntimeError do + # raise "Oops" + # end + # + # An error message can be specified. + # + # assert_changes -> { Status.all_good? }, 'Expected the status to be bad' do + # post :create, params: { status: { incident: true } } + # end + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:212 + def assert_changes(expression, message = T.unsafe(nil), from: T.unsafe(nil), to: T.unsafe(nil), &block); end + + # Test numeric difference between the return value of an expression as a + # result of what is evaluated in the yielded block. + # + # assert_difference 'Article.count' do + # post :create, params: { article: {...} } + # end + # + # An arbitrary expression is passed in and evaluated. + # + # assert_difference 'Article.last.comments(:reload).size' do + # post :create, params: { comment: {...} } + # end + # + # An arbitrary positive or negative difference can be specified. + # The default is +1+. + # + # assert_difference 'Article.count', -1 do + # post :delete, params: { id: ... } + # end + # + # An array of expressions can be passed in and evaluated. + # + # assert_difference [ 'Article.count', 'Post.count' ], 2 do + # post :create, params: { article: {...} } + # end + # + # A hash of expressions/numeric differences can be passed in and evaluated. + # + # assert_difference({ 'Article.count' => 1, 'Notification.count' => 2 }) do + # post :create, params: { article: {...} } + # end + # + # A lambda, a list of lambdas or a hash of lambdas/numeric differences can be passed in and evaluated: + # + # assert_difference ->{ Article.count }, 2 do + # post :create, params: { article: {...} } + # end + # + # assert_difference [->{ Article.count }, ->{ Post.count }], 2 do + # post :create, params: { article: {...} } + # end + # + # assert_difference ->{ Article.count } => 1, ->{ Notification.count } => 2 do + # post :create, params: { article: {...} } + # end + # + # An error message can be specified. + # + # assert_difference 'Article.count', -1, 'An Article should be destroyed' do + # post :delete, params: { id: ... } + # end + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:105 + def assert_difference(expression, *args, &block); end + + # Assertion that the result of evaluating an expression is not changed before + # and after invoking the passed in block. + # + # assert_no_changes 'Status.all_good?' do + # post :create, params: { status: { ok: true } } + # end + # + # Provide the optional keyword argument +:from+ to specify the expected + # initial value. The comparison is done using case equality (===), which means + # you can specify patterns or classes: + # + # # Exact value match + # assert_no_changes -> { Status.all_good? }, from: true do + # post :create, params: { status: { ok: true } } + # end + # + # # Case equality + # assert_no_changes -> { user.token }, from: /\w{32}/ do + # user.touch + # end + # + # # Type check + # assert_no_changes -> { current_error }, from: RuntimeError do + # retry_operation + # end + # + # An error message can be specified. + # + # assert_no_changes -> { Status.all_good? }, 'Expected the status to be good' do + # post :create, params: { status: { ok: false } } + # end + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:281 + def assert_no_changes(expression, message = T.unsafe(nil), from: T.unsafe(nil), &block); end + + # Assertion that the numeric result of evaluating an expression is not + # changed before and after invoking the passed in block. + # + # assert_no_difference 'Article.count' do + # post :create, params: { article: invalid_attributes } + # end + # + # A lambda can be passed in and evaluated. + # + # assert_no_difference -> { Article.count } do + # post :create, params: { article: invalid_attributes } + # end + # + # An error message can be specified. + # + # assert_no_difference 'Article.count', 'An Article should not be created' do + # post :create, params: { article: invalid_attributes } + # end + # + # An array of expressions can also be passed in and evaluated. + # + # assert_no_difference [ 'Article.count', -> { Post.count } ] do + # post :create, params: { article: invalid_attributes } + # end + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:162 + def assert_no_difference(expression, message = T.unsafe(nil), &block); end + + # Asserts that an expression is not truthy. Passes if +object+ is +nil+ or + # +false+. "Truthy" means "considered true in a conditional" like if + # foo. + # + # assert_not nil # => true + # assert_not false # => true + # assert_not 'foo' # => Expected "foo" to be nil or false + # + # An error message can be specified. + # + # assert_not foo, 'foo should be false' + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:21 + def assert_not(object, message = T.unsafe(nil)); end + + # Assertion that the block should not raise an exception. + # + # Passes if evaluated code in the yielded block raises no exception. + # + # assert_nothing_raised do + # perform_service(param: 'no_exception') + # end + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:48 + def assert_nothing_raised; end + + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:39 + def assert_raise(*exp, match: T.unsafe(nil), &block); end + + # Asserts that a block raises one of +exp+. This is an enhancement of the + # standard Minitest assertion method with the ability to test error + # messages. + # + # assert_raises(ArgumentError, match: /incorrect param/i) do + # perform_service(param: 'exception') + # end + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:34 + def assert_raises(*exp, match: T.unsafe(nil), &block); end + + private + + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:316 + def _assert_nothing_raised_or_warn(assertion, &block); end + + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:331 + def _callable_to_source_string(callable); end +end + +# pkg:gem/activesupport#lib/active_support/testing/assertions.rb:8 +ActiveSupport::Testing::Assertions::UNTRACKED = T.let(T.unsafe(nil), Object) + +# Resolves a constant from a minitest spec name. +# +# Given the following spec-style test: +# +# describe WidgetsController, :index do +# describe "authenticated user" do +# describe "returns widgets" do +# it "has a controller that exists" do +# assert_kind_of WidgetsController, @controller +# end +# end +# end +# end +# +# The test will have the following name: +# +# "WidgetsController::index::authenticated user::returns widgets" +# +# The constant WidgetsController can be resolved from the name. +# The following code will resolve the constant: +# +# controller = determine_constant_from_test_name(name) do |constant| +# Class === constant && constant < ::ActionController::Metal +# end +# +# pkg:gem/activesupport#lib/active_support/testing/constant_lookup.rb:32 +module ActiveSupport::Testing::ConstantLookup + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods +end + +# pkg:gem/activesupport#lib/active_support/testing/constant_lookup.rb:35 +module ActiveSupport::Testing::ConstantLookup::ClassMethods + # pkg:gem/activesupport#lib/active_support/testing/constant_lookup.rb:36 + def determine_constant_from_test_name(test_name); end +end + +# pkg:gem/activesupport#lib/active_support/testing/constant_stubbing.rb:5 +module ActiveSupport::Testing::ConstantStubbing + # Changes the value of a constant for the duration of a block. Example: + # + # # World::List::Import::LARGE_IMPORT_THRESHOLD = 5000 + # stub_const(World::List::Import, :LARGE_IMPORT_THRESHOLD, 1) do + # assert_equal 1, World::List::Import::LARGE_IMPORT_THRESHOLD + # end + # + # assert_equal 5000, World::List::Import::LARGE_IMPORT_THRESHOLD + # + # Using this method rather than forcing World::List::Import::LARGE_IMPORT_THRESHOLD = 5000 prevents + # warnings from being thrown, and ensures that the old value is returned after the test has completed. + # + # If the constant doesn't already exists, but you need it set for the duration of the block + # you can do so by passing `exists: false`. + # + # stub_const(object, :SOME_CONST, 1, exists: false) do + # assert_equal 1, SOME_CONST + # end + # + # Note: Stubbing a const will stub it across all threads. So if you have concurrent threads + # (like separate test suites running in parallel) that all depend on the same constant, it's possible + # divergent stubbing will trample on each other. + # + # pkg:gem/activesupport#lib/active_support/testing/constant_stubbing.rb:28 + def stub_const(mod, constant, new_value, exists: T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/testing/declarative.rb:5 +module ActiveSupport::Testing::Declarative + # Helper to define a test method using a String. Under the hood, it replaces + # spaces with underscores and defines the test method. + # + # test "verify something" do + # ... + # end + # + # pkg:gem/activesupport#lib/active_support/testing/declarative.rb:13 + def test(name, &block); end +end + +# pkg:gem/activesupport#lib/active_support/testing/deprecation.rb:7 +module ActiveSupport::Testing::Deprecation + # :call-seq: + # assert_deprecated(deprecator, &block) + # assert_deprecated(match, deprecator, &block) + # + # Asserts that a matching deprecation warning was emitted by the given deprecator during the execution of the yielded block. + # + # assert_deprecated(/foo/, CustomDeprecator) do + # CustomDeprecator.warn "foo should no longer be used" + # end + # + # The +match+ object may be a +Regexp+, or +String+ appearing in the message. + # + # assert_deprecated('foo', CustomDeprecator) do + # CustomDeprecator.warn "foo should no longer be used" + # end + # + # If the +match+ is omitted (or explicitly +nil+), any deprecation warning will match. + # + # assert_deprecated(CustomDeprecator) do + # CustomDeprecator.warn "foo should no longer be used" + # end + # + # pkg:gem/activesupport#lib/active_support/testing/deprecation.rb:30 + def assert_deprecated(match = T.unsafe(nil), deprecator = T.unsafe(nil), &block); end + + # Asserts that no deprecation warnings are emitted by the given deprecator during the execution of the yielded block. + # + # assert_not_deprecated(CustomDeprecator) do + # CustomDeprecator.warn "message" # fails assertion + # end + # + # assert_not_deprecated(ActiveSupport::Deprecation.new) do + # CustomDeprecator.warn "message" # passes assertion, different deprecator + # end + # + # pkg:gem/activesupport#lib/active_support/testing/deprecation.rb:55 + def assert_not_deprecated(deprecator, &block); end + + # Returns the return value of the block and an array of all the deprecation warnings emitted by the given + # +deprecator+ during the execution of the yielded block. + # + # collect_deprecations(CustomDeprecator) do + # CustomDeprecator.warn "message" + # ActiveSupport::Deprecation.new.warn "other message" + # :result + # end # => [:result, ["message"]] + # + # pkg:gem/activesupport#lib/active_support/testing/deprecation.rb:69 + def collect_deprecations(deprecator); end +end + +# pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:5 +module ActiveSupport::Testing::ErrorReporterAssertions + # Assertion that the block should cause at least one exception to be reported + # to +Rails.error+. + # + # Passes if the evaluated code in the yielded block reports a matching exception. + # + # assert_error_reported(IOError) do + # Rails.error.report(IOError.new("Oops")) + # end + # + # To test further details about the reported exception, you can use the return + # value. + # + # report = assert_error_reported(IOError) do + # # ... + # end + # assert_equal "Oops", report.error.message + # assert_equal "admin", report.context[:section] + # assert_equal :warning, report.severity + # assert_predicate report, :handled? + # + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:88 + def assert_error_reported(error_class = T.unsafe(nil), &block); end + + # Assertion that the block should not cause an exception to be reported + # to +Rails.error+. + # + # Passes if evaluated code in the yielded block reports no exception. + # + # assert_no_error_reported do + # perform_service(param: 'no_exception') + # end + # + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:62 + def assert_no_error_reported(&block); end + + # Captures reported errors from within the block that match the given + # error class. + # + # reports = capture_error_reports(IOError) do + # Rails.error.report(IOError.new("Oops")) + # Rails.error.report(IOError.new("Oh no")) + # Rails.error.report(StandardError.new) + # end + # + # assert_equal 2, reports.size + # assert_equal "Oops", reports.first.error.message + # assert_equal "Oh no", reports.last.error.message + # + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:118 + def capture_error_reports(error_class = T.unsafe(nil), &block); end +end + +# pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:6 +module ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector + class << self + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:16 + def record; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:29 + def report(error, **kwargs); end + + private + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:38 + def subscribe; end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 +class ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector::Report < ::Struct + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def context; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def context=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def error; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def error=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def handled; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def handled=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:12 + def handled?; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def severity; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def severity=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def source; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def source=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def members; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def new(*_arg0); end + end +end + +# Provides test helpers for asserting on ActiveSupport::EventReporter events. +# +# pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:6 +module ActiveSupport::Testing::EventReporterAssertions + # Asserts that the block causes an event with the given name to be reported + # to +Rails.event+. + # + # Passes if the evaluated code in the yielded block reports a matching event. + # + # assert_event_reported("user.created") do + # Rails.event.notify("user.created", { id: 123 }) + # end + # + # To test further details about the reported event, you can specify payload and tag matchers. + # + # assert_event_reported("user.created", + # payload: { id: 123, name: "John Doe" }, + # tags: { request_id: /[0-9]+/ } + # ) do + # Rails.event.tagged(request_id: "123") do + # Rails.event.notify("user.created", { id: 123, name: "John Doe" }) + # end + # end + # + # The matchers support partial matching - only the specified keys need to match. + # + # assert_event_reported("user.created", payload: { id: 123 }) do + # Rails.event.notify("user.created", { id: 123, name: "John Doe" }) + # end + # + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:142 + def assert_event_reported(name, payload: T.unsafe(nil), tags: T.unsafe(nil), &block); end + + # Asserts that the provided events were reported, regardless of order. + # + # assert_events_reported([ + # { name: "user.created", payload: { id: 123 } }, + # { name: "email.sent", payload: { to: "user@example.com" } } + # ]) do + # create_user_and_send_welcome_email + # end + # + # Supports the same payload and tag matching as +assert_event_reported+. + # + # assert_events_reported([ + # { + # name: "process.started", + # payload: { id: 123 }, + # tags: { request_id: /[0-9]+/ } + # }, + # { name: "process.completed" } + # ]) do + # Rails.event.tagged(request_id: "456") do + # start_and_complete_process(123) + # end + # end + # + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:184 + def assert_events_reported(expected_events, &block); end + + # Asserts that the block does not cause an event to be reported to +Rails.event+. + # + # If no name is provided, passes if evaluated code in the yielded block reports no events. + # + # assert_no_event_reported do + # service_that_does_not_report_events.perform + # end + # + # If a name is provided, passes if evaluated code in the yielded block reports no events + # with that name. + # + # assert_no_event_reported("user.created") do + # service_that_does_not_report_events.perform + # end + # + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:101 + def assert_no_event_reported(name = T.unsafe(nil), payload: T.unsafe(nil), tags: T.unsafe(nil), &block); end + + # Allows debug events to be reported to +Rails.event+ for the duration of a given block. + # + # with_debug_event_reporting do + # service_that_reports_debug_events.perform + # end + # + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:222 + def with_debug_event_reporting(&block); end +end + +# pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:7 +module ActiveSupport::Testing::EventReporterAssertions::EventCollector + class << self + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:46 + def emit(event); end + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:53 + def record; end + + private + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:81 + def event_recorders; end + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:66 + def subscribe; end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:11 +class ActiveSupport::Testing::EventReporterAssertions::EventCollector::Event + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:14 + def initialize(event_data); end + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:12 + def event_data; end + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:18 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:22 + def matches?(name, payload, tags); end + + private + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:34 + def matches_hash?(expected_hash, event_key); end +end + +# Adds simple access to sample files called file fixtures. +# File fixtures are normal files stored in +# ActiveSupport::TestCase.file_fixture_path. +# +# File fixtures are represented as +Pathname+ objects. +# This makes it easy to extract specific information: +# +# file_fixture("example.txt").read # get the file's content +# file_fixture("example.mp3").size # get the file size +# +# pkg:gem/activesupport#lib/active_support/testing/file_fixtures.rb:16 +module ActiveSupport::Testing::FileFixtures + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + # Returns a +Pathname+ to the fixture file named +fixture_name+. + # + # Raises +ArgumentError+ if +fixture_name+ can't be found. + # + # pkg:gem/activesupport#lib/active_support/testing/file_fixtures.rb:26 + def file_fixture(fixture_name); end + + module GeneratedClassMethods + def file_fixture_path; end + def file_fixture_path=(value); end + def file_fixture_path?; end + end + + module GeneratedInstanceMethods + def file_fixture_path; end + def file_fixture_path?; end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:7 +module ActiveSupport::Testing::Isolation + include ::ActiveSupport::Testing::Isolation::Forking + + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:20 + def run; end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:16 + def forking_env?; end + + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:10 + def included(klass); end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:35 +module ActiveSupport::Testing::Isolation::Forking + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:36 + def run_in_isolation(&blk); end +end + +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:73 +module ActiveSupport::Testing::Isolation::Subprocess + # Complicated H4X to get this working in Windows / JRuby with + # no forking. + # + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:78 + def run_in_isolation(&blk); end +end + +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:74 +ActiveSupport::Testing::Isolation::Subprocess::ORIG_ARGV = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:8 +class ActiveSupport::Testing::Isolation::SubprocessCrashed < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:5 +module ActiveSupport::Testing::NotificationAssertions + # Assert no notifications were emitted for a given +pattern+. + # + # You can assert no notifications were emitted by passing a pattern, which accepts + # either a string or regexp, and a block. While the block is executed, if no + # matching notifications are emitted, the assertion will pass. + # + # assert_no_notifications("post.submitted") do + # post.destroy # => emits non-matching notification + # end + # + # pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:66 + def assert_no_notifications(pattern = T.unsafe(nil), &block); end + + # Assert a notification was emitted with a given +pattern+ and optional +payload+. + # + # You can assert that a notification was emitted by passing a pattern, which accepts + # either a string or regexp, an optional payload, and a block. While the block + # is executed, if a matching notification is emitted, the assertion will pass + # and the notification will be returned. + # + # Note that the payload is matched as a subset, meaning that the notification must + # contain at least the specified keys and values, but may contain additional ones. + # + # assert_notification("post.submitted", title: "Cool Post") do + # post.submit(title: "Cool Post", body: "Cool Body") # => emits matching notification + # end + # + # Using the returned notification, you can make more customized assertions. + # + # notification = assert_notification("post.submitted", title: "Cool Post") do + # ActiveSupport::Notifications.instrument("post.submitted", title: "Cool Post", body: Body.new("Cool Body")) + # end + # + # assert_instance_of(Body, notification.payload[:body]) + # + # pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:28 + def assert_notification(pattern, payload = T.unsafe(nil), &block); end + + # Assert the number of notifications emitted with a given +pattern+. + # + # You can assert the number of notifications emitted by passing a pattern, which accepts + # either a string or regexp, a count, and a block. While the block is executed, + # the number of matching notifications emitted will be counted. After the block's + # execution completes, the assertion will pass if the count matches. + # + # assert_notifications_count("post.submitted", 1) do + # post.submit(title: "Cool Post") # => emits matching notification + # end + # + # pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:51 + def assert_notifications_count(pattern, count, &block); end + + # Capture emitted notifications, optionally filtered by a +pattern+. + # + # You can capture emitted notifications, optionally filtered by a pattern, + # which accepts either a string or regexp, and a block. + # + # notifications = capture_notifications("post.submitted") do + # post.submit(title: "Cool Post") # => emits matching notification + # end + # + # pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:85 + def capture_notifications(pattern = T.unsafe(nil), &block); end +end + +# pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:8 +class ActiveSupport::Testing::Parallelization + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:36 + def initialize(worker_count); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:54 + def <<(work); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:26 + def after_fork_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:43 + def before_fork; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:18 + def before_fork_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:34 + def run_cleanup_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:62 + def shutdown; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:58 + def size; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:47 + def start; end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:22 + def after_fork_hook(&blk); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:26 + def after_fork_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:14 + def before_fork_hook(&blk); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:18 + def before_fork_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:30 + def run_cleanup_hook(&blk); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:34 + def run_cleanup_hooks; end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 +class ActiveSupport::Testing::Parallelization::PrerecordResultClass < ::Struct + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 + def name; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 + def name=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 + def members; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 + def new(*_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:11 +class ActiveSupport::Testing::Parallelization::Server + include ::DRb::DRbUndumped + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:14 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:32 + def <<(o); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:64 + def active_workers?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:68 + def interrupt; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:37 + def pop; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:21 + def record(reporter, result); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:54 + def remove_dead_workers(dead_pids); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:72 + def shutdown; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:44 + def start_worker(worker_id, worker_pid); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:49 + def stop_worker(worker_id, worker_pid); end +end + +# pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:6 +class ActiveSupport::Testing::Parallelization::Worker + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:7 + def initialize(number, url); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:84 + def after_fork; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:42 + def perform_job(job); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:92 + def run_cleanup; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:60 + def safe_record(reporter, result); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:14 + def start; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:36 + def work_from_queue; end + + private + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:99 + def add_setup_exception(result); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:103 + def set_process_title(status); end +end + +# pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:5 +class ActiveSupport::Testing::ParallelizeExecutor + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:8 + def initialize(size:, with:, threshold: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:22 + def <<(work); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:6 + def parallelize_with; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:26 + def shutdown; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:6 + def size; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:15 + def start; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:6 + def threshold; end + + private + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:35 + def build_parallel_executor; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:72 + def execution_info; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:60 + def many_workers?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:31 + def parallel_executor; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:47 + def parallelize; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:52 + def parallelized?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:56 + def should_parallelize?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:68 + def show_execution_info; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:64 + def tests_count; end +end + +# Adds support for +setup+ and +teardown+ callbacks. +# These callbacks serve as a replacement to overwriting the +# #setup and #teardown methods of your TestCase. +# +# class ExampleTest < ActiveSupport::TestCase +# setup do +# # ... +# end +# +# teardown do +# # ... +# end +# end +# +# pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:20 +module ActiveSupport::Testing::SetupAndTeardown + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:44 + def after_teardown; end + + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:39 + def before_setup; end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:21 + def prepended(klass); end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:27 +module ActiveSupport::Testing::SetupAndTeardown::ClassMethods + # Add a callback, which runs before TestCase#setup. + # + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:29 + def setup(*args, &block); end + + # Add a callback, which runs after TestCase#teardown. + # + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:34 + def teardown(*args, &block); end +end + +# Manages stubs for TimeHelpers +# +# pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:9 +class ActiveSupport::Testing::SimpleStubs + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:12 + def initialize; end + + # Stubs object.method_name with the given block + # If the method is already stubbed, remove that stub + # so that removing this stub will restore the original implementation. + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # target = Time.zone.local(2004, 11, 24, 1, 4, 44) + # simple_stubs.stub_object(Time, :now) { at(target.to_i) } + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:23 + def stub_object(object, method_name, &block); end + + # Returns true if any stubs are set, false if there are none + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:53 + def stubbed?; end + + # Returns the Stub for object#method_name + # (nil if it is not stubbed) + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:48 + def stubbing(object, method_name); end + + # Remove all object-method stubs held by this instance + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:37 + def unstub_all!; end + + private + + # Restores the original object.method described by the Stub + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:59 + def unstub_object(stub); end +end + +# pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 +class ActiveSupport::Testing::SimpleStubs::Stub < ::Struct + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def method_name; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def method_name=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def object; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def object=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def original_method; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def original_method=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def members; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def new(*_arg0); end + end +end + +# Logs a "PostsControllerTest: test name" heading before each test to +# make test.log easier to search and follow along with. +# +# pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:7 +module ActiveSupport::Testing::TaggedLogging + # pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:10 + def before_setup; end + + # pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:8 + def tagged_logger=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:22 + def tagged_logger; end +end + +# Warns when a test case does not perform any assertions. +# +# This is helpful in detecting broken tests that do not perform intended assertions. +# +# pkg:gem/activesupport#lib/active_support/testing/tests_without_assertions.rb:8 +module ActiveSupport::Testing::TestsWithoutAssertions + # pkg:gem/activesupport#lib/active_support/testing/tests_without_assertions.rb:9 + def after_teardown; end +end + +# Contains helpers that help you test passage of time. +# +# pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:68 +module ActiveSupport::Testing::TimeHelpers + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:69 + def after_teardown; end + + # Calls +travel_to+ with +date_or_time+, which defaults to +Time.now+. + # Forwards optional with_usec argument. + # + # Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00 + # freeze_time + # sleep(1) + # Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00 + # freeze_time Time.current + 1.day + # sleep(1) + # Time.current # => Mon, 10 Jul 2017 15:34:49 EST -05:00 + # + # This method also accepts a block, which will return the current time back to its original + # state at the end of the block: + # + # Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00 + # freeze_time do + # sleep(1) + # User.create.created_at # => Sun, 09 Jul 2017 15:34:49 EST -05:00 + # end + # Time.current # => Sun, 09 Jul 2017 15:34:50 EST -05:00 + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:261 + def freeze_time(date_or_time = T.unsafe(nil), with_usec: T.unsafe(nil), &block); end + + # Changes current time to the time in the future or in the past by a given time difference by + # stubbing +Time.now+, +Date.today+, and +DateTime.now+. The stubs are automatically removed + # at the end of the test. + # + # Note that the usec for the resulting time will be set to 0 to prevent rounding + # errors with external services, like MySQL (which will round instead of floor, + # leading to off-by-one-second errors), unless the with_usec argument + # is set to true. + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # travel 1.day + # Time.current # => Sun, 10 Nov 2013 15:34:49 EST -05:00 + # Date.current # => Sun, 10 Nov 2013 + # DateTime.current # => Sun, 10 Nov 2013 15:34:49 -0500 + # + # This method also accepts a block, which will return the current time back to its original + # state at the end of the block: + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # travel 1.day do + # User.create.created_at # => Sun, 10 Nov 2013 15:34:49 EST -05:00 + # end + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:97 + def travel(duration, with_usec: T.unsafe(nil), &block); end + + # Returns the current time back to its original state, by removing the stubs added by + # +travel+, +travel_to+, and +freeze_time+. + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # travel_back + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # This method also accepts a block, which brings the stubs back at the end of the block: + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # travel_back do + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # end + # + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:231 + def travel_back; end + + # Changes current time to the given time by stubbing +Time.now+, +Time.new+, + # +Date.today+, and +DateTime.now+ to return the time or date passed into this method. + # The stubs are automatically removed at the end of the test. + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # Date.current # => Wed, 24 Nov 2004 + # DateTime.current # => Wed, 24 Nov 2004 01:04:44 -0500 + # + # Dates are taken as their timestamp at the beginning of the day in the + # application time zone. Time.current returns said timestamp, + # and Time.now its equivalent in the system time zone. Similarly, + # Date.current returns a date equal to the argument, and + # Date.today the date according to Time.now, which may + # be different. (Note that you rarely want to deal with Time.now, + # or Date.today, in order to honor the application time zone + # please always use Time.current and Date.current.) + # + # Note that the usec for the time passed will be set to 0 to prevent rounding + # errors with external services, like MySQL (which will round instead of floor, + # leading to off-by-one-second errors), unless the with_usec argument + # is set to true. + # + # This method also accepts a block, which will return the current time back to its original + # state at the end of the block: + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) do + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # end + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:133 + def travel_to(date_or_time, with_usec: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:239 + def unfreeze_time; end + + private + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:270 + def in_block; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:270 + def in_block=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:266 + def simple_stubs; end +end + +# = Active Support \Time With Zone +# +# A Time-like class that can represent a time in any time zone. Necessary +# because standard Ruby Time instances are limited to UTC and the +# system's ENV['TZ'] zone. +# +# You shouldn't ever need to create a TimeWithZone instance directly via +new+. +# Instead use methods +local+, +parse+, +at+, and +now+ on TimeZone instances, +# and +in_time_zone+ on Time and DateTime instances. +# +# Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' +# Time.zone.local(2007, 2, 10, 15, 30, 45) # => Sat, 10 Feb 2007 15:30:45.000000000 EST -05:00 +# Time.zone.parse('2007-02-10 15:30:45') # => Sat, 10 Feb 2007 15:30:45.000000000 EST -05:00 +# Time.zone.at(1171139445) # => Sat, 10 Feb 2007 15:30:45.000000000 EST -05:00 +# Time.zone.now # => Sun, 18 May 2008 13:07:55.754107581 EDT -04:00 +# Time.utc(2007, 2, 10, 20, 30, 45).in_time_zone # => Sat, 10 Feb 2007 15:30:45.000000000 EST -05:00 +# +# See Time and TimeZone for further documentation of these methods. +# +# TimeWithZone instances implement the same API as Ruby Time instances, so +# that Time and TimeWithZone instances are interchangeable. +# +# t = Time.zone.now # => Sun, 18 May 2008 13:27:25.031505668 EDT -04:00 +# t.hour # => 13 +# t.dst? # => true +# t.utc_offset # => -14400 +# t.zone # => "EDT" +# t.to_fs(:rfc822) # => "Sun, 18 May 2008 13:27:25 -0400" +# t + 1.day # => Mon, 19 May 2008 13:27:25.031505668 EDT -04:00 +# t.beginning_of_year # => Tue, 01 Jan 2008 00:00:00.000000000 EST -05:00 +# t > Time.utc(1999) # => true +# t.is_a?(Time) # => true +# t.is_a?(ActiveSupport::TimeWithZone) # => true +# +# pkg:gem/activesupport#lib/active_support/time_with_zone.rb:44 +class ActiveSupport::TimeWithZone + include ::DateAndTime::Compatibility + include ::Comparable + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:51 + def initialize(utc_time, time_zone, local_time = T.unsafe(nil), period = T.unsafe(nil)); end + + # Adds an interval of time to the current object's time and returns that + # value as a new TimeWithZone object. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 + # now + 1000 # => Sun, 02 Nov 2014 01:43:08.725182881 EDT -04:00 + # + # If we're adding a Duration of variable length (i.e., years, months, days), + # move forward from #time, otherwise move forward from #utc, for accuracy + # when moving across DST boundaries. + # + # For instance, a time + 24.hours will advance exactly 24 hours, while a + # time + 1.day will advance 23-25 hours, depending on the day. + # + # now + 24.hours # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 + # now + 1.day # => Mon, 03 Nov 2014 01:26:28.725182881 EST -05:00 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:314 + def +(other); end + + # Subtracts an interval of time and returns a new TimeWithZone object unless + # the other value +acts_like?+ time. In which case, it will subtract the + # other time and return the difference in seconds as a Float. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # now = Time.zone.now # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 + # now - 1000 # => Mon, 03 Nov 2014 00:09:48.725182881 EST -05:00 + # + # If subtracting a Duration of variable length (i.e., years, months, days), + # move backward from #time, otherwise move backward from #utc, for accuracy + # when moving across DST boundaries. + # + # For instance, a time - 24.hours will go subtract exactly 24 hours, while a + # time - 1.day will subtract 23-25 hours, depending on the day. + # + # now - 24.hours # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 + # now - 1.day # => Sun, 02 Nov 2014 00:26:28.725182881 EDT -04:00 + # + # If both the TimeWithZone object and the other value act like Time, a Float + # will be returned. + # + # Time.zone.now - 1.day.ago # => 86399.999967 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:349 + def -(other); end + + # Use the time in UTC for comparisons. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:247 + def <=>(other); end + + # So that +self+ acts_like?(:time). + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:506 + def acts_like_time?; end + + # Uses Date to provide precise Time calculations for years, months, and days + # according to the proleptic Gregorian calendar. The result is returned as a + # new TimeWithZone object. + # + # The +options+ parameter takes a hash with any of these keys: + # :years, :months, :weeks, :days, + # :hours, :minutes, :seconds. + # + # If advancing by a value of variable length (i.e., years, weeks, months, + # days), move forward from #time, otherwise move forward from #utc, for + # accuracy when moving across DST boundaries. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28.558049687 EDT -04:00 + # now.advance(seconds: 1) # => Sun, 02 Nov 2014 01:26:29.558049687 EDT -04:00 + # now.advance(minutes: 1) # => Sun, 02 Nov 2014 01:27:28.558049687 EDT -04:00 + # now.advance(hours: 1) # => Sun, 02 Nov 2014 01:26:28.558049687 EST -05:00 + # now.advance(days: 1) # => Mon, 03 Nov 2014 01:26:28.558049687 EST -05:00 + # now.advance(weeks: 1) # => Sun, 09 Nov 2014 01:26:28.558049687 EST -05:00 + # now.advance(months: 1) # => Tue, 02 Dec 2014 01:26:28.558049687 EST -05:00 + # now.advance(years: 1) # => Mon, 02 Nov 2015 01:26:28.558049687 EST -05:00 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:438 + def advance(options); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:251 + def after?(_arg0); end + + # Subtracts an interval of time from the current object's time and returns + # the result as a new TimeWithZone object. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # now = Time.zone.now # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 + # now.ago(1000) # => Mon, 03 Nov 2014 00:09:48.725182881 EST -05:00 + # + # If we're subtracting a Duration of variable length (i.e., years, months, + # days), move backward from #time, otherwise move backward from #utc, for + # accuracy when moving across DST boundaries. + # + # For instance, time.ago(24.hours) will move back exactly 24 hours, + # while time.ago(1.day) will move back 23-25 hours, depending on + # the day. + # + # now.ago(24.hours) # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 + # now.ago(1.day) # => Sun, 02 Nov 2014 00:26:28.725182881 EDT -04:00 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:377 + def ago(other); end + + # Coerces time to a string for JSON encoding. The default format is ISO 8601. + # You can get %Y/%m/%d %H:%M:%S +offset style by setting + # ActiveSupport::JSON::Encoding.use_standard_json_time_format + # to +false+. + # + # # With ActiveSupport::JSON::Encoding.use_standard_json_time_format = true + # Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").as_json + # # => "2005-02-01T05:15:10.000-10:00" + # + # # With ActiveSupport::JSON::Encoding.use_standard_json_time_format = false + # Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").as_json + # # => "2005/02/01 05:15:10 -1000" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:182 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:250 + def before?(_arg0); end + + # Returns true if the current object's time is within the specified + # +min+ and +max+ time. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:255 + def between?(min, max); end + + # An instance of ActiveSupport::TimeWithZone is never blank + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:517 + def blank?; end + + # Returns a new +ActiveSupport::TimeWithZone+ where one or more of the elements have + # been changed according to the +options+ parameter. The time options (:hour, + # :min, :sec, :usec, :nsec) reset cascadingly, + # so if only the hour is passed, then minute, sec, usec, and nsec is set to 0. If the + # hour and minute is passed, then sec, usec, and nsec is set to 0. The +options+ + # parameter takes a hash with any of these keys: :year, :month, + # :day, :hour, :min, :sec, :usec, + # :nsec, :offset, :zone. Pass either :usec + # or :nsec, not both. Similarly, pass either :zone or + # :offset, not both. + # + # t = Time.zone.now # => Fri, 14 Apr 2017 11:45:15.116992711 EST -05:00 + # t.change(year: 2020) # => Tue, 14 Apr 2020 11:45:15.116992711 EST -05:00 + # t.change(hour: 12) # => Fri, 14 Apr 2017 12:00:00.000000000 EST -05:00 + # t.change(min: 30) # => Fri, 14 Apr 2017 11:30:00.000000000 EST -05:00 + # t.change(offset: "-10:00") # => Fri, 14 Apr 2017 11:45:15.116992711 HST -10:00 + # t.change(zone: "Hawaii") # => Fri, 14 Apr 2017 11:45:15.116992711 HST -10:00 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:398 + def change(options); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:72 + def comparable_time; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def day; end + + # Returns true if the current time is within Daylight Savings \Time for the + # specified time zone. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # Time.zone.parse("2012-5-30").dst? # => true + # Time.zone.parse("2012-11-30").dst? # => false + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:100 + def dst?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:194 + def encode_with(coder); end + + # Returns +true+ if +other+ is equal to current object. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:290 + def eql?(other); end + + # Returns a formatted string of the offset from UTC, or an alternative + # string if the time zone is already UTC. + # + # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" + # Time.zone.now.formatted_offset(true) # => "-05:00" + # Time.zone.now.formatted_offset(false) # => "-0500" + # Time.zone = 'UTC' # => "UTC" + # Time.zone.now.formatted_offset(true, "0") # => "0" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:131 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:525 + def freeze; end + + # Returns true if the current object's time is in the future. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:285 + def future?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:73 + def getgm; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:92 + def getlocal(utc_offset = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:74 + def getutc; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:114 + def gmt?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:120 + def gmt_offset; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:75 + def gmtime; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:121 + def gmtoff; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:294 + def hash; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def hour; end + + # Returns a string of the object's date and time in the format used by + # HTTP requests. + # + # Time.zone.now.httpdate # => "Tue, 01 Jan 2013 04:39:43 GMT" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:202 + def httpdate; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:324 + def in(other); end + + # Returns the simultaneous time in Time.zone, or the specified zone. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:83 + def in_time_zone(new_zone = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:190 + def init_with(coder); end + + # Returns a string of the object's date, time, zone, and offset from UTC. + # + # Time.zone.now.inspect # => "2024-11-13 07:00:10.528054960 UTC +00:00" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:146 + def inspect; end + + # Say we're a Time to thwart type checking. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:511 + def is_a?(klass); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:103 + def isdst; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:167 + def iso8601(fraction_digits = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:514 + def kind_of?(klass); end + + # Returns a Time instance of the simultaneous time in the system timezone. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:89 + def localtime(utc_offset = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:531 + def marshal_dump; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:535 + def marshal_load(variables); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def mday; end + + # Send the missing method to +time+ instance, and wrap result in a new + # TimeWithZone with the existing +time_zone+. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:555 + def method_missing(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def min; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def mon; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def month; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:275 + def next_day?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def nsec; end + + # Returns true if the current object's time is in the past. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:260 + def past?; end + + # Returns the underlying +TZInfo::TimezonePeriod+. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:78 + def period; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:521 + def present?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:282 + def prev_day?; end + + # respond_to_missing? is not called in some cases, such as when type conversion is + # performed with Kernel#String + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:541 + def respond_to?(sym, include_priv = T.unsafe(nil)); end + + # Returns a string of the object's date and time in the RFC 2822 standard + # format. + # + # Time.zone.now.rfc2822 # => "Tue, 01 Jan 2013 04:51:39 +0000" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:210 + def rfc2822; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:168 + def rfc3339(fraction_digits = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:213 + def rfc822; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def sec; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:323 + def since(other); end + + # Replaces %Z directive with +zone before passing to Time#strftime, + # so that zone information is correct. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:241 + def strftime(format); end + + # Returns a Time instance that represents the time in +time_zone+. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:64 + def time; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:49 + def time_zone; end + + # Returns Array of parts of Time in sequence of + # [seconds, minutes, hours, day, month, year, weekday, yearday, dst?, zone]. + # + # now = Time.zone.now # => Tue, 18 Aug 2015 02:29:27.485278555 UTC +00:00 + # now.to_a # => [27, 29, 2, 18, 8, 2015, 2, 230, false, "UTC"] + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:461 + def to_a; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def to_date; end + + # Returns an instance of DateTime with the timezone's UTC offset + # + # Time.zone.now.to_datetime # => Tue, 18 Aug 2015 02:32:20 +0000 + # Time.current.in_time_zone('Hawaii').to_datetime # => Mon, 17 Aug 2015 16:32:20 -1000 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:494 + def to_datetime; end + + # Returns the object's date and time as a floating-point number of seconds + # since the Epoch (January 1, 1970 00:00 UTC). + # + # Time.zone.now.to_f # => 1417709320.285418 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:469 + def to_f; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:237 + def to_formatted_s(format = T.unsafe(nil)); end + + # Returns a string of the object's date and time. + # + # This method is aliased to to_formatted_s. + # + # Accepts an optional format: + # * :default - default value, mimics Ruby Time#to_s format. + # * :db - format outputs time in UTC :db time. See Time#to_fs(:db). + # * Any key in +Time::DATE_FORMATS+ can be used. See active_support/core_ext/time/conversions.rb. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:228 + def to_fs(format = T.unsafe(nil)); end + + # Returns the object's date and time as an integer number of seconds + # since the Epoch (January 1, 1970 00:00 UTC). + # + # Time.zone.now.to_i # => 1417709320 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:477 + def to_i; end + + # Returns the object's date and time as a rational number of seconds + # since the Epoch (January 1, 1970 00:00 UTC). + # + # Time.zone.now.to_r # => (708854548642709/500000) + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:486 + def to_r; end + + # Returns a string of the object's date and time. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:216 + def to_s; end + + # Returns an instance of +Time+, either with the same timezone as +self+, + # with the same UTC offset as +self+ or in the local system timezone + # depending on the setting of +ActiveSupport.to_time_preserves_timezone+. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:501 + def to_time; end + + # Returns true if the current object's time falls within + # the current day. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:266 + def today?; end + + # Returns true if the current object's time falls within + # the next day (tomorrow). + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:272 + def tomorrow?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:480 + def tv_sec; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def usec; end + + # Returns a Time instance of the simultaneous time in the UTC timezone. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:69 + def utc; end + + # Returns true if the current time zone is set to UTC. + # + # Time.zone = 'UTC' # => 'UTC' + # Time.zone.now.utc? # => true + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # Time.zone.now.utc? # => false + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:111 + def utc?; end + + # Returns the offset from current time to UTC time in seconds. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:117 + def utc_offset; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def wday; end + + # Returns a string of the object's date and time in the ISO 8601 standard + # format. + # + # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05:00" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:154 + def xmlschema(fraction_digits = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def yday; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def year; end + + # Returns true if the current object's time falls within + # the previous day (yesterday). + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:279 + def yesterday?; end + + # Returns the time zone abbreviation. + # + # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" + # Time.zone.now.zone # => "EST" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:139 + def zone; end + + private + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:593 + def duration_of_variable_length?(obj); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:574 + def get_period_and_ensure_valid_local_time(period); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:564 + def incorporate_utc_offset(time, offset); end + + # Ensure proxy class responds to all methods that underlying time instance + # responds to. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:549 + def respond_to_missing?(sym, include_priv); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:587 + def transfer_time_values_to_utc_constructor(time); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:597 + def wrap_with_time_zone(time); end +end + +# pkg:gem/activesupport#lib/active_support/time_with_zone.rb:45 +ActiveSupport::TimeWithZone::PRECISIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/time_with_zone.rb:562 +ActiveSupport::TimeWithZone::SECONDS_PER_DAY = T.let(T.unsafe(nil), Integer) + +# = Active Support \Time Zone +# +# The TimeZone class serves as a wrapper around +TZInfo::Timezone+ instances. +# It allows us to do the following: +# +# * Limit the set of zones provided by TZInfo to a meaningful subset of 134 +# zones. +# * Retrieve and display zones with a friendlier name +# (e.g., "Eastern \Time (US & Canada)" instead of "America/New_York"). +# * Lazily load +TZInfo::Timezone+ instances only when they're needed. +# * Create ActiveSupport::TimeWithZone instances via TimeZone's +local+, +# +parse+, +at+, and +now+ methods. +# +# If you set config.time_zone in the \Rails Application, you can +# access this TimeZone object via Time.zone: +# +# # application.rb: +# class Application < Rails::Application +# config.time_zone = 'Eastern Time (US & Canada)' +# end +# +# Time.zone # => # +# Time.zone.name # => "Eastern Time (US & Canada)" +# Time.zone.now # => Sun, 18 May 2008 14:30:44 EDT -04:00 +# +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:31 +class ActiveSupport::TimeZone + include ::Comparable + + # :stopdoc: + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:310 + def initialize(name, utc_offset = T.unsafe(nil), tzinfo = T.unsafe(nil)); end + + # Compare this time zone to the parameter. The two are compared first on + # their offsets, and then by name. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:340 + def <=>(zone); end + + # Compare #name and TZInfo identifier to a supplied regexp, returning +true+ + # if a match is found. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:349 + def =~(re); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:574 + def abbr(time); end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from number of seconds since the Unix epoch. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.utc(2000).to_f # => 946684800.0 + # Time.zone.at(946684800.0) # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # A second argument can be supplied to specify sub-second precision. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.at(946684800, 123456.789).nsec # => 123456789 + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:386 + def at(*args); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:578 + def dst?(time); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:586 + def encode_with(coder); end + + # Returns a formatted string of the offset from UTC, or an alternative + # string if the time zone is already UTC. + # + # zone = ActiveSupport::TimeZone['Central Time (US & Canada)'] + # zone.formatted_offset # => "-06:00" + # zone.formatted_offset(false) # => "-0600" + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:334 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:582 + def init_with(coder); end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from an ISO 8601 string. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.iso8601('1999-12-31T14:00:00') # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # If the time components are missing then they will be set to zero. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.iso8601('1999-12-31') # => Fri, 31 Dec 1999 00:00:00 HST -10:00 + # + # If the string is invalid then an +ArgumentError+ will be raised unlike +parse+ + # which usually returns +nil+ when given an invalid date string. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:403 + def iso8601(str); end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from given values. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.local(2007, 2, 1, 15, 30, 45) # => Thu, 01 Feb 2007 15:30:45 HST -10:00 + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:370 + def local(*args); end + + # Adjust the given time to the simultaneous time in UTC. Returns a + # Time.utc() instance. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:558 + def local_to_utc(time, dst = T.unsafe(nil)); end + + # Compare #name and TZInfo identifier to a supplied regexp, returning +true+ + # if a match is found. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:355 + def match?(re); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:297 + def name; end + + # Returns an ActiveSupport::TimeWithZone instance representing the current + # time in the time zone represented by +self+. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.now # => Wed, 23 Jan 2008 20:24:27 HST -10:00 + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:523 + def now; end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from parsed string. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.parse('1999-12-31 14:00:00') # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # If upper components are missing from the string, they are supplied from + # TimeZone#now: + # + # Time.zone.now # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # Time.zone.parse('22:30:00') # => Fri, 31 Dec 1999 22:30:00 HST -10:00 + # + # However, if the date component is not provided, but any other upper + # components are supplied, then the day of the month defaults to 1: + # + # Time.zone.parse('Mar 2000') # => Wed, 01 Mar 2000 00:00:00 HST -10:00 + # + # If the string is invalid then an +ArgumentError+ could be raised. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:460 + def parse(str, now = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:566 + def period_for_local(time, dst = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:562 + def period_for_utc(time); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:570 + def periods_for_local(time); end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from an RFC 3339 string. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.rfc3339('2000-01-01T00:00:00Z') # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # If the time or zone components are missing then an +ArgumentError+ will + # be raised. This is much stricter than either +parse+ or +iso8601+ which + # allow for missing components. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.rfc3339('1999-12-31') # => ArgumentError: invalid date + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:476 + def rfc3339(str); end + + # Returns a standard time zone name defined by IANA + # https://www.iana.org/time-zones + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:319 + def standard_name; end + + # Parses +str+ according to +format+ and returns an ActiveSupport::TimeWithZone. + # + # Assumes that +str+ is a time in the time zone +self+, + # unless +format+ includes an explicit time zone. + # (This is the same behavior as +parse+.) + # In either case, the returned TimeWithZone has the timezone of +self+. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.strptime('1999-12-31 14:00:00', '%Y-%m-%d %H:%M:%S') # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # If upper components are missing from the string, they are supplied from + # TimeZone#now: + # + # Time.zone.now # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # Time.zone.strptime('22:30:00', '%H:%M:%S') # => Fri, 31 Dec 1999 22:30:00 HST -10:00 + # + # However, if the date component is not provided, but any other upper + # components are supplied, then the day of the month defaults to 1: + # + # Time.zone.strptime('Mar 2000', '%b %Y') # => Wed, 01 Mar 2000 00:00:00 HST -10:00 + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:514 + def strptime(str, format, now = T.unsafe(nil)); end + + # Returns a textual representation of this time zone. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:361 + def to_s; end + + # Returns the current date in this time zone. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:528 + def today; end + + # Returns the next date in this time zone. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:533 + def tomorrow; end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:298 + def tzinfo; end + + # Returns the offset of this time zone from UTC in seconds. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:324 + def utc_offset; end + + # Adjust the given time to the simultaneous time in the time zone + # represented by +self+. Returns a local time with the appropriate offset + # -- if you want an ActiveSupport::TimeWithZone instance, use + # Time#in_time_zone() instead. + # + # As of tzinfo 2, utc_to_local returns a Time with a non-zero utc_offset. + # See the +utc_to_local_returns_utc_offset_times+ config for more info. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:549 + def utc_to_local(time); end + + # Returns the previous date in this time zone. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:538 + def yesterday; end + + private + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:592 + def parts_to_time(parts, now); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:617 + def time_now; end + + class << self + # Locate a specific time zone object. If the argument is a string, it + # is interpreted to mean the name of the timezone to locate. If it is a + # numeric value it is either the hour offset, or the second offset, of the + # timezone to find. (The first one with that offset will be returned.) + # Returns +nil+ if no such time zone is known to the system. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:233 + def [](arg); end + + # Returns an array of all TimeZone objects. There are multiple + # TimeZone objects per time zone, in many cases, to make it easier + # for users to find their own time zone. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:224 + def all; end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:266 + def clear; end + + # A convenience method for returning a collection of TimeZone objects + # for time zones in the country specified by its ISO 3166-1 Alpha2 code. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:261 + def country_zones(country_code); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:212 + def create(*_arg0); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:208 + def find_tzinfo(name); end + + # Returns a TimeZone instance with the given name, or +nil+ if no + # such TimeZone instance exists. (This exists to support the use of + # this class with the +composed_of+ macro.) + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:217 + def new(name); end + + # Assumes self represents an offset from UTC in seconds (as returned from + # Time#utc_offset) and turns this into an +HH:MM formatted string. + # + # ActiveSupport::TimeZone.seconds_to_utc_offset(-21_600) # => "-06:00" + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:200 + def seconds_to_utc_offset(seconds, colon = T.unsafe(nil)); end + + # A convenience method for returning a collection of TimeZone objects + # for time zones in the USA. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:255 + def us_zones; end + + private + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:274 + def load_country_zones(code); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:288 + def zones_map; end + end +end + +# Keys are \Rails TimeZone names, values are TZInfo identifiers. +# +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:33 +ActiveSupport::TimeZone::MAPPING = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:189 +ActiveSupport::TimeZone::UTC_OFFSET_WITHOUT_COLON = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:188 +ActiveSupport::TimeZone::UTC_OFFSET_WITH_COLON = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:35 +module ActiveSupport::ToJsonWithActiveSupportEncoder + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:36 + def to_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:6 +module ActiveSupport::Tryable + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:7 + def try(*args, **_arg1, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:20 + def try!(*args, **_arg1, &block); end +end + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:9 +module ActiveSupport::VERSION; end + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:10 +ActiveSupport::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:11 +ActiveSupport::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:13 +ActiveSupport::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:15 +ActiveSupport::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:12 +ActiveSupport::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:140 +class ActiveSupport::XMLConverter + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:151 + def initialize(xml, disallowed_types = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:156 + def to_h; end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:222 + def become_array?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:218 + def become_content?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:226 + def become_empty_string?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:232 + def become_hash?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:172 + def deep_to_h(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:241 + def garbage?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:161 + def normalize_keys(params); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:236 + def nothing?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:257 + def process_array(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:248 + def process_content(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:185 + def process_hash(value); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:149 +ActiveSupport::XMLConverter::DISALLOWED_TYPES = T.let(T.unsafe(nil), Array) + +# Raised if the XML contains attributes with type="yaml" or +# type="symbol". Read Hash#from_xml for more details. +# +# pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:143 +class ActiveSupport::XMLConverter::DisallowedType < ::StandardError + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:144 + def initialize(type); end +end + +# = \XmlMini +# +# To use the much faster libxml parser: +# gem "libxml-ruby" +# XmlMini.backend = 'LibXML' +# +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:17 +module ActiveSupport::XmlMini + extend ::ActiveSupport::XmlMini + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:102 + def backend; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:106 + def backend=(name); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:97 + def depth; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:97 + def depth=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:100 + def parse(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:153 + def rename_key(key, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:120 + def to_tag(key, value, options); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:112 + def with_backend(name); end + + private + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:164 + def _dasherize(key); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:170 + def _parse_binary(bin, entity); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:181 + def _parse_file(file, entity); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:189 + def _parse_hex_binary(bin); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:201 + def cast_backend_name_to_module(name); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:193 + def current_thread_backend; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:197 + def current_thread_backend=(name); end +end + +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:34 +ActiveSupport::XmlMini::DEFAULT_ENCODINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:56 +ActiveSupport::XmlMini::FORMATTING = T.let(T.unsafe(nil), Hash) + +# This module decorates files deserialized using Hash.from_xml with +# the original_filename and content_type methods. +# +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:22 +module ActiveSupport::XmlMini::FileLike + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:29 + def content_type; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:23 + def content_type=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:25 + def original_filename; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:23 + def original_filename=(_arg0); end +end + +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:66 +ActiveSupport::XmlMini::PARSING = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:39 +ActiveSupport::XmlMini::TYPE_NAMES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:8 +module ActiveSupport::XmlMini_REXML + extend ::ActiveSupport::XmlMini_REXML + + # Parse an XML Document string or IO into a simple hash. + # + # Same as XmlSimple::xml_in but doesn't shoot itself in the foot, + # and uses the defaults from Active Support. + # + # data:: + # XML Document string or IO to parse + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:20 + def parse(data); end + + private + + # Actually converts an XML document element into a data structure. + # + # element:: + # The document element to be collapsed. + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:63 + def collapse(element, depth); end + + # Determines if a document element has text content + # + # element:: + # XML element to be checked. + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:133 + def empty_content?(element); end + + # Converts the attributes array of an XML element into a hash. + # Returns an empty Hash if node has no attributes. + # + # element:: + # XML element to extract attributes from. + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:123 + def get_attributes(element); end + + # Adds a new key/value pair to an existing Hash. If the key to be added + # already exists and the existing value associated with key is not + # an Array, it will be wrapped in an Array. Then the new value is + # appended to that Array. + # + # hash:: + # Hash to add key/value pair to. + # key:: + # Key to be added. + # value:: + # Value to be associated with key. + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:103 + def merge!(hash, key, value); end + + # Convert an XML element and merge into the hash + # + # hash:: + # Hash to merge the converted element into. + # element:: + # XML element to merge into hash + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:54 + def merge_element!(hash, element, depth); end + + # Merge all the texts of an element into the hash + # + # hash:: + # Hash to add the converted element to. + # element:: + # XML element whose texts are to me merged into the hash + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:81 + def merge_texts!(hash, element); end + + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:41 + def require_rexml; end +end + +# pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:11 +ActiveSupport::XmlMini_REXML::CONTENT_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/core_ext/array/extract.rb:3 +class Array + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:164 + def as_json(options = T.unsafe(nil)); end + + # An array is blank if it's empty: + # + # [].blank? # => true + # [1,2,3].blank? # => false + # + # @return [true, false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:102 + def blank?; end + + # Removes all blank elements from the +Array+ in place and returns self. + # Uses Object#blank? for determining if an item is blank. + # + # a = [1, "", nil, 2, " ", [], {}, false, true] + # a.compact_blank! + # # => [1, 2, true] + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:275 + def compact_blank!; end + + # Returns a deep copy of array. + # + # array = [1, [2, 3]] + # dup = array.deep_dup + # dup[1][2] = 4 + # + # array[1][2] # => nil + # dup[1][2] # => 4 + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/deep_dup.rb:29 + def deep_dup; end + + # Returns a copy of the Array excluding the specified elements. + # + # ["David", "Rafael", "Aaron", "Todd"].excluding("Aaron", "Todd") # => ["David", "Rafael"] + # [ [ 0, 1 ], [ 1, 0 ] ].excluding([ [ 1, 0 ] ]) # => [ [ 0, 1 ] ] + # + # Note: This is an optimization of Enumerable#excluding that uses Array#- + # instead of Array#reject for performance reasons. + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:47 + def excluding(*elements); end + + # Removes and returns the elements for which the block returns a true value. + # If no block is given, an Enumerator is returned instead. + # + # numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + # odd_numbers = numbers.extract! { |number| number.odd? } # => [1, 3, 5, 7, 9] + # numbers # => [0, 2, 4, 6, 8] + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/extract.rb:10 + def extract!; end + + # Extracts options from a set of arguments. Removes and returns the last + # element in the array if it's a hash, otherwise returns a blank hash. + # + # def options(*args) + # args.extract_options! + # end + # + # options(1, 2) # => {} + # options(1, 2, a: :b) # => {:a=>:b} + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/extract_options.rb:24 + def extract_options!; end + + # Equal to self[4]. + # + # %w( a b c d e ).fifth # => "e" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:76 + def fifth; end + + # Equal to self[41]. Also known as accessing "the reddit". + # + # (1..42).to_a.forty_two # => 42 + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:83 + def forty_two; end + + # Equal to self[3]. + # + # %w( a b c d e ).fourth # => "d" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:69 + def fourth; end + + # Returns the tail of the array from +position+. + # + # %w( a b c d ).from(0) # => ["a", "b", "c", "d"] + # %w( a b c d ).from(2) # => ["c", "d"] + # %w( a b c d ).from(10) # => [] + # %w().from(0) # => [] + # %w( a b c d ).from(-2) # => ["c", "d"] + # %w( a b c ).from(-10) # => [] + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:12 + def from(position); end + + # Returns a new array that includes the passed elements. + # + # [ 1, 2, 3 ].including(4, 5) # => [ 1, 2, 3, 4, 5 ] + # [ [ 0, 1 ] ].including([ [ 1, 0 ] ]) # => [ [ 0, 1 ], [ 1, 0 ] ] + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:36 + def including(*elements); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:104 + def present?; end + + # Equal to self[1]. + # + # %w( a b c d e ).second # => "b" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:55 + def second; end + + # Equal to self[-2]. + # + # %w( a b c d e ).second_to_last # => "d" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:97 + def second_to_last; end + + # Equal to self[2]. + # + # %w( a b c d e ).third # => "c" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:62 + def third; end + + # Equal to self[-3]. + # + # %w( a b c d e ).third_to_last # => "c" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:90 + def third_to_last; end + + # Returns the beginning of the array up to +position+. + # + # %w( a b c d ).to(0) # => ["a"] + # %w( a b c d ).to(2) # => ["a", "b", "c"] + # %w( a b c d ).to(10) # => ["a", "b", "c", "d"] + # %w().to(0) # => [] + # %w( a b c d ).to(-2) # => ["a", "b", "c"] + # %w( a b c ).to(-10) # => [] + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:24 + def to(position); end + + # pkg:gem/activesupport#lib/active_support/core_ext/array/conversions.rb:106 + def to_formatted_s(format = T.unsafe(nil)); end + + # Extends Array#to_s to convert a collection of elements into a + # comma separated id list if :db argument is given as the format. + # + # This method is aliased to to_formatted_s. + # + # Blog.all.to_fs(:db) # => "1,2,3" + # Blog.none.to_fs(:db) # => "null" + # [1,2].to_fs # => "[1, 2]" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/conversions.rb:94 + def to_fs(format = T.unsafe(nil)); end + + # Calls to_param on all its elements and joins the result with + # slashes. This is used by url_for in Action Pack. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:48 + def to_param; end + + # Converts an array into a string suitable for use as a URL query string, + # using the given +key+ as the param name. + # + # ['Rails', 'coding'].to_query('hobbies') # => "hobbies%5B%5D=Rails&hobbies%5B%5D=coding" + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:56 + def to_query(key); end + + # Converts the array to a comma-separated sentence where the last element is + # joined by the connector word. + # + # You can pass the following options to change the default behavior. If you + # pass an option key that doesn't exist in the list below, it will raise an + # ArgumentError. + # + # ==== Options + # + # * :words_connector - The sign or word used to join all but the last + # element in arrays with three or more elements (default: ", "). + # * :last_word_connector - The sign or word used to join the last element + # in arrays with three or more elements (default: ", and "). + # * :two_words_connector - The sign or word used to join the elements + # in arrays with two elements (default: " and "). + # * :locale - If +i18n+ is available, you can set a locale and use + # the connector options defined on the 'support.array' namespace in the + # corresponding dictionary file. + # + # ==== Examples + # + # [].to_sentence # => "" + # ['one'].to_sentence # => "one" + # ['one', 'two'].to_sentence # => "one and two" + # ['one', 'two', 'three'].to_sentence # => "one, two, and three" + # + # ['one', 'two'].to_sentence(passing: 'invalid option') + # # => ArgumentError: Unknown key: :passing. Valid keys are: :words_connector, :two_words_connector, :last_word_connector, :locale + # + # ['one', 'two'].to_sentence(two_words_connector: '-') + # # => "one-two" + # + # ['one', 'two', 'three'].to_sentence(words_connector: ' or ', last_word_connector: ' or at least ') + # # => "one or two or at least three" + # + # Using :locale option: + # + # # Given this locale dictionary: + # # + # # es: + # # support: + # # array: + # # words_connector: " o " + # # two_words_connector: " y " + # # last_word_connector: " o al menos " + # + # ['uno', 'dos'].to_sentence(locale: :es) + # # => "uno y dos" + # + # ['uno', 'dos', 'tres'].to_sentence(locale: :es) + # # => "uno o dos o al menos tres" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/conversions.rb:60 + def to_sentence(options = T.unsafe(nil)); end + + # Returns a string that represents the array in XML by invoking +to_xml+ + # on each element. Active Record collections delegate their representation + # in XML to this method. + # + # All elements are expected to respond to +to_xml+, if any of them does + # not then an exception is raised. + # + # The root node reflects the class name of the first element in plural + # if all elements belong to the same type and that's not Hash: + # + # customer.projects.to_xml + # + # + # + # + # 20000.0 + # 1567 + # 2008-04-09 + # ... + # + # + # 57230.0 + # 1567 + # 2008-04-15 + # ... + # + # + # + # Otherwise the root element is "objects": + # + # [{ foo: 1, bar: 2}, { baz: 3}].to_xml + # + # + # + # + # 2 + # 1 + # + # + # 3 + # + # + # + # If the collection is empty the root element is "nil-classes" by default: + # + # [].to_xml + # + # + # + # + # To ensure a meaningful root element use the :root option: + # + # customer_with_no_projects.projects.to_xml(root: 'projects') + # + # + # + # + # By default name of the node for the children of root is root.singularize. + # You can change it with the :children option. + # + # The +options+ hash is passed downwards: + # + # Message.all.to_xml(skip_types: true) + # + # + # + # + # 2008-03-07T09:58:18+01:00 + # 1 + # 1 + # 2008-03-07T09:58:18+01:00 + # 1 + # + # + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/conversions.rb:183 + def to_xml(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:50 + def without(*elements); end + + class << self + # Wraps its argument in an array unless it is already an array (or array-like). + # + # Specifically: + # + # * If the argument is +nil+ an empty array is returned. + # * Otherwise, if the argument responds to +to_ary+ it is invoked, and its result returned. + # * Otherwise, returns an array with the argument as its single element. + # + # Array.wrap(nil) # => [] + # Array.wrap([1, 2, 3]) # => [1, 2, 3] + # Array.wrap(0) # => [0] + # + # This method is similar in purpose to Kernel#Array, but there are some differences: + # + # * If the argument responds to +to_ary+ the method is invoked. Kernel#Array + # moves on to try +to_a+ if the returned value is +nil+, but Array.wrap returns + # an array with the argument as its single element right away. + # * If the returned value from +to_ary+ is neither +nil+ nor an +Array+ object, Kernel#Array + # raises an exception, while Array.wrap does not, it just returns the value. + # * It does not call +to_a+ on the argument, if the argument does not respond to +to_ary+ + # it returns an array with the argument as its single element. + # + # The last point is easily explained with some enumerables: + # + # Array(foo: :bar) # => [[:foo, :bar]] + # Array.wrap(foo: :bar) # => [{:foo=>:bar}] + # + # There's also a related idiom that uses the splat operator: + # + # [*object] + # + # which returns [] for +nil+, but calls to Array(object) otherwise. + # + # The differences with Kernel#Array explained above + # apply to the rest of objects. + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/wrap.rb:39 + def wrap(object); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:124 +class BigDecimal < ::Numeric + include ::ActiveSupport::BigDecimalWithDefaultFormat + + # A BigDecimal would be naturally represented as a JSON number. Most libraries, + # however, parse non-integer JSON numbers directly as floats. Clients using + # those libraries would get in general a wrong number and no way to recover + # other than manually inspecting the string with the JSON code itself. + # + # That's why a JSON string is returned. The JSON literal is not numeric, but + # if the other end knows by contract that the data is supposed to be a + # BigDecimal, it still has the chance to post-process the string and get the + # real value. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:134 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/class/attribute.rb:6 +class Class < ::Module + include ::ActiveSupport::DescendantsTracker::ReloadedClassesFiltering + + # Declare a class-level attribute whose value is inheritable by subclasses. + # Subclasses can change their own value and it will not impact parent class. + # + # ==== Options + # + # * :instance_reader - Sets the instance reader method (defaults to true). + # * :instance_writer - Sets the instance writer method (defaults to true). + # * :instance_accessor - Sets both instance methods (defaults to true). + # * :instance_predicate - Sets a predicate method (defaults to true). + # * :default - Sets a default value for the attribute (defaults to nil). + # + # ==== Examples + # + # class Base + # class_attribute :setting + # end + # + # class Subclass < Base + # end + # + # Base.setting = true + # Subclass.setting # => true + # Subclass.setting = false + # Subclass.setting # => false + # Base.setting # => true + # + # In the above case as long as Subclass does not assign a value to setting + # by performing Subclass.setting = _something_, Subclass.setting + # would read value assigned to parent class. Once Subclass assigns a value then + # the value assigned by Subclass would be returned. + # + # This matches normal Ruby method inheritance: think of writing an attribute + # on a subclass as overriding the reader method. However, you need to be aware + # when using +class_attribute+ with mutable structures as +Array+ or +Hash+. + # In such cases, you don't want to do changes in place. Instead use setters: + # + # Base.setting = [] + # Base.setting # => [] + # Subclass.setting # => [] + # + # # Appending in child changes both parent and child because it is the same object: + # Subclass.setting << :foo + # Base.setting # => [:foo] + # Subclass.setting # => [:foo] + # + # # Use setters to not propagate changes: + # Base.setting = [] + # Subclass.setting += [:foo] + # Base.setting # => [] + # Subclass.setting # => [:foo] + # + # For convenience, an instance predicate method is defined as well. + # To skip it, pass instance_predicate: false. + # + # Subclass.setting? # => false + # + # Instances may overwrite the class value in the same way: + # + # Base.setting = true + # object = Base.new + # object.setting # => true + # object.setting = false + # object.setting # => false + # Base.setting # => true + # + # To opt out of the instance reader method, pass instance_reader: false. + # + # object.setting # => NoMethodError + # object.setting? # => NoMethodError + # + # To opt out of the instance writer method, pass instance_writer: false. + # + # object.setting = false # => NoMethodError + # + # To opt out of both instance methods, pass instance_accessor: false. + # + # To set a default value for the attribute, pass default:, like so: + # + # class_attribute :settings, default: {} + # + # pkg:gem/activesupport#lib/active_support/core_ext/class/attribute.rb:86 + def class_attribute(*attrs, instance_accessor: T.unsafe(nil), instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_predicate: T.unsafe(nil), default: T.unsafe(nil)); end + + # Returns an array with all classes that are < than its receiver. + # + # class C; end + # C.descendants # => [] + # + # class B < C; end + # C.descendants # => [B] + # + # class A < B; end + # C.descendants # => [B, A] + # + # class D < C; end + # C.descendants # => [B, A, D] + # + # pkg:gem/activesupport#lib/active_support/core_ext/class/subclasses.rb:19 + def descendants; end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:59 + def subclasses; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:68 +class Data + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:69 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/date/zones.rb:6 +class Date + include ::Comparable + include ::DateAndTime::Zones + include ::DateAndTime::Calculations + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:98 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:108 + def -(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:160 + def <=>(other); end + + # Duck-types as a Date-like class. See Object#acts_like?. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/acts_like.rb:7 + def acts_like_date?; end + + # Provides precise Date calculations for years, months, and days. The +options+ parameter takes a hash with + # any of these keys: :years, :months, :weeks, :days. + # + # The increments are applied in order of time units from largest to smallest. + # In other words, the date is incremented first by +:years+, then by + # +:months+, then by +:weeks+, then by +:days+. This order can affect the + # result around the end of a month. For example, incrementing first by months + # then by days: + # + # Date.new(2004, 9, 30).advance(months: 1, days: 1) + # # => Sun, 31 Oct 2004 + # + # Whereas incrementing first by days then by months yields a different result: + # + # Date.new(2004, 9, 30).advance(days: 1).advance(months: 1) + # # => Mon, 01 Nov 2004 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:127 + def advance(options); end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) + # and then subtracts the specified number of seconds. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:55 + def ago(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:211 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:72 + def at_beginning_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:88 + def at_end_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:80 + def at_midday; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:82 + def at_middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:71 + def at_midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:81 + def at_noon; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:67 + def beginning_of_day; end + + # Returns a new Date where one or more of the elements have been changed according to the +options+ parameter. + # The +options+ parameter is a hash with a combination of these keys: :year, :month, :day. + # + # Date.new(2007, 5, 12).change(day: 1) # => Date.new(2007, 5, 1) + # Date.new(2007, 5, 12).change(year: 2005, month: 1) # => Date.new(2005, 1, 12) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:143 + def change(options); end + + # Allow Date to be compared with Time by converting to DateTime and relying on the <=> from there. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:152 + def compare_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:159 + def compare_without_coercion(_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:66 + def default_inspect; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the end of the day (23:59:59) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:85 + def end_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:64 + def in(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:67 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:78 + def midday; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:75 + def middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:70 + def midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:100 + def minus_with_duration(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:107 + def minus_without_duration(_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:79 + def noon; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:90 + def plus_with_duration(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:97 + def plus_without_duration(_arg0); end + + # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005" + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:63 + def readable_inspect; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) + # and then adds the specified number of seconds + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:61 + def since(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:60 + def to_formatted_s(format = T.unsafe(nil)); end + + # Convert to a formatted string. See DATE_FORMATS for predefined formats. + # + # This method is aliased to to_formatted_s. + # + # date = Date.new(2007, 11, 10) # => Sat, 10 Nov 2007 + # + # date.to_fs(:db) # => "2007-11-10" + # date.to_formatted_s(:db) # => "2007-11-10" + # + # date.to_fs(:short) # => "10 Nov" + # date.to_fs(:number) # => "20071110" + # date.to_fs(:long) # => "November 10, 2007" + # date.to_fs(:long_ordinal) # => "November 10th, 2007" + # date.to_fs(:rfc822) # => "10 Nov 2007" + # date.to_fs(:rfc2822) # => "10 Nov 2007" + # date.to_fs(:iso8601) # => "2007-11-10" + # + # == Adding your own date formats to to_fs + # You can add your own formats to the Date::DATE_FORMATS hash. + # Use the format name as the hash key and either a strftime string + # or Proc instance that takes a date argument as the value. + # + # # config/initializers/date_formats.rb + # Date::DATE_FORMATS[:month_and_year] = '%B %Y' + # Date::DATE_FORMATS[:short_ordinal] = ->(date) { date.strftime("%B #{date.day.ordinalize}") } + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:49 + def to_fs(format = T.unsafe(nil)); end + + # Converts a Date instance to a Time, where the time is set to the beginning of the day. + # The timezone can be either +:local+ or +:utc+ (default +:local+). + # + # date = Date.new(2007, 11, 10) # => Sat, 10 Nov 2007 + # + # date.to_time # => 2007-11-10 00:00:00 0800 + # date.to_time(:local) # => 2007-11-10 00:00:00 0800 + # + # date.to_time(:utc) # => 2007-11-10 00:00:00 UTC + # + # NOTE: The +:local+ timezone is Ruby's *process* timezone, i.e. ENV['TZ']. + # If the application's timezone is needed, then use +in_time_zone+ instead. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:69 + def to_time(form = T.unsafe(nil)); end + + # Returns a string which represents the time in used time zone as DateTime + # defined by XML Schema: + # + # date = Date.new(2015, 05, 23) # => Sat, 23 May 2015 + # date.xmlschema # => "2015-05-23T00:00:00+04:00" + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:88 + def xmlschema; end + + class << self + # Returns the week start (e.g. +:monday+) for the current request, if this has been set (via Date.beginning_of_week=). + # If Date.beginning_of_week has not been set for the current request, returns the week start specified in config.beginning_of_week. + # If no +config.beginning_of_week+ was specified, returns +:monday+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:19 + def beginning_of_week; end + + # Sets Date.beginning_of_week to a week start (e.g. +:monday+) for current request/thread. + # + # This method accepts any of the following day symbols: + # +:monday+, +:tuesday+, +:wednesday+, +:thursday+, +:friday+, +:saturday+, +:sunday+ + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:27 + def beginning_of_week=(week_start); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:14 + def beginning_of_week_default; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:14 + def beginning_of_week_default=(_arg0); end + + # Returns Time.zone.today when Time.zone or config.time_zone are set, otherwise just returns Date.today. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:48 + def current; end + + # Returns week start day symbol (e.g. +:monday+), or raises an +ArgumentError+ for invalid day symbol. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:32 + def find_beginning_of_week!(week_start); end + + # Returns a new Date representing the date 1 day after today (i.e. tomorrow's date). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:43 + def tomorrow; end + + # Returns a new Date representing the date 1 day ago (i.e. yesterday's date). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:38 + def yesterday; end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:9 +Date::DATE_FORMATS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:6 +module DateAndTime; end + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:7 +module DateAndTime::Calculations + # Returns true if the date/time falls after date_or_time. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:72 + def after?(date_or_time); end + + # Returns a Range representing the whole day of the current date/time. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:310 + def all_day; end + + # Returns a Range representing the whole month of the current date/time. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:321 + def all_month; end + + # Returns a Range representing the whole quarter of the current date/time. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:326 + def all_quarter; end + + # Returns a Range representing the whole week of the current date/time. + # Week starts on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:316 + def all_week(start_day = T.unsafe(nil)); end + + # Returns a Range representing the whole year of the current date/time. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:331 + def all_year; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:128 + def at_beginning_of_month; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:143 + def at_beginning_of_quarter; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:271 + def at_beginning_of_week(start_day = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:182 + def at_beginning_of_year; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:300 + def at_end_of_month; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:158 + def at_end_of_quarter; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:286 + def at_end_of_week(start_day = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:307 + def at_end_of_year; end + + # Returns true if the date/time falls before date_or_time. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:67 + def before?(date_or_time); end + + # Returns a new date/time at the start of the month. + # + # today = Date.today # => Thu, 18 Jun 2015 + # today.beginning_of_month # => Mon, 01 Jun 2015 + # + # +DateTime+ objects will have a time set to 0:00. + # + # now = DateTime.current # => Thu, 18 Jun 2015 15:23:13 +0000 + # now.beginning_of_month # => Mon, 01 Jun 2015 00:00:00 +0000 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:125 + def beginning_of_month; end + + # Returns a new date/time at the start of the quarter. + # + # today = Date.today # => Fri, 10 Jul 2015 + # today.beginning_of_quarter # => Wed, 01 Jul 2015 + # + # +DateTime+ objects will have a time set to 0:00. + # + # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 + # now.beginning_of_quarter # => Wed, 01 Jul 2015 00:00:00 +0000 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:139 + def beginning_of_quarter; end + + # Returns a new date/time representing the start of this week on the given day. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # +DateTime+ objects have their time set to 0:00. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:267 + def beginning_of_week(start_day = T.unsafe(nil)); end + + # Returns a new date/time at the beginning of the year. + # + # today = Date.today # => Fri, 10 Jul 2015 + # today.beginning_of_year # => Thu, 01 Jan 2015 + # + # +DateTime+ objects will have a time set to 0:00. + # + # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 + # now.beginning_of_year # => Thu, 01 Jan 2015 00:00:00 +0000 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:179 + def beginning_of_year; end + + # Returns a new date/time the specified number of days ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:77 + def days_ago(days); end + + # Returns a new date/time the specified number of days in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:82 + def days_since(days); end + + # Returns the number of days to the start of the week on the given day. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:258 + def days_to_week_start(start_day = T.unsafe(nil)); end + + # Returns a new date/time representing the end of the month. + # DateTime objects will have a time set to 23:59:59. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:296 + def end_of_month; end + + # Returns a new date/time at the end of the quarter. + # + # today = Date.today # => Fri, 10 Jul 2015 + # today.end_of_quarter # => Wed, 30 Sep 2015 + # + # +DateTime+ objects will have a time set to 23:59:59. + # + # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 + # now.end_of_quarter # => Wed, 30 Sep 2015 23:59:59 +0000 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:154 + def end_of_quarter; end + + # Returns a new date/time representing the end of this week on the given day. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # DateTime objects have their time set to 23:59:59. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:283 + def end_of_week(start_day = T.unsafe(nil)); end + + # Returns a new date/time representing the end of the year. + # DateTime objects will have a time set to 23:59:59. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:304 + def end_of_year; end + + # Returns true if the date/time is in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:52 + def future?; end + + # Short-hand for months_ago(1). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:240 + def last_month; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:248 + def last_quarter; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:227 + def last_week(start_day = T.unsafe(nil), same_time: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:237 + def last_weekday; end + + # Short-hand for years_ago(1). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:251 + def last_year; end + + # Returns Monday of this week assuming that week starts on Monday. + # +DateTime+ objects have their time set to 0:00. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:275 + def monday; end + + # Returns a new date/time the specified number of months ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:97 + def months_ago(months); end + + # Returns a new date/time the specified number of months in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:102 + def months_since(months); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:38 + def next_day?; end + + # Returns a new date/time representing the next occurrence of the specified day of week. + # + # today = Date.today # => Thu, 14 Dec 2017 + # today.next_occurring(:monday) # => Mon, 18 Dec 2017 + # today.next_occurring(:thursday) # => Thu, 21 Dec 2017 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:340 + def next_occurring(day_of_week); end + + # Short-hand for months_since(3). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:215 + def next_quarter; end + + # Returns a new date/time representing the given day in the next week. + # + # today = Date.today # => Thu, 07 May 2015 + # today.next_week # => Mon, 11 May 2015 + # + # The +given_day_in_next_week+ defaults to the beginning of the week + # which is determined by +Date.beginning_of_week+ or +config.beginning_of_week+ + # when set. + # + # today = Date.today # => Thu, 07 May 2015 + # today.next_week(:friday) # => Fri, 15 May 2015 + # + # +DateTime+ objects have their time set to 0:00 unless +same_time+ is true. + # + # now = DateTime.current # => Thu, 07 May 2015 13:31:16 +0000 + # now.next_week # => Mon, 11 May 2015 00:00:00 +0000 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:200 + def next_week(given_day_in_next_week = T.unsafe(nil), same_time: T.unsafe(nil)); end + + # Returns a new date/time representing the next weekday. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:206 + def next_weekday; end + + # Returns true if the date/time does not fall on a Saturday or Sunday. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:62 + def on_weekday?; end + + # Returns true if the date/time falls on a Saturday or Sunday. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:57 + def on_weekend?; end + + # Returns true if the date/time is in the past. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:47 + def past?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:44 + def prev_day?; end + + # Returns a new date/time representing the previous occurrence of the specified day of week. + # + # today = Date.today # => Thu, 14 Dec 2017 + # today.prev_occurring(:monday) # => Mon, 11 Dec 2017 + # today.prev_occurring(:thursday) # => Thu, 07 Dec 2017 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:351 + def prev_occurring(day_of_week); end + + # Short-hand for months_ago(3). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:245 + def prev_quarter; end + + # Returns a new date/time representing the given day in the previous week. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # DateTime objects have their time set to 0:00 unless +same_time+ is true. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:223 + def prev_week(start_day = T.unsafe(nil), same_time: T.unsafe(nil)); end + + # Returns a new date/time representing the previous weekday. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:230 + def prev_weekday; end + + # Returns the quarter for a date/time. + # + # Date.new(2010, 1, 31).quarter # => 1 + # Date.new(2010, 4, 12).quarter # => 2 + # Date.new(2010, 9, 15).quarter # => 3 + # Date.new(2010, 12, 25).quarter # => 4 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:166 + def quarter; end + + # Returns Sunday of this week assuming that week starts on Monday. + # +DateTime+ objects have their time set to 23:59:59. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:290 + def sunday; end + + # Returns true if the date/time is today. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:30 + def today?; end + + # Returns a new date/time representing tomorrow. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:25 + def tomorrow; end + + # Returns true if the date/time is tomorrow. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:35 + def tomorrow?; end + + # Returns a new date/time the specified number of weeks ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:87 + def weeks_ago(weeks); end + + # Returns a new date/time the specified number of weeks in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:92 + def weeks_since(weeks); end + + # Returns a new date/time the specified number of years ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:107 + def years_ago(years); end + + # Returns a new date/time the specified number of years in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:112 + def years_since(years); end + + # Returns a new date/time representing yesterday. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:20 + def yesterday; end + + # Returns true if the date/time is yesterday. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:41 + def yesterday?; end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:370 + def copy_time_to(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:366 + def days_span(day); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:358 + def first_hour(date_or_time); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:362 + def last_hour(date_or_time); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:8 +DateAndTime::Calculations::DAYS_INTO_WEEK = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:17 +DateAndTime::Calculations::WEEKEND_DAYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:7 +module DateAndTime::Compatibility + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:21 + def utc_to_local_returns_utc_offset_times; end + + class << self + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:21 + def utc_to_local_returns_utc_offset_times; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:21 + def utc_to_local_returns_utc_offset_times=(val); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/zones.rb:4 +module DateAndTime::Zones + # Returns the simultaneous time in Time.zone if a zone is given or + # if Time.zone_default is set. Otherwise, it returns the current time. + # + # Time.zone = 'Hawaii' # => 'Hawaii' + # Time.utc(2000).in_time_zone # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # Date.new(2000).in_time_zone # => Sat, 01 Jan 2000 00:00:00 HST -10:00 + # + # This method is similar to Time#localtime, except that it uses Time.zone as the local zone + # instead of the operating system's time zone. + # + # You can also pass in a TimeZone instance or string that identifies a TimeZone as an argument, + # and the conversion will be based on that zone instead of Time.zone. + # + # Time.utc(2000).in_time_zone('Alaska') # => Fri, 31 Dec 1999 15:00:00 AKST -09:00 + # Date.new(2000).in_time_zone('Alaska') # => Sat, 01 Jan 2000 00:00:00 AKST -09:00 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/zones.rb:20 + def in_time_zone(zone = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/zones.rb:32 + def time_with_zone(time, zone); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:5 +class DateTime < ::Date + # Layers additional behavior on DateTime#<=> so that Time and + # ActiveSupport::TimeWithZone instances can be compared with a DateTime. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:208 + def <=>(other); end + + # Uses Date to provide precise Time calculations for years, months, and days. + # The +options+ parameter takes a hash with any of these keys: :years, + # :months, :weeks, :days, :hours, + # :minutes, :seconds. + # + # Just like Date#advance, increments are applied in order of time units from + # largest to smallest. This order can affect the result around the end of a + # month. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:82 + def advance(options); end + + # Returns a new DateTime representing the time a number of seconds ago. + # Do not use this method in combination with x.months, use months_ago instead! + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:109 + def ago(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:221 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:127 + def at_beginning_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:149 + def at_beginning_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:161 + def at_beginning_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:143 + def at_end_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:155 + def at_end_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:167 + def at_end_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:135 + def at_midday; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:137 + def at_middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:126 + def at_midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:136 + def at_noon; end + + # Returns a new DateTime representing the start of the day (0:00). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:122 + def beginning_of_day; end + + # Returns a new DateTime representing the start of the hour (hh:00:00). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:146 + def beginning_of_hour; end + + # Returns a new DateTime representing the start of the minute (hh:mm:00). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:158 + def beginning_of_minute; end + + # Returns a new DateTime where one or more of the elements have been changed + # according to the +options+ parameter. The time options (:hour, + # :min, :sec) reset cascadingly, so if only the hour is + # passed, then minute and sec is set to 0. If the hour and minute is passed, + # then sec is set to 0. The +options+ parameter takes a hash with any of these + # keys: :year, :month, :day, :hour, + # :min, :sec, :offset, :start. + # + # DateTime.new(2012, 8, 29, 22, 35, 0).change(day: 1) # => DateTime.new(2012, 8, 1, 22, 35, 0) + # DateTime.new(2012, 8, 29, 22, 35, 0).change(year: 1981, day: 1) # => DateTime.new(1981, 8, 1, 22, 35, 0) + # DateTime.new(2012, 8, 29, 22, 35, 0).change(year: 1981, hour: 0) # => DateTime.new(1981, 8, 29, 0, 0, 0) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:51 + def change(options); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:61 + def default_inspect; end + + # Returns a new DateTime representing the end of the day (23:59:59). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:140 + def end_of_day; end + + # Returns a new DateTime representing the end of the hour (hh:59:59). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:152 + def end_of_hour; end + + # Returns a new DateTime representing the end of the minute (hh:mm:59). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:164 + def end_of_minute; end + + # Returns a formatted string of the offset from UTC, or an alternative + # string if the time zone is already UTC. + # + # datetime = DateTime.civil(2000, 1, 1, 0, 0, 0, Rational(-6, 24)) + # datetime.formatted_offset # => "-06:00" + # datetime.formatted_offset(false) # => "-0600" + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:53 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:192 + def getgm; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:178 + def getlocal(utc_offset = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:193 + def getutc; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:194 + def gmtime; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:119 + def in(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:62 + def inspect; end + + # Returns a Time instance of the simultaneous time in the system timezone. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:170 + def localtime(utc_offset = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:133 + def midday; end + + # Returns a new DateTime representing the middle of the day (12:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:130 + def middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:125 + def midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:134 + def noon; end + + # Returns the fraction of a second as nanoseconds + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:96 + def nsec; end + + # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005 14:30:00 +0000". + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:58 + def readable_inspect; end + + # Returns the number of seconds since 00:00:00. + # + # DateTime.new(2012, 8, 29, 0, 0, 0).seconds_since_midnight # => 0 + # DateTime.new(2012, 8, 29, 12, 34, 56).seconds_since_midnight # => 45296 + # DateTime.new(2012, 8, 29, 23, 59, 59).seconds_since_midnight # => 86399 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:20 + def seconds_since_midnight; end + + # Returns the number of seconds until 23:59:59. + # + # DateTime.new(2012, 8, 29, 0, 0, 0).seconds_until_end_of_day # => 86399 + # DateTime.new(2012, 8, 29, 12, 34, 56).seconds_until_end_of_day # => 41103 + # DateTime.new(2012, 8, 29, 23, 59, 59).seconds_until_end_of_day # => 0 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:29 + def seconds_until_end_of_day; end + + # Returns a new DateTime representing the time a number of seconds since the + # instance time. Do not use this method in combination with x.months, use + # months_since instead! + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:116 + def since(seconds); end + + # Returns the fraction of a second as a +Rational+ + # + # DateTime.new(2012, 8, 29, 0, 0, 0.5).subsec # => (1/2) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:36 + def subsec; end + + # Converts +self+ to a floating-point number of seconds, including fractional microseconds, since the Unix epoch. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:81 + def to_f; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:44 + def to_formatted_s(format = T.unsafe(nil)); end + + # Convert to a formatted string. See Time::DATE_FORMATS for predefined formats. + # + # This method is aliased to to_formatted_s. + # + # ==== Examples + # + # datetime = DateTime.civil(2007, 12, 4, 0, 0, 0, 0) # => Tue, 04 Dec 2007 00:00:00 +0000 + # + # datetime.to_fs(:db) # => "2007-12-04 00:00:00" + # datetime.to_formatted_s(:db) # => "2007-12-04 00:00:00" + # datetime.to_fs(:number) # => "20071204000000" + # datetime.to_fs(:short) # => "04 Dec 00:00" + # datetime.to_fs(:long) # => "December 04, 2007 00:00" + # datetime.to_fs(:long_ordinal) # => "December 4th, 2007 00:00" + # datetime.to_fs(:rfc822) # => "Tue, 04 Dec 2007 00:00:00 +0000" + # datetime.to_fs(:iso8601) # => "2007-12-04T00:00:00+00:00" + # + # ==== Adding your own datetime formats to +to_fs+ + # + # DateTime formats are shared with Time. You can add your own to the + # Time::DATE_FORMATS hash. Use the format name as the hash key and + # either a strftime string or Proc instance that takes a time or + # datetime argument as the value. + # + # # config/initializers/time_formats.rb + # Time::DATE_FORMATS[:month_and_year] = '%B %Y' + # Time::DATE_FORMATS[:short_ordinal] = lambda { |time| time.strftime("%B #{time.day.ordinalize}") } + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:37 + def to_fs(format = T.unsafe(nil)); end + + # Converts +self+ to an integer number of seconds since the Unix epoch. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:86 + def to_i; end + + # Returns the fraction of a second as microseconds + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:91 + def usec; end + + # Returns a Time instance of the simultaneous time in the UTC timezone. + # + # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)) # => Mon, 21 Feb 2005 10:11:12 -0600 + # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:184 + def utc; end + + # Returns +true+ if offset == 0. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:197 + def utc?; end + + # Returns the offset value in seconds. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:202 + def utc_offset; end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:101 + def offset_in_seconds; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:105 + def seconds_since_unix_epoch; end + + class << self + # Returns DateTime with local offset for given year if format is local else + # offset is zero. + # + # DateTime.civil_from_format :local, 2012 + # # => Sun, 01 Jan 2012 00:00:00 +0300 + # DateTime.civil_from_format :local, 2012, 12, 17 + # # => Mon, 17 Dec 2012 00:00:00 +0000 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:71 + def civil_from_format(utc_or_local, year, month = T.unsafe(nil), day = T.unsafe(nil), hour = T.unsafe(nil), min = T.unsafe(nil), sec = T.unsafe(nil)); end + + # Returns Time.zone.now.to_datetime when Time.zone or + # config.time_zone are set, otherwise returns + # Time.now.to_datetime. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:10 + def current; end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:117 +class Delegator < ::BasicObject + include ::ActiveSupport::Tryable +end + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:39 +module ERB::Util + include ::ActiveSupport::CoreExt::ERBUtil + include ::ActiveSupport::CoreExt::ERBUtilPrivate + extend ::ActiveSupport::CoreExt::ERBUtil + + private + + # A utility method for escaping HTML without affecting existing escaped entities. + # + # html_escape_once('1 < 2 & 3') + # # => "1 < 2 & 3" + # + # html_escape_once('<< Accept & Checkout') + # # => "<< Accept & Checkout" + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:63 + def html_escape_once(s); end + + # A utility method for escaping HTML entities in JSON strings. Specifically, the + # &, > and < characters are replaced with their equivalent unicode escaped form - + # \u0026, \u003e, and \u003c. The Unicode sequences \u2028 and \u2029 are also + # escaped as they are treated as newline characters in some JavaScript engines. + # These sequences have identical meaning as the original characters inside the + # context of a JSON string, so assuming the input is a valid and well-formed + # JSON value, the output will have equivalent meaning when parsed: + # + # json = JSON.generate({ name: ""}) + # # => "{\"name\":\"\"}" + # + # json_escape(json) + # # => "{\"name\":\"\\u003C/script\\u003E\\u003Cscript\\u003Ealert('PWNED!!!')\\u003C/script\\u003E\"}" + # + # JSON.parse(json) == JSON.parse(json_escape(json)) + # # => true + # + # The intended use case for this method is to escape JSON strings before including + # them inside a script tag to avoid XSS vulnerability: + # + # + # + # It is necessary to +raw+ the result of +json_escape+, so that quotation marks + # don't get converted to " entities. +json_escape+ doesn't + # automatically flag the result as HTML safe, since the raw value is unsafe to + # use inside HTML attributes. + # + # If your JSON is being used downstream for insertion into the DOM, be aware of + # whether or not it is being inserted via html(). Most jQuery plugins do this. + # If that is the case, be sure to +html_escape+ or +sanitize+ any user-generated + # content returned by your JSON. + # + # If you need to output JSON elsewhere in your HTML, you can just do something + # like this, as any unsafe characters (including quotation marks) will be + # automatically escaped for you: + # + #
    ...
    + # + # WARNING: this helper only works with valid JSON. Using this on non-JSON values + # will open up serious XSS vulnerabilities. For example, if you replace the + # +current_user.to_json+ in the example above with user input instead, the browser + # will happily eval() that string as JavaScript. + # + # The escaping performed in this method is identical to those performed in the + # Active Support JSON encoder when +ActiveSupport.escape_html_entities_in_json+ is + # set to true. Because this transformation is idempotent, this helper can be + # applied even if +ActiveSupport.escape_html_entities_in_json+ is already true. + # + # Therefore, when you are unsure if +ActiveSupport.escape_html_entities_in_json+ + # is enabled, or if you are unsure where your JSON string originated from, it + # is recommended that you always apply this helper (other libraries, such as the + # JSON gem, do not provide this kind of protection by default; also some gems + # might override +to_json+ to bypass Active Support's encoder). + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:124 + def json_escape(s); end + + # A utility method for escaping XML names of tags and names of attributes. + # + # xml_name_escape('1 < 2 & 3') + # # => "1___2___3" + # + # It follows the requirements of the specification: https://www.w3.org/TR/REC-xml/#NT-Name + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:142 + def xml_name_escape(name); end + + class << self + # A utility method for escaping HTML without affecting existing escaped entities. + # + # html_escape_once('1 < 2 & 3') + # # => "1 < 2 & 3" + # + # html_escape_once('<< Accept & Checkout') + # # => "<< Accept & Checkout" + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:67 + def html_escape_once(s); end + + # A utility method for escaping HTML entities in JSON strings. Specifically, the + # &, > and < characters are replaced with their equivalent unicode escaped form - + # \u0026, \u003e, and \u003c. The Unicode sequences \u2028 and \u2029 are also + # escaped as they are treated as newline characters in some JavaScript engines. + # These sequences have identical meaning as the original characters inside the + # context of a JSON string, so assuming the input is a valid and well-formed + # JSON value, the output will have equivalent meaning when parsed: + # + # json = JSON.generate({ name: ""}) + # # => "{\"name\":\"\"}" + # + # json_escape(json) + # # => "{\"name\":\"\\u003C/script\\u003E\\u003Cscript\\u003Ealert('PWNED!!!')\\u003C/script\\u003E\"}" + # + # JSON.parse(json) == JSON.parse(json_escape(json)) + # # => true + # + # The intended use case for this method is to escape JSON strings before including + # them inside a script tag to avoid XSS vulnerability: + # + # + # + # It is necessary to +raw+ the result of +json_escape+, so that quotation marks + # don't get converted to " entities. +json_escape+ doesn't + # automatically flag the result as HTML safe, since the raw value is unsafe to + # use inside HTML attributes. + # + # If your JSON is being used downstream for insertion into the DOM, be aware of + # whether or not it is being inserted via html(). Most jQuery plugins do this. + # If that is the case, be sure to +html_escape+ or +sanitize+ any user-generated + # content returned by your JSON. + # + # If you need to output JSON elsewhere in your HTML, you can just do something + # like this, as any unsafe characters (including quotation marks) will be + # automatically escaped for you: + # + #
    ...
    + # + # WARNING: this helper only works with valid JSON. Using this on non-JSON values + # will open up serious XSS vulnerabilities. For example, if you replace the + # +current_user.to_json+ in the example above with user input instead, the browser + # will happily eval() that string as JavaScript. + # + # The escaping performed in this method is identical to those performed in the + # Active Support JSON encoder when +ActiveSupport.escape_html_entities_in_json+ is + # set to true. Because this transformation is idempotent, this helper can be + # applied even if +ActiveSupport.escape_html_entities_in_json+ is already true. + # + # Therefore, when you are unsure if +ActiveSupport.escape_html_entities_in_json+ + # is enabled, or if you are unsure where your JSON string originated from, it + # is recommended that you always apply this helper (other libraries, such as the + # JSON gem, do not provide this kind of protection by default; also some gems + # might override +to_json+ to bypass Active Support's encoder). + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:134 + def json_escape(s); end + + # Tokenizes a line of ERB. This is really just for error reporting and + # nobody should use it. + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:161 + def tokenize(source); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:10 + def unwrapped_html_escape(s); end + + # A utility method for escaping XML names of tags and names of attributes. + # + # xml_name_escape('1 < 2 & 3') + # # => "1___2___3" + # + # It follows the requirements of the specification: https://www.w3.org/TR/REC-xml/#NT-Name + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:157 + def xml_name_escape(name); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:40 +ERB::Util::HTML_ESCAPE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:41 +ERB::Util::HTML_ESCAPE_ONCE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:49 +ERB::Util::INVALID_TAG_NAME_FOLLOWING_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:47 +ERB::Util::INVALID_TAG_NAME_START_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:50 +ERB::Util::SAFE_XML_TAG_NAME_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:48 +ERB::Util::TAG_NAME_FOLLOWING_CODEPOINTS = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:51 +ERB::Util::TAG_NAME_REPLACEMENT_CHAR = T.let(T.unsafe(nil), String) + +# Following XML requirements: https://www.w3.org/TR/REC-xml/#NT-Name +# +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:44 +ERB::Util::TAG_NAME_START_CODEPOINTS = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:145 +module Enumerable + include ::ActiveSupport::ToJsonWithActiveSupportEncoder + extend ::ActiveSupport::EnumerableCoreExt::Constants + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:146 + def as_json(options = T.unsafe(nil)); end + + # Returns a new +Array+ without the blank items. + # Uses Object#blank? for determining if an item is blank. + # + # [1, "", nil, 2, " ", [], {}, false, true].compact_blank + # # => [1, 2, true] + # + # Set.new([nil, "", 1, false]).compact_blank + # # => [1] + # + # When called on a +Hash+, returns a new +Hash+ without the blank values. + # + # { a: "", b: 1, c: nil, d: [], e: false, f: true }.compact_blank + # # => { b: 1, f: true } + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:184 + def compact_blank; end + + # The negative of the Enumerable#include?. Returns +true+ if the + # collection does not include the object. + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:118 + def exclude?(object); end + + # Returns a copy of the enumerable excluding the specified elements. + # + # ["David", "Rafael", "Aaron", "Todd"].excluding "Aaron", "Todd" + # # => ["David", "Rafael"] + # + # ["David", "Rafael", "Aaron", "Todd"].excluding %w[ Aaron Todd ] + # # => ["David", "Rafael"] + # + # {foo: 1, bar: 2, baz: 3}.excluding :bar + # # => {foo: 1, baz: 3} + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:132 + def excluding(*elements); end + + # Returns a new +Array+ where the order has been set to that provided in the +series+, based on the +key+ of the + # objects in the original enumerable. + # + # [ Person.find(5), Person.find(3), Person.find(1) ].in_order_of(:id, [ 1, 5, 3 ]) + # # => [ Person.find(1), Person.find(5), Person.find(3) ] + # + # If the +series+ include keys that have no corresponding element in the Enumerable, these are ignored. + # If the Enumerable has additional elements that aren't named in the +series+, these are not included in the result, unless + # the +filter+ option is set to +false+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:197 + def in_order_of(key, series, filter: T.unsafe(nil)); end + + # Returns a new array that includes the passed elements. + # + # [ 1, 2, 3 ].including(4, 5) + # # => [ 1, 2, 3, 4, 5 ] + # + # ["David", "Rafael"].including %w[ Aaron Todd ] + # # => ["David", "Rafael", "Aaron", "Todd"] + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:112 + def including(*elements); end + + # Convert an enumerable to a hash, using the block result as the key and the + # element as the value. + # + # people.index_by(&:login) + # # => { "nextangle" => , "chade-" => , ...} + # + # people.index_by { |person| "#{person.first_name} #{person.last_name}" } + # # => { "Chade- Fowlersburg-e" => , "David Heinemeier Hansson" => , ...} + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:52 + def index_by; end + + # Convert an enumerable to a hash, using the element as the key and the block + # result as the value. + # + # post = Post.new(title: "hey there", body: "what's up?") + # + # %i( title body ).index_with { |attr_name| post.public_send(attr_name) } + # # => { title: "hey there", body: "what's up?" } + # + # If an argument is passed instead of a block, it will be used as the value + # for all elements: + # + # %i( created_at updated_at ).index_with(Time.now) + # # => { created_at: 2020-03-09 22:31:47, updated_at: 2020-03-09 22:31:47 } + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:75 + def index_with(default = T.unsafe(nil)); end + + # Returns +true+ if the enumerable has more than 1 element. Functionally + # equivalent to enum.to_a.size > 1. Can be called with a block too, + # much like any?, so people.many? { |p| p.age > 26 } returns +true+ + # if more than one person is over 26. + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:93 + def many?; end + + # Calculates the maximum from the extracted elements. + # + # payments = [Payment.new(5), Payment.new(15), Payment.new(10)] + # payments.maximum(:price) # => 15 + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:40 + def maximum(key); end + + # Calculates the minimum from the extracted elements. + # + # payments = [Payment.new(5), Payment.new(15), Payment.new(10)] + # payments.minimum(:price) # => 5 + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:32 + def minimum(key); end + + # Extract the given key from the first element in the enumerable. + # + # [{ name: "David" }, { name: "Rafael" }, { name: "Aaron" }].pick(:name) + # # => "David" + # + # [{ id: 1, name: "David" }, { id: 2, name: "Rafael" }].pick(:id, :name) + # # => [1, "David"] + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:161 + def pick(*keys); end + + # Extract the given key from each element in the enumerable. + # + # [{ name: "David" }, { name: "Rafael" }, { name: "Aaron" }].pluck(:name) + # # => ["David", "Rafael", "Aaron"] + # + # [{ id: 1, name: "David" }, { id: 2, name: "Rafael" }].pluck(:id, :name) + # # => [[1, "David"], [2, "Rafael"]] + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:145 + def pluck(*keys); end + + # Returns the sole item in the enumerable. If there are no items, or more + # than one item, raises Enumerable::SoleItemExpectedError. + # + # ["x"].sole # => "x" + # Set.new.sole # => Enumerable::SoleItemExpectedError: no item found + # { a: 1, b: 2 }.sole # => Enumerable::SoleItemExpectedError: multiple items found + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:211 + def sole; end + + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:136 + def without(*elements); end +end + +# Error generated by +sole+ when called on an enumerable that doesn't have +# exactly one item. +# +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:21 +class Enumerable::SoleItemExpectedError < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:263 +class Exception + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:264 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:65 +class FalseClass + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:87 + def as_json(options = T.unsafe(nil)); end + + # +false+ is blank: + # + # false.blank? # => true + # + # @return [true] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:71 + def blank?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:75 + def present?; end + + # Returns +self+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:40 + def to_param; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/file/atomic.rb:5 +class File < ::IO + class << self + # Write to a file atomically. Useful for situations where you don't + # want other processes or threads to see half-written files. + # + # File.atomic_write('important.file') do |file| + # file.write('hello') + # end + # + # This method needs to create a temporary file. By default it will create it + # in the same directory as the destination file. If you don't like this + # behavior you can provide a different directory but it must be on the + # same physical filesystem as the file you're trying to write. + # + # File.atomic_write('/data/something.important', '/data/tmp') do |file| + # file.write('hello') + # end + # + # pkg:gem/activesupport#lib/active_support/core_ext/file/atomic.rb:21 + def atomic_write(file_name, temp_dir = T.unsafe(nil)); end + + # Private utility method. + # + # pkg:gem/activesupport#lib/active_support/core_ext/file/atomic.rb:56 + def probe_stat_in(dir); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:116 +class Float < ::Numeric + # Encoding Infinity or NaN to JSON should return "null". The default returns + # "Infinity" or "NaN" which are not valid JSON. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:119 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/hash/deep_merge.rb:5 +class Hash + include ::Enumerable + include ::ActiveSupport::DeepMergeable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:175 + def as_json(options = T.unsafe(nil)); end + + # Validates all keys in a hash match *valid_keys, raising + # +ArgumentError+ on a mismatch. + # + # Note that keys are treated differently than HashWithIndifferentAccess, + # meaning that string and symbol keys will not match. + # + # { name: 'Rob', years: '28' }.assert_valid_keys(:name, :age) # => raises "ArgumentError: Unknown key: :years. Valid keys are: :name, :age" + # { name: 'Rob', age: '28' }.assert_valid_keys('name', 'age') # => raises "ArgumentError: Unknown key: :name. Valid keys are: 'name', 'age'" + # { name: 'Rob', age: '28' }.assert_valid_keys(:name, :age) # => passes, raises nothing + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:48 + def assert_valid_keys(*valid_keys); end + + # A hash is blank if it's empty: + # + # {}.blank? # => true + # { key: 'value' }.blank? # => false + # + # @return [true, false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:116 + def blank?; end + + # Hash#reject has its own definition, so this needs one too. + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:234 + def compact_blank; end + + # Removes all blank values from the +Hash+ in place and returns self. + # Uses Object#blank? for determining if a value is blank. + # + # h = { a: "", b: 1, c: nil, d: [], e: false, f: true } + # h.compact_blank! + # # => { b: 1, f: true } + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:244 + def compact_blank!; end + + # Returns a deep copy of hash. + # + # hash = { a: { b: 'b' } } + # dup = hash.deep_dup + # dup[:a][:c] = 'c' + # + # hash[:a][:c] # => nil + # dup[:a][:c] # => "c" + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/deep_dup.rb:43 + def deep_dup; end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/deep_merge.rb:40 + def deep_merge?(other); end + + # Returns a new hash with all keys converted to strings. + # This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # hash = { person: { name: 'Rob', age: '28' } } + # + # hash.deep_stringify_keys + # # => {"person"=>{"name"=>"Rob", "age"=>"28"}} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:84 + def deep_stringify_keys; end + + # Destructively converts all keys to strings. + # This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:91 + def deep_stringify_keys!; end + + # Returns a new hash with all keys converted to symbols, as long as + # they respond to +to_sym+. This includes the keys from the root hash + # and from all nested hashes and arrays. + # + # hash = { 'person' => { 'name' => 'Rob', 'age' => '28' } } + # + # hash.deep_symbolize_keys + # # => {:person=>{:name=>"Rob", :age=>"28"}} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:103 + def deep_symbolize_keys; end + + # Destructively converts all keys to symbols, as long as they respond + # to +to_sym+. This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:110 + def deep_symbolize_keys!; end + + # Returns a new hash with all keys converted by the block operation. + # This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # hash = { person: { name: 'Rob', age: '28' } } + # + # hash.deep_transform_keys{ |key| key.to_s.upcase } + # # => {"PERSON"=>{"NAME"=>"Rob", "AGE"=>"28"}} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:65 + def deep_transform_keys(&block); end + + # Destructively converts all keys by using the block operation. + # This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:72 + def deep_transform_keys!(&block); end + + # Removes the given keys from hash and returns it. + # hash = { a: true, b: false, c: nil } + # hash.except!(:c) # => { a: true, b: false } + # hash # => { a: true, b: false } + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/except.rb:8 + def except!(*keys); end + + # Removes and returns the key/value pairs matching the given keys. + # + # hash = { a: 1, b: 2, c: 3, d: 4 } + # hash.extract!(:a, :b) # => {:a=>1, :b=>2} + # hash # => {:c=>3, :d=>4} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/slice.rb:24 + def extract!(*keys); end + + # By default, only instances of Hash itself are extractable. + # Subclasses of Hash may implement this method and return + # true to declare themselves as extractable. If a Hash + # is extractable, Array#extract_options! pops it from + # the Array when it is the last element of the Array. + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/extract_options.rb:9 + def extractable_options?; end + + # Called when object is nested under an object that receives + # #with_indifferent_access. This method will be called on the current object + # by the enclosing object and is aliased to #with_indifferent_access by + # default. Subclasses of Hash may override this method to return +self+ if + # converting to an ActiveSupport::HashWithIndifferentAccess would not be + # desirable. + # + # b = { b: 1 } + # { a: b }.with_indifferent_access['a'] # calls b.nested_under_indifferent_access + # # => {"b"=>1} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/indifferent_access.rb:23 + def nested_under_indifferent_access; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:118 + def present?; end + + # Merges the caller into +other_hash+. For example, + # + # options = options.reverse_merge(size: 25, velocity: 10) + # + # is equivalent to + # + # options = { size: 25, velocity: 10 }.merge(options) + # + # This is particularly useful for initializing an options hash + # with default values. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:14 + def reverse_merge(other_hash); end + + # Destructive +reverse_merge+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:20 + def reverse_merge!(other_hash); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:23 + def reverse_update(other_hash); end + + # Replaces the hash with only the given keys. + # Returns a hash containing the removed key/value pairs. + # + # hash = { a: 1, b: 2, c: 3, d: 4 } + # hash.slice!(:a, :b) # => {:c=>3, :d=>4} + # hash # => {:a=>1, :b=>2} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/slice.rb:10 + def slice!(*keys); end + + # Returns a new hash with all keys converted to strings. + # + # hash = { name: 'Rob', age: '28' } + # + # hash.stringify_keys + # # => {"name"=>"Rob", "age"=>"28"} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:10 + def stringify_keys; end + + # Destructively converts all keys to strings. Same as + # +stringify_keys+, but modifies +self+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:16 + def stringify_keys!; end + + # Returns a new hash with all keys converted to symbols, as long as + # they respond to +to_sym+. + # + # hash = { 'name' => 'Rob', 'age' => '28' } + # + # hash.symbolize_keys + # # => {:name=>"Rob", :age=>"28"} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:27 + def symbolize_keys; end + + # Destructively converts all keys to symbols, as long as they respond + # to +to_sym+. Same as +symbolize_keys+, but modifies +self+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:34 + def symbolize_keys!; end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:30 + def to_options; end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:37 + def to_options!; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:92 + def to_param(namespace = T.unsafe(nil)); end + + # Returns a string representation of the receiver suitable for use as a URL + # query string: + # + # {name: 'David', nationality: 'Danish'}.to_query + # # => "name=David&nationality=Danish" + # + # An optional namespace can be passed to enclose key names: + # + # {name: 'David', nationality: 'Danish'}.to_query('user') + # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" + # + # The string pairs "key=value" that conform the query string + # are sorted lexicographically in ascending order. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:81 + def to_query(namespace = T.unsafe(nil)); end + + # Returns a string containing an XML representation of its receiver: + # + # { foo: 1, bar: 2 }.to_xml + # # => + # # + # # + # # 1 + # # 2 + # # + # + # To do so, the method loops over the pairs and builds nodes that depend on + # the _values_. Given a pair +key+, +value+: + # + # * If +value+ is a hash there's a recursive call with +key+ as :root. + # + # * If +value+ is an array there's a recursive call with +key+ as :root, + # and +key+ singularized as :children. + # + # * If +value+ is a callable object it must expect one or two arguments. Depending + # on the arity, the callable is invoked with the +options+ hash as first argument + # with +key+ as :root, and +key+ singularized as second argument. The + # callable can add nodes by using options[:builder]. + # + # {foo: lambda { |options, key| options[:builder].b(key) }}.to_xml + # # => "foo" + # + # * If +value+ responds to +to_xml+ the method is invoked with +key+ as :root. + # + # class Foo + # def to_xml(options) + # options[:builder].bar 'fooing!' + # end + # end + # + # { foo: Foo.new }.to_xml(skip_instruct: true) + # # => + # # + # # fooing! + # # + # + # * Otherwise, a node with +key+ as tag is created with a string representation of + # +value+ as text node. If +value+ is +nil+ an attribute "nil" set to "true" is added. + # Unless the option :skip_types exists and is true, an attribute "type" is + # added as well according to the following mapping: + # + # XML_TYPE_NAMES = { + # "Symbol" => "symbol", + # "Integer" => "integer", + # "BigDecimal" => "decimal", + # "Float" => "float", + # "TrueClass" => "boolean", + # "FalseClass" => "boolean", + # "Date" => "date", + # "DateTime" => "dateTime", + # "Time" => "dateTime" + # } + # + # By default the root node is "hash", but that's configurable via the :root option. + # + # The default XML builder is a fresh instance of +Builder::XmlMarkup+. You can + # configure your own builder with the :builder option. The method also accepts + # options like :dasherize and friends, they are forwarded to the builder. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:74 + def to_xml(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:17 + def with_defaults(other_hash); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:24 + def with_defaults!(other_hash); end + + # Returns an ActiveSupport::HashWithIndifferentAccess out of its receiver: + # + # { a: 1 }.with_indifferent_access['a'] # => 1 + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/indifferent_access.rb:9 + def with_indifferent_access; end + + private + + # Support methods for deep transforming nested hashes and arrays. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:116 + def _deep_transform_keys_in_object(object, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:129 + def _deep_transform_keys_in_object!(object, &block); end + + class << self + # Builds a Hash from XML just like Hash.from_xml, but also allows Symbol and YAML. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:133 + def from_trusted_xml(xml); end + + # Returns a Hash containing a collection of pairs when the key is the node name and the value is + # its content + # + # xml = <<-XML + # + # + # 1 + # 2 + # + # XML + # + # hash = Hash.from_xml(xml) + # # => {"hash"=>{"foo"=>1, "bar"=>2}} + # + # +DisallowedType+ is raised if the XML contains attributes with type="yaml" or + # type="symbol". Use Hash.from_trusted_xml to + # parse this XML. + # + # Custom +disallowed_types+ can also be passed in the form of an + # array. + # + # xml = <<-XML + # + # + # 1 + # "David" + # + # XML + # + # hash = Hash.from_xml(xml, ['integer']) + # # => ActiveSupport::XMLConverter::DisallowedType: Disallowed type attribute: "integer" + # + # Note that passing custom disallowed types will override the default types, + # which are Symbol and YAML. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:128 + def from_xml(xml, disallowed_types = T.unsafe(nil)); end + end +end + +# :stopdoc: +# +# pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:464 +HashWithIndifferentAccess = ActiveSupport::HashWithIndifferentAccess + +# :enddoc: +# +# pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:9 +module I18n; end + +# pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:10 +class I18n::Railtie < ::Rails::Railtie + class << self + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:103 + def include_fallbacks_module; end + + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:107 + def init_fallbacks(fallbacks); end + + # Setup i18n configuration. + # + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:36 + def initialize_i18n(app); end + + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:84 + def setup_raise_on_missing_translations_config(app, strict); end + + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:123 + def validate_fallbacks(fallbacks); end + + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:134 + def watched_dirs_with_extensions(paths); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:151 +class IO + include ::Enumerable + include ::File::Constants + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:152 + def as_json(options = T.unsafe(nil)); end +end + +class IO::Buffer + include ::Comparable + + def initialize(*_arg0); end + + def &(_arg0); end + def <=>(_arg0); end + def ^(_arg0); end + def and!(_arg0); end + def clear(*_arg0); end + def copy(*_arg0); end + def each(*_arg0); end + def each_byte(*_arg0); end + def empty?; end + def external?; end + def free; end + def get_string(*_arg0); end + def get_value(_arg0, _arg1); end + def get_values(_arg0, _arg1); end + def hexdump(*_arg0); end + def inspect; end + def internal?; end + def locked; end + def locked?; end + def mapped?; end + def not!; end + def null?; end + def or!(_arg0); end + def pread(*_arg0); end + def private?; end + def pwrite(*_arg0); end + def read(*_arg0); end + def readonly?; end + def resize(_arg0); end + def set_string(*_arg0); end + def set_value(_arg0, _arg1, _arg2); end + def set_values(_arg0, _arg1, _arg2); end + def shared?; end + def size; end + def slice(*_arg0); end + def to_s; end + def transfer; end + def valid?; end + def values(*_arg0); end + def write(*_arg0); end + def xor!(_arg0); end + def |(_arg0); end + def ~; end + + private + + def initialize_copy(_arg0); end + + class << self + def for(_arg0); end + def map(*_arg0); end + def size_of(_arg0); end + def string(_arg0); end + end +end + +class IO::Buffer::AccessError < ::RuntimeError; end +class IO::Buffer::AllocationError < ::RuntimeError; end +IO::Buffer::BIG_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::DEFAULT_SIZE = T.let(T.unsafe(nil), Integer) +IO::Buffer::EXTERNAL = T.let(T.unsafe(nil), Integer) +IO::Buffer::HOST_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::INTERNAL = T.let(T.unsafe(nil), Integer) +class IO::Buffer::InvalidatedError < ::RuntimeError; end +IO::Buffer::LITTLE_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::LOCKED = T.let(T.unsafe(nil), Integer) +class IO::Buffer::LockedError < ::RuntimeError; end +IO::Buffer::MAPPED = T.let(T.unsafe(nil), Integer) +class IO::Buffer::MaskError < ::ArgumentError; end +IO::Buffer::NETWORK_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::PAGE_SIZE = T.let(T.unsafe(nil), Integer) +IO::Buffer::PRIVATE = T.let(T.unsafe(nil), Integer) +IO::Buffer::READONLY = T.let(T.unsafe(nil), Integer) +IO::Buffer::SHARED = T.let(T.unsafe(nil), Integer) + +class IO::EAGAINWaitReadable < ::Errno::EAGAIN + include ::IO::WaitReadable +end + +class IO::EAGAINWaitWritable < ::Errno::EAGAIN + include ::IO::WaitWritable +end + +class IO::EINPROGRESSWaitReadable < ::Errno::EINPROGRESS + include ::IO::WaitReadable +end + +class IO::EINPROGRESSWaitWritable < ::Errno::EINPROGRESS + include ::IO::WaitWritable +end + +IO::EWOULDBLOCKWaitReadable = IO::EAGAINWaitReadable +IO::EWOULDBLOCKWaitWritable = IO::EAGAINWaitWritable +IO::PRIORITY = T.let(T.unsafe(nil), Integer) +IO::READABLE = T.let(T.unsafe(nil), Integer) +IO::WRITABLE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/integer/time.rb:6 +class Integer < ::Numeric + # pkg:gem/activesupport#lib/active_support/core_ext/integer/time.rb:13 + def month; end + + # Returns a Duration instance matching the number of months provided. + # + # 2.months # => 2 months + # + # pkg:gem/activesupport#lib/active_support/core_ext/integer/time.rb:10 + def months; end + + # pkg:gem/activesupport#lib/active_support/core_ext/integer/time.rb:21 + def year; end + + # Returns a Duration instance matching the number of years provided. + # + # 2.years # => 2 years + # + # pkg:gem/activesupport#lib/active_support/core_ext/integer/time.rb:18 + def years; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:3 +module Kernel + private + + # Sets $VERBOSE to +true+ for the duration of the block and back to its + # original value afterwards. + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:20 + def enable_warnings(&block); end + + # Sets $VERBOSE to +nil+ for the duration of the block and back to its original + # value afterwards. + # + # silence_warnings do + # value = noisy_call # no warning voiced + # end + # + # noisy_call # warning voiced + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:14 + def silence_warnings(&block); end + + # Blocks and ignores any exception passed as argument if raised within the block. + # + # suppress(ZeroDivisionError) do + # 1/0 + # puts 'This code is NOT reached' + # end + # + # puts 'This code gets executed and nothing related to ZeroDivisionError was seen' + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:41 + def suppress(*exception_classes); end + + # Sets $VERBOSE for the duration of the block and back to its original + # value afterwards. + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:26 + def with_warnings(flag); end + + class << self + # Sets $VERBOSE to +true+ for the duration of the block and back to its + # original value afterwards. + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:20 + def enable_warnings(&block); end + + # Sets $VERBOSE to +nil+ for the duration of the block and back to its original + # value afterwards. + # + # silence_warnings do + # value = noisy_call # no warning voiced + # end + # + # noisy_call # warning voiced + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:14 + def silence_warnings(&block); end + + # Blocks and ignores any exception passed as argument if raised within the block. + # + # suppress(ZeroDivisionError) do + # 1/0 + # puts 'This code is NOT reached' + # end + # + # puts 'This code gets executed and nothing related to ZeroDivisionError was seen' + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:41 + def suppress(*exception_classes); end + + # Sets $VERBOSE for the duration of the block and back to its original + # value afterwards. + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:26 + def with_warnings(flag); end + end +end + +# == Attribute Accessors +# +# Extends the module object with class/module and instance accessors for +# class/module attributes, just like the native attr* accessors for instance +# attributes. +# == Attribute Accessors per Thread +# +# Extends the module object with class/module and instance accessors for +# class/module attributes, just like the native attr* accessors for instance +# attributes, but does so on a per-thread basis. +# +# So the values are scoped within the Thread.current space under the class name +# of the module. +# +# Note that it can also be scoped per-fiber if +Rails.application.config.active_support.isolation_level+ +# is set to +:fiber+. +# +# pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:3 +class Module + include ::Module::Concerning + + # Allows you to make aliases for attributes, which includes + # getter, setter, and a predicate. + # + # class Content < ActiveRecord::Base + # # has a title attribute + # end + # + # class Email < Content + # alias_attribute :subject, :title + # end + # + # e = Email.find(1) + # e.title # => "Superstars" + # e.subject # => "Superstars" + # e.subject? # => true + # e.subject = "Megastars" + # e.title # => "Megastars" + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/aliasing.rb:21 + def alias_attribute(new_name, old_name); end + + # A module may or may not have a name. + # + # module M; end + # M.name # => "M" + # + # m = Module.new + # m.name # => nil + # + # +anonymous?+ method returns true if module does not have a name, false otherwise: + # + # Module.new.anonymous? # => true + # + # module M; end + # M.anonymous? # => false + # + # A module gets a name when it is first assigned to a constant. Either + # via the +module+ or +class+ keyword or by an explicit assignment: + # + # m = Module.new # creates an anonymous module + # m.anonymous? # => true + # M = m # m gets a name here as a side-effect + # m.name # => "M" + # m.anonymous? # => false + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/anonymous.rb:27 + def anonymous?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:53 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:20 + def attr_internal(*attrs); end + + # Declares an attribute reader and writer backed by an internally-named instance + # variable. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:16 + def attr_internal_accessor(*attrs); end + + # Declares an attribute reader backed by an internally-named instance variable. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:5 + def attr_internal_reader(*attrs); end + + # Declares an attribute writer backed by an internally-named instance variable. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:10 + def attr_internal_writer(*attrs); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:213 + def cattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), &blk); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:75 + def cattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:140 + def cattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end + + # Returns a copy of module or class if it's anonymous. If it's + # named, returns +self+. + # + # Object.deep_dup == Object # => true + # klass = Class.new + # klass.deep_dup == klass # => false + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/deep_dup.rb:64 + def deep_dup; end + + # Provides a +delegate+ class method to easily expose contained objects' + # public methods as your own. + # + # ==== Options + # * :to - Specifies the target object name as a symbol or string + # * :prefix - Prefixes the new method with the target name or a custom prefix + # * :allow_nil - If set to true, prevents a +ActiveSupport::DelegationError+ + # from being raised + # * :private - If set to true, changes method visibility to private + # + # The macro receives one or more method names (specified as symbols or + # strings) and the name of the target object via the :to option + # (also a symbol or string). + # + # Delegation is particularly useful with Active Record associations: + # + # class Greeter < ActiveRecord::Base + # def hello + # 'hello' + # end + # + # def goodbye + # 'goodbye' + # end + # end + # + # class Foo < ActiveRecord::Base + # belongs_to :greeter + # delegate :hello, to: :greeter + # end + # + # Foo.new.hello # => "hello" + # Foo.new.goodbye # => NoMethodError: undefined method `goodbye' for # + # + # Multiple delegates to the same target are allowed: + # + # class Foo < ActiveRecord::Base + # belongs_to :greeter + # delegate :hello, :goodbye, to: :greeter + # end + # + # Foo.new.goodbye # => "goodbye" + # + # Methods can be delegated to instance variables, class variables, or constants + # by providing them as a symbols: + # + # class Foo + # CONSTANT_ARRAY = [0,1,2,3] + # @@class_array = [4,5,6,7] + # + # def initialize + # @instance_array = [8,9,10,11] + # end + # delegate :sum, to: :CONSTANT_ARRAY + # delegate :min, to: :@@class_array + # delegate :max, to: :@instance_array + # end + # + # Foo.new.sum # => 6 + # Foo.new.min # => 4 + # Foo.new.max # => 11 + # + # It's also possible to delegate a method to the class by using +:class+: + # + # class Foo + # def self.hello + # "world" + # end + # + # delegate :hello, to: :class + # end + # + # Foo.new.hello # => "world" + # + # Delegates can optionally be prefixed using the :prefix option. If the value + # is true, the delegate methods are prefixed with the name of the object being + # delegated to. + # + # Person = Struct.new(:name, :address) + # + # class Invoice < Struct.new(:client) + # delegate :name, :address, to: :client, prefix: true + # end + # + # john_doe = Person.new('John Doe', 'Vimmersvej 13') + # invoice = Invoice.new(john_doe) + # invoice.client_name # => "John Doe" + # invoice.client_address # => "Vimmersvej 13" + # + # It is also possible to supply a custom prefix. + # + # class Invoice < Struct.new(:client) + # delegate :name, :address, to: :client, prefix: :customer + # end + # + # invoice = Invoice.new(john_doe) + # invoice.customer_name # => 'John Doe' + # invoice.customer_address # => 'Vimmersvej 13' + # + # The delegated methods are public by default. + # Pass private: true to change that. + # + # class User < ActiveRecord::Base + # has_one :profile + # delegate :first_name, to: :profile + # delegate :date_of_birth, to: :profile, private: true + # + # def age + # Date.today.year - date_of_birth.year + # end + # end + # + # User.new.first_name # => "Tomas" + # User.new.date_of_birth # => NoMethodError: private method `date_of_birth' called for # + # User.new.age # => 2 + # + # If the target is +nil+ and does not respond to the delegated method a + # +ActiveSupport::DelegationError+ is raised. If you wish to instead return +nil+, + # use the :allow_nil option. + # + # class User < ActiveRecord::Base + # has_one :profile + # delegate :age, to: :profile + # end + # + # User.new.age + # # => ActiveSupport::DelegationError: User#age delegated to profile.age, but profile is nil + # + # But if not having a profile yet is fine and should not be an error + # condition: + # + # class User < ActiveRecord::Base + # has_one :profile + # delegate :age, to: :profile, allow_nil: true + # end + # + # User.new.age # nil + # + # Note that if the target is not +nil+ then the call is attempted regardless of the + # :allow_nil option, and thus an exception is still raised if said object + # does not respond to the method: + # + # class Foo + # def initialize(bar) + # @bar = bar + # end + # + # delegate :name, to: :@bar, allow_nil: true + # end + # + # Foo.new("Bar").name # raises NoMethodError: undefined method `name' + # + # The target method must be public, otherwise it will raise +NoMethodError+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:160 + def delegate(*methods, to: T.unsafe(nil), prefix: T.unsafe(nil), allow_nil: T.unsafe(nil), private: T.unsafe(nil)); end + + # When building decorators, a common pattern may emerge: + # + # class Partition + # def initialize(event) + # @event = event + # end + # + # def person + # detail.person || creator + # end + # + # private + # def respond_to_missing?(name, include_private = false) + # @event.respond_to?(name, include_private) + # end + # + # def method_missing(method, *args, &block) + # @event.send(method, *args, &block) + # end + # end + # + # With Module#delegate_missing_to, the above is condensed to: + # + # class Partition + # delegate_missing_to :@event + # + # def initialize(event) + # @event = event + # end + # + # def person + # detail.person || creator + # end + # end + # + # The target can be anything callable within the object, e.g. instance + # variables, methods, constants, etc. + # + # The delegated method must be public on the target, otherwise it will + # raise +ActiveSupport::DelegationError+. If you wish to instead return +nil+, + # use the :allow_nil option. + # + # The marshal_dump and _dump methods are exempt from + # delegation due to possible interference when calling + # Marshal.dump(object), should the delegation target method + # of object add or remove instance variables. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:218 + def delegate_missing_to(target, allow_nil: T.unsafe(nil)); end + + # deprecate :foo, deprecator: MyLib.deprecator + # deprecate :foo, bar: "warning!", deprecator: MyLib.deprecator + # + # A deprecator is typically an instance of ActiveSupport::Deprecation, but you can also pass any object that responds + # to deprecation_warning(deprecated_method_name, message, caller_backtrace) where you can implement your + # custom warning behavior. + # + # class MyLib::Deprecator + # def deprecation_warning(deprecated_method_name, message, caller_backtrace = nil) + # message = "#{deprecated_method_name} is deprecated and will be removed from MyLibrary | #{message}" + # Kernel.warn message + # end + # end + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/deprecation.rb:17 + def deprecate(*method_names, deprecator:, **options); end + + # Defines both class and instance accessors for class attributes. + # All class and instance methods created will be public, even if + # this method is called with a private or protected access modifier. + # + # module HairColors + # mattr_accessor :hair_colors + # end + # + # class Person + # include HairColors + # end + # + # HairColors.hair_colors = [:brown, :black, :blonde, :red] + # HairColors.hair_colors # => [:brown, :black, :blonde, :red] + # Person.new.hair_colors # => [:brown, :black, :blonde, :red] + # + # If a subclass changes the value then that would also change the value for + # parent class. Similarly if parent class changes the value then that would + # change the value of subclasses too. + # + # class Citizen < Person + # end + # + # Citizen.new.hair_colors << :blue + # Person.new.hair_colors # => [:brown, :black, :blonde, :red, :blue] + # + # To omit the instance writer method, pass instance_writer: false. + # To omit the instance reader method, pass instance_reader: false. + # + # module HairColors + # mattr_accessor :hair_colors, instance_writer: false, instance_reader: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors = [:brown] # => NoMethodError + # Person.new.hair_colors # => NoMethodError + # + # Or pass instance_accessor: false, to omit both instance methods. + # + # module HairColors + # mattr_accessor :hair_colors, instance_accessor: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors = [:brown] # => NoMethodError + # Person.new.hair_colors # => NoMethodError + # + # You can set a default value for the attribute. + # + # module HairColors + # mattr_accessor :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_accessor(:hair_styles) { [:long, :short] } + # end + # + # class Person + # include HairColors + # end + # + # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] + # Person.class_variable_get("@@hair_styles") # => [:long, :short] + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:208 + def mattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), &blk); end + + # Defines a class attribute and creates a class and instance reader methods. + # The underlying class variable is set to +nil+, if it is not previously + # defined. All class and instance methods created will be public, even if + # this method is called with a private or protected access modifier. + # + # module HairColors + # mattr_reader :hair_colors + # end + # + # HairColors.hair_colors # => nil + # HairColors.class_variable_set("@@hair_colors", [:brown, :black]) + # HairColors.hair_colors # => [:brown, :black] + # + # The attribute name must be a valid method name in Ruby. + # + # module Foo + # mattr_reader :"1_Badname" + # end + # # => NameError: invalid attribute name: 1_Badname + # + # To omit the instance reader method, pass + # instance_reader: false or instance_accessor: false. + # + # module HairColors + # mattr_reader :hair_colors, instance_reader: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors # => NoMethodError + # + # You can set a default value for the attribute. + # + # module HairColors + # mattr_reader :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_reader(:hair_styles) { [:long, :short] } + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors # => [:brown, :black, :blonde, :red] + # Person.new.hair_styles # => [:long, :short] + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:55 + def mattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end + + # Defines a class attribute and creates a class and instance writer methods to + # allow assignment to the attribute. All class and instance methods created + # will be public, even if this method is called with a private or protected + # access modifier. + # + # module HairColors + # mattr_writer :hair_colors + # end + # + # class Person + # include HairColors + # end + # + # HairColors.hair_colors = [:brown, :black] + # Person.class_variable_get("@@hair_colors") # => [:brown, :black] + # Person.new.hair_colors = [:blonde, :red] + # HairColors.class_variable_get("@@hair_colors") # => [:blonde, :red] + # + # To omit the instance writer method, pass + # instance_writer: false or instance_accessor: false. + # + # module HairColors + # mattr_writer :hair_colors, instance_writer: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors = [:blonde, :red] # => NoMethodError + # + # You can set a default value for the attribute. + # + # module HairColors + # mattr_writer :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_writer(:hair_styles) { [:long, :short] } + # end + # + # class Person + # include HairColors + # end + # + # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] + # Person.class_variable_get("@@hair_styles") # => [:long, :short] + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:121 + def mattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/redefine_method.rb:30 + def method_visibility(method); end + + # Returns the module which contains this one according to its name. + # + # module M + # module N + # end + # end + # X = M::N + # + # M::N.module_parent # => M + # X.module_parent # => M + # + # The parent of top-level and anonymous modules is Object. + # + # M.module_parent # => Object + # Module.new.module_parent # => Object + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/introspection.rb:37 + def module_parent; end + + # Returns the name of the module containing this one. + # + # M::N.module_parent_name # => "M" + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/introspection.rb:9 + def module_parent_name; end + + # Returns all the parents of this module according to its name, ordered from + # nested outwards. The receiver is not contained within the result. + # + # module M + # module N + # end + # end + # X = M::N + # + # M.module_parents # => [Object] + # M::N.module_parents # => [M, Object] + # X.module_parents # => [M, Object] + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/introspection.rb:53 + def module_parents; end + + # Replaces the existing method definition, if there is one, with the passed + # block as its body. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/redefine_method.rb:17 + def redefine_method(method, &block); end + + # Replaces the existing singleton method definition, if there is one, with + # the passed block as its body. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/redefine_method.rb:26 + def redefine_singleton_method(method, &block); end + + # Removes the named method, if it exists. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/remove_method.rb:7 + def remove_possible_method(method); end + + # Removes the named singleton method, if it exists. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/remove_method.rb:14 + def remove_possible_singleton_method(method); end + + # Marks the named method as intended to be redefined, if it exists. + # Suppresses the Ruby method redefinition warning. Prefer + # #redefine_method where possible. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/redefine_method.rb:7 + def silence_redefinition_of_method(method); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors_per_thread.rb:174 + def thread_cattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors_per_thread.rb:81 + def thread_cattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors_per_thread.rb:123 + def thread_cattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil)); end + + # Defines both class and instance accessors for class attributes. + # + # class Account + # thread_mattr_accessor :user + # end + # + # Account.user = "DHH" + # Account.user # => "DHH" + # Account.new.user # => "DHH" + # + # Unlike +mattr_accessor+, values are *not* shared with subclasses or parent classes. + # If a subclass changes the value, the parent class' value is not changed. + # If the parent class changes the value, the value of subclasses is not changed. + # + # class Customer < Account + # end + # + # Account.user # => "DHH" + # Customer.user # => nil + # Customer.user = "Rafael" + # Customer.user # => "Rafael" + # Account.user # => "DHH" + # + # To omit the instance writer method, pass instance_writer: false. + # To omit the instance reader method, pass instance_reader: false. + # + # class Current + # thread_mattr_accessor :user, instance_writer: false, instance_reader: false + # end + # + # Current.new.user = "DHH" # => NoMethodError + # Current.new.user # => NoMethodError + # + # Or pass instance_accessor: false, to omit both instance methods. + # + # class Current + # thread_mattr_accessor :user, instance_accessor: false + # end + # + # Current.new.user = "DHH" # => NoMethodError + # Current.new.user # => NoMethodError + # + # A default value may be specified using the +:default+ option. Because + # multiple threads can access the default value, non-frozen default values + # will be duped and frozen. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors_per_thread.rb:170 + def thread_mattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # Defines a per-thread class attribute and creates class and instance reader methods. + # The underlying per-thread class variable is set to +nil+, if it is not previously defined. + # + # module Current + # thread_mattr_reader :user + # end + # + # Current.user = "DHH" + # Current.user # => "DHH" + # Thread.new { Current.user }.value # => nil + # + # The attribute name must be a valid method name in Ruby. + # + # module Foo + # thread_mattr_reader :"1_Badname" + # end + # # => NameError: invalid attribute name: 1_Badname + # + # To omit the instance reader method, pass + # instance_reader: false or instance_accessor: false. + # + # class Current + # thread_mattr_reader :user, instance_reader: false + # end + # + # Current.new.user # => NoMethodError + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors_per_thread.rb:41 + def thread_mattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # Defines a per-thread class attribute and creates a class and instance writer methods to + # allow assignment to the attribute. + # + # module Current + # thread_mattr_writer :user + # end + # + # Current.user = "DHH" + # Thread.current[:attr_Current_user] # => "DHH" + # + # To omit the instance writer method, pass + # instance_writer: false or instance_accessor: false. + # + # class Current + # thread_mattr_writer :user, instance_writer: false + # end + # + # Current.new.user = "DHH" # => NoMethodError + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors_per_thread.rb:101 + def thread_mattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:40 + def attr_internal_define(attr_name, type); end + + class << self + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:23 + def attr_internal_naming_format; end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:25 + def attr_internal_naming_format=(format); end + end +end + +# == Bite-sized separation of concerns +# +# We often find ourselves with a medium-sized chunk of behavior that we'd +# like to extract, but only mix in to a single class. +# +# Extracting a plain old Ruby object to encapsulate it and collaborate or +# delegate to the original object is often a good choice, but when there's +# no additional state to encapsulate or we're making DSL-style declarations +# about the parent class, introducing new collaborators can obfuscate rather +# than simplify. +# +# The typical route is to just dump everything in a monolithic class, perhaps +# with a comment, as a least-bad alternative. Using modules in separate files +# means tedious sifting to get a big-picture view. +# +# == Dissatisfying ways to separate small concerns +# +# === Using comments: +# +# class Todo < ApplicationRecord +# # Other todo implementation +# # ... +# +# ## Event tracking +# has_many :events +# +# before_create :track_creation +# +# private +# def track_creation +# # ... +# end +# end +# +# === With an inline module: +# +# Noisy syntax. +# +# class Todo < ApplicationRecord +# # Other todo implementation +# # ... +# +# module EventTracking +# extend ActiveSupport::Concern +# +# included do +# has_many :events +# before_create :track_creation +# end +# +# private +# def track_creation +# # ... +# end +# end +# include EventTracking +# end +# +# === Mix-in noise exiled to its own file: +# +# Once our chunk of behavior starts pushing the scroll-to-understand-it +# boundary, we give in and move it to a separate file. At this size, the +# increased overhead can be a reasonable tradeoff even if it reduces our +# at-a-glance perception of how things work. +# +# class Todo < ApplicationRecord +# # Other todo implementation +# # ... +# +# include TodoEventTracking +# end +# +# == Introducing Module#concerning +# +# By quieting the mix-in noise, we arrive at a natural, low-ceremony way to +# separate bite-sized concerns. +# +# class Todo < ApplicationRecord +# # Other todo implementation +# # ... +# +# concerning :EventTracking do +# included do +# has_many :events +# before_create :track_creation +# end +# +# private +# def track_creation +# # ... +# end +# end +# end +# +# Todo.ancestors +# # => [Todo, Todo::EventTracking, ApplicationRecord, Object] +# +# This small step has some wonderful ripple effects. We can +# * grok the behavior of our class in one glance, +# * clean up monolithic junk-drawer classes by separating their concerns, and +# * stop leaning on protected/private for crude "this is internal stuff" modularity. +# +# === Prepending concerning +# +# concerning supports a prepend: true argument which will prepend the +# concern instead of using include for it. +# +# pkg:gem/activesupport#lib/active_support/core_ext/module/concerning.rb:112 +module Module::Concerning + # A low-cruft shortcut to define a concern. + # + # concern :EventTracking do + # ... + # end + # + # is equivalent to + # + # module EventTracking + # extend ActiveSupport::Concern + # + # ... + # end + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/concerning.rb:132 + def concern(topic, &module_definition); end + + # Define a new concern and mix it in. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/concerning.rb:114 + def concerning(topic, prepend: T.unsafe(nil), &block); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:5 +Module::DelegationError = ActiveSupport::DelegationError + +# pkg:gem/activesupport#lib/active_support/core_ext/name_error.rb:3 +class NameError < ::StandardError + include ::ErrorHighlight::CoreExt + include ::DidYouMean::Correctable + + # Extract the name of the missing constant from the exception message. + # + # begin + # HelloWorld + # rescue NameError => e + # e.missing_name + # end + # # => "HelloWorld" + # + # pkg:gem/activesupport#lib/active_support/core_ext/name_error.rb:12 + def missing_name; end + + # Was this exception raised because the given name was missing? + # + # begin + # HelloWorld + # rescue NameError => e + # e.missing_name?("HelloWorld") + # end + # # => true + # + # pkg:gem/activesupport#lib/active_support/core_ext/name_error.rb:44 + def missing_name?(name); end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/name_error.rb:56 + def real_mod_name(mod); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/name_error.rb:53 +NameError::UNBOUND_METHOD_MODULE_NAME = T.let(T.unsafe(nil), UnboundMethod) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:50 +class NilClass + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:93 + def as_json(options = T.unsafe(nil)); end + + # +nil+ is blank: + # + # nil.blank? # => true + # + # @return [true] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:56 + def blank?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:60 + def present?; end + + # Returns +self+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:26 + def to_param; end + + # Returns a CGI-escaped +key+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:21 + def to_query(key); end + + # Calling +try+ on +nil+ always returns +nil+. + # It becomes especially helpful when navigating through associations that may return +nil+. + # + # nil.try(:name) # => nil + # + # Without +try+ + # @person && @person.children.any? && @person.children.first.name + # + # With +try+ + # @person.try(:children).try(:first).try(:name) + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:148 + def try(*_arg0, &_arg1); end + + # Calling +try!+ on +nil+ always returns +nil+. + # + # nil.try!(:name) # => nil + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:155 + def try!(*_arg0, &_arg1); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:170 +class Numeric + include ::Comparable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:111 + def as_json(options = T.unsafe(nil)); end + + # No number is blank: + # + # 1.blank? # => false + # 0.blank? # => false + # + # @return [false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:177 + def blank?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:18 + def byte; end + + # Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes + # + # 2.bytes # => 2 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:15 + def bytes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:40 + def day; end + + # Returns a Duration instance matching the number of days provided. + # + # 2.days # => 2 days + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:37 + def days; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:66 + def exabyte; end + + # Returns the number of bytes equivalent to the exabytes provided. + # + # 2.exabytes # => 2_305_843_009_213_693_952 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:63 + def exabytes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:56 + def fortnight; end + + # Returns a Duration instance matching the number of fortnights provided. + # + # 2.fortnights # => 4 weeks + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:53 + def fortnights; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:42 + def gigabyte; end + + # Returns the number of bytes equivalent to the gigabytes provided. + # + # 2.gigabytes # => 2_147_483_648 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:39 + def gigabytes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:32 + def hour; end + + # Returns a Duration instance matching the number of hours provided. + # + # 2.hours # => 2 hours + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:29 + def hours; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:13 + def html_safe?; end + + # Returns the number of milliseconds equivalent to the seconds provided. + # Used with the standard time durations. + # + # 2.in_milliseconds # => 2000 + # 1.hour.in_milliseconds # => 3600000 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:63 + def in_milliseconds; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:26 + def kilobyte; end + + # Returns the number of bytes equivalent to the kilobytes provided. + # + # 2.kilobytes # => 2048 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:23 + def kilobytes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:34 + def megabyte; end + + # Returns the number of bytes equivalent to the megabytes provided. + # + # 2.megabytes # => 2_097_152 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:31 + def megabytes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:24 + def minute; end + + # Returns a Duration instance matching the number of minutes provided. + # + # 2.minutes # => 2 minutes + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:21 + def minutes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:58 + def petabyte; end + + # Returns the number of bytes equivalent to the petabytes provided. + # + # 2.petabytes # => 2_251_799_813_685_248 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:55 + def petabytes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:181 + def present?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:16 + def second; end + + # Returns a Duration instance matching the number of seconds provided. + # + # 2.seconds # => 2 seconds + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:13 + def seconds; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:50 + def terabyte; end + + # Returns the number of bytes equivalent to the terabytes provided. + # + # 2.terabytes # => 2_199_023_255_552 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:47 + def terabytes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:48 + def week; end + + # Returns a Duration instance matching the number of weeks provided. + # + # 2.weeks # => 2 weeks + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:45 + def weeks; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:74 + def zettabyte; end + + # Returns the number of bytes equivalent to the zettabytes provided. + # + # 2.zettabytes # => 2_361_183_241_434_822_606_848 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:71 + def zettabytes; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:9 +Numeric::EXABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:6 +Numeric::GIGABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:4 +Numeric::KILOBYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:5 +Numeric::MEGABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:8 +Numeric::PETABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:7 +Numeric::TERABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:10 +Numeric::ZETTABYTE = T.let(T.unsafe(nil), Integer) + +# -- +# Most objects are cloneable, but not all. For example you can't dup methods: +# +# method(:puts).dup # => TypeError: allocator undefined for Method +# +# Classes may signal their instances are not duplicable removing +dup+/+clone+ +# or raising exceptions from them. So, to dup an arbitrary object you normally +# use an optimistic approach and are ready to catch an exception, say: +# +# arbitrary_object.dup rescue object +# +# Rails dups objects in a few critical spots where they are not that arbitrary. +# That rescue is very expensive (like 40 times slower than a predicate), and it +# is often triggered. +# +# That's why we hardcode the following cases and check duplicable? instead of +# using that rescue idiom. +# ++ +# +# pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:21 +class Object < ::BasicObject + include ::ActiveSupport::Dependencies::RequireDependency + include ::Kernel + include ::PP::ObjectMixin + include ::ActiveSupport::Tryable + include ::ActiveSupport::ToJsonWithActiveSupportEncoder + + # Provides a way to check whether some class acts like some other class based on the existence of + # an appropriately-named marker method. + # + # A class that provides the same interface as SomeClass may define a marker method named + # acts_like_some_class? to signal its compatibility to callers of + # acts_like?(:some_class). + # + # For example, Active Support extends Date to define an acts_like_date? method, + # and extends Time to define acts_like_time?. As a result, developers can call + # x.acts_like?(:time) and x.acts_like?(:date) to test duck-type compatibility, + # and classes that are able to act like Time can also define an acts_like_time? + # method to interoperate. + # + # Note that the marker method is only expected to exist. It isn't called, so its body or return + # value are irrelevant. + # + # ==== Example: A class that provides the same interface as String + # + # This class may define: + # + # class Stringish + # def acts_like_string? + # end + # end + # + # Then client code can query for duck-type-safeness this way: + # + # Stringish.new.acts_like?(:string) # => true + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/acts_like.rb:33 + def acts_like?(duck); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:59 + def as_json(options = T.unsafe(nil)); end + + # An object is blank if it's false, empty, or a whitespace string. + # For example, +nil+, '', ' ', [], {}, and +false+ are all blank. + # + # This simplifies + # + # !address || address.empty? + # + # to + # + # address.blank? + # + # @return [true, false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:18 + def blank?; end + + # Returns a deep copy of object if it's duplicable. If it's + # not duplicable, returns +self+. + # + # object = Object.new + # dup = object.deep_dup + # dup.instance_variable_set(:@a, 1) + # + # object.instance_variable_defined?(:@a) # => false + # dup.instance_variable_defined?(:@a) # => true + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/deep_dup.rb:15 + def deep_dup; end + + # Can you safely dup this object? + # + # False for method objects; + # true otherwise. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:26 + def duplicable?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:7 + def html_safe?; end + + # Returns true if this object is included in the argument. + # + # When argument is a +Range+, +#cover?+ is used to properly handle inclusion + # check within open ranges. Otherwise, argument must be any object which responds + # to +#include?+. Usage: + # + # characters = ["Konata", "Kagami", "Tsukasa"] + # "Konata".in?(characters) # => true + # + # For non +Range+ arguments, this will throw an +ArgumentError+ if the argument + # doesn't respond to +#include?+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/inclusion.rb:15 + def in?(another_object); end + + # Returns a hash with string keys that maps instance variable names without "@" to their + # corresponding values. + # + # class C + # def initialize(x, y) + # @x, @y = x, y + # end + # end + # + # C.new(0, 1).instance_values # => {"x" => 0, "y" => 1} + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/instance_variables.rb:14 + def instance_values; end + + # Returns an array of instance variable names as strings including "@". + # + # class C + # def initialize(x, y) + # @x, @y = x, y + # end + # end + # + # C.new(0, 1).instance_variable_names # => ["@y", "@x"] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/instance_variables.rb:29 + def instance_variable_names; end + + # Returns the receiver if it's present otherwise returns +nil+. + # object.presence is equivalent to + # + # object.present? ? object : nil + # + # For example, something like + # + # state = params[:state] if params[:state].present? + # country = params[:country] if params[:country].present? + # region = state || country || 'US' + # + # becomes + # + # region = params[:state].presence || params[:country].presence || 'US' + # + # @return [Object] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:45 + def presence; end + + # Returns the receiver if it's included in the argument otherwise returns +nil+. + # Argument must be any object which responds to +#include?+. Usage: + # + # params[:bucket_type].presence_in %w( project calendar ) + # + # This will throw an +ArgumentError+ if the argument doesn't respond to +#include?+. + # + # @return [Object] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/inclusion.rb:34 + def presence_in(another_object); end + + # An object is present if it's not blank. + # + # @return [true, false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:25 + def present?; end + + # Alias of to_s. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:8 + def to_param; end + + # Converts an object into a string suitable for use as a URL query string, + # using the given key as the param name. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:14 + def to_query(key); end + + # Set and restore public attributes around a block. + # + # client.timeout # => 5 + # client.with(timeout: 1) do |c| + # c.timeout # => 1 + # end + # client.timeout # => 5 + # + # The receiver is yielded to the provided block. + # + # This method is a shorthand for the common begin/ensure pattern: + # + # old_value = object.attribute + # begin + # object.attribute = new_value + # # do things + # ensure + # object.attribute = old_value + # end + # + # It can be used on any object as long as both the reader and writer methods + # are public. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/with.rb:26 + def with(**attributes); end + + # An elegant way to factor duplication out of options passed to a series of + # method calls. Each method called in the block, with the block variable as + # the receiver, will have its options merged with the default +options+ + # Hash or Hash-like object provided. Each method called on + # the block variable must take an options hash as its final argument. + # + # Without with_options, this code contains duplication: + # + # class Account < ActiveRecord::Base + # has_many :customers, dependent: :destroy + # has_many :products, dependent: :destroy + # has_many :invoices, dependent: :destroy + # has_many :expenses, dependent: :destroy + # end + # + # Using with_options, we can remove the duplication: + # + # class Account < ActiveRecord::Base + # with_options dependent: :destroy do |assoc| + # assoc.has_many :customers + # assoc.has_many :products + # assoc.has_many :invoices + # assoc.has_many :expenses + # end + # end + # + # It can also be used with an explicit receiver: + # + # I18n.with_options locale: user.locale, scope: 'newsletter' do |i18n| + # subject i18n.t :subject + # body i18n.t :body, user_name: user.name + # end + # + # When you don't pass an explicit receiver, it executes the whole block + # in merging options context: + # + # class Account < ActiveRecord::Base + # with_options dependent: :destroy do + # has_many :customers + # has_many :products + # has_many :invoices + # has_many :expenses + # end + # end + # + # with_options can also be nested since the call is forwarded to its receiver. + # + # NOTE: Each nesting level will merge inherited defaults in addition to their own. + # + # class Post < ActiveRecord::Base + # with_options if: :persisted?, length: { minimum: 50 } do + # validates :content, if: -> { content.present? } + # end + # end + # + # The code is equivalent to: + # + # validates :content, length: { minimum: 50 }, if: -> { content.present? } + # + # Hence the inherited default for +if+ key is ignored. + # + # NOTE: You cannot call class methods implicitly inside of +with_options+. + # You can access these methods using the class name instead: + # + # class Phone < ActiveRecord::Base + # enum :phone_number_type, { home: 0, office: 1, mobile: 2 } + # + # with_options presence: true do + # validates :phone_number_type, inclusion: { in: Phone.phone_number_types.keys } + # end + # end + # + # When the block argument is omitted, the decorated Object instance is returned: + # + # module MyStyledHelpers + # def styled + # with_options style: "color: red;" + # end + # end + # + # styled.link_to "I'm red", "/" + # # => I'm red + # + # styled.button_tag "I'm red too!" + # # => + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/with_options.rb:92 + def with_options(options, &block); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:236 +class Pathname + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:237 + def as_json(options = T.unsafe(nil)); end +end + +module Process + extend ::ActiveSupport::ForkTracker::CoreExt + + class << self + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:6 + def _fork; end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:257 +class Process::Status + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:258 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:157 +class Range + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:158 + def as_json(options = T.unsafe(nil)); end + + # Optimize range sum to use arithmetic progression if a block is not given and + # we have a range of numeric values. + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:253 + def sum(initial_value = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:139 +class Regexp + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:140 + def as_json(options = T.unsafe(nil)); end + + # Returns +true+ if the regexp has the multiline flag set. + # + # (/./).multiline? # => false + # (/./m).multiline? # => true + # + # Regexp.new(".").multiline? # => false + # Regexp.new(".", Regexp::MULTILINE).multiline? # => true + # + # pkg:gem/activesupport#lib/active_support/core_ext/regexp.rb:11 + def multiline?; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:62 +module Singleton + mixes_in_class_methods ::Singleton::SingletonClassMethods + + # Singleton instances are not duplicable: + # + # Class.new.include(Singleton).instance.dup # TypeError (can't dup instance of singleton + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:66 + def duplicable?; end +end + +# String inflections define new methods on the String class to transform names for different purposes. +# For instance, you can figure out the name of a table from the name of a class. +# +# 'ScaleScore'.tableize # => "scale_scores" +# +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:135 +class String + include ::Comparable + + # Enables more predictable duck-typing on String-like classes. See Object#acts_like?. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/behavior.rb:5 + def acts_like_string?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:99 + def as_json(options = T.unsafe(nil)); end + + # If you pass a single integer, returns a substring of one character at that + # position. The first character of the string is at position 0, the next at + # position 1, and so on. If a range is supplied, a substring containing + # characters at offsets given by the range is returned. In both cases, if an + # offset is negative, it is counted from the end of the string. Returns +nil+ + # if the initial offset falls outside the string. Returns an empty string if + # the beginning of the range is greater than the end of the string. + # + # str = "hello" + # str.at(0) # => "h" + # str.at(1..3) # => "ell" + # str.at(-2) # => "l" + # str.at(-2..-1) # => "lo" + # str.at(5) # => nil + # str.at(5..-1) # => "" + # + # If a Regexp is given, the matching portion of the string is returned. + # If a String is given, that given string is returned if it occurs in + # the string. In both cases, +nil+ is returned if there is no match. + # + # str = "hello" + # str.at(/lo/) # => "lo" + # str.at(/ol/) # => nil + # str.at("lo") # => "lo" + # str.at("ol") # => nil + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:29 + def at(position); end + + # A string is blank if it's empty or contains whitespaces only: + # + # ''.blank? # => true + # ' '.blank? # => true + # "\t\n\r".blank? # => true + # ' blah '.blank? # => false + # + # Unicode whitespace is supported: + # + # "\u00a0".blank? # => true + # + # @return [true, false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:153 + def blank?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:111 + def camelcase(first_letter = T.unsafe(nil)); end + + # By default, +camelize+ converts strings to UpperCamelCase. If the argument to camelize + # is set to :lower then camelize produces lowerCamelCase. + # + # +camelize+ will also convert '/' to '::' which is useful for converting paths to namespaces. + # + # 'active_record'.camelize # => "ActiveRecord" + # 'active_record'.camelize(:lower) # => "activeRecord" + # 'active_record/errors'.camelize # => "ActiveRecord::Errors" + # 'active_record/errors'.camelize(:lower) # => "activeRecord::Errors" + # + # See ActiveSupport::Inflector.camelize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:101 + def camelize(first_letter = T.unsafe(nil)); end + + # Creates a class name from a plural table name like \Rails does for table names to models. + # Note that this returns a string and not a class. (To convert to an actual class + # follow +classify+ with +constantize+.) + # + # 'ham_and_eggs'.classify # => "HamAndEgg" + # 'posts'.classify # => "Post" + # + # See ActiveSupport::Inflector.classify. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:239 + def classify; end + + # +constantize+ tries to find a declared constant with the name specified + # in the string. It raises a NameError when the name is not in CamelCase + # or is not initialized. + # + # 'Module'.constantize # => Module + # 'Class'.constantize # => Class + # 'blargle'.constantize # => NameError: wrong constant name blargle + # + # See ActiveSupport::Inflector.constantize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:73 + def constantize; end + + # Replaces underscores with dashes in the string. + # + # 'puni_puni'.dasherize # => "puni-puni" + # + # See ActiveSupport::Inflector.dasherize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:148 + def dasherize; end + + # Removes the rightmost segment from the constant expression in the string. + # + # 'Net::HTTP'.deconstantize # => "Net" + # '::Net::HTTP'.deconstantize # => "::Net" + # 'String'.deconstantize # => "" + # '::String'.deconstantize # => "" + # ''.deconstantize # => "" + # + # See ActiveSupport::Inflector.deconstantize. + # + # See also +demodulize+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:177 + def deconstantize; end + + # Removes the module part from the constant expression in the string. + # + # 'ActiveSupport::Inflector::Inflections'.demodulize # => "Inflections" + # 'Inflections'.demodulize # => "Inflections" + # '::Inflections'.demodulize # => "Inflections" + # ''.demodulize # => '' + # + # See ActiveSupport::Inflector.demodulize. + # + # See also +deconstantize+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:162 + def demodulize; end + + # Converts the first character to lowercase. + # + # 'If they enjoyed The Matrix'.downcase_first # => "if they enjoyed The Matrix" + # 'I'.downcase_first # => "i" + # ''.downcase_first # => "" + # + # See ActiveSupport::Inflector.downcase_first. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:284 + def downcase_first; end + + # Returns the first character. If a limit is supplied, returns a substring + # from the beginning of the string until it reaches the limit value. If the + # given limit is greater than or equal to the string length, returns a copy of self. + # + # str = "hello" + # str.first # => "h" + # str.first(1) # => "h" + # str.first(2) # => "he" + # str.first(0) # => "" + # str.first(6) # => "hello" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:78 + def first(limit = T.unsafe(nil)); end + + # Creates a foreign key name from a class name. + # +separate_class_name_and_id_with_underscore+ sets whether + # the method should put '_' between the name and 'id'. + # + # 'Message'.foreign_key # => "message_id" + # 'Message'.foreign_key(false) # => "messageid" + # 'Admin::Post'.foreign_key # => "post_id" + # + # See ActiveSupport::Inflector.foreign_key. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:297 + def foreign_key(separate_class_name_and_id_with_underscore = T.unsafe(nil)); end + + # Returns a substring from the given position to the end of the string. + # If the position is negative, it is counted from the end of the string. + # + # str = "hello" + # str.from(0) # => "hello" + # str.from(3) # => "lo" + # str.from(-2) # => "lo" + # + # You can mix it with +to+ method and do fun things like: + # + # str = "hello" + # str.from(0).to(-1) # => "hello" + # str.from(1).to(-2) # => "ell" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:46 + def from(position); end + + # Marks a string as trusted safe. It will be inserted into HTML with no + # additional escaping performed. It is your responsibility to ensure that the + # string contains no malicious content. This method is equivalent to the + # +raw+ helper in views. It is recommended that you use +sanitize+ instead of + # this method. It should never be called on user input. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:241 + def html_safe; end + + # Capitalizes the first word, turns underscores into spaces, and (by default) strips a + # trailing '_id' if present. + # Like +titleize+, this is meant for creating pretty output. + # + # The capitalization of the first word can be turned off by setting the + # optional parameter +capitalize+ to false. + # By default, this parameter is true. + # + # The trailing '_id' can be kept by setting the + # optional parameter +keep_id_suffix+ to true. + # By default, this parameter is false. + # + # 'employee_salary'.humanize # => "Employee salary" + # 'author_id'.humanize # => "Author" + # 'author_id'.humanize(capitalize: false) # => "author" + # '_id'.humanize # => "Id" + # 'author_id'.humanize(keep_id_suffix: true) # => "Author id" + # + # See ActiveSupport::Inflector.humanize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:262 + def humanize(capitalize: T.unsafe(nil), keep_id_suffix: T.unsafe(nil)); end + + # Returns +true+ if string has utf_8 encoding. + # + # utf_8_str = "some string".encode "UTF-8" + # iso_str = "some string".encode "ISO-8859-1" + # + # utf_8_str.is_utf8? # => true + # iso_str.is_utf8? # => false + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/multibyte.rb:57 + def is_utf8?; end + + # Returns the last character of the string. If a limit is supplied, returns a substring + # from the end of the string until it reaches the limit value (counting backwards). If + # the given limit is greater than or equal to the string length, returns a copy of self. + # + # str = "hello" + # str.last # => "o" + # str.last(1) # => "o" + # str.last(2) # => "lo" + # str.last(0) # => "" + # str.last(6) # => "hello" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:92 + def last(limit = T.unsafe(nil)); end + + # == Multibyte proxy + # + # +mb_chars+ is a multibyte safe proxy for string methods. + # + # It creates and returns an instance of the ActiveSupport::Multibyte::Chars class which + # encapsulates the original string. A Unicode safe version of all the String methods are defined on this proxy + # class. If the proxy class doesn't respond to a certain method, it's forwarded to the encapsulated string. + # + # >> "lj".mb_chars.upcase.to_s + # # => "LJ" + # + # NOTE: Ruby 2.4 and later support native Unicode case mappings: + # + # >> "lj".upcase + # # => "LJ" + # + # == \Method chaining + # + # All the methods on the Chars proxy which normally return a string will return a Chars object. This allows + # method chaining on the result of any of these methods. + # + # name.mb_chars.reverse.length # => 12 + # + # == Interoperability and configuration + # + # The Chars object tries to be as interchangeable with String objects as possible: sorting and comparing between + # String and Char work like expected. The bang! methods change the internal string representation in the Chars + # object. Interoperability problems can be resolved easily with a +to_s+ call. + # + # For more information about the methods defined on the Chars proxy see ActiveSupport::Multibyte::Chars. For + # information about how to change the default Multibyte behavior see ActiveSupport::Multibyte. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/multibyte.rb:37 + def mb_chars; end + + # Replaces special characters in a string so that it may be used as part of a 'pretty' URL. + # + # If the optional parameter +locale+ is specified, + # the word will be parameterized as a word of that language. + # By default, this parameter is set to nil and it will use + # the configured I18n.locale. + # + # class Person + # def to_param + # "#{id}-#{name.parameterize}" + # end + # end + # + # @person = Person.find(1) + # # => # + # + # <%= link_to(@person.name, person_path) %> + # # => Donald E. Knuth + # + # To preserve the case of the characters in a string, use the +preserve_case+ argument. + # + # class Person + # def to_param + # "#{id}-#{name.parameterize(preserve_case: true)}" + # end + # end + # + # @person = Person.find(1) + # # => # + # + # <%= link_to(@person.name, person_path) %> + # # => Donald E. Knuth + # + # See ActiveSupport::Inflector.parameterize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:215 + def parameterize(separator: T.unsafe(nil), preserve_case: T.unsafe(nil), locale: T.unsafe(nil)); end + + # Returns the plural form of the word in the string. + # + # If the optional parameter +count+ is specified, + # the singular form will be returned if count == 1. + # For any other value of +count+ the plural will be returned. + # + # If the optional parameter +locale+ is specified, + # the word will be pluralized as a word of that language. + # By default, this parameter is set to :en. + # You must define your own inflection rules for languages other than English. + # + # 'post'.pluralize # => "posts" + # 'octopus'.pluralize # => "octopi" + # 'sheep'.pluralize # => "sheep" + # 'words'.pluralize # => "words" + # 'the blue mailman'.pluralize # => "the blue mailmen" + # 'CamelOctopus'.pluralize # => "CamelOctopi" + # 'apple'.pluralize(1) # => "apple" + # 'apple'.pluralize(2) # => "apples" + # 'ley'.pluralize(:es) # => "leyes" + # 'ley'.pluralize(1, :es) # => "ley" + # + # See ActiveSupport::Inflector.pluralize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:35 + def pluralize(count = T.unsafe(nil), locale = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:165 + def present?; end + + # Returns a new string with all occurrences of the patterns removed. + # str = "foo bar test" + # str.remove(" test") # => "foo bar" + # str.remove(" test", /bar/) # => "foo " + # str # => "foo bar test" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:32 + def remove(*patterns); end + + # Alters the string by removing all occurrences of the patterns. + # str = "foo bar test" + # str.remove!(" test", /bar/) # => "foo " + # str # => "foo " + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:40 + def remove!(*patterns); end + + # +safe_constantize+ tries to find a declared constant with the name specified + # in the string. It returns +nil+ when the name is not in CamelCase + # or is not initialized. + # + # 'Module'.safe_constantize # => Module + # 'Class'.safe_constantize # => Class + # 'blargle'.safe_constantize # => nil + # + # See ActiveSupport::Inflector.safe_constantize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:86 + def safe_constantize; end + + # The reverse of +pluralize+, returns the singular form of a word in a string. + # + # If the optional parameter +locale+ is specified, + # the word will be singularized as a word of that language. + # By default, this parameter is set to :en. + # You must define your own inflection rules for languages other than English. + # + # 'posts'.singularize # => "post" + # 'octopi'.singularize # => "octopus" + # 'sheep'.singularize # => "sheep" + # 'word'.singularize # => "word" + # 'the blue mailmen'.singularize # => "the blue mailman" + # 'CamelOctopi'.singularize # => "CamelOctopus" + # 'leyes'.singularize(:es) # => "ley" + # + # See ActiveSupport::Inflector.singularize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:60 + def singularize(locale = T.unsafe(nil)); end + + # Returns the string, first removing all whitespace on both ends of + # the string, and then changing remaining consecutive whitespace + # groups into one space each. + # + # Note that it handles both ASCII and Unicode whitespace. + # + # %{ Multi-line + # string }.squish # => "Multi-line string" + # " foo bar \n \t boo".squish # => "foo bar boo" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:13 + def squish; end + + # Performs a destructive squish. See String#squish. + # str = " foo bar \n \t boo" + # str.squish! # => "foo bar boo" + # str # => "foo bar boo" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:21 + def squish!; end + + # Creates the name of a table like \Rails does for models to table names. This method + # uses the +pluralize+ method on the last word in the string. + # + # 'RawScaledScorer'.tableize # => "raw_scaled_scorers" + # 'ham_and_egg'.tableize # => "ham_and_eggs" + # 'fancyCategory'.tableize # => "fancy_categories" + # + # See ActiveSupport::Inflector.tableize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:227 + def tableize; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:129 + def titlecase(keep_id_suffix: T.unsafe(nil)); end + + # Capitalizes all the words and replaces some characters in the string to create + # a nicer looking title. +titleize+ is meant for creating pretty output. It is not + # used in the \Rails internals. + # + # The trailing '_id','Id'.. can be kept and capitalized by setting the + # optional parameter +keep_id_suffix+ to true. + # By default, this parameter is false. + # + # 'man from the boondocks'.titleize # => "Man From The Boondocks" + # 'x-men: the last stand'.titleize # => "X Men: The Last Stand" + # 'string_ending_with_id'.titleize(keep_id_suffix: true) # => "String Ending With Id" + # + # See ActiveSupport::Inflector.titleize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:126 + def titleize(keep_id_suffix: T.unsafe(nil)); end + + # Returns a substring from the beginning of the string to the given position. + # If the position is negative, it is counted from the end of the string. + # + # str = "hello" + # str.to(0) # => "h" + # str.to(3) # => "hell" + # str.to(-2) # => "hell" + # + # You can mix it with +from+ method and do fun things like: + # + # str = "hello" + # str.from(0).to(-1) # => "hello" + # str.from(1).to(-2) # => "ell" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:63 + def to(position); end + + # Converts a string to a Date value. + # + # "1-1-2012".to_date # => Sun, 01 Jan 2012 + # "01/01/2012".to_date # => Sun, 01 Jan 2012 + # "2012-12-13".to_date # => Thu, 13 Dec 2012 + # "12/13/2012".to_date # => ArgumentError: invalid date + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/conversions.rb:47 + def to_date; end + + # Converts a string to a DateTime value. + # + # "1-1-2012".to_datetime # => Sun, 01 Jan 2012 00:00:00 +0000 + # "01/01/2012 23:59:59".to_datetime # => Sun, 01 Jan 2012 23:59:59 +0000 + # "2012-12-13 12:50".to_datetime # => Thu, 13 Dec 2012 12:50:00 +0000 + # "12/13/2012".to_datetime # => ArgumentError: invalid date + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/conversions.rb:57 + def to_datetime; end + + # Converts a string to a Time value. + # The +form+ can be either +:utc+ or +:local+ (default +:local+). + # + # The time is parsed using Time.parse method. + # If +form+ is +:local+, then the time is in the system timezone. + # If the date part is missing then the current date is used and if + # the time part is missing then it is assumed to be 00:00:00. + # + # "13-12-2012".to_time # => 2012-12-13 00:00:00 +0100 + # "06:12".to_time # => 2012-12-13 06:12:00 +0100 + # "2012-12-13 06:12".to_time # => 2012-12-13 06:12:00 +0100 + # "2012-12-13T06:12".to_time # => 2012-12-13 06:12:00 +0100 + # "2012-12-13T06:12".to_time(:utc) # => 2012-12-13 06:12:00 UTC + # "12/13/2012".to_time # => ArgumentError: argument out of range + # "1604326192".to_time # => ArgumentError: argument out of range + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/conversions.rb:22 + def to_time(form = T.unsafe(nil)); end + + # Truncates a given +text+ to length truncate_to if +text+ is longer than truncate_to: + # + # 'Once upon a time in a world far far away'.truncate(27) + # # => "Once upon a time in a wo..." + # + # Pass a string or regexp :separator to truncate +text+ at a natural break: + # + # 'Once upon a time in a world far far away'.truncate(27, separator: ' ') + # # => "Once upon a time in a..." + # + # 'Once upon a time in a world far far away'.truncate(27, separator: /\s/) + # # => "Once upon a time in a..." + # + # The last characters will be replaced with the :omission string (defaults to "..."). + # The total length will not exceed truncate_to unless both +text+ and :omission + # are longer than truncate_to: + # + # 'And they found that many people were sleeping better.'.truncate(25, omission: '... (continued)') + # # => "And they f... (continued)" + # + # 'And they found that many people were sleeping better.'.truncate(4, omission: '... (continued)') + # # => "... (continued)" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:70 + def truncate(truncate_to, options = T.unsafe(nil)); end + + # Truncates +text+ to at most truncate_to bytes in length without + # breaking string encoding by splitting multibyte characters or breaking + # grapheme clusters ("perceptual characters") by truncating at combining + # characters. + # + # >> "🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪".size + # # => 20 + # >> "🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪".bytesize + # # => 80 + # >> "🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪".truncate_bytes(20) + # # => "🔪🔪🔪🔪…" + # + # The truncated text ends with the :omission string, defaulting + # to "…", for a total length not exceeding truncate_to. + # + # Raises +ArgumentError+ when the bytesize of :omission exceeds truncate_to. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:101 + def truncate_bytes(truncate_to, omission: T.unsafe(nil)); end + + # Truncates a given +text+ after a given number of words (words_count): + # + # 'Once upon a time in a world far far away'.truncate_words(4) + # # => "Once upon a time..." + # + # Pass a string or regexp :separator to specify a different separator of words: + # + # 'Once
    upon
    a
    time
    in
    a
    world'.truncate_words(5, separator: '
    ') + # # => "Once
    upon
    a
    time
    in..." + # + # The last characters will be replaced with the :omission string (defaults to "..."): + # + # 'And they found that many people were sleeping better.'.truncate_words(5, omission: '... (continued)') + # # => "And they found that many... (continued)" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:142 + def truncate_words(words_count, options = T.unsafe(nil)); end + + # The reverse of +camelize+. Makes an underscored, lowercase form from the expression in the string. + # + # +underscore+ will also change '::' to '/' to convert namespaces to paths. + # + # 'ActiveModel'.underscore # => "active_model" + # 'ActiveModel::Errors'.underscore # => "active_model/errors" + # + # See ActiveSupport::Inflector.underscore. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:139 + def underscore; end + + # Converts the first character to uppercase. + # + # 'what a Lovely Day'.upcase_first # => "What a Lovely Day" + # 'w'.upcase_first # => "W" + # ''.upcase_first # => "" + # + # See ActiveSupport::Inflector.upcase_first. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:273 + def upcase_first; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:136 +String::BLANK_RE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:137 +String::ENCODED_BLANKS = T.let(T.unsafe(nil), Concurrent::Map) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:74 +class Struct + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:75 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:123 +class Symbol + include ::Comparable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:105 + def as_json(options = T.unsafe(nil)); end + + # A Symbol is blank if it's empty: + # + # :''.blank? # => true + # :symbol.blank? # => false + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:128 + def blank?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:130 + def present?; end +end + +class Thread + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:7 + def active_support_execution_state; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:7 + def active_support_execution_state=(_arg0); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/thread/backtrace/location.rb:3 +class Thread::Backtrace::Location + # pkg:gem/activesupport#lib/active_support/core_ext/thread/backtrace/location.rb:4 + def spot(ex); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:186 +class Time + include ::Comparable + include ::DateAndTime::Zones + include ::DateAndTime::Calculations + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:298 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:308 + def -(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:338 + def <=>(other); end + + # Duck-types as a Time-like class. See Object#acts_like?. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/acts_like.rb:7 + def acts_like_time?; end + + # Uses Date to provide precise Time calculations for years, months, and days + # according to the proleptic Gregorian calendar. The +options+ parameter + # takes a hash with any of these keys: :years, :months, + # :weeks, :days, :hours, :minutes, + # :seconds. + # + # Time.new(2015, 8, 1, 14, 35, 0).advance(seconds: 1) # => 2015-08-01 14:35:01 -0700 + # Time.new(2015, 8, 1, 14, 35, 0).advance(minutes: 1) # => 2015-08-01 14:36:00 -0700 + # Time.new(2015, 8, 1, 14, 35, 0).advance(hours: 1) # => 2015-08-01 15:35:00 -0700 + # Time.new(2015, 8, 1, 14, 35, 0).advance(days: 1) # => 2015-08-02 14:35:00 -0700 + # Time.new(2015, 8, 1, 14, 35, 0).advance(weeks: 1) # => 2015-08-08 14:35:00 -0700 + # + # Just like Date#advance, increments are applied in order of time units from + # largest to smallest. This order can affect the result around the end of a + # month. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:194 + def advance(options); end + + # Returns a new Time representing the time a number of seconds ago, this is basically a wrapper around the Numeric extension + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:220 + def ago(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:201 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:236 + def at_beginning_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:263 + def at_beginning_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:279 + def at_beginning_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:257 + def at_end_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:273 + def at_end_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:288 + def at_end_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:244 + def at_midday; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:246 + def at_middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:235 + def at_midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:245 + def at_noon; end + + # Returns a new Time representing the start of the day (0:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:231 + def beginning_of_day; end + + # Returns a new Time representing the start of the hour (x:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:260 + def beginning_of_hour; end + + # Returns a new Time representing the start of the minute (x:xx:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:276 + def beginning_of_minute; end + + # No Time is blank: + # + # Time.now.blank? # => false + # + # @return [false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:192 + def blank?; end + + # Returns a new Time where one or more of the elements have been changed according + # to the +options+ parameter. The time options (:hour, :min, + # :sec, :usec, :nsec) reset cascadingly, so if only + # the hour is passed, then minute, sec, usec, and nsec is set to 0. If the hour + # and minute is passed, then sec, usec, and nsec is set to 0. The +options+ parameter + # takes a hash with any of these keys: :year, :month, :day, + # :hour, :min, :sec, :usec, :nsec, + # :offset. Pass either :usec or :nsec, not both. + # + # Time.new(2012, 8, 29, 22, 35, 0).change(day: 1) # => Time.new(2012, 8, 1, 22, 35, 0) + # Time.new(2012, 8, 29, 22, 35, 0).change(year: 1981, day: 1) # => Time.new(1981, 8, 1, 22, 35, 0) + # Time.new(2012, 8, 29, 22, 35, 0).change(year: 1981, hour: 0) # => Time.new(1981, 8, 29, 0, 0, 0) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:123 + def change(options); end + + # Layers additional behavior on Time#<=> so that DateTime and ActiveSupport::TimeWithZone instances + # can be chronologically compared with a Time + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:322 + def compare_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:337 + def compare_without_coercion(_arg0); end + + # Returns a new Time representing the end of the day, 23:59:59.999999 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:249 + def end_of_day; end + + # Returns a new Time representing the end of the hour, x:59:59.999999 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:266 + def end_of_hour; end + + # Returns a new Time representing the end of the minute, x:xx:59.999999 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:282 + def end_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:348 + def eql?(other); end + + # Layers additional behavior on Time#eql? so that ActiveSupport::TimeWithZone instances + # can be eql? to an equivalent Time + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:342 + def eql_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:347 + def eql_without_coercion(_arg0); end + + # Returns a formatted string of the offset from UTC, or an alternative + # string if the time zone is already UTC. + # + # Time.local(2000).formatted_offset # => "-06:00" + # Time.local(2000).formatted_offset(false) # => "-0600" + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:69 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:228 + def in(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:242 + def midday; end + + # Returns a new Time representing the middle of the day (12:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:239 + def middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:234 + def midnight; end + + # Time#- can also be used to determine the number of seconds between two Time instances. + # We're layering on additional behavior so that ActiveSupport::TimeWithZone instances + # are coerced into values that Time#- will recognize + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:313 + def minus_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:300 + def minus_with_duration(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:317 + def minus_without_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:307 + def minus_without_duration(_arg0); end + + # Returns a new time the specified number of days in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:356 + def next_day(days = T.unsafe(nil)); end + + # Returns a new time the specified number of months in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:366 + def next_month(months = T.unsafe(nil)); end + + # Returns a new time the specified number of years in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:376 + def next_year(years = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:243 + def noon; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:290 + def plus_with_duration(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:297 + def plus_without_duration(_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:196 + def present?; end + + # Returns a new time the specified number of days ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:351 + def prev_day(days = T.unsafe(nil)); end + + # Returns a new time the specified number of months ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:361 + def prev_month(months = T.unsafe(nil)); end + + # Returns a new time the specified number of years ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:371 + def prev_year(years = T.unsafe(nil)); end + + # Aliased to +xmlschema+ for compatibility with +DateTime+ + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:74 + def rfc3339(*_arg0); end + + # Returns the fraction of a second as a +Rational+ + # + # Time.new(2012, 8, 29, 0, 0, 0.5).sec_fraction # => (1/2) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:107 + def sec_fraction; end + + # Returns the number of seconds since 00:00:00. + # + # Time.new(2012, 8, 29, 0, 0, 0).seconds_since_midnight # => 0.0 + # Time.new(2012, 8, 29, 12, 34, 56).seconds_since_midnight # => 45296.0 + # Time.new(2012, 8, 29, 23, 59, 59).seconds_since_midnight # => 86399.0 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:91 + def seconds_since_midnight; end + + # Returns the number of seconds until 23:59:59. + # + # Time.new(2012, 8, 29, 0, 0, 0).seconds_until_end_of_day # => 86399 + # Time.new(2012, 8, 29, 12, 34, 56).seconds_until_end_of_day # => 41103 + # Time.new(2012, 8, 29, 23, 59, 59).seconds_until_end_of_day # => 0 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:100 + def seconds_until_end_of_day; end + + # Returns a new Time representing the time a number of seconds since the instance time + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:225 + def since(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:62 + def to_formatted_s(format = T.unsafe(nil)); end + + # Converts to a formatted string. See DATE_FORMATS for built-in formats. + # + # This method is aliased to to_formatted_s. + # + # time = Time.now # => 2007-01-18 06:10:17 -06:00 + # + # time.to_fs(:time) # => "06:10" + # time.to_formatted_s(:time) # => "06:10" + # + # time.to_fs(:db) # => "2007-01-18 06:10:17" + # time.to_fs(:number) # => "20070118061017" + # time.to_fs(:short) # => "18 Jan 06:10" + # time.to_fs(:long) # => "January 18, 2007 06:10" + # time.to_fs(:long_ordinal) # => "January 18th, 2007 06:10" + # time.to_fs(:rfc822) # => "Thu, 18 Jan 2007 06:10:17 -0600" + # time.to_fs(:rfc2822) # => "Thu, 18 Jan 2007 06:10:17 -0600" + # time.to_fs(:iso8601) # => "2007-01-18T06:10:17-06:00" + # + # == Adding your own time formats to +to_fs+ + # You can add your own formats to the Time::DATE_FORMATS hash. + # Use the format name as the hash key and either a strftime string + # or Proc instance that takes a time argument as the value. + # + # # config/initializers/time_formats.rb + # Time::DATE_FORMATS[:month_and_year] = '%B %Y' + # Time::DATE_FORMATS[:short_ordinal] = ->(time) { time.strftime("%B #{time.day.ordinalize}") } + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:55 + def to_fs(format = T.unsafe(nil)); end + + class << self + # Overriding case equality method so that it returns true for ActiveSupport::TimeWithZone instances + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:18 + def ===(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:60 + def at(time_or_number, *args, **_arg2); end + + # Layers additional behavior on Time.at so that ActiveSupport::TimeWithZone and DateTime + # instances can be used when called with a single argument + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:45 + def at_with_coercion(time_or_number, *args, **_arg2); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:59 + def at_without_coercion(time, subsec = T.unsafe(nil), unit = T.unsafe(nil), in: T.unsafe(nil)); end + + # Returns Time.zone.now when Time.zone or config.time_zone are set, otherwise just returns Time.now. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:39 + def current; end + + # Returns the number of days in the given month. + # If no year is specified, it will use the current year. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:24 + def days_in_month(month, year = T.unsafe(nil)); end + + # Returns the number of days in the given year. + # If no year is specified, it will use the current year. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:34 + def days_in_year(year = T.unsafe(nil)); end + + # Returns a TimeZone instance matching the time zone provided. + # Accepts the time zone in any format supported by Time.zone=. + # Returns +nil+ for invalid time zones. + # + # Time.find_zone "America/New_York" # => # + # Time.find_zone "NOT-A-TIMEZONE" # => nil + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:93 + def find_zone(time_zone); end + + # Returns a TimeZone instance matching the time zone provided. + # Accepts the time zone in any format supported by Time.zone=. + # Raises an +ArgumentError+ for invalid time zones. + # + # Time.find_zone! "America/New_York" # => # + # Time.find_zone! "EST" # => # + # Time.find_zone! -5.hours # => # + # Time.find_zone! nil # => nil + # Time.find_zone! false # => false + # Time.find_zone! "NOT-A-TIMEZONE" # => ArgumentError: Invalid Timezone: NOT-A-TIMEZONE + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:81 + def find_zone!(time_zone); end + + # Creates a +Time+ instance from an RFC 3339 string. + # + # Time.rfc3339('1999-12-31T14:00:00-10:00') # => 2000-01-01 00:00:00 -1000 + # + # If the time or offset components are missing then an +ArgumentError+ will be raised. + # + # Time.rfc3339('1999-12-31') # => ArgumentError: invalid date + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:69 + def rfc3339(str); end + + # Allows override of Time.zone locally inside supplied block; + # resets Time.zone to existing value when done. + # + # class ApplicationController < ActionController::Base + # around_action :set_time_zone + # + # private + # def set_time_zone + # Time.use_zone(current_user.timezone) { yield } + # end + # end + # + # NOTE: This won't affect any ActiveSupport::TimeWithZone + # objects that have already been created, e.g. any model timestamp + # attributes that have been read before the block will remain in + # the application's default timezone. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:61 + def use_zone(time_zone); end + + # Returns the TimeZone for the current request, if this has been set (via Time.zone=). + # If Time.zone has not been set for the current request, returns the TimeZone specified in config.time_zone. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:14 + def zone; end + + # Sets Time.zone to a TimeZone object for the current request/thread. + # + # This method accepts any of the following: + # + # * A \Rails TimeZone object. + # * An identifier for a \Rails TimeZone object (e.g., "Eastern \Time (US & Canada)", -5.hours). + # * A +TZInfo::Timezone+ object. + # * An identifier for a +TZInfo::Timezone+ object (e.g., "America/New_York"). + # + # Here's an example of how you might set Time.zone on a per request basis and reset it when the request is done. + # current_user.time_zone just needs to return a string identifying the user's preferred time zone: + # + # class ApplicationController < ActionController::Base + # around_action :set_time_zone + # + # def set_time_zone + # if logged_in? + # Time.use_zone(current_user.time_zone) { yield } + # else + # yield + # end + # end + # end + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:41 + def zone=(time_zone); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:10 + def zone_default; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:10 + def zone_default=(_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:14 +Time::COMMON_YEAR_DAYS_IN_MONTH = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:8 +Time::DATE_FORMATS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:80 +class TrueClass + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:81 + def as_json(options = T.unsafe(nil)); end + + # +true+ is not blank: + # + # true.blank? # => false + # + # @return [false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:86 + def blank?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:90 + def present?; end + + # Returns +self+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:33 + def to_param; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:230 +class URI::Generic + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:231 + def as_json(options = T.unsafe(nil)); end +end diff --git a/sorbet/rbi/gems/ast@2.4.3.rbi b/sorbet/rbi/gems/ast@2.4.3.rbi new file mode 100644 index 0000000..e946b00 --- /dev/null +++ b/sorbet/rbi/gems/ast@2.4.3.rbi @@ -0,0 +1,550 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `ast` gem. +# Please instead update this file by running `bin/tapioca gem ast`. + + +# {AST} is a library for manipulating abstract syntax trees. +# +# It embraces immutability; each AST node is inherently frozen at +# creation, and updating a child node requires recreating that node +# and its every parent, recursively. +# This is a design choice. It does create some pressure on +# garbage collector, but completely eliminates all concurrency +# and aliasing problems. +# +# See also {AST::Node}, {AST::Processor::Mixin} and {AST::Sexp} for +# additional recommendations and design patterns. +# +# pkg:gem/ast#lib/ast.rb:13 +module AST; end + +# Node is an immutable class, instances of which represent abstract +# syntax tree nodes. It combines semantic information (i.e. anything +# that affects the algorithmic properties of a program) with +# meta-information (line numbers or compiler intermediates). +# +# Notes on inheritance +# ==================== +# +# The distinction between semantics and metadata is important. Complete +# semantic information should be contained within just the {#type} and +# {#children} of a Node instance; in other words, if an AST was to be +# stripped of all meta-information, it should remain a valid AST which +# could be successfully processed to yield a result with the same +# algorithmic properties. +# +# Thus, Node should never be inherited in order to define methods which +# affect or return semantic information, such as getters for `class_name`, +# `superclass` and `body` in the case of a hypothetical `ClassNode`. The +# correct solution is to use a generic Node with a {#type} of `:class` +# and three children. See also {Processor} for tips on working with such +# ASTs. +# +# On the other hand, Node can and should be inherited to define +# application-specific metadata (see also {#initialize}) or customize the +# printing format. It is expected that an application would have one or two +# such classes and use them across the entire codebase. +# +# The rationale for this pattern is extensibility and maintainability. +# Unlike static ones, dynamic languages do not require the presence of a +# predefined, rigid structure, nor does it improve dispatch efficiency, +# and while such a structure can certainly be defined, it does not add +# any value but incurs a maintaining cost. +# For example, extending the AST even with a transformation-local +# temporary node type requires making globally visible changes to +# the codebase. +# +# pkg:gem/ast#lib/ast/node.rb:40 +class AST::Node + # Constructs a new instance of Node. + # + # The arguments `type` and `children` are converted with `to_sym` and + # `to_a` respectively. Additionally, the result of converting `children` + # is frozen. While mutating the arguments is generally considered harmful, + # the most common case is to pass an array literal to the constructor. If + # your code does not expect the argument to be frozen, use `#dup`. + # + # The `properties` hash is passed to {#assign_properties}. + # + # pkg:gem/ast#lib/ast/node.rb:72 + def initialize(type, children = T.unsafe(nil), properties = T.unsafe(nil)); end + + # pkg:gem/ast#lib/ast/node.rb:172 + def +(array); end + + # pkg:gem/ast#lib/ast/node.rb:181 + def <<(element); end + + # Compares `self` to `other`, possibly converting with `to_ast`. Only + # `type` and `children` are compared; metadata is deliberately ignored. + # + # @return [Boolean] + # + # pkg:gem/ast#lib/ast/node.rb:153 + def ==(other); end + + # Appends `element` to `children` and returns the resulting node. + # + # @return [AST::Node] + # + # pkg:gem/ast#lib/ast/node.rb:177 + def append(element); end + + # Returns the children of this node. + # The returned value is frozen. + # The to_a alias is useful for decomposing nodes concisely. + # For example: + # + # node = s(:gasgn, :$foo, s(:integer, 1)) + # var_name, value = *node + # p var_name # => :$foo + # p value # => (integer 1) + # + # @return [Array] + # + # pkg:gem/ast#lib/ast/node.rb:56 + def children; end + + # pkg:gem/ast#lib/ast/node.rb:118 + def clone; end + + # Concatenates `array` with `children` and returns the resulting node. + # + # @return [AST::Node] + # + # pkg:gem/ast#lib/ast/node.rb:168 + def concat(array); end + + # Enables matching for Node, where type is the first element + # and the children are remaining items. + # + # @return [Array] + # + # pkg:gem/ast#lib/ast/node.rb:253 + def deconstruct; end + + # Nodes are already frozen, so there is no harm in returning the + # current node as opposed to initializing from scratch and freezing + # another one. + # + # @return self + # + # pkg:gem/ast#lib/ast/node.rb:115 + def dup; end + + # Test if other object is equal to + # @param [Object] other + # @return [Boolean] + # + # pkg:gem/ast#lib/ast/node.rb:85 + def eql?(other); end + + # Returns the precomputed hash value for this node + # @return [Integer] + # + # pkg:gem/ast#lib/ast/node.rb:61 + def hash; end + + # Converts `self` to a s-expression ruby string. + # The code return will recreate the node, using the sexp module s() + # + # @param [Integer] indent Base indentation level. + # @return [String] + # + # pkg:gem/ast#lib/ast/node.rb:211 + def inspect(indent = T.unsafe(nil)); end + + # pkg:gem/ast#lib/ast/node.rb:57 + def to_a; end + + # @return [AST::Node] self + # + # pkg:gem/ast#lib/ast/node.rb:229 + def to_ast; end + + # pkg:gem/ast#lib/ast/node.rb:204 + def to_s(indent = T.unsafe(nil)); end + + # Converts `self` to a pretty-printed s-expression. + # + # @param [Integer] indent Base indentation level. + # @return [String] + # + # pkg:gem/ast#lib/ast/node.rb:187 + def to_sexp(indent = T.unsafe(nil)); end + + # Converts `self` to an Array where the first element is the type as a Symbol, + # and subsequent elements are the same representation of its children. + # + # @return [Array] + # + # pkg:gem/ast#lib/ast/node.rb:237 + def to_sexp_array; end + + # Returns the type of this node. + # @return [Symbol] + # + # pkg:gem/ast#lib/ast/node.rb:43 + def type; end + + # Returns a new instance of Node where non-nil arguments replace the + # corresponding fields of `self`. + # + # For example, `Node.new(:foo, [ 1, 2 ]).updated(:bar)` would yield + # `(bar 1 2)`, and `Node.new(:foo, [ 1, 2 ]).updated(nil, [])` would + # yield `(foo)`. + # + # If the resulting node would be identical to `self`, does nothing. + # + # @param [Symbol, nil] type + # @param [Array, nil] children + # @param [Hash, nil] properties + # @return [AST::Node] + # + # pkg:gem/ast#lib/ast/node.rb:133 + def updated(type = T.unsafe(nil), children = T.unsafe(nil), properties = T.unsafe(nil)); end + + protected + + # By default, each entry in the `properties` hash is assigned to + # an instance variable in this instance of Node. A subclass should define + # attribute readers for such variables. The values passed in the hash + # are not frozen or whitelisted; such behavior can also be implemented + # by subclassing Node and overriding this method. + # + # @return [nil] + # + # pkg:gem/ast#lib/ast/node.rb:98 + def assign_properties(properties); end + + # Returns `@type` with all underscores replaced by dashes. This allows + # to write symbol literals without quotes in Ruby sources and yet have + # nicely looking s-expressions. + # + # @return [String] + # + # pkg:gem/ast#lib/ast/node.rb:264 + def fancy_type; end + + private + + # pkg:gem/ast#lib/ast/node.rb:107 + def original_dup; end +end + +# This class includes {AST::Processor::Mixin}; however, it is +# deprecated, since the module defines all of the behaviors that +# the processor includes. Any new libraries should use +# {AST::Processor::Mixin} instead of subclassing this. +# +# @deprecated Use {AST::Processor::Mixin} instead. +# +# pkg:gem/ast#lib/ast/processor.rb:8 +class AST::Processor + include ::AST::Processor::Mixin +end + +# The processor module is a module which helps transforming one +# AST into another. In a nutshell, the {#process} method accepts +# a {Node} and dispatches it to a handler corresponding to its +# type, and returns a (possibly) updated variant of the node. +# +# The processor module has a set of associated design patterns. +# They are best explained with a concrete example. Let's define a +# simple arithmetic language and an AST format for it: +# +# Terminals (AST nodes which do not have other AST nodes inside): +# +# * `(integer )`, +# +# Nonterminals (AST nodes with other nodes as children): +# +# * `(add )`, +# * `(multiply )`, +# * `(divide )`, +# * `(negate )`, +# * `(store )`: stores value of `` +# into a variable named ``, +# * `(load )`: loads value of a variable named +# ``, +# * `(each ...)`: computes each of the ``s and +# prints the result. +# +# All AST nodes have the same Ruby class, and therefore they don't +# know how to traverse themselves. (A solution which dynamically +# checks the type of children is possible, but is slow and +# error-prone.) So, a class including the module which knows how +# to traverse the entire tree should be defined. Such classes +# have a handler for each nonterminal node which recursively +# processes children nodes: +# +# require 'ast' +# +# class ArithmeticsProcessor +# include AST::Processor::Mixin +# # This method traverses any binary operators such as (add) +# # or (multiply). +# def process_binary_op(node) +# # Children aren't decomposed automatically; it is +# # suggested to use Ruby multiple assignment expansion, +# # as it is very convenient here. +# left_expr, right_expr = *node +# +# # AST::Node#updated won't change node type if nil is +# # passed as a first argument, which allows to reuse the +# # same handler for multiple node types using `alias' +# # (below). +# node.updated(nil, [ +# process(left_expr), +# process(right_expr) +# ]) +# end +# alias_method :on_add, :process_binary_op +# alias_method :on_multiply, :process_binary_op +# alias_method :on_divide, :process_binary_op +# +# def on_negate(node) +# # It is also possible to use #process_all for more +# # compact code if every child is a Node. +# node.updated(nil, process_all(node)) +# end +# +# def on_store(node) +# expr, variable_name = *node +# +# # Note that variable_name is not a Node and thus isn't +# # passed to #process. +# node.updated(nil, [ +# process(expr), +# variable_name +# ]) +# end +# +# # (load) is effectively a terminal node, and so it does +# # not need an explicit handler, as the following is the +# # default behavior. Essentially, for any nodes that don't +# # have a defined handler, the node remains unchanged. +# def on_load(node) +# nil +# end +# +# def on_each(node) +# node.updated(nil, process_all(node)) +# end +# end +# +# Let's test our ArithmeticsProcessor: +# +# include AST::Sexp +# expr = s(:add, s(:integer, 2), s(:integer, 2)) +# +# p ArithmeticsProcessor.new.process(expr) == expr # => true +# +# As expected, it does not change anything at all. This isn't +# actually very useful, so let's now define a Calculator, which +# will compute the expression values: +# +# # This Processor folds nonterminal nodes and returns an +# # (integer) terminal node. +# class ArithmeticsCalculator < ArithmeticsProcessor +# def compute_op(node) +# # First, node children are processed and then unpacked +# # to local variables. +# nodes = process_all(node) +# +# if nodes.all? { |node| node.type == :integer } +# # If each of those nodes represents a literal, we can +# # fold this node! +# values = nodes.map { |node| node.children.first } +# AST::Node.new(:integer, [ +# yield(values) +# ]) +# else +# # Otherwise, we can just leave the current node in the +# # tree and only update it with processed children +# # nodes, which can be partially folded. +# node.updated(nil, nodes) +# end +# end +# +# def on_add(node) +# compute_op(node) { |left, right| left + right } +# end +# +# def on_multiply(node) +# compute_op(node) { |left, right| left * right } +# end +# end +# +# Let's check: +# +# p ArithmeticsCalculator.new.process(expr) # => (integer 4) +# +# Excellent, the calculator works! Now, a careful reader could +# notice that the ArithmeticsCalculator does not know how to +# divide numbers. What if we pass an expression with division to +# it? +# +# expr_with_division = \ +# s(:add, +# s(:integer, 1), +# s(:divide, +# s(:add, s(:integer, 8), s(:integer, 4)), +# s(:integer, 3))) # 1 + (8 + 4) / 3 +# +# folded_expr_with_division = ArithmeticsCalculator.new.process(expr_with_division) +# p folded_expr_with_division +# # => (add +# # (integer 1) +# # (divide +# # (integer 12) +# # (integer 3))) +# +# As you can see, the expression was folded _partially_: the inner +# `(add)` node which could be computed was folded to +# `(integer 12)`, the `(divide)` node is left as-is because there +# is no computing handler for it, and the root `(add)` node was +# also left as it is because some of its children were not +# literals. +# +# Note that this partial folding is only possible because the +# _data_ format, i.e. the format in which the computed values of +# the nodes are represented, is the same as the AST itself. +# +# Let's extend our ArithmeticsCalculator class further. +# +# class ArithmeticsCalculator +# def on_divide(node) +# compute_op(node) { |left, right| left / right } +# end +# +# def on_negate(node) +# # Note how #compute_op works regardless of the operator +# # arity. +# compute_op(node) { |value| -value } +# end +# end +# +# Now, let's apply our renewed ArithmeticsCalculator to a partial +# result of previous evaluation: +# +# p ArithmeticsCalculator.new.process(expr_with_division) # => (integer 5) +# +# Five! Excellent. This is also pretty much how CRuby 1.8 executed +# its programs. +# +# Now, let's do some automated bug searching. Division by zero is +# an error, right? So if we could detect that someone has divided +# by zero before the program is even run, that could save some +# debugging time. +# +# class DivisionByZeroVerifier < ArithmeticsProcessor +# class VerificationFailure < Exception; end +# +# def on_divide(node) +# # You need to process the children to handle nested divisions +# # such as: +# # (divide +# # (integer 1) +# # (divide (integer 1) (integer 0)) +# left, right = process_all(node) +# +# if right.type == :integer && +# right.children.first == 0 +# raise VerificationFailure, "Ouch! This code divides by zero." +# end +# end +# +# def divides_by_zero?(ast) +# process(ast) +# false +# rescue VerificationFailure +# true +# end +# end +# +# nice_expr = \ +# s(:divide, +# s(:add, s(:integer, 10), s(:integer, 2)), +# s(:integer, 4)) +# +# p DivisionByZeroVerifier.new.divides_by_zero?(nice_expr) +# # => false. Good. +# +# bad_expr = \ +# s(:add, s(:integer, 10), +# s(:divide, s(:integer, 1), s(:integer, 0))) +# +# p DivisionByZeroVerifier.new.divides_by_zero?(bad_expr) +# # => true. WHOOPS. DO NOT RUN THIS. +# +# Of course, this won't detect more complex cases... unless you +# use some partial evaluation before! The possibilites are +# endless. Have fun. +# +# pkg:gem/ast#lib/ast/processor/mixin.rb:240 +module AST::Processor::Mixin + # Default handler. Does nothing. + # + # @param [AST::Node] node + # @return [AST::Node, nil] + # + # pkg:gem/ast#lib/ast/processor/mixin.rb:284 + def handler_missing(node); end + + # Dispatches `node`. If a node has type `:foo`, then a handler + # named `on_foo` is invoked with one argument, the `node`; if + # there isn't such a handler, {#handler_missing} is invoked + # with the same argument. + # + # If the handler returns `nil`, `node` is returned; otherwise, + # the return value of the handler is passed along. + # + # @param [AST::Node, nil] node + # @return [AST::Node, nil] + # + # pkg:gem/ast#lib/ast/processor/mixin.rb:251 + def process(node); end + + # {#process}es each node from `nodes` and returns an array of + # results. + # + # @param [Array] nodes + # @return [Array] + # + # pkg:gem/ast#lib/ast/processor/mixin.rb:274 + def process_all(nodes); end +end + +# This simple module is very useful in the cases where one needs +# to define deeply nested ASTs from Ruby code, for example, in +# tests. It should be used like this: +# +# describe YourLanguage do +# include ::AST::Sexp +# +# it "should correctly parse expressions" do +# YourLanguage.parse("1 + 2 * 3").should == +# s(:add, +# s(:integer, 1), +# s(:multiply, +# s(:integer, 2), +# s(:integer, 3))) +# end +# end +# +# This way the amount of boilerplate code is greatly reduced. +# +# pkg:gem/ast#lib/ast/sexp.rb:20 +module AST::Sexp + # Creates a {Node} with type `type` and children `children`. + # Note that the resulting node is of the type AST::Node and not a + # subclass. + # This would not pose a problem with comparisons, as {Node#==} + # ignores metadata. + # + # pkg:gem/ast#lib/ast/sexp.rb:26 + def s(type, *children); end +end diff --git a/sorbet/rbi/gems/base64@0.3.0.rbi b/sorbet/rbi/gems/base64@0.3.0.rbi new file mode 100644 index 0000000..9995f72 --- /dev/null +++ b/sorbet/rbi/gems/base64@0.3.0.rbi @@ -0,0 +1,545 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `base64` gem. +# Please instead update this file by running `bin/tapioca gem base64`. + + +# \Module \Base64 provides methods for: +# +# - \Encoding a binary string (containing non-ASCII characters) +# as a string of printable ASCII characters. +# - Decoding such an encoded string. +# +# \Base64 is commonly used in contexts where binary data +# is not allowed or supported: +# +# - Images in HTML or CSS files, or in URLs. +# - Email attachments. +# +# A \Base64-encoded string is about one-third larger that its source. +# See the {Wikipedia article}[https://en.wikipedia.org/wiki/Base64] +# for more information. +# +# This module provides three pairs of encode/decode methods. +# Your choices among these methods should depend on: +# +# - Which character set is to be used for encoding and decoding. +# - Whether "padding" is to be used. +# - Whether encoded strings are to contain newlines. +# +# Note: Examples on this page assume that the including program has executed: +# +# require 'base64' +# +# == \Encoding Character Sets +# +# A \Base64-encoded string consists only of characters from a 64-character set: +# +# - ('A'..'Z'). +# - ('a'..'z'). +# - ('0'..'9'). +# - =, the 'padding' character. +# - Either: +# - %w[+ /]: +# {RFC-2045-compliant}[https://datatracker.ietf.org/doc/html/rfc2045]; +# _not_ safe for URLs. +# - %w[- _]: +# {RFC-4648-compliant}[https://datatracker.ietf.org/doc/html/rfc4648]; +# safe for URLs. +# +# If you are working with \Base64-encoded strings that will come from +# or be put into URLs, you should choose this encoder-decoder pair +# of RFC-4648-compliant methods: +# +# - Base64.urlsafe_encode64 and Base64.urlsafe_decode64. +# +# Otherwise, you may choose any of the pairs in this module, +# including the pair above, or the RFC-2045-compliant pairs: +# +# - Base64.encode64 and Base64.decode64. +# - Base64.strict_encode64 and Base64.strict_decode64. +# +# == Padding +# +# \Base64-encoding changes a triplet of input bytes +# into a quartet of output characters. +# +# Padding in Encode Methods +# +# Padding -- extending an encoded string with zero, one, or two trailing +# = characters -- is performed by methods Base64.encode64, +# Base64.strict_encode64, and, by default, Base64.urlsafe_encode64: +# +# Base64.encode64('s') # => "cw==\n" +# Base64.strict_encode64('s') # => "cw==" +# Base64.urlsafe_encode64('s') # => "cw==" +# Base64.urlsafe_encode64('s', padding: false) # => "cw" +# +# When padding is performed, the encoded string is always of length 4n, +# where +n+ is a non-negative integer: +# +# - Input bytes of length 3n generate unpadded output characters +# of length 4n: +# +# # n = 1: 3 bytes => 4 characters. +# Base64.strict_encode64('123') # => "MDEy" +# # n = 2: 6 bytes => 8 characters. +# Base64.strict_encode64('123456') # => "MDEyMzQ1" +# +# - Input bytes of length 3n+1 generate padded output characters +# of length 4(n+1), with two padding characters at the end: +# +# # n = 1: 4 bytes => 8 characters. +# Base64.strict_encode64('1234') # => "MDEyMw==" +# # n = 2: 7 bytes => 12 characters. +# Base64.strict_encode64('1234567') # => "MDEyMzQ1Ng==" +# +# - Input bytes of length 3n+2 generate padded output characters +# of length 4(n+1), with one padding character at the end: +# +# # n = 1: 5 bytes => 8 characters. +# Base64.strict_encode64('12345') # => "MDEyMzQ=" +# # n = 2: 8 bytes => 12 characters. +# Base64.strict_encode64('12345678') # => "MDEyMzQ1Njc=" +# +# When padding is suppressed, for a positive integer n: +# +# - Input bytes of length 3n generate unpadded output characters +# of length 4n: +# +# # n = 1: 3 bytes => 4 characters. +# Base64.urlsafe_encode64('123', padding: false) # => "MDEy" +# # n = 2: 6 bytes => 8 characters. +# Base64.urlsafe_encode64('123456', padding: false) # => "MDEyMzQ1" +# +# - Input bytes of length 3n+1 generate unpadded output characters +# of length 4n+2, with two padding characters at the end: +# +# # n = 1: 4 bytes => 6 characters. +# Base64.urlsafe_encode64('1234', padding: false) # => "MDEyMw" +# # n = 2: 7 bytes => 10 characters. +# Base64.urlsafe_encode64('1234567', padding: false) # => "MDEyMzQ1Ng" +# +# - Input bytes of length 3n+2 generate unpadded output characters +# of length 4n+3, with one padding character at the end: +# +# # n = 1: 5 bytes => 7 characters. +# Base64.urlsafe_encode64('12345', padding: false) # => "MDEyMzQ" +# # m = 2: 8 bytes => 11 characters. +# Base64.urlsafe_encode64('12345678', padding: false) # => "MDEyMzQ1Njc" +# +# Padding in Decode Methods +# +# All of the \Base64 decode methods support (but do not require) padding. +# +# \Method Base64.decode64 does not check the size of the padding: +# +# Base64.decode64("MDEyMzQ1Njc") # => "01234567" +# Base64.decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.decode64("MDEyMzQ1Njc==") # => "01234567" +# +# \Method Base64.strict_decode64 strictly enforces padding size: +# +# Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError +# Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError +# +# \Method Base64.urlsafe_decode64 allows padding in the encoded string, +# which if present, must be correct: +# see {Padding}[Base64.html#module-Base64-label-Padding], above: +# +# Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" +# Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. +# +# == Newlines +# +# An encoded string returned by Base64.encode64 or Base64.urlsafe_encode64 +# has an embedded newline character +# after each 60-character sequence, and, if non-empty, at the end: +# +# # No newline if empty. +# encoded = Base64.encode64("\x00" * 0) +# encoded.index("\n") # => nil +# +# # Newline at end of short output. +# encoded = Base64.encode64("\x00" * 1) +# encoded.size # => 4 +# encoded.index("\n") # => 4 +# +# # Newline at end of longer output. +# encoded = Base64.encode64("\x00" * 45) +# encoded.size # => 60 +# encoded.index("\n") # => 60 +# +# # Newlines embedded and at end of still longer output. +# encoded = Base64.encode64("\x00" * 46) +# encoded.size # => 65 +# encoded.rindex("\n") # => 65 +# encoded.split("\n").map {|s| s.size } # => [60, 4] +# +# The string to be encoded may itself contain newlines, +# which are encoded as \Base64: +# +# # Base64.encode64("\n\n\n") # => "CgoK\n" +# s = "This is line 1\nThis is line 2\n" +# Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" +# +# pkg:gem/base64#lib/base64.rb:184 +module Base64 + private + + # :call-seq: + # Base64.decode(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are ignored; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.decode64("\x00\n-_") # => "" + # + # Padding in +encoded_string+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # pkg:gem/base64#lib/base64.rb:247 + def decode64(str); end + + # :call-seq: + # Base64.encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.encode64('*') # => "Kg==\n" + # + # The returned string ends with a newline character, and if sufficiently long + # will have one or more embedded newline characters; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.encode64('*') # => "Kg==\n" + # Base64.encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.encode64("\n\n\n") # => "CgoK\n" + # s = "This is line 1\nThis is line 2\n" + # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # + # pkg:gem/base64#lib/base64.rb:222 + def encode64(bin); end + + # :call-seq: + # Base64.strict_decode64(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are not allowed; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.strict_decode64("\n") # Raises ArgumentError + # Base64.strict_decode64('-') # Raises ArgumentError + # Base64.strict_decode64('_') # Raises ArgumentError + # + # Padding in +encoded_string+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # pkg:gem/base64#lib/base64.rb:309 + def strict_decode64(str); end + + # :call-seq: + # Base64.strict_encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.strict_encode64('*') # => "Kg==\n" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.strict_encode64('*') # => "Kg==" + # Base64.strict_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.strict_encode64("\n\n\n") # => "CgoK" + # s = "This is line 1\nThis is line 2\n" + # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # + # pkg:gem/base64#lib/base64.rb:282 + def strict_encode64(bin); end + + # :call-seq: + # Base64.urlsafe_decode64(encoded_string) -> decoded_string + # + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +encoded_string+: + # + # +encoded_string+ may not contain non-Base64 characters; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_decode64('+') # Raises ArgumentError. + # Base64.urlsafe_decode64('/') # Raises ArgumentError. + # Base64.urlsafe_decode64("\n") # Raises ArgumentError. + # + # Padding in +encoded_string+, if present, must be correct: + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. + # + # pkg:gem/base64#lib/base64.rb:369 + def urlsafe_decode64(str); end + + # :call-seq: + # Base64.urlsafe_encode64(string) -> encoded_string + # + # Returns the RFC-4648-compliant \Base64-encoding of +string+. + # + # Per RFC 4648, the returned string will not contain the URL-unsafe characters + # + or /, + # but instead may contain the URL-safe characters + # - and _; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----" + # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____" + # + # By default, the returned string may have padding; + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # + # Optionally, you can suppress padding: + # + # Base64.urlsafe_encode64('*', padding: false) # => "Kg" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # Base64.urlsafe_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # pkg:gem/base64#lib/base64.rb:343 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + + class << self + # :call-seq: + # Base64.decode(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are ignored; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.decode64("\x00\n-_") # => "" + # + # Padding in +encoded_string+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # pkg:gem/base64#lib/base64.rb:247 + def decode64(str); end + + # :call-seq: + # Base64.encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.encode64('*') # => "Kg==\n" + # + # The returned string ends with a newline character, and if sufficiently long + # will have one or more embedded newline characters; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.encode64('*') # => "Kg==\n" + # Base64.encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.encode64("\n\n\n") # => "CgoK\n" + # s = "This is line 1\nThis is line 2\n" + # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # + # pkg:gem/base64#lib/base64.rb:222 + def encode64(bin); end + + # :call-seq: + # Base64.strict_decode64(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are not allowed; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.strict_decode64("\n") # Raises ArgumentError + # Base64.strict_decode64('-') # Raises ArgumentError + # Base64.strict_decode64('_') # Raises ArgumentError + # + # Padding in +encoded_string+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # pkg:gem/base64#lib/base64.rb:309 + def strict_decode64(str); end + + # :call-seq: + # Base64.strict_encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.strict_encode64('*') # => "Kg==\n" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.strict_encode64('*') # => "Kg==" + # Base64.strict_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.strict_encode64("\n\n\n") # => "CgoK" + # s = "This is line 1\nThis is line 2\n" + # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # + # pkg:gem/base64#lib/base64.rb:282 + def strict_encode64(bin); end + + # :call-seq: + # Base64.urlsafe_decode64(encoded_string) -> decoded_string + # + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +encoded_string+: + # + # +encoded_string+ may not contain non-Base64 characters; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_decode64('+') # Raises ArgumentError. + # Base64.urlsafe_decode64('/') # Raises ArgumentError. + # Base64.urlsafe_decode64("\n") # Raises ArgumentError. + # + # Padding in +encoded_string+, if present, must be correct: + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. + # + # pkg:gem/base64#lib/base64.rb:369 + def urlsafe_decode64(str); end + + # :call-seq: + # Base64.urlsafe_encode64(string) -> encoded_string + # + # Returns the RFC-4648-compliant \Base64-encoding of +string+. + # + # Per RFC 4648, the returned string will not contain the URL-unsafe characters + # + or /, + # but instead may contain the URL-safe characters + # - and _; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----" + # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____" + # + # By default, the returned string may have padding; + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # + # Optionally, you can suppress padding: + # + # Base64.urlsafe_encode64('*', padding: false) # => "Kg" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # Base64.urlsafe_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # pkg:gem/base64#lib/base64.rb:343 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + end +end + +# pkg:gem/base64#lib/base64.rb:186 +Base64::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/benchmark@0.5.0.rbi b/sorbet/rbi/gems/benchmark@0.5.0.rbi new file mode 100644 index 0000000..1c75f8e --- /dev/null +++ b/sorbet/rbi/gems/benchmark@0.5.0.rbi @@ -0,0 +1,621 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `benchmark` gem. +# Please instead update this file by running `bin/tapioca gem benchmark`. + + +# The Benchmark module provides methods to measure and report the time +# used to execute Ruby code. +# +# * Measure the time to construct the string given by the expression +# "a"*1_000_000_000: +# +# require 'benchmark' +# +# puts Benchmark.measure { "a"*1_000_000_000 } +# +# On my machine (OSX 10.8.3 on i5 1.7 GHz) this generates: +# +# 0.350000 0.400000 0.750000 ( 0.835234) +# +# This report shows the user CPU time, system CPU time, the total time +# (sum of user CPU time, system CPU time, children's user CPU time, +# and children's system CPU time), and the elapsed real time. The unit +# of time is seconds. +# +# * Do some experiments sequentially using the #bm method: +# +# require 'benchmark' +# +# n = 5000000 +# Benchmark.bm do |x| +# x.report { for i in 1..n; a = "1"; end } +# x.report { n.times do ; a = "1"; end } +# x.report { 1.upto(n) do ; a = "1"; end } +# end +# +# The result: +# +# user system total real +# 1.010000 0.000000 1.010000 ( 1.014479) +# 1.000000 0.000000 1.000000 ( 0.998261) +# 0.980000 0.000000 0.980000 ( 0.981335) +# +# * Continuing the previous example, put a label in each report: +# +# require 'benchmark' +# +# n = 5000000 +# Benchmark.bm(7) do |x| +# x.report("for:") { for i in 1..n; a = "1"; end } +# x.report("times:") { n.times do ; a = "1"; end } +# x.report("upto:") { 1.upto(n) do ; a = "1"; end } +# end +# +# The result: +# +# user system total real +# for: 1.010000 0.000000 1.010000 ( 1.015688) +# times: 1.000000 0.000000 1.000000 ( 1.003611) +# upto: 1.030000 0.000000 1.030000 ( 1.028098) +# +# * The times for some benchmarks depend on the order in which items +# are run. These differences are due to the cost of memory +# allocation and garbage collection. To avoid these discrepancies, +# the #bmbm method is provided. For example, to compare ways to +# sort an array of floats: +# +# require 'benchmark' +# +# array = (1..1000000).map { rand } +# +# Benchmark.bmbm do |x| +# x.report("sort!") { array.dup.sort! } +# x.report("sort") { array.dup.sort } +# end +# +# The result: +# +# Rehearsal ----------------------------------------- +# sort! 1.490000 0.010000 1.500000 ( 1.490520) +# sort 1.460000 0.000000 1.460000 ( 1.463025) +# -------------------------------- total: 2.960000sec +# +# user system total real +# sort! 1.460000 0.000000 1.460000 ( 1.460465) +# sort 1.450000 0.010000 1.460000 ( 1.448327) +# +# * Report statistics of sequential experiments with unique labels, +# using the #benchmark method: +# +# require 'benchmark' +# include Benchmark # we need the CAPTION and FORMAT constants +# +# n = 5000000 +# Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x| +# tf = x.report("for:") { for i in 1..n; a = "1"; end } +# tt = x.report("times:") { n.times do ; a = "1"; end } +# tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end } +# [tf+tt+tu, (tf+tt+tu)/3] +# end +# +# The result: +# +# user system total real +# for: 0.950000 0.000000 0.950000 ( 0.952039) +# times: 0.980000 0.000000 0.980000 ( 0.984938) +# upto: 0.950000 0.000000 0.950000 ( 0.946787) +# >total: 2.880000 0.000000 2.880000 ( 2.883764) +# >avg: 0.960000 0.000000 0.960000 ( 0.961255) +# +# pkg:gem/benchmark#lib/benchmark.rb:123 +module Benchmark + private + + # Invokes the block with a Benchmark::Report object, which + # may be used to collect and report on the results of individual + # benchmark tests. Reserves +label_width+ leading spaces for + # labels on each line. Prints +caption+ at the top of the + # report, and uses +format+ to format each line. + # (Note: +caption+ must contain a terminating newline character, + # see the default Benchmark::Tms::CAPTION for an example.) + # + # Returns an array of Benchmark::Tms objects. + # + # If the block returns an array of + # Benchmark::Tms objects, these will be used to format + # additional lines of output. If +labels+ parameter are + # given, these are used to label these extra lines. + # + # _Note_: Other methods provide a simpler interface to this one, and are + # suitable for nearly all benchmarking requirements. See the examples in + # Benchmark, and the #bm and #bmbm methods. + # + # Example: + # + # require 'benchmark' + # include Benchmark # we need the CAPTION and FORMAT constants + # + # n = 5000000 + # Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x| + # tf = x.report("for:") { for i in 1..n; a = "1"; end } + # tt = x.report("times:") { n.times do ; a = "1"; end } + # tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end } + # [tf+tt+tu, (tf+tt+tu)/3] + # end + # + # Generates: + # + # user system total real + # for: 0.970000 0.000000 0.970000 ( 0.970493) + # times: 0.990000 0.000000 0.990000 ( 0.989542) + # upto: 0.970000 0.000000 0.970000 ( 0.972854) + # >total: 2.930000 0.000000 2.930000 ( 2.932889) + # >avg: 0.976667 0.000000 0.976667 ( 0.977630) + # + # pkg:gem/benchmark#lib/benchmark.rb:171 + def benchmark(caption = T.unsafe(nil), label_width = T.unsafe(nil), format = T.unsafe(nil), *labels); end + + # A simple interface to the #benchmark method, #bm generates sequential + # reports with labels. +label_width+ and +labels+ parameters have the same + # meaning as for #benchmark. + # + # require 'benchmark' + # + # n = 5000000 + # Benchmark.bm(7) do |x| + # x.report("for:") { for i in 1..n; a = "1"; end } + # x.report("times:") { n.times do ; a = "1"; end } + # x.report("upto:") { 1.upto(n) do ; a = "1"; end } + # end + # + # Generates: + # + # user system total real + # for: 0.960000 0.000000 0.960000 ( 0.957966) + # times: 0.960000 0.000000 0.960000 ( 0.960423) + # upto: 0.950000 0.000000 0.950000 ( 0.954864) + # + # pkg:gem/benchmark#lib/benchmark.rb:216 + def bm(label_width = T.unsafe(nil), *labels, &blk); end + + # Sometimes benchmark results are skewed because code executed + # earlier encounters different garbage collection overheads than + # that run later. #bmbm attempts to minimize this effect by running + # the tests twice, the first time as a rehearsal in order to get the + # runtime environment stable, the second time for + # real. GC.start is executed before the start of each of + # the real timings; the cost of this is not included in the + # timings. In reality, though, there's only so much that #bmbm can + # do, and the results are not guaranteed to be isolated from garbage + # collection and other effects. + # + # Because #bmbm takes two passes through the tests, it can + # calculate the required label width. + # + # require 'benchmark' + # + # array = (1..1000000).map { rand } + # + # Benchmark.bmbm do |x| + # x.report("sort!") { array.dup.sort! } + # x.report("sort") { array.dup.sort } + # end + # + # Generates: + # + # Rehearsal ----------------------------------------- + # sort! 1.440000 0.010000 1.450000 ( 1.446833) + # sort 1.440000 0.000000 1.440000 ( 1.448257) + # -------------------------------- total: 2.890000sec + # + # user system total real + # sort! 1.460000 0.000000 1.460000 ( 1.458065) + # sort 1.450000 0.000000 1.450000 ( 1.455963) + # + # #bmbm yields a Benchmark::Job object and returns an array of + # Benchmark::Tms objects. + # + # pkg:gem/benchmark#lib/benchmark.rb:258 + def bmbm(width = T.unsafe(nil)); end + + # Returns the time used to execute the given block as a + # Benchmark::Tms object. Takes +label+ option. + # + # require 'benchmark' + # + # n = 1000000 + # + # time = Benchmark.measure do + # n.times { a = "1" } + # end + # puts time + # + # Generates: + # + # 0.220000 0.000000 0.220000 ( 0.227313) + # + # pkg:gem/benchmark#lib/benchmark.rb:303 + def measure(label = T.unsafe(nil)); end + + # Returns the elapsed real time used to execute the given block. + # The unit of time is milliseconds. + # + # Benchmark.ms { "a" * 1_000_000_000 } + # #=> 509.8029999935534 + # + # pkg:gem/benchmark#lib/benchmark.rb:335 + def ms; end + + # Returns the elapsed real time used to execute the given block. + # The unit of time is seconds. + # + # Benchmark.realtime { "a" * 1_000_000_000 } + # #=> 0.5098029999935534 + # + # pkg:gem/benchmark#lib/benchmark.rb:322 + def realtime; end + + class << self + # Invokes the block with a Benchmark::Report object, which + # may be used to collect and report on the results of individual + # benchmark tests. Reserves +label_width+ leading spaces for + # labels on each line. Prints +caption+ at the top of the + # report, and uses +format+ to format each line. + # (Note: +caption+ must contain a terminating newline character, + # see the default Benchmark::Tms::CAPTION for an example.) + # + # Returns an array of Benchmark::Tms objects. + # + # If the block returns an array of + # Benchmark::Tms objects, these will be used to format + # additional lines of output. If +labels+ parameter are + # given, these are used to label these extra lines. + # + # _Note_: Other methods provide a simpler interface to this one, and are + # suitable for nearly all benchmarking requirements. See the examples in + # Benchmark, and the #bm and #bmbm methods. + # + # Example: + # + # require 'benchmark' + # include Benchmark # we need the CAPTION and FORMAT constants + # + # n = 5000000 + # Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x| + # tf = x.report("for:") { for i in 1..n; a = "1"; end } + # tt = x.report("times:") { n.times do ; a = "1"; end } + # tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end } + # [tf+tt+tu, (tf+tt+tu)/3] + # end + # + # Generates: + # + # user system total real + # for: 0.970000 0.000000 0.970000 ( 0.970493) + # times: 0.990000 0.000000 0.990000 ( 0.989542) + # upto: 0.970000 0.000000 0.970000 ( 0.972854) + # >total: 2.930000 0.000000 2.930000 ( 2.932889) + # >avg: 0.976667 0.000000 0.976667 ( 0.977630) + # + # pkg:gem/benchmark#lib/benchmark.rb:341 + def benchmark(caption = T.unsafe(nil), label_width = T.unsafe(nil), format = T.unsafe(nil), *labels); end + + # A simple interface to the #benchmark method, #bm generates sequential + # reports with labels. +label_width+ and +labels+ parameters have the same + # meaning as for #benchmark. + # + # require 'benchmark' + # + # n = 5000000 + # Benchmark.bm(7) do |x| + # x.report("for:") { for i in 1..n; a = "1"; end } + # x.report("times:") { n.times do ; a = "1"; end } + # x.report("upto:") { 1.upto(n) do ; a = "1"; end } + # end + # + # Generates: + # + # user system total real + # for: 0.960000 0.000000 0.960000 ( 0.957966) + # times: 0.960000 0.000000 0.960000 ( 0.960423) + # upto: 0.950000 0.000000 0.950000 ( 0.954864) + # + # pkg:gem/benchmark#lib/benchmark.rb:341 + def bm(label_width = T.unsafe(nil), *labels, &blk); end + + # Sometimes benchmark results are skewed because code executed + # earlier encounters different garbage collection overheads than + # that run later. #bmbm attempts to minimize this effect by running + # the tests twice, the first time as a rehearsal in order to get the + # runtime environment stable, the second time for + # real. GC.start is executed before the start of each of + # the real timings; the cost of this is not included in the + # timings. In reality, though, there's only so much that #bmbm can + # do, and the results are not guaranteed to be isolated from garbage + # collection and other effects. + # + # Because #bmbm takes two passes through the tests, it can + # calculate the required label width. + # + # require 'benchmark' + # + # array = (1..1000000).map { rand } + # + # Benchmark.bmbm do |x| + # x.report("sort!") { array.dup.sort! } + # x.report("sort") { array.dup.sort } + # end + # + # Generates: + # + # Rehearsal ----------------------------------------- + # sort! 1.440000 0.010000 1.450000 ( 1.446833) + # sort 1.440000 0.000000 1.440000 ( 1.448257) + # -------------------------------- total: 2.890000sec + # + # user system total real + # sort! 1.460000 0.000000 1.460000 ( 1.458065) + # sort 1.450000 0.000000 1.450000 ( 1.455963) + # + # #bmbm yields a Benchmark::Job object and returns an array of + # Benchmark::Tms objects. + # + # pkg:gem/benchmark#lib/benchmark.rb:341 + def bmbm(width = T.unsafe(nil)); end + + # Returns the time used to execute the given block as a + # Benchmark::Tms object. Takes +label+ option. + # + # require 'benchmark' + # + # n = 1000000 + # + # time = Benchmark.measure do + # n.times { a = "1" } + # end + # puts time + # + # Generates: + # + # 0.220000 0.000000 0.220000 ( 0.227313) + # + # pkg:gem/benchmark#lib/benchmark.rb:341 + def measure(label = T.unsafe(nil)); end + + # Returns the elapsed real time used to execute the given block. + # The unit of time is milliseconds. + # + # Benchmark.ms { "a" * 1_000_000_000 } + # #=> 509.8029999935534 + # + # pkg:gem/benchmark#lib/benchmark.rb:341 + def ms; end + + # Returns the elapsed real time used to execute the given block. + # The unit of time is seconds. + # + # Benchmark.realtime { "a" * 1_000_000_000 } + # #=> 0.5098029999935534 + # + # pkg:gem/benchmark#lib/benchmark.rb:341 + def realtime; end + end +end + +# A Job is a sequence of labelled blocks to be processed by the +# Benchmark.bmbm method. It is of little direct interest to the user. +# +# pkg:gem/benchmark#lib/benchmark.rb:347 +class Benchmark::Job + # Returns an initialized Job instance. + # Usually, one doesn't call this method directly, as new + # Job objects are created by the #bmbm method. + # +width+ is a initial value for the label offset used in formatting; + # the #bmbm method passes its +width+ argument to this constructor. + # + # pkg:gem/benchmark#lib/benchmark.rb:355 + def initialize(width); end + + # Registers the given label and block pair in the job list. + # + # pkg:gem/benchmark#lib/benchmark.rb:363 + def item(label = T.unsafe(nil), &blk); end + + # An array of 2-element arrays, consisting of label and block pairs. + # + # pkg:gem/benchmark#lib/benchmark.rb:375 + def list; end + + # pkg:gem/benchmark#lib/benchmark.rb:372 + def report(label = T.unsafe(nil), &blk); end + + # Length of the widest label in the #list. + # + # pkg:gem/benchmark#lib/benchmark.rb:378 + def width; end +end + +# This class is used by the Benchmark.benchmark and Benchmark.bm methods. +# It is of little direct interest to the user. +# +# pkg:gem/benchmark#lib/benchmark.rb:385 +class Benchmark::Report + # Returns an initialized Report instance. + # Usually, one doesn't call this method directly, as new + # Report objects are created by the #benchmark and #bm methods. + # +width+ and +format+ are the label offset and + # format string used by Tms#format. + # + # pkg:gem/benchmark#lib/benchmark.rb:393 + def initialize(width = T.unsafe(nil), format = T.unsafe(nil)); end + + # An array of Benchmark::Tms objects representing each item. + # + # pkg:gem/benchmark#lib/benchmark.rb:412 + def format; end + + # Prints the +label+ and measured time for the block, + # formatted by +format+. See Tms#format for the + # formatting rules. + # + # pkg:gem/benchmark#lib/benchmark.rb:402 + def item(label = T.unsafe(nil), *format, &blk); end + + # An array of Benchmark::Tms objects representing each item. + # + # pkg:gem/benchmark#lib/benchmark.rb:412 + def list; end + + # pkg:gem/benchmark#lib/benchmark.rb:409 + def report(label = T.unsafe(nil), *format, &blk); end + + # An array of Benchmark::Tms objects representing each item. + # + # pkg:gem/benchmark#lib/benchmark.rb:412 + def width; end +end + +# A data object, representing the times associated with a benchmark +# measurement. +# +# pkg:gem/benchmark#lib/benchmark.rb:421 +class Benchmark::Tms + # Returns an initialized Tms object which has + # +utime+ as the user CPU time, +stime+ as the system CPU time, + # +cutime+ as the children's user CPU time, +cstime+ as the children's + # system CPU time, +real+ as the elapsed real time and +label+ as the label. + # + # pkg:gem/benchmark#lib/benchmark.rb:456 + def initialize(utime = T.unsafe(nil), stime = T.unsafe(nil), cutime = T.unsafe(nil), cstime = T.unsafe(nil), real = T.unsafe(nil), label = T.unsafe(nil)); end + + # Returns a new Tms object obtained by memberwise multiplication + # of the individual times for this Tms object by +x+. + # + # pkg:gem/benchmark#lib/benchmark.rb:504 + def *(x); end + + # Returns a new Tms object obtained by memberwise summation + # of the individual times for this Tms object with those of the +other+ + # Tms object. + # This method and #/() are useful for taking statistics. + # + # pkg:gem/benchmark#lib/benchmark.rb:491 + def +(other); end + + # Returns a new Tms object obtained by memberwise subtraction + # of the individual times for the +other+ Tms object from those of this + # Tms object. + # + # pkg:gem/benchmark#lib/benchmark.rb:498 + def -(other); end + + # Returns a new Tms object obtained by memberwise division + # of the individual times for this Tms object by +x+. + # This method and #+() are useful for taking statistics. + # + # pkg:gem/benchmark#lib/benchmark.rb:511 + def /(x); end + + # Returns a new Tms object whose times are the sum of the times for this + # Tms object, plus the time required to execute the code block (+blk+). + # + # pkg:gem/benchmark#lib/benchmark.rb:465 + def add(&blk); end + + # An in-place version of #add. + # Changes the times of this Tms object by making it the sum of the times + # for this Tms object, plus the time required to execute + # the code block (+blk+). + # + # pkg:gem/benchmark#lib/benchmark.rb:475 + def add!(&blk); end + + # System CPU time of children + # + # pkg:gem/benchmark#lib/benchmark.rb:439 + def cstime; end + + # User CPU time of children + # + # pkg:gem/benchmark#lib/benchmark.rb:436 + def cutime; end + + # Returns the contents of this Tms object as + # a formatted string, according to a +format+ string + # like that passed to Kernel.format. In addition, #format + # accepts the following extensions: + # + # %u:: Replaced by the user CPU time, as reported by Tms#utime. + # %y:: Replaced by the system CPU time, as reported by Tms#stime (Mnemonic: y of "s*y*stem") + # %U:: Replaced by the children's user CPU time, as reported by Tms#cutime + # %Y:: Replaced by the children's system CPU time, as reported by Tms#cstime + # %t:: Replaced by the total CPU time, as reported by Tms#total + # %r:: Replaced by the elapsed real time, as reported by Tms#real + # %n:: Replaced by the label string, as reported by Tms#label (Mnemonic: n of "*n*ame") + # + # If +format+ is not given, FORMAT is used as default value, detailing the + # user, system, total and real elapsed time. + # + # pkg:gem/benchmark#lib/benchmark.rb:530 + def format(format = T.unsafe(nil), *args); end + + # Label + # + # pkg:gem/benchmark#lib/benchmark.rb:448 + def label; end + + # Elapsed real time + # + # pkg:gem/benchmark#lib/benchmark.rb:442 + def real; end + + # System CPU time + # + # pkg:gem/benchmark#lib/benchmark.rb:433 + def stime; end + + # Returns a new 6-element array, consisting of the + # label, user CPU time, system CPU time, children's + # user CPU time, children's system CPU time and elapsed + # real time. + # + # pkg:gem/benchmark#lib/benchmark.rb:555 + def to_a; end + + # Returns a hash containing the same data as `to_a`. + # + # pkg:gem/benchmark#lib/benchmark.rb:562 + def to_h; end + + # Same as #format. + # + # pkg:gem/benchmark#lib/benchmark.rb:545 + def to_s; end + + # Total time, that is +utime+ + +stime+ + +cutime+ + +cstime+ + # + # pkg:gem/benchmark#lib/benchmark.rb:445 + def total; end + + # User CPU time + # + # pkg:gem/benchmark#lib/benchmark.rb:430 + def utime; end + + protected + + # Returns a new Tms object obtained by memberwise operation +op+ + # of the individual times for this Tms object with those of the other + # Tms object (+x+). + # + # +op+ can be a mathematical operation such as +, -, + # *, / + # + # pkg:gem/benchmark#lib/benchmark.rb:583 + def memberwise(op, x); end +end + +# pkg:gem/benchmark#lib/benchmark.rb:125 +Benchmark::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/bigdecimal@4.1.2.rbi b/sorbet/rbi/gems/bigdecimal@4.1.2.rbi new file mode 100644 index 0000000..f4111c5 --- /dev/null +++ b/sorbet/rbi/gems/bigdecimal@4.1.2.rbi @@ -0,0 +1,478 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `bigdecimal` gem. +# Please instead update this file by running `bin/tapioca gem bigdecimal`. + + +# pkg:gem/bigdecimal#lib/bigdecimal.rb:10 +class BigDecimal < ::Numeric + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def %(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def *(_arg0); end + + # call-seq: + # self ** other -> bigdecimal + # + # Returns the \BigDecimal value of +self+ raised to power +other+: + # + # b = BigDecimal('3.14') + # b ** 2 # => 0.98596e1 + # b ** 2.0 # => 0.98596e1 + # b ** Rational(2, 1) # => 0.98596e1 + # + # Related: BigDecimal#power. + # + # pkg:gem/bigdecimal#lib/bigdecimal.rb:127 + def **(y); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def +(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def +@; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def -(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def -@; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def /(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def <(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def <=(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def <=>(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def ==(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def ===(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def >(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def >=(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def _decimal_shift(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def _dump(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def abs; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def add(_arg0, _arg1); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def ceil(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def clone; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def coerce(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def div(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def divmod(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def dup; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def eql?(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def exponent; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def finite?; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def fix; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def floor(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def frac; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def hash; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def infinite?; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def inspect; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def modulo(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def mult(_arg0, _arg1); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def n_significant_digits; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def nan?; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def nonzero?; end + + # call-seq: + # power(n) + # power(n, prec) + # + # Returns the value raised to the power of n. + # + # Also available as the operator **. + # + # pkg:gem/bigdecimal#lib/bigdecimal.rb:147 + def power(y, prec = T.unsafe(nil)); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def precision; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def precision_scale; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def quo(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def remainder(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def round(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def scale; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def sign; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def split; end + + # Returns the square root of the value. + # + # Result has at least prec significant digits. + # + # pkg:gem/bigdecimal#lib/bigdecimal.rb:262 + def sqrt(prec); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def sub(_arg0, _arg1); end + + # call-seq: + # a.to_d -> bigdecimal + # + # Returns self. + # + # require 'bigdecimal/util' + # + # d = BigDecimal("3.14") + # d.to_d # => 0.314e1 + # + # pkg:gem/bigdecimal#lib/bigdecimal/util.rb:110 + def to_d; end + + # call-seq: + # a.to_digits -> string + # + # Converts a BigDecimal to a String of the form "nnnnnn.mmm". + # This method is deprecated; use BigDecimal#to_s("F") instead. + # + # require 'bigdecimal/util' + # + # d = BigDecimal("3.14") + # d.to_digits # => "3.14" + # + # pkg:gem/bigdecimal#lib/bigdecimal/util.rb:90 + def to_digits; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def to_f; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def to_i; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def to_int; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def to_r; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def to_s(format = T.unsafe(nil)); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def truncate(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def zero?; end + + class << self + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def _load(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def double_fig; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def interpret_loosely(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def limit(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def mode(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def save_exception_mode; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def save_limit; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:10 + def save_rounding_mode; end + end +end + +# pkg:gem/bigdecimal#lib/bigdecimal.rb:14 +module BigDecimal::Internal + class << self + # Coerce x to BigDecimal with the specified precision. + # TODO: some methods (example: BigMath.exp) require more precision than specified to coerce. + # + # pkg:gem/bigdecimal#lib/bigdecimal.rb:21 + def coerce_to_bigdecimal(x, prec, method_name); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:33 + def coerce_validate_prec(prec, method_name, accept_zero: T.unsafe(nil)); end + + # Calculates Math.log(x.to_f) considering large or small exponent + # + # pkg:gem/bigdecimal#lib/bigdecimal.rb:87 + def float_log(x); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:53 + def infinity_computation_result; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:67 + def nan_computation_result; end + + # Iteration for Newton's method with increasing precision + # + # pkg:gem/bigdecimal#lib/bigdecimal.rb:75 + def newton_loop(prec, initial_precision: T.unsafe(nil), safe_margin: T.unsafe(nil)); end + + # Calculating Taylor series sum using binary splitting method + # Calculates f(x) = (x/d0)*(1+(x/d1)*(1+(x/d2)*(1+(x/d3)*(1+...)))) + # x.n_significant_digits or ds.size must be small to be performant. + # + # pkg:gem/bigdecimal#lib/bigdecimal.rb:94 + def taylor_sum_binary_splitting(x, ds, prec); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:60 + def underflow_computation_result; end + end +end + +# Default extra precision for intermediate calculations +# This value is currently the same as BigDecimal.double_fig, but defined separately for future changes. +# +# pkg:gem/bigdecimal#lib/bigdecimal.rb:17 +BigDecimal::Internal::EXTRA_PREC = T.let(T.unsafe(nil), Integer) + +BigDecimal::VERSION = T.let(T.unsafe(nil), String) + +# Core BigMath methods for BigDecimal (log, exp) are defined here. +# Other methods (sin, cos, atan) are defined in 'bigdecimal/math.rb'. +# +# -- +# Contents: +# sqrt(x, prec) +# cbrt(x, prec) +# hypot(x, y, prec) +# sin (x, prec) +# cos (x, prec) +# tan (x, prec) +# asin(x, prec) +# acos(x, prec) +# atan(x, prec) +# atan2(y, x, prec) +# sinh (x, prec) +# cosh (x, prec) +# tanh (x, prec) +# asinh(x, prec) +# acosh(x, prec) +# atanh(x, prec) +# log2 (x, prec) +# log10(x, prec) +# log1p(x, prec) +# expm1(x, prec) +# erf (x, prec) +# erfc(x, prec) +# gamma(x, prec) +# lgamma(x, prec) +# frexp(x) +# ldexp(x, exponent) +# PI (prec) +# E (prec) == exp(1.0,prec) +# +# where: +# x, y ... BigDecimal number to be computed. +# prec ... Number of digits to be obtained. +# ++ +# +# Provides mathematical functions. +# +# Example: +# +# require "bigdecimal/math" +# +# include BigMath +# +# a = BigDecimal((PI(49)/2).to_s) +# puts sin(a,100) # => 0.9999999999...9999999986e0 +# +# pkg:gem/bigdecimal#lib/bigdecimal.rb:288 +module BigMath + private + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:336 + def _exp_binary_splitting(x, prec); end + + # call-seq: + # BigMath.exp(decimal, numeric) -> BigDecimal + # + # Computes the value of e (the base of natural logarithms) raised to the + # power of +decimal+, to the specified number of digits of precision. + # + # If +decimal+ is infinity, returns Infinity. + # + # If +decimal+ is NaN, returns NaN. + # + # pkg:gem/bigdecimal#lib/bigdecimal.rb:356 + def exp(x, prec); end + + # call-seq: + # BigMath.log(decimal, numeric) -> BigDecimal + # + # Computes the natural logarithm of +decimal+ to the specified number of + # digits of precision, +numeric+. + # + # If +decimal+ is zero or negative, raises Math::DomainError. + # + # If +decimal+ is positive infinity, returns Infinity. + # + # If +decimal+ is NaN, returns NaN. + # + # pkg:gem/bigdecimal#lib/bigdecimal.rb:303 + def log(x, prec); end + + class << self + # call-seq: + # BigMath.exp(decimal, numeric) -> BigDecimal + # + # Computes the value of e (the base of natural logarithms) raised to the + # power of +decimal+, to the specified number of digits of precision. + # + # If +decimal+ is infinity, returns Infinity. + # + # If +decimal+ is NaN, returns NaN. + # + # pkg:gem/bigdecimal#lib/bigdecimal.rb:356 + def exp(x, prec); end + + # call-seq: + # BigMath.log(decimal, numeric) -> BigDecimal + # + # Computes the natural logarithm of +decimal+ to the specified number of + # digits of precision, +numeric+. + # + # If +decimal+ is zero or negative, raises Math::DomainError. + # + # If +decimal+ is positive infinity, returns Infinity. + # + # If +decimal+ is NaN, returns NaN. + # + # pkg:gem/bigdecimal#lib/bigdecimal.rb:303 + def log(x, prec); end + + private + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:336 + def _exp_binary_splitting(x, prec); end + end +end + +# pkg:gem/bigdecimal#lib/bigdecimal/util.rb:141 +class Complex < ::Numeric + # call-seq: + # cmp.to_d -> bigdecimal + # cmp.to_d(precision) -> bigdecimal + # + # Returns the value as a BigDecimal. + # If the imaginary part is not +0+, an error is raised + # + # The +precision+ parameter is used to determine the number of + # significant digits for the result. When +precision+ is set to +0+, + # the number of digits to represent the float being converted is determined + # automatically. + # The default +precision+ is +0+. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # Complex(0.1234567, 0).to_d(4) # => 0.1235e0 + # Complex(Rational(22, 7), 0).to_d(3) # => 0.314e1 + # Complex(1, 1).to_d # raises ArgumentError + # + # See also Kernel.BigDecimal. + # + # pkg:gem/bigdecimal#lib/bigdecimal/util.rb:164 + def to_d(precision = T.unsafe(nil)); end +end + +# pkg:gem/bigdecimal#lib/bigdecimal/util.rb:116 +class Rational < ::Numeric + # call-seq: + # rat.to_d(precision) -> bigdecimal + # + # Returns the value as a BigDecimal. + # + # The +precision+ parameter is used to determine the number of + # significant digits for the result. When +precision+ is set to +0+, + # the number of digits to represent the float being converted is determined + # automatically. + # The default +precision+ is +0+. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # Rational(22, 7).to_d(3) # => 0.314e1 + # + # See also Kernel.BigDecimal. + # + # pkg:gem/bigdecimal#lib/bigdecimal/util.rb:135 + def to_d(precision = T.unsafe(nil)); end +end diff --git a/sorbet/rbi/gems/builder@3.3.0.rbi b/sorbet/rbi/gems/builder@3.3.0.rbi new file mode 100644 index 0000000..177ba9a --- /dev/null +++ b/sorbet/rbi/gems/builder@3.3.0.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `builder` gem. +# Please instead update this file by running `bin/tapioca gem builder`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem 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..022cfe1 --- /dev/null +++ b/sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi @@ -0,0 +1,10643 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `concurrent-ruby` gem. +# Please instead update this file by running `bin/tapioca gem concurrent-ruby`. + + +# {include:file:README.md} +# load native parts first +# load native parts first +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/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`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:139 + def abort_transaction; end + + # Run a block that reads and writes `TVar`s as a single atomic transaction. + # With respect to the value of `TVar` objects, the transaction is atomic, in + # that it either happens or it does not, consistent, in that the `TVar` + # objects involved will never enter an illegal state, and isolated, in that + # transactions never interfere with each other. You may recognise these + # properties from database transactions. + # + # There are some very important and unusual semantics that you must be aware of: + # + # * Most importantly, the block that you pass to atomically may be executed + # more than once. In most cases your code should be free of + # side-effects, except for via TVar. + # + # * If an exception escapes an atomically block it will abort the transaction. + # + # * It is undefined behaviour to use callcc or Fiber with atomically. + # + # * If you create a new thread within an atomically, it will not be part of + # the transaction. Creating a thread counts as a side-effect. + # + # Transactions within transactions are flattened to a single transaction. + # + # @example + # a = new TVar(100_000) + # b = new TVar(100) + # + # Concurrent::atomically do + # a.value -= 10 + # b.value += 10 + # end + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:82 + def atomically; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:56 + def call_dataflow(method, executor, *inputs, &block); end + + # Dataflow allows you to create a task that will be scheduled when all of its data dependencies are available. + # {include:file:docs-source/dataflow.md} + # + # @param [Future] inputs zero or more `Future` operations that this dataflow depends upon + # + # @yield The operation to perform once all the dependencies are met + # @yieldparam [Future] inputs each of the `Future` inputs to the dataflow + # @yieldreturn [Object] the result of the block operation + # + # @return [Object] the result of all the operations + # + # @raise [ArgumentError] if no block is given + # @raise [ArgumentError] if any of the inputs are not `IVar`s + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:34 + def dataflow(*inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:44 + def dataflow!(*inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:39 + def dataflow_with(executor, *inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:49 + def dataflow_with!(executor, *inputs, &block); end + + # Leave a transaction without committing or aborting - see `Concurrent::atomically`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:144 + def leave_transaction; end + + # @!macro monotonic_get_time + # + # Returns the current time as tracked by the application monotonic clock. + # + # @param [Symbol] unit the time unit to be returned, can be either + # :float_second, :float_millisecond, :float_microsecond, :second, + # :millisecond, :microsecond, or :nanosecond default to :float_second. + # + # @return [Float] The current monotonic time since some unspecified + # starting point + # + # @!macro monotonic_clock_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/monotonic_time.rb:15 + def monotonic_time(unit = T.unsafe(nil)); end + + class << self + # Abort a currently running transaction - see `Concurrent::atomically`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:148 + def abort_transaction; end + + # Run a block that reads and writes `TVar`s as a single atomic transaction. + # With respect to the value of `TVar` objects, the transaction is atomic, in + # that it either happens or it does not, consistent, in that the `TVar` + # objects involved will never enter an illegal state, and isolated, in that + # transactions never interfere with each other. You may recognise these + # properties from database transactions. + # + # There are some very important and unusual semantics that you must be aware of: + # + # * Most importantly, the block that you pass to atomically may be executed + # more than once. In most cases your code should be free of + # side-effects, except for via TVar. + # + # * If an exception escapes an atomically block it will abort the transaction. + # + # * It is undefined behaviour to use callcc or Fiber with atomically. + # + # * If you create a new thread within an atomically, it will not be part of + # the transaction. Creating a thread counts as a side-effect. + # + # Transactions within transactions are flattened to a single transaction. + # + # @example + # a = new TVar(100_000) + # b = new TVar(100) + # + # Concurrent::atomically do + # a.value -= 10 + # b.value += 10 + # end + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:148 + def atomically; end + + # Number of processors cores available for process scheduling. + # This method takes in account the CPU quota if the process is inside a cgroup with a + # dedicated CPU quota (typically Docker). + # Otherwise it returns the same value as #processor_count but as a Float. + # + # For performance reasons the calculated value will be memoized on the first + # call. + # + # @return [Float] number of available processors + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:194 + def available_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:80 + def call_dataflow(method, executor, *inputs, &block); end + + # The maximum number of processors cores available for process scheduling. + # Returns `nil` if there is no enforced limit, or a `Float` if the + # process is inside a cgroup with a dedicated CPU quota (typically Docker). + # + # Note that nothing prevents setting a CPU quota higher than the actual number of + # cores on the system. + # + # For performance reasons the calculated value will be memoized on the first + # call. + # + # @return [nil, Float] Maximum number of available processors as set by a cgroup CPU quota, or nil if none set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:209 + def cpu_quota; end + + # The CPU shares requested by the process. For performance reasons the calculated + # value will be memoized on the first call. + # + # @return [Float, nil] CPU shares requested by the process, or nil if not set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:217 + def cpu_shares; end + + # Create a simple logger with provided level and output. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:38 + def create_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end + + # Create a stdlib logger with provided level and output. + # If you use this deprecated method you might need to add logger to your Gemfile to avoid warnings from Ruby 3.3.5+. + # @deprecated + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:73 + def create_stdlib_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end + + # Dataflow allows you to create a task that will be scheduled when all of its data dependencies are available. + # {include:file:docs-source/dataflow.md} + # + # @param [Future] inputs zero or more `Future` operations that this dataflow depends upon + # + # @yield The operation to perform once all the dependencies are met + # @yieldparam [Future] inputs each of the `Future` inputs to the dataflow + # @yieldreturn [Object] the result of the block operation + # + # @return [Object] the result of all the operations + # + # @raise [ArgumentError] if no block is given + # @raise [ArgumentError] if any of the inputs are not `IVar`s + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:37 + def dataflow(*inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:47 + def dataflow!(*inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:42 + def dataflow_with(executor, *inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:52 + def dataflow_with!(executor, *inputs, &block); end + + # Disables AtExit handlers including pool auto-termination handlers. + # When disabled it will be the application programmer's responsibility + # to ensure that the handlers are shutdown properly prior to application + # exit by calling `AtExit.run` method. + # + # @note this option should be needed only because of `at_exit` ordering + # issues which may arise when running some of the testing frameworks. + # E.g. Minitest's test-suite runs itself in `at_exit` callback which + # executes after the pools are already terminated. Then auto termination + # needs to be disabled and called manually after test-suite ends. + # @note This method should *never* be called + # from within a gem. It should *only* be used from within the main + # application and even then it should be used only when necessary. + # @deprecated Has no effect since it is no longer needed, see https://github.com/ruby-concurrency/concurrent-ruby/pull/841. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:48 + def disable_at_exit_handlers!; end + + # General access point to global executors. + # @param [Symbol, Executor] executor_identifier symbols: + # - :fast - {Concurrent.global_fast_executor} + # - :io - {Concurrent.global_io_executor} + # - :immediate - {Concurrent.global_immediate_executor} + # @return [Executor] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:83 + def executor(executor_identifier); end + + # Global thread pool optimized for short, fast *operations*. + # + # @return [ThreadPoolExecutor] the thread pool + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:55 + def global_fast_executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:66 + def global_immediate_executor; end + + # Global thread pool optimized for long, blocking (IO) *tasks*. + # + # @return [ThreadPoolExecutor] the thread pool + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:62 + def global_io_executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:114 + def global_logger; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:118 + def global_logger=(value); end + + # Global thread pool user for global *timers*. + # + # @return [Concurrent::TimerSet] the thread pool + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:73 + def global_timer_set; end + + # Leave a transaction without committing or aborting - see `Concurrent::atomically`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:148 + def leave_transaction; end + + # @!macro monotonic_get_time + # + # Returns the current time as tracked by the application monotonic clock. + # + # @param [Symbol] unit the time unit to be returned, can be either + # :float_second, :float_millisecond, :float_microsecond, :second, + # :millisecond, :microsecond, or :nanosecond default to :float_second. + # + # @return [Float] The current monotonic time since some unspecified + # starting point + # + # @!macro monotonic_clock_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/monotonic_time.rb:18 + def monotonic_time(unit = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:7 + def mutex_owned_per_thread?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:87 + def new_fast_executor(opts = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:98 + def new_io_executor(opts = T.unsafe(nil)); end + + # Number of physical processor cores on the current system. For performance + # reasons the calculated value will be memoized on the first call. + # + # On Windows the Win32 API will be queried for the `NumberOfCores from + # Win32_Processor`. This will return the total number "of cores for the + # current instance of the processor." On Unix-like operating systems either + # the `hwprefs` or `sysctl` utility will be called in a subshell and the + # returned value will be used. In the rare case where none of these methods + # work or an exception is raised the function will simply return 1. + # + # @return [Integer] number physical processor cores on the current system + # + # @see https://github.com/grosser/parallel/blob/4fc8b89d08c7091fe0419ca8fba1ec3ce5a8d185/lib/parallel.rb + # + # @see http://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx + # @see http://www.unix.com/man-page/osx/1/HWPREFS/ + # @see http://linux.die.net/man/8/sysctl + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:181 + def physical_processor_count; end + + # Number of processors seen by the OS and used for process scheduling. For + # performance reasons the calculated value will be memoized on the first + # call. + # + # When running under JRuby the Java runtime call + # `java.lang.Runtime.getRuntime.availableProcessors` will be used. According + # to the Java documentation this "value may change during a particular + # invocation of the virtual machine... [applications] should therefore + # occasionally poll this property." We still memoize this value once under + # JRuby. + # + # Otherwise Ruby's Etc.nprocessors will be used. + # + # @return [Integer] number of processors seen by the OS or Java runtime + # + # @see http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#availableProcessors() + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:160 + def processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:142 + def processor_counter; end + + # Use logger created by #create_simple_logger to log concurrent-ruby messages. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:66 + def use_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end + + # Use logger created by #create_stdlib_logger to log concurrent-ruby messages. + # @deprecated + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:101 + def use_stdlib_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end + end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:38 +class Concurrent::AbstractExchanger < ::Concurrent::Synchronization::Object + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:44 + def initialize; end + + # @!macro exchanger_method_do_exchange + # + # Waits for another thread to arrive at this exchange point (unless the + # current thread is interrupted), and then transfers the given object to + # it, receiving its object in return. The timeout value indicates the + # approximate number of seconds the method should block while waiting + # for the exchange. When the timeout value is `nil` the method will + # block indefinitely. + # + # @param [Object] value the value to exchange with another thread + # @param [Numeric, nil] timeout in seconds, `nil` blocks indefinitely + # + # @!macro exchanger_method_exchange + # + # In some edge cases when a `timeout` is given a return value of `nil` may be + # ambiguous. Specifically, if `nil` is a valid value in the exchange it will + # be impossible to tell whether `nil` is the actual return value or if it + # signifies timeout. When `nil` is a valid value in the exchange consider + # using {#exchange!} or {#try_exchange} instead. + # + # @return [Object] the value exchanged by the other thread or `nil` on timeout + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:69 + def exchange(value, timeout = T.unsafe(nil)); end + + # @!macro exchanger_method_do_exchange + # @!macro exchanger_method_exchange_bang + # + # On timeout a {Concurrent::TimeoutError} exception will be raised. + # + # @return [Object] the value exchanged by the other thread + # @raise [Concurrent::TimeoutError] on timeout + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:80 + def exchange!(value, timeout = T.unsafe(nil)); end + + # @!macro exchanger_method_do_exchange + # @!macro exchanger_method_try_exchange + # + # The return value will be a {Concurrent::Maybe} set to `Just` on success or + # `Nothing` on timeout. + # + # @return [Concurrent::Maybe] on success a `Just` maybe will be returned with + # the item exchanged by the other thread as `#value`; on timeout a + # `Nothing` maybe will be returned with {Concurrent::TimeoutError} as `#reason` + # + # @example + # + # exchanger = Concurrent::Exchanger.new + # + # result = exchanger.exchange(:foo, 0.5) + # + # if result.just? + # puts result.value #=> :bar + # else + # puts 'timeout' + # end + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:109 + def try_exchange(value, timeout = T.unsafe(nil)); end + + private + + # @!macro exchanger_method_do_exchange + # + # @return [Object, CANCEL] the value exchanged by the other thread; {CANCEL} on timeout + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:122 + def do_exchange(value, timeout); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:41 +Concurrent::AbstractExchanger::CANCEL = T.let(T.unsafe(nil), Object) + +# @!macro abstract_executor_service_public_api +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:10 +class Concurrent::AbstractExecutorService < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Logging + include ::Concurrent::ExecutorService + include ::Concurrent::Concern::Deprecation + + # Create a new thread pool. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:23 + def initialize(opts = T.unsafe(nil), &block); end + + # @!macro executor_service_method_auto_terminate_setter + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:72 + def auto_terminate=(value); end + + # @!macro executor_service_method_auto_terminate_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:67 + def auto_terminate?; end + + # @!macro executor_service_attr_reader_fallback_policy + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:18 + def fallback_policy; end + + # @!macro executor_service_method_kill + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:42 + def kill; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:20 + def name; end + + # @!macro executor_service_method_running_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:52 + def running?; end + + # @!macro executor_service_method_shutdown + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:37 + def shutdown; end + + # @!macro executor_service_method_shutdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:62 + def shutdown?; end + + # @!macro executor_service_method_shuttingdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:57 + def shuttingdown?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:32 + def to_s; end + + # @!macro executor_service_method_wait_for_termination + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:47 + def wait_for_termination(timeout = T.unsafe(nil)); end + + private + + # Returns an action which executes the `fallback_policy` once the queue + # size reaches `max_queue`. The reason for the indirection of an action + # is so that the work can be deferred outside of synchronization. + # + # @param [Array] args the arguments to the task which is being handled. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:85 + def fallback_action(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:126 + def ns_auto_terminate?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:106 + def ns_execute(*args, &task); end + + # @!macro executor_service_method_ns_kill_execution + # + # Callback method called when the executor has been killed. + # The default behavior is to do nothing. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:122 + def ns_kill_execution; end + + # @!macro executor_service_method_ns_shutdown_execution + # + # Callback method called when an orderly shutdown has completed. + # The default behavior is to signal all waiting threads. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:114 + def ns_shutdown_execution; end +end + +# The set of possible fallback policies that may be set at thread pool creation. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:15 +Concurrent::AbstractExecutorService::FALLBACK_POLICIES = T.let(T.unsafe(nil), Array) + +# @!visibility private +# @!macro internal_implementation_note +# +# An abstract implementation of local storage, with sub-classes for +# per-thread and per-fiber locals. +# +# Each execution context (EC, thread or fiber) has a lazily initialized array +# of local variable values. Each time a new local variable is created, we +# allocate an "index" for it. +# +# For example, if the allocated index is 1, that means slot #1 in EVERY EC's +# locals array will be used for the value of that variable. +# +# The good thing about using a per-EC structure to hold values, rather than +# a global, is that no synchronization is needed when reading and writing +# those values (since the structure is only ever accessed by a single +# thread). +# +# Of course, when a local variable is GC'd, 1) we need to recover its index +# for use by other new local variables (otherwise the locals arrays could +# get bigger and bigger with time), and 2) we need to null out all the +# references held in the now-unused slots (both to avoid blocking GC of those +# objects, and also to prevent "stale" values from being passed on to a new +# local when the index is reused). +# +# Because we need to null out freed slots, we need to keep references to +# ALL the locals arrays, so we can null out the appropriate slots in all of +# them. This is why we need to use a finalizer to clean up the locals array +# when the EC goes out of scope. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:35 +class Concurrent::AbstractLocals + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:36 + def initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:89 + def fetch(index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:71 + def free_index(index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:55 + def next_index(local); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:102 + def set(index, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:43 + def synchronize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:48 + def weak_synchronize; end + + private + + # When the local goes out of scope, clean up that slot across all locals currently assigned. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:112 + def local_finalizer(index); end + + # Returns the locals for the current scope, or nil if none exist. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:128 + def locals; end + + # Returns the locals for the current scope, creating them if necessary. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:133 + def locals!; end + + # When a thread/fiber goes out of scope, remove the array from @all_arrays. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:119 + def thread_fiber_finalizer(array_object_id); end +end + +# `Agent` is inspired by Clojure's [agent](http://clojure.org/agents) +# function. An agent is a shared, mutable variable providing independent, +# uncoordinated, *asynchronous* change of individual values. Best used when +# the value will undergo frequent, complex updates. Suitable when the result +# of an update does not need to be known immediately. `Agent` is (mostly) +# functionally equivalent to Clojure's agent, except where the runtime +# prevents parity. +# +# Agents are reactive, not autonomous - there is no imperative message loop +# and no blocking receive. The state of an Agent should be itself immutable +# and the `#value` of an Agent is always immediately available for reading by +# any thread without any messages, i.e. observation does not require +# cooperation or coordination. +# +# Agent action dispatches are made using the various `#send` methods. These +# methods always return immediately. At some point later, in another thread, +# the following will happen: +# +# 1. The given `action` will be applied to the state of the Agent and the +# `args`, if any were supplied. +# 2. The return value of `action` will be passed to the validator lambda, +# if one has been set on the Agent. +# 3. If the validator succeeds or if no validator was given, the return value +# of the given `action` will become the new `#value` of the Agent. See +# `#initialize` for details. +# 4. If any observers were added to the Agent, they will be notified. See +# `#add_observer` for details. +# 5. If during the `action` execution any other dispatches are made (directly +# or indirectly), they will be held until after the `#value` of the Agent +# has been changed. +# +# If any exceptions are thrown by an action function, no nested dispatches +# will occur, and the exception will be cached in the Agent itself. When an +# Agent has errors cached, any subsequent interactions will immediately throw +# an exception, until the agent's errors are cleared. Agent errors can be +# examined with `#error` and the agent restarted with `#restart`. +# +# The actions of all Agents get interleaved amongst threads in a thread pool. +# At any point in time, at most one action for each Agent is being executed. +# Actions dispatched to an agent from another single agent or thread will +# occur in the order they were sent, potentially interleaved with actions +# dispatched to the same agent from other sources. The `#send` method should +# be used for actions that are CPU limited, while the `#send_off` method is +# appropriate for actions that may block on IO. +# +# Unlike in Clojure, `Agent` cannot participate in `Concurrent::TVar` transactions. +# +# ## Example +# +# ``` +# def next_fibonacci(set = nil) +# return [0, 1] if set.nil? +# set + [set[-2..-1].reduce{|sum,x| sum + x }] +# end +# +# # create an agent with an initial value +# agent = Concurrent::Agent.new(next_fibonacci) +# +# # send a few update requests +# 5.times do +# agent.send{|set| next_fibonacci(set) } +# end +# +# # wait for them to complete +# agent.await +# +# # get the current value +# agent.value #=> [0, 1, 1, 2, 3, 5, 8] +# ``` +# +# ## Observation +# +# Agents support observers through the {Concurrent::Observable} mixin module. +# Notification of observers occurs every time an action dispatch returns and +# the new value is successfully validated. Observation will *not* occur if the +# action raises an exception, if validation fails, or when a {#restart} occurs. +# +# When notified the observer will receive three arguments: `time`, `old_value`, +# and `new_value`. The `time` argument is the time at which the value change +# occurred. The `old_value` is the value of the Agent when the action began +# processing. The `new_value` is the value to which the Agent was set when the +# action completed. Note that `old_value` and `new_value` may be the same. +# This is not an error. It simply means that the action returned the same +# value. +# +# ## Nested Actions +# +# It is possible for an Agent action to post further actions back to itself. +# The nested actions will be enqueued normally then processed *after* the +# outer action completes, in the order they were sent, possibly interleaved +# with action dispatches from other threads. Nested actions never deadlock +# with one another and a failure in a nested action will never affect the +# outer action. +# +# Nested actions can be called using the Agent reference from the enclosing +# scope or by passing the reference in as a "send" argument. Nested actions +# cannot be post using `self` from within the action block/proc/lambda; `self` +# in this context will not reference the Agent. The preferred method for +# dispatching nested actions is to pass the Agent as an argument. This allows +# Ruby to more effectively manage the closing scope. +# +# Prefer this: +# +# ``` +# agent = Concurrent::Agent.new(0) +# agent.send(agent) do |value, this| +# this.send {|v| v + 42 } +# 3.14 +# end +# agent.value #=> 45.14 +# ``` +# +# Over this: +# +# ``` +# agent = Concurrent::Agent.new(0) +# agent.send do |value| +# agent.send {|v| v + 42 } +# 3.14 +# end +# ``` +# +# @!macro agent_await_warning +# +# **NOTE** Never, *under any circumstances*, call any of the "await" methods +# ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action +# block/proc/lambda. The call will block the Agent and will always fail. +# Calling either {#await} or {#wait} (with a timeout of `nil`) will +# hopelessly deadlock the Agent with no possibility of recovery. +# +# @!macro thread_safe_variable_comparison +# +# @see http://clojure.org/Agents Clojure Agents +# @see http://clojure.org/state Values and Change - Clojure's approach to Identity and State +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:145 +class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Observable + + # Create a new `Agent` with the given initial value and options. + # + # The `:validator` option must be `nil` or a side-effect free proc/lambda + # which takes one argument. On any intended value change the validator, if + # provided, will be called. If the new value is invalid the validator should + # return `false` or raise an error. + # + # The `:error_handler` option must be `nil` or a proc/lambda which takes two + # arguments. When an action raises an error or validation fails, either by + # returning false or raising an error, the error handler will be called. The + # arguments to the error handler will be a reference to the agent itself and + # the error object which was raised. + # + # The `:error_mode` may be either `:continue` (the default if an error + # handler is given) or `:fail` (the default if error handler nil or not + # given). + # + # If an action being run by the agent throws an error or doesn't pass + # validation the error handler, if present, will be called. After the + # handler executes if the error mode is `:continue` the Agent will continue + # as if neither the action that caused the error nor the error itself ever + # happened. + # + # If the mode is `:fail` the Agent will become {#failed?} and will stop + # accepting new action dispatches. Any previously queued actions will be + # held until {#restart} is called. The {#value} method will still work, + # returning the value of the Agent before the error. + # + # @param [Object] initial the initial value + # @param [Hash] opts the configuration options + # + # @option opts [Symbol] :error_mode either `:continue` or `:fail` + # @option opts [nil, Proc] :error_handler the (optional) error handler + # @option opts [nil, Proc] :validator the (optional) validation procedure + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:220 + def initialize(initial, opts = T.unsafe(nil)); end + + # Dispatches an action to the Agent and returns immediately. Subsequently, + # in a thread from a thread pool, the {#value} will be set to the return + # value of the action. Appropriate for actions that may block on IO. + # + # @param [Proc] action the action dispatch to be enqueued + # @return [Concurrent::Agent] self + # @see #send_off + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:331 + def <<(action); end + + # Blocks the current thread (indefinitely!) until all actions dispatched + # thus far, from this thread or nested by the Agent, have occurred. Will + # block when {#failed?}. Will never return if a failed Agent is {#restart} + # with `:clear_actions` true. + # + # Returns a reference to `self` to support method chaining: + # + # ``` + # current_value = agent.await.value + # ``` + # + # @return [Boolean] self + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:350 + def await; end + + # Blocks the current thread until all actions dispatched thus far, from this + # thread or nested by the Agent, have occurred, or the timeout (in seconds) + # has elapsed. + # + # @param [Float] timeout the maximum number of seconds to wait + # @return [Boolean] true if all actions complete before timeout else false + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:363 + def await_for(timeout); end + + # Blocks the current thread until all actions dispatched thus far, from this + # thread or nested by the Agent, have occurred, or the timeout (in seconds) + # has elapsed. + # + # @param [Float] timeout the maximum number of seconds to wait + # @return [Boolean] true if all actions complete before timeout + # + # @raise [Concurrent::TimeoutError] when timeout is reached + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:377 + def await_for!(timeout); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:233 + def deref; end + + # When {#failed?} and {#error_mode} is `:fail`, returns the error object + # which caused the failure, else `nil`. When {#error_mode} is `:continue` + # will *always* return `nil`. + # + # @return [nil, Error] the error which caused the failure when {#failed?} + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:240 + def error; end + + # The error mode this Agent is operating in. See {#initialize} for details. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:184 + def error_mode; end + + # Is the Agent in a failed state? + # + # @see #restart + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:402 + def failed?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:298 + def post(*args, &action); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:244 + def reason; end + + # When an Agent is {#failed?}, changes the Agent {#value} to `new_value` + # then un-fails the Agent so that action dispatches are allowed again. If + # the `:clear_actions` option is give and true, any actions queued on the + # Agent that were being held while it was failed will be discarded, + # otherwise those held actions will proceed. The `new_value` must pass the + # validator if any, or `restart` will raise an exception and the Agent will + # remain failed with its old {#value} and {#error}. Observers, if any, will + # not be notified of the new state. + # + # @param [Object] new_value the new value for the Agent once restarted + # @param [Hash] opts the configuration options + # @option opts [Symbol] :clear_actions true if all enqueued but unprocessed + # actions should be discarded on restart, else false (default: false) + # @return [Boolean] true + # + # @raise [Concurrent:AgentError] when not failed + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:424 + def restart(new_value, opts = T.unsafe(nil)); end + + # @!macro agent_send + # + # Dispatches an action to the Agent and returns immediately. Subsequently, + # in a thread from a thread pool, the {#value} will be set to the return + # value of the action. Action dispatches are only allowed when the Agent + # is not {#failed?}. + # + # The action must be a block/proc/lambda which takes 1 or more arguments. + # The first argument is the current {#value} of the Agent. Any arguments + # passed to the send method via the `args` parameter will be passed to the + # action as the remaining arguments. The action must return the new value + # of the Agent. + # + # * {#send} and {#send!} should be used for actions that are CPU limited + # * {#send_off}, {#send_off!}, and {#<<} are appropriate for actions that + # may block on IO + # * {#send_via} and {#send_via!} are used when a specific executor is to + # be used for the action + # + # @param [Array] args zero or more arguments to be passed to + # the action + # @param [Proc] action the action dispatch to be enqueued + # + # @yield [agent, value, *args] process the old value and return the new + # @yieldparam [Object] value the current {#value} of the Agent + # @yieldparam [Array] args zero or more arguments to pass to the + # action + # @yieldreturn [Object] the new value of the Agent + # + # @!macro send_return + # @return [Boolean] true if the action is successfully enqueued, false if + # the Agent is {#failed?} + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:278 + def send(*args, &action); end + + # @!macro agent_send + # + # @!macro send_bang_return_and_raise + # @return [Boolean] true if the action is successfully enqueued + # @raise [Concurrent::Agent::Error] if the Agent is {#failed?} + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:287 + def send!(*args, &action); end + + # @!macro agent_send + # @!macro send_return + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:294 + def send_off(*args, &action); end + + # @!macro agent_send + # @!macro send_bang_return_and_raise + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:302 + def send_off!(*args, &action); end + + # @!macro agent_send + # @!macro send_return + # @param [Concurrent::ExecutorService] executor the executor on which the + # action is to be dispatched + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:311 + def send_via(executor, *args, &action); end + + # @!macro agent_send + # @!macro send_bang_return_and_raise + # @param [Concurrent::ExecutorService] executor the executor on which the + # action is to be dispatched + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:319 + def send_via!(executor, *args, &action); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:406 + def stopped?; end + + # The current value (state) of the Agent, irrespective of any pending or + # in-progress actions. The value is always available and is non-blocking. + # + # @return [Object] the current value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:229 + def value; end + + # Blocks the current thread until all actions dispatched thus far, from this + # thread or nested by the Agent, have occurred, or the timeout (in seconds) + # has elapsed. Will block indefinitely when timeout is nil or not given. + # + # Provided mainly for consistency with other classes in this library. Prefer + # the various `await` methods instead. + # + # @param [Float] timeout the maximum number of seconds to wait + # @return [Boolean] true if all actions complete before timeout else false + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:393 + def wait(timeout = T.unsafe(nil)); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:510 + def enqueue_action_job(action, args, executor); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:516 + def enqueue_await_job(latch); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:543 + def execute_next_job; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:576 + def handle_error(error); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:529 + def ns_enqueue_job(job, index = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:584 + def ns_find_last_job_for_thread; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:490 + def ns_initialize(initial, opts); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:539 + def ns_post_next_job; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:570 + def ns_validate(value); end + + class << self + # Blocks the current thread (indefinitely!) until all actions dispatched + # thus far to all the given Agents, from this thread or nested by the + # given Agents, have occurred. Will block when any of the agents are + # failed. Will never return if a failed Agent is restart with + # `:clear_actions` true. + # + # @param [Array] agents the Agents on which to wait + # @return [Boolean] true + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:449 + def await(*agents); end + + # Blocks the current thread until all actions dispatched thus far to all + # the given Agents, from this thread or nested by the given Agents, have + # occurred, or the timeout (in seconds) has elapsed. + # + # @param [Float] timeout the maximum number of seconds to wait + # @param [Array] agents the Agents on which to wait + # @return [Boolean] true if all actions complete before timeout else false + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:463 + def await_for(timeout, *agents); end + + # Blocks the current thread until all actions dispatched thus far to all + # the given Agents, from this thread or nested by the given Agents, have + # occurred, or the timeout (in seconds) has elapsed. + # + # @param [Float] timeout the maximum number of seconds to wait + # @param [Array] agents the Agents on which to wait + # @return [Boolean] true if all actions complete before timeout + # + # @raise [Concurrent::TimeoutError] when timeout is reached + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:482 + def await_for!(timeout, *agents); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:154 +Concurrent::Agent::AWAIT_ACTION = T.let(T.unsafe(nil), Proc) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:151 +Concurrent::Agent::AWAIT_FLAG = T.let(T.unsafe(nil), Object) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:157 +Concurrent::Agent::DEFAULT_ERROR_HANDLER = T.let(T.unsafe(nil), Proc) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:160 +Concurrent::Agent::DEFAULT_VALIDATOR = T.let(T.unsafe(nil), Proc) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:148 +Concurrent::Agent::ERROR_MODES = T.let(T.unsafe(nil), Array) + +# Raised during action processing or any other time in an Agent's lifecycle. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:167 +class Concurrent::Agent::Error < ::StandardError + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:168 + def initialize(message = T.unsafe(nil)); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 +class Concurrent::Agent::Job < ::Struct + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def action; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def action=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def args; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def args=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def caller; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def caller=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def executor=(_); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def [](*_arg0); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def keyword_init?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def new(*_arg0); end + end +end + +# Raised when a new value obtained during action processing or at `#restart` +# fails validation. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:176 +class Concurrent::Agent::ValidationError < ::Concurrent::Agent::Error + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:177 + def initialize(message = T.unsafe(nil)); end +end + +# @!macro concurrent_array +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/array.rb:53 +class Concurrent::Array < ::Array; end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/array.rb:22 +Concurrent::ArrayImplementation = Array + +# A mixin module that provides simple asynchronous behavior to a class, +# turning it into a simple actor. Loosely based on Erlang's +# [gen_server](http://www.erlang.org/doc/man/gen_server.html), but without +# supervision or linking. +# +# A more feature-rich {Concurrent::Actor} is also available when the +# capabilities of `Async` are too limited. +# +# ```cucumber +# Feature: +# As a stateful, plain old Ruby class +# I want safe, asynchronous behavior +# So my long-running methods don't block the main thread +# ``` +# +# The `Async` module is a way to mix simple yet powerful asynchronous +# capabilities into any plain old Ruby object or class, turning each object +# into a simple Actor. Method calls are processed on a background thread. The +# caller is free to perform other actions while processing occurs in the +# background. +# +# Method calls to the asynchronous object are made via two proxy methods: +# `async` (alias `cast`) and `await` (alias `call`). These proxy methods post +# the method call to the object's background thread and return a "future" +# which will eventually contain the result of the method call. +# +# This behavior is loosely patterned after Erlang's `gen_server` behavior. +# When an Erlang module implements the `gen_server` behavior it becomes +# inherently asynchronous. The `start` or `start_link` function spawns a +# process (similar to a thread but much more lightweight and efficient) and +# returns the ID of the process. Using the process ID, other processes can +# send messages to the `gen_server` via the `cast` and `call` methods. Unlike +# Erlang's `gen_server`, however, `Async` classes do not support linking or +# supervision trees. +# +# ## Basic Usage +# +# When this module is mixed into a class, objects of the class become inherently +# asynchronous. Each object gets its own background thread on which to post +# asynchronous method calls. Asynchronous method calls are executed in the +# background one at a time in the order they are received. +# +# To create an asynchronous class, simply mix in the `Concurrent::Async` module: +# +# ``` +# class Hello +# include Concurrent::Async +# +# def hello(name) +# "Hello, #{name}!" +# end +# end +# ``` +# +# Mixing this module into a class provides each object two proxy methods: +# `async` and `await`. These methods are thread safe with respect to the +# enclosing object. The former proxy allows methods to be called +# asynchronously by posting to the object's internal thread. The latter proxy +# allows a method to be called synchronously but does so safely with respect +# to any pending asynchronous method calls and ensures proper ordering. Both +# methods return a {Concurrent::IVar} which can be inspected for the result +# of the proxied method call. Calling a method with `async` will return a +# `:pending` `IVar` whereas `await` will return a `:complete` `IVar`. +# +# ``` +# class Echo +# include Concurrent::Async +# +# def echo(msg) +# print "#{msg}\n" +# end +# end +# +# horn = Echo.new +# horn.echo('zero') # synchronous, not thread-safe +# # returns the actual return value of the method +# +# horn.async.echo('one') # asynchronous, non-blocking, thread-safe +# # returns an IVar in the :pending state +# +# horn.await.echo('two') # synchronous, blocking, thread-safe +# # returns an IVar in the :complete state +# ``` +# +# ## Let It Fail +# +# The `async` and `await` proxy methods have built-in error protection based +# on Erlang's famous "let it fail" philosophy. Instance methods should not be +# programmed defensively. When an exception is raised by a delegated method +# the proxy will rescue the exception, expose it to the caller as the `reason` +# attribute of the returned future, then process the next method call. +# +# ## Calling Methods Internally +# +# External method calls should *always* use the `async` and `await` proxy +# methods. When one method calls another method, the `async` proxy should +# rarely be used and the `await` proxy should *never* be used. +# +# When an object calls one of its own methods using the `await` proxy the +# second call will be enqueued *behind* the currently running method call. +# Any attempt to wait on the result will fail as the second call will never +# run until after the current call completes. +# +# Calling a method using the `await` proxy from within a method that was +# itself called using `async` or `await` will irreversibly deadlock the +# object. Do *not* do this, ever. +# +# ## Instance Variables and Attribute Accessors +# +# Instance variables do not need to be thread-safe so long as they are private. +# Asynchronous method calls are processed in the order they are received and +# are processed one at a time. Therefore private instance variables can only +# be accessed by one thread at a time. This is inherently thread-safe. +# +# When using private instance variables within asynchronous methods, the best +# practice is to read the instance variable into a local variable at the start +# of the method then update the instance variable at the *end* of the method. +# This way, should an exception be raised during method execution the internal +# state of the object will not have been changed. +# +# ### Reader Attributes +# +# The use of `attr_reader` is discouraged. Internal state exposed externally, +# when necessary, should be done through accessor methods. The instance +# variables exposed by these methods *must* be thread-safe, or they must be +# called using the `async` and `await` proxy methods. These two approaches are +# subtly different. +# +# When internal state is accessed via the `async` and `await` proxy methods, +# the returned value represents the object's state *at the time the call is +# processed*, which may *not* be the state of the object at the time the call +# is made. +# +# To get the state *at the current* time, irrespective of an enqueued method +# calls, a reader method must be called directly. This is inherently unsafe +# unless the instance variable is itself thread-safe, preferably using one +# of the thread-safe classes within this library. Because the thread-safe +# classes within this library are internally-locking or non-locking, they can +# be safely used from within asynchronous methods without causing deadlocks. +# +# Generally speaking, the best practice is to *not* expose internal state via +# reader methods. The best practice is to simply use the method's return value. +# +# ### Writer Attributes +# +# Writer attributes should never be used with asynchronous classes. Changing +# the state externally, even when done in the thread-safe way, is not logically +# consistent. Changes to state need to be timed with respect to all asynchronous +# method calls which my be in-process or enqueued. The only safe practice is to +# pass all necessary data to each method as arguments and let the method update +# the internal state as necessary. +# +# ## Class Constants, Variables, and Methods +# +# ### Class Constants +# +# Class constants do not need to be thread-safe. Since they are read-only and +# immutable they may be safely read both externally and from within +# asynchronous methods. +# +# ### Class Variables +# +# Class variables should be avoided. Class variables represent shared state. +# Shared state is anathema to concurrency. Should there be a need to share +# state using class variables they *must* be thread-safe, preferably +# using the thread-safe classes within this library. When updating class +# variables, never assign a new value/object to the variable itself. Assignment +# is not thread-safe in Ruby. Instead, use the thread-safe update functions +# of the variable itself to change the value. +# +# The best practice is to *never* use class variables with `Async` classes. +# +# ### Class Methods +# +# Class methods which are pure functions are safe. Class methods which modify +# class variables should be avoided, for all the reasons listed above. +# +# ## An Important Note About Thread Safe Guarantees +# +# > Thread safe guarantees can only be made when asynchronous method calls +# > are not mixed with direct method calls. Use only direct method calls +# > when the object is used exclusively on a single thread. Use only +# > `async` and `await` when the object is shared between threads. Once you +# > call a method using `async` or `await`, you should no longer call methods +# > directly on the object. Use `async` and `await` exclusively from then on. +# +# @example +# +# class Echo +# include Concurrent::Async +# +# def echo(msg) +# print "#{msg}\n" +# end +# end +# +# horn = Echo.new +# horn.echo('zero') # synchronous, not thread-safe +# # returns the actual return value of the method +# +# horn.async.echo('one') # asynchronous, non-blocking, thread-safe +# # returns an IVar in the :pending state +# +# horn.await.echo('two') # synchronous, blocking, thread-safe +# # returns an IVar in the :complete state +# +# @see Concurrent::Actor +# @see https://en.wikipedia.org/wiki/Actor_model "Actor Model" at Wikipedia +# @see http://www.erlang.org/doc/man/gen_server.html Erlang gen_server +# @see http://c2.com/cgi/wiki?LetItCrash "Let It Crash" at http://c2.com/ +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:217 +module Concurrent::Async + mixes_in_class_methods ::Concurrent::Async::ClassMethods + + # Causes the chained method call to be performed asynchronously on the + # object's thread. The delegated method will return a future in the + # `:pending` state and the method call will have been scheduled on the + # object's thread. The final disposition of the method call can be obtained + # by inspecting the returned future. + # + # @!macro async_thread_safety_warning + # @note The method call is guaranteed to be thread safe with respect to + # all other method calls against the same object that are called with + # either `async` or `await`. The mutable nature of Ruby references + # (and object orientation in general) prevent any other thread safety + # guarantees. Do NOT mix direct method calls with delegated method calls. + # Use *only* delegated method calls when sharing the object between threads. + # + # @return [Concurrent::IVar] the pending result of the asynchronous operation + # + # @raise [NameError] the object does not respond to the requested method + # @raise [ArgumentError] the given `args` do not match the arity of + # the requested method + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:412 + def async; end + + # Causes the chained method call to be performed synchronously on the + # current thread. The delegated will return a future in either the + # `:fulfilled` or `:rejected` state and the delegated method will have + # completed. The final disposition of the delegated method can be obtained + # by inspecting the returned future. + # + # @!macro async_thread_safety_warning + # + # @return [Concurrent::IVar] the completed result of the synchronous operation + # + # @raise [NameError] the object does not respond to the requested method + # @raise [ArgumentError] the given `args` do not match the arity of the + # requested method + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:430 + def await; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:433 + def call; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:415 + def cast; end + + # Initialize the internal serializer and other stnchronization mechanisms. + # + # @note This method *must* be called immediately upon object construction. + # This is the only way thread-safe initialization can be guaranteed. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:441 + def init_synchronization; end + + class << self + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:262 + def included(base); end + + # Check for the presence of a method on an object and determine if a given + # set of arguments matches the required arity. + # + # @param [Object] obj the object to check against + # @param [Symbol] method the method to check the object for + # @param [Array] args zero or more arguments for the arity check + # + # @raise [NameError] the object does not respond to `method` method + # @raise [ArgumentError] the given `args` do not match the arity of `method` + # + # @note This check is imperfect because of the way Ruby reports the arity of + # methods with a variable number of arguments. It is possible to determine + # if too few arguments are given but impossible to determine if too many + # arguments are given. This check may also fail to recognize dynamic behavior + # of the object, such as methods simulated with `method_missing`. + # + # @see http://www.ruby-doc.org/core-2.1.1/Method.html#method-i-arity Method#arity + # @see http://ruby-doc.org/core-2.1.0/Object.html#method-i-respond_to-3F Object#respond_to? + # @see http://www.ruby-doc.org/core-2.1.0/BasicObject.html#method-i-method_missing BasicObject#method_missing + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:250 + def validate_argc(obj, method, *args); end + end +end + +# Delegates asynchronous, thread-safe method calls to the wrapped object. +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:282 +class Concurrent::Async::AsyncDelegator < ::Concurrent::Synchronization::LockableObject + # Create a new delegator object wrapping the given delegate. + # + # @param [Object] delegate the object to wrap and delegate method calls to + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:288 + def initialize(delegate); end + + # Delegates method calls to the wrapped object. + # + # @param [Symbol] method the method being called + # @param [Array] args zero or more arguments to the method + # + # @return [IVar] the result of the method call + # + # @raise [NameError] the object does not respond to `method` method + # @raise [ArgumentError] the given `args` do not match the arity of `method` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:305 + def method_missing(method, *args, &block); end + + # Perform all enqueued tasks. + # + # This method must be called from within the executor. It must not be + # called while already running. It will loop until the queue is empty. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:330 + def perform; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:348 + def reset_if_forked; end + + private + + # Check whether the method is responsive + # + # @param [Symbol] method the method being called + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:322 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end +end + +# Delegates synchronous, thread-safe method calls to the wrapped object. +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:360 +class Concurrent::Async::AwaitDelegator + # Create a new delegator object wrapping the given delegate. + # + # @param [AsyncDelegator] delegate the object to wrap and delegate method calls to + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:365 + def initialize(delegate); end + + # Delegates method calls to the wrapped object. + # + # @param [Symbol] method the method being called + # @param [Array] args zero or more arguments to the method + # + # @return [IVar] the result of the method call + # + # @raise [NameError] the object does not respond to `method` method + # @raise [ArgumentError] the given `args` do not match the arity of `method` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:378 + def method_missing(method, *args, &block); end + + private + + # Check whether the method is responsive + # + # @param [Symbol] method the method being called + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:387 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:269 +module Concurrent::Async::ClassMethods + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:270 + def new(*args, **_arg1, &block); end +end + +# Atoms provide a way to manage shared, synchronous, independent state. +# +# An atom is initialized with an initial value and an optional validation +# proc. At any time the value of the atom can be synchronously and safely +# changed. If a validator is given at construction then any new value +# will be checked against the validator and will be rejected if the +# validator returns false or raises an exception. +# +# There are two ways to change the value of an atom: {#compare_and_set} and +# {#swap}. The former will set the new value if and only if it validates and +# the current value matches the new value. The latter will atomically set the +# new value to the result of running the given block if and only if that +# value validates. +# +# ## Example +# +# ``` +# def next_fibonacci(set = nil) +# return [0, 1] if set.nil? +# set + [set[-2..-1].reduce{|sum,x| sum + x }] +# end +# +# # create an atom with an initial value +# atom = Concurrent::Atom.new(next_fibonacci) +# +# # send a few update requests +# 5.times do +# atom.swap{|set| next_fibonacci(set) } +# end +# +# # get the current value +# atom.value #=> [0, 1, 1, 2, 3, 5, 8] +# ``` +# +# ## Observation +# +# Atoms support observers through the {Concurrent::Observable} mixin module. +# Notification of observers occurs every time the value of the Atom changes. +# When notified the observer will receive three arguments: `time`, `old_value`, +# and `new_value`. The `time` argument is the time at which the value change +# occurred. The `old_value` is the value of the Atom when the change began +# The `new_value` is the value to which the Atom was set when the change +# completed. Note that `old_value` and `new_value` may be the same. This is +# not an error. It simply means that the change operation returned the same +# value. +# +# Unlike in Clojure, `Atom` cannot participate in {Concurrent::TVar} transactions. +# +# @!macro thread_safe_variable_comparison +# +# @see http://clojure.org/atoms Clojure Atoms +# @see http://clojure.org/state Values and Change - Clojure's approach to Identity and State +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:95 +class Concurrent::Atom < ::Concurrent::Synchronization::Object + include ::Concurrent::Concern::Observable + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new atom with the given initial value. + # + # @param [Object] value The initial value + # @param [Hash] opts The options used to configure the atom + # @option opts [Proc] :validator (nil) Optional proc used to validate new + # values. It must accept one and only one argument which will be the + # intended new value. The validator will return true if the new value + # is acceptable else return false (preferably) or raise an exception. + # + # @!macro deref_options + # + # @raise [ArgumentError] if the validator is not a `Proc` (when given) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:121 + def initialize(value, opts = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def __initialize_atomic_fields__; end + + # Atomically sets the value of atom to the new value if and only if the + # current value of the atom is identical to the old value and the new + # value successfully validates against the (optional) validator given + # at construction. + # + # @param [Object] old_value The expected current value. + # @param [Object] new_value The intended new value. + # + # @return [Boolean] True if the value is changed else false. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:181 + def compare_and_set(old_value, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:102 + def deref; end + + # Atomically sets the value of atom to the new value without regard for the + # current value so long as the new value successfully validates against the + # (optional) validator given at construction. + # + # @param [Object] new_value The intended new value. + # + # @return [Object] The final value of the atom after all operations and + # validations are complete. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:198 + def reset(new_value); end + + # Atomically swaps the value of atom using the given block. The current + # value will be passed to the block, as will any arguments passed as + # arguments to the function. The new value will be validated against the + # (optional) validator proc given at construction. If validation fails the + # value will not be changed. + # + # Internally, {#swap} reads the current value, applies the block to it, and + # attempts to compare-and-set it in. Since another thread may have changed + # the value in the intervening time, it may have to retry, and does so in a + # spin loop. The net effect is that the value will always be the result of + # the application of the supplied block to a current value, atomically. + # However, because the block might be called multiple times, it must be free + # of side effects. + # + # @note The given block may be called multiple times, and thus should be free + # of side effects. + # + # @param [Object] args Zero or more arguments passed to the block. + # + # @yield [value, args] Calculates a new value for the atom based on the + # current value and any supplied arguments. + # @yieldparam value [Object] The current value of the atom. + # @yieldparam args [Object] All arguments passed to the function, in order. + # @yieldreturn [Object] The intended new value of the atom. + # + # @return [Object] The final value of the atom after all operations and + # validations are complete. + # + # @raise [ArgumentError] When no block is given. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:157 + def swap(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def value; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def compare_and_set_value(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def swap_value(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def update_value(&block); end + + # Is the new value valid? + # + # @param [Object] new_value The intended new value. + # @return [Boolean] false if the validator function returns false or raises + # an exception else true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:216 + def valid?(new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def value=(value); end +end + +# @!macro atomic_boolean +# +# A boolean value that can be updated atomically. Reads and writes to an atomic +# boolean and thread-safe and guaranteed to succeed. Reads and writes may block +# briefly but no explicit locking is required. +# +# @!macro thread_safe_variable_comparison +# +# Performance: +# +# ``` +# Testing with ruby 2.1.2 +# Testing with Concurrent::MutexAtomicBoolean... +# 2.790000 0.000000 2.790000 ( 2.791454) +# Testing with Concurrent::CAtomicBoolean... +# 0.740000 0.000000 0.740000 ( 0.740206) +# +# Testing with jruby 1.9.3 +# Testing with Concurrent::MutexAtomicBoolean... +# 5.240000 2.520000 7.760000 ( 3.683000) +# Testing with Concurrent::JavaAtomicBoolean... +# 3.340000 0.010000 3.350000 ( 0.855000) +# ``` +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicBoolean.html java.util.concurrent.atomic.AtomicBoolean +# +# @!macro atomic_boolean_public_api +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb:119 +class Concurrent::AtomicBoolean < ::Concurrent::MutexAtomicBoolean + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb:125 + def inspect; end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb:121 + def to_s; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb:82 +Concurrent::AtomicBooleanImplementation = Concurrent::MutexAtomicBoolean + +# Define update methods that use direct paths +# +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb:9 +module Concurrent::AtomicDirectUpdate + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb:15 + def try_update; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb:24 + def try_update!; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb:10 + def update; end +end + +# @!macro atomic_fixnum +# +# A numeric value that can be updated atomically. Reads and writes to an atomic +# fixnum and thread-safe and guaranteed to succeed. Reads and writes may block +# briefly but no explicit locking is required. +# +# @!macro thread_safe_variable_comparison +# +# Performance: +# +# ``` +# Testing with ruby 2.1.2 +# Testing with Concurrent::MutexAtomicFixnum... +# 3.130000 0.000000 3.130000 ( 3.136505) +# Testing with Concurrent::CAtomicFixnum... +# 0.790000 0.000000 0.790000 ( 0.785550) +# +# Testing with jruby 1.9.3 +# Testing with Concurrent::MutexAtomicFixnum... +# 5.460000 2.460000 7.920000 ( 3.715000) +# Testing with Concurrent::JavaAtomicFixnum... +# 4.520000 0.030000 4.550000 ( 1.187000) +# ``` +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicLong.html java.util.concurrent.atomic.AtomicLong +# +# @!macro atomic_fixnum_public_api +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb:136 +class Concurrent::AtomicFixnum < ::Concurrent::MutexAtomicFixnum + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb:142 + def inspect; end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb:138 + def to_s; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb:99 +Concurrent::AtomicFixnumImplementation = Concurrent::MutexAtomicFixnum + +# An atomic reference which maintains an object reference along with a mark bit +# that can be updated atomically. +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicMarkableReference.html +# java.util.concurrent.atomic.AtomicMarkableReference +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:10 +class Concurrent::AtomicMarkableReference < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:15 + def initialize(value = T.unsafe(nil), mark = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def __initialize_atomic_fields__; end + + # Atomically sets the value and mark to the given updated value and + # mark given both: + # - the current value == the expected value && + # - the current mark == the expected mark + # + # @param [Object] expected_val the expected value + # @param [Object] new_val the new value + # @param [Boolean] expected_mark the expected mark + # @param [Boolean] new_mark the new mark + # + # @return [Boolean] `true` if successful. A `false` return indicates + # that the actual value was not equal to the expected value or the + # actual mark was not equal to the expected mark + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:33 + def compare_and_set(expected_val, new_val, expected_mark, new_mark); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:59 + def compare_and_swap(expected_val, new_val, expected_mark, new_mark); end + + # Gets the current reference and marked values. + # + # @return [Array] the current reference and marked values + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:64 + def get; end + + # Gets the current marked value + # + # @return [Boolean] the current marked value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:78 + def mark; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:82 + def marked?; end + + # _Unconditionally_ sets to the given value of both the reference and + # the mark. + # + # @param [Object] new_val the new value + # @param [Boolean] new_mark the new mark + # + # @return [Array] both the new value and the new mark + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:91 + def set(new_val, new_mark); end + + # Pass the current value to the given block, replacing it with the + # block's result. Simply return nil if update fails. + # + # @yield [Object] Calculate a new value and marked state for the atomic + # reference using given (old) value and (old) marked + # @yieldparam [Object] old_val the starting value of the atomic reference + # @yieldparam [Boolean] old_mark the starting state of marked + # + # @return [Array] the new value and marked state, or nil if + # the update failed + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:152 + def try_update; end + + # Pass the current value to the given block, replacing it + # with the block's result. Raise an exception if the update + # fails. + # + # @yield [Object] Calculate a new value and marked state for the atomic + # reference using given (old) value and (old) marked + # @yieldparam [Object] old_val the starting value of the atomic reference + # @yieldparam [Boolean] old_mark the starting state of marked + # + # @return [Array] the new value and marked state + # + # @raise [Concurrent::ConcurrentUpdateError] if the update fails + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:128 + def try_update!; end + + # Pass the current value and marked state to the given block, replacing it + # with the block's results. May retry if the value changes during the + # block's execution. + # + # @yield [Object] Calculate a new value and marked state for the atomic + # reference using given (old) value and (old) marked + # @yieldparam [Object] old_val the starting value of the atomic reference + # @yieldparam [Boolean] old_mark the starting state of marked + # + # @return [Array] the new value and new mark + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:105 + def update; end + + # Gets the current value of the reference + # + # @return [Object] the current value of the reference + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:71 + def value; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def compare_and_set_reference(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:163 + def immutable_array(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def reference; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def reference=(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def swap_reference(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def update_reference(&block); end +end + +# Special "compare and set" handling of numeric values. +# +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb:7 +module Concurrent::AtomicNumericCompareAndSetWrapper + # @!macro atomic_reference_method_compare_and_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb:10 + def compare_and_set(old_value, new_value); end +end + +# An object reference that may be updated atomically. All read and write +# operations have java volatile semantic. +# +# @!macro thread_safe_variable_comparison +# +# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicReference.html +# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/package-summary.html +# +# @!method initialize(value = nil) +# @!macro atomic_reference_method_initialize +# @param [Object] value The initial value. +# +# @!method get +# @!macro atomic_reference_method_get +# Gets the current value. +# @return [Object] the current value +# +# @!method set(new_value) +# @!macro atomic_reference_method_set +# Sets to the given value. +# @param [Object] new_value the new value +# @return [Object] the new value +# +# @!method get_and_set(new_value) +# @!macro atomic_reference_method_get_and_set +# Atomically sets to the given value and returns the old value. +# @param [Object] new_value the new value +# @return [Object] the old value +# +# @!method compare_and_set(old_value, new_value) +# @!macro atomic_reference_method_compare_and_set +# +# Atomically sets the value to the given updated value if +# the current value == the expected value. +# +# @param [Object] old_value the expected value +# @param [Object] new_value the new value +# +# @return [Boolean] `true` if successful. A `false` return indicates +# that the actual value was not equal to the expected value. +# +# @!method update +# Pass the current value to the given block, replacing it +# with the block's result. May retry if the value changes +# during the block's execution. +# +# @yield [Object] Calculate a new value for the atomic reference using +# given (old) value +# @yieldparam [Object] old_value the starting value of the atomic reference +# @return [Object] the new value +# +# @!method try_update +# Pass the current value to the given block, replacing it +# with the block's result. Return nil if the update fails. +# +# @yield [Object] Calculate a new value for the atomic reference using +# given (old) value +# @yieldparam [Object] old_value the starting value of the atomic reference +# @note This method was altered to avoid raising an exception by default. +# Instead, this method now returns `nil` in case of failure. For more info, +# please see: https://github.com/ruby-concurrency/concurrent-ruby/pull/336 +# @return [Object] the new value, or nil if update failed +# +# @!method try_update! +# Pass the current value to the given block, replacing it +# with the block's result. Raise an exception if the update +# fails. +# +# @yield [Object] Calculate a new value for the atomic reference using +# given (old) value +# @yieldparam [Object] old_value the starting value of the atomic reference +# @note This behavior mimics the behavior of the original +# `AtomicReference#try_update` API. The reason this was changed was to +# avoid raising exceptions (which are inherently slow) by default. For more +# info: https://github.com/ruby-concurrency/concurrent-ruby/pull/336 +# @return [Object] the new value +# @raise [Concurrent::ConcurrentUpdateError] if the update fails +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:126 +class Concurrent::AtomicReference < ::Concurrent::MutexAtomicReference + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:133 + def inspect; end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:129 + def to_s; end +end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:18 +Concurrent::AtomicReferenceImplementation = Concurrent::MutexAtomicReference + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:30 +class Concurrent::CRubySet < ::Set + include ::Set::SubclassCompatible + extend ::Set::SubclassCompatible::ClassMethods + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def initialize(*args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def &(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def +(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def -(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def <(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def <<(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def <=(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def <=>(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def ==(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def ===(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def >(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def >=(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def ^(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def add(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def add?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def classify(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def clear(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def collect!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def compare_by_identity(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def compare_by_identity?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def delete(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def delete?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def delete_if(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def difference(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def disjoint?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def divide(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def each(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def empty?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def encode_with(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def eql?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def filter!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def flatten(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def flatten!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def hash(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def include?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def init_with(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def inspect(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def intersect?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def intersection(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def join(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def keep_if(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def length(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def map!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def member?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def merge(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def pretty_print(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def pretty_print_cycle(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def proper_subset?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def proper_superset?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def reject!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def replace(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def reset(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def select!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def size(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def subset?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def subtract(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def superset?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def to_a(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def to_s(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def to_set(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def union(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def |(*args); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def initialize_copy(other); end +end + +# A thread pool that dynamically grows and shrinks to fit the current workload. +# New threads are created as needed, existing threads are reused, and threads +# that remain idle for too long are killed and removed from the pool. These +# pools are particularly suited to applications that perform a high volume of +# short-lived tasks. +# +# On creation a `CachedThreadPool` has zero running threads. New threads are +# created on the pool as new operations are `#post`. The size of the pool +# will grow until `#max_length` threads are in the pool or until the number +# of threads exceeds the number of running and pending operations. When a new +# operation is post to the pool the first available idle thread will be tasked +# with the new operation. +# +# Should a thread crash for any reason the thread will immediately be removed +# from the pool. Similarly, threads which remain idle for an extended period +# of time will be killed and reclaimed. Thus these thread pools are very +# efficient at reclaiming unused resources. +# +# The API and behavior of this class are based on Java's `CachedThreadPool` +# +# @!macro thread_pool_options +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb:27 +class Concurrent::CachedThreadPool < ::Concurrent::ThreadPoolExecutor + # @!macro cached_thread_pool_method_initialize + # + # Create a new thread pool. + # + # @param [Hash] opts the options defining pool behavior. + # @option opts [Symbol] :fallback_policy (`:abort`) the fallback policy + # + # @raise [ArgumentError] if `fallback_policy` is not a known policy + # + # @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newCachedThreadPool-- + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb:39 + def initialize(opts = T.unsafe(nil)); end + + private + + # @!macro cached_thread_pool_method_initialize + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb:51 + def ns_initialize(opts); end +end + +# Raised when an asynchronous operation is cancelled before execution. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:9 +class Concurrent::CancelledOperationError < ::Concurrent::Error; end + +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/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 +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:12 +class Concurrent::Collection::CopyOnNotifyObserverSet < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:14 + def initialize; end + + # @!macro observable_add_observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:20 + def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + # @!macro observable_count_observers + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:55 + def count_observers; end + + # @!macro observable_delete_observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:39 + def delete_observer(observer); end + + # @!macro observable_delete_observers + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:47 + def delete_observers; end + + # Notifies all registered observers with optional args and deletes them. + # + # @param [Object] args arguments to be passed to each observer + # @return [CopyOnWriteObserverSet] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:72 + def notify_and_delete_observers(*args, &block); end + + # Notifies all registered observers with optional args + # @param [Object] args arguments to be passed to each observer + # @return [CopyOnWriteObserverSet] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:62 + def notify_observers(*args, &block); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:80 + def ns_initialize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:86 + def duplicate_and_clear_observers; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:94 + def duplicate_observers; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:98 + def notify_to(observers, *args); end +end + +# A thread safe observer set implemented using copy-on-write approach: +# every time an observer is added or removed the whole internal data structure is +# duplicated and replaced with a new one. +# +# @api private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:11 +class Concurrent::Collection::CopyOnWriteObserverSet < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:13 + def initialize; end + + # @!macro observable_add_observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:19 + def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + # @!macro observable_count_observers + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:56 + def count_observers; end + + # @!macro observable_delete_observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:40 + def delete_observer(observer); end + + # @!macro observable_delete_observers + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:50 + def delete_observers; end + + # Notifies all registered observers with optional args and deletes them. + # + # @param [Object] args arguments to be passed to each observer + # @return [CopyOnWriteObserverSet] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:72 + def notify_and_delete_observers(*args, &block); end + + # Notifies all registered observers with optional args + # @param [Object] args arguments to be passed to each observer + # @return [CopyOnWriteObserverSet] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:63 + def notify_observers(*args, &block); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:80 + def ns_initialize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:102 + def clear_observers_and_return_old; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:86 + def notify_to(observers, *args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:94 + def observers; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:98 + def observers=(new_set); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:10 +Concurrent::Collection::MapImplementation = Concurrent::Collection::MriMapBackend + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:10 +class Concurrent::Collection::MriMapBackend < ::Concurrent::Collection::NonConcurrentMapBackend + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:12 + def initialize(options = T.unsafe(nil), &default_proc); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:17 + def []=(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:61 + def clear; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:33 + def compute(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:21 + def compute_if_absent(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:29 + def compute_if_present(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:53 + def delete(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:57 + def delete_pair(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:49 + def get_and_set(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:37 + def merge_pair(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:45 + def replace_if_exists(key, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:41 + def replace_pair(key, old_value, new_value); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:9 +class Concurrent::Collection::NonConcurrentMapBackend + # WARNING: all public methods of the class must operate on the @backend + # directly without calling each other. This is important because of the + # SynchronizedMapBackend which uses a non-reentrant mutex for performance + # reasons. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:15 + def initialize(options = T.unsafe(nil), &default_proc); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:21 + def [](key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:25 + def []=(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:94 + def clear; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:59 + def compute(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:29 + def compute_if_absent(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:53 + def compute_if_present(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:81 + def delete(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:85 + def delete_pair(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:99 + def each_pair; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:71 + def get_and_set(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:110 + def get_or_default(key, default_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:77 + def key?(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:63 + def merge_pair(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:46 + def replace_if_exists(key, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:37 + def replace_pair(key, old_value, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:106 + def size; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:130 + def dupped_backend; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:124 + def initialize_copy(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:134 + def pair?(key, expected_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:116 + def set_backend(default_proc); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:138 + def store_computed_value(key, new_value); end +end + +# @!macro priority_queue +# +# A queue collection in which the elements are sorted based on their +# comparison (spaceship) operator `<=>`. Items are added to the queue +# at a position relative to their priority. On removal the element +# with the "highest" priority is removed. By default the sort order is +# from highest to lowest, but a lowest-to-highest sort order can be +# set on construction. +# +# The API is based on the `Queue` class from the Ruby standard library. +# +# The pure Ruby implementation, `RubyNonConcurrentPriorityQueue` uses a heap algorithm +# stored in an array. The algorithm is based on the work of Robert Sedgewick +# and Kevin Wayne. +# +# The JRuby native implementation is a thin wrapper around the standard +# library `java.util.NonConcurrentPriorityQueue`. +# +# When running under JRuby the class `NonConcurrentPriorityQueue` extends `JavaNonConcurrentPriorityQueue`. +# When running under all other interpreters it extends `RubyNonConcurrentPriorityQueue`. +# +# @note This implementation is *not* thread safe. +# +# @see http://en.wikipedia.org/wiki/Priority_queue +# @see http://ruby-doc.org/stdlib-2.0.0/libdoc/thread/rdoc/Queue.html +# +# @see http://algs4.cs.princeton.edu/24pq/index.php#2.6 +# @see http://algs4.cs.princeton.edu/24pq/MaxPQ.java.html +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:50 +class Concurrent::Collection::NonConcurrentPriorityQueue < ::Concurrent::Collection::RubyNonConcurrentPriorityQueue + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:59 + def <<(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:56 + def deq; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:60 + def enq(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:52 + def has_priority?(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:57 + def shift; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:54 + def size; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:10 +Concurrent::Collection::NonConcurrentPriorityQueueImplementation = Concurrent::Collection::RubyNonConcurrentPriorityQueue + +# @!macro priority_queue +# +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:8 +class Concurrent::Collection::RubyNonConcurrentPriorityQueue + # @!macro priority_queue_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:11 + def initialize(opts = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:85 + def <<(item); end + + # @!macro priority_queue_method_clear + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:18 + def clear; end + + # @!macro priority_queue_method_delete + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:25 + def delete(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:74 + def deq; end + + # @!macro priority_queue_method_empty + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:43 + def empty?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:86 + def enq(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:51 + def has_priority?(item); end + + # @!macro priority_queue_method_include + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:48 + def include?(item); end + + # @!macro priority_queue_method_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:54 + def length; end + + # @!macro priority_queue_method_peek + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:60 + def peek; end + + # @!macro priority_queue_method_pop + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:65 + def pop; end + + # @!macro priority_queue_method_push + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:78 + def push(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:75 + def shift; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:57 + def size; end + + private + + # Are the items at the given indexes ordered based on the priority + # order specified at construction? + # + # @param [Integer] x the first index from which to retrieve a comparable value + # @param [Integer] y the second index from which to retrieve a comparable value + # + # @return [Boolean] true if the two elements are in the correct priority order + # else false + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:119 + def ordered?(x, y); end + + # Percolate down to maintain heap invariant. + # + # @param [Integer] k the index at which to start the percolation + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:128 + def sink(k); end + + # Exchange the values at the given indexes within the internal array. + # + # @param [Integer] x the first index to swap + # @param [Integer] y the second index to swap + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:103 + def swap(x, y); end + + # Percolate up to maintain heap invariant. + # + # @param [Integer] k the index at which to start the percolation + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:147 + def swim(k); end + + class << self + # @!macro priority_queue_method_from_list + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:89 + def from_list(list, opts = T.unsafe(nil)); end + end +end + +# @!visibility private +# @!macro timeout_queue +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/timeout_queue.rb:15 +class Concurrent::Collection::TimeoutQueue < ::Thread::Queue; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/timeout_queue.rb:5 +Concurrent::Collection::TimeoutQueueImplementation = Thread::Queue + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:2 +module Concurrent::Concern; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/deprecation.rb:8 +module Concurrent::Concern::Deprecation + include ::Concurrent::Concern::Logging + extend ::Concurrent::Concern::Logging + extend ::Concurrent::Concern::Deprecation + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/deprecation.rb:12 + def deprecated(message, strip = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/deprecation.rb:27 + def deprecated_method(old_name, new_name); end +end + +# Object references in Ruby are mutable. This can lead to serious problems when +# the `#value` of a concurrent object is a mutable reference. Which is always the +# case unless the value is a `Fixnum`, `Symbol`, or similar "primitive" data type. +# Most classes in this library that expose a `#value` getter method do so using the +# `Dereferenceable` mixin module. +# +# @!macro copy_options +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:11 +module Concurrent::Concern::Dereferenceable + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:24 + def deref; end + + # Return the value this object represents after applying the options specified + # by the `#set_deref_options` method. + # + # @return [Object] the current value of the object + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:21 + def value; end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:63 + def apply_deref_options(value); end + + # @!macro dereferenceable_set_deref_options + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:54 + def ns_set_deref_options(opts); end + + # @!macro dereferenceable_set_deref_options + # Set the options which define the operations #value performs before + # returning data to the caller (dereferencing). + # + # @note Most classes that include this module will call `#set_deref_options` + # from within the constructor, thus allowing these options to be set at + # object creation. + # + # @param [Hash] opts the options defining dereference behavior. + # @option opts [String] :dup_on_deref (false) call `#dup` before returning the data + # @option opts [String] :freeze_on_deref (false) call `#freeze` before returning the data + # @option opts [String] :copy_on_deref (nil) call the given `Proc` passing + # the internal value and returning the value returned from the proc + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:48 + def set_deref_options(opts = T.unsafe(nil)); end + + # Set the internal value of this object + # + # @param [Object] value the new value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:31 + def value=(value); end +end + +# Include where logging is needed +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:9 +module Concurrent::Concern::Logging + # Logs through {Concurrent.global_logger}, it can be overridden by setting @logger + # @param [Integer] level one of Concurrent::Concern::Logging constants + # @param [String] progname e.g. a path of an Actor + # @param [String, nil] message when nil block is used to generate the message + # @yieldreturn [String] a message + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:19 + def log(level, progname, message = T.unsafe(nil), &block); end +end + +# The same as Logger::Severity but we copy it here to avoid a dependency on the logger gem just for these 7 constants +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::DEBUG = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::ERROR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::FATAL = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::INFO = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:12 +Concurrent::Concern::Logging::SEV_LABEL = T.let(T.unsafe(nil), Array) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::UNKNOWN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::WARN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:10 +module Concurrent::Concern::Obligation + include ::Concurrent::Concern::Dereferenceable + + # Has the obligation completed processing? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:49 + def complete?; end + + # @example allows Obligation to be risen + # rejected_ivar = Ivar.new.fail + # raise rejected_ivar + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:126 + def exception(*args); end + + # Has the obligation been fulfilled? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:20 + def fulfilled?; end + + # Is the obligation still awaiting completion of processing? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:56 + def incomplete?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:89 + def no_error!(timeout = T.unsafe(nil)); end + + # Is obligation completion still pending? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:35 + def pending?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:23 + def realized?; end + + # If an exception was raised during processing this will return the + # exception object. Will return `nil` when the state is pending or if + # the obligation has been successfully fulfilled. + # + # @return [Exception] the exception raised during processing or `nil` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:119 + def reason; end + + # Has the obligation been rejected? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:28 + def rejected?; end + + # The current state of the obligation. + # + # @return [Symbol] the current state + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:110 + def state; end + + # Is the obligation still unscheduled? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:42 + def unscheduled?; end + + # The current value of the obligation. Will be `nil` while the state is + # pending or the operation has been rejected. + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Object] see Dereferenceable#deref + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:65 + def value(timeout = T.unsafe(nil)); end + + # The current value of the obligation. Will be `nil` while the state is + # pending or the operation has been rejected. Will re-raise any exceptions + # raised during processing (but will not raise an exception on timeout). + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Object] see Dereferenceable#deref + # @raise [Exception] raises the reason when rejected + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:98 + def value!(timeout = T.unsafe(nil)); end + + # Wait until obligation is complete or the timeout has been reached. + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Obligation] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:74 + def wait(timeout = T.unsafe(nil)); end + + # Wait until obligation is complete or the timeout is reached. Will re-raise + # any exceptions raised during processing (but will not raise an exception + # on timeout). + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Obligation] self + # @raise [Exception] raises the reason when rejected + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:86 + def wait!(timeout = T.unsafe(nil)); end + + protected + + # Atomic compare and set operation + # State is set to `next_state` only if `current state == expected_current`. + # + # @param [Symbol] next_state + # @param [Symbol] expected_current + # + # @return [Boolean] true is state is changed, false otherwise + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:174 + def compare_and_set_state(next_state, *expected_current); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:145 + def event; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:134 + def get_arguments_from(opts = T.unsafe(nil)); end + + # Executes the block within mutex if current state is included in expected_states + # + # @return block value if executed, false otherwise + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:190 + def if_state(*expected_states); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:139 + def init_obligation; end + + # Am I in the current state? + # + # @param [Symbol] expected The state to check against + # @return [Boolean] true if in the expected state else false + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:210 + def ns_check_state?(expected); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:215 + def ns_set_state(value); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:150 + def set_state(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:161 + def state=(value); end +end + +# The [observer pattern](http://en.wikipedia.org/wiki/Observer_pattern) is one +# of the most useful design patterns. +# +# The workflow is very simple: +# - an `observer` can register itself to a `subject` via a callback +# - many `observers` can be registered to the same `subject` +# - the `subject` notifies all registered observers when its status changes +# - an `observer` can deregister itself when is no more interested to receive +# event notifications +# +# In a single threaded environment the whole pattern is very easy: the +# `subject` can use a simple data structure to manage all its subscribed +# `observer`s and every `observer` can react directly to every event without +# caring about synchronization. +# +# In a multi threaded environment things are more complex. The `subject` must +# synchronize the access to its data structure and to do so currently we're +# using two specialized ObserverSet: {Concurrent::Concern::CopyOnWriteObserverSet} +# and {Concurrent::Concern::CopyOnNotifyObserverSet}. +# +# When implementing and `observer` there's a very important rule to remember: +# **there are no guarantees about the thread that will execute the callback** +# +# Let's take this example +# ``` +# class Observer +# def initialize +# @count = 0 +# end +# +# def update +# @count += 1 +# end +# end +# +# obs = Observer.new +# [obj1, obj2, obj3, obj4].each { |o| o.add_observer(obs) } +# # execute [obj1, obj2, obj3, obj4] +# ``` +# +# `obs` is wrong because the variable `@count` can be accessed by different +# threads at the same time, so it should be synchronized (using either a Mutex +# or an AtomicFixum) +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:50 +module Concurrent::Concern::Observable + # @!macro observable_add_observer + # + # Adds an observer to this set. If a block is passed, the observer will be + # created by this method and no other params should be passed. + # + # @param [Object] observer the observer to add + # @param [Symbol] func the function to call on the observer during notification. + # Default is :update + # @return [Object] the added observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:61 + def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + # @!macro observable_count_observers + # + # Return the number of observers associated with this object. + # + # @return [Integer] the observers count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:101 + def count_observers; end + + # @!macro observable_delete_observer + # + # Remove `observer` as an observer on this object so that it will no + # longer receive notifications. + # + # @param [Object] observer the observer to remove + # @return [Object] the deleted observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:82 + def delete_observer(observer); end + + # @!macro observable_delete_observers + # + # Remove all observers associated with this object. + # + # @return [Observable] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:91 + def delete_observers; end + + # As `#add_observer` but can be used for chaining. + # + # @param [Object] observer the observer to add + # @param [Symbol] func the function to call on the observer during notification. + # @return [Observable] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:70 + def with_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:107 + def observers; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:107 + def observers=(_arg0); end +end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:70 +class Concurrent::ConcurrentUpdateError < ::ThreadError; end + +# frozen pre-allocated backtrace to speed ConcurrentUpdateError +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:72 +Concurrent::ConcurrentUpdateError::CONC_UP_ERR_BACKTRACE = T.let(T.unsafe(nil), Array) + +# Raised when errors occur during configuration. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:6 +class Concurrent::ConfigurationError < ::Concurrent::Error; end + +# @!macro count_down_latch +# +# A synchronization object that allows one thread to wait on multiple other threads. +# The thread that will wait creates a `CountDownLatch` and sets the initial value +# (normally equal to the number of other threads). The initiating thread passes the +# latch to the other threads then waits for the other threads by calling the `#wait` +# method. Each of the other threads calls `#count_down` when done with its work. +# When the latch counter reaches zero the waiting thread is unblocked and continues +# with its work. A `CountDownLatch` can be used only once. Its value cannot be reset. +# +# @!macro count_down_latch_public_api +# @example Waiter and Decrementer +# latch = Concurrent::CountDownLatch.new(3) +# +# waiter = Thread.new do +# latch.wait() +# puts ("Waiter released") +# end +# +# decrementer = Thread.new do +# sleep(1) +# latch.count_down +# puts latch.count +# +# sleep(1) +# latch.count_down +# puts latch.count +# +# sleep(1) +# latch.count_down +# puts latch.count +# end +# +# [waiter, decrementer].each(&:join) +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb:98 +class Concurrent::CountDownLatch < ::Concurrent::MutexCountDownLatch; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb:56 +Concurrent::CountDownLatchImplementation = Concurrent::MutexCountDownLatch + +# A synchronization aid that allows a set of threads to all wait for each +# other to reach a common barrier point. +# @example +# barrier = Concurrent::CyclicBarrier.new(3) +# jobs = Array.new(3) { |i| -> { sleep i; p done: i } } +# process = -> (i) do +# # waiting to start at the same time +# barrier.wait +# # execute job +# jobs[i].call +# # wait for others to finish +# barrier.wait +# end +# threads = 2.times.map do |i| +# Thread.new(i, &process) +# end +# +# # use main as well +# process.call 2 +# +# # here we can be sure that all jobs are processed +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:27 +class Concurrent::CyclicBarrier < ::Concurrent::Synchronization::LockableObject + # Create a new `CyclicBarrier` that waits for `parties` threads + # + # @param [Fixnum] parties the number of parties + # @yield an optional block that will be executed that will be executed after + # the last thread arrives and before the others are released + # + # @raise [ArgumentError] if `parties` is not an integer or is less than zero + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:40 + def initialize(parties, &block); end + + # A barrier can be broken when: + # - a thread called the `reset` method while at least one other thread was waiting + # - at least one thread timed out on `wait` method + # + # A broken barrier can be restored using `reset` it's safer to create a new one + # @return [Boolean] true if the barrier is broken otherwise false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:105 + def broken?; end + + # @return [Fixnum] the number of threads currently waiting on the barrier + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:54 + def number_waiting; end + + # @return [Fixnum] the number of threads needed to pass the barrier + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:49 + def parties; end + + # resets the barrier to its initial state + # If there is at least one waiting thread, it will be woken up, the `wait` + # method will return false and the barrier will be broken + # If the barrier is broken, this method restores it to the original state + # + # @return [nil] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:95 + def reset; end + + # Blocks on the barrier until the number of waiting threads is equal to + # `parties` or until `timeout` is reached or `reset` is called + # If a block has been passed to the constructor, it will be executed once by + # the last arrived thread before releasing the others + # @param [Fixnum] timeout the number of seconds to wait for the counter or + # `nil` to block indefinitely + # @return [Boolean] `true` if the `count` reaches zero else false on + # `timeout` or on `reset` or if the barrier is broken + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:66 + def wait(timeout = T.unsafe(nil)); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:111 + def ns_generation_done(generation, status, continue = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:122 + def ns_initialize(parties, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:117 + def ns_next_generation; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 +class Concurrent::CyclicBarrier::Generation < ::Struct + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def status; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def status=(_); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def [](*_arg0); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def keyword_init?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def new(*_arg0); end + end +end + +# Lazy evaluation of a block yielding an immutable result. Useful for +# expensive operations that may never be needed. It may be non-blocking, +# supports the `Concern::Obligation` interface, and accepts the injection of +# custom executor upon which to execute the block. Processing of +# block will be deferred until the first time `#value` is called. +# At that time the caller can choose to return immediately and let +# the block execute asynchronously, block indefinitely, or block +# with a timeout. +# +# When a `Delay` is created its state is set to `pending`. The value and +# reason are both `nil`. The first time the `#value` method is called the +# enclosed operation will be run and the calling thread will block. Other +# threads attempting to call `#value` will block as well. Once the operation +# is complete the *value* will be set to the result of the operation or the +# *reason* will be set to the raised exception, as appropriate. All threads +# blocked on `#value` will return. Subsequent calls to `#value` will immediately +# return the cached value. The operation will only be run once. This means that +# any side effects created by the operation will only happen once as well. +# +# `Delay` includes the `Concurrent::Concern::Dereferenceable` mixin to support thread +# safety of the reference returned by `#value`. +# +# @!macro copy_options +# +# @!macro delay_note_regarding_blocking +# @note The default behavior of `Delay` is to block indefinitely when +# calling either `value` or `wait`, executing the delayed operation on +# the current thread. This makes the `timeout` value completely +# irrelevant. To enable non-blocking behavior, use the `executor` +# constructor option. This will cause the delayed operation to be +# execute on the given executor, allowing the call to timeout. +# +# @see Concurrent::Concern::Dereferenceable +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:44 +class Concurrent::Delay < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Dereferenceable + include ::Concurrent::Concern::Obligation + + # Create a new `Delay` in the `:pending` state. + # + # @!macro executor_and_deref_options + # + # @yield the delayed operation to perform + # + # @raise [ArgumentError] if no block is given + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:62 + def initialize(opts = T.unsafe(nil), &block); end + + # Reconfigures the block returning the value if still `#incomplete?` + # + # @yield the delayed operation to perform + # @return [true, false] if success + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:146 + def reconfigure(&block); end + + # Return the value this object represents after applying the options + # specified by the `#set_deref_options` method. If the delayed operation + # raised an exception this method will return nil. The exception object + # can be accessed via the `#reason` method. + # + # @param [Numeric] timeout the maximum number of seconds to wait + # @return [Object] the current value of the object + # + # @!macro delay_note_regarding_blocking + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:77 + def value(timeout = T.unsafe(nil)); end + + # Return the value this object represents after applying the options + # specified by the `#set_deref_options` method. If the delayed operation + # raised an exception, this method will raise that exception (even when) + # the operation has already been executed). + # + # @param [Numeric] timeout the maximum number of seconds to wait + # @return [Object] the current value of the object + # @raise [Exception] when `#rejected?` raises `#reason` + # + # @!macro delay_note_regarding_blocking + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:113 + def value!(timeout = T.unsafe(nil)); end + + # Return the value this object represents after applying the options + # specified by the `#set_deref_options` method. + # + # @param [Integer] timeout (nil) the maximum number of seconds to wait for + # the value to be computed. When `nil` the caller will block indefinitely. + # + # @return [Object] self + # + # @!macro delay_note_regarding_blocking + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:132 + def wait(timeout = T.unsafe(nil)); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:160 + def ns_initialize(opts, &block); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:173 + def execute_task_once; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:7 +class Concurrent::DependencyCounter + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:9 + def initialize(count, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:14 + def update(time, value, reason); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:3 +class Concurrent::Error < ::StandardError; end + +# Old school kernel-style event reminiscent of Win32 programming in C++. +# +# When an `Event` is created it is in the `unset` state. Threads can choose to +# `#wait` on the event, blocking until released by another thread. When one +# thread wants to alert all blocking threads it calls the `#set` method which +# will then wake up all listeners. Once an `Event` has been set it remains set. +# New threads calling `#wait` will return immediately. An `Event` may be +# `#reset` at any time once it has been set. +# +# @see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682655.aspx +# @example +# event = Concurrent::Event.new +# +# t1 = Thread.new do +# puts "t1 is waiting" +# event.wait(1) +# puts "event occurred" +# end +# +# t2 = Thread.new do +# puts "t2 calling set" +# event.set +# end +# +# [t1, t2].each(&:join) +# +# # prints: +# # t1 is waiting +# # t2 calling set +# # event occurred +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:36 +class Concurrent::Event < ::Concurrent::Synchronization::LockableObject + # Creates a new `Event` in the unset state. Threads calling `#wait` on the + # `Event` will block. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:40 + def initialize; end + + # Reset a previously set event back to the `unset` state. + # Has no effect if the `Event` has not yet been set. + # + # @return [Boolean] should always return `true` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:68 + def reset; end + + # Trigger the event, setting the state to `set` and releasing all threads + # waiting on the event. Has no effect if the `Event` has already been set. + # + # @return [Boolean] should always return `true` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:56 + def set; end + + # Is the object in the set state? + # + # @return [Boolean] indicating whether or not the `Event` has been set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:48 + def set?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:60 + def try?; end + + # Wait a given number of seconds for the `Event` to be set by another + # thread. Will wait forever when no `timeout` value is given. Returns + # immediately if the `Event` has already been set. + # + # @return [Boolean] true if the `Event` was set before timeout else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:83 + def wait(timeout = T.unsafe(nil)); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:104 + def ns_initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:96 + def ns_set; end +end + +# @!macro exchanger +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:336 +class Concurrent::Exchanger < ::Concurrent::RubyExchanger; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:327 +Concurrent::ExchangerImplementation = Concurrent::RubyExchanger + +# @!macro executor_service_public_api +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:157 +module Concurrent::ExecutorService + include ::Concurrent::Concern::Logging + + # @!macro executor_service_method_left_shift + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:166 + def <<(task); end + + # @!macro executor_service_method_can_overflow_question + # + # @note Always returns `false` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:174 + def can_overflow?; end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:161 + def post(*args, &task); end + + # @!macro executor_service_method_serialized_question + # + # @note Always returns `false` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:181 + def serialized?; end +end + +# A `FiberLocalVar` is a variable where the value is different for each fiber. +# Each variable may have a default value, but when you modify the variable only +# the current fiber will ever see that change. +# +# This is similar to Ruby's built-in fiber-local variables (`Thread.current[:name]`), +# but with these major advantages: +# * `FiberLocalVar` has its own identity, it doesn't need a Symbol. +# * Each Ruby's built-in fiber-local variable leaks some memory forever (it's a Symbol held forever on the fiber), +# so it's only OK to create a small amount of them. +# `FiberLocalVar` has no such issue and it is fine to create many of them. +# * Ruby's built-in fiber-local variables leak forever the value set on each fiber (unless set to nil explicitly). +# `FiberLocalVar` automatically removes the mapping for each fiber once the `FiberLocalVar` instance is GC'd. +# +# @example +# v = FiberLocalVar.new(14) +# v.value #=> 14 +# v.value = 2 +# v.value #=> 2 +# +# @example +# v = FiberLocalVar.new(14) +# +# Fiber.new do +# v.value #=> 14 +# v.value = 1 +# v.value #=> 1 +# end.resume +# +# Fiber.new do +# v.value #=> 14 +# v.value = 2 +# v.value #=> 2 +# end.resume +# +# v.value #=> 14 +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:41 +class Concurrent::FiberLocalVar + # Creates a fiber local variable. + # + # @param [Object] default the default value when otherwise unset + # @param [Proc] default_block Optional block that gets called to obtain the + # default value for each fiber + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:49 + def initialize(default = T.unsafe(nil), &default_block); end + + # Bind the given value to fiber local storage during + # execution of the given block. + # + # @param [Object] value the value to bind + # @yield the operation to be performed with the bound variable + # @return [Object] the value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:86 + def bind(value); end + + # Returns the value in the current fiber's copy of this fiber-local variable. + # + # @return [Object] the current value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:68 + def value; end + + # Sets the current fiber's copy of this fiber-local variable to the specified value. + # + # @param [Object] value the value to set + # @return [Object] the new value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:76 + def value=(value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:101 + def default; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:42 +Concurrent::FiberLocalVar::LOCALS = T.let(T.unsafe(nil), Concurrent::FiberLocals) + +# @!visibility private +# @!macro internal_implementation_note +# An array-backed storage of indexed variables per fiber. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:166 +class Concurrent::FiberLocals < ::Concurrent::AbstractLocals + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:167 + def locals; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:171 + def locals!; end +end + +# @!macro fixed_thread_pool +# +# A thread pool that reuses a fixed number of threads operating off an unbounded queue. +# At any point, at most `num_threads` will be active processing tasks. When all threads are busy new +# tasks `#post` to the thread pool are enqueued until a thread becomes available. +# Should a thread crash for any reason the thread will immediately be removed +# from the pool and replaced. +# +# The API and behavior of this class are based on Java's `FixedThreadPool` +# +# @!macro thread_pool_options +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb:199 +class Concurrent::FixedThreadPool < ::Concurrent::ThreadPoolExecutor + # @!macro fixed_thread_pool_method_initialize + # + # Create a new thread pool. + # + # @param [Integer] num_threads the number of threads to allocate + # @param [Hash] opts the options defining pool behavior. + # @option opts [Symbol] :fallback_policy (`:abort`) the fallback policy + # + # @raise [ArgumentError] if `num_threads` is less than or equal to zero + # @raise [ArgumentError] if `fallback_policy` is not a known policy + # + # @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool-int- + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb:213 + def initialize(num_threads, opts = T.unsafe(nil)); end +end + +# {include:file:docs-source/future.md} +# +# @!macro copy_options +# +# @see http://ruby-doc.org/stdlib-2.1.1/libdoc/observer/rdoc/Observable.html Ruby Observable module +# @see http://clojuredocs.org/clojure_core/clojure.core/future Clojure's future function +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html java.util.concurrent.Future +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:21 +class Concurrent::Future < ::Concurrent::IVar + # Create a new `Future` in the `:unscheduled` state. + # + # @yield the asynchronous operation to perform + # + # @!macro executor_and_deref_options + # + # @option opts [object, Array] :args zero or more arguments to be passed the task + # block on execution + # + # @raise [ArgumentError] if no block is given + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:33 + def initialize(opts = T.unsafe(nil), &block); end + + # Attempt to cancel the operation if it has not already processed. + # The operation can only be cancelled while still `pending`. It cannot + # be cancelled once it has begun processing or has completed. + # + # @return [Boolean] was the operation successfully cancelled. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:99 + def cancel; end + + # Has the operation been successfully cancelled? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:111 + def cancelled?; end + + # Execute an `:unscheduled` `Future`. Immediately sets the state to `:pending` and + # passes the block to a new thread/thread pool for eventual execution. + # Does nothing if the `Future` is in any state other than `:unscheduled`. + # + # @return [Future] a reference to `self` + # + # @example Instance and execute in separate steps + # future = Concurrent::Future.new{ sleep(1); 42 } + # future.state #=> :unscheduled + # future.execute + # future.state #=> :pending + # + # @example Instance and execute in one line + # future = Concurrent::Future.new{ sleep(1); 42 }.execute + # future.state #=> :pending + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:53 + def execute; end + + # @!macro ivar_set_method + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:82 + def set(value = T.unsafe(nil), &block); end + + # Wait the given number of seconds for the operation to complete. + # On timeout attempt to cancel the operation. + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Boolean] true if the operation completed before the timeout + # else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:121 + def wait_or_cancel(timeout); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:133 + def ns_initialize(value, opts); end + + class << self + # Create a new `Future` object with the given block, execute it, and return the + # `:pending` object. + # + # @yield the asynchronous operation to perform + # + # @!macro executor_and_deref_options + # + # @option opts [object, Array] :args zero or more arguments to be passed the task + # block on execution + # + # @raise [ArgumentError] if no block is given + # + # @return [Future] the newly created `Future` in the `:pending` state + # + # @example + # future = Concurrent::Future.execute{ sleep(1); 42 } + # future.state #=> :pending + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:77 + def execute(opts = T.unsafe(nil), &block); end + end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:18 +Concurrent::GLOBAL_FAST_EXECUTOR = T.let(T.unsafe(nil), Concurrent::Delay) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:30 +Concurrent::GLOBAL_IMMEDIATE_EXECUTOR = T.let(T.unsafe(nil), Concurrent::ImmediateExecutor) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:22 +Concurrent::GLOBAL_IO_EXECUTOR = T.let(T.unsafe(nil), Concurrent::Delay) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:111 +Concurrent::GLOBAL_LOGGER = T.let(T.unsafe(nil), Concurrent::AtomicReference) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:26 +Concurrent::GLOBAL_TIMER_SET = T.let(T.unsafe(nil), Concurrent::Delay) + +# @!macro concurrent_hash +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/hash.rb:49 +class Concurrent::Hash < ::Hash; end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/hash.rb:16 +Concurrent::HashImplementation = Hash + +# An `IVar` is like a future that you can assign. As a future is a value that +# is being computed that you can wait on, an `IVar` is a value that is waiting +# to be assigned, that you can wait on. `IVars` are single assignment and +# deterministic. +# +# Then, express futures as an asynchronous computation that assigns an `IVar`. +# The `IVar` becomes the primitive on which [futures](Future) and +# [dataflow](Dataflow) are built. +# +# An `IVar` is a single-element container that is normally created empty, and +# can only be set once. The I in `IVar` stands for immutable. Reading an +# `IVar` normally blocks until it is set. It is safe to set and read an `IVar` +# from different threads. +# +# If you want to have some parallel task set the value in an `IVar`, you want +# a `Future`. If you want to create a graph of parallel tasks all executed +# when the values they depend on are ready you want `dataflow`. `IVar` is +# generally a low-level primitive. +# +# ## Examples +# +# Create, set and get an `IVar` +# +# ```ruby +# ivar = Concurrent::IVar.new +# ivar.set 14 +# ivar.value #=> 14 +# ivar.set 2 # would now be an error +# ``` +# +# ## See Also +# +# 1. For the theory: Arvind, R. Nikhil, and K. Pingali. +# [I-Structures: Data structures for parallel computing](http://dl.acm.org/citation.cfm?id=69562). +# In Proceedings of Workshop on Graph Reduction, 1986. +# 2. For recent application: +# [DataDrivenFuture in Habanero Java from Rice](http://www.cs.rice.edu/~vs3/hjlib/doc/edu/rice/hj/api/HjDataDrivenFuture.html). +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:48 +class Concurrent::IVar < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Dereferenceable + include ::Concurrent::Concern::Obligation + include ::Concurrent::Concern::Observable + + # Create a new `IVar` in the `:pending` state with the (optional) initial value. + # + # @param [Object] value the initial value + # @param [Hash] opts the options to create a message with + # @option opts [String] :dup_on_deref (false) call `#dup` before returning + # the data + # @option opts [String] :freeze_on_deref (false) call `#freeze` before + # returning the data + # @option opts [String] :copy_on_deref (nil) call the given `Proc` passing + # the internal value and returning the value returned from the proc + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:62 + def initialize(value = T.unsafe(nil), opts = T.unsafe(nil), &block); end + + # Add an observer on this object that will receive notification on update. + # + # Upon completion the `IVar` will notify all observers in a thread-safe way. + # The `func` method of the observer will be called with three arguments: the + # `Time` at which the `Future` completed the asynchronous operation, the + # final `value` (or `nil` on rejection), and the final `reason` (or `nil` on + # fulfillment). + # + # @param [Object] observer the object that will be notified of changes + # @param [Symbol] func symbol naming the method to call when this + # `Observable` has changes` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:81 + def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + # @!macro ivar_fail_method + # Set the `IVar` to failed due to some error and wake or notify all threads waiting on it. + # + # @param [Object] reason for the failure + # @raise [Concurrent::MultipleAssignmentError] if the `IVar` has already + # been set or otherwise completed + # @return [IVar] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:135 + def fail(reason = T.unsafe(nil)); end + + # @!macro ivar_set_method + # Set the `IVar` to a value and wake or notify all threads waiting on it. + # + # @!macro ivar_set_parameters_and_exceptions + # @param [Object] value the value to store in the `IVar` + # @yield A block operation to use for setting the value + # @raise [ArgumentError] if both a value and a block are given + # @raise [Concurrent::MultipleAssignmentError] if the `IVar` has already + # been set or otherwise completed + # + # @return [IVar] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:113 + def set(value = T.unsafe(nil)); end + + # Attempt to set the `IVar` with the given value or block. Return a + # boolean indicating the success or failure of the set operation. + # + # @!macro ivar_set_parameters_and_exceptions + # + # @return [Boolean] true if the value was set else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:145 + def try_set(value = T.unsafe(nil), &block); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:202 + def check_for_block_or_value!(block_given, value); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:177 + def complete(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:184 + def complete_without_notification(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:190 + def notify_observers(value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:195 + def ns_complete_without_notification(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:155 + def ns_initialize(value, opts); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:168 + def safe_execute(task, args = T.unsafe(nil)); end +end + +# Raised when an operation is attempted which is not legal given the +# receiver's current state +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:20 +class Concurrent::IllegalOperationError < ::Concurrent::Error; end + +# An executor service which runs all operations on the current thread, +# blocking as necessary. Operations are performed in the order they are +# received and no two operations can be performed simultaneously. +# +# This executor service exists mainly for testing an debugging. When used +# it immediately runs every `#post` operation on the current thread, blocking +# that thread until the operation is complete. This can be very beneficial +# during testing because it makes all operations deterministic. +# +# @note Intended for use primarily in testing and debugging. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:17 +class Concurrent::ImmediateExecutor < ::Concurrent::AbstractExecutorService + include ::Concurrent::SerialExecutorService + + # Creates a new executor + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:21 + def initialize; end + + # @!macro executor_service_method_left_shift + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:34 + def <<(task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:59 + def kill; end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:26 + def post(*args, &task); end + + # @!macro executor_service_method_running_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:40 + def running?; end + + # @!macro executor_service_method_shutdown + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:55 + def shutdown; end + + # @!macro executor_service_method_shutdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:50 + def shutdown?; end + + # @!macro executor_service_method_shuttingdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:45 + def shuttingdown?; end + + # @!macro executor_service_method_wait_for_termination + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:62 + def wait_for_termination(timeout = T.unsafe(nil)); end +end + +# Raised when an attempt is made to violate an immutability guarantee. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:16 +class Concurrent::ImmutabilityError < ::Concurrent::Error; end + +# A thread-safe, immutable variation of Ruby's standard `Struct`. +# +# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct` +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:9 +module Concurrent::ImmutableStruct + include ::Concurrent::Synchronization::AbstractStruct + + # @!macro struct_equality + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:51 + def ==(other); end + + # @!macro struct_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:46 + def [](member); end + + # @!macro struct_each + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:56 + def each(&block); end + + # @!macro struct_each_pair + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:62 + def each_pair(&block); end + + # @!macro struct_inspect + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:29 + def inspect; end + + # @!macro struct_merge + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:36 + def merge(other, &block); end + + # @!macro struct_select + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:68 + def select(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:21 + def to_a; end + + # @!macro struct_to_h + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:41 + def to_h; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:33 + def to_s; end + + # @!macro struct_values + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:17 + def values; end + + # @!macro struct_values_at + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:24 + def values_at(*indexes); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:76 + def initialize_copy(original); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:12 + def included(base); end + + # @!macro struct_new + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:82 + def new(*args, &block); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:92 +Concurrent::ImmutableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) + +# An executor service which runs all operations on a new thread, blocking +# until it completes. Operations are performed in the order they are received +# and no two operations can be performed simultaneously. +# +# This executor service exists mainly for testing an debugging. When used it +# immediately runs every `#post` operation on a new thread, blocking the +# current thread until the operation is complete. This is similar to how the +# ImmediateExecutor works, but the operation has the full stack of the new +# thread at its disposal. This can be helpful when the operations will spawn +# more operations on the same executor and so on - such a situation might +# overflow the single stack in case of an ImmediateExecutor, which is +# inconsistent with how it would behave for a threaded executor. +# +# @note Intended for use primarily in testing and debugging. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb:19 +class Concurrent::IndirectImmediateExecutor < ::Concurrent::ImmediateExecutor + # Creates a new executor + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb:21 + def initialize; end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb:27 + def post(*args, &task); end +end + +# Raised when an object's methods are called when it has not been +# properly initialized. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:24 +class Concurrent::InitializationError < ::Concurrent::Error; end + +# Raised when a lifecycle method (such as `stop`) is called in an improper +# sequence or when the object is in an inappropriate state. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:13 +class Concurrent::LifecycleError < ::Concurrent::Error; end + +# @!macro warn.edge +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:6 +class Concurrent::LockFreeStack < ::Concurrent::Synchronization::Object + include ::Enumerable + extend ::Concurrent::Synchronization::SafeInitialization + + # @param [Node] head + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:51 + def initialize(head = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def __initialize_atomic_fields__; end + + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:118 + def clear; end + + # @return [self] + # @yield over the cleared stack + # @yieldparam [Object] value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:142 + def clear_each(&block); end + + # @param [Node] head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:128 + def clear_if(head); end + + # @param [Node] head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:99 + def compare_and_clear(head); end + + # @param [Node] head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:85 + def compare_and_pop(head); end + + # @param [Node] head + # @param [Object] value + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:65 + def compare_and_push(head, value); end + + # @param [Node] head + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:107 + def each(head = T.unsafe(nil)); end + + # @param [Node] head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:58 + def empty?(head = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:158 + def inspect; end + + # @return [Node] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:79 + def peek; end + + # @return [Object] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:90 + def pop; end + + # @param [Object] value + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:71 + def push(value); end + + # @param [Node] head + # @param [Node] new_head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:135 + def replace_if(head, new_head); end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:154 + def to_s; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def compare_and_set_head(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def head; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def head=(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def swap_head(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def update_head(&block); end + + class << self + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:41 + def of1(value); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:46 + def of2(value1, value2); end + end +end + +# The singleton for empty node +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:32 +Concurrent::LockFreeStack::EMPTY = T.let(T.unsafe(nil), Concurrent::LockFreeStack::Node) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:10 +class Concurrent::LockFreeStack::Node + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:23 + def initialize(value, next_node); end + + # @return [Node] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:14 + def next_node; end + + # @return [Object] + # @!visibility private + # allow to nil-ify to free GC when the entry is no longer relevant, not synchronised + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:17 + def value; end + + # @return [Object] + # @!visibility private + # allow to nil-ify to free GC when the entry is no longer relevant, not synchronised + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:21 + def value=(_arg0); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:28 + def [](*_arg0); end + end +end + +# Either {FiberLocalVar} or {ThreadLocalVar} depending on whether Mutex (and Monitor) +# are held, respectively, per Fiber or per Thread. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:22 +Concurrent::LockLocalVar = Concurrent::FiberLocalVar + +# An `MVar` is a synchronized single element container. They are empty or +# contain one item. Taking a value from an empty `MVar` blocks, as does +# putting a value into a full one. You can either think of them as blocking +# queue of length one, or a special kind of mutable variable. +# +# On top of the fundamental `#put` and `#take` operations, we also provide a +# `#modify` that is atomic with respect to operations on the same instance. +# These operations all support timeouts. +# +# We also support non-blocking operations `#try_put!` and `#try_take!`, a +# `#set!` that ignores existing values, a `#value` that returns the value +# without removing it or returns `MVar::EMPTY`, and a `#modify!` that yields +# `MVar::EMPTY` if the `MVar` is empty and can be used to set `MVar::EMPTY`. +# You shouldn't use these operations in the first instance. +# +# `MVar` is a [Dereferenceable](Dereferenceable). +# +# `MVar` is related to M-structures in Id, `MVar` in Haskell and `SyncVar` in Scala. +# +# Note that unlike the original Haskell paper, our `#take` is blocking. This is how +# Haskell and Scala do it today. +# +# @!macro copy_options +# +# ## See Also +# +# 1. P. Barth, R. Nikhil, and Arvind. [M-Structures: Extending a parallel, non- strict, functional language with state](http://dl.acm.org/citation.cfm?id=652538). In Proceedings of the 5th +# ACM Conference on Functional Programming Languages and Computer Architecture (FPCA), 1991. +# +# 2. S. Peyton Jones, A. Gordon, and S. Finne. [Concurrent Haskell](http://dl.acm.org/citation.cfm?id=237794). +# In Proceedings of the 23rd Symposium on Principles of Programming Languages +# (PoPL), 1996. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:38 +class Concurrent::MVar < ::Concurrent::Synchronization::Object + include ::Concurrent::Concern::Dereferenceable + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `MVar`, either empty or with an initial value. + # + # @param [Hash] opts the options controlling how the future will be processed + # + # @!macro deref_options + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:54 + def initialize(value = T.unsafe(nil), opts = T.unsafe(nil)); end + + # acquires lock on the from an `MVAR`, yields the value to provided block, + # and release lock. A timeout can be set to limit the time spent blocked, + # in which case it returns `TIMEOUT` if the time is exceeded. + # @return [Object] the value returned by the block, or `TIMEOUT` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:86 + def borrow(timeout = T.unsafe(nil)); end + + # Returns if the `MVar` is currently empty. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:195 + def empty?; end + + # Returns if the `MVar` currently contains a value. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:200 + def full?; end + + # Atomically `take`, yield the value to a block for transformation, and then + # `put` the transformed value. Returns the pre-transform value. A timeout can + # be set to limit the time spent blocked, in which case it returns `TIMEOUT` + # if the time is exceeded. + # @return [Object] the pre-transform value, or `TIMEOUT` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:123 + def modify(timeout = T.unsafe(nil)); end + + # Non-blocking version of `modify` that will yield with `EMPTY` if there is no value yet. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:179 + def modify!; end + + # Put a value into an `MVar`, blocking if there is already a value until + # it is empty. A timeout can be set to limit the time spent blocked, in + # which case it returns `TIMEOUT` if the time is exceeded. + # @return [Object] the value that was put, or `TIMEOUT` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:103 + def put(value, timeout = T.unsafe(nil)); end + + # Non-blocking version of `put` that will overwrite an existing value. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:169 + def set!(value); end + + # Remove the value from an `MVar`, leaving it empty, and blocking if there + # isn't a value. A timeout can be set to limit the time spent blocked, in + # which case it returns `TIMEOUT` if the time is exceeded. + # @return [Object] the value that was taken, or `TIMEOUT` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:66 + def take(timeout = T.unsafe(nil)); end + + # Non-blocking version of `put`, that returns whether or not it was successful. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:156 + def try_put!(value); end + + # Non-blocking version of `take`, that returns `EMPTY` instead of blocking. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:142 + def try_take!; end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:206 + def synchronize(&block); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:212 + def unlocked_empty?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:216 + def unlocked_full?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:224 + def wait_for_empty(timeout); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:220 + def wait_for_full(timeout); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:228 + def wait_while(condition, timeout); end +end + +# Unique value that represents that an `MVar` was empty +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:43 +Concurrent::MVar::EMPTY = T.let(T.unsafe(nil), Object) + +# Unique value that represents that an `MVar` timed out before it was able +# to produce a value. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:47 +Concurrent::MVar::TIMEOUT = T.let(T.unsafe(nil), Object) + +# `Concurrent::Map` is a hash-like object and should have much better performance +# characteristics, especially under high concurrency, than `Concurrent::Hash`. +# However, `Concurrent::Map `is not strictly semantically equivalent to a ruby `Hash` +# -- for instance, it does not necessarily retain ordering by insertion time as `Hash` +# does. For most uses it should do fine though, and we recommend you consider +# `Concurrent::Map` instead of `Concurrent::Hash` for your concurrency-safe hash needs. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:39 +class Concurrent::Map < ::Concurrent::Collection::MriMapBackend + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:279 + def each; end + + # Iterates over each key. + # @yield for each key in the map + # @yieldparam key [Object] + # @return [self] + # @!macro map.atomic_method_with_block + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:255 + def each_key; end + + # Iterates over each key value pair. + # @yield for each key value pair in the map + # @yieldparam key [Object] + # @yieldparam value [Object] + # @return [self] + # @!macro map.atomic_method_with_block + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:274 + def each_pair; end + + # Iterates over each value. + # @yield for each value in the map + # @yieldparam value [Object] + # @return [self] + # @!macro map.atomic_method_with_block + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:264 + def each_value; end + + # Is map empty? + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:291 + def empty?; end + + # Get a value with key, or default_value when key is absent, + # or fail when no default_value is given. + # @param [Object] key + # @param [Object] default_value + # @yield default value for a key + # @yieldparam key [Object] + # @yieldreturn [Object] default value + # @return [Object] the value or default value + # @raise [KeyError] when key is missing and no default_value is provided + # @!macro map_method_not_atomic + # @note The "fetch-then-act" methods of `Map` are not atomic. `Map` is intended + # to be use as a concurrency primitive with strong happens-before + # guarantees. It is not intended to be used as a high-level abstraction + # supporting complex operations. All read and write operations are + # thread safe, but no guarantees are made regarding race conditions + # between the fetch operation and yielding to the block. Additionally, + # this method does not support recursion. This is due to internal + # constraints that are very unlikely to change in the near future. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:183 + def fetch(key, default_value = T.unsafe(nil)); end + + # Fetch value with key, or store default value when key is absent, + # or fail when no default_value is given. This is a two step operation, + # therefore not atomic. The store can overwrite other concurrently + # stored value. + # @param [Object] key + # @param [Object] default_value + # @yield default value for a key + # @yieldparam key [Object] + # @yieldreturn [Object] default value + # @return [Object] the value or default value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:205 + def fetch_or_store(key, default_value = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:162 + def get(key); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:321 + def inspect; end + + # Find key of a value. + # @param [Object] value + # @return [Object, nil] key or nil when not found + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:284 + def key(value); end + + # All keys + # @return [::Array] keys + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:236 + def keys; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:305 + def marshal_dump; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:313 + def marshal_load(hash); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:163 + def put(key, value); end + + # Insert value into map with key if key is absent in one atomic step. + # @param [Object] key + # @param [Object] value + # @return [Object, nil] the previous value when key was present or nil when there was no key + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:215 + def put_if_absent(key, value); end + + # Is the value stored in the map. Iterates over all values. + # @param [Object] value + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:227 + def value?(value); end + + # All values + # @return [::Array] values + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:244 + def values; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:331 + def initialize_copy(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:336 + def populate_from(hash); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:327 + def raise_fetch_no_key; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:341 + def validate_options_hash!(options); end +end + +# Raised when an object with a start/stop lifecycle has been started an +# excessive number of times. Often used in conjunction with a restart +# policy or strategy. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:29 +class Concurrent::MaxRestartFrequencyError < ::Concurrent::Error; end + +# A `Maybe` encapsulates an optional value. A `Maybe` either contains a value +# of (represented as `Just`), or it is empty (represented as `Nothing`). Using +# `Maybe` is a good way to deal with errors or exceptional cases without +# resorting to drastic measures such as exceptions. +# +# `Maybe` is a replacement for the use of `nil` with better type checking. +# +# For compatibility with {Concurrent::Concern::Obligation} the predicate and +# accessor methods are aliased as `fulfilled?`, `rejected?`, `value`, and +# `reason`. +# +# ## Motivation +# +# A common pattern in languages with pattern matching, such as Erlang and +# Haskell, is to return *either* a value *or* an error from a function +# Consider this Erlang code: +# +# ```erlang +# case file:consult("data.dat") of +# {ok, Terms} -> do_something_useful(Terms); +# {error, Reason} -> lager:error(Reason) +# end. +# ``` +# +# In this example the standard library function `file:consult` returns a +# [tuple](http://erlang.org/doc/reference_manual/data_types.html#id69044) +# with two elements: an [atom](http://erlang.org/doc/reference_manual/data_types.html#id64134) +# (similar to a ruby symbol) and a variable containing ancillary data. On +# success it returns the atom `ok` and the data from the file. On failure it +# returns `error` and a string with an explanation of the problem. With this +# pattern there is no ambiguity regarding success or failure. If the file is +# empty the return value cannot be misinterpreted as an error. And when an +# error occurs the return value provides useful information. +# +# In Ruby we tend to return `nil` when an error occurs or else we raise an +# exception. Both of these idioms are problematic. Returning `nil` is +# ambiguous because `nil` may also be a valid value. It also lacks +# information pertaining to the nature of the error. Raising an exception +# is both expensive and usurps the normal flow of control. All of these +# problems can be solved with the use of a `Maybe`. +# +# A `Maybe` is unambiguous with regard to whether or not it contains a value. +# When `Just` it contains a value, when `Nothing` it does not. When `Just` +# the value it contains may be `nil`, which is perfectly valid. When +# `Nothing` the reason for the lack of a value is contained as well. The +# previous Erlang example can be duplicated in Ruby in a principled way by +# having functions return `Maybe` objects: +# +# ```ruby +# result = MyFileUtils.consult("data.dat") # returns a Maybe +# if result.just? +# do_something_useful(result.value) # or result.just +# else +# logger.error(result.reason) # or result.nothing +# end +# ``` +# +# @example Returning a Maybe from a Function +# module MyFileUtils +# def self.consult(path) +# file = File.open(path, 'r') +# Concurrent::Maybe.just(file.read) +# rescue => ex +# return Concurrent::Maybe.nothing(ex) +# ensure +# file.close if file +# end +# end +# +# maybe = MyFileUtils.consult('bogus.file') +# maybe.just? #=> false +# maybe.nothing? #=> true +# maybe.reason #=> # +# +# maybe = MyFileUtils.consult('README.md') +# maybe.just? #=> true +# maybe.nothing? #=> false +# maybe.value #=> "# Concurrent Ruby\n[![Gem Version..." +# +# @example Using Maybe with a Block +# result = Concurrent::Maybe.from do +# Client.find(10) # Client is an ActiveRecord model +# end +# +# # -- if the record was found +# result.just? #=> true +# result.value #=> # +# +# # -- if the record was not found +# result.just? #=> false +# result.reason #=> ActiveRecord::RecordNotFound +# +# @example Using Maybe with the Null Object Pattern +# # In a Rails controller... +# result = ClientService.new(10).find # returns a Maybe +# render json: result.or(NullClient.new) +# +# @see https://hackage.haskell.org/package/base-4.2.0.1/docs/Data-Maybe.html Haskell Data.Maybe +# @see https://github.com/purescript/purescript-maybe/blob/master/docs/Data.Maybe.md PureScript Data.Maybe +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:104 +class Concurrent::Maybe < ::Concurrent::Synchronization::Object + include ::Comparable + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `Maybe` with the given attributes. + # + # @param [Object] just The value when `Just` else `NONE`. + # @param [Exception, Object] nothing The exception when `Nothing` else `NONE`. + # + # @return [Maybe] The new `Maybe`. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:224 + def initialize(just, nothing); end + + # Comparison operator. + # + # @return [Integer] 0 if self and other are both `Nothing`; + # -1 if self is `Nothing` and other is `Just`; + # 1 if self is `Just` and other is nothing; + # `self.just <=> other.just` if both self and other are `Just`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:199 + def <=>(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:179 + def fulfilled?; end + + # The value of a `Maybe` when `Just`. Will be `NONE` when `Nothing`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:114 + def just; end + + # Is this `Maybe` a `Just` (successfully fulfilled with a value)? + # + # @return [Boolean] True if `Just` or false if `Nothing`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:176 + def just?; end + + # The reason for the `Maybe` when `Nothing`. Will be `NONE` when `Just`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:117 + def nothing; end + + # Is this `Maybe` a `nothing` (rejected with an exception upon fulfillment)? + # + # @return [Boolean] True if `Nothing` or false if `Just`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:184 + def nothing?; end + + # Return either the value of self or the given default value. + # + # @return [Object] The value of self when `Just`; else the given default. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:210 + def or(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:191 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:187 + def rejected?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:189 + def value; end + + class << self + # Create a new `Maybe` using the given block. + # + # Runs the given block passing all function arguments to the block as block + # arguments. If the block runs to completion without raising an exception + # a new `Just` is created with the value set to the return value of the + # block. If the block raises an exception a new `Nothing` is created with + # the reason being set to the raised exception. + # + # @param [Array] args Zero or more arguments to pass to the block. + # @yield The block from which to create a new `Maybe`. + # @yieldparam [Array] args Zero or more block arguments passed as + # arguments to the function. + # + # @return [Maybe] The newly created object. + # + # @raise [ArgumentError] when no block given. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:137 + def from(*args); end + + # Create a new `Just` with the given value. + # + # @param [Object] value The value to set for the new `Maybe` object. + # + # @return [Maybe] The newly created object. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:152 + def just(value); end + + # Create a new `Nothing` with the given (optional) reason. + # + # @param [Exception] error The reason to set for the new `Maybe` object. + # When given a string a new `StandardError` will be created with the + # argument as the message. When no argument is given a new + # `StandardError` with an empty message will be created. + # + # @return [Maybe] The newly created object. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:164 + def nothing(error = T.unsafe(nil)); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:119 + def new(*args, &block); end + end +end + +# Indicates that the given attribute has not been set. +# When `Just` the {#nothing} getter will return `NONE`. +# When `Nothing` the {#just} getter will return `NONE`. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:111 +Concurrent::Maybe::NONE = T.let(T.unsafe(nil), Object) + +# Raised when an attempt is made to modify an immutable object +# (such as an `IVar`) after its final state has been set. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:33 +class Concurrent::MultipleAssignmentError < ::Concurrent::Error + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:36 + def initialize(message = T.unsafe(nil), inspection_data = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:41 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:34 + def inspection_data; end +end + +# Aggregates multiple exceptions. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:58 +class Concurrent::MultipleErrors < ::Concurrent::Error + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:61 + def initialize(errors, message = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:59 + def errors; end +end + +# An thread-safe variation of Ruby's standard `Struct`. Values can be set at +# construction or safely changed at any time during the object's lifecycle. +# +# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct` +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:10 +module Concurrent::MutableStruct + include ::Concurrent::Synchronization::AbstractStruct + + # @!macro struct_equality + # + # Equality + # + # @return [Boolean] true if other has the same struct subclass and has + # equal member values (according to `Object#==`) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:128 + def ==(other); end + + # @!macro struct_get + # + # Attribute Reference + # + # @param [Symbol, String, Integer] member the string or symbol name of the member + # for which to obtain the value or the member's index + # + # @return [Object] the value of the given struct member or the member at the given index. + # + # @raise [NameError] if the member does not exist + # @raise [IndexError] if the index is out of range. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:118 + def [](member); end + + # @!macro struct_set + # + # Attribute Assignment + # + # Sets the value of the given struct member or the member at the given index. + # + # @param [Symbol, String, Integer] member the string or symbol name of the member + # for which to obtain the value or the member's index + # + # @return [Object] the value of the given struct member or the member at the given index. + # + # @raise [NameError] if the name does not exist + # @raise [IndexError] if the index is out of range. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:185 + def []=(member, value); end + + # @!macro struct_each + # + # Yields the value of each struct member in order. If no block is given + # an enumerator is returned. + # + # @yield the operation to be performed on each struct member + # @yieldparam [Object] value each struct value (in order) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:139 + def each(&block); end + + # @!macro struct_each_pair + # + # Yields the name and value of each struct member in order. If no block is + # given an enumerator is returned. + # + # @yield the operation to be performed on each struct member/value pair + # @yieldparam [Object] member each struct member (in order) + # @yieldparam [Object] value each struct value (in order) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:152 + def each_pair(&block); end + + # @!macro struct_inspect + # + # Describe the contents of this struct in a string. + # + # @return [String] the contents of this struct in a string + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:72 + def inspect; end + + # @!macro struct_merge + # + # Returns a new struct containing the contents of `other` and the contents + # of `self`. If no block is specified, the value for entries with duplicate + # keys will be that of `other`. Otherwise the value for each duplicate key + # is determined by calling the block with the key, its value in `self` and + # its value in `other`. + # + # @param [Hash] other the hash from which to set the new values + # @yield an options block for resolving duplicate keys + # @yieldparam [String, Symbol] member the name of the member which is duplicated + # @yieldparam [Object] selfvalue the value of the member in `self` + # @yieldparam [Object] othervalue the value of the member in `other` + # + # @return [Synchronization::AbstractStruct] a new struct with the new values + # + # @raise [ArgumentError] of given a member that is not defined in the struct + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:94 + def merge(other, &block); end + + # @!macro struct_select + # + # Yields each member value from the struct to the block and returns an Array + # containing the member values from the struct for which the given block + # returns a true value (equivalent to `Enumerable#select`). + # + # @yield the operation to be performed on each struct member + # @yieldparam [Object] value each struct value (in order) + # + # @return [Array] an array containing each value for which the block returns true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:167 + def select(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:54 + def to_a; end + + # @!macro struct_to_h + # + # Returns a hash containing the names and values for the struct’s members. + # + # @return [Hash] the names and values for the struct’s members + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:103 + def to_h; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:75 + def to_s; end + + # @!macro struct_values + # + # Returns the values for this struct as an Array. + # + # @return [Array] the values for this struct + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:51 + def values; end + + # @!macro struct_values_at + # + # Returns the struct member values for each selector as an Array. + # + # A selector may be either an Integer offset or a Range of offsets (as in `Array#values_at`). + # + # @param [Fixnum, Range] indexes the index(es) from which to obatin the values (in order) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:63 + def values_at(*indexes); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:202 + def initialize_copy(original); end + + class << self + # @!macro struct_new + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:210 + def new(*args, &block); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:220 +Concurrent::MutableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) + +# @!macro atomic_boolean +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:8 +class Concurrent::MutexAtomicBoolean + extend ::Concurrent::Synchronization::SafeInitialization + + # @!macro atomic_boolean_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:12 + def initialize(initial = T.unsafe(nil)); end + + # @!macro atomic_boolean_method_false_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:34 + def false?; end + + # @!macro atomic_boolean_method_make_false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:44 + def make_false; end + + # @!macro atomic_boolean_method_make_true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:39 + def make_true; end + + # @!macro atomic_boolean_method_true_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:29 + def true?; end + + # @!macro atomic_boolean_method_value_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:19 + def value; end + + # @!macro atomic_boolean_method_value_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:24 + def value=(value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:51 + def synchronize; end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:62 + def ns_make_value(value); end +end + +# @!macro atomic_fixnum +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:9 +class Concurrent::MutexAtomicFixnum + extend ::Concurrent::Synchronization::SafeInitialization + + # @!macro atomic_fixnum_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:13 + def initialize(initial = T.unsafe(nil)); end + + # @!macro atomic_fixnum_method_compare_and_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:44 + def compare_and_set(expect, update); end + + # @!macro atomic_fixnum_method_decrement + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:37 + def decrement(delta = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:41 + def down(delta = T.unsafe(nil)); end + + # @!macro atomic_fixnum_method_increment + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:30 + def increment(delta = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:34 + def up(delta = T.unsafe(nil)); end + + # @!macro atomic_fixnum_method_update + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:56 + def update; end + + # @!macro atomic_fixnum_method_value_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:20 + def value; end + + # @!macro atomic_fixnum_method_value_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:25 + def value=(value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:65 + def synchronize; end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:76 + def ns_set(value); end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:9 +class Concurrent::MutexAtomicReference + include ::Concurrent::AtomicDirectUpdate + include ::Concurrent::AtomicNumericCompareAndSetWrapper + extend ::Concurrent::Synchronization::SafeInitialization + + # @!macro atomic_reference_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:16 + def initialize(value = T.unsafe(nil)); end + + # @!macro atomic_reference_method_compare_and_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:45 + def _compare_and_set(old_value, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:13 + def compare_and_swap(old_value, new_value); end + + # @!macro atomic_reference_method_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:23 + def get; end + + # @!macro atomic_reference_method_get_and_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:35 + def get_and_set(new_value); end + + # @!macro atomic_reference_method_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:29 + def set(new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:42 + def swap(new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:26 + def value; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:32 + def value=(new_value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:59 + def synchronize; end +end + +# @!macro count_down_latch +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:9 +class Concurrent::MutexCountDownLatch < ::Concurrent::Synchronization::LockableObject + # @!macro count_down_latch_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:12 + def initialize(count = T.unsafe(nil)); end + + # @!macro count_down_latch_method_count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:34 + def count; end + + # @!macro count_down_latch_method_count_down + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:26 + def count_down; end + + # @!macro count_down_latch_method_wait + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:21 + def wait(timeout = T.unsafe(nil)); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:40 + def ns_initialize(count); end +end + +# @!macro semaphore +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:9 +class Concurrent::MutexSemaphore < ::Concurrent::Synchronization::LockableObject + # @!macro semaphore_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:12 + def initialize(count); end + + # @!macro semaphore_method_acquire + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:20 + def acquire(permits = T.unsafe(nil)); end + + # @!macro semaphore_method_available_permits + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:38 + def available_permits; end + + # @!macro semaphore_method_drain_permits + # + # Acquires and returns all permits that are immediately available. + # + # @return [Integer] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:47 + def drain_permits; end + + # Shrinks the number of available permits by the indicated reduction. + # + # @param [Fixnum] reduction Number of permits to remove. + # + # @raise [ArgumentError] if `reduction` is not an integer or is negative + # + # @raise [ArgumentError] if `@free` - `@reduction` is less than zero + # + # @return [nil] + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:99 + def reduce_permits(reduction); end + + # @!macro semaphore_method_release + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:77 + def release(permits = T.unsafe(nil)); end + + # @!macro semaphore_method_try_acquire + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:54 + def try_acquire(permits = T.unsafe(nil), timeout = T.unsafe(nil)); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:110 + def ns_initialize(count); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:117 + def try_acquire_now(permits); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:127 + def try_acquire_timed(permits, timeout); end +end + +# Various classes within allows for +nil+ values to be stored, +# so a special +NULL+ token is required to indicate the "nil-ness". +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/constants.rb:6 +Concurrent::NULL = T.let(T.unsafe(nil), Object) + +# Suppresses all output when used for logging. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:108 +Concurrent::NULL_LOGGER = T.let(T.unsafe(nil), Proc) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/options.rb:6 +module Concurrent::Options + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/options.rb:27 + def executor(executor_identifier); end + + # Get the requested `Executor` based on the values set in the options hash. + # + # @param [Hash] opts the options defining the requested executor + # @option opts [Executor] :executor when set use the given `Executor` instance. + # Three special values are also supported: `:fast` returns the global fast executor, + # `:io` returns the global io executor, and `:immediate` returns a new + # `ImmediateExecutor` object. + # + # @return [Executor, nil] the requested thread pool, or nil when no option specified + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/options.rb:19 + def executor_from_options(opts = T.unsafe(nil)); end + end +end + +# Promises are inspired by the JavaScript [Promises/A](http://wiki.commonjs.org/wiki/Promises/A) +# and [Promises/A+](http://promises-aplus.github.io/promises-spec/) specifications. +# +# > A promise represents the eventual value returned from the single +# > completion of an operation. +# +# Promises are similar to futures and share many of the same behaviours. +# Promises are far more robust, however. Promises can be chained in a tree +# structure where each promise may have zero or more children. Promises are +# chained using the `then` method. The result of a call to `then` is always +# another promise. Promises are resolved asynchronously (with respect to the +# main thread) but in a strict order: parents are guaranteed to be resolved +# before their children, children before their younger siblings. The `then` +# method takes two parameters: an optional block to be executed upon parent +# resolution and an optional callable to be executed upon parent failure. The +# result of each promise is passed to each of its children upon resolution. +# When a promise is rejected all its children will be summarily rejected and +# will receive the reason. +# +# Promises have several possible states: *:unscheduled*, *:pending*, +# *:processing*, *:rejected*, or *:fulfilled*. These are also aggregated as +# `#incomplete?` and `#complete?`. When a Promise is created it is set to +# *:unscheduled*. Once the `#execute` method is called the state becomes +# *:pending*. Once a job is pulled from the thread pool's queue and is given +# to a thread for processing (often immediately upon `#post`) the state +# becomes *:processing*. The future will remain in this state until processing +# is complete. A future that is in the *:unscheduled*, *:pending*, or +# *:processing* is considered `#incomplete?`. A `#complete?` Promise is either +# *:rejected*, indicating that an exception was thrown during processing, or +# *:fulfilled*, indicating success. If a Promise is *:fulfilled* its `#value` +# will be updated to reflect the result of the operation. If *:rejected* the +# `reason` will be updated with a reference to the thrown exception. The +# predicate methods `#unscheduled?`, `#pending?`, `#rejected?`, and +# `#fulfilled?` can be called at any time to obtain the state of the Promise, +# as can the `#state` method, which returns a symbol. +# +# Retrieving the value of a promise is done through the `value` (alias: +# `deref`) method. Obtaining the value of a promise is a potentially blocking +# operation. When a promise is *rejected* a call to `value` will return `nil` +# immediately. When a promise is *fulfilled* a call to `value` will +# immediately return the current value. When a promise is *pending* a call to +# `value` will block until the promise is either *rejected* or *fulfilled*. A +# *timeout* value can be passed to `value` to limit how long the call will +# block. If `nil` the call will block indefinitely. If `0` the call will not +# block. Any other integer or float value will indicate the maximum number of +# seconds to block. +# +# Promises run on the global thread pool. +# +# @!macro copy_options +# +# ### Examples +# +# Start by requiring promises +# +# ```ruby +# require 'concurrent/promise' +# ``` +# +# Then create one +# +# ```ruby +# p = Concurrent::Promise.execute do +# # do something +# 42 +# end +# ``` +# +# Promises can be chained using the `then` method. The `then` method accepts a +# block and an executor, to be executed on fulfillment, and a callable argument to be executed +# on rejection. The result of the each promise is passed as the block argument +# to chained promises. +# +# ```ruby +# p = Concurrent::Promise.new{10}.then{|x| x * 2}.then{|result| result - 10 }.execute +# ``` +# +# And so on, and so on, and so on... +# +# ```ruby +# p = Concurrent::Promise.fulfill(20). +# then{|result| result - 10 }. +# then{|result| result * 3 }. +# then(executor: different_executor){|result| result % 5 }.execute +# ``` +# +# The initial state of a newly created Promise depends on the state of its parent: +# - if parent is *unscheduled* the child will be *unscheduled* +# - if parent is *pending* the child will be *pending* +# - if parent is *fulfilled* the child will be *pending* +# - if parent is *rejected* the child will be *pending* (but will ultimately be *rejected*) +# +# Promises are executed asynchronously from the main thread. By the time a +# child Promise finishes initialization it may be in a different state than its +# parent (by the time a child is created its parent may have completed +# execution and changed state). Despite being asynchronous, however, the order +# of execution of Promise objects in a chain (or tree) is strictly defined. +# +# There are multiple ways to create and execute a new `Promise`. Both ways +# provide identical behavior: +# +# ```ruby +# # create, operate, then execute +# p1 = Concurrent::Promise.new{ "Hello World!" } +# p1.state #=> :unscheduled +# p1.execute +# +# # create and immediately execute +# p2 = Concurrent::Promise.new{ "Hello World!" }.execute +# +# # execute during creation +# p3 = Concurrent::Promise.execute{ "Hello World!" } +# ``` +# +# Once the `execute` method is called a `Promise` becomes `pending`: +# +# ```ruby +# p = Concurrent::Promise.execute{ "Hello, world!" } +# p.state #=> :pending +# p.pending? #=> true +# ``` +# +# Wait a little bit, and the promise will resolve and provide a value: +# +# ```ruby +# p = Concurrent::Promise.execute{ "Hello, world!" } +# sleep(0.1) +# +# p.state #=> :fulfilled +# p.fulfilled? #=> true +# p.value #=> "Hello, world!" +# ``` +# +# If an exception occurs, the promise will be rejected and will provide +# a reason for the rejection: +# +# ```ruby +# p = Concurrent::Promise.execute{ raise StandardError.new("Here comes the Boom!") } +# sleep(0.1) +# +# p.state #=> :rejected +# p.rejected? #=> true +# p.reason #=> "#" +# ``` +# +# #### Rejection +# +# When a promise is rejected all its children will be rejected and will +# receive the rejection `reason` as the rejection callable parameter: +# +# ```ruby +# p = Concurrent::Promise.execute { Thread.pass; raise StandardError } +# +# c1 = p.then(-> reason { 42 }) +# c2 = p.then(-> reason { raise 'Boom!' }) +# +# c1.wait.state #=> :fulfilled +# c1.value #=> 42 +# c2.wait.state #=> :rejected +# c2.reason #=> # +# ``` +# +# Once a promise is rejected it will continue to accept children that will +# receive immediately rejection (they will be executed asynchronously). +# +# #### Aliases +# +# The `then` method is the most generic alias: it accepts a block to be +# executed upon parent fulfillment and a callable to be executed upon parent +# rejection. At least one of them should be passed. The default block is `{ +# |result| result }` that fulfills the child with the parent value. The +# default callable is `{ |reason| raise reason }` that rejects the child with +# the parent reason. +# +# - `on_success { |result| ... }` is the same as `then {|result| ... }` +# - `rescue { |reason| ... }` is the same as `then(Proc.new { |reason| ... } )` +# - `rescue` is aliased by `catch` and `on_error` +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:190 +class Concurrent::Promise < ::Concurrent::IVar + # Initialize a new Promise with the provided options. + # + # @!macro executor_and_deref_options + # + # @!macro promise_init_options + # + # @option opts [Promise] :parent the parent `Promise` when building a chain/tree + # @option opts [Proc] :on_fulfill fulfillment handler + # @option opts [Proc] :on_reject rejection handler + # @option opts [object, Array] :args zero or more arguments to be passed + # the task block on execution + # + # @yield The block operation to be performed asynchronously. + # + # @raise [ArgumentError] if no block is given + # + # @see http://wiki.commonjs.org/wiki/Promises/A + # @see http://promises-aplus.github.io/promises-spec/ + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:210 + def initialize(opts = T.unsafe(nil), &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:364 + def catch(&block); end + + # Execute an `:unscheduled` `Promise`. Immediately sets the state to `:pending` and + # passes the block to a new thread/thread pool for eventual execution. + # Does nothing if the `Promise` is in any state other than `:unscheduled`. + # + # @return [Promise] a reference to `self` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:246 + def execute; end + + # @!macro ivar_fail_method + # + # @raise [Concurrent::PromiseExecutionError] if not the root promise + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:278 + def fail(reason = T.unsafe(nil)); end + + # Yield the successful result to the block that returns a promise. If that + # promise is also successful the result is the result of the yielded promise. + # If either part fails the whole also fails. + # + # @example + # Promise.execute { 1 }.flat_map { |v| Promise.execute { v + 2 } }.value! #=> 3 + # + # @return [Promise] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:375 + def flat_map(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:365 + def on_error(&block); end + + # Chain onto this promise an action to be undertaken on success + # (fulfillment). + # + # @yield The block to execute + # + # @return [Promise] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:349 + def on_success(&block); end + + # Chain onto this promise an action to be undertaken on failure + # (rejection). + # + # @yield The block to execute + # + # @return [Promise] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:360 + def rescue(&block); end + + # @!macro ivar_set_method + # + # @raise [Concurrent::PromiseExecutionError] if not the root promise + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:262 + def set(value = T.unsafe(nil), &block); end + + # Chain a new promise off the current promise. + # + # @return [Promise] the new promise + # @yield The block operation to be performed asynchronously. + # @overload then(rescuer, executor, &block) + # @param [Proc] rescuer An optional rescue block to be executed if the + # promise is rejected. + # @param [ThreadPool] executor An optional thread pool executor to be used + # in the new Promise + # @overload then(rescuer, executor: executor, &block) + # @param [Proc] rescuer An optional rescue block to be executed if the + # promise is rejected. + # @param [ThreadPool] executor An optional thread pool executor to be used + # in the new Promise + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:314 + def then(*args, &block); end + + # Builds a promise that produces the result of self and others in an Array + # and fails if any of them fails. + # + # @overload zip(*promises) + # @param [Array] others + # + # @overload zip(*promises, opts) + # @param [Array] others + # @param [Hash] opts the configuration options + # @option opts [Executor] :executor (ImmediateExecutor.new) when set use the given `Executor` instance. + # @option opts [Boolean] :execute (true) execute promise before returning + # + # @return [Promise] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:440 + def zip(*others); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:551 + def complete(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:545 + def notify_child(child); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:481 + def ns_initialize(value, opts); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:533 + def on_fulfill(result); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:539 + def on_reject(reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:562 + def realize(task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:528 + def root?; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:520 + def set_pending; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:570 + def set_state!(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:576 + def synchronized_set_state!(success, value, reason); end + + class << self + # Aggregate a collection of zero or more promises under a composite promise, + # execute the aggregated promises and collect them into a standard Ruby array, + # call the given Ruby `Ennnumerable` predicate (such as `any?`, `all?`, `none?`, + # or `one?`) on the collection checking for the success or failure of each, + # then executing the composite's `#then` handlers if the predicate returns + # `true` or executing the composite's `#rescue` handlers if the predicate + # returns false. + # + # @!macro promise_self_aggregate + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:505 + def aggregate(method, *promises); end + + # Aggregates a collection of promises and executes the `then` condition + # if all aggregated promises succeed. Executes the `rescue` handler with + # a `Concurrent::PromiseExecutionError` if any of the aggregated promises + # fail. Upon execution will execute any of the aggregate promises that + # were not already executed. + # + # @!macro promise_self_aggregate + # + # The returned promise will not yet have been executed. Additional `#then` + # and `#rescue` handlers may still be provided. Once the returned promise + # is execute the aggregate promises will be also be executed (if they have + # not been executed already). The results of the aggregate promises will + # be checked upon completion. The necessary `#then` and `#rescue` blocks + # on the aggregating promise will then be executed as appropriate. If the + # `#rescue` handlers are executed the raises exception will be + # `Concurrent::PromiseExecutionError`. + # + # @param [Array] promises Zero or more promises to aggregate + # @return [Promise] an unscheduled (not executed) promise that aggregates + # the promises given as arguments + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:464 + def all?(*promises); end + + # Aggregates a collection of promises and executes the `then` condition + # if any aggregated promises succeed. Executes the `rescue` handler with + # a `Concurrent::PromiseExecutionError` if any of the aggregated promises + # fail. Upon execution will execute any of the aggregate promises that + # were not already executed. + # + # @!macro promise_self_aggregate + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:475 + def any?(*promises); end + + # Create a new `Promise` object with the given block, execute it, and return the + # `:pending` object. + # + # @!macro executor_and_deref_options + # + # @!macro promise_init_options + # + # @return [Promise] the newly created `Promise` in the `:pending` state + # + # @raise [ArgumentError] if no block is given + # + # @example + # promise = Concurrent::Promise.execute{ sleep(1); 42 } + # promise.state #=> :pending + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:296 + def execute(opts = T.unsafe(nil), &block); end + + # Create a new `Promise` and fulfill it immediately. + # + # @!macro executor_and_deref_options + # + # @!macro promise_init_options + # + # @raise [ArgumentError] if no block is given + # + # @return [Promise] the newly created `Promise` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:224 + def fulfill(value, opts = T.unsafe(nil)); end + + # Create a new `Promise` and reject it immediately. + # + # @!macro executor_and_deref_options + # + # @!macro promise_init_options + # + # @raise [ArgumentError] if no block is given + # + # @return [Promise] the newly created `Promise` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:237 + def reject(reason, opts = T.unsafe(nil)); end + + # Builds a promise that produces the result of promises in an Array + # and fails if any of them fails. + # + # @overload zip(*promises) + # @param [Array] promises + # + # @overload zip(*promises, opts) + # @param [Array] promises + # @param [Hash] opts the configuration options + # @option opts [Executor] :executor (ImmediateExecutor.new) when set use the given `Executor` instance. + # @option opts [Boolean] :execute (true) execute promise before returning + # + # @return [Promise] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:409 + def zip(*promises); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:11 +class Concurrent::PromiseExecutionError < ::StandardError; end + +# {include:file:docs-source/promises-main.md} +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:13 +module Concurrent::Promises + extend ::Concurrent::Promises::FactoryMethods::Configuration + extend ::Concurrent::Promises::FactoryMethods +end + +# @abstract +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2047 +class Concurrent::Promises::AbstractAnyPromise < ::Concurrent::Promises::BlockedPromise; end + +# Common ancestor of {Event} and {Future} classes, many shared methods are defined here. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:513 +class Concurrent::Promises::AbstractEventFuture < ::Concurrent::Synchronization::Object + include ::Concurrent::Promises::InternalStates + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:522 + def initialize(promise, default_executor); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def __initialize_atomic_fields__; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:738 + def add_callback_clear_delayed_node(node); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:733 + def add_callback_notify_blocked(promise, index); end + + # For inspection. + # @!visibility private + # @return [Array] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:702 + def blocks; end + + # For inspection. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:710 + def callbacks; end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:596 + def chain(*args, &task); end + + # Chains the task to be executed asynchronously on executor after it is resolved. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @return [Future] + # @!macro promise.param.task-future + # + # @overload an_event.chain_on(executor, *args, &task) + # @yield [*args] to the task. + # @overload a_future.chain_on(executor, *args, &task) + # @yield [fulfilled, value, reason, *args] to the task. + # @yieldparam [true, false] fulfilled + # @yieldparam [Object] value + # @yieldparam [Object] reason + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:614 + def chain_on(executor, *args, &task); end + + # Resolves the resolvable when receiver is resolved. + # + # @param [Resolvable] resolvable + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:629 + def chain_resolvable(resolvable); end + + # Returns default executor. + # @return [Executor] default executor + # @see #with_default_executor + # @see FactoryMethods#future_on + # @see FactoryMethods#resolvable_future + # @see FactoryMethods#any_fulfilled_future_on + # @see similar + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:590 + def default_executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:623 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def internal_state; end + + # @!macro promises.shortcut.using + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:637 + def on_resolution(*args, &callback); end + + # Stores the callback to be executed synchronously on resolving thread after it is + # resolved. + # + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # + # @overload an_event.on_resolution!(*args, &callback) + # @yield [*args] to the callback. + # @overload a_future.on_resolution!(*args, &callback) + # @yield [fulfilled, value, reason, *args] to the callback. + # @yieldparam [true, false] fulfilled + # @yieldparam [Object] value + # @yieldparam [Object] reason + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:655 + def on_resolution!(*args, &callback); end + + # Stores the callback to be executed asynchronously on executor after it is resolved. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # + # @overload an_event.on_resolution_using(executor, *args, &callback) + # @yield [*args] to the callback. + # @overload a_future.on_resolution_using(executor, *args, &callback) + # @yield [fulfilled, value, reason, *args] to the callback. + # @yieldparam [true, false] fulfilled + # @yieldparam [Object] value + # @yieldparam [Object] reason + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:673 + def on_resolution_using(executor, *args, &callback); end + + # Is it in pending state? + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:549 + def pending?; end + + # For inspection. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:716 + def promise; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:688 + def resolve_with(state, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Is it in resolved state? + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:555 + def resolved?; end + + # Returns its state. + # @return [Symbol] + # + # @overload an_event.state + # @return [:pending, :resolved] + # @overload a_future.state + # Both :fulfilled, :rejected implies :resolved. + # @return [:pending, :fulfilled, :rejected] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:543 + def state; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:633 + def tangle(resolvable); end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:619 + def to_s; end + + # Propagates touch. Requests all the delayed futures, which it depends on, to be + # executed. This method is called by any other method requiring resolved state, like {#wait}. + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:562 + def touch; end + + # For inspection. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:722 + def touched?; end + + # @!macro promises.method.wait + # Wait (block the Thread) until receiver is {#resolved?}. + # @!macro promises.touches + # + # @!macro promises.warn.blocks + # @!macro promises.param.timeout + # @return [self, true, false] self implies timeout was not used, true implies timeout was used + # and it was resolved, false implies it was not resolved within timeout. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:578 + def wait(timeout = T.unsafe(nil)); end + + # For inspection. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:728 + def waiting_threads; end + + # @!macro promises.method.with_default_executor + # Crates new object with same class with the executor set as its new default executor. + # Any futures depending on it will use the new default executor. + # @!macro promises.shortcut.event-future + # @abstract + # @return [AbstractEventFuture] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:683 + def with_default_executor(executor); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:743 + def with_hidden_resolvable; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:750 + def add_callback(method, *args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:812 + def async_callback_on_resolution(state, executor, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:796 + def call_callback(method, state, args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:800 + def call_callbacks(state); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:763 + def callback_clear_delayed_node(state, node); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:818 + def callback_notify_blocked(state, promise, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def compare_and_set_internal_state(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def internal_state=(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def swap_internal_state(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def update_internal_state(&block); end + + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:768 + def wait_until_resolved(timeout); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:808 + def with_async(executor, *args, &block); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1796 +class Concurrent::Promises::AbstractFlatPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1798 + def initialize(delayed_because, blockers_count, event_or_future); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1808 + def touch; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1828 + def add_delayed_of(future); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1820 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1824 + def resolvable?(countdown, future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1816 + def touched?; end +end + +# @abstract +# @private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1549 +class Concurrent::Promises::AbstractPromise < ::Concurrent::Synchronization::Object + include ::Concurrent::Promises::InternalStates + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1553 + def initialize(future); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1564 + def default_executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1581 + def delayed_because; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1562 + def event; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1558 + def future; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1579 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1568 + def state; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1575 + def to_s; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1572 + def touch; end + + private + + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1592 + def evaluate_to(*args, block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1587 + def resolve_with(new_state, raise_on_reassign = T.unsafe(nil)); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2084 +class Concurrent::Promises::AnyFulfilledFuturePromise < ::Concurrent::Promises::AnyResolvedFuturePromise + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2088 + def resolvable?(countdown, event_or_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2050 +class Concurrent::Promises::AnyResolvedEventPromise < ::Concurrent::Promises::AbstractAnyPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2054 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2062 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2058 + def resolvable?(countdown, future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2067 +class Concurrent::Promises::AnyResolvedFuturePromise < ::Concurrent::Promises::AbstractAnyPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2071 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2079 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2075 + def resolvable?(countdown, future, index); end +end + +# @abstract +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1619 +class Concurrent::Promises::BlockedPromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1661 + def initialize(delayed, blockers_count, future); end + + # for inspection only + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1683 + def blocked_by; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1674 + def delayed_because; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1667 + def on_blocker_resolution(future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1678 + def touch; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1691 + def clear_and_propagate_touch(stack_or_element = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1710 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1706 + def process_on_blocker_resolution(future, index); end + + # @return [true,false] if resolvable + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1702 + def resolvable?(countdown, future, index); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1652 + def add_delayed(delayed1, delayed2); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1645 + def new_blocked_by(blockers, *args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1623 + def new_blocked_by1(blocker, *args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1630 + def new_blocked_by2(blocker1, blocker2, *args, &block); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1621 + def new(*args, &block); end + end +end + +# @abstract +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1716 +class Concurrent::Promises::BlockedTaskPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1717 + def initialize(delayed, blockers_count, default_executor, executor, args, &task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1725 + def executor; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1766 +class Concurrent::Promises::ChainPromise < ::Concurrent::Promises::BlockedTaskPromise + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1769 + def on_resolvable(resolved_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2095 +class Concurrent::Promises::DelayPromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2097 + def initialize(default_executor); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2108 + def delayed_because; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2104 + def touch; end +end + +# Represents an event which will happen in future (will be resolved). The event is either +# pending or resolved. It should be always resolved. Use {Future} to communicate rejections and +# cancellation. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:826 +class Concurrent::Promises::Event < ::Concurrent::Promises::AbstractEventFuture + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:847 + def &(other); end + + # Creates a new event which will be resolved when the first of receiver, `event_or_future` + # resolves. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:853 + def any(event_or_future); end + + # Creates new event dependent on receiver which will not evaluate until touched, see {#touch}. + # In other words, it inserts delay into the chain of Futures making rest of it lazy evaluated. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:863 + def delay; end + + # @!macro promise.method.schedule + # Creates new event dependent on receiver scheduled to execute on/in intended_time. + # In time is interpreted from the moment the receiver is resolved, therefore it inserts + # delay into the chain. + # + # @!macro promises.param.intended_time + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:875 + def schedule(intended_time); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:828 + def then(*args, &task); end + + # Returns self, since this is event + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:893 + def to_event; end + + # Converts event to a future. The future is fulfilled when the event is resolved, the future may never fail. + # + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:885 + def to_future; end + + # @!macro promises.method.with_default_executor + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:899 + def with_default_executor(executor); end + + # @!macro promises.method.zip + # Creates a new event or a future which will be resolved when receiver and other are. + # Returns an event if receiver and other are events, otherwise returns a future. + # If just one of the parties is Future then the result + # of the returned future is equal to the result of the supplied future. If both are futures + # then the result is as described in {FactoryMethods#zip_futures_on}. + # + # @return [Future, Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:839 + def zip(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:857 + def |(event_or_future); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:910 + def callback_on_resolution(state, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:905 + def rejected_resolution(raise_on_reassign, state); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1972 +class Concurrent::Promises::EventWrapperPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1973 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1979 + def on_resolvable(resolved_future, index); end +end + +# Container of all {Future}, {Event} factory methods. They are never constructed directly with +# new. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:46 +module Concurrent::Promises::FactoryMethods + include ::Concurrent::Promises::FactoryMethods::Configuration + extend ::Concurrent::ReInclude + extend ::Concurrent::Promises::FactoryMethods::Configuration + extend ::Concurrent::Promises::FactoryMethods + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:282 + def any(*futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:319 + def any_event(*futures_and_or_events); end + + # Creates a new event which becomes resolved after the first futures_and_or_events resolves. + # @!macro promises.any-touch + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:329 + def any_event_on(default_executor, *futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:300 + def any_fulfilled_future(*futures_and_or_events); end + + # Creates a new future which is resolved after the first futures_and_or_events is fulfilled. + # Its result equals the result of the first resolved future or if all futures_and_or_events reject, + # it has reason of the last rejected future. + # @!macro promises.any-touch + # @!macro promises.event-conversion + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:313 + def any_fulfilled_future_on(default_executor, *futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:278 + def any_resolved_future(*futures_and_or_events); end + + # Creates a new future which is resolved after the first futures_and_or_events is resolved. + # Its result equals the result of the first resolved future. + # @!macro promises.any-touch + # If resolved it does not propagate {Concurrent::AbstractEventFuture#touch}, leaving delayed + # futures un-executed if they are not required any more. + # @!macro promises.event-conversion + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:294 + def any_resolved_future_on(default_executor, *futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Future, Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:190 + def delay(*args, &task); end + + # Creates a new event or future which is resolved only after it is touched, + # see {Concurrent::AbstractEventFuture#touch}. + # + # @!macro promises.param.default_executor + # @overload delay_on(default_executor, *args, &task) + # If task is provided it returns a {Future} representing the result of the task. + # @!macro promises.param.args + # @yield [*args] to the task. + # @!macro promise.param.task-future + # @return [Future] + # @overload delay_on(default_executor) + # If no task is provided, it returns an {Event} + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:207 + def delay_on(default_executor, *args, &task); end + + # Creates a resolved future which will be fulfilled with the given value. + # + # @!macro promises.param.default_executor + # @param [Object] value + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:127 + def fulfilled_future(value, default_executor = T.unsafe(nil)); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:94 + def future(*args, &task); end + + # Constructs a new Future which will be resolved after block is evaluated on default executor. + # Evaluation begins immediately. + # + # @!macro promises.param.default_executor + # @!macro promises.param.args + # @yield [*args] to the task. + # @!macro promise.param.task-future + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:106 + def future_on(default_executor, *args, &task); end + + # General constructor. Behaves differently based on the argument's type. It's provided for convenience + # but it's better to be explicit. + # + # @see rejected_future, resolved_event, fulfilled_future + # @!macro promises.param.default_executor + # @return [Event, Future] + # + # @overload make_future(nil, default_executor = self.default_executor) + # @param [nil] nil + # @return [Event] resolved event. + # + # @overload make_future(a_future, default_executor = self.default_executor) + # @param [Future] a_future + # @return [Future] a future which will be resolved when a_future is. + # + # @overload make_future(an_event, default_executor = self.default_executor) + # @param [Event] an_event + # @return [Event] an event which will be resolved when an_event is. + # + # @overload make_future(exception, default_executor = self.default_executor) + # @param [Exception] exception + # @return [Future] a rejected future with the exception as its reason. + # + # @overload make_future(value, default_executor = self.default_executor) + # @param [Object] value when none of the above overloads fits + # @return [Future] a fulfilled future with the value. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:174 + def make_future(argument = T.unsafe(nil), default_executor = T.unsafe(nil)); end + + # Creates a resolved future which will be rejected with the given reason. + # + # @!macro promises.param.default_executor + # @param [Object] reason + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:136 + def rejected_future(reason, default_executor = T.unsafe(nil)); end + + # @!macro promises.shortcut.on + # @return [ResolvableEvent] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:63 + def resolvable_event; end + + # Creates a resolvable event, user is responsible for resolving the event once + # by calling {Promises::ResolvableEvent#resolve}. + # + # @!macro promises.param.default_executor + # @return [ResolvableEvent] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:72 + def resolvable_event_on(default_executor = T.unsafe(nil)); end + + # @!macro promises.shortcut.on + # @return [ResolvableFuture] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:78 + def resolvable_future; end + + # Creates resolvable future, user is responsible for resolving the future once by + # {Promises::ResolvableFuture#resolve}, {Promises::ResolvableFuture#fulfill}, + # or {Promises::ResolvableFuture#reject} + # + # @!macro promises.param.default_executor + # @return [ResolvableFuture] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:88 + def resolvable_future_on(default_executor = T.unsafe(nil)); end + + # Creates resolved event. + # + # @!macro promises.param.default_executor + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:144 + def resolved_event(default_executor = T.unsafe(nil)); end + + # Creates a resolved future with will be either fulfilled with the given value or rejected with + # the given reason. + # + # @param [true, false] fulfilled + # @param [Object] value + # @param [Object] reason + # @!macro promises.param.default_executor + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:118 + def resolved_future(fulfilled, value, reason, default_executor = T.unsafe(nil)); end + + # @!macro promises.shortcut.on + # @return [Future, Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:214 + def schedule(intended_time, *args, &task); end + + # Creates a new event or future which is resolved in intended_time. + # + # @!macro promises.param.default_executor + # @!macro promises.param.intended_time + # @param [Numeric, Time] intended_time `Numeric` means to run in `intended_time` seconds. + # `Time` means to run on `intended_time`. + # @overload schedule_on(default_executor, intended_time, *args, &task) + # If task is provided it returns a {Future} representing the result of the task. + # @!macro promises.param.args + # @yield [*args] to the task. + # @!macro promise.param.task-future + # @return [Future] + # @overload schedule_on(default_executor, intended_time) + # If no task is provided, it returns an {Event} + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:233 + def schedule_on(default_executor, intended_time, *args, &task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:258 + def zip(*futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:262 + def zip_events(*futures_and_or_events); end + + # Creates a new event which is resolved after all futures_and_or_events are resolved. + # (Future is resolved when fulfilled or rejected.) + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:272 + def zip_events_on(default_executor, *futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:240 + def zip_futures(*futures_and_or_events); end + + # Creates a new future which is resolved after all futures_and_or_events are resolved. + # Its value is an array of zipped future values. Its reason is an array of reasons for rejection. + # If there is an error it rejects. + # @!macro promises.event-conversion + # If event is supplied, which does not have value and can be only resolved, it's + # represented as `:fulfilled` with value `nil`. + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:254 + def zip_futures_on(default_executor, *futures_and_or_events); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:50 +module Concurrent::Promises::FactoryMethods::Configuration + # @return [Executor, :io, :fast] the executor which is used when none is supplied + # to a factory method. The method can be overridden in the receivers of + # `include FactoryMethod` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:54 + def default_executor; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1840 +class Concurrent::Promises::FlatEventPromise < ::Concurrent::Promises::AbstractFlatPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1844 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1848 + def process_on_blocker_resolution(future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1873 +class Concurrent::Promises::FlatFuturePromise < ::Concurrent::Promises::AbstractFlatPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1877 + def initialize(delayed, blockers_count, levels, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1884 + def process_on_blocker_resolution(future, index); end +end + +# Represents a value which will become available in future. May reject with a reason instead, +# e.g. when the tasks raises an exception. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:917 +class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1078 + def &(other); end + + # Creates a new event which will be resolved when the first of receiver, `event_or_future` + # resolves. Returning future will have value nil if event_or_future is event and resolves + # first. + # + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1085 + def any(event_or_future); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1215 + def apply(args, block); end + + # Creates new future dependent on receiver which will not evaluate until touched, see {#touch}. + # In other words, it inserts delay into the chain of Futures making rest of it lazy evaluated. + # + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1095 + def delay; end + + # Allows rejected Future to be risen with `raise` method. + # If the reason is not an exception `Runtime.new(reason)` is returned. + # + # @example + # raise Promises.rejected_future(StandardError.new("boom")) + # raise Promises.rejected_future("or just boom") + # @raise [Concurrent::Error] when raising not rejected future + # @return [Exception] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1013 + def exception(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1124 + def flat(level = T.unsafe(nil)); end + + # Creates new event which will be resolved when the returned event by receiver is. + # Be careful if the receiver rejects it will just resolve since Event does not hold reason. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1130 + def flat_event; end + + # Creates new future which will have result of the future returned by receiver. If receiver + # rejects it will have its rejection. + # + # @param [Integer] level how many levels of futures should flatten + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1120 + def flat_future(level = T.unsafe(nil)); end + + # Is it in fulfilled state? + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:921 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1243 + def inspect; end + + # @!macro promises.shortcut.using + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1136 + def on_fulfillment(*args, &callback); end + + # Stores the callback to be executed synchronously on resolving thread after it is + # fulfilled. Does nothing on rejection. + # + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # @yield [value, *args] to the callback. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1147 + def on_fulfillment!(*args, &callback); end + + # Stores the callback to be executed asynchronously on executor after it is + # fulfilled. Does nothing on rejection. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # @yield [value, *args] to the callback. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1159 + def on_fulfillment_using(executor, *args, &callback); end + + # @!macro promises.shortcut.using + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1165 + def on_rejection(*args, &callback); end + + # Stores the callback to be executed synchronously on resolving thread after it is + # rejected. Does nothing on fulfillment. + # + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # @yield [reason, *args] to the callback. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1176 + def on_rejection!(*args, &callback); end + + # Stores the callback to be executed asynchronously on executor after it is + # rejected. Does nothing on fulfillment. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # @yield [reason, *args] to the callback. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1188 + def on_rejection_using(executor, *args, &callback); end + + # Returns reason of future's rejection. + # @!macro promises.touches + # + # @!macro promises.warn.blocks + # @!macro promises.warn.nil + # @!macro promises.param.timeout + # @!macro promises.param.timeout_value + # @return [Object, timeout_value] the reason, or timeout_value on timeout, or nil on fulfillment. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:966 + def reason(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end + + # Is it in rejected state? + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:928 + def rejected?; end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1052 + def rescue(*args, &task); end + + # Chains the task to be executed asynchronously on executor after it rejects. Does not run + # the task if it fulfills. It will resolve though, triggering any dependent futures. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.task-future + # @return [Future] + # @yield [reason, *args] to the task. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1064 + def rescue_on(executor, *args, &task); end + + # Returns triplet fulfilled?, value, reason. + # @!macro promises.touches + # + # @!macro promises.warn.blocks + # @!macro promises.param.timeout + # @return [Array(Boolean, Object, Object), nil] triplet of fulfilled?, value, reason, or nil + # on timeout. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:981 + def result(timeout = T.unsafe(nil)); end + + # Allows to use futures as green threads. The receiver has to evaluate to a future which + # represents what should be done next. It basically flattens indefinitely until non Future + # values is returned which becomes result of the returned future. Any encountered exception + # will become reason of the returned future. + # + # @return [Future] + # @param [#call(value)] run_test + # an object which when called returns either Future to keep running with + # or nil, then the run completes with the value. + # The run_test can be used to extract the Future from deeper structure, + # or to distinguish Future which is a resulting value from a future + # which is suppose to continue running. + # @example + # body = lambda do |v| + # v += 1 + # v < 5 ? Promises.future(v, &body) : v + # end + # Promises.future(0, &body).run.value! # => 5 + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1210 + def run(run_test = T.unsafe(nil)); end + + # @!macro promise.method.schedule + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1102 + def schedule(intended_time); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1034 + def then(*args, &task); end + + # Chains the task to be executed asynchronously on executor after it fulfills. Does not run + # the task if it rejects. It will resolve though, triggering any dependent futures. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.task-future + # @return [Future] + # @yield [value, *args] to the task. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1046 + def then_on(executor, *args, &task); end + + # Converts future to event which is resolved when future is resolved by fulfillment or rejection. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1222 + def to_event; end + + # Returns self, since this is a future + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1230 + def to_future; end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1235 + def to_s; end + + # @!macro promises.method.value + # Return value of the future. + # @!macro promises.touches + # + # @!macro promises.warn.blocks + # @!macro promises.warn.nil + # @!macro promises.param.timeout + # @!macro promises.param.timeout_value + # @param [Object] timeout_value a value returned by the method when it times out + # @return [Object, nil, timeout_value] the value of the Future when fulfilled, + # timeout_value on timeout, + # nil on rejection. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:950 + def value(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end + + # @!macro promises.method.value + # @return [Object, nil, timeout_value] the value of the Future when fulfilled, + # or nil on rejection, + # or timeout_value on timeout. + # @raise [Exception] {#reason} on rejection + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:997 + def value!(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end + + # @!macro promises.method.wait + # @raise [Exception] {#reason} on rejection + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:987 + def wait!(timeout = T.unsafe(nil)); end + + # @!macro promises.method.with_default_executor + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1111 + def with_default_executor(executor); end + + # @!macro promises.method.zip + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1070 + def zip(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1089 + def |(event_or_future); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1272 + def async_callback_on_fulfillment(state, executor, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1278 + def async_callback_on_rejection(state, executor, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1284 + def callback_on_fulfillment(state, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1288 + def callback_on_rejection(state, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1292 + def callback_on_resolution(state, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1251 + def rejected_resolution(raise_on_reassign, state); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1247 + def run_test(v); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1266 + def wait_until_resolved!(timeout = T.unsafe(nil)); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1984 +class Concurrent::Promises::FutureWrapperPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1985 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1991 + def on_resolvable(resolved_future, index); end +end + +# will be immediately resolved +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1783 +class Concurrent::Promises::ImmediateEventPromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1784 + def initialize(default_executor); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1789 +class Concurrent::Promises::ImmediateFuturePromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1790 + def initialize(default_executor, fulfilled, value, reason); end +end + +# @abstract +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1615 +class Concurrent::Promises::InnerPromise < ::Concurrent::Promises::AbstractPromise; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:338 +module Concurrent::Promises::InternalStates; end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:397 +class Concurrent::Promises::InternalStates::Fulfilled < ::Concurrent::Promises::InternalStates::ResolvedWithResult + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:399 + def initialize(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:407 + def apply(args, block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:403 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:415 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:419 + def to_sym; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:411 + def value; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:425 +class Concurrent::Promises::InternalStates::FulfilledArray < ::Concurrent::Promises::InternalStates::Fulfilled + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:426 + def apply(args, block); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:488 +Concurrent::Promises::InternalStates::PENDING = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Pending) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:459 +class Concurrent::Promises::InternalStates::PartiallyRejected < ::Concurrent::Promises::InternalStates::ResolvedWithResult + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:460 + def initialize(value, reason); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:482 + def apply(args, block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:466 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:478 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:470 + def to_sym; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:474 + def value; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:351 +class Concurrent::Promises::InternalStates::Pending < ::Concurrent::Promises::InternalStates::State + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:352 + def resolved?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:356 + def to_sym; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:490 +Concurrent::Promises::InternalStates::RESERVED = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Reserved) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:492 +Concurrent::Promises::InternalStates::RESOLVED = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Fulfilled) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:432 +class Concurrent::Promises::InternalStates::Rejected < ::Concurrent::Promises::InternalStates::ResolvedWithResult + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:433 + def initialize(reason); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:453 + def apply(args, block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:437 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:445 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:449 + def to_sym; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:441 + def value; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:362 +class Concurrent::Promises::InternalStates::Reserved < ::Concurrent::Promises::InternalStates::Pending; end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:366 +class Concurrent::Promises::InternalStates::ResolvedWithResult < ::Concurrent::Promises::InternalStates::State + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:391 + def apply; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:379 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:387 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:367 + def resolved?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:375 + def result; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:371 + def to_sym; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:383 + def value; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:340 +class Concurrent::Promises::InternalStates::State + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:341 + def resolved?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:345 + def to_sym; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1748 +class Concurrent::Promises::RescuePromise < ::Concurrent::Promises::BlockedTaskPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1751 + def initialize(delayed, blockers_count, default_executor, executor, args, &task); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1755 + def on_resolvable(resolved_future, index); end +end + +# Marker module of Future, Event resolved manually. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1299 +module Concurrent::Promises::Resolvable + include ::Concurrent::Promises::InternalStates +end + +# A Event which can be resolved by user. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1304 +class Concurrent::Promises::ResolvableEvent < ::Concurrent::Promises::Event + include ::Concurrent::Promises::Resolvable + + # Makes the event resolved, which triggers all dependent futures. + # + # @!macro promise.param.raise_on_reassign + # @!macro promise.param.reserved + # @param [true, false] reserved + # Set to true if the resolvable is {#reserve}d by you, + # marks resolution of reserved resolvable events and futures explicitly. + # Advanced feature, ignore unless you use {Resolvable#reserve} from edge. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1324 + def resolve(raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Behaves as {AbstractEventFuture#wait} but has one additional optional argument + # resolve_on_timeout. + # + # @param [true, false] resolve_on_timeout + # If it times out and the argument is true it will also resolve the event. + # @return [self, true, false] + # @see AbstractEventFuture#wait + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1342 + def wait(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Creates new event wrapping receiver, effectively hiding the resolve method. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1331 + def with_hidden_resolvable; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1600 +class Concurrent::Promises::ResolvableEventPromise < ::Concurrent::Promises::AbstractPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1601 + def initialize(default_executor); end +end + +# A Future which can be resolved by user. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1354 +class Concurrent::Promises::ResolvableFuture < ::Concurrent::Promises::Future + include ::Concurrent::Promises::Resolvable + + # Evaluates the block and sets its result as future's value fulfilling, if the block raises + # an exception the future rejects with it. + # + # @yield [*args] to the block. + # @yieldreturn [Object] value + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1395 + def evaluate_to(*args, &block); end + + # Evaluates the block and sets its result as future's value fulfilling, if the block raises + # an exception the future rejects with it. + # + # @yield [*args] to the block. + # @yieldreturn [Object] value + # @return [self] + # @raise [Exception] also raise reason on rejection. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1406 + def evaluate_to!(*args, &block); end + + # Makes the future fulfilled with `value`, + # which triggers all dependent futures. + # + # @param [Object] value + # @!macro promise.param.raise_on_reassign + # @!macro promise.param.reserved + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1375 + def fulfill(value, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Behaves as {Future#reason} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [Exception, timeout_value, nil] + # @see Future#reason + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1503 + def reason(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Makes the future rejected with `reason`, + # which triggers all dependent futures. + # + # @param [Object] reason + # @!macro promise.param.raise_on_reassign + # @!macro promise.param.reserved + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1385 + def reject(reason, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Makes the future resolved with result of triplet `fulfilled?`, `value`, `reason`, + # which triggers all dependent futures. + # + # @param [true, false] fulfilled + # @param [Object] value + # @param [Object] reason + # @!macro promise.param.raise_on_reassign + # @!macro promise.param.reserved + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1365 + def resolve(fulfilled = T.unsafe(nil), value = T.unsafe(nil), reason = T.unsafe(nil), raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Behaves as {Future#result} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [::Array(Boolean, Object, Exception), nil] + # @see Future#result + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1524 + def result(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Behaves as {Future#value} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [Object, timeout_value, nil] + # @see Future#value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1459 + def value(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Behaves as {Future#value!} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [Object, timeout_value, nil] + # @raise [Exception] {#reason} on rejection + # @see Future#value! + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1481 + def value!(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Behaves as {AbstractEventFuture#wait} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [self, true, false] + # @see AbstractEventFuture#wait + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1421 + def wait(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Behaves as {Future#wait!} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [self, true, false] + # @raise [Exception] {#reason} on rejection + # @see Future#wait! + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1438 + def wait!(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Creates new future wrapping receiver, effectively hiding the resolve method and similar. + # + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1542 + def with_hidden_resolvable; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1606 +class Concurrent::Promises::ResolvableFuturePromise < ::Concurrent::Promises::AbstractPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1607 + def initialize(default_executor); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1611 + def evaluate_to(*args, block); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1909 +class Concurrent::Promises::RunFuturePromise < ::Concurrent::Promises::AbstractFlatPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1913 + def initialize(delayed, blockers_count, default_executor, run_test); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1918 + def process_on_blocker_resolution(future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2114 +class Concurrent::Promises::ScheduledPromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2125 + def initialize(default_executor, intended_time); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2119 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2115 + def intended_time; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1730 +class Concurrent::Promises::ThenPromise < ::Concurrent::Promises::BlockedTaskPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1733 + def initialize(delayed, blockers_count, default_executor, executor, args, &task); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1737 + def on_resolvable(resolved_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1940 +class Concurrent::Promises::ZipEventEventPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1941 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1947 + def on_resolvable(resolved_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2031 +class Concurrent::Promises::ZipEventsPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2035 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2041 + def on_resolvable(resolved_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1952 +class Concurrent::Promises::ZipFutureEventPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1953 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1967 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1960 + def process_on_blocker_resolution(future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1996 +class Concurrent::Promises::ZipFuturesPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2000 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2013 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2007 + def process_on_blocker_resolution(future, index); end +end + +# Methods form module A included to a module B, which is already included into class C, +# will not be visible in the C class. If this module is extended to B then A's methods +# are correctly made visible to C. +# +# @example +# module A +# def a +# :a +# end +# end +# +# module B1 +# end +# +# class C1 +# include B1 +# end +# +# module B2 +# extend Concurrent::ReInclude +# end +# +# class C2 +# include B2 +# end +# +# B1.send :include, A +# B2.send :include, A +# +# C1.new.respond_to? :a # => false +# C2.new.respond_to? :a # => true +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/re_include.rb:36 +module Concurrent::ReInclude + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/re_include.rb:44 + def extended(base); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/re_include.rb:50 + def include(*modules); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/re_include.rb:38 + def included(base); end +end + +# Ruby read-write lock implementation +# +# Allows any number of concurrent readers, but only one concurrent writer +# (And if the "write" lock is taken, any readers who come along will have to wait) +# +# If readers are already active when a writer comes along, the writer will wait for +# all the readers to finish before going ahead. +# Any additional readers that come when the writer is already waiting, will also +# wait (so writers are not starved). +# +# This implementation is based on `java.util.concurrent.ReentrantReadWriteLock`. +# +# @example +# lock = Concurrent::ReadWriteLock.new +# lock.with_read_lock { data.retrieve } +# lock.with_write_lock { data.modify! } +# +# @note Do **not** try to acquire the write lock while already holding a read lock +# **or** try to acquire the write lock while you already have it. +# This will lead to deadlock +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html java.util.concurrent.ReentrantReadWriteLock +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:31 +class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `ReadWriteLock` in the unlocked state. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:59 + def initialize; end + + # Acquire a read lock. If a write lock has been acquired will block until + # it is released. Will not block if other read locks have been acquired. + # + # @return [Boolean] true if the lock is successfully acquired + # + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:111 + def acquire_read_lock; end + + # Acquire a write lock. Will block and wait for all active readers and writers. + # + # @return [Boolean] true if the lock is successfully acquired + # + # @raise [Concurrent::ResourceLimitError] if the maximum number of writers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:160 + def acquire_write_lock; end + + # Queries whether any threads are waiting to acquire the read or write lock. + # + # @return [Boolean] true if any threads are waiting for a lock else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:214 + def has_waiters?; end + + # Release a previously acquired read lock. + # + # @return [Boolean] true if the lock is successfully released + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:140 + def release_read_lock; end + + # Release a previously acquired write lock. + # + # @return [Boolean] true if the lock is successfully released + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:196 + def release_write_lock; end + + # Execute a block operation within a read lock. + # + # @yield the task to be performed within the lock. + # + # @return [Object] the result of the block operation. + # + # @raise [ArgumentError] when no block is given. + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:75 + def with_read_lock; end + + # Execute a block operation within a write lock. + # + # @yield the task to be performed within the lock. + # + # @return [Object] the result of the block operation. + # + # @raise [ArgumentError] when no block is given. + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:94 + def with_write_lock; end + + # Queries if the write lock is held by any thread. + # + # @return [Boolean] true if the write lock is held else false` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:207 + def write_locked?; end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:246 + def max_readers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:251 + def max_writers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:221 + def running_readers(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:226 + def running_readers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:231 + def running_writer?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:241 + def waiting_writer?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:236 + def waiting_writers(c = T.unsafe(nil)); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:40 +Concurrent::ReadWriteLock::MAX_READERS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:43 +Concurrent::ReadWriteLock::MAX_WRITERS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:37 +Concurrent::ReadWriteLock::RUNNING_WRITER = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:34 +Concurrent::ReadWriteLock::WAITING_WRITER = T.let(T.unsafe(nil), Integer) + +# Re-entrant read-write lock implementation +# +# Allows any number of concurrent readers, but only one concurrent writer +# (And while the "write" lock is taken, no read locks can be obtained either. +# Hence, the write lock can also be called an "exclusive" lock.) +# +# If another thread has taken a read lock, any thread which wants a write lock +# will block until all the readers release their locks. However, once a thread +# starts waiting to obtain a write lock, any additional readers that come along +# will also wait (so writers are not starved). +# +# A thread can acquire both a read and write lock at the same time. A thread can +# also acquire a read lock OR a write lock more than once. Only when the read (or +# write) lock is released as many times as it was acquired, will the thread +# actually let it go, allowing other threads which might have been waiting +# to proceed. Therefore the lock can be upgraded by first acquiring +# read lock and then write lock and that the lock can be downgraded by first +# having both read and write lock a releasing just the write lock. +# +# If both read and write locks are acquired by the same thread, it is not strictly +# necessary to release them in the same order they were acquired. In other words, +# the following code is legal: +# +# @example +# lock = Concurrent::ReentrantReadWriteLock.new +# lock.acquire_write_lock +# lock.acquire_read_lock +# lock.release_write_lock +# # At this point, the current thread is holding only a read lock, not a write +# # lock. So other threads can take read locks, but not a write lock. +# lock.release_read_lock +# # Now the current thread is not holding either a read or write lock, so +# # another thread could potentially acquire a write lock. +# +# This implementation was inspired by `java.util.concurrent.ReentrantReadWriteLock`. +# +# @example +# lock = Concurrent::ReentrantReadWriteLock.new +# lock.with_read_lock { data.retrieve } +# lock.with_write_lock { data.modify! } +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html java.util.concurrent.ReentrantReadWriteLock +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:53 +class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `ReentrantReadWriteLock` in the unlocked state. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:109 + def initialize; end + + # Acquire a read lock. If a write lock is held by another thread, will block + # until it is released. + # + # @return [Boolean] true if the lock is successfully acquired + # + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:162 + def acquire_read_lock; end + + # Acquire a write lock. Will block and wait for all active readers and writers. + # + # @return [Boolean] true if the lock is successfully acquired + # + # @raise [Concurrent::ResourceLimitError] if the maximum number of writers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:257 + def acquire_write_lock; end + + # Release a previously acquired read lock. + # + # @return [Boolean] true if the lock is successfully released + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:236 + def release_read_lock; end + + # Release a previously acquired write lock. + # + # @return [Boolean] true if the lock is successfully released + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:329 + def release_write_lock; end + + # Try to acquire a read lock and return true if we succeed. If it cannot be + # acquired immediately, return false. + # + # @return [Boolean] true if the lock is successfully acquired + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:215 + def try_read_lock; end + + # Try to acquire a write lock and return true if we succeed. If it cannot be + # acquired immediately, return false. + # + # @return [Boolean] true if the lock is successfully acquired + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:310 + def try_write_lock; end + + # Execute a block operation within a read lock. + # + # @yield the task to be performed within the lock. + # + # @return [Object] the result of the block operation. + # + # @raise [ArgumentError] when no block is given. + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:126 + def with_read_lock; end + + # Execute a block operation within a write lock. + # + # @yield the task to be performed within the lock. + # + # @return [Object] the result of the block operation. + # + # @raise [ArgumentError] when no block is given. + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:145 + def with_write_lock; end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:370 + def max_readers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:375 + def max_writers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:345 + def running_readers(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:350 + def running_readers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:355 + def running_writer?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:365 + def waiting_or_running_writer?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:360 + def waiting_writers(c = T.unsafe(nil)); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:94 +Concurrent::ReentrantReadWriteLock::MAX_READERS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:96 +Concurrent::ReentrantReadWriteLock::MAX_WRITERS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:84 +Concurrent::ReentrantReadWriteLock::READER_BITS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:102 +Concurrent::ReentrantReadWriteLock::READ_LOCK_MASK = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:92 +Concurrent::ReentrantReadWriteLock::RUNNING_WRITER = T.let(T.unsafe(nil), Integer) + +# Used with @Counter: +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:90 +Concurrent::ReentrantReadWriteLock::WAITING_WRITER = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:86 +Concurrent::ReentrantReadWriteLock::WRITER_BITS = T.let(T.unsafe(nil), Integer) + +# Used with @HeldCount: +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:100 +Concurrent::ReentrantReadWriteLock::WRITE_LOCK_HELD = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:104 +Concurrent::ReentrantReadWriteLock::WRITE_LOCK_MASK = T.let(T.unsafe(nil), Integer) + +# Raised by an `Executor` when it is unable to process a given task, +# possibly because of a reject policy or other internal error. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:48 +class Concurrent::RejectedExecutionError < ::Concurrent::Error; end + +# Raised when any finite resource, such as a lock counter, exceeds its +# maximum limit/threshold. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:52 +class Concurrent::ResourceLimitError < ::Concurrent::Error; end + +# @!macro internal_implementation_note +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:129 +class Concurrent::RubyExchanger < ::Concurrent::AbstractExchanger + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:159 + def initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def __initialize_atomic_fields__; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def compare_and_set_slot(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def slot; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def slot=(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def swap_slot(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def update_slot(&block); end + + private + + # @!macro exchanger_method_do_exchange + # + # @return [Object, CANCEL] the value exchanged by the other thread; {CANCEL} on timeout + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:170 + def do_exchange(value, timeout); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:138 +class Concurrent::RubyExchanger::Node < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:142 + def initialize(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def __initialize_atomic_fields__; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def compare_and_set_value(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:153 + def item; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:149 + def latch; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def swap_value(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def update_value(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def value; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def value=(value); end +end + +# @!macro abstract_executor_service_public_api +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:8 +class Concurrent::RubyExecutorService < ::Concurrent::AbstractExecutorService + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:11 + def initialize(*args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:42 + def kill; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:17 + def post(*args, &task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:33 + def shutdown; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:52 + def wait_for_termination(timeout = T.unsafe(nil)); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:70 + def ns_running?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:78 + def ns_shutdown?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:66 + def ns_shutdown_execution; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:74 + def ns_shuttingdown?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:58 + def stop_event; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:62 + def stopped_event; end +end + +# @!macro single_thread_executor +# @!macro abstract_executor_service_public_api +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb:9 +class Concurrent::RubySingleThreadExecutor < ::Concurrent::RubyThreadPoolExecutor + include ::Concurrent::SerialExecutorService + + # @!macro single_thread_executor_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb:13 + def initialize(opts = T.unsafe(nil)); end +end + +# @!macro thread_pool_executor +# @!macro thread_pool_options +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:13 +class Concurrent::RubyThreadPoolExecutor < ::Concurrent::RubyExecutorService + # @!macro thread_pool_executor_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:47 + def initialize(opts = T.unsafe(nil)); end + + # @!macro thread_pool_executor_method_active_count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:67 + def active_count; end + + # @!macro executor_service_method_can_overflow_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:74 + def can_overflow?; end + + # @!macro thread_pool_executor_attr_reader_completed_task_count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:62 + def completed_task_count; end + + # @!macro thread_pool_executor_attr_reader_idletime + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:38 + def idletime; end + + # @!macro thread_pool_executor_attr_reader_largest_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:52 + def largest_length; end + + # @!macro thread_pool_executor_attr_reader_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:79 + def length; end + + # @!macro thread_pool_executor_attr_reader_max_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:32 + def max_length; end + + # @!macro thread_pool_executor_attr_reader_max_queue + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:41 + def max_queue; end + + # @!macro thread_pool_executor_attr_reader_min_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:35 + def min_length; end + + # @!macro thread_pool_executor_method_prune_pool + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:139 + def prune_pool; end + + # removes the worker if it can be pruned + # + # @return [true, false] if the worker was pruned + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:104 + def prune_worker(worker); end + + # @!macro thread_pool_executor_attr_reader_queue_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:84 + def queue_length; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:124 + def ready_worker(worker, last_message); end + + # @!macro thread_pool_executor_attr_reader_remaining_capacity + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:89 + def remaining_capacity; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:116 + def remove_worker(worker); end + + # @!macro thread_pool_executor_attr_reader_scheduled_task_count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:57 + def scheduled_task_count; end + + # @!macro thread_pool_executor_attr_reader_synchronous + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:44 + def synchronous; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:129 + def worker_died(worker); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:134 + def worker_task_completed; end + + private + + # creates new worker which has to receive work to do after it's added + # @return [nil, Worker] nil of max capacity is reached + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:257 + def ns_add_busy_worker; end + + # tries to assign task to a worker, tries to get one from @ready or to create new one + # @return [true, false] if task is assigned to a worker + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:217 + def ns_assign_worker(*args, &task); end + + # tries to enqueue task + # @return [true, false] if enqueued + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:235 + def ns_enqueue(*args, &task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:178 + def ns_execute(*args, &task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:146 + def ns_initialize(opts); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:205 + def ns_kill_execution; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:173 + def ns_limited_queue?; end + + # @return [Integer] number of excess idle workers which can be removed without + # going below min_length, or all workers if not running + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:305 + def ns_prunable_capacity; end + + # handle ready worker, giving it new job or assigning back to @ready + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:269 + def ns_ready_worker(worker, last_message, success = T.unsafe(nil)); end + + # removes a worker which is not tracked in @ready + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:287 + def ns_remove_busy_worker(worker); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:294 + def ns_remove_ready_worker(worker); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:314 + def ns_reset_if_forked; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:190 + def ns_shutdown_execution; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:247 + def ns_worker_died(worker); end +end + +# @!macro thread_pool_executor_constant_default_max_pool_size +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:17 +Concurrent::RubyThreadPoolExecutor::DEFAULT_MAX_POOL_SIZE = T.let(T.unsafe(nil), Integer) + +# @!macro thread_pool_executor_constant_default_max_queue_size +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:23 +Concurrent::RubyThreadPoolExecutor::DEFAULT_MAX_QUEUE_SIZE = T.let(T.unsafe(nil), Integer) + +# @!macro thread_pool_executor_constant_default_min_pool_size +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:20 +Concurrent::RubyThreadPoolExecutor::DEFAULT_MIN_POOL_SIZE = T.let(T.unsafe(nil), Integer) + +# @!macro thread_pool_executor_constant_default_synchronous +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:29 +Concurrent::RubyThreadPoolExecutor::DEFAULT_SYNCHRONOUS = T.let(T.unsafe(nil), FalseClass) + +# @!macro thread_pool_executor_constant_default_thread_timeout +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:26 +Concurrent::RubyThreadPoolExecutor::DEFAULT_THREAD_IDLETIMEOUT = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:328 +class Concurrent::RubyThreadPoolExecutor::Worker + include ::Concurrent::Concern::Logging + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:331 + def initialize(pool, id); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:342 + def <<(message); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:350 + def kill; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:346 + def stop; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:356 + def create_worker(queue, pool, idletime); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:381 + def run_task(pool, task, args); end +end + +# A simple utility class that executes a callable and returns and array of three elements: +# success - indicating if the callable has been executed without errors +# value - filled by the callable result if it has been executed without errors, nil otherwise +# reason - the error risen by the callable if it has been executed with errors, nil otherwise +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:9 +class Concurrent::SafeTaskExecutor < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:11 + def initialize(task, opts = T.unsafe(nil)); end + + # @return [Array] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:18 + def execute(*args); end +end + +# `ScheduledTask` is a close relative of `Concurrent::Future` but with one +# important difference: A `Future` is set to execute as soon as possible +# whereas a `ScheduledTask` is set to execute after a specified delay. This +# implementation is loosely based on Java's +# [ScheduledExecutorService](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledExecutorService.html). +# It is a more feature-rich variant of {Concurrent.timer}. +# +# The *intended* schedule time of task execution is set on object construction +# with the `delay` argument. The delay is a numeric (floating point or integer) +# representing a number of seconds in the future. Any other value or a numeric +# equal to or less than zero will result in an exception. The *actual* schedule +# time of task execution is set when the `execute` method is called. +# +# The constructor can also be given zero or more processing options. Currently +# the only supported options are those recognized by the +# [Dereferenceable](Dereferenceable) module. +# +# The final constructor argument is a block representing the task to be performed. +# If no block is given an `ArgumentError` will be raised. +# +# **States** +# +# `ScheduledTask` mixes in the [Obligation](Obligation) module thus giving it +# "future" behavior. This includes the expected lifecycle states. `ScheduledTask` +# has one additional state, however. While the task (block) is being executed the +# state of the object will be `:processing`. This additional state is necessary +# because it has implications for task cancellation. +# +# **Cancellation** +# +# A `:pending` task can be cancelled using the `#cancel` method. A task in any +# other state, including `:processing`, cannot be cancelled. The `#cancel` +# method returns a boolean indicating the success of the cancellation attempt. +# A cancelled `ScheduledTask` cannot be restarted. It is immutable. +# +# **Obligation and Observation** +# +# The result of a `ScheduledTask` can be obtained either synchronously or +# asynchronously. `ScheduledTask` mixes in both the [Obligation](Obligation) +# module and the +# [Observable](http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html) +# module from the Ruby standard library. With one exception `ScheduledTask` +# behaves identically to [Future](Observable) with regard to these modules. +# +# @!macro copy_options +# +# @example Basic usage +# +# require 'concurrent/scheduled_task' +# require 'csv' +# require 'open-uri' +# +# class Ticker +# def get_year_end_closing(symbol, year, api_key) +# uri = "https://www.alphavantage.co/query?function=TIME_SERIES_MONTHLY&symbol=#{symbol}&apikey=#{api_key}&datatype=csv" +# data = [] +# csv = URI.parse(uri).read +# if csv.include?('call frequency') +# return :rate_limit_exceeded +# end +# CSV.parse(csv, headers: true) do |row| +# data << row['close'].to_f if row['timestamp'].include?(year.to_s) +# end +# year_end = data.first +# year_end +# rescue => e +# p e +# end +# end +# +# api_key = ENV['ALPHAVANTAGE_KEY'] +# abort(error_message) unless api_key +# +# # Future +# price = Concurrent::Future.execute{ Ticker.new.get_year_end_closing('TWTR', 2013, api_key) } +# price.state #=> :pending +# price.pending? #=> true +# price.value(0) #=> nil (does not block) +# +# sleep(1) # do other stuff +# +# price.value #=> 63.65 (after blocking if necessary) +# price.state #=> :fulfilled +# price.fulfilled? #=> true +# price.value #=> 63.65 +# +# @example Successful task execution +# +# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' } +# task.state #=> :unscheduled +# task.execute +# task.state #=> pending +# +# # wait for it... +# sleep(3) +# +# task.unscheduled? #=> false +# task.pending? #=> false +# task.fulfilled? #=> true +# task.rejected? #=> false +# task.value #=> 'What does the fox say?' +# +# @example One line creation and execution +# +# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' }.execute +# task.state #=> pending +# +# task = Concurrent::ScheduledTask.execute(2){ 'What do you get when you multiply 6 by 9?' } +# task.state #=> pending +# +# @example Failed task execution +# +# task = Concurrent::ScheduledTask.execute(2){ raise StandardError.new('Call me maybe?') } +# task.pending? #=> true +# +# # wait for it... +# sleep(3) +# +# task.unscheduled? #=> false +# task.pending? #=> false +# task.fulfilled? #=> false +# task.rejected? #=> true +# task.value #=> nil +# task.reason #=> # +# +# @example Task execution with observation +# +# observer = Class.new{ +# def update(time, value, reason) +# puts "The task completed at #{time} with value '#{value}'" +# end +# }.new +# +# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' } +# task.add_observer(observer) +# task.execute +# task.pending? #=> true +# +# # wait for it... +# sleep(3) +# +# #>> The task completed at 2013-11-07 12:26:09 -0500 with value 'What does the fox say?' +# +# @!macro monotonic_clock_warning +# +# @see Concurrent.timer +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:158 +class Concurrent::ScheduledTask < ::Concurrent::IVar + include ::Comparable + + # Schedule a task for execution at a specified future time. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @yield the task to be performed + # + # @!macro executor_and_deref_options + # + # @option opts [object, Array] :args zero or more arguments to be passed the task + # block on execution + # + # @raise [ArgumentError] When no block is given + # @raise [ArgumentError] When given a time that is in the past + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:178 + def initialize(delay, opts = T.unsafe(nil), &task); end + + # Comparator which orders by schedule time. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:213 + def <=>(other); end + + # Cancel this task and prevent it from executing. A task can only be + # cancelled if it is pending or unscheduled. + # + # @return [Boolean] true if successfully cancelled else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:235 + def cancel; end + + # Has the task been cancelled? + # + # @return [Boolean] true if the task is in the given state else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:220 + def cancelled?; end + + # Execute an `:unscheduled` `ScheduledTask`. Immediately sets the state to `:pending` + # and starts counting down toward execution. Does nothing if the `ScheduledTask` is + # in any state other than `:unscheduled`. + # + # @return [ScheduledTask] a reference to `self` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:273 + def execute; end + + # The executor on which to execute the task. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:163 + def executor; end + + # The `delay` value given at instantiation. + # + # @return [Float] the initial delay. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:199 + def initial_delay; end + + # Execute the task. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:297 + def process_task; end + + # In the task execution in progress? + # + # @return [Boolean] true if the task is in the given state else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:227 + def processing?; end + + # Reschedule the task using the given delay and the current time. + # A task can only be reset while it is `:pending`. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @return [Boolean] true if successfully rescheduled else false + # + # @raise [ArgumentError] When given a time that is in the past + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:262 + def reschedule(delay); end + + # Reschedule the task using the original delay and the current time. + # A task can only be reset while it is `:pending`. + # + # @return [Boolean] true if successfully rescheduled else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:250 + def reset; end + + # The monotonic time at which the the task is scheduled to be executed. + # + # @return [Float] the schedule time or nil if `unscheduled` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:206 + def schedule_time; end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:301 + def fail(reason = T.unsafe(nil)); end + + # Reschedule the task using the given delay and the current time. + # A task can only be reset while it is `:pending`. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @return [Boolean] true if successfully rescheduled else false + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:326 + def ns_reschedule(delay); end + + # Schedule the task using the given delay and the current time. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @return [Boolean] true if successfully rescheduled else false + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:312 + def ns_schedule(delay); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:301 + def set(value = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:301 + def try_set(value = T.unsafe(nil), &block); end + + class << self + # Create a new `ScheduledTask` object with the given block, execute it, and return the + # `:pending` object. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @!macro executor_and_deref_options + # + # @return [ScheduledTask] the newly created `ScheduledTask` in the `:pending` state + # + # @raise [ArgumentError] if no block is given + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:290 + def execute(delay, opts = T.unsafe(nil), &task); end + end +end + +# @!macro semaphore +# +# A counting semaphore. Conceptually, a semaphore maintains a set of +# permits. Each {#acquire} blocks if necessary until a permit is +# available, and then takes it. Each {#release} adds a permit, potentially +# releasing a blocking acquirer. +# However, no actual permit objects are used; the Semaphore just keeps a +# count of the number available and acts accordingly. +# Alternatively, permits may be acquired within a block, and automatically +# released after the block finishes executing. +# +# @!macro semaphore_public_api +# @example +# semaphore = Concurrent::Semaphore.new(2) +# +# t1 = Thread.new do +# semaphore.acquire +# puts "Thread 1 acquired semaphore" +# end +# +# t2 = Thread.new do +# semaphore.acquire +# puts "Thread 2 acquired semaphore" +# end +# +# t3 = Thread.new do +# semaphore.acquire +# puts "Thread 3 acquired semaphore" +# end +# +# t4 = Thread.new do +# sleep(2) +# puts "Thread 4 releasing semaphore" +# semaphore.release +# end +# +# [t1, t2, t3, t4].each(&:join) +# +# # prints: +# # Thread 3 acquired semaphore +# # Thread 2 acquired semaphore +# # Thread 4 releasing semaphore +# # Thread 1 acquired semaphore +# +# @example +# semaphore = Concurrent::Semaphore.new(1) +# +# puts semaphore.available_permits +# semaphore.acquire do +# puts semaphore.available_permits +# end +# puts semaphore.available_permits +# +# # prints: +# # 1 +# # 0 +# # 1 +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/semaphore.rb:161 +class Concurrent::Semaphore < ::Concurrent::MutexSemaphore; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/semaphore.rb:96 +Concurrent::SemaphoreImplementation = Concurrent::MutexSemaphore + +# Indicates that the including `ExecutorService` guarantees +# that all operations will occur in the order they are post and that no +# two operations may occur simultaneously. This module provides no +# functionality and provides no guarantees. That is the responsibility +# of the including class. This module exists solely to allow the including +# object to be interrogated for its serialization status. +# +# @example +# class Foo +# include Concurrent::SerialExecutor +# end +# +# foo = Foo.new +# +# foo.is_a? Concurrent::ExecutorService #=> true +# foo.is_a? Concurrent::SerialExecutor #=> true +# foo.serialized? #=> true +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb:24 +module Concurrent::SerialExecutorService + include ::Concurrent::Concern::Logging + include ::Concurrent::ExecutorService + + # @!macro executor_service_method_serialized_question + # + # @note Always returns `true` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb:30 + def serialized?; end +end + +# Ensures passed jobs in a serialized order never running at the same time. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:8 +class Concurrent::SerializedExecution < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Logging + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:11 + def initialize; end + + # Submit a task to the executor for asynchronous processing. + # + # @param [Executor] executor to be used for this job + # + # @param [Array] args zero or more arguments to be passed to the task + # + # @yield the asynchronous task to perform + # + # @return [Boolean] `true` if the task is queued, `false` if the executor + # is not running + # + # @raise [ArgumentError] if no task is given + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:34 + def post(executor, *args, &task); end + + # As {#post} but allows to submit multiple tasks at once, it's guaranteed that they will not + # be interleaved by other tasks. + # + # @param [Array, Proc)>] posts array of triplets where + # first is a {ExecutorService}, second is array of args for task, third is a task (Proc) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:44 + def posts(posts); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:75 + def call_job(job); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:70 + def ns_initialize; end + + # ensures next job is executed if any is stashed + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:95 + def work(job); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 +class Concurrent::SerializedExecution::Job < ::Struct + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def args; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def args=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def block; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def block=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:17 + def call; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def executor=(_); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def [](*_arg0); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def keyword_init?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def new(*_arg0); end + end +end + +# A wrapper/delegator for any `ExecutorService` that +# guarantees serialized execution of tasks. +# +# @see [SimpleDelegator](http://www.ruby-doc.org/stdlib-2.1.2/libdoc/delegate/rdoc/SimpleDelegator.html) +# @see Concurrent::SerializedExecution +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb:12 +class Concurrent::SerializedExecutionDelegator < ::SimpleDelegator + include ::Concurrent::Concern::Logging + include ::Concurrent::ExecutorService + include ::Concurrent::SerialExecutorService + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb:15 + def initialize(executor); end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb:22 + def post(*args, &task); end +end + +# @!macro concurrent_set +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:61 +class Concurrent::Set < ::Concurrent::CRubySet; end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:23 +Concurrent::SetImplementation = Concurrent::CRubySet + +# An thread-safe, write-once variation of Ruby's standard `Struct`. +# Each member can have its value set at most once, either at construction +# or any time thereafter. Attempting to assign a value to a member +# that has already been set will result in a `Concurrent::ImmutabilityError`. +# +# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct` +# @see http://en.wikipedia.org/wiki/Final_(Java) Java `final` keyword +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:14 +module Concurrent::SettableStruct + include ::Concurrent::Synchronization::AbstractStruct + + # @!macro struct_equality + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:50 + def ==(other); end + + # @!macro struct_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:45 + def [](member); end + + # @!macro struct_set + # + # @raise [Concurrent::ImmutabilityError] if the given member has already been set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:75 + def []=(member, value); end + + # @!macro struct_each + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:55 + def each(&block); end + + # @!macro struct_each_pair + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:61 + def each_pair(&block); end + + # @!macro struct_inspect + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:29 + def inspect; end + + # @!macro struct_merge + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:35 + def merge(other, &block); end + + # @!macro struct_select + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:67 + def select(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:21 + def to_a; end + + # @!macro struct_to_h + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:40 + def to_h; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:32 + def to_s; end + + # @!macro struct_values + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:18 + def values; end + + # @!macro struct_values_at + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:24 + def values_at(*indexes); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:97 + def initialize_copy(original); end + + class << self + # @!macro struct_new + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:105 + def new(*args, &block); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:115 +Concurrent::SettableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) + +# An executor service in which every operation spawns a new, +# independently operating thread. +# +# This is perhaps the most inefficient executor service in this +# library. It exists mainly for testing an debugging. Thread creation +# and management is expensive in Ruby and this executor performs no +# resource pooling. This can be very beneficial during testing and +# debugging because it decouples the using code from the underlying +# executor implementation. In production this executor will likely +# lead to suboptimal performance. +# +# @note Intended for use primarily in testing and debugging. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:21 +class Concurrent::SimpleExecutorService < ::Concurrent::RubyExecutorService + # @!macro executor_service_method_left_shift + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:56 + def <<(task); end + + # @!macro executor_service_method_kill + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:84 + def kill; end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:40 + def post(*args, &task); end + + # @!macro executor_service_method_running_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:62 + def running?; end + + # @!macro executor_service_method_shutdown + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:77 + def shutdown; end + + # @!macro executor_service_method_shutdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:72 + def shutdown?; end + + # @!macro executor_service_method_shuttingdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:67 + def shuttingdown?; end + + # @!macro executor_service_method_wait_for_termination + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:91 + def wait_for_termination(timeout = T.unsafe(nil)); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:97 + def ns_initialize(*args); end + + class << self + # @!macro executor_service_method_left_shift + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:34 + def <<(task); end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:24 + def post(*args); end + end +end + +# @!macro single_thread_executor +# +# A thread pool with a single thread an unlimited queue. Should the thread +# die for any reason it will be removed and replaced, thus ensuring that +# the executor will always remain viable and available to process jobs. +# +# A common pattern for background processing is to create a single thread +# on which an infinite loop is run. The thread's loop blocks on an input +# source (perhaps blocking I/O or a queue) and processes each input as it +# is received. This pattern has several issues. The thread itself is highly +# susceptible to errors during processing. Also, the thread itself must be +# constantly monitored and restarted should it die. `SingleThreadExecutor` +# encapsulates all these behaviors. The task processor is highly resilient +# to errors from within tasks. Also, should the thread die it will +# automatically be restarted. +# +# The API and behavior of this class are based on Java's `SingleThreadExecutor`. +# +# @!macro abstract_executor_service_public_api +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb:37 +class Concurrent::SingleThreadExecutor < ::Concurrent::RubySingleThreadExecutor; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb:10 +Concurrent::SingleThreadExecutorImplementation = Concurrent::RubySingleThreadExecutor + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:2 +module Concurrent::Synchronization + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/full_memory_barrier.rb:7 + def full_memory_barrier; end + end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:9 +class Concurrent::Synchronization::AbstractLockableObject < ::Concurrent::Synchronization::Object + protected + + # @!macro synchronization_object_method_ns_broadcast + # + # Broadcast to all waiting threads. + # @return [self] + # @note only to be used inside synchronized block + # @note to provide direct access to this method in a descendant add method + # ``` + # def broadcast + # synchronize { ns_broadcast } + # end + # ``` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:96 + def ns_broadcast; end + + # @!macro synchronization_object_method_ns_signal + # + # Signal one waiting thread. + # @return [self] + # @note only to be used inside synchronized block + # @note to provide direct access to this method in a descendant add method + # ``` + # def signal + # synchronize { ns_signal } + # end + # ``` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:81 + def ns_signal; end + + # @!macro synchronization_object_method_ns_wait + # + # Wait until another thread calls #signal or #broadcast, + # spurious wake-ups can happen. + # + # @param [Numeric, nil] timeout in seconds, `nil` means no timeout + # @return [self] + # @note only to be used inside synchronized block + # @note to provide direct access to this method in a descendant add method + # ``` + # def wait(timeout = nil) + # synchronize { ns_wait(timeout) } + # end + # ``` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:66 + def ns_wait(timeout = T.unsafe(nil)); end + + # @!macro synchronization_object_method_ns_wait_until + # + # Wait until condition is met or timeout passes, + # protects against spurious wake-ups. + # @param [Numeric, nil] timeout in seconds, `nil` means no timeout + # @yield condition to be met + # @yieldreturn [true, false] + # @return [true, false] if condition met + # @note only to be used inside synchronized block + # @note to provide direct access to this method in a descendant add method + # ``` + # def wait_until(timeout = nil, &condition) + # synchronize { ns_wait_until(timeout, &condition) } + # end + # ``` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:37 + def ns_wait_until(timeout = T.unsafe(nil), &condition); end + + # @!macro synchronization_object_method_synchronize + # + # @yield runs the block synchronized against this object, + # equivalent of java's `synchronize(this) {}` + # @note can by made public in descendants if required by `public :synchronize` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:18 + def synchronize; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:6 +class Concurrent::Synchronization::AbstractObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:7 + def initialize; end + + # @!visibility private + # @abstract + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:13 + def full_memory_barrier; end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:17 + def attr_volatile(*names); end + end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:6 +module Concurrent::Synchronization::AbstractStruct + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:9 + def initialize(*values); end + + # @!macro struct_length + # + # Returns the number of struct members. + # + # @return [Fixnum] the number of struct members + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:19 + def length; end + + # @!macro struct_members + # + # Returns the struct members as an array of symbols. + # + # @return [Array] the struct members as an array of symbols + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:29 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:22 + def size; end + + protected + + # @!macro struct_each + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:82 + def ns_each; end + + # @!macro struct_each_pair + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:89 + def ns_each_pair; end + + # @!macro struct_equality + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:75 + def ns_equality(other); end + + # @!macro struct_get + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:59 + def ns_get(member); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:119 + def ns_initialize_copy; end + + # @!macro struct_inspect + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:105 + def ns_inspect; end + + # @!macro struct_merge + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:114 + def ns_merge(other, &block); end + + # @!macro struct_select + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:98 + def ns_select; end + + # @!macro struct_to_h + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:52 + def ns_to_h; end + + # @!macro struct_values + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:38 + def ns_values; end + + # @!macro struct_values_at + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:45 + def ns_values_at(indexes); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:130 + def pr_underscore(clazz); end + + class << self + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:141 + def define_struct_class(parent, base, name, members, &block); end + end +end + +# @!visibility private +# TODO (pitr-ch 04-Dec-2016): should be in edge +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:8 +class Concurrent::Synchronization::Condition < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:18 + def initialize(lock); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:47 + def broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:51 + def ns_broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:43 + def ns_signal; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:27 + def ns_wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:35 + def ns_wait_until(timeout = T.unsafe(nil), &condition); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:39 + def signal; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:23 + def wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:31 + def wait_until(timeout = T.unsafe(nil), &condition); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:15 + def private_new(*args, &block); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:16 + def new(*args, &block); end + end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:8 +module Concurrent::Synchronization::ConditionSignalling + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:16 + def ns_broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:11 + def ns_signal; end +end + +# @!visibility private +# TODO (pitr-ch 04-Dec-2016): should be in edge +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:8 +class Concurrent::Synchronization::Lock < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:31 + def broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:35 + def ns_broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:29 + def ns_signal; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:17 + def ns_wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:23 + def ns_wait_until(timeout = T.unsafe(nil), &condition); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:25 + def signal; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:11 + def synchronize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:13 + def wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:19 + def wait_until(timeout = T.unsafe(nil), &condition); end +end + +# Safe synchronization under any Ruby implementation. +# It provides methods like {#synchronize}, {#wait}, {#signal} and {#broadcast}. +# Provides a single layer which can improve its implementation over time without changes needed to +# the classes using it. Use {Synchronization::Object} not this abstract class. +# +# @note this object does not support usage together with +# [`Thread#wakeup`](http://ruby-doc.org/core/Thread.html#method-i-wakeup) +# and [`Thread#raise`](http://ruby-doc.org/core/Thread.html#method-i-raise). +# `Thread#sleep` and `Thread#wakeup` will work as expected but mixing `Synchronization::Object#wait` and +# `Thread#wakeup` will not work on all platforms. +# +# @see Event implementation as an example of this class use +# +# @example simple +# class AnClass < Synchronization::Object +# def initialize +# super +# synchronize { @value = 'asd' } +# end +# +# def value +# synchronize { @value } +# end +# end +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb:50 +class Concurrent::Synchronization::LockableObject < ::Concurrent::Synchronization::MutexLockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:57 + def new_condition; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb:11 +Concurrent::Synchronization::LockableObjectImplementation = Concurrent::Synchronization::MutexLockableObject + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:60 +class Concurrent::Synchronization::MonitorLockableObject < ::Concurrent::Synchronization::AbstractLockableObject + include ::Concurrent::Synchronization::ConditionSignalling + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:65 + def initialize; end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:83 + def ns_wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:79 + def synchronize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:71 + def initialize_copy(other); end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:25 +class Concurrent::Synchronization::MutexLockableObject < ::Concurrent::Synchronization::AbstractLockableObject + include ::Concurrent::Synchronization::ConditionSignalling + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:30 + def initialize; end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:52 + def ns_wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:44 + def synchronize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:36 + def initialize_copy(other); end +end + +# Abstract object providing final, volatile, ans CAS extensions to build other concurrent abstractions. +# - final instance variables see {Object.safe_initialization!} +# - volatile instance variables see {Object.attr_volatile} +# - volatile instance variables see {Object.attr_atomic} +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:15 +class Concurrent::Synchronization::Object < ::Concurrent::Synchronization::AbstractObject + include ::Concurrent::Synchronization::Volatile + extend ::Concurrent::Synchronization::Volatile::ClassMethods + + # Has to be called by children. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:28 + def initialize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:146 + def __initialize_atomic_fields__; end + + class << self + # @return [true, false] is the attribute with name atomic? + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:125 + def atomic_attribute?(name); end + + # @param [true, false] inherited should inherited volatile with CAS fields be returned? + # @return [::Array] Returns defined volatile with CAS fields on this class. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:119 + def atomic_attributes(inherited = T.unsafe(nil)); end + + # Creates methods for reading and writing to a instance variable with + # volatile (Java) semantic as {.attr_volatile} does. + # The instance variable should be accessed only through generated methods. + # This method generates following methods: `value`, `value=(new_value) #=> new_value`, + # `swap_value(new_value) #=> old_value`, + # `compare_and_set_value(expected, value) #=> true || false`, `update_value(&block)`. + # @param [::Array] names of the instance variables to be volatile with CAS. + # @return [::Array] names of defined method names. + # @!macro attr_atomic + # @!method $1 + # @return [Object] The $1. + # @!method $1=(new_$1) + # Set the $1. + # @return [Object] new_$1. + # @!method swap_$1(new_$1) + # Set the $1 to new_$1 and return the old $1. + # @return [Object] old $1 + # @!method compare_and_set_$1(expected_$1, new_$1) + # Sets the $1 to new_$1 if the current $1 is expected_$1 + # @return [true, false] + # @!method update_$1(&block) + # Updates the $1 using the block. + # @yield [Object] Calculate a new $1 using given (old) $1 + # @yieldparam [Object] old $1 + # @return [Object] new $1 + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:84 + def attr_atomic(*names); end + + # For testing purposes, quite slow. Injects assert code to new method which will raise if class instance contains + # any instance variables with CamelCase names and isn't {.safe_initialization?}. + # @raise when offend found + # @return [true] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:45 + def ensure_safe_initialization_when_final_fields_are_present; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:33 + def safe_initialization!; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:37 + def safe_initialization?; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:131 + def define_initialize_atomic_fields; end + end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# By extending this module, a class and all its children are marked to be constructed safely. Meaning that +# all writes (ivar initializations) are made visible to all readers of newly constructed object. It ensures +# same behaviour as Java's final fields. +# +# Due to using Kernel#extend, the module is not included again if already present in the ancestors, +# which avoids extra overhead. +# +# @example +# class AClass < Concurrent::Synchronization::Object +# extend Concurrent::Synchronization::SafeInitialization +# +# def initialize +# @AFinalValue = 'value' # published safely, #foo will never return nil +# end +# +# def foo +# @AFinalValue +# end +# end +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb:28 +module Concurrent::Synchronization::SafeInitialization + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb:29 + def new(*args, &block); end +end + +# Volatile adds the attr_volatile class method when included. +# +# @example +# class Foo +# include Concurrent::Synchronization::Volatile +# +# attr_volatile :bar +# +# def initialize +# self.bar = 1 +# end +# end +# +# foo = Foo.new +# foo.bar +# => 1 +# foo.bar = 2 +# => 2 +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:28 +module Concurrent::Synchronization::Volatile + mixes_in_class_methods ::Concurrent::Synchronization::Volatile::ClassMethods + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:33 + def full_memory_barrier; end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:29 + def included(base); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:37 +module Concurrent::Synchronization::Volatile::ClassMethods + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:39 + def attr_volatile(*names); end +end + +# This class provides a trivial way to synchronize all calls to a given object +# by wrapping it with a `Delegator` that performs `Monitor#enter/exit` calls +# around the delegated `#send`. Example: +# +# array = [] # not thread-safe on many impls +# array = SynchronizedDelegator.new([]) # thread-safe +# +# A simple `Monitor` provides a very coarse-grained way to synchronize a given +# object, in that it will cause synchronization for methods that have no need +# for it, but this is a trivial way to get thread-safety where none may exist +# currently on some implementations. +# +# This class is currently being considered for inclusion into stdlib, via +# https://bugs.ruby-lang.org/issues/8556 +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:21 +class Concurrent::SynchronizedDelegator < ::SimpleDelegator + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:31 + def initialize(obj); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:36 + def method_missing(method, *args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:22 + def setup; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:27 + def teardown; end +end + +# A `TVar` is a transactional variable - a single-element container that +# is used as part of a transaction - see `Concurrent::atomically`. +# +# @!macro thread_safe_variable_comparison +# +# {include:file:docs-source/tvar.md} +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:12 +class Concurrent::TVar < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `TVar` with an initial value. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:16 + def initialize(value); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:46 + def unsafe_lock; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:36 + def unsafe_value; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:41 + def unsafe_value=(value); end + + # Get the value of a `TVar`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:22 + def value; end + + # Set the value of a `TVar`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:29 + def value=(value); end +end + +# A `ThreadLocalVar` is a variable where the value is different for each thread. +# Each variable may have a default value, but when you modify the variable only +# the current thread will ever see that change. +# +# This is similar to Ruby's built-in thread-local variables (`Thread#thread_variable_get`), +# but with these major advantages: +# * `ThreadLocalVar` has its own identity, it doesn't need a Symbol. +# * Each Ruby's built-in thread-local variable leaks some memory forever (it's a Symbol held forever on the thread), +# so it's only OK to create a small amount of them. +# `ThreadLocalVar` has no such issue and it is fine to create many of them. +# * Ruby's built-in thread-local variables leak forever the value set on each thread (unless set to nil explicitly). +# `ThreadLocalVar` automatically removes the mapping for each thread once the `ThreadLocalVar` instance is GC'd. +# +# @!macro thread_safe_variable_comparison +# +# @example +# v = ThreadLocalVar.new(14) +# v.value #=> 14 +# v.value = 2 +# v.value #=> 2 +# +# @example +# v = ThreadLocalVar.new(14) +# +# t1 = Thread.new do +# v.value #=> 14 +# v.value = 1 +# v.value #=> 1 +# end +# +# t2 = Thread.new do +# v.value #=> 14 +# v.value = 2 +# v.value #=> 2 +# end +# +# v.value #=> 14 +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:43 +class Concurrent::ThreadLocalVar + # Creates a thread local variable. + # + # @param [Object] default the default value when otherwise unset + # @param [Proc] default_block Optional block that gets called to obtain the + # default value for each thread + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:51 + def initialize(default = T.unsafe(nil), &default_block); end + + # Bind the given value to thread local storage during + # execution of the given block. + # + # @param [Object] value the value to bind + # @yield the operation to be performed with the bound variable + # @return [Object] the value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:88 + def bind(value); end + + # Returns the value in the current thread's copy of this thread-local variable. + # + # @return [Object] the current value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:70 + def value; end + + # Sets the current thread's copy of this thread-local variable to the specified value. + # + # @param [Object] value the value to set + # @return [Object] the new value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:78 + def value=(value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:103 + def default; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:44 +Concurrent::ThreadLocalVar::LOCALS = T.let(T.unsafe(nil), Concurrent::ThreadLocals) + +# @!visibility private +# @!macro internal_implementation_note +# An array-backed storage of indexed variables per thread. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:141 +class Concurrent::ThreadLocals < ::Concurrent::AbstractLocals + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:142 + def locals; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:146 + def locals!; end +end + +# @!macro thread_pool_executor +# +# An abstraction composed of one or more threads and a task queue. Tasks +# (blocks or `proc` objects) are submitted to the pool and added to the queue. +# The threads in the pool remove the tasks and execute them in the order +# they were received. +# +# A `ThreadPoolExecutor` will automatically adjust the pool size according +# to the bounds set by `min-threads` and `max-threads`. When a new task is +# submitted and fewer than `min-threads` threads are running, a new thread +# is created to handle the request, even if other worker threads are idle. +# If there are more than `min-threads` but less than `max-threads` threads +# running, a new thread will be created only if the queue is full. +# +# Threads that are idle for too long will be garbage collected, down to the +# configured minimum options. Should a thread crash it, too, will be garbage collected. +# +# `ThreadPoolExecutor` is based on the Java class of the same name. From +# the official Java documentation; +# +# > Thread pools address two different problems: they usually provide +# > improved performance when executing large numbers of asynchronous tasks, +# > due to reduced per-task invocation overhead, and they provide a means +# > of bounding and managing the resources, including threads, consumed +# > when executing a collection of tasks. Each ThreadPoolExecutor also +# > maintains some basic statistics, such as the number of completed tasks. +# > +# > To be useful across a wide range of contexts, this class provides many +# > adjustable parameters and extensibility hooks. However, programmers are +# > urged to use the more convenient Executors factory methods +# > [CachedThreadPool] (unbounded thread pool, with automatic thread reclamation), +# > [FixedThreadPool] (fixed size thread pool) and [SingleThreadExecutor] (single +# > background thread), that preconfigure settings for the most common usage +# > scenarios. +# +# @!macro thread_pool_options +# +# @!macro thread_pool_executor_public_api +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/thread_pool_executor.rb:56 +class Concurrent::ThreadPoolExecutor < ::Concurrent::RubyThreadPoolExecutor; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/thread_pool_executor.rb:10 +Concurrent::ThreadPoolExecutorImplementation = Concurrent::RubyThreadPoolExecutor + +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:4 +module Concurrent::ThreadSafe; end + +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:7 +module Concurrent::ThreadSafe::Util + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb:16 + def make_synchronized_on_cruby(klass); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb:41 + def make_synchronized_on_truffleruby(klass); end + end +end + +# TODO (pitr-ch 15-Oct-2016): migrate to Utility::ProcessorCounter +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:13 +Concurrent::ThreadSafe::Util::CPU_COUNT = T.let(T.unsafe(nil), Integer) + +# TODO (pitr-ch 15-Oct-2016): migrate to Utility::NativeInteger +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:10 +Concurrent::ThreadSafe::Util::FIXNUM_BIT_SIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:11 +Concurrent::ThreadSafe::Util::MAX_INT = T.let(T.unsafe(nil), Integer) + +# Raised when an operation times out. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:55 +class Concurrent::TimeoutError < ::Concurrent::Error; end + +# Executes a collection of tasks, each after a given delay. A master task +# monitors the set and schedules each task for execution at the appropriate +# time. Tasks are run on the global thread pool or on the supplied executor. +# Each task is represented as a `ScheduledTask`. +# +# @see Concurrent::ScheduledTask +# +# @!macro monotonic_clock_warning +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:19 +class Concurrent::TimerSet < ::Concurrent::RubyExecutorService + # Create a new set of timed tasks. + # + # @!macro executor_options + # + # @param [Hash] opts the options used to specify the executor on which to perform actions + # @option opts [Executor] :executor when set use the given `Executor` instance. + # Three special values are also supported: `:task` returns the global task pool, + # `:operation` returns the global operation pool, and `:immediate` returns a new + # `ImmediateExecutor` object. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:30 + def initialize(opts = T.unsafe(nil)); end + + # Begin an immediate shutdown. In-progress tasks will be allowed to + # complete but enqueued tasks will be dismissed and no new tasks + # will be accepted. Has no additional effect if the thread pool is + # not running. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:62 + def kill; end + + # Post a task to be execute run after a given delay (in seconds). If the + # delay is less than 1/100th of a second the task will be immediately post + # to the executor. + # + # @param [Float] delay the number of seconds to wait for before executing the task. + # @param [Array] args the arguments passed to the task on execution. + # + # @yield the task to be performed. + # + # @return [Concurrent::ScheduledTask, false] IVar representing the task if the post + # is successful; false after shutdown. + # + # @raise [ArgumentError] if the intended execution time is not in the future. + # @raise [ArgumentError] if no block is given. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:48 + def post(delay, *args, &task); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:67 + def <<(task); end + + # Initialize the object. + # + # @param [Hash] opts the options to create the object with. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:75 + def ns_initialize(opts); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:95 + def ns_post_task(task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:132 + def ns_reset_if_forked; end + + # `ExecutorService` callback called during shutdown. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:123 + def ns_shutdown_execution; end + + # Post the task to the internal queue. + # + # @note This is intended as a callback method from ScheduledTask + # only. It is not intended to be used directly. Post a task + # by using the `SchedulesTask#execute` method. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:90 + def post_task(task); end + + # Run a loop and execute tasks in the scheduled order and at the approximate + # scheduled time. If no tasks remain the thread will exit gracefully so that + # garbage collection can occur. If there are no ready tasks it will sleep + # for up to 60 seconds waiting for the next scheduled task. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:146 + def process_tasks; end + + # Remove the given task from the queue. + # + # @note This is intended as a callback method from `ScheduledTask` + # only. It is not intended to be used directly. Cancel a task + # by using the `ScheduledTask#cancel` method. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:116 + def remove_task(task); end +end + +# A very common concurrency pattern is to run a thread that performs a task at +# regular intervals. The thread that performs the task sleeps for the given +# interval then wakes up and performs the task. Lather, rinse, repeat... This +# pattern causes two problems. First, it is difficult to test the business +# logic of the task because the task itself is tightly coupled with the +# concurrency logic. Second, an exception raised while performing the task can +# cause the entire thread to abend. In a long-running application where the +# task thread is intended to run for days/weeks/years a crashed task thread +# can pose a significant problem. `TimerTask` alleviates both problems. +# +# When a `TimerTask` is launched it starts a thread for monitoring the +# execution interval. The `TimerTask` thread does not perform the task, +# however. Instead, the TimerTask launches the task on a separate thread. +# Should the task experience an unrecoverable crash only the task thread will +# crash. This makes the `TimerTask` very fault tolerant. Additionally, the +# `TimerTask` thread can respond to the success or failure of the task, +# performing logging or ancillary operations. +# +# One other advantage of `TimerTask` is that it forces the business logic to +# be completely decoupled from the concurrency logic. The business logic can +# be tested separately then passed to the `TimerTask` for scheduling and +# running. +# +# A `TimerTask` supports two different types of interval calculations. +# A fixed delay will always wait the same amount of time between the +# completion of one task and the start of the next. A fixed rate will +# attempt to maintain a constant rate of execution regardless of the +# duration of the task. For example, if a fixed rate task is scheduled +# to run every 60 seconds but the task itself takes 10 seconds to +# complete, the next task will be scheduled to run 50 seconds after +# the start of the previous task. If the task takes 70 seconds to +# complete, the next task will be start immediately after the previous +# task completes. Tasks will not be executed concurrently. +# +# In some cases it may be necessary for a `TimerTask` to affect its own +# execution cycle. To facilitate this, a reference to the TimerTask instance +# is passed as an argument to the provided block every time the task is +# executed. +# +# The `TimerTask` class includes the `Dereferenceable` mixin module so the +# result of the last execution is always available via the `#value` method. +# Dereferencing options can be passed to the `TimerTask` during construction or +# at any later time using the `#set_deref_options` method. +# +# `TimerTask` supports notification through the Ruby standard library +# {http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html +# Observable} module. On execution the `TimerTask` will notify the observers +# with three arguments: time of execution, the result of the block (or nil on +# failure), and any raised exceptions (or nil on success). +# +# @!macro copy_options +# +# @example Basic usage +# task = Concurrent::TimerTask.new{ puts 'Boom!' } +# task.execute +# +# task.execution_interval #=> 60 (default) +# +# # wait 60 seconds... +# #=> 'Boom!' +# +# task.shutdown #=> true +# +# @example Configuring `:execution_interval` +# task = Concurrent::TimerTask.new(execution_interval: 5) do +# puts 'Boom!' +# end +# +# task.execution_interval #=> 5 +# +# @example Immediate execution with `:run_now` +# task = Concurrent::TimerTask.new(run_now: true){ puts 'Boom!' } +# task.execute +# +# #=> 'Boom!' +# +# @example Configuring `:interval_type` with either :fixed_delay or :fixed_rate, default is :fixed_delay +# task = Concurrent::TimerTask.new(execution_interval: 5, interval_type: :fixed_rate) do +# puts 'Boom!' +# end +# task.interval_type #=> :fixed_rate +# +# @example Last `#value` and `Dereferenceable` mixin +# task = Concurrent::TimerTask.new( +# dup_on_deref: true, +# execution_interval: 5 +# ){ Time.now } +# +# task.execute +# Time.now #=> 2013-11-07 18:06:50 -0500 +# sleep(10) +# task.value #=> 2013-11-07 18:06:55 -0500 +# +# @example Controlling execution from within the block +# timer_task = Concurrent::TimerTask.new(execution_interval: 1) do |task| +# task.execution_interval.to_i.times{ print 'Boom! ' } +# print "\n" +# task.execution_interval += 1 +# if task.execution_interval > 5 +# puts 'Stopping...' +# task.shutdown +# end +# end +# +# timer_task.execute +# #=> Boom! +# #=> Boom! Boom! +# #=> Boom! Boom! Boom! +# #=> Boom! Boom! Boom! Boom! +# #=> Boom! Boom! Boom! Boom! Boom! +# #=> Stopping... +# +# @example Observation +# class TaskObserver +# def update(time, result, ex) +# if result +# print "(#{time}) Execution successfully returned #{result}\n" +# else +# print "(#{time}) Execution failed with error #{ex}\n" +# end +# end +# end +# +# task = Concurrent::TimerTask.new(execution_interval: 1){ 42 } +# task.add_observer(TaskObserver.new) +# task.execute +# sleep 4 +# +# #=> (2013-10-13 19:08:58 -0400) Execution successfully returned 42 +# #=> (2013-10-13 19:08:59 -0400) Execution successfully returned 42 +# #=> (2013-10-13 19:09:00 -0400) Execution successfully returned 42 +# task.shutdown +# +# task = Concurrent::TimerTask.new(execution_interval: 1){ sleep } +# task.add_observer(TaskObserver.new) +# task.execute +# +# #=> (2013-10-13 19:07:25 -0400) Execution timed out +# #=> (2013-10-13 19:07:27 -0400) Execution timed out +# #=> (2013-10-13 19:07:29 -0400) Execution timed out +# task.shutdown +# +# task = Concurrent::TimerTask.new(execution_interval: 1){ raise StandardError } +# task.add_observer(TaskObserver.new) +# task.execute +# +# #=> (2013-10-13 19:09:37 -0400) Execution failed with error StandardError +# #=> (2013-10-13 19:09:38 -0400) Execution failed with error StandardError +# #=> (2013-10-13 19:09:39 -0400) Execution failed with error StandardError +# task.shutdown +# +# @see http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html +# @see http://docs.oracle.com/javase/7/docs/api/java/util/TimerTask.html +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:166 +class Concurrent::TimerTask < ::Concurrent::RubyExecutorService + include ::Concurrent::Concern::Dereferenceable + include ::Concurrent::Concern::Observable + + # Create a new TimerTask with the given task and configuration. + # + # @!macro timer_task_initialize + # @param [Hash] opts the options defining task execution. + # @option opts [Float] :execution_interval number of seconds between + # task executions (default: EXECUTION_INTERVAL) + # @option opts [Boolean] :run_now Whether to run the task immediately + # upon instantiation or to wait until the first # execution_interval + # has passed (default: false) + # @options opts [Symbol] :interval_type method to calculate the interval + # between executions, can be either :fixed_rate or :fixed_delay. + # (default: :fixed_delay) + # @option opts [Executor] executor, default is `global_io_executor` + # + # @!macro deref_options + # + # @raise ArgumentError when no block is given. + # + # @yield to the block after :execution_interval seconds have passed since + # the last yield + # @yieldparam task a reference to the `TimerTask` instance so that the + # block can control its own lifecycle. Necessary since `self` will + # refer to the execution context of the block rather than the running + # `TimerTask`. + # + # @return [TimerTask] the new `TimerTask` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:210 + def initialize(opts = T.unsafe(nil), &task); end + + # Execute a previously created `TimerTask`. + # + # @return [TimerTask] a reference to `self` + # + # @example Instance and execute in separate steps + # task = Concurrent::TimerTask.new(execution_interval: 10){ print "Hello World\n" } + # task.running? #=> false + # task.execute + # task.running? #=> true + # + # @example Instance and execute in one line + # task = Concurrent::TimerTask.new(execution_interval: 10){ print "Hello World\n" }.execute + # task.running? #=> true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:236 + def execute; end + + # @!attribute [rw] execution_interval + # @return [Fixnum] Number of seconds after the task completes before the + # task is performed again. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:261 + def execution_interval; end + + # @!attribute [rw] execution_interval + # @return [Fixnum] Number of seconds after the task completes before the + # task is performed again. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:268 + def execution_interval=(value); end + + # @!attribute [r] interval_type + # @return [Symbol] method to calculate the interval between executions + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:278 + def interval_type; end + + # Is the executor running? + # + # @return [Boolean] `true` when running, `false` when shutting down or shutdown + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:219 + def running?; end + + # @!attribute [rw] timeout_interval + # @return [Fixnum] Number of seconds the task can run before it is + # considered to have failed. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:283 + def timeout_interval; end + + # @!attribute [rw] timeout_interval + # @return [Fixnum] Number of seconds the task can run before it is + # considered to have failed. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:290 + def timeout_interval=(value); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:294 + def <<(task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:357 + def calculate_next_interval(start_time); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:339 + def execute_task(completion, age_when_scheduled); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:298 + def ns_initialize(opts, &task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:327 + def ns_kill_execution; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:321 + def ns_shutdown_execution; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:294 + def post(*args, &task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:333 + def schedule_next_task(interval = T.unsafe(nil)); end + + class << self + # Create and execute a new `TimerTask`. + # + # @!macro timer_task_initialize + # + # @example + # task = Concurrent::TimerTask.execute(execution_interval: 10){ print "Hello World\n" } + # task.running? #=> true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:254 + def execute(opts = T.unsafe(nil), &task); end + end +end + +# Default `:interval_type` +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:182 +Concurrent::TimerTask::DEFAULT_INTERVAL_TYPE = T.let(T.unsafe(nil), Symbol) + +# Default `:execution_interval` in seconds. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:171 +Concurrent::TimerTask::EXECUTION_INTERVAL = T.let(T.unsafe(nil), Integer) + +# Maintain the interval between the end of one execution and the start of the next execution. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:174 +Concurrent::TimerTask::FIXED_DELAY = T.let(T.unsafe(nil), Symbol) + +# Maintain the interval between the start of one execution and the start of the next. +# If execution time exceeds the interval, the next execution will start immediately +# after the previous execution finishes. Executions will not run concurrently. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:179 +Concurrent::TimerTask::FIXED_RATE = T.let(T.unsafe(nil), Symbol) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:153 +class Concurrent::Transaction + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:162 + def initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:192 + def abort; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:196 + def commit; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:177 + def open(tvar); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:166 + def read(tvar); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:206 + def unlock; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:171 + def write(tvar, value); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:212 + def current; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:216 + def current=(transaction); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:155 +Concurrent::Transaction::ABORTED = T.let(T.unsafe(nil), Object) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:159 +class Concurrent::Transaction::AbortError < ::StandardError; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:160 +class Concurrent::Transaction::LeaveError < ::StandardError; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 +class Concurrent::Transaction::OpenEntry < ::Struct + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def modified; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def modified=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def value; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def value=(_); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def [](*_arg0); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def keyword_init?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def new(*_arg0); end + end +end + +# A fixed size array with volatile (synchronized, thread safe) getters/setters. +# Mixes in Ruby's `Enumerable` module for enhanced search, sort, and traversal. +# +# @example +# tuple = Concurrent::Tuple.new(16) +# +# tuple.set(0, :foo) #=> :foo | volatile write +# tuple.get(0) #=> :foo | volatile read +# tuple.compare_and_set(0, :foo, :bar) #=> true | strong CAS +# tuple.cas(0, :foo, :baz) #=> false | strong CAS +# tuple.get(0) #=> :bar | volatile read +# +# @see https://en.wikipedia.org/wiki/Tuple Tuple entry at Wikipedia +# @see http://www.erlang.org/doc/reference_manual/data_types.html#id70396 Erlang Tuple +# @see http://ruby-doc.org/core-2.2.2/Enumerable.html Enumerable +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:20 +class Concurrent::Tuple + include ::Enumerable + + # Create a new tuple of the given size. + # + # @param [Integer] size the number of elements in the tuple + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:29 + def initialize(size); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:73 + def cas(i, old_value, new_value); end + + # Set the value at the given index to the new value if and only if the current + # value matches the given old value. + # + # @param [Integer] i the index for the element to set + # @param [Object] old_value the value to compare against the current value + # @param [Object] new_value the value to set at the given index + # + # @return [Boolean] true if the value at the given element was set else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:69 + def compare_and_set(i, old_value, new_value); end + + # Calls the given block once for each element in self, passing that element as a parameter. + # + # @yieldparam [Object] ref the `Concurrent::AtomicReference` object at the current index + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:78 + def each; end + + # Get the value of the element at the given index. + # + # @param [Integer] i the index from which to retrieve the value + # @return [Object] the value at the given index or nil if the index is out of bounds + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:43 + def get(i); end + + # Set the element at the given index to the given value + # + # @param [Integer] i the index for the element to set + # @param [Object] value the value to set at the given index + # + # @return [Object] the new value of the element at the given index or nil if the index is out of bounds + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:55 + def set(i, value); end + + # The (fixed) size of the tuple. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:24 + def size; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:47 + def volatile_get(i); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:59 + def volatile_set(i, value); end +end + +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:3 +module Concurrent::Utility; end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:6 +module Concurrent::Utility::EngineDetector + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:7 + def on_cruby?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:11 + def on_jruby?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:27 + def on_linux?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:23 + def on_osx?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:15 + def on_truffleruby?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:19 + def on_windows?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:31 + def ruby_version(version = T.unsafe(nil), comparison, major, minor, patch); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:9 +module Concurrent::Utility::NativeExtensionLoader + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:11 + def allow_c_extensions?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:15 + def c_extensions_loaded?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:19 + def load_native_extensions; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:50 + def java_extensions_loaded?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:38 + def load_error_path(error); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:46 + def set_c_extensions_loaded; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:54 + def set_java_extensions_loaded; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:58 + def try_load_c_extension(path); end +end + +# @private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:5 +module Concurrent::Utility::NativeInteger + extend ::Concurrent::Utility::NativeInteger + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:24 + def ensure_integer(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:31 + def ensure_integer_and_bounds(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:17 + def ensure_lower_bound(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:37 + def ensure_positive(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:44 + def ensure_positive_and_no_zero(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:10 + def ensure_upper_bound(value); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:8 +Concurrent::Utility::NativeInteger::MAX_VALUE = T.let(T.unsafe(nil), Integer) + +# http://stackoverflow.com/questions/535721/ruby-max-integer +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:7 +Concurrent::Utility::NativeInteger::MIN_VALUE = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:10 +class Concurrent::Utility::ProcessorCounter + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:11 + def initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:26 + def available_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:41 + def cpu_quota; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:45 + def cpu_shares; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:22 + def physical_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:18 + def processor_count; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:104 + def compute_cpu_quota; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:124 + def compute_cpu_shares; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:59 + def compute_physical_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:51 + def compute_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:99 + def run(command); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/version.rb:2 +Concurrent::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/connection_pool@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/crass@1.0.6.rbi b/sorbet/rbi/gems/crass@1.0.6.rbi new file mode 100644 index 0000000..ef7740f --- /dev/null +++ b/sorbet/rbi/gems/crass@1.0.6.rbi @@ -0,0 +1,601 @@ +# 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. +# +# pkg:gem/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_. + # + # pkg:gem/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_. + # + # pkg:gem/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 +# +# pkg:gem/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_. + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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_. + # + # pkg:gem/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! + # + # pkg:gem/crass#lib/crass/parser.rb:466 + def create_selector(input); end + + # Creates a `:style_rule` node from the given qualified _rule_, and returns + # it. + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/crass#lib/crass/parser.rb:615 + def parse_value(nodes); end + + # {TokenScanner} wrapping the tokens generated from this parser's input. + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/crass#lib/crass/parser.rb:74 + def stringify(nodes, options = T.unsafe(nil)); end + end +end + +# pkg:gem/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. +# +# pkg:gem/crass#lib/crass/scanner.rb:8 +class Crass::Scanner + # Creates a Scanner instance for the given _input_ string or IO instance. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/crass#lib/crass/scanner.rb:11 + def current; end + + # Returns `true` if the end of the string has been reached, `false` + # otherwise. + # + # pkg:gem/crass#lib/crass/scanner.rb:57 + def eos?; end + + # Sets the marker to the position of the next character that will be + # consumed. + # + # pkg:gem/crass#lib/crass/scanner.rb:63 + def mark; end + + # Returns the substring between {#marker} and {#pos}, without altering the + # pointer. + # + # pkg:gem/crass#lib/crass/scanner.rb:69 + def marked; end + + # Current marker position. Use {#marked} to get the substring between + # {#marker} and {#pos}. + # + # pkg:gem/crass#lib/crass/scanner.rb:15 + def marker; end + + # Current marker position. Use {#marked} to get the substring between + # {#marker} and {#pos}. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/crass#lib/crass/scanner.rb:87 + def reconsume; end + + # Resets the pointer to the beginning of the string. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/crass#lib/crass/scanner.rb:115 + def scan_until(pattern); end + + # String being scanned. + # + # pkg:gem/crass#lib/crass/scanner.rb:22 + def string; end +end + +# Like {Scanner}, but for tokens! +# +# pkg:gem/crass#lib/crass/token-scanner.rb:6 +class Crass::TokenScanner + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/crass#lib/crass/token-scanner.rb:24 + def consume; end + + # pkg:gem/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. + # + # pkg:gem/crass#lib/crass/token-scanner.rb:32 + def peek; end + + # pkg:gem/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 + # + # pkg:gem/crass#lib/crass/token-scanner.rb:39 + def reconsume; end + + # Resets the pointer to the first token in the list. + # + # pkg:gem/crass#lib/crass/token-scanner.rb:44 + def reset; end + + # pkg:gem/crass#lib/crass/token-scanner.rb:7 + def tokens; end +end + +# Tokenizes a CSS string. +# +# 4. http://dev.w3.org/csswg/css-syntax/#tokenization +# +# pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/crass#lib/crass/tokenizer.rb:590 + def convert_string_to_number(str); end + + # Creates and returns a new token with the given _properties_. + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/crass#lib/crass/tokenizer.rb:666 + def start_number?(text = T.unsafe(nil)); end + + # Tokenizes the input stream and returns an array of tokens. + # + # pkg:gem/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 + # + # pkg:gem/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_. + # + # pkg:gem/crass#lib/crass/tokenizer.rb:45 + def tokenize(input, options = T.unsafe(nil)); end + end +end + +# pkg:gem/crass#lib/crass/tokenizer.rb:10 +Crass::Tokenizer::RE_COMMENT_CLOSE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:11 +Crass::Tokenizer::RE_DIGIT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:12 +Crass::Tokenizer::RE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:13 +Crass::Tokenizer::RE_HEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:14 +Crass::Tokenizer::RE_NAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:15 +Crass::Tokenizer::RE_NAME_START = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:16 +Crass::Tokenizer::RE_NON_PRINTABLE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:17 +Crass::Tokenizer::RE_NUMBER_DECIMAL = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:18 +Crass::Tokenizer::RE_NUMBER_EXPONENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:19 +Crass::Tokenizer::RE_NUMBER_SIGN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:21 +Crass::Tokenizer::RE_NUMBER_STR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:33 +Crass::Tokenizer::RE_QUOTED_URL_START = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:35 +Crass::Tokenizer::RE_UNICODE_RANGE_END = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:34 +Crass::Tokenizer::RE_UNICODE_RANGE_START = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:36 +Crass::Tokenizer::RE_WHITESPACE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:37 +Crass::Tokenizer::RE_WHITESPACE_ANCHORED = T.let(T.unsafe(nil), Regexp) diff --git a/sorbet/rbi/gems/date@3.5.1.rbi b/sorbet/rbi/gems/date@3.5.1.rbi new file mode 100644 index 0000000..2135e86 --- /dev/null +++ b/sorbet/rbi/gems/date@3.5.1.rbi @@ -0,0 +1,391 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `date` gem. +# Please instead update this file by running `bin/tapioca gem date`. + + +# pkg:gem/date#lib/date.rb:4 +class Date + include ::Comparable + + # pkg:gem/date#lib/date.rb:4 + def initialize(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def +(other); end + + # pkg:gem/date#lib/date.rb:4 + def -(other); end + + # pkg:gem/date#lib/date.rb:4 + def <<(_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def <=>(other); end + + # pkg:gem/date#lib/date.rb:4 + def ===(_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def >>(_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def ajd; end + + # pkg:gem/date#lib/date.rb:4 + def amjd; end + + # pkg:gem/date#lib/date.rb:4 + def asctime; end + + # pkg:gem/date#lib/date.rb:4 + def ctime; end + + # pkg:gem/date#lib/date.rb:4 + def cwday; end + + # pkg:gem/date#lib/date.rb:4 + def cweek; end + + # pkg:gem/date#lib/date.rb:4 + def cwyear; end + + # pkg:gem/date#lib/date.rb:4 + def day; end + + # pkg:gem/date#lib/date.rb:4 + def day_fraction; end + + # pkg:gem/date#lib/date.rb:4 + def deconstruct_keys(_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def downto(_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def england; end + + # pkg:gem/date#lib/date.rb:4 + def eql?(_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def friday?; end + + # pkg:gem/date#lib/date.rb:4 + def gregorian; end + + # pkg:gem/date#lib/date.rb:4 + def gregorian?; end + + # pkg:gem/date#lib/date.rb:4 + def hash; end + + # pkg:gem/date#lib/date.rb:4 + def httpdate; end + + # call-seq: + # infinite? -> false + # + # Returns +false+ + # + # pkg:gem/date#lib/date.rb:13 + def infinite?; end + + # pkg:gem/date#lib/date.rb:4 + def inspect; end + + # pkg:gem/date#lib/date.rb:4 + def iso8601; end + + # pkg:gem/date#lib/date.rb:4 + def italy; end + + # pkg:gem/date#lib/date.rb:4 + def jd; end + + # pkg:gem/date#lib/date.rb:4 + def jisx0301; end + + # pkg:gem/date#lib/date.rb:4 + def julian; end + + # pkg:gem/date#lib/date.rb:4 + def julian?; end + + # pkg:gem/date#lib/date.rb:4 + def ld; end + + # pkg:gem/date#lib/date.rb:4 + def leap?; end + + # pkg:gem/date#lib/date.rb:4 + def marshal_dump; end + + # pkg:gem/date#lib/date.rb:4 + def marshal_load(_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def mday; end + + # pkg:gem/date#lib/date.rb:4 + def mjd; end + + # pkg:gem/date#lib/date.rb:4 + def mon; end + + # pkg:gem/date#lib/date.rb:4 + def monday?; end + + # pkg:gem/date#lib/date.rb:4 + def month; end + + # pkg:gem/date#lib/date.rb:4 + def new_start(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def next; end + + # pkg:gem/date#lib/date.rb:4 + def next_day(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def next_month(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def next_year(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def prev_day(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def prev_month(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def prev_year(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def rfc2822; end + + # pkg:gem/date#lib/date.rb:4 + def rfc3339; end + + # pkg:gem/date#lib/date.rb:4 + def rfc822; end + + # pkg:gem/date#lib/date.rb:4 + def saturday?; end + + # pkg:gem/date#lib/date.rb:4 + def start; end + + # pkg:gem/date#lib/date.rb:4 + def step(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def strftime(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def succ; end + + # pkg:gem/date#lib/date.rb:4 + def sunday?; end + + # pkg:gem/date#lib/date.rb:4 + def thursday?; end + + # pkg:gem/date#lib/date.rb:4 + def to_date; end + + # pkg:gem/date#lib/date.rb:4 + def to_datetime; end + + # pkg:gem/date#lib/date.rb:4 + def to_s; end + + # pkg:gem/date#lib/date.rb:4 + def to_time(form = T.unsafe(nil)); end + + # pkg:gem/date#lib/date.rb:4 + def tuesday?; end + + # pkg:gem/date#lib/date.rb:4 + def upto(_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def wday; end + + # pkg:gem/date#lib/date.rb:4 + def wednesday?; end + + # pkg:gem/date#lib/date.rb:4 + def xmlschema; end + + # pkg:gem/date#lib/date.rb:4 + def yday; end + + # pkg:gem/date#lib/date.rb:4 + def year; end + + private + + # pkg:gem/date#lib/date.rb:4 + def hour; end + + # pkg:gem/date#lib/date.rb:4 + def initialize_copy(_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def min; end + + # pkg:gem/date#lib/date.rb:4 + def minute; end + + # pkg:gem/date#lib/date.rb:4 + def sec; end + + # pkg:gem/date#lib/date.rb:4 + def second; end + + class << self + # pkg:gem/date#lib/date.rb:4 + def _httpdate(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def _iso8601(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def _jisx0301(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def _load(_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def _parse(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def _rfc2822(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def _rfc3339(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def _rfc822(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def _strptime(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def _xmlschema(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def civil(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def commercial(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def gregorian_leap?(_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def httpdate(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def iso8601(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def jd(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def jisx0301(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def julian_leap?(_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def leap?(_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def ordinal(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def parse(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def rfc2822(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def rfc3339(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def rfc822(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def strptime(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def today(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def valid_civil?(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def valid_commercial?(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def valid_date?(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def valid_jd?(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def valid_ordinal?(*_arg0); end + + # pkg:gem/date#lib/date.rb:4 + def xmlschema(*_arg0); end + end +end + +# pkg:gem/date#lib/date.rb:17 +class Date::Infinity < ::Numeric + # pkg:gem/date#lib/date.rb:19 + def initialize(d = T.unsafe(nil)); end + + # pkg:gem/date#lib/date.rb:33 + def +@; end + + # pkg:gem/date#lib/date.rb:32 + def -@; end + + # pkg:gem/date#lib/date.rb:35 + def <=>(other); end + + # pkg:gem/date#lib/date.rb:30 + def abs; end + + # pkg:gem/date#lib/date.rb:51 + def coerce(other); end + + # pkg:gem/date#lib/date.rb:26 + def finite?; end + + # pkg:gem/date#lib/date.rb:27 + def infinite?; end + + # pkg:gem/date#lib/date.rb:28 + def nan?; end + + # pkg:gem/date#lib/date.rb:59 + def to_f; end + + # pkg:gem/date#lib/date.rb:25 + def zero?; end + + protected + + # pkg:gem/date#lib/date.rb:21 + def d; end +end + +# pkg:gem/date#lib/date.rb:7 +Date::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/drb@2.2.3.rbi b/sorbet/rbi/gems/drb@2.2.3.rbi new file mode 100644 index 0000000..a8dd54b --- /dev/null +++ b/sorbet/rbi/gems/drb@2.2.3.rbi @@ -0,0 +1,1589 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `drb` gem. +# Please instead update this file by running `bin/tapioca gem drb`. + + +# == Overview +# +# dRuby is a distributed object system for Ruby. It is written in +# pure Ruby and uses its own protocol. No add-in services are needed +# beyond those provided by the Ruby runtime, such as TCP sockets. It +# does not rely on or interoperate with other distributed object +# systems such as CORBA, RMI, or .NET. +# +# dRuby allows methods to be called in one Ruby process upon a Ruby +# object located in another Ruby process, even on another machine. +# References to objects can be passed between processes. Method +# arguments and return values are dumped and loaded in marshalled +# format. All of this is done transparently to both the caller of the +# remote method and the object that it is called upon. +# +# An object in a remote process is locally represented by a +# DRb::DRbObject instance. This acts as a sort of proxy for the +# remote object. Methods called upon this DRbObject instance are +# forwarded to its remote object. This is arranged dynamically at run +# time. There are no statically declared interfaces for remote +# objects, such as CORBA's IDL. +# +# dRuby calls made into a process are handled by a DRb::DRbServer +# instance within that process. This reconstitutes the method call, +# invokes it upon the specified local object, and returns the value to +# the remote caller. Any object can receive calls over dRuby. There +# is no need to implement a special interface, or mixin special +# functionality. Nor, in the general case, does an object need to +# explicitly register itself with a DRbServer in order to receive +# dRuby calls. +# +# One process wishing to make dRuby calls upon another process must +# somehow obtain an initial reference to an object in the remote +# process by some means other than as the return value of a remote +# method call, as there is initially no remote object reference it can +# invoke a method upon. This is done by attaching to the server by +# URI. Each DRbServer binds itself to a URI such as +# 'druby://example.com:8787'. A DRbServer can have an object attached +# to it that acts as the server's *front* *object*. A DRbObject can +# be explicitly created from the server's URI. This DRbObject's +# remote object will be the server's front object. This front object +# can then return references to other Ruby objects in the DRbServer's +# process. +# +# Method calls made over dRuby behave largely the same as normal Ruby +# method calls made within a process. Method calls with blocks are +# supported, as are raising exceptions. In addition to a method's +# standard errors, a dRuby call may also raise one of the +# dRuby-specific errors, all of which are subclasses of DRb::DRbError. +# +# Any type of object can be passed as an argument to a dRuby call or +# returned as its return value. By default, such objects are dumped +# or marshalled at the local end, then loaded or unmarshalled at the +# remote end. The remote end therefore receives a copy of the local +# object, not a distributed reference to it; methods invoked upon this +# copy are executed entirely in the remote process, not passed on to +# the local original. This has semantics similar to pass-by-value. +# +# However, if an object cannot be marshalled, a dRuby reference to it +# is passed or returned instead. This will turn up at the remote end +# as a DRbObject instance. All methods invoked upon this remote proxy +# are forwarded to the local object, as described in the discussion of +# DRbObjects. This has semantics similar to the normal Ruby +# pass-by-reference. +# +# The easiest way to signal that we want an otherwise marshallable +# object to be passed or returned as a DRbObject reference, rather +# than marshalled and sent as a copy, is to include the +# DRb::DRbUndumped mixin module. +# +# dRuby supports calling remote methods with blocks. As blocks (or +# rather the Proc objects that represent them) are not marshallable, +# the block executes in the local, not the remote, context. Each +# value yielded to the block is passed from the remote object to the +# local block, then the value returned by each block invocation is +# passed back to the remote execution context to be collected, before +# the collected values are finally returned to the local context as +# the return value of the method invocation. +# +# == Examples of usage +# +# For more dRuby samples, see the +samples+ directory in the full +# dRuby distribution. +# +# === dRuby in client/server mode +# +# This illustrates setting up a simple client-server drb +# system. Run the server and client code in different terminals, +# starting the server code first. +# +# ==== Server code +# +# require 'drb/drb' +# +# # The URI for the server to connect to +# URI="druby://localhost:8787" +# +# class TimeServer +# +# def get_current_time +# return Time.now +# end +# +# end +# +# # The object that handles requests on the server +# FRONT_OBJECT=TimeServer.new +# +# DRb.start_service(URI, FRONT_OBJECT) +# # Wait for the drb server thread to finish before exiting. +# DRb.thread.join +# +# ==== Client code +# +# require 'drb/drb' +# +# # The URI to connect to +# SERVER_URI="druby://localhost:8787" +# +# # Start a local DRbServer to handle callbacks. +# # +# # Not necessary for this small example, but will be required +# # as soon as we pass a non-marshallable object as an argument +# # to a dRuby call. +# # +# # Note: this must be called at least once per process to take any effect. +# # This is particularly important if your application forks. +# DRb.start_service +# +# timeserver = DRbObject.new_with_uri(SERVER_URI) +# puts timeserver.get_current_time +# +# === Remote objects under dRuby +# +# This example illustrates returning a reference to an object +# from a dRuby call. The Logger instances live in the server +# process. References to them are returned to the client process, +# where methods can be invoked upon them. These methods are +# executed in the server process. +# +# ==== Server code +# +# require 'drb/drb' +# +# URI="druby://localhost:8787" +# +# class Logger +# +# # Make dRuby send Logger instances as dRuby references, +# # not copies. +# include DRb::DRbUndumped +# +# def initialize(n, fname) +# @name = n +# @filename = fname +# end +# +# def log(message) +# File.open(@filename, "a") do |f| +# f.puts("#{Time.now}: #{@name}: #{message}") +# end +# end +# +# end +# +# # We have a central object for creating and retrieving loggers. +# # This retains a local reference to all loggers created. This +# # is so an existing logger can be looked up by name, but also +# # to prevent loggers from being garbage collected. A dRuby +# # reference to an object is not sufficient to prevent it being +# # garbage collected! +# class LoggerFactory +# +# def initialize(bdir) +# @basedir = bdir +# @loggers = {} +# end +# +# def get_logger(name) +# if !@loggers.has_key? name +# # make the filename safe, then declare it to be so +# fname = name.gsub(/[.\/\\\:]/, "_") +# @loggers[name] = Logger.new(name, @basedir + "/" + fname) +# end +# return @loggers[name] +# end +# +# end +# +# FRONT_OBJECT=LoggerFactory.new("/tmp/dlog") +# +# DRb.start_service(URI, FRONT_OBJECT) +# DRb.thread.join +# +# ==== Client code +# +# require 'drb/drb' +# +# SERVER_URI="druby://localhost:8787" +# +# DRb.start_service +# +# log_service=DRbObject.new_with_uri(SERVER_URI) +# +# ["loga", "logb", "logc"].each do |logname| +# +# logger=log_service.get_logger(logname) +# +# logger.log("Hello, world!") +# logger.log("Goodbye, world!") +# logger.log("=== EOT ===") +# +# end +# +# == Security +# +# As with all network services, security needs to be considered when +# using dRuby. By allowing external access to a Ruby object, you are +# not only allowing outside clients to call the methods you have +# defined for that object, but by default to execute arbitrary Ruby +# code on your server. Consider the following: +# +# # !!! UNSAFE CODE !!! +# ro = DRbObject::new_with_uri("druby://your.server.com:8989") +# class << ro +# undef :instance_eval # force call to be passed to remote object +# end +# ro.instance_eval("`rm -rf *`") +# +# The dangers posed by instance_eval and friends are such that a +# DRbServer should only be used when clients are trusted. +# +# A DRbServer can be configured with an access control list to +# selectively allow or deny access from specified IP addresses. The +# main druby distribution provides the ACL class for this purpose. In +# general, this mechanism should only be used alongside, rather than +# as a replacement for, a good firewall. +# +# == dRuby internals +# +# dRuby is implemented using three main components: a remote method +# call marshaller/unmarshaller; a transport protocol; and an +# ID-to-object mapper. The latter two can be directly, and the first +# indirectly, replaced, in order to provide different behaviour and +# capabilities. +# +# Marshalling and unmarshalling of remote method calls is performed by +# a DRb::DRbMessage instance. This uses the Marshal module to dump +# the method call before sending it over the transport layer, then +# reconstitute it at the other end. There is normally no need to +# replace this component, and no direct way is provided to do so. +# However, it is possible to implement an alternative marshalling +# scheme as part of an implementation of the transport layer. +# +# The transport layer is responsible for opening client and server +# network connections and forwarding dRuby request across them. +# Normally, it uses DRb::DRbMessage internally to manage marshalling +# and unmarshalling. The transport layer is managed by +# DRb::DRbProtocol. Multiple protocols can be installed in +# DRbProtocol at the one time; selection between them is determined by +# the scheme of a dRuby URI. The default transport protocol is +# selected by the scheme 'druby:', and implemented by +# DRb::DRbTCPSocket. This uses plain TCP/IP sockets for +# communication. An alternative protocol, using UNIX domain sockets, +# is implemented by DRb::DRbUNIXSocket in the file drb/unix.rb, and +# selected by the scheme 'drbunix:'. A sample implementation over +# HTTP can be found in the samples accompanying the main dRuby +# distribution. +# +# The ID-to-object mapping component maps dRuby object ids to the +# objects they refer to, and vice versa. The implementation to use +# can be specified as part of a DRb::DRbServer's configuration. The +# default implementation is provided by DRb::DRbIdConv. It uses an +# object's ObjectSpace id as its dRuby id. This means that the dRuby +# reference to that object only remains meaningful for the lifetime of +# the object's process and the lifetime of the object within that +# process. A modified implementation is provided by DRb::TimerIdConv +# in the file drb/timeridconv.rb. This implementation retains a local +# reference to all objects exported over dRuby for a configurable +# period of time (defaulting to ten minutes), to prevent them being +# garbage-collected within this time. Another sample implementation +# is provided in sample/name.rb in the main dRuby distribution. This +# allows objects to specify their own id or "name". A dRuby reference +# can be made persistent across processes by having each process +# register an object using the same dRuby name. +# +# pkg:gem/drb#lib/drb/eq.rb:2 +module DRb + private + + # Get the configuration of the current server. + # + # If there is no current server, this returns the default configuration. + # See #current_server and DRbServer::make_config. + # + # pkg:gem/drb#lib/drb/drb.rb:1882 + def config; end + + # Get the 'current' server. + # + # In the context of execution taking place within the main + # thread of a dRuby server (typically, as a result of a remote + # call on the server or one of its objects), the current + # server is that server. Otherwise, the current server is + # the primary server. + # + # If the above rule fails to find a server, a DRbServerNotFound + # error is raised. + # + # pkg:gem/drb#lib/drb/drb.rb:1839 + def current_server; end + + # Retrieves the server with the given +uri+. + # + # See also regist_server and remove_server. + # + # pkg:gem/drb#lib/drb/drb.rb:1984 + def fetch_server(uri); end + + # Get the front object of the current server. + # + # This raises a DRbServerNotFound error if there is no current server. + # See #current_server. + # + # pkg:gem/drb#lib/drb/drb.rb:1893 + def front; end + + # Is +uri+ the URI for the current local server? + # + # pkg:gem/drb#lib/drb/drb.rb:1872 + def here?(uri); end + + # Set the default ACL to +acl+. + # + # See DRb::DRbServer.default_acl. + # + # pkg:gem/drb#lib/drb/drb.rb:1938 + def install_acl(acl); end + + # Set the default id conversion object. + # + # This is expected to be an instance such as DRb::DRbIdConv that responds to + # #to_id and #to_obj that can convert objects to and from DRb references. + # + # See DRbServer#default_id_conv. + # + # pkg:gem/drb#lib/drb/drb.rb:1930 + def install_id_conv(idconv); end + + # pkg:gem/drb#lib/drb/drb.rb:1944 + def mutex; end + + # The primary local dRuby server. + # + # This is the server created by the #start_service call. + # + # pkg:gem/drb#lib/drb/drb.rb:1826 + def primary_server; end + + # The primary local dRuby server. + # + # This is the server created by the #start_service call. + # + # pkg:gem/drb#lib/drb/drb.rb:1826 + def primary_server=(_arg0); end + + # Registers +server+ with DRb. + # + # This is called when a new DRb::DRbServer is created. + # + # If there is no primary server then +server+ becomes the primary server. + # + # Example: + # + # require 'drb' + # + # s = DRb::DRbServer.new # automatically calls regist_server + # DRb.fetch_server s.uri #=> # + # + # pkg:gem/drb#lib/drb/drb.rb:1962 + def regist_server(server); end + + # Removes +server+ from the list of registered servers. + # + # pkg:gem/drb#lib/drb/drb.rb:1971 + def remove_server(server); end + + # Start a dRuby server locally. + # + # The new dRuby server will become the primary server, even + # if another server is currently the primary server. + # + # +uri+ is the URI for the server to bind to. If nil, + # the server will bind to random port on the default local host + # name and use the default dRuby protocol. + # + # +front+ is the server's front object. This may be nil. + # + # +config+ is the configuration for the new server. This may + # be nil. + # + # See DRbServer::new. + # + # pkg:gem/drb#lib/drb/drb.rb:1818 + def start_service(uri = T.unsafe(nil), front = T.unsafe(nil), config = T.unsafe(nil)); end + + # Stop the local dRuby server. + # + # This operates on the primary server. If there is no primary + # server currently running, it is a noop. + # + # pkg:gem/drb#lib/drb/drb.rb:1851 + def stop_service; end + + # Get the thread of the primary server. + # + # This returns nil if there is no primary server. See #primary_server. + # + # pkg:gem/drb#lib/drb/drb.rb:1919 + def thread; end + + # Get a reference id for an object using the current server. + # + # This raises a DRbServerNotFound error if there is no current server. + # See #current_server. + # + # pkg:gem/drb#lib/drb/drb.rb:1910 + def to_id(obj); end + + # Convert a reference into an object using the current server. + # + # This raises a DRbServerNotFound error if there is no current server. + # See #current_server. + # + # pkg:gem/drb#lib/drb/drb.rb:1902 + def to_obj(ref); end + + # Get the URI defining the local dRuby space. + # + # This is the URI of the current server. See #current_server. + # + # pkg:gem/drb#lib/drb/drb.rb:1860 + def uri; end + + class << self + # Get the configuration of the current server. + # + # If there is no current server, this returns the default configuration. + # See #current_server and DRbServer::make_config. + # + # pkg:gem/drb#lib/drb/drb.rb:1887 + def config; end + + # Get the 'current' server. + # + # In the context of execution taking place within the main + # thread of a dRuby server (typically, as a result of a remote + # call on the server or one of its objects), the current + # server is that server. Otherwise, the current server is + # the primary server. + # + # If the above rule fails to find a server, a DRbServerNotFound + # error is raised. + # + # pkg:gem/drb#lib/drb/drb.rb:1845 + def current_server; end + + # Retrieves the server with the given +uri+. + # + # See also regist_server and remove_server. + # + # pkg:gem/drb#lib/drb/drb.rb:1987 + def fetch_server(uri); end + + # Get the front object of the current server. + # + # This raises a DRbServerNotFound error if there is no current server. + # See #current_server. + # + # pkg:gem/drb#lib/drb/drb.rb:1896 + def front; end + + # Is +uri+ the URI for the current local server? + # + # pkg:gem/drb#lib/drb/drb.rb:1876 + def here?(uri); end + + # Set the default ACL to +acl+. + # + # See DRb::DRbServer.default_acl. + # + # pkg:gem/drb#lib/drb/drb.rb:1941 + def install_acl(acl); end + + # Set the default id conversion object. + # + # This is expected to be an instance such as DRb::DRbIdConv that responds to + # #to_id and #to_obj that can convert objects to and from DRb references. + # + # See DRbServer#default_id_conv. + # + # pkg:gem/drb#lib/drb/drb.rb:1933 + def install_id_conv(idconv); end + + # pkg:gem/drb#lib/drb/drb.rb:1947 + def mutex; end + + # The primary local dRuby server. + # + # This is the server created by the #start_service call. + # + # pkg:gem/drb#lib/drb/drb.rb:1827 + def primary_server; end + + # pkg:gem/drb#lib/drb/drb.rb:1827 + def primary_server=(_arg0); end + + # Registers +server+ with DRb. + # + # This is called when a new DRb::DRbServer is created. + # + # If there is no primary server then +server+ becomes the primary server. + # + # Example: + # + # require 'drb' + # + # s = DRb::DRbServer.new # automatically calls regist_server + # DRb.fetch_server s.uri #=> # + # + # pkg:gem/drb#lib/drb/drb.rb:1968 + def regist_server(server); end + + # Removes +server+ from the list of registered servers. + # + # pkg:gem/drb#lib/drb/drb.rb:1979 + def remove_server(server); end + + # Start a dRuby server locally. + # + # The new dRuby server will become the primary server, even + # if another server is currently the primary server. + # + # +uri+ is the URI for the server to bind to. If nil, + # the server will bind to random port on the default local host + # name and use the default dRuby protocol. + # + # +front+ is the server's front object. This may be nil. + # + # +config+ is the configuration for the new server. This may + # be nil. + # + # See DRbServer::new. + # + # pkg:gem/drb#lib/drb/drb.rb:1821 + def start_service(uri = T.unsafe(nil), front = T.unsafe(nil), config = T.unsafe(nil)); end + + # Stop the local dRuby server. + # + # This operates on the primary server. If there is no primary + # server currently running, it is a noop. + # + # pkg:gem/drb#lib/drb/drb.rb:1855 + def stop_service; end + + # Get the thread of the primary server. + # + # This returns nil if there is no primary server. See #primary_server. + # + # pkg:gem/drb#lib/drb/drb.rb:1922 + def thread; end + + # Get a reference id for an object using the current server. + # + # This raises a DRbServerNotFound error if there is no current server. + # See #current_server. + # + # pkg:gem/drb#lib/drb/drb.rb:1913 + def to_id(obj); end + + # Convert a reference into an object using the current server. + # + # This raises a DRbServerNotFound error if there is no current server. + # See #current_server. + # + # pkg:gem/drb#lib/drb/drb.rb:1914 + def to_obj(ref); end + + # Get the URI defining the local dRuby space. + # + # This is the URI of the current server. See #current_server. + # + # pkg:gem/drb#lib/drb/drb.rb:1869 + def uri; end + end +end + +# This is an internal singleton instance. This must not be used +# by users. +# +# pkg:gem/drb#lib/drb/drb.rb:382 +DRb::DRB_OBJECT_SPACE = T.let(T.unsafe(nil), DRb::DRbObjectSpace) + +# An Array wrapper that can be sent to another server via DRb. +# +# All entries in the array will be dumped or be references that point to +# the local server. +# +# pkg:gem/drb#lib/drb/drb.rb:546 +class DRb::DRbArray + # Creates a new DRbArray that either dumps or wraps all the items in the + # Array +ary+ so they can be loaded by a remote DRb server. + # + # pkg:gem/drb#lib/drb/drb.rb:551 + def initialize(ary); end + + # pkg:gem/drb#lib/drb/drb.rb:570 + def _dump(lv); end + + class << self + # pkg:gem/drb#lib/drb/drb.rb:566 + def _load(s); end + end +end + +# Class handling the connection between a DRbObject and the +# server the real object lives on. +# +# This class maintains a pool of connections, to reduce the +# overhead of starting and closing down connections for each +# method call. +# +# This class is used internally by DRbObject. The user does +# not normally need to deal with it directly. +# +# pkg:gem/drb#lib/drb/drb.rb:1284 +class DRb::DRbConn + # pkg:gem/drb#lib/drb/drb.rb:1345 + def initialize(remote_uri); end + + # pkg:gem/drb#lib/drb/drb.rb:1361 + def alive?; end + + # pkg:gem/drb#lib/drb/drb.rb:1356 + def close; end + + # pkg:gem/drb#lib/drb/drb.rb:1351 + def send_message(ref, msg_id, arg, block); end + + # pkg:gem/drb#lib/drb/drb.rb:1349 + def uri; end + + class << self + # pkg:gem/drb#lib/drb/drb.rb:1287 + def make_pool; end + + # pkg:gem/drb#lib/drb/drb.rb:1325 + def open(remote_uri); end + + # pkg:gem/drb#lib/drb/drb.rb:1320 + def stop_pool; end + end +end + +# Class responsible for converting between an object and its id. +# +# This, the default implementation, uses an object's local ObjectSpace +# __id__ as its id. This means that an object's identification over +# drb remains valid only while that object instance remains alive +# within the server runtime. +# +# For alternative mechanisms, see DRb::TimerIdConv in drb/timeridconv.rb +# and DRbNameIdConv in sample/name.rb in the full drb distribution. +# +# pkg:gem/drb#lib/drb/drb.rb:393 +class DRb::DRbIdConv + # Convert an object into a reference id. + # + # This implementation returns the object's __id__ in the local + # object space. + # + # pkg:gem/drb#lib/drb/drb.rb:407 + def to_id(obj); end + + # Convert an object reference id to an object. + # + # This implementation looks up the reference id in the local object + # space and returns the object it refers to. + # + # pkg:gem/drb#lib/drb/drb.rb:399 + def to_obj(ref); end +end + +# Handler for sending and receiving drb messages. +# +# This takes care of the low-level marshalling and unmarshalling +# of drb requests and responses sent over the wire between server +# and client. This relieves the implementor of a new drb +# protocol layer with having to deal with these details. +# +# The user does not have to directly deal with this object in +# normal use. +# +# pkg:gem/drb#lib/drb/drb.rb:584 +class DRb::DRbMessage + # pkg:gem/drb#lib/drb/drb.rb:585 + def initialize(config); end + + # pkg:gem/drb#lib/drb/drb.rb:590 + def dump(obj, error = T.unsafe(nil)); end + + # pkg:gem/drb#lib/drb/drb.rb:607 + def load(soc); end + + # pkg:gem/drb#lib/drb/drb.rb:667 + def recv_reply(stream); end + + # pkg:gem/drb#lib/drb/drb.rb:647 + def recv_request(stream); end + + # pkg:gem/drb#lib/drb/drb.rb:661 + def send_reply(stream, succ, result); end + + # pkg:gem/drb#lib/drb/drb.rb:633 + def send_request(stream, ref, msg_id, arg, b); end + + private + + # pkg:gem/drb#lib/drb/drb.rb:674 + def make_proxy(obj, error = T.unsafe(nil)); end +end + +# Object wrapping a reference to a remote drb object. +# +# Method calls on this object are relayed to the remote +# object that this object is a stub for. +# +# pkg:gem/drb#lib/drb/eq.rb:3 +class DRb::DRbObject + # Create a new remote object stub. + # + # +obj+ is the (local) object we want to create a stub for. Normally + # this is +nil+. +uri+ is the URI of the remote object that this + # will be a stub for. + # + # pkg:gem/drb#lib/drb/drb.rb:1117 + def initialize(obj, uri = T.unsafe(nil)); end + + # pkg:gem/drb#lib/drb/eq.rb:4 + def ==(other); end + + # Get the reference of the object, if local. + # + # pkg:gem/drb#lib/drb/drb.rb:1143 + def __drbref; end + + # Get the URI of the remote object. + # + # pkg:gem/drb#lib/drb/drb.rb:1138 + def __drburi; end + + # Marshall this object. + # + # The URI and ref of the object are marshalled. + # + # pkg:gem/drb#lib/drb/drb.rb:1108 + def _dump(lv); end + + # pkg:gem/drb#lib/drb/eq.rb:13 + def eql?(other); end + + # pkg:gem/drb#lib/drb/eq.rb:9 + def hash; end + + # pkg:gem/drb#lib/drb/drb.rb:1163 + def method_missing(msg_id, *a, **_arg2, &b); end + + # pkg:gem/drb#lib/drb/drb.rb:1215 + def pretty_print(q); end + + # pkg:gem/drb#lib/drb/drb.rb:1219 + def pretty_print_cycle(q); end + + # Routes respond_to? to the referenced remote object. + # + # pkg:gem/drb#lib/drb/drb.rb:1151 + def respond_to?(msg_id, priv = T.unsafe(nil)); end + + class << self + # Unmarshall a marshalled DRbObject. + # + # If the referenced object is located within the local server, then + # the object itself is returned. Otherwise, a new DRbObject is + # created to act as a stub for the remote referenced object. + # + # pkg:gem/drb#lib/drb/drb.rb:1079 + def _load(s); end + + # Creates a DRb::DRbObject given the reference information to the remote + # host +uri+ and object +ref+. + # + # pkg:gem/drb#lib/drb/drb.rb:1093 + def new_with(uri, ref); end + + # Create a new DRbObject from a URI alone. + # + # pkg:gem/drb#lib/drb/drb.rb:1101 + def new_with_uri(uri); end + + # Returns a modified backtrace from +result+ with the +uri+ where each call + # in the backtrace came from. + # + # pkg:gem/drb#lib/drb/drb.rb:1201 + def prepare_backtrace(uri, result); end + + # Given the +uri+ of another host executes the block provided. + # + # pkg:gem/drb#lib/drb/drb.rb:1188 + def with_friend(uri); end + end +end + +# pkg:gem/drb#lib/drb/drb.rb:351 +class DRb::DRbObjectSpace + include ::MonitorMixin + + # pkg:gem/drb#lib/drb/drb.rb:357 + def initialize; end + + # pkg:gem/drb#lib/drb/drb.rb:362 + def to_id(obj); end + + # pkg:gem/drb#lib/drb/drb.rb:369 + def to_obj(ref); end +end + +# Module managing the underlying network protocol(s) used by drb. +# +# By default, drb uses the DRbTCPSocket protocol. Other protocols +# can be defined. A protocol must define the following class methods: +# +# [open(uri, config)] Open a client connection to the server at +uri+, +# using configuration +config+. Return a protocol +# instance for this connection. +# [open_server(uri, config)] Open a server listening at +uri+, +# using configuration +config+. Return a +# protocol instance for this listener. +# [uri_option(uri, config)] Take a URI, possibly containing an option +# component (e.g. a trailing '?param=val'), +# and return a [uri, option] tuple. +# +# All of these methods should raise a DRbBadScheme error if the URI +# does not identify the protocol they support (e.g. "druby:" for +# the standard Ruby protocol). This is how the DRbProtocol module, +# given a URI, determines which protocol implementation serves that +# protocol. +# +# The protocol instance returned by #open_server must have the +# following methods: +# +# [accept] Accept a new connection to the server. Returns a protocol +# instance capable of communicating with the client. +# [close] Close the server connection. +# [uri] Get the URI for this server. +# +# The protocol instance returned by #open must have the following methods: +# +# [send_request (ref, msg_id, arg, b)] +# Send a request to +ref+ with the given message id and arguments. +# This is most easily implemented by calling DRbMessage.send_request, +# providing a stream that sits on top of the current protocol. +# [recv_reply] +# Receive a reply from the server and return it as a [success-boolean, +# reply-value] pair. This is most easily implemented by calling +# DRb.recv_reply, providing a stream that sits on top of the +# current protocol. +# [alive?] +# Is this connection still alive? +# [close] +# Close this connection. +# +# The protocol instance returned by #open_server().accept() must have +# the following methods: +# +# [recv_request] +# Receive a request from the client and return a [object, message, +# args, block] tuple. This is most easily implemented by calling +# DRbMessage.recv_request, providing a stream that sits on top of +# the current protocol. +# [send_reply(succ, result)] +# Send a reply to the client. This is most easily implemented +# by calling DRbMessage.send_reply, providing a stream that sits +# on top of the current protocol. +# [close] +# Close this connection. +# +# A new protocol is registered with the DRbProtocol module using +# the add_protocol method. +# +# For examples of other protocols, see DRbUNIXSocket in drb/unix.rb, +# and HTTP0 in sample/http0.rb and sample/http0serv.rb in the full +# drb distribution. +# +# pkg:gem/drb#lib/drb/drb.rb:749 +module DRb::DRbProtocol + private + + # Add a new protocol to the DRbProtocol module. + # + # pkg:gem/drb#lib/drb/drb.rb:752 + def add_protocol(prot); end + + # pkg:gem/drb#lib/drb/drb.rb:830 + def auto_load(uri); end + + # Open a client connection to +uri+ with the configuration +config+. + # + # The DRbProtocol module asks each registered protocol in turn to + # try to open the URI. Each protocol signals that it does not handle that + # URI by raising a DRbBadScheme error. If no protocol recognises the + # URI, then a DRbBadURI error is raised. If a protocol accepts the + # URI, but an error occurs in opening it, a DRbConnError is raised. + # + # pkg:gem/drb#lib/drb/drb.rb:764 + def open(uri, config, first = T.unsafe(nil)); end + + # Open a server listening for connections at +uri+ with + # configuration +config+. + # + # The DRbProtocol module asks each registered protocol in turn to + # try to open a server at the URI. Each protocol signals that it does + # not handle that URI by raising a DRbBadScheme error. If no protocol + # recognises the URI, then a DRbBadURI error is raised. If a protocol + # accepts the URI, but an error occurs in opening it, the underlying + # error is passed on to the caller. + # + # pkg:gem/drb#lib/drb/drb.rb:792 + def open_server(uri, config, first = T.unsafe(nil)); end + + # Parse +uri+ into a [uri, option] pair. + # + # The DRbProtocol module asks each registered protocol in turn to + # try to parse the URI. Each protocol signals that it does not handle that + # URI by raising a DRbBadScheme error. If no protocol recognises the + # URI, then a DRbBadURI error is raised. + # + # pkg:gem/drb#lib/drb/drb.rb:813 + def uri_option(uri, config, first = T.unsafe(nil)); end + + class << self + # Add a new protocol to the DRbProtocol module. + # + # pkg:gem/drb#lib/drb/drb.rb:755 + def add_protocol(prot); end + + # pkg:gem/drb#lib/drb/drb.rb:835 + def auto_load(uri); end + + # Open a client connection to +uri+ with the configuration +config+. + # + # The DRbProtocol module asks each registered protocol in turn to + # try to open the URI. Each protocol signals that it does not handle that + # URI by raising a DRbBadScheme error. If no protocol recognises the + # URI, then a DRbBadURI error is raised. If a protocol accepts the + # URI, but an error occurs in opening it, a DRbConnError is raised. + # + # pkg:gem/drb#lib/drb/drb.rb:781 + def open(uri, config, first = T.unsafe(nil)); end + + # Open a server listening for connections at +uri+ with + # configuration +config+. + # + # The DRbProtocol module asks each registered protocol in turn to + # try to open a server at the URI. Each protocol signals that it does + # not handle that URI by raising a DRbBadScheme error. If no protocol + # recognises the URI, then a DRbBadURI error is raised. If a protocol + # accepts the URI, but an error occurs in opening it, the underlying + # error is passed on to the caller. + # + # pkg:gem/drb#lib/drb/drb.rb:805 + def open_server(uri, config, first = T.unsafe(nil)); end + + # Parse +uri+ into a [uri, option] pair. + # + # The DRbProtocol module asks each registered protocol in turn to + # try to parse the URI. Each protocol signals that it does not handle that + # URI by raising a DRbBadScheme error. If no protocol recognises the + # URI, then a DRbBadURI error is raised. + # + # pkg:gem/drb#lib/drb/drb.rb:828 + def uri_option(uri, config, first = T.unsafe(nil)); end + end +end + +# An exception wrapping an error object +# +# pkg:gem/drb#lib/drb/drb.rb:459 +class DRb::DRbRemoteError < ::DRb::DRbError + # Creates a new remote error that wraps the Exception +error+ + # + # pkg:gem/drb#lib/drb/drb.rb:462 + def initialize(error); end + + # the class of the error, as a string. + # + # pkg:gem/drb#lib/drb/drb.rb:469 + def reason; end +end + +# Class representing a drb server instance. +# +# A DRbServer must be running in the local process before any incoming +# dRuby calls can be accepted, or any local objects can be passed as +# dRuby references to remote processes, even if those local objects are +# never actually called remotely. You do not need to start a DRbServer +# in the local process if you are only making outgoing dRuby calls +# passing marshalled parameters. +# +# Unless multiple servers are being used, the local DRbServer is normally +# started by calling DRb.start_service. +# +# pkg:gem/drb#lib/drb/drb.rb:1378 +class DRb::DRbServer + # Create a new DRbServer instance. + # + # +uri+ is the URI to bind to. This is normally of the form + # 'druby://:' where is a hostname of + # the local machine. If nil, then the system's default hostname + # will be bound to, on a port selected by the system; these value + # can be retrieved from the +uri+ attribute. 'druby:' specifies + # the default dRuby transport protocol: another protocol, such + # as 'drbunix:', can be specified instead. + # + # +front+ is the front object for the server, that is, the object + # to which remote method calls on the server will be passed. If + # nil, then the server will not accept remote method calls. + # + # If +config_or_acl+ is a hash, it is the configuration to + # use for this server. The following options are recognised: + # + # :idconv :: an id-to-object conversion object. This defaults + # to an instance of the class DRb::DRbIdConv. + # :verbose :: if true, all unsuccessful remote calls on objects + # in the server will be logged to $stdout. false + # by default. + # :tcp_acl :: the access control list for this server. See + # the ACL class from the main dRuby distribution. + # :load_limit :: the maximum message size in bytes accepted by + # the server. Defaults to 25 MB (26214400). + # :argc_limit :: the maximum number of arguments to a remote + # method accepted by the server. Defaults to + # 256. + # The default values of these options can be modified on + # a class-wide basis by the class methods #default_argc_limit, + # #default_load_limit, #default_acl, #default_id_conv, + # and #verbose= + # + # If +config_or_acl+ is not a hash, but is not nil, it is + # assumed to be the access control list for this server. + # See the :tcp_acl option for more details. + # + # If no other server is currently set as the primary server, + # this will become the primary server. + # + # The server will immediately start running in its own thread. + # + # pkg:gem/drb#lib/drb/drb.rb:1479 + def initialize(uri = T.unsafe(nil), front = T.unsafe(nil), config_or_acl = T.unsafe(nil)); end + + # Is this server alive? + # + # pkg:gem/drb#lib/drb/drb.rb:1534 + def alive?; end + + # Check that a method is callable via dRuby. + # + # +obj+ is the object we want to invoke the method on. +msg_id+ is the + # method name, as a Symbol. + # + # If the method is an insecure method (see #insecure_method?) a + # SecurityError is thrown. If the method is private or undefined, + # a NameError is thrown. + # + # pkg:gem/drb#lib/drb/drb.rb:1622 + def check_insecure_method(obj, msg_id); end + + # The configuration of this DRbServer + # + # pkg:gem/drb#lib/drb/drb.rb:1521 + def config; end + + # The front object of the DRbServer. + # + # This object receives remote method calls made on the server's + # URI alone, with an object id. + # + # pkg:gem/drb#lib/drb/drb.rb:1518 + def front; end + + # Is +uri+ the URI for this server? + # + # pkg:gem/drb#lib/drb/drb.rb:1539 + def here?(uri); end + + # Stop this server. + # + # pkg:gem/drb#lib/drb/drb.rb:1544 + def stop_service; end + + # The main thread of this DRbServer. + # + # This is the thread that listens for and accepts connections + # from clients, not that handles each client's request-response + # session. + # + # pkg:gem/drb#lib/drb/drb.rb:1512 + def thread; end + + # Convert a local object to a dRuby reference. + # + # pkg:gem/drb#lib/drb/drb.rb:1561 + def to_id(obj); end + + # Convert a dRuby reference to the local object it refers to. + # + # pkg:gem/drb#lib/drb/drb.rb:1554 + def to_obj(ref); end + + # The URI of this DRbServer. + # + # pkg:gem/drb#lib/drb/drb.rb:1505 + def uri; end + + # Get whether the server is in verbose mode. + # + # In verbose mode, failed calls are logged to stdout. + # + # pkg:gem/drb#lib/drb/drb.rb:1531 + def verbose; end + + # Set whether to operate in verbose mode. + # + # In verbose mode, failed calls are logged to stdout. + # + # pkg:gem/drb#lib/drb/drb.rb:1526 + def verbose=(v); end + + private + + # Coerce an object to a string, providing our own representation if + # to_s is not defined for the object. + # + # pkg:gem/drb#lib/drb/drb.rb:1608 + def any_to_s(obj); end + + # pkg:gem/drb#lib/drb/drb.rb:1746 + def error_print(exception); end + + # Has a method been included in the list of insecure methods? + # + # pkg:gem/drb#lib/drb/drb.rb:1602 + def insecure_method?(msg_id); end + + # The main loop performed by a DRbServer's internal thread. + # + # Accepts a connection from a client, and starts up its own + # thread to handle it. This thread loops, receiving requests + # from the client, invoking them on a local object, and + # returning responses, until the client closes the connection + # or a local method call fails. + # + # pkg:gem/drb#lib/drb/drb.rb:1764 + def main_loop; end + + # Starts the DRb main loop in a new thread. + # + # pkg:gem/drb#lib/drb/drb.rb:1583 + def run; end + + # pkg:gem/drb#lib/drb/drb.rb:1568 + def shutdown; end + + class << self + # Set the default access control list to +acl+. The default ACL is +nil+. + # + # See also DRb::ACL and #new() + # + # pkg:gem/drb#lib/drb/drb.rb:1403 + def default_acl(acl); end + + # Set the default value for the :argc_limit option. + # + # See #new(). The initial default value is 256. + # + # pkg:gem/drb#lib/drb/drb.rb:1389 + def default_argc_limit(argc); end + + # Set the default value for the :id_conv option. + # + # See #new(). The initial default value is a DRbIdConv instance. + # + # pkg:gem/drb#lib/drb/drb.rb:1410 + def default_id_conv(idconv); end + + # Set the default value for the :load_limit option. + # + # See #new(). The initial default value is 25 MB. + # + # pkg:gem/drb#lib/drb/drb.rb:1396 + def default_load_limit(sz); end + + # pkg:gem/drb#lib/drb/drb.rb:1426 + def make_config(hash = T.unsafe(nil)); end + + # Get the default value of the :verbose option. + # + # pkg:gem/drb#lib/drb/drb.rb:1422 + def verbose; end + + # Set the default value of the :verbose option. + # + # See #new(). The initial default value is false. + # + # pkg:gem/drb#lib/drb/drb.rb:1417 + def verbose=(on); end + end +end + +# pkg:gem/drb#lib/drb/drb.rb:1652 +class DRb::DRbServer::InvokeMethod + # pkg:gem/drb#lib/drb/drb.rb:1653 + def initialize(drb_server, client); end + + # pkg:gem/drb#lib/drb/drb.rb:1658 + def perform; end + + private + + # pkg:gem/drb#lib/drb/drb.rb:1704 + def block_yield(x); end + + # pkg:gem/drb#lib/drb/drb.rb:1695 + def check_insecure_method; end + + # pkg:gem/drb#lib/drb/drb.rb:1687 + def init_with_client; end + + # pkg:gem/drb#lib/drb/drb.rb:1711 + def perform_with_block; end + + # pkg:gem/drb#lib/drb/drb.rb:1731 + def perform_without_block; end + + # pkg:gem/drb#lib/drb/drb.rb:1699 + def setup_message; end +end + +# The default drb protocol which communicates over a TCP socket. +# +# The DRb TCP protocol URI looks like: +# druby://:?. The option is optional. +# +# pkg:gem/drb#lib/drb/drb.rb:843 +class DRb::DRbTCPSocket + # Create a new DRbTCPSocket instance. + # + # +uri+ is the URI we are connected to. + # +soc+ is the tcp socket we are bound to. +config+ is our + # configuration. + # + # pkg:gem/drb#lib/drb/drb.rb:931 + def initialize(uri, soc, config = T.unsafe(nil)); end + + # On the server side, for an instance returned by #open_server, + # accept a client connection and return a new instance to handle + # the server's side of this client-server session. + # + # pkg:gem/drb#lib/drb/drb.rb:999 + def accept; end + + # Check to see if this connection is alive. + # + # pkg:gem/drb#lib/drb/drb.rb:1029 + def alive?; end + + # Close the connection. + # + # If this is an instance returned by #open_server, then this stops + # listening for new connections altogether. If this is an instance + # returned by #open or by #accept, then it closes this particular + # client-server session. + # + # pkg:gem/drb#lib/drb/drb.rb:981 + def close; end + + # Get the address of our TCP peer (the other end of the socket + # we are bound to. + # + # pkg:gem/drb#lib/drb/drb.rb:946 + def peeraddr; end + + # On the client side, receive a reply from the server. + # + # pkg:gem/drb#lib/drb/drb.rb:969 + def recv_reply; end + + # On the server side, receive a request from the client. + # + # pkg:gem/drb#lib/drb/drb.rb:959 + def recv_request; end + + # On the server side, send a reply to the client. + # + # pkg:gem/drb#lib/drb/drb.rb:964 + def send_reply(succ, result); end + + # On the client side, send a request to the server. + # + # pkg:gem/drb#lib/drb/drb.rb:954 + def send_request(ref, msg_id, arg, b); end + + # pkg:gem/drb#lib/drb/drb.rb:1038 + def set_sockopt(soc); end + + # Graceful shutdown + # + # pkg:gem/drb#lib/drb/drb.rb:1024 + def shutdown; end + + # Get the socket. + # + # pkg:gem/drb#lib/drb/drb.rb:951 + def stream; end + + # Get the URI that we are connected to. + # + # pkg:gem/drb#lib/drb/drb.rb:942 + def uri; end + + private + + # pkg:gem/drb#lib/drb/drb.rb:1014 + def accept_or_shutdown; end + + # pkg:gem/drb#lib/drb/drb.rb:990 + def close_shutdown_pipe; end + + class << self + # Returns the hostname of this server + # + # pkg:gem/drb#lib/drb/drb.rb:873 + def getservername; end + + # Open a client connection to +uri+ (DRb URI string) using configuration + # +config+. + # + # This can raise DRb::DRbBadScheme or DRb::DRbBadURI if +uri+ is not for a + # recognized protocol. See DRb::DRbServer.new for information on built-in + # URI protocols. + # + # pkg:gem/drb#lib/drb/drb.rb:866 + def open(uri, config); end + + # Open a server listening for connections at +uri+ using + # configuration +config+. + # + # pkg:gem/drb#lib/drb/drb.rb:904 + def open_server(uri, config); end + + # For the families available for +host+, returns a TCPServer on +port+. + # If +port+ is 0 the first available port is used. IPv4 servers are + # preferred over IPv6 servers. + # + # pkg:gem/drb#lib/drb/drb.rb:889 + def open_server_inaddr_any(host, port); end + + # pkg:gem/drb#lib/drb/drb.rb:846 + def parse_uri(uri); end + + # Parse +uri+ into a [uri, option] pair. + # + # pkg:gem/drb#lib/drb/drb.rb:921 + def uri_option(uri, config); end + end +end + +# Implements DRb over a UNIX socket +# +# DRb UNIX socket URIs look like drbunix:?. The +# option is optional. +# +# pkg:gem/drb#lib/drb/unix.rb:15 +class DRb::DRbUNIXSocket < ::DRb::DRbTCPSocket + # pkg:gem/drb#lib/drb/unix.rb:62 + def initialize(uri, soc, config = T.unsafe(nil), server_mode = T.unsafe(nil)); end + + # pkg:gem/drb#lib/drb/unix.rb:105 + def accept; end + + # pkg:gem/drb#lib/drb/unix.rb:95 + def close; end + + # pkg:gem/drb#lib/drb/unix.rb:111 + def set_sockopt(soc); end + + class << self + # pkg:gem/drb#lib/drb/unix.rb:28 + def open(uri, config); end + + # pkg:gem/drb#lib/drb/unix.rb:34 + def open_server(uri, config); end + + # :stopdoc: + # + # pkg:gem/drb#lib/drb/unix.rb:17 + def parse_uri(uri); end + + # pkg:gem/drb#lib/drb/unix.rb:72 + def temp_server; end + + # pkg:gem/drb#lib/drb/unix.rb:57 + def uri_option(uri, config); end + end +end + +# import from tempfile.rb +# +# pkg:gem/drb#lib/drb/unix.rb:70 +DRb::DRbUNIXSocket::Max_try = T.let(T.unsafe(nil), Integer) + +# pkg:gem/drb#lib/drb/drb.rb:1049 +class DRb::DRbURIOption + # pkg:gem/drb#lib/drb/drb.rb:1050 + def initialize(option); end + + # pkg:gem/drb#lib/drb/drb.rb:1056 + def ==(other); end + + # pkg:gem/drb#lib/drb/drb.rb:1065 + def eql?(other); end + + # pkg:gem/drb#lib/drb/drb.rb:1061 + def hash; end + + # pkg:gem/drb#lib/drb/drb.rb:1053 + def option; end + + # pkg:gem/drb#lib/drb/drb.rb:1054 + def to_s; end +end + +# Mixin module making an object undumpable or unmarshallable. +# +# If an object which includes this module is returned by method +# called over drb, then the object remains in the server space +# and a reference to the object is returned, rather than the +# object being marshalled and moved into the client space. +# +# pkg:gem/drb#lib/drb/drb.rb:418 +module DRb::DRbUndumped + # pkg:gem/drb#lib/drb/drb.rb:419 + def _dump(dummy); end +end + +# Class wrapping a marshalled object whose type is unknown locally. +# +# If an object is returned by a method invoked over drb, but the +# class of the object is unknown in the client namespace, or +# the object is a constant unknown in the client namespace, then +# the still-marshalled object is returned wrapped in a DRbUnknown instance. +# +# If this object is passed as an argument to a method invoked over +# drb, then the wrapped object is passed instead. +# +# The class or constant name of the object can be read from the +# +name+ attribute. The marshalled object is held in the +buf+ +# attribute. +# +# pkg:gem/drb#lib/drb/drb.rb:485 +class DRb::DRbUnknown + # Create a new DRbUnknown object. + # + # +buf+ is a string containing a marshalled object that could not + # be unmarshalled. +err+ is the error message that was raised + # when the unmarshalling failed. It is used to determine the + # name of the unmarshalled object. + # + # pkg:gem/drb#lib/drb/drb.rb:493 + def initialize(err, buf); end + + # pkg:gem/drb#lib/drb/drb.rb:522 + def _dump(lv); end + + # Buffer contained the marshalled, unknown object. + # + # pkg:gem/drb#lib/drb/drb.rb:512 + def buf; end + + # Create a DRbUnknownError exception containing this object. + # + # pkg:gem/drb#lib/drb/drb.rb:536 + def exception; end + + # The name of the unknown thing. + # + # Class name for unknown objects; variable name for unknown + # constants. + # + # pkg:gem/drb#lib/drb/drb.rb:509 + def name; end + + # Attempt to load the wrapped marshalled object again. + # + # If the class of the object is now known locally, the object + # will be unmarshalled and returned. Otherwise, a new + # but identical DRbUnknown object will be returned. + # + # pkg:gem/drb#lib/drb/drb.rb:531 + def reload; end + + class << self + # pkg:gem/drb#lib/drb/drb.rb:514 + def _load(s); end + end +end + +# An exception wrapping a DRb::DRbUnknown object +# +# pkg:gem/drb#lib/drb/drb.rb:438 +class DRb::DRbUnknownError < ::DRb::DRbError + # Create a new DRbUnknownError for the DRb::DRbUnknown object +unknown+ + # + # pkg:gem/drb#lib/drb/drb.rb:441 + def initialize(unknown); end + + # pkg:gem/drb#lib/drb/drb.rb:453 + def _dump(lv); end + + # Get the wrapped DRb::DRbUnknown object. + # + # pkg:gem/drb#lib/drb/drb.rb:447 + def unknown; end + + class << self + # pkg:gem/drb#lib/drb/drb.rb:449 + def _load(s); end + end +end + +# pkg:gem/drb#lib/drb/drb.rb:1227 +class DRb::ThreadObject + include ::MonitorMixin + + # pkg:gem/drb#lib/drb/drb.rb:1230 + def initialize(&blk); end + + # pkg:gem/drb#lib/drb/drb.rb:1265 + def _execute; end + + # pkg:gem/drb#lib/drb/drb.rb:1241 + def alive?; end + + # pkg:gem/drb#lib/drb/drb.rb:1245 + def kill; end + + # pkg:gem/drb#lib/drb/drb.rb:1250 + def method_missing(msg, *arg, &blk); end +end + +# pkg:gem/drb#lib/drb/version.rb:2 +DRb::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/drb#lib/drb/drb.rb:1993 +DRbIdConv = DRb::DRbIdConv + +# :stopdoc: +# +# pkg:gem/drb#lib/drb/drb.rb:1991 +DRbObject = DRb::DRbObject + +# pkg:gem/drb#lib/drb/drb.rb:1992 +DRbUndumped = DRb::DRbUndumped diff --git a/sorbet/rbi/gems/erb@6.0.4.rbi b/sorbet/rbi/gems/erb@6.0.4.rbi new file mode 100644 index 0000000..0220061 --- /dev/null +++ b/sorbet/rbi/gems/erb@6.0.4.rbi @@ -0,0 +1,1537 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `erb` gem. +# Please instead update this file by running `bin/tapioca gem erb`. + + +# :markup: markdown +# +# Class **ERB** (the name stands for **Embedded Ruby**) +# is an easy-to-use, but also very powerful, [template processor][template processor]. +# +# ## Usage +# +# Before you can use \ERB, you must first require it +# (examples on this page assume that this has been done): +# +# ``` +# require 'erb' +# ``` +# +# ## In Brief +# +# Here's how \ERB works: +# +# - You can create a *template*: a plain-text string that includes specially formatted *tags*.. +# - You can create an \ERB object to store the template. +# - You can call instance method ERB#result to get the *result*. +# +# \ERB supports tags of three kinds: +# +# - [Expression tags][expression tags]: +# each begins with `'<%='`, ends with `'%>'`; contains a Ruby expression; +# in the result, the value of the expression replaces the entire tag: +# +# template = 'The magic word is <%= magic_word %>.' +# erb = ERB.new(template) +# magic_word = 'xyzzy' +# erb.result(binding) # => "The magic word is xyzzy." +# +# The above call to #result passes argument `binding`, +# which contains the binding of variable `magic_word` to its string value `'xyzzy'`. +# +# The below call to #result need not pass a binding, +# because its expression `Date::DAYNAMES` is globally defined. +# +# ERB.new('Today is <%= Date::DAYNAMES[Date.today.wday] %>.').result # => "Today is Monday." +# +# - [Execution tags][execution tags]: +# each begins with `'<%'`, ends with `'%>'`; contains Ruby code to be executed: +# +# template = '<% File.write("t.txt", "Some stuff.") %>' +# ERB.new(template).result +# File.read('t.txt') # => "Some stuff." +# +# - [Comment tags][comment tags]: +# each begins with `'<%#'`, ends with `'%>'`; contains comment text; +# in the result, the entire tag is omitted. +# +# template = 'Some stuff;<%# Note to self: figure out what the stuff is. %> more stuff.' +# ERB.new(template).result # => "Some stuff; more stuff." +# +# ## Some Simple Examples +# +# Here's a simple example of \ERB in action: +# +# ``` +# template = 'The time is <%= Time.now %>.' +# erb = ERB.new(template) +# erb.result +# # => "The time is 2025-09-09 10:49:26 -0500." +# ``` +# +# Details: +# +# 1. A plain-text string is assigned to variable `template`. +# Its embedded [expression tag][expression tags] `'<%= Time.now %>'` includes a Ruby expression, `Time.now`. +# 2. The string is put into a new \ERB object, and stored in variable `erb`. +# 4. Method call `erb.result` generates a string that contains the run-time value of `Time.now`, +# as computed at the time of the call. +# +# The +# \ERB object may be re-used: +# +# ``` +# erb.result +# # => "The time is 2025-09-09 10:49:33 -0500." +# ``` +# +# Another example: +# +# ``` +# template = 'The magic word is <%= magic_word %>.' +# erb = ERB.new(template) +# magic_word = 'abracadabra' +# erb.result(binding) +# # => "The magic word is abracadabra." +# ``` +# +# Details: +# +# 1. As before, a plain-text string is assigned to variable `template`. +# Its embedded [expression tag][expression tags] `'<%= magic_word %>'` has a variable *name*, `magic_word`. +# 2. The string is put into a new \ERB object, and stored in variable `erb`; +# note that `magic_word` need not be defined before the \ERB object is created. +# 3. `magic_word = 'abracadabra'` assigns a value to variable `magic_word`. +# 4. Method call `erb.result(binding)` generates a string +# that contains the *value* of `magic_word`. +# +# As before, the \ERB object may be re-used: +# +# ``` +# magic_word = 'xyzzy' +# erb.result(binding) +# # => "The magic word is xyzzy." +# ``` +# +# ## Bindings +# +# A call to method #result, which produces the formatted result string, +# requires a [Binding object][binding object] as its argument. +# +# The binding object provides the bindings for expressions in [expression tags][expression tags]. +# +# There are three ways to provide the required binding: +# +# - [Default binding][default binding]. +# - [Local binding][local binding]. +# - [Augmented binding][augmented binding] +# +# ### Default Binding +# +# When you pass no `binding` argument to method #result, +# the method uses its default binding: the one returned by method #new_toplevel. +# This binding has the bindings defined by Ruby itself, +# which are those for Ruby's constants and variables. +# +# That binding is sufficient for an expression tag that refers only to Ruby's constants and variables; +# these expression tags refer only to Ruby's global constant `RUBY_COPYRIGHT` and global variable `$0`: +# +# ``` +# template = <