chewy 0.6.2 → 0.7.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.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/.travis.yml +35 -29
  4. data/Appraisals +37 -0
  5. data/CHANGELOG.md +115 -4
  6. data/Gemfile +2 -3
  7. data/README.md +135 -40
  8. data/chewy.gemspec +4 -3
  9. data/gemfiles/rails.3.2.activerecord.gemfile +13 -0
  10. data/gemfiles/rails.3.2.activerecord.kaminari.gemfile +14 -0
  11. data/gemfiles/rails.3.2.activerecord.will_paginate.gemfile +14 -0
  12. data/gemfiles/rails.4.0.activerecord.gemfile +13 -0
  13. data/gemfiles/rails.4.0.activerecord.kaminari.gemfile +14 -0
  14. data/gemfiles/rails.4.0.activerecord.will_paginate.gemfile +14 -0
  15. data/gemfiles/rails.4.0.mongoid.gemfile +13 -0
  16. data/gemfiles/rails.4.0.mongoid.kaminari.gemfile +14 -0
  17. data/gemfiles/rails.4.0.mongoid.will_paginate.gemfile +14 -0
  18. data/gemfiles/rails.4.1.activerecord.gemfile +13 -0
  19. data/gemfiles/rails.4.1.activerecord.kaminari.gemfile +14 -0
  20. data/gemfiles/rails.4.1.activerecord.will_paginate.gemfile +14 -0
  21. data/gemfiles/rails.4.1.mongoid.gemfile +13 -0
  22. data/gemfiles/rails.4.1.mongoid.kaminari.gemfile +14 -0
  23. data/gemfiles/rails.4.1.mongoid.will_paginate.gemfile +14 -0
  24. data/gemfiles/rails.4.2.activerecord.gemfile +13 -0
  25. data/gemfiles/rails.4.2.activerecord.kaminari.gemfile +14 -0
  26. data/gemfiles/rails.4.2.activerecord.will_paginate.gemfile +14 -0
  27. data/gemfiles/rails.4.2.mongoid.gemfile +13 -0
  28. data/gemfiles/rails.4.2.mongoid.kaminari.gemfile +14 -0
  29. data/gemfiles/rails.4.2.mongoid.will_paginate.gemfile +14 -0
  30. data/lib/chewy.rb +65 -0
  31. data/lib/chewy/config.rb +44 -93
  32. data/lib/chewy/errors.rb +14 -5
  33. data/lib/chewy/fields/base.rb +8 -7
  34. data/lib/chewy/fields/root.rb +2 -2
  35. data/lib/chewy/index.rb +7 -9
  36. data/lib/chewy/log_subscriber.rb +34 -0
  37. data/lib/chewy/query.rb +41 -27
  38. data/lib/chewy/query/criteria.rb +28 -23
  39. data/lib/chewy/query/scoping.rb +20 -0
  40. data/lib/chewy/railtie.rb +51 -13
  41. data/lib/chewy/repository.rb +61 -0
  42. data/lib/chewy/rspec/update_index.rb +3 -6
  43. data/lib/chewy/search.rb +28 -7
  44. data/lib/chewy/strategy.rb +60 -0
  45. data/lib/chewy/strategy/atomic.rb +31 -0
  46. data/lib/chewy/strategy/base.rb +27 -0
  47. data/lib/chewy/strategy/bypass.rb +15 -0
  48. data/lib/chewy/strategy/urgent.rb +17 -0
  49. data/lib/chewy/type.rb +19 -5
  50. data/lib/chewy/type/adapter/active_record.rb +28 -117
  51. data/lib/chewy/type/adapter/base.rb +35 -0
  52. data/lib/chewy/type/adapter/mongoid.rb +23 -123
  53. data/lib/chewy/type/adapter/object.rb +41 -19
  54. data/lib/chewy/type/adapter/orm.rb +142 -0
  55. data/lib/chewy/type/import.rb +43 -16
  56. data/lib/chewy/type/observe.rb +8 -21
  57. data/lib/chewy/version.rb +1 -1
  58. data/lib/tasks/chewy.rake +8 -4
  59. data/spec/chewy/config_spec.rb +20 -97
  60. data/spec/chewy/fields/base_spec.rb +24 -11
  61. data/spec/chewy/fields/time_fields_spec.rb +27 -0
  62. data/spec/chewy/index/settings_spec.rb +2 -1
  63. data/spec/chewy/index_spec.rb +98 -79
  64. data/spec/chewy/query/criteria_spec.rb +14 -0
  65. data/spec/chewy/query_spec.rb +1 -1
  66. data/spec/chewy/repository_spec.rb +50 -0
  67. data/spec/chewy/search_spec.rb +100 -0
  68. data/spec/chewy/strategy_spec.rb +109 -0
  69. data/spec/chewy/type/adapter/active_record_spec.rb +110 -46
  70. data/spec/chewy/type/adapter/mongoid_spec.rb +123 -74
  71. data/spec/chewy/type/adapter/object_spec.rb +51 -34
  72. data/spec/chewy/type/import_spec.rb +21 -21
  73. data/spec/chewy/type/observe_spec.rb +26 -29
  74. data/spec/chewy/type_spec.rb +19 -0
  75. data/spec/chewy_spec.rb +19 -3
  76. data/spec/spec_helper.rb +1 -1
  77. data/spec/support/active_record.rb +2 -1
  78. data/spec/support/mongoid.rb +29 -38
  79. metadata +85 -55
  80. data/gemfiles/Gemfile.rails-3.2.active_record +0 -6
  81. data/gemfiles/Gemfile.rails-3.2.active_record.kaminari +0 -7
  82. data/gemfiles/Gemfile.rails-3.2.active_record.will_paginate +0 -7
  83. data/gemfiles/Gemfile.rails-4.0.active_record +0 -6
  84. data/gemfiles/Gemfile.rails-4.0.active_record.kaminari +0 -7
  85. data/gemfiles/Gemfile.rails-4.0.active_record.will_paginate +0 -7
  86. data/gemfiles/Gemfile.rails-4.0.mongoid +0 -6
  87. data/gemfiles/Gemfile.rails-4.0.mongoid.kaminari +0 -7
  88. data/gemfiles/Gemfile.rails-4.0.mongoid.will_paginate +0 -7
  89. data/gemfiles/Gemfile.rails-4.1.active_record +0 -6
  90. data/gemfiles/Gemfile.rails-4.1.active_record.kaminari +0 -7
  91. data/gemfiles/Gemfile.rails-4.1.active_record.will_paginate +0 -7
  92. data/gemfiles/Gemfile.rails-4.1.mongoid +0 -6
  93. data/gemfiles/Gemfile.rails-4.1.mongoid.kaminari +0 -7
  94. data/gemfiles/Gemfile.rails-4.1.mongoid.will_paginate +0 -7
  95. data/gemfiles/Gemfile.rails-4.2.active_record +0 -6
  96. data/gemfiles/Gemfile.rails-4.2.active_record.kaminari +0 -7
  97. data/gemfiles/Gemfile.rails-4.2.active_record.will_paginate +0 -7
  98. data/gemfiles/Gemfile.rails-4.2.mongoid +0 -6
  99. data/gemfiles/Gemfile.rails-4.2.mongoid.kaminari +0 -7
  100. data/gemfiles/Gemfile.rails-4.2.mongoid.will_paginate +0 -7
  101. data/spec/chewy/index/search_spec.rb +0 -46
@@ -11,7 +11,7 @@ describe Chewy::Type::Import do
11
11
  let(:backreferenced) { 3.times.map { |i| double(id: i) } }
12
12
 
13
13
  specify { expect { DummiesIndex.dummy.update_index(backreferenced) }
14
- .not_to update_index('dummies#dummy', atomic: false) }
14
+ .to raise_error Chewy::UndefinedUpdateStrategy }
15
15
  specify { expect { DummiesIndex.dummy.update_index([]) }
16
16
  .not_to update_index('dummies#dummy') }
17
17
  specify { expect { DummiesIndex.dummy.update_index(nil) }
@@ -21,17 +21,18 @@ describe Chewy::Type::Import do
21
21
  context 'integration', :orm do
22
22
  before do
23
23
  stub_model(:city) do
24
- belongs_to :country
25
24
  update_index('cities#city') { self }
26
25
  update_index 'countries#country', :country
27
26
  end
28
27
 
29
28
  stub_model(:country) do
30
- has_many :cities
31
29
  update_index('cities#city') { cities }
32
30
  update_index 'countries#country', :self
33
31
  end
34
32
 
33
+ City.belongs_to :country
34
+ Country.has_many :cities
35
+
35
36
  stub_index(:cities) do
36
37
  define_type City
37
38
  end
@@ -41,45 +42,41 @@ describe Chewy::Type::Import do
41
42
  end
42
43
  end
43
44
 
44
- let(:city) { City.create!(id: 1, country: Country.create!(id: 1)) }
45
- let(:country) { Country.create!(id: 1, cities: 2.times.map { |i| City.create!(id: i) }) }
45
+ let(:city) { Chewy.strategy(:atomic) { City.create!(id: 1, country: Country.create!(id: 1)) } }
46
+ let(:country) { Chewy.strategy(:atomic) { Country.create!(id: 1, cities: 2.times.map { |i| City.create!(id: i) }) } }
46
47
 
47
- specify { expect { city.save! }.not_to update_index('cities#city', atomic: false) }
48
+ specify { expect { city.save! }.to update_index('cities#city').and_reindex(city) }
49
+ specify { expect { city.save! }.to update_index('countries#country').and_reindex(city.country) }
50
+ specify { expect { country.save! }.to update_index('cities#city').and_reindex(country.cities) }
48
51
  specify { expect { country.save! }.to update_index('countries#country').and_reindex(country) }
49
52
 
50
- context do
51
- specify { expect { city.save! }.to update_index('cities#city').and_reindex(city) }
52
- specify { expect { city.save! }.to update_index('countries#country').and_reindex(city.country) }
53
- specify { expect { country.save! }.to update_index('cities#city').and_reindex(country.cities) }
54
- specify { expect { country.save! }.to update_index('countries#country').and_reindex(country) }
55
- end
53
+ end
56
54
 
55
+ context 'transactions', :active_record do
57
56
  context do
58
- let(:other_city) { City.create! }
59
-
60
- specify do
61
- expect(CitiesIndex::City).not_to receive(:import)
62
- [city, other_city].map(&:save!)
63
- end
57
+ before { stub_model(:city) { update_index 'cities#city', :self } }
58
+ before { stub_index(:cities) { define_type City } }
64
59
 
65
60
  specify do
66
- expect(CitiesIndex::City).to receive(:import).with([city.id, other_city.id]).once
67
- Chewy.atomic { [city, other_city].map(&:save!) }
61
+ Chewy.strategy(:urgent) do
62
+ ActiveRecord::Base.transaction do
63
+ expect { City.create! }.not_to update_index('cities#city')
64
+ end
65
+ end
68
66
  end
69
67
  end
70
68
 
71
69
  context do
72
- before { allow(Chewy).to receive_messages(urgent_update: true) }
73
- let(:other_country) { Country.create! }
74
-
75
- specify do
76
- expect(CountriesIndex::Country).to receive(:import).at_least(2).times
77
- [country, other_country].map(&:save!)
78
- end
70
+ before { allow(Chewy).to receive_messages(use_after_commit_callbacks: false) }
71
+ before { stub_model(:city) { update_index 'cities#city', :self } }
72
+ before { stub_index(:cities) { define_type City } }
79
73
 
80
74
  specify do
81
- expect(CountriesIndex::Country).to receive(:import).with([country.id, other_country.id]).once
82
- Chewy.atomic { [country, other_country].map(&:save!) }
75
+ Chewy.strategy(:urgent) do
76
+ ActiveRecord::Base.transaction do
77
+ expect { City.create! }.to update_index('cities#city')
78
+ end
79
+ end
83
80
  end
84
81
  end
85
82
  end
@@ -1,4 +1,23 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chewy::Type do
4
+ describe '.scopes' do
5
+ before do
6
+ stub_index(:places) do
7
+ def self.by_id
8
+ end
9
+
10
+ define_type :city do
11
+ def self.by_rating
12
+ end
13
+
14
+ def self.by_name
15
+ end
16
+ end
17
+ end
18
+ end
19
+
20
+ specify { expect(described_class.scopes).to eq([]) }
21
+ specify { expect(PlacesIndex::City.scopes).to match_array([:by_rating, :by_name]) }
22
+ end
4
23
  end
@@ -57,7 +57,8 @@ describe Chewy do
57
57
  end
58
58
 
59
59
  context 'model scope', :orm do
60
- before { stub_model(:city) }
60
+ before { stub_model(:country) }
61
+ before { stub_model(:city) { belongs_to :country } }
61
62
  subject { described_class.create_type(CitiesIndex, City.includes(:country)) }
62
63
 
63
64
  it { is_expected.to be_a Class }
@@ -97,9 +98,9 @@ describe Chewy do
97
98
  before { Chewy.massacre }
98
99
 
99
100
  before do
100
- allow(Chewy).to receive_messages(configuration: Chewy.configuration.merge(prefix: 'prefix1'))
101
+ allow(Chewy).to receive_messages(configuration: { prefix: 'prefix1' })
101
102
  stub_index(:admins).create!
102
- allow(Chewy).to receive_messages(configuration: Chewy.configuration.merge(prefix: 'prefix2'))
103
+ allow(Chewy).to receive_messages(configuration: { prefix: 'prefix2' })
103
104
  stub_index(:developers).create!
104
105
  stub_index(:companies).create!
105
106
 
@@ -110,4 +111,19 @@ describe Chewy do
110
111
  specify { expect(DevelopersIndex.exists?).to eq(false) }
111
112
  specify { expect(CompaniesIndex.exists?).to eq(false) }
112
113
  end
114
+
115
+ describe '#urgent_update=' do
116
+ specify do
117
+ described_class.urgent_update = true
118
+ expect(described_class.strategy.current).to be_a(Chewy::Strategy::Urgent)
119
+ described_class.urgent_update = false
120
+ expect(described_class.strategy.current).to be_a(Chewy::Strategy::Base)
121
+ end
122
+ end
123
+
124
+ describe '#atomic' do
125
+ specify do
126
+ described_class.atomic { expect(described_class.strategy.current).to be_a(Chewy::Strategy::Atomic) }
127
+ end
128
+ end
113
129
  end
@@ -17,7 +17,7 @@ require 'support/class_helpers'
17
17
 
18
18
  require 'chewy/rspec'
19
19
 
20
- Chewy.configuration = {
20
+ Chewy.settings = {
21
21
  host: 'localhost:9250',
22
22
  wait_for_status: 'green',
23
23
  index: {
@@ -2,6 +2,7 @@ require 'database_cleaner'
2
2
 
3
3
  ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
4
4
  ActiveRecord::Base.logger = Logger.new('/dev/null')
5
+ ActiveRecord::Base.raise_in_transactional_callbacks = true if ActiveRecord::Base.respond_to?(:raise_in_transactional_callbacks)
5
6
 
6
7
  ActiveRecord::Schema.define do
7
8
  create_table :countries do |t|
@@ -40,7 +41,7 @@ RSpec.configure do |config|
40
41
 
41
42
  config.before(:suite) do
42
43
  DatabaseCleaner.clean_with :truncation
43
- DatabaseCleaner.strategy = :transaction
44
+ DatabaseCleaner.strategy = :truncation
44
45
  end
45
46
 
46
47
  config.before do
@@ -17,24 +17,37 @@ Mongoid.logger = Logger.new('/dev/null')
17
17
  module MongoidClassHelpers
18
18
  extend ActiveSupport::Concern
19
19
 
20
+ module Country
21
+ extend ActiveSupport::Concern
22
+
23
+ included do
24
+ include Mongoid::Document
25
+
26
+ field :name, type: String
27
+ field :country_code, type: String
28
+ field :rating, type: Integer
29
+ end
30
+ end
31
+
32
+ module City
33
+ extend ActiveSupport::Concern
34
+
35
+ included do
36
+ include Mongoid::Document
37
+
38
+ field :name, type: String
39
+ field :rating, type: Integer
40
+ end
41
+ end
42
+
20
43
  def stub_model name, superclass = nil, &block
21
- model = name.to_s.camelize.constantize rescue nil
22
-
23
- if model
24
- model.class_eval(&block) if block
25
- model
26
- else
27
- klass = if superclass && superclass.ancestors.include?(Mongoid::Document)
28
- superclass
29
- else
30
- Class.new(*([superclass].compact)) do
31
- include Mongoid::Document
32
- store_in collection: name.to_s.tableize
33
- end
34
- end
35
-
36
- stub_class(name, klass, &block)
44
+ mixin = "MongoidClassHelpers::#{name.to_s.camelize}".safe_constantize || Mongoid::Document
45
+ superclass ||= Class.new do
46
+ include mixin
47
+ store_in collection: name.to_s.tableize
37
48
  end
49
+
50
+ stub_class(name, superclass, &block)
38
51
  end
39
52
 
40
53
  def active_record?
@@ -57,28 +70,6 @@ RSpec.configure do |config|
57
70
  end
58
71
 
59
72
  config.before do
60
- Object.send(:remove_const, :City) if defined? City
61
- Object.send(:remove_const, :Country) if defined? Country
62
-
63
- class Country
64
- include Mongoid::Document
65
-
66
- field :name, type: String
67
- field :country_code, type: String
68
- field :rating, type: Integer
69
-
70
- has_many :cities, order: :id.asc
71
- end
72
-
73
- class City
74
- include Mongoid::Document
75
-
76
- field :name, type: String
77
- field :rating, type: Integer
78
-
79
- belongs_to :country
80
- end
81
-
82
73
  DatabaseCleaner.start
83
74
  end
84
75
 
metadata CHANGED
@@ -1,139 +1,153 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chewy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.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-12-03 00:00:00.000000000 Z
11
+ date: 2015-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: appraisal
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
25
39
  - !ruby/object:Gem::Version
26
40
  version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rspec
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - ~>
45
+ - - ">="
32
46
  - !ruby/object:Gem::Version
33
- version: 3.0.0
47
+ version: '0'
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - ~>
52
+ - - ">="
39
53
  - !ruby/object:Gem::Version
40
- version: 3.0.0
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rspec-its
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - ~>
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: 1.0.1
61
+ version: '0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - ~>
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: 1.0.1
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec-collection_matchers
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - '>='
73
+ - - ">="
60
74
  - !ruby/object:Gem::Version
61
75
  version: '0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - '>='
80
+ - - ">="
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: sqlite3
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - '>='
87
+ - - ">="
74
88
  - !ruby/object:Gem::Version
75
89
  version: '0'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - '>='
94
+ - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: database_cleaner
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - '>='
101
+ - - "~>"
88
102
  - !ruby/object:Gem::Version
89
- version: '0'
103
+ version: 1.3.0
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
- - - '>='
108
+ - - "~>"
95
109
  - !ruby/object:Gem::Version
96
- version: '0'
110
+ version: 1.3.0
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: elasticsearch-extensions
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
- - - '>='
115
+ - - ">="
102
116
  - !ruby/object:Gem::Version
103
117
  version: '0'
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
- - - '>='
122
+ - - ">="
109
123
  - !ruby/object:Gem::Version
110
124
  version: '0'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: activesupport
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
- - - '>='
129
+ - - ">="
116
130
  - !ruby/object:Gem::Version
117
131
  version: '3.2'
118
132
  type: :runtime
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
- - - '>='
136
+ - - ">="
123
137
  - !ruby/object:Gem::Version
124
138
  version: '3.2'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: elasticsearch
127
141
  requirement: !ruby/object:Gem::Requirement
128
142
  requirements:
129
- - - '>='
143
+ - - ">="
130
144
  - !ruby/object:Gem::Version
131
145
  version: 1.0.0
132
146
  type: :runtime
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
135
149
  requirements:
136
- - - '>='
150
+ - - ">="
137
151
  - !ruby/object:Gem::Version
138
152
  version: 1.0.0
139
153
  description: Chewy provides functionality for Elasticsearch index handling, documents
@@ -144,9 +158,10 @@ executables: []
144
158
  extensions: []
145
159
  extra_rdoc_files: []
146
160
  files:
147
- - .gitignore
148
- - .rspec
149
- - .travis.yml
161
+ - ".gitignore"
162
+ - ".rspec"
163
+ - ".travis.yml"
164
+ - Appraisals
150
165
  - CHANGELOG.md
151
166
  - Gemfile
152
167
  - Guardfile
@@ -155,27 +170,27 @@ files:
155
170
  - Rakefile
156
171
  - chewy.gemspec
157
172
  - filters
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
173
+ - gemfiles/rails.3.2.activerecord.gemfile
174
+ - gemfiles/rails.3.2.activerecord.kaminari.gemfile
175
+ - gemfiles/rails.3.2.activerecord.will_paginate.gemfile
176
+ - gemfiles/rails.4.0.activerecord.gemfile
177
+ - gemfiles/rails.4.0.activerecord.kaminari.gemfile
178
+ - gemfiles/rails.4.0.activerecord.will_paginate.gemfile
179
+ - gemfiles/rails.4.0.mongoid.gemfile
180
+ - gemfiles/rails.4.0.mongoid.kaminari.gemfile
181
+ - gemfiles/rails.4.0.mongoid.will_paginate.gemfile
182
+ - gemfiles/rails.4.1.activerecord.gemfile
183
+ - gemfiles/rails.4.1.activerecord.kaminari.gemfile
184
+ - gemfiles/rails.4.1.activerecord.will_paginate.gemfile
185
+ - gemfiles/rails.4.1.mongoid.gemfile
186
+ - gemfiles/rails.4.1.mongoid.kaminari.gemfile
187
+ - gemfiles/rails.4.1.mongoid.will_paginate.gemfile
188
+ - gemfiles/rails.4.2.activerecord.gemfile
189
+ - gemfiles/rails.4.2.activerecord.kaminari.gemfile
190
+ - gemfiles/rails.4.2.activerecord.will_paginate.gemfile
191
+ - gemfiles/rails.4.2.mongoid.gemfile
192
+ - gemfiles/rails.4.2.mongoid.kaminari.gemfile
193
+ - gemfiles/rails.4.2.mongoid.will_paginate.gemfile
179
194
  - lib/chewy.rb
180
195
  - lib/chewy/backports/deep_dup.rb
181
196
  - lib/chewy/backports/duplicable.rb
@@ -187,6 +202,7 @@ files:
187
202
  - lib/chewy/index/actions.rb
188
203
  - lib/chewy/index/aliases.rb
189
204
  - lib/chewy/index/settings.rb
205
+ - lib/chewy/log_subscriber.rb
190
206
  - lib/chewy/query.rb
191
207
  - lib/chewy/query/compose.rb
192
208
  - lib/chewy/query/criteria.rb
@@ -215,18 +231,26 @@ files:
215
231
  - lib/chewy/query/pagination.rb
216
232
  - lib/chewy/query/pagination/kaminari.rb
217
233
  - lib/chewy/query/pagination/will_paginate.rb
234
+ - lib/chewy/query/scoping.rb
218
235
  - lib/chewy/railtie.rb
236
+ - lib/chewy/repository.rb
219
237
  - lib/chewy/rspec.rb
220
238
  - lib/chewy/rspec/update_index.rb
221
239
  - lib/chewy/runtime.rb
222
240
  - lib/chewy/runtime/version.rb
223
241
  - lib/chewy/search.rb
242
+ - lib/chewy/strategy.rb
243
+ - lib/chewy/strategy/atomic.rb
244
+ - lib/chewy/strategy/base.rb
245
+ - lib/chewy/strategy/bypass.rb
246
+ - lib/chewy/strategy/urgent.rb
224
247
  - lib/chewy/type.rb
225
248
  - lib/chewy/type/actions.rb
226
249
  - lib/chewy/type/adapter/active_record.rb
227
250
  - lib/chewy/type/adapter/base.rb
228
251
  - lib/chewy/type/adapter/mongoid.rb
229
252
  - lib/chewy/type/adapter/object.rb
253
+ - lib/chewy/type/adapter/orm.rb
230
254
  - lib/chewy/type/import.rb
231
255
  - lib/chewy/type/mapping.rb
232
256
  - lib/chewy/type/observe.rb
@@ -238,9 +262,9 @@ files:
238
262
  - spec/chewy/config_spec.rb
239
263
  - spec/chewy/fields/base_spec.rb
240
264
  - spec/chewy/fields/root_spec.rb
265
+ - spec/chewy/fields/time_fields_spec.rb
241
266
  - spec/chewy/index/actions_spec.rb
242
267
  - spec/chewy/index/aliases_spec.rb
243
- - spec/chewy/index/search_spec.rb
244
268
  - spec/chewy/index/settings_spec.rb
245
269
  - spec/chewy/index_spec.rb
246
270
  - spec/chewy/query/criteria_spec.rb
@@ -266,9 +290,12 @@ files:
266
290
  - spec/chewy/query/pagination/will_paginage_spec.rb
267
291
  - spec/chewy/query/pagination_spec.rb
268
292
  - spec/chewy/query_spec.rb
293
+ - spec/chewy/repository_spec.rb
269
294
  - spec/chewy/rspec/update_index_spec.rb
270
295
  - spec/chewy/runtime/version_spec.rb
271
296
  - spec/chewy/runtime_spec.rb
297
+ - spec/chewy/search_spec.rb
298
+ - spec/chewy/strategy_spec.rb
272
299
  - spec/chewy/type/actions_spec.rb
273
300
  - spec/chewy/type/adapter/active_record_spec.rb
274
301
  - spec/chewy/type/adapter/mongoid_spec.rb
@@ -294,17 +321,17 @@ require_paths:
294
321
  - lib
295
322
  required_ruby_version: !ruby/object:Gem::Requirement
296
323
  requirements:
297
- - - '>='
324
+ - - ">="
298
325
  - !ruby/object:Gem::Version
299
326
  version: '0'
300
327
  required_rubygems_version: !ruby/object:Gem::Requirement
301
328
  requirements:
302
- - - '>='
329
+ - - ">="
303
330
  - !ruby/object:Gem::Version
304
331
  version: '0'
305
332
  requirements: []
306
333
  rubyforge_project:
307
- rubygems_version: 2.2.2
334
+ rubygems_version: 2.4.5
308
335
  signing_key:
309
336
  specification_version: 4
310
337
  summary: Elasticsearch ODM client wrapper
@@ -312,9 +339,9 @@ test_files:
312
339
  - spec/chewy/config_spec.rb
313
340
  - spec/chewy/fields/base_spec.rb
314
341
  - spec/chewy/fields/root_spec.rb
342
+ - spec/chewy/fields/time_fields_spec.rb
315
343
  - spec/chewy/index/actions_spec.rb
316
344
  - spec/chewy/index/aliases_spec.rb
317
- - spec/chewy/index/search_spec.rb
318
345
  - spec/chewy/index/settings_spec.rb
319
346
  - spec/chewy/index_spec.rb
320
347
  - spec/chewy/query/criteria_spec.rb
@@ -340,9 +367,12 @@ test_files:
340
367
  - spec/chewy/query/pagination/will_paginage_spec.rb
341
368
  - spec/chewy/query/pagination_spec.rb
342
369
  - spec/chewy/query_spec.rb
370
+ - spec/chewy/repository_spec.rb
343
371
  - spec/chewy/rspec/update_index_spec.rb
344
372
  - spec/chewy/runtime/version_spec.rb
345
373
  - spec/chewy/runtime_spec.rb
374
+ - spec/chewy/search_spec.rb
375
+ - spec/chewy/strategy_spec.rb
346
376
  - spec/chewy/type/actions_spec.rb
347
377
  - spec/chewy/type/adapter/active_record_spec.rb
348
378
  - spec/chewy/type/adapter/mongoid_spec.rb