module Licensee
Filesystem-based project
Analyze a folder on the filesystem for license information
Git-based project
Analyze a given (bare) Git repository for license information
Constants
- CONFIDENCE_THRESHOLD
Over which percent is a match considered a match by default
- DOMAIN
Base domain from which to build license URLs
- VERSION
Attributes
confidence_threshold[W]
Public Class Methods
confidence_threshold()
click to toggle source
# File lib/licensee.rb, line 53 def confidence_threshold @confidence_threshold ||= CONFIDENCE_THRESHOLD end
inverse_confidence_threshold()
click to toggle source
Inverse of the confidence threshold, represented as a float By default this will be 0.05
# File lib/licensee.rb, line 59 def inverse_confidence_threshold @inverse ||= (1 - Licensee.confidence_threshold / 100.0).round(2) end
license(path)
click to toggle source
Returns the license for a given path
# File lib/licensee.rb, line 43 def license(path) Licensee.project(path).license end
licenses(options = {})
click to toggle source
Returns an array of Licensee::License instances
# File lib/licensee.rb, line 38 def licenses(options = {}) Licensee::License.all(options) end
project(path, **args)
click to toggle source
# File lib/licensee.rb, line 47 def project(path, **args) Licensee::GitProject.new(path, args) rescue Licensee::GitProject::InvalidRepository Licensee::FSProject.new(path, args) end