elastictastic 0.5.0 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/LICENSE +1 -1
  2. data/README.md +161 -10
  3. data/lib/elastictastic/adapter.rb +84 -0
  4. data/lib/elastictastic/association.rb +6 -0
  5. data/lib/elastictastic/basic_document.rb +213 -0
  6. data/lib/elastictastic/bulk_persistence_strategy.rb +64 -19
  7. data/lib/elastictastic/callbacks.rb +18 -12
  8. data/lib/elastictastic/child_collection_proxy.rb +15 -11
  9. data/lib/elastictastic/client.rb +47 -24
  10. data/lib/elastictastic/configuration.rb +59 -4
  11. data/lib/elastictastic/dirty.rb +43 -28
  12. data/lib/elastictastic/discrete_persistence_strategy.rb +48 -23
  13. data/lib/elastictastic/document.rb +1 -85
  14. data/lib/elastictastic/embedded_document.rb +34 -0
  15. data/lib/elastictastic/errors.rb +17 -5
  16. data/lib/elastictastic/field.rb +3 -0
  17. data/lib/elastictastic/mass_assignment_security.rb +2 -4
  18. data/lib/elastictastic/middleware.rb +66 -84
  19. data/lib/elastictastic/multi_get.rb +30 -0
  20. data/lib/elastictastic/multi_search.rb +70 -0
  21. data/lib/elastictastic/nested_document.rb +3 -27
  22. data/lib/elastictastic/new_relic_instrumentation.rb +8 -8
  23. data/lib/elastictastic/observing.rb +8 -6
  24. data/lib/elastictastic/optimistic_locking.rb +57 -0
  25. data/lib/elastictastic/parent_child.rb +56 -54
  26. data/lib/elastictastic/persistence.rb +16 -16
  27. data/lib/elastictastic/properties.rb +136 -96
  28. data/lib/elastictastic/railtie.rb +1 -1
  29. data/lib/elastictastic/rotor.rb +105 -0
  30. data/lib/elastictastic/scope.rb +186 -56
  31. data/lib/elastictastic/server_error.rb +20 -1
  32. data/lib/elastictastic/test_helpers.rb +152 -97
  33. data/lib/elastictastic/thrift/constants.rb +12 -0
  34. data/lib/elastictastic/thrift/rest.rb +83 -0
  35. data/lib/elastictastic/thrift/types.rb +124 -0
  36. data/lib/elastictastic/thrift_adapter.rb +61 -0
  37. data/lib/elastictastic/transport_methods.rb +27 -0
  38. data/lib/elastictastic/validations.rb +11 -13
  39. data/lib/elastictastic/version.rb +1 -1
  40. data/lib/elastictastic.rb +148 -27
  41. data/spec/environment.rb +1 -1
  42. data/spec/examples/bulk_persistence_strategy_spec.rb +151 -23
  43. data/spec/examples/callbacks_spec.rb +65 -34
  44. data/spec/examples/dirty_spec.rb +160 -1
  45. data/spec/examples/document_spec.rb +168 -106
  46. data/spec/examples/middleware_spec.rb +1 -61
  47. data/spec/examples/multi_get_spec.rb +127 -0
  48. data/spec/examples/multi_search_spec.rb +113 -0
  49. data/spec/examples/observing_spec.rb +24 -3
  50. data/spec/examples/optimistic_locking_spec.rb +417 -0
  51. data/spec/examples/parent_child_spec.rb +73 -33
  52. data/spec/examples/properties_spec.rb +53 -0
  53. data/spec/examples/rotor_spec.rb +132 -0
  54. data/spec/examples/scope_spec.rb +78 -18
  55. data/spec/examples/search_spec.rb +26 -0
  56. data/spec/examples/validation_spec.rb +7 -1
  57. data/spec/models/author.rb +1 -1
  58. data/spec/models/blog.rb +2 -0
  59. data/spec/models/comment.rb +1 -1
  60. data/spec/models/photo.rb +9 -0
  61. data/spec/models/post.rb +3 -0
  62. metadata +97 -78
  63. data/lib/elastictastic/resource.rb +0 -4
  64. data/spec/examples/active_model_lint_spec.rb +0 -20
metadata CHANGED
@@ -1,20 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastictastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.10.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Mat Brown
9
+ - Aubrey Holland
10
+ - John Crepezzi
9
11
  autorequire:
10
12
  bindir: bin
11
13
  cert_chain: []
