How to decompress Gzip string in ruby?

Zlib::GzipReader can take "an IO, or IO-like, object." as it's input, as stated in docs. Zlib::GzipReader.open('hoge.gz') {|gz| print gz.read } File.open('hoge.gz') do |f| gz = Zlib::GzipRea...