trailblazer-finder 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/.rubocop.yml +45 -0
  4. data/.rubocop_todo.yml +52 -0
  5. data/.travis.yml +15 -0
  6. data/Gemfile +12 -0
  7. data/LICENSE.txt +23 -0
  8. data/README.md +494 -0
  9. data/Rakefile +29 -0
  10. data/lib/trailblazer/finder/adapters/active_record/paging.rb +20 -0
  11. data/lib/trailblazer/finder/adapters/active_record/sorting.rb +20 -0
  12. data/lib/trailblazer/finder/adapters/active_record.rb +30 -0
  13. data/lib/trailblazer/finder/adapters/data_mapper/paging.rb +20 -0
  14. data/lib/trailblazer/finder/adapters/data_mapper/sorting.rb +25 -0
  15. data/lib/trailblazer/finder/adapters/data_mapper.rb +30 -0
  16. data/lib/trailblazer/finder/adapters/friendly_id.rb +33 -0
  17. data/lib/trailblazer/finder/adapters/kaminari.rb +18 -0
  18. data/lib/trailblazer/finder/adapters/sequel/paging.rb +20 -0
  19. data/lib/trailblazer/finder/adapters/sequel/sorting.rb +25 -0
  20. data/lib/trailblazer/finder/adapters/sequel.rb +30 -0
  21. data/lib/trailblazer/finder/adapters/will_paginate.rb +18 -0
  22. data/lib/trailblazer/finder/adapters.rb +26 -0
  23. data/lib/trailblazer/finder/base.rb +98 -0
  24. data/lib/trailblazer/finder/errors/block_ignored.rb +11 -0
  25. data/lib/trailblazer/finder/errors/invalid_defined_by_value.rb +11 -0
  26. data/lib/trailblazer/finder/errors/invalid_number.rb +16 -0
  27. data/lib/trailblazer/finder/errors/missing_entity_type.rb +11 -0
  28. data/lib/trailblazer/finder/errors/with_ignored.rb +11 -0
  29. data/lib/trailblazer/finder/features/paging.rb +55 -0
  30. data/lib/trailblazer/finder/features/sorting.rb +66 -0
  31. data/lib/trailblazer/finder/features.rb +22 -0
  32. data/lib/trailblazer/finder/filter.rb +66 -0
  33. data/lib/trailblazer/finder/find.rb +29 -0
  34. data/lib/trailblazer/finder/utils/extra.rb +31 -0
  35. data/lib/trailblazer/finder/utils/params.rb +28 -0
  36. data/lib/trailblazer/finder/utils/parse.rb +25 -0
  37. data/lib/trailblazer/finder/utils/string.rb +35 -0
  38. data/lib/trailblazer/finder/version.rb +5 -0
  39. data/lib/trailblazer/finder.rb +29 -0
  40. data/lib/trailblazer/operation/finder.rb +61 -0
  41. data/spec/spec_helper.rb +15 -0
  42. data/spec/spec_helper_active_record.rb +50 -0
  43. data/spec/spec_helper_data_mapper.rb +35 -0
  44. data/spec/spec_helper_sequel.rb +32 -0
  45. data/spec/support/paging_shared_example.rb +65 -0
  46. data/spec/support/sorting_shared_example.rb +95 -0
  47. data/spec/trailblazer/finder/adapters/active_record/base_spec.rb +112 -0
  48. data/spec/trailblazer/finder/adapters/active_record/paging_spec.rb +64 -0
  49. data/spec/trailblazer/finder/adapters/active_record/sorting_spec.rb +82 -0
  50. data/spec/trailblazer/finder/adapters/data_mapper/base_spec.rb +112 -0
  51. data/spec/trailblazer/finder/adapters/data_mapper/paging_spec.rb +64 -0
  52. data/spec/trailblazer/finder/adapters/data_mapper/sorting_spec.rb +85 -0
  53. data/spec/trailblazer/finder/adapters/friendly_id_spec.rb +46 -0
  54. data/spec/trailblazer/finder/adapters/kaminari_spec.rb +64 -0
  55. data/spec/trailblazer/finder/adapters/sequel/base_spec.rb +112 -0
  56. data/spec/trailblazer/finder/adapters/sequel/paging_spec.rb +64 -0
  57. data/spec/trailblazer/finder/adapters/sequel/sorting_spec.rb +82 -0
  58. data/spec/trailblazer/finder/adapters/will_paginate_spec.rb +71 -0
  59. data/spec/trailblazer/finder/adapters_spec.rb +110 -0
  60. data/spec/trailblazer/finder/base_spec.rb +329 -0
  61. data/spec/trailblazer/finder/features/paging_spec.rb +104 -0
  62. data/spec/trailblazer/finder/features/sorting_spec.rb +100 -0
  63. data/spec/trailblazer/finder/features_spec.rb +55 -0
  64. data/spec/trailblazer/finder/filter_spec.rb +133 -0
  65. data/spec/trailblazer/finder/find_spec.rb +72 -0
  66. data/spec/trailblazer/finder/utils/extra_spec.rb +41 -0
  67. data/spec/trailblazer/finder/utils/params_spec.rb +39 -0
  68. data/spec/trailblazer/finder/utils/parse_spec.rb +33 -0
  69. data/spec/trailblazer/finder/utils/string_spec.rb +25 -0
  70. data/spec/trailblazer/operation/finder_spec.rb +103 -0
  71. data/spec/trailblazer/operation/paging_spec.rb +68 -0
  72. data/spec/trailblazer/operation/sorting_spec.rb +80 -0
  73. data/trailblazer-finder.gemspec +41 -0
  74. metadata +402 -0
