rbs 0.13.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +9 -5
  3. data/.gitignore +0 -1
  4. data/CHANGELOG.md +33 -1
  5. data/Gemfile +4 -0
  6. data/README.md +9 -3
  7. data/Rakefile +14 -1
  8. data/Steepfile +1 -1
  9. data/bin/annotate-with-rdoc +1 -1
  10. data/bin/setup +0 -2
  11. data/bin/test_runner.rb +15 -1
  12. data/{stdlib/builtin → core}/array.rbs +124 -120
  13. data/{stdlib/builtin → core}/basic_object.rbs +54 -54
  14. data/{stdlib/builtin → core}/binding.rbs +42 -42
  15. data/core/builtin.rbs +70 -0
  16. data/{stdlib/builtin → core}/class.rbs +33 -33
  17. data/{stdlib/builtin → core}/comparable.rbs +0 -0
  18. data/{stdlib/builtin → core}/complex.rbs +90 -90
  19. data/{stdlib/builtin → core}/constants.rbs +0 -0
  20. data/{stdlib/builtin → core}/data.rbs +0 -0
  21. data/{stdlib/builtin → core}/deprecated.rbs +0 -0
  22. data/{stdlib/builtin → core}/dir.rbs +1 -1
  23. data/{stdlib/builtin → core}/encoding.rbs +33 -33
  24. data/{stdlib/builtin → core}/enumerable.rbs +99 -92
  25. data/{stdlib/builtin → core}/enumerator.rbs +40 -40
  26. data/{stdlib/builtin → core}/errno.rbs +0 -0
  27. data/{stdlib/builtin → core}/errors.rbs +2 -2
  28. data/{stdlib/builtin → core}/exception.rbs +50 -50
  29. data/{stdlib/builtin → core}/false_class.rbs +6 -6
  30. data/{stdlib/builtin → core}/fiber.rbs +14 -14
  31. data/{stdlib/builtin → core}/fiber_error.rbs +1 -1
  32. data/{stdlib/builtin → core}/file.rbs +0 -0
  33. data/{stdlib/builtin → core}/file_test.rbs +0 -0
  34. data/{stdlib/builtin → core}/float.rbs +161 -161
  35. data/{stdlib/builtin → core}/gc.rbs +3 -3
  36. data/{stdlib/builtin → core}/hash.rbs +15 -15
  37. data/{stdlib/builtin → core}/integer.rbs +0 -0
  38. data/{stdlib/builtin → core}/io.rbs +89 -89
  39. data/{stdlib/builtin → core}/kernel.rbs +70 -154
  40. data/{stdlib/builtin → core}/marshal.rbs +0 -0
  41. data/{stdlib/builtin → core}/match_data.rbs +1 -1
  42. data/{stdlib/builtin → core}/math.rbs +0 -0
  43. data/{stdlib/builtin → core}/method.rbs +19 -19
  44. data/{stdlib/builtin → core}/module.rbs +13 -13
  45. data/{stdlib/builtin → core}/nil_class.rbs +20 -20
  46. data/{stdlib/builtin → core}/numeric.rbs +101 -101
  47. data/{stdlib/builtin → core}/object.rbs +173 -173
  48. data/{stdlib/builtin → core}/proc.rbs +91 -91
  49. data/{stdlib/builtin → core}/process.rbs +0 -0
  50. data/{stdlib/builtin → core}/random.rbs +1 -1
  51. data/{stdlib/builtin → core}/range.rbs +4 -6
  52. data/{stdlib/builtin → core}/rational.rbs +83 -83
  53. data/{stdlib/builtin → core}/rb_config.rbs +0 -0
  54. data/{stdlib/builtin → core}/regexp.rbs +0 -0
  55. data/{stdlib/builtin → core}/ruby_vm.rbs +0 -0
  56. data/{stdlib/builtin → core}/signal.rbs +7 -7
  57. data/{stdlib/builtin → core}/string.rbs +10 -10
  58. data/{stdlib/builtin → core}/string_io.rbs +8 -8
  59. data/{stdlib/builtin → core}/struct.rbs +2 -2
  60. data/{stdlib/builtin → core}/symbol.rbs +1 -1
  61. data/{stdlib/builtin → core}/thread.rbs +189 -189
  62. data/{stdlib/builtin → core}/thread_group.rbs +2 -2
  63. data/{stdlib/builtin → core}/time.rbs +0 -0
  64. data/{stdlib/builtin → core}/trace_point.rbs +0 -0
  65. data/{stdlib/builtin → core}/true_class.rbs +10 -10
  66. data/{stdlib/builtin → core}/unbound_method.rbs +0 -0
  67. data/{stdlib/builtin → core}/warning.rbs +1 -1
  68. data/docs/CONTRIBUTING.md +1 -0
  69. data/docs/repo.md +125 -0
  70. data/docs/syntax.md +50 -6
  71. data/goodcheck.yml +22 -5
  72. data/lib/rbs.rb +1 -0
  73. data/lib/rbs/ast/comment.rb +1 -1
  74. data/lib/rbs/cli.rb +105 -103
  75. data/lib/rbs/definition.rb +9 -4
  76. data/lib/rbs/definition_builder.rb +54 -22
  77. data/lib/rbs/environment.rb +1 -1
  78. data/lib/rbs/environment_loader.rb +79 -105
  79. data/lib/rbs/namespace.rb +1 -1
  80. data/lib/rbs/parser.rb +3153 -0
  81. data/lib/rbs/parser.y +25 -11
  82. data/lib/rbs/prototype/rb.rb +47 -9
  83. data/lib/rbs/prototype/runtime.rb +17 -7
  84. data/lib/rbs/repository.rb +121 -0
  85. data/lib/rbs/test/hook.rb +2 -0
  86. data/lib/rbs/test/setup.rb +5 -3
  87. data/lib/rbs/test/setup_helper.rb +4 -4
  88. data/lib/rbs/test/tester.rb +4 -1
  89. data/lib/rbs/test/type_check.rb +12 -6
  90. data/lib/rbs/type_name.rb +3 -2
  91. data/lib/rbs/variance_calculator.rb +1 -1
  92. data/lib/rbs/vendorer.rb +38 -16
  93. data/lib/rbs/version.rb +1 -1
  94. data/lib/rbs/writer.rb +1 -1
  95. data/sig/cli.rbs +58 -0
  96. data/sig/constant.rbs +2 -2
  97. data/sig/constant_table.rbs +11 -11
  98. data/sig/declarations.rbs +2 -2
  99. data/sig/definition.rbs +10 -5
  100. data/sig/definition_builder.rbs +4 -1
  101. data/sig/environment_loader.rbs +92 -46
  102. data/sig/members.rbs +2 -2
  103. data/sig/method_types.rbs +1 -1
  104. data/sig/namespace.rbs +4 -4
  105. data/sig/parser.rbs +25 -0
  106. data/sig/polyfill.rbs +42 -0
  107. data/sig/rbs.rbs +8 -0
  108. data/sig/repository.rbs +79 -0
  109. data/sig/substitution.rbs +3 -3
  110. data/sig/typename.rbs +1 -1
  111. data/sig/types.rbs +1 -1
  112. data/sig/vendorer.rbs +44 -0
  113. data/sig/writer.rbs +15 -15
  114. data/stdlib/abbrev/{abbrev.rbs → 0/abbrev.rbs} +0 -0
  115. data/stdlib/base64/{base64.rbs → 0/base64.rbs} +1 -1
  116. data/stdlib/benchmark/{benchmark.rbs → 0/benchmark.rbs} +2 -2
  117. data/stdlib/{bigdecimal/math → bigdecimal-math/0}/big_math.rbs +0 -0
  118. data/stdlib/bigdecimal/{big_decimal.rbs → 0/big_decimal.rbs} +0 -0
  119. data/stdlib/coverage/{coverage.rbs → 0/coverage.rbs} +2 -2
  120. data/stdlib/csv/{csv.rbs → 0/csv.rbs} +4 -4
  121. data/stdlib/date/{date.rbs → 0/date.rbs} +4 -4
  122. data/stdlib/date/{date_time.rbs → 0/date_time.rbs} +1 -1
  123. data/stdlib/dbm/0/dbm.rbs +277 -0
  124. data/stdlib/erb/{erb.rbs → 0/erb.rbs} +0 -0
  125. data/stdlib/fiber/{fiber.rbs → 0/fiber.rbs} +0 -0
  126. data/stdlib/find/{find.rbs → 0/find.rbs} +12 -12
  127. data/stdlib/forwardable/{forwardable.rbs → 0/forwardable.rbs} +0 -0
  128. data/stdlib/ipaddr/{ipaddr.rbs → 0/ipaddr.rbs} +0 -0
  129. data/stdlib/json/{json.rbs → 0/json.rbs} +0 -0
  130. data/stdlib/logger/{formatter.rbs → 0/formatter.rbs} +0 -0
  131. data/stdlib/logger/{log_device.rbs → 0/log_device.rbs} +1 -1
  132. data/stdlib/logger/{logger.rbs → 0/logger.rbs} +1 -1
  133. data/stdlib/logger/{period.rbs → 0/period.rbs} +0 -0
  134. data/stdlib/logger/{severity.rbs → 0/severity.rbs} +0 -0
  135. data/stdlib/mutex_m/{mutex_m.rbs → 0/mutex_m.rbs} +0 -0
  136. data/stdlib/pathname/{pathname.rbs → 0/pathname.rbs} +40 -40
  137. data/stdlib/prime/{integer-extension.rbs → 0/integer-extension.rbs} +0 -0
  138. data/stdlib/prime/{prime.rbs → 0/prime.rbs} +1 -1
  139. data/stdlib/pstore/0/pstore.rbs +287 -0
  140. data/stdlib/pty/{pty.rbs → 0/pty.rbs} +1 -1
  141. data/stdlib/securerandom/{securerandom.rbs → 0/securerandom.rbs} +0 -0
  142. data/stdlib/set/{set.rbs → 0/set.rbs} +10 -10
  143. data/stdlib/tmpdir/{tmpdir.rbs → 0/tmpdir.rbs} +12 -12
  144. data/stdlib/tsort/0/cyclic.rbs +4 -0
  145. data/stdlib/tsort/0/interfaces.rbs +19 -0
  146. data/stdlib/tsort/0/tsort.rbs +363 -0
  147. data/stdlib/uri/{file.rbs → 0/file.rbs} +0 -0
  148. data/stdlib/uri/{generic.rbs → 0/generic.rbs} +1 -1
  149. data/stdlib/uri/{http.rbs → 0/http.rbs} +0 -0
  150. data/stdlib/uri/{https.rbs → 0/https.rbs} +0 -0
  151. data/stdlib/uri/{ldap.rbs → 0/ldap.rbs} +0 -0
  152. data/stdlib/uri/{ldaps.rbs → 0/ldaps.rbs} +0 -0
  153. data/stdlib/zlib/{zlib.rbs → 0/zlib.rbs} +0 -0
  154. data/steep/Gemfile.lock +9 -9
  155. metadata +104 -93
  156. data/stdlib/builtin/builtin.rbs +0 -42
