Class: Homebrew::Livecheck::LivecheckVersion Private

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
livecheck/livecheck_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 formula or cask version, split into its component sub-versions.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(versions) ⇒ 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:



29
30
31
# File 'livecheck/livecheck_version.rb', line 29

def initialize(versions)
  @versions = versions
end

Instance Attribute Details

#versionsArray<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:



26
27
28
# File 'livecheck/livecheck_version.rb', line 26

def versions
  @versions
end

Class Method Details

.create(package_or_resource, version) ⇒ LivecheckVersion

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:

Returns:



13
14
15
16
17
18
19
20
21
22
23
# File 'livecheck/livecheck_version.rb', line 13

def self.create(package_or_resource, version)
  versions = case package_or_resource
  when Formula, Resource
    [version]
  when Cask::Cask
    version.to_s.split(",").map { |s| Version.new(s) }
  else
    T.absurd(package_or_resource)
  end
  new(versions)
end