rcstorable 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/ext/rcstorable.bundle +0 -0
- data/ext/rcstorable.c +13 -0
- data/ext/rcstorable.o +0 -0
- data/spec/store.pl +1 -11
- metadata +4 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
Binary file
|
data/ext/rcstorable.c
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
|
7
7
|
VALUE thaw(VALUE, VALUE);
|
8
8
|
static VALUE read_object();
|
9
|
+
static VALUE read_boolean();
|
9
10
|
static int read_extended_size();
|
10
11
|
static int read_compact_size();
|
11
12
|
static void read_n_hash_pairs(VALUE, int);
|
@@ -21,6 +22,7 @@ enum perl_types
|
|
21
22
|
PT_HASH = 3,
|
22
23
|
PT_VECTOR = 4,
|
23
24
|
PT_UNDEF = 5,
|
25
|
+
PT_BOOLEAN = 8,
|
24
26
|
PT_STRING = 10,
|
25
27
|
PT_STRING_ALT = 23
|
26
28
|
};
|
@@ -131,6 +133,10 @@ read_n_hash_pairs(VALUE hash, int num)
|
|
131
133
|
str = read_string(true);
|
132
134
|
rb_hash_aset(hash, str, temp);
|
133
135
|
break;
|
136
|
+
case PT_BOOLEAN:
|
137
|
+
temp = read_boolean();
|
138
|
+
rb_hash_aset(hash, read_string(true), temp);
|
139
|
+
break;
|
134
140
|
case PT_STRING:
|
135
141
|
case PT_STRING_ALT:
|
136
142
|
temp = read_string(false);
|
@@ -141,6 +147,13 @@ read_n_hash_pairs(VALUE hash, int num)
|
|
141
147
|
read_n_hash_pairs(hash, num-1);
|
142
148
|
}
|
143
149
|
|
150
|
+
static VALUE
|
151
|
+
read_boolean()
|
152
|
+
{
|
153
|
+
check_pointer(serialized);
|
154
|
+
return (*serialized++ == 128) ? Qfalse : Qtrue;
|
155
|
+
}
|
156
|
+
|
144
157
|
/*
|
145
158
|
* We've already created an array, and read the size of it.
|
146
159
|
* Now we need to read in n items, and add them to the array.
|
data/ext/rcstorable.o
ADDED
Binary file
|
data/spec/store.pl
CHANGED
@@ -5,17 +5,7 @@ use warnings;
|
|
5
5
|
use Storable;
|
6
6
|
use Data::Dumper;
|
7
7
|
|
8
|
-
my %blah = (
|
9
|
-
"a" => "A longish string",
|
10
|
-
"b" => "35",
|
11
|
-
"c" => {
|
12
|
-
"p" => "blah",
|
13
|
-
"q" => "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
|
14
|
-
},
|
15
|
-
"longer_key_name" => "29",
|
16
|
-
);
|
17
8
|
|
18
|
-
#my $x = "004\a\b12345678\004\b\b\b\003\004\000\000\000\004\003\002\000\000\000\n\004blah\001\000\000\000p\001>\002\000\000Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\001\000\000\000q\001\000\000\000c\n\00229\017\000\000\000longer_key_name\n\020A longish string\001\000\000\000a\n\00235\001\000\000\000b";
|
19
9
|
|
20
|
-
print Storable::
|
10
|
+
print Dumper(Storable::thaw($x));
|
21
11
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcstorable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burke Libbey
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-19 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -28,7 +28,9 @@ files:
|
|
28
28
|
- VERSION
|
29
29
|
- ext/Makefile
|
30
30
|
- ext/extconf.rb
|
31
|
+
- ext/rcstorable.bundle
|
31
32
|
- ext/rcstorable.c
|
33
|
+
- ext/rcstorable.o
|
32
34
|
- spec/rcstorable_spec.rb
|
33
35
|
- spec/store.pl
|
34
36
|
has_rdoc: true
|