Sha256: 8a743f1d36322074802c2c11374edd31c6ddf454660fcc59f6670a30568edc1a
Contents?: true
Size: 785 Bytes
Versions: 14
Compression:
Stored size: 785 Bytes
Contents
module Doc class Configurator class Ruby class VersionSpecifier attr_reader :str, :parts alias_method :to_s, :str def initialize(o) @str = o.to_s @parts = str.scan(/\d+/).map(&:to_i) end def valid? str =~ /^\d+\.\d+(?:\.\d+(?:-p\d+)?)?$/ end def full_version? valid? && parts.length == 4 end def dir_name 'ruby-%d.%d.%d-p%d' % parts end include Comparable def <=>(other) parts <=> other.parts end def ===(other) if other.respond_to?(:parts) parts == other.parts[0, parts.length] else str === other end end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems