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.
This commit is contained in:
Max Howell 2009-10-15 09:07:12 +01:00
parent 3e04b3f0d6
commit ca1a6492bc
6 changed files with 10 additions and 10 deletions

View File

@ -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}'

View File

@ -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

View File

@ -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*' '}"

View File

@ -1,8 +1,12 @@
#!/usr/bin/ruby
require 'global'
require 'formula'
require 'keg'
require 'brew.h'
require 'brewkit'
require 'fileutils'
require 'formula'
require 'hardware'
require 'keg'
show_summary_heading = false

View File

@ -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)

View File

@ -92,8 +92,6 @@ begin
raise "Cannot write to #{HOMEBREW_PREFIX}" unless HOMEBREW_PREFIX.writable?
require 'brewkit'
if ARGV.interactive? and ARGV.formulae.length > 1
# the reason for this is interactive mode is a little tricky to do
# with more than one formula, AND I can't think of a time where you'd