ref 1.0.5 → 2.0.0

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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +41 -0
  3. data/lib/ref.rb +28 -29
  4. data/lib/ref/abstract_reference_key_map.rb +72 -28
  5. data/lib/ref/abstract_reference_value_map.rb +61 -18
  6. data/lib/ref/reference_queue.rb +8 -8
  7. data/lib/ref/soft_reference.rb +7 -7
  8. data/lib/ref/version.rb +3 -0
  9. data/lib/ref/weak_reference/pure_ruby.rb +9 -9
  10. data/lib/ref_ext.jar +0 -0
  11. metadata +23 -49
  12. data/README.rdoc +0 -40
  13. data/VERSION +0 -1
  14. data/lib/org/jruby/ext/ref/references.jar +0 -0
  15. data/lib/ref/mock.rb +0 -150
  16. data/lib/ref/safe_monitor.rb +0 -50
  17. data/lib/ref/weak_reference/iron_ruby.rb +0 -14
  18. data/test/mock_test.rb +0 -33
  19. data/test/mock_test.rbc +0 -856
  20. data/test/reference_key_map_behavior.rb +0 -155
  21. data/test/reference_key_map_behavior.rbc +0 -4241
  22. data/test/reference_queue_test.rb +0 -60
  23. data/test/reference_queue_test.rbc +0 -1938
  24. data/test/reference_value_map_behavior.rb +0 -135
  25. data/test/reference_value_map_behavior.rbc +0 -3560
  26. data/test/soft_key_map_test.rb +0 -13
  27. data/test/soft_key_map_test.rbc +0 -331
  28. data/test/soft_reference_test.rb +0 -49
  29. data/test/soft_reference_test.rbc +0 -1481
  30. data/test/soft_value_map_test.rb +0 -13
  31. data/test/soft_value_map_test.rbc +0 -331
  32. data/test/strong_reference_test.rb +0 -15
  33. data/test/strong_reference_test.rbc +0 -546
  34. data/test/test_helper.rb +0 -4
  35. data/test/test_helper.rbc +0 -143
  36. data/test/weak_key_map_test.rb +0 -13
  37. data/test/weak_key_map_test.rbc +0 -331
  38. data/test/weak_reference_test.rb +0 -54
  39. data/test/weak_reference_test.rbc +0 -1510
  40. data/test/weak_value_map_test.rb +0 -13
  41. data/test/weak_value_map_test.rbc +0 -331
