lib/kafo/configuration.rb in kafo-0.7.6 vs lib/kafo/configuration.rb in kafo-0.8.0
- old
+ new
@@ -83,11 +83,11 @@
def set_custom(key, value)
custom_storage[key.to_sym] = value
end
def modules
- @modules ||= @data.keys.map { |mod| PuppetModule.new(mod, KafoParsers::PuppetModuleParser, self).parse }.sort
+ @modules ||= @data.keys.map { |mod| PuppetModule.new(mod, PuppetModule.find_parser, self).parse }.sort
end
def root_dir
File.expand_path(app[:installer_dir])
end
@@ -107,11 +107,11 @@
def kafo_modules_dir
app[:kafo_modules_dir] || (gem_root + '/modules')
end
def add_module(name)
- mod = PuppetModule.new(name, KafoParsers::PuppetModuleParser, self).parse
+ mod = PuppetModule.new(name, PuppetModule.find_parser, self).parse
unless modules.map(&:name).include?(mod.name)
mod.enable
@modules << mod
end
end
@@ -231,20 +231,12 @@
def log_file
File.join(app[:log_dir], app[:log_name])
end
- def log_files_pattern
- log_file.sub(/(\.log)\Z/i) { |suffix| "{.[0-9]*,}#{suffix}" }
- end
-
- def log_files
- Dir.glob(log_files_pattern)
- end
-
def log_exists?
- log_files.any? { |f| File.size(f) > 0 }
+ File.exists?(log_file) && File.size(log_file) > 0
end
def answers
@data
end
@@ -257,10 +249,9 @@
save_configuration(app)
store(answers)
migrations.store_applied
@logger.info("#{migrations.migrations.count} migration/s were applied. Updated configuration was saved.")
end
- migrations.migrations.count
end
def migrations_dir
@config_file.gsub(/\.yaml$/, '.migrations')
end