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
data/stdlib/csv/0/csv.rbs
CHANGED
@@ -9,7 +9,6 @@
|
|
9
9
|
# * A *column* *separator* delimits fields in a row. A common column separator
|
10
10
|
# is the comma character `","`.
|
11
11
|
#
|
12
|
-
#
|
13
12
|
# This CSV String, with row separator `"\n"` and column separator `","`, has
|
14
13
|
# three rows and two columns:
|
15
14
|
# "foo,0\nbar,1\nbaz,2\n"
|
@@ -28,7 +27,6 @@
|
|
28
27
|
# IO object.
|
29
28
|
# * Generating CSV data to a String object.
|
30
29
|
#
|
31
|
-
#
|
32
30
|
# To make CSV available:
|
33
31
|
# require 'csv'
|
34
32
|
#
|
@@ -51,11 +49,9 @@
|
|
51
49
|
# * The outer Array is the entire "table".
|
52
50
|
# * Each inner Array is a row.
|
53
51
|
# * Each String is a field.
|
54
|
-
#
|
55
52
|
# * A CSV::Table object. For details, see [\CSV with
|
56
53
|
# Headers](#class-CSV-label-CSV+with+Headers).
|
57
54
|
#
|
58
|
-
#
|
59
55
|
# #### Parsing a String
|
60
56
|
#
|
61
57
|
# The input to be parsed can be a string:
|
@@ -168,7 +164,6 @@
|
|
168
164
|
# * Method CSV.instance returns a new or cached CSV object.
|
169
165
|
# * Method CSV() also returns a new or cached CSV object.
|
170
166
|
#
|
171
|
-
#
|
172
167
|
# ### Instance Methods
|
173
168
|
#
|
174
169
|
# CSV has three groups of instance methods:
|
@@ -176,7 +171,6 @@
|
|
176
171
|
# * Methods included by module Enumerable.
|
177
172
|
# * Methods delegated to class IO. See below.
|
178
173
|
#
|
179
|
-
#
|
180
174
|
# #### Delegated Methods
|
181
175
|
#
|
182
176
|
# For convenience, a CSV object will delegate to many methods in class IO. (A
|
@@ -215,7 +209,6 @@
|
|
215
209
|
# * IO#truncate
|
216
210
|
# * IO#tty?
|
217
211
|
#
|
218
|
-
#
|
219
212
|
# ### Options
|
220
213
|
#
|
221
214
|
# The default values for options are:
|
@@ -274,7 +267,6 @@
|
|
274
267
|
# * `empty_value`: Specifies the object that is to be substituted for each
|
275
268
|
# empty field.
|
276
269
|
#
|
277
|
-
#
|
278
270
|
# ###### Option `row_sep`
|
279
271
|
#
|
280
272
|
# Specifies the row separator, a String or the Symbol `:auto` (see below), to be
|
@@ -365,7 +357,6 @@
|
|
365
357
|
# * Data is `ARGF`, `STDIN`, `STDOUT`, or `STDERR`.
|
366
358
|
# * The stream is only available for output.
|
367
359
|
#
|
368
|
-
#
|
369
360
|
# Obviously, discovery takes a little time. Set manually if speed is important.
|
370
361
|
# Also note that IO objects should be opened in binary mode on Windows if this
|
371
362
|
# feature will be used as the line-ending translation can cause problems with
|
@@ -684,7 +675,6 @@
|
|
684
675
|
# * The converters apply only to the header row.
|
685
676
|
# * The built-in header converters are `:downcase` and `:symbol`.
|
686
677
|
#
|
687
|
-
#
|
688
678
|
# This section assumes prior execution of:
|
689
679
|
# str = <<-EOT
|
690
680
|
# Name,Value
|
@@ -756,7 +746,6 @@
|
|
756
746
|
# * If a String, converts it to a Regexp, ignores lines that match it.
|
757
747
|
# * If `nil`, no lines are considered to be comments.
|
758
748
|
#
|
759
|
-
#
|
760
749
|
# Default value:
|
761
750
|
# CSV::DEFAULT_OPTIONS.fetch(:skip_lines) # => nil
|
762
751
|
#
|
@@ -885,7 +874,6 @@
|
|
885
874
|
# * `write_empty_value`: Specifies the object that is to be substituted for
|
886
875
|
# each empty field.
|
887
876
|
#
|
888
|
-
#
|
889
877
|
# ###### Option `row_sep`
|
890
878
|
#
|
891
879
|
# Specifies the row separator, a String or the Symbol `:auto` (see below), to be
|
@@ -976,7 +964,6 @@
|
|
976
964
|
# * Data is `ARGF`, `STDIN`, `STDOUT`, or `STDERR`.
|
977
965
|
# * The stream is only available for output.
|
978
966
|
#
|
979
|
-
#
|
980
967
|
# Obviously, discovery takes a little time. Set manually if speed is important.
|
981
968
|
# Also note that IO objects should be opened in binary mode on Windows if this
|
982
969
|
# feature will be used as the line-ending translation can cause problems with
|
@@ -1231,12 +1218,10 @@
|
|
1231
1218
|
# * See [Field Converters](#class-CSV-label-Field+Converters).
|
1232
1219
|
# * See [Header Converters](#class-CSV-label-Header+Converters).
|
1233
1220
|
#
|
1234
|
-
#
|
1235
1221
|
# Also by default, each value to be written during generation is written
|
1236
1222
|
# 'as-is'. You can use a *write* *converter* to modify values before writing.
|
1237
1223
|
# * See [Write Converters](#class-CSV-label-Write+Converters).
|
1238
1224
|
#
|
1239
|
-
#
|
1240
1225
|
# #### Specifying Converters
|
1241
1226
|
#
|
1242
1227
|
# You can specify converters for parsing or generating in the `options` argument
|
@@ -1245,14 +1230,12 @@
|
|
1245
1230
|
# * Option `header_converters` for converting parsed header values.
|
1246
1231
|
# * Option `write_converters` for converting values to be written (generated).
|
1247
1232
|
#
|
1248
|
-
#
|
1249
1233
|
# There are three forms for specifying converters:
|
1250
1234
|
# * A converter proc: executable code to be used for conversion.
|
1251
1235
|
# * A converter name: the name of a stored converter.
|
1252
1236
|
# * A converter list: an array of converter procs, converter names, and
|
1253
1237
|
# converter lists.
|
1254
1238
|
#
|
1255
|
-
#
|
1256
1239
|
# ##### Converter Procs
|
1257
1240
|
#
|
1258
1241
|
# This converter proc, `strip_converter`, accepts a value `field` and returns
|
@@ -1263,7 +1246,6 @@
|
|
1263
1246
|
# string_converter` specifies that:
|
1264
1247
|
# * Proc `string_converter` is to be called for each parsed field.
|
1265
1248
|
# * The converter's return value is to replace the `field` value.
|
1266
|
-
#
|
1267
1249
|
# Example:
|
1268
1250
|
# string = " foo , 0 \n bar , 1 \n baz , 2 \n"
|
1269
1251
|
# array = CSV.parse(string, converters: strip_converter)
|
@@ -1293,7 +1275,6 @@
|
|
1293
1275
|
# * The 1-based line index.
|
1294
1276
|
# * The field header, if any.
|
1295
1277
|
#
|
1296
|
-
#
|
1297
1278
|
# ##### Stored Converters
|
1298
1279
|
#
|
1299
1280
|
# A converter may be given a name and stored in a structure where the parsing
|
@@ -1305,7 +1286,6 @@
|
|
1305
1286
|
# * `:float`: converts each String-embedded float into a true Float.
|
1306
1287
|
# * `:date`: converts each String-embedded date into a true Date.
|
1307
1288
|
# * `:date_time`: converts each String-embedded date-time into a true DateTime
|
1308
|
-
#
|
1309
1289
|
# . This example creates a converter proc, then stores it:
|
1310
1290
|
# strip_converter = proc {|field| field.strip }
|
1311
1291
|
# CSV::Converters[:strip] = strip_converter
|
@@ -1320,7 +1300,6 @@
|
|
1320
1300
|
# * `:downcase`: Downcases each header.
|
1321
1301
|
# * `:symbol`: Converts each header to a Symbol.
|
1322
1302
|
#
|
1323
|
-
#
|
1324
1303
|
# There is no such storage structure for write headers.
|
1325
1304
|
#
|
1326
1305
|
# In order for the parsing methods to access stored converters in
|
@@ -1338,7 +1317,6 @@
|
|
1338
1317
|
# * Names of stored converters.
|
1339
1318
|
# * Nested converter lists.
|
1340
1319
|
#
|
1341
|
-
#
|
1342
1320
|
# Examples:
|
1343
1321
|
# numeric_converters = [:integer, :float]
|
1344
1322
|
# date_converters = [:date, :date_time]
|
@@ -1387,7 +1365,6 @@
|
|
1387
1365
|
# csv.converters # => [:integer]
|
1388
1366
|
# csv.read # => [["foo", 0], ["bar", 1], ["baz", 2]]
|
1389
1367
|
#
|
1390
|
-
#
|
1391
1368
|
# Installing a field converter does not affect already-read rows:
|
1392
1369
|
# csv = CSV.new(string)
|
1393
1370
|
# csv.shift # => ["foo", "0"]
|
@@ -1407,8 +1384,6 @@
|
|
1407
1384
|
# * A Proc field converter.
|
1408
1385
|
# * An Array of field converter names.
|
1409
1386
|
#
|
1410
|
-
#
|
1411
|
-
#
|
1412
1387
|
# Display:
|
1413
1388
|
# CSV::Converters.each_pair do |name, value|
|
1414
1389
|
# if value.kind_of?(Proc)
|
@@ -1522,7 +1497,6 @@
|
|
1522
1497
|
# tbl = CSV.parse(string, headers: true)
|
1523
1498
|
# tbl.headers # => ["Name", "Count"]
|
1524
1499
|
#
|
1525
|
-
#
|
1526
1500
|
# ##### Built-In Header Converters
|
1527
1501
|
#
|
1528
1502
|
# The built-in header converters are in Hash CSV::HeaderConverters. The keys
|
@@ -1547,7 +1521,6 @@
|
|
1547
1521
|
# * Removes non-word characters.
|
1548
1522
|
# * Makes the string into a Symbol.
|
1549
1523
|
#
|
1550
|
-
#
|
1551
1524
|
# ##### Custom Header Converters
|
1552
1525
|
#
|
1553
1526
|
# You can define a custom header converter:
|
@@ -1744,15 +1717,12 @@ class CSV < Object
|
|
1744
1717
|
# * Positioned at the beginning. To position at the end, for appending,
|
1745
1718
|
# use method CSV.generate. For any other positioning, pass a preset
|
1746
1719
|
# StringIO object instead.
|
1747
|
-
#
|
1748
1720
|
# * Argument `options`: See:
|
1749
1721
|
# * [Options for Parsing](#class-CSV-label-Options+for+Parsing)
|
1750
1722
|
# * [Options for Generating](#class-CSV-label-Options+for+Generating)
|
1751
|
-
#
|
1752
1723
|
# For performance reasons, the options cannot be overridden in a CSV object,
|
1753
1724
|
# so those specified here will endure.
|
1754
1725
|
#
|
1755
|
-
#
|
1756
1726
|
# In addition to the CSV instance methods, several IO methods are delegated. See
|
1757
1727
|
# [Delegated Methods](#class-CSV-label-Delegated+Methods).
|
1758
1728
|
#
|
@@ -1793,11 +1763,9 @@ class CSV < Object
|
|
1793
1763
|
# * Positioned at the beginning. To position at the end, for appending,
|
1794
1764
|
# use method CSV.generate. For any other positioning, pass a preset
|
1795
1765
|
# StringIO object instead.
|
1796
|
-
#
|
1797
1766
|
# * Argument `options`: see [Options for
|
1798
1767
|
# Parsing](#class-CSV-label-Options+for+Parsing)
|
1799
1768
|
#
|
1800
|
-
#
|
1801
1769
|
# ###### Without Option `headers`
|
1802
1770
|
#
|
1803
1771
|
# Without {option `headers`[}](#class-CSV-label-Option+headers) case.
|
@@ -1916,11 +1884,9 @@ class CSV < Object
|
|
1916
1884
|
# * Positioned at the beginning. To position at the end, for appending,
|
1917
1885
|
# use method CSV.generate. For any other positioning, pass a preset
|
1918
1886
|
# StringIO object instead.
|
1919
|
-
#
|
1920
1887
|
# * Argument `options`: see [Options for
|
1921
1888
|
# Parsing](#class-CSV-label-Options+for+Parsing)
|
1922
1889
|
#
|
1923
|
-
#
|
1924
1890
|
# ###### Without Option `headers`
|
1925
1891
|
#
|
1926
1892
|
# Without option `headers`, returns the first row as a new Array.
|
@@ -1975,7 +1941,6 @@ class CSV < Object
|
|
1975
1941
|
# * A CSV::Table object, if headers are in use.
|
1976
1942
|
# * An Array of Arrays, otherwise.
|
1977
1943
|
#
|
1978
|
-
#
|
1979
1944
|
# The data source must be opened for reading.
|
1980
1945
|
#
|
1981
1946
|
# Without headers:
|
@@ -2043,7 +2008,6 @@ class CSV < Object
|
|
2043
2008
|
# * Argument `row` must be an Array object or a CSV::Row object.
|
2044
2009
|
# * The output stream must be open for writing.
|
2045
2010
|
#
|
2046
|
-
#
|
2047
2011
|
# ---
|
2048
2012
|
#
|
2049
2013
|
# Append Arrays:
|
@@ -2099,7 +2063,6 @@ class CSV < Object
|
|
2099
2063
|
# * Arguments `options`, if given, should be generating options. See [Options
|
2100
2064
|
# for Generating](#class-CSV-label-Options+for+Generating).
|
2101
2065
|
#
|
2102
|
-
#
|
2103
2066
|
# ---
|
2104
2067
|
#
|
2105
2068
|
# Creates a new CSV object via `CSV.new(csv_string, **options)`; calls the block
|
@@ -2227,7 +2190,6 @@ CSV::VERSION: String
|
|
2227
2190
|
# * Fields: each is an object, not necessarily a String.
|
2228
2191
|
# * Headers: each serves a key, and also need not be a String.
|
2229
2192
|
#
|
2230
|
-
#
|
2231
2193
|
# ### Instance Methods
|
2232
2194
|
#
|
2233
2195
|
# CSV::Row has three groups of instance methods:
|
@@ -2238,8 +2200,6 @@ CSV::VERSION: String
|
|
2238
2200
|
# * Array#length
|
2239
2201
|
# * Array#size
|
2240
2202
|
#
|
2241
|
-
#
|
2242
|
-
#
|
2243
2203
|
# ## Creating a CSV::Row Instance
|
2244
2204
|
#
|
2245
2205
|
# Commonly, a new CSV::Row instance is created by parsing CSV source that has
|
@@ -2658,7 +2618,6 @@ class CSV::Row < Object
|
|
2658
2618
|
# * Header.
|
2659
2619
|
# * Range of headers.
|
2660
2620
|
#
|
2661
|
-
#
|
2662
2621
|
# For `specifier` in one of the first four cases above, returns the result of
|
2663
2622
|
# `self.field(specifier)`; see #field.
|
2664
2623
|
#
|
@@ -2765,7 +2724,6 @@ class CSV::Row < Object
|
|
2765
2724
|
# Returns an ASCII-compatible String showing:
|
2766
2725
|
# * Class CSV::Row.
|
2767
2726
|
# * Header-value pairs.
|
2768
|
-
#
|
2769
2727
|
# Example:
|
2770
2728
|
# source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
|
2771
2729
|
# table = CSV.parse(source, headers: true)
|
@@ -2875,7 +2833,6 @@ end
|
|
2875
2833
|
# * Rows: each is a Table::Row object.
|
2876
2834
|
# * Headers: names for the columns.
|
2877
2835
|
#
|
2878
|
-
#
|
2879
2836
|
# ### Instance Methods
|
2880
2837
|
#
|
2881
2838
|
# CSV::Table has three groups of instance methods:
|
@@ -2886,8 +2843,6 @@ end
|
|
2886
2843
|
# * Array#length
|
2887
2844
|
# * Array#size
|
2888
2845
|
#
|
2889
|
-
#
|
2890
|
-
#
|
2891
2846
|
# ## Creating a CSV::Table Instance
|
2892
2847
|
#
|
2893
2848
|
# Commonly, a new CSV::Table instance is created by parsing CSV source using
|
@@ -2921,7 +2876,6 @@ end
|
|
2921
2876
|
# * Column mode.
|
2922
2877
|
# * Mixed mode (the default for a new table).
|
2923
2878
|
#
|
2924
|
-
#
|
2925
2879
|
# The access mode for aCSV::Table instance affects the behavior of some of its
|
2926
2880
|
# instance methods:
|
2927
2881
|
# * #[]
|
@@ -2931,7 +2885,6 @@ end
|
|
2931
2885
|
# * #each
|
2932
2886
|
# * #values_at
|
2933
2887
|
#
|
2934
|
-
#
|
2935
2888
|
# ### Row Mode
|
2936
2889
|
#
|
2937
2890
|
# Set a table to row mode with method #by_row!:
|
@@ -2984,7 +2937,6 @@ end
|
|
2984
2937
|
# * A Range index refers to multiple rows.
|
2985
2938
|
# * A String index refers to a column.
|
2986
2939
|
#
|
2987
|
-
#
|
2988
2940
|
# Set a table to mixed mode with method #by_col_or_row!:
|
2989
2941
|
# source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
|
2990
2942
|
# table = CSV.parse(source, headers: true)
|
@@ -3025,7 +2977,6 @@ class CSV::Table[out Elem] < Object
|
|
3025
2977
|
# * Argument `array_of_rows` must be an Array of CSV::Row objects.
|
3026
2978
|
# * Argument `headers`, if given, may be an Array of Strings.
|
3027
2979
|
#
|
3028
|
-
#
|
3029
2980
|
# ---
|
3030
2981
|
#
|
3031
2982
|
# Create an empty CSV::Table object:
|
@@ -3135,7 +3086,6 @@ class CSV::Table[out Elem] < Object
|
|
3135
3086
|
# * Access mode: `:row` or `:col_or_row`.
|
3136
3087
|
# * Return value: *nth* row of the table, if that row exists; otherwise `nil`.
|
3137
3088
|
#
|
3138
|
-
#
|
3139
3089
|
# Returns the *nth* row of the table if that row exists:
|
3140
3090
|
# source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
|
3141
3091
|
# table = CSV.parse(source, headers: true)
|
@@ -3166,7 +3116,6 @@ class CSV::Table[out Elem] < Object
|
|
3166
3116
|
# * Return value: *nth* column of the table, if that column exists; otherwise
|
3167
3117
|
# an Array of `nil` fields of length `self.size`.
|
3168
3118
|
#
|
3169
|
-
#
|
3170
3119
|
# Returns the *nth* column of the table if that column exists:
|
3171
3120
|
# source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
|
3172
3121
|
# table = CSV.parse(source, headers: true)
|
@@ -3190,7 +3139,6 @@ class CSV::Table[out Elem] < Object
|
|
3190
3139
|
# * Return value: rows from the table, beginning at row `range.start`, if
|
3191
3140
|
# those rows exists.
|
3192
3141
|
#
|
3193
|
-
#
|
3194
3142
|
# Returns rows from the table, beginning at row `range.first`, if those rows
|
3195
3143
|
# exist:
|
3196
3144
|
# source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
|
@@ -3230,7 +3178,6 @@ class CSV::Table[out Elem] < Object
|
|
3230
3178
|
# * Return value: column data from the table, beginning at column
|
3231
3179
|
# `range.start`, if those columns exist.
|
3232
3180
|
#
|
3233
|
-
#
|
3234
3181
|
# Returns column values from the table, if the column exists; the values are
|
3235
3182
|
# arranged by row:
|
3236
3183
|
# source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
|
@@ -3261,7 +3208,6 @@ class CSV::Table[out Elem] < Object
|
|
3261
3208
|
# * Access mode: `:col` or `:col_or_row`
|
3262
3209
|
# * Return value: column data from the table, if that `header` exists.
|
3263
3210
|
#
|
3264
|
-
#
|
3265
3211
|
# Returns column values from the table, if the column exists:
|
3266
3212
|
# source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
|
3267
3213
|
# table = CSV.parse(source, headers: true)
|
@@ -3299,7 +3245,6 @@ class CSV::Table[out Elem] < Object
|
|
3299
3245
|
# * Access mode: `:row` or `:col_or_row`.
|
3300
3246
|
# * Return value: `row`.
|
3301
3247
|
#
|
3302
|
-
#
|
3303
3248
|
# If the row exists, it is replaced:
|
3304
3249
|
# source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
|
3305
3250
|
# table = CSV.parse(source, headers: true)
|
@@ -3341,7 +3286,6 @@ class CSV::Table[out Elem] < Object
|
|
3341
3286
|
# * Access mode: `:col`.
|
3342
3287
|
# * Return value: `array_of_fields`.
|
3343
3288
|
#
|
3344
|
-
#
|
3345
3289
|
# If the column exists, it is replaced:
|
3346
3290
|
# source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
|
3347
3291
|
# table = CSV.parse(source, headers: true)
|
@@ -3380,7 +3324,6 @@ class CSV::Table[out Elem] < Object
|
|
3380
3324
|
# * Access mode: `:col` or `:col_or_row`.
|
3381
3325
|
# * Return value: `field_or_array_of_fields`.
|
3382
3326
|
#
|
3383
|
-
#
|
3384
3327
|
# If the column exists, it is replaced:
|
3385
3328
|
# source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
|
3386
3329
|
# table = CSV.parse(source, headers: true)
|
@@ -3684,7 +3627,6 @@ class CSV::Table[out Elem] < Object
|
|
3684
3627
|
# * Access mode: `:row`, `:col`, or `:col_or_row`.
|
3685
3628
|
# * Size: Row count, including the header row.
|
3686
3629
|
#
|
3687
|
-
#
|
3688
3630
|
# Example:
|
3689
3631
|
# source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
|
3690
3632
|
# table = CSV.parse(source, headers: true)
|
@@ -3814,3 +3756,21 @@ class CSV::Table[out Elem] < Object
|
|
3814
3756
|
#
|
3815
3757
|
def values_at: (*untyped indices_or_headers) -> untyped
|
3816
3758
|
end
|
3759
|
+
|
3760
|
+
%a{annotate:rdoc:skip}
|
3761
|
+
class Array[unchecked out Elem] < Object
|
3762
|
+
# Equivalent to CSV::generate_line(self, options)
|
3763
|
+
#
|
3764
|
+
# ["CSV", "data"].to_csv
|
3765
|
+
# #=> "CSV,data\n"
|
3766
|
+
def to_csv: (**untyped options) -> String
|
3767
|
+
end
|
3768
|
+
|
3769
|
+
%a{annotate:rdoc:skip}
|
3770
|
+
class String
|
3771
|
+
# Equivalent to CSV::parse_line(self, options)
|
3772
|
+
#
|
3773
|
+
# "CSV,data".parse_csv
|
3774
|
+
# #=> ["CSV", "data"]
|
3775
|
+
def parse_csv: (**untyped options) -> ::Array[String?]?
|
3776
|
+
end
|
data/stdlib/csv/0/manifest.yaml
CHANGED
data/stdlib/date/0/date.rbs
CHANGED
@@ -5,8 +5,7 @@
|
|
5
5
|
#
|
6
6
|
# * You need both dates and times; Date handles only dates.
|
7
7
|
# * You need only Gregorian dates (and not Julian dates); see [Julian and
|
8
|
-
# Gregorian Calendars](rdoc-ref:calendars.rdoc).
|
9
|
-
#
|
8
|
+
# Gregorian Calendars](rdoc-ref:date/calendars.rdoc).
|
10
9
|
#
|
11
10
|
# A Date object, once created, is immutable, and cannot be modified.
|
12
11
|
#
|
@@ -52,7 +51,6 @@
|
|
52
51
|
# Date.strptime('1999 52 5', '%Y %W %u') # => #<Date: 1999-12-31>
|
53
52
|
# Date.strptime('fri31dec99', '%a%d%b%y') # => #<Date: 1999-12-31>
|
54
53
|
#
|
55
|
-
#
|
56
54
|
# See also the specialized methods in ["Specialized Format Strings" in Formats
|
57
55
|
# for Dates and
|
58
56
|
# Times](rdoc-ref:strftime_formatting.rdoc@Specialized+Format+Strings)
|
@@ -90,7 +88,7 @@ class Date
|
|
90
88
|
# number of days in the month; when the argument is negative, counts backward
|
91
89
|
# from the end of the month.
|
92
90
|
#
|
93
|
-
# See argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
91
|
+
# See argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
94
92
|
#
|
95
93
|
# Related: Date.jd.
|
96
94
|
#
|
@@ -311,8 +309,7 @@ class Date
|
|
311
309
|
# Date.commercial(2020, 1, 1).to_s # => "2019-12-30"
|
312
310
|
# Date.commercial(2020, 1, 7).to_s # => "2020-01-05"
|
313
311
|
#
|
314
|
-
#
|
315
|
-
# See argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
312
|
+
# See argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
316
313
|
#
|
317
314
|
# Related: Date.jd, Date.new, Date.ordinal.
|
318
315
|
#
|
@@ -346,10 +343,9 @@ class Date
|
|
346
343
|
#
|
347
344
|
# See:
|
348
345
|
#
|
349
|
-
# * Argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
346
|
+
# * Argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
350
347
|
# * Argument [limit](rdoc-ref:Date@Argument+limit).
|
351
348
|
#
|
352
|
-
#
|
353
349
|
# Related: Date._httpdate (returns a hash).
|
354
350
|
#
|
355
351
|
def self.httpdate: (String str, ?Integer start) -> Date
|
@@ -368,10 +364,9 @@ class Date
|
|
368
364
|
#
|
369
365
|
# See:
|
370
366
|
#
|
371
|
-
# * Argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
367
|
+
# * Argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
372
368
|
# * Argument [limit](rdoc-ref:Date@Argument+limit).
|
373
369
|
#
|
374
|
-
#
|
375
370
|
# Related: Date._iso8601 (returns a hash).
|
376
371
|
#
|
377
372
|
def self.iso8601: (String str, ?Integer start) -> Date
|
@@ -398,8 +393,7 @@ class Date
|
|
398
393
|
#
|
399
394
|
# Date.jd(Date::ITALY - 1).julian? # => true
|
400
395
|
#
|
401
|
-
#
|
402
|
-
# See argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
396
|
+
# See argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
403
397
|
#
|
404
398
|
# Related: Date.new.
|
405
399
|
#
|
@@ -423,10 +417,9 @@ class Date
|
|
423
417
|
#
|
424
418
|
# See:
|
425
419
|
#
|
426
|
-
# * Argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
420
|
+
# * Argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
427
421
|
# * Argument [limit](rdoc-ref:Date@Argument+limit).
|
428
422
|
#
|
429
|
-
#
|
430
423
|
# Related: Date._jisx0301 (returns a hash).
|
431
424
|
#
|
432
425
|
def self.jisx0301: (String str, ?Integer start) -> Date
|
@@ -487,7 +480,7 @@ class Date
|
|
487
480
|
#
|
488
481
|
# Raises an exception if `yday` is zero or out of range.
|
489
482
|
#
|
490
|
-
# See argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
483
|
+
# See argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
491
484
|
#
|
492
485
|
# Related: Date.jd, Date.new.
|
493
486
|
#
|
@@ -517,10 +510,9 @@ class Date
|
|
517
510
|
#
|
518
511
|
# See:
|
519
512
|
#
|
520
|
-
# * Argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
513
|
+
# * Argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
521
514
|
# * Argument [limit](rdoc-ref:Date@Argument+limit).
|
522
515
|
#
|
523
|
-
#
|
524
516
|
# Related: Date._parse (returns a hash).
|
525
517
|
#
|
526
518
|
def self.parse: (?String str, ?boolish complete, ?Integer start) -> Date
|
@@ -539,10 +531,9 @@ class Date
|
|
539
531
|
#
|
540
532
|
# See:
|
541
533
|
#
|
542
|
-
# * Argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
534
|
+
# * Argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
543
535
|
# * Argument [limit](rdoc-ref:Date@Argument+limit).
|
544
536
|
#
|
545
|
-
#
|
546
537
|
# Related: Date._rfc2822 (returns a hash).
|
547
538
|
#
|
548
539
|
def self.rfc2822: (String str, ?Integer start) -> Date
|
@@ -560,10 +551,9 @@ class Date
|
|
560
551
|
#
|
561
552
|
# See:
|
562
553
|
#
|
563
|
-
# * Argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
554
|
+
# * Argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
564
555
|
# * Argument [limit](rdoc-ref:Date@Argument+limit).
|
565
556
|
#
|
566
|
-
#
|
567
557
|
# Related: Date._rfc3339 (returns a hash).
|
568
558
|
#
|
569
559
|
def self.rfc3339: (String str, ?Integer start) -> Date
|
@@ -582,10 +572,9 @@ class Date
|
|
582
572
|
#
|
583
573
|
# See:
|
584
574
|
#
|
585
|
-
# * Argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
575
|
+
# * Argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
586
576
|
# * Argument [limit](rdoc-ref:Date@Argument+limit).
|
587
577
|
#
|
588
|
-
#
|
589
578
|
# Related: Date._rfc2822 (returns a hash).
|
590
579
|
#
|
591
580
|
def self.rfc822: (String str, ?Integer start) -> Date
|
@@ -609,7 +598,7 @@ class Date
|
|
609
598
|
# Times](rdoc-ref:strftime_formatting.rdoc). (Unlike Date.strftime, does not
|
610
599
|
# support flags and width.)
|
611
600
|
#
|
612
|
-
# See argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
601
|
+
# See argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
613
602
|
#
|
614
603
|
# See also [strptime(3)](https://man7.org/linux/man-pages/man3/strptime.3.html).
|
615
604
|
#
|
@@ -625,7 +614,7 @@ class Date
|
|
625
614
|
#
|
626
615
|
# Date.today.to_s # => "2022-07-06"
|
627
616
|
#
|
628
|
-
# See argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
617
|
+
# See argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
629
618
|
#
|
630
619
|
def self.today: (?Integer start) -> Date
|
631
620
|
|
@@ -640,7 +629,7 @@ class Date
|
|
640
629
|
# Date.valid_date?(2001, 2, 29) # => false
|
641
630
|
# Date.valid_date?(2001, 2, -1) # => true
|
642
631
|
#
|
643
|
-
# See argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
632
|
+
# See argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
644
633
|
#
|
645
634
|
# Related: Date.jd, Date.new.
|
646
635
|
#
|
@@ -658,7 +647,7 @@ class Date
|
|
658
647
|
#
|
659
648
|
# See Date.commercial.
|
660
649
|
#
|
661
|
-
# See argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
650
|
+
# See argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
662
651
|
#
|
663
652
|
# Related: Date.jd, Date.commercial.
|
664
653
|
#
|
@@ -675,7 +664,7 @@ class Date
|
|
675
664
|
# Date.valid_date?(2001, 2, 29) # => false
|
676
665
|
# Date.valid_date?(2001, 2, -1) # => true
|
677
666
|
#
|
678
|
-
# See argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
667
|
+
# See argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
679
668
|
#
|
680
669
|
# Related: Date.jd, Date.new.
|
681
670
|
#
|
@@ -690,7 +679,7 @@ class Date
|
|
690
679
|
#
|
691
680
|
# Date.valid_jd?(2451944) # => true
|
692
681
|
#
|
693
|
-
# See argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
682
|
+
# See argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
694
683
|
#
|
695
684
|
# Related: Date.jd.
|
696
685
|
#
|
@@ -706,7 +695,7 @@ class Date
|
|
706
695
|
# Date.valid_ordinal?(2001, 34) # => true
|
707
696
|
# Date.valid_ordinal?(2001, 366) # => false
|
708
697
|
#
|
709
|
-
# See argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
698
|
+
# See argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
710
699
|
#
|
711
700
|
# Related: Date.jd, Date.ordinal.
|
712
701
|
#
|
@@ -725,10 +714,9 @@ class Date
|
|
725
714
|
#
|
726
715
|
# See:
|
727
716
|
#
|
728
|
-
# * Argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
717
|
+
# * Argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
729
718
|
# * Argument [limit](rdoc-ref:Date@Argument+limit).
|
730
719
|
#
|
731
|
-
#
|
732
720
|
# Related: Date._xmlschema (returns a hash).
|
733
721
|
#
|
734
722
|
def self.xmlschema: (String str, ?Integer start) -> Date
|
@@ -755,10 +743,10 @@ class Date
|
|
755
743
|
# rdoc-file=ext/date/date_core.c
|
756
744
|
# - d - other -> date or rational
|
757
745
|
# -->
|
758
|
-
#
|
759
|
-
# If the other is a numeric value,
|
760
|
-
# before self.
|
761
|
-
# most nanosecond.
|
746
|
+
# If the other is a date object, returns a Rational whose value is the
|
747
|
+
# difference between the two dates in days. If the other is a numeric value,
|
748
|
+
# returns a date object pointing `other` days before self. If the other is a
|
749
|
+
# fractional number, assumes its precision is at most nanosecond.
|
762
750
|
#
|
763
751
|
# Date.new(2001,2,3) - 1 #=> #<Date: 2001-02-02 ...>
|
764
752
|
# DateTime.new(2001,2,3) - Rational(1,2)
|
@@ -810,7 +798,6 @@ class Date
|
|
810
798
|
# * `1` if `other` is smaller.
|
811
799
|
# * `nil` if the two are incomparable.
|
812
800
|
#
|
813
|
-
#
|
814
801
|
# Argument `other` may be:
|
815
802
|
#
|
816
803
|
# * Another Date object:
|
@@ -1238,7 +1225,7 @@ class Date
|
|
1238
1225
|
# d1 = d0.new_start(Date::JULIAN)
|
1239
1226
|
# d1.julian? # => true
|
1240
1227
|
#
|
1241
|
-
# See argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
1228
|
+
# See argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
1242
1229
|
#
|
1243
1230
|
def new_start: (?Integer start) -> Date
|
1244
1231
|
|
@@ -1335,10 +1322,9 @@ class Date
|
|
1335
1322
|
#
|
1336
1323
|
# See:
|
1337
1324
|
#
|
1338
|
-
# * Argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
1325
|
+
# * Argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
1339
1326
|
# * Argument [limit](rdoc-ref:Date@Argument+limit).
|
1340
1327
|
#
|
1341
|
-
#
|
1342
1328
|
# Related: Date._rfc2822 (returns a hash).
|
1343
1329
|
#
|
1344
1330
|
def rfc822: () -> String
|
@@ -1369,7 +1355,7 @@ class Date
|
|
1369
1355
|
# Date.new(2001, 2, 3, Date::GREGORIAN).start # => -Infinity
|
1370
1356
|
# Date.new(2001, 2, 3, Date::JULIAN).start # => Infinity
|
1371
1357
|
#
|
1372
|
-
# See argument [start](rdoc-ref:calendars.rdoc@Argument+start).
|
1358
|
+
# See argument [start](rdoc-ref:date/calendars.rdoc@Argument+start).
|
1373
1359
|
#
|
1374
1360
|
def start: () -> Float
|
1375
1361
|
|
@@ -1385,7 +1371,6 @@ class Date
|
|
1385
1371
|
# * The last date is the last one that is before or equal to `limit`, which
|
1386
1372
|
# should be a Date object.
|
1387
1373
|
#
|
1388
|
-
#
|
1389
1374
|
# Example:
|
1390
1375
|
#
|
1391
1376
|
# limit = Date.new(2001, 12, 31)
|