Permalink
Browse files

ready for release

  • Loading branch information...
1 parent d3d3348 commit 2cb3c3cdc066d3136f5d1c7603f68b02a1e2611d @ohler55 committed Jul 24, 2013
Showing with 46 additions and 18 deletions.
  1. +2 −0 README.md
  2. +22 −12 build_test.sh
  3. +20 −5 ext/ox/dump.c
  4. +1 −0 ext/ox/ox.c
  5. +1 −1 lib/ox/version.rb
View
@@ -40,6 +40,8 @@ A fast XML parser and Object marshaller as a Ruby gem.
- Limit depth on dump to 1000 to avoid core dump on circular references if the user does not specify circular.
+ - Handles dumping non-string values for attributes correctly by converting the value to a string.
+
## <a name="description">Description</a>
Optimized XML (Ox), as the name implies was written to provide speed optimized
View
@@ -3,28 +3,31 @@
export RBXOPT=-X19
for ruby in \
- 1.8.7-p358\
+ 1.8.7-p334\
1.9.2-p290\
rbx-1.2.4\
rbx-2.0.0-dev\
ree-1.8.7-2012.02\
- 1.9.3-p385 \
- 2.0.0-p195
+ 1.9.3-p448 \
+ 2.0.0-p247
do
echo "\n********************************************************************************"
echo "Building $ruby\n"
cd ext/ox
rbenv local $ruby
ruby extconf.rb
make clean
+ find . -name "*.rbc" -exec rm {} \;
make
echo "\nRunning tests for $ruby"
cd ../../test
rbenv local $ruby
./tests.rb
- ./sax/sax_test.rb
- cd ..
+ cd sax
+ rbenv local $ruby
+ ./sax_test.rb
+ cd ../..
echo "\n"
done
@@ -42,8 +45,10 @@ echo "\nRunning tests for jruby-1.6.7.2 --1.8"
cd ../../test
rbenv local jruby-1.6.7.2
./tests.rb
-./sax/sax_test.rb
-cd ..
+cd sax
+rbenv local jruby-1.6.7.2
+./sax_test.rb
+cd ../..
echo "\n"
@@ -60,8 +65,10 @@ echo "\nRunning tests for jruby-1.6.7.2 --1.9"
cd ../../test
rbenv local jruby-1.6.7.2
./tests.rb
-./sax/sax_test.rb
-cd ..
+cd sax
+rbenv local jruby-1.6.7.2
+./sax_test.rb
+cd ../..
echo "\n"
@@ -70,6 +77,7 @@ echo "\n************************************************************************
echo "Building OS X Ruby\n"
cd ext/ox
ruby extconf.rb
+make clean
make
echo "\nRunning tests for OS X Ruby"
@@ -81,8 +89,10 @@ cd ..
echo "resetting to 1.9.3-p374\n"
cd ext/ox
-rbenv local 2.0.0-p195
+rbenv local 2.0.0-p247
cd ../../test
-rbenv local 2.0.0-p195
-cd ..
+rbenv local 2.0.0-p247
+cd sax
+rbenv local 2.0.0-p247
+cd ../..
echo "\n"
View
@@ -1142,16 +1142,31 @@ dump_gen_nodes(VALUE obj, int depth, Out out) {
static int
dump_gen_attr(VALUE key, VALUE value, Out out) {
+ const char *ks;
+ size_t klen;
+ size_t size;
+
#if HAS_PRIVATE_ENCODING
// There seems to be a bug in jruby for converting symbols to strings and preserving the encoding. This is a work
// around.
- const char *ks = rb_str_ptr(rb_String(key));
+ ks = rb_str_ptr(rb_String(key));
#else
- const char *ks = (T_SYMBOL == rb_type(key)) ? rb_id2name(SYM2ID(key)) : StringValuePtr(key);
+ switch (rb_type(key)) {
+ case T_SYMBOL:
+ ks = rb_id2name(SYM2ID(key));
+ break;
+ case T_STRING:
+ ks = StringValuePtr(key);
+ break;
+ default:
+ key = rb_String(key);
+ ks = StringValuePtr(key);
+ break;
+ }
#endif
- size_t klen = strlen(ks);
- size_t size = 4 + klen + RSTRING_LEN(value);
-
+ klen = strlen(ks);
+ value = rb_String(value);
+ size = 4 + klen + RSTRING_LEN(value);
if (out->end - out->cur <= (long)size) {
grow(out, size);
}
View
@@ -30,6 +30,7 @@
#include <stdlib.h>
#include <errno.h>
+#include <stdint.h>
#include <stdio.h>
#include <string.h>
View
@@ -1,5 +1,5 @@
module Ox
# Current version of the module.
- VERSION = '2.0.6a1'
+ VERSION = '2.0.6'
end

0 comments on commit 2cb3c3c

Please sign in to comment.