Class: Licensee

Inherits:
Object
  • Object
show all
Defined in:
lib/licensee.rb,
lib/licensee/license.rb,
lib/licensee/project.rb,
lib/licensee/version.rb,
lib/licensee/project_file.rb,
lib/licensee/content_helper.rb,
lib/licensee/matchers/dice_matcher.rb,
lib/licensee/matchers/exact_matcher.rb,
lib/licensee/matchers/gemspec_matcher.rb,
lib/licensee/matchers/package_matcher.rb,
lib/licensee/matchers/copyright_matcher.rb,
lib/licensee/matchers/npm_bower_matcher.rb

Defined Under Namespace

Modules: ContentHelper, Matchers Classes: FSProject, GitProject, InvalidLicense, License, Project

Constant Summary collapse

CONFIDENCE_THRESHOLD =

Over which percent is a match considered a match by default

90
DOMAIN =

Base domain from which to build license URLs

"http://choosealicense.com"
VERSION =
"6.0.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.confidence_thresholdObject



38
39
40
# File 'lib/licensee.rb', line 38

def confidence_threshold
  @confidence_threshold ||= CONFIDENCE_THRESHOLD
end

Class Method Details

.license(path) ⇒ Object

Returns the license for a given path



30
31
32
33
34
35
36
# File 'lib/licensee.rb', line 30

def license(path)
  begin
    Licensee::GitProject.new(path).license
  rescue Licensee::GitProject::InvalidRepository
    Licensee::FSProject.new(path).license
  end
end

.licenses(options = {}) ⇒ Object

Returns an array of Licensee::License instances



25
26
27
# File 'lib/licensee.rb', line 25

def licenses(options={})
  Licensee::License.all(options)
end