WTLS throw' down

P

Phlip

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!
 

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

Members online

No members online now.

Forum statistics

Threads
474,183
Messages
2,570,967
Members
47,517
Latest member
Andres38A1

Latest Threads

Top