Sha256: 6de985cb6ca0e17fb56c3c38117a19249a1add418fa9e14b4aa18eff1c1f05f8

Contents?: true

Size: 476 Bytes

Versions: 2

Compression:

Stored size: 476 Bytes

Contents

module LicenseFinder
  class PackageManager
    attr_reader :logger

    def initialize options={}
      @logger       = options[:logger] || LicenseFinder::Logger::Default.new
      @package_path = options[:package_path] # dependency injection for tests
    end

    def active?
      injected_package_path.exist?.tap { |is_active| logger.active self.class, is_active }
    end

    private

    def injected_package_path
      @package_path || package_path
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
license_finder-1.2 lib/license_finder/package_manager.rb
license_finder-1.2-java lib/license_finder/package_manager.rb