rr 3.0.1 → 3.0.2

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: 4e2a905bf3c98b578d3101fc481f77bfc04fe12f66ddbeaaf5c199203400b039
4
- data.tar.gz: e8f43656c3148894baa0b947838e094ebd2c08bb821ccc325b6a7b43c2e4479d
3
+ metadata.gz: 2b7ca60f4fec0c9f87e1710f6b7faf5ed8a1d52d6c8dd7a8ba82667c1ba920d7
4
+ data.tar.gz: 8c80f469725cc6875ea30384439dc6347e2c998f042c9522eb2c8964a9f7f316
5
5
  SHA512:
6
- metadata.gz: 36c98f63746b65919ea471b3bf860edc647252e9eeaf1ffee4cc61be124dc82dc145de13fda8d4ff49efba4e7476b1c6a999d059a9ce1e6bc1d8eb1088f31079
7
- data.tar.gz: 9c7a00c6899824ae9e807c62ccb81efb07a37b7ed78ab368551a24e36c98732539cd111090826995925543aa52c504f8abec2eadbcc9cc81cdfedac98cbb11f4
6
+ metadata.gz: '07490a4037a941546b5b8c2139520d3c0d91d752a73e59cc52ef1bdae2ba2b0579deb57cd202db69eb96b67f89a5c5533699a0f6d439a787f8c999cf10f5bf7d'
7
+ data.tar.gz: '094e48f18e353e818ed21492f95fdc9fb15c23d01ae17689e0c044f86e6282736a73622451633daf88b04602f31b2848a84996cdd62965be717187dcc1f36b08'
data/CHANGES.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.2 - 2021-06-18
4
+
5
+ ### Improvements
6
+
7
+ * `stub`: Added support for Ruby 3.0's keyword arguments.
8
+ [GitHub#82][Reported by akira yamada]
9
+
10
+ ### Thanks
11
+
12
+ * akira yamada
13
+
3
14
  ## 3.0.1 - 2021-06-18
4
15
 
5
16
  ### Improvements
@@ -137,14 +137,25 @@ module RR
137
137
  id = BoundObjects.size
138
138
  BoundObjects[id] = subject_class
139
139
 
140
- subject_class.class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
141
- def #{method_name}(*args, &block)
142
- ::RR::Injections::DoubleInjection::BoundObjects[#{id}].class_eval do
143
- remove_method(:#{method_name})
140
+ if KeywordArguments.fully_supported?
141
+ subject_class.class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
142
+ def #{method_name}(*args, **kwargs, &block)
143
+ ::RR::Injections::DoubleInjection::BoundObjects[#{id}].class_eval do
144
+ remove_method(:#{method_name})
145
+ end
146
+ method_missing(:#{method_name}, *args, **kwargs, &block)
144
147
  end
145
- method_missing(:#{method_name}, *args, &block)
146
- end
147
- RUBY
148
+ RUBY
149
+ else
150
+ subject_class.class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
151
+ def #{method_name}(*args, &block)
152
+ ::RR::Injections::DoubleInjection::BoundObjects[#{id}].class_eval do
153
+ remove_method(:#{method_name})
154
+ end
155
+ method_missing(:#{method_name}, *args, &block)
156
+ end
157
+ RUBY
158
+ end
148
159
  self
149
160
  end
150
161
 
data/lib/rr/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module RR
2
- VERSION = '3.0.1'.freeze
2
+ VERSION = '3.0.2'.freeze
3
3
  def self.version; VERSION; end
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rr
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-06-17 00:00:00.000000000 Z
13
+ date: 2021-06-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler