aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/build_environment.rb
diff options
context:
space:
mode:
authorJack Nagel2014-07-07 17:34:30 -0500
committerJack Nagel2014-07-07 17:36:20 -0500
commit879ec967437d76d9b32bbe90d70384874bafbd59 (patch)
tree028cd9942a3eee2e074fe1377a8342460b967208 /Library/Homebrew/build_environment.rb
parent9e7f5dc2619839a17dbceb01c6708bab7753e73f (diff)
downloadbrew-879ec967437d76d9b32bbe90d70384874bafbd59.tar.bz2
Only store one proc per BuildEnvironment instance
Diffstat (limited to 'Library/Homebrew/build_environment.rb')
-rw-r--r--Library/Homebrew/build_environment.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/Library/Homebrew/build_environment.rb b/Library/Homebrew/build_environment.rb
index d46e4bfb2..c7cb7bc0e 100644
--- a/Library/Homebrew/build_environment.rb
+++ b/Library/Homebrew/build_environment.rb
@@ -1,9 +1,10 @@
require 'set'
class BuildEnvironment
+ attr_accessor :proc
+
def initialize(*settings)
@settings = Set.new(settings)
- @procs = Set.new
end
def merge(*args)
@@ -11,10 +12,7 @@ class BuildEnvironment
end
def <<(o)
- case o
- when Proc then @procs << o
- else @settings << o
- end
+ @settings << o
self
end
@@ -27,7 +25,7 @@ class BuildEnvironment
end
def modify_build_environment(receiver)
- @procs.each { |p| receiver.instance_eval(&p) }
+ receiver.instance_eval(&proc)
end
def _dump(*)
@@ -43,7 +41,7 @@ module BuildEnvironmentDSL
def env(*settings, &block)
@env ||= BuildEnvironment.new
if block_given?
- @env << block
+ @env.proc = block
else
@env.merge(settings)
end