There are few things I appreciate more than using software projects that have good documentation. When I’m new to the project, documentation is invaluable for helping me get going. When I’m not new, good documentation helps me get the information I need to :shipit:. We say…
A long time ago, there was a big open source project, which was a huge part of the Rails world, but had almost no maintenance. This project was Resque, the go-to way to write background jobs for your Rails application. I attended a talk where the current maintainer was clearly…
I’m doing a little Ember app, and if there’s one thing I’ve learned from writing software, it’s to blog about error messages. Two-years-later me has ended up finding my own posts when searching for help! So today, when getting started with Ember Data 1.13, I was trying to use the…
I’ve just released Resque 1.25.0! Resque is the most stable, widely-used job queue for Ruby. It uses Redis as its backing store. This release is thanks to adelcambre , who took the time to get it over the finish line! <3. A total of 19 contributors helped out with this…
TL;DR: Subclassing core classes in Ruby can lead to unexpected side effects. I suggest composition over inheritance in all these cases. Subclassing Review If you’re familiar with the concept of subclassing, skip down to “The Problem.” In Ruby, you can make your own classes: class…
I’ve just released Resque 1.25.0.pre! Resque is the most stable, widely-used job queue for Ruby. It uses Redis as its backing store. This release is thanks to adelcambre , who took the time to get it over the finish line! <3 A total of 19 contributors helped out with this…
If you don’t want to use Turbolinks with your Rails 4 application, it’s easy! Just do this: Remove the gem 'turbolinks' line from your Gemfile. Remove the //= require turbolinks from your app/assets/javascripts/application.js . Remove the two "data-turbolinks-track" => true hash…
I’m writing Rails 4 in Action along with Ryan Bigg and Yehuda Katz. In updating the book to Rails 4, I started early: the sample app ( ticketee ) was done with 4.0.0.beta1 . Then 4.0.0.rc1 came out. I didn’t upgrade immediately, but last night, I took the plunge. There were only…
Do you have a gem that needs to test against multiple versions of Rails? Doing it all can be complex, and while I have lots to say about this topic, but here’s one of the pieces: Travis build matrix. Here’s what you want: language : ruby rvm : - 1.8.7 - 1.9.2 - 1.9.3 - 2.0.0 -…
I’m a big fan of Puma these days. Today, I converted my blog over to use Puma, and I figured I’d share how I did it. This blog uses Sinatra. If you want to look ahead, here is the commit. Gemfile Installing Puma is really easy: just add gem 'puma' to your Gemfile. Done! This…
Last night, I took a big step forward in my writing career: I’ll be building upon the work Ryan Bigg was doing to take “Rails 3 in Action” and move it to Rails 4. I signed the contract a few weeks ago, but last night I actually did the first bit of editing, and successfully got…
Recently, the Rails team has committed to a specific policy related to release maintenance. Due to the rapid pace of recent releases, it’s good to understand how your apps relate to this policy. The policy was originally posted on Google Groups, here:…
Hey everyone! I made a video today about Ember.js and accessibility. I had always been repeating what I’d heard about screen readers: they can’t work with JavaScript. Turns out that’s not exactly true. The video is the best way to show you: VoiceOver, Ember.js, and WAI-ARIA from…
Due to the recent situation with Rubygems.org , a lot of people noticed that they rely on Rubygems.org when deploying. A lot of people advocate “vendor everything” , and while that’s one approach, I actually don’t think it’s necessary. I think a lot of people think they rely on…
Today, I released Draper 1.0.0! Draper is a gem that gives you decorators/view models for Rails. Rubygems: https://rubygems.org/gems/draper GitHub: https://github.com/drapergem/draper README: https://github.com/drapergem/draper/blob/master/README.md You can get it with Rubygems:…
Rails’ greatest strength is “Convention over Configuration.” Basically, Rails makes a ton of default choices for you about how things should be named, where they should go, and other things. This is why working with Rails is so productive for an experienced developer: just follow…
If you’re looking for crazy simplicity in your ‘switch between multiple Rubies’ life, you may want to check out chruby . Written by Postmodern, it’s basically the simplest possible thing that can work. As in, 76 lines of shell script . For that, you get: Features Updates $PATH .…
I’ve relased the second beta for Draper 1.0.0! Many thanks to all of you who gave the first beta a shot. We’ve fixed some issues, and I’d apprecaite you giving this one a try. This solves all known issues with Draper, including every one we’ve found in 1.0.0.beta1. You can get it…
I’m happy to announce the release of Draper 1.0.0.beta1 today. If you use Draper, I’d appreciate you checking out the beta release in your app, kicking the tires, and letting me know what’s up. You can get it by installing it from Rubygems: $ gem install draper --pre or by…
Ruby on Rails is a great tool to build websites incredibly quickly and easily. But what about applications that aren’t websites? Rails is still a first-class choice for this use-case, but why settle for good when you could be the best? That’s why I’m happy to introduce Rails API:…
I often see comments like this in the Rails bugtracker. Generally, someone is running an older version of Rails, and some bug they face has been fixed on edge. But they may be running a version that’s too old to receive fixes, or need a fix that has yet to be included in an…
If you’ve ever done background job stuff with Rails, you’ve probably used Resque . Resque is “Yet Another GitHub Project They’ve Open Sourced and Then Abandoned.” But Resque is super awesome: it builds a job queue on top of Redis, which is a totally awesome piece of software.…
If you didn’t know, classes are first-class objects in Ruby: 1.9.3p194 :001 > String.class => Class 1.9.3p194 :002 > Class.class => Class How is this useful, though? Inheritance You may create very simple classes at times. This often happens when subclassing an error of some…
One of my favorite classes in Ruby is Struct , but I feel like many Rubyists don’t know when to take advantage of it. The standard library has a lot of junk in it, but Struct and OStruct are super awesome. Struct If you haven’t used Struct before, here’s the documentation of…
Once upon a time, I was building my First Serious Rails App. I was drawn to Rails in the first place because of automated testing and ActiveRecord; I felt the pain of not using an ORM and spending about a week on every deploy making sure that things were still okay in production.…
After RailsConf this year, I joined the Rails Issue Team. This means that I help triage issues that people have filed, try to reproduce errors, and point core team members at ones that are most important. Since doing that, a few people have asked me how to get started, so I…
As you know, I’ve been doing a lot of work over the last few years to keep _why’s Shoes project going. A few other intrepid individuals have been doing a lot as well. We’re starting to work on Shoes 4, and we’d love your help. A little about Shoes If you didn’t know, Shoes is a…
So I said I was gonna build antisocialne.ws. But I’m changing gears instead: I’d rather do this project, which has a better spec and needs a reference implementation. Building StoreEngine from Steve Klabnik on Vimeo .
Because I don’t have enough gems made already, I made another one last night: metadown . What’s Metadown do? This blog originally used Jekyll. When I moved it to my own personal blog implementation, I noticed something: Markdown doesn’t actually have support for adding YAML at…
I love both Sinatra and Rails, for different reasons. I’ve heard a few different heuristics for which framework would be better for your application, but I’m not sure the answer is all that simple, really. Regardless of which is correct for your application, I haven’t seen a lot…
It is practically impossible to teach OO design to students that have had a prior exposure to Rails: as potential programmers they are mentally mutilated beyond hope of regeneration.Edsger W. Dijkstra (paraphrased) I love ActiveRecord. It was the first ORM I’d ever interacted…
It’s true. If you haven’t used it yet, Redcarpet is the Markdown parser that GitHub uses to work all that magic on their site. So of course, it’s awesome. You can use it and abuse it What makes it really awesome is the custom renderers feature. Here’s the one from the…
If you haven’t used it, CanCan is a great library for Rails that handles authorization for you. Its calling card is simplicity; just do this: class Ability include CanCan :: Ability def initialize (user) user ||= User . new if user. is? :paying_customer can :show , Article else…
Just a quick note about Devise, and its RESTful implications. I ran across this error today, and thought I’d share. I was trying to log out, so I hit the normal route for such things with my browser. Here’s the error: Devise: ActionController::RoutingError (No Route Matches [GET]…
You walk into work tomorrow morning, and your boss says this: Boss: Hey, we’re gonna need to go ahead and have you implement require_relative in rubinius. We have some new servers coming in, and we’ll be running it in production, but we use some 1.9.2 features of MRI that haven’t…
I came across a blog post the other day titled Modern Ruby Development . While it’s a perfectly fine blog post (other than the digs at rvm…) it really should have been titled something more along the lines of “My default tooling to build a Rails application.” I thought of this…
My last blog post caused a bit of a stir in some circles. I got a bunch of emails. Apparently, I need to expand on a few things. So here we go. Let’s rap about the Presenter pattern, shall we? No seriously, helpers suck In Ruby, everything is an object. Every bit of information…
UPDATE: I also have a follow-up here . I often tell people that I learned Ruby via Rails. This is pretty much the worst way to do it, but I’d learned so many programming languages by then that it didn’t hinder me too much. The one thing that it did do, however, was give me a…
Okay! So, if you’d read my previous article on this , you’d know how easy it is to contribute to Ruby’s Documentaiton. But Steve, I’m still kinda scared. Okay, so here we go: I’m making it even easier on you. Send me what you want changed, and how, and I’ll make a patch and…
Update! I’m now making it even easier than this: Read my new post about how I’ll do this for you . That said, if you want to do it yourself, the following will tell you how. Original Article Ruby 1.9.3 is coming out soon! drbrain has challenged the Ruby community to improve its…
I’ve heard Ruby Mendicant University (also known as RMU, not to confuse you Robert Morris alums!) described as “the best kept secret of the Ruby community.” High praise, indeed. If you haven’t heard about RMU before, check out this presentation by Andrew Cox: TL;DR: RMU is a…
It’s been a long journey. I have a lot to say about this, but it’ll have to wait until I’m not in the middle of nowhere spending some time with Maria’s family. I just wanted to tell you all Merry Christmas, and point you at the Hackety Hack v1.0 release announcement and the new…
Today is Whyday. A programmer’s holiday. Today is the day that we don’t forget that programming isn’t all Agile and driven by behavior and Serious Business. Inside each cubicle, the hacker spirit is trying to burst free. Today, it will. Today, I’m also releasing a prerelease…
Sometimes, when responding to a support request, it’s nice to see what your users see. At the same time, you don’t want to ask your users for their passwords, out of respect for their privacy. So what do you do? Well, *NIX systems have a program called su. Here’s what man su has…
For those of you that don’t know, I’ve taken over a project by someone named _why. He dropped off of the face of the Internet back in March, and the community has picked up his works. Because I’ll be writing about the project in the future, and because I feel these words are…