lib/licensee/project_files/license_file.rb in licensee-9.16.0 vs lib/licensee/project_files/license_file.rb in licensee-9.16.1

- old
+ new

@@ -5,33 +5,33 @@ class LicenseFile < Licensee::ProjectFiles::ProjectFile include Licensee::ContentHelper # List of extensions to give preference to PREFERRED_EXT = %w[md markdown txt html].freeze - PREFERRED_EXT_REGEX = /\.#{Regexp.union(PREFERRED_EXT)}\z/.freeze + PREFERRED_EXT_REGEX = /\.#{Regexp.union(PREFERRED_EXT)}\z/ # Regex to match any extension except .spdx or .header - LICENSE_EXT_REGEX = %r{\.(?!spdx|header)[^./]+\z}i.freeze + LICENSE_EXT_REGEX = %r{\.(?!spdx|header)[^./]+\z}i # Regex to match any extension except a few unlikely as license # texts with complex filenames - OTHER_EXT_REGEX = %r{\.(?!xml|go|gemspec)[^./]+\z}i.freeze + OTHER_EXT_REGEX = %r{\.(?!xml|go|gemspec)[^./]+\z}i # Regex to match any extension - ANY_EXT_REGEX = %r{\.[^./]+\z}i.freeze + ANY_EXT_REGEX = %r{\.[^./]+\z}i # Regex to match, LICENSE, LICENCE, unlicense, etc. - LICENSE_REGEX = /(un)?licen[sc]e/i.freeze + LICENSE_REGEX = /(un)?licen[sc]e/i # Regex to match COPYING, COPYRIGHT, etc. - COPYING_REGEX = /copy(ing|right)/i.freeze + COPYING_REGEX = /copy(ing|right)/i # Regex to match OFL. - OFL_REGEX = /ofl/i.freeze + OFL_REGEX = /ofl/i # BSD + PATENTS patent file - PATENTS_REGEX = /patents/i.freeze + PATENTS_REGEX = /patents/i # Hash of Regex => score with which to score potential license files FILENAME_REGEXES = { /\A#{LICENSE_REGEX}\z/ => 1.00, # LICENSE /\A#{LICENSE_REGEX}#{PREFERRED_EXT_REGEX}\z/ => 0.95, # LICENSE.md @@ -53,10 +53,10 @@ # CC-NC and CC-ND are not open source licenses and should not be # detected as CC-BY or CC-BY-SA which are 98%+ similar CC_FALSE_POSITIVE_REGEX = / ^(creative\ commons\ )?Attribution-(NonCommercial|NoDerivatives) - /xi.freeze + /xi def possible_matchers [Matchers::Copyright, Matchers::Exact, Matchers::Dice] end