rr 3.0.4 → 3.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +11 -0
- data/lib/rr/double_definitions/double_definition_create_blank_slate.rb +1 -0
- data/lib/rr/double_definitions/strategies/strategy.rb +0 -2
- data/lib/rr/injections/double_injection.rb +10 -19
- data/lib/rr/injections/method_missing_injection.rb +1 -0
- data/lib/rr/keyword_arguments.rb +1 -7
- data/lib/rr/method_dispatches/method_dispatch.rb +2 -2
- data/lib/rr/method_dispatches/method_missing_dispatch.rb +1 -1
- data/lib/rr/space.rb +1 -0
- data/lib/rr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d187dcfce0831255213627383d159a05f73412307407dc0b5a1771956780735
|
4
|
+
data.tar.gz: d85e6dbbdddc435ff00927e5892f2346ac1057cb48d2f21a2788d65be976b8e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc6bdb14cd6690ed0fd83da54c8165218647896e2bd505c882d2fbdfef424f069f7a67a95b481f5f382ccfde3625b87fbeb023abb70f17e8dd1788e88fb616c2
|
7
|
+
data.tar.gz: 13ce13bef3e88bb683083d2680176665368f8862742f956beabf23828a92a378ecadbd6c877f7d35f9e0cff6e84e98ba71450090cc0650e827f2107f3bf1f9ea
|
data/CHANGES.md
CHANGED
@@ -137,25 +137,15 @@ module RR
|
|
137
137
|
id = BoundObjects.size
|
138
138
|
BoundObjects[id] = subject_class
|
139
139
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
remove_method(:#{method_name})
|
145
|
-
end
|
146
|
-
method_missing(:#{method_name}, *args, **kwargs, &block)
|
147
|
-
end
|
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)
|
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})
|
156
144
|
end
|
157
|
-
|
158
|
-
|
145
|
+
method_missing(:#{method_name}, *args, &block)
|
146
|
+
end
|
147
|
+
ruby2_keywords(:#{method_name}) if respond_to?(:ruby2_keywords, true)
|
148
|
+
RUBY
|
159
149
|
self
|
160
150
|
end
|
161
151
|
|
@@ -163,7 +153,7 @@ module RR
|
|
163
153
|
id = BoundObjects.size
|
164
154
|
BoundObjects[id] = subject_class
|
165
155
|
|
166
|
-
if KeywordArguments.fully_supported?
|
156
|
+
if KeywordArguments.fully_supported?
|
167
157
|
subject_class.class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
|
168
158
|
def #{method_name}(*args, **kwargs, &block)
|
169
159
|
arguments = MethodArguments.new(args, kwargs, block)
|
@@ -192,6 +182,7 @@ module RR
|
|
192
182
|
arguments.block
|
193
183
|
)
|
194
184
|
end
|
185
|
+
ruby2_keywords(:#{method_name}) if respond_to?(:ruby2_keywords, true)
|
195
186
|
RUBY
|
196
187
|
end
|
197
188
|
self
|
data/lib/rr/keyword_arguments.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module RR
|
2
2
|
module KeywordArguments
|
3
3
|
class << self
|
4
|
-
if (RUBY_VERSION <=> "
|
4
|
+
if (RUBY_VERSION <=> "3.0.0") >= 0
|
5
5
|
def fully_supported?
|
6
6
|
true
|
7
7
|
end
|
@@ -10,12 +10,6 @@ module RR
|
|
10
10
|
false
|
11
11
|
end
|
12
12
|
end
|
13
|
-
|
14
|
-
def accept_kwargs?(subject_class, method_name)
|
15
|
-
subject_class.instance_method(method_name).parameters.any? { |t, _| t == :key || t == :keyrest }
|
16
|
-
rescue NameError
|
17
|
-
true
|
18
|
-
end
|
19
13
|
end
|
20
14
|
end
|
21
15
|
end
|
@@ -31,7 +31,7 @@ module RR
|
|
31
31
|
|
32
32
|
def call_original_method
|
33
33
|
if subject_has_original_method?
|
34
|
-
if KeywordArguments.fully_supported?
|
34
|
+
if KeywordArguments.fully_supported?
|
35
35
|
subject.__send__(original_method_alias_name, *args, **kwargs, &block)
|
36
36
|
else
|
37
37
|
subject.__send__(original_method_alias_name, *args, &block)
|
@@ -53,7 +53,7 @@ module RR
|
|
53
53
|
call_original_method
|
54
54
|
else
|
55
55
|
if implementation
|
56
|
-
if KeywordArguments.fully_supported?
|
56
|
+
if KeywordArguments.fully_supported?
|
57
57
|
implementation.call(*args, **kwargs, &block)
|
58
58
|
else
|
59
59
|
implementation.call(*args, &block)
|
@@ -52,7 +52,7 @@ module RR
|
|
52
52
|
if double_injection = Injections::DoubleInjection.find(subject_class, method_name)
|
53
53
|
double_injection.bind_method
|
54
54
|
# The DoubleInjection takes care of calling double.method_call
|
55
|
-
if KeywordArguments.fully_supported?
|
55
|
+
if KeywordArguments.fully_supported?
|
56
56
|
subject.__send__(method_name, *args, **kwargs, &block)
|
57
57
|
else
|
58
58
|
subject.__send__(method_name, *args, &block)
|
data/lib/rr/space.rb
CHANGED
data/lib/rr/version.rb
CHANGED
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.
|
4
|
+
version: 3.0.5
|
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-
|
13
|
+
date: 2021-06-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|