Class: DATAPatch Private
- Inherits:
-
EmbeddedPatch
- Object
- EmbeddedPatch
- DATAPatch
- 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.
A patch at the __END__
of a formula file.
Instance Attribute Summary collapse
- #path ⇒ Object private
Attributes inherited from EmbeddedPatch
Instance Method Summary collapse
- #contents ⇒ Object private
-
#initialize(strip) ⇒ DATAPatch
constructor
private
A new instance of DATAPatch.
Methods inherited from EmbeddedPatch
Constructor Details
#initialize(strip) ⇒ DATAPatch
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 DATAPatch.
93 94 95 96 |
# File 'Library/Homebrew/patch.rb', line 93 def initialize(strip) super @path = nil end |
Instance Attribute Details
#path ⇒ 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.
91 92 93 |
# File 'Library/Homebrew/patch.rb', line 91 def path @path end |
Instance Method Details
#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.
98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'Library/Homebrew/patch.rb', line 98 def contents data = +"" path.open("rb") do |f| loop do line = f.gets break if line.nil? || line =~ /^__END__$/ end while line = f.gets data << line end end data.freeze end |