Class: Bottle::Filename Private
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
- #name ⇒ Object readonly private
- #rebuild ⇒ Object readonly private
- #tag ⇒ Object readonly private
- #version ⇒ Object readonly private
Class Method Summary collapse
Instance Method Summary collapse
- #extname ⇒ String private
- #github_packages ⇒ Object private
- #initialize(name, version, tag, rebuild) ⇒ void constructor private
- #json ⇒ String private
- #to_str ⇒ String private
- #url_encode ⇒ Object private
Constructor Details
#initialize(name, version, tag, rebuild) ⇒ 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.
16 17 18 19 20 21 22 23 24 25 |
# File 'bottle.rb', line 16 def initialize(name, version, tag, rebuild) @name = File.basename name raise ArgumentError, "Invalid bottle name" unless Utils.safe_filename?(@name) raise ArgumentError, "Invalid bottle version" unless Utils.safe_filename?(version.to_s) @version = version @tag = tag.to_unstandardized_sym.to_s @rebuild = rebuild end |
Instance Attribute Details
#name ⇒ Object (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.
8 9 10 |
# File 'bottle.rb', line 8 def name @name end |
#rebuild ⇒ Object (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.
8 9 10 |
# File 'bottle.rb', line 8 def rebuild @rebuild end |
#tag ⇒ Object (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.
8 9 10 |
# File 'bottle.rb', line 8 def tag @tag end |
#version ⇒ Object (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.
8 9 10 |
# File 'bottle.rb', line 8 def version @version end |
Class Method Details
.create(formula, tag, rebuild) ⇒ T.attached_class
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.
11 12 13 |
# File 'bottle.rb', line 11 def self.create(formula, tag, rebuild) new(formula.name, formula.pkg_version, tag, rebuild) end |
Instance Method Details
#extname ⇒ 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.
49 50 51 52 |
# File 'bottle.rb', line 49 def extname s = rebuild.positive? ? ".#{rebuild}" : "" ".#{tag}.bottle#{s}.tar.gz" end |
#github_packages ⇒ 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.
44 45 46 |
# File 'bottle.rb', line 44 def github_packages "#{name}--#{version}#{extname}" end |
#json ⇒ 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.
36 37 38 |
# File 'bottle.rb', line 36 def json "#{name}--#{version}.#{tag}.bottle.json" 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.
28 29 30 |
# File 'bottle.rb', line 28 def to_str "#{name}--#{version}#{extname}" end |
#url_encode ⇒ 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.
40 41 42 |
# File 'bottle.rb', line 40 def url_encode ERB::Util.url_encode("#{name}-#{version}#{extname}") end |