nokogumbo 2.0.0 → 2.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97aae1603382eb4357f4126f4c36f86841b930a04b46e0eb6a1c02c26c9e77a4
4
- data.tar.gz: 614f1dc01be03d4ccb48b43d512faf80f556e8ddde4690fa34fbb9e420c36cb9
3
+ metadata.gz: 9a428cfbfd91671cfd185171daf3004072448636054260e4e4cfbf4f9c71a392
4
+ data.tar.gz: a4d2e15843d42f89b8152dafbdc816e452f73114dd7b13f177db62e21a290d6b
5
5
  SHA512:
6
- metadata.gz: aabd005ec985f1a94b0b82195ce8547fabc3d3f97e672b9b03c174ddd131b534b6c2648803ccd0d1fdfc9224bab132cdbd2757271b5646fc3873649d1f509e26
7
- data.tar.gz: 4e793d5436de772587f2abcdb54c1060a3ddbde3dfcad05539e823dbde3c67f0792d1589289323fe76d5baebe265a526aba71d5adcbeb8d2ca72559d789e7b14
6
+ metadata.gz: 145cb3d69a3bab4c0bcd60f3f5253f46a6df49b76ed6bdc88147fe059da2805fc93fa7fedeb1ea4002440cc789e259f9049b472e225170273a3709bb011decda
7
+ data.tar.gz: 8d29a5317ccda466accc132aa300048de6cc237e99e26827dcae3c081941abe1ed00f6feb93a35b36a16a3e6fa27fe88cfe1ea753f5677793a49ff0113ac7f28
@@ -385,7 +385,7 @@ static void build_tree (
385
385
  case GUMBO_NODE_ELEMENT:
386
386
  {
387
387
  xml_child = xmlNewDocNode(doc, NIL, BAD_CAST gumbo_child->v.element.name, NULL);
388
- set_line(xml_child, gumbo_child->v.text.start_pos.line);
388
+ set_line(xml_child, gumbo_child->v.element.start_pos.line);
389
389
  if (xml_root == NIL)
390
390
  xml_root = xml_child;
391
391
  xmlNsPtr ns = NIL;
@@ -709,10 +709,12 @@ static VALUE fragment_continue(ParseArgs *args) {
709
709
 
710
710
  // Initialize the Nokogumbo class and fetch constants we will use later.
711
711
  void Init_nokogumbo() {
712
- rb_funcall(rb_mKernel, rb_intern("gem"), 1, rb_utf8_str_new_static("nokogiri", 8));
712
+ rb_funcall(rb_mKernel, rb_intern_const("gem"), 1, rb_utf8_str_new_static("nokogiri", 8));
713
713
  rb_require("nokogiri");
714
714
 
715
- #ifndef NGLIB
715
+ VALUE line_supported = Qtrue;
716
+
717
+ #if !NGLIB
716
718
  // Class constants.
717
719
  VALUE mNokogiri = rb_const_get(rb_cObject, rb_intern_const("Nokogiri"));
718
720
  VALUE mNokogiriXml = rb_const_get(mNokogiri, rb_intern_const("XML"));
@@ -725,6 +727,9 @@ void Init_nokogumbo() {
725
727
  // Interned symbols.
726
728
  new = rb_intern_const("new");
727
729
  node_name_ = rb_intern_const("node_name=");
730
+
731
+ // #line is not supported (returns 0)
732
+ line_supported = Qfalse;
728
733
  #endif
729
734
 
730
735
  // Class constants.
@@ -739,6 +744,11 @@ void Init_nokogumbo() {
739
744
  VALUE Gumbo = rb_define_module("Nokogumbo");
740
745
  rb_define_singleton_method(Gumbo, "parse", parse, 4);
741
746
  rb_define_singleton_method(Gumbo, "fragment", fragment, 5);
747
+
748
+ // Add private constant for testing.
749
+ rb_define_const(Gumbo, "LINE_SUPPORTED", line_supported);
750
+ rb_funcall(Gumbo, rb_intern_const("private_constant"), 1,
751
+ rb_utf8_str_new_cstr("LINE_SUPPORTED"));
742
752
  }
743
753
 
744
754
  // vim: set shiftwidth=2 softtabstop=2 tabstop=8 expandtab:
@@ -1,3 +1,3 @@
1
1
  module Nokogumbo
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogumbo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-10-04 00:00:00.000000000 Z
12
+ date: 2018-11-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  requirements: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.7.6
113
+ rubygems_version: 2.7.7
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Nokogiri interface to the Gumbo HTML5 parser