12
- date: 2011-11-08 00:00:00.000000000 -05:00
13
- default_executable:
14
+ date: 2012-07-16 00:00:00.000000000Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: activesupport
17
- requirement: &16448500 !ruby/object:Gem::Requirement
18
+ requirement: &6880380 !ruby/object:Gem::Requirement
18
19
  none: false
19
20
  requirements:
20
21
  - - ~>
@@ -22,10 +23,10 @@ dependencies:
22
23
  version: '3.0'
23
24
  type: :runtime
24
25
  prerelease: false
25
- version_requirements: *16448500
26
+ version_requirements: *6880380
26
27
  - !ruby/object:Gem::Dependency
27
28
  name: activemodel
28
- requirement: &16609920 !ruby/object:Gem::Requirement
29
+ requirement: &6879840 !ruby/object:Gem::Requirement
29
30
  none: false
30
31
  requirements:
31
32
  - - ~>
@@ -33,10 +34,10 @@ dependencies:
33
34
  version: '3.0'
34
35
  type: :runtime
35
36
  prerelease: false
36
- version_requirements: *16609920
37
+ version_requirements: *6879840
37
38
  - !ruby/object:Gem::Dependency
38
39
  name: hashie
39
- requirement: &16687040 !ruby/object:Gem::Requirement
40
+ requirement: &6879380 !ruby/object:Gem::Requirement
40
41
  none: false
41
42
  requirements:
42
43
  - - ! '>='
@@ -44,10 +45,10 @@ dependencies:
44
45
  version: '0'
45
46
  type: :runtime
46
47
  prerelease: false
47
- version_requirements: *16687040
48
+ version_requirements: *6879380
48
49
  - !ruby/object:Gem::Dependency
49
50
  name: i18n
50
- requirement: &16794940 !ruby/object:Gem::Requirement
51
+ requirement: &6878820 !ruby/object:Gem::Requirement
51
52
  none: false
52
53
  requirements:
53
54
  - - ! '>='
@@ -55,21 +56,21 @@ dependencies:
55
56
  version: '0'
56
57
  type: :runtime
57
58
  prerelease: false
58
- version_requirements: *16794940
59
+ version_requirements: *6878820
59
60
  - !ruby/object:Gem::Dependency
60
- name: faraday
61
- requirement: &16921840 !ruby/object:Gem::Requirement
61
+ name: multi_json
62
+ requirement: &6878300 !ruby/object:Gem::Requirement
62
63
  none: false
63
64
  requirements:
64
- - - ~>
65
+ - - ! '>='
65
66
  - !ruby/object:Gem::Version
66
- version: '0.7'
67
+ version: '0'
67
68
  type: :runtime
68
69
  prerelease: false
69
- version_requirements: *16921840
70
+ version_requirements: *6878300
70
71
  - !ruby/object:Gem::Dependency
71
72
  name: rspec
72
- requirement: &17079700 !ruby/object:Gem::Requirement
73
+ requirement: &6877680 !ruby/object:Gem::Requirement
73
74
  none: false
74
75
  requirements:
75
76
  - - ~>
@@ -77,40 +78,40 @@ dependencies:
77
78
  version: '2.0'
78
79
  type: :development
79
80
  prerelease: false
80
- version_requirements: *17079700
81
+ version_requirements: *6877680
81
82
  - !ruby/object:Gem::Dependency
82
- name: rspec-unit
83
- requirement: &17284000 !ruby/object:Gem::Requirement
83
+ name: fakeweb
84
+ requirement: &6877060 !ruby/object:Gem::Requirement
84
85
  none: false
85
86
  requirements:
86
87
  - - ~>
87
88
  - !ruby/object:Gem::Version
88
- version: '1.1'
89
+ version: '1.3'
89
90
  type: :development
90
91
  prerelease: false
91
- version_requirements: *17284000
92
+ version_requirements: *6877060
92
93
  - !ruby/object:Gem::Dependency
93
- name: fakeweb
94
- requirement: &17697540 !ruby/object:Gem::Requirement
94
+ name: ruby-debug19
95
+ requirement: &6876480 !ruby/object:Gem::Requirement
95
96
  none: false
96
97
  requirements:
97
98
  - - ~>
98
99
  - !ruby/object:Gem::Version
99
- version: '1.3'
100
+ version: '0.11'
100
101
  type: :development
101
102
  prerelease: false
102
- version_requirements: *17697540
103
+ version_requirements: *6876480
103
104
  - !ruby/object:Gem::Dependency
