flying-sphinx 2.0.0 → 2.1.0
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.
- checksums.yaml +4 -4
- data/{HISTORY → CHANGELOG.markdown} +181 -48
- data/Gemfile +0 -13
- data/README.textile +1 -1
- data/flying-sphinx.gemspec +1 -1
- data/lib/flying_sphinx/configurer.rb +16 -3
- data/lib/flying_sphinx/version.rb +1 -1
- data/spec/acceptance/configuring_spec.rb +4 -0
- data/spec/flying_sphinx/configurer_spec.rb +29 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9e14e5453c49da728c4c1a6fcd73d3bb69f9757346d389118a83f2e637f8d02
|
|
4
|
+
data.tar.gz: a03b95890d0fbe8d5ecf8c9a4254bbb419ee06fc28f722fc1c90d4e7d3d21db3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d2e2893b492f73235a30acfe70c3aab0958beca8f495606e0da53f743b17bf7869c2b2178ae2cff97fa3c4cc7496d88bb2fc0472a24b3d4d81a11291f12c4763
|
|
7
|
+
data.tar.gz: 1d7280b6f9b55632436a5665098bc77abe9f2ec859b4fe7073449953d451a8b89c9a2af6c4786a9041a6af29660b5169c2c6f36599cb12a4b4a46a06f72fe925
|
|
@@ -1,149 +1,282 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project (at least, from v0.4.0 onwards) are documented in this file.
|
|
4
|
+
|
|
5
|
+
## 2.1.0 - 2018-04-20
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
* Check Sphinx/Manticore version against what's available on the Flying Sphinx servers as part of the configuration process.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
* Update gzipped_tar dependency.
|
|
14
|
+
|
|
15
|
+
## 2.0.0 - 2018-04-10
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
* Add support for Manticore (via `engine` setting in config/thinking_sphinx.yml).
|
|
20
|
+
* Using Thinking Sphinx v4's new task/command architecture, and so all the ts rake tasks perform the appropriate behaviour on Flying Sphinx.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
* Dropped support for Thinking Sphinx 3.x or older.
|
|
25
|
+
* Dropped support for ActiveRecord/Rails 3.1 or older.
|
|
26
|
+
* Dropped support for Ruby 2.1 or older.
|
|
27
|
+
|
|
28
|
+
### Deprecated
|
|
29
|
+
|
|
30
|
+
* The fs tasks and the flying-sphinx CLI tool are deprecated and will be removed in a future release. Please use the standard Thinking Sphinx ts rake tasks instead.
|
|
31
|
+
|
|
32
|
+
## 1.3.1 - 2017-12-04
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
10
36
|
* Fix call to generate real-time data for thinking-sphinx v3.4+.
|
|
11
37
|
|
|
12
|
-
1.3.0 -
|
|
13
|
-
|
|
14
|
-
|
|
38
|
+
## 1.3.0 - 2017-12-04
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
* Using v5 of the flying-sphinx.com API.
|
|
43
|
+
* Dropping support for Ruby 1.8.7 and REE.
|
|
15
44
|
* Be clear about the reliance on thinking-sphinx v1.5 or better.
|
|
16
45
|
|
|
17
|
-
1.2.1 -
|
|
18
|
-
|
|
46
|
+
## 1.2.1 - 2017-09-29
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
|
|
19
50
|
* Remove post-install message.
|
|
20
51
|
* Relax Faraday requirement to allow for v0.7.
|
|
21
52
|
* Improved behaviour with Ruby 1.8.7.
|
|
22
53
|
|
|
23
|
-
|
|
54
|
+
### Fixed
|
|
55
|
+
|
|
56
|
+
* Fix population of real-time indices for thinking-sphinx v3.4+.
|
|
57
|
+
|
|
58
|
+
## 1.2.0 - 2014-03-30
|
|
59
|
+
|
|
60
|
+
### Changed
|
|
61
|
+
|
|
24
62
|
* All configuration files (Sphinx, wordforms, exceptions, etc) are now gzipped when sent to the API.
|
|
25
63
|
|
|
26
|
-
1.1.0 -
|
|
27
|
-
|
|
64
|
+
## 1.1.0 - 2014-03-15
|
|
65
|
+
|
|
66
|
+
### Added
|
|
67
|
+
|
|
28
68
|
* Added remote rotate support via custom controller.
|
|
29
69
|
* Added regenerate command (for when real-time indices are being used).
|
|
70
|
+
|
|
71
|
+
### Changed
|
|
72
|
+
|
|
73
|
+
* Updated Faraday dependency to require 0.9 or newer (and removed faraday_middleware dependency).
|
|
30
74
|
* Removed the requirement of Rashie.
|
|
31
75
|
|
|
32
|
-
1.0.0 -
|
|
76
|
+
## 1.0.0 - 2013-05-07
|
|
77
|
+
|
|
78
|
+
### Changed
|
|
79
|
+
|
|
33
80
|
* Updating Riddle dependency to >= 1.5.6.
|
|
34
81
|
* Support for Thinking Sphinx v1/2/3.
|
|
35
82
|
* Delayed Job support pushed back to ts-delayed-delta.
|
|
36
83
|
* Updating MultiJson dependency to ensure MultiJson.load is always available.
|
|
37
84
|
* All actions are now tracked through Pusher, instead of polling or using slow HTTP requests.
|
|
38
85
|
|
|
39
|
-
0.8.5 -
|
|
86
|
+
## 0.8.5 - 2012-12-10
|
|
87
|
+
|
|
88
|
+
### Changed
|
|
89
|
+
|
|
40
90
|
* Daemon actions (start/stop) are now asynchronous.
|
|
41
91
|
* More forgiving when environment variables aren't around. Particularly helpful for Padrino and Sinatra.
|
|
42
92
|
* Make delta indexing jobs asynchronous - no need to wait for the result. Also, with the different URL, flying-sphinx.com will not queue up duplicate delta jobs within the last 20 minutes if there's a indexing job still pending.
|
|
43
93
|
|
|
44
|
-
0.8.4 -
|
|
94
|
+
## 0.8.4 - 2012-09-22
|
|
95
|
+
|
|
96
|
+
### Fixed
|
|
97
|
+
|
|
45
98
|
* Load the Delta class when loading Rails.
|
|
46
99
|
|
|
47
|
-
0.8.3 -
|
|
100
|
+
## 0.8.3 - 2012-09-17
|
|
101
|
+
|
|
102
|
+
### Changed
|
|
103
|
+
|
|
48
104
|
* Requires Rails 3 or better (if you're using Rails).
|
|
49
105
|
* Load Rails when configuring.
|
|
50
106
|
* Don't check whether a document exists before marking it as deleted - Sphinx handles this gracefully anyway.
|
|
51
107
|
|
|
52
|
-
0.8.2 -
|
|
108
|
+
## 0.8.2 - 2012-08-28
|
|
109
|
+
|
|
110
|
+
### Changed
|
|
111
|
+
|
|
53
112
|
* Don't presume there is a Time.zone method (for Rails 2.3).
|
|
54
113
|
* Set client key as part of the configuration generation process (for Rails 2.3).
|
|
55
114
|
|
|
56
|
-
0.8.1 -
|
|
115
|
+
## 0.8.1 - 2012-08-28
|
|
116
|
+
|
|
117
|
+
### Changed
|
|
118
|
+
|
|
57
119
|
* Load Thinking Sphinx when sending a generated configuration (as opposed to a hand-written file).
|
|
58
120
|
* Rebuild command now sends the new configuration up, as before.
|
|
59
121
|
|
|
60
|
-
0.8.0 -
|
|
61
|
-
|
|
122
|
+
## 0.8.0 - 2012-08-25
|
|
123
|
+
|
|
124
|
+
### Added
|
|
125
|
+
|
|
62
126
|
* Adding a 'flying-sphinx' executable to match Python and Node.js clients.
|
|
127
|
+
|
|
128
|
+
### Removed
|
|
129
|
+
|
|
63
130
|
* Removing support for accessing Heroku's shared databases through an SSH tunnel.
|
|
64
131
|
|
|
65
|
-
0.7.0 -
|
|
132
|
+
## 0.7.0 - 2012-07-16
|
|
133
|
+
|
|
134
|
+
### Changed
|
|
135
|
+
|
|
66
136
|
* Print the indexing log.
|
|
67
137
|
* Distinguish between search server and SSH/indexing server, which allows for load balancers as the former.
|
|
68
138
|
* Send the gem version through as a header on API calls.
|
|
69
139
|
* Let flying-sphinx.com wrangle the Sphinx configuration.
|
|
70
140
|
* Use v3 of the flying-sphinx.com API
|
|
71
141
|
|
|
72
|
-
0.6.6 -
|
|
142
|
+
## 0.6.6 - 2012-07-14
|
|
143
|
+
|
|
144
|
+
### Changed
|
|
145
|
+
|
|
73
146
|
* Don't complain about 201s for starting/stopping Sphinx.
|
|
74
147
|
* Relaxing the faraday_middleware dependency to allow 0.8 releases (Matthew Zikherman).
|
|
75
148
|
|
|
76
|
-
0.6.5 -
|
|
149
|
+
## 0.6.5 - 2012-05-03
|
|
150
|
+
|
|
151
|
+
### Changed
|
|
152
|
+
|
|
77
153
|
* Relaxing the multi_json dependency to allow for higher versions.
|
|
78
154
|
* Support for staging.flying-sphinx.com.
|
|
79
155
|
|
|
80
|
-
0.6.4 -
|
|
156
|
+
## 0.6.4 - 2012-03-03
|
|
157
|
+
|
|
158
|
+
### Fixed
|
|
159
|
+
|
|
81
160
|
* Fix for Rails 2 with API verbose logging.
|
|
82
161
|
|
|
83
|
-
0.6.3 -
|
|
162
|
+
## 0.6.3 - 2012-03-01
|
|
163
|
+
|
|
164
|
+
### Added
|
|
165
|
+
|
|
166
|
+
* Allow direct database access when FLYING_SPHINX_INGRESS is set.
|
|
167
|
+
|
|
168
|
+
### Changed
|
|
169
|
+
|
|
84
170
|
* Slow down polling for direct indexing from every 1 second to every 3 seconds.
|
|
85
171
|
* Verbose logging now has timestamps.
|
|
86
|
-
* Allow direct database access when FLYING_SPHINX_INGRESS is set.
|
|
87
172
|
* Use dups of ENV variables so the values can be modified.
|
|
88
173
|
* Report if Sphinx wasn't able to start.
|
|
89
174
|
* Load Flying Sphinx when ENV['FLYING_SPHINX_IDENTIFIER'] exists, instead of for any Rails environment that isn't development or test.
|
|
90
175
|
|
|
91
|
-
0.6.2 -
|
|
176
|
+
## 0.6.2 - 2012-01-02
|
|
177
|
+
|
|
178
|
+
### Changed
|
|
179
|
+
|
|
92
180
|
* Pass Sphinx version through to Flying Sphinx servers.
|
|
93
181
|
|
|
94
|
-
0.6.1 -
|
|
182
|
+
## 0.6.1 - 2011-11-04
|
|
183
|
+
|
|
184
|
+
### Changed
|
|
185
|
+
|
|
95
186
|
* Adding Riddle dependency requirement.
|
|
96
187
|
* Updating indexes (index plural) references to indices.
|
|
97
188
|
* Updating faraday_middleware version requirement, to play nicely with OmniAuth (Paolo Perrotta)
|
|
98
189
|
|
|
99
|
-
0.6.0 -
|
|
100
|
-
|
|
190
|
+
## 0.6.0 - 2011-07-31
|
|
191
|
+
|
|
192
|
+
### Added
|
|
193
|
+
|
|
101
194
|
* Support for all file-based Sphinx settings: stopwords, wordforms, exceptions, and mysql ssl settings for SQL sources.
|
|
102
195
|
|
|
103
|
-
|
|
104
|
-
|
|
196
|
+
### Changed
|
|
197
|
+
|
|
198
|
+
* Version in a separate file.
|
|
199
|
+
|
|
200
|
+
## 0.5.2 - 2011-07-28
|
|
201
|
+
|
|
202
|
+
### Added
|
|
203
|
+
|
|
105
204
|
* This history file now exists (pre-populated).
|
|
106
205
|
* An actual README, courtesy of some prodding by Mislav.
|
|
107
206
|
* Added support for wordforms (automatically sent through to the server).
|
|
207
|
+
|
|
208
|
+
### Changed
|
|
209
|
+
|
|
210
|
+
* Log SSH exceptions during indexing (when we're being verbose).
|
|
108
211
|
* Don't presume that ENV['DATABASE_URL'] exists - it won't in non-Heroku environments.
|
|
109
212
|
|
|
110
|
-
0.5.1 -
|
|
213
|
+
## 0.5.1 - 2011-06-23
|
|
214
|
+
|
|
215
|
+
### Added
|
|
216
|
+
|
|
111
217
|
* Adding rake as a development dependency, just for Travis CI.
|
|
218
|
+
* Sinatra loader (equivalent of a Railtie).
|
|
219
|
+
|
|
220
|
+
### Changed
|
|
221
|
+
|
|
112
222
|
* Have a default database port - Cedar stack doesn't set it by default.
|
|
113
223
|
* Allow for newer net-ssh gem versions (including 2.1).
|
|
114
|
-
|
|
224
|
+
|
|
225
|
+
### Fixed
|
|
226
|
+
|
|
115
227
|
* Fixed bug for handling JSON always as a Hash (sometimes it's an Array).
|
|
116
228
|
* Better error checking when index requests don't get created as expected.
|
|
117
229
|
|
|
118
|
-
0.5.0 -
|
|
230
|
+
## 0.5.0 - 2011-05-12
|
|
231
|
+
|
|
232
|
+
### Added
|
|
233
|
+
|
|
119
234
|
* Rake tasks for latest actions and last index log.
|
|
120
|
-
* Switching to version 2 of the API.
|
|
121
235
|
* Adding default rake task for Travis CI.
|
|
122
|
-
* Allow for Rails 2 versions of Delayed Job.
|
|
123
|
-
* Set client_key for connections, configuration if supported by Riddle and Thinking Sphinx.
|
|
124
236
|
* Allow server to automatically close SSH connections.
|
|
125
237
|
* Adding logging on API calls (Josh Kalderimis).
|
|
126
238
|
* Allow for non-tunnelled index requests (for RDS).
|
|
239
|
+
|
|
240
|
+
### Changed
|
|
241
|
+
|
|
242
|
+
* Switching to version 2 of the API.
|
|
243
|
+
* Allow for Rails 2 versions of Delayed Job.
|
|
244
|
+
* Set client_key for connections, configuration if supported by Riddle and Thinking Sphinx.
|
|
127
245
|
* Don't use custom database adapter if the database is MySQL.
|
|
128
246
|
* Fall back to environment variables for connection settings.
|
|
129
247
|
* Switching from JSON and HTTParty to MultiJSON and Faraday (Josh Kalderimis).
|
|
130
248
|
* Using Bundler as gem driver instead of Jeweler (Josh Kalderimis).
|
|
131
249
|
* More flexible JSON dependency.
|
|
132
250
|
|
|
133
|
-
0.4.4 -
|
|
251
|
+
## 0.4.4 - 2011-02-07
|
|
252
|
+
|
|
253
|
+
### Changed
|
|
254
|
+
|
|
134
255
|
* Using ActiveRecord's connection information, as we can't rely on heroku_env.yml to be around.
|
|
135
256
|
|
|
136
|
-
0.4.3 -
|
|
257
|
+
## 0.4.3 - 2011-02-04
|
|
258
|
+
|
|
259
|
+
### Changed
|
|
260
|
+
|
|
137
261
|
* Wait until the SSH session and forward is prepared before making the index request.
|
|
138
262
|
* If credentials are invalid, raise an appropriate error instead of letting the JSON parsing fail.
|
|
139
263
|
|
|
140
|
-
0.4.2 -
|
|
264
|
+
## 0.4.2 - 2011-01-29
|
|
265
|
+
|
|
266
|
+
### Changed
|
|
267
|
+
|
|
141
268
|
* Set the Thinking Sphinx database adapter when loaded, instead of requiring the Rails dispatcher to setup.
|
|
142
269
|
|
|
143
|
-
0.4.1 -
|
|
270
|
+
## 0.4.1 - 2011-01-24
|
|
271
|
+
|
|
272
|
+
### Changed
|
|
273
|
+
|
|
144
274
|
* Comparing against response bodies for consistency (and avoiding HTTParty magic).
|
|
145
275
|
|
|
146
|
-
0.4.0 -
|
|
276
|
+
## 0.4.0 - 2011-01-18
|
|
277
|
+
|
|
278
|
+
### Changed
|
|
279
|
+
|
|
147
280
|
* Using HTTPS for API calls.
|
|
148
281
|
* Using Flying Sphinx server's account identifier instead of the heroku id from the environment (the latter being unreliable and not part of any official Heroku add-on documentation).
|
|
149
282
|
|
data/Gemfile
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
1
|
source 'https://rubygems.org'
|
|
2
2
|
|
|
3
3
|
gemspec
|
|
4
|
-
|
|
5
|
-
if RUBY_VERSION.to_f <= 1.8
|
|
6
|
-
gem "public_suffix", "< 1.4.0"
|
|
7
|
-
gem "nokogiri", "< 1.6.0"
|
|
8
|
-
gem "activesupport", "< 4.0.0"
|
|
9
|
-
elsif RUBY_VERSION.to_f <= 1.9
|
|
10
|
-
gem "public_suffix", "< 1.5.0"
|
|
11
|
-
gem "mime-types", "< 3.0"
|
|
12
|
-
gem "nokogiri", "< 1.7.0"
|
|
13
|
-
elsif RUBY_VERSION.to_f <= 2.0
|
|
14
|
-
gem "public_suffix", "< 1.5.0"
|
|
15
|
-
gem "nokogiri", "< 1.7.0"
|
|
16
|
-
end
|
data/README.textile
CHANGED
|
@@ -9,7 +9,7 @@ This is all covered pretty well on "the Flying Sphinx site":http://flying-sphinx
|
|
|
9
9
|
<pre><code>gem 'flying-sphinx',
|
|
10
10
|
:git => 'git://github.com/flying-sphinx/flying-sphinx.git',
|
|
11
11
|
:branch => 'master',
|
|
12
|
-
:ref => '
|
|
12
|
+
:ref => 'da021897c6'</code></pre>
|
|
13
13
|
|
|
14
14
|
h2. Compatibility and Limitations
|
|
15
15
|
|
data/flying-sphinx.gemspec
CHANGED
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
|
19
19
|
|
|
20
20
|
s.add_runtime_dependency 'ey-hmac', '~> 2.2'
|
|
21
21
|
s.add_runtime_dependency 'faraday', '>= 0.7'
|
|
22
|
-
s.add_runtime_dependency 'gzipped_tar', '~> 0.
|
|
22
|
+
s.add_runtime_dependency 'gzipped_tar', '~> 0.1.1'
|
|
23
23
|
s.add_runtime_dependency 'multi_json', '>= 1.3.0'
|
|
24
24
|
s.add_runtime_dependency 'pusher-client', '~> 0.3'
|
|
25
25
|
s.add_runtime_dependency 'thinking-sphinx', '>= 4.0.0'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
class FlyingSphinx::Configurer
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
InvalidVersionError = Class.new FlyingSphinx::Error
|
|
3
|
+
PresignatureError = Class.new FlyingSphinx::Error
|
|
4
|
+
UploadError = Class.new FlyingSphinx::Error
|
|
4
5
|
|
|
5
6
|
def self.call(api, input = nil)
|
|
6
7
|
new(api, input).call
|
|
@@ -12,6 +13,11 @@ class FlyingSphinx::Configurer
|
|
|
12
13
|
end
|
|
13
14
|
|
|
14
15
|
def call
|
|
16
|
+
if invalid_version?
|
|
17
|
+
raise InvalidVersionError,
|
|
18
|
+
"Unknown Sphinx engine/version: #{config.engine}-#{config.version}"
|
|
19
|
+
end
|
|
20
|
+
|
|
15
21
|
if presignature["status"] != "OK"
|
|
16
22
|
raise PresignatureError, "Requesting presignature failed"
|
|
17
23
|
end
|
|
@@ -31,6 +37,10 @@ class FlyingSphinx::Configurer
|
|
|
31
37
|
|
|
32
38
|
attr_reader :api, :input
|
|
33
39
|
|
|
40
|
+
def config
|
|
41
|
+
@config ||= FlyingSphinx::ConfigurationOptions.new input
|
|
42
|
+
end
|
|
43
|
+
|
|
34
44
|
def connection
|
|
35
45
|
Faraday.new(:url => presignature["url"]) do |builder|
|
|
36
46
|
builder.request :multipart
|
|
@@ -46,7 +56,6 @@ class FlyingSphinx::Configurer
|
|
|
46
56
|
end
|
|
47
57
|
|
|
48
58
|
def file
|
|
49
|
-
config = FlyingSphinx::ConfigurationOptions.new input
|
|
50
59
|
writer = GZippedTar::Writer.new
|
|
51
60
|
|
|
52
61
|
writer.add "sphinx/raw.conf", config.raw
|
|
@@ -61,6 +70,10 @@ class FlyingSphinx::Configurer
|
|
|
61
70
|
StringIO.new writer.output
|
|
62
71
|
end
|
|
63
72
|
|
|
73
|
+
def invalid_version?
|
|
74
|
+
api.get("/versions/#{config.engine}-#{config.version}")["status"] != "OK"
|
|
75
|
+
end
|
|
76
|
+
|
|
64
77
|
def presignature
|
|
65
78
|
@presignature ||= api.get "/presignature"
|
|
66
79
|
end
|
|
@@ -16,6 +16,10 @@ describe 'Configuring Sphinx' do
|
|
|
16
16
|
to_return(
|
|
17
17
|
:body => '{"url":"https://foo","path":"bar","fields":{},"status":"OK"}'
|
|
18
18
|
)
|
|
19
|
+
stub_hmac_request(
|
|
20
|
+
:get, "https://flying-sphinx.com/api/my/v5/versions/sphinx-2.2.11"
|
|
21
|
+
).to_return(:body => '{"status":"OK"}')
|
|
22
|
+
|
|
19
23
|
stub_request(:post, "https://foo/").to_return(:status => 200)
|
|
20
24
|
end
|
|
21
25
|
|
|
@@ -2,13 +2,14 @@ require "spec_helper"
|
|
|
2
2
|
|
|
3
3
|
RSpec.describe FlyingSphinx::Configurer do
|
|
4
4
|
let(:subject) { FlyingSphinx::Configurer.new api }
|
|
5
|
-
let(:api) { double
|
|
5
|
+
let(:api) { double "API" }
|
|
6
6
|
let(:presignature) { {
|
|
7
7
|
"status" => "OK",
|
|
8
8
|
"path" => "a/path/of/my/own",
|
|
9
9
|
"url" => "https://confserver",
|
|
10
10
|
"fields" => {"message" => "something"}
|
|
11
11
|
} }
|
|
12
|
+
let(:version_check) { {"status" => "OK"} }
|
|
12
13
|
let(:configuration_options) { double "conf options", :version => "2.2.3",
|
|
13
14
|
:raw => "indexer ...", :settings => settings, :engine => "manticore" }
|
|
14
15
|
let(:settings) { {
|
|
@@ -19,6 +20,10 @@ RSpec.describe FlyingSphinx::Configurer do
|
|
|
19
20
|
before :each do
|
|
20
21
|
stub_request(:post, "https://confserver").to_return(:status => 200)
|
|
21
22
|
|
|
23
|
+
allow(api).to receive(:get).with("/versions/manticore-2.2.3").
|
|
24
|
+
and_return(version_check)
|
|
25
|
+
allow(api).to receive(:get).with("/presignature").and_return(presignature)
|
|
26
|
+
|
|
22
27
|
allow(FlyingSphinx::ConfigurationOptions).to receive(:new).
|
|
23
28
|
and_return(configuration_options)
|
|
24
29
|
end
|
|
@@ -144,4 +149,27 @@ RSpec.describe FlyingSphinx::Configurer do
|
|
|
144
149
|
)
|
|
145
150
|
end
|
|
146
151
|
end
|
|
152
|
+
|
|
153
|
+
context "version failure" do
|
|
154
|
+
before :each do
|
|
155
|
+
version_check["status"] = "NOT FOUND"
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
it "raises an InvalidVersionError exception" do
|
|
159
|
+
expect { subject.call }.to raise_error(
|
|
160
|
+
FlyingSphinx::Configurer::InvalidVersionError
|
|
161
|
+
)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
it "does not attempt to upload" do
|
|
165
|
+
begin
|
|
166
|
+
subject.call
|
|
167
|
+
rescue FlyingSphinx::Configurer::InvalidVersionError
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
expect(
|
|
171
|
+
a_multipart_request(:post, "https://confserver")
|
|
172
|
+
).not_to have_been_made
|
|
173
|
+
end
|
|
174
|
+
end
|
|
147
175
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: flying-sphinx
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pat Allan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-04-
|
|
11
|
+
date: 2018-04-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ey-hmac
|
|
@@ -44,14 +44,14 @@ dependencies:
|
|
|
44
44
|
requirements:
|
|
45
45
|
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 0.
|
|
47
|
+
version: 0.1.1
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 0.
|
|
54
|
+
version: 0.1.1
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: multi_json
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -218,8 +218,8 @@ files:
|
|
|
218
218
|
- ".gitignore"
|
|
219
219
|
- ".travis.yml"
|
|
220
220
|
- Appraisals
|
|
221
|
+
- CHANGELOG.markdown
|
|
221
222
|
- Gemfile
|
|
222
|
-
- HISTORY
|
|
223
223
|
- LICENCE
|
|
224
224
|
- README.textile
|
|
225
225
|
- Rakefile
|