libxml-ruby 3.0.0 → 3.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +5 -5
  2. data/HISTORY +37 -0
  3. data/MANIFEST +34 -34
  4. data/README.rdoc +65 -36
  5. data/Rakefile +21 -3
  6. data/ext/libxml/extconf.rb +30 -26
  7. data/ext/libxml/ruby_libxml.h +0 -8
  8. data/ext/libxml/ruby_xml.c +40 -0
  9. data/ext/libxml/ruby_xml_document.c +1 -5
  10. data/ext/libxml/ruby_xml_dtd.c +6 -8
  11. data/ext/libxml/ruby_xml_encoding.c +1 -13
  12. data/ext/libxml/ruby_xml_encoding.h +0 -3
  13. data/ext/libxml/ruby_xml_error.c +1 -1
  14. data/ext/libxml/ruby_xml_error.h +1 -1
  15. data/ext/libxml/ruby_xml_io.c +14 -18
  16. data/ext/libxml/ruby_xml_io.h +1 -1
  17. data/ext/libxml/ruby_xml_node.c +16 -17
  18. data/ext/libxml/ruby_xml_parser_context.c +1 -1
  19. data/ext/libxml/ruby_xml_reader.c +7 -2
  20. data/ext/libxml/ruby_xml_schema.c +44 -66
  21. data/ext/libxml/ruby_xml_schema_element.c +15 -14
  22. data/ext/libxml/ruby_xml_schema_type.c +66 -93
  23. data/ext/libxml/ruby_xml_version.h +4 -4
  24. data/ext/libxml/ruby_xml_writer.c +189 -192
  25. data/lib/libxml/schema/element.rb +0 -8
  26. data/lib/libxml/schema/type.rb +0 -8
  27. data/lib/libxml/schema.rb +0 -19
  28. data/lib/libxml-ruby.rb +30 -0
  29. data/lib/libxml.rb +3 -28
  30. data/libxml-ruby.gemspec +5 -4
  31. data/setup.rb +0 -1
  32. data/test/model/cwm_1_0.xml +11336 -0
  33. data/test/{tc_attr.rb → test_attr.rb} +18 -18
  34. data/test/{tc_attr_decl.rb → test_attr_decl.rb} +8 -8
  35. data/test/{tc_attributes.rb → test_attributes.rb} +10 -10
  36. data/test/{tc_canonicalize.rb → test_canonicalize.rb} +35 -39
  37. data/test/test_deprecated_require.rb +12 -0
  38. data/test/{tc_document.rb → test_document.rb} +31 -24
  39. data/test/test_document_write.rb +146 -0
  40. data/test/{tc_dtd.rb → test_dtd.rb} +26 -25
  41. data/test/{tc_encoding.rb → test_encoding.rb} +20 -17
  42. data/test/{tc_encoding_sax.rb → test_encoding_sax.rb} +3 -3
  43. data/test/test_error.rb +178 -0
  44. data/test/test_helper.rb +4 -11
  45. data/test/{tc_html_parser.rb → test_html_parser.rb} +31 -30
  46. data/test/test_html_parser_context.rb +23 -0
  47. data/test/test_namespace.rb +60 -0
  48. data/test/{tc_namespaces.rb → test_namespaces.rb} +29 -38
  49. data/test/{tc_node.rb → test_node.rb} +37 -31
  50. data/test/{tc_node_cdata.rb → test_node_cdata.rb} +10 -10
  51. data/test/{tc_node_comment.rb → test_node_comment.rb} +6 -6
  52. data/test/{tc_node_copy.rb → test_node_copy.rb} +3 -4
  53. data/test/{tc_node_edit.rb → test_node_edit.rb} +20 -21
  54. data/test/{tc_node_pi.rb → test_node_pi.rb} +8 -10
  55. data/test/{tc_node_text.rb → test_node_text.rb} +8 -9
  56. data/test/{tc_node_write.rb → test_node_write.rb} +16 -26
  57. data/test/test_node_xlink.rb +28 -0
  58. data/test/{tc_parser.rb → test_parser.rb} +72 -75
  59. data/test/{tc_parser_context.rb → test_parser_context.rb} +38 -44
  60. data/test/{tc_properties.rb → test_properties.rb} +5 -5
  61. data/test/test_reader.rb +364 -0
  62. data/test/{tc_relaxng.rb → test_relaxng.rb} +11 -11
  63. data/test/{tc_sax_parser.rb → test_sax_parser.rb} +38 -31
  64. data/test/{tc_schema.rb → test_schema.rb} +40 -33
  65. data/test/test_suite.rb +39 -40
  66. data/test/{tc_traversal.rb → test_traversal.rb} +4 -4
  67. data/test/{tc_writer.rb → test_writer.rb} +95 -74
  68. data/test/{tc_xinclude.rb → test_xinclude.rb} +3 -3
  69. data/test/test_xml.rb +263 -0
  70. data/test/{tc_xpath.rb → test_xpath.rb} +25 -25
  71. data/test/{tc_xpath_context.rb → test_xpath_context.rb} +5 -5
  72. data/test/{tc_xpath_expression.rb → test_xpath_expression.rb} +7 -7
  73. data/test/{tc_xpointer.rb → test_xpointer.rb} +15 -15
  74. metadata +91 -102
  75. data/test/tc_deprecated_require.rb +0 -12
  76. data/test/tc_document_write.rb +0 -195
  77. data/test/tc_error.rb +0 -178
  78. data/test/tc_html_parser_context.rb +0 -23
  79. data/test/tc_namespace.rb +0 -61
  80. data/test/tc_node_xlink.rb +0 -28
  81. data/test/tc_reader.rb +0 -358
  82. data/test/tc_xml.rb +0 -225
