Make keg_only validation lazy
This commit is contained in:
parent
4830bdb5b7
commit
8f1f1d8d8a
@ -8,14 +8,15 @@ class KegOnlyReason
|
|||||||
def initialize reason, explanation=nil
|
def initialize reason, explanation=nil
|
||||||
@reason = reason
|
@reason = reason
|
||||||
@explanation = explanation
|
@explanation = explanation
|
||||||
@valid = case @reason
|
|
||||||
when :provided_pre_mountain_lion then MacOS.version < :mountain_lion
|
|
||||||
else true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def valid?
|
def valid?
|
||||||
@valid
|
case @reason
|
||||||
|
when :provided_pre_mountain_lion
|
||||||
|
MacOS.version < :mountain_lion
|
||||||
|
else
|
||||||
|
true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user