Comments (8)
Yes, that is correct, and a breaking change (thus the 5.0.0 version). Passing options was switched to use keyword parameters instead of the old style of passing hashes (see the release notes). You'll have to update your code. Sorry for the breakage, but this seemed like the right time to do the API change to go along with the deprecation of global settings in limbxml2 2.12.
from libxml-ruby.
The note is in the changelog. See https://github.com/xml4r/libxml-ruby/blob/master/HISTORY
FYI #211 is a definitely a bug and fixed.
from libxml-ruby.
Sorry, I couldn't find a place in the documentation where it says that we need to pass keyword params. Here? (link from the github page).
Well, this is how the the method io
is defined:
module LibXML
module XML
class Document
#...
def self.io(value, options = {})
Parser.io(value, options).parse
end
#...
end
end
which invokes this method here
module LibXML
module XML
class Parser
#...
def self.io(io, base_uri: nil, encoding: nil, options: nil)
context = XML::Parser::Context.io(io)
context.base_uri = base_uri if base_uri
context.encoding = encoding if encoding
context.options = options if options
self.new(context)
end
#...
end
end
So, self.io
methods requires an IO object and an optional options
.
Moreover, I call simply by
XML::Document.io(StringIO.new("<xml>Hello, world!</xml>"))
from libxml-ruby.
Seems like I opened a duplicate but similar query here -> #211
It looks like the library has a bug from what I understand.
from libxml-ruby.
@vseguin But @cfis thinks differently, "breaking changes" and closed right away.
from libxml-ruby.
@fade2black it does seem that @cfis fixed it now, just waiting for a new update to be released 🙌 Thanks for being super-reactive here.
from libxml-ruby.
@cfis You wrote to me
Yes, that is correct, and a breaking change (thus the 5.0.0 version). Passing options was switched to use keyword parameters instead of the old style of passing hashes (see the release notes). You'll have to update your code. Sorry for the breakage, but this seemed like the right time to do the API change to go along with the deprecation of global settings in limbxml2 2.12.
What does that mean? I guess it is YOU should fix your buggy code (if it is a bug) or add corresponding docs, not me to update my APIs.
from libxml-ruby.
@cfis FYI Unlike you I do know very well semver and CO and can tell apart bug from a breaking changes.
You first screw up, next blame me that I need to "update my APIs" instead of having close look at your bug, and then make a sneak fix? This is childish, irrespecutful, and unprofessional of you. I wonder how a "developer" like you maintains this gem. That explains why it lacks a proper documentation and does not have proper tests that catch such simple bugs.
from libxml-ruby.
Related Issues (20)
- Uncaught exception: cannot load such file -- libxml_ruby even if it's installed. HOT 7
- Memory leak in `path` method HOT 5
- Memory leak HOT 2
- Repository website URL (xml4r.github.com) is broken HOT 2
- xmlGetFeaturesList is deprecated HOT 7
- Validating an XML file is well-formed HOT 1
- How close `LibXML::XML::Writer.file`? HOT 2
- Cannot compile gem on Ruby 2.5 HOT 1
- Failed to build gem native extension. HOT 2
- Error parsing documentation when installing libxml-ruby-3.2.3 HOT 8
- New release, pretty please HOT 2
- Can't build with libxml 2.10.3 HOT 3
- Cannot install 3.2.3 due to missing xlink headers HOT 3
- Spurious warning when running with Ruby 3.2: "undefining the allocator of T_DATA class LibXML::XML::Writer" HOT 10
- Can't build with libxml 2.10.4 on Intel Mac HOT 1
- Error compiling ruby_xml_error.c with libxml 2.10.4 on Intel Mac HOT 1
- Error compiling native extension on Intel Mac HOT 2
- Version 5.0.0 breaks in .io method HOT 3
- `bundle exec rake compile` gets `error: incompatible function pointer types HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libxml-ruby.