esearch 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/.gitignore +5 -0
  2. data/.rspec +6 -0
  3. data/.travis.yml +19 -0
  4. data/Changelog.md +27 -0
  5. data/Gemfile +6 -0
  6. data/Gemfile.devtools +60 -0
  7. data/Guardfile +18 -0
  8. data/LICENSE +20 -0
  9. data/README.md +93 -0
  10. data/Rakefile +2 -0
  11. data/TODO +3 -0
  12. data/config/devtools.yml +2 -0
  13. data/config/flay.yml +3 -0
  14. data/config/flog.yml +3 -0
  15. data/config/mutant.yml +3 -0
  16. data/config/reek.yml +103 -0
  17. data/config/yardstick.yml +2 -0
  18. data/esearch.gemspec +26 -0
  19. data/lib/esearch.rb +43 -0
  20. data/lib/esearch/cluster.rb +85 -0
  21. data/lib/esearch/command.rb +158 -0
  22. data/lib/esearch/command/cluster.rb +28 -0
  23. data/lib/esearch/command/document.rb +111 -0
  24. data/lib/esearch/command/exist.rb +37 -0
  25. data/lib/esearch/command/index.rb +66 -0
  26. data/lib/esearch/command/search.rb +24 -0
  27. data/lib/esearch/command/status.rb +24 -0
  28. data/lib/esearch/connection.rb +36 -0
  29. data/lib/esearch/document.rb +53 -0
  30. data/lib/esearch/index.rb +61 -0
  31. data/lib/esearch/indices.rb +52 -0
  32. data/lib/esearch/mixin.rb +111 -0
  33. data/lib/esearch/presenter.rb +43 -0
  34. data/lib/esearch/presenter/aspect.rb +17 -0
  35. data/lib/esearch/presenter/aspect/range.rb +63 -0
  36. data/lib/esearch/presenter/aspect/term.rb +19 -0
  37. data/lib/esearch/presenter/cluster.rb +84 -0
  38. data/lib/esearch/presenter/document.rb +102 -0
  39. data/lib/esearch/presenter/facet.rb +72 -0
  40. data/lib/esearch/presenter/hit.rb +70 -0
  41. data/lib/esearch/presenter/hits.rb +60 -0
  42. data/lib/esearch/presenter/index.rb +23 -0
  43. data/lib/esearch/presenter/search.rb +32 -0
  44. data/lib/esearch/presenter/status.rb +18 -0
  45. data/lib/esearch/request.rb +90 -0
  46. data/lib/esearch/type.rb +40 -0
  47. data/spec/integration/esearch/spike_spec.rb +50 -0
  48. data/spec/spec_helper.rb +65 -0
  49. data/spec/support/example_group_methods.rb +7 -0
  50. data/spec/support/ice_nine_config.rb +6 -0
  51. data/spec/unit/esearch/cluster/class_methods/connect_spec.rb +16 -0
  52. data/spec/unit/esearch/cluster/health_spec.rb +10 -0
  53. data/spec/unit/esearch/cluster/index_spec.rb +11 -0
  54. data/spec/unit/esearch/cluster/indices_spec.rb +11 -0
  55. data/spec/unit/esearch/cluster/path_spec.rb +11 -0
  56. data/spec/unit/esearch/command/class_methods/run_spec.rb +16 -0
  57. data/spec/unit/esearch/command/cluster/health/run_spec.rb +14 -0
  58. data/spec/unit/esearch/command/document/delete/run_spec.rb +13 -0
  59. data/spec/unit/esearch/command/document/get/result_spec.rb +27 -0
  60. data/spec/unit/esearch/command/document/index/create/run_spec.rb +17 -0
  61. data/spec/unit/esearch/command/document/index/run_create_spec.rb +17 -0
  62. data/spec/unit/esearch/command/document/index/run_spec.rb +15 -0
  63. data/spec/unit/esearch/command/document/index/run_update_spec.rb +15 -0
  64. data/spec/unit/esearch/command/document/index/update/run_spec.rb +15 -0
  65. data/spec/unit/esearch/command/exist/result_spec.rb +39 -0
  66. data/spec/unit/esearch/command/index/create/run_spec.rb +14 -0
  67. data/spec/unit/esearch/command/index/delete/run_spec.rb +13 -0
  68. data/spec/unit/esearch/command/index/refresh/run_spec.rb +13 -0
  69. data/spec/unit/esearch/command/result_spec.rb +68 -0
  70. data/spec/unit/esearch/command/search/run_spec.rb +14 -0
  71. data/spec/unit/esearch/command/status/run_spec.rb +13 -0
  72. data/spec/unit/esearch/connection/class_methods/build_spec.rb +29 -0
  73. data/spec/unit/esearch/connection/run_spec.rb +36 -0
  74. data/spec/unit/esearch/document/connection_spec.rb +12 -0
  75. data/spec/unit/esearch/document/delete_spec.rb +12 -0
  76. data/spec/unit/esearch/document/get_spec.rb +12 -0
  77. data/spec/unit/esearch/index/create_spec.rb +12 -0
  78. data/spec/unit/esearch/index/delete_spec.rb +11 -0
  79. data/spec/unit/esearch/index/type_spec.rb +12 -0
  80. data/spec/unit/esearch/indices/all/path_spec.rb +12 -0
  81. data/spec/unit/esearch/mixin/document/index_create_spec.rb +31 -0
  82. data/spec/unit/esearch/mixin/document/index_spec.rb +31 -0
  83. data/spec/unit/esearch/mixin/document/index_update_spec.rb +31 -0
  84. data/spec/unit/esearch/mixin/exist/exist_predicate_spec.rb +16 -0
  85. data/spec/unit/esearch/mixin/index/refresh_spec.rb +16 -0
  86. data/spec/unit/esearch/mixin/index/status_spec.rb +16 -0
  87. data/spec/unit/esearch/mixin/search/search_spec.rb +18 -0
  88. data/spec/unit/esearch/presenter/aspect/range/from_spec.rb +24 -0
  89. data/spec/unit/esearch/presenter/aspect/range/to_spec.rb +24 -0
  90. data/spec/unit/esearch/presenter/class_methods/new_spec.rb +37 -0
  91. data/spec/unit/esearch/presenter/facet/build_spec.rb +26 -0
  92. data/spec/unit/esearch/presenter/facet/class_methods/build_spec.rb +26 -0
  93. data/spec/unit/esearch/presenter/hit/fields_spec.rb +24 -0
  94. data/spec/unit/esearch/presenter/hit/source_spec.rb +24 -0
  95. data/spec/unit/esearch/presenter/hits/each_spec.rb +15 -0
  96. data/spec/unit/esearch/presenter/hits/size_spec.rb +13 -0
  97. data/spec/unit/esearch/request/initialize_spec.rb +39 -0
  98. data/spec/unit/esearch/request/run_spec.rb +39 -0
  99. data/spec/unit/esearch/type/connection_spec.rb +15 -0
  100. data/spec/unit/esearch/type/document_spec.rb +12 -0
  101. metadata +330 -0
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe Esearch::Type, '#connection' do
4
+ subject { object.connection }
5
+
6
+ let(:object) { described_class.new(index, type_name) }
7
+ let(:index) { mock('Index', :connection => connection) }
8
+ let(:connection) { mock('Connection') }
9
+ let(:type_name) { mock('Type Name') }
10
+
11
+ it { should be(connection) }
12
+
13
+ it_should_behave_like 'an idempotent method'
14
+ end
15
+
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ describe Esearch::Type, '#document' do
4
+ subject { object.document(id) }
5
+
6
+ let(:object) { described_class.new(index, type_name) }
7
+ let(:index) { mock('Index') }
8
+ let(:type_name) { 'foo' }
9
+ let(:id) { '1' }
10
+
11
+ it { should eql(Esearch::Document.new(object, id)) }
12
+ end
metadata ADDED
@@ -0,0 +1,330 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: esearch
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Markus Schirp
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-05-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: descendants_tracker
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 0.0.1
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 0.0.1
30
+ - !ruby/object:Gem::Dependency
31
+ name: concord
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 0.1.0
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.1.0
46
+ - !ruby/object:Gem::Dependency
47
+ name: faraday
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 0.8.4
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.8.4
62
+ - !ruby/object:Gem::Dependency
63
+ name: adamantium
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 0.0.7
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 0.0.7
78
+ - !ruby/object:Gem::Dependency
79
+ name: equalizer
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: 0.0.5
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 0.0.5
94
+ - !ruby/object:Gem::Dependency
95
+ name: abstract_type
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: 0.0.5
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 0.0.5
110
+ - !ruby/object:Gem::Dependency
111
+ name: multi_json
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: 1.7.2
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 1.7.2
126
+ - !ruby/object:Gem::Dependency
127
+ name: null_logger
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ~>
132
+ - !ruby/object:Gem::Version
133
+ version: 0.0.1
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ~>
140
+ - !ruby/object:Gem::Version
141
+ version: 0.0.1
142
+ description: Esearch driver for ruby
143
+ email:
144
+ - mbj@seonic.net
145
+ executables: []
146
+ extensions: []
147
+ extra_rdoc_files:
148
+ - TODO
149
+ files:
150
+ - .gitignore
151
+ - .rspec
152
+ - .travis.yml
153
+ - Changelog.md
154
+ - Gemfile
155
+ - Gemfile.devtools
156
+ - Guardfile
157
+ - LICENSE
158
+ - README.md
159
+ - Rakefile
160
+ - TODO
161
+ - config/devtools.yml
162
+ - config/flay.yml
163
+ - config/flog.yml
164
+ - config/mutant.yml
165
+ - config/reek.yml
166
+ - config/yardstick.yml
167
+ - esearch.gemspec
168
+ - lib/esearch.rb
169
+ - lib/esearch/cluster.rb
170
+ - lib/esearch/command.rb
171
+ - lib/esearch/command/cluster.rb
172
+ - lib/esearch/command/document.rb
173
+ - lib/esearch/command/exist.rb
174
+ - lib/esearch/command/index.rb
175
+ - lib/esearch/command/search.rb
176
+ - lib/esearch/command/status.rb
177
+ - lib/esearch/connection.rb
178
+ - lib/esearch/document.rb
179
+ - lib/esearch/index.rb
180
+ - lib/esearch/indices.rb
181
+ - lib/esearch/mixin.rb
182
+ - lib/esearch/presenter.rb
183
+ - lib/esearch/presenter/aspect.rb
184
+ - lib/esearch/presenter/aspect/range.rb
185
+ - lib/esearch/presenter/aspect/term.rb
186
+ - lib/esearch/presenter/cluster.rb
187
+ - lib/esearch/presenter/document.rb
188
+ - lib/esearch/presenter/facet.rb
189
+ - lib/esearch/presenter/hit.rb
190
+ - lib/esearch/presenter/hits.rb
191
+ - lib/esearch/presenter/index.rb
192
+ - lib/esearch/presenter/search.rb
193
+ - lib/esearch/presenter/status.rb
194
+ - lib/esearch/request.rb
195
+ - lib/esearch/type.rb
196
+ - spec/integration/esearch/spike_spec.rb
197
+ - spec/spec_helper.rb
198
+ - spec/support/example_group_methods.rb
199
+ - spec/support/ice_nine_config.rb
200
+ - spec/unit/esearch/cluster/class_methods/connect_spec.rb
201
+ - spec/unit/esearch/cluster/health_spec.rb
202
+ - spec/unit/esearch/cluster/index_spec.rb
203
+ - spec/unit/esearch/cluster/indices_spec.rb
204
+ - spec/unit/esearch/cluster/path_spec.rb
205
+ - spec/unit/esearch/command/class_methods/run_spec.rb
206
+ - spec/unit/esearch/command/cluster/health/run_spec.rb
207
+ - spec/unit/esearch/command/document/delete/run_spec.rb
208
+ - spec/unit/esearch/command/document/get/result_spec.rb
209
+ - spec/unit/esearch/command/document/index/create/run_spec.rb
210
+ - spec/unit/esearch/command/document/index/run_create_spec.rb
211
+ - spec/unit/esearch/command/document/index/run_spec.rb
212
+ - spec/unit/esearch/command/document/index/run_update_spec.rb
213
+ - spec/unit/esearch/command/document/index/update/run_spec.rb
214
+ - spec/unit/esearch/command/exist/result_spec.rb
215
+ - spec/unit/esearch/command/index/create/run_spec.rb
216
+ - spec/unit/esearch/command/index/delete/run_spec.rb
217
+ - spec/unit/esearch/command/index/refresh/run_spec.rb
218
+ - spec/unit/esearch/command/result_spec.rb
219
+ - spec/unit/esearch/command/search/run_spec.rb
220
+ - spec/unit/esearch/command/status/run_spec.rb
221
+ - spec/unit/esearch/connection/class_methods/build_spec.rb
222
+ - spec/unit/esearch/connection/run_spec.rb
223
+ - spec/unit/esearch/document/connection_spec.rb
224
+ - spec/unit/esearch/document/delete_spec.rb
225
+ - spec/unit/esearch/document/get_spec.rb
226
+ - spec/unit/esearch/index/create_spec.rb
227
+ - spec/unit/esearch/index/delete_spec.rb
228
+ - spec/unit/esearch/index/type_spec.rb
229
+ - spec/unit/esearch/indices/all/path_spec.rb
230
+ - spec/unit/esearch/mixin/document/index_create_spec.rb
231
+ - spec/unit/esearch/mixin/document/index_spec.rb
232
+ - spec/unit/esearch/mixin/document/index_update_spec.rb
233
+ - spec/unit/esearch/mixin/exist/exist_predicate_spec.rb
234
+ - spec/unit/esearch/mixin/index/refresh_spec.rb
235
+ - spec/unit/esearch/mixin/index/status_spec.rb
236
+ - spec/unit/esearch/mixin/search/search_spec.rb
237
+ - spec/unit/esearch/presenter/aspect/range/from_spec.rb
238
+ - spec/unit/esearch/presenter/aspect/range/to_spec.rb
239
+ - spec/unit/esearch/presenter/class_methods/new_spec.rb
240
+ - spec/unit/esearch/presenter/facet/build_spec.rb
241
+ - spec/unit/esearch/presenter/facet/class_methods/build_spec.rb
242
+ - spec/unit/esearch/presenter/hit/fields_spec.rb
243
+ - spec/unit/esearch/presenter/hit/source_spec.rb
244
+ - spec/unit/esearch/presenter/hits/each_spec.rb
245
+ - spec/unit/esearch/presenter/hits/size_spec.rb
246
+ - spec/unit/esearch/request/initialize_spec.rb
247
+ - spec/unit/esearch/request/run_spec.rb
248
+ - spec/unit/esearch/type/connection_spec.rb
249
+ - spec/unit/esearch/type/document_spec.rb
250
+ homepage: https://github.com/mbj/elasticsearch
251
+ licenses:
252
+ - MIT
253
+ post_install_message:
254
+ rdoc_options: []
255
+ require_paths:
256
+ - lib
257
+ required_ruby_version: !ruby/object:Gem::Requirement
258
+ none: false
259
+ requirements:
260
+ - - ! '>='
261
+ - !ruby/object:Gem::Version
262
+ version: '0'
263
+ required_rubygems_version: !ruby/object:Gem::Requirement
264
+ none: false
265
+ requirements:
266
+ - - ! '>='
267
+ - !ruby/object:Gem::Version
268
+ version: '0'
269
+ requirements: []
270
+ rubyforge_project:
271
+ rubygems_version: 1.8.23
272
+ signing_key:
273
+ specification_version: 3
274
+ summary: Esearch driver for ruby
275
+ test_files:
276
+ - spec/integration/esearch/spike_spec.rb
277
+ - spec/spec_helper.rb
278
+ - spec/support/example_group_methods.rb
279
+ - spec/support/ice_nine_config.rb
280
+ - spec/unit/esearch/cluster/class_methods/connect_spec.rb
281
+ - spec/unit/esearch/cluster/health_spec.rb
282
+ - spec/unit/esearch/cluster/index_spec.rb
283
+ - spec/unit/esearch/cluster/indices_spec.rb
284
+ - spec/unit/esearch/cluster/path_spec.rb
285
+ - spec/unit/esearch/command/class_methods/run_spec.rb
286
+ - spec/unit/esearch/command/cluster/health/run_spec.rb
287
+ - spec/unit/esearch/command/document/delete/run_spec.rb
288
+ - spec/unit/esearch/command/document/get/result_spec.rb
289
+ - spec/unit/esearch/command/document/index/create/run_spec.rb
290
+ - spec/unit/esearch/command/document/index/run_create_spec.rb
291
+ - spec/unit/esearch/command/document/index/run_spec.rb
292
+ - spec/unit/esearch/command/document/index/run_update_spec.rb
293
+ - spec/unit/esearch/command/document/index/update/run_spec.rb
294
+ - spec/unit/esearch/command/exist/result_spec.rb
295
+ - spec/unit/esearch/command/index/create/run_spec.rb
296
+ - spec/unit/esearch/command/index/delete/run_spec.rb
297
+ - spec/unit/esearch/command/index/refresh/run_spec.rb
298
+ - spec/unit/esearch/command/result_spec.rb
299
+ - spec/unit/esearch/command/search/run_spec.rb
300
+ - spec/unit/esearch/command/status/run_spec.rb
301
+ - spec/unit/esearch/connection/class_methods/build_spec.rb
302
+ - spec/unit/esearch/connection/run_spec.rb
303
+ - spec/unit/esearch/document/connection_spec.rb
304
+ - spec/unit/esearch/document/delete_spec.rb
305
+ - spec/unit/esearch/document/get_spec.rb
306
+ - spec/unit/esearch/index/create_spec.rb
307
+ - spec/unit/esearch/index/delete_spec.rb
308
+ - spec/unit/esearch/index/type_spec.rb
309
+ - spec/unit/esearch/indices/all/path_spec.rb
310
+ - spec/unit/esearch/mixin/document/index_create_spec.rb
311
+ - spec/unit/esearch/mixin/document/index_spec.rb
312
+ - spec/unit/esearch/mixin/document/index_update_spec.rb
313
+ - spec/unit/esearch/mixin/exist/exist_predicate_spec.rb
314
+ - spec/unit/esearch/mixin/index/refresh_spec.rb
315
+ - spec/unit/esearch/mixin/index/status_spec.rb
316
+ - spec/unit/esearch/mixin/search/search_spec.rb
317
+ - spec/unit/esearch/presenter/aspect/range/from_spec.rb
318
+ - spec/unit/esearch/presenter/aspect/range/to_spec.rb
319
+ - spec/unit/esearch/presenter/class_methods/new_spec.rb
320
+ - spec/unit/esearch/presenter/facet/build_spec.rb
321
+ - spec/unit/esearch/presenter/facet/class_methods/build_spec.rb
322
+ - spec/unit/esearch/presenter/hit/fields_spec.rb
323
+ - spec/unit/esearch/presenter/hit/source_spec.rb
324
+ - spec/unit/esearch/presenter/hits/each_spec.rb
325
+ - spec/unit/esearch/presenter/hits/size_spec.rb
326
+ - spec/unit/esearch/request/initialize_spec.rb
327
+ - spec/unit/esearch/request/run_spec.rb
328
+ - spec/unit/esearch/type/connection_spec.rb
329
+ - spec/unit/esearch/type/document_spec.rb
330
+ has_rdoc: