aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2009-06-05 12:57:37 +0100
committerMax Howell2009-06-05 12:57:37 +0100
commite585686b011e32534f1c9333998f9a0756595e50 (patch)
tree2e64fbf1f0af3bf4544b2266326ac88ae13c26cd /Library
parent354ea6f970d8a368d012fa953ca8394609241fa3 (diff)
downloadbrew-e585686b011e32534f1c9333998f9a0756595e50.tar.bz2
Fix GithubGistFormula
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brewkit.rb26
-rwxr-xr-xLibrary/Homebrew/unittest.rb4
2 files changed, 12 insertions, 18 deletions
diff --git a/Library/Homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb
index fe95ae099..4a20c1f84 100644
--- a/Library/Homebrew/brewkit.rb
+++ b/Library/Homebrew/brewkit.rb
@@ -17,7 +17,7 @@
require 'pathname'
require 'osx/cocoa' # to get number of cores
-require "#{File.dirname __FILE__}/env"
+require 'env'
# optimise all the way to eleven, references:
# http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel
@@ -161,7 +161,7 @@ public
Dir.chdir appsupport do
tgz=Pathname.new(fetch()).realpath
md5=`md5 -q "#{tgz}"`.strip
- raise "MD5 mismatch: #{md5}" unless md5 and md5 == @md5.downcase
+ raise "MD5 mismatch: #{md5}" unless @md5 and md5 == @md5.downcase
# we make an additional subdirectory so know exactly what we are
# recursively deleting later
@@ -297,24 +297,16 @@ class UncompressedScriptFormula <Formula
end
end
-class GithubGistFormula <Formula
- def initialize(url, md5)
- @url=url
+class GithubGistFormula <UncompressedScriptFormula
+ def initialize
+ super
@name=File.basename url
@version=File.basename(File.dirname(url))[0,6]
- @md5=md5
-
- brew do |prefix|
- bin=prefix+'bin'
- bin.mkpath
- FileUtils.cp @name, bin
- (bin+@name).chmod 0544
- nil
- end
end
- def uncompress path
- path.dirname
+ def install
+ FileUtils.cp @name, bin
+ (bin+@name).chmod 0544
end
end
@@ -348,7 +340,7 @@ def system cmd
end
end
-########################################################################script
+####################################################################### script
if $0 == __FILE__
d=$cellar.parent+'bin'
d.mkpath unless d.exist?
diff --git a/Library/Homebrew/unittest.rb b/Library/Homebrew/unittest.rb
index 5ec8f0e5d..08a95e1f3 100755
--- a/Library/Homebrew/unittest.rb
+++ b/Library/Homebrew/unittest.rb
@@ -1,6 +1,8 @@
#!/usr/bin/ruby
+
+$:.unshift File.dirname __FILE__
require 'test/unit'
-require "#{__FILE__}/../brewkit"
+require 'brewkit'
class TestFormula <Formula
def initialize url, md5