Sha256: 2052c5fb5b8b11ceef08b536306dd0786c5a38498b2b280854a682b516046c2d

Contents?: true

Size: 571 Bytes

Versions: 5

Compression:

Stored size: 571 Bytes

Contents

module LicenseFinder
  class PossibleLicenseFile
    def initialize(install_path, file_path)
      @install_path = Pathname.new(install_path)
      @file_path = Pathname.new(file_path)
    end

    # Unused, except in tests, but might be useful if LF ever reports the
    # locations of all the files it searched.
    def file_path
      @file_path.relative_path_from(@install_path).to_s
    end

    def text
      @text ||= @file_path.send(@file_path.respond_to?(:binread) ? :binread : :read)
    end

    def license
      License.find_by_text(text)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
license_finder-1.1.1-java lib/license_finder/possible_license_file.rb
license_finder-1.1.1 lib/license_finder/possible_license_file.rb
license_finder-1.1.0 lib/license_finder/possible_license_file.rb
license_finder-1.0.1 lib/license_finder/possible_license_file.rb
license_finder-1.0.0.1 lib/license_finder/possible_license_file.rb