ree 1.0.36 → 1.0.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ree/link_dsl.rb +27 -14
- data/lib/ree/object_compiler.rb +1 -1
- data/lib/ree/rspec_link_dsl.rb +12 -3
- data/lib/ree/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: 35a162c69a00597f108ee30e405a86ec0d5758e94d7110b3f904b5b3b7b7970c
|
4
|
+
data.tar.gz: 5a33fe4850f595f0ad3da5e10acea452d3ca515d47b82003f45e2365f5b5e7b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cf7b6cb449a213fbbce8498702a79349133744e91be63de7e171696319d26565e9ec292a3b4403e765ce18cd326a86f1241f41602feb14b80025da24c76f91b
|
7
|
+
data.tar.gz: aa570fbba3f9f361d81196252b969a35b9ed359a5ff400bdc31cb316de9af17e394312f445f8c9922fffa2983454c4cc3a8ace6cd14d70c3f06a63fb29cff41d
|
data/Gemfile.lock
CHANGED
data/lib/ree/link_dsl.rb
CHANGED
@@ -70,21 +70,34 @@ module Ree::LinkDSL
|
|
70
70
|
.load_package_object(link_package_name, link_object_name)
|
71
71
|
|
72
72
|
if obj.fn?
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
73
|
+
if obj.with_caller?
|
74
|
+
self.class_eval %Q(
|
75
|
+
private def #{link_as}(*args, **kwargs, &block)
|
76
|
+
#{obj.klass}.new.set_caller(self).call(*args, **kwargs, &block)
|
77
|
+
end
|
78
|
+
)
|
79
|
+
else
|
80
|
+
self.class_eval %Q(
|
81
|
+
private def #{link_as}(*args, **kwargs, &block)
|
82
|
+
@#{link_as} ||= #{obj.klass}.new
|
83
|
+
@#{link_as}.call(*args, **kwargs, &block)
|
84
|
+
end
|
85
|
+
)
|
86
|
+
end
|
82
87
|
else
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
+
if obj.with_caller?
|
89
|
+
self.class_eval %Q(
|
90
|
+
private def #{link_as}
|
91
|
+
#{obj.klass}.new.set_caller(self)
|
92
|
+
end
|
93
|
+
)
|
94
|
+
else
|
95
|
+
self.class_eval %Q(
|
96
|
+
private def #{link_as}
|
97
|
+
@#{link_as} ||= #{obj.klass}.new
|
98
|
+
end
|
99
|
+
)
|
100
|
+
end
|
88
101
|
end
|
89
102
|
end
|
90
103
|
|
data/lib/ree/object_compiler.rb
CHANGED
@@ -205,7 +205,7 @@ class Ree::ObjectCompiler
|
|
205
205
|
if obj.with_caller?
|
206
206
|
eval_list.push(indent + "private def #{object_link.as}")
|
207
207
|
indent = inc_indent(indent)
|
208
|
-
eval_list.push(indent + "
|
208
|
+
eval_list.push(indent + "#{obj.klass}.new.set_caller(self)")
|
209
209
|
indent = dec_indent(indent)
|
210
210
|
eval_list.push(indent + "end")
|
211
211
|
else
|
data/lib/ree/rspec_link_dsl.rb
CHANGED
@@ -11,19 +11,28 @@ module Ree::RSpecLinkDSL
|
|
11
11
|
|
12
12
|
define_method as do |*args, **kwargs, &proc|
|
13
13
|
if obj.object?
|
14
|
-
obj.
|
14
|
+
if obj.with_caller?
|
15
|
+
obj.klass.new.set_caller(self)
|
16
|
+
else
|
17
|
+
obj.klass.new
|
18
|
+
end
|
15
19
|
else
|
16
|
-
obj.
|
20
|
+
if obj.with_caller?
|
21
|
+
obj.klass.new.set_caller(self).call(*args, **kwargs, &proc)
|
22
|
+
else
|
23
|
+
obj.klass.new.call(*args, **kwargs, &proc)
|
24
|
+
end
|
17
25
|
end
|
18
26
|
end
|
19
27
|
elsif obj_name.is_a?(String)
|
20
28
|
const_list = link_file(from, obj_name, import_proc)
|
29
|
+
|
21
30
|
const_list.each do |const|
|
22
31
|
Object.const_set(const.name, self.const_get(const.name))
|
23
32
|
end
|
24
33
|
else
|
25
34
|
raise Ree::Error.new("Invalid link DSL usage. Args should be Hash or String")
|
26
|
-
end
|
35
|
+
end
|
27
36
|
end
|
28
37
|
|
29
38
|
private
|
data/lib/ree/version.rb
CHANGED