Puppet Function: gitea::installed_version
- Defined in:
-
lib/puppet/functions/gitea/installed_version.rb
- Function type:
- Ruby 4.x API
Summary
Returns the installed gitea version
Overview
gitea::installed_version(String $a) ⇒ Variant[String,Undef]
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/puppet/functions/gitea/installed_version.rb', line 5
Puppet::Functions.create_function(:"gitea::installed_version") do
dispatch :installed_version do
param 'String', :a
return_type 'Variant[String,Undef]'
end
def installed_version(x)
IO.popen([x, '-v']).read.scan(%r{version ([^\s]+) }).first.first
rescue Errno::ENOENT
nil
end
end
|