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 = []
|
||||||
rows << if project.license
|
rows << if project.license
|
||||||
['License:', project.license.name]
|
['License:', project.license.spdx_id]
|
||||||
elsif !project.licenses.empty?
|
elsif !project.licenses.empty?
|
||||||
['Licenses:', project.licenses.map(&:name)]
|
['Licenses:', project.licenses.map(&:spdx_id)]
|
||||||
else
|
else
|
||||||
['License:', set_color('None', :red)]
|
['License:', set_color('None', :red)]
|
||||||
end
|
end
|
||||||
|
@ -77,7 +77,7 @@ class LicenseeCLI < Thor
|
||||||
def humanize(value, type = nil)
|
def humanize(value, type = nil)
|
||||||
case type
|
case type
|
||||||
when :license
|
when :license
|
||||||
value.name
|
value.spdx_id
|
||||||
when :matcher
|
when :matcher
|
||||||
value.class
|
value.class
|
||||||
when :confidence
|
when :confidence
|
||||||
|
|
|
@ -13,19 +13,19 @@ RSpec.describe 'detect command' do
|
||||||
let(:hash) { '46cdc03462b9af57968df67b450cc4372ac41f53' }
|
let(:hash) { '46cdc03462b9af57968df67b450cc4372ac41f53' }
|
||||||
let(:expected) do
|
let(:expected) do
|
||||||
{
|
{
|
||||||
'License' => 'MIT License',
|
'License' => 'MIT',
|
||||||
'Matched files' => 'LICENSE.md, licensee.gemspec',
|
'Matched files' => 'LICENSE.md, licensee.gemspec',
|
||||||
'LICENSE.md' => {
|
'LICENSE.md' => {
|
||||||
'Content hash' => hash,
|
'Content hash' => hash,
|
||||||
'Attribution' => 'Copyright (c) 2014-2017 Ben Balter',
|
'Attribution' => 'Copyright (c) 2014-2017 Ben Balter',
|
||||||
'Confidence' => '100.00%',
|
'Confidence' => '100.00%',
|
||||||
'Matcher' => 'Licensee::Matchers::Exact',
|
'Matcher' => 'Licensee::Matchers::Exact',
|
||||||
'License' => 'MIT License'
|
'License' => 'MIT'
|
||||||
},
|
},
|
||||||
'licensee.gemspec' => {
|
'licensee.gemspec' => {
|
||||||
'Confidence' => '90.00%',
|
'Confidence' => '90.00%',
|
||||||
'Matcher' => 'Licensee::Matchers::Gemspec',
|
'Matcher' => 'Licensee::Matchers::Gemspec',
|
||||||
'License' => 'MIT License'
|
'License' => 'MIT'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue