Skip to content

Commit eed9fbe

Browse files
author
Jonathan Claudius
committed
Lose assignment in conditional
1 parent c496d2c commit eed9fbe

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

modules/post/multi/gather/rubygems_api_key.rb

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

47-
if key = YAML.load(read_file(path))[:rubygems_api_key]
48-
rubygems_api_key = key
49-
else
50-
next
51-
end
52-
47+
rubygems_api_key = YAML.load(read_file(path))[:rubygems_api_key]
48+
next unless rubygems_api_key.nil?
49+
5350
print_good("Found a RubyGems API Key: #{rubygems_api_key}")
5451

5552
loot_path = store_loot("host.rubygems.apikey",

0 commit comments

Comments
 (0)