mirror of https://github.com/licensee/licensee.git
Merge pull request #280 from mlinksva/bin-spdx-only
command line only output SPDX ID not name
This commit is contained in:
commit
aba6425b18
|
@ -21,9 +21,9 @@ class LicenseeCLI < Thor
|
|||
|
||||
rows = []
|
||||
rows << if project.license
|
||||
['License:', project.license.name]
|
||||
['License:', project.license.spdx_id]
|
||||
elsif !project.licenses.empty?
|
||||
['Licenses:', project.licenses.map(&:name)]
|
||||
['Licenses:', project.licenses.map(&:spdx_id)]
|
||||
else
|
||||
['License:', set_color('None', :red)]
|
||||
end
|
||||
|
@ -77,7 +77,7 @@ class LicenseeCLI < Thor
|
|||
def humanize(value, type = nil)
|
||||
case type
|
||||
when :license
|
||||
value.name
|
||||
value.spdx_id
|
||||
when :matcher
|
||||
value.class
|
||||
when :confidence
|
||||
|
|
|
@ -13,19 +13,19 @@ RSpec.describe 'detect command' do
|
|||
let(:hash) { '46cdc03462b9af57968df67b450cc4372ac41f53' }
|
||||
let(:expected) do
|
||||
{
|
||||
'License' => 'MIT License',
|
||||
'License' => 'MIT',
|
||||
'Matched files' => 'LICENSE.md, licensee.gemspec',
|
||||
'LICENSE.md' => {
|
||||
'Content hash' => hash,
|
||||
'Attribution' => 'Copyright (c) 2014-2017 Ben Balter',
|
||||
'Confidence' => '100.00%',
|
||||
'Matcher' => 'Licensee::Matchers::Exact',
|
||||
'License' => 'MIT License'
|
||||
'License' => 'MIT'
|
||||
},
|
||||
'licensee.gemspec' => {
|
||||
'Confidence' => '90.00%',
|
||||
'Matcher' => 'Licensee::Matchers::Gemspec',
|
||||
'License' => 'MIT License'
|
||||
'License' => 'MIT'
|
||||
}
|
||||
}
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue