cequel 0.0.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/lib/cequel.rb +16 -0
  2. data/lib/cequel/batch.rb +58 -0
  3. data/lib/cequel/cql_row_specification.rb +22 -0
  4. data/lib/cequel/data_set.rb +346 -0
  5. data/lib/cequel/errors.rb +4 -0
  6. data/lib/cequel/keyspace.rb +106 -0
  7. data/lib/cequel/model.rb +95 -0
  8. data/lib/cequel/model/associations.rb +120 -0
  9. data/lib/cequel/model/callbacks.rb +32 -0
  10. data/lib/cequel/model/class_internals.rb +48 -0
  11. data/lib/cequel/model/column.rb +20 -0
  12. data/lib/cequel/model/dictionary.rb +202 -0
  13. data/lib/cequel/model/dirty.rb +53 -0
  14. data/lib/cequel/model/dynamic.rb +31 -0
  15. data/lib/cequel/model/errors.rb +13 -0
  16. data/lib/cequel/model/inheritable.rb +48 -0
  17. data/lib/cequel/model/instance_internals.rb +23 -0
  18. data/lib/cequel/model/local_association.rb +42 -0
  19. data/lib/cequel/model/magic.rb +79 -0
  20. data/lib/cequel/model/mass_assignment_security.rb +21 -0
  21. data/lib/cequel/model/naming.rb +17 -0
  22. data/lib/cequel/model/observer.rb +42 -0
  23. data/lib/cequel/model/persistence.rb +173 -0
  24. data/lib/cequel/model/properties.rb +143 -0
  25. data/lib/cequel/model/railtie.rb +33 -0
  26. data/lib/cequel/model/remote_association.rb +40 -0
  27. data/lib/cequel/model/scope.rb +362 -0
  28. data/lib/cequel/model/scoped.rb +50 -0
  29. data/lib/cequel/model/subclass_internals.rb +45 -0
  30. data/lib/cequel/model/timestamps.rb +52 -0
  31. data/lib/cequel/model/translation.rb +17 -0
  32. data/lib/cequel/model/validations.rb +50 -0
  33. data/lib/cequel/new_relic_instrumentation.rb +22 -0
  34. data/lib/cequel/row_specification.rb +63 -0
  35. data/lib/cequel/statement.rb +23 -0
  36. data/lib/cequel/version.rb +3 -0
  37. data/spec/environment.rb +3 -0
  38. data/spec/examples/data_set_spec.rb +382 -0
  39. data/spec/examples/keyspace_spec.rb +63 -0
  40. data/spec/examples/model/associations_spec.rb +109 -0
  41. data/spec/examples/model/callbacks_spec.rb +79 -0
  42. data/spec/examples/model/dictionary_spec.rb +413 -0
  43. data/spec/examples/model/dirty_spec.rb +39 -0
  44. data/spec/examples/model/dynamic_spec.rb +41 -0
  45. data/spec/examples/model/inheritable_spec.rb +45 -0
  46. data/spec/examples/model/magic_spec.rb +199 -0
  47. data/spec/examples/model/mass_assignment_security_spec.rb +13 -0
  48. data/spec/examples/model/naming_spec.rb +9 -0
  49. data/spec/examples/model/observer_spec.rb +86 -0
  50. data/spec/examples/model/persistence_spec.rb +201 -0
  51. data/spec/examples/model/properties_spec.rb +81 -0
  52. data/spec/examples/model/scope_spec.rb +677 -0
  53. data/spec/examples/model/serialization_spec.rb +20 -0
  54. data/spec/examples/model/spec_helper.rb +12 -0
  55. data/spec/examples/model/timestamps_spec.rb +52 -0
  56. data/spec/examples/model/translation_spec.rb +23 -0
  57. data/spec/examples/model/validations_spec.rb +86 -0
  58. data/spec/examples/spec_helper.rb +9 -0
  59. data/spec/models/asset.rb +21 -0
  60. data/spec/models/asset_observer.rb +5 -0
  61. data/spec/models/blog.rb +14 -0
  62. data/spec/models/blog_posts.rb +6 -0
  63. data/spec/models/category.rb +9 -0
  64. data/spec/models/comment.rb +12 -0
  65. data/spec/models/photo.rb +5 -0
  66. data/spec/models/post.rb +88 -0
  67. data/spec/models/post_comments.rb +14 -0
  68. data/spec/models/post_observer.rb +43 -0
  69. data/spec/support/helpers.rb +26 -0
  70. data/spec/support/result_stub.rb +27 -0
  71. metadata +125 -23