@@ -137,7 +137,7 @@ class Prime
137
137
  class PseudoPrimeGenerator
138
138
  def initialize: (?Integer?) -> void
139
139
 
140
- include Enumerable[Integer, void]
140
+ include Enumerable[Integer]
141
141
 
142
142
  attr_accessor upper_bound (): Integer?
143
143
 
@@ -0,0 +1,287 @@
1
+ # PStore implements a file based persistence mechanism based on a Hash. User
2
+ # code can store hierarchies of Ruby objects (values) into the data store file
3
+ # by name (keys). An object hierarchy may be just a single object. User code
4
+ # may later read values back from the data store or even update data, as needed.
5
+ #
6
+ # The transactional behavior ensures that any changes succeed or fail together.
7
+ # This can be used to ensure that the data store is not left in a transitory
8
+ # state, where some values were updated but others were not.
9
+ #
10
+ # Behind the scenes, Ruby objects are stored to the data store file with
11
+ # Marshal. That carries the usual limitations. Proc objects cannot be
12
+ # marshalled, for example.
13
+ #
14
+ # ## Usage example:
15
+ #
16
+ # require "pstore"
17
+ #
18
+ # # a mock wiki object...
19
+ # class WikiPage
20
+ # def initialize( page_name, author, contents )
21
+ # @page_name = page_name
22
+ # @revisions = Array.new
23
+ #
24
+ # add_revision(author, contents)
25
+ # end
26
+ #
27
+ # attr_reader :page_name
28
+ #
29
+ # def add_revision( author, contents )
30
+ # @revisions << { :created => Time.now,
31
+ # :author => author,
32
+ # :contents => contents }
33
+ # end
34
+ #
35
+ # def wiki_page_references
36
+ # [@page_name] + @revisions.last[:contents].scan(/\b(?:[A-Z]+[a-z]+){2,}/)
37
+ # end
38
+ #
39
+ # # ...
40
+ # end
41
+ #
42
+ # # create a new page...
43
+ # home_page = WikiPage.new( "HomePage", "James Edward Gray II",
44
+ # "A page about the JoysOfDocumentation..." )
45
+ #
46
+ # # then we want to update page data and the index together, or not at all...
47
+ # wiki = PStore.new("wiki_pages.pstore")
48
+ # wiki.transaction do # begin transaction; do all of this or none of it
49
+ # # store page...
50
+ # wiki[home_page.page_name] = home_page
51
+ # # ensure that an index has been created...
52
+ # wiki[:wiki_index] ||= Array.new
53
+ # # update wiki index...
54
+ # wiki[:wiki_index].push(*home_page.wiki_page_references)
55
+ # end # commit changes to wiki data store file
56
+ #
57
+ # ### Some time later... ###
58
+ #
59
+ # # read wiki data...
60
+ # wiki.transaction(true) do # begin read-only transaction, no changes allowed
61
+ # wiki.roots.each do |data_root_name|
62
+ # p data_root_name
63
+ # p wiki[data_root_name]
64
+ # end
65
+ # end
66
+ #
67
+ # ## Transaction modes
68
+ #
69
+ # By default, file integrity is only ensured as long as the operating system
70
+ # (and the underlying hardware) doesn't raise any unexpected I/O errors. If an
71
+ # I/O error occurs while PStore is writing to its file, then the file will
72
+ # become corrupted.
73
+ #
74
+ # You can prevent this by setting *pstore.ultra_safe = true*. However, this
75
+ # results in a minor performance loss, and only works on platforms that support
76
+ # atomic file renames. Please consult the documentation for `ultra_safe` for
77
+ # details.
78
+ #
79
+ # Needless to say, if you're storing valuable data with PStore, then you should
80
+ # backup the PStore files from time to time.
81
+ #
82
+ class PStore
83
+ public
84
+
85
+ # Retrieves a value from the PStore file data, by *name*. The hierarchy of Ruby
86
+ # objects stored under that root *name* will be returned.
87
+ #
88
+ # **WARNING**: This method is only valid in a PStore#transaction. It will
89
+ # raise PStore::Error if called at any other time.
90
+ #
91
+ def []: (untyped name) -> untyped
92
+
93
+ # Stores an individual Ruby object or a hierarchy of Ruby objects in the data
94
+ # store file under the root *name*. Assigning to a *name* already in the data
95
+ # store clobbers the old data.
96
+ #
97
+ # ## Example:
98
+ #
99
+ # require "pstore"
100
+ #
101
+ # store = PStore.new("data_file.pstore")
102
+ # store.transaction do # begin transaction
103
+ # # load some data into the store...
104
+ # store[:single_object] = "My data..."
105
+ # store[:obj_hierarchy] = { "Kev Jackson" => ["rational.rb", "pstore.rb"],
106
+ # "James Gray" => ["erb.rb", "pstore.rb"] }
107
+ # end # commit changes to data store file
108
+ #
109
+ # **WARNING**: This method is only valid in a PStore#transaction and it cannot
110
+ # be read-only. It will raise PStore::Error if called at any other time.
111
+ #
112
+ def []=: (untyped name, untyped value) -> untyped
113
+
114
+ # Ends the current PStore#transaction, discarding any changes to the data store.
115
+ #
116
+ # ## Example:
117
+ #
118
+ # require "pstore"
119
+ #
120
+ # store = PStore.new("data_file.pstore")
121
+ # store.transaction do # begin transaction
122
+ # store[:one] = 1 # this change is not applied, see below...
123
+ # store[:two] = 2 # this change is not applied, see below...
124
+ #
125
+ # store.abort # end transaction here, discard all changes
126
+ #
127
+ # store[:three] = 3 # this change is never reached
128
+ # end
129
+ #
130
+ # **WARNING**: This method is only valid in a PStore#transaction. It will
131
+ # raise PStore::Error if called at any other time.
132
+ #
133
+ def abort: () -> untyped
134
+
135
+ # Ends the current PStore#transaction, committing any changes to the data store
136
+ # immediately.
137
+ #
138
+ # ## Example:
139
+ #
140
+ # require "pstore"
141
+ #
142
+ # store = PStore.new("data_file.pstore")
143
+ # store.transaction do # begin transaction
144
+ # # load some data into the store...
145
+ # store[:one] = 1
146
+ # store[:two] = 2
147
+ #
148
+ # store.commit # end transaction here, committing changes
149
+ #
150
+ # store[:three] = 3 # this change is never reached
151
+ # end
152
+ #
153
+ # **WARNING**: This method is only valid in a PStore#transaction. It will
154
+ # raise PStore::Error if called at any other time.
155
+ #
156
+ def commit: () -> nil
157
+
158
+ # Removes an object hierarchy from the data store, by *name*.
159
+ #
160
+ # **WARNING**: This method is only valid in a PStore#transaction and it cannot
161
+ # be read-only. It will raise PStore::Error if called at any other time.
162
+ #
163
+ def delete: (untyped name) -> untyped
164
+
165
+ # This method is just like PStore#[], save that you may also provide a *default*
166
+ # value for the object. In the event the specified *name* is not found in the
167
+ # data store, your *default* will be returned instead. If you do not specify a
168
+ # default, PStore::Error will be raised if the object is not found.
169
+ #
170
+ # **WARNING**: This method is only valid in a PStore#transaction. It will
171
+ # raise PStore::Error if called at any other time.
172
+ #
173
+ def fetch: (untyped name, ?untyped default) -> untyped
174
+
175
+ # Returns the path to the data store file.
176
+ #
177
+ def path: () -> untyped
178
+
179
+ # Returns true if the supplied *name* is currently in the data store.
180
+ #
181
+ # **WARNING**: This method is only valid in a PStore#transaction. It will
182
+ # raise PStore::Error if called at any other time.
183
+ #
184
+ def root?: (untyped name) -> bool
185
+
186
+ # Returns the names of all object hierarchies currently in the store.
187
+ #
188
+ # **WARNING**: This method is only valid in a PStore#transaction. It will
189
+ # raise PStore::Error if called at any other time.
190
+ #
191
+ def roots: () -> Array[untyped]
192
+
193
+ # Opens a new transaction for the data store. Code executed inside a block
194
+ # passed to this method may read and write data to and from the data store file.
195
+ #
196
+ # At the end of the block, changes are committed to the data store
197
+ # automatically. You may exit the transaction early with a call to either
198
+ # PStore#commit or PStore#abort. See those methods for details about how
199
+ # changes are handled. Raising an uncaught Exception in the block is equivalent
200
+ # to calling PStore#abort.
201
+ #
202
+ # If *read_only* is set to `true`, you will only be allowed to read from the
203
+ # data store during the transaction and any attempts to change the data will
204
+ # raise a PStore::Error.
205
+ #
206
+ # Note that PStore does not support nested transactions.
207
+ #
208
+ def transaction: (?untyped read_only) -> untyped
209
+
210
+ # Whether PStore should do its best to prevent file corruptions, even when under
211
+ # unlikely-to-occur error conditions such as out-of-space conditions and other
212
+ # unusual OS filesystem errors. Setting this flag comes at the price in the form
213
+ # of a performance loss.
214
+ #
215
+ # This flag only has effect on platforms on which file renames are atomic (e.g.
216
+ # all POSIX platforms: Linux, MacOS X, FreeBSD, etc). The default value is
217
+ # false.
218
+ #
219
+ def ultra_safe: () -> untyped
220
+
221
+ def ultra_safe=: (untyped) -> untyped
222
+
223
+ private
224
+
225
+ def dump: (untyped table) -> untyped
226
+
227
+ def empty_marshal_checksum: () -> untyped
228
+
229
+ def empty_marshal_data: () -> untyped
230
+
231
+ # Raises PStore::Error if the calling code is not in a PStore#transaction.
232
+ #
233
+ def in_transaction: () -> untyped
234
+
235
+ # Raises PStore::Error if the calling code is not in a PStore#transaction or if
236
+ # the code is in a read-only PStore#transaction.
237
+ #
238
+ def in_transaction_wr: () -> untyped
239
+
240
+ # To construct a PStore object, pass in the *file* path where you would like the
241
+ # data to be stored.
242
+ #
243
+ # PStore objects are always reentrant. But if *thread_safe* is set to true, then
244
+ # it will become thread-safe at the cost of a minor performance hit.
245
+ #
246
+ def initialize: (untyped file, ?boolish thread_safe) -> untyped
247
+
248
+ def load: (untyped content) -> untyped
249
+
250
+ # Load the given PStore file. If `read_only` is true, the unmarshalled Hash will
251
+ # be returned. If `read_only` is false, a 3-tuple will be returned: the
252
+ # unmarshalled Hash, a checksum of the data, and the size of the data.
253
+ #
254
+ def load_data: (untyped file, untyped read_only) -> untyped
255
+
256
+ def on_windows?: () -> bool
257
+
258
+ # Open the specified filename (either in read-only mode or in read-write mode)
259
+ # and lock it for reading or writing.
260
+ #
261
+ # The opened File object will be returned. If *read_only* is true, and the file
262
+ # does not exist, then nil will be returned.
263
+ #
264
+ # All exceptions are propagated.
265
+ #
266
+ def open_and_lock_file: (untyped filename, untyped read_only) -> untyped
267
+
268
+ def save_data: (untyped original_checksum, untyped original_file_size, untyped file) -> untyped
269
+
270
+ def save_data_with_atomic_file_rename_strategy: (untyped data, untyped file) -> untyped
271
+
272
+ def save_data_with_fast_strategy: (untyped data, untyped file) -> untyped
273
+ end
274
+
275
+ PStore::EMPTY_MARSHAL_CHECKSUM: String
276
+
277
+ PStore::EMPTY_MARSHAL_DATA: String
278
+
279
+ PStore::EMPTY_STRING: String
280
+
281
+ PStore::RDWR_ACCESS: Hash[untyped, untyped]
282
+
283
+ PStore::RD_ACCESS: Hash[untyped, untyped]
284
+
285
+ PStore::VERSION: String
286
+
287
+ PStore::WR_ACCESS: Hash[untyped, untyped]
@@ -66,7 +66,7 @@ module PTY
66
66
  # : If `true` and the process identified by `pid` is no longer alive a
