libxml-ruby 2.8.0 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/HISTORY +15 -0
  3. data/README.rdoc +7 -7
  4. data/Rakefile +80 -78
  5. data/ext/libxml/extconf.h +4 -0
  6. data/ext/libxml/extconf.rb +57 -116
  7. data/ext/libxml/libxml.c +4 -0
  8. data/ext/libxml/ruby_xml.c +977 -893
  9. data/ext/libxml/ruby_xml.h +20 -10
  10. data/ext/libxml/ruby_xml_attr.c +333 -333
  11. data/ext/libxml/ruby_xml_attr_decl.c +2 -2
  12. data/ext/libxml/ruby_xml_cbg.c +85 -85
  13. data/ext/libxml/ruby_xml_document.c +1133 -1147
  14. data/ext/libxml/ruby_xml_dtd.c +261 -268
  15. data/ext/libxml/ruby_xml_encoding.c +262 -260
  16. data/ext/libxml/ruby_xml_encoding.h +19 -19
  17. data/ext/libxml/ruby_xml_html_parser_context.c +337 -338
  18. data/ext/libxml/ruby_xml_input_cbg.c +191 -191
  19. data/ext/libxml/ruby_xml_io.c +52 -50
  20. data/ext/libxml/ruby_xml_namespace.c +2 -2
  21. data/ext/libxml/ruby_xml_node.c +1446 -1452
  22. data/ext/libxml/ruby_xml_parser_context.c +999 -1001
  23. data/ext/libxml/ruby_xml_reader.c +1226 -1228
  24. data/ext/libxml/ruby_xml_relaxng.c +110 -111
  25. data/ext/libxml/ruby_xml_sax2_handler.c +326 -328
  26. data/ext/libxml/ruby_xml_schema.c +300 -301
  27. data/ext/libxml/ruby_xml_version.h +3 -3
  28. data/ext/libxml/ruby_xml_writer.c +14 -15
  29. data/ext/libxml/ruby_xml_xpath.c +188 -188
  30. data/ext/libxml/ruby_xml_xpath_context.c +360 -361
  31. data/ext/libxml/ruby_xml_xpath_object.c +335 -335
  32. data/libxml-ruby.gemspec +47 -44
  33. data/test/tc_attr.rb +5 -7
  34. data/test/tc_attr_decl.rb +5 -6
  35. data/test/tc_attributes.rb +1 -2
  36. data/test/tc_canonicalize.rb +1 -2
  37. data/test/tc_deprecated_require.rb +1 -2
  38. data/test/tc_document.rb +4 -5
  39. data/test/tc_document_write.rb +2 -3
  40. data/test/tc_dtd.rb +4 -5
  41. data/test/tc_encoding.rb +126 -126
  42. data/test/tc_encoding_sax.rb +4 -3
  43. data/test/tc_error.rb +14 -15
  44. data/test/tc_html_parser.rb +15 -7
  45. data/test/tc_html_parser_context.rb +1 -2
  46. data/test/tc_namespace.rb +2 -3
  47. data/test/tc_namespaces.rb +5 -6
  48. data/test/tc_node.rb +2 -3
  49. data/test/tc_node_cdata.rb +2 -3
  50. data/test/tc_node_comment.rb +1 -2
  51. data/test/tc_node_copy.rb +1 -2
  52. data/test/tc_node_edit.rb +5 -7
  53. data/test/tc_node_pi.rb +1 -2
  54. data/test/tc_node_text.rb +2 -3
  55. data/test/tc_node_write.rb +2 -3
  56. data/test/tc_node_xlink.rb +1 -2
  57. data/test/tc_parser.rb +18 -24
  58. data/test/tc_parser_context.rb +6 -7
  59. data/test/tc_properties.rb +1 -2
  60. data/test/tc_reader.rb +9 -10
  61. data/test/tc_relaxng.rb +4 -5
  62. data/test/tc_sax_parser.rb +9 -10
  63. data/test/tc_schema.rb +4 -5
  64. data/test/tc_traversal.rb +1 -2
  65. data/test/tc_writer.rb +1 -2
  66. data/test/tc_xinclude.rb +1 -2
  67. data/test/tc_xml.rb +1 -2
  68. data/test/tc_xpath.rb +8 -9
  69. data/test/tc_xpath_context.rb +3 -4
  70. data/test/tc_xpath_expression.rb +3 -4
  71. data/test/tc_xpointer.rb +1 -3
  72. data/test/test_helper.rb +3 -1
  73. data/test/test_suite.rb +0 -1
  74. metadata +47 -11
  75. data/test/etc_doc_to_s.rb +0 -21
  76. data/test/ets_doc_file.rb +0 -17
  77. data/test/ets_doc_to_s.rb +0 -23
  78. data/test/ets_gpx.rb +0 -28
  79. data/test/ets_node_gc.rb +0 -23
  80. data/test/ets_test.xml +0 -2
  81. data/test/ets_tsr.rb +0 -11
