Puppet Function: rclone::last_version
- Defined in:
-
lib/puppet/functions/rclone/last_version.rb
- Function type:
- Ruby 4.x API
Summary
Fetches the last released Rclone version from internet
Overview
rclone::last_version() ⇒ String
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/puppet/functions/rclone/last_version.rb', line 8
Puppet::Functions.create_function(:'rclone::last_version') do
def last_version
uri = URI('https://downloads.rclone.org/version.txt')
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
response = http.request Net::HTTP::Get.new(uri)
response.body.gsub(%r{.*rclone v(\d+\.\d+\.\d+).*}m, '\1')
end
end
end
|