Class: Version::PreToken Private

Inherits:
CompositeToken show all
Defined in:
version.rb

Overview

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

A token representing the part of a version designating it as a pre-release.

Constant Summary collapse

PATTERN =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

/pre[0-9]*/i.freeze

Instance Attribute Summary

Attributes inherited from StringToken

#value

Attributes inherited from Token

#value

Instance Method Summary collapse

Methods inherited from CompositeToken

#rev

Methods inherited from StringToken

#initialize

Methods inherited from Token

create, from, #hash, #initialize, #inspect, #null?, #numeric?, #to_f, #to_i, #to_s

Constructor Details

This class inherits a constructor from Version::StringToken

Instance Method Details

#<=>(other) ⇒ Integer?

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

  • other (T.untyped)

Returns:

  • (Integer, nil)


250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'version.rb', line 250

def <=>(other)
  return unless (other = Token.from(other))

  case other
  when PreToken
    rev <=> other.rev
  when AlphaToken, BetaToken
    1
  when RCToken, PatchToken, PostToken
    -1
  else
    super
  end
end