famili 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
data/lib/famili/mother.rb CHANGED
@@ -37,6 +37,7 @@ module Famili
37
37
 
38
38
  def inherited(child)
39
39
  child.parent_class = self
40
+ child.pending_tasks = []
40
41
  end
41
42
 
42
43
  def name(&block)
@@ -67,7 +68,7 @@ module Famili
67
68
  end
68
69
 
69
70
  def new_father
70
- invoke_pending_tasks
71
+ invoke_pending_tasks if pending_tasks
71
72
  Famili::Father.new(self.new, attributes)
72
73
  end
73
74
 
@@ -97,14 +98,13 @@ module Famili
97
98
 
98
99
  protected
99
100
 
100
- def pending_tasks
101
- @pending_tasks ||= []
102
- end
101
+ attr_accessor :pending_tasks
103
102
 
104
103
  def invoke_pending_tasks
105
104
  parent_class.invoke_pending_tasks if parent_class
106
105
  if @pending_tasks
107
106
  @pending_tasks.each(&:call)
107
+ @pending_tasks = nil
108
108
  end
109
109
  end
110
110
 
@@ -1,5 +1,5 @@
1
1
  module Famili
2
2
  module Version
3
- STRING = '0.1.8'
3
+ STRING = '0.1.9'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: famili
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2012-06-28 00:00:00.000000000 Z
13
+ date: 2012-07-02 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Yet another object mother pattern implementation.
16
16
  email:
@@ -38,7 +38,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
38
38
  version: '0'
39
39
  segments:
40
40
  - 0
41
- hash: -3995658946911266953
41
+ hash: 2078673055765586338
42
42
  required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  none: false
44
44
  requirements:
@@ -47,11 +47,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
47
  version: '0'
48
48
  segments:
49
49
  - 0
50
- hash: -3995658946911266953
50
+ hash: 2078673055765586338
51
51
  requirements: []
52
52
  rubyforge_project:
53
53
  rubygems_version: 1.8.10
54
54
  signing_key:
55
55
  specification_version: 3
56
- summary: famili-0.1.8
56
+ summary: famili-0.1.9
57
57
  test_files: []