Sha256: 4c37fed482845b099f8b5fe1de76afd0e050ed8c8f69f68cd4779a1d58bc3c4f
Contents?: true
Size: 859 Bytes
Versions: 1
Compression:
Stored size: 859 Bytes
Contents
module Licensee class Project class File attr_reader :content, :filename ENCODING = Encoding::UTF_8 ENCODING_OPTIONS = { invalid: :replace, undef: :replace, replace: '' }.freeze def initialize(content, filename = nil) @content = content @content.force_encoding(ENCODING) unless @content.valid_encoding? @content.encode!(ENCODING, ENCODING_OPTIONS) end @filename = filename end def matcher @matcher ||= possible_matchers.map { |m| m.new(self) }.find(&:match) end # Returns the percent confident with the match def confidence matcher && matcher.confidence end def license matcher && matcher.match end alias match license alias path filename end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
licensee-8.9.2 | lib/licensee/project_file.rb |