ox 2.9.2 → 2.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -3
- data/ext/ox/dump.c +7 -5
- data/ext/ox/encode.h +26 -0
- data/lib/ox/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ed84d3d4fbc1ce7e736c41db72f0be81b54e647916ec7904d3ed8bde7a9f3c0
|
4
|
+
data.tar.gz: d8b315fcbadfa83b886cf99ef1273da41511ce2633a2fae01ed9fb5f1a8ac872
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b86eb6d808f3a3f0dd373082060c838cf829ca15f2d41d64df7a15f6014d4401019e45d39b564f1dade27f328c165792776692f361f4d95f955da1160c1db016
|
7
|
+
data.tar.gz: a8262ff6dc805641118dd60691d80da5ac8bd23efd69274c1807feb94f3ddde1da1bfecbc538a2a62e06f02a242384629393fb42216875e57f5aebabd3e902b9
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -246,7 +246,7 @@ necessary.
|
|
246
246
|
The type indicator map is:
|
247
247
|
|
248
248
|
- **a** => `Array`
|
249
|
-
- **b** => `Base64`
|
249
|
+
- **b** => `Base64` - only for legacy loads
|
250
250
|
- **c** => `Class`
|
251
251
|
- **f** => `Float`
|
252
252
|
- **g** => `Regexp`
|
@@ -300,8 +300,6 @@ Hash. An example is of { 1 => 'one', 2 => 'two' } encoding is:
|
|
300
300
|
<s>two</s>
|
301
301
|
</h>
|
302
302
|
```
|
303
|
-
Strings with characters not allowed in XML are base64 encoded amd will be
|
304
|
-
converted back into a String when loaded.
|
305
303
|
|
306
304
|
Ox supports circular references where attributes of one Object can refer to
|
307
305
|
an Object that refers back to the first Object. When this option is used an
|
data/ext/ox/dump.c
CHANGED
@@ -194,7 +194,7 @@ fill_value(Out out, const char *value, size_t len) {
|
|
194
194
|
memcpy(out->cur, value, len);
|
195
195
|
out->cur += len;
|
196
196
|
} else {
|
197
|
-
for (;
|
197
|
+
for (; 0 < len; len--, value++) {
|
198
198
|
*out->cur++ = *value;
|
199
199
|
}
|
200
200
|
}
|
@@ -210,7 +210,7 @@ fill_attr(Out out, char name, const char *value, size_t len) {
|
|
210
210
|
memcpy(out->cur, value, len);
|
211
211
|
out->cur += len;
|
212
212
|
} else {
|
213
|
-
for (;
|
213
|
+
for (; 0 < len; len--, value++) {
|
214
214
|
*out->cur++ = *value;
|
215
215
|
}
|
216
216
|
}
|
@@ -331,7 +331,7 @@ dump_value(Out out, const char *value, size_t size) {
|
|
331
331
|
memcpy(out->cur, value, size);
|
332
332
|
out->cur += size;
|
333
333
|
} else {
|
334
|
-
for (;
|
334
|
+
for (; 0 < size; size--, value++) {
|
335
335
|
*out->cur++ = *value;
|
336
336
|
}
|
337
337
|
}
|
@@ -345,7 +345,7 @@ dump_str_value(Out out, const char *value, size_t size, const char *table) {
|
|
345
345
|
if (out->end - out->cur <= (long)xsize) {
|
346
346
|
grow(out, xsize);
|
347
347
|
}
|
348
|
-
for (;
|
348
|
+
for (; 0 < size; size--, value++) {
|
349
349
|
if ('1' == table[(uchar)*value]) {
|
350
350
|
*out->cur++ = *value;
|
351
351
|
} else {
|
@@ -1284,7 +1284,9 @@ dump_obj_to_xml(VALUE obj, Options copts, Out out) {
|
|
1284
1284
|
out->w_end = dump_end;
|
1285
1285
|
dump_first_obj(obj, out);
|
1286
1286
|
}
|
1287
|
-
|
1287
|
+
if (0 <= out->indent) {
|
1288
|
+
dump_value(out, "\n", 1);
|
1289
|
+
}
|
1288
1290
|
if (Yes == copts->circular) {
|
1289
1291
|
ox_cache8_delete(out->circ_cache);
|
1290
1292
|
}
|
data/ext/ox/encode.h
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
/* encode.h
|
2
|
+
* Copyright (c) 2011, Peter Ohler
|
3
|
+
* All rights reserved.
|
4
|
+
*/
|
5
|
+
|
6
|
+
#ifndef __OX_ENCODE_H__
|
7
|
+
#define __OX_ENCODE_H__
|
8
|
+
|
9
|
+
#include "ruby.h"
|
10
|
+
#if HAS_ENCODING_SUPPORT
|
11
|
+
#include "ruby/encoding.h"
|
12
|
+
#endif
|
13
|
+
|
14
|
+
static inline VALUE
|
15
|
+
ox_encode(VALUE rstr) {
|
16
|
+
#if HAS_ENCODING_SUPPORT
|
17
|
+
rb_enc_associate(rstr, ox_utf8_encoding);
|
18
|
+
#else
|
19
|
+
if (Qnil != ox_utf8_encoding) {
|
20
|
+
rstr = rb_funcall(ox_utf8_encoding, ox_iconv_id, 1, rstr);
|
21
|
+
}
|
22
|
+
#endif
|
23
|
+
return rstr;
|
24
|
+
}
|
25
|
+
|
26
|
+
#endif /* __OX_ENCODE_H__ */
|
data/lib/ox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.9.
|
4
|
+
version: 2.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "A fast XML parser and object serializer that uses only standard C lib.\n
|
14
14
|
\ \nOptimized XML (Ox), as the name implies was written to provide speed
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- ext/ox/cache8.c
|
36
36
|
- ext/ox/cache8.h
|
37
37
|
- ext/ox/dump.c
|
38
|
+
- ext/ox/encode.h
|
38
39
|
- ext/ox/err.c
|
39
40
|
- ext/ox/err.h
|
40
41
|
- ext/ox/extconf.rb
|