Class: Resource::PatchResource Private

Inherits:
Resource
  • Object
show all
Defined in:
Library/Homebrew/resource.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A resource containing a patch.

Instance Attribute Summary collapse

Attributes inherited from Resource

#checksum, #download_strategy, #mirrors, #name, #owner, #patches, #source_modified_time, #specs, #using, #version

Instance Method Summary collapse

Methods inherited from Resource

#apply_patches, #cached_download, #clear_cache, #download_name, #downloaded?, #downloader, #escaped_name, #fetch, #fetch_patches, #files, #mirror, #on_linux, #on_macos, #patch, #prepare_patches, #stage, #unpack, #url, #verify_download_integrity

Methods included from Context

current, current=, #debug?, #quiet?, #verbose?, #with_context

Constructor Details

#initialize(&block) ⇒ PatchResource

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of PatchResource.


230
231
232
233
234
# File 'Library/Homebrew/resource.rb', line 230

def initialize(&block)
  @patch_files = []
  @directory = nil
  super "patch", &block
end

Instance Attribute Details

#patch_filesObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


228
229
230
# File 'Library/Homebrew/resource.rb', line 228

def patch_files
  @patch_files
end

Instance Method Details

#apply(*paths) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


236
237
238
239
240
# File 'Library/Homebrew/resource.rb', line 236

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. You should avoid using this method if possible, as it may be removed or be changed in the future.


242
243
244
245
246
# File 'Library/Homebrew/resource.rb', line 242

def directory(val = nil)
  return @directory if val.nil?

  @directory = val
end