Class: Resource::PatchResource

Inherits:
Resource
  • Object
show all
Defined in:
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

Methods included from FileUtils

#make, mkdir, mktemp, #old_mkdir, #old_ruby, #ruby, #scons, #xcodebuild

Constructor Details

#initialize(&block) ⇒ PatchResource

Returns a new instance of PatchResource



207
208
209
210
# File 'Library/Homebrew/resource.rb', line 207

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

Instance Attribute Details

#patch_filesObject (readonly)

Returns the value of attribute patch_files



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

def patch_files
  @patch_files
end

Instance Method Details

#apply(*paths) ⇒ Object



212
213
214
215
216
# File 'Library/Homebrew/resource.rb', line 212

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