Class: EmbeddedPatch Private
- Inherits:
-
Object
- Object
- EmbeddedPatch
- Defined in:
- Library/Homebrew/patch.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.
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.
- #inspect ⇒ Object private
Constructor Details
#initialize(strip) ⇒ EmbeddedPatch
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 EmbeddedPatch.
66 67 68 |
# File 'Library/Homebrew/patch.rb', line 66 def initialize(strip) @strip = strip end |
Instance Attribute Details
#owner=(value) ⇒ Object (writeonly)
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.
63 64 65 |
# File 'Library/Homebrew/patch.rb', line 63 def owner=(value) @owner = value end |
#strip ⇒ Object (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.
64 65 66 |
# File 'Library/Homebrew/patch.rb', line 64 def strip @strip end |
Instance Method Details
#apply ⇒ 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.
76 77 78 79 80 |
# File 'Library/Homebrew/patch.rb', line 76 def apply data = contents.gsub("HOMEBREW_PREFIX", HOMEBREW_PREFIX) 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. You should avoid using this method if possible, as it may be removed or be changed in the future.
74 |
# File 'Library/Homebrew/patch.rb', line 74 def contents; end |
#external? ⇒ Boolean
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.
70 71 72 |
# File 'Library/Homebrew/patch.rb', line 70 def external? false end |
#inspect ⇒ 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.
82 83 84 |
# File 'Library/Homebrew/patch.rb', line 82 def inspect "#<#{self.class.name}: #{strip.inspect}>" end |