code4lib / ruby-oai

a Ruby library for building OAI-PMH clients and servers
MIT License
62 stars 42 forks source link

replace REXML with nokogiri (note REXML code currently breaks in ruby 3.0) #68

Open jrochkind opened 4 years ago

jrochkind commented 4 years ago

This code is still using REXML. It should be replaced with nokogiri, becuase REXML is unmaintained and abandoned and much slower than nokogiri.

If there are other alternatives to nokogiri someone wants to suggest, feel free. Nokogiri is definitely the most popular in ruby at present, and one most developers are familiar with (for purposes of writing the code in this gem), but perhaps there's something lighter weight suffiicent for needs here.

jrochkind commented 4 years ago

REXML is used both in tests and in actual live code.

Replacing it in live code is more important than replacing it in tests. Although it might make sense to get it out of tests too, I'd start with replacing it in live code without touching the tests and still having them green, and then considering if you want to leave it that way, or replace REXML in tests too.

jrochkind commented 2 years ago

Note that current code fails on ruby 3.0, because of assuming rexml is in stdlib, which it no longer is.

If I try to run tests in ruby 3.0, I get:

$ bundle exec rake
/Users/jrochkind/code/ruby-oai/lib/oai/provider.rb:1:in `require': cannot load such file -- rexml/document (LoadError)

For Ruby 3.0, you may need to add rexml as an explicit dependency, but not sure if that will break things in older versions of ruby. We really have to fix this one way or another.