ninjudd-tuple 0.0.4 → 0.0.5
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.
- data/VERSION.yml +1 -1
- data/ext/extconf.rb +0 -3
- data/ext/tuple.c +2 -1
- data/test/tuple_test.rb +4 -0
- metadata +2 -2
data/VERSION.yml
CHANGED
data/ext/extconf.rb
CHANGED
data/ext/tuple.c
CHANGED
@@ -29,7 +29,8 @@ static VALUE tuple_dump(VALUE self, VALUE tuple) {
|
|
29
29
|
u_int32_t digit;
|
30
30
|
BDIGIT *digits;
|
31
31
|
|
32
|
-
|
32
|
+
if (TYPE(tuple) != T_ARRAY) tuple = rb_ary_new4(1, tuple);
|
33
|
+
|
33
34
|
for (i = 0; i < RARRAY(tuple)->len; i++) {
|
34
35
|
item = RARRAY(tuple)->ptr[i];
|
35
36
|
header[0] = header[1] = header[2] = header[3] = 0;
|
data/test/tuple_test.rb
CHANGED
@@ -12,6 +12,10 @@ class TupleTest < Test::Unit::TestCase
|
|
12
12
|
assert_equal t, Tuple.load(Tuple.dump(t))
|
13
13
|
end
|
14
14
|
|
15
|
+
should "convert single value into array" do
|
16
|
+
assert_equal [1], Tuple.load(Tuple.dump(1))
|
17
|
+
end
|
18
|
+
|
15
19
|
should "sort tuples using binary" do
|
16
20
|
tuples = [
|
17
21
|
[1, "foo"],
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ninjudd-tuple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Balthrop
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-18 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|