Sha256: e2d898790e2dae5a5fdac7836603ce8358fdfa14482852d8e7e192b53a5b4263

Contents?: true

Size: 572 Bytes

Versions: 11

Compression:

Stored size: 572 Bytes

Contents

# frozen_string_literal: true

require 'gitlab/request'
require 'gitlab'

class ReleaseVersionClient < Gitlab::Request
  base_uri 'https://version.gitlab.com'
  headers 'Private-Token' => -> { api_token }

  # Get the latest version information
  #
  # Returns an Array of Gitlab::ObjectifiedHash objects
  def self.versions
    get('/api/v1/versions', query: { per_page: 50 })
  end

  def self.api_token
    ENV.fetch('RELEASES_GITLAB_READ_TOKEN') do |name|
      raise "Must specify `#{name}` environment variable!"
    end
  end

  private_class_method :api_token
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
gitlab-releases-1.0.1 lib/gitlab_releases/release_version_client.rb
gitlab-releases-1.0.0 lib/gitlab_releases/release_version_client.rb
gitlab-releases-0.2.9 lib/gitlab_releases/release_version_client.rb
gitlab-releases-0.2.7 lib/gitlab_releases/release_version_client.rb
gitlab-releases-0.2.6 lib/gitlab_releases/release_version_client.rb
gitlab-releases-0.2.5 lib/gitlab_releases/release_version_client.rb
gitlab-releases-0.2.4 lib/gitlab_releases/release_version_client.rb
gitlab-releases-0.2.3 lib/gitlab_releases/release_version_client.rb
gitlab-releases-0.2.2 lib/gitlab_releases/release_version_client.rb
gitlab-releases-0.2.1 lib/gitlab_releases/release_version_client.rb
gitlab-releases-0.2.0 lib/gitlab_releases/release_version_client.rb