rbtree 0.2.1 → 0.4.3

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