carioca 1.3 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/main.yml +18 -0
  3. data/.gitignore +11 -0
  4. data/.rspec +3 -0
  5. data/Gemfile +3 -1
  6. data/Gemfile.lock +44 -40
  7. data/README.md +123 -190
  8. data/Rakefile +5 -59
  9. data/bin/console +15 -0
  10. data/bin/setup +8 -0
  11. data/carioca.gemspec +45 -32
  12. data/config/locales/en.yml +19 -0
  13. data/config/locales/fr.yml +19 -0
  14. data/lib/carioca/configuration.rb +60 -0
  15. data/lib/carioca/constants.rb +60 -0
  16. data/lib/carioca/container.rb +16 -0
  17. data/lib/carioca/dependencies.rb +20 -0
  18. data/lib/carioca/helpers.rb +44 -31
  19. data/lib/carioca/mixin.rb +32 -0
  20. data/lib/carioca/{tasks/rake.rb → rake/manage.rb} +4 -6
  21. data/lib/carioca/rake/tasks/registry.tasks +57 -0
  22. data/lib/carioca/registry.rb +94 -0
  23. data/lib/carioca/registry_file.rb +62 -0
  24. data/lib/carioca/services/config.rb +140 -0
  25. data/lib/carioca/services/i18n.rb +20 -0
  26. data/lib/carioca/services/init.rb +2 -0
  27. data/lib/carioca/services/output.rb +175 -0
  28. data/lib/carioca/validator.rb +49 -0
  29. data/lib/carioca.rb +2 -319
  30. data/samples/Rakefile +2 -0
  31. data/samples/config/carioca.registry +22 -0
  32. data/samples/config/locales/en.yml +2 -0
  33. data/samples/config/locales/es.yml +2 -0
  34. data/samples/config/locales/fr.yml +2 -0
  35. data/samples/config/settings.yml +24 -0
  36. data/samples/test.rb +98 -0
  37. metadata +76 -168
  38. data/AUTHORS +0 -8
  39. data/COPYRIGHT +0 -24
  40. data/ChangeLog +0 -7
  41. data/INSTALL +0 -7
  42. data/doc/manual.rdoc +0 -225
  43. data/lib/carioca/exceptions.rb +0 -9
  44. data/lib/carioca/private.rb +0 -170
  45. data/lib/carioca/services/configuration.rb +0 -201
  46. data/lib/carioca/services/debug.rb +0 -73
  47. data/lib/carioca/services/logger.rb +0 -58
  48. data/lib/carioca/services.rb +0 -143
  49. data/lib/carioca/tasks/registry_init.rake +0 -11
  50. data/spec/carioca_spec.rb +0 -474
  51. data/spec/config/services.registry +0 -55
  52. data/spec/init_spec.rb +0 -1
  53. data/spec/samples/dummy.rb +0 -10
  54. data/spec/samples/otherdummy.rb +0 -10
  55. data/spec/samples/requireddummy.rb +0 -10
  56. data/spec/spec_helper.rb +0 -18
  57. data/test.rb +0 -12
  58. data/ultragreen_roodi_coding_convention.yml +0 -25
