Git Product home page Git Product logo

Comments (8)

cfis avatar cfis commented on July 26, 2024 1

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.

cfis avatar cfis commented on July 26, 2024 1

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.

fade2black avatar fade2black commented on July 26, 2024

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.

vseguin avatar vseguin commented on July 26, 2024

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.

fade2black avatar fade2black commented on July 26, 2024

@vseguin But @cfis thinks differently, "breaking changes" and closed right away.

from libxml-ruby.

vseguin avatar vseguin commented on July 26, 2024

@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.

fade2black avatar fade2black commented on July 26, 2024

@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.

fade2black avatar fade2black commented on July 26, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.