@@ -1,9 +1,8 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  require './test_helper'
4
- require 'test/unit'
5
4
 
6
- class TestTranversal < Test::Unit::TestCase
5
+ class TestTranversal < Minitest::Test
7
6
  ROOT_NODES_LENGTH = 27
8
7
  ROOT_ELEMENTS_LENGTH = 13
9
8
 
@@ -2,9 +2,8 @@
2
2
 
3
3
  require './test_helper'
4
4
  require 'stringio'
5
- require 'test/unit'
6
5
 
7
- class TestWriter < Test::Unit::TestCase
6
+ class TestWriter < Minitest::Test
8
7
  XSL_PREFIX = 'xsl'
9
8
  XSL_URI = 'http://www.w3.org/1999/XSL/Transform'
10
9
 
@@ -1,9 +1,8 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  require './test_helper'
4
- require 'test/unit'
5
4
 
6
- class TestXInclude < Test::Unit::TestCase
5
+ class TestXInclude < Minitest::Test
7
6
  def setup
8
7
  @doc = XML::Document.file(File.join(File.dirname(__FILE__), 'model/xinclude.xml'))
9
8
  assert_instance_of(XML::Document, @doc)
@@ -1,10 +1,9 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  require './test_helper'
4
- require 'test/unit'
5
4
  require 'stringio'
6
5
 
7
- class TestXml < Test::Unit::TestCase
6
+ class TestXml < Minitest::Test
8
7
  # ----- Constants ------
9
8
  def test_lib_versions
10
9
  assert(XML.check_lib_versions)
@@ -2,9 +2,8 @@
2
2
 
3
3
  require './test_helper'
4
4
  require 'tempfile'
5
- require 'test/unit'
6
5
 
7
- class TestXPath < Test::Unit::TestCase
6
+ class TestXPath < Minitest::Test
8
7
  def setup
9
8
  @doc = XML::Document.file(File.join(File.dirname(__FILE__), 'model/soap.xml'))
10
9
  end
@@ -109,17 +108,17 @@ class TestXPath < Test::Unit::TestCase
109
108
  doc = XML::Document.file(File.join(File.dirname(__FILE__), 'model/atom.xml'))
110
109
 
111
110
  # No namespace has been yet defined
112
- assert_raise(XML::Error) do
111
+ assert_raises(XML::Error) do
113
112
  node = doc.find("atom:title")
114
113
  end
115
114
 
116
115
  node = doc.find('atom:title', 'atom:http://www.w3.org/2005/Atom')
117
- assert_not_nil(node)
116
+ refute_nil(node)
118
117
 
119
118
  # Register namespace
120
119
  doc.root.namespaces.default_prefix = 'atom'
121
120
  node = doc.find("atom:title")
122
- assert_not_nil(node)
121
+ refute_nil(node)
123
122
  end
124
123
 
125
124
  def test_node_find
@@ -145,7 +144,7 @@ class TestXPath < Test::Unit::TestCase
145
144
 
146
145
  def test_node_no_doc
147
146
  node = XML::Node.new('header', 'some content')
148
- assert_raise(TypeError) do
147
+ assert_raises(TypeError) do
149
148
  node = node.find_first('/header')
150
149
  end
151
150
  end
@@ -201,20 +200,20 @@ class TestXPath < Test::Unit::TestCase
201
200
  def test_xpath_empty_result
202
201
  doc = XML::Document.string('<html><body><p>Welcome to XHTML land!</p></body></html>')
203
202
  nodes = doc.find("//object/param[translate(@name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'wmode']")
204
- assert_not_nil nodes
203
+ refute_nil nodes
205
204
  end
206
205
 
207
206
  def test_invalid_expression
208
207
  xml = LibXML::XML::Document.string('<a></a>')
209
208
 
210
209
  # Using the expression twice used to cause a Segmentation Fault
211
- error = assert_raise(XML::Error) do
210
+ error = assert_raises(XML::Error) do
212
211
  xml.find('//a/')
213
212
  end
214
213
  assert_equal("Error: Invalid expression.", error.to_s)
215
214
 
216
215
  # Try again - this used to cause a Segmentation Fault
217
- error = assert_raise(XML::Error) do
216
+ error = assert_raises(XML::Error) do
218
217
  xml.find('//a/')
219
218
  end
220
219
  assert_equal("Error: Invalid expression.", error.to_s)
