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
commita358bee8e2ae3823dae03cd54bf1edd0d32cefe6 (patch)
treef44306a4ddab8a261dbe2d41e3c8053a06bf5341 /Library
parent49ac4f2f6aff441c39109ce372c63f1466393a1a (diff)
downloadbrew-a358bee8e2ae3823dae03cd54bf1edd0d32cefe6.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