licensee/docs/customizing.md

34 lines
1.4 KiB
Markdown
Raw Normal View History

2018-02-07 01:22:05 +08:00
## Customizing Licensee's behavior
2016-09-22 22:45:17 +08:00
2018-02-07 01:22:05 +08:00
### Adjusting the confidence threshold
2016-09-22 22:45:17 +08:00
If you'd like, you can make Licensee less stringent in its comparison, but risk getting false positives as a result. The confidence threshold is an integer between 1 and 100, with the default being 98, meaning that License is at least 98% confident that the file represents the matched license.
2016-09-22 22:45:17 +08:00
```ruby
LICENSEE.confidence_threshold
=> 98
2016-09-22 22:45:17 +08:00
LICENSEE.confidence_threshold = 90
=> 90
```
2018-02-07 01:22:05 +08:00
### Matching package manager metadata
2016-09-22 22:45:17 +08:00
Licensee supports the ability to take into account Ruby, Node and CRAN package manager metadata, disabled by default. [There are reasons you may not want to use this metadata](what-we-look-at.md). You can explicitly instruct licensee to take this information into account as follows:
2016-09-22 22:45:17 +08:00
```ruby
project = Licensee.project("path/to/project", detect_packages: true)
2016-09-22 22:45:17 +08:00
project.license
=> #<Licensee::Licensee key="mit">
```
2018-02-07 01:22:05 +08:00
### Matching project README license references
2016-09-22 22:45:17 +08:00
Licensee supports the ability to take into account human readable references to licenses within the project's README, disabled by default. [There are reasons you may not want to use this](what-we-look-at.md). You can explicitly instruct licensee to take this information into account as follows:
2016-09-22 22:45:17 +08:00
```ruby
project = Licensee.project("path/to/project", detect_readme: true)
2016-09-22 22:45:17 +08:00
project.license
=> #<Licensee::Licensee key="mit">
```