Class: Resource::PatchResource Private
- Inherits:
-
Resource
- Object
- Downloadable
- Resource
- Resource::PatchResource
- Defined in:
- resource.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 resource containing a patch.
Instance Attribute Summary collapse
-
#patch_files ⇒ Object
readonly
private
Attributes inherited from Resource
#checksum, #download_strategy, #livecheck, #name, #owner, #patches, #source_modified_time
Attributes inherited from Downloadable
Instance Method Summary collapse
-
#apply(*paths) ⇒ Object
private
-
#directory(val = nil) ⇒ Object
private
-
#initialize(&block) ⇒ PatchResource
constructor
private
A new instance of PatchResource.
Methods inherited from Resource
#apply_patches, #download_name, #escaped_name, #fetch, #fetch_patches, #files, #freeze, #initialize_dup, #livecheckable?, #mirror, #patch, #prepare_patches, #sha256, #specs, #stage, #unpack, #url, #using, #version
Methods included from OnSystem::MacOSAndLinux
Methods inherited from Downloadable
#cached_download, #clear_cache, #download_name, #download_strategy, #downloaded?, #downloader, #fetch, #freeze, #initialize_dup, #verify_download_integrity, #version
Methods included from Context
current, current=, #debug?, #quiet?, #verbose?, #with_context
Constructor Details
#initialize(&block) ⇒ PatchResource
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 a new instance of PatchResource.
267 268 269 270 271 |
# File 'resource.rb', line 267 def initialize(&block) @patch_files = [] @directory = nil super "patch", &block end |
Instance Attribute Details
#patch_files ⇒ 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.
265 266 267 |
# File 'resource.rb', line 265 def patch_files @patch_files end |
Instance Method Details
#apply(*paths) ⇒ 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.
273 274 275 276 277 |
# File 'resource.rb', line 273 def apply(*paths) paths.flatten! @patch_files.concat(paths) @patch_files.uniq! end |
#directory(val = nil) ⇒ 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.
279 280 281 282 283 |
# File 'resource.rb', line 279 def directory(val = nil) return @directory if val.nil? @directory = val end |