Environment.[]() allows specifying the type of variable you want returned
This commit is contained in:
parent
46c50049aa
commit
975f6b06c8
@ -34,8 +34,15 @@ module Rscons
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def [](key)
|
def [](key, type = nil)
|
||||||
@variables[key]
|
val = @variables[key]
|
||||||
|
if type == :array
|
||||||
|
val.is_a?(String) ? [val] : val
|
||||||
|
elsif type == :string
|
||||||
|
val.is_a?(Array) ? val.first : val
|
||||||
|
else
|
||||||
|
val
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def []=(key, val)
|
def []=(key, val)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user