class Licensee::ProjectFiles::PackageManagerFile

Constants

FILENAMES_EXTENSIONS

Hash of Filename => [possible matchers]

FILENAMES_SCORES
MATCHERS_EXTENSIONS

Hash of Extension => [possible matchers]

Public Class Methods

name_score(filename) click to toggle source
# File lib/licensee/project_files/package_manager_file.rb, line 36
def self.name_score(filename)
  return 1.0 if ['.gemspec', '.cabal', '.nuspec'].include?(File.extname(filename))

  FILENAMES_SCORES[filename] || 0.0
end

Public Instance Methods

possible_matchers() click to toggle source
# File lib/licensee/project_files/package_manager_file.rb, line 32
def possible_matchers
  MATCHERS_EXTENSIONS[extension] || FILENAMES_EXTENSIONS[filename] || []
end

Private Instance Methods

extension() click to toggle source
# File lib/licensee/project_files/package_manager_file.rb, line 44
def extension
  @extension ||= File.extname(filename)
end