rbtree 0.3.0 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (11) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +1 -1
  3. data/MANIFEST +0 -1
  4. data/README +38 -71
  5. data/dict.c +364 -83
  6. data/dict.h +30 -6
  7. data/extconf.rb +13 -2
  8. data/rbtree.c +772 -482
  9. data/test.rb +309 -182
  10. metadata +42 -45
  11. data/ChangeLog +0 -505
metadata CHANGED
@@ -1,28 +1,28 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rbtree
3
- version: !ruby/object:Gem::Version
4
- version: 0.3.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.4
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - OZAWA Takuma
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2009-11-14 00:00:00 +09:00
13
- default_executable:
11
+ date: 2021-01-01 00:00:00.000000000 Z
14
12
  dependencies: []
15
-
16
- description: RBTree is a sorted associative collection that is implemented with Red-Black Tree. The elements of RBTree are ordered and its interface is the almost same as Hash, so simply you can consider RBTree sorted Hash.
17
- email: burningdowntheopera at yahoo dot co dot jp
13
+ description: |
14
+ A RBTree is a sorted associative collection that is implemented with a
15
+ Red-Black Tree. It maps keys to values like a Hash, but maintains its
16
+ elements in ascending key order. The interface is the almost identical
17
+ to that of Hash.
18
+ email:
18
19
  executables: []
19
-
20
- extensions:
20
+ extensions:
21
21
  - extconf.rb
22
- extra_rdoc_files:
22
+ extra_rdoc_files:
23
+ - README
23
24
  - rbtree.c
24
- files:
25
- - ChangeLog
25
+ files:
26
26
  - LICENSE
27
27
  - MANIFEST
28
28
  - README
@@ -32,37 +32,34 @@ files:
32
32
  - extconf.rb
33
33
  - rbtree.c
34
34
  - test.rb
35
- has_rdoc: true
36
- homepage: http://www.geocities.co.jp/SiliconValley-PaloAlto/3388/rbtree/README.html
37
- post_install_message:
38
- rdoc_options:
39
- - -S
40
- - -t
41
- - ruby-rbtree
42
- - --main
43
- - MultiRBTree
44
- - --exclude
45
- - .*
46
- require_paths:
47
- - .
48
- required_ruby_version: !ruby/object:Gem::Requirement
49
- requirements:
35
+ homepage: http://rbtree.rubyforge.org/
36
+ licenses:
37
+ - MIT
38
+ metadata: {}
39
+ post_install_message:
40
+ rdoc_options:
41
+ - "--title"
42
+ - Ruby/RBTree
43
+ - "--main"
44
+ - README
45
+ - "--exclude"
46
+ - "\\A(?!README|rbtree\\.c).*\\z"
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ requirements:
50
51
  - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 1.8.0
53
- version:
54
- required_rubygems_version: !ruby/object:Gem::Requirement
55
- requirements:
52
+ - !ruby/object:Gem::Version
53
+ version: 1.8.6
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
56
  - - ">="
57
- - !ruby/object:Gem::Version
58
- version: "0"
59
- version:
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
60
59
  requirements: []
61
-
62
- rubyforge_project: rbtree
63
- rubygems_version: 1.3.1
64
- signing_key:
65
- specification_version: 2
60
+ rubygems_version: 3.2.3
61
+ signing_key:
62
+ specification_version: 4
66
63
  summary: A sorted associative collection.
67
- test_files:
64
+ test_files:
68
65
  - test.rb
