Class: EmbeddedPatch Private

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

DATAPatch, StringPatch

Instance Attribute Summary collapse

Instance Method Summary collapse

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.


65
66
67
# File 'Library/Homebrew/patch.rb', line 65

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.


62
63
64
# File 'Library/Homebrew/patch.rb', line 62

def owner=(value)
  @owner = value
end

#stripObject (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.


63
64
65
# File 'Library/Homebrew/patch.rb', line 63

def strip
  @strip
end

Instance Method Details

#applyObject

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.


75
76
77
78
79
# File 'Library/Homebrew/patch.rb', line 75

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

#contentsObject

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.


73
# File 'Library/Homebrew/patch.rb', line 73

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.

Returns:

  • (Boolean)

69
70
71
# File 'Library/Homebrew/patch.rb', line 69

def external?
  false
end

#inspectObject

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.


81
82
83
# File 'Library/Homebrew/patch.rb', line 81

def inspect
  "#<#{self.class.name}: #{strip.inspect}>"
end