104
- name: ruby-debug19
105
- requirement: &18597020 !ruby/object:Gem::Requirement
105
+ name: yard
106
+ requirement: &6875940 !ruby/object:Gem::Requirement
106
107
  none: false
107
108
  requirements:
108
109
  - - ~>
109
110
  - !ruby/object:Gem::Version
110
- version: '0.11'
111
+ version: '0.6'
111
112
  type: :development
112
113
  prerelease: false
113
- version_requirements: *18597020
114
+ version_requirements: *6875940
114
115
  description: ! 'Elastictastic is an object-document mapper and lightweight API adapter
115
116
  for
116
117
 
@@ -128,62 +129,76 @@ extra_rdoc_files:
128
129
  - README.md
129
130
  files:
130
131
  - lib/elastictastic.rb
131
- - lib/elastictastic/field.rb
132
+ - lib/elastictastic/optimistic_locking.rb
133
+ - lib/elastictastic/server_error.rb
134
+ - lib/elastictastic/document.rb
135
+ - lib/elastictastic/nested_document.rb
136
+ - lib/elastictastic/child_collection_proxy.rb
137
+ - lib/elastictastic/mass_assignment_security.rb
138
+ - lib/elastictastic/scope_builder.rb
132
139
  - lib/elastictastic/util.rb
133
- - lib/elastictastic/properties.rb
134
- - lib/elastictastic/client.rb
135
- - lib/elastictastic/test_helpers.rb
140
+ - lib/elastictastic/index.rb
141
+ - lib/elastictastic/bulk_persistence_strategy.rb
142
+ - lib/elastictastic/basic_document.rb
143
+ - lib/elastictastic/thrift/rest.rb
144
+ - lib/elastictastic/thrift/constants.rb
145
+ - lib/elastictastic/thrift/types.rb
146
+ - lib/elastictastic/multi_search.rb
136
147
  - lib/elastictastic/association.rb
137
- - lib/elastictastic/scope.rb
138
- - lib/elastictastic/scoped.rb
139
- - lib/elastictastic/new_relic_instrumentation.rb
140
- - lib/elastictastic/child_collection_proxy.rb
141
- - lib/elastictastic/callbacks.rb
142
- - lib/elastictastic/server_error.rb
148
+ - lib/elastictastic/adapter.rb
143
149
  - lib/elastictastic/discrete_persistence_strategy.rb
150
+ - lib/elastictastic/callbacks.rb
151
+ - lib/elastictastic/observer.rb
152
+ - lib/elastictastic/embedded_document.rb
153
+ - lib/elastictastic/test_helpers.rb
154
+ - lib/elastictastic/thrift_adapter.rb
144
155
  - lib/elastictastic/version.rb
145
- - lib/elastictastic/scope_builder.rb
146
- - lib/elastictastic/observing.rb
147
- - lib/elastictastic/resource.rb
148
- - lib/elastictastic/configuration.rb
149
- - lib/elastictastic/nested_document.rb
150
- - lib/elastictastic/dirty.rb
151
- - lib/elastictastic/document.rb
156
+ - lib/elastictastic/validations.rb
152
157
  - lib/elastictastic/persistence.rb
153
- - lib/elastictastic/index.rb
154
- - lib/elastictastic/search.rb
155
- - lib/elastictastic/mass_assignment_security.rb
158
+ - lib/elastictastic/railtie.rb
159
+ - lib/elastictastic/client.rb
160
+ - lib/elastictastic/properties.rb
161
+ - lib/elastictastic/rotor.rb
162
+ - lib/elastictastic/multi_get.rb
156
163
  - lib/elastictastic/parent_child.rb
157
- - lib/elastictastic/observer.rb
164
+ - lib/elastictastic/field.rb
165
+ - lib/elastictastic/scope.rb
166
+ - lib/elastictastic/scoped.rb
167
+ - lib/elastictastic/new_relic_instrumentation.rb
168
+ - lib/elastictastic/search.rb
169
+ - lib/elastictastic/transport_methods.rb
158
170
  - lib/elastictastic/middleware.rb
171
+ - lib/elastictastic/configuration.rb
172
+ - lib/elastictastic/dirty.rb
159
173
  - lib/elastictastic/errors.rb
160
- - lib/elastictastic/validations.rb
161
- - lib/elastictastic/railtie.rb
162
- - lib/elastictastic/bulk_persistence_strategy.rb
163
- - spec/examples/observing_spec.rb
174
+ - lib/elastictastic/observing.rb
175
+ - spec/environment.rb
164
176
  - spec/examples/bulk_persistence_strategy_spec.rb
