Archive for the 'Ruby' Category

Since being introduced to YAML I’ve loved using it for configuration files in both Ruby and Ruby on Rails. YAML means “YAML Ain’t Markup Language”. Yes, there is an infinite loop in the title - it’s programmer humor. Those of you familiar with Ruby on Rails are somewhat familiar with YAML because [...]

Getting information from users is a common task that we have to deal with in building an application. This typically happens either in creating a user account, commerce orders, or any other time when the application has to ask “who are you?”. Often times we’ll create a field for both a firstname and [...]

So I was thinking this evening about creating an RSS parser in Ruby. You know… Ruby supports this built in? Big surprise right? All you have to do in require the rss library:
require ‘rss’
Then of course if you want to open up a connection to a URL you need to include the [...]

As I become more familiar with Ruby and Rails I’m of course going to start to understand better ways to do a snippet of code. Here is an updated script that is a little leaner:
(1..100).each do |i|
fb = []
fb << “Fizz” if (i % 3) == 0
fb << [...]

So back in February Jeff Atwood over at codinghorror.com was talking about a puzzle to give prospective new-hires when interviewing them entitled “Fizzbuzz”. You can read more about it here.
So with a little thought I decided to solve the fizzbuzz puzzle using Rudy and an Array.
count = 0
100.times do
  count += 1
  fb = [...]