1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-22 04:40:09 +01:00

path item can include -

This commit is contained in:
Mike Linksvayer 2017-11-25 19:56:20 -08:00
parent 7649067151
commit 0e2a2653bd

View File

@ -64,7 +64,7 @@ describe 'license meta' do
examples.each do |example| examples.each do |example|
example_url = example.values[0] example_url = example.values[0]
if example_url.index('https://github.com/') == 0 if example_url.index('https://github.com/') == 0
example_url.gsub!(%r{\Ahttps://github.com/(\w+/\w+)/blob/(\w+/\S+)\z}, 'https://raw.githubusercontent.com/\1/\2') example_url.gsub!(%r{\Ahttps://github.com/([\w-]+/[\w-]+)/blob/([\w-]+/\S+)\z}, 'https://raw.githubusercontent.com/\1/\2')
end end
content = open(example_url).read content = open(example_url).read
detected = Licensee::ProjectFiles::LicenseFile.new(content, 'LICENSE').license detected = Licensee::ProjectFiles::LicenseFile.new(content, 'LICENSE').license