Comments (8)
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.
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.
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.
Okay, thanks for testing. It will be included into the next release 0.2.2 then.
Vale,
Quintus
from ruby-xz.
Do you have an ETA for a 0.2.2 release?
from ruby-xz.
Thanks for reminding me. I just released 0.2.2 and pushed it to rubygems.org.
Happy coding!
Vale,
Quintus
from ruby-xz.
Thanks!
from ruby-xz.
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)
- Remove dependency on io-like HOT 4
- Add methods for determining the approx. (de)compressed size HOT 1
- Sync API with Ruby’s Zlib::GzipFile HOT 2
- Invalid archive checksum should raise exception HOT 1
- can't require 'xz' on OS X without adding a symlink
- how to generate a lzma-js compatible string to decode in browser? HOT 1
- Stream (`IO`-like) mode would be great HOT 15
- Memory leak HOT 3
- StreamWriter crashes when writing more than a couple of bytes HOT 2
- Add 'io-like' dependency to gemspec. HOT 2
- remove initialize in lib_lzma.rb HOT 1
- Question: what constitutes big amounts of data? HOT 3
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 ruby-xz.