rspec-support 3.10.2 → 3.10.3

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: f7b30f3003419ac0253a0804a457ff3d9fc97309c7eafb345aa9e94e379352d8
4
- data.tar.gz: fbacd747f72cb8bc4e06af5559e48150065d0a32580c73744dcc2355c2f6aa9b
3
+ metadata.gz: a580b5b26cfb56a1e613cad6616ec21a00199d740d6a8bb8397f4b611ec9e4fc
4
+ data.tar.gz: f2e5766d860651df933ded46383ca9ad84a827da16adb32d5c929eb339d9795c
5
5
  SHA512:
6
- metadata.gz: eb71f6ad88d243a87719fb8aa5f7ba383f090920d8bb3df0b2da859d07d99fc9e3641f92ef6b94ee68d216b7056667406bd216256c35a8db72a62bd6f81d993c
7
- data.tar.gz: 07eae42126cc684e1c925bed6a19c1137522a7e5a694ed16cae8162fa166737d9266d3d22f32088789f062e4892f4203aa996c0d1c0dc11efe927c0e34188085
6
+ metadata.gz: bd34bd2968390c78df88c9f573b4b7b2ad9b5952d8ea8735c5bedcc16327daaae650f41dfeb880068064c838959b0c61a4e5f05daa77076597992f04ac26c515
7
+ data.tar.gz: 5459f5188f8e7533ded56ba86c6b39ad6a89aeadee363f365aea08337affaed2c81b1bfd8e4c5c8a62397113d53c037ea6ec2fb8ba4922ec5e60b4e1b945b201
checksums.yaml.gz.sig CHANGED
Binary file
data/Changelog.md CHANGED
@@ -1,3 +1,13 @@
1
+ ### 3.10.3 / 2021-11-03
2
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.2...v3.10.3)
3
+
4
+ Bug Fixes:
5
+
6
+ * Use `Mutex#owned?` to allow `RSpec::Support::ReentrantMutex` to work in
7
+ nested Fibers on Ruby 3.0 and later. (Benoit Daloze, #503, #504)
8
+ * Support `end`-less methods in `RSpec::Support::Source::Token`
9
+ so that RSpec won't hang when an `end`-less method raises an error. (Yuji Nakayama, #505)
10
+
1
11
  ### 3.10.2 / 2021-01-28
2
12
  [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.10.1...v3.10.2)
3
13
 
@@ -27,17 +27,34 @@ module RSpec
27
27
 
28
28
  private
29
29
 
30
- def enter
31
- @mutex.lock if @owner != Thread.current
32
- @owner = Thread.current
33
- @count += 1
34
- end
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
- def exit
37
- @count -= 1
38
- return unless @count == 0
39
- @owner = nil
40
- @mutex.unlock
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
- closed_by_delimiter?(other) || closed_by_keyword?(other)
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 closed_by_delimiter?(other)
80
+ def delimiter_closed_by?(other)
77
81
  other.type == CLOSING_TYPES_BY_OPENING_TYPE[type]
78
82
  end
79
83
 
80
- def closed_by_keyword?(other)
81
- return false unless other.keyword?
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
@@ -1,7 +1,7 @@
1
1
  module RSpec
2
2
  module Support
3
3
  module Version
4
- STRING = '3.10.2'
4
+ STRING = '3.10.3'
5
5
  end
6
6
  end
7
7
  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.10.2
4
+ version: 3.10.3
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: 2021-01-28 00:00:00.000000000 Z
51
+ date: 2021-11-03 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.10.2/Changelog.md
128
+ changelog_uri: https://github.com/rspec/rspec-support/blob/v3.10.3/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.2.4
148
+ rubygems_version: 3.2.22
149
149
  signing_key:
150
150
  specification_version: 4
151
- summary: rspec-support-3.10.2
151
+ summary: rspec-support-3.10.3
152
152
  test_files: []
metadata.gz.sig CHANGED
Binary file