Class: PkgVersion Private

Inherits:
Object show all
Extended by:
Forwardable
Includes:
Comparable
Defined in:
pkg_version.rb,
pkg_version.rbi,
sorbet/rbi/parlour.rbi

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.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version, revision) ⇒ PkgVersion

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.

Returns a new instance of PkgVersion.



24
25
26
27
# File 'pkg_version.rb', line 24

def initialize(version, revision)
  @version = version
  @revision = revision
end

Instance Attribute Details

#revisionObject (readonly)

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.



14
15
16
# File 'pkg_version.rb', line 14

def revision
  @revision
end

#versionObject (readonly)

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.



14
15
16
# File 'pkg_version.rb', line 14

def version
  @version
end

Class Method Details

.parse(path) ⇒ Object

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.



18
19
20
21
22
# File 'pkg_version.rb', line 18

def self.parse(path)
  _, version, revision = *path.match(REGEX)
  version = Version.new(version)
  new(version, revision.to_i)
end

Instance Method Details

#head?Boolean

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.

Returns:

  • (Boolean)


29
30
31
# File 'pkg_version.rb', line 29

def head?
  version.head?
end

#major(*args, **options, &block) ⇒ T.untyped

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:

  • args (T.untyped)
  • options (T.untyped)
  • block (T.untyped)

Returns:

  • (T.untyped)


242
# File 'sorbet/rbi/parlour.rbi', line 242

def major(*args, **options, &block); end

#major_minor(*args, **options, &block) ⇒ T.untyped

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:

  • args (T.untyped)
  • options (T.untyped)
  • block (T.untyped)

Returns:

  • (T.untyped)


251
# File 'sorbet/rbi/parlour.rbi', line 251

def major_minor(*args, **options, &block); end

#major_minor_patch(*args, **options, &block) ⇒ T.untyped

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:

  • args (T.untyped)
  • options (T.untyped)
  • block (T.untyped)

Returns:

  • (T.untyped)


254
# File 'sorbet/rbi/parlour.rbi', line 254

def major_minor_patch(*args, **options, &block); end

#minor(*args, **options, &block) ⇒ T.untyped

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:

  • args (T.untyped)
  • options (T.untyped)
  • block (T.untyped)

Returns:

  • (T.untyped)


245
# File 'sorbet/rbi/parlour.rbi', line 245

def minor(*args, **options, &block); end

#patch(*args, **options, &block) ⇒ T.untyped

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:

  • args (T.untyped)
  • options (T.untyped)
  • block (T.untyped)

Returns:

  • (T.untyped)


248
# File 'sorbet/rbi/parlour.rbi', line 248

def patch(*args, **options, &block); end

#to_strString

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.

Returns:



34
35
36
37
38
39
40
# File 'pkg_version.rb', line 34

def to_str
  if revision.positive?
    "#{version}_#{revision}"
  else
    version.to_s
  end
end