mirror of
https://github.com/github/choosealicense.com
synced 2024-12-22 12:50:24 +01:00
relax github.com regex to allow for more branch names
This commit is contained in:
parent
4a3eb294b2
commit
4b67edf0db
@ -56,7 +56,7 @@ describe 'license meta' do
|
|||||||
let(:detected) { Licensee::ProjectFiles::LicenseFile.new(content, 'LICENSE').license }
|
let(:detected) { Licensee::ProjectFiles::LicenseFile.new(content, 'LICENSE').license }
|
||||||
|
|
||||||
if example_url.start_with?('https://github.com/')
|
if example_url.start_with?('https://github.com/')
|
||||||
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/(\S+)\z}, 'https://raw.githubusercontent.com/\1/\2')
|
||||||
elsif example_url.start_with?('https://git.savannah.gnu.org/', 'https://git.gnome.org/')
|
elsif example_url.start_with?('https://git.savannah.gnu.org/', 'https://git.gnome.org/')
|
||||||
example_url.gsub!(%r{/tree/}, '/plain/')
|
example_url.gsub!(%r{/tree/}, '/plain/')
|
||||||
elsif example_url.start_with?('https://bitbucket.org/')
|
elsif example_url.start_with?('https://bitbucket.org/')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user