query_string_filter 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
data/lib/filter.treetop CHANGED
@@ -1,6 +1,19 @@
1
1
  grammar Filter
2
2
 
3
3
  rule match
4
+ and_expression / simple
5
+ end
6
+
7
+ rule and_expression
8
+ simple ospace 'and' ospace match
9
+ {
10
+ def eval
11
+ simple.eval.merge(match.eval)
12
+ end
13
+ }
14
+ end
15
+
16
+ rule simple
4
17
  fuzzy / equality / inequality
5
18
  end
6
19
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{query_string_filter}
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David James"]
@@ -130,5 +130,24 @@ describe "QueryStringFilter" do
130
130
  end
131
131
  end
132
132
  end
133
+
134
+ describe "and" do
135
+ it "double" do
136
+ actual = %(format="xml" and count=13)
137
+ @filter.parse(actual).should == {
138
+ "format" => "xml",
139
+ "count" => 13,
140
+ }
141
+ end
142
+
143
+ it "triple" do
144
+ actual = %(format="xml" and count=13 and size=64)
145
+ @filter.parse(actual).should == {
146
+ "format" => "xml",
147
+ "count" => 13,
148
+ "size" => 64,
149
+ }
150
+ end
151
+ end
133
152
 
134
153
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_string_filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David James