diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb index f2a92a0616..de60b4a87b 100644 --- a/Library/Homebrew/patch.rb +++ b/Library/Homebrew/patch.rb @@ -3,6 +3,9 @@ require "resource" require "erb" +# Helper module for creating patches. +# +# @api private module Patch def self.create(strip, src, &block) case strip @@ -52,6 +55,9 @@ module Patch end end +# An abstract class representing a patch embedded into a formula. +# +# @api private class EmbeddedPatch attr_writer :owner attr_reader :strip @@ -77,6 +83,9 @@ class EmbeddedPatch end end +# A patch at the `__END__` of a formula file. +# +# @api private class DATAPatch < EmbeddedPatch attr_accessor :path @@ -100,6 +109,9 @@ class DATAPatch < EmbeddedPatch end end +# A string containing a patch. +# +# @api private class StringPatch < EmbeddedPatch def initialize(strip, str) super(strip) @@ -111,6 +123,9 @@ class StringPatch < EmbeddedPatch end end +# A string containing a patch. +# +# @api private class ExternalPatch extend Forwardable @@ -170,7 +185,11 @@ class ExternalPatch end end +# A legacy patch. +# # Legacy patches have no checksum and are not cached. +# +# @api private class LegacyPatch < ExternalPatch def initialize(strip, url) odeprecated "legacy patches", "'patch do' blocks"