Dan,
Ruby, as a language, is very elegant and easy to use… even easier,
IMO, than Java and PHP.
But, if you just want to whip up a quick one-file script like thing
and test it from a browser, PHP rocks. But that’s just because
browsers, out of the box (these days) support .php files to be
processed by PHP. Right now, you can’t do that (out of the box) with
Ruby files. Eventually that’ll change. Eventually, you’ll be able to
drop a .rb file into a web directory and have it parsed through Ruby
just like you can drop a .php file and have it parsed by PHP.
Until then, if you wanna play, play with ruby. Not Ruby on Rails, but
just ruby. Command-line and all. If you want to do some quick
scripting from a web app perspective, PHP is probably the right way to
go. If you want to try and build a simple app, though, including
multiple interactions between the browser and server, then Rails is a
very nice framework (although not the only one).
So, it’s really just a matter of waht you are trying to do.
What you have above is exactly the sort of thing Ruby is extremely
easy and powerful to use. It woudl just be a ruby script, called by
the command line. Plopping it into the Rails framework is overkill and
probably confusing as you start out.
Don’t write off Ruby because of Rails.
And don’t write of Rails, just recognize what it is: a framework using
ruby.
-Danimal
BTW, I’m a hard-core RoR evangelist, but I also still use PHP in my
day-to-day development work. Super-simple example: client wants an
“about us” page that has the copyright at the bottom automatically
show the current year. Perfect example of PHP. It’s effectively a
static HTML page with a single line of PHP at the bottom. Stuff like
that, where the extra “weight” of the full Rails stack isn’t warranted
is where PHP is still useful. Eventually, though, I look forward to
the day when I can just drop .rb files in and get the same effect.
Woo! (For all I know, this is already possible. But not ‘out of the
box’ on standard hosting environments)
On Apr 10, 5:29 pm, Dan S. [email protected]