chewy 0.5.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +26 -4
  3. data/CHANGELOG.md +16 -0
  4. data/Gemfile +3 -1
  5. data/README.md +2 -10
  6. data/chewy.gemspec +0 -1
  7. data/gemfiles/Gemfile.rails-3.2.active_record +6 -0
  8. data/gemfiles/Gemfile.rails-3.2.active_record.kaminari +7 -0
  9. data/gemfiles/Gemfile.rails-3.2.active_record.will_paginate +7 -0
  10. data/gemfiles/Gemfile.rails-4.0.active_record +6 -0
  11. data/gemfiles/Gemfile.rails-4.0.active_record.kaminari +7 -0
  12. data/gemfiles/Gemfile.rails-4.0.active_record.will_paginate +7 -0
  13. data/gemfiles/Gemfile.rails-4.0.mongoid +6 -0
  14. data/gemfiles/Gemfile.rails-4.0.mongoid.kaminari +7 -0
  15. data/gemfiles/Gemfile.rails-4.0.mongoid.will_paginate +7 -0
  16. data/gemfiles/Gemfile.rails-4.1.active_record +6 -0
  17. data/gemfiles/Gemfile.rails-4.1.active_record.kaminari +7 -0
  18. data/gemfiles/Gemfile.rails-4.1.active_record.will_paginate +7 -0
  19. data/gemfiles/Gemfile.rails-4.1.mongoid +6 -0
  20. data/gemfiles/Gemfile.rails-4.1.mongoid.kaminari +7 -0
  21. data/gemfiles/Gemfile.rails-4.1.mongoid.will_paginate +7 -0
  22. data/gemfiles/Gemfile.rails-4.2.active_record +6 -0
  23. data/gemfiles/Gemfile.rails-4.2.active_record.kaminari +7 -0
  24. data/gemfiles/Gemfile.rails-4.2.active_record.will_paginate +7 -0
  25. data/gemfiles/Gemfile.rails-4.2.mongoid +6 -0
  26. data/gemfiles/Gemfile.rails-4.2.mongoid.kaminari +7 -0
  27. data/gemfiles/Gemfile.rails-4.2.mongoid.will_paginate +7 -0
  28. data/lib/chewy.rb +33 -5
  29. data/lib/chewy/config.rb +1 -0
  30. data/lib/chewy/index/search.rb +6 -3
  31. data/lib/chewy/query.rb +74 -1
  32. data/lib/chewy/query/compose.rb +4 -4
  33. data/lib/chewy/query/pagination.rb +5 -4
  34. data/lib/chewy/query/pagination/kaminari.rb +1 -1
  35. data/lib/chewy/query/pagination/will_paginate.rb +27 -0
  36. data/lib/chewy/type.rb +1 -0
  37. data/lib/chewy/type/adapter/active_record.rb +2 -2
  38. data/lib/chewy/type/adapter/mongoid.rb +147 -0
  39. data/lib/chewy/type/adapter/object.rb +1 -1
  40. data/lib/chewy/type/import.rb +1 -0
  41. data/lib/chewy/type/observe.rb +34 -6
  42. data/lib/chewy/version.rb +1 -1
  43. data/spec/chewy/config_spec.rb +17 -17
  44. data/spec/chewy/fields/base_spec.rb +62 -62
  45. data/spec/chewy/fields/root_spec.rb +5 -5
  46. data/spec/chewy/index/actions_spec.rb +127 -127
  47. data/spec/chewy/index/aliases_spec.rb +9 -9
  48. data/spec/chewy/index/search_spec.rb +4 -4
  49. data/spec/chewy/index/settings_spec.rb +33 -33
  50. data/spec/chewy/index_spec.rb +49 -49
  51. data/spec/chewy/query/criteria_spec.rb +173 -161
  52. data/spec/chewy/query/filters_spec.rb +76 -76
  53. data/spec/chewy/query/loading_spec.rb +54 -23
  54. data/spec/chewy/query/nodes/and_spec.rb +4 -4
  55. data/spec/chewy/query/nodes/bool_spec.rb +8 -8
  56. data/spec/chewy/query/nodes/equal_spec.rb +19 -19
  57. data/spec/chewy/query/nodes/exists_spec.rb +6 -6
  58. data/spec/chewy/query/nodes/has_child_spec.rb +25 -25
  59. data/spec/chewy/query/nodes/has_parent_spec.rb +25 -25
  60. data/spec/chewy/query/nodes/match_all_spec.rb +1 -1
  61. data/spec/chewy/query/nodes/missing_spec.rb +4 -4
  62. data/spec/chewy/query/nodes/not_spec.rb +4 -4
  63. data/spec/chewy/query/nodes/or_spec.rb +4 -4
  64. data/spec/chewy/query/nodes/prefix_spec.rb +5 -5
  65. data/spec/chewy/query/nodes/query_spec.rb +2 -2
  66. data/spec/chewy/query/nodes/range_spec.rb +18 -18
  67. data/spec/chewy/query/nodes/raw_spec.rb +1 -1
  68. data/spec/chewy/query/nodes/regexp_spec.rb +18 -18
  69. data/spec/chewy/query/nodes/script_spec.rb +4 -4
  70. data/spec/chewy/query/pagination/kaminari_spec.rb +41 -39
  71. data/spec/chewy/query/pagination/will_paginage_spec.rb +60 -0
  72. data/spec/chewy/query/pagination_spec.rb +8 -7
  73. data/spec/chewy/query_spec.rb +166 -167
  74. data/spec/chewy/rspec/update_index_spec.rb +1 -1
  75. data/spec/chewy/runtime/version_spec.rb +30 -30
  76. data/spec/chewy/runtime_spec.rb +3 -3
  77. data/spec/chewy/type/actions_spec.rb +3 -3
  78. data/spec/chewy/type/adapter/active_record_spec.rb +143 -143
  79. data/spec/chewy/type/adapter/mongoid_spec.rb +219 -0
  80. data/spec/chewy/type/adapter/object_spec.rb +39 -39
  81. data/spec/chewy/type/import_spec.rb +67 -37
  82. data/spec/chewy/type/mapping_spec.rb +12 -12
  83. data/spec/chewy/type/observe_spec.rb +5 -6
  84. data/spec/chewy/type/wrapper_spec.rb +12 -12
  85. data/spec/chewy_spec.rb +26 -28
  86. data/spec/spec_helper.rb +19 -31
  87. data/spec/support/active_record.rb +52 -0
  88. data/spec/support/class_helpers.rb +0 -4
  89. data/spec/support/mongoid.rb +87 -0
  90. metadata +33 -18
  91. data/gemfiles/Gemfile.rails-3.2 +0 -15
  92. data/gemfiles/Gemfile.rails-4.0 +0 -15
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.5.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pyromaniac
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-30 00:00:00.000000000 Z
11
+ date: 2014-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: activerecord
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - '>='
88
- - !ruby/object:Gem::Version
89
- version: '3.2'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - '>='
95
- - !ruby/object:Gem::Version
96
- version: '3.2'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: database_cleaner
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -169,8 +155,27 @@ files:
169
155
  - Rakefile
