check_version.rb 620 Bytes
Newer Older
1 2 3 4
require 'faraday'
require 'json'

#print ARGV[0].downcase
5
puts "Checking the ver for #{ARGV[0]}"
6 7 8

response = Faraday.get "https://release-monitoring.org/api/projects/?pattern=#{ARGV[0].downcase}"

9 10
fedora_j = JSON.parse( response.body )['projects']
fedora = fedora_j.select { |h| h['name'] == ARGV[0].downcase }.first['version']
11

David Hrbáč's avatar
David Hrbáč committed
12
response = Faraday.get "https://docs.it4i.cz/modules-matrix.json"
13 14 15 16 17

it4i = JSON.parse( response.body )['projects'][ARGV[0]]
it4i_short = it4i.split('-')[0]
puts "IT4Innovations: #{it4i_short} (#{it4i})"
puts "Upstream      : #{fedora}"
David Hrbáč's avatar
David Hrbáč committed
18 19 20 21 22 23

if it4i_short.eql? fedora
  puts "Identical"
else

end