class BundleUpdateInteractive::ChangelogLocator
def fetch_rubygems_data(name, version)
def fetch_rubygems_data(name, version) api_url = if version.nil? "https://rubygems.org/api/v1/gems/#{name}.json" else "https://rubygems.org/api/v2/rubygems/#{name}/versions/#{version}.json" end response = HTTP.get(api_url) # Try again without the version in case the version does not exist at rubygems for some reason. # This can happen when using a pre-release Ruby that has a bundled gem newer than the published version. return fetch_rubygems_data(name, nil) if !response.success? && !version.nil? response.success? ? JSON.parse(response.body) : nil end