data/spec/carioca_spec.rb DELETED
@@ -1,474 +0,0 @@
1
- require'rubygems'
2
- require'rspec'
3
- require 'carioca'
4
- require 'fileutils'
5
-
6
- $debug = true
7
-
8
- describe Carioca do
9
-
10
- before :all do
11
- FileUtils.rm_rf("/tmp/log.file")
12
- File::unlink('/tmp/dorsal/ringserver.pid') if File::exist?('/tmp/dorsal/ringserver.pid')
13
- File::unlink('/tmp/dorsal/service-distdummy.pid') if File::exist?('/tmp/dorsal/service-distdummy.pid')
14
- pid = `ps aux|grep ruby|grep -v grep |grep 'Ultragreen Ring Server'|awk '{ print $2}'`
15
- unless pid.empty? then
16
- res = `kill -TERM #{pid.chomp}`
17
- end
18
- pid = `ps aux|grep ruby|grep -v grep |grep 'a dummy test service'|awk '{ print $2}'`
19
- unless pid.empty? then
20
- res = `kill -TERM #{pid.chomp}`
21
- end
22
- $carioca = Carioca::Services::Registry.init :file => 'spec/config/services.registry', :debug => $debug
23
- end
24
-
25
- subject { Carioca }
26
- it { should be_an_instance_of Module}
27
- context "Carioca::Services" do
28
- subject { Carioca::Services }
29
- it { should be_an_instance_of Module }
30
- end
31
-
32
- context "Carioca::Services::Registry" do
33
- subject { $carioca }
34
- context "#init" do
35
- it "should be a Singleton" do
36
- carioca1 = Carioca::Services::Registry.init
37
- carioca2 = Carioca::Services::Registry.init
38
- test = (carioca1.inspect == carioca2.inspect)
39
- test.should be true
40
- end
41
-
42
-
43
- it { should be_an_instance_of Carioca::Services::Registry }
44
- it { $carioca.list.keys.should include "logger" }
45
- it "should log Registry starting and logger init if debug mode", :if => $debug do
46
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Registry started, service logger preloaded/).size.should eq 1
47
- end
48
- it "should not log Registry starting and logger init if not debug mode", :unless => $debug do
49
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Registry started, service logger preloaded/).size.should eq 0
50
- end
51
-
52
-
53
- it "should be possible to log with this primary service" do
54
- $logger = subject.get_service :name => 'logger'
55
- $logger.info("test").should eq true
56
- open('/tmp/log.file').grep(/INFO -- : test/).size.should eq 1
57
- $logger.warn("test").should eq true
58
- open('/tmp/log.file').grep(/WARN -- : test/).size.should eq 1
59
- $logger.error("test").should eq true
60
- open('/tmp/log.file').grep(/ERROR -- : test/).size.should eq 1
61
- $logger.fatal("test").should eq true
62
- open('/tmp/log.file').grep(/FATAL -- : test/).size.should eq 1
63
- $logger.info("Program") { "running" }
64
- open('/tmp/log.file').grep(/INFO -- Program: running/).size.should eq 1
65
- end
66
- end
67
-
68
- context "attributs" do
69
- context "#debug (RW)" do
70
- it { should respond_to :debug }
71
- it { should respond_to :debug= }
72
- it "should be true if debug mode", :if => $debug do
73
- subject.debug.should eq true
74
- end
75
- it "should be false if not debug mode", :unless => $debug do
76
- subject.debug.should eq false
77
- end
78
- end
79
-
80
- context "#name (RW)" do
81
- it { should respond_to :name }
82
- it { should respond_to :name= }
83
- it { $carioca.name.should be_an_instance_of String }
84
- it { $carioca.name.should eq 'Carioca'}
85
- end
86
-
87
- context "#list (RO)" do
88
- it { should respond_to :list }
89
- it { should_not respond_to :list= }
90
- it { subject.list.should be_an_instance_of Hash }
91
- it { $carioca.list.keys.sort.should eq ["configuration", "debug", "distdummy","dorsal", "dummy", "logger", "uuid", "uuidbygemfile"] }
92
- end
93
-
94
- context "#loaded_services (RO)" do
95
- it { should respond_to :loaded_services }
96
- it { should_not respond_to :loaded_services= }
97
- it { subject.loaded_services.should be_an_instance_of Hash }
98
- it { $carioca.loaded_services.keys.should eq ["logger"] }
99
- end
100
-
101
- context "#registry_filename" do
102
- it { should respond_to :registry_filename }
103
- it { should respond_to :registry_filename= }
104
- it { subject.registry_filename.should be_an_instance_of String }
105
- it { $carioca.registry_filename.should eq "spec/config/services.registry" }
106
- end
107
-
108
- end
109
-
110
- context "#start_service" do
111
- it { should respond_to :start_service }
112
- it { should respond_to :get_service }
113
-
114
- context "Builtin services" do
115
- context "Logger service" do
116
- it "should be possible to get the builtin logger service" do
117
- $logger = subject.get_service :name => 'logger'
118
- end
119
- it "should log if debug mode", :if => $debug do
120
- open('/tmp/log.file').grep(/DEBUG -- Carioca: getting service logger/).size.should >= 1
121
- end
122
- it "should not log if debug mode", :unless => $debug do
123
- open('/tmp/log.file').grep(/DEBUG -- Carioca: getting service logger/).size.should eq 0
124
- end
125
- end
126
-
127
-
128
- context "Debug Proxy Service" do
129
- it "should start the builtin service debug" do
130
- myservice = subject.start_service :name => 'debug' , :params => {:service => 'dummy'}
131
- myservice.test 'titi'
132
- end
133
- it { subject.list.keys.should include "debug" }
134
- it "should log a proxy service log sequence", :if => $debug do
135
- open('/tmp/log.file').grep(/DEBUG -- ProxyDebug: BEGIN CALL for mapped service dummy/).size.should eq 1
136
- open('/tmp/log.file').grep(/DEBUG -- ProxyDebug: called: test/).size.should eq 1
137
- open('/tmp/log.file').grep(/DEBUG -- ProxyDebug: args : titi/).size.should eq 1
138
- open('/tmp/log.file').grep(/DEBUG -- ProxyDebug: => returned: OK/).size.should eq 1
139
- open('/tmp/log.file').grep(/DEBUG -- ProxyDebug: END CALL/).size.should eq 1
140
- end
141
- end
142
-
143
- context "Configuration Service" do
144
- it "should start the builtin configuration service" do
145
- $conf = subject.start_service :name => 'configuration'
146
- end
147
- it "should access flat settings" do
148
- $conf.settings.context1.key0.should eq 'value'
149
- $conf.settings.context1.node.key1 eq 'value1'
150
- $conf.settings.context1.node.key2 eq 'value2'
151
- $conf.settings.context2.key0.should eq 'value'
152
- $conf.settings.context2.node.key1 eq 'value3'
153
- $conf.settings.context2.node.key2 eq 'value4'
154
- end
155
- it "should access contextualized settings" do
156
- $conf = subject.restart_service :name => 'configuration', :params => { :context => 'context2' }
157
- $conf.settings.key0.should eq 'value'
158
- $conf.settings.node.key1 eq 'value3'
159
- $conf.settings.node.key2 eq 'value4'
160
- end
161
- it "should access inherited settings from YAML" do
162
- $conf = subject.restart_service :name => 'configuration', :params => { :context => 'context3' }
163
- $conf.settings.key0.should eq 'value'
164
- $conf.settings.node.key1 eq 'value3'
165
- $conf.settings.node.key2 eq 'value4'
166
- end
167
- it "should be possible to override a config value" do
168
- $conf.settings.node.key2 = 'value8'
169
- $conf.settings.node.key2.should eq 'value8'
170
- $conf.settings[:node][:key2] = 'value6'
171
- $conf.settings[:node][:key2].should eq 'value6'
172
- end
173
- it { $conf.should respond_to :config_file }
174
- it { $conf.should respond_to :config_file= }
175
- it { $conf.should respond_to :save! }
176
-
177
- it "should be saved in other file" do
178
- $conf.config_file = '/tmp/.config'
179
- $conf.save!.should be true
180
-
181
- end
182
- it "should stop the configuration service" do
183
- subject.stop_service({:name => 'configuration'}).should eq true
184
- end
185
- end
186
-
187
- end
188
-
189
- context "External services" do
190
-
191
- it "should start a dummy service precised in registry YAML configuration" do
192
-
193
- $dummy = subject.start_service :name => 'dummy'
194
- $dummy.should be_an_instance_of ExternalServices::Dummy
195
- end
196
- it { subject.list.keys.should include "dummy" }
197
- it "should be possible to use test method of the dummy service, and return 'OK'" do
198
- $dummy.test.should eq 'OK'
199
- end
200
- it "should start a gem service precised in registry YAML configuration" do
201
- $uuid = subject.start_service :name => 'uuid'
202
- $uuid.should be_an_instance_of UUID
203
- end
204
- it { subject.list.keys.should include "uuid" }
205
- it "should be possible to execute a method with the gem service" do
206
- $uuid.generate.should be_a_kind_of String
207
- end
208
- it "should start a file in gem service precised by gem_file in registry YAML configuration" do
209
- $uuidgemfile = subject.start_service :name => 'uuidbygemfile'
210
- $uuidgemfile.should be_an_instance_of UUID
211
- end
212
- it { subject.list.keys.should include "uuidbygemfile" }
213
- it { subject.loaded_services.keys.should include "uuidbygemfile" }
214
- it "should be possible to execute a method with the gem_file service" do
215
- $uuidgemfile.generate.should be_a_kind_of String
216
- subject.stop_service :name => "uuidbygemfile"
217
- end
218
-
219
-
220
- context "Distributed service" do
221
- it "should be possible to execute a distributed service" do
222
- $dummy_dist = subject.start_service :name => 'distdummy'
223
- end
224
- it "should exist a processus Ring server" do
225
- File::exist?('/tmp/dorsal/ringserver.pid').should be true
226
- pid = `ps aux|grep ruby|grep -v grep |grep 'Ultragreen Ring Server'|awk '{ print $2}'`
227
- pid.should_not be_empty
228
- end
229
- it "should log if debug mode", :if => $debug do
230
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Starting new Ring Server/).size.should >= 1
231
- end
232
- it "should not log if debug mode", :unless => $debug do
233
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Starting new Ring Server/).size.should eq 0
234
- end
235
- it "should include 'distdummy' in @loaded_services.keys" do
236
- subject.loaded_services.should include "distdummy"
237
- end
238
- it "should distdummy be a DRbObject" do
239
- $dummy_dist.should be_a_kind_of DRb::DRbObject
240
- end
241
- it "should be possible to use test method of the distributed dummy service, and return 'OK'" do
242
- $dummy_dist.test.should eq 'OK'
243
- end
244
- end
245
-
246
- end
247
- end
248
-
249
-
250
- context "#stop_service" do
251
- it { should respond_to :stop_service }
252
- it "should raise ArgumentError if the option hash argument passed not include :name" do
253
- lambda { subject.stop_service }.should raise_error ArgumentError
254
- lambda { subject.stop_service(:notname => 'debug') }.should raise_error ArgumentError
255
- end
256
- it "should return true if service really stop" do
257
- subject.stop_service({:name => 'dummy'}).should eq true
258
- end
259
- it "should log if debug mode", :if => $debug do
260
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Service dummy stopped/).size.should >= 1
261
- end
262
- it "should not log if debug mode", :unless => $debug do
263
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Service dummy stopped/).size.should eq 0
264
- end
265
- it "should return false if service not already running" do
266
- subject.stop_service({:name => 'dum'}).should eq false
267
- end
268
- it "should log if debug mode and service not loaded", :if => $debug do
269
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Service dum not loaded/).size.should >= 1
270
- end
271
- it "should not log if debug mode and service not loaded", :unless => $debug do
272
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Service dum not loaded/).size.should eq 0
273
- end
274
- it "should return false if service :name is logger" do
275
- subject.stop_service({:name => 'logger'}).should eq false
276
- end
277
- it "should log if debug mode and service :name is logger", :if => $debug do
278
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Service logger can't be unloaded/).size.should >= 1
279
- end
280
- it "should not log if debug mode and service :name is logger", :unless => $debug do
281
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Service logger can't be unloaded/).size.should eq 0
282
- end
283
-
284
- context "Distributed Service" do
285
- it "should be possible to stop a distributed service" do
286
- $dummy_dist = subject.start_service :name => 'distdummy'
287
- subject.stop_service({:name => 'distdummy'}).should be true
288
- end
289
- it "should not exist forked daemon instance for this stopped service" do
290
- pid = `ps aux|grep ruby|grep -v grep |grep 'a dummy test service'|awk '{ print $2}'`
291
- pid.should be_empty
292
- end
293
- it "should not exist the pid file of this stopped services" do
294
- File::exist?('/tmp/dorsal/service-distdummy.pid').should be false
295
- $dummy_dist = subject.start_service :name => 'distdummy'
296
- end
297
- end
298
-
299
- end
300
-
301
- context "#restart_service" do
302
- it { should respond_to :start_service }
303
- it "should start an instance of a service like dummy_one" do
304
- $dummy = subject.restart_service :name => 'dummy_one'
305
- $dummy = subject.restart_service :name => 'dummy'
306
- $dummy.should be_an_instance_of ExternalServices::Dummy
307
- $carioca.loaded_services.keys.should include 'dummy'
308
- $carioca.loaded_services.keys.should include 'dummy_one'
309
- end
310
- it "should restart a service already loaded and log it" do
311
- $dummy = subject.restart_service :name => 'dummy'
312
- end
313
-
314
- context "Distributed service" do
315
- it "should ne possible to restart a distributed service" do
316
- $dummy_dist = subject.restart_service :name => 'distdummy'
317
- end
318
- it "should log it if debug mode", :if => $debug do
319
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Restarting distributed service distdummy/).size.should eq 1
320
- end
321
- end
322
-
323
- it "should log it if debug mode", :if => $debug do
324
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Restarting service dummy/).size.should eq 1
325
- end
326
- it "should not log it if not debug mode", :if => $debug do
327
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Restarting service dummy/).size.should eq 1
328
- end
329
-
330
- end
331
-
332
-
333
- context "#unregister_service" do
334
- it { should respond_to :unregister_service }
335
- it "should be possible te unregistered the configuration service" do
336
- subject.list.keys.should include "configuration"
337
- subject.unregister_service :name => "configuration"
338
- subject.list.keys.should_not include "configuration"
339
- end
340
- it "should raise RegistryError if trying to unregister logger" do
341
- lambda { subject.unregister_service :name => "logger"}.should raise_error RegistryError
342
- end
343
- it "should raise RegistryError if trying to unregister a loaded service" do
344
- lambda { subject.unregister_service :name => "dummy"}.should raise_error RegistryError
345
- end
346
-
347
- end
348
-
349
- context "#discover_builtins" do
350
- it { should respond_to :discover_builtins }
351
- it "should rebuild builtin service in @list" do
352
- subject.discover_builtins
353
- subject.list.keys.should include "configuration"
354
- end
355
- end
356
-
357
- context "#register_service" do
358
- it { should respond_to :register_service }
359
- it "should add a new service" do
360
- subject.register_service :name => 'otherdummy',
361
- :type => :file,
362
- :resource => './spec/samples/otherdummy.rb',
363
- :service =>'ExternalServices::OtherDummy',
364
- :description => 'An other Dummy Service',
365
- :requires => ['requireddummy']
366
- end
367
- it "should raised RegistryError if started without a registered required service" do
368
- lambda { subject.start_service :name => 'otherdummy' }.should raise_error RegistryError
369
- end
370
- it "should follow requires when started" do
371
- subject.register_service :name => 'requireddummy',
372
- :type => :file,
373
- :resource => './spec/samples/requireddummy.rb',
374
- :service =>'ExternalServices::RequiredDummy',
375
- :description => 'An other Dummy Service'
376
- subject.start_service :name => 'otherdummy'
377
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Registry dependancy found and not loaded : requireddummy/).size.should eq 1 if $debug
378
- subject.loaded_services.keys.should include 'requireddummy'
379
- subject.loaded_services.keys.should include 'otherdummy'
380
- end
381
- it "should raise Argument error if :type is not :gem, :file, :gem_file or :builtin" do
382
- lambda { subject.register_service :name => 'otherdummy',
383
- :type => :error,
384
- :resource => 'spec/samples/otherdummy.rb',
385
- :service =>'ExternalServices::OtherDummy',
386
- :description => 'An other Dummy Service'}.should raise_error ArgumentError
387
-
388
- end
389
- end
390
-
391
-
392
-
393
-
394
-
395
- context "#save!" do
396
- it { should respond_to :save! }
397
- it "should save the config to an other file @registry_filename" do
398
- File::unlink('/tmp/test.reg') if File::exist?('/tmp/test.reg')
399
- prev = subject.registry_filename
400
- subject.registry_filename = '/tmp/test.reg'
401
- subject.save!
402
- File::exist?('/tmp/test.reg').should be true
403
- subject.registry_filename = prev
404
- subject.registry_filename.should eq "spec/config/services.registry"
405
- end
406
-
407
- end
408
-
409
-
410
-
411
- context "#close" do
412
- context "Closing the Carioca registry" do
413
- it { should respond_to :close }
414
- it "should close" do
415
- subject.close.should eq true
416
- end
417
- it "should log a registry closing notification if debug mode", :if => $debug do
418
- open('/tmp/log.file').grep(/DEBUG -- Carioca: closing Registry .../).size.should eq 1
419
- end
420
- it "should not log a registry closing notification if not debug mode", :unless => $debug do
421
- open('/tmp/log.file').grep(/DEBUG -- Carioca: closing Registry .../).size.should eq 0
422
- end
423
- it "should log a distributed service killing notification if debug mode", :if => $debug do
424
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Killing distributed Service distdummy./).size.should >= 1
425
- end
426
- it "should not log a distributed service killing notification if not debug mode", :unless => $debug do
427
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Killing distributed Service distdummy./).size.should eq 0
428
- end
429
- it "should log a stopping notification for each services if debug mode", :if => $debug do
430
- ['debug','uuid','dorsal','dummy','dummy_one','requireddummy','otherdummy'].each do |service|
431
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Service #{service} stopped/).size.should >= 1
432
- end
433
- end
434
- it "should not log a stopping notification for each services if not debug mode", :unless => $debug do
435
- ['debug','uuid','dorsal','dummy','dummy_one','requireddummy','otherdummy'].each do |service|
436
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Service #{service} stopped/).size.should eq 0
437
- end
438
- end
439
- it "should log a registry closing confirmation if debug mode", :if => $debug do
440
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Registry services closed, logger will be closed asynchronously/).size.should eq 1
441
- end
442
- it "should not log a registry closing confirmation if not debug mode", :unless => $debug do
443
- open('/tmp/log.file').grep(/DEBUG -- Carioca: Registry services closed, logger will be closed asynchronously/).size.should eq 0
444
- end
445
- it "should loaded services empty" do
446
- subject.loaded_services.empty?.should eq true
447
- end
448
- context "Distributed service" do
449
- end
450
- end
451
- end
452
- end
453
- after :all do
454
- FileUtils.rm_rf("/tmp/log.file")
455
- File::unlink('/tmp/dorsal/ringserver.pid') if File::exist?('/tmp/dorsal/ringserver.pid')
456
- File::unlink('/tmp/dorsal/service-distdummy.pid') if File::exist?('/tmp/dorsal/service-distdummy.pid')
457
- pid = `ps aux|grep ruby|grep -v grep |grep 'Ultragreen Ring Server'|awk '{ print $2}'`
458
- unless pid.empty? then
459
- res = `kill -TERM #{pid.chomp}`
460
- end
461
- pid = `ps aux|grep ruby|grep -v grep |grep 'a dummy test service'|awk '{ print $2}'`
462
- unless pid.empty? then
463
- res = `kill -TERM #{pid.chomp}`
464
- end
465
- end
466
-
467
- end
468
-
469
-
470
-
471
-
472
-
473
-
474
-
@@ -1,55 +0,0 @@
1
- ---
2
- uuid:
3
- :type: :gem
4
- :resource: uuid
5
- :description: a Rubygems called uuid to build UUID ids.
6
- :service: UUID
7
- logger:
8
- # :distributed: true
9
- :type: :builtin
10
- :resource: logger
11
- :init_options:
12
- :target: /tmp/log.file
13
- :description: The standard ruby Logger internal wrapper Service
14
- :service: Carioca::Services::InternalLogger
15
- configuration:
16
- # :distributed: true
17
- :type: :builtin
18
- :resource: configuration
19
- :description: The configuration service of Carioca
20
- :service: Carioca::Services::Configuration
21
- :init_options:
22
- :config_file: ./spec/config/.config
23
- dorsal:
24
- :type: :gem
25
- :resource: dorsal
26
- :description: The Dorsal Distributed Services architecture
27
- :service: Dorsal::Controller
28
- :init_options:
29
- :host: localhost
30
- :port: 8686
31
- :dir: /tmp/dorsal
32
- :description: Ultragreen Ring Server
33
- dummy:
34
- :type: :file
35
- :resource: ./spec/samples/dummy.rb
36
- :description: a dummy test service
37
- :service: ExternalServices::Dummy
38
- distdummy:
39
- :type: :file
40
- :resource: ./spec/samples/dummy.rb
41
- :description: a dummy test service
42
- :service: ExternalServices::Dummy
43
- :distributed: true
44
- uuidbygemfile:
45
- :type: :gem_file
46
- :resource: uuid:lib/uuid.rb
47
- :description: uuid file in gem
48
- :service: UUID
49
- debug:
50
- :type: :builtin
51
- :resource: debug
52
- :init_options:
53
- :service: dummy
54
- :description: Class Proxy debug logger Service
55
- :service: Carioca::Services::ProxyDebug
data/spec/init_spec.rb DELETED
@@ -1 +0,0 @@
1
- require "spec_helper"
@@ -1,10 +0,0 @@
1
- module ExternalServices
2
- class Dummy
3
- def initialize
4
- end
5
-
6
- def test(arg = nil)
7
- return 'OK'
8
- end
9
- end
10
- end
@@ -1,10 +0,0 @@
1
- module ExternalServices
2
- class OtherDummy
3
- def initialize
4
- end
5
-
6
- def test(arg = nil)
7
- return 'OK'
8
- end
9
- end
10
- end
@@ -1,10 +0,0 @@
1
- module ExternalServices
2
- class RequiredDummy
3
- def initialize
4
- end
5
-
6
- def test(arg = nil)
7
- return 'OK'
8
- end
9
- end
10
- end
data/spec/spec_helper.rb DELETED
@@ -1,18 +0,0 @@
1
- # This file was generated by the `rspec --init` command. Conventionally, all
2
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
- # Require this file using `require "spec_helper.rb"` to ensure that it is only
4
- # loaded once.
5
- #
6
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
- RSpec.configure do |config|
8
- # config.treat_symbols_as_metadata_keys_with_true_values = true
9
- config.run_all_when_everything_filtered = true
10
- # config.filter_run :focus
11
- config.mock_with :rspec do |c|
12
- c.syntax = [:should, :expect]
13
- end
14
- config.expect_with :rspec do |c|
15
- c.syntax = [:should, :expect]
16
- end
17
- end
18
-
data/test.rb DELETED
@@ -1,12 +0,0 @@
1
- require 'rubygems'
2
- require 'dorsal'
3
-
4
- titi = Dorsal::Controller::new
5
- toto = titi.bind_to_ring
6
- if toto.nil? then
7
- titi.start_ring_server
8
- toto = titi.bind_to_ring
9
- end
10
-
11
- p toto
12
-
@@ -1,25 +0,0 @@
1
- AssignmentInConditionalCheck:
2
- CaseMissingElseCheck:
3
- ClassLineCountCheck:
4
- line_count: 300
5
- ClassNameCheck:
6
- pattern: !ruby/regexp /^[A-Z][a-zA-Z0-9]*$/
7
- #ClassVariableCheck:
8
- CyclomaticComplexityBlockCheck:
9
- complexity: 5
10
- CyclomaticComplexityMethodCheck:
11
- complexity: 10
12
- EmptyRescueBodyCheck:
13
- ForLoopCheck:
14
- MethodLineCountCheck:
15
- line_count: 30
16
- MethodNameCheck:
17
- pattern: !ruby/regexp /^[_a-z<>=\[|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/
18
- # MissingForeignKeyIndexCheck:
19
- ModuleLineCountCheck:
20
- line_count: 500
21
- ModuleNameCheck:
22
- pattern: !ruby/regexp /^[A-Z][a-zA-Z0-9]*$/
23
- ParameterNumberCheck:
24
- parameter_count: 5
25
-