165
- - spec/examples/dirty_spec.rb
166
- - spec/examples/parent_child_spec.rb
177
+ - spec/examples/document_spec.rb
178
+ - spec/examples/properties_spec.rb
167
179
  - spec/examples/validation_spec.rb
168
- - spec/examples/spec_helper.rb
180
+ - spec/examples/optimistic_locking_spec.rb
169
181
  - spec/examples/middleware_spec.rb
170
- - spec/examples/active_model_lint_spec.rb
171
- - spec/examples/search_spec.rb
172
- - spec/examples/scope_spec.rb
173
- - spec/examples/properties_spec.rb
174
182
  - spec/examples/mass_assignment_security_spec.rb
175
- - spec/examples/document_spec.rb
183
+ - spec/examples/dirty_spec.rb
184
+ - spec/examples/spec_helper.rb
185
+ - spec/examples/multi_search_spec.rb
186
+ - spec/examples/rotor_spec.rb
176
187
  - spec/examples/callbacks_spec.rb
177
- - spec/support/fakeweb_request_history.rb
178
- - spec/environment.rb
179
- - spec/models/comment.rb
180
- - spec/models/author.rb
188
+ - spec/examples/multi_get_spec.rb
189
+ - spec/examples/scope_spec.rb
190
+ - spec/examples/parent_child_spec.rb
191
+ - spec/examples/observing_spec.rb
192
+ - spec/examples/search_spec.rb
181
193
  - spec/models/post_observer.rb
194
+ - spec/models/author.rb
182
195
  - spec/models/blog.rb
183
196
  - spec/models/post.rb
197
+ - spec/models/photo.rb
198
+ - spec/models/comment.rb
199
+ - spec/support/fakeweb_request_history.rb
184
200
  - README.md
185
201
  - LICENSE
186
- has_rdoc: true
187
202
  homepage:
188
203
  licenses:
189
204
  - MIT
@@ -206,22 +221,26 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
221
  requirements:
207
222
  - ElasticSearch
208
223
  rubyforge_project:
209
- rubygems_version: 1.6.2
224
+ rubygems_version: 1.8.15
210
225
  signing_key:
211
226
  specification_version: 3
212
227
  summary: Object-document mapper for ElasticSearch
213
228
  test_files:
214
- - spec/examples/observing_spec.rb
215
229
  - spec/examples/bulk_persistence_strategy_spec.rb
216
- - spec/examples/dirty_spec.rb
217
- - spec/examples/parent_child_spec.rb
230
+ - spec/examples/document_spec.rb
231
+ - spec/examples/properties_spec.rb
218
232
  - spec/examples/validation_spec.rb
219
- - spec/examples/spec_helper.rb
233
+ - spec/examples/optimistic_locking_spec.rb
220
234
  - spec/examples/middleware_spec.rb
221
- - spec/examples/active_model_lint_spec.rb
222
- - spec/examples/search_spec.rb
223
- - spec/examples/scope_spec.rb
224
- - spec/examples/properties_spec.rb
225
235
  - spec/examples/mass_assignment_security_spec.rb
226
- - spec/examples/document_spec.rb
236
+ - spec/examples/dirty_spec.rb
237
+ - spec/examples/spec_helper.rb
238
+ - spec/examples/multi_search_spec.rb
239
+ - spec/examples/rotor_spec.rb
227
240
  - spec/examples/callbacks_spec.rb
241
+ - spec/examples/multi_get_spec.rb
242
+ - spec/examples/scope_spec.rb
243
+ - spec/examples/parent_child_spec.rb
244
+ - spec/examples/observing_spec.rb
245
+ - spec/examples/search_spec.rb
246
+ has_rdoc: true
@@ -1,4 +0,0 @@
1
- warn 'Elastictastic::Resource is deprecated and will be removed in a future version. The new module name is Elastictastic::NestedDocument'
2
- module Elastictastic
3
- Resource = NestedDocument
4
- end
@@ -1,20 +0,0 @@
1
- require File.expand_path('../spec_helper', __FILE__)
2
-
3
- describe 'ActiveModel compliance' do
4
- include ActiveModel::Lint::Tests
5
-
6
- ActiveModel::Lint::Tests.public_instance_methods.each do |method|
7
- method = method.to_s
8
- if method =~ /^test_/
9
- example method.gsub('_', ' ') do
10
- __send__(method)
11
- end
12
- end
13
- end
14
-
15
- private
16
-
17
- def model
18
- Post.new
19
- end
20
- end