mirror of https://github.com/licensee/licensee.git
Merge pull request #307 from mlinksva/closest-but-not
clarify that printed closest licenses are non-matches
This commit is contained in:
commit
06cfa8ee10
|
@ -36,6 +36,9 @@ Metrics/AbcSize:
|
||||||
Layout/IndentHeredoc:
|
Layout/IndentHeredoc:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Layout/ClosingHeredocIndentation:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
Style/StructInheritance:
|
Style/StructInheritance:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ class LicenseeCLI < Thor
|
||||||
|
|
||||||
licenses = licenses_by_similiarity(matched_file)
|
licenses = licenses_by_similiarity(matched_file)
|
||||||
next if licenses.empty?
|
next if licenses.empty?
|
||||||
say ' Closest licenses:'
|
say ' Closest non-matching licenses:'
|
||||||
rows = licenses[0...3].map do |license, similarity|
|
rows = licenses[0...3].map do |license, similarity|
|
||||||
spdx_id = license.meta['spdx-id']
|
spdx_id = license.meta['spdx-id']
|
||||||
percent = Licensee::ContentHelper.format_percent(similarity)
|
percent = Licensee::ContentHelper.format_percent(similarity)
|
||||||
|
|
|
@ -125,7 +125,7 @@ module Licensee
|
||||||
|
|
||||||
# Returns the human-readable license name
|
# Returns the human-readable license name
|
||||||
def name
|
def name
|
||||||
title ? title : key.capitalize
|
title || spdx_id
|
||||||
end
|
end
|
||||||
|
|
||||||
def name_without_version
|
def name_without_version
|
||||||
|
|
|
@ -25,7 +25,7 @@ RSpec.describe Licensee::ContentHelper do
|
||||||
This license provided 'as is'. Please respect the contributors' wishes when
|
This license provided 'as is'. Please respect the contributors' wishes when
|
||||||
implementing the license's "software".
|
implementing the license's "software".
|
||||||
-----------
|
-----------
|
||||||
LICENSE
|
LICENSE
|
||||||
end
|
end
|
||||||
subject { ContentHelperTestHelper.new(content) }
|
subject { ContentHelperTestHelper.new(content) }
|
||||||
let(:mit) { Licensee::License.find('mit') }
|
let(:mit) { Licensee::License.find('mit') }
|
||||||
|
|
|
@ -201,7 +201,7 @@ RSpec.describe Licensee::License do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'uses the default name when none exists' do
|
it 'uses the default name when none exists' do
|
||||||
expect(other.name).to eql('Other')
|
expect(other.name).to eql('NOASSERTION')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'expoeses the nickname' do
|
it 'expoeses the nickname' do
|
||||||
|
|
Loading…
Reference in New Issue