Class: Licensee::Project::LicenseFile
- Includes:
- ContentHelper
- Defined in:
- lib/licensee/project_files/license_file.rb
Direct Known Subclasses
Constant Summary
Constants included from ContentHelper
Instance Attribute Summary
Attributes inherited from File
Class Method Summary collapse
Instance Method Summary collapse
Methods included from ContentHelper
#content_normalized, #hash, #wordset
Methods inherited from File
#confidence, #initialize, #license, #matcher
Constructor Details
This class inherits a constructor from Licensee::Project::File
Class Method Details
.name_score(filename) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/licensee/project_files/license_file.rb', line 15 def self.name_score(filename) return 1.0 if filename =~ /\A(un)?licen[sc]e\z/i return 0.9 if filename =~ /\A(un)?licen[sc]e\.(md|markdown|txt)\z/i return 0.8 if filename =~ /\Acopy(ing|right)(\.[^.]+)?\z/i return 0.7 if filename =~ /\A(un)?licen[sc]e\.[^.]+\z/i return 0.5 if filename =~ /licen[sc]e/i 0.0 end |