flazz-bagit 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bagit.gemspec +1 -1
- data/lib/bagit/manifest.rb +4 -4
- metadata +1 -1
data/bagit.gemspec
CHANGED
data/lib/bagit/manifest.rb
CHANGED
@@ -78,7 +78,7 @@ module BagIt
|
|
78
78
|
(manifest_files + tagmanifest_files).all? do |mf|
|
79
79
|
# extract the algorithm
|
80
80
|
mf =~ /manifest-(.+).txt$/
|
81
|
-
|
81
|
+
|
82
82
|
algo = case $1
|
83
83
|
when /sha1/i
|
84
84
|
Digest::SHA1
|
@@ -91,13 +91,13 @@ module BagIt
|
|
91
91
|
# check it, an unknown algorithm is always true
|
92
92
|
unless algo == :unknown
|
93
93
|
lines = open(mf) { |io| io.readlines }
|
94
|
-
|
94
|
+
|
95
95
|
lines.all? do |line|
|
96
96
|
manifested_digest, path = line.chomp.split /\s+/, 2
|
97
97
|
actual_digest = open(File.join(@bag_dir, path)) { |io| algo.hexdigest io.read }
|
98
98
|
actual_digest == manifested_digest
|
99
99
|
end
|
100
|
-
|
100
|
+
|
101
101
|
else
|
102
102
|
true
|
103
103
|
end
|
@@ -105,7 +105,7 @@ module BagIt
|
|
105
105
|
end
|
106
106
|
|
107
107
|
end
|
108
|
-
|
108
|
+
|
109
109
|
end
|
110
110
|
|
111
111
|
end
|