Add 'apps/arv-web/' from commit 'f9732ad8460d013c2f28363655d0d1b91894dca5'
[arvados.git] / apps / workbench / app / helpers / version_helper.rb
1 module VersionHelper
2   # api_version returns the git commit hash for the API server's
3   # current version.  It is extracted from api_version_text, which
4   # returns the source_version provided by the discovery document and
5   # may have the word "-modified" appended to it (if the API server is
6   # running from a locally modified repository).
7
8   def api_version
9     api_version_text.sub(/[^[:xdigit:]].*/, '')
10   end
11
12   def api_version_text
13     arvados_api_client.discovery[:source_version]
14   end
15
16   # wb_version and wb_version_text provide the same strings for the
17   # code version that this Workbench is currently running.
18
19   def wb_version
20     Rails.configuration.source_version
21   end
22
23   def wb_version_text
24     wb_version + (Rails.configuration.local_modified or '')
25   end
26
27   def version_link_target version
28     "https://arvados.org/projects/arvados/repository/changes?rev=#{version}"
29   end
30 end