Blueprints 2.0: attributes and dependencies

6 views
Skip to first unread message

Andrius Chamentauskas

unread,
Nov 7, 2011, 5:52:01 PM11/7/11
to blueprints
I started feeling that attributes are becoming big part of blueprints,
that's why I'm planning to add ability to set attributes using second
argument in blueprint block:
blueprint :name, :attribute => 'value'

This sadly means that you can no longer set dependencies using hash
syntax (note that you can still set dependencies using depends_on
method):
blueprint :name => :dependency (invalid in 2.0)

I've noticed that above syntax is mostly used to make groups of
blueprints, so I'm removing namespaces feature (which barely was used
anyway) and instead introducing groups:
group :sample1, :sample2, :as => :samples
# In test
build :samples
samples.should == [sample1, sample2]

I'm also planning on adding some method missing magic for dependencies
in attributes (used with d method):
blueprint :project, :user => admin
Reply all
Reply to author
Forward
0 new messages