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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40269b8b520f835a14d0b155cfb25408dfa0ec06bcdb48aaac552e96283cf76b
4
- data.tar.gz: 58f6c405a3ab08def9dc2899a94c07cdf8cf0d7cf0fe051cfad6a13e77d81fbf
3
+ metadata.gz: 35a162c69a00597f108ee30e405a86ec0d5758e94d7110b3f904b5b3b7b7970c
4
+ data.tar.gz: 5a33fe4850f595f0ad3da5e10acea452d3ca515d47b82003f45e2365f5b5e7b2
5
5
  SHA512:
6
- metadata.gz: 7b0dc9c0d912356c0bed577496d4af90714142d9774cfa3c093fc66f7937e3c04936ca8daed5ec3d796d9880db744f7ac11d7d1a91e33110a9959428e8ae02a1
7
- data.tar.gz: 236477089e9ca29534fec178dd1d33181c1f8482c18fe8bddecd821787e55d69eacf8f51ee952a7070842ddb474d120f0760956d4749021e4c25557978fc3dc2
6
+ metadata.gz: 4cf7b6cb449a213fbbce8498702a79349133744e91be63de7e171696319d26565e9ec292a3b4403e765ce18cd326a86f1241f41602feb14b80025da24c76f91b
7
+ data.tar.gz: aa570fbba3f9f361d81196252b969a35b9ed359a5ff400bdc31cb316de9af17e394312f445f8c9922fffa2983454c4cc3a8ace6cd14d70c3f06a63fb29cff41d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ree (1.0.36)
4
+ ree (1.0.38)
5
5
  commander (~> 5.0.0)
6
6
 
7
7
  GEM
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
- self.class_eval %Q(
74
- private def _#{link_as}
75
- @#{link_as} ||= #{obj.klass}.new
76
- end
77
-
78
- private def #{link_as}(*args, **kwargs, &block)
79
- _#{link_as}.call(*args, **kwargs, &block)
80
- end
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
- self.class_eval %Q(
84
- private def #{link_as}
85
- @#{link_as} ||= #{obj.klass}.new
86
- end
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
 
@@ -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 + "@#{object_link.as}")
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
@@ -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.klass.new
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.klass.new.call(*args, **kwargs, &proc)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ree
4
- VERSION = "1.0.36"
4
+ VERSION = "1.0.38"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ree
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.36
4
+ version: 1.0.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov