Class Licensee::Project::LicenseFile
In: lib/licensee/project_files/license_file.rb
Parent: Licensee::Project::File

Methods

Included Modules

Licensee::ContentHelper

Constants

PREFERRED_EXT = %w(md markdown txt).freeze   List of extensions to give preference to
PREFERRED_EXT_REGEX = /\.#{Regexp.union(PREFERRED_EXT)}\z/
ANY_EXT_REGEX = %r{\.[^./]+\z}   Regex to match any extension
LICENSE_REGEX = /(un)?licen[sc]e/i   Regex to match, LICENSE, LICENCE, unlicense, etc.
COPYING_REGEX = /copy(ing|right)/i   Regex to match COPYING, COPYRIGHT, etc.
FILENAME_REGEXES = { /\A#{LICENSE_REGEX}\z/ => 1.0, # LICENSE /\A#{LICENSE_REGEX}#{PREFERRED_EXT_REGEX}\z/ => 0.9, # LICENSE.md /\A#{COPYING_REGEX}\z/ => 0.8, # COPYING /\A#{COPYING_REGEX}#{PREFERRED_EXT_REGEX}\z/ => 0.7, # COPYING.md /\A#{LICENSE_REGEX}#{ANY_EXT_REGEX}\z/ => 0.6, # LICENSE.textile /\A#{COPYING_REGEX}#{ANY_EXT_REGEX}\z/ => 0.5, # COPYING.textile /#{LICENSE_REGEX}/ => 0.4, # LICENSE-MIT /#{COPYING_REGEX}/ => 0.3, # COPYING-MIT // => 0.0   Hash of Regex => score with which to score potential license files

Public Class methods

case-insensitive block to determine if the given file is LICENSE.lesser

Public Instance methods

[Validate]