Commit Graph

243 Commits

Author SHA1 Message Date
Ben Balter 1bde890782
abstract copyright regex 2017-01-02 14:32:26 -05:00
Ben Balter 38e3cdeffa Bump to 8.7.0 2016-11-15 13:55:16 -05:00
Ben Balter ecbd14ec24 obay the rubocop 2016-11-11 16:16:13 -05:00
Ben Balter 9eeba32652 expose license rules 2016-11-11 15:02:45 -05:00
Ben Balter f5e3358aab fix rubocop offense 2016-10-25 11:52:43 -04:00
Sebastian Schuberth 9cc65afe99 fs_project: Fix for calling "files" with a file multiple times
This fixes a bug where calling FSProject.files with a single file for the
second time would return all files in the directory instead of that single
file. This is because in case of a single file the original implementation
would overwrite @path with the directory of the single file. The next time
FSProject.files is called, @path is not a file anymore, and the pattern
will be set to "*", matching all files.

Fix this by splitting the path into directory and pattern, and always
constructing the path from these.
2016-10-25 16:35:13 +02:00
Sebastian Schuberth 282999a230 fs_project: Fix globbing Windows paths
Dir.glob() does not take backslashes, not even when running on Windows,
see http://stackoverflow.com/a/20668433/1127485.
2016-10-25 16:35:13 +02:00
Sebastian Schuberth 9c3c9f05f5 Fix minor typos in some comments 2016-10-25 16:35:08 +02:00
Ben Balter 6307ba2ff5 Revert "Fixes to running licensee against a single file (on Windows)" 2016-10-25 10:07:09 -04:00
Sebastian Schuberth 8c78d98c65 Do not create the list of files multiple times
This is a performance optimization to avoid expressions like "files.empty?
|| files.nil?" like in "project.rb" to trigger the creation of the list of
files multiple times.

As a side effect, this fixes a bug where calling FSProject.files with a
single file for the second time would return all files in the directory
instaed of that single file. This is because in case of a single file the
implementation overwrites @path with the directory of the single file.
The next time FSProject.files is called, @path is not a file anymore, and
the pattern will be set to "*", matching all files.
2016-10-25 15:41:35 +02:00
Sebastian Schuberth 908f2a1c62 fs_project: Fix globbing Windows paths
Dir.glob() does not take backslashes, not even when running on Windows,
see http://stackoverflow.com/a/20668433/1127485.
2016-10-25 15:26:35 +02:00
Sebastian Schuberth 63029a2f8f project: Fix a minor typo in a comment 2016-10-25 15:25:33 +02:00
Paul Chaignon 7459d2b23b Recognize underlined license headers in READMEs
The following license header will now be recognized
as the beginning of a license text in a README
    License
    -------
