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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '019689814b3a1a5d0c1b88e2fc433acb328795f7b71c0a42889ac79bab50eb23'
4
- data.tar.gz: d7669d77ad9fcd0a211586b9f4cfcdeaee51c22d53c98f439da69a0321728021
3
+ metadata.gz: 461e236c7a74ee03996267e889af1db65986af4ea1a9a3d258f9e84b23587182
4
+ data.tar.gz: 53196811eeefb96f59d641d8a3c359fa2f84c43513dbc5eb46fa872b006147af
5
5
  SHA512:
6
- metadata.gz: 01101a55594365a082d5ed34ac6ca58e94ad79f275efb94e22cc381578755f210e14a984f77bc63c7eab118967c3f6774051b5c67a034ded2635a0081f19dc48
7
- data.tar.gz: 4ebe708ff34901816c8d0dfd012e9e68b7fe28e65b4a7c6101ef4f1ef284e9a44c103287f40f0f7582f93bda3f4b8a85a1c834dbff01a4b3758791d3b9388087
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
@@ -15,6 +15,7 @@ gem "json-schema"
15
15
  gem 'stackprof'
16
16
  gem "goodcheck"
17
17
  gem "dbm"
18
+ gem 'digest'
18
19
 
19
20
  # Test gems
20
21
  gem "rbs-amber", path: "test/assets/test-gem"
data/core/builtin.rbs CHANGED
@@ -31,7 +31,7 @@ interface _Each[out A]
31
31
  end
32
32
 
33
33
  interface _Reader
34
- def read: (?int length, ?string outbuf) -> String?
34
+ def read: (?int? length, ?string outbuf) -> String?
35
35
  end
36
36
 
37
37
  interface _ReaderPartial
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: (?Integer length, ?String outbuf) -> String
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
@@ -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: bool
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
- # The same as $!.backtrace.
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
- # The same as $!.backtrace.
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: (?Integer? length, ?String outbuf) -> String?
535
+ def read: (?int? length, ?string outbuf) -> String?
536
536
 
537
- def read_nonblock: (Integer len, ?String buf, ?exception: true) -> String
538
- | (Integer len, ?String buf, exception: false) -> (String | :wait_readable | nil)
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: (Integer maxlen, ?String outbuf) -> String
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