flying-sphinx 0.8.5 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,9 +13,7 @@ describe FlyingSphinx::SettingFiles do
13
13
  fire_double 'Riddle::Configuration::SQLSource', methods
14
14
  end
15
15
 
16
- describe '#upload_to' do
17
- let(:api) { fire_double('FlyingSphinx::API') }
18
-
16
+ describe '#to_hash' do
19
17
  before :each do
20
18
  File.stub :read => 'blah'
21
19
  end
@@ -24,32 +22,31 @@ describe FlyingSphinx::SettingFiles do
24
22
  it "uploads #{setting} files from indices" do
25
23
  indices << index_double(setting => '/my/file/foo.txt')
26
24
 
27
- api.should_receive(:post).with('/add_file', :setting => setting.to_s,
28
- :file_name => 'foo.txt', :content => 'blah')
29
-
30
- files.upload_to(api)
25
+ files.to_hash.should == {
26
+ "#{setting}:foo.txt" => 'blah',
27
+ 'extra' => "#{setting}:foo.txt"
28
+ }
31
29
  end
32
30
 
33
31
  it "does not repeat same files for #{setting}" do
34
32
  indices << index_double(setting => '/my/file/foo.txt')
35
33
  indices << index_double(setting => '/my/file/foo.txt')
36
34
 
37
- api.should_receive(:post).with('/add_file', :setting => setting.to_s,
38
- :file_name => 'foo.txt', :content => 'blah').once
39
-
40
- files.upload_to(api)
35
+ files.to_hash.should == {
36
+ "#{setting}:foo.txt" => 'blah',
37
+ 'extra' => "#{setting}:foo.txt"
38
+ }
41
39
  end
42
40
 
43
41
  it "accepts multiples files for #{setting}" do
44
42
  indices << index_double(
45
43
  setting => '/my/file/foo.txt /my/file/bar.txt')
46
44
 
47
- api.should_receive(:post).with('/add_file', :setting => setting.to_s,
48
- :file_name => 'foo.txt', :content => 'blah').once
49
- api.should_receive(:post).with('/add_file', :setting => setting.to_s,
50
- :file_name => 'bar.txt', :content => 'blah').once
51
-
52
- files.upload_to(api)
45
+ files.to_hash.should == {
46
+ "#{setting}:foo.txt" => 'blah',
47
+ "#{setting}:bar.txt" => 'blah',
48
+ 'extra' => "#{setting}:foo.txt;#{setting}:bar.txt"
49
+ }
53
50
  end
54
51
  end
55
52
 
@@ -58,10 +55,10 @@ describe FlyingSphinx::SettingFiles do
58
55
  indices << index_double(:sources => [
59
56
  source_double(setting => '/my/file/foo.txt')])
60
57
 
61
- api.should_receive(:post).with('/add_file', :setting => setting.to_s,
62
- :file_name => 'foo.txt', :content => 'blah')
63
-
64
- files.upload_to(api)
58
+ files.to_hash.should == {
59
+ "#{setting}:foo.txt" => 'blah',
60
+ 'extra' => "#{setting}:foo.txt"
61
+ }
65
62
  end
66
63
 
67
64
  it "does not repeat same files for #{setting}" do
@@ -70,22 +67,21 @@ describe FlyingSphinx::SettingFiles do
70
67
  indices << index_double(:sources => [
71
68
  source_double(setting => '/my/file/foo.txt')])
72
69
 
73
- api.should_receive(:post).with('/add_file', :setting => setting.to_s,
74
- :file_name => 'foo.txt', :content => 'blah').once
75
-
76
- files.upload_to(api)
70
+ files.to_hash.should == {
71
+ "#{setting}:foo.txt" => 'blah',
72
+ 'extra' => "#{setting}:foo.txt"
73
+ }
77
74
  end
78
75
 
79
76
  it "accepts multiples files for #{setting}" do
80
77
  indices << index_double(:sources => [
81
78
  source_double(setting => '/my/file/foo.txt /my/file/bar.txt')])
82
79
 
83
- api.should_receive(:post).with('/add_file', :setting => setting.to_s,
84
- :file_name => 'foo.txt', :content => 'blah').once
85
- api.should_receive(:post).with('/add_file', :setting => setting.to_s,
86
- :file_name => 'bar.txt', :content => 'blah').once
87
-
88
- files.upload_to(api)
80
+ files.to_hash.should == {
81
+ "#{setting}:foo.txt" => 'blah',
82
+ "#{setting}:bar.txt" => 'blah',
83
+ 'extra' => "#{setting}:foo.txt;#{setting}:bar.txt"
84
+ }
89
85
  end
90
86
  end
91
87
  end
metadata CHANGED
@@ -1,216 +1,219 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: flying-sphinx
3
- version: !ruby/object:Gem::Version
4
- version: 0.8.5
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 0
10
+ version: 1.0.0
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Pat Allan
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-12-10 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: thinking-sphinx
16
- requirement: !ruby/object:Gem::Requirement
17
+
18
+ date: 2013-05-07 00:00:00 -07:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ requirement: &id001 !ruby/object:Gem::Requirement
17
23
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ hash: 3
28
+ segments:
29
+ - 0
30
+ version: "0"
31
+ version_requirements: *id001
32
+ name: thinking-sphinx
23
33
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
34
+ type: :runtime
35
+ - !ruby/object:Gem::Dependency
36
+ requirement: &id002 !ruby/object:Gem::Requirement
25
37
  none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
- - !ruby/object:Gem::Dependency
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ hash: 15
42
+ segments:
43
+ - 1
44
+ - 5
45
+ - 6
46
+ version: 1.5.6
47
+ version_requirements: *id002
31
48
  name: riddle
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: 1.5.0
38
- type: :runtime
39
49
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
50
+ type: :runtime
51
+ - !ruby/object:Gem::Dependency
52
+ requirement: &id003 !ruby/object:Gem::Requirement
41
53
  none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: 1.5.0
46
- - !ruby/object:Gem::Dependency
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 27
58
+ segments:
59
+ - 1
60
+ - 3
61
+ - 0
62
+ version: 1.3.0
63
+ version_requirements: *id003
47
64
  name: multi_json
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: 1.0.1
54
- type: :runtime
55
65
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: 1.0.1
62
- - !ruby/object:Gem::Dependency
63
- name: faraday_middleware
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ~>
68
- - !ruby/object:Gem::Version
69
- version: '0.7'
70
66
  type: :runtime
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
67
+ - !ruby/object:Gem::Dependency
68
+ requirement: &id004 !ruby/object:Gem::Requirement
73
69
  none: false
74
- requirements:
70
+ requirements:
75
71
  - - ~>
76
- - !ruby/object:Gem::Version
77
- version: '0.7'
78
- - !ruby/object:Gem::Dependency
79
- name: rash
80
- requirement: !ruby/object:Gem::Requirement
72
+ - !ruby/object:Gem::Version
73
+ hash: 5
74
+ segments:
75
+ - 0
76
+ - 7
77
+ version: "0.7"
78
+ version_requirements: *id004
79
+ name: faraday_middleware
80
+ prerelease: false
81
+ type: :runtime
82
+ - !ruby/object:Gem::Dependency
83
+ requirement: &id005 !ruby/object:Gem::Requirement
81
84
  none: false
82
- requirements:
85
+ requirements:
83
86
  - - ~>
84
- - !ruby/object:Gem::Version
87
+ - !ruby/object:Gem::Version
88
+ hash: 19
89
+ segments:
90
+ - 0
91
+ - 3
92
+ - 0
85
93
  version: 0.3.0
86
- type: :runtime
94
+ version_requirements: *id005
95
+ name: rash
87
96
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
97
+ type: :runtime
98
+ - !ruby/object:Gem::Dependency
99
+ requirement: &id006 !ruby/object:Gem::Requirement
89
100
  none: false
90
- requirements:
101
+ requirements:
91
102
  - - ~>
92
- - !ruby/object:Gem::Version
93
- version: 0.3.0
94
- - !ruby/object:Gem::Dependency
95
- name: rake
96
- requirement: !ruby/object:Gem::Requirement
103
+ - !ruby/object:Gem::Version
104
+ hash: 13
105
+ segments:
106
+ - 0
107
+ - 3
108
+ version: "0.3"
109
+ version_requirements: *id006
110
+ name: pusher-client
111
+ prerelease: false
112
+ type: :runtime
113
+ - !ruby/object:Gem::Dependency
114
+ requirement: &id007 !ruby/object:Gem::Requirement
97
115
  none: false
98
- requirements:
116
+ requirements:
99
117
  - - ~>
100
- - !ruby/object:Gem::Version
118
+ - !ruby/object:Gem::Version
119
+ hash: 63
120
+ segments:
121
+ - 0
122
+ - 9
123
+ - 2
101
124
  version: 0.9.2
102
- type: :development
125
+ version_requirements: *id007
126
+ name: rake
103
127
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
128
+ type: :development
129
+ - !ruby/object:Gem::Dependency
130
+ requirement: &id008 !ruby/object:Gem::Requirement
105
131
  none: false
106
- requirements:
132
+ requirements:
107
133
  - - ~>
