lib/licensee/project_files/license_file.rb in licensee-9.11.0 vs lib/licensee/project_files/license_file.rb in licensee-9.12.0
- old
+ new
@@ -1,12 +1,14 @@
+# frozen_string_literal: true
+
module Licensee
module ProjectFiles
class LicenseFile < Licensee::ProjectFiles::ProjectFile
include Licensee::ContentHelper
# List of extensions to give preference to
- PREFERRED_EXT = %w[md markdown txt].freeze
+ PREFERRED_EXT = %w[md markdown txt html].freeze
PREFERRED_EXT_REGEX = /\.#{Regexp.union(PREFERRED_EXT)}\z/.freeze
# Regex to match any extension except .spdx or .header
OTHER_EXT_REGEX = %r{\.(?!spdx|header|gemspec)[^./]+\z}i.freeze
@@ -70,14 +72,14 @@
def lgpl?
LicenseFile.lesser_gpl_score(filename) == 1 && license && license.lgpl?
end
def gpl?
- license && license.gpl?
+ license&.gpl?
end
def license
- if matcher && matcher.match
+ if matcher&.match
matcher.match
else
License.find('other')
end
end