riddle 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -83,3 +83,4 @@ Thanks to the following people who have contributed to Riddle in some shape or f
83
83
  * Amir Yalon
84
84
  * Sam Goldstein
85
85
  * Matt Todd
86
+ * Paco Guzmán
@@ -6,7 +6,7 @@ class Riddle::AutoVersion
6
6
  case version
7
7
  when '0.9.8', '0.9.9'
8
8
  require "riddle/#{version}"
9
- when '1.10-beta'
9
+ when '1.10-beta', '1.10-id64-beta'
10
10
  require 'riddle/1.10'
11
11
  end
12
12
  end
@@ -136,8 +136,9 @@ module Riddle
136
136
  # accessed and changed via the attribute accessors.
137
137
  def initialize(servers=nil, port=nil)
138
138
  Riddle.version_warning
139
-
140
- @servers = Array(servers || "localhost").shuffle
139
+
140
+ servers = Array(servers || "localhost")
141
+ @servers = servers.respond_to?(:shuffle) ? servers.shuffle : servers.sort_by{ rand }
141
142
  @port = port || 9312
142
143
  @socket = nil
143
144
 
@@ -12,7 +12,7 @@ module Riddle
12
12
  end
13
13
 
14
14
  def sphinx_version
15
- `#{indexer} 2>&1`[/^Sphinx (\d+\.\d+(\.\d+|\-beta))/, 1]
15
+ `#{indexer} 2>&1`[/^Sphinx (\d+\.\d+(\.\d+|(\-id64)?\-beta))/, 1]
16
16
  rescue
17
17
  nil
18
18
  end
@@ -27,5 +27,12 @@ describe Riddle::AutoVersion do
27
27
  @controller.stub!(:sphinx_version => '1.10-beta')
28
28
  Riddle::AutoVersion.configure
29
29
  end
30
+
31
+ it "should require 1.10 if using 1.10 with 64 bit IDs" do
32
+ Riddle::AutoVersion.should_receive(:require).with('riddle/1.10')
33
+
34
+ @controller.stub!(:sphinx_version => '1.10-id64-beta')
35
+ Riddle::AutoVersion.configure
36
+ end
30
37
  end
31
38
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riddle
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 1
10
- version: 1.2.1
9
+ - 2
10
+ version: 1.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pat Allan
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-16 00:00:00 +11:00
18
+ date: 2010-12-22 00:00:00 +11:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency