aboutsummaryrefslogtreecommitdiff
path: root/app/lib/incommon.rb
diff options
context:
space:
mode:
authorhellekin <hellekin@cepheide.org>2021-01-22 14:45:15 +0100
committerhellekin <hellekin@cepheide.org>2021-01-22 14:46:50 +0100
commit9d51444479cec02d0b250ae65a91d36beb5f6b1b (patch)
tree71475d4157eaa2f65207e43cec433a18304d1a50 /app/lib/incommon.rb
parent97bfc3f6012027077077ea4a6b5f2f709c76158e (diff)
downloadincommon-map-9d51444479cec02d0b250ae65a91d36beb5f6b1b.tar.gz
Link to current source code version (per AGPL-3.0)
Diffstat (limited to 'app/lib/incommon.rb')
-rw-r--r--app/lib/incommon.rb10
1 files changed, 10 insertions, 0 deletions
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