class Travis::Conditions::V0::Eval
Public Instance Methods
apply()
click to toggle source
# File lib/travis/conditions/v0/eval.rb, line 5 def apply !!evl(sexp) end
Private Instance Methods
and(lft, rgt)
click to toggle source
# File lib/travis/conditions/v0/eval.rb, line 28 def and(lft, rgt) evl(lft) && evl(rgt) end
blank(value)
click to toggle source
# File lib/travis/conditions/v0/eval.rb, line 64 def blank(value) !present(value) end
env(key)
click to toggle source
# File lib/travis/conditions/v0/eval.rb, line 56 def env(key) data.env(key) end
eq(lft, rgt)
click to toggle source
# File lib/travis/conditions/v0/eval.rb, line 32 def eq(lft, rgt) evl(lft) == rgt end
evl(value)
click to toggle source
# File lib/travis/conditions/v0/eval.rb, line 11 def evl(value) case value when Array send(*value) else data[value] end end
in(lft, rgt)
click to toggle source
# File lib/travis/conditions/v0/eval.rb, line 48 def in(lft, rgt) rgt.include?(evl(lft)) end
is(lft, rgt)
click to toggle source
# File lib/travis/conditions/v0/eval.rb, line 52 def is(lft, rgt) send(rgt, evl(lft)) end
match(lft, rgt)
click to toggle source
# File lib/travis/conditions/v0/eval.rb, line 40 def match(lft, rgt) evl(lft) =~ Regexp.new(rgt) end
not(lft)
click to toggle source
# File lib/travis/conditions/v0/eval.rb, line 20 def not(lft) !evl(lft) end
not_eq(lft, rgt)
click to toggle source
# File lib/travis/conditions/v0/eval.rb, line 36 def not_eq(lft, rgt) not eq(lft, rgt) end
not_match(lft, rgt)
click to toggle source
# File lib/travis/conditions/v0/eval.rb, line 44 def not_match(lft, rgt) not match(lft, rgt) end
or(lft, rgt)
click to toggle source
# File lib/travis/conditions/v0/eval.rb, line 24 def or(lft, rgt) evl(lft) || evl(rgt) end
present(value)
click to toggle source
# File lib/travis/conditions/v0/eval.rb, line 60 def present(value) value.respond_to?(:empty?) && !value.empty? end