rbs 1.0.5 → 1.0.6
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/CHANGELOG.md +6 -0
- data/core/enumerator.rbs +4 -0
- data/docs/stdlib.md +1 -1
- data/lib/rbs/version.rb +1 -1
- data/stdlib/json/0/json.rbs +224 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c8f0c698e503246f1952a9f05aed05cd1a820d4ea67721970497664bf0ee3fd
|
4
|
+
data.tar.gz: bf2d2e438893b213ad750d1fcd71c9d1b318f9cff1f2212ee65a3dc50cf43e39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53fd4afc4d095999f7a03d6199af9cdd1009a378ebd2976c690c54a2bd2aed81d129912c70a16914733bd252a58e50223f9090bd995ca53a01a1acef513efd4a
|
7
|
+
data.tar.gz: b976e7a9c8bd2b80912290d7047403cfc2d7b09ed405e82aa52b75e9ed19737c144bc9c62d72f0ddcf2839117400d3e5207952753fb73097b21fdfd1192d214f
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 1.0.6 (2021-02-17)
|
6
|
+
|
7
|
+
* Signature Updates
|
8
|
+
* `Enumerable` ([\#595](https://github.com/ruby/rbs/pull/595), [\#596](https://github.com/ruby/rbs/pull/596), [\#601](https://github.com/ruby/rbs/pull/601))
|
9
|
+
* `#as_json` ([\#597](https://github.com/ruby/rbs/pull/597))
|
10
|
+
|
5
11
|
## 1.0.5 (2021-02-13)
|
6
12
|
|
7
13
|
* Signature Updates
|
data/core/enumerator.rbs
CHANGED
@@ -244,6 +244,8 @@ end
|
|
244
244
|
|
245
245
|
class Enumerator::Generator[out Elem] < Object
|
246
246
|
include Enumerable[Elem]
|
247
|
+
|
248
|
+
def each: () { (Elem) -> void } -> void
|
247
249
|
end
|
248
250
|
|
249
251
|
class Enumerator::Lazy[out Elem, out Return] < Enumerator[Elem, Return]
|
@@ -259,4 +261,6 @@ end
|
|
259
261
|
|
260
262
|
class Enumerator::Chain[out Elem] < Object
|
261
263
|
include Enumerable[Elem]
|
264
|
+
|
265
|
+
def each: () { (Elem) -> void } -> void
|
262
266
|
end
|
data/docs/stdlib.md
CHANGED
@@ -70,7 +70,7 @@ One non-trivial but absolutely better solution is to make a tool:
|
|
70
70
|
The next step should be importing RDoc documents.
|
71
71
|
|
72
72
|
```
|
73
|
-
$ bin/annotate-with-rdoc stdlib/pathname/pathname.rbs
|
73
|
+
$ bin/annotate-with-rdoc stdlib/pathname/0/pathname.rbs
|
74
74
|
Loading store from /Users/soutaro/.rbenv/versions/2.7.0-dev/share/ri/2.7.0/system...
|
75
75
|
Loading store from /Users/soutaro/.rbenv/versions/2.7.0-dev/share/ri/2.7.0/site...
|
76
76
|
Opening stdlib/pathname/pathname.rbs...
|
data/lib/rbs/version.rb
CHANGED
data/stdlib/json/0/json.rbs
CHANGED
@@ -403,3 +403,227 @@ class Array[unchecked out Elem]
|
|
403
403
|
#
|
404
404
|
def to_json: (?JSON::State state) -> String
|
405
405
|
end
|
406
|
+
|
407
|
+
class BigDecimal
|
408
|
+
# Import a JSON Marshalled object.
|
409
|
+
#
|
410
|
+
# method used for JSON marshalling support.
|
411
|
+
#
|
412
|
+
def self.json_create: (Hash[String, String] object) -> instance
|
413
|
+
|
414
|
+
# Marshal the object to JSON.
|
415
|
+
#
|
416
|
+
# method used for JSON marshalling support.
|
417
|
+
#
|
418
|
+
def as_json: (*untyped) -> Hash[String, String]
|
419
|
+
|
420
|
+
# return the JSON value
|
421
|
+
#
|
422
|
+
def to_json: (?JSON::State state) -> String
|
423
|
+
end
|
424
|
+
|
425
|
+
class Complex
|
426
|
+
# Deserializes JSON string by converting Real value `r`, imaginary value `i`, to
|
427
|
+
# a Complex object.
|
428
|
+
#
|
429
|
+
def self.json_create: (Hash[String, String | Numeric] object) -> instance
|
430
|
+
|
431
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
432
|
+
# object.
|
433
|
+
#
|
434
|
+
def as_json: (*untyped) -> Hash[String, String | Numeric]
|
435
|
+
|
436
|
+
# Stores class name (Complex) along with real value `r` and imaginary value `i`
|
437
|
+
# as JSON string
|
438
|
+
#
|
439
|
+
def to_json: (?JSON::State state) -> String
|
440
|
+
end
|
441
|
+
|
442
|
+
class Date
|
443
|
+
# Deserializes JSON string by converting Julian year `y`, month `m`, day `d` and
|
444
|
+
# Day of Calendar Reform `sg` to Date.
|
445
|
+
#
|
446
|
+
def self.json_create: (Hash[String, String | Integer | Float] object) -> instance
|
447
|
+
|
448
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
449
|
+
# object.
|
450
|
+
#
|
451
|
+
def as_json: (*untyped) -> Hash[String, String | Integer | Float]
|
452
|
+
|
453
|
+
# Stores class name (Date) with Julian year `y`, month `m`, day `d` and Day of
|
454
|
+
# Calendar Reform `sg` as JSON string
|
455
|
+
#
|
456
|
+
def to_json: (?JSON::State state) -> String
|
457
|
+
end
|
458
|
+
|
459
|
+
class DateTime
|
460
|
+
# Deserializes JSON string by converting year `y`, month `m`, day `d`, hour `H`,
|
461
|
+
# minute `M`, second `S`, offset `of` and Day of Calendar Reform `sg` to
|
462
|
+
# DateTime.
|
463
|
+
#
|
464
|
+
def self.json_create: (Hash[String, String | Integer | Float] object) -> instance
|
465
|
+
|
466
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
467
|
+
# object.
|
468
|
+
#
|
469
|
+
def as_json: (*untyped) -> Hash[String, String | Integer | Float]
|
470
|
+
|
471
|
+
# Stores class name (DateTime) with Julian year `y`, month `m`, day `d`, hour
|
472
|
+
# `H`, minute `M`, second `S`, offset `of` and Day of Calendar Reform `sg` as
|
473
|
+
# JSON string
|
474
|
+
#
|
475
|
+
def to_json: (?JSON::State state) -> String
|
476
|
+
end
|
477
|
+
|
478
|
+
class Exception
|
479
|
+
# Deserializes JSON string by constructing new Exception object with message `m`
|
480
|
+
# and backtrace `b` serialized with `to_json`
|
481
|
+
#
|
482
|
+
def self.json_create: (Hash[String, String | Array[String] | nil] object) -> instance
|
483
|
+
|
484
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
485
|
+
# object.
|
486
|
+
#
|
487
|
+
def as_json: (*untyped) -> Hash[String, String | Array[String] | nil]
|
488
|
+
|
489
|
+
# Stores class name (Exception) with message `m` and backtrace array `b` as JSON
|
490
|
+
# string
|
491
|
+
#
|
492
|
+
def to_json: (?JSON::State state) -> String
|
493
|
+
end
|
494
|
+
|
495
|
+
class OpenStruct
|
496
|
+
# Deserializes JSON string by constructing new Struct object with values `t`
|
497
|
+
# serialized by `to_json`.
|
498
|
+
#
|
499
|
+
def self.json_create: (Hash[String, String | Hash[Symbol, untyped]] object) -> instance
|
500
|
+
|
501
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
502
|
+
# object.
|
503
|
+
#
|
504
|
+
def as_json: (*untyped) -> Hash[String, String | Hash[Symbol, untyped]]
|
505
|
+
|
506
|
+
# Stores class name (OpenStruct) with this struct's values `t` as a JSON string.
|
507
|
+
#
|
508
|
+
def to_json: (?JSON::State state) -> String
|
509
|
+
end
|
510
|
+
|
511
|
+
class Range[out Elem]
|
512
|
+
# Deserializes JSON string by constructing new Range object with arguments `a`
|
513
|
+
# serialized by `to_json`.
|
514
|
+
#
|
515
|
+
def self.json_create: (Hash[String, String | [Elem, Elem, bool]] object) -> instance
|
516
|
+
|
517
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
518
|
+
# object.
|
519
|
+
#
|
520
|
+
def as_json: (*untyped) -> Hash[String, String | [Elem, Elem, bool]]
|
521
|
+
|
522
|
+
# Stores class name (Range) with JSON array of arguments `a` which include
|
523
|
+
# `first` (integer), `last` (integer), and `exclude_end?` (boolean) as JSON
|
524
|
+
# string.
|
525
|
+
#
|
526
|
+
def to_json: (?JSON::State state) -> String
|
527
|
+
end
|
528
|
+
|
529
|
+
class Rational
|
530
|
+
# Deserializes JSON string by converting numerator value `n`, denominator value
|
531
|
+
# `d`, to a Rational object.
|
532
|
+
#
|
533
|
+
def self.json_create: (Hash[String, String | Integer] object) -> instance
|
534
|
+
|
535
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
536
|
+
# object.
|
537
|
+
#
|
538
|
+
def as_json: (*untyped) -> Hash[String, String | Integer]
|
539
|
+
|
540
|
+
# Stores class name (Rational) along with numerator value `n` and denominator
|
541
|
+
# value `d` as JSON string
|
542
|
+
#
|
543
|
+
def to_json: (?JSON::State state) -> String
|
544
|
+
end
|
545
|
+
|
546
|
+
class Regexp
|
547
|
+
# Deserializes JSON string by constructing new Regexp object with source `s`
|
548
|
+
# (Regexp or String) and options `o` serialized by `to_json`
|
549
|
+
#
|
550
|
+
def self.json_create: (Hash[String, String | Integer] object) -> instance
|
551
|
+
|
552
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
553
|
+
# object.
|
554
|
+
#
|
555
|
+
def as_json: (*untyped) -> Hash[String, String | Integer]
|
556
|
+
|
557
|
+
# Stores class name (Regexp) with options `o` and source `s` (Regexp or String)
|
558
|
+
# as JSON string
|
559
|
+
#
|
560
|
+
def to_json: (?JSON::State state) -> String
|
561
|
+
end
|
562
|
+
|
563
|
+
class Set[A]
|
564
|
+
# Import a JSON Marshalled object.
|
565
|
+
#
|
566
|
+
# method used for JSON marshalling support.
|
567
|
+
#
|
568
|
+
def self.json_create: (Hash[String, String | Array[A]] object) -> instance
|
569
|
+
|
570
|
+
# Marshal the object to JSON.
|
571
|
+
#
|
572
|
+
# method used for JSON marshalling support.
|
573
|
+
#
|
574
|
+
def as_json: (*untyped) -> Hash[String, String | Array[A]]
|
575
|
+
|
576
|
+
# return the JSON value
|
577
|
+
#
|
578
|
+
def to_json: (?JSON::State state) -> String
|
579
|
+
end
|
580
|
+
|
581
|
+
class Struct[Elem]
|
582
|
+
# Deserializes JSON string by constructing new Struct object with values `v`
|
583
|
+
# serialized by `to_json`.
|
584
|
+
#
|
585
|
+
def self.json_create: (Hash[String, String | Array[Elem]] object) -> instance
|
586
|
+
|
587
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
588
|
+
# object.
|
589
|
+
#
|
590
|
+
def as_json: (*untyped) -> Hash[String, String | Array[Elem]]
|
591
|
+
|
592
|
+
# Stores class name (Struct) with Struct values `v` as a JSON string. Only named
|
593
|
+
# structs are supported.
|
594
|
+
#
|
595
|
+
def to_json: (?JSON::State state) -> String
|
596
|
+
end
|
597
|
+
|
598
|
+
class Symbol
|
599
|
+
# Deserializes JSON string by converting the `string` value stored in the object
|
600
|
+
# to a Symbol
|
601
|
+
#
|
602
|
+
def self.json_create: (Hash[String, String] object) -> instance
|
603
|
+
|
604
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
605
|
+
# object.
|
606
|
+
#
|
607
|
+
def as_json: (*untyped) -> Hash[String, String]
|
608
|
+
|
609
|
+
# Stores class name (Symbol) with String representation of Symbol as a JSON
|
610
|
+
# string.
|
611
|
+
#
|
612
|
+
def to_json: (?JSON::State state) -> String
|
613
|
+
end
|
614
|
+
|
615
|
+
class Time
|
616
|
+
# Deserializes JSON string by converting time since epoch to Time
|
617
|
+
#
|
618
|
+
def self.json_create: (Hash[String, String | Integer] object) -> instance
|
619
|
+
|
620
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
621
|
+
# object.
|
622
|
+
#
|
623
|
+
def as_json: (*untyped) -> Hash[String, String | Integer]
|
624
|
+
|
625
|
+
# Stores class name (Time) with number of seconds since epoch and number of
|
626
|
+
# microseconds for Time as JSON string
|
627
|
+
#
|
628
|
+
def to_json: (?JSON::State state) -> String
|
629
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soutaro Matsumoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: RBS is the language for type signatures for Ruby and standard library
|
14
14
|
definitions.
|