Set up lefthook for Ruby formatters and type checking
This commit is contained in:
4
sorbet/config
Normal file
4
sorbet/config
Normal file
@@ -0,0 +1,4 @@
|
||||
--dir
|
||||
.
|
||||
--ignore=/tmp/
|
||||
--ignore=/vendor/bundle
|
||||
1
sorbet/rbi/annotations/.gitattributes
vendored
Normal file
1
sorbet/rbi/annotations/.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
**/*.rbi linguist-vendored=true
|
||||
89
sorbet/rbi/annotations/activemodel.rbi
vendored
Normal file
89
sorbet/rbi/annotations/activemodel.rbi
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This file was pulled from a central RBI files repository.
|
||||
# Please run `bin/tapioca annotations` to update it.
|
||||
|
||||
class ActiveModel::Errors
|
||||
Elem = type_member { { fixed: ActiveModel::Error } }
|
||||
|
||||
sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) }
|
||||
def [](attribute); end
|
||||
|
||||
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(ActiveModel::Error) }
|
||||
def add(attribute, type = :invalid, **options); end
|
||||
|
||||
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T::Boolean) }
|
||||
def added?(attribute, type = :invalid, options = {}); end
|
||||
|
||||
sig { params(options: T.untyped).returns(T::Hash[T.untyped, T.untyped]) }
|
||||
def as_json(options = nil); end
|
||||
|
||||
sig { returns(T::Array[Symbol]) }
|
||||
def attribute_names; end
|
||||
|
||||
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T.nilable(T::Array[String])) }
|
||||
def delete(attribute, type = nil, **options); end
|
||||
|
||||
sig { returns(T::Hash[Symbol, T::Array[T::Hash[Symbol, T.untyped]]]) }
|
||||
def details; end
|
||||
|
||||
sig { returns(T::Array[Elem]) }
|
||||
def errors; end
|
||||
|
||||
sig { params(attribute: T.any(Symbol, String), message: String).returns(String) }
|
||||
def full_message(attribute, message); end
|
||||
|
||||
sig { returns(T::Array[String]) }
|
||||
def full_messages; end
|
||||
|
||||
sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) }
|
||||
def full_messages_for(attribute); end
|
||||
|
||||
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(String) }
|
||||
def generate_message(attribute, type = :invalid, options = {}); end
|
||||
|
||||
sig { returns(T::Hash[Symbol, T::Array[ActiveModel::Error]]) }
|
||||
def group_by_attribute; end
|
||||
|
||||
sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) }
|
||||
def has_key?(attribute); end
|
||||
|
||||
sig { params(error: ActiveModel::Error, override_options: T.untyped).returns(T::Array[ActiveModel::Error]) }
|
||||
def import(error, override_options = {}); end
|
||||
|
||||
sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) }
|
||||
def include?(attribute); end
|
||||
|
||||
sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) }
|
||||
def key?(attribute); end
|
||||
|
||||
sig { params(other: T.untyped).returns(T::Array[ActiveModel::Error]) }
|
||||
def merge!(other); end
|
||||
|
||||
sig { returns(T::Hash[Symbol, T::Array[String]]) }
|
||||
def messages; end
|
||||
|
||||
sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) }
|
||||
def messages_for(attribute); end
|
||||
|
||||
sig { returns(T::Array[Elem]) }
|
||||
def objects; end
|
||||
|
||||
sig { params(attribute: T.any(Symbol, String), type: T.untyped).returns(T::Boolean) }
|
||||
def of_kind?(attribute, type = :invalid); end
|
||||
|
||||
sig { returns(T::Array[String]) }
|
||||
def to_a; end
|
||||
|
||||
sig { params(full_messages: T.untyped).returns(T::Hash[Symbol, T::Array[String]]) }
|
||||
def to_hash(full_messages = false); end
|
||||
|
||||
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T::Array[ActiveModel::Error]) }
|
||||
def where(attribute, type = nil, **options); end
|
||||
end
|
||||
|
||||
module ActiveModel::Validations
|
||||
sig { returns(ActiveModel::Errors) }
|
||||
def errors; end
|
||||
end
|
||||
98
sorbet/rbi/annotations/activerecord.rbi
vendored
Normal file
98
sorbet/rbi/annotations/activerecord.rbi
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This file was pulled from a central RBI files repository.
|
||||
# Please run `bin/tapioca annotations` to update it.
|
||||
|
||||
class ActiveRecord::Schema
|
||||
sig { params(info: T::Hash[T.untyped, T.untyped], blk: T.proc.bind(ActiveRecord::Schema).void).void }
|
||||
def self.define(info = nil, &blk); end
|
||||
end
|
||||
|
||||
class ActiveRecord::Migration
|
||||
# @shim: Methods on migration are delegated to `SchemaStatements` using `method_missing`
|
||||
include ActiveRecord::ConnectionAdapters::SchemaStatements
|
||||
|
||||
# @shim: Methods on migration are delegated to `DatabaseStatements` using `method_missing`
|
||||
include ActiveRecord::ConnectionAdapters::DatabaseStatements
|
||||
end
|
||||
|
||||
class ActiveRecord::Base
|
||||
sig { returns(FalseClass) }
|
||||
def blank?; end
|
||||
|
||||
# @shim: since `present?` is always true, `presence` always returns `self`
|
||||
sig { returns(T.self_type) }
|
||||
def presence; end
|
||||
|
||||
sig { returns(TrueClass) }
|
||||
def present?; end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.after_initialize(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.after_find(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.after_touch(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.before_validation(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.after_validation(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.before_save(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.around_save(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.after_save(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.before_create(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.around_create(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.after_create(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.before_update(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.around_update(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.after_update(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.before_destroy(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.around_destroy(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.after_destroy(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.after_commit(*args, **options, &block); end
|
||||
|
||||
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
||||
def self.after_rollback(*args, **options, &block); end
|
||||
end
|
||||
|
||||
class ActiveRecord::Relation
|
||||
Elem = type_member(:out) { { fixed: T.untyped } }
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def blank?; end
|
||||
|
||||
sig { abstract.params(blk: T.proc.params(arg0: Elem).returns(BasicObject)).returns(T.untyped) }
|
||||
sig { abstract.returns(T::Enumerator[Elem]) }
|
||||
def each(&blk); end
|
||||
end
|
||||
463
sorbet/rbi/annotations/activesupport.rbi
vendored
Normal file
463
sorbet/rbi/annotations/activesupport.rbi
vendored
Normal file
@@ -0,0 +1,463 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This file was pulled from a central RBI files repository.
|
||||
# Please run `bin/tapioca annotations` to update it.
|
||||
|
||||
module ActiveSupport::Testing::Declarative
|
||||
sig { params(name: String, block: T.proc.bind(T.untyped).void).void }
|
||||
def test(name, &block); end
|
||||
end
|
||||
|
||||
class ActiveSupport::EnvironmentInquirer
|
||||
sig { returns(T::Boolean) }
|
||||
def development?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def production?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def test?; end
|
||||
|
||||
# @method_missing: delegated to String through ActiveSupport::StringInquirer
|
||||
sig { returns(T::Boolean) }
|
||||
def staging?; end
|
||||
end
|
||||
|
||||
module ActiveSupport::Testing::SetupAndTeardown::ClassMethods
|
||||
sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.untyped).void)).void }
|
||||
def setup(*args, &block); end
|
||||
|
||||
sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.untyped).void)).void }
|
||||
def teardown(*args, &block); end
|
||||
end
|
||||
|
||||
class ActiveSupport::TestCase
|
||||
sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).void)).void }
|
||||
def self.setup(*args, &block); end
|
||||
|
||||
sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).void)).void }
|
||||
def self.teardown(*args, &block); end
|
||||
|
||||
sig { params(name: String, block: T.proc.bind(T.attached_class).void).void }
|
||||
def self.test(name, &block); end
|
||||
end
|
||||
|
||||
class ActiveSupport::TimeWithZone
|
||||
# @shim: Methods on ActiveSupport::TimeWithZone are delegated to `Time` using `method_missing
|
||||
include ::DateAndTime::Zones
|
||||
|
||||
# @shim: Methods on ActiveSupport::TimeWithZone are delegated to `Time` using `method_missing
|
||||
include ::DateAndTime::Calculations
|
||||
|
||||
sig { returns(FalseClass) }
|
||||
def blank?; end
|
||||
|
||||
# @shim: since `present?` is always true, `presence` always returns `self`
|
||||
sig { returns(T.self_type) }
|
||||
def presence; end
|
||||
|
||||
# @shim: since `blank?` is always false, `present?` always returns `true`
|
||||
sig { returns(TrueClass) }
|
||||
def present?; end
|
||||
end
|
||||
|
||||
class Object
|
||||
sig { returns(T::Boolean) }
|
||||
def blank?; end
|
||||
|
||||
sig { returns(FalseClass) }
|
||||
def html_safe?; end
|
||||
|
||||
sig { returns(T.nilable(T.self_type)) }
|
||||
def presence; end
|
||||
|
||||
sig { params(another_object: T.untyped).returns(T.nilable(T.self_type)) }
|
||||
def presence_in(another_object); end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def present?; end
|
||||
end
|
||||
|
||||
class Hash
|
||||
sig { returns(T::Boolean) }
|
||||
def blank?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def present?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def extractable_options?; end
|
||||
end
|
||||
|
||||
class Array
|
||||
sig { returns(T::Boolean) }
|
||||
def blank?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def present?; end
|
||||
|
||||
sig { params(position: Integer).returns(T.self_type) }
|
||||
def from(position); end
|
||||
|
||||
sig { params(position: Integer).returns(T.self_type) }
|
||||
def to(position); end
|
||||
|
||||
sig { params(elements: T.untyped).returns(T::Array[T.untyped]) }
|
||||
def including(*elements); end
|
||||
|
||||
sig { params(elements: T.untyped).returns(T.self_type) }
|
||||
def excluding(*elements); end
|
||||
|
||||
sig { params(elements: T.untyped).returns(T.self_type) }
|
||||
def without(*elements); end
|
||||
|
||||
sig { returns(T.nilable(Elem)) }
|
||||
def second; end
|
||||
|
||||
sig { returns(T.nilable(Elem)) }
|
||||
def third; end
|
||||
|
||||
sig { returns(T.nilable(Elem)) }
|
||||
def fourth; end
|
||||
|
||||
sig { returns(T.nilable(Elem)) }
|
||||
def fifth; end
|
||||
|
||||
sig { returns(T.nilable(Elem)) }
|
||||
def forty_two; end
|
||||
|
||||
sig { returns(T.nilable(Elem)) }
|
||||
def third_to_last; end
|
||||
|
||||
sig { returns(T.nilable(Elem)) }
|
||||
def second_to_last; end
|
||||
|
||||
sig { params(options: T::Hash[T.untyped, T.untyped]).returns(String) }
|
||||
def to_sentence(options = {}); end
|
||||
|
||||
sig { params(format: Symbol).returns(String) }
|
||||
def to_fs(format = :default); end
|
||||
|
||||
sig { params(format: Symbol).returns(String) }
|
||||
def to_formatted_s(format = :default); end
|
||||
|
||||
sig { returns(String) }
|
||||
def to_xml; end
|
||||
|
||||
sig { returns(T::Hash[T.untyped, T.untyped]) }
|
||||
def extract_options!; end
|
||||
|
||||
sig { type_parameters(:FillType).params(number: Integer, fill_with: T.type_parameter(:FillType), block: T.nilable(T.proc.params(group: T::Array[T.any(Elem, T.type_parameter(:FillType))]).void)).returns(T::Array[T::Array[T.any(Elem, T.type_parameter(:FillType))]]) }
|
||||
def in_groups(number, fill_with = T.unsafe(nil), &block); end
|
||||
|
||||
sig { type_parameters(:FillType).params(number: Integer, fill_with: T.type_parameter(:FillType), block: T.nilable(T.proc.params(group: T::Array[T.any(Elem, T.type_parameter(:FillType))]).void)).returns(T::Array[T::Array[T.any(Elem, T.type_parameter(:FillType))]]) }
|
||||
def in_groups_of(number, fill_with = T.unsafe(nil), &block); end
|
||||
|
||||
sig { params(value: T.untyped, block: T.nilable(T.proc.params(element: Elem).returns(T.untyped))).returns(T::Array[T::Array[Elem]]) }
|
||||
def split(value = nil, &block); end
|
||||
|
||||
sig { params(block: T.nilable(T.proc.params(element: Elem).returns(T.untyped))).returns(T.any(T::Array[Elem], T::Enumerator[Elem])) }
|
||||
def extract!(&block); end
|
||||
|
||||
sig { returns(ActiveSupport::ArrayInquirer) }
|
||||
def inquiry; end
|
||||
|
||||
sig { params(object: T.untyped).returns(T::Array[T.untyped]) }
|
||||
def self.wrap(object); end
|
||||
end
|
||||
|
||||
class Date
|
||||
sig { returns(FalseClass) }
|
||||
def blank?; end
|
||||
|
||||
# @shim: since `present?` is always true, `presence` always returns `self`
|
||||
sig { returns(T.self_type) }
|
||||
def presence; end
|
||||
|
||||
# @shim: since `blank?` is always false, `present?` always returns `true`
|
||||
sig { returns(TrueClass) }
|
||||
def present?; end
|
||||
end
|
||||
|
||||
class DateTime
|
||||
sig { returns(FalseClass) }
|
||||
def blank?; end
|
||||
|
||||
# @shim: since `present?` is always true, `presence` always returns `self`
|
||||
sig { returns(T.self_type) }
|
||||
def presence; end
|
||||
|
||||
# @shim: since `blank?` is always false, `present?` always returns `true`
|
||||
sig { returns(TrueClass) }
|
||||
def present?; end
|
||||
end
|
||||
|
||||
module Enumerable
|
||||
# @version >= 7.0.0
|
||||
sig { returns(Elem) }
|
||||
def sole; end
|
||||
end
|
||||
|
||||
class NilClass
|
||||
sig { returns(TrueClass) }
|
||||
def blank?; end
|
||||
|
||||
# @shim: since `present?` is always false, `presence` always returns `nil`
|
||||
sig { returns(NilClass) }
|
||||
def presence; end
|
||||
|
||||
# @shim: since `blank?` is always true, `present?` always returns `false`
|
||||
sig { returns(FalseClass) }
|
||||
def present?; end
|
||||
end
|
||||
|
||||
class FalseClass
|
||||
sig { returns(TrueClass) }
|
||||
def blank?; end
|
||||
|
||||
# @shim: since `present?` is always false, `presence` always returns `nil`
|
||||
sig { returns(NilClass) }
|
||||
def presence; end
|
||||
|
||||
# @shim: since `blank?` is always true, `present?` always returns `false`
|
||||
sig { returns(FalseClass) }
|
||||
def present?; end
|
||||
end
|
||||
|
||||
class TrueClass
|
||||
sig { returns(FalseClass) }
|
||||
def blank?; end
|
||||
|
||||
# @shim: since `present?` is always true, `presence` always returns `self`
|
||||
sig { returns(T.self_type) }
|
||||
def presence; end
|
||||
|
||||
# @shim: since `blank?` is always false, `present?` always returns `true`
|
||||
sig { returns(TrueClass) }
|
||||
def present?; end
|
||||
end
|
||||
|
||||
class Numeric
|
||||
sig { returns(FalseClass) }
|
||||
def blank?; end
|
||||
|
||||
sig { returns(TrueClass) }
|
||||
def html_safe?; end
|
||||
|
||||
# @shim: since `present?` is always true, `presence` always returns `self`
|
||||
sig { returns(T.self_type) }
|
||||
def presence; end
|
||||
|
||||
# @shim: since `blank?` is always false, `present?` always returns `true`
|
||||
sig { returns(TrueClass) }
|
||||
def present?; end
|
||||
end
|
||||
|
||||
class Time
|
||||
sig { returns(FalseClass) }
|
||||
def blank?; end
|
||||
|
||||
# @shim: since `present?` is always true, `presence` always returns `self`
|
||||
sig { returns(T.self_type) }
|
||||
def presence; end
|
||||
|
||||
# @shim: since `blank?` is always false, `present?` always returns `true`
|
||||
sig { returns(TrueClass) }
|
||||
def present?; end
|
||||
|
||||
sig { returns(ActiveSupport::TimeZone) }
|
||||
def self.zone; end
|
||||
|
||||
sig { returns(T.any(ActiveSupport::TimeWithZone, ::Time)) }
|
||||
def self.current; end
|
||||
end
|
||||
|
||||
class Symbol
|
||||
sig { returns(T::Boolean) }
|
||||
def blank?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def present?; end
|
||||
|
||||
# alias for `#start_with?`
|
||||
sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
|
||||
def starts_with?(*string_or_regexp); end
|
||||
|
||||
# alias for `#end_with?`
|
||||
sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
|
||||
def ends_with?(*string_or_regexp); end
|
||||
end
|
||||
|
||||
class String
|
||||
sig { returns(TrueClass) }
|
||||
def acts_like_string?; end
|
||||
|
||||
# This is the subset of `#[]` sigs that have just 1 parameter.
|
||||
# https://github.com/sorbet/sorbet/blob/40ad87b4dc7be23fa00c1369ac9f927053c68907/rbi/core/string.rbi#L270-L303
|
||||
sig { params(position: Integer).returns(T.nilable(String)) }
|
||||
sig { params(position: T.any(T::Range[Integer], Regexp)).returns(T.nilable(String)) }
|
||||
sig { params(position: String).returns(T.nilable(String)) }
|
||||
def at(position); end
|
||||
|
||||
sig { returns(String) }
|
||||
def as_json; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def blank?; end
|
||||
|
||||
sig { params(first_letter: Symbol).returns(String) }
|
||||
def camelcase(first_letter = :upper); end
|
||||
|
||||
sig { params(first_letter: Symbol).returns(String) }
|
||||
def camelize(first_letter = :upper); end
|
||||
|
||||
sig { returns(String) }
|
||||
def classify; end
|
||||
|
||||
sig { returns(T.untyped) }
|
||||
def constantize; end
|
||||
|
||||
sig { returns(String) }
|
||||
def dasherize; end
|
||||
|
||||
sig { returns(String) }
|
||||
def deconstantize; end
|
||||
|
||||
sig { returns(String) }
|
||||
def demodulize; end
|
||||
|
||||
# alias for `#end_with?`
|
||||
sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
|
||||
def ends_with?(*string_or_regexp); end
|
||||
|
||||
sig { returns(String) }
|
||||
def downcase_first; end
|
||||
|
||||
sig { params(string: String).returns(T::Boolean) }
|
||||
def exclude?(string); end
|
||||
|
||||
sig { params(limit: Integer).returns(String) }
|
||||
def first(limit = 1); end
|
||||
|
||||
sig { params(separate_class_name_and_id_with_underscore: T::Boolean).returns(String) }
|
||||
def foreign_key(separate_class_name_and_id_with_underscore = true); end
|
||||
|
||||
sig { params(position: Integer).returns(String) }
|
||||
def from(position); end
|
||||
|
||||
sig { returns(ActiveSupport::SafeBuffer) }
|
||||
def html_safe; end
|
||||
|
||||
sig { params(capitalize: T::Boolean, keep_id_suffix: T::Boolean).returns(String) }
|
||||
def humanize(capitalize: true, keep_id_suffix: false); end
|
||||
|
||||
sig { params(zone: T.nilable(T.any(ActiveSupport::TimeZone, String))).returns(T.any(ActiveSupport::TimeWithZone, Time)) }
|
||||
def in_time_zone(zone = ::Time.zone); end
|
||||
|
||||
sig { params(amount: Integer, indent_string: T.nilable(String), indent_empty_lines: T::Boolean).returns(String) }
|
||||
def indent(amount, indent_string = nil, indent_empty_lines = false); end
|
||||
|
||||
sig { params(amount: Integer, indent_string: T.nilable(String), indent_empty_lines: T::Boolean).returns(T.nilable(String)) }
|
||||
def indent!(amount, indent_string = nil, indent_empty_lines = false); end
|
||||
|
||||
sig { returns(ActiveSupport::StringInquirer) }
|
||||
def inquiry; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def is_utf8?; end
|
||||
|
||||
sig { params(limit: Integer).returns(String) }
|
||||
def last(limit = 1); end
|
||||
|
||||
sig { returns(ActiveSupport::Multibyte::Chars) }
|
||||
def mb_chars; end
|
||||
|
||||
sig { params(separator: String, preserve_case: T::Boolean, locale: T.nilable(Symbol)).returns(String) }
|
||||
def parameterize(separator: "-", preserve_case: false, locale: nil); end
|
||||
|
||||
sig { params(count: T.nilable(T.any(Integer, Symbol)), locale: T.nilable(Symbol)).returns(String) }
|
||||
def pluralize(count = nil, locale = :en); end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def present?; end
|
||||
|
||||
sig { params(patterns: T.any(String, Regexp)).returns(String) }
|
||||
def remove(*patterns); end
|
||||
|
||||
sig { params(patterns: T.any(String, Regexp)).returns(String) }
|
||||
def remove!(*patterns); end
|
||||
|
||||
sig { returns(T.untyped) }
|
||||
def safe_constantize; end
|
||||
|
||||
sig { params(locale: Symbol).returns(String) }
|
||||
def singularize(locale = :en); end
|
||||
|
||||
sig { returns(String) }
|
||||
def squish; end
|
||||
|
||||
sig { returns(String) }
|
||||
def squish!; end
|
||||
|
||||
# alias for `#start_with?`
|
||||
sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
|
||||
def starts_with?(*string_or_regexp); end
|
||||
|
||||
sig { returns(String) }
|
||||
def strip_heredoc; end
|
||||
|
||||
sig { returns(String) }
|
||||
def tableize; end
|
||||
|
||||
sig { params(keep_id_suffix: T::Boolean).returns(String) }
|
||||
def titlecase(keep_id_suffix: false); end
|
||||
|
||||
sig { params(keep_id_suffix: T::Boolean).returns(String) }
|
||||
def titleize(keep_id_suffix: false); end
|
||||
|
||||
sig { params(position: Integer).returns(String) }
|
||||
def to(position); end
|
||||
|
||||
sig { returns(::Date) }
|
||||
def to_date; end
|
||||
|
||||
sig { returns(::DateTime) }
|
||||
def to_datetime; end
|
||||
|
||||
sig { params(form: T.nilable(Symbol)).returns(T.nilable(Time)) }
|
||||
def to_time(form = :local); end
|
||||
|
||||
sig { params(truncate_to: Integer, options: T::Hash[Symbol, T.anything]).returns(String) }
|
||||
def truncate(truncate_to, options = {}); end
|
||||
|
||||
sig { params(truncate_to: Integer, omission: T.nilable(String)).returns(String) }
|
||||
def truncate_bytes(truncate_to, omission: "…"); end
|
||||
|
||||
sig { params(words_count: Integer, options: T::Hash[Symbol, T.anything]).returns(String) }
|
||||
def truncate_words(words_count, options = {}); end
|
||||
|
||||
sig { returns(String) }
|
||||
def underscore; end
|
||||
|
||||
sig { returns(String) }
|
||||
def upcase_first; end
|
||||
end
|
||||
|
||||
class ActiveSupport::ErrorReporter
|
||||
# @version >= 7.1.0.beta1
|
||||
sig { type_parameters(:Block, :Fallback).params(error_classes: T.class_of(Exception), severity: T.nilable(Symbol), context: T.nilable(T::Hash[Symbol, T.untyped]), fallback: T.nilable(T.proc.returns(T.type_parameter(:Fallback))), source: T.nilable(String), blk: T.proc.returns(T.type_parameter(:Block))).returns(T.any(T.type_parameter(:Block), T.type_parameter(:Fallback))) }
|
||||
def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil), &blk); end
|
||||
|
||||
# @version >= 7.1.0.beta1
|
||||
sig { type_parameters(:Block).params(error_classes: T.class_of(Exception), severity: T.nilable(Symbol), context: T.nilable(T::Hash[Symbol, T.untyped]), source: T.nilable(String), blk: T.proc.returns(T.type_parameter(:Block))).returns(T.type_parameter(:Block)) }
|
||||
def record(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil), &blk); end
|
||||
|
||||
# @version >= 7.1.0.beta1
|
||||
sig { params(error: Exception, handled: T::Boolean, severity: T.nilable(Symbol), context: T::Hash[Symbol, T.untyped], source: T.nilable(String)).void }
|
||||
def report(error, handled: true, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end
|
||||
|
||||
# @version >= 7.2.0.beta1
|
||||
sig { params(error: T.any(Exception, String), severity: T.nilable(Symbol), context: T::Hash[Symbol, T.untyped], source: T.nilable(String)).void }
|
||||
def unexpected(error, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end
|
||||
end
|
||||
119
sorbet/rbi/annotations/minitest.rbi
vendored
Normal file
119
sorbet/rbi/annotations/minitest.rbi
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This file was pulled from a central RBI files repository.
|
||||
# Please run `bin/tapioca annotations` to update it.
|
||||
|
||||
module Minitest::Assertions
|
||||
sig { params(test: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def assert(test, msg = nil); end
|
||||
|
||||
sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def assert_empty(obj, msg = nil); end
|
||||
|
||||
sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def assert_equal(exp, act, msg = nil); end
|
||||
|
||||
sig { params(exp: T.anything, act: T.anything, delta: Numeric, msg: T.anything).returns(TrueClass) }
|
||||
def assert_in_delta(exp, act, delta = T.unsafe(nil), msg = nil); end
|
||||
|
||||
sig { params(a: T.anything, b: T.anything, epsilon: Numeric, msg: T.anything).returns(TrueClass) }
|
||||
def assert_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = nil); end
|
||||
|
||||
sig { params(collection: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def assert_includes(collection, obj, msg = nil); end
|
||||
|
||||
sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def assert_instance_of(cls, obj, msg = nil); end
|
||||
|
||||
sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def assert_kind_of(cls, obj, msg = nil); end
|
||||
|
||||
sig { params(matcher: T.any(String, Regexp), obj: T.anything, msg: T.anything).returns(MatchData) }
|
||||
def assert_match(matcher, obj, msg = nil); end
|
||||
|
||||
sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def assert_nil(obj, msg = nil); end
|
||||
|
||||
sig { params(o1: T.anything, op: T.any(Symbol, String), o2: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def assert_operator(o1, op, o2 = T.unsafe(nil), msg = nil); end
|
||||
|
||||
sig { params(stdout: T.nilable(T.any(String, Regexp)), stderr: T.nilable(T.any(String, Regexp)), block: T.proc.void).returns(T::Boolean) }
|
||||
def assert_output(stdout = nil, stderr = nil, &block); end
|
||||
|
||||
sig { params(path: T.any(String, Pathname), msg: T.anything).returns(TrueClass) }
|
||||
def assert_path_exists(path, msg = nil); end
|
||||
|
||||
sig { params(block: T.proc.void).returns(TrueClass) }
|
||||
def assert_pattern(&block); end
|
||||
|
||||
sig { params(o1: T.anything, op: T.any(String, Symbol), msg: T.anything).returns(TrueClass) }
|
||||
def assert_predicate(o1, op, msg = nil); end
|
||||
|
||||
sig { params(exp: NilClass, block: T.proc.void).returns(StandardError) }
|
||||
sig { type_parameters(:T).params(exp: T.any(T::Class[T.type_parameter(:T)], Regexp, String), block: T.proc.void).returns(T.type_parameter(:T)) }
|
||||
def assert_raises(*exp, &block); end
|
||||
|
||||
sig { params(obj: T.anything, meth: T.any(String, Symbol), msg: T.anything, include_all: T::Boolean).returns(TrueClass) }
|
||||
def assert_respond_to(obj, meth, msg = nil, include_all: false); end
|
||||
|
||||
sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def assert_same(exp, act, msg = nil); end
|
||||
|
||||
sig { params(send_ary: T::Array[T.anything], m: T.anything).returns(T::Boolean) }
|
||||
def assert_send(send_ary, m = nil); end
|
||||
|
||||
sig { params(block: T.proc.void).returns(T::Boolean) }
|
||||
def assert_silent(&block); end
|
||||
|
||||
sig { params(sym: Symbol, msg: T.anything, block: T.proc.void).returns(T.anything) }
|
||||
def assert_throws(sym, msg = nil, &block); end
|
||||
|
||||
sig { params(test: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def refute(test, msg = nil); end
|
||||
|
||||
sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def refute_empty(obj, msg = nil); end
|
||||
|
||||
sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def refute_equal(exp, act, msg = nil); end
|
||||
|
||||
sig { params(exp: T.anything, act: T.anything, delta: Numeric, msg: T.anything).returns(TrueClass) }
|
||||
def refute_in_delta(exp, act, delta = T.unsafe(nil), msg = nil); end
|
||||
|
||||
sig { params(a: T.anything, b: T.anything, epsilon: Numeric, msg: T.anything).returns(TrueClass) }
|
||||
def refute_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = nil); end
|
||||
|
||||
sig { params(collection: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def refute_includes(collection, obj, msg = nil); end
|
||||
|
||||
sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def refute_instance_of(cls, obj, msg = nil); end
|
||||
|
||||
sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def refute_kind_of(cls, obj, msg = nil); end
|
||||
|
||||
sig { params(matcher: T.any(String, Regexp), obj: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def refute_match(matcher, obj, msg = nil); end
|
||||
|
||||
sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def refute_nil(obj, msg = nil); end
|
||||
|
||||
sig { params(block: T.proc.void).returns(TrueClass) }
|
||||
def refute_pattern(&block); end
|
||||
|
||||
sig { params(o1: T.anything, op: T.any(Symbol, String), o2: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def refute_operator(o1, op, o2 = T.unsafe(nil), msg = nil); end
|
||||
|
||||
sig { params(path: T.any(String, Pathname), msg: T.anything).returns(TrueClass) }
|
||||
def refute_path_exists(path, msg = nil); end
|
||||
|
||||
sig { params(o1: T.anything, op: T.any(String, Symbol), msg: T.anything).returns(TrueClass) }
|
||||
def refute_predicate(o1, op, msg = nil); end
|
||||
|
||||
sig { params(obj: T.anything, meth: T.any(String, Symbol), msg: T.anything, include_all: T::Boolean).returns(TrueClass) }
|
||||
def refute_respond_to(obj, meth, msg = nil, include_all: false); end
|
||||
|
||||
sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) }
|
||||
def refute_same(exp, act, msg = nil); end
|
||||
end
|
||||
1
sorbet/rbi/dsl/.gitattributes
vendored
Normal file
1
sorbet/rbi/dsl/.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
**/*.rbi linguist-generated=true
|
||||
23
sorbet/rbi/dsl/active_support/callbacks.rbi
generated
Normal file
23
sorbet/rbi/dsl/active_support/callbacks.rbi
generated
Normal file
@@ -0,0 +1,23 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for dynamic methods in `ActiveSupport::Callbacks`.
|
||||
# Please instead update this file by running `bin/tapioca dsl ActiveSupport::Callbacks`.
|
||||
|
||||
|
||||
module ActiveSupport::Callbacks
|
||||
include GeneratedInstanceMethods
|
||||
|
||||
mixes_in_class_methods GeneratedClassMethods
|
||||
|
||||
module GeneratedClassMethods
|
||||
def __callbacks; end
|
||||
def __callbacks=(value); end
|
||||
def __callbacks?; end
|
||||
end
|
||||
|
||||
module GeneratedInstanceMethods
|
||||
def __callbacks; end
|
||||
def __callbacks?; end
|
||||
end
|
||||
end
|
||||
1
sorbet/rbi/gems/.gitattributes
vendored
Normal file
1
sorbet/rbi/gems/.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
**/*.rbi linguist-generated=true
|
||||
9
sorbet/rbi/gems/activemodel@7.2.2.1.rbi
generated
Normal file
9
sorbet/rbi/gems/activemodel@7.2.2.1.rbi
generated
Normal file
@@ -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
|
||||
11
sorbet/rbi/gems/activerecord@7.2.2.1.rbi
generated
Normal file
11
sorbet/rbi/gems/activerecord@7.2.2.1.rbi
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
# 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`.
|
||||
|
||||
|
||||
# :include: ../README.rdoc
|
||||
module ActiveRecord; end
|
||||
|
||||
module ActiveRecord::AuxTable; end
|
||||
11
sorbet/rbi/gems/activesupport@7.2.2.1.rbi
generated
Normal file
11
sorbet/rbi/gems/activesupport@7.2.2.1.rbi
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
# typed: false
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `activesupport` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem activesupport`.
|
||||
|
||||
|
||||
class NameError < ::StandardError
|
||||
include ::ErrorHighlight::CoreExt
|
||||
include ::DidYouMean::Correctable
|
||||
end
|
||||
9
sorbet/rbi/gems/base64@0.3.0.rbi
generated
Normal file
9
sorbet/rbi/gems/base64@0.3.0.rbi
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
# 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`.
|
||||
|
||||
|
||||
# THIS IS AN EMPTY RBI FILE.
|
||||
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
|
||||
619
sorbet/rbi/gems/benchmark@0.4.1.rbi
generated
Normal file
619
sorbet/rbi/gems/benchmark@0.4.1.rbi
generated
Normal file
@@ -0,0 +1,619 @@
|
||||
# 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
|
||||
# <code>"a"*1_000_000_000</code>:
|
||||
#
|
||||
# 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)
|
||||
#
|
||||
# source://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)
|
||||
#
|
||||
# source://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)
|
||||
#
|
||||
# source://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.
|
||||
#
|
||||
# source://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)
|
||||
#
|
||||
# source://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 seconds.
|
||||
#
|
||||
# Benchmark.realtime { "a" * 1_000_000_000 }
|
||||
# #=> 0.5098029999935534
|
||||
#
|
||||
# source://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)
|
||||
#
|
||||
# source://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)
|
||||
#
|
||||
# source://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.
|
||||
#
|
||||
# source://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)
|
||||
#
|
||||
# source://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 seconds.
|
||||
#
|
||||
# Benchmark.realtime { "a" * 1_000_000_000 }
|
||||
# #=> 0.5098029999935534
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#322
|
||||
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.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#334
|
||||
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.
|
||||
#
|
||||
# @return [Job] a new instance of Job
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#342
|
||||
def initialize(width); end
|
||||
|
||||
# Registers the given label and block pair in the job list.
|
||||
#
|
||||
# @raise [ArgumentError]
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#350
|
||||
def item(label = T.unsafe(nil), &blk); end
|
||||
|
||||
# An array of 2-element arrays, consisting of label and block pairs.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#362
|
||||
def list; end
|
||||
|
||||
# Registers the given label and block pair in the job list.
|
||||
#
|
||||
# @raise [ArgumentError]
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#350
|
||||
def report(label = T.unsafe(nil), &blk); end
|
||||
|
||||
# Length of the widest label in the #list.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#365
|
||||
def width; end
|
||||
end
|
||||
|
||||
# This class is used by the Benchmark.benchmark and Benchmark.bm methods.
|
||||
# It is of little direct interest to the user.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#372
|
||||
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.
|
||||
#
|
||||
# @return [Report] a new instance of Report
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#380
|
||||
def initialize(width = T.unsafe(nil), format = T.unsafe(nil)); end
|
||||
|
||||
# An array of Benchmark::Tms objects representing each item.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#399
|
||||
def format; end
|
||||
|
||||
# Prints the +label+ and measured time for the block,
|
||||
# formatted by +format+. See Tms#format for the
|
||||
# formatting rules.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#389
|
||||
def item(label = T.unsafe(nil), *format, &blk); end
|
||||
|
||||
# An array of Benchmark::Tms objects representing each item.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#399
|
||||
def list; end
|
||||
|
||||
# Prints the +label+ and measured time for the block,
|
||||
# formatted by +format+. See Tms#format for the
|
||||
# formatting rules.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#389
|
||||
def report(label = T.unsafe(nil), *format, &blk); end
|
||||
|
||||
# An array of Benchmark::Tms objects representing each item.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#399
|
||||
def width; end
|
||||
end
|
||||
|
||||
# A data object, representing the times associated with a benchmark
|
||||
# measurement.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#408
|
||||
class Benchmark::Tms
|
||||
# Returns an initialized Tms object which has
|
||||
# +utime+ as the user CPU time, +stime+ as the system CPU time,
|
||||
# +cutime+ as the children's user CPU time, +cstime+ as the children's
|
||||
# system CPU time, +real+ as the elapsed real time and +label+ as the label.
|
||||
#
|
||||
# @return [Tms] a new instance of Tms
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#443
|
||||
def initialize(utime = T.unsafe(nil), stime = T.unsafe(nil), cutime = T.unsafe(nil), cstime = T.unsafe(nil), real = T.unsafe(nil), label = T.unsafe(nil)); end
|
||||
|
||||
# Returns a new Tms object obtained by memberwise multiplication
|
||||
# of the individual times for this Tms object by +x+.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#491
|
||||
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.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#478
|
||||
def +(other); end
|
||||
|
||||
# Returns a new Tms object obtained by memberwise subtraction
|
||||
# of the individual times for the +other+ Tms object from those of this
|
||||
# Tms object.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#485
|
||||
def -(other); end
|
||||
|
||||
# Returns a new Tms object obtained by memberwise division
|
||||
# of the individual times for this Tms object by +x+.
|
||||
# This method and #+() are useful for taking statistics.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#498
|
||||
def /(x); end
|
||||
|
||||
# Returns a new Tms object whose times are the sum of the times for this
|
||||
# Tms object, plus the time required to execute the code block (+blk+).
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#452
|
||||
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+).
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#462
|
||||
def add!(&blk); end
|
||||
|
||||
# System CPU time of children
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#426
|
||||
def cstime; end
|
||||
|
||||
# User CPU time of children
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#423
|
||||
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:
|
||||
#
|
||||
# <tt>%u</tt>:: Replaced by the user CPU time, as reported by Tms#utime.
|
||||
# <tt>%y</tt>:: Replaced by the system CPU time, as reported by Tms#stime (Mnemonic: y of "s*y*stem")
|
||||
# <tt>%U</tt>:: Replaced by the children's user CPU time, as reported by Tms#cutime
|
||||
# <tt>%Y</tt>:: Replaced by the children's system CPU time, as reported by Tms#cstime
|
||||
# <tt>%t</tt>:: Replaced by the total CPU time, as reported by Tms#total
|
||||
# <tt>%r</tt>:: Replaced by the elapsed real time, as reported by Tms#real
|
||||
# <tt>%n</tt>:: 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.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#517
|
||||
def format(format = T.unsafe(nil), *args); end
|
||||
|
||||
# Label
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#435
|
||||
def label; end
|
||||
|
||||
# Elapsed real time
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#429
|
||||
def real; end
|
||||
|
||||
# System CPU time
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#420
|
||||
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.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#542
|
||||
def to_a; end
|
||||
|
||||
# Returns a hash containing the same data as `to_a`.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#549
|
||||
def to_h; end
|
||||
|
||||
# Same as #format.
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#532
|
||||
def to_s; end
|
||||
|
||||
# Total time, that is +utime+ + +stime+ + +cutime+ + +cstime+
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#432
|
||||
def total; end
|
||||
|
||||
# User CPU time
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#417
|
||||
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 <tt>+</tt>, <tt>-</tt>,
|
||||
# <tt>*</tt>, <tt>/</tt>
|
||||
#
|
||||
# source://benchmark//lib/benchmark.rb#570
|
||||
def memberwise(op, x); end
|
||||
end
|
||||
|
||||
# source://benchmark//lib/benchmark.rb#125
|
||||
Benchmark::VERSION = T.let(T.unsafe(nil), String)
|
||||
9
sorbet/rbi/gems/bigdecimal@3.2.2.rbi
generated
Normal file
9
sorbet/rbi/gems/bigdecimal@3.2.2.rbi
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
# typed: true
|
||||
|
||||
# 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`.
|
||||
|
||||
|
||||
# THIS IS AN EMPTY RBI FILE.
|
||||
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
|
||||
9
sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi
generated
Normal file
9
sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `concurrent-ruby` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem concurrent-ruby`.
|
||||
|
||||
|
||||
# THIS IS AN EMPTY RBI FILE.
|
||||
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
|
||||
9
sorbet/rbi/gems/connection_pool@2.5.3.rbi
generated
Normal file
9
sorbet/rbi/gems/connection_pool@2.5.3.rbi
generated
Normal file
@@ -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
|
||||
75
sorbet/rbi/gems/date@3.4.1.rbi
generated
Normal file
75
sorbet/rbi/gems/date@3.4.1.rbi
generated
Normal file
@@ -0,0 +1,75 @@
|
||||
# typed: true
|
||||
|
||||
# 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`.
|
||||
|
||||
|
||||
# source://date//lib/date.rb#6
|
||||
class Date
|
||||
include ::Comparable
|
||||
|
||||
# call-seq:
|
||||
# infinite? -> false
|
||||
#
|
||||
# Returns +false+
|
||||
#
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://date//lib/date.rb#13
|
||||
def infinite?; end
|
||||
end
|
||||
|
||||
# source://date//lib/date.rb#17
|
||||
class Date::Infinity < ::Numeric
|
||||
# @return [Infinity] a new instance of Infinity
|
||||
#
|
||||
# source://date//lib/date.rb#19
|
||||
def initialize(d = T.unsafe(nil)); end
|
||||
|
||||
# source://date//lib/date.rb#33
|
||||
def +@; end
|
||||
|
||||
# source://date//lib/date.rb#32
|
||||
def -@; end
|
||||
|
||||
# source://date//lib/date.rb#35
|
||||
def <=>(other); end
|
||||
|
||||
# source://date//lib/date.rb#30
|
||||
def abs; end
|
||||
|
||||
# source://date//lib/date.rb#51
|
||||
def coerce(other); end
|
||||
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://date//lib/date.rb#26
|
||||
def finite?; end
|
||||
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://date//lib/date.rb#27
|
||||
def infinite?; end
|
||||
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://date//lib/date.rb#28
|
||||
def nan?; end
|
||||
|
||||
# source://date//lib/date.rb#59
|
||||
def to_f; end
|
||||
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://date//lib/date.rb#25
|
||||
def zero?; end
|
||||
|
||||
protected
|
||||
|
||||
# source://date//lib/date.rb#21
|
||||
def d; end
|
||||
end
|
||||
|
||||
# source://date//lib/date.rb#7
|
||||
Date::VERSION = T.let(T.unsafe(nil), String)
|
||||
1134
sorbet/rbi/gems/diff-lcs@1.6.2.rbi
generated
Normal file
1134
sorbet/rbi/gems/diff-lcs@1.6.2.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
1615
sorbet/rbi/gems/drb@2.2.3.rbi
generated
Normal file
1615
sorbet/rbi/gems/drb@2.2.3.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
878
sorbet/rbi/gems/erb@5.0.1.rbi
generated
Normal file
878
sorbet/rbi/gems/erb@5.0.1.rbi
generated
Normal file
@@ -0,0 +1,878 @@
|
||||
# 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`.
|
||||
|
||||
|
||||
# = ERB -- Ruby Templating
|
||||
#
|
||||
# == Introduction
|
||||
#
|
||||
# ERB provides an easy to use but powerful templating system for Ruby. Using
|
||||
# ERB, actual Ruby code can be added to any plain text document for the
|
||||
# purposes of generating document information details and/or flow control.
|
||||
#
|
||||
# A very simple example is this:
|
||||
#
|
||||
# require 'erb'
|
||||
#
|
||||
# x = 42
|
||||
# template = ERB.new <<-EOF
|
||||
# The value of x is: <%= x %>
|
||||
# EOF
|
||||
# puts template.result(binding)
|
||||
#
|
||||
# <em>Prints:</em> The value of x is: 42
|
||||
#
|
||||
# More complex examples are given below.
|
||||
#
|
||||
#
|
||||
# == Recognized Tags
|
||||
#
|
||||
# ERB recognizes certain tags in the provided template and converts them based
|
||||
# on the rules below:
|
||||
#
|
||||
# <% Ruby code -- inline with output %>
|
||||
# <%= Ruby expression -- replace with result %>
|
||||
# <%# comment -- ignored -- useful in testing %> (`<% #` doesn't work. Don't use Ruby comments.)
|
||||
# % a line of Ruby code -- treated as <% line %> (optional -- see ERB.new)
|
||||
# %% replaced with % if first thing on a line and % processing is used
|
||||
# <%% or %%> -- replace with <% or %> respectively
|
||||
#
|
||||
# All other text is passed through ERB filtering unchanged.
|
||||
#
|
||||
#
|
||||
# == Options
|
||||
#
|
||||
# There are several settings you can change when you use ERB:
|
||||
# * the nature of the tags that are recognized;
|
||||
# * the binding used to resolve local variables in the template.
|
||||
#
|
||||
# See the ERB.new and ERB#result methods for more detail.
|
||||
#
|
||||
# == Character encodings
|
||||
#
|
||||
# ERB (or Ruby code generated by ERB) returns a string in the same
|
||||
# character encoding as the input string. When the input string has
|
||||
# a magic comment, however, it returns a string in the encoding specified
|
||||
# by the magic comment.
|
||||
#
|
||||
# # -*- coding: utf-8 -*-
|
||||
# require 'erb'
|
||||
#
|
||||
# template = ERB.new <<EOF
|
||||
# <%#-*- coding: Big5 -*-%>
|
||||
# \_\_ENCODING\_\_ is <%= \_\_ENCODING\_\_ %>.
|
||||
# EOF
|
||||
# puts template.result
|
||||
#
|
||||
# <em>Prints:</em> \_\_ENCODING\_\_ is Big5.
|
||||
#
|
||||
#
|
||||
# == Examples
|
||||
#
|
||||
# === Plain Text
|
||||
#
|
||||
# ERB is useful for any generic templating situation. Note that in this example, we use the
|
||||
# convenient "% at start of line" tag, and we quote the template literally with
|
||||
# <tt>%q{...}</tt> to avoid trouble with the backslash.
|
||||
#
|
||||
# require "erb"
|
||||
#
|
||||
# # Create template.
|
||||
# template = %q{
|
||||
# From: James Edward Gray II <james@grayproductions.net>
|
||||
# To: <%= to %>
|
||||
# Subject: Addressing Needs
|
||||
#
|
||||
# <%= to[/\w+/] %>:
|
||||
#
|
||||
# Just wanted to send a quick note assuring that your needs are being
|
||||
# addressed.
|
||||
#
|
||||
# I want you to know that my team will keep working on the issues,
|
||||
# especially:
|
||||
#
|
||||
# <%# ignore numerous minor requests -- focus on priorities %>
|
||||
# % priorities.each do |priority|
|
||||
# * <%= priority %>
|
||||
# % end
|
||||
#
|
||||
# Thanks for your patience.
|
||||
#
|
||||
# James Edward Gray II
|
||||
# }.gsub(/^ /, '')
|
||||
#
|
||||
# message = ERB.new(template, trim_mode: "%<>")
|
||||
#
|
||||
# # Set up template data.
|
||||
# to = "Community Spokesman <spokesman@ruby_community.org>"
|
||||
# priorities = [ "Run Ruby Quiz",
|
||||
# "Document Modules",
|
||||
# "Answer Questions on Ruby Talk" ]
|
||||
#
|
||||
# # Produce result.
|
||||
# email = message.result
|
||||
# puts email
|
||||
#
|
||||
# <i>Generates:</i>
|
||||
#
|
||||
# From: James Edward Gray II <james@grayproductions.net>
|
||||
# To: Community Spokesman <spokesman@ruby_community.org>
|
||||
# Subject: Addressing Needs
|
||||
#
|
||||
# Community:
|
||||
#
|
||||
# Just wanted to send a quick note assuring that your needs are being addressed.
|
||||
#
|
||||
# I want you to know that my team will keep working on the issues, especially:
|
||||
#
|
||||
# * Run Ruby Quiz
|
||||
# * Document Modules
|
||||
# * Answer Questions on Ruby Talk
|
||||
#
|
||||
# Thanks for your patience.
|
||||
#
|
||||
# James Edward Gray II
|
||||
#
|
||||
# === Ruby in HTML
|
||||
#
|
||||
# ERB is often used in <tt>.rhtml</tt> files (HTML with embedded Ruby). Notice the need in
|
||||
# this example to provide a special binding when the template is run, so that the instance
|
||||
# variables in the Product object can be resolved.
|
||||
#
|
||||
# require "erb"
|
||||
#
|
||||
# # Build template data class.
|
||||
# class Product
|
||||
# def initialize( code, name, desc, cost )
|
||||
# @code = code
|
||||
# @name = name
|
||||
# @desc = desc
|
||||
# @cost = cost
|
||||
#
|
||||
# @features = [ ]
|
||||
# end
|
||||
#
|
||||
# def add_feature( feature )
|
||||
# @features << feature
|
||||
# end
|
||||
#
|
||||
# # Support templating of member data.
|
||||
# def get_binding
|
||||
# binding
|
||||
# end
|
||||
#
|
||||
# # ...
|
||||
# end
|
||||
#
|
||||
# # Create template.
|
||||
# template = %{
|
||||
# <html>
|
||||
# <head><title>Ruby Toys -- <%= @name %></title></head>
|
||||
# <body>
|
||||
#
|
||||
# <h1><%= @name %> (<%= @code %>)</h1>
|
||||
# <p><%= @desc %></p>
|
||||
#
|
||||
# <ul>
|
||||
# <% @features.each do |f| %>
|
||||
# <li><b><%= f %></b></li>
|
||||
# <% end %>
|
||||
# </ul>
|
||||
#
|
||||
# <p>
|
||||
# <% if @cost < 10 %>
|
||||
# <b>Only <%= @cost %>!!!</b>
|
||||
# <% else %>
|
||||
# Call for a price, today!
|
||||
# <% end %>
|
||||
# </p>
|
||||
#
|
||||
# </body>
|
||||
# </html>
|
||||
# }.gsub(/^ /, '')
|
||||
#
|
||||
# rhtml = ERB.new(template)
|
||||
#
|
||||
# # Set up template data.
|
||||
# toy = Product.new( "TZ-1002",
|
||||
# "Rubysapien",
|
||||
# "Geek's Best Friend! Responds to Ruby commands...",
|
||||
# 999.95 )
|
||||
# toy.add_feature("Listens for verbal commands in the Ruby language!")
|
||||
# toy.add_feature("Ignores Perl, Java, and all C variants.")
|
||||
# toy.add_feature("Karate-Chop Action!!!")
|
||||
# toy.add_feature("Matz signature on left leg.")
|
||||
# toy.add_feature("Gem studded eyes... Rubies, of course!")
|
||||
#
|
||||
# # Produce result.
|
||||
# rhtml.run(toy.get_binding)
|
||||
#
|
||||
# <i>Generates (some blank lines removed):</i>
|
||||
#
|
||||
# <html>
|
||||
# <head><title>Ruby Toys -- Rubysapien</title></head>
|
||||
# <body>
|
||||
#
|
||||
# <h1>Rubysapien (TZ-1002)</h1>
|
||||
# <p>Geek's Best Friend! Responds to Ruby commands...</p>
|
||||
#
|
||||
# <ul>
|
||||
# <li><b>Listens for verbal commands in the Ruby language!</b></li>
|
||||
# <li><b>Ignores Perl, Java, and all C variants.</b></li>
|
||||
# <li><b>Karate-Chop Action!!!</b></li>
|
||||
# <li><b>Matz signature on left leg.</b></li>
|
||||
# <li><b>Gem studded eyes... Rubies, of course!</b></li>
|
||||
# </ul>
|
||||
#
|
||||
# <p>
|
||||
# Call for a price, today!
|
||||
# </p>
|
||||
#
|
||||
# </body>
|
||||
# </html>
|
||||
#
|
||||
#
|
||||
# == Notes
|
||||
#
|
||||
# There are a variety of templating solutions available in various Ruby projects.
|
||||
# For example, RDoc, distributed with Ruby, uses its own template engine, which
|
||||
# can be reused elsewhere.
|
||||
#
|
||||
# Other popular engines could be found in the corresponding
|
||||
# {Category}[https://www.ruby-toolbox.com/categories/template_engines] of
|
||||
# The Ruby Toolbox.
|
||||
#
|
||||
# source://erb//lib/erb/version.rb#2
|
||||
class ERB
|
||||
# Constructs a new ERB object with the template specified in _str_.
|
||||
#
|
||||
# An ERB object works by building a chunk of Ruby code that will output
|
||||
# the completed template when run.
|
||||
#
|
||||
# If _trim_mode_ is passed a String containing one or more of the following
|
||||
# modifiers, ERB will adjust its code generation as listed:
|
||||
#
|
||||
# % enables Ruby code processing for lines beginning with %
|
||||
# <> omit newline for lines starting with <% and ending in %>
|
||||
# > omit newline for lines ending in %>
|
||||
# - omit blank lines ending in -%>
|
||||
#
|
||||
# _eoutvar_ can be used to set the name of the variable ERB will build up
|
||||
# its output in. This is useful when you need to run multiple ERB
|
||||
# templates through the same binding and/or when you want to control where
|
||||
# output ends up. Pass the name of the variable to be used inside a String.
|
||||
#
|
||||
# === Example
|
||||
#
|
||||
# require "erb"
|
||||
#
|
||||
# # build data class
|
||||
# class Listings
|
||||
# PRODUCT = { :name => "Chicken Fried Steak",
|
||||
# :desc => "A well messaged pattie, breaded and fried.",
|
||||
# :cost => 9.95 }
|
||||
#
|
||||
# attr_reader :product, :price
|
||||
#
|
||||
# def initialize( product = "", price = "" )
|
||||
# @product = product
|
||||
# @price = price
|
||||
# end
|
||||
#
|
||||
# def build
|
||||
# b = binding
|
||||
# # create and run templates, filling member data variables
|
||||
# ERB.new(<<~'END_PRODUCT', trim_mode: "", eoutvar: "@product").result b
|
||||
# <%= PRODUCT[:name] %>
|
||||
# <%= PRODUCT[:desc] %>
|
||||
# END_PRODUCT
|
||||
# ERB.new(<<~'END_PRICE', trim_mode: "", eoutvar: "@price").result b
|
||||
# <%= PRODUCT[:name] %> -- <%= PRODUCT[:cost] %>
|
||||
# <%= PRODUCT[:desc] %>
|
||||
# END_PRICE
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# # setup template data
|
||||
# listings = Listings.new
|
||||
# listings.build
|
||||
#
|
||||
# puts listings.product + "\n" + listings.price
|
||||
#
|
||||
# _Generates_
|
||||
#
|
||||
# Chicken Fried Steak
|
||||
# A well massaged pattie, breaded and fried.
|
||||
#
|
||||
# Chicken Fried Steak -- 9.95
|
||||
# A well massaged pattie, breaded and fried.
|
||||
#
|
||||
# @return [ERB] a new instance of ERB
|
||||
#
|
||||
# source://erb//lib/erb.rb#334
|
||||
def initialize(str, safe_level = T.unsafe(nil), legacy_trim_mode = T.unsafe(nil), legacy_eoutvar = T.unsafe(nil), trim_mode: T.unsafe(nil), eoutvar: T.unsafe(nil)); end
|
||||
|
||||
# Define unnamed class which has _methodname_ as instance method, and return it.
|
||||
#
|
||||
# example:
|
||||
# class MyClass_
|
||||
# def initialize(arg1, arg2)
|
||||
# @arg1 = arg1; @arg2 = arg2
|
||||
# end
|
||||
# end
|
||||
# filename = 'example.rhtml' # @arg1 and @arg2 are used in example.rhtml
|
||||
# erb = ERB.new(File.read(filename))
|
||||
# erb.filename = filename
|
||||
# MyClass = erb.def_class(MyClass_, 'render()')
|
||||
# print MyClass.new('foo', 123).render()
|
||||
#
|
||||
# source://erb//lib/erb.rb#499
|
||||
def def_class(superklass = T.unsafe(nil), methodname = T.unsafe(nil)); end
|
||||
|
||||
# Define _methodname_ as instance method of _mod_ from compiled Ruby source.
|
||||
#
|
||||
# example:
|
||||
# filename = 'example.rhtml' # 'arg1' and 'arg2' are used in example.rhtml
|
||||
# erb = ERB.new(File.read(filename))
|
||||
# erb.def_method(MyClass, 'render(arg1, arg2)', filename)
|
||||
# print MyClass.new.render('foo', 123)
|
||||
#
|
||||
# source://erb//lib/erb.rb#463
|
||||
def def_method(mod, methodname, fname = T.unsafe(nil)); end
|
||||
|
||||
# Create unnamed module, define _methodname_ as instance method of it, and return it.
|
||||
#
|
||||
# example:
|
||||
# filename = 'example.rhtml' # 'arg1' and 'arg2' are used in example.rhtml
|
||||
# erb = ERB.new(File.read(filename))
|
||||
# erb.filename = filename
|
||||
# MyModule = erb.def_module('render(arg1, arg2)')
|
||||
# class MyClass
|
||||
# include MyModule
|
||||
# end
|
||||
#
|
||||
# source://erb//lib/erb.rb#480
|
||||
def def_module(methodname = T.unsafe(nil)); end
|
||||
|
||||
# The encoding to eval
|
||||
#
|
||||
# source://erb//lib/erb.rb#369
|
||||
def encoding; end
|
||||
|
||||
# The optional _filename_ argument passed to Kernel#eval when the ERB code
|
||||
# is run
|
||||
#
|
||||
# source://erb//lib/erb.rb#373
|
||||
def filename; end
|
||||
|
||||
# The optional _filename_ argument passed to Kernel#eval when the ERB code
|
||||
# is run
|
||||
#
|
||||
# source://erb//lib/erb.rb#373
|
||||
def filename=(_arg0); end
|
||||
|
||||
# The optional _lineno_ argument passed to Kernel#eval when the ERB code
|
||||
# is run
|
||||
#
|
||||
# source://erb//lib/erb.rb#377
|
||||
def lineno; end
|
||||
|
||||
# The optional _lineno_ argument passed to Kernel#eval when the ERB code
|
||||
# is run
|
||||
#
|
||||
# source://erb//lib/erb.rb#377
|
||||
def lineno=(_arg0); end
|
||||
|
||||
# Sets optional filename and line number that will be used in ERB code
|
||||
# evaluation and error reporting. See also #filename= and #lineno=
|
||||
#
|
||||
# erb = ERB.new('<%= some_x %>')
|
||||
# erb.render
|
||||
# # undefined local variable or method `some_x'
|
||||
# # from (erb):1
|
||||
#
|
||||
# erb.location = ['file.erb', 3]
|
||||
# # All subsequent error reporting would use new location
|
||||
# erb.render
|
||||
# # undefined local variable or method `some_x'
|
||||
# # from file.erb:4
|
||||
#
|
||||
# source://erb//lib/erb.rb#394
|
||||
def location=(_arg0); end
|
||||
|
||||
# Creates a new compiler for ERB. See ERB::Compiler.new for details
|
||||
#
|
||||
# source://erb//lib/erb.rb#361
|
||||
def make_compiler(trim_mode); end
|
||||
|
||||
# Executes the generated ERB code to produce a completed template, returning
|
||||
# the results of that code.
|
||||
#
|
||||
# _b_ accepts a Binding object which is used to set the context of
|
||||
# code evaluation.
|
||||
#
|
||||
# source://erb//lib/erb.rb#423
|
||||
def result(b = T.unsafe(nil)); end
|
||||
|
||||
# Render a template on a new toplevel binding with local variables specified
|
||||
# by a Hash object.
|
||||
#
|
||||
# source://erb//lib/erb.rb#432
|
||||
def result_with_hash(hash); end
|
||||
|
||||
# Generate results and print them. (see ERB#result)
|
||||
#
|
||||
# source://erb//lib/erb.rb#412
|
||||
def run(b = T.unsafe(nil)); end
|
||||
|
||||
# Can be used to set _eoutvar_ as described in ERB::new. It's probably
|
||||
# easier to just use the constructor though, since calling this method
|
||||
# requires the setup of an ERB _compiler_ object.
|
||||
#
|
||||
# source://erb//lib/erb.rb#404
|
||||
def set_eoutvar(compiler, eoutvar = T.unsafe(nil)); end
|
||||
|
||||
# The Ruby code generated by ERB
|
||||
#
|
||||
# source://erb//lib/erb.rb#366
|
||||
def src; end
|
||||
|
||||
private
|
||||
|
||||
# Returns a new binding each time *near* TOPLEVEL_BINDING for runs that do
|
||||
# not specify a binding.
|
||||
#
|
||||
# source://erb//lib/erb.rb#444
|
||||
def new_toplevel(vars = T.unsafe(nil)); end
|
||||
|
||||
class << self
|
||||
# Returns revision information for the erb.rb module.
|
||||
#
|
||||
# source://erb//lib/erb.rb#266
|
||||
def version; end
|
||||
end
|
||||
end
|
||||
|
||||
# --
|
||||
# ERB::Compiler
|
||||
#
|
||||
# Compiles ERB templates into Ruby code; the compiled code produces the
|
||||
# template result when evaluated. ERB::Compiler provides hooks to define how
|
||||
# generated output is handled.
|
||||
#
|
||||
# Internally ERB does something like this to generate the code returned by
|
||||
# ERB#src:
|
||||
#
|
||||
# compiler = ERB::Compiler.new('<>')
|
||||
# compiler.pre_cmd = ["_erbout=+''"]
|
||||
# compiler.put_cmd = "_erbout.<<"
|
||||
# compiler.insert_cmd = "_erbout.<<"
|
||||
# compiler.post_cmd = ["_erbout"]
|
||||
#
|
||||
# code, enc = compiler.compile("Got <%= obj %>!\n")
|
||||
# puts code
|
||||
#
|
||||
# <i>Generates</i>:
|
||||
#
|
||||
# #coding:UTF-8
|
||||
# _erbout=+''; _erbout.<< "Got ".freeze; _erbout.<<(( obj ).to_s); _erbout.<< "!\n".freeze; _erbout
|
||||
#
|
||||
# By default the output is sent to the print method. For example:
|
||||
#
|
||||
# compiler = ERB::Compiler.new('<>')
|
||||
# code, enc = compiler.compile("Got <%= obj %>!\n")
|
||||
# puts code
|
||||
#
|
||||
# <i>Generates</i>:
|
||||
#
|
||||
# #coding:UTF-8
|
||||
# print "Got ".freeze; print(( obj ).to_s); print "!\n".freeze
|
||||
#
|
||||
# == Evaluation
|
||||
#
|
||||
# The compiled code can be used in any context where the names in the code
|
||||
# correctly resolve. Using the last example, each of these print 'Got It!'
|
||||
#
|
||||
# Evaluate using a variable:
|
||||
#
|
||||
# obj = 'It'
|
||||
# eval code
|
||||
#
|
||||
# Evaluate using an input:
|
||||
#
|
||||
# mod = Module.new
|
||||
# mod.module_eval %{
|
||||
# def get(obj)
|
||||
# #{code}
|
||||
# end
|
||||
# }
|
||||
# extend mod
|
||||
# get('It')
|
||||
#
|
||||
# Evaluate using an accessor:
|
||||
#
|
||||
# klass = Class.new Object
|
||||
# klass.class_eval %{
|
||||
# attr_accessor :obj
|
||||
# def initialize(obj)
|
||||
# @obj = obj
|
||||
# end
|
||||
# def get_it
|
||||
# #{code}
|
||||
# end
|
||||
# }
|
||||
# klass.new('It').get_it
|
||||
#
|
||||
# Good! See also ERB#def_method, ERB#def_module, and ERB#def_class.
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#73
|
||||
class ERB::Compiler
|
||||
# Construct a new compiler using the trim_mode. See ERB::new for available
|
||||
# trim modes.
|
||||
#
|
||||
# @return [Compiler] a new instance of Compiler
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#433
|
||||
def initialize(trim_mode); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#315
|
||||
def add_insert_cmd(out, content); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#311
|
||||
def add_put_cmd(out, content); end
|
||||
|
||||
# Compiles an ERB template into Ruby code. Returns an array of the code
|
||||
# and encoding like ["code", Encoding].
|
||||
#
|
||||
# @raise [ArgumentError]
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#321
|
||||
def compile(s); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#381
|
||||
def compile_content(stag, out); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#368
|
||||
def compile_etag(etag, out, scanner); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#344
|
||||
def compile_stag(stag, out, scanner); end
|
||||
|
||||
# The command to handle text that is inserted prior to a newline
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#446
|
||||
def insert_cmd; end
|
||||
|
||||
# The command to handle text that is inserted prior to a newline
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#446
|
||||
def insert_cmd=(_arg0); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#427
|
||||
def make_scanner(src); end
|
||||
|
||||
# Returns the value of attribute percent.
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#440
|
||||
def percent; end
|
||||
|
||||
# An array of commands appended to compiled code
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#452
|
||||
def post_cmd; end
|
||||
|
||||
# An array of commands appended to compiled code
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#452
|
||||
def post_cmd=(_arg0); end
|
||||
|
||||
# An array of commands prepended to compiled code
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#449
|
||||
def pre_cmd; end
|
||||
|
||||
# An array of commands prepended to compiled code
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#449
|
||||
def pre_cmd=(_arg0); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#398
|
||||
def prepare_trim_mode(mode); end
|
||||
|
||||
# The command to handle text that ends with a newline
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#443
|
||||
def put_cmd; end
|
||||
|
||||
# The command to handle text that ends with a newline
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#443
|
||||
def put_cmd=(_arg0); end
|
||||
|
||||
# Returns the value of attribute trim_mode.
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#440
|
||||
def trim_mode; end
|
||||
|
||||
private
|
||||
|
||||
# A buffered text in #compile
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#457
|
||||
def content; end
|
||||
|
||||
# A buffered text in #compile
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#457
|
||||
def content=(_arg0); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#459
|
||||
def detect_magic_comment(s, enc = T.unsafe(nil)); end
|
||||
|
||||
# :startdoc:
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#485
|
||||
def warn_invalid_trim_mode(mode, uplevel:); end
|
||||
end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#278
|
||||
class ERB::Compiler::Buffer
|
||||
# @return [Buffer] a new instance of Buffer
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#279
|
||||
def initialize(compiler, enc = T.unsafe(nil), frozen = T.unsafe(nil)); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#301
|
||||
def close; end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#295
|
||||
def cr; end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#291
|
||||
def push(cmd); end
|
||||
|
||||
# Returns the value of attribute script.
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#289
|
||||
def script; end
|
||||
end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#254
|
||||
class ERB::Compiler::ExplicitScanner < ::ERB::Compiler::Scanner
|
||||
# source://erb//lib/erb/compiler.rb#255
|
||||
def scan; end
|
||||
end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#74
|
||||
class ERB::Compiler::PercentLine
|
||||
# @return [PercentLine] a new instance of PercentLine
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#75
|
||||
def initialize(str); end
|
||||
|
||||
# Returns the value of attribute value.
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#78
|
||||
def to_s; end
|
||||
|
||||
# Returns the value of attribute value.
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#78
|
||||
def value; end
|
||||
end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#82
|
||||
class ERB::Compiler::Scanner
|
||||
# @return [Scanner] a new instance of Scanner
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#108
|
||||
def initialize(src, trim_mode, percent); end
|
||||
|
||||
# Returns the value of attribute etags.
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#115
|
||||
def etags; end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#117
|
||||
def scan; end
|
||||
|
||||
# Returns the value of attribute stag.
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#114
|
||||
def stag; end
|
||||
|
||||
# Sets the attribute stag
|
||||
#
|
||||
# @param value the value to set the attribute stag to.
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#114
|
||||
def stag=(_arg0); end
|
||||
|
||||
# Returns the value of attribute stags.
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#115
|
||||
def stags; end
|
||||
|
||||
class << self
|
||||
# source://erb//lib/erb/compiler.rb#97
|
||||
def default_scanner=(klass); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#101
|
||||
def make_scanner(src, trim_mode, percent); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#86
|
||||
def regist_scanner(klass, trim_mode, percent); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#86
|
||||
def register_scanner(klass, trim_mode, percent); end
|
||||
end
|
||||
end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#107
|
||||
ERB::Compiler::Scanner::DEFAULT_ETAGS = T.let(T.unsafe(nil), Array)
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#106
|
||||
ERB::Compiler::Scanner::DEFAULT_STAGS = T.let(T.unsafe(nil), Array)
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#240
|
||||
class ERB::Compiler::SimpleScanner < ::ERB::Compiler::Scanner
|
||||
# source://erb//lib/erb/compiler.rb#241
|
||||
def scan; end
|
||||
end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#120
|
||||
class ERB::Compiler::TrimScanner < ::ERB::Compiler::Scanner
|
||||
# @return [TrimScanner] a new instance of TrimScanner
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#121
|
||||
def initialize(src, trim_mode, percent); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#210
|
||||
def explicit_trim_line(line); end
|
||||
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#229
|
||||
def is_erb_stag?(s); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#152
|
||||
def percent_line(line, &block); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#140
|
||||
def scan(&block); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#165
|
||||
def scan_line(line); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#174
|
||||
def trim_line1(line); end
|
||||
|
||||
# source://erb//lib/erb/compiler.rb#188
|
||||
def trim_line2(line); end
|
||||
end
|
||||
|
||||
# :stopdoc:
|
||||
#
|
||||
# source://erb//lib/erb/compiler.rb#476
|
||||
ERB::Compiler::WARNING_UPLEVEL = T.let(T.unsafe(nil), Integer)
|
||||
|
||||
# ERB::DefMethod
|
||||
#
|
||||
# Utility module to define eRuby script as instance method.
|
||||
#
|
||||
# === Example
|
||||
#
|
||||
# example.rhtml:
|
||||
# <% for item in @items %>
|
||||
# <b><%= item %></b>
|
||||
# <% end %>
|
||||
#
|
||||
# example.rb:
|
||||
# require 'erb'
|
||||
# class MyClass
|
||||
# extend ERB::DefMethod
|
||||
# def_erb_method('render()', 'example.rhtml')
|
||||
# def initialize(items)
|
||||
# @items = items
|
||||
# end
|
||||
# end
|
||||
# print MyClass.new([10,20,30]).render()
|
||||
#
|
||||
# result:
|
||||
#
|
||||
# <b>10</b>
|
||||
#
|
||||
# <b>20</b>
|
||||
#
|
||||
# <b>30</b>
|
||||
#
|
||||
# source://erb//lib/erb/def_method.rb#33
|
||||
module ERB::DefMethod
|
||||
private
|
||||
|
||||
# define _methodname_ as instance method of current module, using ERB
|
||||
# object or eRuby file
|
||||
#
|
||||
# source://erb//lib/erb/def_method.rb#36
|
||||
def def_erb_method(methodname, erb_or_fname); end
|
||||
|
||||
class << self
|
||||
# define _methodname_ as instance method of current module, using ERB
|
||||
# object or eRuby file
|
||||
#
|
||||
# source://erb//lib/erb/def_method.rb#36
|
||||
def def_erb_method(methodname, erb_or_fname); end
|
||||
end
|
||||
end
|
||||
|
||||
module ERB::Escape
|
||||
private
|
||||
|
||||
def html_escape(_arg0); end
|
||||
|
||||
class << self
|
||||
def html_escape(_arg0); end
|
||||
end
|
||||
end
|
||||
|
||||
# source://erb//lib/erb.rb#355
|
||||
ERB::NOT_GIVEN = T.let(T.unsafe(nil), Object)
|
||||
|
||||
# ERB::Util
|
||||
#
|
||||
# A utility module for conversion routines, often handy in HTML generation.
|
||||
#
|
||||
# source://erb//lib/erb/util.rb#32
|
||||
module ERB::Util
|
||||
include ::ERB::Escape
|
||||
|
||||
private
|
||||
|
||||
# cgi.gem <= v0.3.2
|
||||
#
|
||||
# source://erb//lib/erb/util.rb#63
|
||||
def u(s); end
|
||||
|
||||
# cgi.gem <= v0.3.2
|
||||
#
|
||||
# source://erb//lib/erb/util.rb#63
|
||||
def url_encode(s); end
|
||||
|
||||
class << self
|
||||
# cgi.gem <= v0.3.2
|
||||
#
|
||||
# source://erb//lib/erb/util.rb#63
|
||||
def u(s); end
|
||||
|
||||
# cgi.gem <= v0.3.2
|
||||
#
|
||||
# source://erb//lib/erb/util.rb#63
|
||||
def url_encode(s); end
|
||||
end
|
||||
end
|
||||
|
||||
# source://erb//lib/erb/version.rb#3
|
||||
ERB::VERSION = T.let(T.unsafe(nil), String)
|
||||
155
sorbet/rbi/gems/erubi@1.13.1.rbi
generated
Normal file
155
sorbet/rbi/gems/erubi@1.13.1.rbi
generated
Normal file
@@ -0,0 +1,155 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `erubi` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem erubi`.
|
||||
|
||||
|
||||
# source://erubi//lib/erubi.rb#3
|
||||
module Erubi
|
||||
private
|
||||
|
||||
def h(_arg0); end
|
||||
|
||||
class << self
|
||||
def h(_arg0); end
|
||||
end
|
||||
end
|
||||
|
||||
# source://erubi//lib/erubi.rb#51
|
||||
class Erubi::Engine
|
||||
# Initialize a new Erubi::Engine. Options:
|
||||
# +:bufval+ :: The value to use for the buffer variable, as a string (default <tt>'::String.new'</tt>).
|
||||
# +:bufvar+ :: The variable name to use for the buffer variable, as a string.
|
||||
# +:chain_appends+ :: Whether to chain <tt><<</t> calls to the buffer variable. Offers better
|
||||
# performance, but can cause issues when the buffer variable is reassigned during
|
||||
# template rendering (default +false+).
|
||||
# +:ensure+ :: Wrap the template in a begin/ensure block restoring the previous value of bufvar.
|
||||
# +:escapefunc+ :: The function to use for escaping, as a string (default: <tt>'::Erubi.h'</tt>).
|
||||
# +:escape+ :: Whether to make <tt><%=</tt> escape by default, and <tt><%==</tt> not escape by default.
|
||||
# +:escape_html+ :: Same as +:escape+, with lower priority.
|
||||
# +:filename+ :: The filename for the template.
|
||||
# the resulting source code. Note this may cause problems if you are wrapping the resulting
|
||||
# source code in other code, because the magic comment only has an effect at the beginning of
|
||||
# the file, and having the magic comment later in the file can trigger warnings.
|
||||
# +:freeze_template_literals+ :: Whether to suffix all literal strings for template code with <tt>.freeze</tt>
|
||||
# (default: +true+ on Ruby 2.1+, +false+ on Ruby 2.0 and older).
|
||||
# Can be set to +false+ on Ruby 2.3+ when frozen string literals are enabled
|
||||
# in order to improve performance.
|
||||
# +:literal_prefix+ :: The prefix to output when using escaped tag delimiters (default <tt>'<%'</tt>).
|
||||
# +:literal_postfix+ :: The postfix to output when using escaped tag delimiters (default <tt>'%>'</tt>).
|
||||
# +:outvar+ :: Same as +:bufvar+, with lower priority.
|
||||
# +:postamble+ :: The postamble for the template, by default returns the resulting source code.
|
||||
# +:preamble+ :: The preamble for the template, by default initializes the buffer variable.
|
||||
# +:regexp+ :: The regexp to use for scanning.
|
||||
# +:src+ :: The initial value to use for the source code, an empty string by default.
|
||||
# +:trim+ :: Whether to trim leading and trailing whitespace, true by default.
|
||||
#
|
||||
# @return [Engine] a new instance of Engine
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#91
|
||||
def initialize(input, properties = T.unsafe(nil)); end
|
||||
|
||||
# The variable name used for the buffer variable.
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#62
|
||||
def bufvar; end
|
||||
|
||||
# The filename of the template, if one was given.
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#59
|
||||
def filename; end
|
||||
|
||||
# The frozen ruby source code generated from the template, which can be evaled.
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#56
|
||||
def src; end
|
||||
|
||||
private
|
||||
|
||||
# :nocov:
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#209
|
||||
def _dup_string_if_frozen(string); end
|
||||
|
||||
# Add ruby code to the template
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#232
|
||||
def add_code(code); end
|
||||
|
||||
# Add the given ruby expression result to the template,
|
||||
# escaping it based on the indicator given and escape flag.
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#241
|
||||
def add_expression(indicator, code); end
|
||||
|
||||
# Add the result of Ruby expression to the template
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#250
|
||||
def add_expression_result(code); end
|
||||
|
||||
# Add the escaped result of Ruby expression to the template
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#255
|
||||
def add_expression_result_escaped(code); end
|
||||
|
||||
# Add the given postamble to the src. Can be overridden in subclasses
|
||||
# to make additional changes to src that depend on the current state.
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#261
|
||||
def add_postamble(postamble); end
|
||||
|
||||
# Add raw text to the template. Modifies argument if argument is mutable as a memory optimization.
|
||||
# Must be called with a string, cannot be called with nil (Rails's subclass depends on it).
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#222
|
||||
def add_text(text); end
|
||||
|
||||
# Raise an exception, as the base engine class does not support handling other indicators.
|
||||
#
|
||||
# @raise [ArgumentError]
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#267
|
||||
def handle(indicator, code, tailch, rspace, lspace); end
|
||||
|
||||
# Make sure that any current expression has been terminated.
|
||||
# The default is to terminate all expressions, but when
|
||||
# the chain_appends option is used, expressions may not be
|
||||
# terminated.
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#295
|
||||
def terminate_expression; end
|
||||
|
||||
# Make sure the buffer variable is the target of the next append
|
||||
# before yielding to the block. Mark that the buffer is the target
|
||||
# of the next append after the block executes.
|
||||
#
|
||||
# This method should only be called if the block will result in
|
||||
# code where << will append to the bufvar.
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#277
|
||||
def with_buffer; end
|
||||
end
|
||||
|
||||
# The default regular expression used for scanning.
|
||||
#
|
||||
# source://erubi//lib/erubi.rb#53
|
||||
Erubi::Engine::DEFAULT_REGEXP = T.let(T.unsafe(nil), Regexp)
|
||||
|
||||
# source://erubi//lib/erubi.rb#17
|
||||
Erubi::FREEZE_TEMPLATE_LITERALS = T.let(T.unsafe(nil), TrueClass)
|
||||
|
||||
# source://erubi//lib/erubi.rb#15
|
||||
Erubi::MATCH_METHOD = T.let(T.unsafe(nil), Symbol)
|
||||
|
||||
# source://erubi//lib/erubi.rb#8
|
||||
Erubi::RANGE_FIRST = T.let(T.unsafe(nil), Integer)
|
||||
|
||||
# source://erubi//lib/erubi.rb#9
|
||||
Erubi::RANGE_LAST = T.let(T.unsafe(nil), Integer)
|
||||
|
||||
# source://erubi//lib/erubi.rb#16
|
||||
Erubi::SKIP_DEFINED_FOR_INSTANCE_VARIABLE = T.let(T.unsafe(nil), TrueClass)
|
||||
|
||||
# source://erubi//lib/erubi.rb#4
|
||||
Erubi::VERSION = T.let(T.unsafe(nil), String)
|
||||
9
sorbet/rbi/gems/i18n@1.14.7.rbi
generated
Normal file
9
sorbet/rbi/gems/i18n@1.14.7.rbi
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `i18n` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem i18n`.
|
||||
|
||||
|
||||
# THIS IS AN EMPTY RBI FILE.
|
||||
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
|
||||
9
sorbet/rbi/gems/io-console@0.8.0.rbi
generated
Normal file
9
sorbet/rbi/gems/io-console@0.8.0.rbi
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `io-console` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem io-console`.
|
||||
|
||||
|
||||
# THIS IS AN EMPTY RBI FILE.
|
||||
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
|
||||
9
sorbet/rbi/gems/lefthook@1.12.2.rbi
generated
Normal file
9
sorbet/rbi/gems/lefthook@1.12.2.rbi
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `lefthook` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem lefthook`.
|
||||
|
||||
|
||||
# THIS IS AN EMPTY RBI FILE.
|
||||
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
|
||||
963
sorbet/rbi/gems/logger@1.7.0.rbi
generated
Normal file
963
sorbet/rbi/gems/logger@1.7.0.rbi
generated
Normal file
@@ -0,0 +1,963 @@
|
||||
# typed: false
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `logger` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem logger`.
|
||||
|
||||
|
||||
# \Class \Logger provides a simple but sophisticated logging utility that
|
||||
# you can use to create one or more
|
||||
# {event logs}[https://en.wikipedia.org/wiki/Logging_(software)#Event_logs]
|
||||
# for your program.
|
||||
# Each such log contains a chronological sequence of entries
|
||||
# that provides a record of the program's activities.
|
||||
#
|
||||
# == About the Examples
|
||||
#
|
||||
# All examples on this page assume that \Logger has been required:
|
||||
#
|
||||
# require 'logger'
|
||||
#
|
||||
# == Synopsis
|
||||
#
|
||||
# Create a log with Logger.new:
|
||||
#
|
||||
# # Single log file.
|
||||
# logger = Logger.new('t.log')
|
||||
# # Size-based rotated logging: 3 10-megabyte files.
|
||||
# logger = Logger.new('t.log', 3, 10485760)
|
||||
# # Period-based rotated logging: daily (also allowed: 'weekly', 'monthly').
|
||||
# logger = Logger.new('t.log', 'daily')
|
||||
# # Log to an IO stream.
|
||||
# logger = Logger.new($stdout)
|
||||
#
|
||||
# Add entries (level, message) with Logger#add:
|
||||
#
|
||||
# logger.add(Logger::DEBUG, 'Maximal debugging info')
|
||||
# logger.add(Logger::INFO, 'Non-error information')
|
||||
# logger.add(Logger::WARN, 'Non-error warning')
|
||||
# logger.add(Logger::ERROR, 'Non-fatal error')
|
||||
# logger.add(Logger::FATAL, 'Fatal error')
|
||||
# logger.add(Logger::UNKNOWN, 'Most severe')
|
||||
#
|
||||
# Close the log with Logger#close:
|
||||
#
|
||||
# logger.close
|
||||
#
|
||||
# == Entries
|
||||
#
|
||||
# You can add entries with method Logger#add:
|
||||
#
|
||||
# logger.add(Logger::DEBUG, 'Maximal debugging info')
|
||||
# logger.add(Logger::INFO, 'Non-error information')
|
||||
# logger.add(Logger::WARN, 'Non-error warning')
|
||||
# logger.add(Logger::ERROR, 'Non-fatal error')
|
||||
# logger.add(Logger::FATAL, 'Fatal error')
|
||||
# logger.add(Logger::UNKNOWN, 'Most severe')
|
||||
#
|
||||
# These shorthand methods also add entries:
|
||||
#
|
||||
# logger.debug('Maximal debugging info')
|
||||
# logger.info('Non-error information')
|
||||
# logger.warn('Non-error warning')
|
||||
# logger.error('Non-fatal error')
|
||||
# logger.fatal('Fatal error')
|
||||
# logger.unknown('Most severe')
|
||||
#
|
||||
# When you call any of these methods,
|
||||
# the entry may or may not be written to the log,
|
||||
# depending on the entry's severity and on the log level;
|
||||
# see {Log Level}[rdoc-ref:Logger@Log+Level]
|
||||
#
|
||||
# An entry always has:
|
||||
#
|
||||
# - A severity (the required argument to #add).
|
||||
# - An automatically created timestamp.
|
||||
#
|
||||
# And may also have:
|
||||
#
|
||||
# - A message.
|
||||
# - A program name.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# logger = Logger.new($stdout)
|
||||
# logger.add(Logger::INFO, 'My message.', 'mung')
|
||||
# # => I, [2022-05-07T17:21:46.536234 #20536] INFO -- mung: My message.
|
||||
#
|
||||
# The default format for an entry is:
|
||||
#
|
||||
# "%s, [%s #%d] %5s -- %s: %s\n"
|
||||
#
|
||||
# where the values to be formatted are:
|
||||
#
|
||||
# - \Severity (one letter).
|
||||
# - Timestamp.
|
||||
# - Process id.
|
||||
# - \Severity (word).
|
||||
# - Program name.
|
||||
# - Message.
|
||||
#
|
||||
# You can use a different entry format by:
|
||||
#
|
||||
# - Setting a custom format proc (affects following entries);
|
||||
# see {formatter=}[Logger.html#attribute-i-formatter].
|
||||
# - Calling any of the methods above with a block
|
||||
# (affects only the one entry).
|
||||
# Doing so can have two benefits:
|
||||
#
|
||||
# - Context: the block can evaluate the entire program context
|
||||
# and create a context-dependent message.
|
||||
# - Performance: the block is not evaluated unless the log level
|
||||
# permits the entry actually to be written:
|
||||
#
|
||||
# logger.error { my_slow_message_generator }
|
||||
#
|
||||
# Contrast this with the string form, where the string is
|
||||
# always evaluated, regardless of the log level:
|
||||
#
|
||||
# logger.error("#{my_slow_message_generator}")
|
||||
#
|
||||
# === \Severity
|
||||
#
|
||||
# The severity of a log entry has two effects:
|
||||
#
|
||||
# - Determines whether the entry is selected for inclusion in the log;
|
||||
# see {Log Level}[rdoc-ref:Logger@Log+Level].
|
||||
# - Indicates to any log reader (whether a person or a program)
|
||||
# the relative importance of the entry.
|
||||
#
|
||||
# === Timestamp
|
||||
#
|
||||
# The timestamp for a log entry is generated automatically
|
||||
# when the entry is created.
|
||||
#
|
||||
# The logged timestamp is formatted by method
|
||||
# {Time#strftime}[https://docs.ruby-lang.org/en/master/Time.html#method-i-strftime]
|
||||
# using this format string:
|
||||
#
|
||||
# '%Y-%m-%dT%H:%M:%S.%6N'
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# logger = Logger.new($stdout)
|
||||
# logger.add(Logger::INFO)
|
||||
# # => I, [2022-05-07T17:04:32.318331 #20536] INFO -- : nil
|
||||
#
|
||||
# You can set a different format using method #datetime_format=.
|
||||
#
|
||||
# === Message
|
||||
#
|
||||
# The message is an optional argument to an entry method:
|
||||
#
|
||||
# logger = Logger.new($stdout)
|
||||
# logger.add(Logger::INFO, 'My message')
|
||||
# # => I, [2022-05-07T18:15:37.647581 #20536] INFO -- : My message
|
||||
#
|
||||
# For the default entry formatter, <tt>Logger::Formatter</tt>,
|
||||
# the message object may be:
|
||||
#
|
||||
# - A string: used as-is.
|
||||
# - An Exception: <tt>message.message</tt> is used.
|
||||
# - Anything else: <tt>message.inspect</tt> is used.
|
||||
#
|
||||
# *Note*: Logger::Formatter does not escape or sanitize
|
||||
# the message passed to it.
|
||||
# Developers should be aware that malicious data (user input)
|
||||
# may be in the message, and should explicitly escape untrusted data.
|
||||
#
|
||||
# You can use a custom formatter to escape message data;
|
||||
# see the example at {formatter=}[Logger.html#attribute-i-formatter].
|
||||
#
|
||||
# === Program Name
|
||||
#
|
||||
# The program name is an optional argument to an entry method:
|
||||
#
|
||||
# logger = Logger.new($stdout)
|
||||
# logger.add(Logger::INFO, 'My message', 'mung')
|
||||
# # => I, [2022-05-07T18:17:38.084716 #20536] INFO -- mung: My message
|
||||
#
|
||||
# The default program name for a new logger may be set in the call to
|
||||
# Logger.new via optional keyword argument +progname+:
|
||||
#
|
||||
# logger = Logger.new('t.log', progname: 'mung')
|
||||
#
|
||||
# The default program name for an existing logger may be set
|
||||
# by a call to method #progname=:
|
||||
#
|
||||
# logger.progname = 'mung'
|
||||
#
|
||||
# The current program name may be retrieved with method
|
||||
# {progname}[Logger.html#attribute-i-progname]:
|
||||
#
|
||||
# logger.progname # => "mung"
|
||||
#
|
||||
# == Log Level
|
||||
#
|
||||
# The log level setting determines whether an entry is actually
|
||||
# written to the log, based on the entry's severity.
|
||||
#
|
||||
# These are the defined severities (least severe to most severe):
|
||||
#
|
||||
# logger = Logger.new($stdout)
|
||||
# logger.add(Logger::DEBUG, 'Maximal debugging info')
|
||||
# # => D, [2022-05-07T17:57:41.776220 #20536] DEBUG -- : Maximal debugging info
|
||||
# logger.add(Logger::INFO, 'Non-error information')
|
||||
# # => I, [2022-05-07T17:59:14.349167 #20536] INFO -- : Non-error information
|
||||
# logger.add(Logger::WARN, 'Non-error warning')
|
||||
# # => W, [2022-05-07T18:00:45.337538 #20536] WARN -- : Non-error warning
|
||||
# logger.add(Logger::ERROR, 'Non-fatal error')
|
||||
# # => E, [2022-05-07T18:02:41.592912 #20536] ERROR -- : Non-fatal error
|
||||
# logger.add(Logger::FATAL, 'Fatal error')
|
||||
# # => F, [2022-05-07T18:05:24.703931 #20536] FATAL -- : Fatal error
|
||||
# logger.add(Logger::UNKNOWN, 'Most severe')
|
||||
# # => A, [2022-05-07T18:07:54.657491 #20536] ANY -- : Most severe
|
||||
#
|
||||
# The default initial level setting is Logger::DEBUG, the lowest level,
|
||||
# which means that all entries are to be written, regardless of severity:
|
||||
#
|
||||
# logger = Logger.new($stdout)
|
||||
# logger.level # => 0
|
||||
# logger.add(0, "My message")
|
||||
# # => D, [2022-05-11T15:10:59.773668 #20536] DEBUG -- : My message
|
||||
#
|
||||
# You can specify a different setting in a new logger
|
||||
# using keyword argument +level+ with an appropriate value:
|
||||
#
|
||||
# logger = Logger.new($stdout, level: Logger::ERROR)
|
||||
# logger = Logger.new($stdout, level: 'error')
|
||||
# logger = Logger.new($stdout, level: :error)
|
||||
# logger.level # => 3
|
||||
#
|
||||
# With this level, entries with severity Logger::ERROR and higher
|
||||
# are written, while those with lower severities are not written:
|
||||
#
|
||||
# logger = Logger.new($stdout, level: Logger::ERROR)
|
||||
# logger.add(3)
|
||||
# # => E, [2022-05-11T15:17:20.933362 #20536] ERROR -- : nil
|
||||
# logger.add(2) # Silent.
|
||||
#
|
||||
# You can set the log level for an existing logger
|
||||
# with method #level=:
|
||||
#
|
||||
# logger.level = Logger::ERROR
|
||||
#
|
||||
# These shorthand methods also set the level:
|
||||
#
|
||||
# logger.debug! # => 0
|
||||
# logger.info! # => 1
|
||||
# logger.warn! # => 2
|
||||
# logger.error! # => 3
|
||||
# logger.fatal! # => 4
|
||||
#
|
||||
# You can retrieve the log level with method #level.
|
||||
#
|
||||
# logger.level = Logger::ERROR
|
||||
# logger.level # => 3
|
||||
#
|
||||
# These methods return whether a given
|
||||
# level is to be written:
|
||||
#
|
||||
# logger.level = Logger::ERROR
|
||||
# logger.debug? # => false
|
||||
# logger.info? # => false
|
||||
# logger.warn? # => false
|
||||
# logger.error? # => true
|
||||
# logger.fatal? # => true
|
||||
#
|
||||
# == Log File Rotation
|
||||
#
|
||||
# By default, a log file is a single file that grows indefinitely
|
||||
# (until explicitly closed); there is no file rotation.
|
||||
#
|
||||
# To keep log files to a manageable size,
|
||||
# you can use _log_ _file_ _rotation_, which uses multiple log files:
|
||||
#
|
||||
# - Each log file has entries for a non-overlapping
|
||||
# time interval.
|
||||
# - Only the most recent log file is open and active;
|
||||
# the others are closed and inactive.
|
||||
#
|
||||
# === Size-Based Rotation
|
||||
#
|
||||
# For size-based log file rotation, call Logger.new with:
|
||||
#
|
||||
# - Argument +logdev+ as a file path.
|
||||
# - Argument +shift_age+ with a positive integer:
|
||||
# the number of log files to be in the rotation.
|
||||
# - Argument +shift_size+ as a positive integer:
|
||||
# the maximum size (in bytes) of each log file;
|
||||
# defaults to 1048576 (1 megabyte).
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# logger = Logger.new('t.log', 3) # Three 1-megabyte files.
|
||||
# logger = Logger.new('t.log', 5, 10485760) # Five 10-megabyte files.
|
||||
#
|
||||
# For these examples, suppose:
|
||||
#
|
||||
# logger = Logger.new('t.log', 3)
|
||||
#
|
||||
# Logging begins in the new log file, +t.log+;
|
||||
# the log file is "full" and ready for rotation
|
||||
# when a new entry would cause its size to exceed +shift_size+.
|
||||
#
|
||||
# The first time +t.log+ is full:
|
||||
#
|
||||
# - +t.log+ is closed and renamed to +t.log.0+.
|
||||
# - A new file +t.log+ is opened.
|
||||
#
|
||||
# The second time +t.log+ is full:
|
||||
#
|
||||
# - +t.log.0 is renamed as +t.log.1+.
|
||||
# - +t.log+ is closed and renamed to +t.log.0+.
|
||||
# - A new file +t.log+ is opened.
|
||||
#
|
||||
# Each subsequent time that +t.log+ is full,
|
||||
# the log files are rotated:
|
||||
#
|
||||
# - +t.log.1+ is removed.
|
||||
# - +t.log.0 is renamed as +t.log.1+.
|
||||
# - +t.log+ is closed and renamed to +t.log.0+.
|
||||
# - A new file +t.log+ is opened.
|
||||
#
|
||||
# === Periodic Rotation
|
||||
#
|
||||
# For periodic rotation, call Logger.new with:
|
||||
#
|
||||
# - Argument +logdev+ as a file path.
|
||||
# - Argument +shift_age+ as a string period indicator.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# logger = Logger.new('t.log', 'daily') # Rotate log files daily.
|
||||
# logger = Logger.new('t.log', 'weekly') # Rotate log files weekly.
|
||||
# logger = Logger.new('t.log', 'monthly') # Rotate log files monthly.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# logger = Logger.new('t.log', 'daily')
|
||||
#
|
||||
# When the given period expires:
|
||||
#
|
||||
# - The base log file, +t.log+ is closed and renamed
|
||||
# with a date-based suffix such as +t.log.20220509+.
|
||||
# - A new log file +t.log+ is opened.
|
||||
# - Nothing is removed.
|
||||
#
|
||||
# The default format for the suffix is <tt>'%Y%m%d'</tt>,
|
||||
# which produces a suffix similar to the one above.
|
||||
# You can set a different format using create-time option
|
||||
# +shift_period_suffix+;
|
||||
# see details and suggestions at
|
||||
# {Time#strftime}[https://docs.ruby-lang.org/en/master/Time.html#method-i-strftime].
|
||||
#
|
||||
# source://logger//lib/logger/version.rb#3
|
||||
class Logger
|
||||
include ::Logger::Severity
|
||||
|
||||
# :call-seq:
|
||||
# Logger.new(logdev, shift_age = 0, shift_size = 1048576, **options)
|
||||
#
|
||||
# With the single argument +logdev+,
|
||||
# returns a new logger with all default options:
|
||||
#
|
||||
# Logger.new('t.log') # => #<Logger:0x000001e685dc6ac8>
|
||||
#
|
||||
# Argument +logdev+ must be one of:
|
||||
#
|
||||
# - A string filepath: entries are to be written
|
||||
# to the file at that path; if the file at that path exists,
|
||||
# new entries are appended.
|
||||
# - An IO stream (typically <tt>$stdout</tt>, <tt>$stderr</tt>. or
|
||||
# an open file): entries are to be written to the given stream.
|
||||
# - +nil+ or +File::NULL+: no entries are to be written.
|
||||
#
|
||||
# Argument +shift_age+ must be one of:
|
||||
#
|
||||
# - The number of log files to be in the rotation.
|
||||
# See {Size-Based Rotation}[rdoc-ref:Logger@Size-Based+Rotation].
|
||||
# - A string period indicator.
|
||||
# See {Periodic Rotation}[rdoc-ref:Logger@Periodic+Rotation].
|
||||
#
|
||||
# Argument +shift_size+ is the maximum size (in bytes) of each log file.
|
||||
# See {Size-Based Rotation}[rdoc-ref:Logger@Size-Based+Rotation].
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# Logger.new('t.log')
|
||||
# Logger.new($stdout)
|
||||
#
|
||||
# The keyword options are:
|
||||
#
|
||||
# - +level+: sets the log level; default value is Logger::DEBUG.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level]:
|
||||
#
|
||||
# Logger.new('t.log', level: Logger::ERROR)
|
||||
#
|
||||
# - +progname+: sets the default program name; default is +nil+.
|
||||
# See {Program Name}[rdoc-ref:Logger@Program+Name]:
|
||||
#
|
||||
# Logger.new('t.log', progname: 'mung')
|
||||
#
|
||||
# - +formatter+: sets the entry formatter; default is +nil+.
|
||||
# See {formatter=}[Logger.html#attribute-i-formatter].
|
||||
#
|
||||
# - +datetime_format+: sets the format for entry timestamp;
|
||||
# default is +nil+.
|
||||
# See #datetime_format=.
|
||||
#
|
||||
# - +binmode+: sets whether the logger writes in binary mode;
|
||||
# default is +false+.
|
||||
#
|
||||
# - +shift_period_suffix+: sets the format for the filename suffix
|
||||
# for periodic log file rotation; default is <tt>'%Y%m%d'</tt>.
|
||||
# See {Periodic Rotation}[rdoc-ref:Logger@Periodic+Rotation].
|
||||
#
|
||||
# - +reraise_write_errors+: An array of exception classes, which will
|
||||
# be reraised if there is an error when writing to the log device.
|
||||
# The default is to swallow all exceptions raised.
|
||||
# - +skip_header+: If +true+, prevents the logger from writing a header
|
||||
# when creating a new log file. The default is +false+, meaning
|
||||
# the header will be written as usual.
|
||||
#
|
||||
# @return [Logger] a new instance of Logger
|
||||
#
|
||||
# source://logger//lib/logger.rb#598
|
||||
def initialize(logdev, shift_age = T.unsafe(nil), shift_size = T.unsafe(nil), level: T.unsafe(nil), progname: T.unsafe(nil), formatter: T.unsafe(nil), datetime_format: T.unsafe(nil), binmode: T.unsafe(nil), shift_period_suffix: T.unsafe(nil), reraise_write_errors: T.unsafe(nil), skip_header: T.unsafe(nil)); end
|
||||
|
||||
# Writes the given +msg+ to the log with no formatting;
|
||||
# returns the number of characters written,
|
||||
# or +nil+ if no log device exists:
|
||||
#
|
||||
# logger = Logger.new($stdout)
|
||||
# logger << 'My message.' # => 10
|
||||
#
|
||||
# Output:
|
||||
#
|
||||
# My message.
|
||||
#
|
||||
# source://logger//lib/logger.rb#708
|
||||
def <<(msg); end
|
||||
|
||||
# Creates a log entry, which may or may not be written to the log,
|
||||
# depending on the entry's severity and on the log level.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level]
|
||||
# and {Entries}[rdoc-ref:Logger@Entries] for details.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# logger = Logger.new($stdout, progname: 'mung')
|
||||
# logger.add(Logger::INFO)
|
||||
# logger.add(Logger::ERROR, 'No good')
|
||||
# logger.add(Logger::ERROR, 'No good', 'gnum')
|
||||
#
|
||||
# Output:
|
||||
#
|
||||
# I, [2022-05-12T16:25:31.469726 #36328] INFO -- mung: mung
|
||||
# E, [2022-05-12T16:25:55.349414 #36328] ERROR -- mung: No good
|
||||
# E, [2022-05-12T16:26:35.841134 #36328] ERROR -- gnum: No good
|
||||
#
|
||||
# These convenience methods have implicit severity:
|
||||
#
|
||||
# - #debug.
|
||||
# - #info.
|
||||
# - #warn.
|
||||
# - #error.
|
||||
# - #fatal.
|
||||
# - #unknown.
|
||||
#
|
||||
# source://logger//lib/logger.rb#675
|
||||
def add(severity, message = T.unsafe(nil), progname = T.unsafe(nil)); end
|
||||
|
||||
# Closes the logger; returns +nil+:
|
||||
#
|
||||
# logger = Logger.new('t.log')
|
||||
# logger.close # => nil
|
||||
# logger.info('foo') # Prints "log writing failed. closed stream"
|
||||
#
|
||||
# Related: Logger#reopen.
|
||||
#
|
||||
# source://logger//lib/logger.rb#755
|
||||
def close; end
|
||||
|
||||
# Returns the date-time format; see #datetime_format=.
|
||||
#
|
||||
# source://logger//lib/logger.rb#438
|
||||
def datetime_format; end
|
||||
|
||||
# Sets the date-time format.
|
||||
#
|
||||
# Argument +datetime_format+ should be either of these:
|
||||
#
|
||||
# - A string suitable for use as a format for method
|
||||
# {Time#strftime}[https://docs.ruby-lang.org/en/master/Time.html#method-i-strftime].
|
||||
# - +nil+: the logger uses <tt>'%Y-%m-%dT%H:%M:%S.%6N'</tt>.
|
||||
#
|
||||
# source://logger//lib/logger.rb#432
|
||||
def datetime_format=(datetime_format); end
|
||||
|
||||
# Equivalent to calling #add with severity <tt>Logger::DEBUG</tt>.
|
||||
#
|
||||
# source://logger//lib/logger.rb#714
|
||||
def debug(progname = T.unsafe(nil), &block); end
|
||||
|
||||
# Sets the log level to Logger::DEBUG.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level].
|
||||
#
|
||||
# source://logger//lib/logger.rb#487
|
||||
def debug!; end
|
||||
|
||||
# Returns +true+ if the log level allows entries with severity
|
||||
# Logger::DEBUG to be written, +false+ otherwise.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level].
|
||||
#
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://logger//lib/logger.rb#482
|
||||
def debug?; end
|
||||
|
||||
# Equivalent to calling #add with severity <tt>Logger::ERROR</tt>.
|
||||
#
|
||||
# source://logger//lib/logger.rb#732
|
||||
def error(progname = T.unsafe(nil), &block); end
|
||||
|
||||
# Sets the log level to Logger::ERROR.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level].
|
||||
#
|
||||
# source://logger//lib/logger.rb#520
|
||||
def error!; end
|
||||
|
||||
# Returns +true+ if the log level allows entries with severity
|
||||
# Logger::ERROR to be written, +false+ otherwise.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level].
|
||||
#
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://logger//lib/logger.rb#515
|
||||
def error?; end
|
||||
|
||||
# Equivalent to calling #add with severity <tt>Logger::FATAL</tt>.
|
||||
#
|
||||
# source://logger//lib/logger.rb#738
|
||||
def fatal(progname = T.unsafe(nil), &block); end
|
||||
|
||||
# Sets the log level to Logger::FATAL.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level].
|
||||
#
|
||||
# source://logger//lib/logger.rb#531
|
||||
def fatal!; end
|
||||
|
||||
# Returns +true+ if the log level allows entries with severity
|
||||
# Logger::FATAL to be written, +false+ otherwise.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level].
|
||||
#
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://logger//lib/logger.rb#526
|
||||
def fatal?; end
|
||||
|
||||
# Sets or retrieves the logger entry formatter proc.
|
||||
#
|
||||
# When +formatter+ is +nil+, the logger uses Logger::Formatter.
|
||||
#
|
||||
# When +formatter+ is a proc, a new entry is formatted by the proc,
|
||||
# which is called with four arguments:
|
||||
#
|
||||
# - +severity+: The severity of the entry.
|
||||
# - +time+: A Time object representing the entry's timestamp.
|
||||
# - +progname+: The program name for the entry.
|
||||
# - +msg+: The message for the entry (string or string-convertible object).
|
||||
#
|
||||
# The proc should return a string containing the formatted entry.
|
||||
#
|
||||
# This custom formatter uses
|
||||
# {String#dump}[https://docs.ruby-lang.org/en/master/String.html#method-i-dump]
|
||||
# to escape the message string:
|
||||
#
|
||||
# logger = Logger.new($stdout, progname: 'mung')
|
||||
# original_formatter = logger.formatter || Logger::Formatter.new
|
||||
# logger.formatter = proc { |severity, time, progname, msg|
|
||||
# original_formatter.call(severity, time, progname, msg.dump)
|
||||
# }
|
||||
# logger.add(Logger::INFO, "hello \n ''")
|
||||
# logger.add(Logger::INFO, "\f\x00\xff\\\"")
|
||||
#
|
||||
# Output:
|
||||
#
|
||||
# I, [2022-05-13T13:16:29.637488 #8492] INFO -- mung: "hello \n ''"
|
||||
# I, [2022-05-13T13:16:29.637610 #8492] INFO -- mung: "\f\x00\xFF\\\""
|
||||
#
|
||||
# source://logger//lib/logger.rb#473
|
||||
def formatter; end
|
||||
|
||||
# Sets or retrieves the logger entry formatter proc.
|
||||
#
|
||||
# When +formatter+ is +nil+, the logger uses Logger::Formatter.
|
||||
#
|
||||
# When +formatter+ is a proc, a new entry is formatted by the proc,
|
||||
# which is called with four arguments:
|
||||
#
|
||||
# - +severity+: The severity of the entry.
|
||||
# - +time+: A Time object representing the entry's timestamp.
|
||||
# - +progname+: The program name for the entry.
|
||||
# - +msg+: The message for the entry (string or string-convertible object).
|
||||
#
|
||||
# The proc should return a string containing the formatted entry.
|
||||
#
|
||||
# This custom formatter uses
|
||||
# {String#dump}[https://docs.ruby-lang.org/en/master/String.html#method-i-dump]
|
||||
# to escape the message string:
|
||||
#
|
||||
# logger = Logger.new($stdout, progname: 'mung')
|
||||
# original_formatter = logger.formatter || Logger::Formatter.new
|
||||
# logger.formatter = proc { |severity, time, progname, msg|
|
||||
# original_formatter.call(severity, time, progname, msg.dump)
|
||||
# }
|
||||
# logger.add(Logger::INFO, "hello \n ''")
|
||||
# logger.add(Logger::INFO, "\f\x00\xff\\\"")
|
||||
#
|
||||
# Output:
|
||||
#
|
||||
# I, [2022-05-13T13:16:29.637488 #8492] INFO -- mung: "hello \n ''"
|
||||
# I, [2022-05-13T13:16:29.637610 #8492] INFO -- mung: "\f\x00\xFF\\\""
|
||||
#
|
||||
# source://logger//lib/logger.rb#473
|
||||
def formatter=(_arg0); end
|
||||
|
||||
# Equivalent to calling #add with severity <tt>Logger::INFO</tt>.
|
||||
#
|
||||
# source://logger//lib/logger.rb#720
|
||||
def info(progname = T.unsafe(nil), &block); end
|
||||
|
||||
# Sets the log level to Logger::INFO.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level].
|
||||
#
|
||||
# source://logger//lib/logger.rb#498
|
||||
def info!; end
|
||||
|
||||
# Returns +true+ if the log level allows entries with severity
|
||||
# Logger::INFO to be written, +false+ otherwise.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level].
|
||||
#
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://logger//lib/logger.rb#493
|
||||
def info?; end
|
||||
|
||||
# Logging severity threshold (e.g. <tt>Logger::INFO</tt>).
|
||||
#
|
||||
# source://logger//lib/logger.rb#383
|
||||
def level; end
|
||||
|
||||
# Sets the log level; returns +severity+.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level].
|
||||
#
|
||||
# Argument +severity+ may be an integer, a string, or a symbol:
|
||||
#
|
||||
# logger.level = Logger::ERROR # => 3
|
||||
# logger.level = 3 # => 3
|
||||
# logger.level = 'error' # => "error"
|
||||
# logger.level = :error # => :error
|
||||
#
|
||||
# Logger#sev_threshold= is an alias for Logger#level=.
|
||||
#
|
||||
# source://logger//lib/logger.rb#399
|
||||
def level=(severity); end
|
||||
|
||||
# Creates a log entry, which may or may not be written to the log,
|
||||
# depending on the entry's severity and on the log level.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level]
|
||||
# and {Entries}[rdoc-ref:Logger@Entries] for details.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# logger = Logger.new($stdout, progname: 'mung')
|
||||
# logger.add(Logger::INFO)
|
||||
# logger.add(Logger::ERROR, 'No good')
|
||||
# logger.add(Logger::ERROR, 'No good', 'gnum')
|
||||
#
|
||||
# Output:
|
||||
#
|
||||
# I, [2022-05-12T16:25:31.469726 #36328] INFO -- mung: mung
|
||||
# E, [2022-05-12T16:25:55.349414 #36328] ERROR -- mung: No good
|
||||
# E, [2022-05-12T16:26:35.841134 #36328] ERROR -- gnum: No good
|
||||
#
|
||||
# These convenience methods have implicit severity:
|
||||
#
|
||||
# - #debug.
|
||||
# - #info.
|
||||
# - #warn.
|
||||
# - #error.
|
||||
# - #fatal.
|
||||
# - #unknown.
|
||||
#
|
||||
# source://logger//lib/logger.rb#675
|
||||
def log(severity, message = T.unsafe(nil), progname = T.unsafe(nil)); end
|
||||
|
||||
# Program name to include in log messages.
|
||||
#
|
||||
# source://logger//lib/logger.rb#422
|
||||
def progname; end
|
||||
|
||||
# Program name to include in log messages.
|
||||
#
|
||||
# source://logger//lib/logger.rb#422
|
||||
def progname=(_arg0); end
|
||||
|
||||
# Sets the logger's output stream:
|
||||
#
|
||||
# - If +logdev+ is +nil+, reopens the current output stream.
|
||||
# - If +logdev+ is a filepath, opens the indicated file for append.
|
||||
# - If +logdev+ is an IO stream
|
||||
# (usually <tt>$stdout</tt>, <tt>$stderr</tt>, or an open File object),
|
||||
# opens the stream for append.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# logger = Logger.new('t.log')
|
||||
# logger.add(Logger::ERROR, 'one')
|
||||
# logger.close
|
||||
# logger.add(Logger::ERROR, 'two') # Prints 'log writing failed. closed stream'
|
||||
# logger.reopen
|
||||
# logger.add(Logger::ERROR, 'three')
|
||||
# logger.close
|
||||
# File.readlines('t.log')
|
||||
# # =>
|
||||
# # ["# Logfile created on 2022-05-12 14:21:19 -0500 by logger.rb/v1.5.0\n",
|
||||
# # "E, [2022-05-12T14:21:27.596726 #22428] ERROR -- : one\n",
|
||||
# # "E, [2022-05-12T14:23:05.847241 #22428] ERROR -- : three\n"]
|
||||
#
|
||||
# source://logger//lib/logger.rb#642
|
||||
def reopen(logdev = T.unsafe(nil), shift_age = T.unsafe(nil), shift_size = T.unsafe(nil), shift_period_suffix: T.unsafe(nil), binmode: T.unsafe(nil)); end
|
||||
|
||||
# Logging severity threshold (e.g. <tt>Logger::INFO</tt>).
|
||||
#
|
||||
# source://logger//lib/logger.rb#383
|
||||
def sev_threshold; end
|
||||
|
||||
# Sets the log level; returns +severity+.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level].
|
||||
#
|
||||
# Argument +severity+ may be an integer, a string, or a symbol:
|
||||
#
|
||||
# logger.level = Logger::ERROR # => 3
|
||||
# logger.level = 3 # => 3
|
||||
# logger.level = 'error' # => "error"
|
||||
# logger.level = :error # => :error
|
||||
#
|
||||
# Logger#sev_threshold= is an alias for Logger#level=.
|
||||
#
|
||||
# source://logger//lib/logger.rb#399
|
||||
def sev_threshold=(severity); end
|
||||
|
||||
# Equivalent to calling #add with severity <tt>Logger::UNKNOWN</tt>.
|
||||
#
|
||||
# source://logger//lib/logger.rb#744
|
||||
def unknown(progname = T.unsafe(nil), &block); end
|
||||
|
||||
# Equivalent to calling #add with severity <tt>Logger::WARN</tt>.
|
||||
#
|
||||
# source://logger//lib/logger.rb#726
|
||||
def warn(progname = T.unsafe(nil), &block); end
|
||||
|
||||
# Sets the log level to Logger::WARN.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level].
|
||||
#
|
||||
# source://logger//lib/logger.rb#509
|
||||
def warn!; end
|
||||
|
||||
# Returns +true+ if the log level allows entries with severity
|
||||
# Logger::WARN to be written, +false+ otherwise.
|
||||
# See {Log Level}[rdoc-ref:Logger@Log+Level].
|
||||
#
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://logger//lib/logger.rb#504
|
||||
def warn?; end
|
||||
|
||||
# Adjust the log level during the block execution for the current Fiber only
|
||||
#
|
||||
# logger.with_level(:debug) do
|
||||
# logger.debug { "Hello" }
|
||||
# end
|
||||
#
|
||||
# source://logger//lib/logger.rb#408
|
||||
def with_level(severity); end
|
||||
|
||||
private
|
||||
|
||||
# source://logger//lib/logger.rb#786
|
||||
def format_message(severity, datetime, progname, msg); end
|
||||
|
||||
# source://logger//lib/logger.rb#764
|
||||
def format_severity(severity); end
|
||||
|
||||
# source://logger//lib/logger.rb#782
|
||||
def level_key; end
|
||||
|
||||
# Guarantee the existence of this ivar even when subclasses don't call the superclass constructor.
|
||||
#
|
||||
# source://logger//lib/logger.rb#769
|
||||
def level_override; end
|
||||
end
|
||||
|
||||
# Default formatter for log messages.
|
||||
#
|
||||
# source://logger//lib/logger/formatter.rb#5
|
||||
class Logger::Formatter
|
||||
# @return [Formatter] a new instance of Formatter
|
||||
#
|
||||
# source://logger//lib/logger/formatter.rb#11
|
||||
def initialize; end
|
||||
|
||||
# source://logger//lib/logger/formatter.rb#15
|
||||
def call(severity, time, progname, msg); end
|
||||
|
||||
# Returns the value of attribute datetime_format.
|
||||
#
|
||||
# source://logger//lib/logger/formatter.rb#9
|
||||
def datetime_format; end
|
||||
|
||||
# Sets the attribute datetime_format
|
||||
#
|
||||
# @param value the value to set the attribute datetime_format to.
|
||||
#
|
||||
# source://logger//lib/logger/formatter.rb#9
|
||||
def datetime_format=(_arg0); end
|
||||
|
||||
private
|
||||
|
||||
# source://logger//lib/logger/formatter.rb#21
|
||||
def format_datetime(time); end
|
||||
|
||||
# source://logger//lib/logger/formatter.rb#25
|
||||
def msg2str(msg); end
|
||||
end
|
||||
|
||||
# source://logger//lib/logger/formatter.rb#7
|
||||
Logger::Formatter::DatetimeFormat = T.let(T.unsafe(nil), String)
|
||||
|
||||
# source://logger//lib/logger/formatter.rb#6
|
||||
Logger::Formatter::Format = T.let(T.unsafe(nil), String)
|
||||
|
||||
# Device used for logging messages.
|
||||
#
|
||||
# source://logger//lib/logger/log_device.rb#7
|
||||
class Logger::LogDevice
|
||||
include ::Logger::Period
|
||||
include ::MonitorMixin
|
||||
|
||||
# @return [LogDevice] a new instance of LogDevice
|
||||
#
|
||||
# source://logger//lib/logger/log_device.rb#14
|
||||
def initialize(log = T.unsafe(nil), shift_age: T.unsafe(nil), shift_size: T.unsafe(nil), shift_period_suffix: T.unsafe(nil), binmode: T.unsafe(nil), reraise_write_errors: T.unsafe(nil), skip_header: T.unsafe(nil)); end
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#38
|
||||
def close; end
|
||||
|
||||
# Returns the value of attribute dev.
|
||||
#
|
||||
# source://logger//lib/logger/log_device.rb#10
|
||||
def dev; end
|
||||
|
||||
# Returns the value of attribute filename.
|
||||
#
|
||||
# source://logger//lib/logger/log_device.rb#11
|
||||
def filename; end
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#48
|
||||
def reopen(log = T.unsafe(nil), shift_age: T.unsafe(nil), shift_size: T.unsafe(nil), shift_period_suffix: T.unsafe(nil), binmode: T.unsafe(nil)); end
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#27
|
||||
def write(message); end
|
||||
|
||||
private
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#156
|
||||
def add_log_header(file); end
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#162
|
||||
def check_shift_log; end
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#132
|
||||
def create_logfile(filename); end
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#104
|
||||
def fixup_mode(dev); end
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#148
|
||||
def handle_write_errors(mesg); end
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#177
|
||||
def lock_shift_log; end
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#119
|
||||
def open_logfile(filename); end
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#78
|
||||
def set_dev(log); end
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#92
|
||||
def set_file(shift_age, shift_size, shift_period_suffix); end
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#207
|
||||
def shift_log_age; end
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#232
|
||||
def shift_log_file(shifted); end
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#216
|
||||
def shift_log_period(period_end); end
|
||||
end
|
||||
|
||||
# :stopdoc:
|
||||
#
|
||||
# source://logger//lib/logger/log_device.rb#69
|
||||
Logger::LogDevice::MODE = T.let(T.unsafe(nil), Integer)
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#76
|
||||
Logger::LogDevice::MODE_TO_CREATE = T.let(T.unsafe(nil), Integer)
|
||||
|
||||
# source://logger//lib/logger/log_device.rb#72
|
||||
Logger::LogDevice::MODE_TO_OPEN = T.let(T.unsafe(nil), Integer)
|
||||
|
||||
# source://logger//lib/logger/period.rb#4
|
||||
module Logger::Period
|
||||
private
|
||||
|
||||
# source://logger//lib/logger/period.rb#9
|
||||
def next_rotate_time(now, shift_age); end
|
||||
|
||||
# source://logger//lib/logger/period.rb#31
|
||||
def previous_period_end(now, shift_age); end
|
||||
|
||||
class << self
|
||||
# source://logger//lib/logger/period.rb#9
|
||||
def next_rotate_time(now, shift_age); end
|
||||
|
||||
# source://logger//lib/logger/period.rb#31
|
||||
def previous_period_end(now, shift_age); end
|
||||
end
|
||||
end
|
||||
|
||||
# source://logger//lib/logger/period.rb#7
|
||||
Logger::Period::SiD = T.let(T.unsafe(nil), Integer)
|
||||
|
||||
# \Severity label for logging (max 5 chars).
|
||||
#
|
||||
# source://logger//lib/logger.rb#762
|
||||
Logger::SEV_LABEL = T.let(T.unsafe(nil), Array)
|
||||
|
||||
# Logging severity.
|
||||
#
|
||||
# source://logger//lib/logger/severity.rb#5
|
||||
module Logger::Severity
|
||||
class << self
|
||||
# source://logger//lib/logger/severity.rb#29
|
||||
def coerce(severity); end
|
||||
end
|
||||
end
|
||||
|
||||
# source://logger//lib/logger/severity.rb#19
|
||||
Logger::Severity::LEVELS = T.let(T.unsafe(nil), Hash)
|
||||
9
sorbet/rbi/gems/minitest@5.25.5.rbi
generated
Normal file
9
sorbet/rbi/gems/minitest@5.25.5.rbi
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `minitest` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem minitest`.
|
||||
|
||||
|
||||
# THIS IS AN EMPTY RBI FILE.
|
||||
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
|
||||
159
sorbet/rbi/gems/netrc@0.11.0.rbi
generated
Normal file
159
sorbet/rbi/gems/netrc@0.11.0.rbi
generated
Normal file
@@ -0,0 +1,159 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `netrc` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem netrc`.
|
||||
|
||||
|
||||
# source://netrc//lib/netrc.rb#3
|
||||
class Netrc
|
||||
# @return [Netrc] a new instance of Netrc
|
||||
#
|
||||
# source://netrc//lib/netrc.rb#166
|
||||
def initialize(path, data); end
|
||||
|
||||
# source://netrc//lib/netrc.rb#180
|
||||
def [](k); end
|
||||
|
||||
# source://netrc//lib/netrc.rb#188
|
||||
def []=(k, info); end
|
||||
|
||||
# source://netrc//lib/netrc.rb#200
|
||||
def delete(key); end
|
||||
|
||||
# source://netrc//lib/netrc.rb#211
|
||||
def each(&block); end
|
||||
|
||||
# source://netrc//lib/netrc.rb#196
|
||||
def length; end
|
||||
|
||||
# source://netrc//lib/netrc.rb#215
|
||||
def new_item(m, l, p); end
|
||||
|
||||
# Returns the value of attribute new_item_prefix.
|
||||
#
|
||||
# source://netrc//lib/netrc.rb#178
|
||||
def new_item_prefix; end
|
||||
|
||||
# Sets the attribute new_item_prefix
|
||||
#
|
||||
# @param value the value to set the attribute new_item_prefix to.
|
||||
#
|
||||
# source://netrc//lib/netrc.rb#178
|
||||
def new_item_prefix=(_arg0); end
|
||||
|
||||
# source://netrc//lib/netrc.rb#219
|
||||
def save; end
|
||||
|
||||
# source://netrc//lib/netrc.rb#233
|
||||
def unparse; end
|
||||
|
||||
class << self
|
||||
# source://netrc//lib/netrc.rb#42
|
||||
def check_permissions(path); end
|
||||
|
||||
# source://netrc//lib/netrc.rb#33
|
||||
def config; end
|
||||
|
||||
# @yield [self.config]
|
||||
#
|
||||
# source://netrc//lib/netrc.rb#37
|
||||
def configure; end
|
||||
|
||||
# source://netrc//lib/netrc.rb#10
|
||||
def default_path; end
|
||||
|
||||
# source://netrc//lib/netrc.rb#14
|
||||
def home_path; end
|
||||
|
||||
# source://netrc//lib/netrc.rb#85
|
||||
def lex(lines); end
|
||||
|
||||
# source://netrc//lib/netrc.rb#29
|
||||
def netrc_filename; end
|
||||
|
||||
# Returns two values, a header and a list of items.
|
||||
# Each item is a tuple, containing some or all of:
|
||||
# - machine keyword (including trailing whitespace+comments)
|
||||
# - machine name
|
||||
# - login keyword (including surrounding whitespace+comments)
|
||||
# - login
|
||||
# - password keyword (including surrounding whitespace+comments)
|
||||
# - password
|
||||
# - trailing chars
|
||||
# This lets us change individual fields, then write out the file
|
||||
# with all its original formatting.
|
||||
#
|
||||
# source://netrc//lib/netrc.rb#129
|
||||
def parse(ts); end
|
||||
|
||||
# Reads path and parses it as a .netrc file. If path doesn't
|
||||
# exist, returns an empty object. Decrypt paths ending in .gpg.
|
||||
#
|
||||
# source://netrc//lib/netrc.rb#51
|
||||
def read(path = T.unsafe(nil)); end
|
||||
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://netrc//lib/netrc.rb#112
|
||||
def skip?(s); end
|
||||
end
|
||||
end
|
||||
|
||||
# source://netrc//lib/netrc.rb#8
|
||||
Netrc::CYGWIN = T.let(T.unsafe(nil), T.untyped)
|
||||
|
||||
# source://netrc//lib/netrc.rb#244
|
||||
class Netrc::Entry < ::Struct
|
||||
# Returns the value of attribute login
|
||||
#
|
||||
# @return [Object] the current value of login
|
||||
def login; end
|
||||
|
||||
# Sets the attribute login
|
||||
#
|
||||
# @param value [Object] the value to set the attribute login to.
|
||||
# @return [Object] the newly set value
|
||||
def login=(_); end
|
||||
|
||||
# Returns the value of attribute password
|
||||
#
|
||||
# @return [Object] the current value of password
|
||||
def password; end
|
||||
|
||||
# Sets the attribute password
|
||||
#
|
||||
# @param value [Object] the value to set the attribute password to.
|
||||
# @return [Object] the newly set value
|
||||
def password=(_); end
|
||||
|
||||
def to_ary; end
|
||||
|
||||
class << self
|
||||
def [](*_arg0); end
|
||||
def inspect; end
|
||||
def keyword_init?; end
|
||||
def members; end
|
||||
def new(*_arg0); end
|
||||
end
|
||||
end
|
||||
|
||||
# source://netrc//lib/netrc.rb#250
|
||||
class Netrc::Error < ::StandardError; end
|
||||
|
||||
# source://netrc//lib/netrc.rb#68
|
||||
class Netrc::TokenArray < ::Array
|
||||
# source://netrc//lib/netrc.rb#76
|
||||
def readto; end
|
||||
|
||||
# source://netrc//lib/netrc.rb#69
|
||||
def take; end
|
||||
end
|
||||
|
||||
# source://netrc//lib/netrc.rb#4
|
||||
Netrc::VERSION = T.let(T.unsafe(nil), String)
|
||||
|
||||
# see http://stackoverflow.com/questions/4871309/what-is-the-correct-way-to-detect-if-ruby-is-running-on-windows
|
||||
#
|
||||
# source://netrc//lib/netrc.rb#7
|
||||
Netrc::WINDOWS = T.let(T.unsafe(nil), T.untyped)
|
||||
291
sorbet/rbi/gems/parallel@1.27.0.rbi
generated
Normal file
291
sorbet/rbi/gems/parallel@1.27.0.rbi
generated
Normal file
@@ -0,0 +1,291 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `parallel` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem parallel`.
|
||||
|
||||
|
||||
# source://parallel//lib/parallel/version.rb#2
|
||||
module Parallel
|
||||
class << self
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#243
|
||||
def all?(*args, &block); end
|
||||
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#238
|
||||
def any?(*args, &block); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#234
|
||||
def each(array, options = T.unsafe(nil), &block); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#248
|
||||
def each_with_index(array, options = T.unsafe(nil), &block); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#307
|
||||
def filter_map(*_arg0, **_arg1, &_arg2); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#303
|
||||
def flat_map(*_arg0, **_arg1, &_arg2); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#228
|
||||
def in_processes(options = T.unsafe(nil), &block); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#212
|
||||
def in_threads(options = T.unsafe(nil)); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#252
|
||||
def map(source, options = T.unsafe(nil), &block); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#299
|
||||
def map_with_index(array, options = T.unsafe(nil), &block); end
|
||||
|
||||
# Number of physical processor cores on the current system.
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#312
|
||||
def physical_processor_count; end
|
||||
|
||||
# Number of processors seen by the OS or value considering CPU quota if the process is inside a cgroup,
|
||||
# used for process scheduling
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#342
|
||||
def processor_count; end
|
||||
|
||||
# source://parallel//lib/parallel.rb#346
|
||||
def worker_number; end
|
||||
|
||||
# TODO: this does not work when doing threads in forks, so should remove and yield the number instead if needed
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#351
|
||||
def worker_number=(worker_num); end
|
||||
|
||||
private
|
||||
|
||||
# source://parallel//lib/parallel.rb#384
|
||||
def add_progress_bar!(job_factory, options); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#699
|
||||
def available_processor_count; end
|
||||
|
||||
# source://parallel//lib/parallel.rb#647
|
||||
def call_with_index(item, index, options, &block); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#579
|
||||
def create_workers(job_factory, options, &block); end
|
||||
|
||||
# options is either a Integer or a Hash with :count
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#637
|
||||
def extract_count_from_options(options); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#665
|
||||
def instrument_finish(item, index, result, options); end
|
||||
|
||||
# yield results in the order of the input items
|
||||
# needs to use `options` to store state between executions
|
||||
# needs to use `done` index since a nil result would also be valid
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#674
|
||||
def instrument_finish_in_order(item, index, result, options); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#694
|
||||
def instrument_start(item, index, options); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#357
|
||||
def physical_processor_count_windows; end
|
||||
|
||||
# source://parallel//lib/parallel.rb#613
|
||||
def process_incoming_jobs(read, write, job_factory, options, &block); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#567
|
||||
def replace_worker(job_factory, workers, index, options, blk); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#378
|
||||
def run(command); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#658
|
||||
def with_instrumentation(item, index, options); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#409
|
||||
def work_direct(job_factory, options, &block); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#519
|
||||
def work_in_processes(job_factory, options, &blk); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#453
|
||||
def work_in_ractors(job_factory, options); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#428
|
||||
def work_in_threads(job_factory, options, &block); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#587
|
||||
def worker(job_factory, options, &block); end
|
||||
end
|
||||
end
|
||||
|
||||
# source://parallel//lib/parallel.rb#11
|
||||
class Parallel::Break < ::StandardError
|
||||
# @return [Break] a new instance of Break
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#14
|
||||
def initialize(value = T.unsafe(nil)); end
|
||||
|
||||
# Returns the value of attribute value.
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#12
|
||||
def value; end
|
||||
end
|
||||
|
||||
# source://parallel//lib/parallel.rb#8
|
||||
class Parallel::DeadWorker < ::StandardError; end
|
||||
|
||||
# source://parallel//lib/parallel.rb#32
|
||||
class Parallel::ExceptionWrapper
|
||||
# @return [ExceptionWrapper] a new instance of ExceptionWrapper
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#35
|
||||
def initialize(exception); end
|
||||
|
||||
# Returns the value of attribute exception.
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#33
|
||||
def exception; end
|
||||
end
|
||||
|
||||
# source://parallel//lib/parallel.rb#98
|
||||
class Parallel::JobFactory
|
||||
# @return [JobFactory] a new instance of JobFactory
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#99
|
||||
def initialize(source, mutex); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#107
|
||||
def next; end
|
||||
|
||||
# generate item that is sent to workers
|
||||
# just index is faster + less likely to blow up with unserializable errors
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#136
|
||||
def pack(item, index); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#126
|
||||
def size; end
|
||||
|
||||
# unpack item that is sent to workers
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#141
|
||||
def unpack(data); end
|
||||
|
||||
private
|
||||
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#147
|
||||
def producer?; end
|
||||
|
||||
# source://parallel//lib/parallel.rb#151
|
||||
def queue_wrapper(array); end
|
||||
end
|
||||
|
||||
# source://parallel//lib/parallel.rb#20
|
||||
class Parallel::Kill < ::Parallel::Break; end
|
||||
|
||||
# source://parallel//lib/parallel.rb#6
|
||||
Parallel::Stop = T.let(T.unsafe(nil), Object)
|
||||
|
||||
# source://parallel//lib/parallel.rb#23
|
||||
class Parallel::UndumpableException < ::StandardError
|
||||
# @return [UndumpableException] a new instance of UndumpableException
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#26
|
||||
def initialize(original); end
|
||||
|
||||
# Returns the value of attribute backtrace.
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#24
|
||||
def backtrace; end
|
||||
end
|
||||
|
||||
# source://parallel//lib/parallel.rb#156
|
||||
class Parallel::UserInterruptHandler
|
||||
class << self
|
||||
# source://parallel//lib/parallel.rb#181
|
||||
def kill(thing); end
|
||||
|
||||
# kill all these pids or threads if user presses Ctrl+c
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#161
|
||||
def kill_on_ctrl_c(pids, options); end
|
||||
|
||||
private
|
||||
|
||||
# source://parallel//lib/parallel.rb#205
|
||||
def restore_interrupt(old, signal); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#190
|
||||
def trap_interrupt(signal); end
|
||||
end
|
||||
end
|
||||
|
||||
# source://parallel//lib/parallel.rb#157
|
||||
Parallel::UserInterruptHandler::INTERRUPT_SIGNAL = T.let(T.unsafe(nil), Symbol)
|
||||
|
||||
# source://parallel//lib/parallel/version.rb#3
|
||||
Parallel::VERSION = T.let(T.unsafe(nil), String)
|
||||
|
||||
# source://parallel//lib/parallel/version.rb#3
|
||||
Parallel::Version = T.let(T.unsafe(nil), String)
|
||||
|
||||
# source://parallel//lib/parallel.rb#51
|
||||
class Parallel::Worker
|
||||
# @return [Worker] a new instance of Worker
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#55
|
||||
def initialize(read, write, pid); end
|
||||
|
||||
# might be passed to started_processes and simultaneously closed by another thread
|
||||
# when running in isolation mode, so we have to check if it is closed before closing
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#68
|
||||
def close_pipes; end
|
||||
|
||||
# Returns the value of attribute pid.
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#52
|
||||
def pid; end
|
||||
|
||||
# Returns the value of attribute read.
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#52
|
||||
def read; end
|
||||
|
||||
# source://parallel//lib/parallel.rb#61
|
||||
def stop; end
|
||||
|
||||
# Returns the value of attribute thread.
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#53
|
||||
def thread; end
|
||||
|
||||
# Sets the attribute thread
|
||||
#
|
||||
# @param value the value to set the attribute thread to.
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#53
|
||||
def thread=(_arg0); end
|
||||
|
||||
# source://parallel//lib/parallel.rb#73
|
||||
def work(data); end
|
||||
|
||||
# Returns the value of attribute write.
|
||||
#
|
||||
# source://parallel//lib/parallel.rb#52
|
||||
def write; end
|
||||
|
||||
private
|
||||
|
||||
# source://parallel//lib/parallel.rb#91
|
||||
def wait; end
|
||||
end
|
||||
368
sorbet/rbi/gems/pp@0.6.2.rbi
generated
Normal file
368
sorbet/rbi/gems/pp@0.6.2.rbi
generated
Normal file
@@ -0,0 +1,368 @@
|
||||
# typed: false
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `pp` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem pp`.
|
||||
|
||||
|
||||
class Array
|
||||
include ::Enumerable
|
||||
|
||||
# source://pp//lib/pp.rb#402
|
||||
def pretty_print(q); end
|
||||
|
||||
# source://pp//lib/pp.rb#410
|
||||
def pretty_print_cycle(q); end
|
||||
end
|
||||
|
||||
class Data
|
||||
# source://pp//lib/pp.rb#456
|
||||
def pretty_print(q); end
|
||||
|
||||
# source://pp//lib/pp.rb#484
|
||||
def pretty_print_cycle(q); end
|
||||
end
|
||||
|
||||
class File::Stat
|
||||
include ::Comparable
|
||||
|
||||
# source://pp//lib/pp.rb#518
|
||||
def pretty_print(q); end
|
||||
end
|
||||
|
||||
class Hash
|
||||
include ::Enumerable
|
||||
|
||||
# source://pp//lib/pp.rb#416
|
||||
def pretty_print(q); end
|
||||
|
||||
# source://pp//lib/pp.rb#420
|
||||
def pretty_print_cycle(q); end
|
||||
end
|
||||
|
||||
module Kernel
|
||||
# Returns a pretty printed object as a string.
|
||||
#
|
||||
# See the PP module for more information.
|
||||
#
|
||||
# source://pp//lib/pp.rb#685
|
||||
def pretty_inspect; end
|
||||
|
||||
private
|
||||
|
||||
# prints arguments in pretty form.
|
||||
#
|
||||
# +#pp+ returns argument(s).
|
||||
#
|
||||
# source://pp//lib/pp.rb#692
|
||||
def pp(*objs); end
|
||||
|
||||
class << self
|
||||
# prints arguments in pretty form.
|
||||
#
|
||||
# +#pp+ returns argument(s).
|
||||
#
|
||||
# source://pp//lib/pp.rb#692
|
||||
def pp(*objs); end
|
||||
end
|
||||
end
|
||||
|
||||
class MatchData
|
||||
# source://pp//lib/pp.rb#601
|
||||
def pretty_print(q); end
|
||||
end
|
||||
|
||||
# A pretty-printer for Ruby objects.
|
||||
#
|
||||
#
|
||||
# == What PP Does
|
||||
#
|
||||
# Standard output by #p returns this:
|
||||
# #<PP:0x81fedf0 @genspace=#<Proc:0x81feda0>, @group_queue=#<PrettyPrint::GroupQueue:0x81fed3c @queue=[[#<PrettyPrint::Group:0x81fed78 @breakables=[], @depth=0, @break=false>], []]>, @buffer=[], @newline="\n", @group_stack=[#<PrettyPrint::Group:0x81fed78 @breakables=[], @depth=0, @break=false>], @buffer_width=0, @indent=0, @maxwidth=79, @output_width=2, @output=#<IO:0x8114ee4>>
|
||||
#
|
||||
# Pretty-printed output returns this:
|
||||
# #<PP:0x81fedf0
|
||||
# @buffer=[],
|
||||
# @buffer_width=0,
|
||||
# @genspace=#<Proc:0x81feda0>,
|
||||
# @group_queue=
|
||||
# #<PrettyPrint::GroupQueue:0x81fed3c
|
||||
# @queue=
|
||||
# [[#<PrettyPrint::Group:0x81fed78 @break=false, @breakables=[], @depth=0>],
|
||||
# []]>,
|
||||
# @group_stack=
|
||||
# [#<PrettyPrint::Group:0x81fed78 @break=false, @breakables=[], @depth=0>],
|
||||
# @indent=0,
|
||||
# @maxwidth=79,
|
||||
# @newline="\n",
|
||||
# @output=#<IO:0x8114ee4>,
|
||||
# @output_width=2>
|
||||
#
|
||||
#
|
||||
# == Usage
|
||||
#
|
||||
# pp(obj) #=> obj
|
||||
# pp obj #=> obj
|
||||
# pp(obj1, obj2, ...) #=> [obj1, obj2, ...]
|
||||
# pp() #=> nil
|
||||
#
|
||||
# Output <tt>obj(s)</tt> to <tt>$></tt> in pretty printed format.
|
||||
#
|
||||
# It returns <tt>obj(s)</tt>.
|
||||
#
|
||||
#
|
||||
# == Output Customization
|
||||
#
|
||||
# To define a customized pretty printing function for your classes,
|
||||
# redefine method <code>#pretty_print(pp)</code> in the class.
|
||||
# Note that <code>require 'pp'</code> is needed before redefining <code>#pretty_print(pp)</code>.
|
||||
#
|
||||
# <code>#pretty_print</code> takes the +pp+ argument, which is an instance of the PP class.
|
||||
# The method uses #text, #breakable, #nest, #group and #pp to print the
|
||||
# object.
|
||||
#
|
||||
#
|
||||
# == Pretty-Print JSON
|
||||
#
|
||||
# To pretty-print JSON refer to JSON#pretty_generate.
|
||||
#
|
||||
#
|
||||
# == Author
|
||||
# Tanaka Akira <akr@fsij.org>
|
||||
class PP < ::PrettyPrint
|
||||
include ::PP::PPMethods
|
||||
|
||||
class << self
|
||||
# :stopdoc:
|
||||
#
|
||||
# source://pp//lib/pp.rb#116
|
||||
def mcall(obj, mod, meth, *args, &block); end
|
||||
|
||||
# Outputs +obj+ to +out+ in pretty printed format of
|
||||
# +width+ columns in width.
|
||||
#
|
||||
# If +out+ is omitted, <code>$></code> is assumed.
|
||||
# If +width+ is omitted, the width of +out+ is assumed (see
|
||||
# width_for).
|
||||
#
|
||||
# PP.pp returns +out+.
|
||||
#
|
||||
# source://pp//lib/pp.rb#96
|
||||
def pp(obj, out = T.unsafe(nil), width = T.unsafe(nil)); end
|
||||
|
||||
# Returns the sharing detection flag as a boolean value.
|
||||
# It is false by default.
|
||||
#
|
||||
# source://pp//lib/pp.rb#125
|
||||
def sharing_detection; end
|
||||
|
||||
# Returns the sharing detection flag as a boolean value.
|
||||
# It is false by default.
|
||||
#
|
||||
# source://pp//lib/pp.rb#129
|
||||
def sharing_detection=(b); end
|
||||
|
||||
# Outputs +obj+ to +out+ like PP.pp but with no indent and
|
||||
# newline.
|
||||
#
|
||||
# PP.singleline_pp returns +out+.
|
||||
#
|
||||
# source://pp//lib/pp.rb#108
|
||||
def singleline_pp(obj, out = T.unsafe(nil)); end
|
||||
|
||||
# Returns the usable width for +out+.
|
||||
# As the width of +out+:
|
||||
# 1. If +out+ is assigned to a tty device, its width is used.
|
||||
# 2. Otherwise, or it could not get the value, the +COLUMN+
|
||||
# environment variable is assumed to be set to the width.
|
||||
# 3. If +COLUMN+ is not set to a non-zero number, 80 is assumed.
|
||||
#
|
||||
# And finally, returns the above width value - 1.
|
||||
# * This -1 is for Windows command prompt, which moves the cursor to
|
||||
# the next line if it reaches the last column.
|
||||
#
|
||||
# source://pp//lib/pp.rb#79
|
||||
def width_for(out); end
|
||||
end
|
||||
end
|
||||
|
||||
module PP::ObjectMixin
|
||||
# A default pretty printing method for general objects.
|
||||
# It calls #pretty_print_instance_variables to list instance variables.
|
||||
#
|
||||
# If +self+ has a customized (redefined) #inspect method,
|
||||
# the result of self.inspect is used but it obviously has no
|
||||
# line break hints.
|
||||
#
|
||||
# This module provides predefined #pretty_print methods for some of
|
||||
# the most commonly used built-in classes for convenience.
|
||||
#
|
||||
# source://pp//lib/pp.rb#353
|
||||
def pretty_print(q); end
|
||||
|
||||
# A default pretty printing method for general objects that are
|
||||
# detected as part of a cycle.
|
||||
#
|
||||
# source://pp//lib/pp.rb#370
|
||||
def pretty_print_cycle(q); end
|
||||
|
||||
# Is #inspect implementation using #pretty_print.
|
||||
# If you implement #pretty_print, it can be used as follows.
|
||||
#
|
||||
# alias inspect pretty_print_inspect
|
||||
#
|
||||
# However, doing this requires that every class that #inspect is called on
|
||||
# implement #pretty_print, or a RuntimeError will be raised.
|
||||
#
|
||||
# source://pp//lib/pp.rb#392
|
||||
def pretty_print_inspect; end
|
||||
|
||||
# Returns a sorted array of instance variable names.
|
||||
#
|
||||
# This method should return an array of names of instance variables as symbols or strings as:
|
||||
# +[:@a, :@b]+.
|
||||
#
|
||||
# source://pp//lib/pp.rb#381
|
||||
def pretty_print_instance_variables; end
|
||||
end
|
||||
|
||||
# Module that defines helper methods for pretty_print.
|
||||
module PP::PPMethods
|
||||
# Check whether the object_id +id+ is in the current buffer of objects
|
||||
# to be pretty printed. Used to break cycles in chains of objects to be
|
||||
# pretty printed.
|
||||
#
|
||||
# source://pp//lib/pp.rb#169
|
||||
def check_inspect_key(id); end
|
||||
|
||||
# A convenience method which is same as follows:
|
||||
#
|
||||
# text ','
|
||||
# breakable
|
||||
#
|
||||
# source://pp//lib/pp.rb#232
|
||||
def comma_breakable; end
|
||||
|
||||
# Yields to a block
|
||||
# and preserves the previous set of objects being printed.
|
||||
#
|
||||
# source://pp//lib/pp.rb#147
|
||||
def guard_inspect_key; end
|
||||
|
||||
# A convenience method, like object_group, but also reformats the Object's
|
||||
# object_id.
|
||||
#
|
||||
# source://pp//lib/pp.rb#222
|
||||
def object_address_group(obj, &block); end
|
||||
|
||||
# A convenience method which is same as follows:
|
||||
#
|
||||
# group(1, '#<' + obj.class.name, '>') { ... }
|
||||
#
|
||||
# source://pp//lib/pp.rb#216
|
||||
def object_group(obj, &block); end
|
||||
|
||||
# Removes an object from the set of objects being pretty printed.
|
||||
#
|
||||
# source://pp//lib/pp.rb#182
|
||||
def pop_inspect_key(id); end
|
||||
|
||||
# Adds +obj+ to the pretty printing buffer
|
||||
# using Object#pretty_print or Object#pretty_print_cycle.
|
||||
#
|
||||
# Object#pretty_print_cycle is used when +obj+ is already
|
||||
# printed, a.k.a the object reference chain has a cycle.
|
||||
#
|
||||
# source://pp//lib/pp.rb#191
|
||||
def pp(obj); end
|
||||
|
||||
# A pretty print for a Hash
|
||||
#
|
||||
# source://pp//lib/pp.rb#291
|
||||
def pp_hash(obj); end
|
||||
|
||||
# A pretty print for a pair of Hash
|
||||
#
|
||||
# source://pp//lib/pp.rb#303
|
||||
def pp_hash_pair(k, v); end
|
||||
|
||||
# A present standard failsafe for pretty printing any given Object
|
||||
#
|
||||
# source://pp//lib/pp.rb#275
|
||||
def pp_object(obj); end
|
||||
|
||||
# Adds the object_id +id+ to the set of objects being pretty printed, so
|
||||
# as to not repeat objects.
|
||||
#
|
||||
# source://pp//lib/pp.rb#177
|
||||
def push_inspect_key(id); end
|
||||
|
||||
# Adds a separated list.
|
||||
# The list is separated by comma with breakable space, by default.
|
||||
#
|
||||
# #seplist iterates the +list+ using +iter_method+.
|
||||
# It yields each object to the block given for #seplist.
|
||||
# The procedure +separator_proc+ is called between each yields.
|
||||
#
|
||||
# If the iteration is zero times, +separator_proc+ is not called at all.
|
||||
#
|
||||
# If +separator_proc+ is nil or not given,
|
||||
# +lambda { comma_breakable }+ is used.
|
||||
# If +iter_method+ is not given, :each is used.
|
||||
#
|
||||
# For example, following 3 code fragments has similar effect.
|
||||
#
|
||||
# q.seplist([1,2,3]) {|v| xxx v }
|
||||
#
|
||||
# q.seplist([1,2,3], lambda { q.comma_breakable }, :each) {|v| xxx v }
|
||||
#
|
||||
# xxx 1
|
||||
# q.comma_breakable
|
||||
# xxx 2
|
||||
# q.comma_breakable
|
||||
# xxx 3
|
||||
#
|
||||
# source://pp//lib/pp.rb#261
|
||||
def seplist(list, sep = T.unsafe(nil), iter_method = T.unsafe(nil)); end
|
||||
end
|
||||
|
||||
class PP::SingleLine < ::PrettyPrint::SingleLine
|
||||
include ::PP::PPMethods
|
||||
end
|
||||
|
||||
# The version string
|
||||
#
|
||||
# source://pp//lib/pp.rb#67
|
||||
PP::VERSION = T.let(T.unsafe(nil), String)
|
||||
|
||||
class Range
|
||||
include ::Enumerable
|
||||
|
||||
# source://pp//lib/pp.rb#490
|
||||
def pretty_print(q); end
|
||||
end
|
||||
|
||||
class RubyVM::AbstractSyntaxTree::Node
|
||||
# source://pp//lib/pp.rb#640
|
||||
def pretty_print(q); end
|
||||
|
||||
# source://pp//lib/pp.rb#627
|
||||
def pretty_print_children(q, names = T.unsafe(nil)); end
|
||||
end
|
||||
|
||||
class String
|
||||
include ::Comparable
|
||||
|
||||
# source://pp//lib/pp.rb#502
|
||||
def pretty_print(q); end
|
||||
end
|
||||
|
||||
class Struct
|
||||
include ::Enumerable
|
||||
|
||||
# source://pp//lib/pp.rb#436
|
||||
def pretty_print(q); end
|
||||
|
||||
# source://pp//lib/pp.rb#450
|
||||
def pretty_print_cycle(q); end
|
||||
end
|
||||
952
sorbet/rbi/gems/prettier_print@1.2.1.rbi
generated
Normal file
952
sorbet/rbi/gems/prettier_print@1.2.1.rbi
generated
Normal file
@@ -0,0 +1,952 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `prettier_print` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem prettier_print`.
|
||||
|
||||
|
||||
# This class implements a pretty printing algorithm. It finds line breaks and
|
||||
# nice indentations for grouped structure.
|
||||
#
|
||||
# By default, the class assumes that primitive elements are strings and each
|
||||
# byte in the strings is a single column in width. But it can be used for other
|
||||
# situations by giving suitable arguments for some methods:
|
||||
#
|
||||
# * newline object and space generation block for PrettierPrint.new
|
||||
# * optional width argument for PrettierPrint#text
|
||||
# * PrettierPrint#breakable
|
||||
#
|
||||
# There are several candidate uses:
|
||||
# * text formatting using proportional fonts
|
||||
# * multibyte characters which has columns different to number of bytes
|
||||
# * non-string formatting
|
||||
#
|
||||
# == Usage
|
||||
#
|
||||
# To use this module, you will need to generate a tree of print nodes that
|
||||
# represent indentation and newline behavior before it gets sent to the printer.
|
||||
# Each node has different semantics, depending on the desired output.
|
||||
#
|
||||
# The most basic node is a Text node. This represents plain text content that
|
||||
# cannot be broken up even if it doesn't fit on one line. You would create one
|
||||
# of those with the text method, as in:
|
||||
#
|
||||
# PrettierPrint.format { |q| q.text('my content') }
|
||||
#
|
||||
# No matter what the desired output width is, the output for the snippet above
|
||||
# will always be the same.
|
||||
#
|
||||
# If you want to allow the printer to break up the content on the space
|
||||
# character when there isn't enough width for the full string on the same line,
|
||||
# you can use the Breakable and Group nodes. For example:
|
||||
#
|
||||
# PrettierPrint.format do |q|
|
||||
# q.group do
|
||||
# q.text("my")
|
||||
# q.breakable
|
||||
# q.text("content")
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# Now, if everything fits on one line (depending on the maximum width specified)
|
||||
# then it will be the same output as the first example. If, however, there is
|
||||
# not enough room on the line, then you will get two lines of output, one for
|
||||
# the first string and one for the second.
|
||||
#
|
||||
# There are other nodes for the print tree as well, described in the
|
||||
# documentation below. They control alignment, indentation, conditional
|
||||
# formatting, and more.
|
||||
#
|
||||
# == References
|
||||
# Christian Lindig, Strictly Pretty, March 2000
|
||||
# https://lindig.github.io/papers/strictly-pretty-2000.pdf
|
||||
#
|
||||
# Philip Wadler, A prettier printer, March 1998
|
||||
# https://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#62
|
||||
class PrettierPrint
|
||||
# Creates a buffer for pretty printing.
|
||||
#
|
||||
# +output+ is an output target. If it is not specified, '' is assumed. It
|
||||
# should have a << method which accepts the first argument +obj+ of
|
||||
# PrettierPrint#text, the first argument +separator+ of PrettierPrint#breakable,
|
||||
# the first argument +newline+ of PrettierPrint.new, and the result of a given
|
||||
# block for PrettierPrint.new.
|
||||
#
|
||||
# +maxwidth+ specifies maximum line length. If it is not specified, 80 is
|
||||
# assumed. However actual outputs may overflow +maxwidth+ if long
|
||||
# non-breakable texts are provided.
|
||||
#
|
||||
# +newline+ is used for line breaks. "\n" is used if it is not specified.
|
||||
#
|
||||
# The block is used to generate spaces. ->(n) { ' ' * n } is used if it is not
|
||||
# given.
|
||||
#
|
||||
# @return [PrettierPrint] a new instance of PrettierPrint
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#441
|
||||
def initialize(output = T.unsafe(nil), maxwidth = T.unsafe(nil), newline = T.unsafe(nil), &genspace); end
|
||||
|
||||
# This inserts a BreakParent node into the print tree which forces the
|
||||
# surrounding and all parent group nodes to break.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#814
|
||||
def break_parent; end
|
||||
|
||||
# This says "you can break a line here if necessary", and a +width+\-column
|
||||
# text +separator+ is inserted if a line is not broken at the point.
|
||||
#
|
||||
# If +separator+ is not specified, ' ' is used.
|
||||
#
|
||||
# If +width+ is not specified, +separator.length+ is used. You will have to
|
||||
# specify this when +separator+ is a multibyte character, for example.
|
||||
#
|
||||
# By default, if the surrounding group is broken and a newline is inserted,
|
||||
# the printer will indent the subsequent line up to the current level of
|
||||
# indentation. You can disable this behavior with the +indent+ argument if
|
||||
# that's not desired (rare).
|
||||
#
|
||||
# By default, when you insert a Breakable into the print tree, it only breaks
|
||||
# the surrounding group when the group's contents cannot fit onto the
|
||||
# remaining space of the current line. You can force it to break the
|
||||
# surrounding group instead if you always want the newline with the +force+
|
||||
# argument.
|
||||
#
|
||||
# There are a few circumstances where you'll want to force the newline into
|
||||
# the output but no insert a break parent (because you don't want to
|
||||
# necessarily force the groups to break unless they need to). In this case you
|
||||
# can pass `force: :skip_break_parent` to this method and it will not insert
|
||||
# a break parent.`
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#802
|
||||
def breakable(separator = T.unsafe(nil), width = T.unsafe(nil), indent: T.unsafe(nil), force: T.unsafe(nil)); end
|
||||
|
||||
# Another very common breakable call you receive while formatting is an
|
||||
# empty string in flat mode and a newline in break mode. Similar to
|
||||
# breakable_space, this is here for avoid unnecessary calculation.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#646
|
||||
def breakable_empty; end
|
||||
|
||||
# The final of the very common breakable calls you receive while formatting
|
||||
# is the normal breakable space but with the addition of the break_parent.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#652
|
||||
def breakable_force; end
|
||||
|
||||
# This is the same shortcut as breakable_force, except that it doesn't indent
|
||||
# the next line. This is necessary if you're trying to preserve some custom
|
||||
# formatting like a multi-line string.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#660
|
||||
def breakable_return; end
|
||||
|
||||
# The vast majority of breakable calls you receive while formatting are a
|
||||
# space in flat mode and a newline in break mode. Since this is so common,
|
||||
# we have a method here to skip past unnecessary calculation.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#639
|
||||
def breakable_space; end
|
||||
|
||||
# This is an output buffer that wraps the output object and provides
|
||||
# additional functionality depending on its type.
|
||||
#
|
||||
# This defaults to Buffer::StringBuffer.new("".dup)
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#400
|
||||
def buffer; end
|
||||
|
||||
# A convenience method which is same as follows:
|
||||
#
|
||||
# text(",")
|
||||
# breakable
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#669
|
||||
def comma_breakable; end
|
||||
|
||||
# Returns the group most recently added to the stack.
|
||||
#
|
||||
# Contrived example:
|
||||
# out = ""
|
||||
# => ""
|
||||
# q = PrettierPrint.new(out)
|
||||
# => #<PrettierPrint:0x0>
|
||||
# q.group {
|
||||
# q.text q.current_group.inspect
|
||||
# q.text q.newline
|
||||
# q.group(q.current_group.depth + 1) {
|
||||
# q.text q.current_group.inspect
|
||||
# q.text q.newline
|
||||
# q.group(q.current_group.depth + 1) {
|
||||
# q.text q.current_group.inspect
|
||||
# q.text q.newline
|
||||
# q.group(q.current_group.depth + 1) {
|
||||
# q.text q.current_group.inspect
|
||||
# q.text q.newline
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# => 284
|
||||
# puts out
|
||||
# #<PrettierPrint::Group:0x0 @depth=1>
|
||||
# #<PrettierPrint::Group:0x0 @depth=2>
|
||||
# #<PrettierPrint::Group:0x0 @depth=3>
|
||||
# #<PrettierPrint::Group:0x0 @depth=4>
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#484
|
||||
def current_group; end
|
||||
|
||||
# This is similar to #breakable except the decision to break or not is
|
||||
# determined individually.
|
||||
#
|
||||
# Two #fill_breakable under a group may cause 4 results:
|
||||
# (break,break), (break,non-break), (non-break,break), (non-break,non-break).
|
||||
# This is different to #breakable because two #breakable under a group
|
||||
# may cause 2 results: (break,break), (non-break,non-break).
|
||||
#
|
||||
# The text +separator+ is inserted if a line is not broken at this point.
|
||||
#
|
||||
# If +separator+ is not specified, ' ' is used.
|
||||
#
|
||||
# If +width+ is not specified, +separator.length+ is used. You will have to
|
||||
# specify this when +separator+ is a multibyte character, for example.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#688
|
||||
def fill_breakable(separator = T.unsafe(nil), width = T.unsafe(nil)); end
|
||||
|
||||
# Flushes all of the generated print tree onto the output buffer, then clears
|
||||
# the generated tree from memory.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#490
|
||||
def flush(base_indentation = T.unsafe(nil)); end
|
||||
|
||||
# An object that responds to call that takes one argument, of an Integer, and
|
||||
# returns the corresponding number of spaces.
|
||||
#
|
||||
# By default this is: ->(n) { ' ' * n }
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#416
|
||||
def genspace; end
|
||||
|
||||
# Groups line break hints added in the block. The line break hints are all to
|
||||
# be used or not.
|
||||
#
|
||||
# If +indent+ is specified, the method call is regarded as nested by
|
||||
# nest(indent) { ... }.
|
||||
#
|
||||
# If +open_object+ is specified, <tt>text(open_object, open_width)</tt> is
|
||||
# called before grouping. If +close_object+ is specified,
|
||||
# <tt>text(close_object, close_width)</tt> is called after grouping.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#845
|
||||
def group(indent = T.unsafe(nil), open_object = T.unsafe(nil), close_object = T.unsafe(nil), open_width = T.unsafe(nil), close_width = T.unsafe(nil)); end
|
||||
|
||||
# The stack of groups that are being printed.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#419
|
||||
def groups; end
|
||||
|
||||
# Inserts an IfBreak node with the contents of the block being added to its
|
||||
# list of nodes that should be printed if the surrounding node breaks. If it
|
||||
# doesn't, then you can specify the contents to be printed with the #if_flat
|
||||
# method used on the return object from this method. For example,
|
||||
#
|
||||
# q.if_break { q.text('do') }.if_flat { q.text('{') }
|
||||
#
|
||||
# In the example above, if the surrounding group is broken it will print 'do'
|
||||
# and if it is not it will print '{'.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#917
|
||||
def if_break; end
|
||||
|
||||
# This is similar to if_break in that it also inserts an IfBreak node into the
|
||||
# print tree, however it's starting from the flat contents, and cannot be used
|
||||
# to build the break contents.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#936
|
||||
def if_flat; end
|
||||
|
||||
# Very similar to the #nest method, this indents the nested content by one
|
||||
# level by inserting an Indent node into the print tree. The contents of the
|
||||
# node are determined by the block.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#956
|
||||
def indent; end
|
||||
|
||||
# This method calculates the position of the text relative to the current
|
||||
# indentation level when the doc has been printed. It's useful for
|
||||
# determining how to align text to doc nodes that are already built into the
|
||||
# tree.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#696
|
||||
def last_position(node); end
|
||||
|
||||
# Inserts a LineSuffix node into the print tree. The contents of the node are
|
||||
# determined by the block.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#967
|
||||
def line_suffix(priority: T.unsafe(nil)); end
|
||||
|
||||
# The maximum width of a line, before it is separated in to a newline
|
||||
#
|
||||
# This defaults to 80, and should be an Integer
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#405
|
||||
def maxwidth; end
|
||||
|
||||
# Increases left margin after newline with +indent+ for line breaks added in
|
||||
# the block.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#977
|
||||
def nest(indent); end
|
||||
|
||||
# The value that is appended to +output+ to add a new line.
|
||||
#
|
||||
# This defaults to "\n", and should be String
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#410
|
||||
def newline; end
|
||||
|
||||
# The output object. It represents the final destination of the contents of
|
||||
# the print tree. It should respond to <<.
|
||||
#
|
||||
# This defaults to "".dup
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#394
|
||||
def output; end
|
||||
|
||||
# This method will remove any breakables from the list of contents so that
|
||||
# no newlines are present in the output. If a newline is being forced into
|
||||
# the output, the replace value will be used.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#721
|
||||
def remove_breaks(node, replace = T.unsafe(nil)); end
|
||||
|
||||
# Adds a separated list.
|
||||
# The list is separated by comma with breakable space, by default.
|
||||
#
|
||||
# #seplist iterates the +list+ using +iter_method+.
|
||||
# It yields each object to the block given for #seplist.
|
||||
# The procedure +separator_proc+ is called between each yields.
|
||||
#
|
||||
# If the iteration is zero times, +separator_proc+ is not called at all.
|
||||
#
|
||||
# If +separator_proc+ is nil or not given,
|
||||
# +lambda { comma_breakable }+ is used.
|
||||
# If +iter_method+ is not given, :each is used.
|
||||
#
|
||||
# For example, following 3 code fragments has similar effect.
|
||||
#
|
||||
# q.seplist([1,2,3]) {|v| xxx v }
|
||||
#
|
||||
# q.seplist([1,2,3], lambda { q.comma_breakable }, :each) {|v| xxx v }
|
||||
#
|
||||
# xxx 1
|
||||
# q.comma_breakable
|
||||
# xxx 2
|
||||
# q.comma_breakable
|
||||
# xxx 3
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#760
|
||||
def seplist(list, sep = T.unsafe(nil), iter_method = T.unsafe(nil)); end
|
||||
|
||||
# The current array of contents that calls to methods that generate print tree
|
||||
# nodes will append to.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#423
|
||||
def target; end
|
||||
|
||||
# This adds +object+ as a text of +width+ columns in width.
|
||||
#
|
||||
# If +width+ is not specified, object.length is used.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#989
|
||||
def text(object = T.unsafe(nil), width = T.unsafe(nil)); end
|
||||
|
||||
# This inserts a Trim node into the print tree which, when printed, will clear
|
||||
# all whitespace at the end of the output buffer. This is useful for the rare
|
||||
# case where you need to delete printed indentation and force the next node
|
||||
# to start at the beginning of the line.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#828
|
||||
def trim; end
|
||||
|
||||
# A convenience method used by a lot of the print tree node builders that
|
||||
# temporarily changes the target that the builders will append to.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#1007
|
||||
def with_target(target); end
|
||||
|
||||
private
|
||||
|
||||
# This method returns a boolean as to whether or not the remaining commands
|
||||
# fit onto the remaining space on the current line. If we finish printing
|
||||
# all of the commands or if we hit a newline, then we return true. Otherwise
|
||||
# if we continue printing past the remaining space, we return false.
|
||||
#
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#1019
|
||||
def fits?(next_commands, rest_commands, remaining); end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#1091
|
||||
def remove_breaks_with(doc, replace); end
|
||||
|
||||
# Resets the group stack and target array so that this pretty printer object
|
||||
# can continue to be used before calling flush again if desired.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#1085
|
||||
def reset; end
|
||||
|
||||
class << self
|
||||
# This is a convenience method which is same as follows:
|
||||
#
|
||||
# begin
|
||||
# q = PrettierPrint.new(output, maxwidth, newline, &genspace)
|
||||
# ...
|
||||
# q.flush
|
||||
# output
|
||||
# end
|
||||
#
|
||||
# @yield [q]
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#377
|
||||
def format(output = T.unsafe(nil), maxwidth = T.unsafe(nil), newline = T.unsafe(nil), genspace = T.unsafe(nil), indentation = T.unsafe(nil)); end
|
||||
|
||||
# This is similar to PrettierPrint::format but the result has no breaks.
|
||||
#
|
||||
# +maxwidth+, +newline+ and +genspace+ are ignored.
|
||||
#
|
||||
# The invocation of +breakable+ in the block doesn't break a line and is
|
||||
# treated as just an invocation of +text+.
|
||||
#
|
||||
# @yield [q]
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#156
|
||||
def singleline_format(output = T.unsafe(nil), _maxwidth = T.unsafe(nil), _newline = T.unsafe(nil), _genspace = T.unsafe(nil)); end
|
||||
end
|
||||
end
|
||||
|
||||
# A node in the print tree that represents aligning nested nodes to a certain
|
||||
# prefix width or string.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#65
|
||||
class PrettierPrint::Align
|
||||
# @return [Align] a new instance of Align
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#68
|
||||
def initialize(indent:, contents: T.unsafe(nil)); end
|
||||
|
||||
# Returns the value of attribute contents.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#66
|
||||
def contents; end
|
||||
|
||||
# Returns the value of attribute indent.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#66
|
||||
def indent; end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#73
|
||||
def pretty_print(q); end
|
||||
end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#126
|
||||
PrettierPrint::BREAKABLE_EMPTY = T.let(T.unsafe(nil), PrettierPrint::Breakable)
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#127
|
||||
PrettierPrint::BREAKABLE_FORCE = T.let(T.unsafe(nil), PrettierPrint::Breakable)
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#128
|
||||
PrettierPrint::BREAKABLE_RETURN = T.let(T.unsafe(nil), PrettierPrint::Breakable)
|
||||
|
||||
# Below here are the most common combination of options that are created when
|
||||
# creating new breakables. They are here to cut down on some allocations.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#125
|
||||
PrettierPrint::BREAKABLE_SPACE = T.let(T.unsafe(nil), PrettierPrint::Breakable)
|
||||
|
||||
# Since there's really no difference in these instances, just using the same
|
||||
# one saves on some allocations.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#141
|
||||
PrettierPrint::BREAK_PARENT = T.let(T.unsafe(nil), PrettierPrint::BreakParent)
|
||||
|
||||
# A node in the print tree that forces the surrounding group to print out in
|
||||
# the "break" mode as opposed to the "flat" mode. Useful for when you need to
|
||||
# force a newline into a group.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#133
|
||||
class PrettierPrint::BreakParent
|
||||
# source://prettier_print//lib/prettier_print.rb#134
|
||||
def pretty_print(q); end
|
||||
end
|
||||
|
||||
# A node in the print tree that represents a place in the buffer that the
|
||||
# content can be broken onto multiple lines.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#82
|
||||
class PrettierPrint::Breakable
|
||||
# @return [Breakable] a new instance of Breakable
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#85
|
||||
def initialize(separator = T.unsafe(nil), width = T.unsafe(nil), force: T.unsafe(nil), indent: T.unsafe(nil)); end
|
||||
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#97
|
||||
def force?; end
|
||||
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#101
|
||||
def indent?; end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#105
|
||||
def pretty_print(q); end
|
||||
|
||||
# Returns the value of attribute separator.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#83
|
||||
def separator; end
|
||||
|
||||
# Returns the value of attribute width.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#83
|
||||
def width; end
|
||||
end
|
||||
|
||||
# When building up the contents in the output buffer, it's convenient to be
|
||||
# able to trim trailing whitespace before newlines. If the output object is a
|
||||
# string or array or strings, then we can do this with some gsub calls. If
|
||||
# not, then this effectively just wraps the output object and forwards on
|
||||
# calls to <<.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#277
|
||||
module PrettierPrint::Buffer
|
||||
class << self
|
||||
# This is a switch for building the correct output buffer wrapper class for
|
||||
# the given output object.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#336
|
||||
def for(output); end
|
||||
end
|
||||
end
|
||||
|
||||
# This is an output buffer that wraps an array output object. It provides a
|
||||
# trim! method that trims off trailing whitespace from the last element in
|
||||
# the array if it's an unfrozen string using the same method as the
|
||||
# StringBuffer.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#303
|
||||
class PrettierPrint::Buffer::ArrayBuffer
|
||||
# @return [ArrayBuffer] a new instance of ArrayBuffer
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#306
|
||||
def initialize(output = T.unsafe(nil)); end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#310
|
||||
def <<(object); end
|
||||
|
||||
# Returns the value of attribute output.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#304
|
||||
def output; end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#314
|
||||
def trim!; end
|
||||
end
|
||||
|
||||
# This is an output buffer that wraps a string output object. It provides a
|
||||
# trim! method that trims off trailing whitespace from the string using
|
||||
# gsub!.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#281
|
||||
class PrettierPrint::Buffer::StringBuffer
|
||||
# @return [StringBuffer] a new instance of StringBuffer
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#284
|
||||
def initialize(output = T.unsafe(nil)); end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#288
|
||||
def <<(object); end
|
||||
|
||||
# Returns the value of attribute output.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#282
|
||||
def output; end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#292
|
||||
def trim!; end
|
||||
end
|
||||
|
||||
# When generating spaces after a newline for indentation, by default we
|
||||
# generate one space per character needed for indentation. You can change this
|
||||
# behavior (for instance to use tabs) by passing a different genspace
|
||||
# procedure.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#350
|
||||
PrettierPrint::DEFAULT_GENSPACE = T.let(T.unsafe(nil), Proc)
|
||||
|
||||
# The default indentation for printing is zero, assuming that the code starts
|
||||
# at the top level. That can be changed if desired to start from a different
|
||||
# indentation level.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#366
|
||||
PrettierPrint::DEFAULT_INDENTATION = T.let(T.unsafe(nil), Integer)
|
||||
|
||||
# When printing, you can optionally specify the value that should be used
|
||||
# whenever a group needs to be broken onto multiple lines. In this case the
|
||||
# default is \n.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#344
|
||||
PrettierPrint::DEFAULT_NEWLINE = T.let(T.unsafe(nil), String)
|
||||
|
||||
# A node in the print tree that represents a group of items which the printer
|
||||
# should try to fit onto one line. This is the basic command to tell the
|
||||
# printer when to break. Groups are usually nested, and the printer will try
|
||||
# to fit everything on one line, but if it doesn't fit it will break the
|
||||
# outermost group first and try again. It will continue breaking groups until
|
||||
# everything fits (or there are no more groups to break).
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#149
|
||||
class PrettierPrint::Group
|
||||
# @return [Group] a new instance of Group
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#152
|
||||
def initialize(depth, contents: T.unsafe(nil)); end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#158
|
||||
def break; end
|
||||
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#162
|
||||
def break?; end
|
||||
|
||||
# Returns the value of attribute contents.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#150
|
||||
def contents; end
|
||||
|
||||
# Returns the value of attribute depth.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#150
|
||||
def depth; end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#166
|
||||
def pretty_print(q); end
|
||||
end
|
||||
|
||||
# A node in the print tree that represents printing one thing if the
|
||||
# surrounding group node is broken and another thing if the surrounding group
|
||||
# node is flat.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#176
|
||||
class PrettierPrint::IfBreak
|
||||
# @return [IfBreak] a new instance of IfBreak
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#179
|
||||
def initialize(break_contents: T.unsafe(nil), flat_contents: T.unsafe(nil)); end
|
||||
|
||||
# Returns the value of attribute break_contents.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#177
|
||||
def break_contents; end
|
||||
|
||||
# Returns the value of attribute flat_contents.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#177
|
||||
def flat_contents; end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#184
|
||||
def pretty_print(q); end
|
||||
end
|
||||
|
||||
# A small DSL-like object used for specifying the alternative contents to be
|
||||
# printed if the surrounding group doesn't break for an IfBreak node.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#874
|
||||
class PrettierPrint::IfBreakBuilder
|
||||
# @return [IfBreakBuilder] a new instance of IfBreakBuilder
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#877
|
||||
def initialize(q, flat_contents); end
|
||||
|
||||
# Returns the value of attribute flat_contents.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#875
|
||||
def flat_contents; end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#882
|
||||
def if_flat; end
|
||||
|
||||
# Returns the value of attribute q.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#875
|
||||
def q; end
|
||||
end
|
||||
|
||||
# When we already know that groups are broken, we don't actually need to track
|
||||
# the flat versions of the contents. So this builder version is effectively a
|
||||
# no-op, but we need it to maintain the same API. The only thing this can
|
||||
# impact is that if there's a forced break in the flat contents, then we need
|
||||
# to propagate that break up the whole tree.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#892
|
||||
class PrettierPrint::IfFlatIgnore
|
||||
# @return [IfFlatIgnore] a new instance of IfFlatIgnore
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#895
|
||||
def initialize(q); end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#899
|
||||
def if_flat; end
|
||||
|
||||
# Returns the value of attribute q.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#893
|
||||
def q; end
|
||||
end
|
||||
|
||||
# A node in the print tree that is a variant of the Align node that indents
|
||||
# its contents by one level.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#200
|
||||
class PrettierPrint::Indent
|
||||
# @return [Indent] a new instance of Indent
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#203
|
||||
def initialize(contents: T.unsafe(nil)); end
|
||||
|
||||
# Returns the value of attribute contents.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#201
|
||||
def contents; end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#207
|
||||
def pretty_print(q); end
|
||||
end
|
||||
|
||||
# A node in the print tree that has its own special buffer for implementing
|
||||
# content that should flush before any newline.
|
||||
#
|
||||
# Useful for implementating trailing content, as it's not always practical to
|
||||
# constantly check where the line ends to avoid accidentally printing some
|
||||
# content after a line suffix node.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#220
|
||||
class PrettierPrint::LineSuffix
|
||||
# @return [LineSuffix] a new instance of LineSuffix
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#225
|
||||
def initialize(priority: T.unsafe(nil), contents: T.unsafe(nil)); end
|
||||
|
||||
# Returns the value of attribute contents.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#223
|
||||
def contents; end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#230
|
||||
def pretty_print(q); end
|
||||
|
||||
# Returns the value of attribute priority.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#223
|
||||
def priority; end
|
||||
end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#221
|
||||
PrettierPrint::LineSuffix::DEFAULT_PRIORITY = T.let(T.unsafe(nil), Integer)
|
||||
|
||||
# There are two modes in printing, break and flat. When we're in break mode,
|
||||
# any lines will use their newline, any if-breaks will use their break
|
||||
# contents, etc.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#356
|
||||
PrettierPrint::MODE_BREAK = T.let(T.unsafe(nil), Integer)
|
||||
|
||||
# This is another print mode much like MODE_BREAK. When we're in flat mode, we
|
||||
# attempt to print everything on one line until we either hit a broken group,
|
||||
# a forced line, or the maximum width.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#361
|
||||
PrettierPrint::MODE_FLAT = T.let(T.unsafe(nil), Integer)
|
||||
|
||||
# PrettierPrint::SingleLine is used by PrettierPrint.singleline_format
|
||||
#
|
||||
# It is passed to be similar to a PrettierPrint object itself, by responding to
|
||||
# all of the same print tree node builder methods, as well as the #flush
|
||||
# method.
|
||||
#
|
||||
# The significant difference here is that there are no line breaks in the
|
||||
# output. If an IfBreak node is used, only the flat contents are printed.
|
||||
# LineSuffix nodes are printed at the end of the buffer when #flush is called.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#13
|
||||
class PrettierPrint::SingleLine
|
||||
# Create a PrettierPrint::SingleLine object
|
||||
#
|
||||
# Arguments:
|
||||
# * +output+ - String (or similar) to store rendered text. Needs to respond
|
||||
# to '<<'.
|
||||
# * +maxwidth+ - Argument position expected to be here for compatibility.
|
||||
# This argument is a noop.
|
||||
# * +newline+ - Argument position expected to be here for compatibility.
|
||||
# This argument is a noop.
|
||||
#
|
||||
# @return [SingleLine] a new instance of SingleLine
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#34
|
||||
def initialize(output, _maxwidth = T.unsafe(nil), _newline = T.unsafe(nil)); end
|
||||
|
||||
# Here for compatibility, does nothing.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#64
|
||||
def break_parent; end
|
||||
|
||||
# Appends +separator+ to the text to be output. By default +separator+ is
|
||||
# ' '
|
||||
#
|
||||
# The +width+, +indent+, and +force+ arguments are here for compatibility.
|
||||
# They are all noop arguments.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#54
|
||||
def breakable(separator = T.unsafe(nil), _width = T.unsafe(nil), indent: T.unsafe(nil), force: T.unsafe(nil)); end
|
||||
|
||||
# Appends +separator+ to the output buffer. +width+ is a noop here for
|
||||
# compatibility.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#69
|
||||
def fill_breakable(separator = T.unsafe(nil), _width = T.unsafe(nil)); end
|
||||
|
||||
# Flushes the line suffixes onto the output buffer.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#41
|
||||
def flush; end
|
||||
|
||||
# Opens a block for grouping objects to be pretty printed.
|
||||
#
|
||||
# Arguments:
|
||||
# * +indent+ - noop argument. Present for compatibility.
|
||||
# * +open_obj+ - text appended before the &block. Default is ''
|
||||
# * +close_obj+ - text appended after the &block. Default is ''
|
||||
# * +open_width+ - noop argument. Present for compatibility.
|
||||
# * +close_width+ - noop argument. Present for compatibility.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#90
|
||||
def group(_indent = T.unsafe(nil), open_object = T.unsafe(nil), close_object = T.unsafe(nil), _open_width = T.unsafe(nil), _close_width = T.unsafe(nil)); end
|
||||
|
||||
# Effectively unnecessary, but here for compatibility.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#113
|
||||
def if_break; end
|
||||
|
||||
# Also effectively unnecessary, but here for compatibility.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#118
|
||||
def if_flat; end
|
||||
|
||||
# A noop that immediately yields.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#122
|
||||
def indent; end
|
||||
|
||||
# Changes the target output buffer to the line suffix output buffer which
|
||||
# will get flushed at the end of printing.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#128
|
||||
def line_suffix; end
|
||||
|
||||
# A buffer output that wraps any calls to line_suffix that will be flushed
|
||||
# at the end of printing.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#23
|
||||
def line_suffixes; end
|
||||
|
||||
# Takes +indent+ arg, but does nothing with it.
|
||||
#
|
||||
# Yields to a block.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#137
|
||||
def nest(_indent); end
|
||||
|
||||
# The output object. It stores rendered text and should respond to <<.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#15
|
||||
def output; end
|
||||
|
||||
# The current array of contents that the print tree builder methods should
|
||||
# append to.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#19
|
||||
def target; end
|
||||
|
||||
# Add +object+ to the text to be output.
|
||||
#
|
||||
# +width+ argument is here for compatibility. It is a noop argument.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#144
|
||||
def text(object = T.unsafe(nil), _width = T.unsafe(nil)); end
|
||||
|
||||
# Immediately trims the output buffer.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#74
|
||||
def trim; end
|
||||
end
|
||||
|
||||
# A class that wraps the ability to call #if_flat. The contents of the
|
||||
# #if_flat block are executed immediately, so effectively this class and the
|
||||
# #if_break method that triggers it are unnecessary, but they're here to
|
||||
# maintain compatibility.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#106
|
||||
class PrettierPrint::SingleLine::IfBreakBuilder
|
||||
# source://prettier_print//lib/prettier_print/single_line.rb#107
|
||||
def if_flat; end
|
||||
end
|
||||
|
||||
# Since all of the instances here are the same, we can reuse the same one to
|
||||
# cut down on allocations.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#270
|
||||
PrettierPrint::TRIM = T.let(T.unsafe(nil), PrettierPrint::Trim)
|
||||
|
||||
# A node in the print tree that represents plain content that cannot be broken
|
||||
# up (by default this assumes strings, but it can really be anything).
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#239
|
||||
class PrettierPrint::Text
|
||||
# @return [Text] a new instance of Text
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#242
|
||||
def initialize; end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#247
|
||||
def add(object: T.unsafe(nil), width: T.unsafe(nil)); end
|
||||
|
||||
# Returns the value of attribute objects.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#240
|
||||
def objects; end
|
||||
|
||||
# source://prettier_print//lib/prettier_print.rb#252
|
||||
def pretty_print(q); end
|
||||
|
||||
# Returns the value of attribute width.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#240
|
||||
def width; end
|
||||
end
|
||||
|
||||
# A node in the print tree that represents trimming all of the indentation of
|
||||
# the current line, in the rare case that you need to ignore the indentation
|
||||
# that you've already created. This node should be placed after a Breakable.
|
||||
#
|
||||
# source://prettier_print//lib/prettier_print.rb#262
|
||||
class PrettierPrint::Trim
|
||||
# source://prettier_print//lib/prettier_print.rb#263
|
||||
def pretty_print(q); end
|
||||
end
|
||||
477
sorbet/rbi/gems/prettyprint@0.2.0.rbi
generated
Normal file
477
sorbet/rbi/gems/prettyprint@0.2.0.rbi
generated
Normal file
@@ -0,0 +1,477 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `prettyprint` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem prettyprint`.
|
||||
|
||||
|
||||
# This class implements a pretty printing algorithm. It finds line breaks and
|
||||
# nice indentations for grouped structure.
|
||||
#
|
||||
# By default, the class assumes that primitive elements are strings and each
|
||||
# byte in the strings have single column in width. But it can be used for
|
||||
# other situations by giving suitable arguments for some methods:
|
||||
# * newline object and space generation block for PrettyPrint.new
|
||||
# * optional width argument for PrettyPrint#text
|
||||
# * PrettyPrint#breakable
|
||||
#
|
||||
# There are several candidate uses:
|
||||
# * text formatting using proportional fonts
|
||||
# * multibyte characters which has columns different to number of bytes
|
||||
# * non-string formatting
|
||||
#
|
||||
# == Bugs
|
||||
# * Box based formatting?
|
||||
# * Other (better) model/algorithm?
|
||||
#
|
||||
# Report any bugs at http://bugs.ruby-lang.org
|
||||
#
|
||||
# == References
|
||||
# Christian Lindig, Strictly Pretty, March 2000,
|
||||
# https://lindig.github.io/papers/strictly-pretty-2000.pdf
|
||||
#
|
||||
# Philip Wadler, A prettier printer, March 1998,
|
||||
# https://homepages.inf.ed.ac.uk/wadler/topics/language-design.html#prettier
|
||||
#
|
||||
# == Author
|
||||
# Tanaka Akira <akr@fsij.org>
|
||||
class PrettyPrint
|
||||
# Creates a buffer for pretty printing.
|
||||
#
|
||||
# +output+ is an output target. If it is not specified, '' is assumed. It
|
||||
# should have a << method which accepts the first argument +obj+ of
|
||||
# PrettyPrint#text, the first argument +sep+ of PrettyPrint#breakable, the
|
||||
# first argument +newline+ of PrettyPrint.new, and the result of a given
|
||||
# block for PrettyPrint.new.
|
||||
#
|
||||
# +maxwidth+ specifies maximum line length. If it is not specified, 79 is
|
||||
# assumed. However actual outputs may overflow +maxwidth+ if long
|
||||
# non-breakable texts are provided.
|
||||
#
|
||||
# +newline+ is used for line breaks. "\n" is used if it is not specified.
|
||||
#
|
||||
# The block is used to generate spaces. {|width| ' ' * width} is used if it
|
||||
# is not given.
|
||||
#
|
||||
# @return [PrettyPrint] a new instance of PrettyPrint
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#84
|
||||
def initialize(output = T.unsafe(nil), maxwidth = T.unsafe(nil), newline = T.unsafe(nil), &genspace); end
|
||||
|
||||
# Breaks the buffer into lines that are shorter than #maxwidth
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#162
|
||||
def break_outmost_groups; end
|
||||
|
||||
# This says "you can break a line here if necessary", and a +width+\-column
|
||||
# text +sep+ is inserted if a line is not broken at the point.
|
||||
#
|
||||
# If +sep+ is not specified, " " is used.
|
||||
#
|
||||
# If +width+ is not specified, +sep.length+ is used. You will have to
|
||||
# specify this when +sep+ is a multibyte character, for example.
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#226
|
||||
def breakable(sep = T.unsafe(nil), width = T.unsafe(nil)); end
|
||||
|
||||
# Returns the group most recently added to the stack.
|
||||
#
|
||||
# Contrived example:
|
||||
# out = ""
|
||||
# => ""
|
||||
# q = PrettyPrint.new(out)
|
||||
# => #<PrettyPrint:0x82f85c0 @output="", @maxwidth=79, @newline="\n", @genspace=#<Proc:0x82f8368@/home/vbatts/.rvm/rubies/ruby-head/lib/ruby/2.0.0/prettyprint.rb:82 (lambda)>, @output_width=0, @buffer_width=0, @buffer=[], @group_stack=[#<PrettyPrint::Group:0x82f8138 @depth=0, @breakables=[], @break=false>], @group_queue=#<PrettyPrint::GroupQueue:0x82fb7c0 @queue=[[#<PrettyPrint::Group:0x82f8138 @depth=0, @breakables=[], @break=false>]]>, @indent=0>
|
||||
# q.group {
|
||||
# q.text q.current_group.inspect
|
||||
# q.text q.newline
|
||||
# q.group(q.current_group.depth + 1) {
|
||||
# q.text q.current_group.inspect
|
||||
# q.text q.newline
|
||||
# q.group(q.current_group.depth + 1) {
|
||||
# q.text q.current_group.inspect
|
||||
# q.text q.newline
|
||||
# q.group(q.current_group.depth + 1) {
|
||||
# q.text q.current_group.inspect
|
||||
# q.text q.newline
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# => 284
|
||||
# puts out
|
||||
# #<PrettyPrint::Group:0x8354758 @depth=1, @breakables=[], @break=false>
|
||||
# #<PrettyPrint::Group:0x8354550 @depth=2, @breakables=[], @break=false>
|
||||
# #<PrettyPrint::Group:0x83541cc @depth=3, @breakables=[], @break=false>
|
||||
# #<PrettyPrint::Group:0x8347e54 @depth=4, @breakables=[], @break=false>
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#157
|
||||
def current_group; end
|
||||
|
||||
# This is similar to #breakable except
|
||||
# the decision to break or not is determined individually.
|
||||
#
|
||||
# Two #fill_breakable under a group may cause 4 results:
|
||||
# (break,break), (break,non-break), (non-break,break), (non-break,non-break).
|
||||
# This is different to #breakable because two #breakable under a group
|
||||
# may cause 2 results:
|
||||
# (break,break), (non-break,non-break).
|
||||
#
|
||||
# The text +sep+ is inserted if a line is not broken at this point.
|
||||
#
|
||||
# If +sep+ is not specified, " " is used.
|
||||
#
|
||||
# If +width+ is not specified, +sep.length+ is used. You will have to
|
||||
# specify this when +sep+ is a multibyte character, for example.
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#214
|
||||
def fill_breakable(sep = T.unsafe(nil), width = T.unsafe(nil)); end
|
||||
|
||||
# outputs buffered data.
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#290
|
||||
def flush; end
|
||||
|
||||
# A lambda or Proc, that takes one argument, of an Integer, and returns
|
||||
# the corresponding number of spaces.
|
||||
#
|
||||
# By default this is:
|
||||
# lambda {|n| ' ' * n}
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#120
|
||||
def genspace; end
|
||||
|
||||
# Groups line break hints added in the block. The line break hints are all
|
||||
# to be used or not.
|
||||
#
|
||||
# If +indent+ is specified, the method call is regarded as nested by
|
||||
# nest(indent) { ... }.
|
||||
#
|
||||
# If +open_obj+ is specified, <tt>text open_obj, open_width</tt> is called
|
||||
# before grouping. If +close_obj+ is specified, <tt>text close_obj,
|
||||
# close_width</tt> is called after grouping.
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#251
|
||||
def group(indent = T.unsafe(nil), open_obj = T.unsafe(nil), close_obj = T.unsafe(nil), open_width = T.unsafe(nil), close_width = T.unsafe(nil)); end
|
||||
|
||||
# The PrettyPrint::GroupQueue of groups in stack to be pretty printed
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#126
|
||||
def group_queue; end
|
||||
|
||||
# Takes a block and queues a new group that is indented 1 level further.
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#262
|
||||
def group_sub; end
|
||||
|
||||
# The number of spaces to be indented
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#123
|
||||
def indent; end
|
||||
|
||||
# The maximum width of a line, before it is separated in to a newline
|
||||
#
|
||||
# This defaults to 79, and should be an Integer
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#108
|
||||
def maxwidth; end
|
||||
|
||||
# Increases left margin after newline with +indent+ for line breaks added in
|
||||
# the block.
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#279
|
||||
def nest(indent); end
|
||||
|
||||
# The value that is appended to +output+ to add a new line.
|
||||
#
|
||||
# This defaults to "\n", and should be String
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#113
|
||||
def newline; end
|
||||
|
||||
# The output object.
|
||||
#
|
||||
# This defaults to '', and should accept the << method
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#103
|
||||
def output; end
|
||||
|
||||
# This adds +obj+ as a text of +width+ columns in width.
|
||||
#
|
||||
# If +width+ is not specified, obj.length is used.
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#182
|
||||
def text(obj, width = T.unsafe(nil)); end
|
||||
|
||||
class << self
|
||||
# This is a convenience method which is same as follows:
|
||||
#
|
||||
# begin
|
||||
# q = PrettyPrint.new(output, maxwidth, newline, &genspace)
|
||||
# ...
|
||||
# q.flush
|
||||
# output
|
||||
# end
|
||||
#
|
||||
# @yield [q]
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#47
|
||||
def format(output = T.unsafe(nil), maxwidth = T.unsafe(nil), newline = T.unsafe(nil), genspace = T.unsafe(nil)); end
|
||||
|
||||
# This is similar to PrettyPrint::format but the result has no breaks.
|
||||
#
|
||||
# +maxwidth+, +newline+ and +genspace+ are ignored.
|
||||
#
|
||||
# The invocation of +breakable+ in the block doesn't break a line and is
|
||||
# treated as just an invocation of +text+.
|
||||
#
|
||||
# @yield [q]
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#61
|
||||
def singleline_format(output = T.unsafe(nil), maxwidth = T.unsafe(nil), newline = T.unsafe(nil), genspace = T.unsafe(nil)); end
|
||||
end
|
||||
end
|
||||
|
||||
# The Breakable class is used for breaking up object information
|
||||
#
|
||||
# This class is intended for internal use of the PrettyPrint buffers.
|
||||
class PrettyPrint::Breakable
|
||||
# Create a new Breakable object.
|
||||
#
|
||||
# Arguments:
|
||||
# * +sep+ String of the separator
|
||||
# * +width+ Integer width of the +sep+
|
||||
# * +q+ parent PrettyPrint object, to base from
|
||||
#
|
||||
# @return [Breakable] a new instance of Breakable
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#347
|
||||
def initialize(sep, width, q); end
|
||||
|
||||
# The number of spaces to indent.
|
||||
#
|
||||
# This is inferred from +q+ within PrettyPrint, passed in ::new
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#367
|
||||
def indent; end
|
||||
|
||||
# Holds the separator String
|
||||
#
|
||||
# The +sep+ argument from ::new
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#359
|
||||
def obj; end
|
||||
|
||||
# Render the String text of the objects that have been added to this
|
||||
# Breakable object.
|
||||
#
|
||||
# Output the text to +out+, and increment the width to +output_width+
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#373
|
||||
def output(out, output_width); end
|
||||
|
||||
# The width of +obj+ / +sep+
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#362
|
||||
def width; end
|
||||
end
|
||||
|
||||
# The Group class is used for making indentation easier.
|
||||
#
|
||||
# While this class does neither the breaking into newlines nor indentation,
|
||||
# it is used in a stack (as well as a queue) within PrettyPrint, to group
|
||||
# objects.
|
||||
#
|
||||
# For information on using groups, see PrettyPrint#group
|
||||
#
|
||||
# This class is intended for internal use of the PrettyPrint buffers.
|
||||
class PrettyPrint::Group
|
||||
# Create a Group object
|
||||
#
|
||||
# Arguments:
|
||||
# * +depth+ - this group's relation to previous groups
|
||||
#
|
||||
# @return [Group] a new instance of Group
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#401
|
||||
def initialize(depth); end
|
||||
|
||||
# Makes a break for this Group, and returns true
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#414
|
||||
def break; end
|
||||
|
||||
# Boolean of whether this Group has made a break
|
||||
#
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#419
|
||||
def break?; end
|
||||
|
||||
# Array to hold the Breakable objects for this Group
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#411
|
||||
def breakables; end
|
||||
|
||||
# This group's relation to previous groups
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#408
|
||||
def depth; end
|
||||
|
||||
# Boolean of whether this Group has been queried for being first
|
||||
#
|
||||
# This is used as a predicate, and ought to be called first.
|
||||
#
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#426
|
||||
def first?; end
|
||||
end
|
||||
|
||||
# The GroupQueue class is used for managing the queue of Group to be pretty
|
||||
# printed.
|
||||
#
|
||||
# This queue groups the Group objects, based on their depth.
|
||||
#
|
||||
# This class is intended for internal use of the PrettyPrint buffers.
|
||||
class PrettyPrint::GroupQueue
|
||||
# Create a GroupQueue object
|
||||
#
|
||||
# Arguments:
|
||||
# * +groups+ - one or more PrettyPrint::Group objects
|
||||
#
|
||||
# @return [GroupQueue] a new instance of GroupQueue
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#447
|
||||
def initialize(*groups); end
|
||||
|
||||
# Remote +group+ from this queue
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#479
|
||||
def delete(group); end
|
||||
|
||||
# Returns the outer group of the queue
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#463
|
||||
def deq; end
|
||||
|
||||
# Enqueue +group+
|
||||
#
|
||||
# This does not strictly append the group to the end of the queue,
|
||||
# but instead adds it in line, base on the +group.depth+
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#456
|
||||
def enq(group); end
|
||||
end
|
||||
|
||||
# PrettyPrint::SingleLine is used by PrettyPrint.singleline_format
|
||||
#
|
||||
# It is passed to be similar to a PrettyPrint object itself, by responding to:
|
||||
# * #text
|
||||
# * #breakable
|
||||
# * #nest
|
||||
# * #group
|
||||
# * #flush
|
||||
# * #first?
|
||||
#
|
||||
# but instead, the output has no line breaks
|
||||
class PrettyPrint::SingleLine
|
||||
# Create a PrettyPrint::SingleLine object
|
||||
#
|
||||
# Arguments:
|
||||
# * +output+ - String (or similar) to store rendered text. Needs to respond to '<<'
|
||||
# * +maxwidth+ - Argument position expected to be here for compatibility.
|
||||
# This argument is a noop.
|
||||
# * +newline+ - Argument position expected to be here for compatibility.
|
||||
# This argument is a noop.
|
||||
#
|
||||
# @return [SingleLine] a new instance of SingleLine
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#505
|
||||
def initialize(output, maxwidth = T.unsafe(nil), newline = T.unsafe(nil)); end
|
||||
|
||||
# Appends +sep+ to the text to be output. By default +sep+ is ' '
|
||||
#
|
||||
# +width+ argument is here for compatibility. It is a noop argument.
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#520
|
||||
def breakable(sep = T.unsafe(nil), width = T.unsafe(nil)); end
|
||||
|
||||
# This is used as a predicate, and ought to be called first.
|
||||
#
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#552
|
||||
def first?; end
|
||||
|
||||
# Method present for compatibility, but is a noop
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#548
|
||||
def flush; end
|
||||
|
||||
# Opens a block for grouping objects to be pretty printed.
|
||||
#
|
||||
# Arguments:
|
||||
# * +indent+ - noop argument. Present for compatibility.
|
||||
# * +open_obj+ - text appended before the &blok. Default is ''
|
||||
# * +close_obj+ - text appended after the &blok. Default is ''
|
||||
# * +open_width+ - noop argument. Present for compatibility.
|
||||
# * +close_width+ - noop argument. Present for compatibility.
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#539
|
||||
def group(indent = T.unsafe(nil), open_obj = T.unsafe(nil), close_obj = T.unsafe(nil), open_width = T.unsafe(nil), close_width = T.unsafe(nil)); end
|
||||
|
||||
# Takes +indent+ arg, but does nothing with it.
|
||||
#
|
||||
# Yields to a block.
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#527
|
||||
def nest(indent); end
|
||||
|
||||
# Add +obj+ to the text to be output.
|
||||
#
|
||||
# +width+ argument is here for compatibility. It is a noop argument.
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#513
|
||||
def text(obj, width = T.unsafe(nil)); end
|
||||
end
|
||||
|
||||
# The Text class is the means by which to collect strings from objects.
|
||||
#
|
||||
# This class is intended for internal use of the PrettyPrint buffers.
|
||||
class PrettyPrint::Text
|
||||
# Creates a new text object.
|
||||
#
|
||||
# This constructor takes no arguments.
|
||||
#
|
||||
# The workflow is to append a PrettyPrint::Text object to the buffer, and
|
||||
# being able to call the buffer.last() to reference it.
|
||||
#
|
||||
# As there are objects, use PrettyPrint::Text#add to include the objects
|
||||
# and the width to utilized by the String version of this object.
|
||||
#
|
||||
# @return [Text] a new instance of Text
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#312
|
||||
def initialize; end
|
||||
|
||||
# Include +obj+ in the objects to be pretty printed, and increment
|
||||
# this Text object's total width by +width+
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#330
|
||||
def add(obj, width); end
|
||||
|
||||
# Render the String text of the objects that have been added to this Text object.
|
||||
#
|
||||
# Output the text to +out+, and increment the width to +output_width+
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#323
|
||||
def output(out, output_width); end
|
||||
|
||||
# The total width of the objects included in this Text object.
|
||||
#
|
||||
# source://prettyprint//lib/prettyprint.rb#318
|
||||
def width; end
|
||||
end
|
||||
|
||||
# source://prettyprint//lib/prettyprint.rb#36
|
||||
PrettyPrint::VERSION = T.let(T.unsafe(nil), String)
|
||||
40168
sorbet/rbi/gems/prism@1.4.0.rbi
generated
Normal file
40168
sorbet/rbi/gems/prism@1.4.0.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
2469
sorbet/rbi/gems/psych@5.2.6.rbi
generated
Normal file
2469
sorbet/rbi/gems/psych@5.2.6.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
3036
sorbet/rbi/gems/rake@13.3.0.rbi
generated
Normal file
3036
sorbet/rbi/gems/rake@13.3.0.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
6893
sorbet/rbi/gems/rbi@0.3.6.rbi
generated
Normal file
6893
sorbet/rbi/gems/rbi@0.3.6.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
6978
sorbet/rbi/gems/rbs@3.9.4.rbi
generated
Normal file
6978
sorbet/rbi/gems/rbs@3.9.4.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
12840
sorbet/rbi/gems/rdoc@6.14.2.rbi
generated
Normal file
12840
sorbet/rbi/gems/rdoc@6.14.2.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
2429
sorbet/rbi/gems/reline@0.6.1.rbi
generated
Normal file
2429
sorbet/rbi/gems/reline@0.6.1.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
5240
sorbet/rbi/gems/rexml@3.4.1.rbi
generated
Normal file
5240
sorbet/rbi/gems/rexml@3.4.1.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
11241
sorbet/rbi/gems/rspec-core@3.13.5.rbi
generated
Normal file
11241
sorbet/rbi/gems/rspec-core@3.13.5.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
8189
sorbet/rbi/gems/rspec-expectations@3.13.5.rbi
generated
Normal file
8189
sorbet/rbi/gems/rspec-expectations@3.13.5.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
5350
sorbet/rbi/gems/rspec-mocks@3.13.5.rbi
generated
Normal file
5350
sorbet/rbi/gems/rspec-mocks@3.13.5.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
1630
sorbet/rbi/gems/rspec-support@3.13.4.rbi
generated
Normal file
1630
sorbet/rbi/gems/rspec-support@3.13.4.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
83
sorbet/rbi/gems/rspec@3.13.1.rbi
generated
Normal file
83
sorbet/rbi/gems/rspec@3.13.1.rbi
generated
Normal file
@@ -0,0 +1,83 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `rspec` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem rspec`.
|
||||
|
||||
|
||||
# source://rspec//lib/rspec/version.rb#1
|
||||
module RSpec
|
||||
class << self
|
||||
# source://rspec-core/3.13.5/lib/rspec/core.rb#70
|
||||
def clear_examples; end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core.rb#85
|
||||
def configuration; end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core.rb#49
|
||||
def configuration=(_arg0); end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core.rb#97
|
||||
def configure; end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core.rb#194
|
||||
def const_missing(name); end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core/dsl.rb#42
|
||||
def context(*args, &example_group_block); end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core.rb#122
|
||||
def current_example; end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core.rb#128
|
||||
def current_example=(example); end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core.rb#154
|
||||
def current_scope; end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core.rb#134
|
||||
def current_scope=(scope); end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core/dsl.rb#42
|
||||
def describe(*args, &example_group_block); end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core/dsl.rb#42
|
||||
def example_group(*args, &example_group_block); end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core/dsl.rb#42
|
||||
def fcontext(*args, &example_group_block); end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core/dsl.rb#42
|
||||
def fdescribe(*args, &example_group_block); end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core.rb#58
|
||||
def reset; end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core/shared_example_group.rb#110
|
||||
def shared_context(name, *args, &block); end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core/shared_example_group.rb#110
|
||||
def shared_examples(name, *args, &block); end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core/shared_example_group.rb#110
|
||||
def shared_examples_for(name, *args, &block); end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core.rb#160
|
||||
def world; end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core.rb#49
|
||||
def world=(_arg0); end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core/dsl.rb#42
|
||||
def xcontext(*args, &example_group_block); end
|
||||
|
||||
# source://rspec-core/3.13.5/lib/rspec/core/dsl.rb#42
|
||||
def xdescribe(*args, &example_group_block); end
|
||||
end
|
||||
end
|
||||
|
||||
# source://rspec//lib/rspec/version.rb#2
|
||||
module RSpec::Version; end
|
||||
|
||||
# source://rspec//lib/rspec/version.rb#3
|
||||
RSpec::Version::STRING = T.let(T.unsafe(nil), String)
|
||||
75
sorbet/rbi/gems/securerandom@0.4.1.rbi
generated
Normal file
75
sorbet/rbi/gems/securerandom@0.4.1.rbi
generated
Normal file
@@ -0,0 +1,75 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `securerandom` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem securerandom`.
|
||||
|
||||
|
||||
# == Secure random number generator interface.
|
||||
#
|
||||
# This library is an interface to secure random number generators which are
|
||||
# suitable for generating session keys in HTTP cookies, etc.
|
||||
#
|
||||
# You can use this library in your application by requiring it:
|
||||
#
|
||||
# require 'securerandom'
|
||||
#
|
||||
# It supports the following secure random number generators:
|
||||
#
|
||||
# * openssl
|
||||
# * /dev/urandom
|
||||
# * Win32
|
||||
#
|
||||
# SecureRandom is extended by the Random::Formatter module which
|
||||
# defines the following methods:
|
||||
#
|
||||
# * alphanumeric
|
||||
# * base64
|
||||
# * choose
|
||||
# * gen_random
|
||||
# * hex
|
||||
# * rand
|
||||
# * random_bytes
|
||||
# * random_number
|
||||
# * urlsafe_base64
|
||||
# * uuid
|
||||
#
|
||||
# These methods are usable as class methods of SecureRandom such as
|
||||
# +SecureRandom.hex+.
|
||||
#
|
||||
# If a secure random number generator is not available,
|
||||
# +NotImplementedError+ is raised.
|
||||
#
|
||||
# source://securerandom//lib/securerandom.rb#41
|
||||
module SecureRandom
|
||||
extend ::Random::Formatter
|
||||
|
||||
class << self
|
||||
# Returns a random binary string containing +size+ bytes.
|
||||
#
|
||||
# See Random.bytes
|
||||
#
|
||||
# source://securerandom//lib/securerandom.rb#50
|
||||
def bytes(n); end
|
||||
|
||||
# source://securerandom//lib/securerandom.rb#70
|
||||
def gen_random(n); end
|
||||
|
||||
private
|
||||
|
||||
# Implementation using OpenSSL
|
||||
#
|
||||
# source://securerandom//lib/securerandom.rb#65
|
||||
def gen_random_openssl(n); end
|
||||
|
||||
# Implementation using system random device
|
||||
#
|
||||
# source://securerandom//lib/securerandom.rb#70
|
||||
def gen_random_urandom(n); end
|
||||
end
|
||||
end
|
||||
|
||||
# The version
|
||||
#
|
||||
# source://securerandom//lib/securerandom.rb#44
|
||||
SecureRandom::VERSION = T.let(T.unsafe(nil), String)
|
||||
6985
sorbet/rbi/gems/spoom@1.6.3.rbi
generated
Normal file
6985
sorbet/rbi/gems/spoom@1.6.3.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
9
sorbet/rbi/gems/stringio@3.1.7.rbi
generated
Normal file
9
sorbet/rbi/gems/stringio@3.1.7.rbi
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `stringio` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem stringio`.
|
||||
|
||||
|
||||
# THIS IS AN EMPTY RBI FILE.
|
||||
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
|
||||
23134
sorbet/rbi/gems/syntax_tree@6.2.0.rbi
generated
Normal file
23134
sorbet/rbi/gems/syntax_tree@6.2.0.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
3628
sorbet/rbi/gems/tapioca@0.16.11.rbi
generated
Normal file
3628
sorbet/rbi/gems/tapioca@0.16.11.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
4378
sorbet/rbi/gems/thor@1.3.2.rbi
generated
Normal file
4378
sorbet/rbi/gems/thor@1.3.2.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
157
sorbet/rbi/gems/timeout@0.4.3.rbi
generated
Normal file
157
sorbet/rbi/gems/timeout@0.4.3.rbi
generated
Normal file
@@ -0,0 +1,157 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `timeout` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem timeout`.
|
||||
|
||||
|
||||
# source://timeout//lib/timeout.rb#21
|
||||
module Timeout
|
||||
private
|
||||
|
||||
# Perform an operation in a block, raising an error if it takes longer than
|
||||
# +sec+ seconds to complete.
|
||||
#
|
||||
# +sec+:: Number of seconds to wait for the block to terminate. Any non-negative number
|
||||
# or nil may be used, including Floats to specify fractional seconds. A
|
||||
# value of 0 or +nil+ will execute the block without any timeout.
|
||||
# Any negative number will raise an ArgumentError.
|
||||
# +klass+:: Exception Class to raise if the block fails to terminate
|
||||
# in +sec+ seconds. Omitting will use the default, Timeout::Error
|
||||
# +message+:: Error message to raise with Exception Class.
|
||||
# Omitting will use the default, "execution expired"
|
||||
#
|
||||
# Returns the result of the block *if* the block completed before
|
||||
# +sec+ seconds, otherwise throws an exception, based on the value of +klass+.
|
||||
#
|
||||
# The exception thrown to terminate the given block cannot be rescued inside
|
||||
# the block unless +klass+ is given explicitly. However, the block can use
|
||||
# ensure to prevent the handling of the exception. For that reason, this
|
||||
# method cannot be relied on to enforce timeouts for untrusted blocks.
|
||||
#
|
||||
# If a scheduler is defined, it will be used to handle the timeout by invoking
|
||||
# Scheduler#timeout_after.
|
||||
#
|
||||
# Note that this is both a method of module Timeout, so you can <tt>include
|
||||
# Timeout</tt> into your classes so they have a #timeout method, as well as
|
||||
# a module method, so you can call it directly as Timeout.timeout().
|
||||
#
|
||||
# @raise [ArgumentError]
|
||||
#
|
||||
# source://timeout//lib/timeout.rb#167
|
||||
def timeout(sec, klass = T.unsafe(nil), message = T.unsafe(nil), &block); end
|
||||
|
||||
class << self
|
||||
# source://timeout//lib/timeout.rb#124
|
||||
def ensure_timeout_thread_created; end
|
||||
|
||||
# Perform an operation in a block, raising an error if it takes longer than
|
||||
# +sec+ seconds to complete.
|
||||
#
|
||||
# +sec+:: Number of seconds to wait for the block to terminate. Any non-negative number
|
||||
# or nil may be used, including Floats to specify fractional seconds. A
|
||||
# value of 0 or +nil+ will execute the block without any timeout.
|
||||
# Any negative number will raise an ArgumentError.
|
||||
# +klass+:: Exception Class to raise if the block fails to terminate
|
||||
# in +sec+ seconds. Omitting will use the default, Timeout::Error
|
||||
# +message+:: Error message to raise with Exception Class.
|
||||
# Omitting will use the default, "execution expired"
|
||||
#
|
||||
# Returns the result of the block *if* the block completed before
|
||||
# +sec+ seconds, otherwise throws an exception, based on the value of +klass+.
|
||||
#
|
||||
# The exception thrown to terminate the given block cannot be rescued inside
|
||||
# the block unless +klass+ is given explicitly. However, the block can use
|
||||
# ensure to prevent the handling of the exception. For that reason, this
|
||||
# method cannot be relied on to enforce timeouts for untrusted blocks.
|
||||
#
|
||||
# If a scheduler is defined, it will be used to handle the timeout by invoking
|
||||
# Scheduler#timeout_after.
|
||||
#
|
||||
# Note that this is both a method of module Timeout, so you can <tt>include
|
||||
# Timeout</tt> into your classes so they have a #timeout method, as well as
|
||||
# a module method, so you can call it directly as Timeout.timeout().
|
||||
#
|
||||
# @raise [ArgumentError]
|
||||
#
|
||||
# source://timeout//lib/timeout.rb#167
|
||||
def timeout(sec, klass = T.unsafe(nil), message = T.unsafe(nil), &block); end
|
||||
|
||||
private
|
||||
|
||||
# source://timeout//lib/timeout.rb#94
|
||||
def create_timeout_thread; end
|
||||
end
|
||||
end
|
||||
|
||||
# :stopdoc:
|
||||
#
|
||||
# source://timeout//lib/timeout.rb#47
|
||||
Timeout::CONDVAR = T.let(T.unsafe(nil), Thread::ConditionVariable)
|
||||
|
||||
# Raised by Timeout.timeout when the block times out.
|
||||
#
|
||||
# source://timeout//lib/timeout.rb#33
|
||||
class Timeout::Error < ::RuntimeError
|
||||
class << self
|
||||
# source://timeout//lib/timeout.rb#34
|
||||
def handle_timeout(message); end
|
||||
end
|
||||
end
|
||||
|
||||
# Internal error raised to when a timeout is triggered.
|
||||
#
|
||||
# source://timeout//lib/timeout.rb#26
|
||||
class Timeout::ExitException < ::Exception
|
||||
# source://timeout//lib/timeout.rb#27
|
||||
def exception(*_arg0); end
|
||||
end
|
||||
|
||||
# We keep a private reference so that time mocking libraries won't break
|
||||
# Timeout.
|
||||
#
|
||||
# source://timeout//lib/timeout.rb#136
|
||||
Timeout::GET_TIME = T.let(T.unsafe(nil), Method)
|
||||
|
||||
# source://timeout//lib/timeout.rb#48
|
||||
Timeout::QUEUE = T.let(T.unsafe(nil), Thread::Queue)
|
||||
|
||||
# source://timeout//lib/timeout.rb#49
|
||||
Timeout::QUEUE_MUTEX = T.let(T.unsafe(nil), Thread::Mutex)
|
||||
|
||||
# source://timeout//lib/timeout.rb#54
|
||||
class Timeout::Request
|
||||
# @return [Request] a new instance of Request
|
||||
#
|
||||
# source://timeout//lib/timeout.rb#57
|
||||
def initialize(thread, timeout, exception_class, message); end
|
||||
|
||||
# Returns the value of attribute deadline.
|
||||
#
|
||||
# source://timeout//lib/timeout.rb#55
|
||||
def deadline; end
|
||||
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://timeout//lib/timeout.rb#67
|
||||
def done?; end
|
||||
|
||||
# @return [Boolean]
|
||||
#
|
||||
# source://timeout//lib/timeout.rb#73
|
||||
def expired?(now); end
|
||||
|
||||
# source://timeout//lib/timeout.rb#86
|
||||
def finished; end
|
||||
|
||||
# source://timeout//lib/timeout.rb#77
|
||||
def interrupt; end
|
||||
end
|
||||
|
||||
# source://timeout//lib/timeout.rb#50
|
||||
Timeout::TIMEOUT_THREAD_MUTEX = T.let(T.unsafe(nil), Thread::Mutex)
|
||||
|
||||
# The version
|
||||
#
|
||||
# source://timeout//lib/timeout.rb#23
|
||||
Timeout::VERSION = T.let(T.unsafe(nil), String)
|
||||
9
sorbet/rbi/gems/tzinfo@2.0.6.rbi
generated
Normal file
9
sorbet/rbi/gems/tzinfo@2.0.6.rbi
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `tzinfo` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem tzinfo`.
|
||||
|
||||
|
||||
# THIS IS AN EMPTY RBI FILE.
|
||||
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
|
||||
435
sorbet/rbi/gems/yard-sorbet@0.9.0.rbi
generated
Normal file
435
sorbet/rbi/gems/yard-sorbet@0.9.0.rbi
generated
Normal file
@@ -0,0 +1,435 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `yard-sorbet` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem yard-sorbet`.
|
||||
|
||||
|
||||
class YARD::Handlers::Ruby::ClassHandler < ::YARD::Handlers::Ruby::Base
|
||||
include ::YARDSorbet::Handlers::StructClassHandler
|
||||
end
|
||||
|
||||
# Types are documentation
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/version.rb#5
|
||||
module YARDSorbet; end
|
||||
|
||||
# Extract & re-add directives to a docstring
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/directives.rb#6
|
||||
module YARDSorbet::Directives
|
||||
class << self
|
||||
# source://yard-sorbet//lib/yard-sorbet/directives.rb#21
|
||||
sig { params(docstring: ::String, directives: T::Array[::String]).void }
|
||||
def add_directives(docstring, directives); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/directives.rb#10
|
||||
sig { params(docstring: T.nilable(::String)).returns([::YARD::Docstring, T::Array[::String]]) }
|
||||
def extract_directives(docstring); end
|
||||
end
|
||||
end
|
||||
|
||||
# Custom YARD Handlers
|
||||
#
|
||||
# @see https://rubydoc.info/gems/yard/YARD/Handlers/Base YARD Base Handler documentation
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers.rb#7
|
||||
module YARDSorbet::Handlers; end
|
||||
|
||||
# Applies an `@abstract` tag to `abstract!`/`interface!` modules (if not alerady present).
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/abstract_dsl_handler.rb#7
|
||||
class YARDSorbet::Handlers::AbstractDSLHandler < ::YARD::Handlers::Ruby::Base
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/abstract_dsl_handler.rb#21
|
||||
sig { void }
|
||||
def process; end
|
||||
end
|
||||
|
||||
# Extra text for class namespaces
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/abstract_dsl_handler.rb#18
|
||||
YARDSorbet::Handlers::AbstractDSLHandler::CLASS_TAG_TEXT = T.let(T.unsafe(nil), String)
|
||||
|
||||
# The text accompanying the `@abstract` tag.
|
||||
#
|
||||
# @see https://github.com/lsegal/yard/blob/main/templates/default/docstring/html/abstract.erb The `@abstract` tag template
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/abstract_dsl_handler.rb#16
|
||||
YARDSorbet::Handlers::AbstractDSLHandler::TAG_TEXT = T.let(T.unsafe(nil), String)
|
||||
|
||||
# Handle `enums` calls, registering enum values as constants
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/enums_handler.rb#7
|
||||
class YARDSorbet::Handlers::EnumsHandler < ::YARD::Handlers::Ruby::Base
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/enums_handler.rb#14
|
||||
sig { void }
|
||||
def process; end
|
||||
|
||||
private
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/enums_handler.rb#29
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Boolean) }
|
||||
def const_assign_node?(node); end
|
||||
end
|
||||
|
||||
# Extends any modules included via `mixes_in_class_methods`
|
||||
#
|
||||
# @see https://sorbet.org/docs/abstract#interfaces-and-the-included-hook Sorbet `mixes_in_class_methods` documentation
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/include_handler.rb#9
|
||||
class YARDSorbet::Handlers::IncludeHandler < ::YARD::Handlers::Ruby::Base
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/include_handler.rb#16
|
||||
sig { void }
|
||||
def process; end
|
||||
|
||||
private
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/include_handler.rb#28
|
||||
sig { returns(::YARD::CodeObjects::NamespaceObject) }
|
||||
def included_in; end
|
||||
end
|
||||
|
||||
# Tracks modules that invoke `mixes_in_class_methods` for use in {IncludeHandler}
|
||||
#
|
||||
# @see https://sorbet.org/docs/abstract#interfaces-and-the-included-hook Sorbet `mixes_in_class_methods` documentation
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/mixes_in_class_methods_handler.rb#9
|
||||
class YARDSorbet::Handlers::MixesInClassMethodsHandler < ::YARD::Handlers::Ruby::Base
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/mixes_in_class_methods_handler.rb#21
|
||||
sig { void }
|
||||
def process; end
|
||||
|
||||
class << self
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/mixes_in_class_methods_handler.rb#18
|
||||
sig { params(code_obj: ::String).returns(T.nilable(T::Array[::String])) }
|
||||
def mixed_in_class_methods(code_obj); end
|
||||
end
|
||||
end
|
||||
|
||||
# A YARD Handler for Sorbet type declarations
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#7
|
||||
class YARDSorbet::Handlers::SigHandler < ::YARD::Handlers::Ruby::Base
|
||||
# Swap the method definition docstring and the sig docstring.
|
||||
# Parse relevant parts of the `sig` and include them as well.
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#24
|
||||
sig { void }
|
||||
def process; end
|
||||
|
||||
private
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#73
|
||||
sig { params(method_objects: T::Array[::YARD::CodeObjects::MethodObject]).void }
|
||||
def document_attrs(method_objects); end
|
||||
|
||||
# An attr* sig can be merged into a previous attr* docstring if it is the only parameter passed to the attr*
|
||||
# declaration. This is to avoid needing to rewrite the source code to separate merged and unmerged attr*
|
||||
# declarations.
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#60
|
||||
sig { params(attr_node: ::YARD::Parser::Ruby::MethodCallNode).returns(T::Boolean) }
|
||||
def merged_into_attr?(attr_node); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#76
|
||||
sig do
|
||||
params(
|
||||
attach_to: T.any(::YARD::CodeObjects::MethodObject, ::YARD::Parser::Ruby::MethodCallNode, ::YARD::Parser::Ruby::MethodDefinitionNode),
|
||||
docstring: T.nilable(::String),
|
||||
include_params: T::Boolean
|
||||
).void
|
||||
end
|
||||
def parse_node(attach_to, docstring, include_params: T.unsafe(nil)); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#97
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode, docstring: ::YARD::Docstring).void }
|
||||
def parse_params(node, docstring); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#107
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode, docstring: ::YARD::Docstring).void }
|
||||
def parse_return(node, docstring); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#85
|
||||
sig { params(docstring: ::YARD::Docstring, include_params: T::Boolean).void }
|
||||
def parse_sig(docstring, include_params: T.unsafe(nil)); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#50
|
||||
sig { params(attr_node: ::YARD::Parser::Ruby::MethodCallNode).void }
|
||||
def process_attr(attr_node); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#36
|
||||
sig { params(def_node: ::YARD::Parser::Ruby::MethodDefinitionNode).void }
|
||||
def process_def(def_node); end
|
||||
end
|
||||
|
||||
# YARD types that can have docstrings attached to them
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#14
|
||||
YARDSorbet::Handlers::SigHandler::Documentable = T.type_alias { T.any(::YARD::CodeObjects::MethodObject, ::YARD::Parser::Ruby::MethodCallNode, ::YARD::Parser::Ruby::MethodDefinitionNode) }
|
||||
|
||||
# Class-level handler that folds all `const` and `prop` declarations into the constructor documentation
|
||||
# this needs to be injected as a module otherwise the default Class handler will overwrite documentation
|
||||
#
|
||||
# @note this module is included in `YARD::Handlers::Ruby::ClassHandler`
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/struct_class_handler.rb#10
|
||||
module YARDSorbet::Handlers::StructClassHandler
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/struct_class_handler.rb#14
|
||||
sig { void }
|
||||
def process; end
|
||||
|
||||
private
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/struct_class_handler.rb#50
|
||||
sig do
|
||||
params(
|
||||
object: ::YARD::CodeObjects::MethodObject,
|
||||
props: T::Array[::YARDSorbet::TStructProp],
|
||||
docstring: ::YARD::Docstring,
|
||||
directives: T::Array[::String]
|
||||
).void
|
||||
end
|
||||
def decorate_t_struct_init(object, props, docstring, directives); end
|
||||
|
||||
# Create a virtual `initialize` method with all the `prop`/`const` arguments
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/struct_class_handler.rb#30
|
||||
sig { params(props: T::Array[::YARDSorbet::TStructProp], class_ns: ::YARD::CodeObjects::ClassObject).void }
|
||||
def process_t_struct_props(props, class_ns); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/struct_class_handler.rb#60
|
||||
sig { params(props: T::Array[::YARDSorbet::TStructProp]).returns(T::Array[[::String, T.nilable(::String)]]) }
|
||||
def to_object_parameters(props); end
|
||||
end
|
||||
|
||||
# Handles all `const`/`prop` calls, creating accessor methods, and compiles them for later usage at the class level
|
||||
# in creating a constructor
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#8
|
||||
class YARDSorbet::Handlers::StructPropHandler < ::YARD::Handlers::Ruby::Base
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#15
|
||||
sig { void }
|
||||
def process; end
|
||||
|
||||
private
|
||||
|
||||
# Add the source and docstring to the method object
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#28
|
||||
sig { params(object: ::YARD::CodeObjects::MethodObject, prop: ::YARDSorbet::TStructProp).void }
|
||||
def decorate_object(object, prop); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#38
|
||||
sig { returns(T::Boolean) }
|
||||
def immutable?; end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#42
|
||||
sig { params(kwd: ::String).returns(T.nilable(::String)) }
|
||||
def kw_arg(kwd); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#45
|
||||
sig { params(name: ::String).returns(::YARDSorbet::TStructProp) }
|
||||
def make_prop(name); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#56
|
||||
sig { returns(T::Array[::YARD::Parser::Ruby::AstNode]) }
|
||||
def params; end
|
||||
|
||||
# Register the field explicitly as an attribute.
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#60
|
||||
sig { params(object: ::YARD::CodeObjects::MethodObject, name: ::String).void }
|
||||
def register_attrs(object, name); end
|
||||
|
||||
# Store the prop for use in the constructor definition
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#68
|
||||
sig { params(prop: ::YARDSorbet::TStructProp).void }
|
||||
def update_state(prop); end
|
||||
end
|
||||
|
||||
# Helper methods for working with `YARD` AST Nodes
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/node_utils.rb#6
|
||||
module YARDSorbet::NodeUtils
|
||||
class << self
|
||||
# Traverse AST nodes in breadth-first order
|
||||
#
|
||||
# @note This will skip over some node types.
|
||||
# @yield [YARD::Parser::Ruby::AstNode]
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/node_utils.rb#21
|
||||
sig do
|
||||
params(
|
||||
node: ::YARD::Parser::Ruby::AstNode,
|
||||
_blk: T.proc.params(n: ::YARD::Parser::Ruby::AstNode).void
|
||||
).void
|
||||
end
|
||||
def bfs_traverse(node, &_blk); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/node_utils.rb#31
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode).void }
|
||||
def delete_node(node); end
|
||||
|
||||
# Enqueue the eligible children of a node in the BFS queue
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/node_utils.rb#35
|
||||
sig { params(queue: ::Thread::Queue, node: ::YARD::Parser::Ruby::AstNode).void }
|
||||
def enqueue_children(queue, node); end
|
||||
|
||||
# Gets the node that a sorbet `sig` can be attached do, bypassing visisbility modifiers and the like
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/node_utils.rb#48
|
||||
sig do
|
||||
params(
|
||||
node: ::YARD::Parser::Ruby::AstNode
|
||||
).returns(T.any(::YARD::Parser::Ruby::MethodCallNode, ::YARD::Parser::Ruby::MethodDefinitionNode))
|
||||
end
|
||||
def get_method_node(node); end
|
||||
|
||||
# Find and return the adjacent node (ascending)
|
||||
#
|
||||
# @raise [IndexError] if the node does not have an adjacent sibling (ascending)
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/node_utils.rb#53
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(::YARD::Parser::Ruby::AstNode) }
|
||||
def sibling_node(node); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/node_utils.rb#60
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Boolean) }
|
||||
def sigable_node?(node); end
|
||||
|
||||
# @see https://github.com/lsegal/yard/blob/main/lib/yard/handlers/ruby/attribute_handler.rb YARD::Handlers::Ruby::AttributeHandler.validated_attribute_names
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/node_utils.rb#71
|
||||
sig { params(attr_node: ::YARD::Parser::Ruby::MethodCallNode).returns(T::Array[::String]) }
|
||||
def validated_attribute_names(attr_node); end
|
||||
end
|
||||
end
|
||||
|
||||
# Command node types that can have type signatures
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/node_utils.rb#10
|
||||
YARDSorbet::NodeUtils::ATTRIBUTE_METHODS = T.let(T.unsafe(nil), Array)
|
||||
|
||||
# Skip these method contents during BFS node traversal, they can have their own nested types via `T.Proc`
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/node_utils.rb#12
|
||||
YARDSorbet::NodeUtils::SKIP_METHOD_CONTENTS = T.let(T.unsafe(nil), Array)
|
||||
|
||||
# Node types that can have type signatures
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/node_utils.rb#14
|
||||
YARDSorbet::NodeUtils::SigableNode = T.type_alias { T.any(::YARD::Parser::Ruby::MethodCallNode, ::YARD::Parser::Ruby::MethodDefinitionNode) }
|
||||
|
||||
# Translate `sig` type syntax to `YARD` type syntax.
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#6
|
||||
module YARDSorbet::SigToYARD
|
||||
class << self
|
||||
# @see https://yardoc.org/types.html
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#23
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Array[::String]) }
|
||||
def convert(node); end
|
||||
|
||||
private
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#58
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(::String) }
|
||||
def build_generic_type(node); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#67
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Array[::String]) }
|
||||
def convert_aref(node); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#79
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns([::String]) }
|
||||
def convert_array(node); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#87
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns([::String]) }
|
||||
def convert_collection(node); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#94
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns([::String]) }
|
||||
def convert_hash(node); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#102
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Array[::String]) }
|
||||
def convert_list(node); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#28
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Array[::String]) }
|
||||
def convert_node(node); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#40
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Array[::String]) }
|
||||
def convert_node_type(node); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#107
|
||||
sig { params(node: ::YARD::Parser::Ruby::MethodCallNode).returns(T::Array[::String]) }
|
||||
def convert_t_method(node); end
|
||||
|
||||
# source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#118
|
||||
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns([::String]) }
|
||||
def convert_unknown(node); end
|
||||
end
|
||||
end
|
||||
|
||||
# Used to store the details of a `T::Struct` `prop` definition
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/t_struct_prop.rb#6
|
||||
class YARDSorbet::TStructProp < ::T::Struct
|
||||
const :default, T.nilable(::String)
|
||||
const :doc, ::String
|
||||
const :prop_name, ::String
|
||||
const :source, ::String
|
||||
const :types, T::Array[::String]
|
||||
|
||||
class << self
|
||||
# source://sorbet-runtime/0.5.12222/lib/types/struct.rb#13
|
||||
def inherited(s); end
|
||||
end
|
||||
end
|
||||
|
||||
# Helper methods for working with `YARD` tags
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/tag_utils.rb#6
|
||||
module YARDSorbet::TagUtils
|
||||
class << self
|
||||
# source://yard-sorbet//lib/yard-sorbet/tag_utils.rb#16
|
||||
sig do
|
||||
params(
|
||||
docstring: ::YARD::Docstring,
|
||||
tag_name: ::String,
|
||||
name: T.nilable(::String)
|
||||
).returns(T.nilable(::YARD::Tags::Tag))
|
||||
end
|
||||
def find_tag(docstring, tag_name, name); end
|
||||
|
||||
# Create or update a `YARD` tag with type information
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/tag_utils.rb#28
|
||||
sig do
|
||||
params(
|
||||
docstring: ::YARD::Docstring,
|
||||
tag_name: ::String,
|
||||
types: T.nilable(T::Array[::String]),
|
||||
name: T.nilable(::String),
|
||||
text: ::String
|
||||
).void
|
||||
end
|
||||
def upsert_tag(docstring, tag_name, types = T.unsafe(nil), name = T.unsafe(nil), text = T.unsafe(nil)); end
|
||||
end
|
||||
end
|
||||
|
||||
# The `void` return type, as a constant to reduce array allocations
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/tag_utils.rb#10
|
||||
YARDSorbet::TagUtils::VOID_RETURN_TYPE = T.let(T.unsafe(nil), Array)
|
||||
|
||||
# {https://rubygems.org/gems/yard-sorbet Version history}
|
||||
#
|
||||
# source://yard-sorbet//lib/yard-sorbet/version.rb#7
|
||||
YARDSorbet::VERSION = T.let(T.unsafe(nil), String)
|
||||
18379
sorbet/rbi/gems/yard@0.9.37.rbi
generated
Normal file
18379
sorbet/rbi/gems/yard@0.9.37.rbi
generated
Normal file
File diff suppressed because it is too large
Load Diff
24
sorbet/rbi/sorbet-typed/lib/rspec-core/all/rspec-core.rbi
Normal file
24
sorbet/rbi/sorbet-typed/lib/rspec-core/all/rspec-core.rbi
Normal file
@@ -0,0 +1,24 @@
|
||||
# This file is autogenerated. Do not edit it by hand. Regenerate it with:
|
||||
# srb rbi sorbet-typed
|
||||
#
|
||||
# If you would like to make changes to this file, great! Please upstream any changes you make here:
|
||||
#
|
||||
# https://github.com/sorbet/sorbet-typed/edit/master/lib/rspec-core/all/rspec-core.rbi
|
||||
#
|
||||
# typed: true
|
||||
|
||||
module RSpec::Core::ShellEscape
|
||||
def conditionally_quote(id); end
|
||||
def escape(shell_command); end
|
||||
def quote(argument); end
|
||||
def self.conditionally_quote(id); end
|
||||
def self.escape(shell_command); end
|
||||
def self.quote(argument); end
|
||||
def self.shell_allows_unquoted_ids?; end
|
||||
def shell_allows_unquoted_ids?; end
|
||||
end
|
||||
class RSpec::Core::RakeTask < ::Rake::TaskLib
|
||||
include ::Rake::DSL
|
||||
include RSpec::Core::ShellEscape
|
||||
def initialize(*args, &task_block); end
|
||||
end
|
||||
35
sorbet/rbi/sorbet-typed/lib/yard/all/yard.rbi
Normal file
35
sorbet/rbi/sorbet-typed/lib/yard/all/yard.rbi
Normal file
@@ -0,0 +1,35 @@
|
||||
# This file is autogenerated. Do not edit it by hand. Regenerate it with:
|
||||
# srb rbi sorbet-typed
|
||||
#
|
||||
# If you would like to make changes to this file, great! Please upstream any changes you make here:
|
||||
#
|
||||
# https://github.com/sorbet/sorbet-typed/edit/master/lib/yard/all/yard.rbi
|
||||
#
|
||||
# typed: true
|
||||
|
||||
sig { returns(YARD::Logger) }
|
||||
def log; end
|
||||
|
||||
class YARD::CodeObjects::Base
|
||||
def initialize(namespace, name, *arg2); end
|
||||
end
|
||||
class YARD::CodeObjects::NamespaceObject < YARD::CodeObjects::Base
|
||||
def mixins(*scopes); end
|
||||
end
|
||||
class YARD::CodeObjects::ClassObject < YARD::CodeObjects::NamespaceObject
|
||||
end
|
||||
class YARD::CodeObjects::ConstantObject < YARD::CodeObjects::Base
|
||||
end
|
||||
class YARD::CodeObjects::Proxy
|
||||
def initialize(namespace, name, type = nil); end
|
||||
end
|
||||
class YARD::Handlers::Base
|
||||
def handlers; end
|
||||
def self.handlers; end
|
||||
end
|
||||
class YARD::Handlers::Ruby::Base < YARD::Handlers::Base
|
||||
end
|
||||
class YARD::Handlers::Ruby::AttributeHandler < YARD::Handlers::Ruby::Base
|
||||
end
|
||||
class YARD::Handlers::Ruby::MethodHandler < YARD::Handlers::Ruby::Base
|
||||
end
|
||||
16
sorbet/rbi/todo.rbi
Normal file
16
sorbet/rbi/todo.rbi
Normal file
@@ -0,0 +1,16 @@
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for unresolved constants.
|
||||
# Please instead update this file by running `bin/tapioca todo`.
|
||||
|
||||
# typed: false
|
||||
|
||||
module ::DateAndTime::Calculations; end
|
||||
module ::DateAndTime::Zones; end
|
||||
module ActiveModel::Error; end
|
||||
module ActiveRecord::ConnectionAdapters::DatabaseStatements; end
|
||||
module ActiveRecord::ConnectionAdapters::SchemaStatements; end
|
||||
module ActiveSupport::ArrayInquirer; end
|
||||
module ActiveSupport::Multibyte::Chars; end
|
||||
module ActiveSupport::SafeBuffer; end
|
||||
module ActiveSupport::StringInquirer; end
|
||||
module ActiveSupport::TimeZone; end
|
||||
13
sorbet/tapioca/config.yml
Normal file
13
sorbet/tapioca/config.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
gem:
|
||||
# Add your `gem` command parameters here:
|
||||
#
|
||||
# exclude:
|
||||
# - gem_name
|
||||
# doc: true
|
||||
# workers: 5
|
||||
dsl:
|
||||
# Add your `dsl` command parameters here:
|
||||
#
|
||||
# exclude:
|
||||
# - SomeGeneratorName
|
||||
# workers: 5
|
||||
4
sorbet/tapioca/require.rb
Normal file
4
sorbet/tapioca/require.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Add your extra requires here (`bin/tapioca require` can be used to bootstrap this list)
|
||||
Reference in New Issue
Block a user