metadata ADDED
@@ -0,0 +1,402 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: trailblazer-finder
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Nick Sutterer
8
+ - Marc Tich
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2018-03-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: hashie
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '3.5'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '3.5'
28
+ - !ruby/object:Gem::Dependency
29
+ name: bundler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rake
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: sequel
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: activerecord
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: sqlite3
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: will_paginate
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: kaminari
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: kaminari-activerecord
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ - !ruby/object:Gem::Dependency
141
+ name: rspec
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - "~>"
145
+ - !ruby/object:Gem::Version
146
+ version: '3.5'
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: '3.5'
154
+ - !ruby/object:Gem::Dependency
155
+ name: rspec-mocks
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - "~>"
159
+ - !ruby/object:Gem::Version
160
+ version: '3.5'
161
+ type: :development
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - "~>"
166
+ - !ruby/object:Gem::Version
167
+ version: '3.5'
168
+ - !ruby/object:Gem::Dependency
169
+ name: rubocop
170
+ requirement: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ type: :development
176
+ prerelease: false
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - ">="
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ - !ruby/object:Gem::Dependency
183
+ name: rubocop-rspec
184
+ requirement: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - ">="
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
189
+ type: :development
190
+ prerelease: false
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - ">="
194
+ - !ruby/object:Gem::Version
195
+ version: '0'
196
+ - !ruby/object:Gem::Dependency
197
+ name: data_mapper
198
+ requirement: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - ">="
201
+ - !ruby/object:Gem::Version
202
+ version: '0'
203
+ type: :development
204
+ prerelease: false
205
+ version_requirements: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - ">="
208
+ - !ruby/object:Gem::Version
209
+ version: '0'
210
+ - !ruby/object:Gem::Dependency
211
+ name: dm-sqlite-adapter
212
+ requirement: !ruby/object:Gem::Requirement
213
+ requirements:
214
+ - - ">="
215
+ - !ruby/object:Gem::Version
216
+ version: '0'
217
+ type: :development
218
+ prerelease: false
219
+ version_requirements: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - ">="
222
+ - !ruby/object:Gem::Version
223
+ version: '0'
224
+ - !ruby/object:Gem::Dependency
225
+ name: simplecov
226
+ requirement: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ version: '0'
231
+ type: :development
232
+ prerelease: false
233
+ version_requirements: !ruby/object:Gem::Requirement
234
+ requirements:
235
+ - - ">="
236
+ - !ruby/object:Gem::Version
237
+ version: '0'
238
+ - !ruby/object:Gem::Dependency
239
+ name: trailblazer
240
+ requirement: !ruby/object:Gem::Requirement
241
+ requirements:
242
+ - - ">="
243
+ - !ruby/object:Gem::Version
244
+ version: 2.1.0.beta4
245
+ type: :development
246
+ prerelease: false
247
+ version_requirements: !ruby/object:Gem::Requirement
248
+ requirements:
249
+ - - ">="
250
+ - !ruby/object:Gem::Version
251
+ version: 2.1.0.beta4
252
+ - !ruby/object:Gem::Dependency
253
+ name: rspec_junit_formatter
254
+ requirement: !ruby/object:Gem::Requirement
255
+ requirements:
256
+ - - ">="
257
+ - !ruby/object:Gem::Version
258
+ version: '0'
259
+ type: :development
260
+ prerelease: false
261
+ version_requirements: !ruby/object:Gem::Requirement
262
+ requirements:
263
+ - - ">="
264
+ - !ruby/object:Gem::Version
265
+ version: '0'
266
+ description: Trailblazer Finder object DSL
267
+ email:
268
+ - apotonick@gmail.com
269
+ - marc@mudsu.com
270
+ executables: []
271
+ extensions: []
272
+ extra_rdoc_files: []
273
+ files:
274
+ - ".gitignore"
275
+ - ".rubocop.yml"
276
+ - ".rubocop_todo.yml"
277
+ - ".travis.yml"
278
+ - Gemfile
279
+ - LICENSE.txt
280
+ - README.md
281
+ - Rakefile
282
+ - lib/trailblazer/finder.rb
283
+ - lib/trailblazer/finder/adapters.rb
284
+ - lib/trailblazer/finder/adapters/active_record.rb
285
+ - lib/trailblazer/finder/adapters/active_record/paging.rb
286
+ - lib/trailblazer/finder/adapters/active_record/sorting.rb
287
+ - lib/trailblazer/finder/adapters/data_mapper.rb
288
+ - lib/trailblazer/finder/adapters/data_mapper/paging.rb
289
+ - lib/trailblazer/finder/adapters/data_mapper/sorting.rb
290
+ - lib/trailblazer/finder/adapters/friendly_id.rb
291
+ - lib/trailblazer/finder/adapters/kaminari.rb
292
+ - lib/trailblazer/finder/adapters/sequel.rb
293
+ - lib/trailblazer/finder/adapters/sequel/paging.rb
294
+ - lib/trailblazer/finder/adapters/sequel/sorting.rb
295
+ - lib/trailblazer/finder/adapters/will_paginate.rb
296
+ - lib/trailblazer/finder/base.rb
297
+ - lib/trailblazer/finder/errors/block_ignored.rb
298
+ - lib/trailblazer/finder/errors/invalid_defined_by_value.rb
299
+ - lib/trailblazer/finder/errors/invalid_number.rb
300
+ - lib/trailblazer/finder/errors/missing_entity_type.rb
301
+ - lib/trailblazer/finder/errors/with_ignored.rb
302
+ - lib/trailblazer/finder/features.rb
303
+ - lib/trailblazer/finder/features/paging.rb
304
+ - lib/trailblazer/finder/features/sorting.rb
305
+ - lib/trailblazer/finder/filter.rb
306
+ - lib/trailblazer/finder/find.rb
307
+ - lib/trailblazer/finder/utils/extra.rb
308
+ - lib/trailblazer/finder/utils/params.rb
309
+ - lib/trailblazer/finder/utils/parse.rb
310
+ - lib/trailblazer/finder/utils/string.rb
311
+ - lib/trailblazer/finder/version.rb
312
+ - lib/trailblazer/operation/finder.rb
313
+ - spec/spec_helper.rb
314
+ - spec/spec_helper_active_record.rb
315
+ - spec/spec_helper_data_mapper.rb
316
+ - spec/spec_helper_sequel.rb
317
+ - spec/support/paging_shared_example.rb
318
+ - spec/support/sorting_shared_example.rb
319
+ - spec/trailblazer/finder/adapters/active_record/base_spec.rb
320
+ - spec/trailblazer/finder/adapters/active_record/paging_spec.rb
321
+ - spec/trailblazer/finder/adapters/active_record/sorting_spec.rb
322
+ - spec/trailblazer/finder/adapters/data_mapper/base_spec.rb
323
+ - spec/trailblazer/finder/adapters/data_mapper/paging_spec.rb
324
+ - spec/trailblazer/finder/adapters/data_mapper/sorting_spec.rb
325
+ - spec/trailblazer/finder/adapters/friendly_id_spec.rb
326
+ - spec/trailblazer/finder/adapters/kaminari_spec.rb
327
+ - spec/trailblazer/finder/adapters/sequel/base_spec.rb
328
+ - spec/trailblazer/finder/adapters/sequel/paging_spec.rb
329
+ - spec/trailblazer/finder/adapters/sequel/sorting_spec.rb
330
+ - spec/trailblazer/finder/adapters/will_paginate_spec.rb
331
+ - spec/trailblazer/finder/adapters_spec.rb
332
+ - spec/trailblazer/finder/base_spec.rb
333
+ - spec/trailblazer/finder/features/paging_spec.rb
334
+ - spec/trailblazer/finder/features/sorting_spec.rb
335
+ - spec/trailblazer/finder/features_spec.rb
336
+ - spec/trailblazer/finder/filter_spec.rb
337
+ - spec/trailblazer/finder/find_spec.rb
338
+ - spec/trailblazer/finder/utils/extra_spec.rb
339
+ - spec/trailblazer/finder/utils/params_spec.rb
340
+ - spec/trailblazer/finder/utils/parse_spec.rb
341
+ - spec/trailblazer/finder/utils/string_spec.rb
342
+ - spec/trailblazer/operation/finder_spec.rb
343
+ - spec/trailblazer/operation/paging_spec.rb
344
+ - spec/trailblazer/operation/sorting_spec.rb
345
+ - trailblazer-finder.gemspec
346
+ homepage: http://trailblazer.to
347
+ licenses:
348
+ - MIT
349
+ metadata: {}
350
+ post_install_message:
351
+ rdoc_options: []
352
+ require_paths:
353
+ - lib
354
+ required_ruby_version: !ruby/object:Gem::Requirement
355
+ requirements:
356
+ - - ">="
357
+ - !ruby/object:Gem::Version
358
+ version: 2.1.0
359
+ required_rubygems_version: !ruby/object:Gem::Requirement
360
+ requirements:
361
+ - - ">="
362
+ - !ruby/object:Gem::Version
363
+ version: '0'
364
+ requirements: []
365
+ rubyforge_project:
366
+ rubygems_version: 2.6.13
367
+ signing_key:
368
+ specification_version: 4
369
+ summary: Provides DSL for creating trailblazer based finder objects
370
+ test_files:
371
+ - spec/spec_helper.rb
372
+ - spec/spec_helper_active_record.rb
373
+ - spec/spec_helper_data_mapper.rb
374
+ - spec/spec_helper_sequel.rb
375
+ - spec/support/paging_shared_example.rb
376
+ - spec/support/sorting_shared_example.rb
377
+ - spec/trailblazer/finder/adapters/active_record/base_spec.rb
378
+ - spec/trailblazer/finder/adapters/active_record/paging_spec.rb
379
+ - spec/trailblazer/finder/adapters/active_record/sorting_spec.rb
380
+ - spec/trailblazer/finder/adapters/data_mapper/base_spec.rb
381
+ - spec/trailblazer/finder/adapters/data_mapper/paging_spec.rb
382
+ - spec/trailblazer/finder/adapters/data_mapper/sorting_spec.rb
383
+ - spec/trailblazer/finder/adapters/friendly_id_spec.rb
384
+ - spec/trailblazer/finder/adapters/kaminari_spec.rb
385
+ - spec/trailblazer/finder/adapters/sequel/base_spec.rb
386
+ - spec/trailblazer/finder/adapters/sequel/paging_spec.rb
387
+ - spec/trailblazer/finder/adapters/sequel/sorting_spec.rb
388
+ - spec/trailblazer/finder/adapters/will_paginate_spec.rb
389
+ - spec/trailblazer/finder/adapters_spec.rb
390
+ - spec/trailblazer/finder/base_spec.rb
391
+ - spec/trailblazer/finder/features/paging_spec.rb
392
+ - spec/trailblazer/finder/features/sorting_spec.rb
393
+ - spec/trailblazer/finder/features_spec.rb
394
+ - spec/trailblazer/finder/filter_spec.rb
395
+ - spec/trailblazer/finder/find_spec.rb
396
+ - spec/trailblazer/finder/utils/extra_spec.rb
397
+ - spec/trailblazer/finder/utils/params_spec.rb
398
+ - spec/trailblazer/finder/utils/parse_spec.rb
399
+ - spec/trailblazer/finder/utils/string_spec.rb
400
+ - spec/trailblazer/operation/finder_spec.rb
401
+ - spec/trailblazer/operation/paging_spec.rb
402
+ - spec/trailblazer/operation/sorting_spec.rb