module Bake::Scope

def self.inspect

def self.inspect
	"Bake::Scope<#{self.const_get(:FILE_PATH)}>"
end

def self.load(file_path, path = [])

def self.load(file_path, path = [])
	scope = Module.new
	scope.extend(self)
	
	scope.const_set(:FILE_PATH, file_path)
	scope.const_set(:PATH, path)
	
	scope.module_eval(File.read(file_path), file_path)
	
	return scope
end

def path

def path
	self.const_get(:PATH)
end

def recipe(name, **options, &block)

def recipe(name, **options, &block)
	define_method(name, &block)
end

def recipe_for(name)

def recipe_for(name)
	Recipe.new(self, name, self.instance_method(name))
end

def recipes

def recipes
	return to_enum(:recipes) unless block_given?
	
	names = self.instance_methods
	
	names.each do |name|
		yield recipe_for(name)
	end
end