data/ChangeLog DELETED
@@ -1,505 +0,0 @@
1
- 2009-11-14 OZAWA Takuma
2
-
3
- * version 0.3.0 released.
4
-
5
- 2009-11-10 OZAWA Takuma
6
-
7
- * rbtree.c: applied patches for Ruby 1.9 by Florian Gilcher and
8
- Nobu Nakada. Thanks.
9
- http://redmine.ruby-lang.org/issues/show/2348
10
-
11
- * test.rb: ditto.
12
-
13
- * extconf.rb: ditto.
14
-
15
- * extconf.rb: remove options for only gcc.
16
-
17
- * test.rb (test_inspect): correct recursion tests.
18
-
19
- * rbtree.c (rbtree_to_s_recursive): should return if recursive.
20
-
21
- * test.rb (test_to_s): add recursion tests.
22
-
23
- 2009-01-27 OZAWA Takuma
24
-
25
- * version 0.2.1 released.
26
-
27
- * README: fixed documents.
28
-
29
- * rbtree.c: ditto.
30
-
31
- 2009-01-23 OZAWA Takuma
32
-
33
- * rbtree.c (RETURN_ENUMERATOR): do nothing if rb_enumeratorize not
34
- defined.
35
-
36
- * rbtree.c (RBTREE_IN_ITERATION): removed. it has been not used.
37
-
38
- * rbtree.c (HAVE_RB_MARSHAL_LOAD, HAVE_RB_OBJ_INIT_COPY,
39
- HAVE_OBJECT_ALLOCATE, HAVE_RB_BLOCK_PROC, HAVE_RB_YIELD_VALUES):
40
- removed macros for Ruby 1.6.x.
41
-
42
- * extconf.rb (HAVE_RB_MARSHAL_LOAD, HAVE_RB_OBJ_INIT_COPY,
43
- HAVE_OBJECT_ALLOCATE, HAVE_RB_BLOCK_PROC, HAVE_RB_YIELD_VALUES):
44
- ditto.
45
-
46
- * rbtree.c (cmpint): removed a few codes for Ruby 1.6.x.
47
-
48
- * test.rb: ditto.
49
-
50
- * test.rb: (assert_raise): removed an alias for RubyUnit. use
51
- assert_raises.
52
-
53
- * extconf.rb: removed checking for inline keyword.
54
-
55
- 2009-01-21 OZAWA Takuma
56
-
57
- * extconf.rb: removed gcc options for portability. Thanks to
58
- Masatoshi SEKI.
59
-
60
- 2008-12-26 OZAWA Takuma
61
-
62
- * rbtree.c (rbtree_each, rbtree_each_pair, rbtree_each_key,
63
- rbtree_each_value, rbtree_reverse_each, rbtree_delete_if,
64
- rbtree_reject_bang, rbtree_select): Return an enumerator if no
65
- block is given.
66
-
67
- 2008-12-24 OZAWA Takuma
68
-
69
- * rbtree.c (rbtree_s_create): check and convert argument inner arrays (assocs) using #to_ary.
70
-
71
- * rbtree.c (rbtree_s_create): check and convert argument hash using #to_hash.
72
-
73
- * rbtree.c (rbtree_s_create): RBTree#[] now takes assocs as source of rbtree conversion.
74
-
75
- * rbtree.c (rbtree_to_hash): can't convert MultiRBTree to Hash.
76
-
77
- * rbtree.c (rbtree_s_create): can't convert MultiRBTree to RBTree.
78
-
79
- * rbtree.c (rbtree_s_create, rbtree_values_at): use long for loop counter instead of int.
80
-
81
- 2007-09-21 OZAWA Takuma
82
-
83
- * extconf.rb: no gcc options for mswin32.
84
-
85
- 2007-02-01 OZAWA Takuma
86
-
87
- * version 0.2.0 released.
88
-
89
- 2007-01-25 OZAWA Takuma
90
-
91
- * rbtree.c (rbtree_readjust): remove a warning.
92
-
93
- * rbtree.c (rbtree_default): should not call default procedure if
94
- no key is given.
95
-
96
- * rbtree.c (rbtree_equal): returns true if two rbtrees have same
97
- set of key-value set.
98
-
99
- 2004-10-27 OZAWA Takuma
100
-
101
- * version 0.1.3 released.
102
-
103
- 2004-07-29 OZAWA Takuma
104
-
105
- * rbtree.c (rbtree_bound): RBTree#bound(lower, upper = lower).
106
-
107
- 2004-07-11 OZAWA Takuma
108
-
109
- * rbtree.c (MultiRBTree): new class. MultiRBTree allows duplicates
110
- of keys.
111
-
112
- * rbtree.c (rbtree_dump, rbtree_s_load): use Array as a storage
113
- for performance improvement.
114
-
115
- * rbtree.c (rbtree_equal, rbtree_initialize_copy, rbtree_update):
116
- should use rb_obj_is_kind_of.
117
-
118
- * rbtree.c (iter_lev): added to count iterator level for nesting
119
- and thread-safety.
120
-
121
- 2004-06-29 OZAWA Takuma
122
-
123
- * dict.c: remove codes Ruby/RBTree doesn't need. now not supposed
124
- to use dict.c with other program.
125
-
126
- * dict.h: ditto.
127
-
128
- * dict.c (dict_equal): remove key_eql argument. use
129
- dict->dict_compare to compare keys.
130
-
131
- 2004-06-20 OZAWA Takuma
132
-
133
- * rbtree.c (rbtree_cmp): use rb_str_cmp if the type of keys is
134
- string.
135
-
136
- * rbtree.c (rbtree_cmp): use rb_cmpint.
137
-
138
- * rbtree.c (rbtree_user_cmp): ditto.
139
-
140
- 2004-06-12 OZAWA Takuma
141
-
142
- * version 0.1.2 release.
143
-
144
- 2004-05-31 OZAWA Takuma
145
-
146
- * rbtree.c (rbtree_initialize_copy): if an exception is raised in
147
- the method rbtree is not modified.
148
-
149
- * rbtree.c (rbtree_delete_if): if an exception is raised in the
150
- block rbtree is not modified(no keys are deleted).
151
-
152
- * rbtree.c (rbtree_readjust): use rb_gc_force_recycle.
153
-
154
- 2004-05-24 OZAWA Takuma
155
-
156
- * rbtree.c (rbtree_initialize_copy): use aset_i. duplicating a key
157
- of string is fast because of copy-on-write.
158
-
159
- * rbtree.c (rbtree_readjust): ditto.
160
-
161
- * rbtree.c (rbtree_update): ditto.
162
-
163
- * rbtree.c (rbtree_aset): no dict_lookup for better performance.
164
-
165
- * rbtree.c (rbtree_update): was same whether a block is given or not.
166
-
167
- 2004-05-23 OZAWA Takuma
168
-
169
- * rbtree.c (inspect_rbtree): add OBJ_INFECTs.
170
-
171
- * rbtree.c (inspect_rbtree): change ``compare'' to ``cmp_proc''.
172
-
173
- * rbtree.c (pp_block): ditto.
174
-
175
- 2004-04-26 OZAWA Takuma
176
-
177
- * rbtree.c (rbtree_s_create): accept Hash argument.
178
-
179
- * rbtree.c (rbtree_s_create): should just copy keys and values.
180
-
181
- 2004-02-19 OZAWA Takuma
182
-
183
- * rbtree.c (pp_object_group): use id_object_group.
184
-
185
- 2004-02-16 OZAWA Takuma
186
-
187
- * version 0.1.1 release.
188
-
189
- 2004-02-13 OZAWA Takuma
190
-
191
- * README: rewritten.
192
-
193
- * rbtree.c (document): incomplete document for rdoc.
194
-
195
- 2004-02-08 OZAWA Takuma
196
-
197
- * test.rb (test_pp): add pretty printing test.
198
-
199
- 2004-02-07 OZAWA Takuma
200
-
201
- * rbtree.c (rbtree_mark): should check rbtree and dict is
202
- initialized. Thanks to Neil Spring.
203
-
204
- 2004-02-05 OZAWA Takuma
205
-
206
- * rbtree.c (prettyprint): polish code.
207
-
208
- * test.rb (assert_raise): alias of assert_raises for Ruby 1.6.x.
209
-
210
- 2004-02-02 OZAWA Takuma
211
-
212
- * test.rb: clean code. no more RUnit support. use Test::Unit.
213
-
214
- 2004-01-29 OZAWA Takuma
215
-
216
- * rbtree.c (rbtree_dump): optimization.
217
-
218
- * rbtree.c (rbtree_s_load): ditto.
219
-
220
- 2004-01-27 OZAWA Takuma
221
-
222
- * rbtree.c (readjust): RBTree#readjust() just readjusts elements
223
- using current comparison block. use RBTree#readjust(nil) to set
224
- default comparison block.
225
-
226
- * extconf.rb (assertion): removed.
227
-
228
- 2004-01-14 OZAWA Takuma
229
-
230
- * ctest/test.c: removed.
231
-
232
- * ctest/testlib.c: ditto.
233
-
234
- * ctest/testlib.h: ditto.
235
-
236
- * ctest/Makefile: ditto.
237
-
238
- 2004-01-04 OZAWA Takuma
239
-
240
- * version 0.1.0 release.
241
-
242
- 2004-01-03 OZAWA Takuma
243
-
244
- * rbtree.c (rbtree_to_rbtree): new method.
245
-
246
- * rbtree.c (each_pair_i, rbtree_bound_body, rbtree_delete_if_body,
247
- select_i, update_block_i): use rb_yield_values.
248
-
249
- * rbtree.c (rbtree_each): RBTree#each should yield single value.
250
-
251
- * rbtree.c (rbtree_select): select(key..) is removed.
252
-
253
- * rbtree.c (rbtree_fetch): always warn if default argument and a
254
- block are supplied at the same time.
255
-
256
- 2003-08-12 takuma ozawa
257
-
258
- * version 0.0.7 release.
259
-
260
- 2003-08-11 takuma ozawa
261
-
262
- * rbtree.c (rbtree_to_hash): copy default value.
263
-
264
- * rbtree.c (rbtree_readjust): takes a Proc argument.
265
-
266
- * rbtree.c (to_hash_i): optimization.
267
-
268
- 2003-08-09 takuma ozawa
269
-
270
- * rbtree.c (rbtree_merge): new method.
271
-
272
- * rbtree.c (rbtree_select): select(key..) is deprecated.
273
-
274
- * rbtree.c (rbtree_values_at): new method.
275
-
276
- * rbtree.c (rbtree_initialized_copy): rbtree_copy_object changed to.
277
-
278
- 2003-07-27 takuma ozawa
279
-
280
- * rbtree.c (rbtree_dump): new method based on Ara Howard's code.
281
- Thanks.
282
-
283
- * rbtree.c (rbtree_s_load): ditto.
284
-
285
- 2003-03-25 takuma ozawa
286
-
287
- * version 0.0.6 release.
288
-
289
- 2003-02-26 takuma ozawa
290
-
291
- * rbtree.c (rbtree_readjust): rbtree_modify.
292
-
293
- 2003-02-23 takuma ozawa
294
-
295
- * rbtree.c (rbtree_copy_object): use copy_i.
296
-
297
- * rbtree.c (rbtree_readjust): ditto.
298
-
299
- * rbtree.c (rbtree_aset): not freeze a key.
300
-
301
- 2003-01-24 takuma ozawa
302
-
303
- * rbtree.c (rbtree_aset): optimization.
304
-
305
- 2003-01-18 takuma ozawa
306
-
307
- * rbtree.c (rbtree_aset): not raise an exception if a dict is
308
- full and the key has been contained.
309
-
310
- 2003-01-16 takuma ozawa
311
-
312
- * version 0.0.5 release.
313
-
314
- 2002-12-26 takuma ozawa
315
-
316
- * rbtree.c (rbtree_alloc): new allocation framework.
317
-
318
- * rbtree.c (rbtree_copy_object): changed become to copy_object.
319
-
320
- * rbtree.c (rbtree_cmp): use NUM2INT in case nil returned.
321
-
322
- * extconf.rb (assertion): assertion is off by default.
323
-
324
- * rbtree.c (rbtree_aset): fixed a memory leak occured if the
325
- comparison block raises an exception.
326
-
327
- 2002-11-24 takuma ozawa
328
-
329
- * rbtree.c (rbtree_pretty_print): new method.
330
-
331
- * rbtree.c (rbtree_pretty_print_cycle): new method.
332
-
333
- 2002-11-22 takuma ozawa
334
-
335
- * rbtree.c (rbtree_inspect): format changed.
336
-
337
- * rbtree.c (rbtree_user_cmp): use NUM2INT.
338
-
339
- 2002-10-29 takuma ozawa
340
-
341
- * version 0.0.4 release.
342
-
343
- 2002-10-18 takuma ozawa
344
-
345
- * extconf.rb (assertion): change name to assertion.
346
-
347
- 2002-10-12 takuma ozawa
348
-
349
- * rbtree.c (rbtree_readjust): assign Qnil to other's dict_context
350
- after swap.
351
-
352
- * rbtree.c (rbtree_bound): use dict_compare for range check.
353
-
354
- 2002-10-10 takuma ozawa
355
-
356
- * rbtree.c (rbtree_readjust): empty dict check.
357
-
358
- * rbtree.c (rbtree_readjust): not use dict_readjust for better
359
- readability.
360
-
361
- * rbtree.c (rbtree_become): must copy dict_compare and
362
- dict_context before copying nodes.
363
-
364
- * rbtree.c (rbtree_delete_if): rbtree_modify.
365
-
366
- * rbtree.c (rbtree_shift_pop): ditto.
367
-
368
- * rbtree.c (rbtree_update): ditto.
369
-
370
- * test.rb: Test::Unit.
371
-
372
- * rbtree.c (rbtree_readjust): clear other's nodes after swap.
373
-
374
- * rbtree.c (rbtree_readjust): assign Qnil to other's ifnone after
375
- swap.
376
-
377
- 2002-10-07 takuma ozawa
378
-
379
- * rbtree.c (rbtree_update): self assignment check.
380
-
381
- * rbtree.c (rbtree_update): replace duplicate value by return
382
- value of block if given.
383
-
384
- 2002-10-03 takuma ozawa
385
-
386
- * rbtree.c (rbtree_become): self assignment check.
387
-
388
- 2002-09-24 takuma ozawa
389
-
390
- * rbtree.c (rbtree_cmp_proc): new method.
391
-
392
- * rbtree.c (rbtree_readjust): if no block given, must assign Qnil
393
- to context.
394
-
395
- * rbtree.c (rbtree_inspect): format changed.
396
-
397
- 2002-09-23 takuma ozawa
398
-
399
- * dict.c (dict_equal): empty test must be after similar test.
400
-
401
- 2002-09-22 takuma ozawa
402
-
403
- * rbtree.c (rbtree_update): convert argument to RBTree.
404
-
405
- * rbtree.c (rbtree_become): ditto.
406
-
407
- * rbtree.c (rbtree_eq): use rb_equal.
408
-
409
- * rbtree.c (rbtree_eql): change name to rbtree_eq.
410
-
411
- 2002-09-20 takuma ozawa
412
-
413
- * rbtree.c (RBTREE_FL_COPY): removed.
414
-
415
- * ctest/test.c: rewritten in C. CppUnit is not required.
416
-
417
- 2002-09-18 takuma ozawa
418
-
419
- * depend: new file.
420
-
421
- * rbtree.c (rbtree_equal): no need to check RBTREE_PROC_DEFAULT.
422
-
423
- * extconf.rb (inline) check for inline keyword.
424
-
425
- 2002-09-17 takuma ozawa
426
-
427
- * version 0.0.3 release.
428
-
429
- 2002-09-16 takuma ozawa
430
-
431
- * rbtree.c (rbtree_reverse_each): new method.
432
-
433
- 2002-09-12 takuma ozawa
434
-
435
- * rbtree.c (rbtree_s_create): unset RBTREE_PROC_DEFAULT if the
436
- argument is RBTree.
437
-
438
- * rbtree.c (rbtree_clone): use rbtree_become.
439
-
440
- * rbtree.c (version.h): not included.
441
-
442
- 2002-09-11 takuma ozawa
443
-
444
- * rbtree.c (rbtree_to_a): use OBJ_INFECT.
445
-
446
- * rbtree.c (rbtree_to_hash): ditto.
447
-
448
- * rbtree.c (rbtree_become): replaced by rbtree_replace.
449
-
450
- * rbtree.c (rbtree_replace): removed. replace is implemented
451
- useing rbtree_become.
452
-
453
- * rbtree.c (rbtree_first_last): first or pop from empty tree
454
- should not return its default proc.
455
-
456
- 2002-09-09 takuma ozawa
457
-
458
- * rbtree.c (rbtree_become): new method.
459
-
460
- * rbtree.c (rbtree_clone): unset RBTREE_IN_ITERATION.
461
-
462
- * rbtree.c (rbtree_replace): should copy ifnone.
463
-
464
- * rbtree.c (rbtree_shift_pop): shift or pop from empty tree should
465
- not return its default proc.
466
-
467
- * rbtree.c (rbtree_default_proc): new method.
468
-
469
- * rbtree.c (rbtree_equal): should check default values and
470
- RBTREE_PROC_DEFAULT.
471
-
472
- 2002-07-19 takuma ozawa
473
-
474
- * dict.c (alloc_node): must return NULL if a memory allocation
475
- fails.
476
-
477
- 2002-07-13 takuma ozawa
478
-
479
- * version 0.0.2 release.
480
-
481
- 2002-07-11 takuma ozawa
482
-
483
- * rbtree.c (rbtree_readjust): new method.
484
-
485
- 2002-07-10 takuma ozawa
486
-
487
- * dict.c (dict_clone): clone object must copy must_unfreeze
488
- variable.
489
-
490
- 2002-06-25 takuma ozawa
491
-
492
- * dict.h (dnode_t): add must_freeze flag not to unfreeze already
493
- freezed object.
494
-
495
- 2002-06-22 takuma ozawa
496
-
497
- * rbtree.c (rbtree_first): new method.
498
-
499
- * rbtree.c (rbtree_last): new method.
500
-
501
- * rbtree.c (rbtree_pop): new method.
502
-
503
- 2002-06-14 takuma ozawa
504
-
505
- * initial release.