rbs 1.4.0 → 1.5.0
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 +12 -0
- data/Gemfile +1 -0
- data/core/builtin.rbs +1 -1
- data/core/file.rbs +3 -1
- data/core/global_variables.rbs +3 -3
- data/core/io/wait.rbs +37 -0
- data/core/io.rbs +4 -4
- data/core/ractor.rbs +779 -0
- data/core/string_io.rbs +3 -5
- data/lib/rbs/version.rb +1 -1
- data/stdlib/digest/0/digest.rbs +418 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 461e236c7a74ee03996267e889af1db65986af4ea1a9a3d258f9e84b23587182
|
4
|
+
data.tar.gz: 53196811eeefb96f59d641d8a3c359fa2f84c43513dbc5eb46fa872b006147af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f7e1f726bda298d0186a9cdc106835ff35baa82aef50c0177ca2d66dea051a21fb499694c56e0910b5e543ccf029f53c349d0f2d4c1e7b89462e78c099ccf32
|
7
|
+
data.tar.gz: 90d95f9ff0087ef339dc777e8db736ec849869842046f79e1e6a41eb56ed9826eeddb94ec06185f80abf04130dc98690f72697f9ad201468717b006d0d9a7781
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,18 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 1.5.0 (2021-08-22)
|
6
|
+
|
7
|
+
This release includes stdlib signature updates.
|
8
|
+
|
9
|
+
### Signature updates
|
10
|
+
|
11
|
+
* digest ([\#744](https://github.com/ruby/rbs/pull/744), [\#757](https://github.com/ruby/rbs/pull/757))
|
12
|
+
* io-wait ([\#756](https://github.com/ruby/rbs/pull/756), [\#758](https://github.com/ruby/rbs/pull/758))
|
13
|
+
* `Ractor` ([\#755](https://github.com/ruby/rbs/pull/755))
|
14
|
+
* `File::Stat#size?` ([\#754](https://github.com/ruby/rbs/pull/754))
|
15
|
+
* `$-i`, `$0`, `$PROGRAM_NAME` ([\#753](https://github.com/ruby/rbs/pull/753))
|
16
|
+
|
5
17
|
## 1.4.0 (2021-08-19)
|
6
18
|
|
7
19
|
This release includes feature enhancements including recursive `type` definition validation, improved compatibility of global variable names, and various method type updates.
|
data/Gemfile
CHANGED
data/core/builtin.rbs
CHANGED
data/core/file.rbs
CHANGED
@@ -1042,7 +1042,7 @@ class File::Stat < Object
|
|
1042
1042
|
|
1043
1043
|
def rdev_minor: () -> Integer
|
1044
1044
|
|
1045
|
-
def read: (?
|
1045
|
+
def read: (?int? length, ?string outbuf) -> String?
|
1046
1046
|
|
1047
1047
|
def readable?: () -> bool
|
1048
1048
|
|
@@ -1054,6 +1054,8 @@ class File::Stat < Object
|
|
1054
1054
|
|
1055
1055
|
def size: () -> Integer
|
1056
1056
|
|
1057
|
+
def size?: () -> Integer?
|
1058
|
+
|
1057
1059
|
def socket?: () -> bool
|
1058
1060
|
|
1059
1061
|
def sticky?: () -> bool
|
data/core/global_variables.rbs
CHANGED
@@ -48,7 +48,7 @@ $-a: bool
|
|
48
48
|
$-d: bool
|
49
49
|
|
50
50
|
# In in-place-edit mode, this variable holds the extension, otherwise +nil+.
|
51
|
-
$-i:
|
51
|
+
$-i: String?
|
52
52
|
|
53
53
|
# True if option <tt>-l</tt> is set. Read-only variable.
|
54
54
|
$-l: bool
|
@@ -74,7 +74,7 @@ $.: Integer
|
|
74
74
|
# The input record separator, newline by default. Aliased to $-0.
|
75
75
|
$/: String | nil
|
76
76
|
|
77
|
-
#
|
77
|
+
# Contains the name of the script being executed. May be assignable.
|
78
78
|
$0: String
|
79
79
|
|
80
80
|
# The Nth group of the last successful match. May be > 1.
|
@@ -149,7 +149,7 @@ $LOADED_FEATURES: Array[String]
|
|
149
149
|
# the path the original Kernel#require method would load.
|
150
150
|
$LOAD_PATH: Array[String]
|
151
151
|
|
152
|
-
#
|
152
|
+
# Contains the name of the script being executed. May be assignable.
|
153
153
|
$PROGRAM_NAME: String
|
154
154
|
|
155
155
|
# The verbose flag, which is set by the <tt>-w</tt> or <tt>-v</tt> switch.
|
data/core/io/wait.rbs
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
class IO
|
2
|
+
# Returns number of bytes that can be read without blocking. Returns zero if no
|
3
|
+
# information available.
|
4
|
+
#
|
5
|
+
def nread: () -> Integer
|
6
|
+
|
7
|
+
# Returns `true` if input available without blocking, or `false`.
|
8
|
+
#
|
9
|
+
def ready?: () -> boolish
|
10
|
+
|
11
|
+
# Waits until the IO becomes ready for the specified events and returns the
|
12
|
+
# subset of events that become ready, or `false` when times out.
|
13
|
+
#
|
14
|
+
# The events can be a bit mask of `IO::READABLE`, `IO::WRITABLE` or
|
15
|
+
# `IO::PRIORITY`.
|
16
|
+
#
|
17
|
+
# Returns `true` immediately when buffered data is available.
|
18
|
+
#
|
19
|
+
# Optional parameter `mode` is one of `:read`, `:write`, or `:read_write`
|
20
|
+
# (deprecated).
|
21
|
+
#
|
22
|
+
def wait: (Integer events, ?Numeric timeout) -> (self | bool | nil)
|
23
|
+
| (?Numeric timeout, *wait_mode mode) -> (self | bool | nil)
|
24
|
+
|
25
|
+
type wait_mode = :read | :r | :readable
|
26
|
+
| :write | :w | :writable
|
27
|
+
| :read_write | :rw | :readable_writable
|
28
|
+
|
29
|
+
# Waits until IO is readable and returns `true`, or `false` when times out.
|
30
|
+
# Returns `true` immediately when buffered data is available.
|
31
|
+
#
|
32
|
+
def wait_readable: (?Numeric timeout) -> (self | bool | nil)?
|
33
|
+
|
34
|
+
# Waits until IO is writable and returns `true` or `false` when times out.
|
35
|
+
#
|
36
|
+
def wait_writable: (?Numeric timeout) -> (self | bool | nil)?
|
37
|
+
end
|
data/core/io.rbs
CHANGED
@@ -532,10 +532,10 @@ class IO < Object
|
|
532
532
|
# need the behavior like a single read(2) system call, consider #readpartial,
|
533
533
|
# #read_nonblock, and #sysread.
|
534
534
|
#
|
535
|
-
def read: (?
|
535
|
+
def read: (?int? length, ?string outbuf) -> String?
|
536
536
|
|
537
|
-
def read_nonblock: (
|
538
|
-
| (
|
537
|
+
def read_nonblock: (int len, ?string buf, ?exception: true) -> String
|
538
|
+
| (int len, ?string buf, exception: false) -> (String | :wait_readable | nil)
|
539
539
|
|
540
540
|
# Reads a byte as with `IO#getbyte`, but raises an `EOFError` on end of
|
541
541
|
# file.
|
@@ -611,7 +611,7 @@ class IO < Object
|
|
611
611
|
# on the situation IO#sysread causes Errno::EWOULDBLOCK as if the fd is blocking
|
612
612
|
# mode.
|
613
613
|
#
|
614
|
-
def readpartial: (
|
614
|
+
def readpartial: (int maxlen, ?string outbuf) -> String
|
615
615
|
|
616
616
|
def reopen: (IO other_IO_or_path) -> IO
|
617
617
|
| (String other_IO_or_path, ?String mode_str) -> IO
|