Addicted to Ruby

GiguToday first time in my life I decided to write small Ruby script instead of using COPY, PASTE. Does it mean that I’m a geek now?

I needed to get some data from a web site. Because data was nicely formatted in table I could just mark it, copy and then paste in spreadsheet tool. What I did instead was a little script that loaded the page, parsed table rows, extracted the data and saved it to a csv file. There is a nice library for HTML parsing called Hpricot. If anyone is doing some HTML, XHTML parsig in Ruby I do strongly recommend. Very simple parsing based on document tree.

Short example, to get all link elements from this blog I would do something like that:

document = open(‘http://blog.gigoo.org’) { |opened_uri| Hpricot(opened_uri) }

link_elements = document.search(“a”)

Voila 🙂

So, why addicted

I think I became addicted. Got the Ruby bug on me now. I like it more and more. Still trying to keep away from Rails just play with language and it’s features. I love big number of useful tools and libraries and the fact that community is working hard to make great stuff for it.

What I don’t like is the fact that everything is design and created with Rails on mind. I hope that Ruby is not going to be “the Rails language” and that people are going to remember that it’s not only about WEB (well, almost all the time is).

Cheerios and other cereals, Gregster

2 thoughts on “Addicted to Ruby

  1. “What I don’t like is the fact that everything is design and created with Rails on mind.”
    I’m guessing you mean tools and libraries, etc. instead of the actual Ruby language itself.

    I don’t think Ruby stands a chance of being the “rails” language except perhaps in the ill-informed public mind. With the exciting developments like Shoes and the existing plethora of gems available and in development that have nothing to do with the net, I’m continually excited about Ruby’s future.

    Incidentally, Rails is awesome in and of itself, but also awesome because of how it shows ruby’s strengths and has started people thinking about what a web framework should and shouldn’t be. I also think Merb, etc. are great independent reactionary responses and improvements that ultimately benefit the language as a whole and help fight off the Railsification of Ruby 🙂

    Enjoy your new love affair, Ruby is beautiful.

Leave a Reply

Fill in your details below or click an icon to log in:

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