ox 2.14.0 → 2.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '059b3f1db82648104560fe8087b57d8c7e1ee082ed953a53afcdf3f8762b0a3e'
4
- data.tar.gz: 344eac455d082e55935804cc45a7f399ebce83be700c1895a4679f28cd3b635a
3
+ metadata.gz: f66978b87b2aae7cb34b029f8a03a5f7bafdf88ca2e5f8323a72ac191e8f988a
4
+ data.tar.gz: 8181a385f4ae1421b21ad936c92ec80e5fcaba6d50bb24ec34a4f90dff317f87
5
5
  SHA512:
6
- metadata.gz: f4a109a5e5d97594c1c266bfd071af26aedf94acaf08d11c55ea03981fef97bff44d762c3df2b6b21da8559d928e7aac1d6d3421fbe0af56fb2eec10975449a6
7
- data.tar.gz: c82c7d2ca8fb54eb4f04d7da7b1b5527ef47e89905fcdd3b9ab9b5407bee6c9f3a55ea253472e212810e10cec71627a9cd84dcbb69f1c3db2bdee2e86651f6bd
6
+ metadata.gz: 3b8fed912eaf70837fce79caa564dbf549b4158b686d21168dd3383670d9c1f0ceb90a2dd8e7de048991320f168d21ed21e42a5083f0524096df4dd8a62a690d
7
+ data.tar.gz: 107b632e4cad49d118370b155d076715f55d5e1b1f9893a8bd33a57e0e09a82061fce9557447bc08241eccfd2ab643409847571e9a810ea03f3e43898506558e
@@ -4,6 +4,12 @@ All changes to the Ox gem are documented here. Releases follow semantic versioni
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [2.14.1] - 2021-01-11
8
+
9
+ ### Fixed
10
+
11
+ - In Ruby 3.0 Range objects are frozen. This version allows Ranges to be created on load.
12
+
7
13
  ## [2.14.0] - 2020-12-15
8
14
 
9
15
  ### Added
data/README.md CHANGED
@@ -17,10 +17,6 @@ A fast XML parser and Object marshaller as a Ruby gem.
17
17
 
18
18
  *RubyGems* *repo*: https://rubygems.org/gems/ox
19
19
 
20
- ## Follow @oxgem on Twitter
21
-
22
- [Follow @peterohler on Twitter](http://twitter.com/#!/peterohler) for announcements and news about the Ox gem.
23
-
24
20
  ## Support
25
21
 
26
22
  [Get supported Ox with a Tidelift Subscription.](https://tidelift.com/subscription/pkg/rubygems-ox?utm_source=rubygems-ox&utm_medium=referral&utm_campaign=readme) Security updates are [supported](https://tidelift.com/security).
@@ -79,7 +75,7 @@ callbacks. Unlike Nokogiri and LibXML, Ox can be tuned to use only the SAX
79
75
  callbacks that are of interest to the caller. (See the perf_sax.rb file for an
80
76
  example.)
81
77
 
82
- Ox is compatible with Ruby 1.8.7, 1.9.3, 2.1.2, 2.2.0 and RBX.
78
+ Ox is compatible with Ruby 2.3, 2.4, 2.5, 2.6, 2.7, 3.0.
83
79
 
84
80
  ### Object Dump Sample:
85
81
 
@@ -838,7 +838,7 @@ dump_obj(ID aid, VALUE obj, int depth, Out out) {
838
838
  out->w_start(out, &e);
839
839
 
840
840
  for (i = 0; i < cnt; i++) {
841
- VALUE v = RSTRUCT_GET(obj, i);
841
+ VALUE v = RSTRUCT_GET(obj, (int)(i));
842
842
  dump_obj(rb_intern(ulong2str(i, num_buf + sizeof(num_buf) - 1)), v, d2, out);
843
843
  }
844
844
  out->w_end(out, &e);
@@ -42,10 +42,10 @@ static void fill_indent(PInfo pi, char *buf, size_t size);
42
42
 
43
43
 
44
44
  struct _parseCallbacks _ox_obj_callbacks = {
45
- instruct, /* instruct, */
46
- 0, /* add_doctype, */
47
- 0, /* add_comment, */
48
- 0, /* add_cdata, */
45
+ instruct, // instruct,
46
+ 0, // add_doctype,
47
+ 0, // add_comment,
48
+ 0, // add_cdata,
49
49
  add_text,
50
50
  add_element,
51
51
  end_element,
@@ -128,7 +128,7 @@ resolve_classname(VALUE mod, const char *class_name, Effort effort, VALUE base_c
128
128
  break;
129
129
  case StrictEffort:
130
130
  default:
131
- /* raise an error if name is not defined */
131
+ // raise an error if name is not defined
132
132
  clas = rb_const_get_at(mod, ci);
133
133
  break;
134
134
  }
@@ -183,7 +183,7 @@ parse_ulong(const char *s, PInfo pi) {
183
183
  return ULONG2NUM(n);
184
184
  }
185
185
 
186
- /* 2010-07-09T10:47:45.895826162+09:00 */
186
+ // 2010-07-09T10:47:45.895826162+09:00
187
187
  inline static VALUE
188
188
  parse_time(const char *text, VALUE clas) {
189
189
  VALUE t;
@@ -559,7 +559,7 @@ add_element(PInfo pi, const char *ename, Attr attrs, int hasChildren) {
559
559
  printf("%s%s\n", indent, buf);
560
560
  }
561
561
  }
562
- if (helper_stack_empty(&pi->helpers)) { /* top level object */
562
+ if (helper_stack_empty(&pi->helpers)) { // top level object
563
563
  if (0 != (id = get_id_from_attrs(pi, attrs))) {
564
564
  pi->circ_array = circ_array_new();
565
565
  }
@@ -580,7 +580,7 @@ add_element(PInfo pi, const char *ename, Attr attrs, int hasChildren) {
580
580
  h->obj = Qfalse;
581
581
  break;
582
582
  case StringCode:
583
- /* h->obj will be replaced by add_text if it is called */
583
+ // h->obj will be replaced by add_text if it is called
584
584
  h->obj = ox_empty_string;
585
585
  if (0 != pi->circ_array) {
586
586
  pi->id = get_id_from_attrs(pi, attrs);
@@ -597,8 +597,8 @@ add_element(PInfo pi, const char *ename, Attr attrs, int hasChildren) {
597
597
  case ComplexCode:
598
598
  case DateCode:
599
599
  case TimeCode:
600
- case RationalCode: /* sub elements read next */
601
- /* value will be read in the following add_text */
600
+ case RationalCode: // sub elements read next
601
+ // value will be read in the following add_text
602
602
  h->obj = Qundef;
603
603
  break;
604
604
  case String64Code:
@@ -620,7 +620,7 @@ add_element(PInfo pi, const char *ename, Attr attrs, int hasChildren) {
620
620
  }
621
621
  break;
622
622
  case RangeCode:
623
- h->obj = rb_range_new(ox_zero_fixnum, ox_zero_fixnum, Qfalse);
623
+ h->obj = rb_ary_new_from_args(3, Qnil, Qnil, Qfalse);
624
624
  break;
625
625
  case RawCode:
626
626
  if (hasChildren) {
@@ -700,12 +700,15 @@ end_element(PInfo pi, const char *ename) {
700
700
  Helper ph = helper_stack_peek(&pi->helpers);
701
701
 
702
702
  if (ox_empty_string == h->obj) {
703
- /* special catch for empty strings */
703
+ // special catch for empty strings
704
704
  h->obj = rb_str_new2("");
705
- }
706
- if (Qundef == h->obj) {
705
+ } else if (Qundef == h->obj) {
707
706
  set_error(&pi->err, "Invalid element for object mode", pi->str, pi->s);
708
707
  return;
708
+ } else if (RangeCode == h->type) { // Expect an array of 3 elements.
709
+ const VALUE *ap = RARRAY_PTR(h->obj);
710
+
711
+ h->obj = rb_range_new(*ap, *(ap + 1), Qtrue == *(ap + 2));
709
712
  }
710
713
  pi->obj = h->obj;
711
714
  if (0 != ph) {
@@ -740,11 +743,11 @@ end_element(PInfo pi, const char *ename) {
740
743
  break;
741
744
  case RangeCode:
742
745
  if (ox_beg_id == h->var) {
743
- RSTRUCT_SET(ph->obj, 0, h->obj);
746
+ rb_ary_store(ph->obj, 0, h->obj);
744
747
  } else if (ox_end_id == h->var) {
745
- RSTRUCT_SET(ph->obj, 1, h->obj);
748
+ rb_ary_store(ph->obj, 1, h->obj);
746
749
  } else if (ox_excl_id == h->var) {
747
- RSTRUCT_SET(ph->obj, 2, h->obj);
750
+ rb_ary_store(ph->obj, 2, h->obj);
748
751
  } else {
749
752
  set_error(&pi->err, "Invalid range attribute", pi->str, pi->s);
750
753
  return;
@@ -903,7 +906,7 @@ parse_xsd_time(const char *text, VALUE clas) {
903
906
  #endif
904
907
  }
905
908
 
906
- /* debug functions */
909
+ // debug functions
907
910
  static void
908
911
  fill_indent(PInfo pi, char *buf, size_t size) {
909
912
  size_t cnt;
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Ox
3
3
  # Current version of the module.
4
- VERSION = '2.14.0'
4
+ VERSION = '2.14.1'
5
5
  end
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.14.0
4
+ version: 2.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ohler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-15 00:00:00.000000000 Z
11
+ date: 2021-01-11 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\nOptimized
14
14
  XML (Ox), as the name implies was written to provide speed optimized\nXML handling.
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  requirements: []
101
- rubygems_version: 3.1.2
101
+ rubygems_version: 3.2.3
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: A fast XML parser and object serializer.