rbs 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +5 -0
- data/CHANGELOG.md +23 -0
- data/README.md +6 -1
- data/core/array.rbs +2866 -1086
- data/core/basic_object.rbs +150 -30
- data/core/binding.rbs +33 -0
- data/core/builtin.rbs +4 -4
- data/core/class.rbs +43 -5
- data/core/comparable.rbs +57 -0
- data/core/complex.rbs +170 -4
- data/core/constants.rbs +51 -0
- data/core/deprecated.rbs +7 -0
- data/core/dir.rbs +305 -20
- data/core/encoding.rbs +472 -77
- data/core/enumerable.rbs +2173 -234
- data/core/enumerator.rbs +448 -182
- data/core/env.rbs +448 -1
- data/core/errno.rbs +1 -10
- data/core/errors.rbs +152 -2
- data/core/exception.rbs +201 -127
- data/core/false_class.rbs +27 -0
- data/core/fiber.rbs +118 -37
- data/core/fiber_error.rbs +8 -9
- data/core/file.rbs +1059 -139
- data/core/file_test.rbs +287 -32
- data/core/float.rbs +776 -300
- data/core/gc.rbs +185 -34
- data/core/global_variables.rbs +5 -1
- data/core/hash.rbs +1582 -649
- data/core/integer.rbs +974 -204
- data/core/io/buffer.rbs +710 -0
- data/core/io/wait.rbs +29 -8
- data/core/io.rbs +2438 -417
- data/core/kernel.rbs +2315 -316
- data/core/marshal.rbs +37 -2
- data/core/match_data.rbs +123 -6
- data/core/math.rbs +126 -6
- data/core/method.rbs +226 -102
- data/core/module.rbs +421 -45
- data/core/nil_class.rbs +64 -0
- data/core/numeric.rbs +620 -142
- data/core/object.rbs +453 -81
- data/core/object_space.rbs +92 -2
- data/core/proc.rbs +482 -285
- data/core/process.rbs +443 -34
- data/core/ractor.rbs +232 -9
- data/core/random.rbs +151 -52
- data/core/range.rbs +885 -160
- data/core/rational.rbs +122 -6
- data/core/rb_config.rbs +14 -4
- data/core/refinement.rbs +44 -0
- data/core/regexp.rbs +156 -14
- data/core/ruby_vm.rbs +42 -3
- data/core/signal.rbs +78 -39
- data/core/string.rbs +2123 -567
- data/core/string_io.rbs +204 -0
- data/core/struct.rbs +283 -28
- data/core/symbol.rbs +304 -30
- data/core/thread.rbs +1288 -688
- data/core/thread_group.rbs +66 -10
- data/core/time.rbs +643 -217
- data/core/trace_point.rbs +100 -12
- data/core/true_class.rbs +24 -0
- data/core/unbound_method.rbs +73 -7
- data/core/warning.rbs +37 -12
- data/docs/CONTRIBUTING.md +40 -34
- data/docs/stdlib.md +3 -102
- data/lib/rbs/annotate/annotations.rb +197 -0
- data/lib/rbs/annotate/formatter.rb +80 -0
- data/lib/rbs/annotate/rdoc_annotator.rb +398 -0
- data/lib/rbs/annotate/rdoc_source.rb +120 -0
- data/lib/rbs/annotate.rb +6 -0
- data/lib/rbs/cli.rb +45 -1
- data/lib/rbs/definition_builder.rb +5 -1
- data/lib/rbs/location_aux.rb +12 -0
- data/lib/rbs/prototype/rb.rb +12 -0
- data/lib/rbs/version.rb +1 -1
- data/sig/annotate/annotations.rbs +102 -0
- data/sig/annotate/formatter.rbs +24 -0
- data/sig/annotate/rdoc_annotater.rbs +82 -0
- data/sig/annotate/rdoc_source.rbs +30 -0
- data/sig/cli.rbs +2 -0
- data/sig/collection/{collections.rbs → sources.rbs} +0 -0
- data/sig/location.rbs +6 -0
- data/sig/method_types.rbs +5 -1
- data/sig/polyfill.rbs +78 -0
- data/stdlib/abbrev/0/abbrev.rbs +6 -0
- data/stdlib/abbrev/0/array.rbs +26 -0
- data/stdlib/base64/0/base64.rbs +31 -0
- data/stdlib/benchmark/0/benchmark.rbs +74 -3
- data/stdlib/bigdecimal/0/big_decimal.rbs +614 -165
- data/stdlib/bigdecimal-math/0/big_math.rbs +41 -64
- data/stdlib/cgi/0/core.rbs +59 -0
- data/stdlib/coverage/0/coverage.rbs +164 -2
- data/stdlib/csv/0/csv.rbs +2862 -398
- data/stdlib/date/0/date.rbs +483 -25
- data/stdlib/date/0/date_time.rbs +187 -12
- data/stdlib/dbm/0/dbm.rbs +152 -17
- data/stdlib/digest/0/digest.rbs +146 -0
- data/stdlib/erb/0/erb.rbs +65 -245
- data/stdlib/fiber/0/fiber.rbs +73 -91
- data/stdlib/fileutils/0/fileutils.rbs +301 -1
- data/stdlib/find/0/find.rbs +9 -0
- data/stdlib/forwardable/0/forwardable.rbs +65 -1
- data/stdlib/io-console/0/io-console.rbs +227 -15
- data/stdlib/ipaddr/0/ipaddr.rbs +161 -0
- data/stdlib/json/0/json.rbs +1146 -144
- data/stdlib/logger/0/formatter.rbs +24 -0
- data/stdlib/logger/0/log_device.rbs +64 -0
- data/stdlib/logger/0/logger.rbs +165 -13
- data/stdlib/logger/0/period.rbs +10 -0
- data/stdlib/logger/0/severity.rbs +26 -0
- data/stdlib/monitor/0/monitor.rbs +163 -0
- data/stdlib/mutex_m/0/mutex_m.rbs +35 -6
- data/stdlib/net-http/0/net-http.rbs +1492 -683
- data/stdlib/nkf/0/nkf.rbs +372 -0
- data/stdlib/objspace/0/objspace.rbs +149 -90
- data/stdlib/openssl/0/openssl.rbs +8108 -71
- data/stdlib/optparse/0/optparse.rbs +487 -19
- data/stdlib/pathname/0/pathname.rbs +425 -124
- data/stdlib/prettyprint/0/prettyprint.rbs +120 -99
- data/stdlib/prime/0/integer-extension.rbs +20 -2
- data/stdlib/prime/0/prime.rbs +88 -21
- data/stdlib/pstore/0/pstore.rbs +102 -0
- data/stdlib/pty/0/pty.rbs +64 -14
- data/stdlib/resolv/0/resolv.rbs +420 -31
- data/stdlib/rubygems/0/basic_specification.rbs +4 -1
- data/stdlib/rubygems/0/config_file.rbs +33 -1
- data/stdlib/rubygems/0/dependency_installer.rbs +4 -3
- data/stdlib/rubygems/0/installer.rbs +13 -1
- data/stdlib/rubygems/0/path_support.rbs +4 -1
- data/stdlib/rubygems/0/platform.rbs +5 -1
- data/stdlib/rubygems/0/request_set.rbs +44 -2
- data/stdlib/rubygems/0/requirement.rbs +65 -2
- data/stdlib/rubygems/0/rubygems.rbs +407 -0
- data/stdlib/rubygems/0/source_list.rbs +13 -0
- data/stdlib/rubygems/0/specification.rbs +21 -1
- data/stdlib/rubygems/0/stream_ui.rbs +3 -1
- data/stdlib/rubygems/0/uninstaller.rbs +8 -1
- data/stdlib/rubygems/0/version.rbs +60 -157
- data/stdlib/securerandom/0/securerandom.rbs +44 -0
- data/stdlib/set/0/set.rbs +420 -106
- data/stdlib/shellwords/0/shellwords.rbs +55 -77
- data/stdlib/singleton/0/singleton.rbs +20 -0
- data/stdlib/socket/0/addrinfo.rbs +210 -9
- data/stdlib/socket/0/basic_socket.rbs +103 -11
- data/stdlib/socket/0/ip_socket.rbs +31 -9
- data/stdlib/socket/0/socket.rbs +586 -38
- data/stdlib/socket/0/tcp_server.rbs +22 -2
- data/stdlib/socket/0/tcp_socket.rbs +12 -1
- data/stdlib/socket/0/udp_socket.rbs +25 -2
- data/stdlib/socket/0/unix_server.rbs +22 -2
- data/stdlib/socket/0/unix_socket.rbs +45 -5
- data/stdlib/strscan/0/string_scanner.rbs +210 -9
- data/stdlib/tempfile/0/tempfile.rbs +58 -10
- data/stdlib/time/0/time.rbs +208 -116
- data/stdlib/timeout/0/timeout.rbs +10 -0
- data/stdlib/tmpdir/0/tmpdir.rbs +13 -4
- data/stdlib/tsort/0/cyclic.rbs +1 -0
- data/stdlib/tsort/0/interfaces.rbs +1 -0
- data/stdlib/tsort/0/tsort.rbs +42 -0
- data/stdlib/uri/0/common.rbs +57 -8
- data/stdlib/uri/0/file.rbs +55 -109
- data/stdlib/uri/0/ftp.rbs +6 -3
- data/stdlib/uri/0/generic.rbs +556 -327
- data/stdlib/uri/0/http.rbs +26 -115
- data/stdlib/uri/0/https.rbs +8 -102
- data/stdlib/uri/0/ldap.rbs +143 -137
- data/stdlib/uri/0/ldaps.rbs +8 -102
- data/stdlib/uri/0/mailto.rbs +3 -0
- data/stdlib/uri/0/rfc2396_parser.rbs +66 -26
- data/stdlib/uri/0/ws.rbs +6 -3
- data/stdlib/uri/0/wss.rbs +5 -3
- data/stdlib/yaml/0/dbm.rbs +151 -87
- data/stdlib/yaml/0/store.rbs +6 -0
- data/stdlib/zlib/0/zlib.rbs +90 -31
- metadata +17 -5
- data/lib/rbs/location.rb +0 -221
@@ -1,3 +1,35 @@
|
|
1
|
+
# <!-- rdoc-file=lib/rubygems/config_file.rb -->
|
2
|
+
# Gem::ConfigFile RubyGems options and gem command options from gemrc.
|
3
|
+
#
|
4
|
+
# gemrc is a YAML file that uses strings to match gem command arguments and
|
5
|
+
# symbols to match RubyGems options.
|
6
|
+
#
|
7
|
+
# Gem command arguments use a String key that matches the command name and allow
|
8
|
+
# you to specify default arguments:
|
9
|
+
#
|
10
|
+
# install: --no-rdoc --no-ri
|
11
|
+
# update: --no-rdoc --no-ri
|
12
|
+
#
|
13
|
+
# You can use `gem:` to set default arguments for all commands.
|
14
|
+
#
|
15
|
+
# RubyGems options use symbol keys. Valid options are:
|
16
|
+
#
|
17
|
+
# `:backtrace`
|
18
|
+
# : See #backtrace
|
19
|
+
# `:sources`
|
20
|
+
# : Sets Gem::sources
|
21
|
+
# `:verbose`
|
22
|
+
# : See #verbose
|
23
|
+
# `:concurrent_downloads`
|
24
|
+
# : See #concurrent_downloads
|
25
|
+
#
|
26
|
+
#
|
27
|
+
# gemrc files may exist in various locations and are read and merged in the
|
28
|
+
# following order:
|
29
|
+
#
|
30
|
+
# * system wide (/etc/gemrc)
|
31
|
+
# * per user (~/.gemrc)
|
32
|
+
# * per environment (gemrc files listed in the GEMRC environment variable)
|
33
|
+
#
|
1
34
|
class Gem::ConfigFile
|
2
|
-
# TODO: Add sinatures...
|
3
35
|
end
|
@@ -1,5 +1,6 @@
|
|
1
|
+
# <!-- rdoc-file=lib/rubygems/dependency_installer.rb -->
|
2
|
+
# Installs a gem along with all its dependencies from local and remote gems.
|
3
|
+
#
|
1
4
|
class Gem::DependencyInstaller
|
2
|
-
type options = Hash[Symbol, untyped]
|
3
|
-
|
4
|
-
# TODO: Add sinatures...
|
5
|
+
type options = Hash[Symbol, untyped]
|
5
6
|
end
|
@@ -1,3 +1,15 @@
|
|
1
|
+
# <!-- rdoc-file=lib/rubygems/installer.rb -->
|
2
|
+
# The installer installs the files contained in the .gem into the Gem.home.
|
3
|
+
#
|
4
|
+
# Gem::Installer does the work of putting files in all the right places on the
|
5
|
+
# filesystem including unpacking the gem into its gem dir, installing the
|
6
|
+
# gemspec in the specifications dir, storing the cached gem in the cache dir,
|
7
|
+
# and installing either wrappers or symlinks for executables.
|
8
|
+
#
|
9
|
+
# The installer invokes pre and post install hooks. Hooks can be added either
|
10
|
+
# through a rubygems_plugin.rb file in an installed gem or via a
|
11
|
+
# rubygems/defaults/#{RUBY_ENGINE}.rb or rubygems/defaults/operating_system.rb
|
12
|
+
# file. See Gem.pre_install and Gem.post_install for details.
|
13
|
+
#
|
1
14
|
class Gem::Installer
|
2
|
-
# TODO: Add sinatures...
|
3
15
|
end
|
@@ -1,7 +1,49 @@
|
|
1
|
+
# <!-- rdoc-file=lib/rubygems/request_set.rb -->
|
2
|
+
# A RequestSet groups a request to activate a set of dependencies.
|
3
|
+
#
|
4
|
+
# nokogiri = Gem::Dependency.new 'nokogiri', '~> 1.6'
|
5
|
+
# pg = Gem::Dependency.new 'pg', '~> 0.14'
|
6
|
+
#
|
7
|
+
# set = Gem::RequestSet.new nokogiri, pg
|
8
|
+
#
|
9
|
+
# requests = set.resolve
|
10
|
+
#
|
11
|
+
# p requests.map { |r| r.full_name }
|
12
|
+
# #=> ["nokogiri-1.6.0", "mini_portile-0.5.1", "pg-0.17.0"]
|
13
|
+
#
|
1
14
|
class Gem::RequestSet
|
2
|
-
# TODO: Add sinatures...
|
3
15
|
end
|
4
16
|
|
17
|
+
# <!-- rdoc-file=lib/rubygems/request_set/gem_dependency_api.rb -->
|
18
|
+
# A semi-compatible DSL for the Bundler Gemfile and Isolate gem dependencies
|
19
|
+
# files.
|
20
|
+
#
|
21
|
+
# To work with both the Bundler Gemfile and Isolate formats this implementation
|
22
|
+
# takes some liberties to allow compatibility with each, most notably in
|
23
|
+
# #source.
|
24
|
+
#
|
25
|
+
# A basic gem dependencies file will look like the following:
|
26
|
+
#
|
27
|
+
# source 'https://rubygems.org'
|
28
|
+
#
|
29
|
+
# gem 'rails', '3.2.14a
|
30
|
+
# gem 'devise', '~> 2.1', '>= 2.1.3'
|
31
|
+
# gem 'cancan'
|
32
|
+
# gem 'airbrake'
|
33
|
+
# gem 'pg'
|
34
|
+
#
|
35
|
+
# RubyGems recommends saving this as gem.deps.rb over Gemfile or Isolate.
|
36
|
+
#
|
37
|
+
# To install the gems in this Gemfile use `gem install -g` to install it and
|
38
|
+
# create a lockfile. The lockfile will ensure that when you make changes to
|
39
|
+
# your gem dependencies file a minimum amount of change is made to the
|
40
|
+
# dependencies of your gems.
|
41
|
+
#
|
42
|
+
# RubyGems can activate all the gems in your dependencies file at startup using
|
43
|
+
# the RUBYGEMS_GEMDEPS environment variable or through Gem.use_gemdeps. See
|
44
|
+
# Gem.use_gemdeps for details and warnings.
|
45
|
+
#
|
46
|
+
# See `gem help install` and `gem help gem_dependencies` for further details.
|
47
|
+
#
|
5
48
|
class Gem::RequestSet::GemDependencyAPI
|
6
|
-
# TODO: Add sinatures...
|
7
49
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
+
%a{annotate:rdoc:skip}
|
1
2
|
module Gem
|
3
|
+
# <!-- rdoc-file=lib/rubygems/requirement.rb -->
|
2
4
|
# A Requirement is a set of one or more version restrictions. It supports a few
|
3
5
|
# (`=, !=, >, <, >=, <=, ~>`) different restriction operators.
|
4
6
|
#
|
@@ -8,34 +10,56 @@ module Gem
|
|
8
10
|
class Requirement
|
9
11
|
type operator = "=" | "!=" | ">" | "<" | ">=" | "<=" | "~>"
|
10
12
|
|
13
|
+
# <!-- rdoc-file=lib/rubygems/requirement.rb -->
|
11
14
|
# Raised when a bad requirement is encountered
|
12
15
|
#
|
13
16
|
class BadRequirementError < ArgumentError
|
14
17
|
end
|
15
18
|
|
19
|
+
# <!-- rdoc-file=lib/rubygems/requirement.rb -->
|
16
20
|
# The default requirement matches any version
|
17
21
|
#
|
18
22
|
DefaultPrereleaseRequirement: [ operator, Gem::Version ]
|
19
23
|
|
24
|
+
# <!-- rdoc-file=lib/rubygems/requirement.rb -->
|
20
25
|
# The default requirement matches any non-prerelease version
|
21
26
|
#
|
22
27
|
DefaultRequirement: [ operator, Gem::Version ]
|
23
28
|
|
29
|
+
# <!-- rdoc-file=lib/rubygems/requirement.rb -->
|
24
30
|
# A regular expression that matches a requirement
|
25
31
|
#
|
26
32
|
PATTERN: Regexp
|
27
33
|
|
34
|
+
# <!--
|
35
|
+
# rdoc-file=lib/rubygems/requirement.rb
|
36
|
+
# - create(*inputs)
|
37
|
+
# -->
|
28
38
|
# Factory method to create a Gem::Requirement object. Input may be a Version, a
|
29
39
|
# String, or nil. Intended to simplify client code.
|
30
40
|
#
|
31
41
|
# If the input is "weird", the default version requirement is returned.
|
32
42
|
#
|
33
|
-
def self.create: (*
|
43
|
+
def self.create: (*String | Gem::Version | Gem::Requirement | nil inputs) -> instance
|
34
44
|
|
45
|
+
# <!--
|
46
|
+
# rdoc-file=lib/rubygems/requirement.rb
|
47
|
+
# - default()
|
48
|
+
# -->
|
49
|
+
#
|
35
50
|
def self.default: () -> instance
|
36
51
|
|
52
|
+
# <!--
|
53
|
+
# rdoc-file=lib/rubygems/requirement.rb
|
54
|
+
# - default_prerelease()
|
55
|
+
# -->
|
56
|
+
#
|
37
57
|
def self.default_prerelease: () -> instance
|
38
58
|
|
59
|
+
# <!--
|
60
|
+
# rdoc-file=lib/rubygems/requirement.rb
|
61
|
+
# - parse(obj)
|
62
|
+
# -->
|
39
63
|
# Parse `obj`, returning an `[op, version]` pair. `obj` can be a String or a
|
40
64
|
# Gem::Version.
|
41
65
|
#
|
@@ -48,36 +72,75 @@ module Gem
|
|
48
72
|
#
|
49
73
|
def self.parse: (String | Gem::Version obj) -> [ operator, Gem::Version ]
|
50
74
|
|
75
|
+
# <!--
|
76
|
+
# rdoc-file=lib/rubygems/requirement.rb
|
77
|
+
# - new(*requirements)
|
78
|
+
# -->
|
51
79
|
# Constructs a requirement from `requirements`. Requirements can be Strings,
|
52
80
|
# Gem::Versions, or Arrays of those. `nil` and duplicate requirements are
|
53
81
|
# ignored. An empty set of `requirements` is the same as `">= 0"`.
|
54
82
|
#
|
55
|
-
def initialize: (*
|
83
|
+
def initialize: (*String | Gem::Version requirements) -> void
|
56
84
|
|
85
|
+
# <!--
|
86
|
+
# rdoc-file=lib/rubygems/requirement.rb
|
87
|
+
# - concat(new)
|
88
|
+
# -->
|
57
89
|
# Concatenates the `new` requirements onto this requirement.
|
58
90
|
#
|
59
91
|
def concat: (Array[String | Gem::Version] new) -> void
|
60
92
|
|
93
|
+
# <!--
|
94
|
+
# rdoc-file=lib/rubygems/requirement.rb
|
95
|
+
# - exact?()
|
96
|
+
# -->
|
61
97
|
# true if the requirement is for only an exact version
|
62
98
|
#
|
63
99
|
def exact?: () -> bool
|
64
100
|
|
101
|
+
# <!--
|
102
|
+
# rdoc-file=lib/rubygems/requirement.rb
|
103
|
+
# - none?()
|
104
|
+
# -->
|
65
105
|
# true if this gem has no requirements.
|
66
106
|
#
|
67
107
|
def none?: () -> bool
|
68
108
|
|
109
|
+
# <!--
|
110
|
+
# rdoc-file=lib/rubygems/requirement.rb
|
111
|
+
# - prerelease?()
|
112
|
+
# -->
|
69
113
|
# A requirement is a prerelease if any of the versions inside of it are
|
70
114
|
# prereleases
|
71
115
|
#
|
72
116
|
def prerelease?: () -> bool
|
73
117
|
|
118
|
+
# <!--
|
119
|
+
# rdoc-file=lib/rubygems/requirement.rb
|
120
|
+
# - satisfied_by?(version)
|
121
|
+
# -->
|
74
122
|
# True if `version` satisfies this Requirement.
|
75
123
|
#
|
76
124
|
def satisfied_by?: (Gem::Version version) -> bool
|
77
125
|
|
126
|
+
# <!--
|
127
|
+
# rdoc-file=lib/rubygems/requirement.rb
|
128
|
+
# - ===(version)
|
129
|
+
# -->
|
130
|
+
#
|
78
131
|
alias === satisfied_by?
|
132
|
+
|
133
|
+
# <!--
|
134
|
+
# rdoc-file=lib/rubygems/requirement.rb
|
135
|
+
# - =~(version)
|
136
|
+
# -->
|
137
|
+
#
|
79
138
|
alias =~ satisfied_by?
|
80
139
|
|
140
|
+
# <!--
|
141
|
+
# rdoc-file=lib/rubygems/requirement.rb
|
142
|
+
# - specific?()
|
143
|
+
# -->
|
81
144
|
# True if the requirement will not always match the latest version.
|
82
145
|
#
|
83
146
|
def specific?: () -> bool
|