lib/bagit/info.rb in bagit-0.0.4 vs lib/bagit/info.rb in bagit-0.1.0

- old
+ new

@@ -2,31 +2,31 @@ module BagIt module Info - def package_info_txt_file - File.join bag_dir, 'package-info.txt' + def bag_info_txt_file + File.join bag_dir, 'bag-info.txt' end - def package_info - read_info_file package_info_txt_file + def bag_info + read_info_file bag_info_txt_file end - def write_package_info(hash) - write_info_file package_info_txt_file, hash + def write_bag_info(hash) + write_info_file bag_info_txt_file, hash end def bagit_txt_file File.join bag_dir, 'bagit.txt' end - def bag_info + def bagit read_info_file bagit_txt_file end - def write_bag_info(hash) + def write_bagit(hash) write_info_file bagit_txt_file, hash end protected @@ -35,10 +35,10 @@ open(file) do |io| entries = io.read.split /\n(?=[^\s])/ entries.inject({}) do |hash, line| - name, value = line.chomp.split /\s*:\s*/ + name, value = line.chomp.split /\s*:\s*/, 2 hash.merge({name => value}) end end