67
67
  # PTY::ChildExited is raised.
68
68
  #
69
- def self.check: (Integer pid, ?bool raise) -> Process::Status?
69
+ def self.check: (Integer pid, ?boolish raise) -> Process::Status?
70
70
 
71
71
  alias self.getpty self.spawn
72
72
 
@@ -51,8 +51,8 @@ class Set[A]
51
51
  # Set.new(1..5) #=> #<Set: {1, 2, 3, 4, 5}>
52
52
  # Set.new([1, 2, 3]) { |x| x * x } #=> #<Set: {1, 4, 9}>
53
53
  #
54
- def initialize: (_Each[A, untyped]) -> untyped
55
- | [X] (_Each[X, untyped]) { (X) -> A } -> untyped
54
+ def initialize: (_Each[A]) -> untyped
55
+ | [X] (_Each[X]) { (X) -> A } -> untyped
56
56
  | (?nil) -> untyped
57
57
 
58
58
  # Creates a new set containing the given objects.
@@ -69,7 +69,7 @@ class Set[A]
69
69
  # Set[1, 3, 5] & Set[3, 2, 1] #=> #<Set: {3, 1}>
70
70
  # Set['a', 'b', 'z'] & ['a', 'b', 'c'] #=> #<Set: {"a", "b"}>
