From 4aebb3dc53f29bd616dc7010456610f8dad31020 Mon Sep 17 00:00:00 2001 From: Alan deLevie Date: Sun, 9 Jun 2013 13:49:55 -0400 Subject: [PATCH 1/3] uses Digest::MD5::hexdigest instead of md5sum --- Rakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 83dd95c1..373d7cdd 100644 --- a/Rakefile +++ b/Rakefile @@ -6,6 +6,7 @@ require 'yaml' require 'rake' require 'rdoc/task' require 'rspec/core/rake_task' +require 'digest/md5' # Cane requires ripper, which appears to only work on MRI 1.9 if RUBY_VERSION >= "1.9" && RUBY_ENGINE == "ruby" @@ -56,7 +57,7 @@ task :integrity_yaml do path_without_spec = path.gsub("spec/","") data[path_without_spec] = { :bytes => File.size(path), - :md5 => `md5sum "#{path}"`.split.first + :md5 => Digest::MD5.hexdigest(File.read(path)) } if File.file?(path) end File.open("spec/integrity.yml","wb") { |f| f.write YAML.dump(data)} From dedeec20f677c3442b9a089c3bc3bd6f655f90af Mon Sep 17 00:00:00 2001 From: Alan deLevie Date: Sun, 9 Jun 2013 16:29:56 -0400 Subject: [PATCH 2/3] forced UTF-8 encoding of md5 for integrity_yaml --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 373d7cdd..6dc26737 100644 --- a/Rakefile +++ b/Rakefile @@ -57,7 +57,7 @@ task :integrity_yaml do path_without_spec = path.gsub("spec/","") data[path_without_spec] = { :bytes => File.size(path), - :md5 => Digest::MD5.hexdigest(File.read(path)) + :md5 => Digest::MD5.file(path).hexdigest.encode('UTF-8') } if File.file?(path) end File.open("spec/integrity.yml","wb") { |f| f.write YAML.dump(data)} From deb2ac378f3a05f3f7e8174cbbe179f2b5cada3c Mon Sep 17 00:00:00 2001 From: James Healy Date: Sun, 23 Jun 2013 22:42:43 +1000 Subject: [PATCH 3/3] Revert "forced UTF-8 encoding of md5 for integrity_yaml" This reverts commit dedeec20f677c3442b9a089c3bc3bd6f655f90af. --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 6dc26737..373d7cdd 100644 --- a/Rakefile +++ b/Rakefile @@ -57,7 +57,7 @@ task :integrity_yaml do path_without_spec = path.gsub("spec/","") data[path_without_spec] = { :bytes => File.size(path), - :md5 => Digest::MD5.file(path).hexdigest.encode('UTF-8') + :md5 => Digest::MD5.hexdigest(File.read(path)) } if File.file?(path) end File.open("spec/integrity.yml","wb") { |f| f.write YAML.dump(data)}