Skip to content

Commit 75b127b

Browse files
committed
Remove deprecated require shims and fix require_relative issue
Remove lib/xml.rb and lib/xml/libxml.rb which were deprecated entry points that polluted the global namespace. Use require 'libxml-ruby' instead. Revert require_relative back to require for loading the C extension so RubyGems can find the .so via $LOAD_PATH when installed as a gem. Update docs and changelog. Fixes #226
1 parent 9a634e2 commit 75b127b

4 files changed

Lines changed: 6 additions & 34 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Breaking changes:
1515
* Remove deprecated Document methods: dump, format_dump, debug_dump, debug_dump_head, debug_format_dump, reader
1616
* Remove deprecated Parser.register_error_handler (use Error.set_handler)
1717
* 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')
18+
* Remove deprecated require paths: require 'libxml', require 'xml/libxml', and require 'xml' (use require 'libxml-ruby')
1919
* Fix misspelled Schema::Type#annonymus_subtypes -> anonymous_subtypes
2020

2121
The release also includes a number of smaller improvements, including:
@@ -32,6 +32,10 @@ The release also includes a number of smaller improvements, including:
3232
* Remove dead Float::INFINITY definition for Ruby 1.8.7
3333
* Add mswin CI job using vcpkg for libxml2
3434
* Minimum Ruby version is now 3.2
35+
* Revert require_relative back to require for loading the C extension (fixes #226)
36+
* Allow nil for external and system IDs when creating a DTD (fixes #215)
37+
* Fix C14N document subset canonicalization with namespace nodes
38+
* Enable W3C C14N spec tests 3.5 (entity references) and 3.7 (document subsets)
3539
* Rename HISTORY to CHANGELOG.md, README.rdoc to README.md
3640

3741
== 5.0.6 / 2026-04-03

docs/getting_started.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,14 @@
22

33
## Requiring the Library
44

5-
There are several ways to load libxml-ruby:
6-
75
```ruby
8-
# Recommended - keeps everything under the LibXML namespace
96
require 'libxml-ruby'
107
document = LibXML::XML::Document.new
118
```
129

13-
```ruby
14-
# Convenience - mixes LibXML into the global namespace
15-
require 'xml'
16-
document = XML::Document.new
17-
```
10+
If you prefer shorter names, include the LibXML module in your own namespace:
1811

1912
```ruby
20-
# In your own namespace
2113
require 'libxml-ruby'
2214

2315
module MyApp

lib/xml.rb

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

lib/xml/libxml.rb

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

0 commit comments

Comments
 (0)