Class: Danger::RubyGemsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/danger/clients/rubygems_client.rb

Constant Summary collapse

API_URL =
"https://rubygems.org/api/v1/versions/danger/latest.json".freeze
DUMMY_VERSION =
"0.0.0".freeze

Class Method Summary collapse

Class Method Details

.latest_danger_versionObject



6
7
8
9
10
11
12
# File 'lib/danger/clients/rubygems_client.rb', line 6

def self.latest_danger_version
  require "json"
  json = JSON.parse(Faraday.get(API_URL).body)
  json.fetch("version") { DUMMY_VERSION }
rescue StandardError => _e
  DUMMY_VERSION
end