lib/scope.rb in expressive-0.0.36 vs lib/scope.rb in expressive-0.0.37
- old
+ new
@@ -172,9 +172,10 @@
define('+') {|a,b| a.to_f + b.to_f }
define('-') {|a,b| a.to_f - b.to_f }
define('*') {|a,b| a.to_f * b.to_f }
define('/') {|a,b| a.to_f / b.to_f }
define('=') {|a,b| a == b }
+ define('~') {|a,b| !!(a =~ Regexp.new(b)) }
define('>') {|a,b| a.to_f > b.to_f }
define('<') {|a,b| a.to_f < b.to_f }
define('>=') {|a,b| a.to_f >= b.to_f }
define('<=') {|a,b| a.to_f <= b.to_f }
define('and') {|a,b| !!a && !!b }