Clean up BuildEnvironment interface a bit
This commit is contained in:
parent
49ac4f2f6a
commit
a358bee8e2
@ -1,10 +1,15 @@
|
|||||||
require 'set'
|
require 'set'
|
||||||
|
|
||||||
class BuildEnvironment
|
class BuildEnvironment
|
||||||
def initialize settings
|
def initialize(*settings)
|
||||||
@settings = Set.new(settings)
|
@settings = Set.new(settings)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def <<(o)
|
||||||
|
@settings << o
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
def std?
|
def std?
|
||||||
@settings.include? :std
|
@settings.include? :std
|
||||||
end
|
end
|
||||||
|
@ -437,7 +437,7 @@ class Formula
|
|||||||
def requirements; self.class.dependencies.requirements; end
|
def requirements; self.class.dependencies.requirements; end
|
||||||
|
|
||||||
def env
|
def env
|
||||||
@env ||= BuildEnvironment.new(self.class.environments)
|
@env ||= self.class.env
|
||||||
end
|
end
|
||||||
|
|
||||||
def conflicts
|
def conflicts
|
||||||
@ -710,12 +710,10 @@ private
|
|||||||
@stable.mirror(val)
|
@stable.mirror(val)
|
||||||
end
|
end
|
||||||
|
|
||||||
def environments
|
|
||||||
@environments ||= []
|
|
||||||
end
|
|
||||||
|
|
||||||
def env *settings
|
def env *settings
|
||||||
environments.concat [settings].flatten
|
@env ||= BuildEnvironment.new
|
||||||
|
settings.each { |s| @env << s }
|
||||||
|
@env
|
||||||
end
|
end
|
||||||
|
|
||||||
def dependencies
|
def dependencies
|
||||||
|
Loading…
x
Reference in New Issue
Block a user