module Blueprints
# Module that blueprints file is executed against. Defined blueprint and namespace methods.
module FileContext
# Creates a new plan by name and block passed
def self.blueprint(plan, &block)
Plan.new(plan, &block)
end
# Creates new namespace by name, and evaluates block against it.
def self.namespace(name)
old_namespace = Namespace.root
namespace = Namespace.new(name)
Namespace.root = namespace
yield
old_namespace.add_child(namespace)
Namespace.root = old_namespace
end
end
end