aggrobot 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +8 -8
  2. data/Gemfile +3 -0
  3. data/README.md +11 -1
  4. data/aggrobot.gemspec +10 -2
  5. data/aggrobot_test +0 -0
  6. data/asmemory +0 -0
  7. data/lib/aggrobot.rb +7 -3
  8. data/lib/aggrobot/aggregator.rb +18 -5
  9. data/lib/aggrobot/aggrobot.rb +24 -13
  10. data/lib/aggrobot/errors.rb +6 -0
  11. data/lib/aggrobot/query_planner.rb +8 -19
  12. data/lib/aggrobot/query_planner/agg.rb +28 -0
  13. data/lib/aggrobot/query_planner/bucketed_groups_query_planner.rb +18 -15
  14. data/lib/aggrobot/query_planner/default_query_planner.rb +27 -8
  15. data/lib/aggrobot/query_planner/group_limit_query_planner.rb +30 -10
  16. data/lib/aggrobot/query_planner/parameters_validator.rb +33 -0
  17. data/lib/aggrobot/sql_functions.rb +23 -50
  18. data/lib/aggrobot/sql_functions/common.rb +65 -0
  19. data/lib/aggrobot/sql_functions/mysql.rb +6 -0
  20. data/lib/aggrobot/sql_functions/pgsql.rb +6 -0
  21. data/lib/aggrobot/sql_functions/sqlite.rb +6 -0
  22. data/lib/aggrobot/version.rb +1 -1
  23. data/pbcopy +1 -0
  24. data/spec/factories.rb +0 -0
  25. data/spec/factories/users.rb +4 -0
  26. data/spec/spec_helper.rb +49 -7
  27. data/spec/support/factory_robot/distribution_evaluator.rb +44 -0
  28. data/spec/support/factory_robot/factory_robot.rb +108 -0
  29. data/spec/support/user.rb +2 -0
  30. data/spec/unit/aggrobot/query_planners/bucketed_groups_query_planner_spec.rb +42 -55
  31. data/spec/unit/aggrobot/query_planners/default_query_planner_spec.rb +45 -21
  32. data/spec/unit/aggrobot/query_planners/group_limit_query_planner_spec.rb +69 -70
  33. data/spec/unit/aggrobot/sql_functions_spec.rb +20 -19
  34. metadata +97 -7
metadata CHANGED
@@ -1,29 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aggrobot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shadab Ahmed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-27 00:00:00.000000000 Z
11
+ date: 2014-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activerecord
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '4.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
25
39
  - !ruby/object:Gem::Version
26
40
  version: '4.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: arel
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: bundler
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +66,20 @@ dependencies:
38
66
  - - ~>
39
67
  - !ruby/object:Gem::Version
40
68
  version: '1.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: sqlite3
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
41
83
  - !ruby/object:Gem::Dependency
42
84
  name: rake
43
85
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +122,34 @@ dependencies:
80
122
  - - ! '>='
81
123
  - !ruby/object:Gem::Version
82
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: factory_girl
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: database_cleaner
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ! '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ! '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
83
153
  description: Easy and performant aggregation for rails
84
154
  email:
85
155
  - shadab.ansari@gmail.com
@@ -96,26 +166,41 @@ files:
96
166
  - README.md
97
167
  - Rakefile
98
168
  - aggrobot.gemspec
169
+ - aggrobot_test
170
+ - asmemory
99
171
  - lib/aggrobot.rb
100
172
  - lib/aggrobot/aggregator.rb
101
173
  - lib/aggrobot/aggrobot.rb
102
174
  - lib/aggrobot/aggrobot_error.rb
175
+ - lib/aggrobot/errors.rb
103
176
  - lib/aggrobot/helper.rb
104
177
  - lib/aggrobot/query_planner.rb
178
+ - lib/aggrobot/query_planner/agg.rb
105
179
  - lib/aggrobot/query_planner/bucketed_groups_query_planner.rb
106
180
  - lib/aggrobot/query_planner/default_query_planner.rb
107
181
  - lib/aggrobot/query_planner/group_limit_query_planner.rb
182
+ - lib/aggrobot/query_planner/parameters_validator.rb
108
183
  - lib/aggrobot/railtie.rb
109
184
  - lib/aggrobot/sql_functions.rb
185
+ - lib/aggrobot/sql_functions/common.rb
186
+ - lib/aggrobot/sql_functions/mysql.rb
187
+ - lib/aggrobot/sql_functions/pgsql.rb
188
+ - lib/aggrobot/sql_functions/sqlite.rb
110
189
  - lib/aggrobot/version.rb
190
+ - pbcopy
191
+ - spec/factories.rb
192
+ - spec/factories/users.rb
111
193
  - spec/spec_helper.rb
112
194
  - spec/support/chain_query.rb
195
+ - spec/support/factory_robot/distribution_evaluator.rb
196
+ - spec/support/factory_robot/factory_robot.rb
197
+ - spec/support/user.rb
113
198
  - spec/unit/aggrobot/query_planners/bucketed_groups_query_planner_spec.rb
114
199
  - spec/unit/aggrobot/query_planners/default_query_planner_spec.rb
115
200
  - spec/unit/aggrobot/query_planners/group_limit_query_planner_spec.rb
116
201
  - spec/unit/aggrobot/sql_functions_spec.rb
117
202
  - spec/unit/aggrobot_spec.rb
118
- homepage: ''
203
+ homepage: https://github.com/shadabahmed/aggrobot
119
204
  licenses:
120
205
  - MIT
121
206
  metadata: {}
@@ -127,7 +212,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
127
212
  requirements:
128
213
  - - ! '>='
129
214
  - !ruby/object:Gem::Version
130
- version: '0'
215
+ version: 1.9.3
131
216
  required_rubygems_version: !ruby/object:Gem::Requirement
132
217
  requirements:
133
218
  - - ! '>='
@@ -135,13 +220,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
220
  version: '0'
136
221
  requirements: []
137
222
  rubyforge_project:
138
- rubygems_version: 2.1.4
223
+ rubygems_version: 2.2.2
139
224
  signing_key:
140
225
  specification_version: 4
141
226
  summary: Rails aggregation library
142
227
  test_files:
228
+ - spec/factories.rb
229
+ - spec/factories/users.rb
143
230
  - spec/spec_helper.rb
144
231
  - spec/support/chain_query.rb
232
+ - spec/support/factory_robot/distribution_evaluator.rb
233
+ - spec/support/factory_robot/factory_robot.rb
234
+ - spec/support/user.rb
145
235
  - spec/unit/aggrobot/query_planners/bucketed_groups_query_planner_spec.rb
146
236
  - spec/unit/aggrobot/query_planners/default_query_planner_spec.rb
147
237
  - spec/unit/aggrobot/query_planners/group_limit_query_planner_spec.rb