diff options
| author | mo khan <mo.khan@gmail.com> | 2019-08-21 13:58:21 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2019-08-21 13:58:21 -0600 |
| commit | 450d9b983df6c616f74759c59a7e1ae1098a2dff (patch) | |
| tree | 1444a5ea0bec80227cc9aec241ec7f64a9a9b6da /lib | |
| parent | 27888daf19c84e646ffdae7a635f38db8bc05cdb (diff) | |
add way to choose canonical or non canonical form in v1 reports
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/license/management/report/versions/v1.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/license/management/report/versions/v1.rb b/lib/license/management/report/versions/v1.rb index c14864b..e897960 100644 --- a/lib/license/management/report/versions/v1.rb +++ b/lib/license/management/report/versions/v1.rb @@ -68,7 +68,16 @@ module License end def license_data(license) - repository.item_for(license) + return repository.item_for(license) if canonicalize? + + { + 'name' => license.name.split(/[\r\n]+/)[0], + 'url' => license.url + } + end + + def canonicalize? + ENV.fetch('LM_V1_CANONICALIZE', 'false') == 'true' end end end |
