riddle 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -132,7 +132,7 @@ module Riddle
132
132
  Riddle.version_warning
133
133
 
134
134
  @server = server || "localhost"
135
- @port = port || 3312
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
- unless @socket.nil?
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
@@ -18,8 +18,6 @@ module Riddle
18
18
  attr_accessor :indexer
19
19
 
20
20
  def initialize
21
- Riddle.version_warning
22
-
23
21
  @indexer = Riddle::Configuration::Indexer.new
24
22
  @searchd = Riddle::Configuration::Searchd.new
25
23
  @indexes = []
@@ -4,7 +4,7 @@ class RiddleSpecConnectionProcError < StandardError; end
4
4
 
5
5
  describe "Sphinx Client" do
6
6
  before :each do
7
- @client = Riddle::Client.new("localhost", 3313)
7
+ @client = Riddle::Client.new("localhost", 9313)
8
8
  end
9
9
 
10
10
  after :each do
@@ -2,7 +2,7 @@ require 'spec/spec_helper'
2
2
 
3
3
  describe "Sphinx Excepts" do
4
4
  before :each do
5
- @client = Riddle::Client.new("localhost", 3313)
5
+ @client = Riddle::Client.new("localhost", 9313)
6
6
  end
7
7
 
8
8
  it "should highlight a single word multiple times in a document" do
@@ -2,7 +2,7 @@ require 'spec/spec_helper'
2
2
 
3
3
  describe "Sphinx Keywords" do
4
4
  before :each do
5
- @client = Riddle::Client.new("localhost", 3313)
5
+ @client = Riddle::Client.new("localhost", 9313)
6
6
  end
7
7
 
8
8
  it "should return an array of hashes" do
@@ -2,7 +2,7 @@ require 'spec/spec_helper'
2
2
 
3
3
  describe "Sphinx Persistance Connection" do
4
4
  before :each do
5
- @client = Riddle::Client.new("localhost", 3313)
5
+ @client = Riddle::Client.new("localhost", 9313)
6
6
  end
7
7
 
8
8
  it "should raise errors once already opened" do
@@ -2,7 +2,7 @@ require 'spec/spec_helper'
2
2
 
3
3
  describe "Sphinx Searches" do
4
4
  before :each do
5
- @client = Riddle::Client.new("localhost", 3313)
5
+ @client = Riddle::Client.new("localhost", 9313)
6
6
  end
7
7
 
8
8
  it "should return a single hash if a single query" do
@@ -3,7 +3,7 @@ require 'spec/spec_helper'
3
3
  if Riddle.loaded_version == '0.9.9'
4
4
  describe "Sphinx Status" do
5
5
  before :each do
6
- @client = Riddle::Client.new("localhost", 3313)
6
+ @client = Riddle::Client.new("localhost", 9313)
7
7
  @status = @client.status
8
8
  end
9
9
 
@@ -2,7 +2,7 @@ require 'spec/spec_helper'
2
2
 
3
3
  describe "Sphinx Updates" do
4
4
  before :each do
5
- @client = Riddle::Client.new("localhost", 3313)
5
+ @client = Riddle::Client.new("localhost", 9313)
6
6
  end
7
7
 
8
8
  it "should update a single record appropriately" do
@@ -1,11 +1,5 @@
1
1
  require 'spec/spec_helper'
2
2
 
3
3
  describe Riddle::Configuration do
4
- describe '#initialize' do
5
- it "should check the loaded Sphinx version" do
6
- Riddle.should_receive(:version_warning)
7
-
8
- Riddle::Configuration.new
9
- end
10
- end
4
+ #
11
5
  end
@@ -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'
@@ -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 3312" do
14
- Riddle::Client.new.port.should == 3312
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.6
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-02 00:00:00 +11:00
12
+ date: 2009-12-08 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency