rbs 2.2.2 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +4 -0
- data/.github/workflows/comments.yml +2 -2
- data/.github/workflows/ruby.yml +1 -1
- data/.gitignore +0 -1
- data/CHANGELOG.md +43 -0
- data/Gemfile +2 -1
- data/Gemfile.lock +117 -0
- data/Rakefile +1 -1
- data/core/dir.rbs +1 -1
- data/core/enumerator.rbs +1 -1
- data/core/false_class.rbs +1 -1
- data/core/integer.rbs +4 -4
- data/core/io/wait.rbs +1 -1
- data/core/module.rbs +21 -2
- data/core/nil_class.rbs +7 -5
- data/core/object.rbs +9 -0
- data/core/trace_point.rbs +42 -3
- data/core/true_class.rbs +1 -1
- data/ext/rbs_extension/constants.c +1 -1
- data/ext/rbs_extension/extconf.rb +1 -1
- data/ext/rbs_extension/location.c +1 -1
- data/ext/rbs_extension/parser.c +4 -3
- data/ext/rbs_extension/parserstate.c +2 -2
- data/ext/rbs_extension/unescape.c +1 -1
- data/lib/rbs/ast/members.rb +2 -1
- data/lib/rbs/collection/installer.rb +4 -1
- data/lib/rbs/definition_builder/ancestor_builder.rb +4 -2
- data/lib/rbs/definition_builder/method_builder.rb +1 -1
- data/lib/rbs/definition_builder.rb +2 -2
- data/lib/rbs/environment.rb +24 -12
- data/lib/rbs/locator.rb +24 -15
- data/lib/rbs/prototype/rb.rb +17 -6
- data/lib/rbs/resolver/constant_resolver.rb +192 -0
- data/lib/rbs/resolver/type_name_resolver.rb +55 -0
- data/lib/rbs/type_name.rb +15 -0
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs.rb +2 -0
- data/schema/members.json +4 -1
- data/sig/environment.rbs +28 -21
- data/sig/environment_loader.rbs +23 -23
- data/sig/locator.rbs +2 -0
- data/sig/manifest.yaml +8 -0
- data/sig/resolver/constant_resolver.rbs +93 -0
- data/sig/resolver/context.rbs +34 -0
- data/sig/resolver/type_name_resolver.rbs +31 -0
- data/sig/typename.rbs +9 -3
- data/stdlib/bigdecimal/0/big_decimal.rbs +135 -0
- data/stdlib/erb/0/erb.rbs +237 -0
- data/stdlib/optparse/0/optparse.rbs +20 -18
- data/stdlib/prime/0/prime.rbs +115 -4
- data/stdlib/rubygems/0/version.rbs +159 -1
- data/steep/Gemfile.lock +13 -15
- metadata +10 -3
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# ### New to OptionParser?
|
5
5
|
#
|
6
|
-
# See the [Tutorial](
|
6
|
+
# See the [Tutorial](optparse/tutorial.rdoc).
|
7
7
|
#
|
8
8
|
# ### Introduction
|
9
9
|
#
|
@@ -374,9 +374,8 @@
|
|
374
374
|
# ### Further documentation
|
375
375
|
#
|
376
376
|
# The above examples, along with the accompanying
|
377
|
-
# [Tutorial](
|
378
|
-
#
|
379
|
-
# http://bugs.ruby-lang.org.
|
377
|
+
# [Tutorial](optparse/tutorial.rdoc), should be enough to learn how to use this
|
378
|
+
# class. If you have any questions, file a ticket at http://bugs.ruby-lang.org.
|
380
379
|
#
|
381
380
|
class OptionParser
|
382
381
|
interface _Pattern
|
@@ -540,12 +539,12 @@ class OptionParser
|
|
540
539
|
# - define(*params, &block)
|
541
540
|
# -->
|
542
541
|
# Creates an option from the given parameters `params`. See [Parameters for New
|
543
|
-
# Options](./
|
542
|
+
# Options](./option_params.rdoc).
|
544
543
|
#
|
545
544
|
# The block, if given, is the handler for the created option. When the option is
|
546
545
|
# encountered during command-line parsing, the block is called with the argument
|
547
546
|
# given for the option, if any. See [Option
|
548
|
-
# Handlers](./
|
547
|
+
# Handlers](./option_params.rdoc#label-Option+Handlers).
|
549
548
|
#
|
550
549
|
def define: (*String params) ?{ (*untyped) -> untyped } -> untyped
|
551
550
|
| (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> untyped
|
@@ -557,12 +556,12 @@ class OptionParser
|
|
557
556
|
# - define_head(*params, &block)
|
558
557
|
# -->
|
559
558
|
# Creates an option from the given parameters `params`. See [Parameters for New
|
560
|
-
# Options](./
|
559
|
+
# Options](./option_params.rdoc).
|
561
560
|
#
|
562
561
|
# The block, if given, is the handler for the created option. When the option is
|
563
562
|
# encountered during command-line parsing, the block is called with the argument
|
564
563
|
# given for the option, if any. See [Option
|
565
|
-
# Handlers](./
|
564
|
+
# Handlers](./option_params.rdoc#label-Option+Handlers).
|
566
565
|
#
|
567
566
|
def define_head: (*String params) ?{ (*untyped) -> untyped } -> untyped
|
568
567
|
| (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> untyped
|
@@ -574,12 +573,12 @@ class OptionParser
|
|
574
573
|
# - define_tail(*params, &block)
|
575
574
|
# -->
|
576
575
|
# Creates an option from the given parameters `params`. See [Parameters for New
|
577
|
-
# Options](./
|
576
|
+
# Options](./option_params.rdoc).
|
578
577
|
#
|
579
578
|
# The block, if given, is the handler for the created option. When the option is
|
580
579
|
# encountered during command-line parsing, the block is called with the argument
|
581
580
|
# given for the option, if any. See [Option
|
582
|
-
# Handlers](./
|
581
|
+
# Handlers](./option_params.rdoc#label-Option+Handlers).
|
583
582
|
#
|
584
583
|
def define_tail: (*String params) ?{ (*untyped) -> untyped } -> untyped
|
585
584
|
| (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> untyped
|
@@ -646,12 +645,12 @@ class OptionParser
|
|
646
645
|
# - make_switch(params, block = nil)
|
647
646
|
# -->
|
648
647
|
# Creates an option from the given parameters `params`. See [Parameters for New
|
649
|
-
# Options](./
|
648
|
+
# Options](./option_params.rdoc).
|
650
649
|
#
|
651
650
|
# The block, if given, is the handler for the created option. When the option is
|
652
651
|
# encountered during command-line parsing, the block is called with the argument
|
653
652
|
# given for the option, if any. See [Option
|
654
|
-
# Handlers](./
|
653
|
+
# Handlers](./option_params.rdoc#label-Option+Handlers).
|
655
654
|
#
|
656
655
|
def make_switch: (Array[untyped] opts, ?Proc block) -> [ untyped, untyped, untyped, untyped, untyped ]
|
657
656
|
|
@@ -669,12 +668,12 @@ class OptionParser
|
|
669
668
|
# - on(*params, &block)
|
670
669
|
# -->
|
671
670
|
# Creates an option from the given parameters `params`. See [Parameters for New
|
672
|
-
# Options](./
|
671
|
+
# Options](./option_params.rdoc).
|
673
672
|
#
|
674
673
|
# The block, if given, is the handler for the created option. When the option is
|
675
674
|
# encountered during command-line parsing, the block is called with the argument
|
676
675
|
# given for the option, if any. See [Option
|
677
|
-
# Handlers](./
|
676
|
+
# Handlers](./option_params.rdoc#label-Option+Handlers).
|
678
677
|
#
|
679
678
|
def on: (*String params) ?{ (*untyped) -> untyped } -> self
|
680
679
|
| (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> self
|
@@ -686,12 +685,12 @@ class OptionParser
|
|
686
685
|
# - on_head(*params, &block)
|
687
686
|
# -->
|
688
687
|
# Creates an option from the given parameters `params`. See [Parameters for New
|
689
|
-
# Options](./
|
688
|
+
# Options](./option_params.rdoc).
|
690
689
|
#
|
691
690
|
# The block, if given, is the handler for the created option. When the option is
|
692
691
|
# encountered during command-line parsing, the block is called with the argument
|
693
692
|
# given for the option, if any. See [Option
|
694
|
-
# Handlers](./
|
693
|
+
# Handlers](./option_params.rdoc#label-Option+Handlers).
|
695
694
|
#
|
696
695
|
# The new option is added at the head of the summary.
|
697
696
|
#
|
@@ -705,12 +704,12 @@ class OptionParser
|
|
705
704
|
# - on_tail(*params, &block)
|
706
705
|
# -->
|
707
706
|
# Creates an option from the given parameters `params`. See [Parameters for New
|
708
|
-
# Options](./
|
707
|
+
# Options](./option_params.rdoc).
|
709
708
|
#
|
710
709
|
# The block, if given, is the handler for the created option. When the option is
|
711
710
|
# encountered during command-line parsing, the block is called with the argument
|
712
711
|
# given for the option, if any. See [Option
|
713
|
-
# Handlers](./
|
712
|
+
# Handlers](./option_params.rdoc#label-Option+Handlers).
|
714
713
|
#
|
715
714
|
# The new option is added at the tail of the summary.
|
716
715
|
#
|
@@ -809,6 +808,9 @@ class OptionParser
|
|
809
808
|
#
|
810
809
|
def release: () -> untyped
|
811
810
|
|
811
|
+
# <!-- rdoc-file=lib/optparse.rb -->
|
812
|
+
# Release code
|
813
|
+
#
|
812
814
|
def release=: (untyped) -> untyped
|
813
815
|
|
814
816
|
# <!--
|
data/stdlib/prime/0/prime.rbs
CHANGED
@@ -76,9 +76,66 @@ class Prime
|
|
76
76
|
# : Upper bound of prime numbers. The iterator stops after it yields all prime
|
77
77
|
# numbers p <= `ubound`.
|
78
78
|
#
|
79
|
-
def self
|
79
|
+
def self.each: (?Integer? ubound, ?PseudoPrimeGenerator generator) { (Integer) -> void } -> void
|
80
80
|
| (?Integer? ubound, ?PseudoPrimeGenerator generator) -> PseudoPrimeGenerator
|
81
81
|
|
82
|
+
# <!--
|
83
|
+
# rdoc-file=lib/prime.rb
|
84
|
+
# - each(ubound = nil, generator = EratosthenesGenerator.new, &block)
|
85
|
+
# -->
|
86
|
+
# Iterates the given block over all prime numbers.
|
87
|
+
#
|
88
|
+
# ## Parameters
|
89
|
+
#
|
90
|
+
# `ubound`
|
91
|
+
# : Optional. An arbitrary positive number. The upper bound of enumeration.
|
92
|
+
# The method enumerates prime numbers infinitely if `ubound` is nil.
|
93
|
+
# `generator`
|
94
|
+
# : Optional. An implementation of pseudo-prime generator.
|
95
|
+
#
|
96
|
+
#
|
97
|
+
# ## Return value
|
98
|
+
#
|
99
|
+
# An evaluated value of the given block at the last time. Or an enumerator which
|
100
|
+
# is compatible to an `Enumerator` if no block given.
|
101
|
+
#
|
102
|
+
# ## Description
|
103
|
+
#
|
104
|
+
# Calls `block` once for each prime number, passing the prime as a parameter.
|
105
|
+
#
|
106
|
+
# `ubound`
|
107
|
+
# : Upper bound of prime numbers. The iterator stops after it yields all prime
|
108
|
+
# numbers p <= `ubound`.
|
109
|
+
#
|
110
|
+
def each: (?Integer? ubound, ?PseudoPrimeGenerator generator) { (Integer) -> void } -> void
|
111
|
+
| (?Integer? ubound, ?PseudoPrimeGenerator generator) -> PseudoPrimeGenerator
|
112
|
+
|
113
|
+
# <!--
|
114
|
+
# rdoc-file=lib/prime.rb
|
115
|
+
# - int_from_prime_division(pd)
|
116
|
+
# -->
|
117
|
+
# Re-composes a prime factorization and returns the product.
|
118
|
+
#
|
119
|
+
# For the decomposition:
|
120
|
+
#
|
121
|
+
# [[p_1, e_1], [p_2, e_2], ..., [p_n, e_n]],
|
122
|
+
#
|
123
|
+
# it returns:
|
124
|
+
#
|
125
|
+
# p_1**e_1 * p_2**e_2 * ... * p_n**e_n.
|
126
|
+
#
|
127
|
+
# ## Parameters
|
128
|
+
# `pd`
|
129
|
+
# : Array of pairs of integers. Each pair consists of a prime number -- a
|
130
|
+
# prime factor -- and a natural number -- its exponent (multiplicity).
|
131
|
+
#
|
132
|
+
#
|
133
|
+
# ## Example
|
134
|
+
# Prime.int_from_prime_division([[3, 2], [5, 1]]) #=> 45
|
135
|
+
# 3**2 * 5 #=> 45
|
136
|
+
#
|
137
|
+
def self.int_from_prime_division: (Array[[ Integer, Integer ]]) -> Integer
|
138
|
+
|
82
139
|
# <!--
|
83
140
|
# rdoc-file=lib/prime.rb
|
84
141
|
# - int_from_prime_division(pd)
|
@@ -103,7 +160,7 @@ class Prime
|
|
103
160
|
# Prime.int_from_prime_division([[3, 2], [5, 1]]) #=> 45
|
104
161
|
# 3**2 * 5 #=> 45
|
105
162
|
#
|
106
|
-
def
|
163
|
+
def int_from_prime_division: (Array[[ Integer, Integer ]]) -> Integer
|
107
164
|
|
108
165
|
# <!--
|
109
166
|
# rdoc-file=lib/prime.rb
|
@@ -119,7 +176,61 @@ class Prime
|
|
119
176
|
# `generator`
|
120
177
|
# : optional. A pseudo-prime generator.
|
121
178
|
#
|
122
|
-
def self
|
179
|
+
def self.prime?: (Integer value, ?PseudoPrimeGenerator generator) -> bool
|
180
|
+
|
181
|
+
# <!--
|
182
|
+
# rdoc-file=lib/prime.rb
|
183
|
+
# - prime?(value, generator = Prime::Generator23.new)
|
184
|
+
# -->
|
185
|
+
# Returns true if `value` is a prime number, else returns false. Integer#prime?
|
186
|
+
# is much more performant.
|
187
|
+
#
|
188
|
+
# ## Parameters
|
189
|
+
#
|
190
|
+
# `value`
|
191
|
+
# : an arbitrary integer to be checked.
|
192
|
+
# `generator`
|
193
|
+
# : optional. A pseudo-prime generator.
|
194
|
+
#
|
195
|
+
def prime?: (Integer value, ?PseudoPrimeGenerator generator) -> bool
|
196
|
+
|
197
|
+
# <!--
|
198
|
+
# rdoc-file=lib/prime.rb
|
199
|
+
# - prime_division(value, generator = Prime::Generator23.new)
|
200
|
+
# -->
|
201
|
+
# Returns the factorization of `value`.
|
202
|
+
#
|
203
|
+
# For an arbitrary integer:
|
204
|
+
#
|
205
|
+
# p_1**e_1 * p_2**e_2 * ... * p_n**e_n,
|
206
|
+
#
|
207
|
+
# prime_division returns an array of pairs of integers:
|
208
|
+
#
|
209
|
+
# [[p_1, e_1], [p_2, e_2], ..., [p_n, e_n]].
|
210
|
+
#
|
211
|
+
# Each pair consists of a prime number -- a prime factor -- and a natural number
|
212
|
+
# -- its exponent (multiplicity).
|
213
|
+
#
|
214
|
+
# ## Parameters
|
215
|
+
# `value`
|
216
|
+
# : An arbitrary integer.
|
217
|
+
# `generator`
|
218
|
+
# : Optional. A pseudo-prime generator. `generator`.succ must return the next
|
219
|
+
# pseudo-prime number in ascending order. It must generate all prime
|
220
|
+
# numbers, but may also generate non-prime numbers, too.
|
221
|
+
#
|
222
|
+
#
|
223
|
+
# ### Exceptions
|
224
|
+
# `ZeroDivisionError`
|
225
|
+
# : when `value` is zero.
|
226
|
+
#
|
227
|
+
#
|
228
|
+
# ## Example
|
229
|
+
#
|
230
|
+
# Prime.prime_division(45) #=> [[3, 2], [5, 1]]
|
231
|
+
# 3**2 * 5 #=> 45
|
232
|
+
#
|
233
|
+
def self.prime_division: (Integer, ?PseudoPrimeGenerator generator) -> Array[[ Integer, Integer ]]
|
123
234
|
|
124
235
|
# <!--
|
125
236
|
# rdoc-file=lib/prime.rb
|
@@ -157,7 +268,7 @@ class Prime
|
|
157
268
|
# Prime.prime_division(45) #=> [[3, 2], [5, 1]]
|
158
269
|
# 3**2 * 5 #=> 45
|
159
270
|
#
|
160
|
-
def
|
271
|
+
def prime_division: (Integer, ?PseudoPrimeGenerator generator) -> Array[[ Integer, Integer ]]
|
161
272
|
|
162
273
|
# Returns the singleton instance.
|
163
274
|
#
|
@@ -1,5 +1,163 @@
|
|
1
1
|
%a{annotate:rdoc:skip}
|
2
2
|
module Gem
|
3
|
+
# <!-- rdoc-file=lib/rubygems/version.rb -->
|
4
|
+
# The Version class processes string versions into comparable values. A version
|
5
|
+
# string should normally be a series of numbers separated by periods. Each part
|
6
|
+
# (digits separated by periods) is considered its own number, and these are used
|
7
|
+
# for sorting. So for instance, 3.10 sorts higher than 3.2 because ten is
|
8
|
+
# greater than two.
|
9
|
+
#
|
10
|
+
# If any part contains letters (currently only a-z are supported) then that
|
11
|
+
# version is considered prerelease. Versions with a prerelease part in the Nth
|
12
|
+
# part sort less than versions with N-1 parts. Prerelease parts are sorted
|
13
|
+
# alphabetically using the normal Ruby string sorting rules. If a prerelease
|
14
|
+
# part contains both letters and numbers, it will be broken into multiple parts
|
15
|
+
# to provide expected sort behavior (1.0.a10 becomes 1.0.a.10, and is greater
|
16
|
+
# than 1.0.a9).
|
17
|
+
#
|
18
|
+
# Prereleases sort between real releases (newest to oldest):
|
19
|
+
#
|
20
|
+
# 1. 1.0
|
21
|
+
# 2. 1.0.b1
|
22
|
+
# 3. 1.0.a.2
|
23
|
+
# 4. 0.9
|
24
|
+
#
|
25
|
+
#
|
26
|
+
# If you want to specify a version restriction that includes both prereleases
|
27
|
+
# and regular releases of the 1.x series this is the best way:
|
28
|
+
#
|
29
|
+
# s.add_dependency 'example', '>= 1.0.0.a', '< 2.0.0'
|
30
|
+
#
|
31
|
+
# ## How Software Changes
|
32
|
+
#
|
33
|
+
# Users expect to be able to specify a version constraint that gives them some
|
34
|
+
# reasonable expectation that new versions of a library will work with their
|
35
|
+
# software if the version constraint is true, and not work with their software
|
36
|
+
# if the version constraint is false. In other words, the perfect system will
|
37
|
+
# accept all compatible versions of the library and reject all incompatible
|
38
|
+
# versions.
|
39
|
+
#
|
40
|
+
# Libraries change in 3 ways (well, more than 3, but stay focused here!).
|
41
|
+
#
|
42
|
+
# 1. The change may be an implementation detail only and have no effect on the
|
43
|
+
# client software.
|
44
|
+
# 2. The change may add new features, but do so in a way that client software
|
45
|
+
# written to an earlier version is still compatible.
|
46
|
+
# 3. The change may change the public interface of the library in such a way
|
47
|
+
# that old software is no longer compatible.
|
48
|
+
#
|
49
|
+
#
|
50
|
+
# Some examples are appropriate at this point. Suppose I have a Stack class
|
51
|
+
# that supports a `push` and a `pop` method.
|
52
|
+
#
|
53
|
+
# ### Examples of Category 1 changes:
|
54
|
+
#
|
55
|
+
# * Switch from an array based implementation to a linked-list based
|
56
|
+
# implementation.
|
57
|
+
# * Provide an automatic (and transparent) backing store for large stacks.
|
58
|
+
#
|
59
|
+
#
|
60
|
+
# ### Examples of Category 2 changes might be:
|
61
|
+
#
|
62
|
+
# * Add a `depth` method to return the current depth of the stack.
|
63
|
+
# * Add a `top` method that returns the current top of stack (without changing
|
64
|
+
# the stack).
|
65
|
+
# * Change `push` so that it returns the item pushed (previously it had no
|
66
|
+
# usable return value).
|
67
|
+
#
|
68
|
+
#
|
69
|
+
# ### Examples of Category 3 changes might be:
|
70
|
+
#
|
71
|
+
# * Changes `pop` so that it no longer returns a value (you must use `top` to
|
72
|
+
# get the top of the stack).
|
73
|
+
# * Rename the methods to `push_item` and `pop_item`.
|
74
|
+
#
|
75
|
+
#
|
76
|
+
# ## RubyGems Rational Versioning
|
77
|
+
#
|
78
|
+
# * Versions shall be represented by three non-negative integers, separated by
|
79
|
+
# periods (e.g. 3.1.4). The first integers is the "major" version number,
|
80
|
+
# the second integer is the "minor" version number, and the third integer is
|
81
|
+
# the "build" number.
|
82
|
+
#
|
83
|
+
# * A category 1 change (implementation detail) will increment the build
|
84
|
+
# number.
|
85
|
+
#
|
86
|
+
# * A category 2 change (backwards compatible) will increment the minor
|
87
|
+
# version number and reset the build number.
|
88
|
+
#
|
89
|
+
# * A category 3 change (incompatible) will increment the major build number
|
90
|
+
# and reset the minor and build numbers.
|
91
|
+
#
|
92
|
+
# * Any "public" release of a gem should have a different version. Normally
|
93
|
+
# that means incrementing the build number. This means a developer can
|
94
|
+
# generate builds all day long, but as soon as they make a public release,
|
95
|
+
# the version must be updated.
|
96
|
+
#
|
97
|
+
#
|
98
|
+
# ### Examples
|
99
|
+
#
|
100
|
+
# Let's work through a project lifecycle using our Stack example from above.
|
101
|
+
#
|
102
|
+
# Version 0.0.1
|
103
|
+
# : The initial Stack class is release.
|
104
|
+
# Version 0.0.2
|
105
|
+
# : Switched to a linked=list implementation because it is cooler.
|
106
|
+
# Version 0.1.0
|
107
|
+
# : Added a `depth` method.
|
108
|
+
# Version 1.0.0
|
109
|
+
# : Added `top` and made `pop` return nil (`pop` used to return the old top
|
110
|
+
# item).
|
111
|
+
# Version 1.1.0
|
112
|
+
# : `push` now returns the value pushed (it used it return nil).
|
113
|
+
# Version 1.1.1
|
114
|
+
# : Fixed a bug in the linked list implementation.
|
115
|
+
# Version 1.1.2
|
116
|
+
# : Fixed a bug introduced in the last fix.
|
117
|
+
#
|
118
|
+
#
|
119
|
+
# Client A needs a stack with basic push/pop capability. They write to the
|
120
|
+
# original interface (no `top`), so their version constraint looks like:
|
121
|
+
#
|
122
|
+
# gem 'stack', '>= 0.0'
|
123
|
+
#
|
124
|
+
# Essentially, any version is OK with Client A. An incompatible change to the
|
125
|
+
# library will cause them grief, but they are willing to take the chance (we
|
126
|
+
# call Client A optimistic).
|
127
|
+
#
|
128
|
+
# Client B is just like Client A except for two things: (1) They use the `depth`
|
129
|
+
# method and (2) they are worried about future incompatibilities, so they write
|
130
|
+
# their version constraint like this:
|
131
|
+
#
|
132
|
+
# gem 'stack', '~> 0.1'
|
133
|
+
#
|
134
|
+
# The `depth` method was introduced in version 0.1.0, so that version or
|
135
|
+
# anything later is fine, as long as the version stays below version 1.0 where
|
136
|
+
# incompatibilities are introduced. We call Client B pessimistic because they
|
137
|
+
# are worried about incompatible future changes (it is OK to be pessimistic!).
|
138
|
+
#
|
139
|
+
# ## Preventing Version Catastrophe:
|
140
|
+
#
|
141
|
+
# From: http://blog.zenspider.com/2008/10/rubygems-howto-preventing-cata.html
|
142
|
+
#
|
143
|
+
# Let's say you're depending on the fnord gem version 2.y.z. If you specify your
|
144
|
+
# dependency as ">= 2.0.0" then, you're good, right? What happens if fnord 3.0
|
145
|
+
# comes out and it isn't backwards compatible with 2.y.z? Your stuff will break
|
146
|
+
# as a result of using ">=". The better route is to specify your dependency with
|
147
|
+
# an "approximate" version specifier ("~>"). They're a tad confusing, so here is
|
148
|
+
# how the dependency specifiers work:
|
149
|
+
#
|
150
|
+
# Specification From ... To (exclusive)
|
151
|
+
# ">= 3.0" 3.0 ... ∞
|
152
|
+
# "~> 3.0" 3.0 ... 4.0
|
153
|
+
# "~> 3.0.0" 3.0.0 ... 3.1
|
154
|
+
# "~> 3.5" 3.5 ... 4.0
|
155
|
+
# "~> 3.5.0" 3.5.0 ... 3.6
|
156
|
+
# "~> 3" 3.0 ... 4.0
|
157
|
+
#
|
158
|
+
# For the last example, single-digit versions are automatically extended with a
|
159
|
+
# zero to give a sensible result.
|
160
|
+
#
|
3
161
|
class Version
|
4
162
|
include Comparable
|
5
163
|
|
@@ -40,7 +198,7 @@ module Gem
|
|
40
198
|
# -->
|
41
199
|
# Compares this version with `other` returning -1, 0, or 1 if the other version
|
42
200
|
# is larger, the same, or smaller than this one. Attempts to compare to
|
43
|
-
# something that's not a `Gem::Version` return `nil`.
|
201
|
+
# something that's not a `Gem::Version` or a valid version String return `nil`.
|
44
202
|
#
|
45
203
|
def <=>: (untyped other) -> Integer?
|
46
204
|
|
data/steep/Gemfile.lock
CHANGED
@@ -1,45 +1,43 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activesupport (
|
4
|
+
activesupport (7.0.2.3)
|
5
5
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
6
6
|
i18n (>= 1.6, < 2)
|
7
7
|
minitest (>= 5.1)
|
8
8
|
tzinfo (~> 2.0)
|
9
|
-
zeitwerk (~> 2.3)
|
10
9
|
ast (2.4.2)
|
11
|
-
concurrent-ruby (1.1.
|
12
|
-
ffi (1.15.
|
13
|
-
i18n (1.
|
10
|
+
concurrent-ruby (1.1.10)
|
11
|
+
ffi (1.15.5)
|
12
|
+
i18n (1.10.0)
|
14
13
|
concurrent-ruby (~> 1.0)
|
15
14
|
language_server-protocol (3.16.0.3)
|
16
|
-
listen (3.7.
|
15
|
+
listen (3.7.1)
|
17
16
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
18
17
|
rb-inotify (~> 0.9, >= 0.9.10)
|
19
|
-
minitest (5.
|
20
|
-
parallel (1.
|
21
|
-
parser (3.
|
18
|
+
minitest (5.15.0)
|
19
|
+
parallel (1.22.0)
|
20
|
+
parser (3.1.1.0)
|
22
21
|
ast (~> 2.4.1)
|
23
|
-
rainbow (3.
|
24
|
-
rb-fsevent (0.11.
|
22
|
+
rainbow (3.1.1)
|
23
|
+
rb-fsevent (0.11.1)
|
25
24
|
rb-inotify (0.10.1)
|
26
25
|
ffi (~> 1.0)
|
27
|
-
rbs (
|
28
|
-
steep (0.
|
26
|
+
rbs (2.2.2)
|
27
|
+
steep (0.50.0)
|
29
28
|
activesupport (>= 5.1)
|
30
29
|
language_server-protocol (>= 3.15, < 4.0)
|
31
30
|
listen (~> 3.0)
|
32
31
|
parallel (>= 1.0.0)
|
33
32
|
parser (>= 3.0)
|
34
33
|
rainbow (>= 2.2.2, < 4.0)
|
35
|
-
rbs (
|
34
|
+
rbs (>= 2.2.0)
|
36
35
|
terminal-table (>= 2, < 4)
|
37
36
|
terminal-table (3.0.2)
|
38
37
|
unicode-display_width (>= 1.1.1, < 3)
|
39
38
|
tzinfo (2.0.4)
|
40
39
|
concurrent-ruby (~> 1.0)
|
41
40
|
unicode-display_width (2.1.0)
|
42
|
-
zeitwerk (2.5.1)
|
43
41
|
|
44
42
|
PLATFORMS
|
45
43
|
ruby
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soutaro Matsumoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: RBS is the language for type signatures for Ruby and standard library
|
14
14
|
definitions.
|
@@ -29,6 +29,7 @@ files:
|
|
29
29
|
- CHANGELOG.md
|
30
30
|
- COPYING
|
31
31
|
- Gemfile
|
32
|
+
- Gemfile.lock
|
32
33
|
- README.md
|
33
34
|
- Rakefile
|
34
35
|
- Steepfile
|
@@ -171,6 +172,8 @@ files:
|
|
171
172
|
- lib/rbs/prototype/rbi.rb
|
172
173
|
- lib/rbs/prototype/runtime.rb
|
173
174
|
- lib/rbs/repository.rb
|
175
|
+
- lib/rbs/resolver/constant_resolver.rb
|
176
|
+
- lib/rbs/resolver/type_name_resolver.rb
|
174
177
|
- lib/rbs/substitution.rb
|
175
178
|
- lib/rbs/test.rb
|
176
179
|
- lib/rbs/test/errors.rb
|
@@ -228,6 +231,7 @@ files:
|
|
228
231
|
- sig/errors.rbs
|
229
232
|
- sig/location.rbs
|
230
233
|
- sig/locator.rbs
|
234
|
+
- sig/manifest.yaml
|
231
235
|
- sig/members.rbs
|
232
236
|
- sig/method_builder.rbs
|
233
237
|
- sig/method_types.rbs
|
@@ -236,6 +240,9 @@ files:
|
|
236
240
|
- sig/polyfill.rbs
|
237
241
|
- sig/rbs.rbs
|
238
242
|
- sig/repository.rbs
|
243
|
+
- sig/resolver/constant_resolver.rbs
|
244
|
+
- sig/resolver/context.rbs
|
245
|
+
- sig/resolver/type_name_resolver.rbs
|
239
246
|
- sig/substitution.rbs
|
240
247
|
- sig/type_alias_dependency.rbs
|
241
248
|
- sig/type_alias_regularity.rbs
|
@@ -373,7 +380,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
373
380
|
- !ruby/object:Gem::Version
|
374
381
|
version: '0'
|
375
382
|
requirements: []
|
376
|
-
rubygems_version: 3.3.
|
383
|
+
rubygems_version: 3.3.7
|
377
384
|
signing_key:
|
378
385
|
specification_version: 4
|
379
386
|
summary: Type signature for Ruby.
|