mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 01:01:39 -05:00
18 lines
397 B
Ruby
18 lines
397 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CheckAppVersion
|
|
def initialize
|
|
@repo_url = 'https://api.github.com/repos/Freika/dawarich/tags'
|
|
@app_version = File.read('.app_version').strip
|
|
end
|
|
|
|
def call
|
|
begin
|
|
latest_version = JSON.parse(Net::HTTP.get(URI.parse(@repo_url)))[0]['name']
|
|
rescue StandardError
|
|
return false
|
|
end
|
|
|
|
latest_version != @app_version
|
|
end
|
|
end
|