rbs 3.6.1 → 3.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/comments.yml +2 -2
- data/.github/workflows/dependabot.yml +1 -1
- data/.github/workflows/ruby.yml +34 -10
- data/.github/workflows/windows.yml +20 -3
- data/.gitignore +1 -0
- data/.rubocop.yml +26 -1
- data/CHANGELOG.md +241 -0
- data/Rakefile +54 -4
- data/config.yml +317 -0
- data/core/array.rbs +1756 -1591
- data/core/basic_object.rbs +38 -35
- data/core/comparable.rbs +1 -1
- data/core/complex.rbs +166 -94
- data/core/data.rbs +2 -2
- data/core/dir.rbs +2 -18
- data/core/encoding.rbs +12 -32
- data/core/enumerable.rbs +270 -266
- data/core/enumerator.rbs +14 -4
- data/core/env.rbs +1 -1
- data/core/errno.rbs +33 -16
- data/core/errors.rbs +6 -2
- data/core/exception.rbs +342 -167
- data/core/fiber.rbs +3 -2
- data/core/file.rbs +26 -75
- data/core/float.rbs +125 -72
- data/core/gc.rbs +158 -42
- data/core/hash.rbs +122 -143
- data/core/integer.rbs +79 -50
- data/core/io/buffer.rbs +49 -43
- data/core/io.rbs +108 -151
- data/core/kernel.rbs +341 -209
- data/core/match_data.rbs +76 -2
- data/core/math.rbs +0 -36
- data/core/method.rbs +2 -2
- data/core/module.rbs +32 -27
- data/core/nil_class.rbs +2 -2
- data/core/numeric.rbs +101 -104
- data/core/object.rbs +1 -5
- data/core/object_space/weak_key_map.rbs +3 -4
- data/core/object_space.rbs +3 -3
- data/core/proc.rbs +82 -14
- data/core/process.rbs +110 -58
- data/core/ractor.rbs +57 -4
- data/core/range.rbs +114 -87
- data/core/rational.rbs +0 -2
- data/core/rbs/unnamed/argf.rbs +237 -36
- data/core/rbs/unnamed/env_class.rbs +35 -53
- data/core/rbs/unnamed/random.rbs +1 -2
- data/core/regexp.rbs +10 -56
- data/core/ruby_vm.rbs +88 -9
- data/core/rubygems/config_file.rbs +3 -0
- data/core/rubygems/errors.rbs +3 -6
- data/core/rubygems/platform.rbs +0 -9
- data/core/rubygems/rubygems.rbs +3 -6
- data/core/rubygems/version.rbs +8 -8
- data/core/set.rbs +4 -16
- data/core/string.rbs +271 -264
- data/core/struct.rbs +6 -18
- data/core/symbol.rbs +14 -21
- data/core/thread.rbs +32 -35
- data/core/time.rbs +131 -50
- data/core/trace_point.rbs +124 -113
- data/core/true_class.rbs +0 -1
- data/core/unbound_method.rbs +1 -1
- data/core/warning.rbs +9 -2
- data/docs/architecture.md +1 -1
- data/docs/syntax.md +17 -10
- data/ext/rbs_extension/extconf.rb +11 -0
- data/ext/rbs_extension/location.c +61 -29
- data/ext/rbs_extension/location.h +4 -3
- data/ext/rbs_extension/main.c +23 -1
- data/ext/rbs_extension/parser.c +506 -517
- data/ext/rbs_extension/parserstate.c +109 -30
- data/ext/rbs_extension/parserstate.h +6 -4
- data/ext/rbs_extension/rbs_extension.h +1 -10
- data/{ext/rbs_extension → include/rbs}/constants.h +21 -19
- data/include/rbs/ruby_objs.h +72 -0
- data/include/rbs/util/rbs_constant_pool.h +219 -0
- data/include/rbs.h +7 -0
- data/lib/rbs/annotate/annotations.rb +3 -3
- data/lib/rbs/annotate/rdoc_source.rb +2 -2
- data/lib/rbs/ast/declarations.rb +9 -4
- data/lib/rbs/ast/directives.rb +10 -0
- data/lib/rbs/ast/members.rb +2 -0
- data/lib/rbs/ast/type_param.rb +2 -12
- data/lib/rbs/cli/diff.rb +3 -3
- data/lib/rbs/cli/validate.rb +2 -1
- data/lib/rbs/cli.rb +16 -16
- data/lib/rbs/collection/config/lockfile_generator.rb +58 -8
- data/lib/rbs/collection/config.rb +5 -3
- data/lib/rbs/collection/sources/rubygems.rb +1 -1
- data/lib/rbs/collection.rb +1 -0
- data/lib/rbs/definition.rb +51 -34
- data/lib/rbs/definition_builder/ancestor_builder.rb +5 -3
- data/lib/rbs/definition_builder.rb +83 -24
- data/lib/rbs/environment.rb +33 -18
- data/lib/rbs/environment_loader.rb +6 -1
- data/lib/rbs/errors.rb +24 -0
- data/lib/rbs/locator.rb +2 -0
- data/lib/rbs/method_type.rb +2 -0
- data/lib/rbs/namespace.rb +1 -0
- data/lib/rbs/parser_aux.rb +40 -3
- data/lib/rbs/prototype/rb.rb +20 -12
- data/lib/rbs/prototype/rbi.rb +11 -6
- data/lib/rbs/prototype/runtime/value_object_generator.rb +7 -5
- data/lib/rbs/prototype/runtime.rb +7 -5
- data/lib/rbs/subtractor.rb +3 -3
- data/lib/rbs/test/hook.rb +47 -42
- data/lib/rbs/test/type_check.rb +7 -5
- data/lib/rbs/type_name.rb +14 -9
- data/lib/rbs/types.rb +63 -14
- data/lib/rbs/unit_test/spy.rb +4 -2
- data/lib/rbs/unit_test/type_assertions.rb +19 -13
- data/lib/rbs/unit_test/with_aliases.rb +3 -1
- data/lib/rbs/validator.rb +7 -1
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/writer.rb +10 -5
- data/lib/rbs.rb +1 -0
- data/lib/rdoc_plugin/parser.rb +2 -2
- data/rbs.gemspec +6 -2
- data/sig/ancestor_graph.rbs +5 -5
- data/sig/annotate/rdoc_source.rbs +2 -0
- data/sig/cli.rbs +2 -0
- data/sig/collection/config/lockfile_generator.rbs +9 -1
- data/sig/declarations.rbs +10 -3
- data/sig/definition.rbs +80 -12
- data/sig/definition_builder.rbs +18 -4
- data/sig/directives.rbs +17 -1
- data/sig/environment.rbs +3 -1
- data/sig/errors.rbs +19 -0
- data/sig/namespace.rbs +2 -3
- data/sig/parser.rbs +5 -1
- data/sig/prototype/rb.rbs +1 -1
- data/sig/resolver/constant_resolver.rbs +2 -2
- data/sig/resolver/context.rbs +1 -1
- data/sig/subtractor.rbs +1 -1
- data/sig/test/type_check.rbs +2 -2
- data/sig/type_alias_dependency.rbs +2 -2
- data/sig/type_alias_regularity.rbs +6 -6
- data/sig/type_param.rbs +4 -4
- data/sig/typename.rbs +8 -5
- data/sig/types.rbs +1 -1
- data/sig/unit_test/spy.rbs +2 -0
- data/sig/unit_test/type_assertions.rbs +2 -0
- data/sig/use_map.rbs +1 -1
- data/sig/validator.rbs +6 -2
- data/sig/vendorer.rbs +1 -1
- data/sig/writer.rbs +1 -1
- data/{ext/rbs_extension → src}/constants.c +35 -36
- data/src/ruby_objs.c +799 -0
- data/src/util/rbs_constant_pool.c +342 -0
- data/stdlib/base64/0/base64.rbs +0 -9
- data/stdlib/benchmark/0/benchmark.rbs +11 -2
- data/stdlib/bigdecimal/0/big_decimal.rbs +26 -182
- data/stdlib/cgi/0/core.rbs +60 -3
- data/stdlib/cgi/0/manifest.yaml +1 -0
- data/stdlib/coverage/0/coverage.rbs +0 -3
- data/stdlib/csv/0/csv.rbs +18 -58
- data/stdlib/csv/0/manifest.yaml +1 -0
- data/stdlib/date/0/date.rbs +27 -42
- data/stdlib/did_you_mean/0/did_you_mean.rbs +1 -6
- data/stdlib/digest/0/digest.rbs +25 -2
- data/stdlib/erb/0/erb.rbs +0 -1
- data/stdlib/etc/0/etc.rbs +51 -34
- data/stdlib/fileutils/0/fileutils.rbs +3 -44
- data/stdlib/io-console/0/io-console.rbs +69 -15
- data/stdlib/ipaddr/0/ipaddr.rbs +16 -4
- data/stdlib/json/0/json.rbs +107 -120
- data/stdlib/logger/0/log_device.rbs +1 -1
- data/stdlib/logger/0/logger.rbs +3 -18
- data/stdlib/minitest/0/kernel.rbs +2 -2
- data/stdlib/minitest/0/minitest/abstract_reporter.rbs +4 -1
- data/stdlib/minitest/0/minitest/assertion.rbs +1 -0
- data/stdlib/minitest/0/minitest/assertions.rbs +58 -13
- data/stdlib/minitest/0/minitest/backtrace_filter.rbs +7 -0
- data/stdlib/minitest/0/minitest/bench_spec.rbs +8 -8
- data/stdlib/minitest/0/minitest/benchmark.rbs +17 -16
- data/stdlib/minitest/0/minitest/compress.rbs +13 -0
- data/stdlib/minitest/0/minitest/error_on_warning.rbs +3 -0
- data/stdlib/minitest/0/minitest/mock.rbs +9 -5
- data/stdlib/minitest/0/minitest/parallel/executor.rbs +4 -0
- data/stdlib/minitest/0/minitest/parallel/test/class_methods.rbs +0 -1
- data/stdlib/minitest/0/minitest/pride_io.rbs +8 -0
- data/stdlib/minitest/0/minitest/pride_lol.rbs +2 -0
- data/stdlib/minitest/0/minitest/progress_reporter.rbs +1 -1
- data/stdlib/minitest/0/minitest/reportable.rbs +2 -0
- data/stdlib/minitest/0/minitest/runnable.rbs +33 -1
- data/stdlib/minitest/0/minitest/spec/dsl/instance_methods.rbs +1 -1
- data/stdlib/minitest/0/minitest/spec/dsl.rbs +10 -6
- data/stdlib/minitest/0/minitest/spec.rbs +1 -1
- data/stdlib/minitest/0/minitest/statistics_reporter.rbs +5 -0
- data/stdlib/minitest/0/minitest/summary_reporter.rbs +0 -7
- data/stdlib/minitest/0/minitest/test/lifecycle_hooks.rbs +1 -1
- data/stdlib/minitest/0/minitest/test.rbs +7 -14
- data/stdlib/minitest/0/minitest/unexpected_error.rbs +2 -0
- data/stdlib/minitest/0/minitest/unexpected_warning.rbs +6 -0
- data/stdlib/minitest/0/minitest/unit.rbs +1 -2
- data/stdlib/minitest/0/minitest.rbs +41 -892
- data/stdlib/monitor/0/monitor.rbs +13 -4
- data/stdlib/net-http/0/net-http.rbs +42 -109
- data/stdlib/nkf/0/nkf.rbs +30 -0
- data/stdlib/objspace/0/objspace.rbs +1 -2
- data/stdlib/observable/0/observable.rbs +1 -1
- data/stdlib/open-uri/0/manifest.yaml +1 -0
- data/stdlib/open-uri/0/open-uri.rbs +52 -0
- data/stdlib/open3/0/open3.rbs +0 -8
- data/stdlib/openssl/0/manifest.yaml +1 -0
- data/stdlib/openssl/0/openssl.rbs +235 -143
- data/stdlib/optparse/0/optparse.rbs +58 -18
- data/stdlib/pathname/0/pathname.rbs +2 -8
- data/stdlib/pp/0/pp.rbs +3 -1
- data/stdlib/prettyprint/0/prettyprint.rbs +0 -4
- data/stdlib/pstore/0/pstore.rbs +0 -6
- data/stdlib/psych/0/core_ext.rbs +12 -0
- data/stdlib/psych/0/psych.rbs +15 -4
- data/stdlib/pty/0/pty.rbs +46 -4
- data/stdlib/rdoc/0/code_object.rbs +0 -4
- data/stdlib/rdoc/0/markup.rbs +10 -12
- data/stdlib/rdoc/0/rdoc.rbs +13 -8
- data/stdlib/resolv/0/resolv.rbs +21 -12
- data/stdlib/ripper/0/ripper.rbs +0 -2
- data/stdlib/securerandom/0/securerandom.rbs +7 -2
- data/stdlib/shellwords/0/shellwords.rbs +11 -12
- data/stdlib/singleton/0/singleton.rbs +0 -1
- data/stdlib/socket/0/addrinfo.rbs +1 -2
- data/stdlib/socket/0/basic_socket.rbs +0 -5
- data/stdlib/socket/0/socket.rbs +32 -27
- data/stdlib/socket/0/tcp_server.rbs +0 -3
- data/stdlib/socket/0/tcp_socket.rbs +36 -3
- data/stdlib/socket/0/udp_socket.rbs +0 -1
- data/stdlib/socket/0/unix_server.rbs +0 -3
- data/stdlib/socket/0/unix_socket.rbs +4 -2
- data/{core/string_io.rbs → stdlib/stringio/0/stringio.rbs} +1 -1
- data/stdlib/strscan/0/string_scanner.rbs +1265 -422
- data/stdlib/tempfile/0/tempfile.rbs +135 -28
- data/stdlib/time/0/time.rbs +48 -35
- data/stdlib/timeout/0/timeout.rbs +11 -8
- data/stdlib/tmpdir/0/tmpdir.rbs +10 -3
- data/stdlib/tsort/0/tsort.rbs +0 -4
- data/stdlib/uri/0/common.rbs +28 -30
- data/stdlib/uri/0/ftp.rbs +1 -1
- data/stdlib/uri/0/generic.rbs +22 -18
- data/stdlib/uri/0/http.rbs +2 -2
- data/stdlib/uri/0/rfc2396_parser.rbs +3 -0
- data/stdlib/zlib/0/buf_error.rbs +1 -70
- data/stdlib/zlib/0/data_error.rbs +1 -70
- data/stdlib/zlib/0/deflate.rbs +8 -72
- data/stdlib/zlib/0/error.rbs +1 -70
- data/stdlib/zlib/0/gzip_file/crc_error.rbs +2 -105
- data/stdlib/zlib/0/gzip_file/error.rbs +2 -105
- data/stdlib/zlib/0/gzip_file/length_error.rbs +2 -105
- data/stdlib/zlib/0/gzip_file/no_footer.rbs +2 -105
- data/stdlib/zlib/0/gzip_file.rbs +1 -71
- data/stdlib/zlib/0/gzip_reader.rbs +3 -74
- data/stdlib/zlib/0/gzip_writer.rbs +1 -70
- data/stdlib/zlib/0/inflate.rbs +4 -71
- data/stdlib/zlib/0/mem_error.rbs +1 -70
- data/stdlib/zlib/0/need_dict.rbs +1 -70
- data/stdlib/zlib/0/stream_end.rbs +1 -70
- data/stdlib/zlib/0/stream_error.rbs +1 -70
- data/stdlib/zlib/0/version_error.rbs +1 -70
- data/stdlib/zlib/0/zlib.rbs +0 -2
- data/stdlib/zlib/0/zstream.rbs +4 -72
- metadata +17 -13
- data/ext/rbs_extension/ruby_objs.c +0 -602
- data/ext/rbs_extension/ruby_objs.h +0 -51
- data/stdlib/minitest/0/manifest.yaml +0 -2
@@ -9,7 +9,6 @@
|
|
9
9
|
# * Supplements [class File](rdoc-ref:File) (but is not included or extended
|
10
10
|
# there).
|
11
11
|
#
|
12
|
-
#
|
13
12
|
# Here, module FileUtils provides methods that are useful for:
|
14
13
|
#
|
15
14
|
# * [Creating](rdoc-ref:FileUtils@Creating).
|
@@ -21,7 +20,6 @@
|
|
21
20
|
# * [Moving](rdoc-ref:FileUtils@Moving).
|
22
21
|
# * [Options](rdoc-ref:FileUtils@Options).
|
23
22
|
#
|
24
|
-
#
|
25
23
|
# ### Creating
|
26
24
|
#
|
27
25
|
# * ::mkdir: Creates directories.
|
@@ -33,7 +31,6 @@
|
|
33
31
|
# * ::ln_sf: Creates symbolic links, overwriting if necessary.
|
34
32
|
# * ::ln_sr: Creates symbolic links relative to targets
|
35
33
|
#
|
36
|
-
#
|
37
34
|
# ### Deleting
|
38
35
|
#
|
39
36
|
# * ::remove_dir: Removes a directory and its descendants.
|
@@ -47,14 +44,12 @@
|
|
47
44
|
# * ::rm_rf, ::rmtree: Like ::rm_r, but removes forcibly.
|
48
45
|
# * ::rmdir: Removes directories.
|
49
46
|
#
|
50
|
-
#
|
51
47
|
# ### Querying
|
52
48
|
#
|
53
49
|
# * ::pwd, ::getwd: Returns the path to the working directory.
|
54
50
|
# * ::uptodate?: Returns whether a given entry is newer than given other
|
55
51
|
# entries.
|
56
52
|
#
|
57
|
-
#
|
58
53
|
# ### Setting
|
59
54
|
#
|
60
55
|
# * ::cd, ::chdir: Sets the working directory.
|
@@ -65,14 +60,12 @@
|
|
65
60
|
# * ::touch: Sets modification and access times for entries, creating if
|
66
61
|
# necessary.
|
67
62
|
#
|
68
|
-
#
|
69
63
|
# ### Comparing
|
70
64
|
#
|
71
65
|
# * ::compare_file, ::cmp, ::identical?: Returns whether two entries are
|
72
66
|
# identical.
|
73
67
|
# * ::compare_stream: Returns whether two streams are identical.
|
74
68
|
#
|
75
|
-
#
|
76
69
|
# ### Copying
|
77
70
|
#
|
78
71
|
# * ::copy_entry: Recursively copies an entry.
|
@@ -84,12 +77,10 @@
|
|
84
77
|
# * ::install: Recursively copies files, optionally setting mode, owner, and
|
85
78
|
# group.
|
86
79
|
#
|
87
|
-
#
|
88
80
|
# ### Moving
|
89
81
|
#
|
90
82
|
# * ::mv, ::move: Moves entries.
|
91
83
|
#
|
92
|
-
#
|
93
84
|
# ### Options
|
94
85
|
#
|
95
86
|
# * ::collect_method: Returns the names of methods that accept a given option.
|
@@ -98,7 +89,6 @@
|
|
98
89
|
# * ::options: Returns all option names.
|
99
90
|
# * ::options_of: Returns the names of the options for a given method.
|
100
91
|
#
|
101
|
-
#
|
102
92
|
# ## Path Arguments
|
103
93
|
#
|
104
94
|
# Some methods in FileUtils accept *path* arguments, which are interpreted as
|
@@ -108,7 +98,6 @@
|
|
108
98
|
# * If the argument has method `:to_path`, it is converted via that method.
|
109
99
|
# * If the argument has method `:to_str`, it is converted via that method.
|
110
100
|
#
|
111
|
-
#
|
112
101
|
# ## About the Examples
|
113
102
|
#
|
114
103
|
# Some examples here involve trees of file entries. For these, we sometimes
|
@@ -149,28 +138,23 @@
|
|
149
138
|
# * A world-writable descendant directory.
|
150
139
|
# * A symbolic link.
|
151
140
|
#
|
152
|
-
#
|
153
|
-
#
|
154
141
|
# To avoid that vulnerability, you can use this method to remove entries:
|
155
142
|
#
|
156
143
|
# * FileUtils.remove_entry_secure: removes recursively if the target path
|
157
144
|
# points to a directory.
|
158
145
|
#
|
159
|
-
#
|
160
146
|
# Also available are these methods, each of which calls
|
161
147
|
# FileUtils.remove_entry_secure:
|
162
148
|
#
|
163
149
|
# * FileUtils.rm_r with keyword argument `secure: true`.
|
164
150
|
# * FileUtils.rm_rf with keyword argument `secure: true`.
|
165
151
|
#
|
166
|
-
#
|
167
152
|
# Finally, this method for moving entries calls FileUtils.remove_entry_secure if
|
168
153
|
# the source and destination are on different file systems (which means that the
|
169
154
|
# "move" is really a copy and remove):
|
170
155
|
#
|
171
156
|
# * FileUtils.mv with keyword argument `secure: true`.
|
172
157
|
#
|
173
|
-
#
|
174
158
|
# Method FileUtils.remove_entry_secure removes securely by applying a special
|
175
159
|
# pre-process:
|
176
160
|
#
|
@@ -180,7 +164,6 @@
|
|
180
164
|
# * The owner of the target directory should be either the current process or
|
181
165
|
# the super user (root).
|
182
166
|
#
|
183
|
-
#
|
184
167
|
# WARNING: You must ensure that **ALL** parent directories cannot be moved by
|
185
168
|
# other untrusted users. For example, parent directories should not be owned by
|
186
169
|
# untrusted users, and should not be world writable except when the sticky bit
|
@@ -194,6 +177,9 @@
|
|
194
177
|
# 52).
|
195
178
|
#
|
196
179
|
module FileUtils
|
180
|
+
# <!-- rdoc-file=lib/fileutils.rb -->
|
181
|
+
# The version number.
|
182
|
+
#
|
197
183
|
VERSION: String
|
198
184
|
|
199
185
|
type mode = Integer | String
|
@@ -237,7 +223,6 @@ module FileUtils
|
|
237
223
|
# cd ..
|
238
224
|
# cd fileutils
|
239
225
|
#
|
240
|
-
#
|
241
226
|
# Related: FileUtils.pwd.
|
242
227
|
#
|
243
228
|
def self?.cd: (path dir, ?verbose: boolish) -> void
|
@@ -270,7 +255,6 @@ module FileUtils
|
|
270
255
|
# * Modifies each entry that is a symbolic link using
|
271
256
|
# [File.lchmod](rdoc-ref:File.lchmod).
|
272
257
|
#
|
273
|
-
#
|
274
258
|
# Argument `list` or its elements should be [interpretable as
|
275
259
|
# paths](rdoc-ref:FileUtils@Path+Arguments).
|
276
260
|
#
|
@@ -292,14 +276,12 @@ module FileUtils
|
|
292
276
|
# * `'o'`: permissions apply to other users not in the file's group.
|
293
277
|
# * `'a'` (the default): permissions apply to all users.
|
294
278
|
#
|
295
|
-
#
|
296
279
|
# * `operator` may be one of these letters:
|
297
280
|
#
|
298
281
|
# * `'+'`: adds permissions.
|
299
282
|
# * `'-'`: removes permissions.
|
300
283
|
# * `'='`: sets (replaces) permissions.
|
301
284
|
#
|
302
|
-
#
|
303
285
|
# * `perms` (may be repeated, with separating commas) may be any
|
304
286
|
# combination of these letters:
|
305
287
|
#
|
@@ -310,14 +292,11 @@ module FileUtils
|
|
310
292
|
# * `'s'`: Uid or gid.
|
311
293
|
# * `'t'`: Sticky bit.
|
312
294
|
#
|
313
|
-
#
|
314
|
-
#
|
315
295
|
# Examples:
|
316
296
|
#
|
317
297
|
# FileUtils.chmod('u=wrx,go=rx', 'src1.txt')
|
318
298
|
# FileUtils.chmod('u=wrx,go=rx', '/usr/bin/ruby')
|
319
299
|
#
|
320
|
-
#
|
321
300
|
# Keyword arguments:
|
322
301
|
#
|
323
302
|
# * `noop: true` - does not change permissions; returns `nil`.
|
@@ -335,7 +314,6 @@ module FileUtils
|
|
335
314
|
# chmod u=wrx,go=rx src1.txt
|
336
315
|
# chmod u=wrx,go=rx /usr/bin/ruby
|
337
316
|
#
|
338
|
-
#
|
339
317
|
# Related: FileUtils.chmod_R.
|
340
318
|
#
|
341
319
|
def self?.chmod: (mode mode, pathlist list, ?noop: boolish, ?verbose: boolish) -> void
|
@@ -361,7 +339,6 @@ module FileUtils
|
|
361
339
|
# * Modifies each entry that is a symbolic link using
|
362
340
|
# [File.lchown](rdoc-ref:File.lchown).
|
363
341
|
#
|
364
|
-
#
|
365
342
|
# Argument `list` or its elements should be [interpretable as
|
366
343
|
# paths](rdoc-ref:FileUtils@Path+Arguments).
|
367
344
|
#
|
@@ -373,7 +350,6 @@ module FileUtils
|
|
373
350
|
# group is not changed.
|
374
351
|
# * The user must be a member of the group.
|
375
352
|
#
|
376
|
-
#
|
377
353
|
# Examples:
|
378
354
|
#
|
379
355
|
# # One path.
|
@@ -414,7 +390,6 @@ module FileUtils
|
|
414
390
|
# chown user2:group1 src0.txt
|
415
391
|
# chown user2:group1 .
|
416
392
|
#
|
417
|
-
#
|
418
393
|
# Related: FileUtils.chown_R.
|
419
394
|
#
|
420
395
|
def self?.chown: (String? user, String? group, pathlist list, ?noop: boolish, ?verbose: boolish) -> void
|
@@ -553,7 +528,6 @@ module FileUtils
|
|
553
528
|
# * `preserve: true` - preserves file times.
|
554
529
|
# * `remove_destination: true` - removes `dest` before copying files.
|
555
530
|
#
|
556
|
-
#
|
557
531
|
# Related: [methods for copying](rdoc-ref:FileUtils@Copying).
|
558
532
|
#
|
559
533
|
def self?.copy_entry: (path src, path dest, ?boolish preserve, ?boolish dereference_root, ?boolish remove_destination) -> void
|
@@ -580,7 +554,6 @@ module FileUtils
|
|
580
554
|
# * `preserve: true` - preserves file times.
|
581
555
|
# * `remove_destination: true` - removes `dest` before copying files.
|
582
556
|
#
|
583
|
-
#
|
584
557
|
# Related: [methods for copying](rdoc-ref:FileUtils@Copying).
|
585
558
|
#
|
586
559
|
def self?.copy_file: (path src, path dest, ?boolish preserve, ?boolish dereference) -> void
|
@@ -647,7 +620,6 @@ module FileUtils
|
|
647
620
|
# cp src1.txt dest1
|
648
621
|
# cp src2.txt src2.dat dest2
|
649
622
|
#
|
650
|
-
#
|
651
623
|
# Raises an exception if `src` is a directory.
|
652
624
|
#
|
653
625
|
# Related: [methods for copying](rdoc-ref:FileUtils@Copying).
|
@@ -763,7 +735,6 @@ module FileUtils
|
|
763
735
|
# cp -lr src1 dest1
|
764
736
|
# cp -lr src2/sub0 src2/sub1 dest2
|
765
737
|
#
|
766
|
-
#
|
767
738
|
# Raises an exception if `dest` is the path to an existing file or directory and
|
768
739
|
# keyword argument `remove_destination: true` is not given.
|
769
740
|
#
|
@@ -869,7 +840,6 @@ module FileUtils
|
|
869
840
|
# cp -r src2 dest2
|
870
841
|
# cp -r src3 dest3
|
871
842
|
#
|
872
|
-
#
|
873
843
|
# Raises an exception of `src` is the path to a directory and `dest` is the path
|
874
844
|
# to a file.
|
875
845
|
#
|
@@ -954,7 +924,6 @@ module FileUtils
|
|
954
924
|
# install -c src1.txt dest1.txt
|
955
925
|
# install -c src2.txt dest2
|
956
926
|
#
|
957
|
-
#
|
958
927
|
# Related: [methods for copying](rdoc-ref:FileUtils@Copying).
|
959
928
|
#
|
960
929
|
def self?.install: (path src, path dest, ?mode: mode?, ?owner: String?, ?group: String?, ?preserve: boolish, ?noop: boolish, ?verbose: boolish) -> void
|
@@ -999,7 +968,6 @@ module FileUtils
|
|
999
968
|
# * `dereference_root: true` - dereferences `src` if it is a symbolic link.
|
1000
969
|
# * `remove_destination: true` - removes `dest` before creating links.
|
1001
970
|
#
|
1002
|
-
#
|
1003
971
|
# Raises an exception if `dest` is the path to an existing file or directory and
|
1004
972
|
# keyword argument `remove_destination: true` is not given.
|
1005
973
|
#
|
@@ -1058,7 +1026,6 @@ module FileUtils
|
|
1058
1026
|
# ln tmp2/t.dat tmp3
|
1059
1027
|
# ln tmp0/t.txt tmp2/t.dat tmp4/
|
1060
1028
|
#
|
1061
|
-
#
|
1062
1029
|
# Raises an exception if `dest` is the path to an existing file and keyword
|
1063
1030
|
# argument `force` is not `true`.
|
1064
1031
|
#
|
@@ -1110,7 +1077,6 @@ module FileUtils
|
|
1110
1077
|
#
|
1111
1078
|
# FileUtils.ln_s('src1.txt', 'dest1.txt') # Raises Errno::EEXIST.
|
1112
1079
|
#
|
1113
|
-
#
|
1114
1080
|
# If `dest` is the path to a directory, creates a symbolic link at `dest/src`
|
1115
1081
|
# pointing to `src`:
|
1116
1082
|
#
|
@@ -1150,7 +1116,6 @@ module FileUtils
|
|
1150
1116
|
# ln -sf src2.txt dest2.txt
|
1151
1117
|
# ln -s srcdir3/src0.txt srcdir3/src1.txt destdir3
|
1152
1118
|
#
|
1153
|
-
#
|
1154
1119
|
# Related: FileUtils.ln_sf.
|
1155
1120
|
#
|
1156
1121
|
def self?.ln_s: (pathlist src, path dest, ?force: boolish, ?relative: boolish, ?target_directory: boolish, ?noop: boolish, ?verbose: boolish) -> void
|
@@ -1216,7 +1181,6 @@ module FileUtils
|
|
1216
1181
|
# mkdir tmp0 tmp1
|
1217
1182
|
# mkdir -m 700 tmp2 tmp3
|
1218
1183
|
#
|
1219
|
-
#
|
1220
1184
|
# Raises an exception if any path points to an existing file or directory, or if
|
1221
1185
|
# for any reason a directory cannot be created.
|
1222
1186
|
#
|
@@ -1257,7 +1221,6 @@ module FileUtils
|
|
1257
1221
|
# mkdir -p tmp0 tmp1
|
1258
1222
|
# mkdir -p -m 700 tmp2 tmp3
|
1259
1223
|
#
|
1260
|
-
#
|
1261
1224
|
# Raises an exception if for any reason a directory cannot be created.
|
1262
1225
|
#
|
1263
1226
|
# FileUtils.mkpath and FileUtils.makedirs are aliases for FileUtils.mkdir_p.
|
@@ -1524,7 +1487,6 @@ module FileUtils
|
|
1524
1487
|
#
|
1525
1488
|
# rm src0.dat src0.txt
|
1526
1489
|
#
|
1527
|
-
#
|
1528
1490
|
# Related: [methods for deleting](rdoc-ref:FileUtils@Deleting).
|
1529
1491
|
#
|
1530
1492
|
def self?.rm: (pathlist list, ?force: boolish, ?noop: boolish, ?verbose: boolish) -> void
|
@@ -1625,7 +1587,6 @@ module FileUtils
|
|
1625
1587
|
# rm -r src0.dat src0.txt
|
1626
1588
|
# rm -r src1
|
1627
1589
|
#
|
1628
|
-
#
|
1629
1590
|
# Related: [methods for deleting](rdoc-ref:FileUtils@Deleting).
|
1630
1591
|
#
|
1631
1592
|
def self?.rm_r: (pathlist list, ?force: boolish, ?noop: boolish, ?verbose: boolish, ?secure: boolish) -> void
|
@@ -1695,7 +1656,6 @@ module FileUtils
|
|
1695
1656
|
# rmdir -p tmp0/tmp1 tmp2/tmp3
|
1696
1657
|
# rmdir -p tmp4/tmp5
|
1697
1658
|
#
|
1698
|
-
#
|
1699
1659
|
# Raises an exception if a directory does not exist or if for any reason a
|
1700
1660
|
# directory cannot be removed.
|
1701
1661
|
#
|
@@ -1749,7 +1709,6 @@ module FileUtils
|
|
1749
1709
|
# touch src0.txt src0.dat
|
1750
1710
|
# touch src0.txt
|
1751
1711
|
#
|
1752
|
-
#
|
1753
1712
|
# Related: FileUtils.uptodate?.
|
1754
1713
|
#
|
1755
1714
|
def self?.touch: (pathlist list, ?noop: boolish, ?verbose: boolish, ?mtime: (Time | Numeric)?, ?nocreate: boolish) -> void
|
@@ -39,22 +39,33 @@ class IO
|
|
39
39
|
|
40
40
|
# <!--
|
41
41
|
# rdoc-file=ext/io/console/console.c
|
42
|
-
# - beep
|
42
|
+
# - io.beep
|
43
43
|
# -->
|
44
|
+
# Beeps on the output console.
|
45
|
+
#
|
46
|
+
# You must require 'io/console' to use this method.
|
44
47
|
#
|
45
48
|
def beep: () -> self
|
46
49
|
|
47
50
|
# <!--
|
48
51
|
# rdoc-file=ext/io/console/console.c
|
49
|
-
# - check_winsize_changed
|
52
|
+
# - io.check_winsize_changed { ... } -> io
|
50
53
|
# -->
|
54
|
+
# Yields while console input events are queued.
|
55
|
+
#
|
56
|
+
# This method is Windows only.
|
57
|
+
#
|
58
|
+
# You must require 'io/console' to use this method.
|
51
59
|
#
|
52
60
|
def check_winsize_changed: () { () -> void } -> self
|
53
61
|
|
54
62
|
# <!--
|
55
63
|
# rdoc-file=ext/io/console/console.c
|
56
|
-
# - clear_screen
|
64
|
+
# - io.clear_screen -> io
|
57
65
|
# -->
|
66
|
+
# Clears the entire screen and moves the cursor top-left corner.
|
67
|
+
#
|
68
|
+
# You must require 'io/console' to use this method.
|
58
69
|
#
|
59
70
|
def clear_screen: () -> self
|
60
71
|
|
@@ -119,36 +130,53 @@ class IO
|
|
119
130
|
|
120
131
|
# <!--
|
121
132
|
# rdoc-file=ext/io/console/console.c
|
122
|
-
# - cursor=
|
133
|
+
# - io.cursor = [line, column] -> io
|
123
134
|
# -->
|
135
|
+
# Same as `io.goto(line, column)`
|
136
|
+
#
|
137
|
+
# See IO#goto.
|
138
|
+
#
|
139
|
+
# You must require 'io/console' to use this method.
|
124
140
|
#
|
125
141
|
def cursor=: ([ Integer, Integer ]) -> [ Integer, Integer ]
|
126
142
|
|
127
143
|
# <!--
|
128
144
|
# rdoc-file=ext/io/console/console.c
|
129
|
-
# - cursor_down(
|
145
|
+
# - io.cursor_down(n) -> io
|
130
146
|
# -->
|
147
|
+
# Moves the cursor down `n` lines.
|
148
|
+
#
|
149
|
+
# You must require 'io/console' to use this method.
|
131
150
|
#
|
132
151
|
def cursor_down: (int) -> self
|
133
152
|
|
134
153
|
# <!--
|
135
154
|
# rdoc-file=ext/io/console/console.c
|
136
|
-
# - cursor_left(
|
155
|
+
# - io.cursor_left(n) -> io
|
137
156
|
# -->
|
157
|
+
# Moves the cursor left `n` columns.
|
158
|
+
#
|
159
|
+
# You must require 'io/console' to use this method.
|
138
160
|
#
|
139
161
|
def cursor_left: (int) -> self
|
140
162
|
|
141
163
|
# <!--
|
142
164
|
# rdoc-file=ext/io/console/console.c
|
143
|
-
# - cursor_right(
|
165
|
+
# - io.cursor_right(n) -> io
|
144
166
|
# -->
|
167
|
+
# Moves the cursor right `n` columns.
|
168
|
+
#
|
169
|
+
# You must require 'io/console' to use this method.
|
145
170
|
#
|
146
171
|
def cursor_right: (int) -> self
|
147
172
|
|
148
173
|
# <!--
|
149
174
|
# rdoc-file=ext/io/console/console.c
|
150
|
-
# - cursor_up(
|
175
|
+
# - io.cursor_up(n) -> io
|
151
176
|
# -->
|
177
|
+
# Moves the cursor up `n` lines.
|
178
|
+
#
|
179
|
+
# You must require 'io/console' to use this method.
|
152
180
|
#
|
153
181
|
def cursor_up: (int) -> self
|
154
182
|
|
@@ -175,15 +203,23 @@ class IO
|
|
175
203
|
|
176
204
|
# <!--
|
177
205
|
# rdoc-file=ext/io/console/console.c
|
178
|
-
# - erase_line(
|
206
|
+
# - io.erase_line(mode) -> io
|
179
207
|
# -->
|
208
|
+
# Erases the line at the cursor corresponding to `mode`. `mode` may be either:
|
209
|
+
# 0: after cursor 1: before and cursor 2: entire line
|
210
|
+
#
|
211
|
+
# You must require 'io/console' to use this method.
|
180
212
|
#
|
181
213
|
def erase_line: (0 | 1 | 2 | nil) -> self
|
182
214
|
|
183
215
|
# <!--
|
184
216
|
# rdoc-file=ext/io/console/console.c
|
185
|
-
# - erase_screen(
|
217
|
+
# - io.erase_screen(mode) -> io
|
186
218
|
# -->
|
219
|
+
# Erases the screen at the cursor corresponding to `mode`. `mode` may be either:
|
220
|
+
# 0: after cursor 1: before and cursor 2: entire screen
|
221
|
+
#
|
222
|
+
# You must require 'io/console' to use this method.
|
187
223
|
#
|
188
224
|
def erase_screen: (0 | 1 | 2 | 3 | nil) -> self
|
189
225
|
|
@@ -220,15 +256,21 @@ class IO
|
|
220
256
|
|
221
257
|
# <!--
|
222
258
|
# rdoc-file=ext/io/console/console.c
|
223
|
-
# - goto(
|
259
|
+
# - io.goto(line, column) -> io
|
224
260
|
# -->
|
261
|
+
# Set the cursor position at `line` and `column`.
|
262
|
+
#
|
263
|
+
# You must require 'io/console' to use this method.
|
225
264
|
#
|
226
265
|
def goto: (int, int) -> self
|
227
266
|
|
228
267
|
# <!--
|
229
268
|
# rdoc-file=ext/io/console/console.c
|
230
|
-
# - goto_column(
|
269
|
+
# - io.goto_column(column) -> io
|
231
270
|
# -->
|
271
|
+
# Set the cursor position at `column` in the same line of the current position.
|
272
|
+
#
|
273
|
+
# You must require 'io/console' to use this method.
|
232
274
|
#
|
233
275
|
def goto_column: (int) -> self
|
234
276
|
|
@@ -278,8 +320,14 @@ class IO
|
|
278
320
|
|
279
321
|
# <!--
|
280
322
|
# rdoc-file=ext/io/console/console.c
|
281
|
-
# - pressed?(
|
323
|
+
# - io.pressed?(key) -> bool
|
282
324
|
# -->
|
325
|
+
# Returns `true` if `key` is pressed. `key` may be a virtual key code or its
|
326
|
+
# name (String or Symbol) with out "VK_" prefix.
|
327
|
+
#
|
328
|
+
# This method is Windows only.
|
329
|
+
#
|
330
|
+
# You must require 'io/console' to use this method.
|
283
331
|
#
|
284
332
|
def pressed?: (Integer | interned) -> bool
|
285
333
|
|
@@ -324,15 +372,21 @@ class IO
|
|
324
372
|
|
325
373
|
# <!--
|
326
374
|
# rdoc-file=ext/io/console/console.c
|
327
|
-
# - scroll_backward(
|
375
|
+
# - io.scroll_backward(n) -> io
|
328
376
|
# -->
|
377
|
+
# Scrolls the entire scrolls backward `n` lines.
|
378
|
+
#
|
379
|
+
# You must require 'io/console' to use this method.
|
329
380
|
#
|
330
381
|
def scroll_backward: (int) -> self
|
331
382
|
|
332
383
|
# <!--
|
333
384
|
# rdoc-file=ext/io/console/console.c
|
334
|
-
# - scroll_forward(
|
385
|
+
# - io.scroll_forward(n) -> io
|
335
386
|
# -->
|
387
|
+
# Scrolls the entire scrolls forward `n` lines.
|
388
|
+
#
|
389
|
+
# You must require 'io/console' to use this method.
|
336
390
|
#
|
337
391
|
def scroll_forward: (int) -> self
|
338
392
|
|
data/stdlib/ipaddr/0/ipaddr.rbs
CHANGED
@@ -37,7 +37,8 @@ class IPAddr
|
|
37
37
|
# - ntop(addr)
|
38
38
|
# -->
|
39
39
|
# Convert a network byte ordered string form of an IP address into human
|
40
|
-
# readable form.
|
40
|
+
# readable form. It expects the string to be encoded in Encoding::ASCII_8BIT
|
41
|
+
# (BINARY).
|
41
42
|
#
|
42
43
|
def self.ntop: (String addr) -> String
|
43
44
|
|
@@ -240,8 +241,10 @@ class IPAddr
|
|
240
241
|
# - link_local?()
|
241
242
|
# -->
|
242
243
|
# Returns true if the ipaddr is a link-local address. IPv4 addresses in
|
243
|
-
# 169.254.0.0/16 reserved by RFC 3927 and
|
244
|
-
# fe80::/10 reserved by RFC 4291 are considered link-local.
|
244
|
+
# 169.254.0.0/16 reserved by RFC 3927 and link-local IPv6 Unicast Addresses in
|
245
|
+
# fe80::/10 reserved by RFC 4291 are considered link-local. Link-local IPv4
|
246
|
+
# addresses in the IPv4-mapped IPv6 address range are also considered
|
247
|
+
# link-local.
|
245
248
|
#
|
246
249
|
def link_local?: () -> bool
|
247
250
|
|
@@ -249,7 +252,8 @@ class IPAddr
|
|
249
252
|
# rdoc-file=lib/ipaddr.rb
|
250
253
|
# - loopback?()
|
251
254
|
# -->
|
252
|
-
# Returns true if the ipaddr is a loopback address.
|
255
|
+
# Returns true if the ipaddr is a loopback address. Loopback IPv4 addresses in
|
256
|
+
# the IPv4-mapped IPv6 address range are also considered as loopback addresses.
|
253
257
|
#
|
254
258
|
def loopback?: () -> bool
|
255
259
|
|
@@ -272,6 +276,14 @@ class IPAddr
|
|
272
276
|
#
|
273
277
|
def native: () -> IPAddr
|
274
278
|
|
279
|
+
# <!--
|
280
|
+
# rdoc-file=lib/ipaddr.rb
|
281
|
+
# - netmask()
|
282
|
+
# -->
|
283
|
+
# Returns the netmask in string format e.g. 255.255.0.0
|
284
|
+
#
|
285
|
+
def netmask: () -> String
|
286
|
+
|
275
287
|
# <!--
|
276
288
|
# rdoc-file=lib/ipaddr.rb
|
277
289
|
# - prefix()
|