Class: Gitlab::QA::Component::Staging::Version

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/qa/component/staging.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address) ⇒ Version

Returns a new instance of Version.



52
53
54
55
56
# File 'lib/gitlab/qa/component/staging.rb', line 52

def initialize(address)
  @uri = URI.join(address, '/api/v4/version')

  Runtime::Env.require_qa_access_token!
end

Instance Attribute Details

#uriObject (readonly)

Returns the value of attribute uri.



50
51
52
# File 'lib/gitlab/qa/component/staging.rb', line 50

def uri
  @uri
end

Instance Method Details

#tagObject



58
59
60
61
62
63
64
65
66
67
# File 'lib/gitlab/qa/component/staging.rb', line 58

def tag
  if official?
    # Because RCs are considered to be pre-releases, that come before
    # regular releases we can't check if version < 15.6.0, hence
    # using this weird not-gonna-happen-patch-release hack.
    Gem::Version.new(version) > Gem::Version.new('15.5.99') ? version : "v#{version}"
  else
    revision
  end
end