Sha256: d73502b6fa37f7cda8fe7ed376866314e5b45b1d3297a82baa29b97ccb234c48

Contents?: true

Size: 590 Bytes

Versions: 5

Compression:

Stored size: 590 Bytes

Contents

module Blueprints
  # Module that blueprints file is executed against. Defined <tt>blueprint</tt> and <tt>namespace</tt> 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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
blueprints-0.5.1 lib/blueprints/file_context.rb
blueprints-0.5.0 lib/blueprints/file_context.rb
blueprints-0.4.2 lib/blueprints/file_context.rb
blueprints-0.4.1 lib/blueprints/file_context.rb
blueprints-0.4.0 lib/blueprints/file_context.rb