170
156
  - chewy.gemspec
171
157
  - filters
172
- - gemfiles/Gemfile.rails-3.2
173
- - gemfiles/Gemfile.rails-4.0
158
+ - gemfiles/Gemfile.rails-3.2.active_record
159
+ - gemfiles/Gemfile.rails-3.2.active_record.kaminari
160
+ - gemfiles/Gemfile.rails-3.2.active_record.will_paginate
161
+ - gemfiles/Gemfile.rails-4.0.active_record
162
+ - gemfiles/Gemfile.rails-4.0.active_record.kaminari
163
+ - gemfiles/Gemfile.rails-4.0.active_record.will_paginate
164
+ - gemfiles/Gemfile.rails-4.0.mongoid
165
+ - gemfiles/Gemfile.rails-4.0.mongoid.kaminari
166
+ - gemfiles/Gemfile.rails-4.0.mongoid.will_paginate
167
+ - gemfiles/Gemfile.rails-4.1.active_record
168
+ - gemfiles/Gemfile.rails-4.1.active_record.kaminari
169
+ - gemfiles/Gemfile.rails-4.1.active_record.will_paginate
170
+ - gemfiles/Gemfile.rails-4.1.mongoid
171
+ - gemfiles/Gemfile.rails-4.1.mongoid.kaminari
172
+ - gemfiles/Gemfile.rails-4.1.mongoid.will_paginate
173
+ - gemfiles/Gemfile.rails-4.2.active_record
174
+ - gemfiles/Gemfile.rails-4.2.active_record.kaminari
175
+ - gemfiles/Gemfile.rails-4.2.active_record.will_paginate
176
+ - gemfiles/Gemfile.rails-4.2.mongoid
177
+ - gemfiles/Gemfile.rails-4.2.mongoid.kaminari
178
+ - gemfiles/Gemfile.rails-4.2.mongoid.will_paginate
174
179
  - lib/chewy.rb
175
180
  - lib/chewy/backports/deep_dup.rb
176
181
  - lib/chewy/backports/duplicable.rb
@@ -210,6 +215,7 @@ files:
210
215
  - lib/chewy/query/nodes/script.rb
