blueprints 0.3.0 → 0.3.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.
- data/lib/blueprints/buildable.rb +4 -0
- data/lib/blueprints/namespace.rb +1 -1
- data/lib/blueprints/plan.rb +1 -1
- data/spec/active_record/blueprints_spec.rb +11 -10
- metadata +2 -2
data/lib/blueprints/buildable.rb
CHANGED
data/lib/blueprints/namespace.rb
CHANGED
data/lib/blueprints/plan.rb
CHANGED
@@ -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(
|
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
|
-
@
|
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
|
-
@
|
249
|
-
@
|
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
|
-
@
|
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
|
-
|
261
|
-
@
|
262
|
-
@
|
263
|
-
@
|
264
|
-
@
|
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
|
-
@
|
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.
|
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-
|
12
|
+
date: 2009-10-18 00:00:00 +03:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|