File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env ruby
2
2
# frozen_string_literal: true
3
3
4
- require ' digest/sha2'
5
- gems = Dir [ ' *.gem' ]
4
+ require " digest/sha2"
5
+ gems = Dir [ " *.gem" ]
6
6
puts "Found: #{ gems . inspect } "
7
- raise 'Too Many Gems' if gems . length > 1
7
+ raise "No Gems" if gems . length . zero?
8
+ raise "Too Many Gems" if gems . length > 1
8
9
9
10
built_gem_path = gems . first
10
- checksum_512 = Digest ::SHA512 . new . hexdigest ( File . read ( built_gem_path ) )
11
- checksum_512_path = "checksums/#{ built_gem_path } .sha512"
12
- File . open ( checksum_512_path , 'w' ) { | f | f . write ( checksum_512 ) }
11
+ checksum512 = Digest ::SHA512 . new . hexdigest ( File . read ( built_gem_path ) )
12
+ checksum512_path = "checksums/#{ built_gem_path } .sha512"
13
+ File . write ( checksum512_path , checksum512 )
13
14
14
- checksum_256 = Digest ::SHA256 . new . hexdigest ( File . read ( built_gem_path ) )
15
- checksum_256_path = "checksums/#{ built_gem_path } .sha256"
16
- File . open ( checksum_256_path , 'w' ) { | f | f . write ( checksum_256 ) }
15
+ checksum256 = Digest ::SHA256 . new . hexdigest ( File . read ( built_gem_path ) )
16
+ checksum256_path = "checksums/#{ built_gem_path } .sha256"
17
+ File . write ( checksum256_path , checksum256 )
17
18
18
19
puts "You must now git add and commit '#{ checksum_256_path } ' and '#{ checksum_512_path } '"
You can’t perform that action at this time.
0 commit comments