Because I switch between ColdFusion and Ruby on a weekly basis, when I work on ColdFusion I sometimes miss some of the features that I have in Ruby. Like having a hash return a nil when a key doesn't exist, rather than getting an error when a key...
Read more
by Jeffrey Konowitch
Last month, several Singlebrook developers participated in Ithaca’s Global Day of Code Retreat. The event had a very simple structure; the day was broken into several 45 minute pair-programming sessions - switching partners...
Read more
by Jared Beck
2012-10-21
Here's a nice ruby 1.9 discovery to brighten your day.
In 1.8 we had to:
require File.expand_path('../relative/path', __FILE__)
but in 1.9 you can:
relative_require 'relative/path'...
Read more
by Jared Beck
2012-07-19
Out of the box, rspec likes to dump all of the specs to stdout:
$ rake spec
ruby -S rspec ./spec/controllers/activity_categories_controller_spec.rb ./spec/controllers/attendee_controller_activities_spec.rb...
Read more
By Jeffrey Konowitch
I was quite confused when I saw lines like this in controllers that I was working on:
class SessionController < ApplicationController
def create
user = User.find_by_email(params[:session][:email])
password = params[:session][:password]
if user && user.authenticate(password)
sign_in user
redirect_to user
else
redirect_to sign_in_path
end
end
end
Sign in user? Is it that easy? Do I just type what I want in plain text and the computer will know what I’m talking about? Well, no, of course not...but as someone new to the system, these sorts of conventions can be really confusing.
If you find yourself in this position, then you are probably coming from another language where class inheritance worked differently from Ruby.
Read more
by Leon Miller-Out
Last night I wrote this fun code to see if I could display a Mandelbrot fractal in my terminal. It was easier than I thought, thanks to some pseudo-code on the Mandelbrot Set Wikipedia page, although tracking down the proper...
Read more
Singlebrook had a great
Bugmash on Saturday. Six developers from Ithaca's small (but committed) Ruby community showed up to help move Rails 3.0 to a release candidate.
Everyone here was a first-time contributor, so we had a range of successes, from...
Read more