Coder Social home page Coder Social logo

Comments (8)

Quintus avatar Quintus commented on June 24, 2024

Weird. I just tested your script, and I can reproduce the problem. However, I don’t think it is related to io-like, because this works as intended:

#!/usr/bin/env ruby
require 'resolv'
require "io/like"
puts Resolv.getaddress('google.com')
$ ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]

This will require some debugging. Thanks for reporting!

Vale,
Quintus

from ruby-xz.

Quintus avatar Quintus commented on June 24, 2024

Oh yes. Such a great bug. This was the cause:

class XZ::StreamReader < XZ::Stream
  # ...
  self.class.send(:alias_method, :open, :new)
  # ...
end

What this intended to do is to alias a class method. However, self is XZ::StreamReader in this context (the class object), so self.class is Class (the Ruby class for class objects). So what the code really did was redefining Class#open, which in turn seems to have quite nasty side effects.

However, it appears I accidentally fixed the problem already in commit a4ec945, where I removed that statement and replaced it with an explicit method definition, because I wanted to add a deprecation warning for a certain use of that alias. So, could you please test with current devel again? If you need a gem, you can run rake gem to build one.

Vale,
Quintus

from ruby-xz.

imoverclocked avatar imoverclocked commented on June 24, 2024

After running bundle clean, I was able to verify this bug is fixed with the following Gemfile:

source 'https://rubygems.org'
ruby '2.2.0'
gem 'ruby-xz', :git => 'https://github.com/Quintus/ruby-xz.git', :ref => '48e1fe2f2898056275eba73725d6e0df0eefb0dd'

Thanks for the fix! Looking forward to the released gem :)

from ruby-xz.

Quintus avatar Quintus commented on June 24, 2024

Okay, thanks for testing. It will be included into the next release 0.2.2 then.

Vale,
Quintus

from ruby-xz.

imoverclocked avatar imoverclocked commented on June 24, 2024

Do you have an ETA for a 0.2.2 release?

from ruby-xz.

Quintus avatar Quintus commented on June 24, 2024

Thanks for reminding me. I just released 0.2.2 and pushed it to rubygems.org.

Happy coding!

Vale,
Quintus

from ruby-xz.

imoverclocked avatar imoverclocked commented on June 24, 2024

Thanks!

from ruby-xz.

Quintus avatar Quintus commented on June 24, 2024

Due to a documentation error, I also released 0.2.3. The source code of 0.2.2 and 0.2.3 is otherwise identical.

Vale,
Quintus

from ruby-xz.

Related Issues (13)

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.