cobble 0.1.1 → 0.1.2
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/lib/cobble/binding.rb +13 -7
- metadata +1 -1
data/lib/cobble/binding.rb
CHANGED
@@ -3,13 +3,11 @@ class Cobble
|
|
3
3
|
attr_accessor :name
|
4
4
|
attr_accessor :type
|
5
5
|
attr_accessor :options
|
6
|
-
attr_accessor :built_options # :nodoc:
|
7
6
|
|
8
7
|
def initialize(name, options = {}) # :nodoc:
|
9
8
|
self.name = name
|
10
9
|
self.type = :build
|
11
10
|
self.options = {}
|
12
|
-
self.built_options = {}
|
13
11
|
parse_options(options)
|
14
12
|
|
15
13
|
self.attributes_for(name)
|
@@ -36,16 +34,24 @@ class Cobble
|
|
36
34
|
end
|
37
35
|
|
38
36
|
def method_missing(sym, *args, &block)
|
39
|
-
|
40
|
-
unless val
|
37
|
+
unless self.options[sym]
|
41
38
|
if block_given?
|
42
|
-
|
39
|
+
self.options[sym] = yield
|
43
40
|
end
|
44
41
|
end
|
45
|
-
self.built_options[sym] = val
|
46
|
-
return val
|
47
42
|
end
|
48
43
|
|
44
|
+
# def method_missing(sym, *args, &block)
|
45
|
+
# val = self.options.delete(sym) || self.built_options[sym]
|
46
|
+
# unless val
|
47
|
+
# if block_given?
|
48
|
+
# val = yield
|
49
|
+
# end
|
50
|
+
# end
|
51
|
+
# self.built_options[sym] = val
|
52
|
+
# return val
|
53
|
+
# end
|
54
|
+
|
49
55
|
private
|
50
56
|
def parse_options(options)
|
51
57
|
case options
|