public
Description: Ambition adapter for Sphinx
Clone URL: git://github.com/technicalpickles/ambitious-sphinx.git
Refactored how we decide what needs quoting slightly.
Josh Nichols (author)
Thu Feb 07 10:43:35 -0800 2008
commit  aedc169984f52dc8372977b58cc7df0a114ee17a
tree    896cf8f81f13da7842a1c5358ba8670f16f2372f
parent  a3e22ea77b57a0b8fefa9bfbb5c7520e1277602c
...
2
3
4
5
 
6
7
8
...
10
11
12
 
 
 
 
13
14
 
15
16
17
...
2
3
4
 
5
6
7
8
...
10
11
12
13
14
15
16
17
 
18
19
20
21
0
@@ -2,7 +2,7 @@ module Ambition
0
   module Adapters
0
     module AmbitiousSphinx
0
       class Base
0
- def field? str
0
+ def has_field? str
0
           str =~ /:/
0
         end
0
         
0
@@ -10,8 +10,12 @@ module Ambition
0
           str =~ /(AND|OR|NOT)/
0
         end
0
         
0
+ def needs_quoting? str
0
+ not (has_operator?(str) or has_field?(str))
0
+ end
0
+
0
         def quotify str
0
- unless field?(str) or has_operator?(str)
0
+ if needs_quoting?(str)
0
             "\"#{str}\""
0
           else
0
             str

Comments

    No one has commented yet.