Sha256: 0edabd938a0cc8acdce6426c55976b50b4e5b7b6a41d195dda3138e1edfd25f7
Contents?: true
Size: 1.17 KB
Versions: 50
Compression:
Stored size: 1.17 KB
Contents
# frozen_string_literal: true # Go pre-release versions use 1.0.1-rc1 syntax, which Gem::Version # converts into 1.0.1.pre.rc1. We override the `to_s` method to stop that # alteration. # Best docs are at https://github.com/Masterminds/semver module Dependabot module Utils module Go class Version < Gem::Version VERSION_PATTERN = '[0-9]+[0-9a-zA-Z]*(?>\.[0-9a-zA-Z]+)*' \ '(-[0-9A-Za-z-]+(\.[0-9a-zA-Z-]+)*)?' \ '(\+incompatible)?' ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/.freeze def self.correct?(version) version = version.gsub(/^v/, "") if version.is_a?(String) version = version&.to_s&.split("+")&.first super(version) end def initialize(version) @version_string = version.to_s.gsub(/^v/, "") version = version.gsub(/^v/, "") if version.is_a?(String) version = version&.to_s&.split("+")&.first super end def inspect # :nodoc: "#<#{self.class} #{@version_string.inspect}>" end def to_s @version_string end end end end end
Version data entries
50 entries across 50 versions & 1 rubygems