aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/patch.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/patch.rb')
-rw-r--r--Library/Homebrew/patch.rb30
1 files changed, 6 insertions, 24 deletions
diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb
index 1b7751ba3..7f5a6af35 100644
--- a/Library/Homebrew/patch.rb
+++ b/Library/Homebrew/patch.rb
@@ -108,8 +108,14 @@ class StringPatch < EmbeddedPatch
end
class ExternalPatch
+ extend Forwardable
+
attr_reader :resource, :strip
+ def_delegators :resource,
+ :url, :fetch, :patch_files, :verify_download_integrity, :cached_download,
+ :clear_cache
+
def initialize(strip, &block)
@strip = strip
@resource = Resource::Patch.new(&block)
@@ -148,30 +154,6 @@ class ExternalPatch
end
end
- def url
- resource.url
- end
-
- def fetch
- resource.fetch
- end
-
- def patch_files
- resource.patch_files
- end
-
- def verify_download_integrity(fn)
- resource.verify_download_integrity(fn)
- end
-
- def cached_download
- resource.cached_download
- end
-
- def clear_cache
- resource.clear_cache
- end
-
def inspect
"#<#{self.class.name}: #{strip.inspect} #{url.inspect}>"
end