108
- - !ruby/object:Gem::Version
109
- version: 0.9.2
110
- - !ruby/object:Gem::Dependency
134
+ - !ruby/object:Gem::Version
135
+ hash: 21
136
+ segments:
137
+ - 2
138
+ - 11
139
+ version: "2.11"
140
+ version_requirements: *id008
111
141
  name: rspec
112
- requirement: !ruby/object:Gem::Requirement
113
- none: false
114
- requirements:
115
- - - ~>
116
- - !ruby/object:Gem::Version
117
- version: '2.11'
118
- type: :development
119
142
  prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
- requirements:
123
- - - ~>
124
- - !ruby/object:Gem::Version
125
- version: '2.11'
126
- - !ruby/object:Gem::Dependency
127
- name: rspec-fire
128
- requirement: !ruby/object:Gem::Requirement
129
- none: false
130
- requirements:
131
- - - ~>
132
- - !ruby/object:Gem::Version
133
- version: 1.1.0
134
143
  type: :development
135
- prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
144
+ - !ruby/object:Gem::Dependency
145
+ requirement: &id009 !ruby/object:Gem::Requirement
137
146
  none: false
138
- requirements:
147
+ requirements:
139
148
  - - ~>
140
- - !ruby/object:Gem::Version
149
+ - !ruby/object:Gem::Version
150
+ hash: 19
151
+ segments:
152
+ - 1
153
+ - 1
154
+ - 0
141
155
  version: 1.1.0
142
- - !ruby/object:Gem::Dependency
143
- name: yajl-ruby
144
- requirement: !ruby/object:Gem::Requirement
145
- none: false
146
- requirements:
147
- - - ~>
148
- - !ruby/object:Gem::Version
149
- version: 0.8.2
150
- type: :development
156
+ version_requirements: *id009
157
+ name: rspec-fire
151
158
  prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
159
+ type: :development
160
+ - !ruby/object:Gem::Dependency
161
+ requirement: &id010 !ruby/object:Gem::Requirement
153
162
  none: false
154
- requirements:
163
+ requirements:
155
164
  - - ~>
156
- - !ruby/object:Gem::Version
165
+ - !ruby/object:Gem::Version
166
+ hash: 59
167
+ segments:
168
+ - 0
169
+ - 8
170
+ - 2
157
171
  version: 0.8.2
158
- - !ruby/object:Gem::Dependency
159
- name: fakeweb
160
- requirement: !ruby/object:Gem::Requirement
161
- none: false
162
- requirements:
163
- - - ~>
164
- - !ruby/object:Gem::Version
165
- version: 1.3.0
166
- type: :development
172
+ version_requirements: *id010
173
+ name: yajl-ruby
167
174
  prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
175
+ type: :development
176
+ - !ruby/object:Gem::Dependency
177
+ requirement: &id011 !ruby/object:Gem::Requirement
169
178
  none: false
170
- requirements:
179
+ requirements:
171
180
  - - ~>
172
- - !ruby/object:Gem::Version
181
+ - !ruby/object:Gem::Version
182
+ hash: 27
183
+ segments:
184
+ - 1
185
+ - 3
186
+ - 0
173
187
  version: 1.3.0
174
- - !ruby/object:Gem::Dependency
175
- name: fakeweb-matcher
176
- requirement: !ruby/object:Gem::Requirement
177
- none: false
178
- requirements:
179
- - - ~>
180
- - !ruby/object:Gem::Version
181
- version: 1.2.2
182
- type: :development
188
+ version_requirements: *id011
189
+ name: fakeweb
183
190
  prerelease: false
184
- version_requirements: !ruby/object:Gem::Requirement
191
+ type: :development
192
+ - !ruby/object:Gem::Dependency
193
+ requirement: &id012 !ruby/object:Gem::Requirement
185
194
  none: false
186
- requirements:
195
+ requirements:
187
196
  - - ~>
188
- - !ruby/object:Gem::Version
197
+ - !ruby/object:Gem::Version
198
+ hash: 27
199
+ segments:
200
+ - 1
201
+ - 2
202
+ - 2
189
203
  version: 1.2.2
190
- - !ruby/object:Gem::Dependency
191
- name: delayed_job
192
- requirement: !ruby/object:Gem::Requirement
193
- none: false
194
- requirements:
195
- - - ~>
196
- - !ruby/object:Gem::Version
197
- version: 2.1.4
198
- type: :development
204
+ version_requirements: *id012
205
+ name: fakeweb-matcher
199
206
  prerelease: false
200
- version_requirements: !ruby/object:Gem::Requirement
201
- none: false
202
- requirements:
203
- - - ~>
204
- - !ruby/object:Gem::Version
205
- version: 2.1.4
207
+ type: :development
206
208
  description: Hooks Thinking Sphinx into the Flying Sphinx service
