Skip to content

Commit 20b8238

Browse files
committed
Clean up stale references and unnecessary compatibility code
- Update benchmark scripts to require 'libxml-ruby' - Remove defined?(::Encoding) guard (always true on Ruby 3.2+) - Remove stale rdoc excludes for deleted files in Rakefile and docs CI - Remove ruby_xml_cbg.c references from Xcode project - Ship Xcode project in gem alongside VC project
1 parent 1265cfb commit 20b8238

8 files changed

Lines changed: 6 additions & 12 deletions

File tree

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: zensical build --clean
4848

4949
- name: Build API reference
50-
run: rdoc --format aliki --output site/reference --title 'LibXML Ruby API' --line-numbers --charset=utf-8 --exclude lib/xml.rb --exclude lib/xml/libxml.rb --main README.md ext/**/libxml.c ext/**/ruby_xml.c ext/**/*.c lib/**/*.rb README.md
50+
run: rdoc --format aliki --output site/reference --title 'LibXML Ruby API' --line-numbers --charset=utf-8 --main README.md ext/**/libxml.c ext/**/ruby_xml.c ext/**/*.c lib/**/*.rb README.md
5151

5252
- name: Upload artifact
5353
uses: actions/upload-pages-artifact@v3

Rakefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ RDoc::Task.new("rdoc") do |rdoc|
6868
'README.md',
6969
'CHANGELOG.md',
7070
'LICENSE')
71-
rdoc.rdoc_files.exclude('lib/xml.rb', 'lib/xml/libxml.rb')
7271
end
7372

7473
# Test Task

