flying-sphinx 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/flying_sphinx/index_request.rb +6 -0
- data/spec/flying_sphinx/index_request_spec.rb +11 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
@@ -53,11 +53,15 @@ class FlyingSphinx::IndexRequest
|
|
53
53
|
end
|
54
54
|
rescue Net::SSH::Exception
|
55
55
|
cancel_request
|
56
|
+
rescue RuntimeError => err
|
57
|
+
puts err.message
|
56
58
|
end
|
57
59
|
|
58
60
|
def begin_request
|
59
61
|
@index_id = api.post('/app/indices', :indices => indices.join(','))
|
60
62
|
@request_begun = true
|
63
|
+
|
64
|
+
raise RuntimeError, 'Your account does not support delta indexing. Upgrading plans is probably the best way around this.' if @index_id == 'BLOCKED'
|
61
65
|
end
|
62
66
|
|
63
67
|
def request_begun?
|
@@ -79,6 +83,8 @@ class FlyingSphinx::IndexRequest
|
|
79
83
|
def cancel_request
|
80
84
|
return if index_id.nil?
|
81
85
|
|
86
|
+
puts "Connecting Flying Sphinx to the Database failed"
|
87
|
+
puts "Cancelling Index Request..."
|
82
88
|
api.put "/app/indices/#{index_id}", :status => 'CANCELLED'
|
83
89
|
end
|
84
90
|
|
@@ -67,6 +67,17 @@ describe FlyingSphinx::IndexRequest do
|
|
67
67
|
|
68
68
|
index_request.update_and_index
|
69
69
|
end
|
70
|
+
|
71
|
+
context 'delta request without delta support' do
|
72
|
+
it "should explain why the request failed" do
|
73
|
+
api.should_receive(:put).with('/app', conf_params).and_return('ok')
|
74
|
+
api.should_receive(:post).
|
75
|
+
with('/app/indices', index_params).and_return('BLOCKED')
|
76
|
+
index_request.should_receive(:puts).with('Your account does not support delta indexing. Upgrading plans is probably the best way around this.')
|
77
|
+
|
78
|
+
index_request.update_and_index
|
79
|
+
end
|
80
|
+
end
|
70
81
|
end
|
71
82
|
|
72
83
|
describe '#perform' do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flying-sphinx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 2
|
10
|
+
version: 0.3.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: 2011-01-
|
18
|
+
date: 2011-01-06 00:00:00 +11:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|