Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Commit

Permalink
Task for building SHA512 checksums.
Browse files Browse the repository at this point in the history
Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
  • Loading branch information
Yorick Peterse committed Mar 9, 2013
1 parent 7a92e5b commit daa816f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'rubygems/package_task'
require 'digest/sha2'

GEMSPEC = Gem::Specification.load('ruby-lint.gemspec')

Expand Down
Empty file added checksum/.gitkeep
Empty file.
14 changes: 14 additions & 0 deletions task/checksum.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
desc 'Creates SHA512 checksums for all built Gems'
task :checksum do
checksums = File.expand_path('../../checksum', __FILE__)
pattern = File.expand_path('../../pkg/*.gem', __FILE__)

Dir.glob(pattern).each do |path|
name = File.basename(path) + '.sha512'
checksum = Digest::SHA512.new.hexdigest(File.read(path))

File.open(File.join(checksums, name), 'w') do |handle|
handle.write(checksum)
end
end
end

0 comments on commit daa816f

Please sign in to comment.