Spec-Zone.ru › Homebrew

Class: PkgVersion Private

Inherits:
Object
  • Object
  • PkgVersion
show all
Extended by:
Forwardable
Includes:
Comparable
Defined in:
pkg_version.rb,
pkg_version.rbi,
sorbet/rbi/dsl/pkg_version.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

  • #revision ⇒ Integer readonly private
  • #version ⇒ Version readonly private

Class Method Summary collapse

  • .parse(path) ⇒ PkgVersion private

Instance Method Summary collapse

  • #head? ⇒ Boolean private
  • #initialize(version, revision) ⇒ void constructor private
  • #major(*args, &block) ⇒ T.untyped private
  • #major_minor(*args, &block) ⇒ T.untyped private
  • #major_minor_patch(*args, &block) ⇒ T.untyped private
  • #minor(*args, &block) ⇒ T.untyped private
  • #patch(*args, &block) ⇒ T.untyped private
  • #to_str ⇒ String private

Constructor Details

#initialize(version, revision) ⇒ void

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:

  • version (Version)
  • revision (Integer)


30
31
32
33
# File 'pkg_version.rb', line 30

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

Instance Attribute Details

#revision ⇒ Integer (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.

Returns:

  • (Integer)


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

def revision
  @revision
end

#version ⇒ Version (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.

Returns:

  • (Version)


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

def version
  @version
end

Class Method Details

.parse(path) ⇒ 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.

Parameters:

  • path (String)

Returns:

  • (PkgVersion)


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

def self.parse(path)
  _, version, revision = *path.match(REGEX)
  version = Version.new(version.to_s)
  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)


36
37
38
# File 'pkg_version.rb', line 36

def head?
  version.head?
end

#major(*args, &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)
  • block (T.untyped)

Returns:

  • (T.untyped)


10
# File 'sorbet/rbi/dsl/pkg_version.rbi', line 10

def major(*args, &block); end

#major_minor(*args, &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)
  • block (T.untyped)

Returns:

  • (T.untyped)


13
# File 'sorbet/rbi/dsl/pkg_version.rbi', line 13

def major_minor(*args, &block); end

#major_minor_patch(*args, &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)
  • block (T.untyped)

Returns:

  • (T.untyped)


16
# File 'sorbet/rbi/dsl/pkg_version.rbi', line 16

def major_minor_patch(*args, &block); end

#minor(*args, &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)
  • block (T.untyped)

Returns:

  • (T.untyped)


19
# File 'sorbet/rbi/dsl/pkg_version.rbi', line 19

def minor(*args, &block); end

#patch(*args, &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)
  • block (T.untyped)

Returns:

  • (T.untyped)


22
# File 'sorbet/rbi/dsl/pkg_version.rbi', line 22

def patch(*args, &block); end

#to_str ⇒ String

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:

  • (String)


41
42
43
44
45
46
47
# File 'pkg_version.rb', line 41

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

© 2009–present Homebrew contributors
Licensed under the BSD 2-Clause License.
https://docs.brew.sh/rubydoc/PkgVersion.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API