Class: EmbeddedPatch 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.
An abstract class representing a patch embedded into a formula.
Direct Known Subclasses
Instance Attribute Summary collapse
- #owner ⇒ Object writeonly private
 - #strip ⇒ Object readonly private
 
Instance Method Summary collapse
- #apply ⇒ Object private
 - #contents ⇒ Object private
 - #external? ⇒ Boolean private
 - 
  
    
      #initialize(strip)  ⇒ EmbeddedPatch 
    
    
  
  
  
    constructor
  
  
  
  
  
  private
  
    
A new instance of EmbeddedPatch.
 
Constructor Details
#initialize(strip) ⇒ EmbeddedPatch
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 EmbeddedPatch.
      38 39 40  | 
    
      # File 'patch.rb', line 38 def initialize(strip) @strip = strip end  | 
  
Instance Attribute Details
#owner=(value) ⇒ Object (writeonly)
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.
      35 36 37  | 
    
      # File 'patch.rb', line 35 def owner=(value) @owner = value end  | 
  
#strip ⇒ 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.
      36 37 38  | 
    
      # File 'patch.rb', line 36 def strip @strip end  | 
  
Instance Method Details
#apply ⇒ 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.
      49 50 51 52 53 54 55 56 57  | 
    
      # File 'patch.rb', line 49 def apply data = contents.gsub("@@HOMEBREW_PREFIX@@", HOMEBREW_PREFIX) if data.gsub!("HOMEBREW_PREFIX", HOMEBREW_PREFIX) # Utils::Output.odeprecated "patch with HOMEBREW_PREFIX placeholder", # "patch with @@HOMEBREW_PREFIX@@ placeholder" end args = %W[-g 0 -f -#{strip}] Utils.safe_popen_write("patch", *args) { |p| p.write(data) } end  | 
  
#contents ⇒ 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.
      47  | 
    
      # File 'patch.rb', line 47 def contents; end  | 
  
#external? ⇒ Boolean
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.
      43 44 45  | 
    
      # File 'patch.rb', line 43 def external? false end  |