@@ -5,14 +5,6 @@ module LibXML
5
5
  Schema::Types.constants.find { |k| Schema::Types.const_get(k) == kind }
6
6
  end
7
7
 
8
- def annotation
9
- return if node.nil?
10
- annotations = node.children.select { |n| n.name == 'annotation' }
11
- annotations.map do |annotation|
12
- annotation.children.map(&:content).join("\n")
13
- end.join("\n")
14
- end
15
-
16
8
  def annonymus_subtypes
17
9
  elements.select { |_, e| e.type.name.nil? }
18
10
  end
data/lib/libxml/schema.rb CHANGED
@@ -43,25 +43,6 @@ module LibXML
43
43
  XML_SCHEMA_EXTRA_QNAMEREF = 2000
44
44
  XML_SCHEMA_EXTRA_ATTR_USE_PROHIB = 2001
45
45
  end
46
-
47
- class Namespaces < Array
48
- def find_by_href(href)
49
- find { |n| n.href == href }
50
- end
51
-
52
- def find_by_prefix(prefix)
53
- find { |n| n.prefix == prefix }
54
- end
55
- end
56
-
57
- def namespaces
58
- Namespaces.new(_namespaces.uniq { |n| n.href })
59
- end
60
-
61
- def self.cached(location)
62
- @_schemas ||= {}
63
- @_schemas[location] ||= new(location)
64
- end
65
46
  end
66
47
  end
67
48
  end
@@ -0,0 +1,30 @@
1
+ # encoding: UTF-8
2
+
3
+ # Load the C-based binding.
4
+ begin
5
+ RUBY_VERSION =~ /(\d+.\d+)/
6
+ require "#{$1}/libxml_ruby"
7
+ rescue LoadError
8
+ require "libxml_ruby"
9
+ end
10
+
11
+ # Load Ruby supporting code.
12
+ require 'libxml/error'
13
+ require 'libxml/parser'
14
+ require 'libxml/document'
15
+ require 'libxml/namespaces'
16
+ require 'libxml/namespace'
17
+ require 'libxml/node'
18
+ require 'libxml/attributes'
19
+ require 'libxml/attr'
20
+ require 'libxml/attr_decl'
21
+ require 'libxml/tree'
22
+ require 'libxml/html_parser'
23
+ require 'libxml/sax_parser'
24
+ require 'libxml/sax_callbacks'
25
+
26
+ #Schema Interface
27
+ require 'libxml/schema'
28
+ require 'libxml/schema/type'
29
+ require 'libxml/schema/element'
30
+ require 'libxml/schema/attribute'
data/lib/libxml.rb CHANGED
@@ -1,30 +1,5 @@
1
1
  # encoding: UTF-8
