Allow custom LicenseRef

This commit is contained in:
Carlos Palhares 2021-10-25 15:50:32 -03:00 committed by Hiroshi SHIBATA
parent b74385e78d
commit 17f8fd6568
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2
2 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,7 @@ class Gem::Licenses
extend Gem::Text extend Gem::Text
NONSTANDARD = 'Nonstandard'.freeze NONSTANDARD = 'Nonstandard'.freeze
LICENSE_REF = 'LicenseRef-.+'.freeze
# Software Package Data Exchange (SPDX) standard open-source software # Software Package Data Exchange (SPDX) standard open-source software
# license identifiers # license identifiers
@ -523,6 +524,7 @@ class Gem::Licenses
\+? \+?
(?:\s WITH \s #{Regexp.union(EXCEPTION_IDENTIFIERS)})? (?:\s WITH \s #{Regexp.union(EXCEPTION_IDENTIFIERS)})?
| #{NONSTANDARD} | #{NONSTANDARD}
| #{LICENSE_REF}
) )
\Z \Z
}ox.freeze }ox.freeze

View File

@ -3066,6 +3066,17 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
WARNING WARNING
end end
def test_validate_license_ref
util_setup_validate
use_ui @ui do
@a1.licenses = ['LicenseRef-LICENSE.md']
@a1.validate
end
assert_empty @ui.error
end
def test_validate_license_values_plus def test_validate_license_values_plus
util_setup_validate util_setup_validate