Sha256: a4685e56a6c6a3fb7f4d44508193bc2f333c354c1d53b678e9867381f5448408
Contents?: true
Size: 653 Bytes
Versions: 13
Compression:
Stored size: 653 Bytes
Contents
# frozen_string_literal: true module RBS module Collection class Cleaner attr_reader :lock def initialize(lockfile_path:) @lock = Config.from_path(lockfile_path) end def clean lock.repo_path.glob('*/*') do |dir| *_, gem_name, version = dir.to_s.split('/') gem_name or raise version or raise next if needed? gem_name, version FileUtils.remove_entry_secure(dir.to_s) end end def needed?(gem_name, version) gem = lock.gem(gem_name) return false unless gem gem['version'] == version end end end end
Version data entries
13 entries across 13 versions & 2 rubygems