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
- #file(val = nil) ⇒ String, ... private
- #initialize(&block) ⇒ void constructor private
- #resolves(*cves) ⇒ Array<String> private
- #type(val = nil) ⇒ Symbol? 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.
563 564 565 566 567 568 569 570 |
# File 'resource.rb', line 563 def initialize(&block) @patch_files = T.let([], T::Array[T.any(String, Pathname)]) @directory = T.let(nil, T.nilable(T.any(String, Pathname))) @file = T.let(nil, T.nilable(T.any(String, Pathname))) @resolves = T.let([], T::Array[String]) @type = T.let(nil, T.nilable(Symbol)) 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.
560 561 562 |
# File 'resource.rb', line 560 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.
573 574 575 576 |
# File 'resource.rb', line 573 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.
597 598 599 600 601 |
# File 'resource.rb', line 597 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.
619 620 621 622 623 624 625 |
# File 'resource.rb', line 619 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.
616 |
# File 'resource.rb', line 616 def download_queue_type = "Patch" |
#file(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.
604 605 606 607 608 609 610 611 612 613 |
# File 'resource.rb', line 604 def file(val = nil) return @file if val.nil? path_string = val.to_s unless LocalPatch.valid_path?(path_string) raise ArgumentError, "Patch file must be a relative path within the repository." end @file = val end |
#resolves(*cves) ⇒ Array<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.
579 580 581 582 583 584 |
# File 'resource.rb', line 579 def resolves(*cves) return @resolves if cves.empty? @resolves.concat(cves).uniq! @resolves end |
#type(val = nil) ⇒ Symbol?
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.
587 588 589 590 591 592 593 594 |
# File 'resource.rb', line 587 def type(val = nil) return @type if val.nil? unless ::Patch::TYPES.key?(val) raise ArgumentError, "Patch type must be one of: #{::Patch::TYPES.keys.map(&:inspect).join(", ")}" end @type = val end |