freelancing-god-riddle 0.9.8.1533.5 → 0.9.8.1533.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
- This client has been written to interface with Sphinx[http://sphinxsearch.com/]. It is written by
2
- {Pat Allan}[http://freelancing-gods.com], and has been influenced by both Dmytro Shteflyuk's Ruby
1
+ This client has been written to interface with "Sphinx":http://sphinxsearch.com/. It is written by
2
+ "Pat Allan":http://freelancing-gods.com, and has been influenced by both Dmytro Shteflyuk's Ruby
3
3
  client and the original PHP client - credit where credit's due, after all.
4
4
 
5
5
  It does not follow the same syntax as those two, though (not much point writing this otherwise) -
@@ -53,27 +53,27 @@ the following keys:
53
53
  * :warning (if appropriate)
54
54
  * :error (if appropriate)
55
55
 
56
- The key <tt>:matches</tt> returns an array of hashes - the actual search results. Each hash has the
57
- document id (<tt>:doc</tt>), the result weighting (<tt>:weight</tt>), and a hash of the attributes for
58
- the document (<tt>:attributes</tt>).
56
+ The key @:matches@ returns an array of hashes - the actual search results. Each hash has the
57
+ document id (@:doc@), the result weighting (@:weight@), and a hash of the attributes for
58
+ the document (@:attributes@).
59
59
 
60
- The <tt>:fields</tt> and <tt>:attribute_names</tt> keys return list of fields and attributes for the
61
- documents. The key <tt>:attributes</tt> will return a hash of attribute name and type pairs, and
62
- <tt>:words</tt> returns a hash of hashes representing the words from the search, with the number of
60
+ The @:fields@ and @:attribute_names@ keys return list of fields and attributes for the
61
+ documents. The key @:attributes@ will return a hash of attribute name and type pairs, and
62
+ @:words@ returns a hash of hashes representing the words from the search, with the number of
63
63
  documents and hits for each, along the lines of:
64
64
 
65
65
  results[:words]["Pat"] #=> {:docs => 12, :hits => 15}
66
66
 
67
- <tt>:total</tt>, <tt>:total_found</tt> and <tt>:time</tt> return the number of matches available, the
67
+ @:total@, @:total_found@ and @:time@ return the number of matches available, the
68
68
  total number of matches (which may be greater than the maximum available), and the time in milliseconds
69
69
  that the query took to run.
70
70
 
71
- <tt>:status</tt> is the error code for the query - and if there was a related warning, it will be under
72
- the <tt>:warning</tt> key. Fatal errors will be described under <tt>:error</tt>.
71
+ @:status@ is the error code for the query - and if there was a related warning, it will be under
72
+ the @:warning@ key. Fatal errors will be described under @:error@.
73
73
 
74
74
  If you've installed the gem and wondering why there's no tests - check out the svn version. I've kept the specs out of the gem as I have a decent amount of test data in there, which really isn't needed unless you want to submit patches.
75
75
 
76
- == Contributors
76
+ h2. Contributors
77
77
 
78
78
  Thanks to the following people who have contributed to Riddle in some shape or form:
79
79
 
@@ -83,4 +83,5 @@ Thanks to the following people who have contributed to Riddle in some shape or f
83
83
  * Jeremy Seitz
84
84
  * Mark Lane
85
85
  * Xavier Noria
86
- * Henrik Nyh
86
+ * Henrik Nye
87
+ * Kristopher Chambers
@@ -10,14 +10,15 @@ module Riddle
10
10
 
11
11
  # Append raw data (only use if you know what you're doing)
12
12
  def append(*args)
13
- return if args.length == 0
14
-
15
13
  args.each { |arg| @message << arg }
16
14
  end
17
15
 
18
16
  # Append a string's length, then the string itself
19
17
  def append_string(str)
20
- @message << [str.send(@size_method)].pack('N') + str
18
+ string = str.respond_to?(:force_encoding) ?
19
+ str.dup.force_encoding('ASCII-8BIT') : str
20
+
21
+ @message << [string.send(@size_method)].pack('N') + string
21
22
  end
22
23
 
23
24
  # Append an integer
data/lib/riddle/client.rb CHANGED
@@ -437,6 +437,9 @@ module Riddle
437
437
  version = 0
438
438
  length = 0
439
439
  message = Array(messages).join("")
440
+ if message.respond_to?(:force_encoding)
441
+ message = message.force_encoding('ASCII-8BIT')
442
+ end
440
443
 
441
444
  connect do |socket|
442
445
  case command
data/lib/riddle.rb CHANGED
@@ -18,7 +18,7 @@ module Riddle #:nodoc:
18
18
  Rev = 1533
19
19
  # Release number to mark my own fixes, beyond feature parity with
20
20
  # Sphinx itself.
21
- Release = 5
21
+ Release = 7
22
22
 
23
23
  String = [Major, Minor, Tiny].join('.')
24
24
  GemVersion = [Major, Minor, Tiny, Rev, Release].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freelancing-god-riddle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8.1533.5
4
+ version: 0.9.8.1533.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-24 00:00:00 -07:00
12
+ date: 2009-07-30 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -40,7 +40,7 @@ files:
40
40
  - lib/riddle.rb
41
41
  - lib/tabtab_definitions.rb
42
42
  - MIT-LICENCE
43
- - README
43
+ - README.textile
44
44
  - spec/functional/excerpt_spec.rb
45
45
  - spec/functional/keywords_spec.rb
46
46
  - spec/functional/search_spec.rb
@@ -60,6 +60,7 @@ files:
60
60
  - spec/unit/riddle_spec.rb
61
61
  has_rdoc: true
62
62
  homepage: http://riddle.freelancing-gods.com
63
+ licenses:
63
64
  post_install_message:
64
65
  rdoc_options:
65
66
  - --title
@@ -84,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
85
  requirements: []
85
86
 
86
87
  rubyforge_project: riddle
87
- rubygems_version: 1.2.0
88
+ rubygems_version: 1.3.5
88
89
  signing_key:
89
90
  specification_version: 2
90
91
  summary: API for Sphinx, written in and for Ruby.