1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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

View file

@ -3066,6 +3066,17 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
WARNING
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
util_setup_validate