mirror of
https://github.com/TracksApp/tracks.git
synced 2025-09-22 05:50:47 +02:00
initialize the sorbet type signatures
This commit is contained in:
parent
4e349b59d0
commit
8b8db1ef7c
22 changed files with 142249 additions and 0 deletions
2
sorbet/config
Normal file
2
sorbet/config
Normal file
|
@ -0,0 +1,2 @@
|
|||
--dir
|
||||
.
|
46714
sorbet/rbi/hidden-definitions/errors.txt
Normal file
46714
sorbet/rbi/hidden-definitions/errors.txt
Normal file
File diff suppressed because it is too large
Load diff
76442
sorbet/rbi/hidden-definitions/hidden.rbi
Normal file
76442
sorbet/rbi/hidden-definitions/hidden.rbi
Normal file
File diff suppressed because it is too large
Load diff
76
sorbet/rbi/sorbet-typed/lib/aasm/all/aasm.rbi
Normal file
76
sorbet/rbi/sorbet-typed/lib/aasm/all/aasm.rbi
Normal file
|
@ -0,0 +1,76 @@
|
|||
# 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/aasm/all/aasm.rbi
|
||||
#
|
||||
# typed: strong
|
||||
|
||||
module AASM
|
||||
mixes_in_class_methods(AASM::ClassMethods)
|
||||
end
|
||||
|
||||
module AASM::ClassMethods
|
||||
sig do
|
||||
params(
|
||||
name: Symbol,
|
||||
before_enter: T.nilable(Symbol),
|
||||
initial: T.nilable(T::Boolean)
|
||||
).void
|
||||
end
|
||||
def state(
|
||||
name,
|
||||
before_enter: nil,
|
||||
initial: nil
|
||||
)
|
||||
end
|
||||
|
||||
sig do
|
||||
params(
|
||||
name: Symbol,
|
||||
after_commit: T.nilable(Symbol),
|
||||
guard: T.nilable(Symbol)
|
||||
).void
|
||||
end
|
||||
def event(
|
||||
name,
|
||||
after_commit: nil,
|
||||
guard: nil
|
||||
)
|
||||
end
|
||||
|
||||
sig do
|
||||
params(
|
||||
from: T.any(T.nilable(Symbol), T::Array[Symbol]),
|
||||
to: T.nilable(Symbol),
|
||||
guard: T.nilable(Symbol)
|
||||
).void
|
||||
end
|
||||
def transitions(
|
||||
from: nil,
|
||||
to: nil,
|
||||
guard: nil
|
||||
)
|
||||
end
|
||||
|
||||
sig do
|
||||
params(
|
||||
name: Symbol
|
||||
).void
|
||||
end
|
||||
def before(
|
||||
name
|
||||
)
|
||||
end
|
||||
|
||||
sig do
|
||||
params(
|
||||
name: Symbol
|
||||
).void
|
||||
end
|
||||
def after(
|
||||
name
|
||||
)
|
||||
end
|
||||
end
|
|
@ -0,0 +1,13 @@
|
|||
# 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/actionmailer/all/actionmailer.rbi
|
||||
#
|
||||
# typed: strong
|
||||
|
||||
class ActionMailer::Base
|
||||
sig { params(headers: T.untyped).returns(Mail::Message) }
|
||||
def mail(headers = nil, &block); end
|
||||
end
|
855
sorbet/rbi/sorbet-typed/lib/actionpack/all/actionpack.rbi
Normal file
855
sorbet/rbi/sorbet-typed/lib/actionpack/all/actionpack.rbi
Normal file
|
@ -0,0 +1,855 @@
|
|||
# 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/actionpack/all/actionpack.rbi
|
||||
#
|
||||
# typed: strong
|
||||
|
||||
class ActionController::Base < ActionController::Metal
|
||||
end
|
||||
|
||||
class AbstractController::Base < Object
|
||||
end
|
||||
|
||||
class ActionController::Metal < AbstractController::Base
|
||||
sig { returns(ActionDispatch::Request) }
|
||||
def request(); end
|
||||
|
||||
sig { returns(ActionDispatch::Response) }
|
||||
def response(); end
|
||||
|
||||
sig { returns(ActionController::Parameters) }
|
||||
def params(); end
|
||||
end
|
||||
|
||||
module ActionDispatch::Http::Parameters
|
||||
sig { returns(ActionController::Parameters) }
|
||||
def parameters(); end
|
||||
|
||||
# params is an alias of parameters
|
||||
sig { returns(ActionController::Parameters) }
|
||||
def params(); end
|
||||
end
|
||||
|
||||
class ActionDispatch::Request
|
||||
end
|
||||
|
||||
class ActionDispatch::Response
|
||||
end
|
||||
|
||||
class ActionController::Parameters
|
||||
sig { params(other: ActionController::Parameters).returns(T::Boolean) }
|
||||
def ==(other); end
|
||||
|
||||
sig { params(key: T.any(String, Symbol)).returns(T.untyped) }
|
||||
def [](key); end
|
||||
|
||||
sig { params(key: T.any(String, Symbol), value: T.untyped).void }
|
||||
def []=(key, value); end
|
||||
|
||||
sig { returns(T.nilable(T::Array[T.any(String, Symbol)])) }
|
||||
def always_permitted_parameters; end
|
||||
|
||||
sig { params(obj: T.nilable(T::Array[T.any(String, Symbol)])).void }
|
||||
def always_permitted_parameters=(obj); end
|
||||
|
||||
sig { params(options: T.untyped).returns(T.untyped) }
|
||||
def as_json(options = nil); end
|
||||
|
||||
sig { returns(T.untyped) }
|
||||
def deep_dup; end
|
||||
|
||||
sig { params(key: T.any(String, Symbol), block: T.untyped).returns(T.untyped) }
|
||||
def delete(key, &block); end
|
||||
|
||||
sig { params(keys: T.any(String, Symbol)).returns(T.untyped) }
|
||||
def dig(*keys); end
|
||||
|
||||
sig { params(block: T.untyped).returns(T.untyped) }
|
||||
def each_pair(&block); end
|
||||
|
||||
# each is an alias of each_pair
|
||||
sig { params(block: T.untyped).returns(T.untyped) }
|
||||
def each(&block); end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def empty?; end
|
||||
|
||||
sig { params(keys: T.any(String, Symbol)).returns(ActionController::Parameters) }
|
||||
def except(*keys); end
|
||||
|
||||
sig { params(keys: T.any(String, Symbol)).returns(T.untyped) }
|
||||
def extract!(*keys); end
|
||||
|
||||
sig { params(key: T.any(String, Symbol), args: T.untyped).returns(T.untyped) }
|
||||
def fetch(key, *args); end
|
||||
|
||||
sig { params(key: T.any(String, Symbol)).returns(T::Boolean) }
|
||||
def has_key?(key); end
|
||||
|
||||
sig { params(value: T.untyped).returns(T::Boolean) }
|
||||
def has_value?(value); end
|
||||
|
||||
sig { params(key: T.any(String, Symbol)).returns(T::Boolean) }
|
||||
def include?(key); end
|
||||
|
||||
sig { params(parameters: T.untyped).void }
|
||||
def initialize(parameters = nil); end
|
||||
|
||||
sig { returns(String) }
|
||||
def inspect; end
|
||||
|
||||
sig { params(key: T.any(String, Symbol)).returns(T::Boolean) }
|
||||
def key?(key); end
|
||||
|
||||
sig { returns(T::Array[T.untyped]) }
|
||||
def keys; end
|
||||
|
||||
sig { params(other_hash: T.untyped).returns(ActionController::Parameters) }
|
||||
def merge!(other_hash); end
|
||||
|
||||
sig { params(other_hash: T.untyped).returns(ActionController::Parameters) }
|
||||
def merge(other_hash); end
|
||||
|
||||
sig { returns(T.untyped) }
|
||||
def parameters; end
|
||||
|
||||
sig { returns(T.self_type) }
|
||||
def permit!; end
|
||||
|
||||
# You can pass _a lot_ of stuff to permit, so filters is left untyped for now.
|
||||
sig { params(filters: T.untyped).returns(ActionController::Parameters) }
|
||||
def permit(*filters); end
|
||||
|
||||
sig { params(new_permitted: T.untyped).void }
|
||||
def permitted=(new_permitted); end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def permitted?; end
|
||||
|
||||
sig { params(block: T.untyped).returns(T.untyped) }
|
||||
def reject!(&block); end
|
||||
|
||||
# delete_if is an alias of reject!
|
||||
sig { params(block: T.untyped).returns(T.untyped) }
|
||||
def delete_if(&block); end
|
||||
|
||||
sig { params(block: T.untyped).returns(T.untyped) }
|
||||
def reject(&block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
key: T.any(String, Symbol),
|
||||
).returns(
|
||||
T.nilable(
|
||||
T.any(
|
||||
String,
|
||||
Numeric,
|
||||
ActionController::Parameters,
|
||||
),
|
||||
),
|
||||
)
|
||||
end
|
||||
def [](key); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
key: T.any(
|
||||
String,
|
||||
Symbol,
|
||||
T::Array[T.any(String, Symbol)],
|
||||
),
|
||||
).returns(
|
||||
T.any(
|
||||
String,
|
||||
Numeric,
|
||||
T::Array[T.untyped],
|
||||
ActionController::Parameters,
|
||||
),
|
||||
)
|
||||
end
|
||||
def require(key); end
|
||||
|
||||
# required is an alias of require
|
||||
sig do
|
||||
params(
|
||||
key: T.any(
|
||||
String,
|
||||
Symbol,
|
||||
T::Array[T.any(String, Symbol)],
|
||||
),
|
||||
).returns(
|
||||
T.any(
|
||||
String,
|
||||
Numeric,
|
||||
T::Array[T.untyped],
|
||||
ActionController::Parameters,
|
||||
),
|
||||
)
|
||||
end
|
||||
def required(key); end
|
||||
|
||||
sig { params(other_hash: T.untyped).returns(ActionController::Parameters) }
|
||||
def reverse_merge!(other_hash); end
|
||||
|
||||
# with_defaults! is an alias of reverse_merge!
|
||||
sig { params(other_hash: T.untyped).returns(ActionController::Parameters) }
|
||||
def with_defaults!(other_hash); end
|
||||
|
||||
sig { params(other_hash: T.untyped).returns(ActionController::Parameters) }
|
||||
def reverse_merge(other_hash); end
|
||||
|
||||
# with_defaults is an alias of reverse_merge
|
||||
sig { params(other_hash: T.untyped).returns(ActionController::Parameters) }
|
||||
def with_defaults(other_hash); end
|
||||
|
||||
sig { params(block: T.untyped).returns(T.nilable(ActionController::Parameters)) }
|
||||
def select!(&block); end
|
||||
|
||||
# keep_if is an alias of select!
|
||||
sig { params(block: T.untyped).returns(T.nilable(ActionController::Parameters)) }
|
||||
def keep_if(&block); end
|
||||
|
||||
sig { params(block: T.untyped).returns(ActionController::Parameters) }
|
||||
def select(&block); end
|
||||
|
||||
sig { returns(T.any(Symbol, T::Boolean)) }
|
||||
def self.action_on_unpermitted_parameters; end
|
||||
|
||||
sig { params(obj: T.any(Symbol, T::Boolean)).void }
|
||||
def self.action_on_unpermitted_parameters=(obj); end
|
||||
|
||||
sig { returns(T::Array[T.any(String, Symbol)]) }
|
||||
def self.always_permitted_parameters; end
|
||||
|
||||
sig { params(obj: T::Array[T.any(String, Symbol)]).void }
|
||||
def self.always_permitted_parameters=(obj); end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def self.permit_all_parameters; end
|
||||
|
||||
sig { params(obj: T::Boolean).void }
|
||||
def self.permit_all_parameters=(obj); end
|
||||
|
||||
sig { params(keys: T.any(String, Symbol)).returns(ActionController::Parameters) }
|
||||
def slice!(*keys); end
|
||||
|
||||
sig { params(keys: T.any(String, Symbol)).returns(ActionController::Parameters) }
|
||||
def slice(*keys); end
|
||||
|
||||
sig { returns(ActiveSupport::HashWithIndifferentAccess) }
|
||||
def to_h; end
|
||||
|
||||
sig { returns(T::Hash[T.untyped, T.untyped]) }
|
||||
def to_hash; end
|
||||
|
||||
# to_param is an alias of to_query
|
||||
sig { params(args: String).returns(T.nilable(String)) }
|
||||
def to_param(*args); end
|
||||
|
||||
sig { params(args: String).returns(T.nilable(String)) }
|
||||
def to_query(*args); end
|
||||
|
||||
sig { returns(String) }
|
||||
def to_s; end
|
||||
|
||||
sig { returns(ActiveSupport::HashWithIndifferentAccess) }
|
||||
def to_unsafe_h; end
|
||||
|
||||
# to_unsafe_hash is an alias of to_unsafe_h
|
||||
sig { returns(ActiveSupport::HashWithIndifferentAccess) }
|
||||
def to_unsafe_hash; end
|
||||
|
||||
sig { params(block: T.untyped).returns(ActionController::Parameters) }
|
||||
def transform_keys!(&block); end
|
||||
|
||||
sig { params(block: T.untyped).returns(ActionController::Parameters) }
|
||||
def transform_keys(&block); end
|
||||
|
||||
sig { returns(ActionController::Parameters) }
|
||||
def transform_values!; end
|
||||
|
||||
sig { returns(ActionController::Parameters) }
|
||||
def transform_values; end
|
||||
|
||||
sig { params(value: T.untyped).returns(T::Boolean) }
|
||||
def value?(value); end
|
||||
|
||||
sig { returns(T::Array[T.untyped]) }
|
||||
def values; end
|
||||
|
||||
sig { params(keys: T.any(String, Symbol)).returns(T.untyped) }
|
||||
def values_at(*keys); end
|
||||
end
|
||||
|
||||
module ActionController::StrongParameters
|
||||
sig { returns(ActionController::Parameters) }
|
||||
def params; end
|
||||
end
|
||||
|
||||
class ActionDispatch::Routing::RouteSet
|
||||
sig { params(blk: T.proc.bind(ActionDispatch::Routing::Mapper).void).void }
|
||||
def draw(&blk); end
|
||||
end
|
||||
|
||||
module ActionController::Flash::ClassMethods
|
||||
sig { params(types: Symbol).void }
|
||||
def add_flash_types(*types); end
|
||||
end
|
||||
|
||||
module ActionController::RequestForgeryProtection::ClassMethods
|
||||
sig do
|
||||
params(
|
||||
only: T.any(T::Array[Symbol], Symbol),
|
||||
except: T.nilable(T.any(T::Array[Symbol], Symbol)),
|
||||
if: T.untyped,
|
||||
unless: T.untyped,
|
||||
prepend: T.untyped,
|
||||
with: T.nilable(Symbol),
|
||||
exception: T.untyped,
|
||||
reset_session: T.untyped,
|
||||
null_session: T.untyped
|
||||
).void
|
||||
end
|
||||
def protect_from_forgery(
|
||||
only: nil,
|
||||
except: nil,
|
||||
if: nil,
|
||||
unless: nil,
|
||||
prepend: false,
|
||||
with: nil,
|
||||
exception: nil,
|
||||
reset_session: nil,
|
||||
null_session: nil
|
||||
); end
|
||||
end
|
||||
|
||||
module ActionDispatch::Routing::Mapper::HttpHelpers
|
||||
# get, put, patch, post, and delete all have the same arguments as
|
||||
# ActionDispatch::Routing::Mapper::Resources#match
|
||||
sig do
|
||||
params(
|
||||
name: T.any(String, Symbol, T::Hash[String, String]),
|
||||
controller: T.nilable(T.any(String, Symbol)),
|
||||
action: T.nilable(T.any(String, Symbol)),
|
||||
param: T.nilable(Symbol),
|
||||
module: T.nilable(T.any(String, Symbol)),
|
||||
as: T.nilable(T.any(String, Symbol)),
|
||||
via: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
to: T.nilable(T.any(String, T.proc.returns(T.untyped))),
|
||||
on: T.nilable(Symbol),
|
||||
constraints: T.untyped,
|
||||
defaults: T.nilable(T::Hash[T.untyped, T.untyped]),
|
||||
anchor: T::Boolean,
|
||||
format: T.nilable(T.any(String, T::Boolean)),
|
||||
path: T.nilable(T.any(String, Symbol)),
|
||||
block: T.untyped
|
||||
).returns(T.untyped)
|
||||
end
|
||||
def delete(
|
||||
name,
|
||||
controller: nil,
|
||||
action: nil,
|
||||
param: :id,
|
||||
module: nil,
|
||||
as: nil,
|
||||
via: nil,
|
||||
to: nil,
|
||||
on: nil,
|
||||
constraints: nil,
|
||||
defaults: nil,
|
||||
anchor: true,
|
||||
format: nil,
|
||||
path: nil,
|
||||
&block
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
name: T.any(String, Symbol, T::Hash[String, String]),
|
||||
controller: T.nilable(T.any(String, Symbol)),
|
||||
action: T.nilable(T.any(String, Symbol)),
|
||||
param: T.nilable(Symbol),
|
||||
module: T.nilable(T.any(String, Symbol)),
|
||||
as: T.nilable(T.any(String, Symbol)),
|
||||
via: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
to: T.nilable(T.any(String, Symbol, T.proc.returns(T.untyped))),
|
||||
on: T.nilable(Symbol),
|
||||
constraints: T.untyped,
|
||||
defaults: T.nilable(T::Hash[T.untyped, T.untyped]),
|
||||
anchor: T::Boolean,
|
||||
format: T.nilable(T.any(String, T::Boolean)),
|
||||
path: T.nilable(T.any(String, Symbol)),
|
||||
block: T.untyped
|
||||
).returns(T.untyped)
|
||||
end
|
||||
def get(
|
||||
name,
|
||||
controller: nil,
|
||||
action: nil,
|
||||
param: :id,
|
||||
module: nil,
|
||||
as: nil,
|
||||
via: nil,
|
||||
to: nil,
|
||||
on: nil,
|
||||
constraints: nil,
|
||||
defaults: nil,
|
||||
anchor: true,
|
||||
format: nil,
|
||||
path: nil,
|
||||
&block
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
name: T.any(String, Symbol, T::Hash[String, String]),
|
||||
controller: T.nilable(T.any(String, Symbol)),
|
||||
action: T.nilable(T.any(String, Symbol)),
|
||||
param: T.nilable(Symbol),
|
||||
module: T.nilable(T.any(String, Symbol)),
|
||||
as: T.nilable(T.any(String, Symbol)),
|
||||
via: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
to: T.nilable(T.any(String, T.proc.returns(T.untyped))),
|
||||
on: T.nilable(Symbol),
|
||||
constraints: T.untyped,
|
||||
defaults: T.nilable(T::Hash[T.untyped, T.untyped]),
|
||||
anchor: T::Boolean,
|
||||
format: T.nilable(T.any(String, T::Boolean)),
|
||||
path: T.nilable(T.any(String, Symbol)),
|
||||
block: T.untyped
|
||||
).returns(T.untyped)
|
||||
end
|
||||
def patch(
|
||||
name,
|
||||
controller: nil,
|
||||
action: nil,
|
||||
param: :id,
|
||||
module: nil,
|
||||
as: nil,
|
||||
via: nil,
|
||||
to: nil,
|
||||
on: nil,
|
||||
constraints: nil,
|
||||
defaults: nil,
|
||||
anchor: true,
|
||||
format: nil,
|
||||
path: nil,
|
||||
&block
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
name: T.any(String, Symbol, T::Hash[String, String]),
|
||||
controller: T.nilable(T.any(String, Symbol)),
|
||||
action: T.nilable(T.any(String, Symbol)),
|
||||
param: T.nilable(Symbol),
|
||||
module: T.nilable(T.any(String, Symbol)),
|
||||
as: T.nilable(T.any(String, Symbol)),
|
||||
via: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
to: T.nilable(T.any(String, T.proc.returns(T.untyped))),
|
||||
on: T.nilable(Symbol),
|
||||
constraints: T.untyped,
|
||||
defaults: T.nilable(T::Hash[T.untyped, T.untyped]),
|
||||
anchor: T::Boolean,
|
||||
format: T.nilable(T.any(String, T::Boolean)),
|
||||
path: T.nilable(T.any(String, Symbol)),
|
||||
block: T.untyped
|
||||
).returns(T.untyped)
|
||||
end
|
||||
def post(
|
||||
name,
|
||||
controller: nil,
|
||||
action: nil,
|
||||
param: :id,
|
||||
module: nil,
|
||||
as: nil,
|
||||
via: nil,
|
||||
to: nil,
|
||||
on: nil,
|
||||
constraints: nil,
|
||||
defaults: nil,
|
||||
anchor: true,
|
||||
format: nil,
|
||||
path: nil,
|
||||
&block
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
name: T.any(String, Symbol, T::Hash[String, String]),
|
||||
controller: T.nilable(T.any(String, Symbol)),
|
||||
action: T.nilable(T.any(String, Symbol)),
|
||||
param: T.nilable(Symbol),
|
||||
module: T.nilable(T.any(String, Symbol)),
|
||||
as: T.nilable(T.any(String, Symbol)),
|
||||
via: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
to: T.nilable(T.any(String, T.proc.returns(T.untyped))),
|
||||
on: T.nilable(Symbol),
|
||||
constraints: T.untyped,
|
||||
defaults: T.nilable(T::Hash[T.untyped, T.untyped]),
|
||||
anchor: T::Boolean,
|
||||
format: T.nilable(T.any(String, T::Boolean)),
|
||||
path: T.nilable(T.any(String, Symbol)),
|
||||
block: T.untyped
|
||||
).returns(T.untyped)
|
||||
end
|
||||
def put(
|
||||
name,
|
||||
controller: nil,
|
||||
action: nil,
|
||||
param: :id,
|
||||
module: nil,
|
||||
as: nil,
|
||||
via: nil,
|
||||
to: nil,
|
||||
on: nil,
|
||||
constraints: nil,
|
||||
defaults: nil,
|
||||
anchor: true,
|
||||
format: nil,
|
||||
path: nil,
|
||||
&block
|
||||
); end
|
||||
end
|
||||
|
||||
module ActionDispatch::Routing::Mapper::Resources
|
||||
sig { params(name: T.untyped).returns(T.untyped) }
|
||||
def action_path(name); end
|
||||
|
||||
sig { params(block: T.untyped).returns(T.untyped) }
|
||||
def collection(&block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
name: T.any(String, Symbol, T::Hash[String, String]),
|
||||
controller: T.nilable(T.any(String, Symbol)),
|
||||
action: T.nilable(T.any(String, Symbol)),
|
||||
param: T.nilable(Symbol),
|
||||
module: T.nilable(T.any(String, Symbol)),
|
||||
as: T.nilable(T.any(String, Symbol)),
|
||||
via: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
to: T.nilable(T.any(String, T.proc.returns(T.untyped))),
|
||||
on: T.nilable(Symbol),
|
||||
constraints: T.untyped,
|
||||
defaults: T.nilable(T::Hash[T.untyped, T.untyped]),
|
||||
anchor: T::Boolean,
|
||||
format: T.nilable(T.any(String, T::Boolean)),
|
||||
path: T.nilable(T.any(String, Symbol)),
|
||||
block: T.untyped
|
||||
).returns(T.untyped)
|
||||
end
|
||||
def match(
|
||||
name,
|
||||
controller: nil,
|
||||
action: nil,
|
||||
param: :id,
|
||||
module: nil,
|
||||
as: nil,
|
||||
via: nil,
|
||||
to: nil,
|
||||
on: nil,
|
||||
constraints: nil,
|
||||
defaults: nil,
|
||||
anchor: true,
|
||||
format: nil,
|
||||
path: nil,
|
||||
&block
|
||||
); end
|
||||
|
||||
sig { params(block: T.untyped).returns(T.untyped) }
|
||||
def member(&block); end
|
||||
|
||||
# These are set to T.unsafe(nil) because they do actually have values, but they
|
||||
# can't be determined statically. They take the value of path when no explicit
|
||||
# values are provided.
|
||||
sig do
|
||||
params(
|
||||
path: T.untyped,
|
||||
as: T.untyped,
|
||||
module: T.untyped,
|
||||
shallow_path: T.untyped,
|
||||
shallow_prefix: T.untyped,
|
||||
block: T.untyped
|
||||
).returns(T.untyped)
|
||||
end
|
||||
def namespace(
|
||||
path,
|
||||
as: T.unsafe(nil),
|
||||
module: T.unsafe(nil),
|
||||
shallow_path: T.unsafe(nil),
|
||||
shallow_prefix: T.unsafe(nil),
|
||||
&block
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
resources: T.any(String, Symbol),
|
||||
as: T.nilable(T.any(String, Symbol)),
|
||||
controller: T.nilable(T.any(String, Symbol)),
|
||||
concerns: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
param: T.nilable(Symbol),
|
||||
path_names: T.untyped,
|
||||
path: T.untyped,
|
||||
only: T.nilable(T.any(
|
||||
T::Array[T.any(String, Symbol)],
|
||||
String,
|
||||
Symbol
|
||||
)),
|
||||
except: T.nilable(T.any(
|
||||
T::Array[T.any(String, Symbol)],
|
||||
String,
|
||||
Symbol
|
||||
)),
|
||||
shallow: T::Boolean,
|
||||
shallow_path: T.nilable(String),
|
||||
shallow_prefix: T.nilable(String),
|
||||
format: T.untyped,
|
||||
block: T.untyped
|
||||
).returns(T.untyped)
|
||||
end
|
||||
def resource(
|
||||
*resources,
|
||||
as: nil,
|
||||
controller: nil,
|
||||
concerns: nil,
|
||||
param: nil,
|
||||
path_names: nil,
|
||||
path: nil,
|
||||
only: nil,
|
||||
except: nil,
|
||||
shallow: false,
|
||||
shallow_path: nil,
|
||||
shallow_prefix: nil,
|
||||
format: nil,
|
||||
&block
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
resources: T.any(String, Symbol),
|
||||
as: T.nilable(T.any(String, Symbol)),
|
||||
controller: T.nilable(T.any(String, Symbol)),
|
||||
concerns: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
param: T.nilable(Symbol),
|
||||
path_names: T.untyped,
|
||||
path: T.untyped,
|
||||
only: T.nilable(T.any(
|
||||
T::Array[T.any(String, Symbol)],
|
||||
String,
|
||||
Symbol
|
||||
)),
|
||||
except: T.nilable(T.any(
|
||||
T::Array[T.any(String, Symbol)],
|
||||
String,
|
||||
Symbol
|
||||
)),
|
||||
shallow: T::Boolean,
|
||||
shallow_path: T.nilable(String),
|
||||
shallow_prefix: T.nilable(String),
|
||||
format: T.untyped,
|
||||
block: T.untyped
|
||||
).returns(T.untyped)
|
||||
end
|
||||
def resources(
|
||||
*resources,
|
||||
as: nil,
|
||||
controller: nil,
|
||||
concerns: nil,
|
||||
param: nil,
|
||||
path_names: nil,
|
||||
path: nil,
|
||||
only: nil,
|
||||
except: nil,
|
||||
shallow: false,
|
||||
shallow_path: nil,
|
||||
shallow_prefix: nil,
|
||||
format: nil,
|
||||
&block
|
||||
); end
|
||||
|
||||
# Technically, path doesn't have a default value set. However, this is
|
||||
# necessary to allow code like `root to: 'home#index'`.
|
||||
sig { params(path: T.nilable(String), to: T.untyped).returns(T.untyped) }
|
||||
def root(path = T.unsafe(nil), to: nil); end
|
||||
|
||||
sig { returns(T.untyped) }
|
||||
def shallow; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def shallow?; end
|
||||
end
|
||||
|
||||
# https://api.rubyonrails.org/classes/AbstractController/Callbacks/ClassMethods.html
|
||||
module AbstractController::Callbacks::ClassMethods
|
||||
sig do
|
||||
params(
|
||||
names: Symbol,
|
||||
except: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
only: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
if: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
unless: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
block: T.nilable(T.proc.returns(T.untyped))
|
||||
).void
|
||||
end
|
||||
def after_action(*names, except: nil, only: nil, if: nil, unless: nil, &block); end
|
||||
|
||||
# append_after_action is an alias of after_action
|
||||
sig do
|
||||
params(
|
||||
names: Symbol,
|
||||
except: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
only: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
if: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
unless: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
block: T.nilable(T.proc.returns(T.untyped))
|
||||
).void
|
||||
end
|
||||
def append_after_action(*names, except: nil, only: nil, if: nil, unless: nil, &block); end
|
||||
|
||||
# append_around_action is an alias of around_action
|
||||
sig do
|
||||
params(
|
||||
names: Symbol,
|
||||
except: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
only: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
if: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
unless: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
block: T.nilable(T.proc.returns(T.untyped))
|
||||
).void
|
||||
end
|
||||
def append_around_action(*names, except: nil, only: nil, if: nil, unless: nil, &block); end
|
||||
|
||||
# append_before_action is an alias of before_action
|
||||
sig do
|
||||
params(
|
||||
names: Symbol,
|
||||
except: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
only: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
if: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
unless: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
block: T.nilable(T.proc.returns(T.untyped))
|
||||
).void
|
||||
end
|
||||
def append_before_action(*names, except: nil, only: nil, if: nil, unless: nil, &block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
names: Symbol,
|
||||
except: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
only: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
if: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
unless: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
block: T.nilable(T.proc.returns(T.untyped))
|
||||
).void
|
||||
end
|
||||
def around_action(*names, except: nil, only: nil, if: nil, unless: nil, &block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
names: Symbol,
|
||||
except: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
only: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
if: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
unless: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
block: T.nilable(T.proc.returns(T.untyped))
|
||||
).void
|
||||
end
|
||||
def before_action(*names, except: nil, only: nil, if: nil, unless: nil, &block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
names: Symbol,
|
||||
except: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
only: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
if: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
unless: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
block: T.nilable(T.proc.returns(T.untyped))
|
||||
).void
|
||||
end
|
||||
def prepend_after_action(*names, except: nil, only: nil, if: nil, unless: nil, &block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
names: Symbol,
|
||||
except: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
only: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
if: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
unless: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
block: T.nilable(T.proc.returns(T.untyped))
|
||||
).void
|
||||
end
|
||||
def prepend_around_action(*names, except: nil, only: nil, if: nil, unless: nil, &block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
names: Symbol,
|
||||
except: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
only: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
if: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
unless: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
block: T.nilable(T.proc.returns(T.untyped))
|
||||
).void
|
||||
end
|
||||
def prepend_before_action(*names, except: nil, only: nil, if: nil, unless: nil, &block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
names: Symbol,
|
||||
except: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
only: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
if: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
unless: T.nilable(T.any(Symbol, T::Array[Symbol], Proc))
|
||||
).void
|
||||
end
|
||||
def skip_after_action(*names, except: nil, only: nil, if: nil, unless: nil); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
names: Symbol,
|
||||
except: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
only: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
if: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
unless: T.nilable(T.any(Symbol, T::Array[Symbol], Proc))
|
||||
).void
|
||||
end
|
||||
def skip_around_action(*names, except: nil, only: nil, if: nil, unless: nil); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
names: Symbol,
|
||||
except: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
only: T.nilable(T.any(Symbol, T::Array[Symbol])),
|
||||
if: T.nilable(T.any(Symbol, T::Array[Symbol], Proc)),
|
||||
unless: T.nilable(T.any(Symbol, T::Array[Symbol], Proc))
|
||||
).void
|
||||
end
|
||||
def skip_before_action(*names, except: nil, only: nil, if: nil, unless: nil); end
|
||||
end
|
||||
|
||||
# https://api.rubyonrails.org/classes/ActionController/MimeResponds.html
|
||||
module ActionController::MimeResponds
|
||||
sig do
|
||||
params(
|
||||
mimes: T.nilable(Symbol),
|
||||
block: T.nilable(T.proc.params(arg0: ActionController::MimeResponds::Collector).void)
|
||||
).void
|
||||
end
|
||||
def respond_to(*mimes, &block); end
|
||||
end
|
||||
|
||||
class ActionController::MimeResponds::Collector
|
||||
sig { params(block: T.nilable(T.proc.void)).void }
|
||||
def html(&block); end
|
||||
|
||||
sig { params(block: T.nilable(T.proc.void)).void }
|
||||
def js(&block); end
|
||||
|
||||
sig { params(block: T.nilable(T.proc.void)).void }
|
||||
def json(&block); end
|
||||
|
||||
sig { params(block: T.nilable(T.proc.void)).void }
|
||||
def xml(&block); end
|
||||
end
|
314
sorbet/rbi/sorbet-typed/lib/actionview/all/actionview.rbi
Normal file
314
sorbet/rbi/sorbet-typed/lib/actionview/all/actionview.rbi
Normal file
|
@ -0,0 +1,314 @@
|
|||
# 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/actionview/all/actionview.rbi
|
||||
#
|
||||
# typed: ignore
|
||||
|
||||
module ActionView
|
||||
class ActionViewError < StandardError; end
|
||||
class EncodingError < StandardError; end
|
||||
class WrongEncodingError < EncodingError; end
|
||||
|
||||
class MissingTemplate < ActionViewError
|
||||
sig { returns(String) }
|
||||
def path; end
|
||||
end
|
||||
|
||||
class Template
|
||||
class Error < ActionViewError; end
|
||||
end
|
||||
|
||||
TemplateError = T.type_alias {Template::Error}
|
||||
|
||||
class SyntaxErrorInTemplate < Template::Error; end
|
||||
end
|
||||
|
||||
# Provides a set of methods for making links and getting URLs that
|
||||
# depend on the routing subsystem (see ActionDispatch::Routing).
|
||||
# This allows you to use the same format for links in views
|
||||
# and controllers.
|
||||
module ActionView::Helpers::UrlHelper
|
||||
# Creates an anchor element of the given `name` using a URL created by the set of `options`.
|
||||
# See the valid options in the documentation for `url_for`. It's also possible to
|
||||
# pass a String instead of an options hash, which generates an anchor element that uses the
|
||||
# value of the String as the href for the link. Using a `:back` Symbol instead
|
||||
# of an options hash will generate a link to the referrer (a JavaScript back link
|
||||
# will be used in place of a referrer if none exists). If `nil` is passed as the name
|
||||
# the value of the link itself will become the name.
|
||||
#
|
||||
# #### Signatures
|
||||
#
|
||||
# ```ruby
|
||||
# link_to(body, url, html_options = {})
|
||||
# # url is a String; you can use URL helpers like
|
||||
# # posts_path
|
||||
#
|
||||
# link_to(body, url_options = {}, html_options = {})
|
||||
# # url_options, except :method, is passed to url_for
|
||||
#
|
||||
# link_to(options = {}, html_options = {}) do
|
||||
# # name
|
||||
# end
|
||||
#
|
||||
# link_to(url, html_options = {}) do
|
||||
# # name
|
||||
# end
|
||||
# ```
|
||||
#
|
||||
# #### Options
|
||||
# * `:data` - This option can be used to add custom data attributes.
|
||||
# * `method: symbol of HTTP verb` - This modifier will dynamically
|
||||
# create an HTML form and immediately submit the form for processing using
|
||||
# the HTTP verb specified. Useful for having links perform a POST operation
|
||||
# in dangerous actions like deleting a record (which search bots can follow
|
||||
# while spidering your site). Supported verbs are `:post`, `:delete`, `:patch`, and `:put`.
|
||||
# Note that if the user has JavaScript disabled, the request will fall back
|
||||
# to using GET. If `href: '#'` is used and the user has JavaScript
|
||||
# disabled clicking the link will have no effect. If you are relying on the
|
||||
# POST behavior, you should check for it in your controller's action by using
|
||||
# the request object's methods for `post?`, `delete?`, `patch?`, or `put?`.
|
||||
# * `remote: true` - This will allow the unobtrusive JavaScript
|
||||
# driver to make an Ajax request to the URL in question instead of following
|
||||
# the link. The drivers each provide mechanisms for listening for the
|
||||
# completion of the Ajax request and performing JavaScript operations once
|
||||
# they're complete
|
||||
#
|
||||
# #### Data attributes
|
||||
#
|
||||
# * `confirm: 'question?'` - This will allow the unobtrusive JavaScript
|
||||
# driver to prompt with the question specified (in this case, the
|
||||
# resulting text would be `question?`. If the user accepts, the
|
||||
# link is processed normally, otherwise no action is taken.
|
||||
# * `:disable_with` - Value of this parameter will be used as the
|
||||
# name for a disabled version of the link. This feature is provided by
|
||||
# the unobtrusive JavaScript driver.
|
||||
#
|
||||
# #### Examples
|
||||
# Because it relies on `url_for`, `link_to` supports both older-style controller/action/id arguments
|
||||
# and newer RESTful routes. Current Rails style favors RESTful routes whenever possible, so base
|
||||
# your application on resources and use
|
||||
#
|
||||
# ```ruby
|
||||
# link_to "Profile", profile_path(@profile)
|
||||
# # => <a href="/profiles/1">Profile</a>
|
||||
# ```
|
||||
#
|
||||
# or the even pithier
|
||||
#
|
||||
# ```ruby
|
||||
# link_to "Profile", @profile
|
||||
# # => <a href="/profiles/1">Profile</a>
|
||||
# ```
|
||||
#
|
||||
# in place of the older more verbose, non-resource-oriented
|
||||
#
|
||||
# ```ruby
|
||||
# link_to "Profile", controller: "profiles", action: "show", id: @profile
|
||||
# # => <a href="/profiles/show/1">Profile</a>
|
||||
# ```
|
||||
#
|
||||
# Similarly,
|
||||
#
|
||||
# ```ruby
|
||||
# link_to "Profiles", profiles_path
|
||||
# # => <a href="/profiles">Profiles</a>
|
||||
# ```
|
||||
#
|
||||
# is better than
|
||||
#
|
||||
# ```ruby
|
||||
# link_to "Profiles", controller: "profiles"
|
||||
# # => <a href="/profiles">Profiles</a>
|
||||
# ```
|
||||
#
|
||||
# When name is `nil` the href is presented instead
|
||||
#
|
||||
# ```ruby
|
||||
# link_to nil, "http://example.com"
|
||||
# # => <a href="http://www.example.com">http://www.example.com</a>
|
||||
# ```
|
||||
#
|
||||
# You can use a block as well if your link target is hard to fit into the name parameter. ERB example:
|
||||
#
|
||||
# ```html
|
||||
# <%= link_to(@profile) do %>
|
||||
# <strong><%= @profile.name %></strong> -- <span>Check it out!</span>
|
||||
# <% end %>
|
||||
# # => <a href="/profiles/1">
|
||||
# <strong>David</strong> -- <span>Check it out!</span>
|
||||
# </a>
|
||||
# ```
|
||||
#
|
||||
# Classes and ids for CSS are easy to produce:
|
||||
#
|
||||
# ```ruby
|
||||
# link_to "Articles", articles_path, id: "news", class: "article"
|
||||
# # => <a href="/articles" class="article" id="news">Articles</a>
|
||||
# ```
|
||||
#
|
||||
# Be careful when using the older argument style, as an extra literal hash is needed:
|
||||
#
|
||||
# ```ruby
|
||||
# link_to "Articles", { controller: "articles" }, id: "news", class: "article"
|
||||
# # => <a href="/articles" class="article" id="news">Articles</a>
|
||||
# ```
|
||||
#
|
||||
# Leaving the hash off gives the wrong link:
|
||||
#
|
||||
# ```ruby
|
||||
# link_to "WRONG!", controller: "articles", id: "news", class: "article"
|
||||
# # => <a href="/articles/index/news?class=article">WRONG!</a>
|
||||
# ```
|
||||
#
|
||||
# `link_to` can also produce links with anchors or query strings:
|
||||
#
|
||||
# ```ruby
|
||||
# link_to "Comment wall", profile_path(@profile, anchor: "wall")
|
||||
# # => <a href="/profiles/1#wall">Comment wall</a>
|
||||
#
|
||||
# link_to "Ruby on Rails search", controller: "searches", query: "ruby on rails"
|
||||
# # => <a href="/searches?query=ruby+on+rails">Ruby on Rails search</a>
|
||||
#
|
||||
# link_to "Nonsense search", searches_path(foo: "bar", baz: "quux")
|
||||
# # => <a href="/searches?foo=bar&baz=quux">Nonsense search</a>
|
||||
# ```
|
||||
#
|
||||
# The only option specific to `link_to` (`:method`) is used as follows:
|
||||
#
|
||||
# ```ruby
|
||||
# link_to("Destroy", "http://www.example.com", method: :delete)
|
||||
# # => <a href='http://www.example.com' rel="nofollow" data-method="delete">Destroy</a>
|
||||
# ```
|
||||
#
|
||||
# You can also use custom data attributes using the `:data` option:
|
||||
#
|
||||
# ```ruby
|
||||
# link_to "Visit Other Site", "http://www.rubyonrails.org/", data: { confirm: "Are you sure?" }
|
||||
# # => <a href="http://www.rubyonrails.org/" data-confirm="Are you sure?">Visit Other Site</a>
|
||||
# ```
|
||||
#
|
||||
# Also you can set any link attributes such as `target`, `rel`, `type`:
|
||||
#
|
||||
# ```ruby
|
||||
# link_to "External link", "http://www.rubyonrails.org/", target: "_blank", rel: "nofollow"
|
||||
# # => <a href="http://www.rubyonrails.org/" target="_blank" rel="nofollow">External link</a>
|
||||
# ```
|
||||
sig do
|
||||
params(
|
||||
name: String,
|
||||
options: T.untyped,
|
||||
html_options: T.untyped,
|
||||
block: T.untyped
|
||||
).returns(ActiveSupport::SafeBuffer)
|
||||
end
|
||||
def link_to(name = nil, options = nil, html_options = nil, &block); end
|
||||
|
||||
# Creates a link tag of the given `name` using a URL created by the set of
|
||||
# `options` if `condition` is true, otherwise only the name is
|
||||
# returned. To specialize the default behavior, you can pass a block that
|
||||
# accepts the name or the full argument list for `link_to_unless` (see the examples
|
||||
# in `link_to_unless`).
|
||||
#
|
||||
# #### Examples
|
||||
# ```ruby
|
||||
# <%= link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) %>
|
||||
# # If the user isn't logged in...
|
||||
# # => <a href="/sessions/new/">Login</a>
|
||||
# ```
|
||||
#
|
||||
# ```ruby
|
||||
# <%=
|
||||
# link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) do
|
||||
# link_to(@current_user.login, { controller: "accounts", action: "show", id: @current_user })
|
||||
# end
|
||||
# %>
|
||||
# # If the user isn't logged in...
|
||||
# # => <a href="/sessions/new/">Login</a>
|
||||
# # If they are logged in...
|
||||
# # => <a href="/accounts/show/3">my_username</a>
|
||||
# ```
|
||||
sig do
|
||||
params(
|
||||
condition: T.untyped,
|
||||
name: String,
|
||||
options: T.untyped,
|
||||
html_options: T.untyped,
|
||||
block: T.untyped
|
||||
).returns(T.untyped)
|
||||
end
|
||||
def link_to_if(condition, name, options = {}, html_options = {}, &block); end
|
||||
|
||||
# True if the current request URI was generated by the given `options`.
|
||||
#
|
||||
# #### Examples
|
||||
# Let's say we're in the `http://www.example.com/shop/checkout?order=desc&page=1` action.
|
||||
#
|
||||
# ```ruby
|
||||
# current_page?(action: 'process')
|
||||
# # => false
|
||||
#
|
||||
# current_page?(action: 'checkout')
|
||||
# # => true
|
||||
#
|
||||
# current_page?(controller: 'library', action: 'checkout')
|
||||
# # => false
|
||||
#
|
||||
# current_page?(controller: 'shop', action: 'checkout')
|
||||
# # => true
|
||||
#
|
||||
# current_page?(controller: 'shop', action: 'checkout', order: 'asc')
|
||||
# # => false
|
||||
#
|
||||
# current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '1')
|
||||
# # => true
|
||||
#
|
||||
# current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '2')
|
||||
# # => false
|
||||
#
|
||||
# current_page?('http://www.example.com/shop/checkout')
|
||||
# # => true
|
||||
#
|
||||
# current_page?('http://www.example.com/shop/checkout', check_parameters: true)
|
||||
# # => false
|
||||
#
|
||||
# current_page?('/shop/checkout')
|
||||
# # => true
|
||||
#
|
||||
# current_page?('http://www.example.com/shop/checkout?order=desc&page=1')
|
||||
# # => true
|
||||
# ```
|
||||
#
|
||||
# Let's say we're in the `http://www.example.com/products` action with method POST in case of invalid product.
|
||||
#
|
||||
# ```ruby
|
||||
# current_page?(controller: 'product', action: 'index')
|
||||
# # => false
|
||||
# ```
|
||||
#
|
||||
# We can also pass in the symbol arguments instead of strings.
|
||||
sig { params(options: T.untyped, check_parameters: T::Boolean).returns(T::Boolean) }
|
||||
def current_page?(options, check_parameters: false); end
|
||||
end
|
||||
|
||||
module ActionView::Layouts
|
||||
extend T::Helpers
|
||||
|
||||
module ClassMethods; end
|
||||
|
||||
mixes_in_class_methods(ActionView::Layouts::ClassMethods)
|
||||
end
|
||||
|
||||
module ActionView::Rendering
|
||||
extend T::Helpers
|
||||
|
||||
mixes_in_class_methods(ActionView::Rendering::ClassMethods)
|
||||
end
|
||||
|
||||
module ActionView::ViewPaths
|
||||
extend T::Helpers
|
||||
|
||||
mixes_in_class_methods(ActionView::ViewPaths::ClassMethods)
|
||||
end
|
423
sorbet/rbi/sorbet-typed/lib/activemodel/all/activemodel.rbi
Normal file
423
sorbet/rbi/sorbet-typed/lib/activemodel/all/activemodel.rbi
Normal file
|
@ -0,0 +1,423 @@
|
|||
# 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/activemodel/all/activemodel.rbi
|
||||
#
|
||||
# typed: strong
|
||||
|
||||
module ActiveModel::Dirty
|
||||
extend T::Sig
|
||||
sig { params(attr: Symbol, from: T.untyped, to: T.untyped).returns(T::Boolean) }
|
||||
def attribute_changed?(attr, from: nil, to: nil); end
|
||||
|
||||
sig { params(attr_name: Symbol).returns(T::Boolean) }
|
||||
def attribute_changed_in_place?(attr_name); end
|
||||
|
||||
sig { params(attr_name: Symbol).returns(T::Boolean) }
|
||||
def attribute_previously_changed?(attr_name); end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def changed?; end
|
||||
end
|
||||
|
||||
module ActiveModel::Validations
|
||||
module ClassMethods
|
||||
# https://github.com/rails/rails/blob/v5.2.3/activemodel/lib/active_model/validations.rb#L136-L154
|
||||
sig do
|
||||
params(
|
||||
names: T.any(Symbol, String),
|
||||
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
on: T.any(Symbol, String),
|
||||
prepend: T::Boolean,
|
||||
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
).void
|
||||
end
|
||||
def validate(
|
||||
*names,
|
||||
if: nil,
|
||||
on: nil,
|
||||
prepend: false,
|
||||
unless: nil
|
||||
); end
|
||||
|
||||
# https://github.com/rails/rails/blob/v5.2.3/activemodel/lib/active_model/validations/validates.rb#L75-L105
|
||||
sig do
|
||||
params(
|
||||
names: T.any(Symbol, String), # a splat of at least one attribute name
|
||||
absence: T.any(T::Boolean, T::Hash[T.untyped, T.untyped]),
|
||||
acceptance: T.any(T::Boolean, T::Hash[T.untyped, T.untyped]),
|
||||
allow_blank: T::Boolean,
|
||||
allow_nil: T::Boolean,
|
||||
confirmation: T.any(T::Boolean, T::Hash[T.untyped, T.untyped]),
|
||||
# `exclusion` and `inclusion` are tricky to type without better support
|
||||
# for overloading and shapes. Value can be anything that responds to
|
||||
# `include?` (e.g. (1..3)), or a hash having an `in` or `within` key,
|
||||
# like { in: [1, 2, 3], ... }
|
||||
exclusion: T::Enumerable[T.untyped],
|
||||
# `format` hash must additionally contain either :with or :without keys.
|
||||
# Alternatively, it can be a Regexp.
|
||||
format: T.any(T::Hash[T.untyped, T.untyped], Regexp),
|
||||
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
# `exclusion` and `inclusion` are tricky to type without better support
|
||||
# for overloading and shapes. Value can be anything that responds to
|
||||
# `include?` (e.g. (1..3)), or a hash having an `in` or `within` key,
|
||||
# like { in: [1, 2, 3], ... }
|
||||
inclusion: T::Enumerable[T.untyped],
|
||||
# if Hash, must contain :in, :within, :maximum, :minimum, or :is keys
|
||||
length: T.any(T::Range[T.untyped], T::Hash[T.untyped, T.untyped]),
|
||||
numericality: T.any(T::Boolean, T::Hash[T.untyped, T.untyped]),
|
||||
on: T.any(Symbol, String, T::Array[T.any(Symbol, String)]),
|
||||
presence: T::Boolean,
|
||||
size: T.any(T::Boolean, T::Hash[T.untyped, T.untyped]),
|
||||
strict: T::Boolean,
|
||||
uniqueness: T.any(T::Boolean, T::Hash[T.untyped, T.untyped]),
|
||||
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
).void
|
||||
end
|
||||
def validates(
|
||||
*names,
|
||||
absence: false,
|
||||
acceptance: {},
|
||||
allow_blank: false,
|
||||
allow_nil: false,
|
||||
confirmation: false,
|
||||
exclusion: [],
|
||||
format: {},
|
||||
if: nil,
|
||||
inclusion: [],
|
||||
length: {},
|
||||
numericality: false,
|
||||
on: :_,
|
||||
presence: false,
|
||||
size: false,
|
||||
strict: false,
|
||||
uniqueness: false,
|
||||
unless: :_
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class ActiveModel::Type::Boolean
|
||||
sig { params(arg0: T.untyped).returns(T.nilable(T::Boolean))}
|
||||
def cast(arg0); end
|
||||
end
|
||||
|
||||
module ActiveModel::Validations::HelperMethods
|
||||
sig do
|
||||
params(
|
||||
attr_names: T.any(String, Symbol),
|
||||
message: String,
|
||||
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
on: T.any(Symbol, String),
|
||||
allow_nil: T::Boolean,
|
||||
allow_blank: T::Boolean,
|
||||
strict: T::Boolean
|
||||
).void
|
||||
end
|
||||
def validates_absence_of(
|
||||
*attr_names,
|
||||
message: 'must be blank',
|
||||
if: nil,
|
||||
unless: :_,
|
||||
on: :_,
|
||||
allow_nil: false,
|
||||
allow_blank: false,
|
||||
strict: false
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
attr_names: T.any(String, Symbol),
|
||||
message: String,
|
||||
accept: T.untyped,
|
||||
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
on: T.any(Symbol, String),
|
||||
allow_nil: T::Boolean,
|
||||
allow_blank: T::Boolean,
|
||||
strict: T::Boolean
|
||||
).void
|
||||
end
|
||||
def validates_acceptance_of(
|
||||
*attr_names,
|
||||
message: 'must be accepted',
|
||||
accept: ['1', true],
|
||||
if: nil,
|
||||
unless: :_,
|
||||
on: :_,
|
||||
allow_nil: false,
|
||||
allow_blank: false,
|
||||
strict: false
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
attr_names: T.any(String, Symbol),
|
||||
message: String,
|
||||
case_sensitive: T::Boolean,
|
||||
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
on: T.any(Symbol, String),
|
||||
allow_nil: T::Boolean,
|
||||
allow_blank: T::Boolean,
|
||||
strict: T::Boolean
|
||||
).void
|
||||
end
|
||||
def validates_confirmation_of(
|
||||
*attr_names,
|
||||
message: "doesn't match %{translated_attribute_name}",
|
||||
case_sensitive: true,
|
||||
if: nil,
|
||||
unless: :_,
|
||||
on: :_,
|
||||
allow_nil: false,
|
||||
allow_blank: false,
|
||||
strict: false
|
||||
); end
|
||||
|
||||
# A type alias for the in/within parameters on the
|
||||
# validates_(inclusion/exclusion)_of methods.
|
||||
InWithinType = T.type_alias do
|
||||
T.nilable(
|
||||
T.any(
|
||||
Symbol,
|
||||
String,
|
||||
T::Array[T.any(String, Symbol)],
|
||||
T::Range[Integer],
|
||||
T::Array[T::Boolean],
|
||||
T.proc.params(arg0: T.untyped).returns(T::Boolean)
|
||||
)
|
||||
)
|
||||
end
|
||||
sig do
|
||||
params(
|
||||
attr_names: T.any(String, Symbol),
|
||||
message: String,
|
||||
in: InWithinType,
|
||||
within: InWithinType,
|
||||
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
on: T.any(Symbol, String),
|
||||
allow_nil: T::Boolean,
|
||||
allow_blank: T::Boolean,
|
||||
strict: T::Boolean
|
||||
).void
|
||||
end
|
||||
def validates_exclusion_of(
|
||||
*attr_names,
|
||||
message: 'is reserved',
|
||||
in: nil,
|
||||
within: nil,
|
||||
if: nil,
|
||||
unless: :_,
|
||||
on: :_,
|
||||
allow_nil: false,
|
||||
allow_blank: false,
|
||||
strict: false
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
attr_names: T.any(String, Symbol),
|
||||
message: String,
|
||||
with: T.untyped,
|
||||
without: T.untyped,
|
||||
multiline: T.untyped,
|
||||
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
on: T.any(Symbol, String),
|
||||
allow_nil: T::Boolean,
|
||||
allow_blank: T::Boolean,
|
||||
strict: T::Boolean
|
||||
).void
|
||||
end
|
||||
def validates_format_of(
|
||||
*attr_names,
|
||||
message: 'is invalid',
|
||||
with: nil,
|
||||
without: nil,
|
||||
multiline: nil,
|
||||
if: nil,
|
||||
unless: :_,
|
||||
on: :_,
|
||||
allow_nil: false,
|
||||
allow_blank: false,
|
||||
strict: false
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
attr_names: T.any(String, Symbol),
|
||||
message: String,
|
||||
in: InWithinType,
|
||||
within: InWithinType,
|
||||
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
on: T.any(Symbol, String),
|
||||
allow_nil: T::Boolean,
|
||||
allow_blank: T::Boolean,
|
||||
strict: T::Boolean
|
||||
).void
|
||||
end
|
||||
def validates_inclusion_of(
|
||||
*attr_names,
|
||||
message: 'is not included in the list',
|
||||
in: nil,
|
||||
within: nil,
|
||||
if: nil,
|
||||
unless: :_,
|
||||
on: :_,
|
||||
allow_nil: false,
|
||||
allow_blank: false,
|
||||
strict: false
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
attr_names: T.any(String, Symbol),
|
||||
message: T.nilable(String),
|
||||
minimum: T.nilable(Integer),
|
||||
maximum: T.nilable(Integer),
|
||||
is: T.nilable(Integer),
|
||||
within: T.nilable(T::Range[Integer]),
|
||||
in: T.nilable(T::Range[Integer]),
|
||||
too_long: String,
|
||||
too_short: String,
|
||||
wrong_length: String,
|
||||
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
on: T.any(Symbol, String),
|
||||
allow_nil: T::Boolean,
|
||||
allow_blank: T::Boolean,
|
||||
strict: T::Boolean
|
||||
).void
|
||||
end
|
||||
def validates_length_of(
|
||||
*attr_names,
|
||||
message: nil,
|
||||
minimum: nil,
|
||||
maximum: nil,
|
||||
is: nil,
|
||||
within: nil,
|
||||
in: nil,
|
||||
too_long: 'is too long (maximum is %{count} characters)',
|
||||
too_short: 'is too short (minimum is %{count} characters)',
|
||||
wrong_length: 'is the wrong length (should be %{count} characters)',
|
||||
if: nil,
|
||||
unless: :_,
|
||||
on: :_,
|
||||
allow_nil: false,
|
||||
allow_blank: false,
|
||||
strict: false
|
||||
); end
|
||||
|
||||
# validates_size_of is an alias of validates_length_of
|
||||
sig do
|
||||
params(
|
||||
attr_names: T.any(String, Symbol),
|
||||
message: T.nilable(String),
|
||||
minimum: T.nilable(Integer),
|
||||
maximum: T.nilable(Integer),
|
||||
is: T.nilable(Integer),
|
||||
within: T.nilable(T::Range[Integer]),
|
||||
in: T.nilable(T::Range[Integer]),
|
||||
too_long: String,
|
||||
too_short: String,
|
||||
wrong_length: String,
|
||||
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
on: T.any(Symbol, String),
|
||||
allow_nil: T::Boolean,
|
||||
allow_blank: T::Boolean,
|
||||
strict: T::Boolean
|
||||
).void
|
||||
end
|
||||
def validates_size_of(
|
||||
*attr_names,
|
||||
message: nil,
|
||||
minimum: nil,
|
||||
maximum: nil,
|
||||
is: nil,
|
||||
within: nil,
|
||||
in: nil,
|
||||
too_long: 'is too long (maximum is %{count} characters)',
|
||||
too_short: 'is too short (minimum is %{count} characters)',
|
||||
wrong_length: 'is the wrong length (should be %{count} characters)',
|
||||
if: nil,
|
||||
unless: :_,
|
||||
on: :_,
|
||||
allow_nil: false,
|
||||
allow_blank: false,
|
||||
strict: false
|
||||
); end
|
||||
|
||||
# Create a type alias so we don't have to repeat this long type signature 6 times.
|
||||
NumberComparatorType = T.type_alias {T.nilable(T.any(Integer, Float, T.proc.params(arg0: T.untyped).returns(T::Boolean), Symbol))}
|
||||
sig do
|
||||
params(
|
||||
attr_names: T.any(String, Symbol),
|
||||
message: String,
|
||||
only_integer: T::Boolean,
|
||||
greater_than: NumberComparatorType,
|
||||
greater_than_or_equal_to: NumberComparatorType,
|
||||
equal_to: NumberComparatorType,
|
||||
less_than: NumberComparatorType,
|
||||
less_than_or_equal_to: NumberComparatorType,
|
||||
other_than: NumberComparatorType,
|
||||
odd: T::Boolean,
|
||||
even: T::Boolean,
|
||||
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
on: T.any(Symbol, String),
|
||||
allow_nil: T::Boolean,
|
||||
allow_blank: T::Boolean,
|
||||
strict: T::Boolean
|
||||
).void
|
||||
end
|
||||
def validates_numericality_of(
|
||||
*attr_names,
|
||||
message: 'is not a number',
|
||||
only_integer: false,
|
||||
greater_than: nil,
|
||||
greater_than_or_equal_to: nil,
|
||||
equal_to: nil,
|
||||
less_than: nil,
|
||||
less_than_or_equal_to: nil,
|
||||
other_than: nil,
|
||||
odd: false,
|
||||
even: false,
|
||||
if: nil,
|
||||
unless: :_,
|
||||
on: :_,
|
||||
allow_nil: false,
|
||||
allow_blank: false,
|
||||
strict: false
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
attr_names: T.any(String, Symbol),
|
||||
message: String,
|
||||
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
||||
on: T.any(Symbol, String),
|
||||
allow_nil: T::Boolean,
|
||||
allow_blank: T::Boolean,
|
||||
strict: T::Boolean
|
||||
).void
|
||||
end
|
||||
def validates_presence_of(
|
||||
*attr_names,
|
||||
message: "can't be blank",
|
||||
if: nil,
|
||||
unless: :_,
|
||||
on: :_,
|
||||
allow_nil: false,
|
||||
allow_blank: false,
|
||||
strict: false
|
||||
); end
|
||||
end
|
|
@ -0,0 +1,17 @@
|
|||
# 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/activerecord/>=5.2/activerecord.rbi
|
||||
#
|
||||
# typed: strong
|
||||
|
||||
class ActiveRecord::Base
|
||||
extend ActiveRecord::Delegation::DelegateCache
|
||||
extend ActiveRecord::CollectionCacheKey
|
||||
include ActiveRecord::DefineCallbacks
|
||||
include ActiveRecord::TouchLater
|
||||
include ActiveRecord::SecureToken
|
||||
include ActiveRecord::Suppressor
|
||||
end
|
1419
sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi
Normal file
1419
sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,443 @@
|
|||
# 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/activerecord/~>5.2.0/activerecord.rbi
|
||||
#
|
||||
# typed: strong
|
||||
|
||||
class ActiveRecord::Migration::Compatibility::V5_1 < ActiveRecord::Migration::Current; end
|
||||
|
||||
ActiveRecord::Migration::Compatibility::V5_2 = ActiveRecord::Migration::Current
|
||||
|
||||
# Method definitions are documented here:
|
||||
# https://api.rubyonrails.org/v5.2/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html
|
||||
class ActiveRecord::Migration::Current < ActiveRecord::Migration
|
||||
# Tables
|
||||
|
||||
# https://github.com/rails/rails/blob/v5.2.3/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb#L151-L290
|
||||
sig do
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
comment: T.untyped,
|
||||
id: T.any(T::Boolean, Symbol),
|
||||
primary_key: T.any(String, Symbol, T::Array[T.any(String, Symbol)]),
|
||||
options: T.untyped,
|
||||
temporary: T::Boolean,
|
||||
force: T.any(T::Boolean, Symbol),
|
||||
as: T.untyped,
|
||||
blk: T.nilable(T.proc.params(t: ActiveRecord::ConnectionAdapters::TableDefinition).void)
|
||||
).returns(T.untyped)
|
||||
end
|
||||
def create_table(
|
||||
table_name,
|
||||
comment: nil,
|
||||
id: :primary_key,
|
||||
primary_key: :_,
|
||||
options: nil,
|
||||
temporary: false,
|
||||
force: false,
|
||||
as: nil,
|
||||
&blk
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
bulk: T::Boolean,
|
||||
blk: T.proc.params(t: ActiveRecord::ConnectionAdapters::Table).void
|
||||
).void
|
||||
end
|
||||
def change_table(
|
||||
table_name,
|
||||
bulk: false,
|
||||
&blk
|
||||
); end
|
||||
|
||||
sig { params(table_name: T.any(String, Symbol), new_name: T.any(String, Symbol)).void }
|
||||
def rename_table(table_name, new_name); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
force: T.any(T::Boolean, Symbol),
|
||||
if_exists: T::Boolean,
|
||||
blk: T.nilable(T.proc.params(t: ActiveRecord::ConnectionAdapters::TableDefinition).void)
|
||||
).void
|
||||
end
|
||||
def drop_table(
|
||||
table_name,
|
||||
force: false,
|
||||
if_exists: false,
|
||||
&blk
|
||||
); end
|
||||
|
||||
# Join Tables
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_1: T.any(String, Symbol),
|
||||
table_2: T.any(String, Symbol),
|
||||
column_options: T.untyped,
|
||||
table_name: T.any(String, Symbol),
|
||||
temporary: T.untyped,
|
||||
force: T::Boolean,
|
||||
blk: T.nilable(T.proc.params(t: ActiveRecord::ConnectionAdapters::TableDefinition).void)
|
||||
).void
|
||||
end
|
||||
def create_join_table(
|
||||
table_1,
|
||||
table_2,
|
||||
column_options: {},
|
||||
table_name: nil,
|
||||
temporary: nil,
|
||||
force: false,
|
||||
&blk
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_1: T.any(String, Symbol),
|
||||
table_2: T.any(String, Symbol),
|
||||
options: T.untyped,
|
||||
blk: T.nilable(T.proc.params(t: ActiveRecord::ConnectionAdapters::TableDefinition).void)
|
||||
).void
|
||||
end
|
||||
def drop_join_table(
|
||||
table_1,
|
||||
table_2,
|
||||
options = {},
|
||||
&blk
|
||||
); end
|
||||
|
||||
# Columns
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
column_name: T.any(String, Symbol),
|
||||
type: T.any(String, Symbol),
|
||||
limit: T.untyped,
|
||||
default: T.untyped,
|
||||
null: T::Boolean,
|
||||
precision: Integer,
|
||||
scale: Integer,
|
||||
comment: String
|
||||
).void
|
||||
end
|
||||
def add_column(
|
||||
table_name,
|
||||
column_name,
|
||||
type,
|
||||
limit: nil,
|
||||
default: nil,
|
||||
null: nil,
|
||||
precision: nil,
|
||||
scale: nil,
|
||||
comment: nil
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
column_name: T.any(String, Symbol),
|
||||
type: T.any(String, Symbol),
|
||||
limit: T.untyped,
|
||||
default: T.untyped,
|
||||
null: T::Boolean,
|
||||
precision: Integer,
|
||||
scale: Integer,
|
||||
comment: String
|
||||
).void
|
||||
end
|
||||
def change_column(
|
||||
table_name,
|
||||
column_name,
|
||||
type,
|
||||
limit: nil,
|
||||
default: nil,
|
||||
null: nil,
|
||||
precision: nil,
|
||||
scale: nil,
|
||||
comment: nil
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
column_name: T.any(String, Symbol),
|
||||
null: T::Boolean,
|
||||
default: T.untyped
|
||||
).void
|
||||
end
|
||||
def change_column_null(table_name, column_name, null, default = nil); end
|
||||
|
||||
sig { params(table_name: T.any(String, Symbol), column_name: T.any(String, Symbol), default_or_changes: T.untyped).void }
|
||||
def change_column_default(table_name, column_name, default_or_changes); end
|
||||
|
||||
sig { params(table_name: T.any(String, Symbol), column_name: T.any(String, Symbol), new_column_name: T.any(String, Symbol)).void }
|
||||
def rename_column(table_name, column_name, new_column_name); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
column_name: T.any(String, Symbol),
|
||||
type: T.nilable(T.any(String, Symbol)),
|
||||
options: T.untyped
|
||||
).void
|
||||
end
|
||||
def remove_column(
|
||||
table_name,
|
||||
column_name,
|
||||
type = nil,
|
||||
options = {}
|
||||
); end
|
||||
|
||||
sig { params(table_name: T.any(String, Symbol), column_names: T.any(String, Symbol)).void }
|
||||
def remove_columns(table_name, *column_names); end
|
||||
|
||||
# Foreign Keys
|
||||
|
||||
sig do
|
||||
params(
|
||||
from_table: T.any(String, Symbol),
|
||||
to_table: T.any(String, Symbol),
|
||||
column: T.any(String, Symbol),
|
||||
primary_key: T.any(String, Symbol),
|
||||
name: T.any(String, Symbol),
|
||||
on_delete: Symbol,
|
||||
on_update: Symbol,
|
||||
validate: T::Boolean
|
||||
).void
|
||||
end
|
||||
def add_foreign_key(
|
||||
from_table,
|
||||
to_table,
|
||||
column: nil,
|
||||
primary_key: nil,
|
||||
name: nil,
|
||||
on_delete: nil,
|
||||
on_update: nil,
|
||||
validate: true
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
from_table: T.any(String, Symbol),
|
||||
to_table: T.nilable(T.any(String, Symbol)),
|
||||
column: T.any(String, Symbol),
|
||||
primary_key: T.any(String, Symbol),
|
||||
name: T.any(String, Symbol),
|
||||
on_delete: Symbol,
|
||||
on_update: Symbol,
|
||||
validate: T::Boolean
|
||||
).void
|
||||
end
|
||||
def remove_foreign_key(
|
||||
from_table,
|
||||
to_table = nil,
|
||||
column: nil,
|
||||
primary_key: nil,
|
||||
name: nil,
|
||||
on_delete: nil,
|
||||
on_update: nil,
|
||||
validate: true
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
from_table: T.any(String, Symbol),
|
||||
to_table: T.any(String, Symbol),
|
||||
name: T.any(String, Symbol),
|
||||
column: T.any(String, Symbol),
|
||||
options: T.untyped
|
||||
).returns(T::Boolean)
|
||||
end
|
||||
def foreign_key_exists?(from_table, to_table = nil, name: nil, column: nil, **options); end
|
||||
|
||||
sig { params(table_name: T.any(String, Symbol)).returns(T::Array[T.untyped]) }
|
||||
def foreign_keys(table_name); end
|
||||
|
||||
# Indices
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
column_name: T.any(String, Symbol, T::Array[T.any(String, Symbol)]),
|
||||
using: T.untyped,
|
||||
unique: T::Boolean,
|
||||
where: T.untyped,
|
||||
order: T.untyped,
|
||||
name: T.any(String, Symbol),
|
||||
length: T.untyped,
|
||||
opclass: T.untyped,
|
||||
type: T.untyped,
|
||||
internal: T.untyped,
|
||||
algorithm: T.untyped
|
||||
).void
|
||||
end
|
||||
def add_index(
|
||||
table_name,
|
||||
column_name,
|
||||
using: nil,
|
||||
unique: false,
|
||||
where: nil,
|
||||
order: nil,
|
||||
name: nil,
|
||||
length: nil,
|
||||
opclass: nil,
|
||||
type: nil,
|
||||
internal: nil,
|
||||
algorithm: nil
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
column: T.any(String, Symbol, T::Array[T.any(String, Symbol)]),
|
||||
using: T.untyped,
|
||||
unique: T::Boolean,
|
||||
where: T.untyped,
|
||||
order: T.untyped,
|
||||
name: T.any(String, Symbol),
|
||||
length: T.untyped,
|
||||
opclass: T.untyped,
|
||||
type: T.untyped,
|
||||
internal: T.untyped,
|
||||
algorithm: T.untyped
|
||||
).void
|
||||
end
|
||||
def remove_index(
|
||||
table_name,
|
||||
column,
|
||||
using: nil,
|
||||
unique: false,
|
||||
where: nil,
|
||||
order: nil,
|
||||
name: nil,
|
||||
length: nil,
|
||||
opclass: nil,
|
||||
type: nil,
|
||||
internal: nil,
|
||||
algorithm: nil
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
old_name: T.any(String, Symbol),
|
||||
new_name: T.any(String, Symbol)
|
||||
).void
|
||||
end
|
||||
def rename_index(
|
||||
table_name,
|
||||
old_name,
|
||||
new_name
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
column_name: T.any(String, Symbol),
|
||||
options: T.untyped
|
||||
).returns(T::Boolean)
|
||||
end
|
||||
def index_exists?(table_name, column_name, options = {}); end
|
||||
|
||||
sig { params(table_name: T.any(String, Symbol), index_name: T.any(String, Symbol)).returns(T::Boolean) }
|
||||
def index_name_exists?(table_name, index_name); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
column_name: T.any(String, Symbol),
|
||||
type: T.nilable(T.any(String, Symbol)),
|
||||
options: T.untyped
|
||||
).returns(T::Boolean)
|
||||
end
|
||||
def column_exists?(table_name, column_name, type = nil, options = {}); end
|
||||
|
||||
sig { params(table_name: T.any(String, Symbol)).returns(T::Array[T.untyped]) }
|
||||
def indexes(table_name); end
|
||||
|
||||
# References
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
ref_name: T.any(String, Symbol),
|
||||
type: T.any(String, Symbol),
|
||||
index: T.any(T::Boolean, T::Hash[Symbol, T.untyped]),
|
||||
foreign_key: T.any(T::Boolean, T::Hash[Symbol, T.untyped]),
|
||||
polymorphic: T::Boolean,
|
||||
null: T.untyped
|
||||
).void
|
||||
end
|
||||
def add_reference(
|
||||
table_name,
|
||||
ref_name,
|
||||
type: :bigint,
|
||||
index: true,
|
||||
foreign_key: false,
|
||||
polymorphic: false,
|
||||
null: nil
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
ref_name: T.any(String, Symbol),
|
||||
type: T.any(String, Symbol),
|
||||
index: T.any(T::Boolean, T::Hash[Symbol, T.untyped]),
|
||||
foreign_key: T.any(T::Boolean, T::Hash[Symbol, T.untyped]),
|
||||
polymorphic: T::Boolean,
|
||||
null: T.untyped
|
||||
).void
|
||||
end
|
||||
def remove_reference(
|
||||
table_name,
|
||||
ref_name,
|
||||
type: :bigint,
|
||||
index: true,
|
||||
foreign_key: false,
|
||||
polymorphic: false,
|
||||
null: nil
|
||||
); end
|
||||
|
||||
# Timestamps
|
||||
|
||||
sig { params(table_name: T.any(String, Symbol), options: T.untyped).void }
|
||||
def add_timestamps(table_name, options = {}); end
|
||||
|
||||
sig { params(table_name: T.any(String, Symbol), options: T.untyped).void }
|
||||
def remove_timestamps(table_name, options = {}); end
|
||||
|
||||
# Extensions
|
||||
|
||||
sig { params(name: T.any(String, Symbol)).void }
|
||||
def enable_extension(name); end
|
||||
|
||||
sig { params(name: T.any(String, Symbol)).void }
|
||||
def disable_extension(name); end
|
||||
|
||||
# Miscellaneous
|
||||
|
||||
sig { params(message: String, subitem: T.untyped).void }
|
||||
def say(message, subitem = false); end
|
||||
|
||||
sig { params(message: String, blk: T.untyped).returns(T.untyped) }
|
||||
def say_with_time(message, &blk); end
|
||||
|
||||
sig { params(blk: T.untyped).void }
|
||||
def suppress_messages(&blk); end
|
||||
|
||||
sig { params(blk: T.proc.params(arg0: T.untyped).void).void }
|
||||
def reversible(&blk); end
|
||||
|
||||
sig { params(migration_classes: T.untyped, blk: T.nilable(T.proc.params(arg0: T.untyped).void)).void }
|
||||
def revert(*migration_classes, &blk); end
|
||||
|
||||
sig { params(sql: String, name: T.nilable(String)).returns(T.untyped) }
|
||||
def execute(sql, name = nil); end
|
||||
end
|
173
sorbet/rbi/sorbet-typed/lib/activestorage/all/activestorage.rbi
Normal file
173
sorbet/rbi/sorbet-typed/lib/activestorage/all/activestorage.rbi
Normal file
|
@ -0,0 +1,173 @@
|
|||
# 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/activestorage/all/activestorage.rbi
|
||||
#
|
||||
# typed: strong
|
||||
|
||||
module ActiveStorage
|
||||
sig { returns(Gem::Version) }
|
||||
def self.gem_version; end
|
||||
|
||||
sig { returns(Gem::Version) }
|
||||
def self.version; end
|
||||
end
|
||||
|
||||
class ActiveStorage::Attached::One
|
||||
# These aren't technically included, but Attached::One delegates any missing
|
||||
# methods to Attachment, which in turn delegates to Blob. This is essentially
|
||||
# a hack to make it easier to maintain the ActiveStorage signatures. We can't
|
||||
#include Blob directly because it's a class, so `include`ing it doesn't work.
|
||||
include ActiveStorage::Blob::Analyzable
|
||||
include ActiveStorage::Blob::Identifiable
|
||||
include ActiveStorage::Blob::Representable
|
||||
|
||||
# Attaches an `attachable` to the record.
|
||||
#
|
||||
# If the record is persisted and unchanged, the attachment is saved to
|
||||
# the database immediately. Otherwise, it'll be saved to the DB when the
|
||||
# record is next saved.
|
||||
#
|
||||
# ```ruby
|
||||
# person.avatar.attach(params[:avatar]) # ActionDispatch::Http::UploadedFile object
|
||||
# person.avatar.attach(params[:signed_blob_id]) # Signed reference to blob from direct upload
|
||||
# person.avatar.attach(io: File.open("/path/to/face.jpg"), filename: "face.jpg", content_type: "image/jpg")
|
||||
# person.avatar.attach(avatar_blob) # ActiveStorage::Blob object
|
||||
# ```
|
||||
sig { params(attachable: T.untyped).void }
|
||||
def attach(attachable); end
|
||||
|
||||
# Returns `true` if an attachment has been made.
|
||||
#
|
||||
# ```ruby
|
||||
# class User < ApplicationRecord
|
||||
# has_one_attached :avatar
|
||||
# end
|
||||
#
|
||||
# User.new.avatar.attached? # => false
|
||||
# ```
|
||||
sig { returns(T::Boolean) }
|
||||
def attached?; end
|
||||
|
||||
# Returns the associated attachment record.
|
||||
#
|
||||
# You don't have to call this method to access the attachment's methods as
|
||||
# they are all available at the model level.
|
||||
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
||||
def attachment; end
|
||||
|
||||
# Deletes the attachment without purging it, leaving its blob in place.
|
||||
sig { void }
|
||||
def detach; end
|
||||
|
||||
# Directly purges the attachment (i.e. destroys the blob and
|
||||
# attachment and deletes the file on the service).
|
||||
sig { void }
|
||||
def purge; end
|
||||
|
||||
# Purges the attachment through the queuing system.
|
||||
sig { void }
|
||||
def purge_later; end
|
||||
end
|
||||
|
||||
class ActiveStorage::Attached::Many
|
||||
# These aren't technically included, but Attached::Many delegates any missing
|
||||
# methods to Attachment, which in turn delegates to Blob. This is essentially
|
||||
# a hack to make it easier to maintain the ActiveStorage signatures. We can't
|
||||
# include Blob directly because it's a class, so `include`ing it doesn't work.
|
||||
include ActiveStorage::Blob::Analyzable
|
||||
include ActiveStorage::Blob::Identifiable
|
||||
include ActiveStorage::Blob::Representable
|
||||
|
||||
# Attaches one or more `attachables` to the record.
|
||||
#
|
||||
# If the record is persisted and unchanged, the attachments are saved to
|
||||
# the database immediately. Otherwise, they'll be saved to the DB when the
|
||||
# record is next saved.
|
||||
#
|
||||
# ```ruby
|
||||
# document.images.attach(params[:images]) # Array of ActionDispatch::Http::UploadedFile objects
|
||||
# document.images.attach(params[:signed_blob_id]) # Signed reference to blob from direct upload
|
||||
# document.images.attach(io: File.open("/path/to/racecar.jpg"), filename: "racecar.jpg", content_type: "image/jpg")
|
||||
# document.images.attach([ first_blob, second_blob ])
|
||||
# ```
|
||||
sig { params(attachables: T.untyped).void }
|
||||
def attach(*attachables); end
|
||||
|
||||
# Returns `true` if any attachments have been made.
|
||||
#
|
||||
# ```ruby
|
||||
# class Gallery < ApplicationRecord
|
||||
# has_many_attached :photos
|
||||
# end
|
||||
#
|
||||
# Gallery.new.photos.attached? # => false
|
||||
# ```
|
||||
sig { returns(T::Boolean) }
|
||||
def attached?; end
|
||||
|
||||
# Returns all the associated attachment records.
|
||||
#
|
||||
# All methods called on this proxy object that aren't listed here will automatically be delegated to `attachments`.
|
||||
sig { returns(T.nilable(T::Array[ActiveStorage::Attachment])) }
|
||||
def attachments; end
|
||||
|
||||
# Deletes associated attachments without purging them, leaving their respective blobs in place.
|
||||
sig { void }
|
||||
def detach; end
|
||||
|
||||
# Directly purges each associated attachment (i.e. destroys the blobs and
|
||||
# attachments and deletes the files on the service).
|
||||
sig { void }
|
||||
def purge; end
|
||||
|
||||
# Purges each associated attachment through the queuing system.
|
||||
sig { void }
|
||||
def purge_later; end
|
||||
end
|
||||
|
||||
module ActiveStorage::Blob::Representable
|
||||
# Returns an ActiveStorage::Variant instance with the set of `transformations` provided. This is only relevant for image
|
||||
# files, and it allows any image to be transformed for size, colors, and the like. Example:
|
||||
#
|
||||
# ```ruby
|
||||
# avatar.variant(resize_to_limit: [100, 100]).processed.service_url
|
||||
# ```
|
||||
#
|
||||
# This will create and process a variant of the avatar blob that's constrained to a height and width of 100px.
|
||||
# Then it'll upload said variant to the service according to a derivative key of the blob and the transformations.
|
||||
#
|
||||
# Frequently, though, you don't actually want to transform the variant right away. But rather simply refer to a
|
||||
# specific variant that can be created by a controller on-demand. Like so:
|
||||
#
|
||||
# ```ruby
|
||||
# <%= image_tag Current.user.avatar.variant(resize_to_limit: [100, 100]) %>
|
||||
# ```
|
||||
#
|
||||
# This will create a URL for that specific blob with that specific variant, which the ActiveStorage::RepresentationsController
|
||||
# can then produce on-demand.
|
||||
#
|
||||
# Raises ActiveStorage::InvariableError if ImageMagick cannot transform the blob. To determine whether a blob is
|
||||
# variable, call ActiveStorage::Blob#variable?.
|
||||
sig { params(transformations: T.untyped).returns(ActiveStorage::Variant) }
|
||||
def variant(transformations); end
|
||||
end
|
||||
|
||||
class ActiveStorage::Attachment < ActiveRecord::Base
|
||||
# These aren't technically included, but Attachment delegates any missing
|
||||
# methods to Blob, which means it effectively inherits methods from Blob.
|
||||
# This is essentially a hack to make it easier to maintain the
|
||||
# ActiveStorage signatures. We can't include Blob directly because
|
||||
# it's a class, so `include`ing it doesn't work.
|
||||
include ActiveStorage::Blob::Analyzable
|
||||
include ActiveStorage::Blob::Identifiable
|
||||
include ActiveStorage::Blob::Representable
|
||||
end
|
||||
|
||||
class ActiveStorage::Blob < ActiveRecord::Base
|
||||
include ActiveStorage::Blob::Analyzable
|
||||
include ActiveStorage::Blob::Identifiable
|
||||
include ActiveStorage::Blob::Representable
|
||||
end
|
700
sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi
Normal file
700
sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi
Normal file
|
@ -0,0 +1,700 @@
|
|||
# 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/activesupport/all/activesupport.rbi
|
||||
#
|
||||
# typed: strong
|
||||
|
||||
module ActiveSupport
|
||||
sig { params(kind: Symbol, blk: T.proc.bind(T.class_of(ActionController::Base)).void).void }
|
||||
def self.on_load(kind, &blk); end
|
||||
end
|
||||
|
||||
class Object
|
||||
sig { params(duck: T.any(String, Symbol)).returns(T::Boolean) }
|
||||
def acts_like?(duck); end
|
||||
|
||||
sig {returns(T::Boolean)}
|
||||
def blank?; end
|
||||
|
||||
sig { returns(T.self_type) }
|
||||
def deep_dup; end
|
||||
|
||||
sig { returns(TrueClass) }
|
||||
def duplicable?; end
|
||||
|
||||
sig { params(another_object: Object).returns(T::Boolean) }
|
||||
def in?(another_object); end
|
||||
|
||||
sig { returns(T::Hash[String, T.untyped]) }
|
||||
def instance_values; end
|
||||
|
||||
sig { returns(T::Array[String]) }
|
||||
def instance_variable_names; end
|
||||
|
||||
sig { returns(T.nilable(T.self_type)) }
|
||||
def presence; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def present?; end
|
||||
|
||||
sig { returns(String) }
|
||||
def to_param; end
|
||||
|
||||
sig { params(key: String).returns(String) }
|
||||
def to_query(key); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
method_name: T.any(Symbol, String, NilClass),
|
||||
args: T.untyped,
|
||||
b: T.nilable(T.proc.params(arg0: T.untyped).returns(T.untyped))
|
||||
).returns(T.untyped)
|
||||
end
|
||||
def try(method_name = nil, *args, &b); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
method_name: T.any(Symbol, String, NilClass),
|
||||
args: T.untyped,
|
||||
b: T.nilable(T.proc.params(arg0: T.untyped).returns(T.untyped))
|
||||
).returns(T.untyped)
|
||||
end
|
||||
def try!(method_name = nil, *args, &b); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
options: T::Hash[T.untyped, T.untyped],
|
||||
block: T.nilable(T.proc.returns(T.untyped))
|
||||
).returns(T.untyped)
|
||||
end
|
||||
def with_options(options, &block); end
|
||||
end
|
||||
|
||||
class FalseClass
|
||||
sig { returns(NilClass) }
|
||||
def presence; end
|
||||
end
|
||||
|
||||
class Method
|
||||
sig { returns(FalseClass) }
|
||||
def duplicable?; end
|
||||
end
|
||||
|
||||
class NilClass
|
||||
sig { returns(T::Boolean) }
|
||||
def duplicable?; end
|
||||
|
||||
sig do
|
||||
params(
|
||||
method_name: T.any(Symbol, String, NilClass),
|
||||
args: T.untyped,
|
||||
b: T.nilable(T.proc.params(arg0: T.untyped).returns(T.untyped))
|
||||
).returns(NilClass)
|
||||
end
|
||||
def try(method_name = nil, *args, &b); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
method_name: T.any(Symbol, String, NilClass),
|
||||
args: T.untyped,
|
||||
b: T.nilable(T.proc.params(arg0: T.untyped).returns(T.untyped))
|
||||
).returns(NilClass)
|
||||
end
|
||||
def try!(method_name = nil, *args, &b); end
|
||||
end
|
||||
|
||||
class String
|
||||
sig { returns(T::Boolean) }
|
||||
def acts_like_string?; end
|
||||
|
||||
sig { params(position: T.any(Integer, String, Regexp, T::Range[Integer])).returns(T.nilable(String)) }
|
||||
def at(position); end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def blank?; end
|
||||
|
||||
sig { params(first_letter: Symbol).returns(String) }
|
||||
def camelize(first_letter = :upper); end
|
||||
|
||||
# camelcase is an alias of camelize
|
||||
sig { params(first_letter: Symbol).returns(String) }
|
||||
def camelcase(first_letter = :upper); end
|
||||
|
||||
sig { returns(String) }
|
||||
def classify; end
|
||||
|
||||
sig { returns(String) }
|
||||
def constantize; end
|
||||
|
||||
sig { returns(String) }
|
||||
def dasherize; end
|
||||
|
||||
sig { returns(String) }
|
||||
def deconstantize; end
|
||||
|
||||
sig { returns(String) }
|
||||
def demodulize; end
|
||||
|
||||
# ends_with? is an alias of the core method 'end_with?'
|
||||
sig { params(arg0: String).returns(T::Boolean) }
|
||||
def ends_with?(*arg0); 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(T.untyped) }
|
||||
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: String).returns(T.any(Time, ActiveSupport::TimeWithZone)) }
|
||||
def in_time_zone(zone = ::Time.zone); 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 { 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).returns(String) }
|
||||
def parameterize(separator: "-", preserve_case: false); end
|
||||
|
||||
sig { params(count: T.nilable(Integer), locale: Symbol).returns(String) }
|
||||
def pluralize(count = nil, locale = :en); end
|
||||
|
||||
sig { params(patterns: T.untyped).returns(T.untyped) }
|
||||
def remove!(*patterns); end
|
||||
|
||||
sig { params(patterns: T.untyped).returns(T.untyped) }
|
||||
def remove(*patterns); end
|
||||
|
||||
sig { returns(T.untyped) }
|
||||
def safe_constantize; end
|
||||
|
||||
sig { params(locale: Symbol).returns(T.nilable(String)) }
|
||||
def singularize(locale = :en); end
|
||||
|
||||
sig { returns(T.untyped) }
|
||||
def squish!; end
|
||||
|
||||
sig { returns(String) }
|
||||
def squish; end
|
||||
|
||||
# starts_with? is an alias of the core method 'start_with?''
|
||||
sig { params(arg0: String).returns(T::Boolean) }
|
||||
def starts_with?(*arg0); end
|
||||
|
||||
sig { returns(String) }
|
||||
def strip_heredoc; end
|
||||
|
||||
sig { returns(String) }
|
||||
def tableize; end
|
||||
|
||||
sig { params(keep_id_suffix: T::Boolean).returns(String) }
|
||||
def titleize(keep_id_suffix: false); end
|
||||
|
||||
# titlecase is an alias of titleize
|
||||
sig { params(keep_id_suffix: T::Boolean).returns(String) }
|
||||
def titlecase(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: Symbol).returns(Time) }
|
||||
def to_time(form = :local); end
|
||||
|
||||
sig { params(truncate_at: Integer, separator: T.nilable(T.any(String, Regexp)), omission: String).returns(String) }
|
||||
def truncate(truncate_at, separator: nil, omission: "..."); end
|
||||
|
||||
sig { params(words_count: Integer, separator: T.nilable(T.any(String, Regexp)), omission: String).returns(String) }
|
||||
def truncate_words(words_count, separator: nil, omission: "..."); end
|
||||
|
||||
sig { returns(String) }
|
||||
def underscore; end
|
||||
|
||||
sig { returns(String) }
|
||||
def upcase_first; end
|
||||
end
|
||||
|
||||
class Array
|
||||
sig { returns(T::Boolean) }
|
||||
def blank?; end
|
||||
|
||||
sig { returns(T::Array[T.untyped]) }
|
||||
def deep_dup; end
|
||||
|
||||
sig { returns(T::Hash[T.untyped, T.untyped]) }
|
||||
def extract_options!; end
|
||||
|
||||
sig { returns(Elem) }
|
||||
def fifth; end
|
||||
|
||||
sig { returns(Elem) }
|
||||
def forty_two; end
|
||||
|
||||
sig { returns(Elem) }
|
||||
def fourth; end
|
||||
|
||||
sig { params(position: Integer).returns(T::Array[T.untyped]) }
|
||||
def from(position); end
|
||||
|
||||
sig { params(number: Integer, fill_with: T.untyped).returns(T.untyped) }
|
||||
def in_groups(number, fill_with = nil); end
|
||||
|
||||
sig { params(number: Integer, fill_with: T.untyped).returns(T.untyped) }
|
||||
def in_groups_of(number, fill_with = nil); end
|
||||
|
||||
sig { returns(T.untyped) }
|
||||
def inquiry; end
|
||||
|
||||
sig { returns(Elem) }
|
||||
def second; end
|
||||
|
||||
sig { returns(Elem) }
|
||||
def second_to_last; end
|
||||
|
||||
sig do
|
||||
params(
|
||||
value: T.untyped,
|
||||
blk: T.proc.params(arg0: Elem).void
|
||||
).returns(T::Array[Elem])
|
||||
end
|
||||
def split(value = nil, &blk); end
|
||||
|
||||
sig { returns(Elem) }
|
||||
def third; end
|
||||
|
||||
sig { returns(Elem) }
|
||||
def third_to_last; end
|
||||
|
||||
sig { params(position: Integer).returns(T::Array[T.untyped]) }
|
||||
def to(position); end
|
||||
|
||||
# to_default_s is an alias of the core method 'to_s'
|
||||
sig {returns(String)}
|
||||
def to_defaul_s; end
|
||||
|
||||
sig { params(format: Symbol).returns(String) }
|
||||
def to_formatted_s(format = :default); end
|
||||
|
||||
sig { returns(String) }
|
||||
def to_param; end
|
||||
|
||||
sig { params(key: String).returns(String) }
|
||||
def to_query(key); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
words_connector: String,
|
||||
two_words_connector: String,
|
||||
last_word_connector: String,
|
||||
locale: T.nilable(Symbol)
|
||||
).returns(String)
|
||||
end
|
||||
def to_sentence(words_connector: ", ", two_words_connector: " and ", last_word_connector: ", and ", locale: nil); end
|
||||
|
||||
sig { params(options: T.untyped).returns(T.untyped) }
|
||||
def to_xml(options = nil); end
|
||||
|
||||
sig { params(elements: T.untyped).returns(T.untyped) }
|
||||
def without(*elements); end
|
||||
end
|
||||
|
||||
module ActiveSupport::NumberHelper
|
||||
sig do
|
||||
params(
|
||||
number: T.any(Integer, Float, String),
|
||||
locale: Symbol,
|
||||
precision: T.nilable(Integer),
|
||||
unit: String,
|
||||
separator: String,
|
||||
delimiter: String,
|
||||
format: String,
|
||||
negative_format: String
|
||||
).returns(String)
|
||||
end
|
||||
def number_to_currency(number, locale: :en, precision: 2, unit: "$", separator: ".", delimiter: ",", format: "%u%n", negative_format: "-%u%n"); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
number: T.any(Integer, Float, String),
|
||||
locale: Symbol,
|
||||
delimiter: String,
|
||||
separator: String,
|
||||
delimiter_pattern: T.nilable(Regexp)
|
||||
).returns(String)
|
||||
end
|
||||
def number_to_delimited(number, locale: :en, delimiter: ",", separator: ".", delimiter_pattern: nil); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
number: T.any(Integer, Float, String),
|
||||
locale: Symbol,
|
||||
precision: T.nilable(Integer),
|
||||
significant: T::Boolean,
|
||||
separator: String,
|
||||
delimiter: String,
|
||||
strip_insignificant_zeros: T::Boolean,
|
||||
units: T.any(T::Hash[T.untyped, T.untyped], String, Symbol),
|
||||
format: String
|
||||
).returns(String)
|
||||
end
|
||||
def number_to_human(number, locale: :en, precision: 3, significant: true, separator: ".", delimiter: "", strip_insignificant_zeros: true, units: {}, format: "%n %u"); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
number: T.any(Integer, Float, String),
|
||||
locale: Symbol,
|
||||
precision: T.nilable(Integer),
|
||||
significant: T::Boolean,
|
||||
separator: String,
|
||||
delimiter: String,
|
||||
strip_insignificant_zeros: T::Boolean
|
||||
).returns(String)
|
||||
end
|
||||
def number_to_human_size(number, locale: :en, precision: 3, significant: true, separator: ".", delimiter: "", strip_insignificant_zeros: true); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
number: T.any(Integer, Float, String),
|
||||
locale: Symbol,
|
||||
precision: T.nilable(Integer),
|
||||
significant: T::Boolean,
|
||||
separator: String,
|
||||
delimiter: String,
|
||||
strip_insignificant_zeros: T::Boolean,
|
||||
format: String
|
||||
).returns(String)
|
||||
end
|
||||
def number_to_percentage(number, locale: :en, precision: 3, significant: false, separator: ".", delimiter: "", strip_insignificant_zeros: false, format: "%n%"); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
number: T.any(Integer, Float, String),
|
||||
area_code: T::Boolean,
|
||||
delimiter: String,
|
||||
extension: T.nilable(Integer),
|
||||
country_code: T.nilable(Integer),
|
||||
pattern: T.nilable(Regexp)
|
||||
).returns(String)
|
||||
end
|
||||
def number_to_phone(number, area_code: false, delimiter: "-", extension: nil, country_code: nil, pattern: nil); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
number: T.any(Integer, Float, String),
|
||||
locale: Symbol,
|
||||
precision: T.nilable(Integer),
|
||||
significant: T::Boolean,
|
||||
separator: String,
|
||||
delimiter: String,
|
||||
strip_insignificant_zeros: T::Boolean
|
||||
).returns(String)
|
||||
end
|
||||
def number_to_rounded(number, locale: :en, precision: 3, significant: false, separator: ".", delimiter: "", strip_insignificant_zeros: false); end
|
||||
end
|
||||
|
||||
module ActiveSupport::Inflector
|
||||
sig do
|
||||
params(
|
||||
term: String,
|
||||
uppercase_first_letter: T::Boolean
|
||||
).returns(String)
|
||||
end
|
||||
def camelize(term, uppercase_first_letter = true); end
|
||||
|
||||
sig { params(table_name: String).returns(String) }
|
||||
def classify(table_name); end
|
||||
|
||||
sig { params(camel_cased_word: String).returns(T.untyped) }
|
||||
def constantize(camel_cased_word); end
|
||||
|
||||
sig { params(underscored_word: String).returns(String) }
|
||||
def dasherize(underscored_word); end
|
||||
|
||||
sig { params(path: String).returns(String) }
|
||||
def deconstantize(path); end
|
||||
|
||||
sig { params(path: String).returns(String) }
|
||||
def demodulize(path); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
class_name: String,
|
||||
separate_class_name_and_id_with_underscore: T::Boolean
|
||||
).returns(String)
|
||||
end
|
||||
def foreign_key(class_name, separate_class_name_and_id_with_underscore = true); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
lower_case_and_underscored_word: String,
|
||||
capitalize: T::Boolean,
|
||||
keep_id_suffix: T::Boolean
|
||||
).returns(String)
|
||||
end
|
||||
def humanize(lower_case_and_underscored_word, capitalize: true, keep_id_suffix: false); end
|
||||
|
||||
sig { params(locale: Symbol, blk: T.untyped).returns(T.untyped) }
|
||||
def inflections(locale = :en, &blk); end
|
||||
|
||||
sig { params(number: Integer).returns(String) }
|
||||
def ordinal(number); end
|
||||
|
||||
sig { params(number: Integer).returns(String) }
|
||||
def ordinalize(number); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
string: String,
|
||||
separator: String,
|
||||
preserve_case: T::Boolean,
|
||||
locale: Symbol
|
||||
).returns(String)
|
||||
end
|
||||
def parameterize(string, separator: '-', preserve_case: false, locale: nil); end
|
||||
|
||||
sig { params(word: String, locale: Symbol).returns(String) }
|
||||
def pluralize(word, locale = :en); end
|
||||
|
||||
sig { params(camel_cased_word: String).returns(T.untyped) }
|
||||
def safe_constantize(camel_cased_word); end
|
||||
|
||||
sig { params(word: String, locale: Symbol).returns(String) }
|
||||
def singularize(word, locale = :en); end
|
||||
|
||||
sig { params(class_name: String).returns(String) }
|
||||
def tableize(class_name); end
|
||||
|
||||
sig { params(word: String, keep_id_suffix: T::Boolean).returns(String) }
|
||||
def titleize(word, keep_id_suffix: false); end
|
||||
|
||||
sig { params(string: String, replacement: String, locale: Symbol).returns(String) }
|
||||
def transliterate(string, replacement = '?', locale: nil); end
|
||||
|
||||
sig { params(camel_cased_word: String).returns(String) }
|
||||
def underscore(camel_cased_word); end
|
||||
|
||||
sig { params(string: String).returns(String) }
|
||||
def upcase_first(string); end
|
||||
end
|
||||
|
||||
|
||||
# defines some of the methods at https://github.com/rails/rails/blob/v6.0.0/activesupport/lib/active_support/core_ext/time/calculations.rb
|
||||
# these get added to Time, but are available on TimeWithZone thanks to https://github.com/rails/rails/blob/v6.0.0/activesupport/lib/active_support/time_with_zone.rb#L520
|
||||
# this is not a complete definition!
|
||||
class ActiveSupport::TimeWithZone
|
||||
sig { returns(ActiveSupport::TimeWithZone) }
|
||||
def midnight; end
|
||||
|
||||
sig { returns(ActiveSupport::TimeWithZone) }
|
||||
def beginning_of_day; end
|
||||
|
||||
sig { returns(ActiveSupport::TimeWithZone) }
|
||||
def at_midnight; end
|
||||
|
||||
sig { returns(ActiveSupport::TimeWithZone) }
|
||||
def at_beginning_of_day; end
|
||||
|
||||
sig { returns(ActiveSupport::TimeWithZone) }
|
||||
def middle_of_day; end
|
||||
|
||||
sig { returns(ActiveSupport::TimeWithZone) }
|
||||
def midday; end
|
||||
|
||||
sig { returns(ActiveSupport::TimeWithZone) }
|
||||
def noon; end
|
||||
|
||||
sig { returns(ActiveSupport::TimeWithZone) }
|
||||
def at_midday; end
|
||||
|
||||
sig { returns(ActiveSupport::TimeWithZone) }
|
||||
def at_noon; end
|
||||
|
||||
sig { returns(ActiveSupport::TimeWithZone) }
|
||||
def at_middle_of_day; end
|
||||
end
|
||||
|
||||
# defines some of the methods at https://github.com/rails/rails/blob/v6.0.0/activesupport/lib/active_support/core_ext/date
|
||||
# this is not a complete definition!
|
||||
class Date
|
||||
sig { params(options: T::Hash[Symbol, Integer]).returns(Date) }
|
||||
def advance(options); end
|
||||
end
|
||||
|
||||
# defines some of the methods at https://github.com/rails/rails/blob/v6.0.0/activesupport/lib/active_support/core_ext/time
|
||||
# this is not a complete definition!
|
||||
class Time
|
||||
sig { returns(Time) }
|
||||
def midnight; end
|
||||
|
||||
sig { returns(Time) }
|
||||
def beginning_of_day; end
|
||||
|
||||
sig { params(options: T::Hash[Symbol, Integer]).returns(Time) }
|
||||
def advance(options); end
|
||||
|
||||
sig { returns(Time) }
|
||||
def at_midnight; end
|
||||
|
||||
sig { returns(Time) }
|
||||
def at_beginning_of_day; end
|
||||
|
||||
sig { returns(Time) }
|
||||
def middle_of_day; end
|
||||
|
||||
sig { returns(Time) }
|
||||
def midday; end
|
||||
|
||||
sig { returns(Time) }
|
||||
def noon; end
|
||||
|
||||
sig { returns(Time) }
|
||||
def at_midday; end
|
||||
|
||||
sig { returns(Time) }
|
||||
def at_noon; end
|
||||
|
||||
sig { returns(Time) }
|
||||
def at_middle_of_day; end
|
||||
|
||||
# https://github.com/rails/rails/blob/v6.0.0/activesupport/lib/active_support/core_ext/date_and_time/zones.rb
|
||||
sig { params(zone: String).returns(T.any(Time, ActiveSupport::TimeWithZone)) }
|
||||
def in_time_zone(zone = ::Time.zone); end
|
||||
end
|
||||
|
||||
# defines some of the methods at https://github.com/rails/rails/tree/v6.0.0/activesupport/lib/active_support/core_ext/hash
|
||||
# this is not a complete definition!
|
||||
class Hash
|
||||
sig { returns(T::Hash[String, T.untyped]) }
|
||||
def stringify_keys; end
|
||||
|
||||
sig { returns(T::Hash[String, T.untyped]) }
|
||||
def stringify_keys!; end
|
||||
|
||||
sig { returns(T::Hash[String, T.untyped]) }
|
||||
def deep_stringify_keys; end
|
||||
|
||||
sig { returns(T::Hash[String, T.untyped]) }
|
||||
def deep_stringify_keys!; end
|
||||
|
||||
sig { returns(T::Hash[Symbol, T.untyped]) }
|
||||
def symbolize_keys; end
|
||||
|
||||
sig { returns(T::Hash[Symbol, T.untyped]) }
|
||||
def symbolize_keys!; end
|
||||
|
||||
sig { returns(T::Hash[Symbol, T.untyped]) }
|
||||
def deep_symbolize_keys; end
|
||||
|
||||
sig { returns(T::Hash[Symbol, T.untyped]) }
|
||||
def deep_symbolize_keys!; end
|
||||
|
||||
# in an ideal world, `arg` would be the type of all keys, the 1st `T.untyped` would be
|
||||
# the type of keys your block returns, and the 2nd `T.untyped` would be the type of values
|
||||
# that the hash had.
|
||||
sig { params(block: T.proc.params(arg: T.untyped).void).returns(T::Hash[T.untyped, T.untyped]) }
|
||||
def deep_transform_keys(&block); end
|
||||
|
||||
sig { params(block: T.proc.params(arg: T.untyped).void).returns(T::Hash[T.untyped, T.untyped]) }
|
||||
def deep_transform_keys!(&block); end
|
||||
|
||||
sig { returns(T::Hash[Symbol, T.untyped]) }
|
||||
def to_options; end
|
||||
end
|
||||
|
||||
class Numeric
|
||||
sig { returns(ActiveSupport::Duration) }
|
||||
def second; end
|
||||
|
||||
sig { returns(ActiveSupport::Duration) }
|
||||
def seconds; end
|
||||
|
||||
sig { returns(ActiveSupport::Duration) }
|
||||
def minute; end
|
||||
|
||||
sig { returns(ActiveSupport::Duration) }
|
||||
def minutes; end
|
||||
|
||||
sig { returns(ActiveSupport::Duration) }
|
||||
def hour; end
|
||||
|
||||
sig { returns(ActiveSupport::Duration) }
|
||||
def hours; end
|
||||
|
||||
sig { returns(ActiveSupport::Duration) }
|
||||
def day; end
|
||||
|
||||
sig { returns(ActiveSupport::Duration) }
|
||||
def days; end
|
||||
|
||||
sig { returns(ActiveSupport::Duration) }
|
||||
def week; end
|
||||
|
||||
sig { returns(ActiveSupport::Duration) }
|
||||
def weeks; end
|
||||
|
||||
sig { returns(ActiveSupport::Duration) }
|
||||
def fortnight; end
|
||||
|
||||
sig { returns(ActiveSupport::Duration) }
|
||||
def fortnights; end
|
||||
|
||||
sig { returns(T.self_type) }
|
||||
def in_milliseconds; end
|
||||
end
|
||||
|
||||
module Enumerable
|
||||
# https://github.com/rails/rails/blob/v5.2.3/activesupport/lib/active_support/core_ext/enumerable.rb#L64..L72
|
||||
# the case where a block isn't given isn't handled - that seems like an unlikely case
|
||||
sig do
|
||||
type_parameters(:key).params(
|
||||
block: T.proc.params(o: Enumerable::Elem).returns(T.type_parameter(:key))
|
||||
).returns(
|
||||
T::Hash[T.type_parameter(:key), Enumerable::Elem]
|
||||
)
|
||||
end
|
||||
def index_by(&block); end
|
||||
end
|
||||
|
||||
class ActiveSupport::Duration
|
||||
sig { returns(Integer) }
|
||||
def to_i; end
|
||||
|
||||
sig { returns(Float) }
|
||||
def to_f; end
|
||||
|
||||
sig { returns(String) }
|
||||
def to_s; end
|
||||
end
|
8684
sorbet/rbi/sorbet-typed/lib/bundler/all/bundler.rbi
Normal file
8684
sorbet/rbi/sorbet-typed/lib/bundler/all/bundler.rbi
Normal file
File diff suppressed because it is too large
Load diff
102
sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi
Normal file
102
sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi
Normal file
|
@ -0,0 +1,102 @@
|
|||
# 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/minitest/all/minitest.rbi
|
||||
#
|
||||
# typed: strong
|
||||
|
||||
module Minitest
|
||||
class Runnable
|
||||
end
|
||||
|
||||
class Test < Runnable
|
||||
include Minitest::Assertions
|
||||
end
|
||||
end
|
||||
|
||||
module Minitest::Assertions
|
||||
extend T::Sig
|
||||
|
||||
sig { params(test: T.untyped, msg: T.nilable(String)).returns(TrueClass) }
|
||||
def assert(test, msg = nil); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
exp: BasicObject,
|
||||
msg: T.nilable(String)
|
||||
).returns(TrueClass)
|
||||
end
|
||||
def assert_empty(exp, msg = nil); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
exp: BasicObject,
|
||||
act: BasicObject,
|
||||
msg: T.nilable(String)
|
||||
).returns(TrueClass)
|
||||
end
|
||||
def assert_equal(exp, act, msg = nil); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
collection: T::Enumerable[T.untyped],
|
||||
obj: BasicObject,
|
||||
msg: T.nilable(String)
|
||||
).returns(TrueClass)
|
||||
end
|
||||
def assert_includes(collection, obj, msg = nil); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
obj: BasicObject,
|
||||
msg: T.nilable(String)
|
||||
).returns(TrueClass)
|
||||
end
|
||||
def assert_nil(obj, msg = nil); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
exp: T.untyped
|
||||
).returns(TrueClass)
|
||||
end
|
||||
def assert_raises(*exp); end
|
||||
|
||||
sig { params(test: T.untyped, msg: T.nilable(String)).returns(TrueClass) }
|
||||
def refute(test, msg = nil); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
exp: BasicObject,
|
||||
msg: T.nilable(String)
|
||||
).returns(TrueClass)
|
||||
end
|
||||
def refute_empty(exp, msg = nil); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
exp: BasicObject,
|
||||
act: BasicObject,
|
||||
msg: T.nilable(String)
|
||||
).returns(TrueClass)
|
||||
end
|
||||
def refute_equal(exp, act, msg = nil); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
collection: T::Enumerable[T.untyped],
|
||||
obj: BasicObject,
|
||||
msg: T.nilable(String)
|
||||
).returns(TrueClass)
|
||||
end
|
||||
def refute_includes(collection, obj, msg = nil); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
obj: BasicObject,
|
||||
msg: T.nilable(String)
|
||||
).returns(TrueClass)
|
||||
end
|
||||
def refute_nil(obj, msg = nil); end
|
||||
end
|
695
sorbet/rbi/sorbet-typed/lib/paperclip/all/paperclip.rbi
Normal file
695
sorbet/rbi/sorbet-typed/lib/paperclip/all/paperclip.rbi
Normal file
|
@ -0,0 +1,695 @@
|
|||
# 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/paperclip/all/paperclip.rbi
|
||||
#
|
||||
# typed: strong
|
||||
|
||||
#############
|
||||
# START: this is copied from sorbet/rbi/gems/paperclip.rbi for paperclip v5.2.1
|
||||
#############
|
||||
module Paperclip
|
||||
def self.current_attachments_styles; end
|
||||
def self.get_registered_attachments_styles; end
|
||||
def self.io_adapters; end
|
||||
def self.io_adapters=(new_registry); end
|
||||
def self.missing_attachments_styles; end
|
||||
def self.options; end
|
||||
def self.registered_attachments_styles_path; end
|
||||
def self.registered_attachments_styles_path=(arg0); end
|
||||
def self.save_current_attachments_styles!; end
|
||||
extend Paperclip::Helpers
|
||||
extend Paperclip::Logger
|
||||
extend Paperclip::ProcessorHelpers
|
||||
end
|
||||
class Paperclip::GeometryParser
|
||||
def initialize(string); end
|
||||
def make; end
|
||||
def match; end
|
||||
end
|
||||
class Paperclip::GeometryDetector
|
||||
def geometry_string; end
|
||||
def initialize(file); end
|
||||
def make; end
|
||||
def path; end
|
||||
def raise_because_imagemagick_missing; end
|
||||
def raise_if_blank_file; end
|
||||
end
|
||||
class Paperclip::Geometry
|
||||
def aspect; end
|
||||
def auto_orient; end
|
||||
def cropping(dst, ratio, scale); end
|
||||
def height; end
|
||||
def height=(arg0); end
|
||||
def horizontal?; end
|
||||
def initialize(width = nil, height = nil, modifier = nil); end
|
||||
def inspect; end
|
||||
def larger; end
|
||||
def modifier; end
|
||||
def modifier=(arg0); end
|
||||
def resize_to(geometry); end
|
||||
def scale_to(new_geometry); end
|
||||
def scaling(dst, ratio); end
|
||||
def self.from_file(file); end
|
||||
def self.parse(string); end
|
||||
def smaller; end
|
||||
def square?; end
|
||||
def to_s; end
|
||||
def transformation_to(dst, crop = nil); end
|
||||
def vertical?; end
|
||||
def width; end
|
||||
def width=(arg0); end
|
||||
end
|
||||
class Paperclip::Processor
|
||||
def attachment; end
|
||||
def attachment=(arg0); end
|
||||
def convert(arguments = nil, local_options = nil); end
|
||||
def file; end
|
||||
def file=(arg0); end
|
||||
def identify(arguments = nil, local_options = nil); end
|
||||
def initialize(file, options = nil, attachment = nil); end
|
||||
def make; end
|
||||
def options; end
|
||||
def options=(arg0); end
|
||||
def self.make(file, options = nil, attachment = nil); end
|
||||
end
|
||||
module Paperclip::ProcessorHelpers
|
||||
def clear_processors!; end
|
||||
def load_processor(name); end
|
||||
def processor(name); end
|
||||
def register_processor(name, processor); end
|
||||
end
|
||||
class Paperclip::ProcessorHelpers::NoSuchProcessor < StandardError
|
||||
end
|
||||
# class Paperclip::Tempfile < Tempfile
|
||||
# def make_tmpname(prefix_suffix, n); end
|
||||
# end
|
||||
module Paperclip::TempfileEncoding
|
||||
def binmode; end
|
||||
end
|
||||
class Paperclip::Thumbnail < Paperclip::Processor
|
||||
def animated; end
|
||||
def animated=(arg0); end
|
||||
def animated?; end
|
||||
def auto_orient; end
|
||||
def auto_orient=(arg0); end
|
||||
def convert_options; end
|
||||
def convert_options=(arg0); end
|
||||
def convert_options?; end
|
||||
def crop?; end
|
||||
def current_geometry; end
|
||||
def current_geometry=(arg0); end
|
||||
def format; end
|
||||
def format=(arg0); end
|
||||
def frame_index; end
|
||||
def frame_index=(arg0); end
|
||||
def identified_as_animated?; end
|
||||
def initialize(file, options = nil, attachment = nil); end
|
||||
def make; end
|
||||
def multi_frame_format?; end
|
||||
def source_file_options; end
|
||||
def source_file_options=(arg0); end
|
||||
def target_geometry; end
|
||||
def target_geometry=(arg0); end
|
||||
def transformation_command; end
|
||||
def whiny; end
|
||||
def whiny=(arg0); end
|
||||
end
|
||||
module Paperclip::Interpolations
|
||||
def attachment(attachment, style_name); end
|
||||
def basename(attachment, style_name); end
|
||||
def class(attachment = nil, style_name = nil); end
|
||||
def content_type_extension(attachment, style_name); end
|
||||
def dotextension(attachment, style_name); end
|
||||
def extension(attachment, style_name); end
|
||||
def filename(attachment, style_name); end
|
||||
def fingerprint(attachment, style_name); end
|
||||
def hash(attachment = nil, style_name = nil); end
|
||||
def id(attachment, style_name); end
|
||||
def id_partition(attachment, style_name); end
|
||||
def param(attachment, style_name); end
|
||||
def rails_env(attachment, style_name); end
|
||||
def rails_root(attachment, style_name); end
|
||||
def self.[](name); end
|
||||
def self.[]=(name, block); end
|
||||
def self.all; end
|
||||
def self.interpolate(pattern, *args); end
|
||||
def self.interpolators_cache; end
|
||||
def self.plural_cache; end
|
||||
def style(attachment, style_name); end
|
||||
def timestamp(attachment, style_name); end
|
||||
def updated_at(attachment, style_name); end
|
||||
def url(attachment, style_name); end
|
||||
extend Paperclip::Interpolations
|
||||
end
|
||||
class Paperclip::Interpolations::PluralCache
|
||||
def initialize; end
|
||||
def pluralize_symbol(symbol); end
|
||||
def underscore_and_pluralize_class(klass); end
|
||||
end
|
||||
class Paperclip::TempfileFactory
|
||||
def basename; end
|
||||
def extension; end
|
||||
def generate(name = nil); end
|
||||
def random_name; end
|
||||
end
|
||||
class Paperclip::Style
|
||||
def [](key); end
|
||||
def []=(key, value); end
|
||||
def attachment; end
|
||||
def convert_options; end
|
||||
def default_format; end
|
||||
def format; end
|
||||
def geometry; end
|
||||
def initialize(name, definition, attachment); end
|
||||
def name; end
|
||||
def processor_options; end
|
||||
def processors; end
|
||||
def source_file_options; end
|
||||
def whiny; end
|
||||
def whiny?; end
|
||||
end
|
||||
class Paperclip::UrlGenerator
|
||||
def attachment; end
|
||||
def attachment_options(*args, &block); end
|
||||
def default_url; end
|
||||
def escape_regex; end
|
||||
def escape_url(url); end
|
||||
def escape_url_as_needed(url, options); end
|
||||
def for(style_name, options); end
|
||||
def initialize(attachment); end
|
||||
def most_appropriate_url; end
|
||||
def timestamp_as_needed(url, options); end
|
||||
def timestamp_possible?; end
|
||||
end
|
||||
class Paperclip::Attachment
|
||||
def able_to_store_created_at?; end
|
||||
def active_validator_classes; end
|
||||
def after_flush_writes; end
|
||||
def as_json(options = nil); end
|
||||
def assign(uploaded_file); end
|
||||
def assign_attributes; end
|
||||
def assign_file_information; end
|
||||
def assign_fingerprint; end
|
||||
def assign_timestamps; end
|
||||
def blank?; end
|
||||
def cleanup_filename(filename); end
|
||||
def clear(*styles_to_clear); end
|
||||
def content_type; end
|
||||
def convert_options; end
|
||||
def created_at; end
|
||||
def default_options; end
|
||||
def default_style; end
|
||||
def destroy; end
|
||||
def dirty!; end
|
||||
def dirty?; end
|
||||
def ensure_required_accessors!; end
|
||||
def ensure_required_validations!; end
|
||||
def errors; end
|
||||
def expiring_url(time = nil, style_name = nil); end
|
||||
def extra_options_for(style); end
|
||||
def extra_source_file_options_for(style); end
|
||||
def file?; end
|
||||
def filename_cleaner; end
|
||||
def fingerprint; end
|
||||
def flush_errors; end
|
||||
def has_enabled_but_unset_created_at?; end
|
||||
def hash_key(style_name = nil); end
|
||||
def initialize(name, instance, options = nil); end
|
||||
def initialize_storage; end
|
||||
def instance; end
|
||||
def instance_read(attr); end
|
||||
def instance_respond_to?(attr); end
|
||||
def instance_write(attr, value); end
|
||||
def interpolate(pattern, style_name = nil); end
|
||||
def interpolator; end
|
||||
def log(message); end
|
||||
def missing_required_validator?; end
|
||||
def name; end
|
||||
def only_process; end
|
||||
def options; end
|
||||
def original_filename; end
|
||||
def path(style_name = nil); end
|
||||
def path_option; end
|
||||
def post_process(*style_args); end
|
||||
def post_process_file; end
|
||||
def post_process_style(name, style); end
|
||||
def post_process_styles(*style_args); end
|
||||
def post_processing; end
|
||||
def post_processing=(arg0); end
|
||||
def present?; end
|
||||
def process_options(options_type, style); end
|
||||
def process_style?(style_name, style_args); end
|
||||
def processors; end
|
||||
def queue_all_for_delete; end
|
||||
def queue_some_for_delete(*styles); end
|
||||
def queued_for_write; end
|
||||
def reprocess!(*style_args); end
|
||||
def reset_file_if_original_reprocessed; end
|
||||
def reset_updater; end
|
||||
def save; end
|
||||
def self.default_options; end
|
||||
def size; end
|
||||
def source_file_options; end
|
||||
def staged?; end
|
||||
def staged_path(style_name = nil); end
|
||||
def styles; end
|
||||
def time_zone; end
|
||||
def to_s(style_name = nil); end
|
||||
def unlink_files(files); end
|
||||
def updated_at; end
|
||||
def updater; end
|
||||
def uploaded_file; end
|
||||
def url(style_name = nil, options = nil); end
|
||||
def whiny; end
|
||||
end
|
||||
module Paperclip::Storage
|
||||
end
|
||||
module Paperclip::Storage::Filesystem
|
||||
def copy_to_local_file(style, local_dest_path); end
|
||||
def exists?(style_name = nil); end
|
||||
def flush_deletes; end
|
||||
def flush_writes; end
|
||||
def move_file(src, dest); end
|
||||
def self.extended(base); end
|
||||
end
|
||||
module Paperclip::Storage::Fog
|
||||
def connection; end
|
||||
def convert_time(time); end
|
||||
def copy_to_local_file(style, local_dest_path); end
|
||||
def directory; end
|
||||
def directory_name; end
|
||||
def dynamic_fog_host_for_style(style); end
|
||||
def exists?(style = nil); end
|
||||
def expiring_url(time = nil, style_name = nil); end
|
||||
def find_credentials(creds); end
|
||||
def flush_deletes; end
|
||||
def flush_writes; end
|
||||
def fog_credentials; end
|
||||
def fog_file; end
|
||||
def fog_public(style = nil); end
|
||||
def host_name_for_directory; end
|
||||
def parse_credentials(creds); end
|
||||
def public_url(style = nil); end
|
||||
def scheme; end
|
||||
def self.extended(base); end
|
||||
end
|
||||
module Paperclip::Storage::S3
|
||||
def bucket_name; end
|
||||
def copy_to_local_file(style, local_dest_path); end
|
||||
def create_bucket; end
|
||||
def exists?(style = nil); end
|
||||
def expiring_url(time = nil, style_name = nil); end
|
||||
def find_credentials(creds); end
|
||||
def flush_deletes; end
|
||||
def flush_writes; end
|
||||
def http_proxy_host; end
|
||||
def http_proxy_password; end
|
||||
def http_proxy_port; end
|
||||
def http_proxy_user; end
|
||||
def merge_s3_headers(http_headers, s3_headers, s3_metadata); end
|
||||
def obtain_s3_instance_for(options); end
|
||||
def parse_credentials(creds); end
|
||||
def s3_bucket; end
|
||||
def s3_credentials; end
|
||||
def s3_host_alias; end
|
||||
def s3_host_name; end
|
||||
def s3_interface; end
|
||||
def s3_object(style_name = nil); end
|
||||
def s3_permissions(style = nil); end
|
||||
def s3_prefixes_in_alias; end
|
||||
def s3_protocol(style = nil, with_colon = nil); end
|
||||
def s3_region; end
|
||||
def s3_storage_class(style = nil); end
|
||||
def s3_url_options; end
|
||||
def self.extended(base); end
|
||||
def set_permissions(permissions); end
|
||||
def set_storage_class(storage_class); end
|
||||
def style_name_as_path(style_name); end
|
||||
def use_accelerate_endpoint?; end
|
||||
def use_secure_protocol?(style_name); end
|
||||
def using_http_proxy?; end
|
||||
end
|
||||
module Paperclip::Callbacks
|
||||
def self.included(base); end
|
||||
end
|
||||
module Paperclip::Callbacks::Defining
|
||||
def define_paperclip_callbacks(*callbacks); end
|
||||
def hasta_la_vista_baby; end
|
||||
end
|
||||
module Paperclip::Callbacks::Running
|
||||
def run_paperclip_callbacks(callback, &block); end
|
||||
end
|
||||
class Paperclip::FileCommandContentTypeDetector
|
||||
def detect; end
|
||||
def initialize(filename); end
|
||||
def type_from_file_command; end
|
||||
end
|
||||
class Paperclip::MediaTypeSpoofDetector
|
||||
def calculated_content_type; end
|
||||
def calculated_media_type; end
|
||||
def calculated_type_mismatch?; end
|
||||
def content_types_from_name; end
|
||||
def filename_extension; end
|
||||
def has_extension?; end
|
||||
def has_name?; end
|
||||
def initialize(file, name, content_type); end
|
||||
def mapped_content_type; end
|
||||
def mapping_override_mismatch?; end
|
||||
def media_type_mismatch?; end
|
||||
def media_types_from_name; end
|
||||
def self.using(file, name, content_type); end
|
||||
def spoofed?; end
|
||||
def supplied_content_type; end
|
||||
def supplied_media_type; end
|
||||
def supplied_type_mismatch?; end
|
||||
def type_from_file_command; end
|
||||
end
|
||||
class Paperclip::ContentTypeDetector
|
||||
def blank_name?; end
|
||||
def calculated_type_matches; end
|
||||
def detect; end
|
||||
def empty?; end
|
||||
def empty_file?; end
|
||||
def initialize(filepath); end
|
||||
def possible_types; end
|
||||
def type_from_file_command; end
|
||||
def type_from_file_contents; end
|
||||
def type_from_mime_magic; end
|
||||
end
|
||||
module Paperclip::Validators
|
||||
extend ActiveSupport::Concern
|
||||
end
|
||||
class Paperclip::Validators::AttachmentContentTypeValidator < ActiveModel::EachValidator
|
||||
def allowed_types; end
|
||||
def check_validity!; end
|
||||
def forbidden_types; end
|
||||
def initialize(options); end
|
||||
def mark_invalid(record, attribute, types); end
|
||||
def self.helper_method_name; end
|
||||
def validate_blacklist(record, attribute, value); end
|
||||
def validate_each(record, attribute, value); end
|
||||
def validate_whitelist(record, attribute, value); end
|
||||
end
|
||||
module Paperclip::Validators::HelperMethods
|
||||
def do_not_validate_attachment_file_type(*attr_names); end
|
||||
def validates_attachment_content_type(*attr_names); end
|
||||
def validates_attachment_file_name(*attr_names); end
|
||||
def validates_attachment_presence(*attr_names); end
|
||||
def validates_attachment_size(*attr_names); end
|
||||
def validates_media_type_spoof_detection(*attr_names); end
|
||||
end
|
||||
class Paperclip::Validators::AttachmentFileNameValidator < ActiveModel::EachValidator
|
||||
def allowed; end
|
||||
def check_validity!; end
|
||||
def forbidden; end
|
||||
def initialize(options); end
|
||||
def mark_invalid(record, attribute, patterns); end
|
||||
def self.helper_method_name; end
|
||||
def validate_blacklist(record, attribute, value); end
|
||||
def validate_each(record, attribute, value); end
|
||||
def validate_whitelist(record, attribute, value); end
|
||||
end
|
||||
class Paperclip::Validators::AttachmentPresenceValidator < ActiveModel::EachValidator
|
||||
def self.helper_method_name; end
|
||||
def validate_each(record, attribute, value); end
|
||||
end
|
||||
class Paperclip::Validators::AttachmentSizeValidator < ActiveModel::Validations::NumericalityValidator
|
||||
def check_validity!; end
|
||||
def extract_option_value(option, option_value); end
|
||||
def extract_options(options); end
|
||||
def human_size(size); end
|
||||
def initialize(options); end
|
||||
def max_value_in_human_size(record); end
|
||||
def min_value_in_human_size(record); end
|
||||
def self.helper_method_name; end
|
||||
def validate_each(record, attr_name, value); end
|
||||
end
|
||||
class Paperclip::Validators::MediaTypeSpoofDetectionValidator < ActiveModel::EachValidator
|
||||
def validate_each(record, attribute, value); end
|
||||
end
|
||||
class Paperclip::Validators::AttachmentFileTypeIgnoranceValidator < ActiveModel::EachValidator
|
||||
def self.helper_method_name; end
|
||||
def validate_each(record, attribute, value); end
|
||||
end
|
||||
module Paperclip::Validators::ClassMethods
|
||||
def create_validating_before_filter(attribute, validator_class, options); end
|
||||
def validate_before_processing(validator_class, options); end
|
||||
def validates_attachment(*attributes); end
|
||||
end
|
||||
module Paperclip::Schema
|
||||
def self.included(base); end
|
||||
end
|
||||
module Paperclip::Schema::Statements
|
||||
def add_attachment(table_name, *attachment_names); end
|
||||
def drop_attached_file(*args); end
|
||||
def remove_attachment(table_name, *attachment_names); end
|
||||
end
|
||||
module Paperclip::Schema::TableDefinition
|
||||
def attachment(*attachment_names); end
|
||||
def has_attached_file(*attachment_names); end
|
||||
end
|
||||
module Paperclip::Schema::CommandRecorder
|
||||
def add_attachment(*args); end
|
||||
def invert_add_attachment(args); end
|
||||
end
|
||||
module Paperclip::Glue
|
||||
def self.included(base); end
|
||||
end
|
||||
class Paperclip::Error < StandardError
|
||||
end
|
||||
module Paperclip::Errors
|
||||
end
|
||||
class Paperclip::Errors::StorageMethodNotFound < Paperclip::Error
|
||||
end
|
||||
class Paperclip::Errors::CommandNotFoundError < Paperclip::Error
|
||||
end
|
||||
class Paperclip::Errors::MissingRequiredValidatorError < Paperclip::Error
|
||||
end
|
||||
class Paperclip::Errors::NotIdentifiedByImageMagickError < Paperclip::Error
|
||||
end
|
||||
class Paperclip::Errors::InfiniteInterpolationError < Paperclip::Error
|
||||
end
|
||||
class Paperclip::AttachmentRegistry
|
||||
def clear; end
|
||||
def definitions_for(klass); end
|
||||
def each_definition; end
|
||||
def initialize; end
|
||||
def names_for(klass); end
|
||||
def register(klass, attachment_name, attachment_options); end
|
||||
def self.allocate; end
|
||||
def self.clear; end
|
||||
def self.definitions_for(klass); end
|
||||
def self.each_definition(&block); end
|
||||
def self.instance; end
|
||||
def self.names_for(klass); end
|
||||
def self.new(*arg0); end
|
||||
def self.register(klass, attachment_name, attachment_options); end
|
||||
extend Singleton::SingletonClassMethods
|
||||
include Singleton
|
||||
end
|
||||
module Paperclip::Logger
|
||||
def log(message); end
|
||||
def logger; end
|
||||
def logger=(logger); end
|
||||
def logging?; end
|
||||
end
|
||||
module Paperclip::Helpers
|
||||
def class_for(class_name); end
|
||||
def configure; end
|
||||
def each_instance_with_attachment(klass, name); end
|
||||
def interpolates(key, &block); end
|
||||
def reset_duplicate_clash_check!; end
|
||||
def run(cmd, arguments = nil, interpolation_values = nil, local_options = nil); end
|
||||
end
|
||||
class Paperclip::HasAttachedFile
|
||||
def add_active_record_callbacks; end
|
||||
def add_paperclip_callbacks; end
|
||||
def add_required_validations; end
|
||||
def define; end
|
||||
def define_class_getter; end
|
||||
def define_flush_errors; end
|
||||
def define_getters; end
|
||||
def define_instance_getter; end
|
||||
def define_query; end
|
||||
def define_setter; end
|
||||
def initialize(klass, name, options); end
|
||||
def register_new_attachment; end
|
||||
def self.define_on(klass, name, options); end
|
||||
end
|
||||
module Paperclip::HasAttachedFile::ClassMethods
|
||||
def attachment_definitions; end
|
||||
end
|
||||
class Paperclip::FilenameCleaner
|
||||
def call(filename); end
|
||||
def initialize(invalid_character_regex); end
|
||||
end
|
||||
class Paperclip::RailsEnvironment
|
||||
def get; end
|
||||
def rails_environment_exists?; end
|
||||
def rails_exists?; end
|
||||
def self.get; end
|
||||
end
|
||||
class Paperclip::Railtie < Rails::Railtie
|
||||
def self.insert; end
|
||||
end
|
||||
class Paperclip::AdapterRegistry
|
||||
def for(target, options = nil); end
|
||||
def handler_for(target); end
|
||||
def initialize; end
|
||||
def register(handler_class, &block); end
|
||||
def registered?(target); end
|
||||
def registered_handlers; end
|
||||
def unregister(handler_class); end
|
||||
end
|
||||
class Paperclip::AdapterRegistry::NoHandlerError < Paperclip::Error
|
||||
end
|
||||
class Paperclip::AbstractAdapter
|
||||
def assignment?; end
|
||||
def binmode(*args, &block); end
|
||||
def binmode?(*args, &block); end
|
||||
def close!(*args, &block); end
|
||||
def close(*args, &block); end
|
||||
def closed?(*args, &block); end
|
||||
def content_type; end
|
||||
def copy_to_tempfile(src); end
|
||||
def destination; end
|
||||
def eof?(*args, &block); end
|
||||
def fingerprint; end
|
||||
def initialize(target, options = nil); end
|
||||
def inspect; end
|
||||
def length; end
|
||||
def link_or_copy_file(src, dest); end
|
||||
def nil?; end
|
||||
def original_filename; end
|
||||
def original_filename=(new_filename); end
|
||||
def path(*args, &block); end
|
||||
def read(length = nil, buffer = nil); end
|
||||
def readbyte(*args, &block); end
|
||||
def rewind(*args, &block); end
|
||||
def size; end
|
||||
def unlink(*args, &block); end
|
||||
end
|
||||
class Paperclip::EmptyStringAdapter < Paperclip::AbstractAdapter
|
||||
def assignment?; end
|
||||
def nil?; end
|
||||
def self.register; end
|
||||
end
|
||||
class Paperclip::IdentityAdapter < Paperclip::AbstractAdapter
|
||||
def initialize; end
|
||||
def new(target, _); end
|
||||
def self.register; end
|
||||
end
|
||||
class Paperclip::FileAdapter < Paperclip::AbstractAdapter
|
||||
def cache_current_values; end
|
||||
def initialize(target, options = nil); end
|
||||
def self.register; end
|
||||
end
|
||||
class Paperclip::StringioAdapter < Paperclip::AbstractAdapter
|
||||
def cache_current_values; end
|
||||
def content_type=(arg0); end
|
||||
def copy_to_tempfile(source); end
|
||||
def initialize(target, options = nil); end
|
||||
def self.register; end
|
||||
end
|
||||
class Paperclip::DataUriAdapter < Paperclip::StringioAdapter
|
||||
def extract_target(uri); end
|
||||
def initialize(target_uri, options = nil); end
|
||||
def self.register; end
|
||||
end
|
||||
class Paperclip::NilAdapter < Paperclip::AbstractAdapter
|
||||
def content_type; end
|
||||
def eof?; end
|
||||
def initialize(_target, _options = nil); end
|
||||
def nil?; end
|
||||
def original_filename; end
|
||||
def read(*_args); end
|
||||
def self.register; end
|
||||
def size; end
|
||||
end
|
||||
class Paperclip::AttachmentAdapter < Paperclip::AbstractAdapter
|
||||
def cache_current_values; end
|
||||
def copy_to_tempfile(source); end
|
||||
def initialize(target, options = nil); end
|
||||
def self.register; end
|
||||
end
|
||||
class Paperclip::UploadedFileAdapter < Paperclip::AbstractAdapter
|
||||
def cache_current_values; end
|
||||
def content_type_detector; end
|
||||
def determine_content_type; end
|
||||
def initialize(target, options = nil); end
|
||||
def self.content_type_detector; end
|
||||
def self.content_type_detector=(arg0); end
|
||||
def self.register; end
|
||||
end
|
||||
class Paperclip::UriAdapter < Paperclip::AbstractAdapter
|
||||
def cache_current_values; end
|
||||
def content_type=(arg0); end
|
||||
def content_type_from_content; end
|
||||
def copy_to_tempfile(src); end
|
||||
def default_filename; end
|
||||
def download_content; end
|
||||
def filename_from_content_disposition; end
|
||||
def filename_from_path; end
|
||||
def initialize(target, options = nil); end
|
||||
def self.register; end
|
||||
end
|
||||
class Paperclip::HttpUrlProxyAdapter < Paperclip::UriAdapter
|
||||
def initialize(target, options = nil); end
|
||||
def self.register; end
|
||||
end
|
||||
module Paperclip::ClassMethods
|
||||
def has_attached_file(name, options = nil); end
|
||||
end
|
||||
#############
|
||||
# END: this is copied from sorbet/rbi/gems/paperclip.rbi for paperclip v5.2.1
|
||||
#############
|
||||
|
||||
#############
|
||||
# the glue below is so that ActiveRecord models can use paperclip.
|
||||
# some (but not all) of this would otherwise end up in hidden.rbi when srb init is run.
|
||||
#############
|
||||
class ActiveRecord::Base
|
||||
# https://github.com/thoughtbot/paperclip/blob/v6.1.0/lib/paperclip/railtie.rb#L27
|
||||
include ::Paperclip::Glue
|
||||
|
||||
# https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/glue.rb#L8
|
||||
extend Paperclip::ClassMethods
|
||||
include ::Paperclip::Callbacks
|
||||
include ::Paperclip::Callbacks::Running
|
||||
include ::Paperclip::Validators
|
||||
extend ::Paperclip::Validators::HelperMethods
|
||||
include ::Paperclip::Schema
|
||||
|
||||
extend ::Paperclip::Validators::ClassMethods
|
||||
|
||||
# https://github.com/thoughtbot/paperclip/blob/v5.2.1/lib/paperclip/callbacks.rb#L9
|
||||
# same sig as `before_save` etc in ActiveRecord
|
||||
sig do
|
||||
params(
|
||||
arg: T.nilable(Symbol),
|
||||
if: T.nilable(T.any(Symbol, Proc, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
||||
unless: T.nilable(T.any(Symbol, Proc, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
||||
).void
|
||||
end
|
||||
def self.before_post_process(
|
||||
arg = nil,
|
||||
if: nil,
|
||||
unless: nil
|
||||
); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
arg: T.nilable(Symbol),
|
||||
if: T.nilable(T.any(Symbol, Proc, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
||||
unless: T.nilable(T.any(Symbol, Proc, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
||||
).void
|
||||
end
|
||||
def self.after_post_process(
|
||||
arg = nil,
|
||||
if: nil,
|
||||
unless: nil
|
||||
); end
|
||||
end
|
25
sorbet/rbi/sorbet-typed/lib/railties/all/railties.rbi
Normal file
25
sorbet/rbi/sorbet-typed/lib/railties/all/railties.rbi
Normal file
|
@ -0,0 +1,25 @@
|
|||
# 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/railties/all/railties.rbi
|
||||
#
|
||||
# typed: strong
|
||||
|
||||
module Rails
|
||||
sig {returns(Rails::Application)}
|
||||
def self.application; end
|
||||
|
||||
sig { returns(Pathname) }
|
||||
def self.root; end
|
||||
end
|
||||
|
||||
class Rails::Application
|
||||
sig {params(blk: T.proc.bind(Rails::Application).void).void}
|
||||
def configure(&blk); end
|
||||
|
||||
sig {returns(ActionDispatch::Routing::RouteSet)}
|
||||
def routes; end
|
||||
end
|
||||
|
254
sorbet/rbi/sorbet-typed/lib/rainbow/all/rainbow.rbi
Normal file
254
sorbet/rbi/sorbet-typed/lib/rainbow/all/rainbow.rbi
Normal file
|
@ -0,0 +1,254 @@
|
|||
# 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/rainbow/all/rainbow.rbi
|
||||
#
|
||||
# typed: strong
|
||||
|
||||
module Rainbow
|
||||
sig { returns(T::Boolean) }
|
||||
attr_accessor :enabled
|
||||
|
||||
class Color
|
||||
sig { returns(Symbol) }
|
||||
attr_reader :ground
|
||||
|
||||
sig do
|
||||
params(
|
||||
ground: Symbol,
|
||||
values: T.any([Integer], [Integer, Integer, Integer])
|
||||
).returns(Color)
|
||||
end
|
||||
def self.build(ground, values); end
|
||||
|
||||
sig { params(hex: String).returns([Integer, Integer, Integer]) }
|
||||
def self.parse_hex_color(hex); end
|
||||
|
||||
class Indexed < Color
|
||||
sig { returns(Integer) }
|
||||
attr_reader :num
|
||||
|
||||
sig { params(ground: Symbol, num: Integer).returns(Indexed) }
|
||||
def initialize(ground, num); end
|
||||
|
||||
sig { returns(T::Array[Integer]) }
|
||||
def codes; end
|
||||
end
|
||||
|
||||
class Named < Indexed
|
||||
NAMES = T.let(nil, T::Hash[Symbol, Integer])
|
||||
|
||||
sig { returns(T::Array[Symbol]) }
|
||||
def self.color_names; end
|
||||
|
||||
sig { returns(String) }
|
||||
def self.valid_names; end
|
||||
|
||||
sig { params(ground: Symbol, name: Symbol).returns(Named) }
|
||||
def initialize(ground, name); end
|
||||
end
|
||||
|
||||
class RGB < Indexed
|
||||
sig { returns(Integer) }
|
||||
attr_accessor :r, :g, :b
|
||||
|
||||
sig { params(value: Numeric).returns(Integer) }
|
||||
def to_ansi_domain(value); end
|
||||
|
||||
sig { params(ground: Symbol, values: Integer).returns(RGB) }
|
||||
def initialize(ground, *values); end
|
||||
|
||||
sig { returns(T::Array[Integer]) }
|
||||
def codes; end
|
||||
end
|
||||
|
||||
class X11Named < RGB
|
||||
include X11ColorNames
|
||||
|
||||
sig { returns(T::Array[Symbol]) }
|
||||
def self.color_names; end
|
||||
|
||||
sig { returns(String) }
|
||||
def self.valid_names; end
|
||||
|
||||
sig { params(ground: Symbol, name: Symbol).returns(X11Named) }
|
||||
def initialize(ground, name); end
|
||||
end
|
||||
end
|
||||
|
||||
sig { returns(Wrapper) }
|
||||
def self.global; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def self.enabled; end
|
||||
|
||||
sig { params(value: T::Boolean).returns(T::Boolean) }
|
||||
def self.enabled=(value); end
|
||||
|
||||
sig { params(string: String).returns(String) }
|
||||
def self.uncolor(string); end
|
||||
|
||||
class NullPresenter < String
|
||||
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
|
||||
def color(*values); end
|
||||
|
||||
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
|
||||
def background(*values); end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def reset; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def bright; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def faint; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def italic; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def underline; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def blink; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def inverse; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def hide; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def cross_out; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def black; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def red; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def green; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def yellow; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def blue; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def magenta; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def cyan; end
|
||||
|
||||
sig { returns(NullPresenter) }
|
||||
def white; end
|
||||
|
||||
alias foreground color
|
||||
alias fg color
|
||||
alias bg background
|
||||
alias bold bright
|
||||
alias dark faint
|
||||
alias strike cross_out
|
||||
end
|
||||
|
||||
class Presenter < String
|
||||
TERM_EFFECTS = T.let(nil, T::Hash[Symbol, Integer])
|
||||
|
||||
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
|
||||
def color(*values); end
|
||||
|
||||
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
|
||||
def background(*values); end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def reset; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def bright; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def faint; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def italic; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def underline; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def blink; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def inverse; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def hide; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def cross_out; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def black; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def red; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def green; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def yellow; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def blue; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def magenta; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def cyan; end
|
||||
|
||||
sig { returns(Presenter) }
|
||||
def white; end
|
||||
|
||||
alias foreground color
|
||||
alias fg color
|
||||
alias bg background
|
||||
alias bold bright
|
||||
alias dark faint
|
||||
alias strike cross_out
|
||||
end
|
||||
|
||||
class StringUtils
|
||||
sig { params(string: String, codes: T::Array[Integer]).returns(String) }
|
||||
def self.wrap_with_sgr(string, codes); end
|
||||
|
||||
sig { params(string: String).returns(String) }
|
||||
def uncolor(string); end
|
||||
end
|
||||
|
||||
VERSION = T.let(nil, String)
|
||||
|
||||
class Wrapper
|
||||
sig { returns(T::Boolean) }
|
||||
attr_accessor :enabled
|
||||
|
||||
sig { params(enabled: T::Boolean).returns(Wrapper) }
|
||||
def initialize(enabled = true); end
|
||||
|
||||
sig { params(string: String).returns(T.any(Rainbow::Presenter, Rainbow::NullPresenter)) }
|
||||
def wrap(string); end
|
||||
end
|
||||
|
||||
module X11ColorNames
|
||||
NAMES = T.let(nil, T::Hash[Symbol, [Integer, Integer, Integer]])
|
||||
end
|
||||
end
|
||||
|
||||
sig { params(string: String).returns(Rainbow::Presenter) }
|
||||
def Rainbow(string); end
|
4222
sorbet/rbi/sorbet-typed/lib/ruby/all/gem.rbi
Normal file
4222
sorbet/rbi/sorbet-typed/lib/ruby/all/gem.rbi
Normal file
File diff suppressed because it is too large
Load diff
111
sorbet/rbi/sorbet-typed/lib/ruby/all/open3.rbi
Normal file
111
sorbet/rbi/sorbet-typed/lib/ruby/all/open3.rbi
Normal file
|
@ -0,0 +1,111 @@
|
|||
# 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/ruby/all/open3.rbi
|
||||
#
|
||||
# typed: strong
|
||||
|
||||
module Open3
|
||||
sig do
|
||||
params(
|
||||
cmd: T.any(String, T::Array[String]),
|
||||
opts: T.untyped,
|
||||
block: T.nilable(T.proc.params(stdin: IO, stdout: IO, stderr: IO, wait_thr: Process::Waiter).void)
|
||||
).returns([IO, IO, IO, Process::Waiter])
|
||||
end
|
||||
def self.popen3(*cmd, **opts, &block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
cmd: T.any(String, T::Array[String]),
|
||||
opts: T.untyped,
|
||||
block: T.nilable(T.proc.params(stdin: IO, stdout: IO, wait_thr: Process::Waiter).void)
|
||||
).returns([IO, IO, Process::Waiter])
|
||||
end
|
||||
def self.popen2(*cmd, **opts, &block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
cmd: T.any(String, T::Array[String]),
|
||||
opts: T.untyped,
|
||||
block: T.nilable(T.proc.params(stdin: IO, stdout_and_stderr: IO, wait_thr: Process::Waiter).void)
|
||||
).returns([IO, IO, Process::Waiter])
|
||||
end
|
||||
def self.popen2e(*cmd, **opts, &block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
cmd: T.any(String, T::Array[String]),
|
||||
stdin_data: T.nilable(String),
|
||||
binmode: T.any(FalseClass, TrueClass),
|
||||
opts: T::Hash[Symbol, T.untyped]
|
||||
).returns([String, String, Process::Status])
|
||||
end
|
||||
def self.capture3(*cmd, stdin_data: '', binmode: false, **opts); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
cmd: T.any(String, T::Array[String]),
|
||||
stdin_data: T.nilable(String),
|
||||
binmode: T.any(FalseClass, TrueClass),
|
||||
opts: T::Hash[Symbol, T.untyped]
|
||||
).returns([String, Process::Status])
|
||||
end
|
||||
def self.capture2(*cmd, stdin_data: nil, binmode: false, **opts); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
cmd: T.any(String, T::Array[String]),
|
||||
stdin_data: T.nilable(String),
|
||||
binmode: T.any(FalseClass, TrueClass),
|
||||
opts: T::Hash[Symbol, T.untyped]
|
||||
).returns([String, Process::Status])
|
||||
end
|
||||
def self.capture2e(*cmd, stdin_data: nil, binmode: false, **opts); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
cmds: T.any(String, T::Array[String]),
|
||||
opts: T.untyped,
|
||||
block: T.nilable(T.proc.params(first_stdin: IO, last_stdout: IO, wait_threads: T::Array[Process::Waiter]).void)
|
||||
).returns([IO, IO, T::Array[Process::Waiter]])
|
||||
end
|
||||
def self.pipeline_rw(*cmds, **opts, &block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
cmds: T.any(String, T::Array[String]),
|
||||
opts: T.untyped,
|
||||
block: T.nilable(T.proc.params(last_stdout: IO, wait_threads: T::Array[Process::Waiter]).void)
|
||||
).returns([IO, T::Array[Process::Waiter]])
|
||||
end
|
||||
def self.pipeline_r(*cmds, **opts, &block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
cmds: T.any(String, T::Array[String]),
|
||||
opts: T.untyped,
|
||||
block: T.nilable(T.proc.params(first_stdin: IO, wait_threads: T::Array[Process::Waiter]).void)
|
||||
).returns([IO, T::Array[Process::Waiter]])
|
||||
end
|
||||
def self.pipeline_w(*cmds, **opts, &block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
cmds: T.any(String, T::Array[String]),
|
||||
opts: T.untyped,
|
||||
block: T.nilable(T.proc.params(wait_threads: T::Array[Process::Waiter]).void)
|
||||
).returns(T::Array[Process::Waiter])
|
||||
end
|
||||
def self.pipeline_start(*cmds, **opts, &block); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
cmds: T.any(String, T::Array[String]),
|
||||
opts: T.untyped
|
||||
).returns(T::Array[Process::Status])
|
||||
end
|
||||
def self.pipeline(*cmds, **opts); end
|
||||
end
|
543
sorbet/rbi/sorbet-typed/lib/ruby/all/resolv.rbi
Normal file
543
sorbet/rbi/sorbet-typed/lib/ruby/all/resolv.rbi
Normal file
|
@ -0,0 +1,543 @@
|
|||
# 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/ruby/all/resolv.rbi
|
||||
#
|
||||
# typed: strong
|
||||
|
||||
class Resolv
|
||||
sig { params(name: String).returns(String) }
|
||||
def self.getaddress(name); end
|
||||
|
||||
sig { params(name: String).returns(T::Array[String]) }
|
||||
def self.getaddresses(name); end
|
||||
|
||||
sig { params(name: String, block: T.proc.params(address: String).void).void }
|
||||
def self.each_address(name, &block); end
|
||||
|
||||
sig { params(address: String).returns(String) }
|
||||
def self.getname(address); end
|
||||
|
||||
sig { params(address: String).returns(T::Array[String]) }
|
||||
def self.getnames(address); end
|
||||
|
||||
sig { params(address: String, proc: T.proc.params(name: String).void).void }
|
||||
def self.each_name(address, &proc); end
|
||||
|
||||
sig { params(resolvers: [Hosts, DNS]).void }
|
||||
def initialize(resolvers=[Hosts.new, DNS.new]); end
|
||||
|
||||
sig { params(name: String).returns(String) }
|
||||
def getaddress(name); end
|
||||
|
||||
sig { params(name: String).returns(T::Array[String]) }
|
||||
def getaddresses(name); end
|
||||
|
||||
sig { params(name: String, block: T.proc.params(address: String).void).void }
|
||||
def each_address(name, &block); end
|
||||
|
||||
sig { params(address: String).returns(String) }
|
||||
def getname(address); end
|
||||
|
||||
sig { params(address: String).returns(T::Array[String]) }
|
||||
def getnames(address); end
|
||||
|
||||
sig { params(address: String, proc: T.proc.params(name: String).void).void }
|
||||
def each_name(address, &proc); end
|
||||
|
||||
class ResolvError < StandardError; end
|
||||
class ResolvTimeout < Timeout::Error; end
|
||||
|
||||
class Hosts
|
||||
DefaultFileName = T.let(T.unsafe(nil), String)
|
||||
|
||||
sig { params(filename: String).void }
|
||||
def initialize(filename = DefaultFileName); end
|
||||
|
||||
sig { params(name: String).returns(String) }
|
||||
def getaddress(name); end
|
||||
|
||||
sig { params(name: String).returns(T::Array[String]) }
|
||||
def getaddresses(name); end
|
||||
|
||||
sig { params(name: String, block: T.proc.params(address: String).void).void }
|
||||
def each_address(name, &block); end
|
||||
|
||||
sig { params(address: String).returns(String) }
|
||||
def getname(address); end
|
||||
|
||||
sig { params(address: String).returns(T::Array[String]) }
|
||||
def getnames(address); end
|
||||
|
||||
sig { params(address: String, proc: T.proc.params(name: String).void).void }
|
||||
def each_name(address, &proc); end
|
||||
end
|
||||
|
||||
class DNS
|
||||
Port = T.let(T.unsafe(nil), Integer)
|
||||
|
||||
UDPSize = T.let(T.unsafe(nil), Integer)
|
||||
|
||||
sig do
|
||||
params(
|
||||
config_info: T.any(
|
||||
NilClass,
|
||||
String,
|
||||
{ nameserver: T.any(String, T::Array[String]), search: T::Array[String], ndots: Integer },
|
||||
{ nameserver_port: T::Array[[String, Integer]], search: T::Array[String], ndots: Integer }
|
||||
)
|
||||
).returns(Resolv::DNS)
|
||||
end
|
||||
def self.open(config_info = nil); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
config_info: T.any(
|
||||
NilClass,
|
||||
String,
|
||||
{ nameserver: T.any(String, T::Array[String]), search: T::Array[String], ndots: Integer },
|
||||
{ nameserver_port: T::Array[[String, Integer]], search: T::Array[String], ndots: Integer }
|
||||
)
|
||||
).void
|
||||
end
|
||||
def initialize(config_info = nil); end
|
||||
|
||||
sig { params(values: T.any(NilClass, Integer, T::Array[Integer])).void }
|
||||
def timeouts=(values); end
|
||||
|
||||
sig { void }
|
||||
def close; end
|
||||
|
||||
sig { params(name: String).returns(String) }
|
||||
def getaddress(name); end
|
||||
|
||||
sig { params(name: String).returns(T::Array[String]) }
|
||||
def getaddresses(name); end
|
||||
|
||||
sig { params(name: String, block: T.proc.params(address: String).void).void }
|
||||
def each_address(name, &block); end
|
||||
|
||||
sig { params(address: String).returns(String) }
|
||||
def getname(address); end
|
||||
|
||||
sig { params(address: String).returns(T::Array[String]) }
|
||||
def getnames(address); end
|
||||
|
||||
sig { params(address: String, proc: T.proc.params(name: String).void).void }
|
||||
def each_name(address, &proc); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
name: T.any(String, Resolv::DNS::Name),
|
||||
typeclass: T.class_of(Resolv::DNS::Resource)
|
||||
).returns(Resolv::DNS::Resource)
|
||||
end
|
||||
def getresource(name, typeclass); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
name: T.any(String, Resolv::DNS::Name),
|
||||
typeclass: T.class_of(Resolv::DNS::Resource)
|
||||
).returns(T::Array[Resolv::DNS::Resource])
|
||||
end
|
||||
def getresources(name, typeclass); end
|
||||
|
||||
sig do
|
||||
params(
|
||||
name: T.any(String, Resolv::DNS::Name),
|
||||
typeclass: T.class_of(Resolv::DNS::Resource),
|
||||
proc: T.proc.params(resource: Resolv::DNS::Resource).void
|
||||
).void
|
||||
end
|
||||
def each_resource(name, typeclass, &proc); end
|
||||
|
||||
class DecodeError < StandardError; end
|
||||
class EncodeError < StandardError; end
|
||||
|
||||
class Name
|
||||
sig { params(arg: T.any(String, Resolv::DNS::Name)).returns(Resolv::DNS::Name) }
|
||||
def self.create(arg); end
|
||||
|
||||
sig { params(labels: T::Array[String], absolute: T.any(FalseClass, TrueClass)).void }
|
||||
def initialize(labels, absolute=true); end
|
||||
|
||||
sig { returns(T.any(FalseClass, TrueClass)) }
|
||||
def absolute?; end
|
||||
|
||||
sig { params(other: Resolv::DNS::Name).returns(T.any(FalseClass, TrueClass)) }
|
||||
def subdomain_of?(other); end
|
||||
end
|
||||
|
||||
class Query; end
|
||||
|
||||
class Resource < Query
|
||||
sig { returns(T.nilable(Integer)) }
|
||||
attr_reader :ttl
|
||||
|
||||
sig { void }
|
||||
def initialize
|
||||
@ttl = T.let(T.unsafe(nil), T.nilable(Integer))
|
||||
end
|
||||
|
||||
class Generic < Resource
|
||||
sig { params(data: T.untyped).void }
|
||||
def initialize(data)
|
||||
@data = T.let(T.unsafe(nil), T.untyped)
|
||||
end
|
||||
|
||||
sig { returns(T.untyped) }
|
||||
attr_reader :data
|
||||
end
|
||||
|
||||
class DomainName < Resource
|
||||
sig { params(name: String).void }
|
||||
def initialize(name)
|
||||
@name = T.let(T.unsafe(nil), String)
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :name
|
||||
end
|
||||
|
||||
class NS < DomainName; end
|
||||
|
||||
class CNAME < DomainName; end
|
||||
|
||||
class SOA < Resource
|
||||
sig do
|
||||
params(
|
||||
mname: String,
|
||||
rname: String,
|
||||
serial: Integer,
|
||||
refresh: Integer,
|
||||
retry_: Integer,
|
||||
expire: Integer,
|
||||
minimum: Integer
|
||||
).void
|
||||
end
|
||||
def initialize(mname, rname, serial, refresh, retry_, expire, minimum)
|
||||
@mname = T.let(T.unsafe(nil), String)
|
||||
@rname = T.let(T.unsafe(nil), String)
|
||||
@serial = T.let(T.unsafe(nil), Integer)
|
||||
@refresh = T.let(T.unsafe(nil), Integer)
|
||||
@retry = T.let(T.unsafe(nil), Integer)
|
||||
@expire = T.let(T.unsafe(nil), Integer)
|
||||
@minimum = T.let(T.unsafe(nil), Integer)
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :mname
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :rname
|
||||
|
||||
sig { returns(Integer) }
|
||||
attr_reader :serial
|
||||
|
||||
sig { returns(Integer) }
|
||||
attr_reader :refresh
|
||||
|
||||
sig { returns(Integer) }
|
||||
attr_reader :retry
|
||||
|
||||
sig { returns(Integer) }
|
||||
attr_reader :expire
|
||||
|
||||
sig { returns(Integer) }
|
||||
attr_reader :minimum
|
||||
end
|
||||
|
||||
class PTR < DomainName; end
|
||||
|
||||
class HINFO < Resource
|
||||
sig { params(cpu: String, os: String).void }
|
||||
def initialize(cpu, os)
|
||||
@cpu = T.let(T.unsafe(nil), String)
|
||||
@os = T.let(T.unsafe(nil), String)
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :cpu
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :os
|
||||
end
|
||||
|
||||
class MINFO < Resource
|
||||
sig { params(rmailbx: String, emailbx: String).void }
|
||||
def initialize(rmailbx, emailbx)
|
||||
@rmailbx = T.let(T.unsafe(nil), String)
|
||||
@emailbx = T.let(T.unsafe(nil), String)
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :rmailbx
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :emailbx
|
||||
end
|
||||
|
||||
class MX < Resource
|
||||
sig { params(preference: Integer, exchange: String).void }
|
||||
def initialize(preference, exchange)
|
||||
@preference = T.let(T.unsafe(nil), Integer)
|
||||
@exchange = T.let(T.unsafe(nil), String)
|
||||
end
|
||||
|
||||
sig { returns(Integer) }
|
||||
attr_reader :preference
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :exchange
|
||||
end
|
||||
|
||||
class TXT < Resource
|
||||
sig { params(first_string: String, rest_strings: String).void }
|
||||
def initialize(first_string, *rest_strings)
|
||||
@strings = T.let(T.unsafe(nil), T::Array[String])
|
||||
end
|
||||
|
||||
sig { returns(T::Array[String]) }
|
||||
attr_reader :strings
|
||||
|
||||
sig { returns(String) }
|
||||
def data; end
|
||||
end
|
||||
|
||||
class LOC < Resource
|
||||
sig do
|
||||
params(
|
||||
version: String,
|
||||
ssize: T.any(String, Resolv::LOC::Size),
|
||||
hprecision: T.any(String, Resolv::LOC::Size),
|
||||
vprecision: T.any(String, Resolv::LOC::Size),
|
||||
latitude: T.any(String, Resolv::LOC::Coord),
|
||||
longitude: T.any(String, Resolv::LOC::Coord),
|
||||
altitude: T.any(String, Resolv::LOC::Alt)
|
||||
).void
|
||||
end
|
||||
def initialize(version, ssize, hprecision, vprecision, latitude, longitude, altitude)
|
||||
@version = T.let(T.unsafe(nil), String)
|
||||
@ssize = T.let(T.unsafe(nil), Resolv::LOC::Size)
|
||||
@hprecision = T.let(T.unsafe(nil), Resolv::LOC::Size)
|
||||
@vprecision = T.let(T.unsafe(nil), Resolv::LOC::Size)
|
||||
@latitude = T.let(T.unsafe(nil), Resolv::LOC::Coord)
|
||||
@longitude = T.let(T.unsafe(nil), Resolv::LOC::Coord)
|
||||
@altitude = T.let(T.unsafe(nil), Resolv::LOC::Alt)
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :version
|
||||
|
||||
sig { returns(Resolv::LOC::Size) }
|
||||
attr_reader :ssize
|
||||
|
||||
sig { returns(Resolv::LOC::Size) }
|
||||
attr_reader :hprecision
|
||||
|
||||
sig { returns(Resolv::LOC::Size) }
|
||||
attr_reader :vprecision
|
||||
|
||||
sig { returns(Resolv::LOC::Coord) }
|
||||
attr_reader :latitude
|
||||
|
||||
sig { returns(Resolv::LOC::Coord) }
|
||||
attr_reader :longitude
|
||||
|
||||
sig { returns(Resolv::LOC::Alt) }
|
||||
attr_reader :altitude
|
||||
end
|
||||
|
||||
class ANY < Query; end
|
||||
|
||||
module IN
|
||||
class A < Resource
|
||||
sig { params(address: String).void }
|
||||
def initialize(address)
|
||||
@address = T.let(T.unsafe(nil), Resolv::IPv4)
|
||||
end
|
||||
|
||||
sig { returns(Resolv::IPv4) }
|
||||
attr_reader :address
|
||||
end
|
||||
|
||||
class WKS < Resource
|
||||
sig { params(address: String, protocol: Integer, bitmap: String).void }
|
||||
def initialize(address, protocol, bitmap)
|
||||
@address = T.let(T.unsafe(nil), Resolv::IPv4)
|
||||
@protocol = T.let(T.unsafe(nil), Integer)
|
||||
@bitmap = T.let(T.unsafe(nil), String)
|
||||
end
|
||||
|
||||
sig { returns(Resolv::IPv4) }
|
||||
attr_reader :address
|
||||
|
||||
sig { returns(Integer) }
|
||||
attr_reader :protocol
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :bitmap
|
||||
end
|
||||
|
||||
class AAAA < Resource
|
||||
sig { params(address: String).void }
|
||||
def initialize(address)
|
||||
@address = T.let(T.unsafe(nil), Resolv::IPv6)
|
||||
end
|
||||
|
||||
sig { returns(Resolv::IPv6) }
|
||||
attr_reader :address
|
||||
end
|
||||
|
||||
class SRV < Resource
|
||||
# Create a SRV resource record.
|
||||
#
|
||||
# See the documentation for #priority, #weight, #port and #target
|
||||
# for +priority+, +weight+, +port and +target+ respectively.
|
||||
|
||||
sig do
|
||||
params(
|
||||
priority: T.any(Integer, String),
|
||||
weight: T.any(Integer, String),
|
||||
port: T.any(Integer, String),
|
||||
target: T.any(String, Resolv::DNS::Name)
|
||||
).void
|
||||
end
|
||||
def initialize(priority, weight, port, target)
|
||||
@priority = T.let(T.unsafe(nil), Integer)
|
||||
@weight = T.let(T.unsafe(nil), Integer)
|
||||
@port = T.let(T.unsafe(nil), Integer)
|
||||
@target = T.let(T.unsafe(nil), Resolv::DNS::Name)
|
||||
end
|
||||
|
||||
sig { returns(Integer) }
|
||||
attr_reader :priority
|
||||
|
||||
sig { returns(Integer) }
|
||||
attr_reader :weight
|
||||
|
||||
sig { returns(Integer) }
|
||||
attr_reader :port
|
||||
|
||||
sig { returns(Resolv::DNS::Name) }
|
||||
attr_reader :target
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class IPv4
|
||||
Regex256 = T.let(T.unsafe(nil), Regexp)
|
||||
Regex = T.let(T.unsafe(nil), Regexp)
|
||||
|
||||
sig { params(arg: T.any(String, Resolv::IPv4)).returns(Resolv::IPv4) }
|
||||
def self.create(arg); end
|
||||
|
||||
sig { params(address: String).void }
|
||||
def initialize(address)
|
||||
@address = T.let(T.unsafe(nil), String)
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :address
|
||||
|
||||
sig { returns(DNS::Name) }
|
||||
def to_name; end
|
||||
end
|
||||
|
||||
class IPv6
|
||||
Regex_8Hex = T.let(T.unsafe(nil), Regexp)
|
||||
Regex_CompressedHex = T.let(T.unsafe(nil), Regexp)
|
||||
Regex_6Hex4Dec = T.let(T.unsafe(nil), Regexp)
|
||||
Regex_CompressedHex4Dec = T.let(T.unsafe(nil), Regexp)
|
||||
Regex = T.let(T.unsafe(nil), Regexp)
|
||||
|
||||
sig { params(arg: T.any(String, Resolv::IPv6)).returns(Resolv::IPv6) }
|
||||
def self.create(arg); end
|
||||
|
||||
sig { params(address: String).void }
|
||||
def initialize(address)
|
||||
@address = T.let(T.unsafe(nil), String)
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :address
|
||||
|
||||
sig { returns(DNS::Name) }
|
||||
def to_name; end
|
||||
end
|
||||
|
||||
class MDNS < DNS
|
||||
Port = T.let(T.unsafe(nil), Integer)
|
||||
AddressV4 = T.let(T.unsafe(nil), String)
|
||||
AddressV6 = T.let(T.unsafe(nil), String)
|
||||
Addresses = T.let(T.unsafe(nil), [[String, Integer], [String, Integer]])
|
||||
|
||||
sig do
|
||||
params(
|
||||
config_info: T.any(
|
||||
NilClass,
|
||||
{ nameserver: T.any(String, T::Array[String]), search: T::Array[String], ndots: Integer },
|
||||
{ nameserver_port: T::Array[[String, Integer]], search: T::Array[String], ndots: Integer }
|
||||
)
|
||||
).void
|
||||
end
|
||||
def initialize(config_info = nil); end
|
||||
end
|
||||
|
||||
module LOC
|
||||
class Size
|
||||
Regex = T.let(T.unsafe(nil), Regexp)
|
||||
|
||||
sig { params(arg: T.any(String, Resolv::LOC::Size)).returns(Resolv::LOC::Size) }
|
||||
def self.create(arg); end
|
||||
|
||||
sig { params(scalar: String).void }
|
||||
def initialize(scalar)
|
||||
@scalar = T.let(T.unsafe(nil), String)
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :scalar
|
||||
end
|
||||
|
||||
class Coord
|
||||
Regex = T.let(T.unsafe(nil), Regexp)
|
||||
|
||||
sig { params(arg: T.any(String, Resolv::LOC::Coord)).returns(Resolv::LOC::Coord) }
|
||||
def self.create(arg); end
|
||||
|
||||
sig { params(coordinates: String, orientation: T.enum(%w[lat lon])).void }
|
||||
def initialize(coordinates, orientation)
|
||||
@coordinates = T.let(T.unsafe(nil), String)
|
||||
@orientation = T.let(T.unsafe(nil), T.enum(%w[lat lon]))
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :coordinates
|
||||
|
||||
sig { returns(T.enum(%w[lat lon])) }
|
||||
attr_reader :orientation
|
||||
end
|
||||
|
||||
class Alt
|
||||
Regex = T.let(T.unsafe(nil), Regexp)
|
||||
|
||||
sig { params(arg: T.any(String, Resolv::LOC::Alt)).returns(Resolv::LOC::Alt) }
|
||||
def self.create(arg); end
|
||||
|
||||
sig { params(altitude: String).void }
|
||||
def initialize(altitude)
|
||||
@altitude = T.let(T.unsafe(nil), String)
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :altitude
|
||||
end
|
||||
end
|
||||
|
||||
DefaultResolver = T.let(T.unsafe(nil), Resolv)
|
||||
AddressRegex = T.let(T.unsafe(nil), Regexp)
|
||||
end
|
22
sorbet/rbi/todo.rbi
Normal file
22
sorbet/rbi/todo.rbi
Normal file
|
@ -0,0 +1,22 @@
|
|||
# This file is autogenerated. Do not edit it by hand. Regenerate it with:
|
||||
# srb rbi todo
|
||||
|
||||
# typed: strong
|
||||
module ::ADDITIONAL_LOAD_PATHS; end
|
||||
module ::Dispatcher; end
|
||||
module ::Spring; end
|
||||
module ActionView::Helpers::SanitizeHelper::ClassMethods; end
|
||||
module ActiveStorage::Blob::Analyzable; end
|
||||
module ActiveStorage::Blob::Analyzable; end
|
||||
module ActiveStorage::Blob::Analyzable; end
|
||||
module ActiveStorage::Blob::Analyzable; end
|
||||
module ActiveStorage::Blob::Identifiable; end
|
||||
module ActiveStorage::Blob::Identifiable; end
|
||||
module ActiveStorage::Blob::Identifiable; end
|
||||
module ActiveStorage::Blob::Identifiable; end
|
||||
module ActiveStorage::Variant; end
|
||||
module I18n::Backend::Pluralization::InvalidPluralizationData; end
|
||||
module LoginSystem::CASClient::Frameworks::Rails::Filter; end
|
||||
module Tag::Error; end
|
||||
module TodoFromRichMessage::CannotAccessContext; end
|
||||
module Tracks::ActiveResource::Base; end
|
Loading…
Add table
Add a link
Reference in a new issue