aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-12-23 19:43:10 -0600
committerJack Nagel2012-12-26 14:37:02 -0600
commit337efcc6367a623140662b6c6ac1151d395bc879 (patch)
treeeb380111343b20d64a00787f7d8c9e896f9634ef /Library
parentc259bda0d967bcac04cfe062e2dc19895e83e4e5 (diff)
downloadhomebrew-337efcc6367a623140662b6c6ac1151d395bc879.tar.bz2
Clean up BuildEnvironment interface a bit
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/build_environment.rb7
-rw-r--r--Library/Homebrew/formula.rb10
2 files changed, 10 insertions, 7 deletions
diff --git a/Library/Homebrew/build_environment.rb b/Library/Homebrew/build_environment.rb
index 0beee6c25..97a8fae42 100644
--- a/Library/Homebrew/build_environment.rb
+++ b/Library/Homebrew/build_environment.rb
@@ -1,10 +1,15 @@
require 'set'
class BuildEnvironment
- def initialize settings
+ def initialize(*settings)
@settings = Set.new(settings)
end
+ def <<(o)
+ @settings << o
+ self
+ end
+
def std?
@settings.include? :std
end
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 337916a0a..3d3c23ec3 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -437,7 +437,7 @@ class Formula
def requirements; self.class.dependencies.requirements; end
def env
- @env ||= BuildEnvironment.new(self.class.environments)
+ @env ||= self.class.env
end
def conflicts
@@ -710,12 +710,10 @@ private
@stable.mirror(val)
end
- def environments
- @environments ||= []
- end
-
def env *settings
- environments.concat [settings].flatten
+ @env ||= BuildEnvironment.new
+ settings.each { |s| @env << s }
+ @env
end
def dependencies