ruby_rnv 0.2.3 → 0.2.4

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: ce96c14db6a65519b008b024bdd445baa77d7fd8dc7c4058036069b570137ffc
4
- data.tar.gz: ea3d0f24683bc0534c59ed42780e3f09fec6065fa4d45cb338661000d04e9e4f
3
+ metadata.gz: a97a5b35a39aa2ad603660b81b9c13e04375dafbc9f537fec0720357befd53f8
4
+ data.tar.gz: 54dff4be913ec5e3e356cb43c5d58a936aa6aa76f38212212a19f3057875f22c
5
5
  SHA512:
6
- metadata.gz: fbf7ae9c188ca229dcc96c468dc5cf5b4cade193d49dd65fdc1ad9e1e7fcf124fb7a536c8b0a8a89a6c80706ab5ca94ff5b8a88bb7fa1d97b8376064e26c00d3
7
- data.tar.gz: e949052b38a2cece1846fbcb4f365112de0f9674c0e55eb10fd5646f19f61e6034796d8923807736e17b7e8ad5e3081d2aecd60899d6cd6921b3863c516956fa
6
+ metadata.gz: bacdd196d95d59883413268ab7dc70d68bd39d4d93876ca156687aceabd7d76cd917a09dbeea4537a3f3c96cbc883bd6f7cd35bf152ac0c421e6e9183f14c2a9
7
+ data.tar.gz: c43c097908014a8dc61fedab76ab407012077ec471fdc256aeca28d8261e3c90a4678f50a7b4308aa66efd96c008e1eb2e86f6fafe3ef1418b433b0da74a146c
data/ext/rnv/ruby_rnv.c CHANGED
@@ -489,10 +489,11 @@ VALUE rb_document_load_string(VALUE self, VALUE r_str)
489
489
  document->fn,
490
490
  RSTRING_PTR(r_str), RSTRING_LEN(r_str));
491
491
 
492
- document_load(document);
493
-
494
492
  if (document->opened)
493
+ {
494
+ document_load(document);
495
495
  return Qtrue;
496
+ }
496
497
  else
497
498
  return Qfalse;
498
499
  }
@@ -507,27 +508,21 @@ VALUE rb_document_load_file(VALUE self, VALUE r_fn)
507
508
  document_t *document;
508
509
  Data_Get_Struct(self, document_t, document);
509
510
 
510
- switch (TYPE(r_fn))
511
- {
512
- case T_STRING:
513
- document->fn = RSTRING_PTR(r_fn);
511
+ Check_Type(r_fn, T_STRING);
514
512
 
515
- document->opened = rnl_fn(document->rnv,
516
- document->rnc_st,
517
- document->rn_st,
518
- document->rnd_st,
519
- document->fn);
520
- break;
521
- case T_FILE: // TODO
522
- default:
523
- rb_raise(rb_eTypeError, "invalid argument");
524
- break;
525
- }
513
+ document->fn = RSTRING_PTR(r_fn);
526
514
 
527
- document_load(document);
515
+ document->opened = rnl_fn(document->rnv,
516
+ document->rnc_st,
517
+ document->rn_st,
518
+ document->rnd_st,
519
+ document->fn);
528
520
 
529
521
  if (document->opened)
522
+ {
523
+ document_load(document);
530
524
  return Qtrue;
525
+ }
531
526
  else
532
527
  return Qfalse;
533
528
  }
data/lib/rnv/validator.rb CHANGED
@@ -76,6 +76,7 @@ module RNV
76
76
 
77
77
  parser = Nokogiri::XML::SAX::Parser.new(rnv_doc)
78
78
  parser.parse_memory(str) do |ctx|
79
+ ctx.replace_entities = true
79
80
  rnv_doc.ctx = ctx
80
81
  end
81
82
 
@@ -94,6 +95,7 @@ module RNV
94
95
 
95
96
  parser = Nokogiri::XML::SAX::Parser.new(rnv_doc)
96
97
  parser.parse(file) do |ctx|
98
+ ctx.replace_entities = true
97
99
  rnv_doc.ctx = ctx
98
100
  end
99
101
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_rnv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Boulnois