Module: Licensee
- Defined in:
- lib/licensee/projects/fs_project.rb,
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/project_files/readme.rb,
lib/licensee/projects/git_project.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,
lib/licensee/project_files/license_file.rb,
lib/licensee/project_files/package_info.rb
Overview
Git-based project
analyze a given git repository for license information
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'.freeze
- VERSION =
'7.0.0'.freeze
Class Attribute Summary collapse
Class Method Summary collapse
-
.license(path) ⇒ Object
Returns the license for a given path.
-
.licenses(options = {}) ⇒ Object
Returns an array of Licensee::License instances.
- .project(path) ⇒ Object
Class Attribute Details
.confidence_threshold ⇒ Object
50 51 52 |
# File 'lib/licensee.rb', line 50 def confidence_threshold @confidence_threshold ||= CONFIDENCE_THRESHOLD end |
Class Method Details
.license(path) ⇒ Object
Returns the license for a given path
40 41 42 |
# File 'lib/licensee.rb', line 40 def license(path) Licensee.project(path).license end |
.licenses(options = {}) ⇒ Object
Returns an array of Licensee::License instances
35 36 37 |
# File 'lib/licensee.rb', line 35 def licenses( = {}) Licensee::License.all() end |
.project(path) ⇒ Object
44 45 46 47 48 |
# File 'lib/licensee.rb', line 44 def project(path) Licensee::GitProject.new(path) rescue Licensee::GitProject::InvalidRepository Licensee::FSProject.new(path) end |