titan 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,13 @@
1
+ ## 0.3.0 (December 12, 2010)
2
+
3
+ - Features
4
+
5
+ * Added an executable that prints the status of all threads managed by Titan ('titan status' on the terminal)
6
+
7
+ - Bug fixes
8
+
9
+ * Fixed "warning: don't put space before argument parentheses" in thread.rb at line 124
10
+
1
11
  ## 0.2.1 (December 6, 2010)
2
12
 
3
13
  - Bug fixes
data/README.md CHANGED
@@ -63,9 +63,14 @@ Furthermore, you can check if a single thread is alive:
63
63
  thread = Titan::Thread.find("my_new_thread")
64
64
  thread.alive? # returns true or false
65
65
 
66
+ You can print the status of all threads managed by Titan on the command line:
67
+
68
+ titan status
69
+
66
70
  Requirements
67
71
  ======
68
72
 
73
+ * Ruby 1.8.7 or higher
69
74
  * Linux or Mac OS X
70
75
 
71
76
  Bugs
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require "titan"
3
+
4
+ Titan::CLI.start
@@ -1,5 +1,6 @@
1
1
  require "titan/version"
2
2
 
3
3
  module Titan
4
+ autoload :CLI, "titan/cli"
4
5
  autoload :Thread, "titan/thread"
5
6
  end
@@ -0,0 +1,171 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 37
13
+ 5
14
+ 7
15
+ 0
16
+ 64
17
+ 47
18
+ 49
19
+ 1
20
+ 1
21
+ 15
22
+ 99
23
+ 7
24
+ 2
25
+ 65
26
+ 49
27
+ 3
28
+ 2
29
+ 13
30
+ 99
31
+ 12
32
+ 7
33
+ 4
34
+ 12
35
+ 7
36
+ 5
37
+ 12
38
+ 65
39
+ 12
40
+ 49
41
+ 6
42
+ 4
43
+ 15
44
+ 49
45
+ 4
46
+ 0
47
+ 15
48
+ 2
49
+ 11
50
+ I
51
+ 6
52
+ I
53
+ 0
54
+ I
55
+ 0
56
+ I
57
+ 0
58
+ n
59
+ p
60
+ 7
61
+ s
62
+ 13
63
+ titan/version
64
+ x
65
+ 7
66
+ require
67
+ x
68
+ 5
69
+ Titan
70
+ x
71
+ 11
72
+ open_module
73
+ x
74
+ 15
75
+ __module_init__
76
+ M
77
+ 1
78
+ n
79
+ n
80
+ x
81
+ 5
82
+ Titan
83
+ i
84
+ 24
85
+ 5
86
+ 66
87
+ 5
88
+ 7
89
+ 0
90
+ 7
91
+ 1
92
+ 64
93
+ 47
94
+ 49
95
+ 2
96
+ 2
97
+ 15
98
+ 5
99
+ 7
100
+ 3
101
+ 7
102
+ 4
103
+ 64
104
+ 47
105
+ 49
106
+ 2
107
+ 2
108
+ 11
109
+ I
110
+ 3
111
+ I
112
+ 0
113
+ I
114
+ 0
115
+ I
116
+ 0
117
+ n
118
+ p
119
+ 5
120
+ x
121
+ 3
122
+ CLI
123
+ s
124
+ 9
125
+ titan/cli
126
+ x
127
+ 8
128
+ autoload
129
+ x
130
+ 6
131
+ Thread
132
+ s
133
+ 12
134
+ titan/thread
135
+ p
136
+ 5
137
+ I
138
+ 2
139
+ I
140
+ 4
141
+ I
142
+ d
143
+ I
144
+ 5
145
+ I
146
+ 18
147
+ x
148
+ 38
149
+ /Users/stefan/Codes/titan/lib/titan.rb
150
+ p
151
+ 0
152
+ x
153
+ 13
154
+ attach_method
155
+ p
156
+ 5
157
+ I
158
+ 0
159
+ I
160
+ 1
161
+ I
162
+ 9
163
+ I
164
+ 3
165
+ I
166
+ 25
167
+ x
168
+ 38
169
+ /Users/stefan/Codes/titan/lib/titan.rb
170
+ p
171
+ 0
@@ -0,0 +1,41 @@
1
+ require "thor"
2
+
3
+ module Titan
4
+ class CLI < Thor
5
+ include Thor::Actions
6
+
7
+ def initialize(*)
8
+ super
9
+ @shell = Thor::Shell::Basic.new
10
+ end
11
+
12
+ desc "help", "Describes available command line options"
13
+ def help
14
+ @shell.say "The following methods are available through typing `titan method_name`"
15
+ @shell.say ""
16
+ available_methods = [
17
+ ["method_name", "description"],
18
+ ["", ""],
19
+ ["help", "Prints this page and describes available methods"],
20
+ ["status", "Prints the status of all threads managed by Titan"],
21
+ ["version", "Prints the currently installed version"]
22
+ ]
23
+ @shell.print_table(available_methods)
24
+ end
25
+
26
+ desc "status", "Prints the status of all threads managed by Titan"
27
+ def status
28
+ table_header = ["id", "pid", "status"]
29
+ threads = Titan::Thread.all.each_value.collect { |thread|
30
+ [thread.id.to_s, thread.pid.to_s, thread.alive? ? "alive" : "dead"]
31
+ }
32
+ @shell.print_table(threads.unshift(table_header)) unless threads.empty?
33
+ end
34
+
35
+ desc "version", "Prints the currently installed version"
36
+ def version
37
+ @shell.say Titan::VERSION
38
+ end
39
+ map %w(--version -v) => :version
40
+ end
41
+ end
@@ -0,0 +1,1026 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 37
13
+ 5
14
+ 7
15
+ 0
16
+ 64
17
+ 47
18
+ 49
19
+ 1
20
+ 1
21
+ 15
22
+ 99
23
+ 7
24
+ 2
25
+ 65
26
+ 49
27
+ 3
28
+ 2
29
+ 13
30
+ 99
31
+ 12
32
+ 7
33
+ 4
34
+ 12
35
+ 7
36
+ 5
37
+ 12
38
+ 65
39
+ 12
40
+ 49
41
+ 6
42
+ 4
43
+ 15
44
+ 49
45
+ 4
46
+ 0
47
+ 15
48
+ 2
49
+ 11
50
+ I
51
+ 6
52
+ I
53
+ 0
54
+ I
55
+ 0
56
+ I
57
+ 0
58
+ n
59
+ p
60
+ 7
61
+ s
62
+ 4
63
+ thor
64
+ x
65
+ 7
66
+ require
67
+ x
68
+ 5
69
+ Titan
70
+ x
71
+ 11
72
+ open_module
73
+ x
74
+ 15
75
+ __module_init__
76
+ M
77
+ 1
78
+ n
79
+ n
80
+ x
81
+ 5
82
+ Titan
83
+ i
84
+ 31
85
+ 5
86
+ 66
87
+ 99
88
+ 7
89
+ 0
90
+ 45
91
+ 1
92
+ 2
93
+ 65
94
+ 49
95
+ 3
96
+ 3
97
+ 13
98
+ 99
99
+ 12
100
+ 7
101
+ 4
102
+ 12
103
+ 7
104
+ 5
105
+ 12
106
+ 65
107
+ 12
108
+ 49
109
+ 6
110
+ 4
111
+ 15
112
+ 49
113
+ 4
114
+ 0
115
+ 11
116
+ I
117
+ 6
118
+ I
119
+ 0
120
+ I
121
+ 0
122
+ I
123
+ 0
124
+ n
125
+ p
126
+ 7
127
+ x
128
+ 3
129
+ CLI
130
+ x
131
+ 4
132
+ Thor
133
+ n
134
+ x
135
+ 10
136
+ open_class
137
+ x
138
+ 14
139
+ __class_init__
140
+ M
141
+ 1
142
+ n
143
+ n
144
+ x
145
+ 3
146
+ CLI
147
+ i
148
+ 133
149
+ 5
150
+ 66
151
+ 5
152
+ 45
153
+ 0
154
+ 1
155
+ 43
156
+ 2
157
+ 47
158
+ 49
159
+ 3
160
+ 1
161
+ 15
162
+ 99
163
+ 7
164
+ 4
165
+ 7
166
+ 5
167
+ 65
168
+ 67
169
+ 49
170
+ 6
171
+ 0
172
+ 49
173
+ 7
174
+ 4
175
+ 15
176
+ 5
177
+ 7
178
+ 8
179
+ 64
180
+ 7
181
+ 9
182
+ 64
183
+ 47
184
+ 49
185
+ 10
186
+ 2
187
+ 15
188
+ 99
189
+ 7
190
+ 11
191
+ 7
192
+ 12
193
+ 65
194
+ 67
195
+ 49
196
+ 6
197
+ 0
198
+ 49
199
+ 7
200
+ 4
201
+ 15
202
+ 5
203
+ 7
204
+ 13
205
+ 64
206
+ 7
207
+ 14
208
+ 64
209
+ 47
210
+ 49
211
+ 10
212
+ 2
213
+ 15
214
+ 99
215
+ 7
216
+ 15
217
+ 7
218
+ 16
219
+ 65
220
+ 67
221
+ 49
222
+ 6
223
+ 0
224
+ 49
225
+ 7
226
+ 4
227
+ 15
228
+ 5
229
+ 7
230
+ 17
231
+ 64
232
+ 7
233
+ 18
234
+ 64
235
+ 47
236
+ 49
237
+ 10
238
+ 2
239
+ 15
240
+ 99
241
+ 7
242
+ 19
243
+ 7
244
+ 20
245
+ 65
246
+ 67
247
+ 49
248
+ 6
249
+ 0
250
+ 49
251
+ 7
252
+ 4
253
+ 15
254
+ 5
255
+ 44
256
+ 43
257
+ 21
258
+ 79
259
+ 49
260
+ 22
261
+ 1
262
+ 13
263
+ 7
264
+ 23
265
+ 64
266
+ 7
267
+ 24
268
+ 64
269
+ 35
270
+ 2
271
+ 7
272
+ 19
273
+ 49
274
+ 25
275
+ 2
276
+ 15
277
+ 47
278
+ 49
279
+ 26
280
+ 1
281
+ 11
282
+ I
283
+ 5
284
+ I
285
+ 0
286
+ I
287
+ 0
288
+ I
289
+ 0
290
+ n
291
+ p
292
+ 27
293
+ x
294
+ 4
295
+ Thor
296
+ n
297
+ x
298
+ 7
299
+ Actions
300
+ x
301
+ 7
302
+ include
303
+ x
304
+ 10
305
+ initialize
306
+ M
307
+ 1
308
+ n
309
+ n
310
+ x
311
+ 10
312
+ initialize
313
+ i
314
+ 35
315
+ 54
316
+ 89
317
+ 0
318
+ 15
319
+ 45
320
+ 1
321
+ 2
322
+ 43
323
+ 3
324
+ 43
325
+ 4
326
+ 13
327
+ 71
328
+ 5
329
+ 47
330
+ 9
331
+ 29
332
+ 47
333
+ 49
334
+ 6
335
+ 0
336
+ 13
337
+ 47
338
+ 49
339
+ 0
340
+ 0
341
+ 15
342
+ 8
343
+ 32
344
+ 49
345
+ 5
346
+ 0
347
+ 38
348
+ 7
349
+ 11
350
+ I
351
+ 3
352
+ I
353
+ 1
354
+ I
355
+ 0
356
+ I
357
+ 0
358
+ I
359
+ 0
360
+ p
361
+ 8
362
+ x
363
+ 10
364
+ initialize
365
+ x
366
+ 4
367
+ Thor
368
+ n
369
+ x
370
+ 5
371
+ Shell
372
+ x
373
+ 5
374
+ Basic
375
+ x
376
+ 3
377
+ new
378
+ x
379
+ 8
380
+ allocate
381
+ x
382
+ 6
383
+ @shell
384
+ p
385
+ 7
386
+ I
387
+ 0
388
+ I
389
+ 7
390
+ I
391
+ 0
392
+ I
393
+ 8
394
+ I
395
+ 4
396
+ I
397
+ 9
398
+ I
399
+ 23
400
+ x
401
+ 42
402
+ /Users/stefan/Codes/titan/lib/titan/cli.rb
403
+ p
404
+ 1
405
+ x
406
+ 14
407
+ @unnamed_splat
408
+ x
409
+ 17
410
+ method_visibility
411
+ x
412
+ 15
413
+ add_defn_method
414
+ s
415
+ 4
416
+ help
417
+ s
418
+ 40
419
+ Describes available command line options
420
+ x
421
+ 4
422
+ desc
423
+ x
424
+ 4
425
+ help
426
+ M
427
+ 1
428
+ n
429
+ n
430
+ x
431
+ 4
432
+ help
433
+ i
434
+ 71
435
+ 39
436
+ 0
437
+ 7
438
+ 1
439
+ 64
440
+ 49
441
+ 2
442
+ 1
443
+ 15
444
+ 39
445
+ 0
446
+ 7
447
+ 3
448
+ 64
449
+ 49
450
+ 2
451
+ 1
452
+ 15
453
+ 7
454
+ 4
455
+ 64
456
+ 7
457
+ 5
458
+ 64
459
+ 35
460
+ 2
461
+ 7
462
+ 3
463
+ 64
464
+ 7
465
+ 3
466
+ 64
467
+ 35
468
+ 2
469
+ 7
470
+ 6
471
+ 64
472
+ 7
473
+ 7
474
+ 64
475
+ 35
476
+ 2
477
+ 7
478
+ 8
479
+ 64
480
+ 7
481
+ 9
482
+ 64
483
+ 35
484
+ 2
485
+ 7
486
+ 10
487
+ 64
488
+ 7
489
+ 11
490
+ 64
491
+ 35
492
+ 2
493
+ 35
494
+ 5
495
+ 19
496
+ 0
497
+ 15
498
+ 39
499
+ 0
500
+ 20
501
+ 0
502
+ 49
503
+ 12
504
+ 1
505
+ 11
506
+ I
507
+ 7
508
+ I
509
+ 1
510
+ I
511
+ 0
512
+ I
513
+ 0
514
+ n
515
+ p
516
+ 13
517
+ x
518
+ 6
519
+ @shell
520
+ s
521
+ 70
522
+ The following methods are available through typing `titan method_name`
523
+ x
524
+ 3
525
+ say
526
+ s
527
+ 0
528
+
529
+ s
530
+ 11
531
+ method_name
532
+ s
533
+ 11
534
+ description
535
+ s
536
+ 4
537
+ help
538
+ s
539
+ 48
540
+ Prints this page and describes available methods
541
+ s
542
+ 6
543
+ status
544
+ s
545
+ 49
546
+ Prints the status of all threads managed by Titan
547
+ s
548
+ 7
549
+ version
550
+ s
551
+ 38
552
+ Prints the currently installed version
553
+ x
554
+ 11
555
+ print_table
556
+ p
557
+ 19
558
+ I
559
+ 0
560
+ I
561
+ d
562
+ I
563
+ 0
564
+ I
565
+ e
566
+ I
567
+ 9
568
+ I
569
+ f
570
+ I
571
+ 12
572
+ I
573
+ 11
574
+ I
575
+ 1a
576
+ I
577
+ 12
578
+ I
579
+ 22
580
+ I
581
+ 13
582
+ I
583
+ 2a
584
+ I
585
+ 14
586
+ I
587
+ 32
588
+ I
589
+ 15
590
+ I
591
+ 3f
592
+ I
593
+ 17
594
+ I
595
+ 47
596
+ x
597
+ 42
598
+ /Users/stefan/Codes/titan/lib/titan/cli.rb
599
+ p
600
+ 1
601
+ x
602
+ 17
603
+ available_methods
604
+ s
605
+ 6
606
+ status
607
+ s
608
+ 49
609
+ Prints the status of all threads managed by Titan
610
+ x
611
+ 6
612
+ status
613
+ M
614
+ 1
615
+ n
616
+ n
617
+ x
618
+ 6
619
+ status
620
+ i
621
+ 56
622
+ 7
623
+ 0
624
+ 64
625
+ 7
626
+ 1
627
+ 64
628
+ 7
629
+ 2
630
+ 64
631
+ 35
632
+ 3
633
+ 19
634
+ 0
635
+ 15
636
+ 45
637
+ 3
638
+ 4
639
+ 43
640
+ 5
641
+ 49
642
+ 6
643
+ 0
644
+ 49
645
+ 7
646
+ 0
647
+ 56
648
+ 8
649
+ 50
650
+ 9
651
+ 0
652
+ 19
653
+ 1
654
+ 15
655
+ 20
656
+ 1
657
+ 49
658
+ 10
659
+ 0
660
+ 9
661
+ 43
662
+ 1
663
+ 8
664
+ 55
665
+ 39
666
+ 11
667
+ 20
668
+ 1
669
+ 20
670
+ 0
671
+ 49
672
+ 12
673
+ 1
674
+ 49
675
+ 13
676
+ 1
677
+ 11
678
+ I
679
+ 5
680
+ I
681
+ 2
682
+ I
683
+ 0
684
+ I
685
+ 0
686
+ n
687
+ p
688
+ 14
689
+ s
690
+ 2
691
+ id
692
+ s
693
+ 3
694
+ pid
695
+ s
696
+ 6
697
+ status
698
+ x
699
+ 5
700
+ Titan
701
+ n
702
+ x
703
+ 6
704
+ Thread
705
+ x
706
+ 3
707
+ all
708
+ x
709
+ 10
710
+ each_value
711
+ M
712
+ 1
713
+ p
714
+ 2
715
+ x
716
+ 9
717
+ for_block
718
+ t
719
+ n
720
+ x
721
+ 6
722
+ status
723
+ i
724
+ 38
725
+ 57
726
+ 19
727
+ 0
728
+ 15
729
+ 20
730
+ 0
731
+ 49
732
+ 0
733
+ 0
734
+ 49
735
+ 1
736
+ 0
737
+ 20
738
+ 0
739
+ 49
740
+ 2
741
+ 0
742
+ 49
743
+ 1
744
+ 0
745
+ 20
746
+ 0
747
+ 49
748
+ 3
749
+ 0
750
+ 9
751
+ 32
752
+ 7
753
+ 4
754
+ 64
755
+ 8
756
+ 35
757
+ 7
758
+ 5
759
+ 64
760
+ 35
761
+ 3
762
+ 11
763
+ I
764
+ 5
765
+ I
766
+ 1
767
+ I
768
+ 1
769
+ I
770
+ 1
771
+ n
772
+ p
773
+ 6
774
+ x
775
+ 2
776
+ id
777
+ x
778
+ 4
779
+ to_s
780
+ x
781
+ 3
782
+ pid
783
+ x
784
+ 6
785
+ alive?
786
+ s
787
+ 5
788
+ alive
789
+ s
790
+ 4
791
+ dead
792
+ p
793
+ 5
794
+ I
795
+ 0
796
+ I
797
+ 1d
798
+ I
799
+ 4
800
+ I
801
+ 1e
802
+ I
803
+ 26
804
+ x
805
+ 42
806
+ /Users/stefan/Codes/titan/lib/titan/cli.rb
807
+ p
808
+ 1
809
+ x
810
+ 6
811
+ thread
812
+ x
813
+ 7
814
+ collect
815
+ x
816
+ 6
817
+ empty?
818
+ x
819
+ 6
820
+ @shell
821
+ x
822
+ 7
823
+ unshift
824
+ x
825
+ 11
826
+ print_table
827
+ p
828
+ 9
829
+ I
830
+ 0
831
+ I
832
+ 1b
833
+ I
834
+ 0
835
+ I
836
+ 1c
837
+ I
838
+ e
839
+ I
840
+ 1d
841
+ I
842
+ 21
843
+ I
844
+ 20
845
+ I
846
+ 38
847
+ x
848
+ 42
849
+ /Users/stefan/Codes/titan/lib/titan/cli.rb
850
+ p
851
+ 2
852
+ x
853
+ 12
854
+ table_header
855
+ x
856
+ 7
857
+ threads
858
+ s
859
+ 7
860
+ version
861
+ s
862
+ 38
863
+ Prints the currently installed version
864
+ x
865
+ 7
866
+ version
867
+ M
868
+ 1
869
+ n
870
+ n
871
+ x
872
+ 7
873
+ version
874
+ i
875
+ 11
876
+ 39
877
+ 0
878
+ 45
879
+ 1
880
+ 2
881
+ 43
882
+ 3
883
+ 49
884
+ 4
885
+ 1
886
+ 11
887
+ I
888
+ 2
889
+ I
890
+ 0
891
+ I
892
+ 0
893
+ I
894
+ 0
895
+ n
896
+ p
897
+ 5
898
+ x
899
+ 6
900
+ @shell
901
+ x
902
+ 5
903
+ Titan
904
+ n
905
+ x
906
+ 7
907
+ VERSION
908
+ x
909
+ 3
910
+ say
911
+ p
912
+ 5
913
+ I
914
+ 0
915
+ I
916
+ 24
917
+ I
918
+ 0
919
+ I
920
+ 25
921
+ I
922
+ b
923
+ x
924
+ 42
925
+ /Users/stefan/Codes/titan/lib/titan/cli.rb
926
+ p
927
+ 0
928
+ x
929
+ 4
930
+ Hash
931
+ x
932
+ 16
933
+ new_from_literal
934
+ s
935
+ 9
936
+ --version
937
+ s
938
+ 2
939
+ -v
940
+ x
941
+ 3
942
+ []=
943
+ x
944
+ 3
945
+ map
946
+ p
947
+ 19
948
+ I
949
+ 2
950
+ I
951
+ 5
952
+ I
953
+ d
954
+ I
955
+ 7
956
+ I
957
+ 1b
958
+ I
959
+ c
960
+ I
961
+ 27
962
+ I
963
+ d
964
+ I
965
+ 35
966
+ I
967
+ 1a
968
+ I
969
+ 41
970
+ I
971
+ 1b
972
+ I
973
+ 4f
974
+ I
975
+ 23
976
+ I
977
+ 5b
978
+ I
979
+ 24
980
+ I
981
+ 69
982
+ I
983
+ 27
984
+ I
985
+ 85
986
+ x
987
+ 42
988
+ /Users/stefan/Codes/titan/lib/titan/cli.rb
989
+ p
990
+ 0
991
+ x
992
+ 13
993
+ attach_method
994
+ p
995
+ 3
996
+ I
997
+ 2
998
+ I
999
+ 4
1000
+ I
1001
+ 1f
1002
+ x
1003
+ 42
1004
+ /Users/stefan/Codes/titan/lib/titan/cli.rb
1005
+ p
1006
+ 0
1007
+ x
1008
+ 13
1009
+ attach_method
1010
+ p
1011
+ 5
1012
+ I
1013
+ 0
1014
+ I
1015
+ 1
1016
+ I
1017
+ 9
1018
+ I
1019
+ 3
1020
+ I
1021
+ 25
1022
+ x
1023
+ 42
1024
+ /Users/stefan/Codes/titan/lib/titan/cli.rb
1025
+ p
1026
+ 0