company-logo

Tag

rails

Java is Like Senator Harry Reid: Meh, but Alternatives are Worse

photo credit: Center forAmerican Progress Action Fund Harry Reid hung on to beat Sharron Angle this past election day. It wasn’t that the voters of Nevada loved him, it was just that the other candidate was so much worse. Much the same can be said of Java for enterprise applications: meh, but the alternatives are worse. That’s not surprising, as most of the alternatives to Java have focused on the things
Read More

Installing mysql gem with bundler on Snow Leopard

Between 0.9.26, RC and final 1.0 release, bundler went thru some heavy changes with respect to command line options it supports. Luckily, twitter, forum and blogs kept everybody in the loop. The blogs, however, became obsolete quickly and even blog posts few months old don’t work with latest version of bundler. We came across this issue that kept is in a loop for a while. Snow Leopard changed a few things with
Read More

Continuous Integration on Multiple Ruby Versions with RVM and Hudson

NOTICE: We’ve run into some snags still with the hudson daemon recognizing the proper environment vars.  We are working on some solutions after speaking with Wayne Seguin, and we’ll keep you updated.  So basically, the following is possibly interesting, but not yet entirely correctly implemented. We’ve recently moved to Ruby 1.9.1 on a current Rails project. Since we’re still working on other
Read More

What is the ideal Senior Developer skillset?

We’re currently in the process of interviewing candidates for 1-2 Senior, and 2-3 junior level Rails Developers, and I’m wondering about the skills that are most critical, and how best to identify the best candidates. My normal interview process flows like this: Quick Phone screen evaluating basic development skills, background, availability, personality Basic coding problem (less than 1hr to complete) Ph
Read More

Rails DateTime.to_time, Time, and a case of 'Why do you need to do that?'

The problem: I needed to display a warning to a user if the data they were looking at was more than 90 days old. The solution: Create a method that takes 2 dates (either DateTime or Time), and returns the number of days, or hours between them. def self.difference_in_dates(date1, date2, unit = 1.day) return nil if date1.nil? || date2.nil? || unit == 0 (( date1.to_time - date2.to_time ) / unit).round.abs end The proble
Read More

acts_without_database: Now a Rails Plugin

Quite a while ago, I wrote a blog post which included some code which allowed you to use ActiveRecord without needing a database table. I recently needed that functionality again, so I converted that code into a plugin and put it on github so that I could easily include it in another project. While doing this, I also cleaned up and simplified the code quite a bit. The github page is here: http://github.com/AnthonyCal
Read More

Chiphone Meeting: Chicago iPhone user group gets its TDD on

Eric Smith from 8th light gave a hands-on TDD presentation at last night’s Chiphone meeting, hosted at Obtiva’s downtown office, (conveniently located near the the train). There was a good crowd of people, most attendees have ‘played around’ with iphone development, 4 have actively developed apps (3 people have live apps in the store).  From my quick survey of those that have submitted apps, i
Read More

Using Mocha for ActiveRecord Partial Mocks with Finders

Mocha on sparklette.net Mocha is the mocking library used by the Rails team, so it has understandably gained some traction among Rails developers. I have started using it over flexmock lately, but ran into some problems with partial mocks on ActiveRecord objects. The problem stemmed from the fact that ActiveRecord instantiates new records when returning records from finders, which meant that creating partial mocks fo
Read More

Rails Development on Windows: Native or Virtualize

I have come to the conclusion that doing rails development native in windows is not worth the cost. Things may seem to run smooth initially, but over time problems inevitably come up, and they have become enough of a pain point that i’m moving to a linux virtualization. This for me makes particular sense as most of the full time ruby guys in my shop are using macs and are no help when it comes to figuring out w
Read More

What's the best way to programmatically edit a pdf in ruby?

I’ve been doing a good deal of PDF generation in Rails, and had to go through the process of comparing all the available techniques and frameworks in order to find the right solution for my needs. Its great that there are so many tools out there, but it can be a daunting task to figure out which is best, which will scale, which will continue to grow and improve, and to evaluate the true ‘cost’ of fr
Read More