rspec-support 3.10.2 → 3.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/Changelog.md +18 -0
- data/README.md +1 -1
- data/lib/rspec/support/reentrant_mutex.rb +27 -10
- data/lib/rspec/support/source/token.rb +12 -5
- data/lib/rspec/support/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +5 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15b095a31f89b4f715f85a98def34e8d8e401552aa3cbdd8e41e97229acaa7a3
|
4
|
+
data.tar.gz: 7e038fa362d523cc2b271357fd777624479e4952327d286261d3b5d6e503f664
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 631144fe2de1984bb09db168acbee96186e9709838f4a3c963d083007da80a529c45db2e80890548f78a07e8c190e374b1a40f669d0ca24c0d15030c306698ec
|
7
|
+
data.tar.gz: e9ecd3254c12547501b1bf973e56bc818189ffe979394603cad8fbbaf6b653b5ac51819ba50fb0df555e473f968f55b7359f8f77d38b36ee0b6ee0f2a96c8b00
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
### Development
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.11.0...3-11-maintenance)
|
3
|
+
|
4
|
+
### 3.11.0 / 2022-02-09
|
5
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.3...v3.11.0)
|
6
|
+
|
7
|
+
No changes. Released to support other RSpec releases.
|
8
|
+
|
9
|
+
### 3.10.3 / 2021-11-03
|
10
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.2...v3.10.3)
|
11
|
+
|
12
|
+
Bug Fixes:
|
13
|
+
|
14
|
+
* Use `Mutex#owned?` to allow `RSpec::Support::ReentrantMutex` to work in
|
15
|
+
nested Fibers on Ruby 3.0 and later. (Benoit Daloze, #503, #504)
|
16
|
+
* Support `end`-less methods in `RSpec::Support::Source::Token`
|
17
|
+
so that RSpec won't hang when an `end`-less method raises an error. (Yuji Nakayama, #505)
|
18
|
+
|
1
19
|
### 3.10.2 / 2021-01-28
|
2
20
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.1...v3.10.2)
|
3
21
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# RSpec::Support [![Build Status](https://github.com/rspec/rspec-support/workflows/RSpec%20CI/badge.svg
|
1
|
+
# RSpec::Support [![Build Status](https://github.com/rspec/rspec-support/workflows/RSpec%20CI/badge.svg)](https://github.com/rspec/rspec-support/actions)
|
2
2
|
|
3
3
|
`RSpec::Support` provides common functionality to `RSpec::Core`,
|
4
4
|
`RSpec::Expectations` and `RSpec::Mocks`. It is considered
|
@@ -27,17 +27,34 @@ module RSpec
|
|
27
27
|
|
28
28
|
private
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
# This is fixing a bug #501 that is specific to Ruby 3.0. The new implementation
|
31
|
+
# depends on `owned?` that was introduced in Ruby 2.0, so both should work for Ruby 2.x.
|
32
|
+
if RUBY_VERSION.to_f >= 3.0
|
33
|
+
def enter
|
34
|
+
@mutex.lock unless @mutex.owned?
|
35
|
+
@count += 1
|
36
|
+
end
|
35
37
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
def exit
|
39
|
+
unless @mutex.owned?
|
40
|
+
raise ThreadError, "Attempt to unlock a mutex which is locked by another thread/fiber"
|
41
|
+
end
|
42
|
+
@count -= 1
|
43
|
+
@mutex.unlock if @count == 0
|
44
|
+
end
|
45
|
+
else
|
46
|
+
def enter
|
47
|
+
@mutex.lock if @owner != Thread.current
|
48
|
+
@owner = Thread.current
|
49
|
+
@count += 1
|
50
|
+
end
|
51
|
+
|
52
|
+
def exit
|
53
|
+
@count -= 1
|
54
|
+
return unless @count == 0
|
55
|
+
@owner = nil
|
56
|
+
@mutex.unlock
|
57
|
+
end
|
41
58
|
end
|
42
59
|
end
|
43
60
|
|
@@ -54,12 +54,16 @@ module RSpec
|
|
54
54
|
type == :on_kw
|
55
55
|
end
|
56
56
|
|
57
|
+
def equals_operator?
|
58
|
+
type == :on_op && string == '='
|
59
|
+
end
|
60
|
+
|
57
61
|
def opening?
|
58
62
|
opening_delimiter? || opening_keyword?
|
59
63
|
end
|
60
64
|
|
61
65
|
def closed_by?(other)
|
62
|
-
|
66
|
+
delimiter_closed_by?(other) || keyword_closed_by?(other)
|
63
67
|
end
|
64
68
|
|
65
69
|
private
|
@@ -73,13 +77,16 @@ module RSpec
|
|
73
77
|
CLOSING_KEYWORDS_BY_OPENING_KEYWORD.key?(string)
|
74
78
|
end
|
75
79
|
|
76
|
-
def
|
80
|
+
def delimiter_closed_by?(other)
|
77
81
|
other.type == CLOSING_TYPES_BY_OPENING_TYPE[type]
|
78
82
|
end
|
79
83
|
|
80
|
-
def
|
81
|
-
return false unless
|
82
|
-
other.string == CLOSING_KEYWORDS_BY_OPENING_KEYWORD[string]
|
84
|
+
def keyword_closed_by?(other)
|
85
|
+
return false unless keyword?
|
86
|
+
return true if other.string == CLOSING_KEYWORDS_BY_OPENING_KEYWORD[string]
|
87
|
+
|
88
|
+
# Ruby 3's `end`-less method definition: `def method_name = body`
|
89
|
+
string == 'def' && other.equals_operator? && location.line == other.location.line
|
83
90
|
end
|
84
91
|
end
|
85
92
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chelimsky
|
@@ -48,7 +48,7 @@ cert_chain:
|
|
48
48
|
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
49
49
|
F3MdtaDehhjC
|
50
50
|
-----END CERTIFICATE-----
|
51
|
-
date:
|
51
|
+
date: 2022-02-09 00:00:00.000000000 Z
|
52
52
|
dependencies:
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: rake
|
@@ -125,7 +125,7 @@ licenses:
|
|
125
125
|
- MIT
|
126
126
|
metadata:
|
127
127
|
bug_tracker_uri: https://github.com/rspec/rspec-support/issues
|
128
|
-
changelog_uri: https://github.com/rspec/rspec-support/blob/v3.
|
128
|
+
changelog_uri: https://github.com/rspec/rspec-support/blob/v3.11.0/Changelog.md
|
129
129
|
documentation_uri: https://rspec.info/documentation/
|
130
130
|
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
131
131
|
source_code_uri: https://github.com/rspec/rspec-support
|
@@ -145,8 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
148
|
+
rubygems_version: 3.3.3
|
149
149
|
signing_key:
|
150
150
|
specification_version: 4
|
151
|
-
summary: rspec-support-3.
|
151
|
+
summary: rspec-support-3.11.0
|
152
152
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|