Posted: Nov 22, 2009
in webbynode

By Felipe Coury

Full Gemcutter local mirror


rubygemsAs you may have heard, Gemcutter is now the official Gem repository for the ruby community and requests to gems.rubyforge.org are being handled by gemcutter.org.

With this change, we’re glad to announce that Webbynode customers enjoy a full Gemcutter mirror, available through internal network. This means you can download and install your favorite, up to date gems faster and without consuming your local bandwidth!

For that to work, you should maintain http://repo.webbynode.com/gems/ as your first source (before gemcutter).

If you already used Gemcutter’s gem tumble, it’s just a matter of running it again and then adding gemcutter.org to your ~/.gemrc file.

Here’s how your ~/.gemrc file should look like:

:sources:
- http://repo.webbynode.com/gems/
- http://gemcutter.org

Happy coding!

Posted: Nov 9, 2009
in webbynode

By Carlos Taborda

Webbynode’s Highlights #1


One of the things we enjoy the most are interesting overall ‘geeky’ links, whether they refer to linux, mac stuff, office design, web applications, etc. We’ll be sharing some of the links we run into each week.

10 Free Server & Network Monitoring Tools that Kick Ass

Open source and freeware server/network monitoring tools that will supervise your infrastructure for any issues that may arise.

Servermonitoring

Stereomood is a free emotional internet radio

that suggests to me the music that best suits my mood and my daily activities.

http://stereomood.com

Scout Labs: A web-based application that tracks social media.

I have been using ScoutLabs 30 day trial to monitor the buzz around Webbynode, and its been great so far. I would definitively recommend it.

scoutlabs

Build a Simple Password Strength Checker

passwordstrength

MacHeist: 6 top Mac apps for Free

macheist


Chorus – Discover Apps with Friends

Nice little iPhone app that helps you to discover hot new iPhone apps from your friends. Chorus enables you and your friends to review apps and share opinions.

chrorusapp
CompareMyDocs

Compare and merge multiple versions of a Word 97/2003 or RTF documents online.

comparedocs

OmniDiskSweeper

Free little Mac app that helps you to save disk space. It shows an overview of the folders that takes more space in your Mac, enabling you to drill down and find your space hungry files.

omnidisk

Add jQuery datagrids to your Rails apps

Amazing plugin to add AJAX based, jQuery grids with goodies like ordering, pagination, searching, all without reloading the page. Check it out!

2dconcept

Quick Lessons from DevDay

This poorly named blog post teaches you how to make your ERB tags to be sanitized by default. Up to rails 2, if you want to sanitize your HTML output, you have to use <%=h var %>. Starting in Rails 3, this is done automatically. Find out how to do it in Rails 2.

devdays

Posted: Nov 7, 2009
in development, felipe talk, rails, ruby, webbynode

By Felipe Coury

Webrat matchers for HTML validation in Cucumber


Recently here at Webbynode we had a demand for validating HTML without going as far as driving a browser. We have an internal library that generates HTML after compiling HAML templates. To fulfill our BDD needs, we wanted a simple, straightforward way to validate HTML tags without the need of a full blown browser driving engine, since we don’t have an HTTP server running while testing this library.

We found out that Webrat’s Matchers and HaveTagMatcher classes was all we needed. Combined to a couple of custom Cucumber steps, here’s how simple it became to validate our HTML tags:

In order to make those steps work, here’s what we needed. First, requiring Webrat and including its matchers into our Cucumber world:

Note that we have added a new method as well, called response_body. That’s where Webrat will expect your HTML body to be, so in our HTML generating component we just assign the @body variable:

View code Gist here

And, finally we created a couple of custom steps to make dead simple to match HTML tags:

This way, you have matchers for any tag, just using things like “I should see a div with id: content, name: content, class: bordered, content: Your profile have been saved”. Note that content is a special key within Webrat matchers, and it will imply the following HTML chunk:


<div id="content" name="content" class="bordered">
Your profile have been saved
</div>

Do you know any other interesting custom steps for Cucumber? Share them in the comments!

Update: I have narrowed the former two cucumber steps to only one. I had an “a vs. an” issue with regexp but Jim provided some feedback on his comment and I applied it. Thanks, Jim!