rbs 0.18.1 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e206f65853958ab46b6893d2c8b631676a82bd3eb62ea2f6f0f5c19bef2ce2a0
4
- data.tar.gz: 502bdf2a7ccc7578b3cfe816cfcae57a84677e4da171204d82e5e8f7c9f71091
3
+ metadata.gz: 8305afa064e98cd22b78a49fb402692abed204c735a7ce05d90f6a48d7bd6b96
4
+ data.tar.gz: 7840d67b2bbd54eb041342e093892b6d1046b21b6655b80eba109df6b773451d
5
5
  SHA512:
6
- metadata.gz: 6665849050b6ef83c7d9d4f4fb32a712b96a5afb38bb236d7749f5e55bebc939ca08f04251ab1af482f2a090bd285d12ae421593076bcdc53fffedccb6e31d9e
7
- data.tar.gz: ff18d27e825dfbddafba1f6b493fbeee50e47274fcf47fad33db55e69e4edc72f25ed9a24449217178ca3d279079f5a8216440080104f147d62e9bccc67926d7
6
+ metadata.gz: 4919d1fd1323fa5cb2c40f89f5338d2168d3ae4fcabed2e2c428b3e5b4bacda2e395e9dfb2fc52a6517e75137358118b4142b330f607f77c162f259485ac0b13
7
+ data.tar.gz: dc36b905d8c746eb5e976f6f3fc4a06ba8ed2b037d15d73e8bfa4360497c9c814f44dd604981f7c3622002ef0bb603b1b9374e2f49ab0af67bc35ecbe2d7b26e
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.19.0 (2020-12-02)
6
+
7
+ * Signature updates for `Monitor` and File ([#485](https://github.com/ruby/rbs/pull/485), [#495](https://github.com/ruby/rbs/pull/495))
8
+
5
9
  ## 0.18.1 (2020-12-01)
6
10
 
7
11
  * Fix `EnvironmentWalker#each_type_name` ([#494](https://github.com/ruby/rbs/pull/494))
@@ -192,10 +192,6 @@ class File < IO
192
192
  #
193
193
  def self.exist?: (string | _ToPath | IO file_name) -> bool
194
194
 
195
- # Deprecated method. Don't use.
196
- #
197
- alias self.exists? self.exist?
198
-
199
195
  # Converts a pathname to an absolute pathname. Relative paths are referenced
200
196
  # from the current working directory of the process unless `dir_string` is
201
197
  # given, in which case it will be used as the starting point. The given pathname
@@ -1,3 +1,3 @@
1
1
  module RBS
2
- VERSION = "0.18.1"
2
+ VERSION = "0.19.0"
3
3
  end
@@ -0,0 +1,119 @@
1
+ # Use the Monitor class when you want to have a lock object for blocks with
2
+ # mutual exclusion.
3
+ #
4
+ # require 'monitor'
5
+ #
6
+ # lock = Monitor.new
7
+ # lock.synchronize do
8
+ # # exclusive access
9
+ # end
10
+ class Monitor
11
+ public
12
+
13
+ def enter: () -> nil
14
+
15
+ def exit: () -> nil
16
+
17
+ def mon_check_owner: () -> nil
18
+
19
+ alias mon_enter enter
20
+
21
+ alias mon_exit exit
22
+
23
+ def mon_locked?: () -> bool
24
+
25
+ def mon_owned?: () -> bool
26
+
27
+ alias mon_synchronize synchronize
28
+
29
+ alias mon_try_enter try_enter
30
+
31
+ def new_cond: () -> ::MonitorMixin::ConditionVariable
32
+
33
+ def synchronize: [T] () { () -> T } -> T
34
+
35
+ def try_enter: () -> bool
36
+
37
+ # for compatibility
38
+ alias try_mon_enter try_enter
39
+
40
+ def wait_for_cond: (::MonitorMixin::ConditionVariable, Numeric? timeout) -> untyped
41
+ end
42
+
43
+ module MonitorMixin
44
+ def self.extend_object: (untyped obj) -> untyped
45
+
46
+ public
47
+
48
+ # Enters exclusive section.
49
+ def mon_enter: () -> nil
50
+
51
+ # Leaves exclusive section.
52
+ def mon_exit: () -> nil
53
+
54
+ # Returns true if this monitor is locked by any thread
55
+ def mon_locked?: () -> bool
56
+
57
+ # Returns true if this monitor is locked by current thread.
58
+ def mon_owned?: () -> bool
59
+
60
+ # Enters exclusive section and executes the block. Leaves the exclusive section
61
+ # automatically when the block exits. See example under `MonitorMixin`.
62
+ def mon_synchronize: [T] () { () -> T } -> T
63
+
64
+ # Attempts to enter exclusive section. Returns `false` if lock fails.
65
+ def mon_try_enter: () -> bool
66
+
67
+ # Creates a new MonitorMixin::ConditionVariable associated with the Monitor
68
+ # object.
69
+ def new_cond: () -> ::MonitorMixin::ConditionVariable
70
+
71
+ alias synchronize mon_synchronize
72
+
73
+ # For backward compatibility
74
+ alias try_mon_enter mon_try_enter
75
+
76
+ private
77
+
78
+ # Use `extend MonitorMixin` or `include MonitorMixin` instead of this
79
+ # constructor. Have look at the examples above to understand how to use this
80
+ # module.
81
+ def initialize: (*untyped) { (*untyped) -> untyped } -> void
82
+
83
+ def mon_check_owner: () -> nil
84
+
85
+ # Initializes the MonitorMixin after being included in a class or when an object
86
+ # has been extended with the MonitorMixin
87
+ def mon_initialize: () -> untyped
88
+ end
89
+
90
+ # FIXME: This isn't documented in Nutshell.
91
+ #
92
+ # Since MonitorMixin.new_cond returns a ConditionVariable, and the example above
93
+ # calls while_wait and signal, this class should be documented.
94
+ class MonitorMixin::ConditionVariable
95
+ public
96
+
97
+ # Wakes up all threads waiting for this lock.
98
+ def broadcast: () -> Thread::ConditionVariable
99
+
100
+ # Wakes up the first thread in line waiting for this lock.
101
+ def signal: () -> Thread::ConditionVariable
102
+
103
+ # Releases the lock held in the associated monitor and waits; reacquires the
104
+ # lock on wakeup.
105
+ #
106
+ # If `timeout` is given, this method returns after `timeout` seconds passed,
107
+ # even if no other thread doesn't signal.
108
+ def wait: (?Numeric? timeout) -> untyped
109
+
110
+ # Calls wait repeatedly until the given block yields a truthy value.
111
+ def wait_until: () { () -> boolish } -> untyped
112
+
113
+ # Calls wait repeatedly while the given block yields a truthy value.
114
+ def wait_while: () { () -> boolish } -> untyped
115
+
116
+ private
117
+
118
+ def initialize: (Monitor monitor) -> void
119
+ 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: 0.18.1
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-01 00:00:00.000000000 Z
11
+ date: 2020-12-02 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.
@@ -206,6 +206,7 @@ files:
206
206
  - stdlib/logger/0/logger.rbs
207
207
  - stdlib/logger/0/period.rbs
208
208
  - stdlib/logger/0/severity.rbs
209
+ - stdlib/monitor/0/monitor.rbs
209
210
  - stdlib/mutex_m/0/mutex_m.rbs
210
211
  - stdlib/pathname/0/pathname.rbs
211
212
  - stdlib/prime/0/integer-extension.rbs
@@ -253,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
254
  - !ruby/object:Gem::Version
254
255
  version: '0'
255
256
  requirements: []
256
- rubygems_version: 3.2.0.rc.2
257
+ rubygems_version: 3.1.2
257
258
  signing_key:
258
259
  specification_version: 4
259
260
  summary: Type signature for Ruby.