lib/shaddox/config.rb in shaddox-0.0.6 vs lib/shaddox/config.rb in shaddox-0.0.7
- old
+ new
@@ -1,21 +1,24 @@
module Shaddox
class Config
attr_accessor :servers, :targets, :repos, :tasks
- def initialize(doxfilename = "./Doxfile")
+ def initialize(doxfile)
+ doxfile = './Doxfile' unless doxfile
if !File.exists?(doxfilename)
puts "Doxfile could not be found.".red
exit(1)
end
@servers = Hash.new
@targets = Hash.new {|hsh, key| @servers[key]} # Fall back on @servers hash for missing targets
@tasks = Hash.new
@repos = Hash.new
+ # :local and :localhost point to local by default
@targets[:localhost] = Localhost.new
+ @targets[:local] = :localhost
- instance_eval(File.read(doxfilename), doxfilename)
+ instance_eval(File.read(doxfile), doxfile)
end
def explode_target(target_key)
exploded = []
[@targets[target_key]].flatten.each do |target|