chewy 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +43 -11
- data/Appraisals +39 -12
- data/CHANGELOG.md +42 -0
- data/Gemfile +1 -1
- data/README.md +60 -7
- data/chewy.gemspec +12 -5
- data/gemfiles/{rails.4.0.mongoid.gemfile → rails.4.0.mongoid.4.0.0.gemfile} +1 -1
- data/gemfiles/{rails.4.0.mongoid.kaminari.gemfile → rails.4.0.mongoid.4.0.0.kaminari.gemfile} +1 -1
- data/gemfiles/{rails.4.0.mongoid.will_paginate.gemfile → rails.4.0.mongoid.4.0.0.will_paginate.gemfile} +1 -1
- data/gemfiles/rails.4.0.mongoid.5.1.0.gemfile +15 -0
- data/gemfiles/rails.4.0.mongoid.5.1.0.kaminari.gemfile +14 -0
- data/gemfiles/rails.4.0.mongoid.5.1.0.will_paginate.gemfile +14 -0
- data/gemfiles/{rails.4.1.mongoid.gemfile → rails.4.1.mongoid.4.0.0.gemfile} +1 -1
- data/gemfiles/{rails.4.1.mongoid.kaminari.gemfile → rails.4.1.mongoid.4.0.0.kaminari.gemfile} +1 -1
- data/gemfiles/{rails.4.1.mongoid.will_paginate.gemfile → rails.4.1.mongoid.4.0.0.will_paginate.gemfile} +1 -1
- data/gemfiles/rails.4.1.mongoid.5.1.0.gemfile +15 -0
- data/gemfiles/rails.4.1.mongoid.5.1.0.kaminari.gemfile +14 -0
- data/gemfiles/rails.4.1.mongoid.5.1.0.will_paginate.gemfile +14 -0
- data/gemfiles/{rails.4.2.mongoid.gemfile → rails.4.2.mongoid.4.0.0.gemfile} +1 -1
- data/gemfiles/{rails.4.2.mongoid.kaminari.gemfile → rails.4.2.mongoid.4.0.0.kaminari.gemfile} +1 -1
- data/gemfiles/{rails.4.2.mongoid.will_paginate.gemfile → rails.4.2.mongoid.4.0.0.will_paginate.gemfile} +1 -1
- data/gemfiles/rails.4.2.mongoid.5.1.0.gemfile +15 -0
- data/gemfiles/rails.4.2.mongoid.5.1.0.kaminari.gemfile +14 -0
- data/gemfiles/rails.4.2.mongoid.5.1.0.will_paginate.gemfile +14 -0
- data/gemfiles/rails.5.0.0.beta3.activerecord.gemfile +16 -0
- data/gemfiles/rails.5.0.0.beta3.activerecord.kaminari.gemfile +16 -0
- data/gemfiles/rails.5.0.0.beta3.activerecord.will_paginate.gemfile +15 -0
- data/gemfiles/{sequel.4.28.gemfile → sequel.4.31.gemfile} +1 -1
- data/lib/chewy.rb +7 -1
- data/lib/chewy/errors.rb +6 -0
- data/lib/chewy/fields/base.rb +12 -8
- data/lib/chewy/fields/root.rb +1 -1
- data/lib/chewy/index.rb +17 -8
- data/lib/chewy/index/actions.rb +4 -4
- data/lib/chewy/query.rb +8 -13
- data/lib/chewy/query/compose.rb +2 -2
- data/lib/chewy/query/criteria.rb +2 -2
- data/lib/chewy/query/loading.rb +1 -1
- data/lib/chewy/query/nodes/bool.rb +1 -1
- data/lib/chewy/query/nodes/regexp.rb +2 -2
- data/lib/chewy/railtie.rb +15 -3
- data/lib/chewy/rake_helper.rb +5 -2
- data/lib/chewy/rspec/update_index.rb +17 -6
- data/lib/chewy/strategy.rb +7 -3
- data/lib/chewy/strategy/active_job.rb +2 -2
- data/lib/chewy/strategy/resque.rb +2 -2
- data/lib/chewy/strategy/sidekiq.rb +2 -2
- data/lib/chewy/type.rb +14 -0
- data/lib/chewy/type/adapter/active_record.rb +11 -1
- data/lib/chewy/type/adapter/orm.rb +13 -11
- data/lib/chewy/type/adapter/sequel.rb +10 -12
- data/lib/chewy/type/import.rb +53 -22
- data/lib/chewy/type/witchcraft.rb +208 -0
- data/lib/chewy/type/wrapper.rb +25 -7
- data/lib/chewy/version.rb +1 -1
- data/lib/tasks/chewy.rake +22 -14
- data/spec/chewy/fields/base_spec.rb +6 -2
- data/spec/chewy/fields/time_fields_spec.rb +4 -4
- data/spec/chewy/index/actions_spec.rb +32 -18
- data/spec/chewy/index_spec.rb +19 -0
- data/spec/chewy/query/pagination_spec.rb +1 -1
- data/spec/chewy/query_spec.rb +77 -21
- data/spec/chewy/rspec/update_index_spec.rb +75 -62
- data/spec/chewy/runtime_spec.rb +1 -1
- data/spec/chewy/strategy/active_job_spec.rb +6 -1
- data/spec/chewy/strategy/atomic_spec.rb +5 -5
- data/spec/chewy/strategy/resque_spec.rb +7 -2
- data/spec/chewy/strategy/sidekiq_spec.rb +6 -1
- data/spec/chewy/strategy_spec.rb +13 -1
- data/spec/chewy/type/actions_spec.rb +4 -1
- data/spec/chewy/type/import_spec.rb +71 -2
- data/spec/chewy/type/observe_spec.rb +9 -9
- data/spec/chewy/type/witchcraft_spec.rb +154 -0
- data/spec/chewy/type/wrapper_spec.rb +30 -5
- data/spec/chewy/type_spec.rb +10 -0
- data/spec/chewy_spec.rb +29 -5
- data/spec/spec_helper.rb +2 -0
- data/spec/support/class_helpers.rb +15 -0
- data/spec/support/mongoid.rb +5 -0
- metadata +64 -21
data/spec/spec_helper.rb
CHANGED
@@ -13,4 +13,19 @@ module ClassHelpers
|
|
13
13
|
def stub_model name, superclass = nil, &block
|
14
14
|
raise NotImplementedError, 'Seems like no ORM/ODM are loaded, please check your Gemfile'
|
15
15
|
end
|
16
|
+
|
17
|
+
def skip_on_version_gte version, message = "Removed from elasticsearch #{version}"
|
18
|
+
skip message if Chewy::Runtime.version >= version
|
19
|
+
end
|
20
|
+
|
21
|
+
def skip_on_version_lt version, message = "Only for elasticsearch #{version} and greater"
|
22
|
+
skip message if Chewy::Runtime.version < version
|
23
|
+
end
|
24
|
+
|
25
|
+
def skip_on_plugin_missing_from_version plugin, version, message = "Plugin '#{plugin}' is missing on elasticsearch > #{version}"
|
26
|
+
if Chewy::Runtime.version >= version
|
27
|
+
plugins = Chewy.client.nodes.info(plugins: true)["nodes"].values.map { |item| item["plugins"] }.flatten
|
28
|
+
skip message unless plugins.find { |item| item["name"] == plugin }
|
29
|
+
end
|
30
|
+
end
|
16
31
|
end
|
data/spec/support/mongoid.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chewy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pyromaniac
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 3.4.0
|
48
48
|
type: :development
|
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:
|
54
|
+
version: 3.4.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec-its
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,16 +98,16 @@ dependencies:
|
|
98
98
|
name: database_cleaner
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: elasticsearch-extensions
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,6 +136,34 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: method_source
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: unparser
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
139
167
|
- !ruby/object:Gem::Dependency
|
140
168
|
name: activesupport
|
141
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -190,22 +218,34 @@ files:
|
|
190
218
|
- gemfiles/rails.4.0.activerecord.gemfile
|
191
219
|
- gemfiles/rails.4.0.activerecord.kaminari.gemfile
|
192
220
|
- gemfiles/rails.4.0.activerecord.will_paginate.gemfile
|
193
|
-
- gemfiles/rails.4.0.mongoid.gemfile
|
194
|
-
- gemfiles/rails.4.0.mongoid.kaminari.gemfile
|
195
|
-
- gemfiles/rails.4.0.mongoid.will_paginate.gemfile
|
221
|
+
- gemfiles/rails.4.0.mongoid.4.0.0.gemfile
|
222
|
+
- gemfiles/rails.4.0.mongoid.4.0.0.kaminari.gemfile
|
223
|
+
- gemfiles/rails.4.0.mongoid.4.0.0.will_paginate.gemfile
|
224
|
+
- gemfiles/rails.4.0.mongoid.5.1.0.gemfile
|
225
|
+
- gemfiles/rails.4.0.mongoid.5.1.0.kaminari.gemfile
|
226
|
+
- gemfiles/rails.4.0.mongoid.5.1.0.will_paginate.gemfile
|
196
227
|
- gemfiles/rails.4.1.activerecord.gemfile
|
197
228
|
- gemfiles/rails.4.1.activerecord.kaminari.gemfile
|
198
229
|
- gemfiles/rails.4.1.activerecord.will_paginate.gemfile
|
199
|
-
- gemfiles/rails.4.1.mongoid.gemfile
|
200
|
-
- gemfiles/rails.4.1.mongoid.kaminari.gemfile
|
201
|
-
- gemfiles/rails.4.1.mongoid.will_paginate.gemfile
|
230
|
+
- gemfiles/rails.4.1.mongoid.4.0.0.gemfile
|
231
|
+
- gemfiles/rails.4.1.mongoid.4.0.0.kaminari.gemfile
|
232
|
+
- gemfiles/rails.4.1.mongoid.4.0.0.will_paginate.gemfile
|
233
|
+
- gemfiles/rails.4.1.mongoid.5.1.0.gemfile
|
234
|
+
- gemfiles/rails.4.1.mongoid.5.1.0.kaminari.gemfile
|
235
|
+
- gemfiles/rails.4.1.mongoid.5.1.0.will_paginate.gemfile
|
202
236
|
- gemfiles/rails.4.2.activerecord.gemfile
|
203
237
|
- gemfiles/rails.4.2.activerecord.kaminari.gemfile
|
204
238
|
- gemfiles/rails.4.2.activerecord.will_paginate.gemfile
|
205
|
-
- gemfiles/rails.4.2.mongoid.gemfile
|
206
|
-
- gemfiles/rails.4.2.mongoid.kaminari.gemfile
|
207
|
-
- gemfiles/rails.4.2.mongoid.will_paginate.gemfile
|
208
|
-
- gemfiles/
|
239
|
+
- gemfiles/rails.4.2.mongoid.4.0.0.gemfile
|
240
|
+
- gemfiles/rails.4.2.mongoid.4.0.0.kaminari.gemfile
|
241
|
+
- gemfiles/rails.4.2.mongoid.4.0.0.will_paginate.gemfile
|
242
|
+
- gemfiles/rails.4.2.mongoid.5.1.0.gemfile
|
243
|
+
- gemfiles/rails.4.2.mongoid.5.1.0.kaminari.gemfile
|
244
|
+
- gemfiles/rails.4.2.mongoid.5.1.0.will_paginate.gemfile
|
245
|
+
- gemfiles/rails.5.0.0.beta3.activerecord.gemfile
|
246
|
+
- gemfiles/rails.5.0.0.beta3.activerecord.kaminari.gemfile
|
247
|
+
- gemfiles/rails.5.0.0.beta3.activerecord.will_paginate.gemfile
|
248
|
+
- gemfiles/sequel.4.31.gemfile
|
209
249
|
- lib/chewy.rb
|
210
250
|
- lib/chewy/backports/deep_dup.rb
|
211
251
|
- lib/chewy/backports/duplicable.rb
|
@@ -275,6 +315,7 @@ files:
|
|
275
315
|
- lib/chewy/type/import.rb
|
276
316
|
- lib/chewy/type/mapping.rb
|
277
317
|
- lib/chewy/type/observe.rb
|
318
|
+
- lib/chewy/type/witchcraft.rb
|
278
319
|
- lib/chewy/type/wrapper.rb
|
279
320
|
- lib/chewy/version.rb
|
280
321
|
- lib/generators/chewy/install_generator.rb
|
@@ -330,6 +371,7 @@ files:
|
|
330
371
|
- spec/chewy/type/import_spec.rb
|
331
372
|
- spec/chewy/type/mapping_spec.rb
|
332
373
|
- spec/chewy/type/observe_spec.rb
|
374
|
+
- spec/chewy/type/witchcraft_spec.rb
|
333
375
|
- spec/chewy/type/wrapper_spec.rb
|
334
376
|
- spec/chewy/type_spec.rb
|
335
377
|
- spec/chewy_spec.rb
|
@@ -359,7 +401,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
359
401
|
version: '0'
|
360
402
|
requirements: []
|
361
403
|
rubyforge_project:
|
362
|
-
rubygems_version: 2.4.
|
404
|
+
rubygems_version: 2.4.8
|
363
405
|
signing_key:
|
364
406
|
specification_version: 4
|
365
407
|
summary: Elasticsearch ODM client wrapper
|
@@ -413,6 +455,7 @@ test_files:
|
|
413
455
|
- spec/chewy/type/import_spec.rb
|
414
456
|
- spec/chewy/type/mapping_spec.rb
|
415
457
|
- spec/chewy/type/observe_spec.rb
|
458
|
+
- spec/chewy/type/witchcraft_spec.rb
|
416
459
|
- spec/chewy/type/wrapper_spec.rb
|
417
460
|
- spec/chewy/type_spec.rb
|
418
461
|
- spec/chewy_spec.rb
|