ext/xcode/libxml-ruby.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
C7F2B5CD2B4B636C004E0A86 /* ruby_xml_attr_decl.c in Sources */ = {isa = PBXBuildFile; fileRef = C7F2B54A2B4B5AED004E0A86 /* ruby_xml_attr_decl.c */; };
5151
C7F2B5CE2B4B636C004E0A86 /* ruby_xml_attr.c in Sources */ = {isa = PBXBuildFile; fileRef = C7F2B5212B4B5AEC004E0A86 /* ruby_xml_attr.c */; };
5252
C7F2B5CF2B4B636C004E0A86 /* ruby_xml_attributes.c in Sources */ = {isa = PBXBuildFile; fileRef = C7F2B5482B4B5AED004E0A86 /* ruby_xml_attributes.c */; };
53-
C7F2B5D02B4B636C004E0A86 /* ruby_xml_cbg.c in Sources */ = {isa = PBXBuildFile; fileRef = C7F2B5382B4B5AED004E0A86 /* ruby_xml_cbg.c */; };
5453
C7F2B5D12B4B636C004E0A86 /* ruby_xml_document.c in Sources */ = {isa = PBXBuildFile; fileRef = C7F2B5522B4B5AED004E0A86 /* ruby_xml_document.c */; };
5554
C7F2B5D22B4B636C004E0A86 /* ruby_xml_dtd.c in Sources */ = {isa = PBXBuildFile; fileRef = C7F2B5622B4B5AEE004E0A86 /* ruby_xml_dtd.c */; };
5655
C7F2B5D32B4B636C004E0A86 /* ruby_xml_encoding.c in Sources */ = {isa = PBXBuildFile; fileRef = C7F2B5362B4B5AED004E0A86 /* ruby_xml_encoding.c */; };
@@ -124,7 +123,6 @@
124123
C7F2B5352B4B5AED004E0A86 /* ruby_xml_encoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ruby_xml_encoding.h; path = ../libxml/ruby_xml_encoding.h; sourceTree = "<group>"; };
125124
C7F2B5362B4B5AED004E0A86 /* ruby_xml_encoding.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ruby_xml_encoding.c; path = ../libxml/ruby_xml_encoding.c; sourceTree = "<group>"; };
126125
C7F2B5372B4B5AED004E0A86 /* ruby_xml_writer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ruby_xml_writer.c; path = ../libxml/ruby_xml_writer.c; sourceTree = "<group>"; };
127-
C7F2B5382B4B5AED004E0A86 /* ruby_xml_cbg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ruby_xml_cbg.c; path = ../libxml/ruby_xml_cbg.c; sourceTree = "<group>"; };
128126
C7F2B5392B4B5AED004E0A86 /* ruby_xml_schema_attribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ruby_xml_schema_attribute.h; path = ../libxml/ruby_xml_schema_attribute.h; sourceTree = "<group>"; };
129127
C7F2B53A2B4B5AED004E0A86 /* ruby_xml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ruby_xml.c; path = ../libxml/ruby_xml.c; sourceTree = "<group>"; };
130128
C7F2B53B2B4B5AED004E0A86 /* ruby_xml_namespace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ruby_xml_namespace.c; path = ../libxml/ruby_xml_namespace.c; sourceTree = "<group>"; };
@@ -203,7 +201,6 @@
203201
C7F2B54F2B4B5AED004E0A86 /* ruby_xml_attr.h */,
204202
C7F2B5482B4B5AED004E0A86 /* ruby_xml_attributes.c */,
205203
C7F2B52E2B4B5AED004E0A86 /* ruby_xml_attributes.h */,
206-
C7F2B5382B4B5AED004E0A86 /* ruby_xml_cbg.c */,
207204
C7F2B5522B4B5AED004E0A86 /* ruby_xml_document.c */,
208205
C7F2B5602B4B5AEE004E0A86 /* ruby_xml_document.h */,
209206
C7F2B5622B4B5AEE004E0A86 /* ruby_xml_dtd.c */,
@@ -409,7 +406,6 @@
409406
C7F2B5CD2B4B636C004E0A86 /* ruby_xml_attr_decl.c in Sources */,
410407
C7F2B5CE2B4B636C004E0A86 /* ruby_xml_attr.c in Sources */,
411408
C7F2B5CF2B4B636C004E0A86 /* ruby_xml_attributes.c in Sources */,
412-
C7F2B5D02B4B636C004E0A86 /* ruby_xml_cbg.c in Sources */,
413409
C7F2B5D12B4B636C004E0A86 /* ruby_xml_document.c in Sources */,
414410
C7F2B5D22B4B636C004E0A86 /* ruby_xml_dtd.c in Sources */,
415411
C7F2B5D32B4B636C004E0A86 /* ruby_xml_encoding.c in Sources */,

lib/libxml/node.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,7 @@ def xinclude_start?
313313

314314
def create_string_io(xml)
315315
result = StringIO.new("")
316-
if defined?(::Encoding)
317-
result.set_encoding(xml.encoding)
318-
end
316+
result.set_encoding(xml.encoding)
319317
result
320318
end
321319
end

libxml-ruby.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
3131
'ext/libxml/*.rb',
3232
'ext/vc/*.sln',
3333
'ext/vc/*.vcprojx',
34+
'ext/xcode/**/*',
3435
'lib/**/*.rb',
3536
'script/**/*',
3637
'test/**/*'])

script/benchmark/depixelate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require 'rubygems'
44
require 'benchmark'
55
require 'hpricot'
66
require 'rexml/document'
7-
require 'xml'
7+
require 'libxml-ruby'
88

99

1010
# Taken from http://depixelate.com/2008/4/23/ruby-xml-parsing-benchmarks

script/benchmark/parsecount

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ if RUBY_PLATFORM =~ /java/
8787
require 'nokogiri'
8888

8989
gem 'libxml-ruby', '>= 0.9.2'
90-
require 'libxml'
90+
require 'libxml-ruby'
9191
@xml_parser = LibXML::XML::Parser.new
9292
end
9393

script/benchmark/throughput

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require 'rubygems'
44
require 'hpricot'
5-
require 'xml'
5+
require 'libxml-ruby'
66
require 'rexml/document'
77

88
ITERATIONS = 3

0 commit comments

Comments
 (0)