207
209
  email: pat@freelancing-gods.com
208
- executables:
210
+ executables:
209
211
  - flying-sphinx
210
212
  extensions: []
211
- extra_rdoc_files:
213
+
214
+ extra_rdoc_files:
212
215
  - README.textile
213
- files:
216
+ files:
214
217
  - .gitignore
215
218
  - .travis.yml
216
219
  - Gemfile
@@ -223,61 +226,69 @@ files:
223
226
  - keys/key
224
227
  - lib/flying-sphinx.rb
225
228
  - lib/flying_sphinx.rb
229
+ - lib/flying_sphinx/action.rb
226
230
  - lib/flying_sphinx/api.rb
231
+ - lib/flying_sphinx/binary.rb
232
+ - lib/flying_sphinx/binary/translator.rb
227
233
  - lib/flying_sphinx/cli.rb
228
234
  - lib/flying_sphinx/configuration.rb
229
- - lib/flying_sphinx/delayed_delta.rb
230
- - lib/flying_sphinx/flag_as_deleted_job.rb
231
- - lib/flying_sphinx/heroku_shared_adapter.rb
232
- - lib/flying_sphinx/index_request.rb
235
+ - lib/flying_sphinx/controller.rb
233
236
  - lib/flying_sphinx/rails.rb
234
237
  - lib/flying_sphinx/railtie.rb
235
238
  - lib/flying_sphinx/setting_files.rb
236
239
  - lib/flying_sphinx/sinatra.rb
237
- - lib/flying_sphinx/sphinx_configuration.rb
240
+ - lib/flying_sphinx/sphinxql.rb
241
+ - lib/flying_sphinx/sphinxql/translator.rb
238
242
  - lib/flying_sphinx/tasks.rb
239
243
  - lib/flying_sphinx/version.rb
240
244
  - spec/light_spec_helper.rb
241
245
  - spec/spec_helper.rb
246
+ - spec/specs/action_spec.rb
242
247
  - spec/specs/api_spec.rb
243
248
  - spec/specs/configuration_spec.rb
244
- - spec/specs/delayed_delta_spec.rb
245
- - spec/specs/flag_as_deleted_job_spec.rb
246
- - spec/specs/index_request_spec.rb
247
249
  - spec/specs/setting_files_spec.rb
248
- - spec/specs/sphinx_configuration_spec.rb
250
+ has_rdoc: true
249
251
  homepage: https://flying-sphinx.com
250
252
  licenses: []
251
- post_install_message: ! "If you're upgrading, you should rebuild your Sphinx setup
252
- when deploying:\n\n $ heroku rake fs:rebuild\n"
253
+
254
+ post_install_message: |
255
+ If you're upgrading, you should rebuild your Sphinx setup when deploying:
256
+
257
+ $ heroku rake fs:rebuild
258
+
253
259
  rdoc_options: []
254
- require_paths:
260
+
261
+ require_paths:
255
262
  - lib
256
- required_ruby_version: !ruby/object:Gem::Requirement
263
+ required_ruby_version: !ruby/object:Gem::Requirement
257
264
  none: false
258
- requirements:
259
- - - ! '>='
260
- - !ruby/object:Gem::Version
261
- version: '0'
262
- required_rubygems_version: !ruby/object:Gem::Requirement
265
+ requirements:
266
+ - - ">="
267
+ - !ruby/object:Gem::Version
268
+ hash: 3
269
+ segments:
270
+ - 0
271
+ version: "0"
272
+ required_rubygems_version: !ruby/object:Gem::Requirement
263
273
  none: false
264
- requirements:
265
- - - ! '>='
266
- - !ruby/object:Gem::Version
267
- version: '0'
274
+ requirements:
275
+ - - ">="
276
+ - !ruby/object:Gem::Version
277
+ hash: 3
278
+ segments:
279
+ - 0
280
+ version: "0"
268
281
  requirements: []
282
+
269
283
  rubyforge_project:
270
- rubygems_version: 1.8.23
284
+ rubygems_version: 1.6.2
271
285
  signing_key:
272
286
  specification_version: 3
273
287
  summary: Sphinx in the Cloud
274
- test_files:
288
+ test_files:
275
289
  - spec/light_spec_helper.rb
276
290
  - spec/spec_helper.rb
291
+ - spec/specs/action_spec.rb
277
292
  - spec/specs/api_spec.rb
278
293
  - spec/specs/configuration_spec.rb
279
- - spec/specs/delayed_delta_spec.rb
280
- - spec/specs/flag_as_deleted_job_spec.rb
281
- - spec/specs/index_request_spec.rb
282
294
  - spec/specs/setting_files_spec.rb
283
- - spec/specs/sphinx_configuration_spec.rb