meta_methods 1.0.4 → 1.0.5
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.
- data/.idea/workspace.xml +30 -57
- data/lib/meta_methods/meta_methods.rb +8 -14
- data/lib/meta_methods/version.rb +1 -1
- metadata +1 -1
data/.idea/workspace.xml
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
<component name="ChangeListManager">
|
|
4
4
|
<list default="true" id="cb96d5fa-a536-45ee-8377-2c11e1c06313" name="Default" comment="">
|
|
5
5
|
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
|
6
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/meta_methods/meta_methods.rb" afterPath="$PROJECT_DIR$/lib/meta_methods/meta_methods.rb" />
|
|
7
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/meta_methods/version.rb" afterPath="$PROJECT_DIR$/lib/meta_methods/version.rb" />
|
|
6
8
|
</list>
|
|
7
9
|
<ignored path="meta_methods.iws" />
|
|
8
10
|
<ignored path=".idea/workspace.xml" />
|
|
@@ -42,19 +44,19 @@
|
|
|
42
44
|
</provider>
|
|
43
45
|
</entry>
|
|
44
46
|
</file>
|
|
45
|
-
<file leaf-file-name="meta_methods.gemspec" pinned="false" current="
|
|
47
|
+
<file leaf-file-name="meta_methods.gemspec" pinned="false" current="false" current-in-tab="false">
|
|
46
48
|
<entry file="file://$PROJECT_DIR$/meta_methods.gemspec">
|
|
47
49
|
<provider selected="true" editor-type-id="text-editor">
|
|
48
|
-
<state line="
|
|
50
|
+
<state line="22" column="105" selection-start="810" selection-end="810" vertical-scroll-proportion="0.0">
|
|
49
51
|
<folding />
|
|
50
52
|
</state>
|
|
51
53
|
</provider>
|
|
52
54
|
</entry>
|
|
53
55
|
</file>
|
|
54
|
-
<file leaf-file-name="version.rb" pinned="false" current="
|
|
56
|
+
<file leaf-file-name="version.rb" pinned="false" current="true" current-in-tab="true">
|
|
55
57
|
<entry file="file://$PROJECT_DIR$/lib/meta_methods/version.rb">
|
|
56
58
|
<provider selected="true" editor-type-id="text-editor">
|
|
57
|
-
<state line="
|
|
59
|
+
<state line="1" column="18" selection-start="37" selection-end="37" vertical-scroll-proportion="0.035955057">
|
|
58
60
|
<folding />
|
|
59
61
|
</state>
|
|
60
62
|
</provider>
|
|
@@ -69,19 +71,19 @@
|
|
|
69
71
|
</provider>
|
|
70
72
|
</entry>
|
|
71
73
|
</file>
|
|
72
|
-
<file leaf-file-name="
|
|
73
|
-
<entry file="file://$PROJECT_DIR$/
|
|
74
|
+
<file leaf-file-name="meta_methods_spec.rb" pinned="false" current="false" current-in-tab="false">
|
|
75
|
+
<entry file="file://$PROJECT_DIR$/spec/meta_methods_spec.rb">
|
|
74
76
|
<provider selected="true" editor-type-id="text-editor">
|
|
75
|
-
<state line="
|
|
77
|
+
<state line="10" column="16" selection-start="155" selection-end="155" vertical-scroll-proportion="0.0">
|
|
76
78
|
<folding />
|
|
77
79
|
</state>
|
|
78
80
|
</provider>
|
|
79
81
|
</entry>
|
|
80
82
|
</file>
|
|
81
|
-
<file leaf-file-name="
|
|
82
|
-
<entry file="file://$PROJECT_DIR$/
|
|
83
|
+
<file leaf-file-name="meta_methods.rb" pinned="false" current="false" current-in-tab="false">
|
|
84
|
+
<entry file="file://$PROJECT_DIR$/lib/meta_methods/meta_methods.rb">
|
|
83
85
|
<provider selected="true" editor-type-id="text-editor">
|
|
84
|
-
<state line="
|
|
86
|
+
<state line="55" column="9" selection-start="1332" selection-end="1332" vertical-scroll-proportion="0.0">
|
|
85
87
|
<folding />
|
|
86
88
|
</state>
|
|
87
89
|
</provider>
|
|
@@ -97,6 +99,9 @@
|
|
|
97
99
|
<component name="Git.Settings">
|
|
98
100
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
99
101
|
</component>
|
|
102
|
+
<component name="GitLogSettings">
|
|
103
|
+
<option name="myStructureFilterPaths" />
|
|
104
|
+
</component>
|
|
100
105
|
<component name="IdeDocumentHistory">
|
|
101
106
|
<option name="changedFiles">
|
|
102
107
|
<list>
|
|
@@ -109,8 +114,8 @@
|
|
|
109
114
|
<option value="$PROJECT_DIR$/Gemfile" />
|
|
110
115
|
<option value="$PROJECT_DIR$/meta_methods.gemspec.erb" />
|
|
111
116
|
<option value="$PROJECT_DIR$/Rakefile" />
|
|
112
|
-
<option value="$PROJECT_DIR$/lib/meta_methods/version.rb" />
|
|
113
117
|
<option value="$PROJECT_DIR$/lib/meta_methods/meta_methods.rb" />
|
|
118
|
+
<option value="$PROJECT_DIR$/lib/meta_methods/version.rb" />
|
|
114
119
|
</list>
|
|
115
120
|
</option>
|
|
116
121
|
</component>
|
|
@@ -146,6 +151,7 @@
|
|
|
146
151
|
<sortByType />
|
|
147
152
|
</navigator>
|
|
148
153
|
<panes>
|
|
154
|
+
<pane id="Scope" />
|
|
149
155
|
<pane id="ProjectPane">
|
|
150
156
|
<subPane>
|
|
151
157
|
<PATH>
|
|
@@ -178,41 +184,8 @@
|
|
|
178
184
|
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
179
185
|
</PATH_ELEMENT>
|
|
180
186
|
</PATH>
|
|
181
|
-
<PATH>
|
|
182
|
-
<PATH_ELEMENT>
|
|
183
|
-
<option name="myItemId" value="meta_methods" />
|
|
184
|
-
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
185
|
-
</PATH_ELEMENT>
|
|
186
|
-
<PATH_ELEMENT>
|
|
187
|
-
<option name="myItemId" value="meta_methods" />
|
|
188
|
-
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
189
|
-
</PATH_ELEMENT>
|
|
190
|
-
<PATH_ELEMENT>
|
|
191
|
-
<option name="myItemId" value="lib" />
|
|
192
|
-
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
193
|
-
</PATH_ELEMENT>
|
|
194
|
-
</PATH>
|
|
195
|
-
<PATH>
|
|
196
|
-
<PATH_ELEMENT>
|
|
197
|
-
<option name="myItemId" value="meta_methods" />
|
|
198
|
-
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
199
|
-
</PATH_ELEMENT>
|
|
200
|
-
<PATH_ELEMENT>
|
|
201
|
-
<option name="myItemId" value="meta_methods" />
|
|
202
|
-
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
203
|
-
</PATH_ELEMENT>
|
|
204
|
-
<PATH_ELEMENT>
|
|
205
|
-
<option name="myItemId" value="lib" />
|
|
206
|
-
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
207
|
-
</PATH_ELEMENT>
|
|
208
|
-
<PATH_ELEMENT>
|
|
209
|
-
<option name="myItemId" value="meta_methods" />
|
|
210
|
-
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
211
|
-
</PATH_ELEMENT>
|
|
212
|
-
</PATH>
|
|
213
187
|
</subPane>
|
|
214
188
|
</pane>
|
|
215
|
-
<pane id="Scope" />
|
|
216
189
|
</panes>
|
|
217
190
|
</component>
|
|
218
191
|
<component name="PropertiesComponent">
|
|
@@ -335,12 +308,13 @@
|
|
|
335
308
|
<frame x="240" y="142" width="1588" height="1058" extended-state="0" />
|
|
336
309
|
<editor active="false" />
|
|
337
310
|
<layout>
|
|
338
|
-
<window_info id="
|
|
311
|
+
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3298647" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
|
312
|
+
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.508845" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
|
339
313
|
<window_info id="CSS-X-Fire" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
|
340
314
|
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
|
341
315
|
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
|
|
342
316
|
<window_info id="jenkinsBrowser" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
|
343
|
-
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.
|
|
317
|
+
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.49115506" order="0" side_tool="false" content_ui="combo" />
|
|
344
318
|
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
|
345
319
|
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
|
346
320
|
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
|
|
@@ -350,7 +324,6 @@
|
|
|
350
324
|
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
|
351
325
|
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
|
352
326
|
<window_info id="Find" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.3298647" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
|
353
|
-
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3298647" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
|
354
327
|
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
|
355
328
|
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
|
356
329
|
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
|
@@ -471,37 +444,37 @@
|
|
|
471
444
|
<state line="13" column="8" selection-start="548" selection-end="548" vertical-scroll-proportion="0.35135135" />
|
|
472
445
|
</provider>
|
|
473
446
|
</entry>
|
|
474
|
-
<entry file="file://$PROJECT_DIR$/
|
|
447
|
+
<entry file="file://$PROJECT_DIR$/spec/meta_methods_spec.rb">
|
|
475
448
|
<provider selected="true" editor-type-id="text-editor">
|
|
476
|
-
<state line="
|
|
449
|
+
<state line="10" column="16" selection-start="155" selection-end="155" vertical-scroll-proportion="0.0">
|
|
477
450
|
<folding />
|
|
478
451
|
</state>
|
|
479
452
|
</provider>
|
|
480
453
|
</entry>
|
|
481
|
-
<entry file="file://$PROJECT_DIR$/
|
|
454
|
+
<entry file="file://$PROJECT_DIR$/Rakefile">
|
|
482
455
|
<provider selected="true" editor-type-id="text-editor">
|
|
483
|
-
<state line="
|
|
456
|
+
<state line="24" column="0" selection-start="474" selection-end="548" vertical-scroll-proportion="0.0">
|
|
484
457
|
<folding />
|
|
485
458
|
</state>
|
|
486
459
|
</provider>
|
|
487
460
|
</entry>
|
|
488
|
-
<entry file="file://$PROJECT_DIR$/
|
|
461
|
+
<entry file="file://$PROJECT_DIR$/meta_methods.gemspec">
|
|
489
462
|
<provider selected="true" editor-type-id="text-editor">
|
|
490
|
-
<state line="
|
|
463
|
+
<state line="22" column="105" selection-start="810" selection-end="810" vertical-scroll-proportion="0.0">
|
|
491
464
|
<folding />
|
|
492
465
|
</state>
|
|
493
466
|
</provider>
|
|
494
467
|
</entry>
|
|
495
|
-
<entry file="file://$PROJECT_DIR$/
|
|
468
|
+
<entry file="file://$PROJECT_DIR$/lib/meta_methods/meta_methods.rb">
|
|
496
469
|
<provider selected="true" editor-type-id="text-editor">
|
|
497
|
-
<state line="
|
|
470
|
+
<state line="55" column="9" selection-start="1332" selection-end="1332" vertical-scroll-proportion="0.0">
|
|
498
471
|
<folding />
|
|
499
472
|
</state>
|
|
500
473
|
</provider>
|
|
501
474
|
</entry>
|
|
502
|
-
<entry file="file://$PROJECT_DIR$/meta_methods.
|
|
475
|
+
<entry file="file://$PROJECT_DIR$/lib/meta_methods/version.rb">
|
|
503
476
|
<provider selected="true" editor-type-id="text-editor">
|
|
504
|
-
<state line="
|
|
477
|
+
<state line="1" column="18" selection-start="37" selection-end="37" vertical-scroll-proportion="0.035955057">
|
|
505
478
|
<folding />
|
|
506
479
|
</state>
|
|
507
480
|
</provider>
|
|
@@ -33,13 +33,19 @@ module MetaMethods
|
|
|
33
33
|
extract_values(defined_vars(scope), scope)
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
def evaluate_dsl(create_block, destroy_block, execute_block
|
|
36
|
+
def evaluate_dsl(create_block, destroy_block, execute_block)
|
|
37
37
|
object = nil
|
|
38
38
|
|
|
39
39
|
begin
|
|
40
40
|
object = create_block.kind_of?(Proc) ? create_block.call : create_block
|
|
41
|
+
object.instance_variable_set(:@execute_block, execute_block)
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
def object.method_missing(sym, *args, &block)
|
|
44
|
+
block_binding = @execute_block.binding
|
|
45
|
+
caller = block_binding.eval 'self'
|
|
46
|
+
|
|
47
|
+
caller.send sym, *args, &block
|
|
48
|
+
end
|
|
43
49
|
|
|
44
50
|
object.instance_eval(&execute_block)
|
|
45
51
|
ensure
|
|
@@ -49,18 +55,6 @@ module MetaMethods
|
|
|
49
55
|
|
|
50
56
|
private
|
|
51
57
|
|
|
52
|
-
def access_block_scope object, block
|
|
53
|
-
object.instance_variable_set(:@execute_block, block)
|
|
54
|
-
|
|
55
|
-
def object.method_missing(sym, *args, &block)
|
|
56
|
-
block_binding = @execute_block.binding
|
|
57
|
-
|
|
58
|
-
caller = block_binding.eval 'self'
|
|
59
|
-
|
|
60
|
-
caller.send sym, *args, &block
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|
|
64
58
|
def defined_vars scope
|
|
65
59
|
eval("local_variables", scope) - Kernel.local_variables - %w(content)
|
|
66
60
|
end
|
data/lib/meta_methods/version.rb
CHANGED