Sha256: 29f7d1fe3ecb1869b233d4688e799a7c3603d299bc4578baadc3b5fe25e6e410
Contents?: true
Size: 929 Bytes
Versions: 25
Compression:
Stored size: 929 Bytes
Contents
module CMSScanner # Version class Version include Finders::Finding attr_reader :number def initialize(number, opts = {}) @number = number.to_s @number = "0#{number}" if @number[0, 1] == '.' parse_finding_options(opts) end # @param [ Version, String ] other # rubocop:disable Style/NumericPredicate def ==(other) (self <=> other) == 0 end # rubocop:enable all # @param [ Version, String ] other def <(other) (self <=> other) == -1 end # @param [ Version, String ] other def >(other) (self <=> other) == 1 end # @param [ Version, String ] other def <=>(other) other = self.class.new(other) unless other.is_a?(self.class) # handle potential '.1' version Gem::Version.new(number) <=> Gem::Version.new(other.number) rescue ArgumentError false end def to_s number end end end
Version data entries
25 entries across 25 versions & 1 rubygems