Class: Licensee::Project::PackageInfo

Inherits:
File
  • Object
show all
Defined in:
lib/licensee/project_file.rb

Instance Attribute Summary

Attributes inherited from File

#content, #filename

Class Method Summary collapse

Instance Method Summary collapse

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



70
71
72
73
74
75
# File 'lib/licensee/project_file.rb', line 70

def self.name_score(filename)
  return 1.0  if ::File.extname(filename) == ".gemspec"
  return 1.0  if filename == "package.json"
  return 0.75 if filename == "bower.json"
  return 0.0
end

Instance Method Details

#possible_matchersObject



59
60
61
62
63
64
65
66
67
68
# File 'lib/licensee/project_file.rb', line 59

def possible_matchers
  case ::File.extname(filename)
  when ".gemspec"
    [Matchers::Gemspec]
  when ".json"
    [Matchers::NpmBower]
  else
    []
  end
end