ox 1.2.3 → 1.2.4
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.
Potentially problematic release.
This version of ox might be problematic. Click here for more details.
- data/ext/ox/ox.c +10 -5
- data/lib/ox/version.rb +1 -1
- data/test/func.rb +2 -0
- metadata +1 -1
data/ext/ox/ox.c
CHANGED
@@ -201,14 +201,19 @@ set_def_opts(VALUE self, VALUE opts) {
|
|
201
201
|
Check_Type(v, T_STRING);
|
202
202
|
strncpy(default_options.encoding, StringValuePtr(v), sizeof(default_options.encoding) - 1);
|
203
203
|
}
|
204
|
+
|
204
205
|
v = rb_hash_aref(opts, indent_sym);
|
205
|
-
|
206
|
-
|
206
|
+
if (Qnil != v) {
|
207
|
+
Check_Type(v, T_FIXNUM);
|
208
|
+
default_options.indent = FIX2INT(v);
|
209
|
+
}
|
207
210
|
|
208
211
|
v = rb_hash_aref(opts, trace_sym);
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
+
if (Qnil != v) {
|
213
|
+
Check_Type(v, T_FIXNUM);
|
214
|
+
default_options.trace = FIX2INT(v);
|
215
|
+
}
|
216
|
+
|
212
217
|
v = rb_hash_aref(opts, mode_sym);
|
213
218
|
if (Qnil == v) {
|
214
219
|
default_options.mode = NoMode;
|
data/lib/ox/version.rb
CHANGED
data/test/func.rb
CHANGED
@@ -62,9 +62,11 @@ class Func < ::Test::Unit::TestCase
|
|
62
62
|
:xsd_date=>true,
|
63
63
|
:mode=>:object,
|
64
64
|
:effort=>:tolerant }
|
65
|
+
o3 = { :xsd_date=>false }
|
65
66
|
Ox.default_options = o2
|
66
67
|
opts = Ox.default_options()
|
67
68
|
assert_equal(opts, o2);
|
69
|
+
Ox.default_options = o3 # see if it throws an exception
|
68
70
|
Ox.default_options = orig # return to original
|
69
71
|
end
|
70
72
|
|