@@ -0,0 +1,27 @@
1
+ module Cequel
2
+
3
+ module SpecSupport
4
+
5
+ RowStub = Struct.new(:to_hash)
6
+
7
+ class ResultStub
8
+
9
+ def initialize(rows)
10
+ @rows = rows
11
+ end
12
+
13
+ def fetch
14
+ while row = fetch_row
15
+ yield RowStub.new(row)
16
+ end
17
+ end
18
+
19
+ def fetch_row
20
+ @rows.shift
21
+ end
22
+
23
+ end
24
+
25
+ end
26
+
27
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,33 +9,33 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-01 00:00:00.000000000Z
12
+ date: 2012-08-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &13466940 !ruby/object:Gem::Requirement
16
+ requirement: &10794380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: '3.0'
21
+ version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *13466940
24
+ version_requirements: *10794380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activemodel
27
- requirement: &13466480 !ruby/object:Gem::Requirement
27
+ requirement: &10793880 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: '3.0'
32
+ version: '3.1'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *13466480
35
+ version_requirements: *10793880
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: cassandra-cql
38
- requirement: &13466020 !ruby/object:Gem::Requirement
38
+ requirement: &10793360 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '1.0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *13466020
46
+ version_requirements: *10793360
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: i18n
49
- requirement: &13465640 !ruby/object:Gem::Requirement
49
+ requirement: &10792940 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *13465640
57
+ version_requirements: *10792940
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rspec
60
- requirement: &13465100 !ruby/object:Gem::Requirement
60
+ requirement: &10792260 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,21 +65,21 @@ dependencies:
65
65
  version: '2.0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *13465100
68
+ version_requirements: *10792260
69
69
  - !ruby/object:Gem::Dependency
70
- name: ruby-debug19
71
- requirement: &13464600 !ruby/object:Gem::Requirement
70
+ name: debugger
71
+ requirement: &10791720 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
- - - ~>
74
+ - - ! '>='
75
75
  - !ruby/object:Gem::Version
76
- version: '0.11'
76
+ version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *13464600
79
+ version_requirements: *10791720
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: yard
82
- requirement: &13464140 !ruby/object:Gem::Requirement
82
+ requirement: &10790940 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,7 +87,18 @@ dependencies:
87
87
  version: '0.6'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *13464140
90
+ version_requirements: *10790940
91
+ - !ruby/object:Gem::Dependency
92
+ name: geminabox
93
+ requirement: &10790260 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ type: :development
100
+ prerelease: false
101
+ version_requirements: *10790260
91
102
  description: ! 'Cequel is a lightweight query abstraction layer for Cassandra''s CQL
92
103
  language. It
93
104
 
@@ -100,7 +111,77 @@ email: mat.a.brown@gmail.com
100
111
  executables: []
101
112
  extensions: []
102
113
  extra_rdoc_files: []
103
- files: []
114
+ files:
115
+ - lib/cequel.rb
116
+ - lib/cequel/cql_row_specification.rb
117
+ - lib/cequel/statement.rb
118
+ - lib/cequel/model/inheritable.rb
119
+ - lib/cequel/model/remote_association.rb
120
+ - lib/cequel/model/naming.rb
121
+ - lib/cequel/model/associations.rb
122
+ - lib/cequel/model/mass_assignment_security.rb
123
+ - lib/cequel/model/dictionary.rb
124
+ - lib/cequel/model/translation.rb
125
+ - lib/cequel/model/subclass_internals.rb
126
+ - lib/cequel/model/magic.rb
127
+ - lib/cequel/model/callbacks.rb
128
+ - lib/cequel/model/dynamic.rb
129
+ - lib/cequel/model/observer.rb
130
+ - lib/cequel/model/column.rb
131
+ - lib/cequel/model/instance_internals.rb
132
+ - lib/cequel/model/validations.rb
133
+ - lib/cequel/model/persistence.rb
134
+ - lib/cequel/model/railtie.rb
135
+ - lib/cequel/model/properties.rb
136
+ - lib/cequel/model/scope.rb
137
+ - lib/cequel/model/scoped.rb
138
+ - lib/cequel/model/timestamps.rb
139
+ - lib/cequel/model/local_association.rb
140
+ - lib/cequel/model/dirty.rb
141
+ - lib/cequel/model/errors.rb
142
+ - lib/cequel/model/class_internals.rb
143
+ - lib/cequel/keyspace.rb
144
+ - lib/cequel/version.rb
145
+ - lib/cequel/data_set.rb
146
+ - lib/cequel/row_specification.rb
147
+ - lib/cequel/new_relic_instrumentation.rb
148
+ - lib/cequel/model.rb
149
+ - lib/cequel/batch.rb
150
+ - lib/cequel/errors.rb
151
+ - spec/environment.rb
152
+ - spec/examples/spec_helper.rb
153
+ - spec/examples/data_set_spec.rb
154
+ - spec/examples/keyspace_spec.rb
155
+ - spec/examples/model/naming_spec.rb
156
+ - spec/examples/model/properties_spec.rb
157
+ - spec/examples/model/observer_spec.rb
158
+ - spec/examples/model/mass_assignment_security_spec.rb
159
+ - spec/examples/model/dynamic_spec.rb
160
+ - spec/examples/model/dirty_spec.rb
161
+ - spec/examples/model/spec_helper.rb
162
+ - spec/examples/model/timestamps_spec.rb
163
+ - spec/examples/model/persistence_spec.rb
164
+ - spec/examples/model/magic_spec.rb
165
+ - spec/examples/model/callbacks_spec.rb
166
+ - spec/examples/model/inheritable_spec.rb
167
+ - spec/examples/model/scope_spec.rb
168
+ - spec/examples/model/dictionary_spec.rb
169
+ - spec/examples/model/serialization_spec.rb
170
+ - spec/examples/model/validations_spec.rb
171
+ - spec/examples/model/associations_spec.rb
172
+ - spec/examples/model/translation_spec.rb
173
+ - spec/models/post_observer.rb
174
+ - spec/models/blog_posts.rb
175
+ - spec/models/blog.rb
176
+ - spec/models/post.rb
177
+ - spec/models/photo.rb
178
+ - spec/models/asset.rb
179
+ - spec/models/post_comments.rb
180
+ - spec/models/comment.rb
181
+ - spec/models/asset_observer.rb
182
+ - spec/models/category.rb
183
+ - spec/support/helpers.rb
184
+ - spec/support/result_stub.rb
104
185
  homepage:
105
186
  licenses:
106
187
  - MIT
@@ -127,5 +208,26 @@ rubygems_version: 1.8.15
127
208
  signing_key:
128
209
  specification_version: 3
129
210
  summary: Query abstraction layer and object-row mapper for Cassandra and CQL
130
- test_files: []
211
+ test_files:
212
+ - spec/examples/spec_helper.rb
213
+ - spec/examples/data_set_spec.rb
214
+ - spec/examples/keyspace_spec.rb
215
+ - spec/examples/model/naming_spec.rb
216
+ - spec/examples/model/properties_spec.rb
217
+ - spec/examples/model/observer_spec.rb
218
+ - spec/examples/model/mass_assignment_security_spec.rb
219
+ - spec/examples/model/dynamic_spec.rb
220
+ - spec/examples/model/dirty_spec.rb
221
+ - spec/examples/model/spec_helper.rb
222
+ - spec/examples/model/timestamps_spec.rb
223
+ - spec/examples/model/persistence_spec.rb
224
+ - spec/examples/model/magic_spec.rb
225
+ - spec/examples/model/callbacks_spec.rb
226
+ - spec/examples/model/inheritable_spec.rb
227
+ - spec/examples/model/scope_spec.rb
228
+ - spec/examples/model/dictionary_spec.rb
229
+ - spec/examples/model/serialization_spec.rb
230
+ - spec/examples/model/validations_spec.rb
231
+ - spec/examples/model/associations_spec.rb
232
+ - spec/examples/model/translation_spec.rb
131
233
  has_rdoc: false