From: Robert Klemme Date: 2010-08-18T22:54:41+09:00 Subject: Re: Making File.open work on gzipped files 2010/8/18 Martin Hansen : > >> 1. refactor opening code (everything before "if block_given?") into a >> separate method which returns either IO or GzipReader. >> >> 2. fold parse and ios into one (i.e. the value returned from the other >> method). >> >> See http://ruby-doc.org/core/classes/Zlib/GzipFile.html#method-M007448 >> >> 3. In case of block_given? do not return true but rather nothing (i.e. >> what the block returned).  This is more flexible. > > 1 & 3 done! I dont quite get 2. If you have done 1 you will have a single variable left and hence done 2 as well. :-) Sorry for my bad wording. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/