lib/review/catalog.rb in review-4.2.0 vs lib/review/catalog.rb in review-5.0.0

- old
+ new

@@ -39,11 +39,11 @@ part_list.flatten.compact end def replace_part(old_name, new_name) @yaml['CHAPS'].map! do |e| - if e.is_a?(Hash) and (e.keys.first == old_name) + if e.is_a?(Hash) && (e.keys.first == old_name) e = { new_name => e.values.first } end e end end @@ -87,10 +87,10 @@ end if postdef.present? filenames.concat(postdef) end filenames.each do |filename| - refile = File.join(basedir, config['contentdir'], filename) + refile = File.expand_path(File.join(config['contentdir'], filename), basedir) unless File.exist?(refile) raise FileNotFound, "file not found in catalog.yml: #{refile}" end end end