module Confection::Current
Current
mixin extends the Confection
module. Primarily is provides class methods for working with the current project’s configurations.
Public Instance Methods
bootstrap()
click to toggle source
# File lib/confection/current.rb, line 29 def bootstrap $properties = current_project.properties end
clear!()
click to toggle source
# File lib/confection/current.rb, line 49 def clear! current_project.store.clear! end
controller(scope, tool, *options)
click to toggle source
# File lib/confection/current.rb, line 15 def controller(scope, tool, *options) params = (Hash === options.last ? options.pop : {}) params[:profile] = options.shift unless options.empty? if from = params[:from] projects[from] ||= Project.load(from) projects[from].controller(scope, tool, params) else bootstrap if $properties.nil? # TODO: better way to go about this? current_project.controller(scope, tool, params) end end
current_directory()
click to toggle source
# File lib/confection/current.rb, line 39 def current_directory @current_directory ||= Dir.pwd end
current_project()
click to toggle source
# File lib/confection/current.rb, line 44 def current_project projects[current_directory] ||= Project.lookup(current_directory) end
each(&block)
click to toggle source
# File lib/confection/current.rb, line 59 def each(&block) current_project.each(&block) end
profiles(tool)
click to toggle source
# File lib/confection/current.rb, line 54 def profiles(tool) current_project.profiles(tool) end
projects()
click to toggle source
# File lib/confection/current.rb, line 34 def projects @projects ||= {} end
properties()
click to toggle source
Project
properties.
# File lib/confection/current.rb, line 71 def properties current_project.properties end
size()
click to toggle source
# File lib/confection/current.rb, line 64 def size current_project.size end