cql-ruby 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cql_ruby/cql_parser.rb +4 -0
- data/test/test_cql_parser.rb +12 -0
- metadata +12 -12
data/lib/cql_ruby/cql_parser.rb
CHANGED
@@ -128,6 +128,10 @@ class CqlParser
|
|
128
128
|
relation.set_modifiers( ms )
|
129
129
|
log( "index='#{index}', relation='#{relation.to_cql}'")
|
130
130
|
end
|
131
|
+
|
132
|
+
# change backslashed double quotes in term to plain double-quotes
|
133
|
+
# since the backslashes have served their purpose.
|
134
|
+
word.gsub!('\\"', '"')
|
131
135
|
|
132
136
|
node = CqlTermNode.new( index, relation, word )
|
133
137
|
log( "made term node #{node.to_cql}" )
|
data/test/test_cql_parser.rb
CHANGED
@@ -15,6 +15,18 @@ class TestCqlParser < Test::Unit::TestCase
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
18
|
+
|
19
|
+
def test_backslash_escaped
|
20
|
+
parser = CqlRuby::CqlParser.new
|
21
|
+
parser.debug = false
|
22
|
+
|
23
|
+
node = parser.parse('field relation "there is \\"phrase here\\""')
|
24
|
+
|
25
|
+
# removed the backslash please
|
26
|
+
assert_equal('there is "phrase here"', node.term)
|
27
|
+
# and round-trip it comes back.
|
28
|
+
assert_equal('field relation "there is \\"phrase here\\""', node.to_cql)
|
29
|
+
end
|
18
30
|
|
19
31
|
def test_parser
|
20
32
|
parser = CqlRuby::CqlParser.new
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cql-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 61
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 1
|
10
|
+
version: 0.8.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jonathan Rochkind
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-06-
|
19
|
+
date: 2010-06-28 00:00:00 -04:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|
@@ -37,14 +37,14 @@ files:
|
|
37
37
|
- lib/cql_ruby/cql_to_solr.rb
|
38
38
|
- lib/cql_ruby/version.rb
|
39
39
|
- README.txt
|
40
|
-
- test/
|
40
|
+
- test/test_cql_parser.rb
|
41
|
+
- test/test_cql_nodes.rb
|
41
42
|
- test/test_cql_generator.rb
|
42
43
|
- test/test_cql_lexer.rb
|
43
|
-
- test/test_cql_nodes.rb
|
44
|
-
- test/test_cql_parser.rb
|
45
44
|
- test/test_cql_ruby.rb
|
46
|
-
- test/test_cql_to_solr.rb
|
47
45
|
- test/test_helper.rb
|
46
|
+
- test/helper.rb
|
47
|
+
- test/test_cql_to_solr.rb
|
48
48
|
has_rdoc: true
|
49
49
|
homepage: http://cql-ruby.rubyforge.org/
|
50
50
|
licenses: []
|
@@ -80,11 +80,11 @@ signing_key:
|
|
80
80
|
specification_version: 3
|
81
81
|
summary: CQL Parser
|
82
82
|
test_files:
|
83
|
-
- test/
|
83
|
+
- test/test_cql_parser.rb
|
84
|
+
- test/test_cql_nodes.rb
|
84
85
|
- test/test_cql_generator.rb
|
85
86
|
- test/test_cql_lexer.rb
|
86
|
-
- test/test_cql_nodes.rb
|
87
|
-
- test/test_cql_parser.rb
|
88
87
|
- test/test_cql_ruby.rb
|
89
|
-
- test/test_cql_to_solr.rb
|
90
88
|
- test/test_helper.rb
|
89
|
+
- test/helper.rb
|
90
|
+
- test/test_cql_to_solr.rb
|