@@ -2,9 +2,8 @@
2
2
 
3
3
  require './test_helper'
4
4
  require "tempfile"
5
- require "test/unit"
6
5
 
7
- class TestXPathContext < Test::Unit::TestCase
6
+ class TestXPathContext < Minitest::Test
8
7
  SOAP_PREFIX = 'soap'
9
8
  SOAP_URI = 'http://schemas.xmlsoap.org/soap/envelope/'
10
9
 
@@ -21,7 +20,7 @@ class TestXPathContext < Test::Unit::TestCase
21
20
  end
22
21
 
23
22
  def test_no_ns
24
- error = assert_raise(LibXML::XML::Error) do
23
+ error = assert_raises(LibXML::XML::Error) do
25
24
  @context.find('/soap:Envelope')
26
25
  end
27
26
  assert_equal("Error: Undefined namespace prefix.", error.to_s)
@@ -81,7 +80,7 @@ class TestXPathContext < Test::Unit::TestCase
81
80
 
82
81
  def test_require_doc
83
82
  doc = XML::Document.file(File.join(File.dirname(__FILE__), 'model/soap.xml'))
84
- error = assert_raise(TypeError) do
83
+ error = assert_raises(TypeError) do
85
84
  @context = XML::XPath::Context.new(doc.root)
86
85
  end
87
86
  assert_equal("Supplied argument must be a document or node.", error.to_s)
@@ -2,9 +2,8 @@
2
2
 
3
3
  require './test_helper'
4
4
 
5
- require 'test/unit'
6
5
 
7
- class TestXPathExpression < Test::Unit::TestCase
6
+ class TestXPathExpression < Minitest::Test
8
7
  def setup
9
8
  xp = XML::Parser.string('<ruby_array uga="booga" foo="bar"><fixnum>one</fixnum><fixnum>two</fixnum></ruby_array>')
10
9
  @doc = xp.parse
@@ -29,10 +28,10 @@ class TestXPathExpression < Test::Unit::TestCase
29
28
  end
30
29
 
31
30
  def test_find_invalid
32
- error = assert_raise(TypeError) do
31
+ error = assert_raises(TypeError) do
33
32
  set = @doc.find(999)
34
33
  end
