lib/confuse/config.rb in confuse-0.1.3 vs lib/confuse/config.rb in confuse-0.1.4

- old
+ new

@@ -10,11 +10,20 @@ # Super class for configuration in order to have multiple instances. class ConfigBase include ConfigMixin extend DSL - def initialize(*paths) - load_namespaces(self.class.namespaces) + def namespaces + @namespaces ||= {} + end + + def initialize(options = {}) + load_namespaces(self.class.namespaces.clone) + paths = options[:paths] || [] + load_defaults = begin + d = options[:load_defaults] + d.nil? ? true : d + end if paths.flatten.empty? read_files(self.class.config_path.flatten) else read_files(paths.flatten) end