Class: Resource::Patch Private
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 resource containing a patch.
Instance Attribute Summary collapse
- #patch_files ⇒ Array<String, Pathname> readonly private
Instance Method Summary collapse
- #apply(*paths) ⇒ void private
- #directory(val = nil) ⇒ String, ... private
- #download_queue_name ⇒ String private
- #download_queue_type ⇒ String private
- #initialize(&block) ⇒ void constructor private
Constructor Details
#initialize(&block) ⇒ 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.
465 466 467 468 469 |
# File 'resource.rb', line 465 def initialize(&block) @patch_files = T.let([], T::Array[T.any(String, Pathname)]) @directory = T.let(nil, T.nilable(T.any(String, Pathname))) super "patch", &block end |
Instance Attribute Details
#patch_files ⇒ Array<String, Pathname> (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.
462 463 464 |
# File 'resource.rb', line 462 def patch_files @patch_files end |
Instance Method Details
#apply(*paths) ⇒ 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.
This method returns an undefined value.
472 473 474 475 |
# File 'resource.rb', line 472 def apply(*paths) @patch_files.concat(paths.flatten) @patch_files.uniq! end |
#directory(val = nil) ⇒ 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.
478 479 480 481 482 |
# File 'resource.rb', line 478 def directory(val = nil) return @directory if val.nil? @directory = val end |
#download_queue_name ⇒ 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.
488 489 490 491 492 493 494 |
# File 'resource.rb', line 488 def download_queue_name if (last_url_component = url.to_s.split("/").last) return last_url_component end super end |
#download_queue_type ⇒ 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.
485 |
# File 'resource.rb', line 485 def download_queue_type = "Patch" |