71
71
  #
72
- def &: (_Each[A, untyped]) -> self
72
+ def &: (_Each[A]) -> self
73
73
 
74
74
  alias intersection &
75
75
 
@@ -79,7 +79,7 @@ class Set[A]
79
79
  # Set[1, 2, 3] | Set[2, 4, 5] #=> #<Set: {1, 2, 3, 4, 5}>
80
80
  # Set[1, 5, 'z'] | (1..6) #=> #<Set: {1, 5, "z", 2, 3, 4, 6}>
81
81
  #
82
- def |: (_Each[A, untyped]) -> self
82
+ def |: (_Each[A]) -> self
83
83
 
84
84
  alias union |
85
85
 
@@ -91,7 +91,7 @@ class Set[A]
91
91
  # Set[1, 3, 5] - Set[1, 5] #=> #<Set: {3}>
92
92
  # Set['a', 'b', 'z'] - ['a', 'c'] #=> #<Set: {"b", "z"}>
93
93
  #
94
- def -: (_Each[A, untyped]) -> self
94
+ def -: (_Each[A]) -> self
95
95
 
96
96
  alias difference -
97
97
 
@@ -133,7 +133,7 @@ class Set[A]
133
133
  # Set[1, 2] ^ Set[2, 3] #=> #<Set: {3, 1}>
