summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTetiana Chupryna <tchupryna@gitlab.com>2020-08-13 18:43:27 +0300
committerTetiana Chupryna <tchupryna@gitlab.com>2020-08-21 13:09:13 +0300
commit533e4496f4f79634179291a18fd99765ace506f2 (patch)
tree27e8203bdd0094e54b69daa873aee497bd09e520 /lib
parente08b5a38a7fcade1851637bd401a6097193db00d (diff)
Patch url for not specified BSD license
Diffstat (limited to 'lib')
-rw-r--r--lib/license/management/repository.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/license/management/repository.rb b/lib/license/management/repository.rb
index 4b6e8a5..3d16b78 100644
--- a/lib/license/management/repository.rb
+++ b/lib/license/management/repository.rb
@@ -64,7 +64,7 @@ module License
{
'id' => name.downcase,
'name' => name,
- 'url' => present?(license.url) ? license.url : ''
+ 'url' => normalized_url(license.url)
}
end
@@ -90,6 +90,13 @@ module License
logger.error(e)
nil
end
+
+ def normalized_url(url)
+ return '' unless present?(url)
+ return 'http://en.wikipedia.org/wiki/BSD_licenses' if url.match?('BSD_licenses#4-clause_license')
+
+ url
+ end
end
end
end