Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WTLS throw' down

2 views
Skip to first unread message

Phlip

unread,
Sep 26, 2005, 7:57:03 PM9/26/05
to
Rubies:

Reading this page, by "Why the Lucky Stiff" it is, yesterday I was:

http://whytheluckystiff.net/articles/wearingRubySlippersToWork.html

Very friendly, very bloggy I considered it. Easier to read, more than
I, I thought it.

An example I will give:

"Slippers That Shuffle Through (Using Dir.glob and File#grep)

"Not long ago a friend asked me how to recursively search his PHP
scripts for a string...

find . -name "*.php" -exec grep 'search_string' {} \; -print

"...Here's the above file search reworked in Ruby:

Dir['**/*.php'].each do |path|
File.open( path ) do |f|
f.grep( /search_string/ ) do |line|
puts path, ':', line
..."

Okay, I think. An example to entice newbies; entry level Ruby cleaner
than shell scripts is, to tell them.

Very senior I think myself; very mature. And for that sample Googling I
am, the very next day, it is my project for.

"Why the Lucky Stuff" much respect. Down you throw!

--
Yoda

0 new messages