lib/docman/deployers/deployer.rb in docman-0.0.13 vs lib/docman/deployers/deployer.rb in docman-0.0.14
- old
+ new
@@ -51,11 +51,11 @@
end
end
stored_config_hash = read_version_file_param('config_hash')
@config_hash = Docman::Application.instance.config.config_hash
- @config_yaml = Docman::Application.instance.config.to_yaml
+ @config_yaml = Docman::Application.instance.config.unmutable_config.to_yaml
#TODO: need to refactor
stored_docroot_config_hash = read_version_file_param('docroot_config_hash')
@docroot_config_hash = @docroot_config.config_hash
@docroot_config_yaml = @docroot_config.raw_infos.to_yaml
@@ -64,11 +64,11 @@
filename = File.join(@docroot_config.root['full_build_path'], 'config.yaml')
log Diffy::Diff.new(read_file(filename), @config_yaml) if File.file? filename
Docman::Application.instance.force = true
end
if stored_docroot_config_hash != @docroot_config_hash
- log 'Forced rebuild as configuration was changed', 'info'
+ log 'Forced rebuild as docroot configuration was changed', 'info'
filename = File.join(@docroot_config.root['full_build_path'], 'docroot_config.yaml')
log Diffy::Diff.new(read_file(filename), @docroot_config_yaml) if File.file? filename
Docman::Application.instance.force = true
end
end
@@ -103,11 +103,12 @@
end
def read_file(path)
YAML::load_file(path)
rescue
- raise "Error in config file #{path}"
+ log "Error in config file #{path}"
+ return false
end
def read_version_file_param(param)
path = File.join(@docroot_config.root['full_build_path'], 'version.yaml')
return false unless File.file?(path)
@@ -122,10 +123,10 @@
to_write['docroot_config_hash'] = @docroot_config_hash
File.open(path, 'w') {|f| f.write to_write.to_yaml}
end
def write_config_file(config, path)
- File.open(path, 'w') {|f| f.write config.to_yaml}
+ File.open(path, 'w') {|f| f.write config}
end
def build
if self['name'].nil?
build_recursive
\ No newline at end of file