2
+ #
3
+ # This include is deprecated, use libxml-ruby instead!
2
4
 
3
- # Load the C-based binding.
4
- begin
5
- RUBY_VERSION =~ /(\d+.\d+)/
6
- require "#{$1}/libxml_ruby"
7
- rescue LoadError
8
- require "libxml_ruby"
9
- end
10
-
11
- # Load Ruby supporting code.
12
- require 'libxml/error'
13
- require 'libxml/parser'
14
- require 'libxml/document'
15
- require 'libxml/namespaces'
16
- require 'libxml/namespace'
17
- require 'libxml/node'
18
- require 'libxml/attributes'
19
- require 'libxml/attr'
20
- require 'libxml/attr_decl'
21
- require 'libxml/tree'
22
- require 'libxml/html_parser'
23
- require 'libxml/sax_parser'
24
- require 'libxml/sax_callbacks'
25
-
26
- #Schema Interface
27
- require 'libxml/schema'
28
- require 'libxml/schema/type'
29
- require 'libxml/schema/element'
30
- require 'libxml/schema/attribute'
5
+ require 'libxml-ruby'
data/libxml-ruby.gemspec CHANGED
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ require 'date'
2
3
 
3
4
  # Determine the current version of the software
4
5
  version = File.read('ext/libxml/ruby_xml_version.h').match(/\s*RUBY_LIBXML_VERSION\s*['"](\d.+)['"]/)[1]
@@ -6,7 +7,7 @@ version = File.read('ext/libxml/ruby_xml_version.h').match(/\s*RUBY_LIBXML_VERSI
6
7
  Gem::Specification.new do |spec|
7
8
  spec.name = 'libxml-ruby'
8
9
  spec.version = version
9
- spec.homepage = 'http://xml4r.github.com/libxml-ruby'
10
+ spec.homepage = 'https://xml4r.github.io/libxml-ruby/'
10
11
  spec.summary = 'Ruby Bindings for LibXML2'
11
12
  spec.description = <<-EOS
12
13
  The Libxml-Ruby project provides Ruby language bindings for the GNOME
@@ -37,10 +38,10 @@ Gem::Specification.new do |spec|
37
38
  'lib/**/*.rb',
38
39
  'script/**/*',
39
40
  'test/**/*'])
40
- spec.test_files = Dir.glob('test/tc_*.rb')
41
- spec.required_ruby_version = '>= 1.8.6'
41
+
42
+ spec.test_files = Dir.glob('test/test_*.rb')
43
+ spec.required_ruby_version = '>= 2.5'
42
44
  spec.date = DateTime.now
43
- spec.add_development_dependency('hanna_guado')
44
45
  spec.add_development_dependency('rake-compiler')
45
46
  spec.add_development_dependency('minitest')
46
47
  spec.license = 'MIT'
data/setup.rb CHANGED
@@ -281,7 +281,6 @@ class ConfigTable
281
281
  'site-ruby-common' => 'siteruby', # For backward compatibility
282
282
  'site-ruby' => 'siterubyver', # For backward compatibility
283
283
  'bin-dir' => 'bindir',
284
- 'bin-dir' => 'bindir',
285
284
  'rb-dir' => 'rbdir',
286
285
  'so-dir' => 'sodir',
287
286
  'data-dir' => 'datadir',