aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/build_environment.rb
diff options
context:
space:
mode:
authorJack Nagel2013-02-25 14:01:02 -0600
committerJack Nagel2013-02-25 14:01:02 -0600
commitaca48deda0f7bbb9831291dbf47ed3c8e4ae2b9c (patch)
treecdc7d47a04f1cb1e3c0694c0297ddb1a0c9b2f70 /Library/Homebrew/build_environment.rb
parent6b96102fad11bc627cebc0c3e937e28971c4678c (diff)
downloadbrew-aca48deda0f7bbb9831291dbf47ed3c8e4ae2b9c.tar.bz2
BuildEnvironment: use separate sets for procs and symbols
Diffstat (limited to 'Library/Homebrew/build_environment.rb')
-rw-r--r--Library/Homebrew/build_environment.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/Library/Homebrew/build_environment.rb b/Library/Homebrew/build_environment.rb
index 60e099977..c10c9fb1c 100644
--- a/Library/Homebrew/build_environment.rb
+++ b/Library/Homebrew/build_environment.rb
@@ -3,10 +3,14 @@ require 'set'
class BuildEnvironment
def initialize(*settings)
@settings = Set.new(settings)
+ @procs = Set.new
end
def <<(o)
- @settings << o
+ case o
+ when Proc then @procs << o
+ else @settings << o
+ end
self
end
@@ -19,12 +23,11 @@ class BuildEnvironment
end
def modify_build_environment(context=nil)
- p = @settings.find { |s| Proc === s }
- ENV.instance_exec(context, &p) unless p.nil?
+ @procs.each { |p| ENV.instance_exec(context, &p) }
end
def _dump(*)
- @settings.dup.reject { |s| Proc === s }.join(":")
+ @settings.to_a.join(":")
end
def self._load(s)