aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/unpack.rb
diff options
context:
space:
mode:
authorJack Nagel2014-07-29 16:06:07 -0500
committerJack Nagel2014-07-29 16:22:07 -0500
commit5216dd54b3b02a24394dc7d98aff09f82015c8a9 (patch)
tree3c5b8c8baed79428955148c189498a4cfd39b4b4 /Library/Homebrew/cmd/unpack.rb
parentdc2080bd9f111a3bc5a71b981a0c2035266d3aaf (diff)
downloadbrew-5216dd54b3b02a24394dc7d98aff09f82015c8a9.tar.bz2
Remove patch hacks from unpack
Diffstat (limited to 'Library/Homebrew/cmd/unpack.rb')
-rw-r--r--Library/Homebrew/cmd/unpack.rb26
1 files changed, 1 insertions, 25 deletions
diff --git a/Library/Homebrew/cmd/unpack.rb b/Library/Homebrew/cmd/unpack.rb
index 162d887b9..9c71f8025 100644
--- a/Library/Homebrew/cmd/unpack.rb
+++ b/Library/Homebrew/cmd/unpack.rb
@@ -2,33 +2,9 @@ require "stringio"
require "formula"
module Homebrew
- module DATALoader
- # Original code from http://stackoverflow.com/a/2157556/371237
- def self.load(path)
- data = StringIO.new
- path.open("r") do |f|
- begin
- line = f.gets
- end until line.nil? || /^__END__$/ === line
- data << line while line = f.gets
- end
- data.rewind
- data
- end
- end
-
module UnpackPatch
def patch
- return unless ARGV.flag? "--patch"
-
- begin
- old_verbose, $VERBOSE = $VERBOSE, nil
- Object.const_set "DATA", DATALoader.load(path)
- ensure
- $VERBOSE = old_verbose
- end
-
- super
+ super if ARGV.flag?("--patch")
end
end