lib/shaddox/config.rb in shaddox-0.1.0 vs lib/shaddox/config.rb in shaddox-0.1.1
- old
+ new
@@ -3,30 +3,31 @@
# Init ==============================================
attr_accessor :tasks
- def initialize(doxfile)
+ def initialize(doxfile, opts = {})
doxfile = './Doxfile' unless doxfile
if !File.exists?(doxfile)
puts "Doxfile could not be found.".red
exit(1)
end
@tasks = Hash.new
+ @pvr = Provisioner.new(opts)
instance_eval(File.read(doxfile), doxfile)
end
# Methods ============================================
- def invoke(task_key, opts)
+ def invoke(task_key)
begin
task = @tasks[task_key.to_sym]
return if task.done
- task.deps.each { |dep| invoke(dep, opts) }
+ task.deps.each { |dep| invoke(dep) }
info "[#{task_key}] Starting..."
- Provisioner.new(task.block, opts)
+ @pvr.run(task.block)
task.done = true
info "[#{task_key}] Done".green
rescue => e
err "[#{task_key}] Failed".red
puts e.message.red