ruby - GzipReader each_line method missing in Rubinius -


i trying read gzipped file using zlib:gzipreader. works expected using ruby 1.9.3 getting method_missing error each_line when using rubinius.

is there way read gzipped file using rubinius?

require 'zlib'  zlib::gzipreader.open("lines.txt.gz").each_line { |line|   puts "#{line}" }  kernel(zlib::gzipreader)#each_line (method_missing) @ kernel/delta/kernel.rb:81 

i believe bug in rubinius, should consider opening issue project. however, workaround should going:

require 'zlib' require 'stringio'  file = file.read("lines.txt.gz") lines = zlib::gzipreader.new(stringio.new(file)).read 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -