vayacondios-server 0.2.11 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. data/.gitignore +3 -1
  2. data/.travis.yml +2 -0
  3. data/Gemfile +15 -9
  4. data/LICENSE.md +2 -6
  5. data/Procfile +1 -1
  6. data/README.md +656 -111
  7. data/Rakefile +89 -6
  8. data/bin/vcd +10 -0
  9. data/bin/vcd-server +8 -0
  10. data/config/database.yml +6 -0
  11. data/config/spec.example.yml +18 -0
  12. data/config/vayacondios.example.yml +15 -0
  13. data/config/vcd-server.rb +37 -0
  14. data/examples/configuration.rb +56 -0
  15. data/examples/event_stream.rb +19 -0
  16. data/examples/simple.rb +61 -0
  17. data/features/event.feature +319 -0
  18. data/features/events.feature +208 -0
  19. data/features/stash.feature +840 -0
  20. data/features/stashes.feature +492 -0
  21. data/features/step_definitions/stash_steps.rb +113 -0
  22. data/features/stream.feature +30 -0
  23. data/features/support/em.rb +14 -0
  24. data/features/support/env.rb +13 -0
  25. data/lib/vayacondios/configuration.rb +63 -0
  26. data/lib/vayacondios/server/api.rb +126 -0
  27. data/lib/vayacondios/server/api_options.rb +56 -0
  28. data/lib/vayacondios/server/configuration.rb +23 -0
  29. data/lib/vayacondios/server/driver.rb +71 -0
  30. data/lib/vayacondios/server/drivers/mongo.rb +126 -0
  31. data/lib/vayacondios/server/handlers/document_handler.rb +81 -0
  32. data/lib/vayacondios/server/handlers/event_handler.rb +31 -26
  33. data/lib/vayacondios/server/handlers/events_handler.rb +31 -0
  34. data/lib/vayacondios/server/handlers/stash_handler.rb +69 -0
  35. data/lib/vayacondios/server/handlers/stashes_handler.rb +49 -0
  36. data/lib/vayacondios/server/handlers/stream_handler.rb +39 -0
  37. data/lib/vayacondios/server/models/document.rb +87 -0
  38. data/lib/vayacondios/server/models/event.rb +198 -0
  39. data/lib/vayacondios/server/models/stash.rb +100 -0
  40. data/lib/vayacondios/server.rb +35 -0
  41. data/lib/vayacondios-server.rb +19 -13
  42. data/lib/vayacondios.rb +22 -0
  43. data/pom.xml +124 -4
  44. data/spec/configuration_spec.rb +41 -0
  45. data/spec/server/api_options_spec.rb +32 -0
  46. data/spec/server/api_spec.rb +279 -0
  47. data/spec/server/configuration_spec.rb +27 -0
  48. data/spec/server/drivers/mongo_spec.rb +107 -0
  49. data/spec/server/handlers/event_handler_spec.rb +62 -0
  50. data/spec/server/handlers/events_handler_spec.rb +51 -0
  51. data/spec/server/handlers/stash_handler_spec.rb +68 -0
  52. data/spec/server/handlers/stashes_handler_spec.rb +50 -0
  53. data/spec/server/handlers/stream_handler_spec.rb +5 -0
  54. data/spec/server/models/document_spec.rb +9 -0
  55. data/spec/server/models/event_spec.rb +185 -0
  56. data/spec/server/models/stash_spec.rb +95 -0
  57. data/spec/spec_helper.rb +23 -3
  58. data/spec/support/database_helper.rb +42 -0
  59. data/spec/support/log_helper.rb +19 -0
  60. data/spec/support/shared_context_for_events.rb +22 -0
  61. data/spec/support/shared_context_for_stashes.rb +24 -0
  62. data/spec/support/shared_examples_for_handlers.rb +32 -0
  63. data/src/main/java/com/infochimps/vayacondios/BaseClient.java +342 -0
  64. data/src/main/java/com/infochimps/vayacondios/HTTPClient.java +426 -0
  65. data/src/main/java/com/infochimps/vayacondios/VayacondiosClient.java +487 -65
  66. data/src/main/java/com/infochimps/vayacondios/test/IntegrationTest.java +3 -0
  67. data/src/test/java/com/infochimps/vayacondios/BaseClientTest.java +50 -0
  68. data/src/test/java/com/infochimps/vayacondios/HTTPClientIT.java +267 -0
  69. data/vayacondios-server.gemspec +9 -9
  70. metadata +127 -122
  71. checksums.yaml +0 -15
  72. data/.rspec +0 -2
  73. data/.yardopts +0 -10
  74. data/Guardfile +0 -41
  75. data/app/http_shim.rb +0 -71
  76. data/bin/vcd.sh +0 -27
  77. data/config/http_shim.rb +0 -43
  78. data/config/vayacondios.example.yaml +0 -7
  79. data/config/vayacondios.yaml +0 -7
  80. data/examples/java/ItemSetTest.java +0 -76
  81. data/lib/tasks/publish.rake +0 -23
  82. data/lib/tasks/spec.rake +0 -11
  83. data/lib/tasks/yard.rake +0 -2
  84. data/lib/vayacondios/client/config.rb +0 -7
  85. data/lib/vayacondios/client/configliere.rb +0 -38
  86. data/lib/vayacondios/client/cube_client.rb +0 -39
  87. data/lib/vayacondios/client/http_client.rb +0 -49
  88. data/lib/vayacondios/client/itemset.rb +0 -130
  89. data/lib/vayacondios/client/legacy_switch.rb +0 -43
  90. data/lib/vayacondios/client/notifier.rb +0 -123
  91. data/lib/vayacondios/client/zabbix_client.rb +0 -148
  92. data/lib/vayacondios/legacy_switch.rb +0 -43
  93. data/lib/vayacondios/server/errors/bad_request.rb +0 -6
  94. data/lib/vayacondios/server/errors/not_found.rb +0 -6
  95. data/lib/vayacondios/server/handlers/config_handler.rb +0 -32
  96. data/lib/vayacondios/server/handlers/itemset_handler.rb +0 -60
  97. data/lib/vayacondios/server/legacy_switch.rb +0 -43
  98. data/lib/vayacondios/server/model/config_document.rb +0 -89
  99. data/lib/vayacondios/server/model/document.rb +0 -25
  100. data/lib/vayacondios/server/model/event_document.rb +0 -94
  101. data/lib/vayacondios/server/model/itemset_document.rb +0 -126
  102. data/lib/vayacondios/server/rack/extract_methods.rb +0 -35
  103. data/lib/vayacondios/server/rack/jsonize.rb +0 -43
  104. data/lib/vayacondios/server/rack/params.rb +0 -50
  105. data/lib/vayacondios/server/rack/path.rb +0 -23
  106. data/lib/vayacondios/server/rack/path_validation.rb +0 -22
  107. data/lib/vayacondios/version.rb +0 -3
  108. data/lib/vayacondios-client.rb +0 -22
  109. data/scripts/hadoop_monitor/configurable.rb +0 -66
  110. data/scripts/hadoop_monitor/hadoop_attempt_scraper.rb +0 -45
  111. data/scripts/hadoop_monitor/hadoop_client.rb +0 -273
  112. data/scripts/hadoop_monitor/hadoop_monitor.rb +0 -101
  113. data/scripts/hadoop_monitor/hadoopable.rb +0 -65
  114. data/scripts/hadoop_monitor/machine_monitor.rb +0 -115
  115. data/scripts/s3_cataloger/buckets +0 -33
  116. data/scripts/s3_cataloger/foreach_bucket +0 -88
  117. data/scripts/s3_cataloger/parse_ls.py +0 -391
  118. data/spec/client/itemset_legacy_spec.rb +0 -55
  119. data/spec/client/itemset_spec.rb +0 -60
  120. data/spec/client/notifier_spec.rb +0 -120
  121. data/spec/server/config_spec.rb +0 -113
  122. data/spec/server/event_spec.rb +0 -103
  123. data/spec/server/itemset_legacy_spec.rb +0 -320
  124. data/spec/server/itemset_spec.rb +0 -317
  125. data/spec/server/rack/extract_methods_spec.rb +0 -60
  126. data/spec/server/rack/path_spec.rb +0 -36
  127. data/spec/server/rack/path_validation_spec.rb +0 -22
  128. data/spec/server/server_spec.rb +0 -20
  129. data/spec/support/mongo_cleaner.rb +0 -32
  130. data/src/main/java/ItemSetTest.java +0 -76
  131. data/src/main/java/com/infochimps/util/CurrentClass.java +0 -26
  132. data/src/main/java/com/infochimps/util/DebugUtil.java +0 -38
  133. data/src/main/java/com/infochimps/util/HttpHelper.java +0 -181
  134. data/src/main/java/com/infochimps/vayacondios/ItemSets.java +0 -373
  135. data/src/main/java/com/infochimps/vayacondios/LinkToVCD.java +0 -18
  136. data/src/main/java/com/infochimps/vayacondios/MemoryVCDShim.java +0 -84
  137. data/src/main/java/com/infochimps/vayacondios/Organization.java +0 -62
  138. data/src/main/java/com/infochimps/vayacondios/PathBuilder.java +0 -13
  139. data/src/main/java/com/infochimps/vayacondios/StandardVCDLink.java +0 -218
  140. data/src/main/java/com/infochimps/vayacondios/VCDIntegrationTest.java +0 -108
  141. data/src/test/java/com/infochimps/vayacondios/TestVayacondiosInMemory.java +0 -78
  142. data/vayacondios-client.gemspec +0 -25
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vayacondios-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.3.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Philip (flip) Kromer
@@ -11,11 +12,12 @@ authors:
11
12
  autorequire:
12
13
  bindir: bin
13
14
  cert_chain: []
14
- date: 2013-08-08 00:00:00.000000000 Z
15
+ date: 2014-02-18 00:00:00.000000000 Z
15
16
  dependencies:
16
17
  - !ruby/object:Gem::Dependency
17
18
  name: configliere
18
19
  requirement: !ruby/object:Gem::Requirement
20
+ none: false
19
21
  requirements:
20
22
  - - ! '>='
21
23
  - !ruby/object:Gem::Version
@@ -23,6 +25,7 @@ dependencies:
23
25
  type: :runtime
24
26
  prerelease: false
25
27
  version_requirements: !ruby/object:Gem::Requirement
28
+ none: false
26
29
  requirements:
27
30
  - - ! '>='
28
31
  - !ruby/object:Gem::Version
@@ -30,6 +33,7 @@ dependencies:
30
33
  - !ruby/object:Gem::Dependency
31
34
  name: gorillib
32
35
  requirement: !ruby/object:Gem::Requirement
36
+ none: false
33
37
  requirements:
34
38
  - - ! '>='
35
39
  - !ruby/object:Gem::Version
@@ -37,6 +41,7 @@ dependencies:
37
41
  type: :runtime
38
42
  prerelease: false
39
43
  version_requirements: !ruby/object:Gem::Requirement
44
+ none: false
40
45
  requirements:
41
46
  - - ! '>='
42
47
  - !ruby/object:Gem::Version
@@ -44,6 +49,7 @@ dependencies:
44
49
  - !ruby/object:Gem::Dependency
45
50
  name: multi_json
46
51
  requirement: !ruby/object:Gem::Requirement
52
+ none: false
47
53
  requirements:
48
54
  - - ! '>='
49
55
  - !ruby/object:Gem::Version
@@ -51,27 +57,31 @@ dependencies:
51
57
  type: :runtime
52
58
  prerelease: false
53
59
  version_requirements: !ruby/object:Gem::Requirement
60
+ none: false
54
61
  requirements:
55
62
  - - ! '>='
56
63
  - !ruby/object:Gem::Version
57
64
  version: 1.3.6
58
65
  - !ruby/object:Gem::Dependency
59
- name: eventmachine
66
+ name: goliath-chimp
60
67
  requirement: !ruby/object:Gem::Requirement
68
+ none: false
61
69
  requirements:
62
- - - ~>
70
+ - - ! '>='
63
71
  - !ruby/object:Gem::Version
64
- version: 1.0.0.beta.4
72
+ version: 0.0.2
65
73
  type: :runtime
66
74
  prerelease: false
67
75
  version_requirements: !ruby/object:Gem::Requirement
76
+ none: false
68
77
  requirements:
69
- - - ~>
78
+ - - ! '>='
70
79
  - !ruby/object:Gem::Version
71
- version: 1.0.0.beta.4
80
+ version: 0.0.2
72
81
  - !ruby/object:Gem::Dependency
73
- name: goliath
82
+ name: eventmachine
74
83
  requirement: !ruby/object:Gem::Requirement
84
+ none: false
75
85
  requirements:
76
86
  - - ~>
77
87
  - !ruby/object:Gem::Version
@@ -79,13 +89,15 @@ dependencies:
79
89
  type: :runtime
80
90
  prerelease: false
81
91
  version_requirements: !ruby/object:Gem::Requirement
92
+ none: false
82
93
  requirements:
83
94
  - - ~>
84
95
  - !ruby/object:Gem::Version
85
96
  version: '1.0'
86
97
  - !ruby/object:Gem::Dependency
87
- name: em-http-request
98
+ name: goliath
88
99
  requirement: !ruby/object:Gem::Requirement
100
+ none: false
89
101
  requirements:
90
102
  - - ~>
91
103
  - !ruby/object:Gem::Version
@@ -93,193 +105,186 @@ dependencies:
93
105
  type: :runtime
94
106
  prerelease: false
95
107
  version_requirements: !ruby/object:Gem::Requirement
108
+ none: false
96
109
  requirements:
97
110
  - - ~>
98
111
  - !ruby/object:Gem::Version
99
112
  version: '1.0'
100
113
  - !ruby/object:Gem::Dependency
101
- name: em-mongo
114
+ name: em-http-request
102
115
  requirement: !ruby/object:Gem::Requirement
116
+ none: false
103
117
  requirements:
104
118
  - - ~>
105
119
  - !ruby/object:Gem::Version
106
- version: 0.4.3
120
+ version: '1.0'
107
121
  type: :runtime
108
122
  prerelease: false
109
123
  version_requirements: !ruby/object:Gem::Requirement
124
+ none: false
110
125
  requirements:
111
126
  - - ~>
112
127
  - !ruby/object:Gem::Version
113
- version: 0.4.3
128
+ version: '1.0'
114
129
  - !ruby/object:Gem::Dependency
115
- name: foreman
130
+ name: em-mongo
116
131
  requirement: !ruby/object:Gem::Requirement
132
+ none: false
117
133
  requirements:
118
- - - ! '>='
134
+ - - ~>
119
135
  - !ruby/object:Gem::Version
120
- version: '0'
136
+ version: 0.4.3
121
137
  type: :runtime
122
138
  prerelease: false
123
139
  version_requirements: !ruby/object:Gem::Requirement
140
+ none: false
124
141
  requirements:
125
- - - ! '>='
126
- - !ruby/object:Gem::Version
127
- version: '0'
128
- - !ruby/object:Gem::Dependency
129
- name: rake
130
- requirement: !ruby/object:Gem::Requirement
131
- requirements:
132
- - - ! '>='
133
- - !ruby/object:Gem::Version
134
- version: '0'
135
- type: :development
136
- prerelease: false
137
- version_requirements: !ruby/object:Gem::Requirement
138
- requirements:
139
- - - ! '>='
142
+ - - ~>
140
143
  - !ruby/object:Gem::Version
141
- version: '0'
144
+ version: 0.4.3
142
145
  - !ruby/object:Gem::Dependency
143
- name: mongo
146
+ name: bson_ext
144
147
  requirement: !ruby/object:Gem::Requirement
148
+ none: false
145
149
  requirements:
146
150
  - - ! '>='
147
151
  - !ruby/object:Gem::Version
148
152
  version: '0'
149
- type: :development
153
+ type: :runtime
150
154
  prerelease: false
151
155
  version_requirements: !ruby/object:Gem::Requirement
156
+ none: false
152
157
  requirements:
153
158
  - - ! '>='
154
159
  - !ruby/object:Gem::Version
155
160
  version: '0'
156
161
  description: Simple enough to use in a shell script, performant enough to use everywhere.
157
162
  Dios mío! Record that metric, ese!
158
- email:
159
- executables: []
163
+ email: coders@infochimps.com
164
+ executables:
165
+ - vcd-server
160
166
  extensions: []
161
167
  extra_rdoc_files: []
162
168
  files:
163
169
  - .gitignore
164
- - .rspec
165
170
  - .travis.yml
166
- - .yardopts
167
171
  - CHANGELOG.md
168
172
  - Gemfile
169
- - Guardfile
170
173
  - LICENSE.md
171
174
  - Procfile
172
175
  - README.md
173
176
  - Rakefile
174
- - app/http_shim.rb
175
- - bin/vcd.sh
176
- - config/http_shim.rb
177
- - config/vayacondios.example.yaml
178
- - config/vayacondios.yaml
179
- - examples/java/ItemSetTest.java
180
- - lib/tasks/publish.rake
181
- - lib/tasks/spec.rake
182
- - lib/tasks/yard.rake
183
- - lib/vayacondios-client.rb
177
+ - bin/vcd
178
+ - bin/vcd-server
179
+ - config/database.yml
180
+ - config/spec.example.yml
181
+ - config/vayacondios.example.yml
182
+ - config/vcd-server.rb
183
+ - examples/configuration.rb
184
+ - examples/event_stream.rb
185
+ - examples/simple.rb
186
+ - features/event.feature
187
+ - features/events.feature
188
+ - features/stash.feature
189
+ - features/stashes.feature
190
+ - features/step_definitions/stash_steps.rb
191
+ - features/stream.feature
192
+ - features/support/em.rb
193
+ - features/support/env.rb
184
194
  - lib/vayacondios-server.rb
185
- - lib/vayacondios/client/config.rb
186
- - lib/vayacondios/client/configliere.rb
187
- - lib/vayacondios/client/cube_client.rb
188
- - lib/vayacondios/client/http_client.rb
189
- - lib/vayacondios/client/itemset.rb
190
- - lib/vayacondios/client/legacy_switch.rb
191
- - lib/vayacondios/client/notifier.rb
192
- - lib/vayacondios/client/zabbix_client.rb
193
- - lib/vayacondios/legacy_switch.rb
194
- - lib/vayacondios/server/errors/bad_request.rb
195
- - lib/vayacondios/server/errors/not_found.rb
196
- - lib/vayacondios/server/handlers/config_handler.rb
195
+ - lib/vayacondios.rb
196
+ - lib/vayacondios/configuration.rb
197
+ - lib/vayacondios/server.rb
198
+ - lib/vayacondios/server/api.rb
199
+ - lib/vayacondios/server/api_options.rb
200
+ - lib/vayacondios/server/configuration.rb
201
+ - lib/vayacondios/server/driver.rb
202
+ - lib/vayacondios/server/drivers/mongo.rb
203
+ - lib/vayacondios/server/handlers/document_handler.rb
197
204
  - lib/vayacondios/server/handlers/event_handler.rb
198
- - lib/vayacondios/server/handlers/itemset_handler.rb
199
- - lib/vayacondios/server/legacy_switch.rb
200
- - lib/vayacondios/server/model/config_document.rb
201
- - lib/vayacondios/server/model/document.rb
202
- - lib/vayacondios/server/model/event_document.rb
203
- - lib/vayacondios/server/model/itemset_document.rb
204
- - lib/vayacondios/server/rack/extract_methods.rb
205
- - lib/vayacondios/server/rack/jsonize.rb
206
- - lib/vayacondios/server/rack/params.rb
207
- - lib/vayacondios/server/rack/path.rb
208
- - lib/vayacondios/server/rack/path_validation.rb
209
- - lib/vayacondios/version.rb
205
+ - lib/vayacondios/server/handlers/events_handler.rb
206
+ - lib/vayacondios/server/handlers/stash_handler.rb
207
+ - lib/vayacondios/server/handlers/stashes_handler.rb
208
+ - lib/vayacondios/server/handlers/stream_handler.rb
209
+ - lib/vayacondios/server/models/document.rb
210
+ - lib/vayacondios/server/models/event.rb
211
+ - lib/vayacondios/server/models/stash.rb
210
212
  - pom.xml
211
- - scripts/hadoop_monitor/configurable.rb
212
- - scripts/hadoop_monitor/hadoop_attempt_scraper.rb
213
- - scripts/hadoop_monitor/hadoop_client.rb
214
- - scripts/hadoop_monitor/hadoop_monitor.rb
215
- - scripts/hadoop_monitor/hadoopable.rb
216
- - scripts/hadoop_monitor/machine_monitor.rb
217
- - scripts/s3_cataloger/buckets
218
- - scripts/s3_cataloger/foreach_bucket
219
- - scripts/s3_cataloger/parse_ls.py
220
- - spec/client/itemset_legacy_spec.rb
221
- - spec/client/itemset_spec.rb
222
- - spec/client/notifier_spec.rb
223
- - spec/server/config_spec.rb
224
- - spec/server/event_spec.rb
225
- - spec/server/itemset_legacy_spec.rb
226
- - spec/server/itemset_spec.rb
227
- - spec/server/rack/extract_methods_spec.rb
228
- - spec/server/rack/path_spec.rb
229
- - spec/server/rack/path_validation_spec.rb
230
- - spec/server/server_spec.rb
213
+ - spec/configuration_spec.rb
214
+ - spec/server/api_options_spec.rb
215
+ - spec/server/api_spec.rb
216
+ - spec/server/configuration_spec.rb
217
+ - spec/server/drivers/mongo_spec.rb
218
+ - spec/server/handlers/event_handler_spec.rb
219
+ - spec/server/handlers/events_handler_spec.rb
220
+ - spec/server/handlers/stash_handler_spec.rb
221
+ - spec/server/handlers/stashes_handler_spec.rb
222
+ - spec/server/handlers/stream_handler_spec.rb
223
+ - spec/server/models/document_spec.rb
224
+ - spec/server/models/event_spec.rb
225
+ - spec/server/models/stash_spec.rb
231
226
  - spec/spec_helper.rb
232
- - spec/support/mongo_cleaner.rb
233
- - src/main/java/ItemSetTest.java
234
- - src/main/java/com/infochimps/util/CurrentClass.java
235
- - src/main/java/com/infochimps/util/DebugUtil.java
236
- - src/main/java/com/infochimps/util/HttpHelper.java
237
- - src/main/java/com/infochimps/vayacondios/ItemSets.java
238
- - src/main/java/com/infochimps/vayacondios/LinkToVCD.java
239
- - src/main/java/com/infochimps/vayacondios/MemoryVCDShim.java
240
- - src/main/java/com/infochimps/vayacondios/Organization.java
241
- - src/main/java/com/infochimps/vayacondios/PathBuilder.java
242
- - src/main/java/com/infochimps/vayacondios/StandardVCDLink.java
243
- - src/main/java/com/infochimps/vayacondios/VCDIntegrationTest.java
227
+ - spec/support/database_helper.rb
228
+ - spec/support/log_helper.rb
229
+ - spec/support/shared_context_for_events.rb
230
+ - spec/support/shared_context_for_stashes.rb
231
+ - spec/support/shared_examples_for_handlers.rb
232
+ - src/main/java/com/infochimps/vayacondios/BaseClient.java
233
+ - src/main/java/com/infochimps/vayacondios/HTTPClient.java
244
234
  - src/main/java/com/infochimps/vayacondios/VayacondiosClient.java
245
- - src/test/java/com/infochimps/vayacondios/TestVayacondiosInMemory.java
246
- - vayacondios-client.gemspec
235
+ - src/main/java/com/infochimps/vayacondios/test/IntegrationTest.java
236
+ - src/test/java/com/infochimps/vayacondios/BaseClientTest.java
237
+ - src/test/java/com/infochimps/vayacondios/HTTPClientIT.java
247
238
  - vayacondios-server.gemspec
248
239
  homepage: https://github.com/infochimps-labs/vayacondios
249
- licenses: []
250
- metadata: {}
240
+ licenses:
241
+ - Apache 2.0
251
242
  post_install_message:
252
243
  rdoc_options: []
253
244
  require_paths:
254
245
  - lib
255
246
  required_ruby_version: !ruby/object:Gem::Requirement
247
+ none: false
256
248
  requirements:
257
249
  - - ! '>='
258
250
  - !ruby/object:Gem::Version
259
251
  version: '0'
252
+ segments:
253
+ - 0
254
+ hash: 218667830925451175
260
255
  required_rubygems_version: !ruby/object:Gem::Requirement
256
+ none: false
261
257
  requirements:
262
258
  - - ! '>='
263
259
  - !ruby/object:Gem::Version
264
260
  version: '0'
261
+ segments:
262
+ - 0
263
+ hash: 218667830925451175
265
264
  requirements: []
266
265
  rubyforge_project:
267
- rubygems_version: 2.0.5
266
+ rubygems_version: 1.8.23
268
267
  signing_key:
269
- specification_version: 4
268
+ specification_version: 3
270
269
  summary: Data goes in. The right thing happens
271
270
  test_files:
272
- - spec/client/itemset_legacy_spec.rb
273
- - spec/client/itemset_spec.rb
274
- - spec/client/notifier_spec.rb
275
- - spec/server/config_spec.rb
276
- - spec/server/event_spec.rb
277
- - spec/server/itemset_legacy_spec.rb
278
- - spec/server/itemset_spec.rb
279
- - spec/server/rack/extract_methods_spec.rb
280
- - spec/server/rack/path_spec.rb
281
- - spec/server/rack/path_validation_spec.rb
282
- - spec/server/server_spec.rb
271
+ - spec/configuration_spec.rb
272
+ - spec/server/api_options_spec.rb
273
+ - spec/server/api_spec.rb
274
+ - spec/server/configuration_spec.rb
275
+ - spec/server/drivers/mongo_spec.rb
276
+ - spec/server/handlers/event_handler_spec.rb
277
+ - spec/server/handlers/events_handler_spec.rb
278
+ - spec/server/handlers/stash_handler_spec.rb
279
+ - spec/server/handlers/stashes_handler_spec.rb
280
+ - spec/server/handlers/stream_handler_spec.rb
281
+ - spec/server/models/document_spec.rb
282
+ - spec/server/models/event_spec.rb
283
+ - spec/server/models/stash_spec.rb
283
284
  - spec/spec_helper.rb
284
- - spec/support/mongo_cleaner.rb
285
+ - spec/support/database_helper.rb
286
+ - spec/support/log_helper.rb
287
+ - spec/support/shared_context_for_events.rb
288
+ - spec/support/shared_context_for_stashes.rb
289
+ - spec/support/shared_examples_for_handlers.rb
285
290
  has_rdoc:
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NzRmOTU2YjY4MjgxNjhkNGYxZTRmNTg2OWQzNjJlODZhMzc1YzJmOQ==
5
- data.tar.gz: !binary |-
6
- YTdhOTVkYmE2MTdjYjJhYjcxOGJmMTYyYTJkOTk1NmExMTlhYmUyYw==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZjRlNjEyMDY4Y2E2NzI0MDc0M2MwMDUzZGYwY2EwZWJiYTQ3ZDViZGEyMTdk
10
- ZjNhMzg1M2NiY2I3MzZhOWY4YWU3ODQ5NDM4YzllNzRlN2Y4ZjNhOWY1YWMz
11
- NTkwNDg2ZjM0MzExODBjYzVlZjhiNGU0YjgyZTYzZDM0Y2E4N2I=
12
- data.tar.gz: !binary |-
13
- NDZlY2I2N2I3YzNkODBlYTEyN2EyOTkxM2YwM2JhNzAzNmQ0ZTkzYjVlNTc0
14
- ZDBlMmJkNGU2ZTE0YjY5NzlhZDEwODJlMGNiNzUxZjZlMWJjMGIwOTFiNTlh
15
- ZTJkOTYyZGMzZmIxZTQ5NmUyN2QwMjZiZjc5NzAwODU1NTExN2I=
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --format documentation
data/.yardopts DELETED
@@ -1,10 +0,0 @@
1
- --readme README.md
2
- --markup markdown
3
- --verbose
4
- -
5
- VERSION
6
- CHANGELOG.md
7
- LICENSE.md
8
- README.md
9
- notes/*.md
10
- features/**/*.feature
data/Guardfile DELETED
@@ -1,41 +0,0 @@
1
- # -*- ruby -*-
2
-
3
- # More info at https://github.com/guard/guard#readme
4
-
5
- # guard 'yard' do
6
- # watch(%r{lib/.+\.rb})
7
- # watch(%r{notes/.+\.(md|txt)}) { "notes" }
8
- # end
9
-
10
- rspec_opts = '--format progress'
11
- # rspec_opts = '--format doc'
12
-
13
- guard 'rspec', :version => 2, :cli => rspec_opts do
14
- watch(%r{^spec/.+_spec\.rb$})
15
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
16
- watch('spec/spec_helper.rb') { "spec" }
17
- watch(/spec\/support\/(.+)\.rb/) { "spec" }
18
- watch(%r{^examples/(\w+)\.rb$}) { |m| "spec/examples/#{m[1]}_spec.rb" }
19
- watch(%r{^examples/(\w+)/(.+)\.rb$}) { |m| "spec/examples/#{m[1]}_spec.rb" }
20
- end
21
-
22
- # # This is an example with all options that you can specify for guard-process
23
- # Dir['examples/**/*.rb'].each do |file|
24
- # next unless File.file?(file) && File.executable?(file)
25
- # guard 'process', :name => file, :command => file do
26
- # watch('Gemfile.lock')
27
- # watch(file)
28
- # watch('examples/examples_helper.rb')
29
- # end
30
- # end
31
-
32
- graph_output_dir = File.expand_path("/tmp/wukong-#{ENV['USER']}/graphs")
33
- FileUtils.mkdir_p(graph_output_dir)
34
-
35
- Dir['examples/**/*.gv'].each do |file|
36
- graph_output_file = File.join(graph_output_dir, File.basename(file, '.gv')+".png")
37
- cmd = "dot -Tpng -o #{graph_output_file} #{file}"
38
- guard 'process', :name => "dot on #{file}", :command => cmd do
39
- watch(file)
40
- end
41
- end
data/app/http_shim.rb DELETED
@@ -1,71 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'gorillib/logger/log'
4
- require 'vayacondios-server'
5
-
6
- class HttpShim < Goliath::API
7
- use Goliath::Rack::Heartbeat # respond to /status with 200, OK (monitoring, etc)
8
- use Vayacondios::Rack::JSONize
9
- use Goliath::Rack::Tracer, 'X-Tracer' # log trace statistics
10
- use Vayacondios::Rack::Params # parse query string and message body into params hash
11
- # use Goliath::Rack::Params # parse query string and message body into params hash
12
- use Goliath::Rack::Validation::RequestMethod, %w[GET PUT PATCH DELETE] # only allow these methods
13
- use Vayacondios::Rack::ExtractMethods # interpolate GET, PUT into :create, :update, etc
14
- use Vayacondios::Rack::Path # parse path into parameterized pieces
15
- use Vayacondios::Rack::PathValidation # validate the existence of env[:vayacondios_path]
16
- use Goliath::Rack::Formatters::JSON # JSON output formatter
17
- use Goliath::Rack::Render # auto-negotiate response format
18
-
19
- # The document part of the request, e.g. - params that came
20
- # directly from its body.
21
- #
22
- # Something somewhere in Rack is unhappy when receiving
23
- # non-Hash-like records via a JSON-formatted request body. So that
24
- # Vayacondios::Rack::Params takes a non-Hash-like request body and
25
- # turns it into a Hash with a single key: _document.
26
- #
27
- # This hack does **not** affect the client-side: clients can still
28
- # send non-Hash-like JSON documents and they will be interpreted
29
- # as intended.
30
- #
31
- # @return [Hash,Array,String,Fixnum,nil] any native JSON datatype
32
- def document
33
- params['_document'] || params
34
- end
35
-
36
- def response(env)
37
- path_params = env[:vayacondios_path]
38
- klass = ('vayacondios/' + path_params[:type] + '_handler').camelize.constantize
39
-
40
- Log.info("received request #{env['REQUEST_METHOD']} #{env['REQUEST_URI']}")
41
- Log.info("params: #{document}")
42
-
43
- begin
44
- case env[:vayacondios_method]
45
-
46
- when :show
47
- record = klass.find(mongo, path_params)
48
- [200, {}, record.body]
49
-
50
- when :update
51
- record = klass.new(mongo).update(document, path_params)
52
- [200, {}, nil]
53
-
54
- when :patch
55
- record = klass.new(mongo).patch(document, path_params)
56
- [200, {}, nil]
57
-
58
- when :delete
59
- record = klass.find(mongo, path_params).destroy(document)
60
- [200, {}, record.body]
61
- end
62
- rescue Vayacondios::Error::NotFound => ex
63
- return [404, {}, { error: "Not Found" }]
64
- rescue Vayacondios::Error::BadRequest => ex
65
- return [400, {}, { error: "Bad Request" }]
66
- rescue StandardError => ex
67
- puts ex
68
- ex.backtrace.each{ |l| puts l }
69
- end
70
- end
71
- end
data/bin/vcd.sh DELETED
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- cmd="${1-help}"
4
-
5
- vcd_server_url='http://localhost:9000'
6
-
7
- case "$cmd" in
8
- help|--help)
9
- echo "commands: "
10
- echo " vcd hola foo/bar '{...json hash...}' -- dispatches the hash to the foo/bar bucket on the vayacondios server"
11
- echo " vcd help -- this text"
12
- echo ""
13
- echo "example: "
14
- echo " $0 hola just/fiddlin '{\"hi\":\"there\"}'"
15
- echo ""
16
- ;;
17
-
18
- hola)
19
- bucket="$2"
20
- facts="$3"
21
- if [ -z "$bucket" ] || [ -z "$facts" ] ; then echo "vcd hola foo/bar '{...json hash...}'" ; echo " got '$bucket' '$fact'" ; exit -1 ; fi
22
-
23
- echo -- curl -H 'Content-Type:application/json' -d "'$facts'" "'$vcd_server_url/$bucket'"
24
- curl -H 'Content-Type:application/json' -d "$facts" "$vcd_server_url/$bucket"
25
- ;;
26
-
27
- esac
data/config/http_shim.rb DELETED
@@ -1,43 +0,0 @@
1
- def ENV.root_path(*args)
2
- File.expand_path(File.join(File.dirname(__FILE__), '..', *args))
3
- end
4
-
5
- require 'configliere'
6
- Settings.define :app_name, :default => 'vayacondios', :description => 'Name to key on for tracer stats, statsd metrics, etc.'
7
- Settings.define 'mongo.host', :default => 'localhost', :description => 'Mongo hostname'
8
- Settings.define 'mongo.port', :default => '27017', :description => 'Mongo port'
9
-
10
- Settings.read(ENV.root_path('config/vayacondios.yaml'))
11
- Settings.resolve!
12
-
13
- config[:server] = {
14
- :nodename => ENV['NODENAME'],
15
- :hostname => `hostname`.chomp,
16
- :program => File.expand_path($0),
17
- :version => `git log | head -n1`.chomp.split[1],
18
- :pid => Process.pid,
19
- }
20
-
21
- environment(:production) do
22
- Settings[:environment] = config[:environment] = 'production'
23
- config['mongo'] = EventMachine::Synchrony::ConnectionPool.new(:size => 20) do
24
- conn = EM::Mongo::Connection.new(Settings[:mongo][:host], Settings[:mongo][:port], 1, {:reconnect_in => 1})
25
- conn.db(Settings[:mongo][:database])
26
- end
27
- end
28
-
29
- environment(:development) do
30
- Settings[:environment] = config[:environment] = 'development'
31
- conn = EM::Mongo::Connection.new(Settings[:mongo][:host],Settings[:mongo][:port], 1, {:reconnect_in => 1})
32
- config['mongo'] = conn.db(Settings[:mongo][:database])
33
- end
34
-
35
- environment(:test) do
36
- Settings[:environment] = config[:environment] = 'test'
37
- conn = EM::Mongo::Connection.new(Settings[:mongo][:host],Settings[:mongo][:port], 1, {:reconnect_in => 1})
38
- config['mongo'] = conn.db(Settings[:mongo][:database])
39
- end
40
-
41
- # def config.inspect
42
- # self.reject{|k, v| /#{DB_NAME}/ =~ k.to_s}.inspect
43
- # end
@@ -1,7 +0,0 @@
1
- mongo:
2
- host: localhost
3
- port: 27017
4
- database: vayacondios_dev
5
-
6
- vayacondios:
7
- legacy: true
@@ -1,7 +0,0 @@
1
- mongo:
2
- host: localhost
3
- port: 27017
4
- database: vayacondios_dev
5
-
6
- vayacondios:
7
- legacy: true