RIO 0.4.0

Posted: April 3, 2007 in ノート, RUBY, Technology

Ubcol: “Bpapang… Abcol.. kamu beli apa lagi? Bpapang… Aku udah ini aja, pulang yuk, belanja di mal gini bosen, gak ada Jojon. Bpapang…

Col, mainanku naik kelas lagi col bpapang..”

Abcol: “Mainanmu yang mana lagi Ub?”
Ubcol: “Mainan RIO… Bpapang, bukan Ria, Ira apalagi Ari bpapang….”

Arie yang entah dimana bersin: “Hacciihh..”
FYI budaya Jepang bilang kalau seseorang bersin artinya ada yg ngomongin.

Abcol: “Waaah… mana mana … liat liat!”

Ubcol: “nih.”

sayang:~/idruby arie$ gem search rio -r

*** REMOTE GEMS ***
Bulk updating Gem source index for: http://gems.rubyforge.org

PriorityQueue (0.1.2, 0.1.1, 0.1.0)
    This is a fibonacci-heap priority-queue implementation

rio (0.4.0, 0.3.9, 0.3.8, 0.3.7, 0.3.6, 0.3.4, 0.3.3, 0.3.2, 0.3.1)
    Rio - Ruby I/O Comfort Class
sayang:~/idruby arie$ sudo gem ins rio --rdoc -y -r
Password:
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed rio-0.4.0
Installing ri documentation for rio-0.4.0...
Installing RDoc documentation for rio-0.4.0...
sayang:~/idruby arie$ e /opt/local/lib/ruby/gems/1.8/gems/rio-0.
rio-0.3.8  rio-0.4.0  
sayang:~/idruby arie$ e /opt/local/lib/ruby/gems/1.8/gems/rio-0.4.0/
COPYING       Rakefile      doc           lib           test          
README        build_doc.rb  ex            setup.rb      
sayang:~/idruby arie$ e /opt/local/lib/ruby/gems/1.8/gems/rio-0.4.0/
sayang:~/idruby arie$ 

Kalau mau RTFM nya bagus warna warni bpapang… tapi ubcol kasih liat ngebros lewat Terminal/Console aja ya Col… bpapang…

sayang:~/idruby arie$ ruby -rnet/http -e’Net::HTTP.get_print URI.parse(“http://localhost:8808/doc_root/rio-0.4.0/rdoc/classes/RIO/Doc/SYNOPSIS.html”)’|grep rio

 rio('adir').files('*.rb') { |entrio| ... }
 rio('adir').files['*.rb']
 rio('adir').files('*.rb') > rio('another_directory')
 rio('adir').all.files('*.rb') { |entrio| ... }
 rio('adir').all.files['*.rb']
 rio('afile') > astring      # copy
 rio('afile') >> astring     # append
 rio('afile') < astring      # copy
 rio('afile') << astring     # append
 rio('afile') > anarray
 rio('afile') >> anarray
 rio('afile') > rio('another_file')
 rio('afile') >> rio('another_file')
 rio('adir') << rio('afile')
 rio('adir') >> rio('another_directory')
 rio('http://rubydoc.org/') > rio('afile')
 astring = rio('http://rubydoc.org/').read
 anarray = rio('afile').chomp[]         # subscript operator
 rio('afile').chomp > anarray           # copy-to operator
 anarray = rio('afile').chomp.to_a      # to_a
 anarray = rio('afile').chomp.readlines # IO#readlines
 rio('adir').lines(0..3) { |aline| ... }       # a range of lines
 rio('adir').lines(/re/) { |aline| ... }       # by regular expression
 rio('adir').lines(0..3,/re/) { |aline| ... }  # or both
 rio('adir').lines[0..3]       # a range of lines
 rio('adir').lines[/re/]       # by regular expression
 rio('adir').lines[0..3,/re/]  # or both
 rio('adir').chomp.lines(0..3) { |aline| ... }       # a range of lines
 rio('adir').chomp.lines(/re/) { |aline| ... }       # by regular expression
 rio('adir').chomp[0..3]  # a range of lines
 rio('adir').chomp[/re/]  # by regular expression
 rio('afile.gz').gzip > rio('afile')
 rio('afile.gz').gzip < rio('afile')
 rio('ftp://host/afile.gz').gzip > rio('afile')
 rio('adir').files('*.rb').skip[:symlink?]
 anarray =  rio('afile.gz').chomp.gzip[0...10]
 rio('ftp://host/afile.gz').gzip.lines(0,3..5) > ?-
 rio('adir').norecurse(/^\.svn$/).files[]
 rio('afile').chomp.skip(:empty?,/^\s*#/) { |line| ... }
 rio(?-,'ps -a').skiplines(0,/ps$/) > anarray
 ans = rio(?-).print("Type Something: ").chomp.gets
 rio('adir').rename.all.files('*.htm') do |htmfile|
sayang:~/idruby arie$ 

Bpapang… Ubcol heran, kenapa orang sudah tua sudah pada dewasa sukanya berantem… enakan jadi kita ya Col, mainan, bpapang… mereka bilang kenapa di ruby ada fileutils, ada dir, ada file, ada IO, macam-macam ada rio.. kata mbah-mbah selalu ada banyak cara utk melakukan sesuatu. Punya wrapper bagus kan enak ya col … bpapang.

Comments
  1. […] help rdoc 16 05 2007 “Bunda, Keke punya teman baru, namanya Ubcol. Dia biasa mainan rio, jadi akhirnya Keke juga senang mainan rio, sayangnya karena Keke pernah mengikuti tips dan trik […]

tinggalkan feedback konstruktif atau lebih baik diam

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s