Skip to content

Commit 8ce436c

Browse files
committed
Remove deprecated methods.
1 parent cb088a4 commit 8ce436c

7 files changed

Lines changed: 14 additions & 64 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ This release is a major refresh of libxml-ruby. The most important changes inclu
1010
* Updated reference documentation to Ruby's new Aliki theme
1111
* Expanded tests
1212

13-
The release also include a number of smaller improvements, including:
13+
Breaking changes:
14+
15+
* Remove deprecated Document methods: dump, format_dump, debug_dump, debug_dump_head, debug_format_dump, reader
16+
* Remove deprecated Parser.register_error_handler (use Error.set_handler)
17+
* Remove deprecated HTMLParser#file=, #io=, #string= (use class methods HTMLParser.file, .io, .string)
18+
* Remove deprecated require paths: require 'libxml' and require 'xml/libxml' (use require 'libxml-ruby')
19+
* Fix misspelled Schema::Type#annonymus_subtypes -> anonymous_subtypes
20+
21+
The release also includes a number of smaller improvements, including:
1422

1523
* Support Ruby 4.0 (no changes were required)
1624
* Fix RelaxNG factories to raise on parse failure instead of wrapping NULL

ext/libxml/ruby_xml_version.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Don't nuke this block! It is used for automatically updating the
22
* versions below. VERSION = string formatting, VERNUM = numbered
33
* version for inline testing: increment both or none at all.*/
4-
#define RUBY_LIBXML_VERSION "5.0.6"
5-
#define RUBY_LIBXML_VERNUM 505
6-
#define RUBY_LIBXML_VER_MAJ 5
4+
#define RUBY_LIBXML_VERSION "6.0.0"
5+
#define RUBY_LIBXML_VERNUM 600
6+
#define RUBY_LIBXML_VER_MAJ 6
77
#define RUBY_LIBXML_VER_MIN 0
8-
#define RUBY_LIBXML_VER_MIC 6
8+
#define RUBY_LIBXML_VER_MIC 0
99
#define RUBY_LIBXML_VER_PATCH 0

lib/libxml.rb

Lines changed: 0 additions & 5 deletions
This file was deleted.

lib/libxml/document.rb

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -160,35 +160,6 @@ def html_doc?
160160
node_type == XML::Node::HTML_DOCUMENT_NODE
161161
end
162162

163-
def dump
164-
warn('Document#dump is deprecated. Use Document#to_s instead.')
165-
self.to_s
166-
end
167-
168-
def format_dump
169-
warn('Document#format_dump is deprecated. Use Document#to_s instead.')
170-
self.to_s
171-
end
172-
173-
def debug_dump
174-
warn('Document#debug_dump is deprecated. Use Document#debug instead.')
175-
self.debug
176-
end
177-
178-
def debug_dump_head
179-
warn('Document#debug_dump_head is deprecated. Use Document#debug instead.')
180-
self.debug
181-
end
182-
183-
def debug_format_dump
184-
warn('Document#debug_format_dump is deprecated. Use Document#to_s instead.')
185-
self.to_s
186-
end
187-
188-
def reader
189-
warn('Document#reader is deprecated. Use XML::Reader.document(self) instead.')
190-
XML::Reader.document(self)
191-
end
192163
end
193164
end
194165
end

lib/libxml/html_parser.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,6 @@ def self.string(string, base_uri: nil, encoding: nil, options: nil)
7575
self.new(context)
7676
end
7777

78-
# :enddoc:
79-
80-
def file=(value)
81-
warn("XML::HTMLParser#file is deprecated. Use XML::HTMLParser.file instead")
82-
@context = XML::HTMLParser::Context.file(value)
83-
end
84-
85-
def io=(value)
86-
warn("XML::HTMLParser#io is deprecated. Use XML::HTMLParser.io instead")
87-
@context = XML::HTMLParser::Context.io(value)
88-
end
89-
90-
def string=(value)
91-
warn("XML::HTMLParser#string is deprecated. Use XML::HTMLParser.string instead")
92-
@context = XML::HTMLParser::Context.string(value)
93-
end
9478
end
9579
end
9680
end

lib/libxml/parser.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,6 @@ def self.string(string, base_uri: nil, encoding: nil, options: nil)
9090
self.new(context)
9191
end
9292

93-
def self.register_error_handler(proc)
94-
warn('Parser.register_error_handler is deprecated. Use Error.set_handler instead')
95-
if proc.nil?
96-
Error.reset_handler
97-
else
98-
Error.set_handler(&proc)
99-
end
100-
end
10193
end
10294
end
10395
end

test/test_error.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def test_double_parse
154154
end
155155

156156
def test_double_parse_register_handler
157-
LibXML::XML::Parser.register_error_handler(lambda {|msg| nil })
157+
LibXML::XML::Error.set_handler {|msg| nil }
158158
parser = LibXML::XML::Parser.string("<test>something</test>")
159159
parser.parse
160160

0 commit comments

Comments
 (0)