riddle 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/riddle/client.rb +3 -2
- data/lib/riddle/configuration.rb +0 -2
- data/spec/functional/connection_spec.rb +1 -1
- data/spec/functional/excerpt_spec.rb +1 -1
- data/spec/functional/keywords_spec.rb +1 -1
- data/spec/functional/persistance_spec.rb +1 -1
- data/spec/functional/search_spec.rb +1 -1
- data/spec/functional/status_spec.rb +1 -1
- data/spec/functional/update_spec.rb +1 -1
- data/spec/riddle/configuration_spec.rb +1 -7
- data/spec/riddle/controller_spec.rb +5 -0
- data/spec/unit/client_spec.rb +2 -2
- metadata +2 -2
data/lib/riddle/client.rb
CHANGED
@@ -132,7 +132,7 @@ module Riddle
|
|
132
132
|
Riddle.version_warning
|
133
133
|
|
134
134
|
@server = server || "localhost"
|
135
|
-
@port = port ||
|
135
|
+
@port = port || 9312
|
136
136
|
@socket = nil
|
137
137
|
|
138
138
|
reset
|
@@ -474,9 +474,10 @@ module Riddle
|
|
474
474
|
# Connects to the Sphinx daemon, and yields a socket to use. The socket is
|
475
475
|
# closed at the end of the block.
|
476
476
|
def connect(&block)
|
477
|
-
|
477
|
+
if @socket && !@socket.closed?
|
478
478
|
yield @socket
|
479
479
|
else
|
480
|
+
@socket = nil
|
480
481
|
open_socket
|
481
482
|
begin
|
482
483
|
yield @socket
|
data/lib/riddle/configuration.rb
CHANGED
@@ -6,6 +6,11 @@ describe Riddle::Controller do
|
|
6
6
|
@controller = Riddle::Controller.new stub('controller'), 'sphinx.conf'
|
7
7
|
end
|
8
8
|
|
9
|
+
it "should return 0.9.9 if using 0.9.9" do
|
10
|
+
@controller.stub!(:` => 'Sphinx 0.9.9-release (r2117)')
|
11
|
+
@controller.sphinx_version.should == '0.9.9'
|
12
|
+
end
|
13
|
+
|
9
14
|
it "should return 0.9.9 if using 0.9.9 rc2" do
|
10
15
|
@controller.stub!(:` => 'Sphinx 0.9.9-rc2 (r1785)')
|
11
16
|
@controller.sphinx_version.should == '0.9.9'
|
data/spec/unit/client_spec.rb
CHANGED
@@ -10,8 +10,8 @@ describe Riddle::Client do
|
|
10
10
|
Riddle::Client.new.server.should == "localhost"
|
11
11
|
end
|
12
12
|
|
13
|
-
it "should default to port
|
14
|
-
Riddle::Client.new.port.should ==
|
13
|
+
it "should default to port 9312" do
|
14
|
+
Riddle::Client.new.port.should == 9312
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should translate anchor arguments correctly" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riddle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.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-12-
|
12
|
+
date: 2009-12-08 00:00:00 +11:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|