134
134
  # Set[1, 'b', 'c'] ^ ['b', 'd'] #=> #<Set: {"d", 1, "c"}>
135
135
  #
136
- def ^: (_Each[A, untyped]) -> self
136
+ def ^: (_Each[A]) -> self
137
137
 
138
138
  # Classifies the set by the return value of the given block and returns a hash
139
139
  # of {value => set of elements} pairs. The block is called once for each
@@ -248,7 +248,7 @@ class Set[A]
248
248
  # Merges the elements of the given enumerable object to the set and returns
249
249
  # self.
250
250
  #
251
- def merge: (_Each[A, untyped]) -> self
251
+ def merge: (_Each[A]) -> self
252
252
 
253
253
  # Returns true if the set is a subset of the given set.
254
254
  #
@@ -271,7 +271,7 @@ class Set[A]
271
271
  # set.replace([1, 2]) #=> #<Set: {1, 2}>
272
272
  # set #=> #<Set: {1, 2}>
273
273
  #
274
- def replace: (_Each[A, untyped]) -> self
274
+ def replace: (_Each[A]) -> self
275
275
 
276
276
  # Resets the internal state after modification to existing elements and returns
277
277
  # self.
@@ -288,7 +288,7 @@ class Set[A]
288
288
  # Deletes every element that appears in the given enumerable object and returns
