rbtree-jruby 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- jruby-1.7.0
1
+ jruby-1.7.4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -563,8 +563,8 @@ public class MultiRBTree extends RubyObject {
563
563
 
564
564
  @JRubyMethod
565
565
  public IRubyObject delete(ThreadContext context, IRubyObject key, Block block) {
566
- Node node = lower_boundInternal(context, key);
567
- if (node.isNull()) {
566
+ Node node = internalGet(context, (RubyObject) key);
567
+ if (node == null) {
568
568
  if (block.isGiven()) {
569
569
  return block.yield(context, key);
570
570
  }
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "rbtree-jruby"
8
- s.version = "0.1.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Isaiah Peng"]
12
- s.date = "2012-11-10"
12
+ s.date = "2013-07-23"
13
13
  s.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."
14
14
  s.email = "issaria@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -25,16 +25,14 @@ Gem::Specification.new do |s|
25
25
  "README.md",
26
26
  "Rakefile",
27
27
  "VERSION",
28
- "java/src/rbtree/ext/Color.java",
28
+ "benchmark/bm.rb",
29
+ "benchmark/bm1.rb",
30
+ "benchmark/result.png",
31
+ "benchmark/result.txt",
29
32
  "java/src/rbtree/ext/MultiRBTree.java",
30
33
  "java/src/rbtree/ext/MultiRBTreeService.java",
31
- "java/src/rbtree/ext/NilNode.java",
32
- "java/src/rbtree/ext/Node.java",
33
34
  "lib/rbtree.rb",
34
35
  "lib/rbtree/ext/multi_r_b_tree.jar",
35
- "lib/rbtree/ext/multi_red_black_tree.jar",
36
- "lib/rbtree/ext/rbtree.jar",
37
- "lib/rbtree/ext/red_black_tree.jar",
38
36
  "rbtree-jruby.gemspec",
39
37
  "test/helper.rb",
40
38
  "test/test_rbtree.rb"
@@ -959,4 +959,21 @@ class MultiRBTreeTest < Test::Unit::TestCase
959
959
  assert_equal("b", @rbtree.index("C"))
960
960
  assert_equal("b", @rbtree.index("D"))
961
961
  end
962
+
963
+ end
964
+
965
+ class RegressionTest < Test::Unit::TestCase
966
+ def setup
967
+ @number_key_tree = RBTree.new
968
+ @number_key_tree[5] = 'a'
969
+ @number_key_tree[15] = 'b'
970
+ @number_key_tree[10] = 'c'
971
+ end
972
+
973
+ # gh #1
974
+ def test_number_key_delete
975
+ assert_equal(false, @number_key_tree.include?(7))
976
+ assert_nil(@number_key_tree.delete(7))
977
+ assert_equal(3, @number_key_tree.size)
978
+ end
962
979
  end
metadata CHANGED
@@ -2,30 +2,28 @@
2
2
  name: rbtree-jruby
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.0
5
+ version: 0.2.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Isaiah Peng
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-09 00:00:00.000000000 Z
12
+ date: 2013-07-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda
16
16
  version_requirements: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ! '>='
18
+ - - '>='
19
19
  - !ruby/object:Gem::Version
20
- version: !binary |-
21
- MA==
20
+ version: '0'
22
21
  none: false
23
22
  requirement: !ruby/object:Gem::Requirement
24
23
  requirements:
25
- - - ! '>='
24
+ - - '>='
26
25
  - !ruby/object:Gem::Version
27
- version: !binary |-
28
- MA==
26
+ version: '0'
29
27
  none: false
30
28
  prerelease: false
31
29
  type: :development
@@ -49,17 +47,15 @@ dependencies:
49
47
  name: bundler
50
48
  version_requirements: !ruby/object:Gem::Requirement
51
49
  requirements:
52
- - - ! '>='
50
+ - - '>='
53
51
  - !ruby/object:Gem::Version
54
- version: !binary |-
55
- MA==
52
+ version: '0'
56
53
  none: false
57
54
  requirement: !ruby/object:Gem::Requirement
58
55
  requirements:
59
- - - ! '>='
56
+ - - '>='
60
57
  - !ruby/object:Gem::Version
61
- version: !binary |-
62
- MA==
58
+ version: '0'
63
59
  none: false
64
60
  prerelease: false
65
61
  type: :development
@@ -83,17 +79,15 @@ dependencies:
83
79
  name: rcov
84
80
  version_requirements: !ruby/object:Gem::Requirement
85
81
  requirements:
86
- - - ! '>='
82
+ - - '>='
87
83
  - !ruby/object:Gem::Version
88
- version: !binary |-
89
- MA==
84
+ version: '0'
90
85
  none: false
91
86
  requirement: !ruby/object:Gem::Requirement
92
87
  requirements:
93
- - - ! '>='
88
+ - - '>='
94
89
  - !ruby/object:Gem::Version
95
- version: !binary |-
96
- MA==
90
+ version: '0'
97
91
  none: false
98
92
  prerelease: false
99
93
  type: :development
@@ -133,20 +127,18 @@ require_paths:
133
127
  - lib
134
128
  required_ruby_version: !ruby/object:Gem::Requirement
135
129
  requirements:
136
- - - ! '>='
130
+ - - '>='
137
131
  - !ruby/object:Gem::Version
138
- version: !binary |-
139
- MA==
140
132
  segments:
141
133
  - 0
142
134
  hash: 2
135
+ version: '0'
143
136
  none: false
144
137
  required_rubygems_version: !ruby/object:Gem::Requirement
145
138
  requirements:
146
- - - ! '>='
139
+ - - '>='
147
140
  - !ruby/object:Gem::Version
148
- version: !binary |-
149
- MA==
141
+ version: '0'
150
142
  none: false
151
143
  requirements: []
152
144
  rubyforge_project: