cobble 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. data/lib/cobble/binding.rb +7 -2
  2. metadata +1 -1
@@ -3,11 +3,13 @@ class Cobble
3
3
  attr_accessor :name
4
4
  attr_accessor :type
5
5
  attr_accessor :options
6
+ attr_accessor :built_options # :nodoc:
6
7
 
7
8
  def initialize(name, options = {}) # :nodoc:
8
9
  self.name = name
9
10
  self.type = :build
10
11
  self.options = {}
12
+ self.built_options = {}
11
13
  parse_options(options)
12
14
 
13
15
  self.attributes_for(name)
@@ -34,11 +36,14 @@ class Cobble
34
36
  end
35
37
 
36
38
  def method_missing(sym, *args, &block)
37
- unless self.options[sym]
39
+ val = self.options.delete(sym) || self.built_options[sym]
40
+ unless val
38
41
  if block_given?
39
- self.options[sym] = yield
42
+ val = yield
40
43
  end
41
44
  end
45
+ self.built_options[sym] = val
46
+ return val
42
47
  end
43
48
 
44
49
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cobble
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - markbates