289
289
  # self.
290
290
  #
291
- def subtract: (_Each[A, untyped]) -> self
291
+ def subtract: (_Each[A]) -> self
292
292
 
293
293
  # Converts the set to an array. The order of elements is uncertain.
294
294
  #
@@ -297,5 +297,5 @@ class Set[A]
297
297
  #
298
298
  def to_a: () -> Array[A]
299
299
 
300
- include Enumerable[A, self]
300
+ include Enumerable[A]
301
301
  end
@@ -1,13 +1,13 @@
1
1
  class Dir
2
2
  # Returns the operating system's temporary file path.
3
- #
3
+ #
4
4
  def self.tmpdir: () -> String
5
5
 
6
6
  # Dir.mktmpdir creates a temporary directory.
7
- #
7
+ #
8
8
  # The directory is created with 0700 permission. Application should not change
9
9
  # the permission to make the temporary directory accessible from other users.
10
- #
10
+ #
11
11
  # The prefix and suffix of the name of the directory is specified by the
12
12
  # optional first argument, *prefix_suffix*.
13
13
  # * If it is not specified or nil, "d" is used as the prefix and no suffix is
@@ -15,30 +15,30 @@ class Dir
15
15
  # * If it is a string, it is used as the prefix and no suffix is used.
16
16
  # * If it is an array, first element is used as the prefix and second element