211
216
  - lib/chewy/query/pagination.rb
212
217
  - lib/chewy/query/pagination/kaminari.rb
218
+ - lib/chewy/query/pagination/will_paginate.rb
213
219
  - lib/chewy/railtie.rb
214
220
  - lib/chewy/rspec.rb
215
221
  - lib/chewy/rspec/update_index.rb
@@ -219,6 +225,7 @@ files:
219
225
  - lib/chewy/type/actions.rb
220
226
  - lib/chewy/type/adapter/active_record.rb
221
227
  - lib/chewy/type/adapter/base.rb
228
+ - lib/chewy/type/adapter/mongoid.rb
222
229
  - lib/chewy/type/adapter/object.rb
223
230
  - lib/chewy/type/import.rb
224
231
  - lib/chewy/type/mapping.rb
@@ -256,6 +263,7 @@ files:
256
263
  - spec/chewy/query/nodes/regexp_spec.rb
257
264
  - spec/chewy/query/nodes/script_spec.rb
258
265
  - spec/chewy/query/pagination/kaminari_spec.rb
266
+ - spec/chewy/query/pagination/will_paginage_spec.rb
259
267
  - spec/chewy/query/pagination_spec.rb
260
268
  - spec/chewy/query_spec.rb
261
269
  - spec/chewy/rspec/update_index_spec.rb
@@ -263,6 +271,7 @@ files:
263
271
  - spec/chewy/runtime_spec.rb
264
272
  - spec/chewy/type/actions_spec.rb
265
273
  - spec/chewy/type/adapter/active_record_spec.rb
274
+ - spec/chewy/type/adapter/mongoid_spec.rb
266
275
  - spec/chewy/type/adapter/object_spec.rb
267
276
  - spec/chewy/type/import_spec.rb
268
277
  - spec/chewy/type/mapping_spec.rb
@@ -271,8 +280,10 @@ files:
271
280
  - spec/chewy/type_spec.rb
272
281
  - spec/chewy_spec.rb
273
282
  - spec/spec_helper.rb
283
+ - spec/support/active_record.rb
274
284
  - spec/support/class_helpers.rb
275
285
  - spec/support/fail_helpers.rb
286
+ - spec/support/mongoid.rb
276
287
  homepage: ''
277
288
  licenses:
278
289
  - MIT
@@ -326,6 +337,7 @@ test_files:
326
337
  - spec/chewy/query/nodes/regexp_spec.rb
327
338
  - spec/chewy/query/nodes/script_spec.rb
328
339
  - spec/chewy/query/pagination/kaminari_spec.rb
340
+ - spec/chewy/query/pagination/will_paginage_spec.rb
329
341
  - spec/chewy/query/pagination_spec.rb
330
342
  - spec/chewy/query_spec.rb
331
343
  - spec/chewy/rspec/update_index_spec.rb
@@ -333,6 +345,7 @@ test_files:
333
345
  - spec/chewy/runtime_spec.rb
334
346
  - spec/chewy/type/actions_spec.rb
335
347
  - spec/chewy/type/adapter/active_record_spec.rb
348
+ - spec/chewy/type/adapter/mongoid_spec.rb
336
349
  - spec/chewy/type/adapter/object_spec.rb
337
350
  - spec/chewy/type/import_spec.rb
338
351
  - spec/chewy/type/mapping_spec.rb
@@ -341,5 +354,7 @@ test_files:
341
354
  - spec/chewy/type_spec.rb
342
355
  - spec/chewy_spec.rb
343
356
  - spec/spec_helper.rb
357
+ - spec/support/active_record.rb
344
358
  - spec/support/class_helpers.rb
345
359
  - spec/support/fail_helpers.rb
360
+ - spec/support/mongoid.rb
@@ -1,15 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec path: '../'
4
-
5
- gem 'activerecord', '~> 3.2.0'
6
- gem 'activesupport', '~> 3.2.0'
7
- gem 'kaminari', require: false
8
-
9
- group :test do
10
- gem 'guard'
11
- gem 'guard-rspec'
12
- gem 'rb-inotify', require: false
13
- gem 'rb-fsevent', require: false
14
- gem 'rb-fchange', require: false
15
- end
@@ -1,15 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec path: '../'
4
-
5
- gem 'activerecord', '~> 4.0.0'
6
- gem 'activesupport', '~> 4.0.0'
7
- gem 'kaminari', require: false
8
-
9
- group :test do
10
- gem 'guard'
11
- gem 'guard-rspec'
12
- gem 'rb-inotify', require: false
13
- gem 'rb-fsevent', require: false
14
- gem 'rb-fchange', require: false
15
- end