evt-mimic 2.3.1.0 → 2.3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mimic/controls/subject/delegated_parameters.rb +12 -0
- data/lib/mimic/controls/subject.rb +5 -0
- data/lib/mimic/controls.rb +1 -0
- data/lib/mimic/define_methods.rb +15 -3
- data/lib/mimic/mimic.rb +1 -1
- data/lib/mimic/predicates/method/parameters.rb +24 -0
- data/lib/mimic/subject_methods.rb +2 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e914127f63af9cf5a3f1eaf9bbe106e95cc390241cf1bfb34e5f7f30312e91f
|
4
|
+
data.tar.gz: 59f35d69cddfb389232537da6857be6c4d2a980172c9dd8021384017e503de10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 558016928680a0aa153522429c38e7f25f662a8f2cdcdb41f9820b8d7e7a4181378d8a3ac91438f7e2f8bb44ccbeea49664fe41f42445717a1b21e5bc049cea4
|
7
|
+
data.tar.gz: 553605c025140b601baa51e0b9b75304a0e8f2905e828c5efd724220af21ef7b7a258889e64bf818a0cc5833a992b895edc6097ea34c5fc2dc7d6d62bcc07372
|
data/lib/mimic/controls.rb
CHANGED
@@ -8,6 +8,7 @@ require 'mimic/controls/subject/block_parameter'
|
|
8
8
|
require 'mimic/controls/subject/multiple_assignment_parameter'
|
9
9
|
require 'mimic/controls/subject/multiple_assignment_named_parameter'
|
10
10
|
require 'mimic/controls/subject/mixed_parameters'
|
11
|
+
require 'mimic/controls/subject/delegated_parameters'
|
11
12
|
require 'mimic/controls/invocation'
|
12
13
|
require 'mimic/controls/recorder'
|
13
14
|
require 'mimic/controls/mimic'
|
data/lib/mimic/define_methods.rb
CHANGED
@@ -55,11 +55,23 @@ module Mimic
|
|
55
55
|
when :keyreq
|
56
56
|
return "#{name}:"
|
57
57
|
when :rest
|
58
|
-
|
58
|
+
if name == :*
|
59
|
+
return "*"
|
60
|
+
else
|
61
|
+
return "*#{name}"
|
62
|
+
end
|
59
63
|
when :keyrest
|
60
|
-
|
64
|
+
if name == :**
|
65
|
+
return "**"
|
66
|
+
else
|
67
|
+
return "**#{name}"
|
68
|
+
end
|
61
69
|
when :block
|
62
|
-
|
70
|
+
if name == :&
|
71
|
+
return "&"
|
72
|
+
else
|
73
|
+
return "&#{name}"
|
74
|
+
end
|
63
75
|
else
|
64
76
|
raise Error, "Unknown parameter type (Name: #{name.inspect}, Type: #{type.inspect})"
|
65
77
|
end
|
data/lib/mimic/mimic.rb
CHANGED
@@ -22,6 +22,30 @@ module Mimic
|
|
22
22
|
|
23
23
|
compare_parameters == control_parameters
|
24
24
|
end
|
25
|
+
|
26
|
+
def self.types_equal?(compare, control, method_name)
|
27
|
+
control_method = control.method(method_name)
|
28
|
+
|
29
|
+
control_parameters = control_method.parameters
|
30
|
+
control_parameter_types = control_parameters.map(&:first)
|
31
|
+
|
32
|
+
compare_method = compare.method(method_name)
|
33
|
+
|
34
|
+
compare_parameters = compare_method.parameters
|
35
|
+
compare_parameter_types = compare_parameters.map(&:first)
|
36
|
+
|
37
|
+
if ENV['VERBOSE'] == 'on'
|
38
|
+
puts "Control: #{control.class}"
|
39
|
+
pp control_parameter_types
|
40
|
+
|
41
|
+
puts
|
42
|
+
|
43
|
+
puts "Compare: #{compare.class}"
|
44
|
+
pp compare_parameter_types
|
45
|
+
end
|
46
|
+
|
47
|
+
compare_parameter_types == control_parameter_types
|
48
|
+
end
|
25
49
|
end
|
26
50
|
end
|
27
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-mimic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.1.
|
4
|
+
version: 2.3.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-invocation
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- lib/mimic/controls/recorder.rb
|
54
54
|
- lib/mimic/controls/subject.rb
|
55
55
|
- lib/mimic/controls/subject/block_parameter.rb
|
56
|
+
- lib/mimic/controls/subject/delegated_parameters.rb
|
56
57
|
- lib/mimic/controls/subject/keyword_parameters.rb
|
57
58
|
- lib/mimic/controls/subject/mixed_parameters.rb
|
58
59
|
- lib/mimic/controls/subject/multiple_assignment_named_parameter.rb
|
@@ -74,7 +75,7 @@ homepage: https://github.com/eventide-project/mimic
|
|
74
75
|
licenses:
|
75
76
|
- MIT
|
76
77
|
metadata: {}
|
77
|
-
post_install_message:
|
78
|
+
post_install_message:
|
78
79
|
rdoc_options: []
|
79
80
|
require_paths:
|
80
81
|
- lib
|
@@ -89,8 +90,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
90
|
- !ruby/object:Gem::Version
|
90
91
|
version: '0'
|
91
92
|
requirements: []
|
92
|
-
rubygems_version: 3.
|
93
|
-
signing_key:
|
93
|
+
rubygems_version: 3.3.3
|
94
|
+
signing_key:
|
94
95
|
specification_version: 4
|
95
96
|
summary: Copy a class's instance interface to an anonymous, new object that acts as
|
96
97
|
a substitutable mimic for the class
|