Class: GDK::Dependencies::GitlabVersions

Inherits:
Object
  • Object
show all
Defined in:
lib/gdk/dependencies/gitlab_versions.rb

Constant Summary collapse

REPOSITORY_RAW_URL =
'https://gitlab.com/gitlab-org/gitlab/-/raw/master/'
VersionNotDetected =
Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#ruby_versionString

Return GitLab’s ruby version from local repository or fallback to remote repository when no code is still installed

Returns:

  • (String)

    ruby version



16
17
18
19
20
# File 'lib/gdk/dependencies/gitlab_versions.rb', line 16

def ruby_version
  (local_ruby_version || remote_ruby_version).tap do |version|
    raise(VersionNotDetected, "Failed to determine GitLab's Ruby version") unless version.match?(/^[0-9]\.[0-9]+(.[0-9]+)/)
  end
end