diff options
| author | Max Howell | 2009-10-15 09:07:12 +0100 |
|---|---|---|
| committer | Max Howell | 2009-10-15 16:48:03 +0100 |
| commit | ca1a6492bc7921c3ad269f434be5b927802ada64 (patch) | |
| tree | d3cf3173f777ab0885d284960f6da1cfd50c1cd8 /Library/Homebrew | |
| parent | 3e04b3f0d6d5470a6907fd89cb32eae6641d2544 (diff) | |
| download | brew-ca1a6492bc7921c3ad269f434be5b927802ada64.tar.bz2 | |
s/require 'brewkit'/require 'formula'/g
brewkit.rb changes ENV destructively, so lets not do that everytime a formula
is required. Now it's possible for other tools to require a formula
description without worrying about side-effects.
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/brew.h.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/brewkit.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 2 | ||||
| -rwxr-xr-x | Library/Homebrew/install.rb | 6 | ||||
| -rwxr-xr-x | Library/Homebrew/unittest.rb | 2 |
5 files changed, 9 insertions, 7 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb index 83cb79c50..24f9046a9 100644 --- a/Library/Homebrew/brew.h.rb +++ b/Library/Homebrew/brew.h.rb @@ -30,7 +30,7 @@ def __make url, name raise "#{path} already exists" if path.exist? template=<<-EOS - require 'brewkit' + require 'formula' class #{Formula.class_s name} <Formula url '#{url}' diff --git a/Library/Homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb index 0a966a317..843ac023d 100644 --- a/Library/Homebrew/brewkit.rb +++ b/Library/Homebrew/brewkit.rb @@ -21,10 +21,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -require 'fileutils' -require 'formula' -require 'download_strategy' -require 'hardware' # TODO # 1. Indeed, there should be an option to build 32 or 64 bit binaries diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 8e4771cd1..4330b812f 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -21,6 +21,8 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # +require 'download_strategy' + class ExecutionError <RuntimeError def initialize cmd, args=[] super "Failure while executing: #{cmd} #{args*' '}" diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index 75a63ac32..9509a56b8 100755 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -1,8 +1,12 @@ #!/usr/bin/ruby require 'global' + +require 'brew.h' +require 'brewkit' +require 'fileutils' require 'formula' +require 'hardware' require 'keg' -require 'brew.h' show_summary_heading = false diff --git a/Library/Homebrew/unittest.rb b/Library/Homebrew/unittest.rb index 8faeb4f43..dfbf0e101 100755 --- a/Library/Homebrew/unittest.rb +++ b/Library/Homebrew/unittest.rb @@ -365,7 +365,7 @@ class BeerTasting <Test::Unit::TestCase path.dirname.mkpath File.open(path, 'w') do |f| f << %{ - require 'brewkit' + require 'formula' class #{classname} < Formula @url='' def initialize(*args) |
