Skip to content

Commit d8200c6

Browse files
author
Tod Beardsley
committed
Strip safely, avoid nil.strip errors
1 parent 5b3d877 commit d8200c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/post/multi/gather/rubygems_api_key.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def run
4848
def extract_key(path)
4949
data = read_file(path)
5050
keys = data.split(':').select { |k| k =~ /[0-9a-f]{32}/ }
51-
keys.first.strip
51+
keys.map {|k| k.strip}.first
5252
end
5353

5454
def download_key(paths)

0 commit comments

Comments
 (0)