lib/spandx/core/cache.rb in spandx-0.11.0 vs lib/spandx/core/cache.rb in spandx-0.12.0

- old
+ new

@@ -3,17 +3,17 @@ module Spandx module Core class Cache attr_reader :db, :package_manager - def initialize(package_manager, url:) + def initialize(package_manager, db: Spandx.git[:cache]) @package_manager = package_manager - @db = ::Spandx::Core::Database.new(url: url) + @db = db @cache = {} @lines = {} end - def licenses_for(name:, version:) + def licenses_for(name, version) found = search(name: name, version: version) Spandx.logger.debug("Cache miss: #{name}-#{version}") if found.nil? found ? found[2].split('-|-') : [] end