ae_easy-core 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/doc/AeEasy.html +1 -1
- data/doc/AeEasy/Core.html +67 -49
- data/doc/AeEasy/Core/Config.html +1 -1
- data/doc/AeEasy/Core/Exception.html +1 -1
- data/doc/AeEasy/Core/Exception/OutdatedError.html +1 -1
- data/doc/AeEasy/Core/Helper.html +1 -1
- data/doc/AeEasy/Core/Helper/Cookie.html +1 -1
- data/doc/AeEasy/Core/Mock.html +1 -1
- data/doc/AeEasy/Core/Mock/FakeDb.html +1 -1
- data/doc/AeEasy/Core/Mock/FakeExecutor.html +1 -1
- data/doc/AeEasy/Core/Mock/FakeParser.html +1 -1
- data/doc/AeEasy/Core/Mock/FakeSeeder.html +1 -1
- data/doc/AeEasy/Core/Plugin.html +1 -1
- data/doc/AeEasy/Core/Plugin/CollectionVault.html +1 -1
- data/doc/AeEasy/Core/Plugin/ConfigBehavior.html +1 -1
- data/doc/AeEasy/Core/Plugin/ContextIntegrator.html +6 -6
- data/doc/AeEasy/Core/Plugin/Executor.html +1 -1
- data/doc/AeEasy/Core/Plugin/ExecutorBehavior.html +1 -1
- data/doc/AeEasy/Core/Plugin/InitializeHook.html +1 -1
- data/doc/AeEasy/Core/Plugin/Parser.html +1 -1
- data/doc/AeEasy/Core/Plugin/ParserBehavior.html +1 -1
- data/doc/AeEasy/Core/Plugin/Seeder.html +1 -1
- data/doc/AeEasy/Core/Plugin/SeederBehavior.html +1 -1
- data/doc/AeEasy/Core/SmartCollection.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/top-level-namespace.html +1 -1
- data/lib/ae_easy/core.rb +22 -21
- data/lib/ae_easy/core/mock/fake_executor.rb +3 -3
- data/lib/ae_easy/core/plugin/context_integrator.rb +3 -3
- data/lib/ae_easy/core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 017dbd3b6a40dcd7a015c375e7d8af7ab7ed19a3c2707b8d0c144ead7682d9a5
|
|
4
|
+
data.tar.gz: 4dc6667bef776fb7803447f8897cda1fcc7c0c6a3009617eb0c16b01d07f52d1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d57f9cc09d015f6afbbd8cea22ad6ab2d2e3920538d4383907aecdf7c15a1a6dd32dd28d97246862c4fc8b4cbc9ce7c2964bc46aec1958f8cf65bb60d7e74342
|
|
7
|
+
data.tar.gz: 2f3ee07354601682c767ea83c87e819adf7f55778b8372a730408ad56e59845177c44dc591b5bb6940842363ac5c10426f54099d893f45faa812e7fb48f1035d
|
data/doc/AeEasy.html
CHANGED
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
</div>
|
|
108
108
|
|
|
109
109
|
<div id="footer">
|
|
110
|
-
Generated on Fri Mar 8
|
|
110
|
+
Generated on Fri Mar 8 21:02:55 2019 by
|
|
111
111
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
112
112
|
0.9.18 (ruby-2.5.3).
|
|
113
113
|
</div>
|
data/doc/AeEasy/Core.html
CHANGED
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
|
|
121
121
|
</div>
|
|
122
122
|
</dt>
|
|
123
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.1.
|
|
123
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.1.6</span><span class='tstring_end'>"</span></span></pre></dd>
|
|
124
124
|
|
|
125
125
|
</dl>
|
|
126
126
|
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
<li class="public ">
|
|
167
167
|
<span class="summary_signature">
|
|
168
168
|
|
|
169
|
-
<a href="#analyze_compatibility-class_method" title="analyze_compatibility (class method)">.<strong>analyze_compatibility</strong>(
|
|
169
|
+
<a href="#analyze_compatibility-class_method" title="analyze_compatibility (class method)">.<strong>analyze_compatibility</strong>(origin, fragment) ⇒ Hash </a>
|
|
170
170
|
|
|
171
171
|
|
|
172
172
|
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
|
|
182
182
|
|
|
183
183
|
<span class="summary_desc"><div class='inline'>
|
|
184
|
-
<p>Generate a compatibility report from a
|
|
184
|
+
<p>Generate a compatibility report from a origin and a fragment as a hash.</p>
|
|
185
185
|
</div></span>
|
|
186
186
|
|
|
187
187
|
</li>
|
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
<li class="public ">
|
|
287
287
|
<span class="summary_signature">
|
|
288
288
|
|
|
289
|
-
<a href="#instance_methods_from-class_method" title="instance_methods_from (class method)">.<strong>instance_methods_from</strong>(object) ⇒ Array </a>
|
|
289
|
+
<a href="#instance_methods_from-class_method" title="instance_methods_from (class method)">.<strong>instance_methods_from</strong>(object, class_only = false) ⇒ Array </a>
|
|
290
290
|
|
|
291
291
|
|
|
292
292
|
|
|
@@ -310,7 +310,7 @@
|
|
|
310
310
|
<li class="public ">
|
|
311
311
|
<span class="summary_signature">
|
|
312
312
|
|
|
313
|
-
<a href="#mock_instance_methods-class_method" title="mock_instance_methods (class method)">.<strong>mock_instance_methods</strong>(
|
|
313
|
+
<a href="#mock_instance_methods-class_method" title="mock_instance_methods (class method)">.<strong>mock_instance_methods</strong>(origin, target) ⇒ Object </a>
|
|
314
314
|
|
|
315
315
|
|
|
316
316
|
|
|
@@ -325,7 +325,7 @@
|
|
|
325
325
|
|
|
326
326
|
|
|
327
327
|
<span class="summary_desc"><div class='inline'>
|
|
328
|
-
<p>Mock instances methods from the
|
|
328
|
+
<p>Mock instances methods from the origin into target object.</p>
|
|
329
329
|
</div></span>
|
|
330
330
|
|
|
331
331
|
</li>
|
|
@@ -523,7 +523,7 @@
|
|
|
523
523
|
<div class="method_details ">
|
|
524
524
|
<h3 class="signature " id="analyze_compatibility-class_method">
|
|
525
525
|
|
|
526
|
-
.<strong>analyze_compatibility</strong>(
|
|
526
|
+
.<strong>analyze_compatibility</strong>(origin, fragment) ⇒ <tt>Hash</tt>
|
|
527
527
|
|
|
528
528
|
|
|
529
529
|
|
|
@@ -532,7 +532,7 @@
|
|
|
532
532
|
</h3><div class="docstring">
|
|
533
533
|
<div class="discussion">
|
|
534
534
|
|
|
535
|
-
<p>Generate a compatibility report from a
|
|
535
|
+
<p>Generate a compatibility report from a origin and a fragment as a hash.</p>
|
|
536
536
|
|
|
537
537
|
|
|
538
538
|
</div>
|
|
@@ -544,7 +544,7 @@
|
|
|
544
544
|
|
|
545
545
|
|
|
546
546
|
<p class="example_title"><div class='inline'>
|
|
547
|
-
<p>Analyze when uncompatible `fragment` because of `
|
|
547
|
+
<p>Analyze when uncompatible `fragment` because of `origin` missing fields.</p>
|
|
548
548
|
</div></p>
|
|
549
549
|
|
|
550
550
|
<pre class="example code"><code><span class='const'><span class='object_link'><a href="../AeEasy.html" title="AeEasy (module)">AeEasy</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="AeEasy::Core (module)">Core</a></span></span><span class='period'>.</span><span class='id identifier rubyid_analyze_compatibility'>analyze_compatibility</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>3</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>5</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>6</span><span class='rbracket'>]</span>
|
|
@@ -564,7 +564,7 @@
|
|
|
564
564
|
|
|
565
565
|
<li>
|
|
566
566
|
|
|
567
|
-
<span class='name'>
|
|
567
|
+
<span class='name'>origin</span>
|
|
568
568
|
|
|
569
569
|
|
|
570
570
|
<span class='type'>(<tt>Array</tt>)</span>
|
|
@@ -589,7 +589,7 @@
|
|
|
589
589
|
|
|
590
590
|
—
|
|
591
591
|
<div class='inline'>
|
|
592
|
-
<p>Item collection to compare againt <code>
|
|
592
|
+
<p>Item collection to compare againt <code>origin</code>.</p>
|
|
593
593
|
</div>
|
|
594
594
|
|
|
595
595
|
</li>
|
|
@@ -610,10 +610,10 @@
|
|
|
610
610
|
<div class='inline'><ul><li>
|
|
611
611
|
<p>`:missing [Array]` (`[]`) Methods on `fragment` only.</p>
|
|
612
612
|
</li><li>
|
|
613
|
-
<p>`:new [Array]` (`[]`) Methods on `
|
|
613
|
+
<p>`:new [Array]` (`[]`) Methods on `origin` only.</p>
|
|
614
614
|
</li><li>
|
|
615
615
|
<p>`:is_compatible [Boolean]` true when all `fragment`'s methods are
|
|
616
|
-
present on `
|
|
616
|
+
present on `origin`.</p>
|
|
617
617
|
</li></ul>
|
|
618
618
|
</div>
|
|
619
619
|
|
|
@@ -627,23 +627,23 @@ present on `source`.</p>
|
|
|
627
627
|
<pre class="lines">
|
|
628
628
|
|
|
629
629
|
|
|
630
|
-
196
|
|
631
630
|
197
|
|
632
631
|
198
|
|
633
632
|
199
|
|
634
633
|
200
|
|
635
634
|
201
|
|
636
635
|
202
|
|
637
|
-
203
|
|
636
|
+
203
|
|
637
|
+
204</pre>
|
|
638
638
|
</td>
|
|
639
639
|
<td>
|
|
640
|
-
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line
|
|
640
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 197</span>
|
|
641
641
|
|
|
642
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_analyze_compatibility'>analyze_compatibility</span> <span class='id identifier
|
|
643
|
-
<span class='id identifier rubyid_intersection'>intersection</span> <span class='op'>=</span> <span class='id identifier
|
|
642
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_analyze_compatibility'>analyze_compatibility</span> <span class='id identifier rubyid_origin'>origin</span><span class='comma'>,</span> <span class='id identifier rubyid_fragment'>fragment</span>
|
|
643
|
+
<span class='id identifier rubyid_intersection'>intersection</span> <span class='op'>=</span> <span class='id identifier rubyid_origin'>origin</span> <span class='op'>&</span> <span class='id identifier rubyid_fragment'>fragment</span>
|
|
644
644
|
<span class='lbrace'>{</span>
|
|
645
645
|
<span class='label'>missing:</span> <span class='id identifier rubyid_fragment'>fragment</span> <span class='op'>-</span> <span class='id identifier rubyid_intersection'>intersection</span><span class='comma'>,</span>
|
|
646
|
-
<span class='label'>new:</span> <span class='id identifier
|
|
646
|
+
<span class='label'>new:</span> <span class='id identifier rubyid_origin'>origin</span> <span class='op'>-</span> <span class='id identifier rubyid_intersection'>intersection</span><span class='comma'>,</span>
|
|
647
647
|
<span class='label'>is_compatible:</span> <span class='lparen'>(</span><span class='id identifier rubyid_intersection'>intersection</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span> <span class='op'>==</span> <span class='id identifier rubyid_fragment'>fragment</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='rparen'>)</span>
|
|
648
648
|
<span class='rbrace'>}</span>
|
|
649
649
|
<span class='kw'>end</span></pre>
|
|
@@ -734,17 +734,17 @@ present on `source`.</p>
|
|
|
734
734
|
<pre class="lines">
|
|
735
735
|
|
|
736
736
|
|
|
737
|
-
246
|
|
738
737
|
247
|
|
739
738
|
248
|
|
740
739
|
249
|
|
741
740
|
250
|
|
742
741
|
251
|
|
743
742
|
252
|
|
744
|
-
253
|
|
743
|
+
253
|
|
744
|
+
254</pre>
|
|
745
745
|
</td>
|
|
746
746
|
<td>
|
|
747
|
-
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line
|
|
747
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 247</span>
|
|
748
748
|
|
|
749
749
|
<span class='kw'>def</span> <span class='id identifier rubyid_deep_clone'>deep_clone</span> <span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='id identifier rubyid_should_clone'>should_clone</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|
750
750
|
<span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
@@ -836,7 +836,6 @@ present on `source`.</p>
|
|
|
836
836
|
<pre class="lines">
|
|
837
837
|
|
|
838
838
|
|
|
839
|
-
211
|
|
840
839
|
212
|
|
841
840
|
213
|
|
842
841
|
214
|
|
@@ -854,10 +853,11 @@ present on `source`.</p>
|
|
|
854
853
|
226
|
|
855
854
|
227
|
|
856
855
|
228
|
|
857
|
-
229
|
|
856
|
+
229
|
|
857
|
+
230</pre>
|
|
858
858
|
</td>
|
|
859
859
|
<td>
|
|
860
|
-
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line
|
|
860
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 212</span>
|
|
861
861
|
|
|
862
862
|
<span class='kw'>def</span> <span class='id identifier rubyid_deep_stringify_keys'>deep_stringify_keys</span> <span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='id identifier rubyid_should_clone'>should_clone</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
863
863
|
<span class='kw'>return</span> <span class='id identifier rubyid_hash'>hash</span> <span class='kw'>unless</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Hash</span>
|
|
@@ -942,12 +942,12 @@ present on `source`.</p>
|
|
|
942
942
|
<pre class="lines">
|
|
943
943
|
|
|
944
944
|
|
|
945
|
-
236
|
|
946
945
|
237
|
|
947
|
-
238
|
|
946
|
+
238
|
|
947
|
+
239</pre>
|
|
948
948
|
</td>
|
|
949
949
|
<td>
|
|
950
|
-
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line
|
|
950
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 237</span>
|
|
951
951
|
|
|
952
952
|
<span class='kw'>def</span> <span class='id identifier rubyid_deep_stringify_keys!'>deep_stringify_keys!</span> <span class='id identifier rubyid_hash'>hash</span>
|
|
953
953
|
<span class='id identifier rubyid_deep_stringify_keys'>deep_stringify_keys</span> <span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='kw'>false</span>
|
|
@@ -1089,7 +1089,7 @@ present on `source`.</p>
|
|
|
1089
1089
|
<div class="method_details ">
|
|
1090
1090
|
<h3 class="signature " id="instance_methods_from-class_method">
|
|
1091
1091
|
|
|
1092
|
-
.<strong>instance_methods_from</strong>(object) ⇒ <tt>Array</tt>
|
|
1092
|
+
.<strong>instance_methods_from</strong>(object, class_only = false) ⇒ <tt>Array</tt>
|
|
1093
1093
|
|
|
1094
1094
|
|
|
1095
1095
|
|
|
@@ -1139,6 +1139,24 @@ present on `source`.</p>
|
|
|
1139
1139
|
—
|
|
1140
1140
|
<div class='inline'>
|
|
1141
1141
|
<p>Object with instance methods.</p>
|
|
1142
|
+
</div>
|
|
1143
|
+
|
|
1144
|
+
</li>
|
|
1145
|
+
|
|
1146
|
+
<li>
|
|
1147
|
+
|
|
1148
|
+
<span class='name'>class_only</span>
|
|
1149
|
+
|
|
1150
|
+
|
|
1151
|
+
<span class='type'>(<tt>false</tt>)</span>
|
|
1152
|
+
|
|
1153
|
+
|
|
1154
|
+
<em class="default">(defaults to: <tt>false</tt>)</em>
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
—
|
|
1158
|
+
<div class='inline'>
|
|
1159
|
+
<p>Will get class only methods when `true`.</p>
|
|
1142
1160
|
</div>
|
|
1143
1161
|
|
|
1144
1162
|
</li>
|
|
@@ -1165,15 +1183,15 @@ present on `source`.</p>
|
|
|
1165
1183
|
<pre class="lines">
|
|
1166
1184
|
|
|
1167
1185
|
|
|
1168
|
-
125
|
|
1169
1186
|
126
|
|
1170
|
-
127
|
|
1187
|
+
127
|
|
1188
|
+
128</pre>
|
|
1171
1189
|
</td>
|
|
1172
1190
|
<td>
|
|
1173
|
-
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line
|
|
1191
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 126</span>
|
|
1174
1192
|
|
|
1175
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_instance_methods_from'>instance_methods_from</span> <span class='id identifier rubyid_object'>object</span>
|
|
1176
|
-
<span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_methods'>methods</span><span class='lparen'>(</span><span class='
|
|
1193
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_instance_methods_from'>instance_methods_from</span> <span class='id identifier rubyid_object'>object</span><span class='comma'>,</span> <span class='id identifier rubyid_class_only'>class_only</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|
1194
|
+
<span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_methods'>methods</span><span class='lparen'>(</span><span class='op'>!</span><span class='id identifier rubyid_class_only'>class_only</span><span class='rparen'>)</span> <span class='op'>-</span> <span class='const'>Object</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='period'>.</span><span class='id identifier rubyid_methods'>methods</span><span class='lparen'>(</span><span class='op'>!</span><span class='id identifier rubyid_class_only'>class_only</span><span class='rparen'>)</span>
|
|
1177
1195
|
<span class='kw'>end</span></pre>
|
|
1178
1196
|
</td>
|
|
1179
1197
|
</tr>
|
|
@@ -1183,7 +1201,7 @@ present on `source`.</p>
|
|
|
1183
1201
|
<div class="method_details ">
|
|
1184
1202
|
<h3 class="signature " id="mock_instance_methods-class_method">
|
|
1185
1203
|
|
|
1186
|
-
.<strong>mock_instance_methods</strong>(
|
|
1204
|
+
.<strong>mock_instance_methods</strong>(origin, target) ⇒ <tt>Object</tt>
|
|
1187
1205
|
|
|
1188
1206
|
|
|
1189
1207
|
|
|
@@ -1192,7 +1210,7 @@ present on `source`.</p>
|
|
|
1192
1210
|
</h3><div class="docstring">
|
|
1193
1211
|
<div class="discussion">
|
|
1194
1212
|
|
|
1195
|
-
<p>Mock instances methods from the
|
|
1213
|
+
<p>Mock instances methods from the origin into target object.</p>
|
|
1196
1214
|
|
|
1197
1215
|
|
|
1198
1216
|
</div>
|
|
@@ -1220,16 +1238,16 @@ present on `source`.</p>
|
|
|
1220
1238
|
<span class='kw'>end</span>
|
|
1221
1239
|
<span class='kw'>end</span>
|
|
1222
1240
|
|
|
1223
|
-
<span class='id identifier
|
|
1241
|
+
<span class='id identifier rubyid_origin'>origin</span> <span class='op'>=</span> <span class='const'>Boo</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
1224
1242
|
<span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='const'>Foo</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
1225
|
-
<span class='const'><span class='object_link'><a href="../AeEasy.html" title="AeEasy (module)">AeEasy</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="AeEasy::Core (module)">Core</a></span></span><span class='period'>.</span><span class='id identifier rubyid_mock_instance_methods'>mock_instance_methods</span> <span class='id identifier
|
|
1243
|
+
<span class='const'><span class='object_link'><a href="../AeEasy.html" title="AeEasy (module)">AeEasy</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="AeEasy::Core (module)">Core</a></span></span><span class='period'>.</span><span class='id identifier rubyid_mock_instance_methods'>mock_instance_methods</span> <span class='id identifier rubyid_origin'>origin</span> <span class='id identifier rubyid_target'>target</span>
|
|
1226
1244
|
|
|
1227
1245
|
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_hello_world'>hello_world</span>
|
|
1228
1246
|
<span class='comment'># => 'Hello world!'
|
|
1229
1247
|
</span><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_hello_person'>hello_person</span>
|
|
1230
1248
|
<span class='comment'># => 'Hello person!'
|
|
1231
1249
|
</span>
|
|
1232
|
-
<span class='id identifier
|
|
1250
|
+
<span class='id identifier rubyid_origin'>origin</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Hello world again!</span><span class='tstring_end'>'</span></span>
|
|
1233
1251
|
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_hello_world'>hello_world</span>
|
|
1234
1252
|
<span class='comment'># => 'Hello world again!'</span></code></pre>
|
|
1235
1253
|
|
|
@@ -1239,7 +1257,7 @@ present on `source`.</p>
|
|
|
1239
1257
|
|
|
1240
1258
|
<li>
|
|
1241
1259
|
|
|
1242
|
-
<span class='name'>
|
|
1260
|
+
<span class='name'>origin</span>
|
|
1243
1261
|
|
|
1244
1262
|
|
|
1245
1263
|
<span class='type'></span>
|
|
@@ -1278,7 +1296,6 @@ present on `source`.</p>
|
|
|
1278
1296
|
<pre class="lines">
|
|
1279
1297
|
|
|
1280
1298
|
|
|
1281
|
-
164
|
|
1282
1299
|
165
|
|
1283
1300
|
166
|
|
1284
1301
|
167
|
|
@@ -1291,23 +1308,24 @@ present on `source`.</p>
|
|
|
1291
1308
|
174
|
|
1292
1309
|
175
|
|
1293
1310
|
176
|
|
1294
|
-
177
|
|
1311
|
+
177
|
|
1312
|
+
178</pre>
|
|
1295
1313
|
</td>
|
|
1296
1314
|
<td>
|
|
1297
|
-
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line
|
|
1315
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 165</span>
|
|
1298
1316
|
|
|
1299
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_mock_instance_methods'>mock_instance_methods</span> <span class='id identifier
|
|
1317
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_mock_instance_methods'>mock_instance_methods</span> <span class='id identifier rubyid_origin'>origin</span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span>
|
|
1300
1318
|
<span class='comment'># Get instance unique methods
|
|
1301
|
-
</span> <span class='id identifier rubyid_method_list'>method_list</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_methods_from'>instance_methods_from</span> <span class='id identifier
|
|
1319
|
+
</span> <span class='id identifier rubyid_method_list'>method_list</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_methods_from'>instance_methods_from</span> <span class='id identifier rubyid_origin'>origin</span>
|
|
1302
1320
|
<span class='id identifier rubyid_method_list'>method_list</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='symbol'>:context_binding</span> <span class='kw'>if</span> <span class='id identifier rubyid_method_list'>method_list</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='symbol'>:context_binding</span>
|
|
1303
1321
|
|
|
1304
|
-
<span class='comment'># Build env reflecting
|
|
1322
|
+
<span class='comment'># Build env reflecting origin unique methods
|
|
1305
1323
|
</span> <span class='id identifier rubyid_env'>env</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
1306
1324
|
<span class='id identifier rubyid_method_list'>method_list</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_method'>method</span><span class='op'>|</span>
|
|
1307
|
-
<span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='id identifier rubyid_method'>method</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span><span class='op'>|</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='op'>|</span><span class='id identifier
|
|
1325
|
+
<span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='id identifier rubyid_method'>method</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span><span class='op'>|</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='op'>|</span><span class='id identifier rubyid_origin'>origin</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
|
1308
1326
|
<span class='kw'>end</span>
|
|
1309
1327
|
|
|
1310
|
-
<span class='comment'># Mock
|
|
1328
|
+
<span class='comment'># Mock origin unique methods into target
|
|
1311
1329
|
</span> <span class='id identifier rubyid_expose_to'>expose_to</span> <span class='id identifier rubyid_target'>target</span><span class='comma'>,</span> <span class='id identifier rubyid_env'>env</span>
|
|
1312
1330
|
<span class='kw'>end</span></pre>
|
|
1313
1331
|
</td>
|
|
@@ -1562,7 +1580,7 @@ present on `source`.</p>
|
|
|
1562
1580
|
</div>
|
|
1563
1581
|
|
|
1564
1582
|
<div id="footer">
|
|
1565
|
-
Generated on Fri Mar 8
|
|
1583
|
+
Generated on Fri Mar 8 21:02:55 2019 by
|
|
1566
1584
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1567
1585
|
0.9.18 (ruby-2.5.3).
|
|
1568
1586
|
</div>
|
data/doc/AeEasy/Core/Config.html
CHANGED
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
</div>
|
|
302
302
|
|
|
303
303
|
<div id="footer">
|
|
304
|
-
Generated on Fri Mar 8
|
|
304
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
305
305
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
306
306
|
0.9.18 (ruby-2.5.3).
|
|
307
307
|
</div>
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
</div>
|
|
108
108
|
|
|
109
109
|
<div id="footer">
|
|
110
|
-
Generated on Fri Mar 8
|
|
110
|
+
Generated on Fri Mar 8 21:02:55 2019 by
|
|
111
111
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
112
112
|
0.9.18 (ruby-2.5.3).
|
|
113
113
|
</div>
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
</div>
|
|
126
126
|
|
|
127
127
|
<div id="footer">
|
|
128
|
-
Generated on Fri Mar 8
|
|
128
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
129
129
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
130
130
|
0.9.18 (ruby-2.5.3).
|
|
131
131
|
</div>
|
data/doc/AeEasy/Core/Helper.html
CHANGED
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
</div>
|
|
108
108
|
|
|
109
109
|
<div id="footer">
|
|
110
|
-
Generated on Fri Mar 8
|
|
110
|
+
Generated on Fri Mar 8 21:02:55 2019 by
|
|
111
111
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
112
112
|
0.9.18 (ruby-2.5.3).
|
|
113
113
|
</div>
|
|
@@ -1060,7 +1060,7 @@ update_as_hash , response_cookies
|
|
|
1060
1060
|
</div>
|
|
1061
1061
|
|
|
1062
1062
|
<div id="footer">
|
|
1063
|
-
Generated on Fri Mar 8
|
|
1063
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
1064
1064
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1065
1065
|
0.9.18 (ruby-2.5.3).
|
|
1066
1066
|
</div>
|
data/doc/AeEasy/Core/Mock.html
CHANGED
|
@@ -272,7 +272,7 @@
|
|
|
272
272
|
</div>
|
|
273
273
|
|
|
274
274
|
<div id="footer">
|
|
275
|
-
Generated on Fri Mar 8
|
|
275
|
+
Generated on Fri Mar 8 21:02:55 2019 by
|
|
276
276
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
277
277
|
0.9.18 (ruby-2.5.3).
|
|
278
278
|
</div>
|
|
@@ -3365,7 +3365,7 @@ suites only.</p>
|
|
|
3365
3365
|
</div>
|
|
3366
3366
|
|
|
3367
3367
|
<div id="footer">
|
|
3368
|
-
Generated on Fri Mar 8
|
|
3368
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
3369
3369
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
3370
3370
|
0.9.18 (ruby-2.5.3).
|
|
3371
3371
|
</div>
|
|
@@ -2686,7 +2686,7 @@ instead, this is the defaul behavior.</p>
|
|
|
2686
2686
|
</div>
|
|
2687
2687
|
|
|
2688
2688
|
<div id="footer">
|
|
2689
|
-
Generated on Fri Mar 8
|
|
2689
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
2690
2690
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
2691
2691
|
0.9.18 (ruby-2.5.3).
|
|
2692
2692
|
</div>
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
</div>
|
|
151
151
|
|
|
152
152
|
<div id="footer">
|
|
153
|
-
Generated on Fri Mar 8
|
|
153
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
154
154
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
155
155
|
0.9.18 (ruby-2.5.3).
|
|
156
156
|
</div>
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
</div>
|
|
151
151
|
|
|
152
152
|
<div id="footer">
|
|
153
|
-
Generated on Fri Mar 8
|
|
153
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
154
154
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
155
155
|
0.9.18 (ruby-2.5.3).
|
|
156
156
|
</div>
|
data/doc/AeEasy/Core/Plugin.html
CHANGED
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
</div>
|
|
108
108
|
|
|
109
109
|
<div id="footer">
|
|
110
|
-
Generated on Fri Mar 8
|
|
110
|
+
Generated on Fri Mar 8 21:02:55 2019 by
|
|
111
111
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
112
112
|
0.9.18 (ruby-2.5.3).
|
|
113
113
|
</div>
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
</div>
|
|
290
290
|
|
|
291
291
|
<div id="footer">
|
|
292
|
-
Generated on Fri Mar 8
|
|
292
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
293
293
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
294
294
|
0.9.18 (ruby-2.5.3).
|
|
295
295
|
</div>
|
|
@@ -531,7 +531,7 @@
|
|
|
531
531
|
</div>
|
|
532
532
|
|
|
533
533
|
<div id="footer">
|
|
534
|
-
Generated on Fri Mar 8
|
|
534
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
535
535
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
536
536
|
0.9.18 (ruby-2.5.3).
|
|
537
537
|
</div>
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
<li class="public ">
|
|
165
165
|
<span class="summary_signature">
|
|
166
166
|
|
|
167
|
-
<a href="#mock_context-instance_method" title="#mock_context (instance method)">#<strong>mock_context</strong>(
|
|
167
|
+
<a href="#mock_context-instance_method" title="#mock_context (instance method)">#<strong>mock_context</strong>(origin) ⇒ Object </a>
|
|
168
168
|
|
|
169
169
|
|
|
170
170
|
|
|
@@ -332,7 +332,7 @@
|
|
|
332
332
|
<div class="method_details ">
|
|
333
333
|
<h3 class="signature " id="mock_context-instance_method">
|
|
334
334
|
|
|
335
|
-
#<strong>mock_context</strong>(
|
|
335
|
+
#<strong>mock_context</strong>(origin) ⇒ <tt>Object</tt>
|
|
336
336
|
|
|
337
337
|
|
|
338
338
|
|
|
@@ -390,7 +390,7 @@
|
|
|
390
390
|
|
|
391
391
|
<li>
|
|
392
392
|
|
|
393
|
-
<span class='name'>
|
|
393
|
+
<span class='name'>origin</span>
|
|
394
394
|
|
|
395
395
|
|
|
396
396
|
<span class='type'></span>
|
|
@@ -421,8 +421,8 @@
|
|
|
421
421
|
<td>
|
|
422
422
|
<pre class="code"><span class="info file"># File 'lib/ae_easy/core/plugin/context_integrator.rb', line 44</span>
|
|
423
423
|
|
|
424
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_mock_context'>mock_context</span> <span class='id identifier
|
|
425
|
-
<span class='ivar'>@context</span> <span class='op'>=</span> <span class='id identifier
|
|
424
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_mock_context'>mock_context</span> <span class='id identifier rubyid_origin'>origin</span>
|
|
425
|
+
<span class='ivar'>@context</span> <span class='op'>=</span> <span class='id identifier rubyid_origin'>origin</span>
|
|
426
426
|
<span class='const'><span class='object_link'><a href="../../../AeEasy.html" title="AeEasy (module)">AeEasy</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Core.html" title="AeEasy::Core (module)">Core</a></span></span><span class='period'>.</span><span class='id identifier rubyid_mock_instance_methods'><span class='object_link'><a href="../../Core.html#mock_instance_methods-class_method" title="AeEasy::Core.mock_instance_methods (method)">mock_instance_methods</a></span></span> <span class='id identifier rubyid_context'>context</span><span class='comma'>,</span> <span class='kw'>self</span>
|
|
427
427
|
<span class='kw'>end</span></pre>
|
|
428
428
|
</td>
|
|
@@ -435,7 +435,7 @@
|
|
|
435
435
|
</div>
|
|
436
436
|
|
|
437
437
|
<div id="footer">
|
|
438
|
-
Generated on Fri Mar 8
|
|
438
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
439
439
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
440
440
|
0.9.18 (ruby-2.5.3).
|
|
441
441
|
</div>
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
</div>
|
|
250
250
|
|
|
251
251
|
<div id="footer">
|
|
252
|
-
Generated on Fri Mar 8
|
|
252
|
+
Generated on Fri Mar 8 21:02:55 2019 by
|
|
253
253
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
254
254
|
0.9.18 (ruby-2.5.3).
|
|
255
255
|
</div>
|
|
@@ -334,7 +334,7 @@
|
|
|
334
334
|
</div>
|
|
335
335
|
|
|
336
336
|
<div id="footer">
|
|
337
|
-
Generated on Fri Mar 8
|
|
337
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
338
338
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
339
339
|
0.9.18 (ruby-2.5.3).
|
|
340
340
|
</div>
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
</div>
|
|
211
211
|
|
|
212
212
|
<div id="footer">
|
|
213
|
-
Generated on Fri Mar 8
|
|
213
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
214
214
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
215
215
|
0.9.18 (ruby-2.5.3).
|
|
216
216
|
</div>
|
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
</div>
|
|
261
261
|
|
|
262
262
|
<div id="footer">
|
|
263
|
-
Generated on Fri Mar 8
|
|
263
|
+
Generated on Fri Mar 8 21:02:55 2019 by
|
|
264
264
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
265
265
|
0.9.18 (ruby-2.5.3).
|
|
266
266
|
</div>
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
</div>
|
|
226
226
|
|
|
227
227
|
<div id="footer">
|
|
228
|
-
Generated on Fri Mar 8
|
|
228
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
229
229
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
230
230
|
0.9.18 (ruby-2.5.3).
|
|
231
231
|
</div>
|
|
@@ -664,7 +664,7 @@
|
|
|
664
664
|
</div>
|
|
665
665
|
|
|
666
666
|
<div id="footer">
|
|
667
|
-
Generated on Fri Mar 8
|
|
667
|
+
Generated on Fri Mar 8 21:02:55 2019 by
|
|
668
668
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
669
669
|
0.9.18 (ruby-2.5.3).
|
|
670
670
|
</div>
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
</div>
|
|
133
133
|
|
|
134
134
|
<div id="footer">
|
|
135
|
-
Generated on Fri Mar 8
|
|
135
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
136
136
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
137
137
|
0.9.18 (ruby-2.5.3).
|
|
138
138
|
</div>
|
|
@@ -1077,7 +1077,7 @@ data
|
|
|
1077
1077
|
</div>
|
|
1078
1078
|
|
|
1079
1079
|
<div id="footer">
|
|
1080
|
-
Generated on Fri Mar 8
|
|
1080
|
+
Generated on Fri Mar 8 21:02:56 2019 by
|
|
1081
1081
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1082
1082
|
0.9.18 (ruby-2.5.3).
|
|
1083
1083
|
</div>
|
data/doc/_index.html
CHANGED
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
</div>
|
|
334
334
|
|
|
335
335
|
<div id="footer">
|
|
336
|
-
Generated on Fri Mar 8
|
|
336
|
+
Generated on Fri Mar 8 21:02:55 2019 by
|
|
337
337
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
338
338
|
0.9.18 (ruby-2.5.3).
|
|
339
339
|
</div>
|
data/doc/file.README.html
CHANGED
|
@@ -81,7 +81,7 @@ href="http://rubydoc.org/gems/ae_easy-core/frames">here</a>.</p>
|
|
|
81
81
|
</div></div>
|
|
82
82
|
|
|
83
83
|
<div id="footer">
|
|
84
|
-
Generated on Fri Mar 8
|
|
84
|
+
Generated on Fri Mar 8 21:02:55 2019 by
|
|
85
85
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
86
86
|
0.9.18 (ruby-2.5.3).
|
|
87
87
|
</div>
|
data/doc/index.html
CHANGED
|
@@ -81,7 +81,7 @@ href="http://rubydoc.org/gems/ae_easy-core/frames">here</a>.</p>
|
|
|
81
81
|
</div></div>
|
|
82
82
|
|
|
83
83
|
<div id="footer">
|
|
84
|
-
Generated on Fri Mar 8
|
|
84
|
+
Generated on Fri Mar 8 21:02:55 2019 by
|
|
85
85
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
86
86
|
0.9.18 (ruby-2.5.3).
|
|
87
87
|
</div>
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
</div>
|
|
101
101
|
|
|
102
102
|
<div id="footer">
|
|
103
|
-
Generated on Fri Mar 8
|
|
103
|
+
Generated on Fri Mar 8 21:02:55 2019 by
|
|
104
104
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
105
105
|
0.9.18 (ruby-2.5.3).
|
|
106
106
|
</div>
|
data/lib/ae_easy/core.rb
CHANGED
|
@@ -105,6 +105,7 @@ module AeEasy
|
|
|
105
105
|
# Retrieve instance methods from an object.
|
|
106
106
|
#
|
|
107
107
|
# @param object Object with instance methods.
|
|
108
|
+
# @param class_only (false) Will get class only methods when `true`.
|
|
108
109
|
#
|
|
109
110
|
# @return [Array]
|
|
110
111
|
#
|
|
@@ -122,13 +123,13 @@ module AeEasy
|
|
|
122
123
|
# my_object = Foo.new
|
|
123
124
|
# AeEasy::Core.instance_methods_from my_object
|
|
124
125
|
# # => [:hello_world, :hello_person]
|
|
125
|
-
def instance_methods_from object
|
|
126
|
-
object.methods(
|
|
126
|
+
def instance_methods_from object, class_only = false
|
|
127
|
+
object.methods(!class_only) - Object.new.methods(!class_only)
|
|
127
128
|
end
|
|
128
129
|
|
|
129
|
-
# Mock instances methods from the
|
|
130
|
+
# Mock instances methods from the origin into target object.
|
|
130
131
|
#
|
|
131
|
-
# @param
|
|
132
|
+
# @param origin Object with instance methods to mock.
|
|
132
133
|
# @param target Object instance to mock methods into.
|
|
133
134
|
#
|
|
134
135
|
# @example
|
|
@@ -149,55 +150,55 @@ module AeEasy
|
|
|
149
150
|
# end
|
|
150
151
|
# end
|
|
151
152
|
#
|
|
152
|
-
#
|
|
153
|
+
# origin = Boo.new
|
|
153
154
|
# target = Foo.new
|
|
154
|
-
# AeEasy::Core.mock_instance_methods
|
|
155
|
+
# AeEasy::Core.mock_instance_methods origin target
|
|
155
156
|
#
|
|
156
157
|
# puts target.hello_world
|
|
157
158
|
# # => 'Hello world!'
|
|
158
159
|
# puts target.hello_person
|
|
159
160
|
# # => 'Hello person!'
|
|
160
161
|
#
|
|
161
|
-
#
|
|
162
|
+
# origin.message = 'Hello world again!'
|
|
162
163
|
# puts target.hello_world
|
|
163
164
|
# # => 'Hello world again!'
|
|
164
|
-
def mock_instance_methods
|
|
165
|
+
def mock_instance_methods origin, target
|
|
165
166
|
# Get instance unique methods
|
|
166
|
-
method_list = instance_methods_from
|
|
167
|
+
method_list = instance_methods_from origin
|
|
167
168
|
method_list.delete :context_binding if method_list.include? :context_binding
|
|
168
169
|
|
|
169
|
-
# Build env reflecting
|
|
170
|
+
# Build env reflecting origin unique methods
|
|
170
171
|
env = {}
|
|
171
172
|
method_list.each do |method|
|
|
172
|
-
env[method] = lambda{|*args|
|
|
173
|
+
env[method] = lambda{|*args|origin.send(method, *args)}
|
|
173
174
|
end
|
|
174
175
|
|
|
175
|
-
# Mock
|
|
176
|
+
# Mock origin unique methods into target
|
|
176
177
|
expose_to target, env
|
|
177
178
|
end
|
|
178
179
|
|
|
179
|
-
# Generate a compatibility report from a
|
|
180
|
+
# Generate a compatibility report from a origin and a fragment as a hash.
|
|
180
181
|
#
|
|
181
|
-
# @param [Array]
|
|
182
|
-
# @param [Array] fragment Item collection to compare againt +
|
|
182
|
+
# @param [Array] origin Item collection to represent the universe.
|
|
183
|
+
# @param [Array] fragment Item collection to compare againt +origin+.
|
|
183
184
|
#
|
|
184
185
|
# @return [Hash]
|
|
185
186
|
# * `:missing [Array]` (`[]`) Methods on `fragment` only.
|
|
186
|
-
# * `:new [Array]` (`[]`) Methods on `
|
|
187
|
-
# * `:is_compatible [Boolean]` true when all `fragment`'s methods are present on `
|
|
187
|
+
# * `:new [Array]` (`[]`) Methods on `origin` only.
|
|
188
|
+
# * `:is_compatible [Boolean]` true when all `fragment`'s methods are present on `origin`.
|
|
188
189
|
#
|
|
189
|
-
# @example Analyze when uncompatible `fragment` because of `
|
|
190
|
+
# @example Analyze when uncompatible `fragment` because of `origin` missing fields.
|
|
190
191
|
# AeEasy::Core.analyze_compatibility [1,2,3,4,5], [1,2,6]
|
|
191
192
|
# # => {missing: [6], new: [3,4,5], is_compatible: false}
|
|
192
193
|
#
|
|
193
194
|
# @example Analyze when compatible.
|
|
194
195
|
# AeEasy::Core.analyze_compatibility [1,2,3,4,5], [1,2,3]
|
|
195
196
|
# # => {missing: [], new: [4,5], is_compatible: true}
|
|
196
|
-
def analyze_compatibility
|
|
197
|
-
intersection =
|
|
197
|
+
def analyze_compatibility origin, fragment
|
|
198
|
+
intersection = origin & fragment
|
|
198
199
|
{
|
|
199
200
|
missing: fragment - intersection,
|
|
200
|
-
new:
|
|
201
|
+
new: origin - intersection,
|
|
201
202
|
is_compatible: (intersection.count == fragment.count)
|
|
202
203
|
}
|
|
203
204
|
end
|
|
@@ -18,13 +18,13 @@ module AeEasy
|
|
|
18
18
|
# Validate executor methods compatibility.
|
|
19
19
|
# @private
|
|
20
20
|
#
|
|
21
|
-
# @param [Array]
|
|
21
|
+
# @param [Array] origin Answersengine executor method collection.
|
|
22
22
|
# @param [Array] fragment Fake executor method collection.
|
|
23
23
|
#
|
|
24
24
|
# @return [Hash]
|
|
25
25
|
# @raise [AeEasy::Core::Exception::OutdatedError] When missing methods.
|
|
26
|
-
def self.check_compatibility
|
|
27
|
-
report = AeEasy::Core.analyze_compatibility
|
|
26
|
+
def self.check_compatibility origin, fragment
|
|
27
|
+
report = AeEasy::Core.analyze_compatibility origin, fragment
|
|
28
28
|
|
|
29
29
|
unless report[:new].count < 1
|
|
30
30
|
# Warn when outdated
|
|
@@ -7,7 +7,7 @@ module AeEasy
|
|
|
7
7
|
|
|
8
8
|
# Mock a context methods into self.
|
|
9
9
|
#
|
|
10
|
-
# @param
|
|
10
|
+
# @param origin Object that represents the context to mock.
|
|
11
11
|
#
|
|
12
12
|
# @example
|
|
13
13
|
# class MyContext
|
|
@@ -41,8 +41,8 @@ module AeEasy
|
|
|
41
41
|
# context.message = 'Hello world again!'
|
|
42
42
|
# puts my_object.hello_world
|
|
43
43
|
# # => 'Hello world again!
|
|
44
|
-
def mock_context
|
|
45
|
-
@context =
|
|
44
|
+
def mock_context origin
|
|
45
|
+
@context = origin
|
|
46
46
|
AeEasy::Core.mock_instance_methods context, self
|
|
47
47
|
end
|
|
48
48
|
|
data/lib/ae_easy/core/version.rb
CHANGED