[ANN] Rio 0.3.1

R

rio4ruby

I am pleased to announce the first public release of Rio -- Rio 0.3.1

== Overview

Rio is a Ruby I/O convenience class wrapping much of the functionality
of IO, File and Dir. Rio also uses Pathname, 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.

A Rio is and can manipulate:
* a path
* the string representing that path
* the file, directory, web-page, or IO object to which that path refers
* the object created by opening that file or directory.

A Rio open itself, closes itself and selects its mode based on how it
used and the object referenced.

== Grande interface

With the grande interface you can:

Copy...
rio('afile') > astring # a file into a string
rio('afile') < astring # a string into a file
rio('afile') > anarray # lines of a file into array
rio('afile') < anarray # an array into a file
rio('afile') > rio('another_file') # a file into another file
rio('adir') > rio('another_directory') # a directory into another
rio('http://rubydoc.org/') > rio('afile') # a web page into a file

Iterate...
rio('adir').entries { |entrio| ... } # over directory entries
rio('adir').files { |entrio| ... } # over only files
rio('adir').dirs { |entrio| ... } # over only directories
rio('afile').lines { |line| ... } # over lines in a file

Create an array...
rio('adir').files[] # of files
rio('adir').dirs[] # of directories
rio('afile').lines[] # of lines

Whether copying, iterating or returning an array
Rio provides common input manipulations

rio('afile').chomp > anarray # chomped lines to an array
anarray = rio('afile').chomp[] # same thing
rio('afile.gz').gzip > rio('afile') # ungzip a file
rio('afile.gz').gzip < rio('afile') # gzip a file
rio('afile.gz').chomp { |line| ...} # iterate chomped lines

Whether copying, iterating or returning an array
Rio provides simple input selection

rio('afile').lines(0..9) > rio('file2') # the first 10 lines
rio('afile').lines(/Rio/) { |line| ...} # lines containing 'Rio'
anarray = rio('adir').files['*.rb'] # ruby files

Manipulation and selection methods can be combined

rio('afile').gzip.lines(/Rio/) > astring # 'Rio' lines from gz file
anarray = rio('afile').chomp[0..9] # first 10 lines chomped

Many more examples and documentation at http://rio.rubyforge.org/

== Copyright
Copyright (c) 2005, Christopher Kleckner. All rights reserved

== License
Rio is released under the GNU General Public License
(http://www.gnu.org/licenses/gpl.html)

-Christopher Kleckner
 
W

Wybo Dekker

rio4ruby said:
I am pleased to announce the first public release of Rio -- Rio 0.3.1

I tried this - what am I doing wrong?:

root>gem install rio --remote
Attempting remote installation of 'rio'
Successfully installed rio-0.3.1
Installing RDoc documentation for rio-0.3.1...
Could not find main page RIO::Doc::SYNOPSIS
Could not find main page RIO::Doc::SYNOPSIS
Could not find main page RIO::Doc::SYNOPSIS
Could not find main page RIO::Doc::SYNOPSIS
root>updatedb
root>locate rio.rb
/usr/local/lib/ruby/gems/1.8/gems/rio-0.3.1/doc/generators/template/html/rio.rb
/usr/local/lib/ruby/gems/1.8/gems/rio-0.3.1/lib/rio.rb
/usr/local/lib/ruby/gems/1.8/gems/rio-0.3.1/lib/rio/scheme/strio.rb
/usr/local/lib/ruby/gems/1.8/gems/rio-0.3.1/lib/rio/to_rio.rb
root>irb
irb(main):001:0> require 'rio'
LoadError: No such file to load -- rio
from (irb):1:in `require'
from (irb):1
irb(main):002:0> puts $LOAD_PATH
/home/local/ruby
/usr/local/lib/ruby
/usr/local/lib/ruby/site_ruby/1.8
/usr/local/lib/ruby/site_ruby/1.8/i686-linux
/usr/local/lib/ruby/site_ruby
/usr/local/lib/ruby/1.8
/usr/local/lib/ruby/1.8/i686-linux
 
S

Shalev NessAiver

Usually when requiring a gem you need to first " require 'rubygems' "
and then do "require 'rio' ".
That should fix your problem.

-Shalev
 
W

Wybo Dekker

Shalev said:
Usually when requiring a gem you need to first " require 'rubygems' "
and then do "require 'rio' ".
That should fix your problem.
it did - thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top