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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95cce12420df985da9b27a2bf3d3ca5e114e7d98241c783ee075023a5ba4ff70
4
- data.tar.gz: f9631baccd4415ca2fffd73d41543c2268c5cd7a0a68b2705c7c40ea0e3122d2
3
+ metadata.gz: 4e914127f63af9cf5a3f1eaf9bbe106e95cc390241cf1bfb34e5f7f30312e91f
4
+ data.tar.gz: 59f35d69cddfb389232537da6857be6c4d2a980172c9dd8021384017e503de10
5
5
  SHA512:
6
- metadata.gz: db0bcb20b68f0e76e8354d9559485e395141499a8cdca162706824b399afbff4b7d94ccba884a4a6c80bd29c96a26529f768e1bdac335e99dbf14115cd1c0300
7
- data.tar.gz: ec6c28a94bc800b4ca4d8138d09af8b06e7c42f1f0c0de68cc70eb9e387c0cf2bcf34927ed28a82736714c34c06bcb7062c55b4f2a9c332386083545ce15e5dd
6
+ metadata.gz: 558016928680a0aa153522429c38e7f25f662a8f2cdcdb41f9820b8d7e7a4181378d8a3ac91438f7e2f8bb44ccbeea49664fe41f42445717a1b21e5bc049cea4
7
+ data.tar.gz: 553605c025140b601baa51e0b9b75304a0e8f2905e828c5efd724220af21ef7b7a258889e64bf818a0cc5833a992b895edc6097ea34c5fc2dc7d6d62bcc07372
@@ -0,0 +1,12 @@
1
+ module Mimic
2
+ module Controls
3
+ module Subject
4
+ module DelegatedParameters
5
+ class Example
6
+ def some_method(...)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -17,6 +17,11 @@ module Mimic
17
17
  end
18
18
  end
19
19
 
20
+ class Initialized
21
+ def initialize(a)
22
+ end
23
+ end
24
+
20
25
  module Anonymous
21
26
  def self.example
22
27
  ::Class.new(Example)
@@ -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'
@@ -55,11 +55,23 @@ module Mimic
55
55
  when :keyreq
56
56
  return "#{name}:"
57
57
  when :rest
58
- return "*#{name}"
58
+ if name == :*
59
+ return "*"
60
+ else
61
+ return "*#{name}"
62
+ end
59
63
  when :keyrest
60
- return "**#{name}"
64
+ if name == :**
65
+ return "**"
66
+ else
67
+ return "**#{name}"
68
+ end
61
69
  when :block
62
- return "&#{name}"
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
@@ -1,6 +1,6 @@
1
1
  module Mimic
2
2
  def self.call(subject_class, record: nil, &blk)
3
3
  cls = Build.(subject_class, record: record, &blk)
4
- cls.new
4
+ cls.allocate
5
5
  end
6
6
  end
@@ -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
@@ -6,5 +6,7 @@ module Mimic
6
6
  instance_methods = instance_method_names.map do |method_name|
7
7
  cls.instance_method(method_name)
8
8
  end
9
+
10
+ instance_methods
9
11
  end
10
12
  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.0
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: 2019-12-10 00:00:00.000000000 Z
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.0.1
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