@@ -1,14 +0,0 @@
1
- module Ref
2
- class WeakReference < Reference
3
- # This implementation of a weak reference wraps the System::WeakReference class
4
- # that comes with IronRuby.
5
- def initialize(obj) #:nodoc:
6
- @referenced_object_id = obj.__id__
7
- @ref = ::System::WeakReference.new(obj)
8
- end
9
-
10
- def object #:nodoc:
11
- @ref.target
12
- end
13
- end
14
- end
@@ -1,33 +0,0 @@
1
- require File.expand_path("../test_helper", __FILE__)
2
-
3
- class TestMock < Test::Unit::TestCase
4
- def test_gc_with_argument
5
- Ref::Mock.use do
6
- obj_1 = Object.new
7
- obj_2 = Object.new
8
-
9
- ref_1 = Ref::WeakReference.new(obj_1)
10
- ref_2 = Ref::WeakReference.new(obj_2)
11
-
12
- Ref::Mock.gc(obj_1)
13
-
14
- assert_nil ref_1.object
15
- assert_equal ref_2.object, obj_2
16
- end
17
- end
18
-
19
- def test_gc_with_no_argument
20
- Ref::Mock.use do
21
- obj_1 = Object.new
22
- obj_2 = Object.new
23
-
24
- ref_1 = Ref::WeakReference.new(obj_1)
25
- ref_2 = Ref::WeakReference.new(obj_2)
26
-
27
- Ref::Mock.gc
28
-
29
- assert_nil ref_1.object
30
- assert_nil ref_2.object
31
- end
32
- end
33
- end
@@ -1,856 +0,0 @@
1
- !RBIX
2
- 12529030924842180271
3
- x
4
- M
5
- 1
6
- n
7
- n
8
- x
9
- 10
10
- __script__
11
- i
12
- 54
13
- 5
14
- 45
15
- 0
16
- 1
17
- 7
18
- 2
19
- 64
20
- 65
21
- 49
22
- 3
23
- 0
24
- 49
25
- 4
26
- 2
27
- 47
28
- 49
29
- 5
30
- 1
31
- 15
32
- 99
33
- 7
34
- 6
35
- 45
36
- 7
37
- 8
38
- 43
39
- 9
40
- 43
41
- 10
42
- 65
43
- 49
44
- 11
45
- 3
46
- 13
47
- 99
48
- 12
49
- 7
50
- 12
51
- 12
52
- 7
53
- 13
54
- 12
55
- 65
56
- 12
57
- 49
58
- 14
59
- 4
60
- 15
61
- 49
62
- 12
63
- 0
64
- 15
65
- 2
66
- 11
67
- I
68
- 6
69
- I
70
- 0
71
- I
72
- 0
73
- I
74
- 0
75
- n
76
- p
77
- 15
78
- x
79
- 4
80
- File
81
- n
82
- s
83
- 14
84
- ../test_helper
85
- x
86
- 11
87
- active_path
88
- x
89
- 11
90
- expand_path
91
- x
92
- 7
93
- require
94
- x
95
- 8
96
- TestMock
97
- x
98
- 4
99
- Test
100
- n
101
- x
102
- 4
103
- Unit
104
- x
105
- 8
106
- TestCase
107
- x
108
- 10
109
- open_class
110
- x
111
- 14
112
- __class_init__
113
- M
114
- 1
115
- n
116
- n
117
- x
118
- 8
119
- TestMock
120
- i
121
- 30
122
- 5
123
- 66
124
- 99
125
- 7
126
- 0
127
- 7
128
- 1
129
- 65
130
- 67
131
- 49
132
- 2
133
- 0
134
- 49
135
- 3
136
- 4
137
- 15
138
- 99
139
- 7
140
- 4
141
- 7
142
- 5
143
- 65
144
- 67
145
- 49
146
- 2
147
- 0
148
- 49
149
- 3
150
- 4
151
- 11
152
- I
153
- 5
154
- I
155
- 0
156
- I
157
- 0
158
- I
159
- 0
160
- n
161
- p
162
- 6
163
- x
164
- 21
165
- test_gc_with_argument
166
- M
167
- 1
168
- n
169
- n
170
- x
171
- 21
172
- test_gc_with_argument
173
- i
174
- 11
175
- 45
176
- 0
177
- 1
178
- 43
179
- 2
180
- 56
181
- 3
182
- 50
183
- 4
184
- 0
185
- 11
186
- I
187
- 2
188
- I
189
- 0
190
- I
191
- 0
192
- I
193
- 0
194
- n
195
- p
196
- 5
197
- x
198
- 3
199
- Ref
200
- n
201
- x
202
- 4
203
- Mock
204
- M
205
- 1
206
- p
207
- 2
208
- x
209
- 9
210
- for_block
211
- t
212
- n
213
- x
214
- 21
215
- test_gc_with_argument
216
- i
217
- 155
218
- 45
219
- 0
220
- 1
221
- 13
222
- 71
223
- 2
224
- 47
225
- 9
226
- 21
227
- 47
228
- 49
229
- 3
230
- 0
231
- 13
232
- 47
233
- 49
234
- 4
235
- 0
236
- 15
237
- 8
238
- 24
239
- 49
240
- 2
241
- 0
242
- 19
243
- 0
244
- 15
245
- 45
246
- 0
247
- 5
248
- 13
249
- 71
250
- 2
251
- 47
252
- 9
253
- 48
254
- 47
255
- 49
256
- 3
257
- 0
258
- 13
259
- 47
260
- 49
261
- 4
262
- 0
263
- 15
264
- 8
265
- 51
266
- 49
267
- 2
268
- 0
269
- 19
270
- 1
271
- 15
272
- 45
273
- 6
274
- 7
275
- 43
276
- 8
277
- 13
278
- 71
279
- 2
280
- 47
281
- 9
282
- 79
283
- 47
284
- 49
285
- 3
286
- 0
287
- 13
288
- 20
289
- 0
290
- 47
291
- 49
292
- 4
293
- 1
294
- 15
295
- 8
296
- 84
297
- 20
298
- 0
299
- 49
300
- 2
301
- 1
302
- 19
303
- 2
304
- 15
305
- 45
306
- 6
307
- 9
308
- 43
309
- 8
310
- 13
311
- 71
312
- 2
313
- 47
314
- 9
315
- 112
316
- 47
317
- 49
318
- 3
319
- 0
320
- 13
321
- 20
322
- 1
323
- 47
324
- 49
325
- 4
326
- 1
327
- 15
328
- 8
329
- 117
330
- 20
331
- 1
332
- 49
333
- 2
334
- 1
335
- 19
336
- 3
337
- 15
338
- 45
339
- 6
340
- 10
341
- 43
342
- 11
343
- 20
344
- 0
345
- 49
346
- 12
347
- 1
348
- 15
349
- 5
350
- 20
351
- 2
352
- 49
353
- 13
354
- 0
355
- 47
356
- 49
357
- 14
358
- 1
359
- 15
360
- 5
361
- 20
362
- 3
363
- 49
364
- 13
365
- 0
366
- 20
367
- 1
368
- 47
369
- 49
370
- 15
371
- 2
372
- 11
373
- I
374
- 8
375
- I
376
- 4
377
- I
378
- 0
379
- I
380
- 0
381
- I
382
- -2
383
- p
384
- 16
385
- x
386
- 6
387
- Object
388
- n
389
- x
390
- 3
391
- new
392
- x
393
- 8
394
- allocate
395
- x
396
- 10
397
- initialize
398
- n
399
- x
400
- 3
401
- Ref
402
- n
403
- x
404
- 13
405
- WeakReference
406
- n
407
- n
408
- x
409
- 4
410
- Mock
411
- x
412
- 2
413
- gc
414
- x
415
- 6
416
- object
417
- x
418
- 10
419
- assert_nil
420
- x
421
- 12
422
- assert_equal
423
- p
424
- 15
425
- I
426
- 0
427
- I
428
- 6
429
- I
430
- 1b
431
- I
432
- 7
433
- I
434
- 36
435
- I
436
- 9
437
- I
438
- 57
439
- I
440
- a
441
- I
442
- 78
443
- I
444
- c
445
- I
446
- 83
447
- I
448
- e
449
- I
450
- 8e
451
- I
452
- f
453
- I
454
- 9b
455
- x
456
- 49
457
- /Users/bdurand/dev/projects/ref/test/mock_test.rb
458
- p
459
- 4
460
- x
461
- 5
462
- obj_1
463
- x
464
- 5
465
- obj_2
466
- x
467
- 5
468
- ref_1
469
- x
470
- 5
471
- ref_2
472
- x
473
- 3
474
- use
475
- p
476
- 5
477
- I
478
- -1
479
- I
480
- 4
481
- I
482
- 0
483
- I
484
- 5
485
- I
486
- b
487
- x
488
- 49
489
- /Users/bdurand/dev/projects/ref/test/mock_test.rb
490
- p
491
- 0
492
- x
493
- 17
494
- method_visibility
495
- x
496
- 15
497
- add_defn_method
498
- x
499
- 24
500
- test_gc_with_no_argument
501
- M
502
- 1
503
- n
504
- n
505
- x
506
- 24
507
- test_gc_with_no_argument
508
- i
509
- 11
510
- 45
511
- 0
512
- 1
513
- 43
514
- 2
515
- 56
516
- 3
517
- 50
518
- 4
519
- 0
520
- 11
521
- I
522
- 2
523
- I
524
- 0
525
- I
526
- 0
527
- I
528
- 0
529
- n
530
- p
531
- 5
532
- x
533
- 3
534
- Ref
535
- n
536
- x
537
- 4
538
- Mock
539
- M
540
- 1
541
- p
542
- 2
543
- x
544
- 9
545
- for_block
546
- t
547
- n
548
- x
549
- 24
550
- test_gc_with_no_argument
551
- i
552
- 151
553
- 45
554
- 0
555
- 1
556
- 13
557
- 71
558
- 2
559
- 47
560
- 9
561
- 21
562
- 47
563
- 49
564
- 3
565
- 0
566
- 13
567
- 47
568
- 49
569
- 4
570
- 0
571
- 15
572
- 8
573
- 24
574
- 49
575
- 2
576
- 0
577
- 19
578
- 0
579
- 15
580
- 45
581
- 0
582
- 5
583
- 13
584
- 71
585
- 2
586
- 47
587
- 9
588
- 48
589
- 47
590
- 49
591
- 3
592
- 0
593
- 13
594
- 47
595
- 49
596
- 4
597
- 0
598
- 15
599
- 8
600
- 51
601
- 49
602
- 2
603
- 0
604
- 19
605
- 1
606
- 15
607
- 45
608
- 6
609
- 7
610
- 43
611
- 8
612
- 13
613
- 71
614
- 2
615
- 47
616
- 9
617
- 79
618
- 47
619
- 49
620
- 3
621
- 0
622
- 13
623
- 20
624
- 0
625
- 47
626
- 49
627
- 4
628
- 1
629
- 15
630
- 8
631
- 84
632
- 20
633
- 0
634
- 49
635
- 2
636
- 1
637
- 19
638
- 2
639
- 15
640
- 45
641
- 6
642
- 9
643
- 43
644
- 8
645
- 13
646
- 71
647
- 2
648
- 47
649
- 9
650
- 112
651
- 47
652
- 49
653
- 3
654
- 0
655
- 13
656
- 20
657
- 1
658
- 47
659
- 49
660
- 4
661
- 1
662
- 15
663
- 8
664
- 117
665
- 20
666
- 1
667
- 49
668
- 2
669
- 1
670
- 19
671
- 3
672
- 15
673
- 45
674
- 6
675
- 10
676
- 43
677
- 11
678
- 49
679
- 12
680
- 0
681
- 15
682
- 5
683
- 20
684
- 2
685
- 49
686
- 13
687
- 0
688
- 47
689
- 49
690
- 14
691
- 1
692
- 15
693
- 5
694
- 20
695
- 3
696
- 49
697
- 13
698
- 0
699
- 47
700
- 49
701
- 14
702
- 1
703
- 11
704
- I
705
- 8
706
- I
707
- 4
708
- I
709
- 0
710
- I
711
- 0
712
- I
713
- -2
714
- p
715
- 15
716
- x
717
- 6
718
- Object
719
- n
720
- x
721
- 3
722
- new
723
- x
724
- 8
725
- allocate
726
- x
727
- 10
728
- initialize
729
- n
730
- x
731
- 3
732
- Ref
733
- n
734
- x
735
- 13
736
- WeakReference
737
- n
738
- n
739
- x
740
- 4
741
- Mock
742
- x
743
- 2
744
- gc
745
- x
746
- 6
747
- object
748
- x
749
- 10
750
- assert_nil
751
- p
752
- 15
753
- I
754
- 0
755
- I
756
- 15
757
- I
758
- 1b
759
- I
760
- 16
761
- I
762
- 36
763
- I
764
- 18
765
- I
766
- 57
767
- I
768
- 19
769
- I
770
- 78
771
- I
772
- 1b
773
- I
774
- 81
775
- I
776
- 1d
777
- I
778
- 8c
779
- I
780
- 1e
781
- I
782
- 97
783
- x
784
- 49
785
- /Users/bdurand/dev/projects/ref/test/mock_test.rb
786
- p
787
- 4
788
- x
789
- 5
790
- obj_1
791
- x
792
- 5
793
- obj_2
794
- x
795
- 5
796
- ref_1
797
- x
798
- 5
799
- ref_2
800
- x
801
- 3
802
- use
803
- p
804
- 5
805
- I
806
- -1
807
- I
808
- 13
809
- I
810
- 0
811
- I
812
- 14
813
- I
814
- b
815
- x
816
- 49
817
- /Users/bdurand/dev/projects/ref/test/mock_test.rb
818
- p
819
- 0
820
- p
821
- 5
822
- I
823
- 2
824
- I
825
- 4
826
- I
827
- 10
828
- I
829
- 13
830
- I
831
- 1e
832
- x
833
- 49
834
- /Users/bdurand/dev/projects/ref/test/mock_test.rb
835
- p
836
- 0
837
- x
838
- 13
839
- attach_method
840
- p
841
- 5
842
- I
843
- 0
844
- I
845
- 1
846
- I
847
- 13
848
- I
849
- 3
850
- I
851
- 36
852
- x
853
- 49
854
- /Users/bdurand/dev/projects/ref/test/mock_test.rb
855
- p
856
- 0