rudelo 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,7 +28,7 @@ require 'rudelo/parsers/set_logic_transform'
28
28
  module Rudelo
29
29
  module Matchers
30
30
  class SetLogic < Rufus::Decision::Matcher
31
- SYNTAX_EXPR = %r{\$\([^)]*\)|\$in}
31
+ SYNTAX_EXPR = %r{^\$\([^)]*\)|\$in|#[><=]}
32
32
 
33
33
  # if true, will raise if a cell is not valid set logic syntax
34
34
  attr_accessor :force
@@ -51,7 +51,10 @@ module Rudelo
51
51
  return false unless force || can_match?(cell)
52
52
  evaluator = ast(cell)
53
53
  return return_on_cant_match if evaluator.nil?
54
- in_set = value_transform.apply(value_parser.parse(value)) unless in_set.is_a?(Set)
54
+ in_set = nil
55
+ in_set = value if value.is_a?(Set)
56
+ in_set = Set.new if value == ''
57
+ in_set ||= value_transform.apply(value_parser.parse(value))
55
58
  result = evaluator.eval(in_set)
56
59
  return result ? true : return_on_cant_match
57
60
  end
@@ -1,3 +1,3 @@
1
1
  module Rudelo
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rudelo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-29 00:00:00.000000000 Z
12
+ date: 2013-06-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rufus-decision
@@ -136,7 +136,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  segments:
138
138
  - 0
139
- hash: -1336408223698741406
139
+ hash: 765560753132729104
140
140
  required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  none: false
142
142
  requirements:
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  version: '0'
146
146
  segments:
147
147
  - 0
148
- hash: -1336408223698741406
148
+ hash: 765560753132729104
149
149
  requirements: []
150
150
  rubyforge_project:
151
151
  rubygems_version: 1.8.25