35
- assert_equal('Argument should be an intance of a String or XPath::Expression',
34
+ assert_equal('Argument should be an instance of a String or XPath::Expression',
36
35
  error.to_s)
37
36
  end
38
37
  end
@@ -1,9 +1,7 @@
1
1
  # encoding: UTF-8
2
-
3
2
  require './test_helper'
4
- require "test/unit"
5
3
 
6
- class TC_XML_XPointer < Test::Unit::TestCase
4
+ class TC_XML_XPointer < Minitest::Test
7
5
  def setup()
8
6
  xp = XML::Parser.string('<!DOCTYPE ra [<!ELEMENT ra (foo+)><!ATTLIST ra id ID #IMPLIED><!ELEMENT foo (#PCDATA)><!ATTLIST foo id ID #IMPLIED>]><ra id="start"><foo id="one">one</foo><foo id="two">two</foo><foo id="three">three</foo></ra>')
9
7
  @doc = xp.parse
@@ -11,4 +11,6 @@ $LOAD_PATH << lib
11
11
  $LOAD_PATH << ext
12
12
 
13
13
  require 'xml'
14
-
14
+ require 'minitest/autorun'
15
+ # require 'minitest/reporters'
16
+ # MiniTest::Reporters.use!
@@ -40,7 +40,6 @@ require './tc_xpath_context'
40
40
  require './tc_xpath_expression'
41
41
  require './tc_xpointer'
42
42
 
43
-
44
43
  if defined?(Encoding)
45
44
  require './tc_encoding'
46
45
  require './tc_encoding_sax'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libxml-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Bamform
@@ -14,8 +14,50 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2015-01-09 00:00:00.000000000 Z
18
- dependencies: []
17
+ date: 2016-06-13 00:00:00.000000000 Z
18
+ dependencies:
19
+ - !ruby/object:Gem::Dependency
20
+ name: hanna_guado
21
+ requirement: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
26
+ type: :development
27
+ prerelease: false
28
+ version_requirements: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: rake-compiler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: minitest
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
19
61
  description: |2
20
62
  The Libxml-Ruby project provides Ruby language bindings for the GNOME
21
63
  Libxml2 XML toolkit. It is free software, released under the MIT License.
@@ -33,6 +75,7 @@ files:
33
75
  - MANIFEST
34
76
  - README.rdoc
35
77
  - Rakefile
78
+ - ext/libxml/extconf.h
36
79
  - ext/libxml/extconf.rb
37
80
  - ext/libxml/libxml.c
38
81
  - ext/libxml/libxml_ruby.def
@@ -176,13 +219,6 @@ files:
176
219
  - test/c14n/result/without-comments/example-5
177
220
  - test/c14n/result/without-comments/example-6
178
221
  - test/c14n/result/without-comments/example-7
179
- - test/etc_doc_to_s.rb
180
- - test/ets_doc_file.rb
181
- - test/ets_doc_to_s.rb
182
- - test/ets_gpx.rb
183
- - test/ets_node_gc.rb
184
- - test/ets_test.xml
185
- - test/ets_tsr.rb
186
222
  - test/model/atom.xml
187
223
  - test/model/bands.iso-8859-1.xml
188
224
  - test/model/bands.utf-8.xml
@@ -259,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
295
  version: '0'
260
296
  requirements: []
261
297
  rubyforge_project:
262
- rubygems_version: 2.4.5
298
+ rubygems_version: 2.5.1
263
299
  signing_key:
264
300
  specification_version: 4
265
301
  summary: Ruby Bindings for LibXML2
@@ -1,21 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require './test_helper'
4
-
5
- 1.times do |count|
6
-
7
- xml_doc = XML::Document.new()
8
- xml_doc.encoding = "UTF-8"
9
- xml_doc.root = XML::Node.new("Request")
10
-
11
- 1000.times do |index|
12
- xml_doc.root << node = XML::Node.new("row")
13
- node["user_id"] = index.to_s
14
- node << "600445"
15
- end
16
-
17
- xml_str = xml_doc.to_s
18
- print "\r#{count}"
19
- $stdout.flush
20
- end
21
- puts "\n"
@@ -1,17 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require './test_helper'
4
-
5
- # This is related to bug 8337, complaint is on amd64/fbsd
6
- # unknown if it happens on other amd64/os combos
7
-
8
- Process.setrlimit(Process::RLIMIT_NOFILE,10005)
9
-
10
- (1..10000).each{|time|
11
- XML::Document.file(File.join(File.dirname(__FILE__),'ets_test.xml'))
12
- if time % 100 == 0
13
- print "\r#{time}"
14
- $stdout.flush
15
- end
16
- }
17
- puts "\n"
@@ -1,23 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require './test_helper'
4
-
5
- 100.times do |count|
6
-
7
- xml_doc = XML::Document.new()
8
- xml_doc.encoding = "UTF-8"
9
- xml_doc.root = XML::Node.new("Request")
10
-
11
- 1000.times do |index|
12
-
13
- xml_doc.root << node = XML::Node.new("row")
14
- node["user_id"] = index.to_s
15
- node << "600445"
16
-
17
- end
18
-
19
- xml_str = xml_doc.to_s
20
- print "\r#{count}"
21
- $stdout.flush
22
- end
23
- puts "\n"
@@ -1,28 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require 'libxml'
4
-
5
- 100.times do
6
- doc = XML::Document.new
7
- doc.encoding = 'UTF-8'
8
-
9
- root = XML::Node.new 'gpx'
10
- root['version'] = '1.0'
11
- root['creator'] = 'OpenStreetMap.org'
12
- root['xmlns'] = "http://www.topografix.com/GPX/1/0/"
13
-
14
- doc.root = root
15
-
16
- track = XML::Node.new 'trk'
17
- doc.root << track
18
-
19
- trkseg = XML::Node.new 'trkseg'
20
- track << trkseg
21
-
22
- 1.upto(1000) do |n|
23
- trkpt = XML::Node.new 'trkpt'
24
- trkpt['lat'] = n.to_s
25
- trkpt['lon'] = n.to_s
26
- trkseg << trkpt
27
- end
28
- end
@@ -1,23 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require './test_helper'
4
-
5
- # test of bug 13310, clears MEM2
6
-
7
- include GC
8
-
9
- inner = XML::Node.new('inner')
10
- save = nil
11
- 1.times do
12
- outer = XML::Node.new('outer')
13
- outer.child = inner
14
- 1.times do
15
- doc = XML::Document.new
16
- doc.root = outer
17
- # Uncomment the following line and it won't crash
18
- save = doc
19
- end
20
- garbage_collect
21
- end
22
- garbage_collect
23
- puts inner
@@ -1,2 +0,0 @@
1
- <?xml version="1.0"?>
2
- <test/>
@@ -1,11 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require './test_helper'
4
-
5
- 10_000.times {|n|
6
- j=XML::Node.new2(nil,"happy#{n}")
7
- 10.times {|r|
8
- j1=XML::Node.new("happy#{r}","farts")
9
- j.child=j1
10
- }
11
- }