blueprints 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,6 +22,10 @@ module Blueprints
22
22
 
23
23
  protected
24
24
 
25
+ def path
26
+ @path = (namespace.path + "_" unless namespace.nil? or namespace.path.empty?).to_s + @name.to_s
27
+ end
28
+
25
29
  def build_parent_plans
26
30
  @parents.each do |p|
27
31
  parent = begin
@@ -25,7 +25,7 @@ module Blueprints
25
25
  end
26
26
 
27
27
  def build_plan
28
- Namespace.root.add_variable(name, @children.collect {|p| p.last.build }.uniq)
28
+ Namespace.root.add_variable(path, @children.collect {|p| p.last.build }.uniq)
29
29
  end
30
30
  end
31
31
  end
@@ -9,7 +9,7 @@ module Blueprints
9
9
  surface_errors do
10
10
  if @block
11
11
  @result = Namespace.root.context.module_eval(&@block)
12
- Namespace.root.add_variable(@name, @result)
12
+ Namespace.root.add_variable(path, @result)
13
13
  end
14
14
  end unless Namespace.root.executed_plans.include?(@name)
15
15
  Namespace.root.executed_plans << @name
@@ -240,28 +240,29 @@ describe Blueprints do
240
240
  describe "with pitted namespace" do
241
241
  it "should allow building namespaced scenarios" do
242
242
  build 'pitted.peach_tree'
243
- @peach_tree.name.should == 'pitted peach tree'
243
+ @pitted_peach_tree.name.should == 'pitted peach tree'
244
244
  end
245
245
 
246
246
  it "should allow adding dependencies from same namespace" do
247
247
  build 'pitted.peach'
248
- @peach.species.should == 'pitted peach'
249
- @peach_tree.should_not be_nil
248
+ @pitted_peach.species.should == 'pitted peach'
249
+ @pitted_peach_tree.should_not be_nil
250
250
  end
251
251
 
252
252
  it "should allow adding dependencies from root namespace" do
253
253
  build 'pitted.acorn'
254
- @acorn.species.should == 'pitted acorn'
254
+ @pitted_acorn.species.should == 'pitted acorn'
255
255
  @oak.should_not be_nil
256
256
  end
257
257
 
258
258
  it "should allow building whole namespace" do
259
259
  build :pitted
260
- @peach_tree.should_not be_nil
261
- @peach.should_not be_nil
262
- @acorn.should_not be_nil
263
- @apple.should_not be_nil
264
- @pitted.should =~ [@peach_tree, @peach, @acorn, [@apple]]
260
+ p instance_variables
261
+ @pitted_peach_tree.should_not be_nil
262
+ @pitted_peach.should_not be_nil
263
+ @pitted_acorn.should_not be_nil
264
+ @pitted_red_apple.should_not be_nil
265
+ @pitted.should =~ [@pitted_peach_tree, @pitted_peach, @pitted_acorn, [@pitted_red_apple]]
265
266
  end
266
267
 
267
268
  it "should load dependencies when building namespaced blueprint if namespace has any" do
@@ -272,7 +273,7 @@ describe Blueprints do
272
273
  describe "with red namespace" do
273
274
  it "should allow building nested namespaces scenarios" do
274
275
  build 'pitted.red.apple'
275
- @apple.species.should == 'pitted red apple'
276
+ @pitted_red_apple.species.should == 'pitted red apple'
276
277
  end
277
278
  end
278
279
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blueprints
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrius Chamentauskas
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-17 00:00:00 +03:00
12
+ date: 2009-10-18 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency