noah 0.0.5-jruby → 0.1-jruby

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/.gemtest +0 -0
  2. data/.gitignore +10 -0
  3. data/LICENSE +201 -0
  4. data/README.md +68 -212
  5. data/Rakefile +65 -41
  6. data/TODO.md +65 -0
  7. data/bin/noah +2 -1
  8. data/bin/noah-watcher.rb +103 -0
  9. data/config.ru +6 -3
  10. data/config/warble.rb +18 -0
  11. data/examples/README.md +116 -0
  12. data/examples/cluster.ru +2 -0
  13. data/examples/custom-watcher.rb +10 -0
  14. data/examples/httpclient-server.rb +7 -0
  15. data/examples/httpclient.rb +12 -0
  16. data/examples/httpclient2.rb +28 -0
  17. data/examples/js/FABridge.js +1452 -0
  18. data/examples/js/WebSocketMain.swf +830 -0
  19. data/examples/js/swfobject.js +851 -0
  20. data/examples/js/web_socket.js +312 -0
  21. data/examples/logger.rb +11 -0
  22. data/examples/reconfiguring-sinatra-watcher.rb +11 -0
  23. data/examples/reconfiguring-sinatra.rb +33 -0
  24. data/examples/simple-post.rb +17 -0
  25. data/examples/websocket.html +24 -0
  26. data/examples/websocket.rb +41 -0
  27. data/lib/noah.rb +6 -8
  28. data/lib/noah/app.rb +20 -268
  29. data/lib/noah/application_routes.rb +70 -0
  30. data/lib/noah/ark.rb +0 -0
  31. data/lib/noah/configuration_routes.rb +81 -0
  32. data/lib/noah/custom_watcher.rb +79 -0
  33. data/lib/noah/ephemeral_routes.rb +47 -0
  34. data/lib/noah/helpers.rb +37 -14
  35. data/lib/noah/host_routes.rb +69 -0
  36. data/lib/noah/models.rb +86 -5
  37. data/lib/noah/models/applications.rb +41 -0
  38. data/lib/noah/models/configurations.rb +49 -0
  39. data/lib/noah/models/ephemerals.rb +54 -0
  40. data/lib/noah/models/hosts.rb +56 -0
  41. data/lib/noah/models/services.rb +54 -0
  42. data/lib/noah/models/watchers.rb +62 -0
  43. data/lib/noah/passthrough.rb +11 -0
  44. data/lib/noah/service_routes.rb +71 -0
  45. data/lib/noah/validations.rb +1 -0
  46. data/lib/noah/validations/watcher_validations.rb +48 -0
  47. data/lib/noah/version.rb +1 -1
  48. data/lib/noah/watcher_routes.rb +45 -0
  49. data/noah.gemspec +25 -17
  50. data/spec/application_spec.rb +30 -30
  51. data/spec/configuration_spec.rb +78 -14
  52. data/spec/ephemeral_spec.rb +59 -0
  53. data/spec/host_spec.rb +21 -21
  54. data/spec/noahapp_application_spec.rb +6 -6
  55. data/spec/noahapp_configuration_spec.rb +5 -5
  56. data/spec/noahapp_ephemeral_spec.rb +115 -0
  57. data/spec/noahapp_host_spec.rb +3 -3
  58. data/spec/noahapp_service_spec.rb +10 -10
  59. data/spec/noahapp_watcher_spec.rb +123 -0
  60. data/spec/service_spec.rb +27 -27
  61. data/spec/spec_helper.rb +13 -22
  62. data/spec/support/db/.keep +0 -0
  63. data/spec/support/test-redis.conf +8 -0
  64. data/spec/watcher_spec.rb +62 -0
  65. data/views/index.haml +21 -15
  66. metadata +189 -146
  67. data/Gemfile.lock +0 -83
  68. data/doc/coverage/index.html +0 -138
  69. data/doc/coverage/jquery-1.3.2.min.js +0 -19
  70. data/doc/coverage/jquery.tablesorter.min.js +0 -15
  71. data/doc/coverage/lib-helpers_rb.html +0 -393
  72. data/doc/coverage/lib-models_rb.html +0 -1449
  73. data/doc/coverage/noah_rb.html +0 -2019
  74. data/doc/coverage/print.css +0 -12
  75. data/doc/coverage/rcov.js +0 -42
  76. data/doc/coverage/screen.css +0 -270
  77. data/lib/noah/applications.rb +0 -46
  78. data/lib/noah/configurations.rb +0 -49
  79. data/lib/noah/hosts.rb +0 -54
  80. data/lib/noah/services.rb +0 -57
  81. data/lib/noah/watchers.rb +0 -18
data/views/index.haml CHANGED
@@ -4,46 +4,52 @@
4
4
 
5
5
  #header
6
6
  %h1 Sample links
7
+ %h2 System Information
8
+ %ul
9
+ %li
10
+ Noah Version: #{locals[:noah_version]}
11
+ %li
12
+ Redis URL: #{locals[:redis_url]}
7
13
  #header
8
14
  %h2 Hosts
9
15
  %ul
10
16
  %li
11
- %a{:href => "/h/"} All registered Hosts
17
+ %a{:href => "h/"} All registered Hosts
12
18
  %li
13
- %a{:href => "/h/localhost"} localhost (this server)
19
+ %a{:href => "h/localhost"} localhost (this server)
14
20
  %li
15
- %a{:href => "/h/localhost/noah"} localhost noah service
21
+ %a{:href => "h/localhost/noah"} localhost noah service
16
22
  #header
17
23
  %h2 Services
18
24
  %ul
19
25
  %li
20
- %a{:href => "/s/"} All registered Services
26
+ %a{:href => "s/"} All registered Services
21
27
  %li
22
- %a{:href => "/s/http"} All hosts providing 'http'
28
+ %a{:href => "s/http"} All hosts providing 'http'
23
29
  %li
24
- %a{:href => "/s/noah/localhost"} localhost noah service
30
+ %a{:href => "s/noah/localhost"} localhost noah service
25
31
  #header
26
32
  %h2 Applications
27
33
  %ul
28
34
  %li
29
- %a{:href => "/a/"} All registered Applications
35
+ %a{:href => "a/"} All registered Applications
30
36
  %li
31
- %a{:href => "/a/noah"} Noah Application entry
37
+ %a{:href => "a/noah"} Noah Application entry
32
38
  %li
33
- %a{:href => "/a/noah/redis"} Noah Redis configuration entry
39
+ %a{:href => "a/noah/redis"} Noah Redis configuration entry
34
40
  #header
35
41
  %h2 Configurations
36
42
  %ul
37
43
  %li
38
- %a{:href => "/c/"} All registered Configurations
44
+ %a{:href => "c/"} All registered Configurations
39
45
  %li
40
- %a{:href => "/c/noah"} Noah Configuration entry
46
+ %a{:href => "c/noah"} Noah Configuration entry
41
47
  %li
42
- %a{:href => "/c/myrailsapp1"} myrailsapp1 Configuration entry
48
+ %a{:href => "c/myrailsapp1"} myrailsapp1 Configuration entry
43
49
  %li
44
- %a{:href => "/c/myrestapp1"} myrestapp1 Configuration entry
50
+ %a{:href => "c/myrestapp1"} myrestapp1 Configuration entry
45
51
  %li
46
- %a{:href => "/c/myrailsapp1/database.yml"} database.yml file for myrailsapp1 (should return the proper content-type)
52
+ %a{:href => "c/myrailsapp1/database.yml"} database.yml file for myrailsapp1 (should return the proper content-type)
47
53
  %li
48
- %a{:href => "/c/myrestapp1/config.json"} config.json file for myrestapp1
54
+ %a{:href => "c/myrestapp1/config.json"} config.json file for myrestapp1
49
55
 
metadata CHANGED
@@ -1,267 +1,306 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noah
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 5
9
- version: 0.0.5
4
+ prerelease:
5
+ version: "0.1"
10
6
  platform: jruby
11
7
  authors:
12
- - lusis
8
+ - John E. Vincent
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2011-02-07 00:00:00 -05:00
13
+ date: 2011-03-14 00:00:00 -04:00
18
14
  default_executable:
19
15
  dependencies:
20
16
  - !ruby/object:Gem::Dependency
21
- name: rake
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
17
+ name: eventmachine
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
23
21
  requirements:
24
22
  - - "="
25
23
  - !ruby/object:Gem::Version
26
- segments:
27
- - 0
28
- - 8
29
- - 7
30
- version: 0.8.7
31
- requirement: *id001
24
+ version: 1.0.0.beta.3
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: em-http-request
32
29
  prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - "="
34
+ - !ruby/object:Gem::Version
35
+ version: 1.0.0.beta.3
33
36
  type: :runtime
37
+ version_requirements: *id002
34
38
  - !ruby/object:Gem::Dependency
35
- name: sinatra
36
- version_requirements: &id002 !ruby/object:Gem::Requirement
39
+ name: redis
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
37
43
  requirements:
38
44
  - - "="
39
45
  - !ruby/object:Gem::Version
40
- segments:
41
- - 1
42
- - 1
43
- - 2
44
- version: 1.1.2
45
- requirement: *id002
46
+ version: 2.1.1
47
+ type: :runtime
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
50
+ name: nest
46
51
  prerelease: false
52
+ requirement: &id004 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - "="
56
+ - !ruby/object:Gem::Version
57
+ version: 1.1.0
47
58
  type: :runtime
59
+ version_requirements: *id004
48
60
  - !ruby/object:Gem::Dependency
49
- name: sinatra-namespace
50
- version_requirements: &id003 !ruby/object:Gem::Requirement
61
+ name: rack
62
+ prerelease: false
63
+ requirement: &id005 !ruby/object:Gem::Requirement
64
+ none: false
51
65
  requirements:
52
66
  - - "="
53
67
  - !ruby/object:Gem::Version
54
- segments:
55
- - 0
56
- - 6
57
- - 1
58
- version: 0.6.1
59
- requirement: *id003
68
+ version: 1.2.1
69
+ type: :runtime
70
+ version_requirements: *id005
71
+ - !ruby/object:Gem::Dependency
72
+ name: tilt
60
73
  prerelease: false
74
+ requirement: &id006 !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - "="
78
+ - !ruby/object:Gem::Version
79
+ version: 1.2.2
80
+ type: :runtime
81
+ version_requirements: *id006
82
+ - !ruby/object:Gem::Dependency
83
+ name: sinatra
84
+ prerelease: false
85
+ requirement: &id007 !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - "="
89
+ - !ruby/object:Gem::Version
90
+ version: 1.1.2
61
91
  type: :runtime
92
+ version_requirements: *id007
62
93
  - !ruby/object:Gem::Dependency
63
94
  name: ohm
64
- version_requirements: &id004 !ruby/object:Gem::Requirement
95
+ prerelease: false
96
+ requirement: &id008 !ruby/object:Gem::Requirement
97
+ none: false
65
98
  requirements:
66
99
  - - "="
67
100
  - !ruby/object:Gem::Version
68
- segments:
69
- - 0
70
- - 1
71
- - 3
72
101
  version: 0.1.3
73
- requirement: *id004
74
- prerelease: false
75
102
  type: :runtime
103
+ version_requirements: *id008
76
104
  - !ruby/object:Gem::Dependency
77
105
  name: ohm-contrib
78
- version_requirements: &id005 !ruby/object:Gem::Requirement
106
+ prerelease: false
107
+ requirement: &id009 !ruby/object:Gem::Requirement
108
+ none: false
79
109
  requirements:
80
110
  - - "="
81
111
  - !ruby/object:Gem::Version
82
- segments:
83
- - 0
84
- - 1
85
- - 0
86
- version: 0.1.0
87
- requirement: *id005
88
- prerelease: false
112
+ version: 0.1.1
89
113
  type: :runtime
114
+ version_requirements: *id009
90
115
  - !ruby/object:Gem::Dependency
91
116
  name: haml
92
- version_requirements: &id006 !ruby/object:Gem::Requirement
117
+ prerelease: false
118
+ requirement: &id010 !ruby/object:Gem::Requirement
119
+ none: false
93
120
  requirements:
94
121
  - - "="
95
122
  - !ruby/object:Gem::Version
96
- segments:
97
- - 3
98
- - 0
99
- - 25
100
123
  version: 3.0.25
101
- requirement: *id006
102
- prerelease: false
103
124
  type: :runtime
125
+ version_requirements: *id010
104
126
  - !ruby/object:Gem::Dependency
105
127
  name: vegas
106
- version_requirements: &id007 !ruby/object:Gem::Requirement
128
+ prerelease: false
129
+ requirement: &id011 !ruby/object:Gem::Requirement
130
+ none: false
107
131
  requirements:
108
132
  - - "="
109
133
  - !ruby/object:Gem::Version
110
- segments:
111
- - 0
112
- - 1
113
- - 8
114
134
  version: 0.1.8
115
- requirement: *id007
116
- prerelease: false
117
135
  type: :runtime
136
+ version_requirements: *id011
118
137
  - !ruby/object:Gem::Dependency
119
- name: sinatra-reloader
120
- version_requirements: &id008 !ruby/object:Gem::Requirement
138
+ name: jruby-openssl
139
+ prerelease: false
140
+ requirement: &id012 !ruby/object:Gem::Requirement
141
+ none: false
121
142
  requirements:
122
- - - "="
143
+ - - ">="
123
144
  - !ruby/object:Gem::Version
124
- segments:
125
- - 0
126
- - 5
127
- - 0
128
- version: 0.5.0
129
- requirement: *id008
145
+ version: "0"
146
+ type: :runtime
147
+ version_requirements: *id012
148
+ - !ruby/object:Gem::Dependency
149
+ name: json
130
150
  prerelease: false
131
- type: :development
151
+ requirement: &id013 !ruby/object:Gem::Requirement
152
+ none: false
153
+ requirements:
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ version: "0"
157
+ type: :runtime
158
+ version_requirements: *id013
132
159
  - !ruby/object:Gem::Dependency
133
- name: rspec
134
- version_requirements: &id009 !ruby/object:Gem::Requirement
160
+ name: warbler
161
+ prerelease: false
162
+ requirement: &id014 !ruby/object:Gem::Requirement
163
+ none: false
135
164
  requirements:
136
165
  - - "="
137
166
  - !ruby/object:Gem::Version
138
- segments:
139
- - 2
140
- - 4
141
- - 0
142
- version: 2.4.0
143
- requirement: *id009
144
- prerelease: false
167
+ version: 1.2.1
145
168
  type: :development
169
+ version_requirements: *id014
146
170
  - !ruby/object:Gem::Dependency
147
- name: rack-test
148
- version_requirements: &id010 !ruby/object:Gem::Requirement
171
+ name: diff-lcs
172
+ prerelease: false
173
+ requirement: &id015 !ruby/object:Gem::Requirement
174
+ none: false
149
175
  requirements:
150
176
  - - "="
151
177
  - !ruby/object:Gem::Version
152
- segments:
153
- - 0
154
- - 5
155
- - 7
156
- version: 0.5.7
157
- requirement: *id010
158
- prerelease: false
178
+ version: 1.1.2
159
179
  type: :development
180
+ version_requirements: *id015
160
181
  - !ruby/object:Gem::Dependency
161
- name: ZenTest
162
- version_requirements: &id011 !ruby/object:Gem::Requirement
182
+ name: sinatra-reloader
183
+ prerelease: false
184
+ requirement: &id016 !ruby/object:Gem::Requirement
185
+ none: false
163
186
  requirements:
164
187
  - - "="
165
188
  - !ruby/object:Gem::Version
166
- segments:
167
- - 4
168
- - 4
169
- - 2
170
- version: 4.4.2
171
- requirement: *id011
172
- prerelease: false
189
+ version: 0.5.0
173
190
  type: :development
191
+ version_requirements: *id016
174
192
  - !ruby/object:Gem::Dependency
175
- name: autotest
176
- version_requirements: &id012 !ruby/object:Gem::Requirement
193
+ name: rspec
194
+ prerelease: false
195
+ requirement: &id017 !ruby/object:Gem::Requirement
196
+ none: false
177
197
  requirements:
178
- - - "="
198
+ - - ~>
179
199
  - !ruby/object:Gem::Version
180
- segments:
181
- - 4
182
- - 4
183
- - 6
184
- version: 4.4.6
185
- requirement: *id012
186
- prerelease: false
200
+ version: "2.5"
187
201
  type: :development
202
+ version_requirements: *id017
188
203
  - !ruby/object:Gem::Dependency
189
- name: autotest-growl
190
- version_requirements: &id013 !ruby/object:Gem::Requirement
204
+ name: rcov
205
+ prerelease: false
206
+ requirement: &id018 !ruby/object:Gem::Requirement
207
+ none: false
191
208
  requirements:
192
209
  - - "="
193
210
  - !ruby/object:Gem::Version
194
- segments:
195
- - 0
196
- - 2
197
- - 9
198
- version: 0.2.9
199
- requirement: *id013
200
- prerelease: false
211
+ version: 0.9.9
201
212
  type: :development
213
+ version_requirements: *id018
202
214
  - !ruby/object:Gem::Dependency
203
- name: warbler
204
- version_requirements: &id014 !ruby/object:Gem::Requirement
215
+ name: rack-test
216
+ prerelease: false
217
+ requirement: &id019 !ruby/object:Gem::Requirement
218
+ none: false
205
219
  requirements:
206
220
  - - "="
207
221
  - !ruby/object:Gem::Version
208
- segments:
209
- - 1
210
- - 2
211
- - 1
212
- version: 1.2.1
213
- requirement: *id014
214
- prerelease: false
222
+ version: 0.5.7
215
223
  type: :development
224
+ version_requirements: *id019
216
225
  description: Application registry based on Apache Zookeeper
217
226
  email:
218
227
  - lusis.org+rubygems.org@gmail.com
219
228
  executables:
220
229
  - noah
230
+ - noah-watcher.rb
221
231
  extensions: []
222
232
 
223
233
  extra_rdoc_files: []
224
234
 
225
235
  files:
226
236
  - .autotest
237
+ - .gemtest
227
238
  - .gitignore
228
239
  - Gemfile
229
- - Gemfile.lock
240
+ - LICENSE
230
241
  - README.md
231
242
  - Rakefile
243
+ - TODO.md
232
244
  - autotest/discover.rb
233
245
  - bin/noah
246
+ - bin/noah-watcher.rb
234
247
  - config.ru
235
- - doc/coverage/index.html
236
- - doc/coverage/jquery-1.3.2.min.js
237
- - doc/coverage/jquery.tablesorter.min.js
238
- - doc/coverage/lib-helpers_rb.html
239
- - doc/coverage/lib-models_rb.html
240
- - doc/coverage/noah_rb.html
241
- - doc/coverage/print.css
242
- - doc/coverage/rcov.js
243
- - doc/coverage/screen.css
248
+ - config/warble.rb
249
+ - examples/README.md
250
+ - examples/cluster.ru
251
+ - examples/custom-watcher.rb
252
+ - examples/httpclient-server.rb
253
+ - examples/httpclient.rb
254
+ - examples/httpclient2.rb
255
+ - examples/js/FABridge.js
256
+ - examples/js/WebSocketMain.swf
257
+ - examples/js/swfobject.js
258
+ - examples/js/web_socket.js
259
+ - examples/logger.rb
260
+ - examples/reconfiguring-sinatra-watcher.rb
261
+ - examples/reconfiguring-sinatra.rb
262
+ - examples/simple-post.rb
263
+ - examples/websocket.html
264
+ - examples/websocket.rb
244
265
  - lib/noah.rb
245
266
  - lib/noah/app.rb
246
- - lib/noah/applications.rb
247
- - lib/noah/configurations.rb
267
+ - lib/noah/application_routes.rb
268
+ - lib/noah/ark.rb
269
+ - lib/noah/configuration_routes.rb
270
+ - lib/noah/custom_watcher.rb
271
+ - lib/noah/ephemeral_routes.rb
248
272
  - lib/noah/helpers.rb
249
- - lib/noah/hosts.rb
273
+ - lib/noah/host_routes.rb
250
274
  - lib/noah/models.rb
251
- - lib/noah/services.rb
275
+ - lib/noah/models/applications.rb
276
+ - lib/noah/models/configurations.rb
277
+ - lib/noah/models/ephemerals.rb
278
+ - lib/noah/models/hosts.rb
279
+ - lib/noah/models/services.rb
280
+ - lib/noah/models/watchers.rb
281
+ - lib/noah/passthrough.rb
282
+ - lib/noah/service_routes.rb
283
+ - lib/noah/validations.rb
284
+ - lib/noah/validations/watcher_validations.rb
252
285
  - lib/noah/version.rb
253
- - lib/noah/watchers.rb
286
+ - lib/noah/watcher_routes.rb
254
287
  - noah.gemspec
255
288
  - spec/application_spec.rb
256
289
  - spec/configuration_spec.rb
290
+ - spec/ephemeral_spec.rb
257
291
  - spec/host_spec.rb
258
292
  - spec/noahapp_application_spec.rb
259
293
  - spec/noahapp_configuration_spec.rb
294
+ - spec/noahapp_ephemeral_spec.rb
260
295
  - spec/noahapp_host_spec.rb
261
296
  - spec/noahapp_service_spec.rb
262
297
  - spec/noahapp_spec.rb
298
+ - spec/noahapp_watcher_spec.rb
263
299
  - spec/service_spec.rb
264
300
  - spec/spec_helper.rb
301
+ - spec/support/db/.keep
302
+ - spec/support/test-redis.conf
303
+ - spec/watcher_spec.rb
265
304
  - views/200.erb
266
305
  - views/404.erb
267
306
  - views/500.erb
@@ -276,34 +315,38 @@ rdoc_options: []
276
315
  require_paths:
277
316
  - lib
278
317
  required_ruby_version: !ruby/object:Gem::Requirement
318
+ none: false
279
319
  requirements:
280
320
  - - ">="
281
321
  - !ruby/object:Gem::Version
282
- segments:
283
- - 0
284
322
  version: "0"
285
323
  required_rubygems_version: !ruby/object:Gem::Requirement
324
+ none: false
286
325
  requirements:
287
326
  - - ">="
288
327
  - !ruby/object:Gem::Version
289
- segments:
290
- - 0
291
328
  version: "0"
292
329
  requirements: []
293
330
 
294
331
  rubyforge_project: noah
295
- rubygems_version: 1.3.6
332
+ rubygems_version: 1.5.2
296
333
  signing_key:
297
334
  specification_version: 3
298
335
  summary: Application registry based on Apache Zookeeper
299
336
  test_files:
300
337
  - spec/application_spec.rb
301
338
  - spec/configuration_spec.rb
339
+ - spec/ephemeral_spec.rb
302
340
  - spec/host_spec.rb
303
341
  - spec/noahapp_application_spec.rb
304
342
  - spec/noahapp_configuration_spec.rb
343
+ - spec/noahapp_ephemeral_spec.rb
305
344
  - spec/noahapp_host_spec.rb
306
345
  - spec/noahapp_service_spec.rb
307
346
  - spec/noahapp_spec.rb
347
+ - spec/noahapp_watcher_spec.rb
308
348
  - spec/service_spec.rb
309
349
  - spec/spec_helper.rb
350
+ - spec/support/db/.keep
351
+ - spec/support/test-redis.conf
352
+ - spec/watcher_spec.rb