2016-10-07 21:46:39 +02:00
Ben Balter 9541183852 Bump to 8.6.1 2016-10-07 12:55:55 -04:00
Ben Balter 6dffa73832 Bump to 8.6.0 2016-09-26 10:22:07 -04:00
Ben Balter a6ecb6c505 add Cran tests 2016-09-26 10:13:02 -04:00
Ben Balter eae9e8f543 Merge branch 'CRAN' of https://github.com/jimhester/licensee into jimhester-CRAN 2016-09-26 09:56:02 -04:00
Ben Balter a270d419d0 Merge branch 'mdown-readme-extension' of https://github.com/pchaigno/licensee into pchaigno-mdown-readme-extension 2016-09-26 09:52:21 -04:00
Ben Balter 8dd4cdf520 convert tests to rspec 2016-09-25 18:42:36 -04:00
Paul Chaignon 59f540ac57 Add .mdown README extension 2016-09-25 22:28:58 +02:00
Jim Hester f7cb765985 Verify the file starts with 'Package:' as well
This check is cheap and should give us very few false positives.
2016-09-23 10:15:44 -04:00
Jim Hester 46a6f9acec Use modifier if 2016-09-23 10:15:44 -04:00
Jim Hester 7394be1e73 Add support for the CRAN package manager for R packages. 2016-09-23 10:15:44 -04:00
Ben Balter 09543fc8d3 add tests for each regex component 2016-09-23 09:34:36 -04:00
Ben Balter b504109184 rename constants to ANY_EXT and PREFERRED_EXT 2016-09-23 09:18:06 -04:00
Ben Balter 96d8dd6b24 break license regex into constants 2016-09-22 11:24:31 -04:00
Waldir Pimenta 5da8c7f7d5 score LICENSE.md et al. over COPYING/COPYRIGHT 2016-09-21 14:51:15 +01:00
Waldir Pimenta b418cc6772 harmonize scoring based on extension (fixes #109)
This change implements the following ranking:

1. No extension: LICENSE, COPYING, etc.
3. Filetype extension (syntactic annotation): UNLICENSE.txt, COPYRIGHT.md, etc.
2. Content-related extension (semantic annotation): COPYING.image, LICENCE.go, etc.
2016-09-21 14:51:15 +01:00
Ben Balter 722d09dad1 Bump to 8.5.0 2016-09-20 15:20:13 -04:00
Ben Balter 3120af2836 expose list of licenses by similarity to help debug false negatives 2016-09-20 15:14:53 -04:00
Ben Balter 943272720e fix rubocop offenses 2016-09-20 14:20:30 -04:00
Ben Balter 588755486b strip HRs from license before comparison 2016-09-20 13:56:01 -04:00
Ben Balter f8c0526d57 Bump to 8.4.0 2016-09-15 09:16:38 -04:00
Ben Balter 3a404407a3 check for COPYING.lesser, not LICENSE.lesser 2016-09-14 17:03:16 -04:00
Ben Balter 41d639ccfd edge case LICENSE.lesser for LGPL 2016-09-14 16:42:56 -04:00
Ben Balter 1c730ae1c0 absract out file, find_files, and find_file methods 2016-09-14 16:07:23 -04:00
Ben Balter b76ff7da0e fix for concatenated license detection 2016-09-13 13:23:02 -04:00
Ben Balter 7f74d4d9da zlib license doesnt begin with copyright, use (c) instead 2016-09-13 13:20:48 -04:00
Ben Balter c62db67cd6 exact matcher should also take into account length 2016-09-13 11:35:43 -04:00
Ben Balter 01baa08358 Bump to 8.3.1 2016-08-02 12:26:06 -04:00
Ben Balter 8a6e297062 pseudo licenses should have default meta 2016-08-02 12:03:08 -04:00
Ben Balter aec0efafa0 Bump to 8.3.0 2016-07-05 12:03:39 -04:00
Ben Balter 70f9a85745 Bump to 8.2.1 2016-07-05 12:02:50 -04:00
Ben Balter 97171abc55 Bump to 8.2.0 2016-06-15 11:32:56 -04:00
Ben Balter e0f244a768 update tests to match vendored licenses 2016-06-15 11:26:59 -04:00
Sebastian Schuberth 6087368af7 Properly close GitProject repositories when tearing down tests 2016-05-09 13:54:25 +02:00
Sebastian Schuberth 565d41ddcd Commonly use Licensee.project() both for scanning files and directories
Defer the file check to the begin / rescue block in Licensee.project() as
creating a GitProject would fail for a file.
2016-05-03 16:23:40 +02:00
Ben Balter 93764265f2 Bump to 8.1.0 2016-04-28 07:33:23 -07:00
Sebastian Schuberth 23b8f7a371 Allow Licensee.license() to scan a single file
This is useful if you alread know the path to the license file (or want to
ensure the license file exists at the given path) and just want to check
for the type of license.
2016-04-28 11:54:32 +02:00
Sebastian Schuberth 2ca899165c GitProject: Be clearer that also bare repositories are supported
As regular local Git repositories have working trees that could also be
processed by an FSProject, the main advantage of GitProject is that it can
handle bare repositories without actually checking the files out into a
working tree.
2016-04-14 16:52:24 +02:00