aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/patch.rb
diff options
context:
space:
mode:
authorJack Nagel2014-03-14 16:12:31 -0500
committerJack Nagel2014-03-14 16:16:53 -0500
commit251bd707a25cc81fbe54052f4d48134e1b19ea37 (patch)
treedcaffe021664882a8f1cc743948f346ec5cd219a /Library/Homebrew/patch.rb
parent86a0373159dcc36825c9a6e7660a238e707250de (diff)
downloadbrew-251bd707a25cc81fbe54052f4d48134e1b19ea37.tar.bz2
Remove use of Forwardable from ExternalPatch
Diffstat (limited to 'Library/Homebrew/patch.rb')
-rw-r--r--Library/Homebrew/patch.rb30
1 files changed, 22 insertions, 8 deletions
diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb
index 2fd33c01f..f648cfc7b 100644
--- a/Library/Homebrew/patch.rb
+++ b/Library/Homebrew/patch.rb
@@ -1,7 +1,6 @@
require 'resource'
require 'stringio'
require 'erb'
-require 'forwardable'
class Patch
def self.create(strip, io=nil, &block)
@@ -85,13 +84,8 @@ class IOPatch < Patch
end
class ExternalPatch < Patch
- extend Forwardable
-
attr_reader :resource, :strip
- def_delegators :@resource, :fetch, :verify_download_integrity,
- :cached_download, :clear_cache, :url
-
def initialize(strip, &block)
@strip = strip
@resource = Resource.new(&block)
@@ -113,6 +107,26 @@ class ExternalPatch < Patch
end
end
+ def url
+ resource.url
+ end
+
+ def fetch
+ resource.fetch
+ 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}: #{strip.inspect} #{url.inspect}>"
end
@@ -131,7 +145,7 @@ class LegacyPatch < ExternalPatch
end
def fetch
- resource.clear_cache
+ clear_cache
super
end
@@ -142,6 +156,6 @@ class LegacyPatch < ExternalPatch
def apply
super
ensure
- resource.clear_cache
+ clear_cache
end
end