From 9d51444479cec02d0b250ae65a91d36beb5f6b1b Mon Sep 17 00:00:00 2001 From: hellekin Date: Fri, 22 Jan 2021 14:45:15 +0100 Subject: Link to current source code version (per AGPL-3.0) --- app/lib/incommon.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/lib/incommon.rb') diff --git a/app/lib/incommon.rb b/app/lib/incommon.rb index 091f022..c2f30b5 100644 --- a/app/lib/incommon.rb +++ b/app/lib/incommon.rb @@ -3,4 +3,14 @@ # SPDX-License-Identifier: AGPL-3.0-or-later module INCOMMON + module_function + def repo_url(version) + case version + when /^(HEAD|v\d)/ + query="h=#{version}" + else + query="h=HEAD&id=#{version}" + end + URI.parse("https://code.cepheide.org/incommon-map.git/tree/?#{query}").to_s + end end -- cgit v1.2.3