Merge pull request #307 from mlinksva/closest-but-not

clarify that printed closest licenses are non-matches
This commit is contained in:
Mike Linksvayer 2018-06-14 21:25:07 +00:00 committed by GitHub
commit 06cfa8ee10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 4 deletions

View File

@ -36,6 +36,9 @@ Metrics/AbcSize:
Layout/IndentHeredoc:
Enabled: false
Layout/ClosingHeredocIndentation:
Enabled: false
Style/StructInheritance:
Enabled: false

View File

@ -51,7 +51,7 @@ class LicenseeCLI < Thor
licenses = licenses_by_similiarity(matched_file)
next if licenses.empty?
say ' Closest licenses:'
say ' Closest non-matching licenses:'
rows = licenses[0...3].map do |license, similarity|
spdx_id = license.meta['spdx-id']
percent = Licensee::ContentHelper.format_percent(similarity)

View File

@ -125,7 +125,7 @@ module Licensee
# Returns the human-readable license name
def name
title ? title : key.capitalize
title || spdx_id
end
def name_without_version

View File

@ -25,7 +25,7 @@ RSpec.describe Licensee::ContentHelper do
This license provided 'as is'. Please respect the contributors' wishes when
implementing the license's "software".
-----------
LICENSE
LICENSE
end
subject { ContentHelperTestHelper.new(content) }
let(:mit) { Licensee::License.find('mit') }

View File

@ -201,7 +201,7 @@ RSpec.describe Licensee::License do
end
it 'uses the default name when none exists' do
expect(other.name).to eql('Other')
expect(other.name).to eql('NOASSERTION')
end
it 'expoeses the nickname' do