mirror of
https://github.com/github/choosealicense.com
synced 2024-12-22 12:50:24 +01:00
path item can include -
This commit is contained in:
parent
7649067151
commit
0e2a2653bd
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user