Sha256: c5f994a27a7bf6af40393d6ce7dc9d0017d21f9c59455c727ba1bf8d76c4f499
Contents?: true
Size: 763 Bytes
Versions: 10
Compression:
Stored size: 763 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.encode!(ENCODING, ENCODING_OPTIONS) @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
10 entries across 10 versions & 1 rubygems