17
17
  # is used as a suffix.
18
- #
19
- #
18
+ #
19
+ #
20
20
  # Dir.mktmpdir {|dir| dir is ".../d..." }
21
21
  # Dir.mktmpdir("foo") {|dir| dir is ".../foo..." }
22
22
  # Dir.mktmpdir(["foo", "bar"]) {|dir| dir is ".../foo...bar" }
23
- #
23
+ #
24
24
  # The directory is created under Dir.tmpdir or the optional second argument
25
25
  # *tmpdir* if non-nil value is given.
26
- #
26
+ #
27
27
  # Dir.mktmpdir {|dir| dir is "#{Dir.tmpdir}/d..." }
28
28
  # Dir.mktmpdir(nil, "/var/tmp") {|dir| dir is "/var/tmp/d..." }
29
- #
29
+ #
30
30
  # If a block is given, it is yielded with the path of the directory. The
31
31
  # directory and its contents are removed using FileUtils.remove_entry before
32
32
  # Dir.mktmpdir returns. The value of the block is returned.
33
- #
33
+ #
34
34
  # Dir.mktmpdir {|dir|
35
35
  # # use the directory...
36
36
  # open("#{dir}/foo", "w") { ... }
37
37
  # }
38
- #
38
+ #
39
39
  # If a block is not given, The path of the directory is returned. In this case,
40
40
  # Dir.mktmpdir doesn't remove the directory.
41
- #
41
+ #
42
42
  # dir = Dir.mktmpdir
43
43
  # begin
44
44
  # # use the directory...
@@ -47,7 +47,7 @@ class Dir
47
47
  # # remove the directory.
48
48
  # FileUtils.remove_entry dir
49
49
  # end
50
- #
50
+ #
51
51
  def self.mktmpdir: (?(String | [ String, String ] | nil), ?String?, ?max_try: Integer?) -> String
52
52
  | [X] (?(String | [ String, String ] | nil), ?String?, ?max_try: Integer?) { (String) -> X } -> X
53
53
  end