Permalink
Browse files

Updated for Ruby 2.4.0.

  • Loading branch information...
ohler55 committed Jun 24, 2016
1 parent 2cbcdec commit f826190eeeb3cc43f810de5b630a36b78f709dc2
Showing with 47 additions and 6 deletions.
  1. +1 −0 .travis.yml
  2. +6 −0 README.md
  3. +7 −5 build_test.sh
  4. +24 −0 ext/ox/builder.c
  5. +8 −0 ext/ox/ox.c
  6. +1 −1 lib/ox/version.rb
View
@@ -7,6 +7,7 @@ rvm:
- 2.2.2
- 2.2.3
- 2.3.0
- 2.3.1
- rbx-2
script:
View
@@ -34,6 +34,12 @@ A fast XML parser and Object marshaller as a Ruby gem.
## Release Notes
### Release 2.4.3
- Fixed compiler warnings and errors.
- Updated for Ruby 2.4.0.
### Release 2.4.2
- Added methods to Ox::Builder to provide output position information.
View
@@ -1,12 +1,14 @@
#!/bin/sh
# 1.8.7-p374\
for ruby in \
1.8.7-p374\
rbx-2.2.6\
1.9.3-p547\
2.1.5\
2.2.2\
2.3.0
2.3.1\
2.4.0-preview1
do
echo "\n********************************************************************************"
echo "Building $ruby\n"
@@ -46,10 +48,10 @@ cd ..
echo "resetting to 2.3.0\n"
cd ext/ox
rbenv local 2.3.0
rbenv local 2.3.1
cd ../../test
rbenv local 2.3.0
rbenv local 2.3.1
cd sax
rbenv local 2.3.0
rbenv local 2.3.1
cd ../..
echo "\n"
View
@@ -327,13 +327,21 @@ builder_new(int argc, VALUE *argv, VALUE self) {
rb_check_type(*argv, T_HASH);
if (Qnil != (v = rb_hash_lookup(*argv, ox_indent_sym))) {
#ifdef RUBY_INTEGER_UNIFICATION
if (rb_cInteger != rb_obj_class(v)) {
#else
if (rb_cFixnum != rb_obj_class(v)) {
#endif
rb_raise(ox_parse_error_class, ":indent must be a fixnum.\n");
}
indent = NUM2INT(v);
}
if (Qnil != (v = rb_hash_lookup(*argv, ox_size_sym))) {
#ifdef RUBY_INTEGER_UNIFICATION
if (rb_cInteger != rb_obj_class(v)) {
#else
if (rb_cFixnum != rb_obj_class(v)) {
#endif
rb_raise(ox_parse_error_class, ":size must be a fixnum.\n");
}
buf_size = NUM2LONG(v);
@@ -383,13 +391,21 @@ builder_file(int argc, VALUE *argv, VALUE self) {
rb_check_type(argv[1], T_HASH);
if (Qnil != (v = rb_hash_lookup(argv[1], ox_indent_sym))) {
#ifdef RUBY_INTEGER_UNIFICATION
if (rb_cInteger != rb_obj_class(v)) {
#else
if (rb_cFixnum != rb_obj_class(v)) {
#endif
rb_raise(ox_parse_error_class, ":indent must be a fixnum.\n");
}
indent = NUM2INT(v);
}
if (Qnil != (v = rb_hash_lookup(argv[1], ox_size_sym))) {
#ifdef RUBY_INTEGER_UNIFICATION
if (rb_cInteger != rb_obj_class(v)) {
#else
if (rb_cFixnum != rb_obj_class(v)) {
#endif
rb_raise(ox_parse_error_class, ":size must be a fixnum.\n");
}
buf_size = NUM2LONG(v);
@@ -438,13 +454,21 @@ builder_io(int argc, VALUE *argv, VALUE self) {
rb_check_type(argv[1], T_HASH);
if (Qnil != (v = rb_hash_lookup(argv[1], ox_indent_sym))) {
#ifdef RUBY_INTEGER_UNIFICATION
if (rb_cInteger != rb_obj_class(v)) {
#else
if (rb_cFixnum != rb_obj_class(v)) {
#endif
rb_raise(ox_parse_error_class, ":indent must be a fixnum.\n");
}
indent = NUM2INT(v);
}
if (Qnil != (v = rb_hash_lookup(argv[1], ox_size_sym))) {
#ifdef RUBY_INTEGER_UNIFICATION
if (rb_cInteger != rb_obj_class(v)) {
#else
if (rb_cFixnum != rb_obj_class(v)) {
#endif
rb_raise(ox_parse_error_class, ":size must be a fixnum.\n");
}
buf_size = NUM2LONG(v);
View
@@ -1085,13 +1085,21 @@ parse_dump_options(VALUE ropts, Options copts) {
VALUE v;
if (Qnil != (v = rb_hash_lookup(ropts, ox_indent_sym))) {
#ifdef RUBY_INTEGER_UNIFICATION
if (rb_cInteger != rb_obj_class(v)) {
#else
if (rb_cFixnum != rb_obj_class(v)) {
#endif
rb_raise(ox_parse_error_class, ":indent must be a Fixnum.\n");
}
copts->indent = NUM2INT(v);
}
if (Qnil != (v = rb_hash_lookup(ropts, trace_sym))) {
#ifdef RUBY_INTEGER_UNIFICATION
if (rb_cInteger != rb_obj_class(v)) {
#else
if (rb_cFixnum != rb_obj_class(v)) {
#endif
rb_raise(ox_parse_error_class, ":trace must be a Fixnum.\n");
}
copts->trace = NUM2INT(v);
View
@@ -1,5 +1,5 @@
module Ox
# Current version of the module.
VERSION = '2.4.2'
VERSION = '2.4.3a1'
end

0 comments on commit f826190

Please sign in to comment.