lib/shaddox/provisioner.rb in shaddox-0.1.0 vs lib/shaddox/provisioner.rb in shaddox-0.1.1

- old
+ new

@@ -13,13 +13,16 @@ require 'fileutils' # Init ==================================================== - def initialize(block, opts = {:verbose => false}) + def initialize(opts = {:verbose => false}) @verbose = opts[:verbose] @required = true + end + + def run(block) instance_eval(&block) unless !block end # Methods ================================================= @@ -57,10 +60,10 @@ end def ln_s(source, dest, opts = {}) mkdir(dest.exp_path.parent) Dir.glob(source.exp_path).each { |src| - info "Linking '#{source.exp_path}' to '#{dest.exp_path}'", 1 if @verbose + info "Linking '#{src.exp_path}' to '#{dest.exp_path}'", 1 if @verbose FileUtils::ln_s(src, dest.exp_path, opts) } end def mkdir(path)