doc/ANNOUNCE in rio-0.3.7 vs doc/ANNOUNCE in rio-0.3.8

- old
+ new

@@ -1,36 +1,46 @@ -Piping Hot -- Rio 0.3.7 +Rio 0.3.8 == Overview Rio is a Ruby I/O convenience class wrapping much of the functionality of IO, File and Dir. Rio also uses FileUtils, Tempfile, StringIO, -OpenURI, Zlib, and CSV to provide similar functionality using a simple -consistent interface. In addition to forwarding the interfaces -provided by IO, File, and Dir to an appropriate object, Rio provides a -"grande" interface that allows many common application-level I/O and -file-system tasks to be expressed succinctly. +OpenURI, Net::FTP, Zlib, and CSV to provide similar functionality +using a simple consistent interface. In addition to forwarding the +interfaces provided by IO, File, and Dir to an appropriate object, Rio +provides a "grande" interface that allows many common application +level I/O and file-system tasks to be expressed succinctly. == New -Support for Pipe operator - # Pipe multiple commands - rio('afile') | rio(?-,'acmd') | 'another_cmd' | ?- +Enhanced support for FTP file-systems. All of Rio's most powerful +idioms are now supported seamlessly on FTP servers. - # run the same series of commands, with different input and/or output - cmdpipe = rio(?-,'acmd') | rio(?-,'another_cmd') - rio('infile1') | cmdpipe | rio('outfile1') - rio('infile2') | cmdpipe | rio('outfile2') + # copy a file from or to an FTP server + rio('ftp://ahost/adir/afile') > rio('localfile') # server -> local file + rio('ftp://ahost/adir/afile') < rio('localfile') # local file -> server - cmdpipe2 = rio(?|,'cmd1','cmd2','outfile') # create a cmdpipe Rio - rio('infile1') | cmdpipe2 # run with input coming from a file - rio(?-) | cmdpipe2 # same commands with input from stdin + # copy an entire directory structure from or to an FTP server + rio('ftp://ahost/adir') > rio('localdir') # server -> local directory + rio('ftp://ahost/adir') < rio('localdir') # local directory -> server -Improved support for MS Windows path specifications - rio('D:/adir/afile') - rio('//ahost/adir/afile') +All of Rio's grande selection and filtering options are available for +files and directories on FTP servers. + # create a gzipped copy of a web page on an ftp server + rio('ftp://ftphost/f.html.gz').gzip < rio('http://httphost/f.html') + + # dump the first 10 lines of a gzipped log file on an FTP server to stdout + rio('ftp://ftphost/logfile.txt').lines(0...10) > ?- + + # iterate through the entries of a directory on an FTP server + rio('ftp://ftphost/adir').entries { |entrio| ... } + + # get an array of all .rb files on an ftp server + rb_files = rio('ftp://ftphost/').all.files['*.rb'] + + == SYNOPSIS For the following assume: astring = "" anarray = [] @@ -133,78 +143,21 @@ Create a tab separated file of accounts in a UNIX passwd file, listing only the username, uid, and realname fields rio('/etc/passwd').csv(':').columns(0,2,4) > rio('rpt').csv("\t") -== New for version 0.3.4 +Pipe multiple commands + rio('afile') | rio(?-,'acmd') | 'another_cmd' | ?- -* New Grande Selection parameter. +== Contact - A major weakness of Rio's selection methods (lines, files, etc.) - has always been that it only implemented a logical OR. - - rio('afile').lines(0..10,/Rio/) {...} - iterates through lines that are in the range 0..10 OR - contain 'Rio'. - - rio('adir').files(:executable?,'*.rb') {...} - iterates through files that are executable OR match '*.rb' - - Selecting files that matched both required using a proc. - rio('adir').files(proc{ |f| f.executable? and f.fnmatch?('*.rb')}) {...} - - Rio's grande selection methods will now accept an array of conditions - which must all be matched, in order to be selected. A logical AND. - - rio('adir').files([:executable?,'*.rb']) {...} - - The array, of course, need not be the only paramter. - - rio('adir').files('*.exe',[:executable?,'*.rb']) {...} - - selects .exe files and .rb files that are executable. - -* Renamed some of grande rejection methods. - (based on a suggestion by Gavin Sinclair) - nolines => skiplines - nofiles => skipfiles - etc. - -* New skip() grande method - rio('afile').skip.lines(/Rio/) # same as skiplines(/Rio/) - rio('afile').lines(/Rio/).skip(0..9) # lines with 'Rio', exclude - # the first ten lines - -* Alternative syntaxes for creating Rios that have no path. - rio(?-) # create a Rio refering to stdio - rio(:stdio) # same thing. - rio.stdio # same thing - RIO.stdio # ditto - RIO::Rio.stdio # once again - -* From Pathname added - * root? - * mountpoint? - * realpath - * cleanpath - -* Removed Rio#slurp in favor of Rio#contents. - -* Added aliases for the copy operators. (suggested by Dave Burt) - * copy_to > - * append_to >> - * copy_from < - * append_from << - -* Bug fixes and corrections - Project:: http://rubyforge.org/projects/rio/ Documentation:: http://rio.rubyforge.org/ Bugs:: http://rubyforge.org/tracker/?group_id=821 Email:: rio4ruby@rubyforge.org == Copyright -Copyright (c) 2005, Christopher Kleckner. All rights reserved +Copyright (c) 2005, 2006 Christopher Kleckner. All rights reserved == License Rio is released under the GNU General Public License (http://www.gnu.org/licenses/gpl.html)