lib/spandx/gateways/nuget.rb in spandx-0.4.1 vs lib/spandx/gateways/nuget.rb in spandx-0.5.0

- old
+ new

@@ -14,17 +14,17 @@ @guess = Guess.new(catalogue) @host = 'api.nuget.org' end def update!(index, limit: nil) - counter = Concurrent::AtomicFixnum.new(0) + counter = 0 each do |spec| upsert_into!(index, spec) if limit - counter.increment - break if counter.value > limit + counter += 1 + break if counter > limit end end end def licenses_for(name, version) @@ -102,13 +102,12 @@ def upsert_into!(index, spec) key = [host, spec['id'], spec['version']] return if index.indexed?(key) - if (license = spec['licenseExpression']) - index.write(key, license) - end - puts [license, key].inspect + return unless spec['licenseExpression'] + + index.write(key, spec['licenseExpression']) end end end end