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:
parent
3e04b3f0d6
commit
ca1a6492bc
@ -30,7 +30,7 @@ def __make url, name
|
|||||||
raise "#{path} already exists" if path.exist?
|
raise "#{path} already exists" if path.exist?
|
||||||
|
|
||||||
template=<<-EOS
|
template=<<-EOS
|
||||||
require 'brewkit'
|
require 'formula'
|
||||||
|
|
||||||
class #{Formula.class_s name} <Formula
|
class #{Formula.class_s name} <Formula
|
||||||
url '#{url}'
|
url '#{url}'
|
||||||
|
|||||||
@ -21,10 +21,6 @@
|
|||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
require 'fileutils'
|
|
||||||
require 'formula'
|
|
||||||
require 'download_strategy'
|
|
||||||
require 'hardware'
|
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
# 1. Indeed, there should be an option to build 32 or 64 bit binaries
|
# 1. Indeed, there should be an option to build 32 or 64 bit binaries
|
||||||
|
|||||||
@ -21,6 +21,8 @@
|
|||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
require 'download_strategy'
|
||||||
|
|
||||||
class ExecutionError <RuntimeError
|
class ExecutionError <RuntimeError
|
||||||
def initialize cmd, args=[]
|
def initialize cmd, args=[]
|
||||||
super "Failure while executing: #{cmd} #{args*' '}"
|
super "Failure while executing: #{cmd} #{args*' '}"
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
#!/usr/bin/ruby
|
#!/usr/bin/ruby
|
||||||
require 'global'
|
require 'global'
|
||||||
require 'formula'
|
|
||||||
require 'keg'
|
|
||||||
require 'brew.h'
|
require 'brew.h'
|
||||||
|
require 'brewkit'
|
||||||
|
require 'fileutils'
|
||||||
|
require 'formula'
|
||||||
|
require 'hardware'
|
||||||
|
require 'keg'
|
||||||
|
|
||||||
show_summary_heading = false
|
show_summary_heading = false
|
||||||
|
|
||||||
|
|||||||
@ -365,7 +365,7 @@ class BeerTasting <Test::Unit::TestCase
|
|||||||
path.dirname.mkpath
|
path.dirname.mkpath
|
||||||
File.open(path, 'w') do |f|
|
File.open(path, 'w') do |f|
|
||||||
f << %{
|
f << %{
|
||||||
require 'brewkit'
|
require 'formula'
|
||||||
class #{classname} < Formula
|
class #{classname} < Formula
|
||||||
@url=''
|
@url=''
|
||||||
def initialize(*args)
|
def initialize(*args)
|
||||||
|
|||||||
2
bin/brew
2
bin/brew
@ -92,8 +92,6 @@ begin
|
|||||||
|
|
||||||
raise "Cannot write to #{HOMEBREW_PREFIX}" unless HOMEBREW_PREFIX.writable?
|
raise "Cannot write to #{HOMEBREW_PREFIX}" unless HOMEBREW_PREFIX.writable?
|
||||||
|
|
||||||
require 'brewkit'
|
|
||||||
|
|
||||||
if ARGV.interactive? and ARGV.formulae.length > 1
|
if ARGV.interactive? and ARGV.formulae.length > 1
|
||||||
# the reason for this is interactive mode is a little tricky to do
|
# 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
|
# with more than one formula, AND I can't think of a time where you'd
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user