Class: Resource::PatchResource

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

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, #downloader, #escaped_name, #fetch, #files, #mirror, #patch, #prepare_patches, #stage, #unpack, #url, #verify_download_integrity

Constructor Details

#initialize(&block) ⇒ PatchResource

Returns a new instance of PatchResource



199
200
201
202
# File 'brew/Library/Homebrew/resource.rb', line 199

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

Instance Attribute Details

#patch_filesObject (readonly)

Returns the value of attribute patch_files



197
198
199
# File 'brew/Library/Homebrew/resource.rb', line 197

def patch_files
  @patch_files
end

Instance Method Details

#apply(*paths) ⇒ Object



204
205
206
207
208
# File 'brew/Library/Homebrew/resource.rb', line 204

def apply(*paths)
  paths.flatten!
  @patch_files.concat(paths)
  @patch_files.uniq!
end