All blog posts tagged with ruby

Serialized hashes with partial_updates in Rails 2.1

June 2, 2008

In Rails 2.1, they added partial updates - which is a great idea and a long time coming. This makes ActiveRecord only updates the parts of a model that has actually changed, and also gives you the ability to see if a field (or a record) has changed since retrieving it from the database. (via mode…

Read more

Ruby shared-mime-info gem and OS X

February 18, 2008

For anyone doing stuff requiring a good MIME library in Ruby, shared-mime-info works well. On OS X a few things are necessary to make it work though.

First, use ports to install the shared-mime-info database:

sudo port install shared-mime-info

Then you have to set XDG_DATA_DIRS to point at the right…

Read more

Rails Deployment

January 14, 2008

There is a post on RubyInside today that spawned quite the cascade of comments on the topic of deploying rails. While a lot to wade through, there are some interesting comments buried in there. I still find it strange that everyone is clamoring for a solution, while ignoring one that exists because …

Read more

A few useful tools

December 11, 2007

I've found a couple nifty tools that I figured I'd share:

Rak is a grep replacement written in ruby - it has some pretty neat features including nicer output by default, ignoring .svn and other similar directories. Definitely worth poking through at least the info on the website.

Reggy is a very sim…

Read more

Netbeans ruby refactoring just got even better

November 13, 2007

Yesterday Tor checked in some new changes to netbeans 6.x which improve refactoring tools for ruby. Added are Extract method, introduce variable, introduce field, and introduce constant.

Tor goes into more depth on his blog, complete with examples and screenshots.

Read more

Installing ruby mysql gem in OSX 10.5 (Leopard)

November 9, 2007

It took awhile, but I've finally switched over to OSX - and from what I can tell by googling for "OSX Ruby mysql gem", have gone through what seems to be an initiation.

There are many, many, many posts on how to make it install - and most of them didn't work for me. I did get it to work though and a…

Read more

RubyConf 07

November 5, 2007

Well, I'm back from Charlotte and RubyConf 07!

This year was quite good, and again being larger than previous years. Notable was the focus mostly back on Ruby, as opposed to Rails. Ruby Central's plan of RailsConf to take the ruby focus back worked. Lots of people have been of course uploading pictu…

Read more

CruiseControl and custom cruise tasks running in production

September 20, 2007

I found a fun gotcha! today with CruiseControl - if you create a custom cruise task you have to set the RAILS_ENV AND ENV["RAILS_ENV"] to test.

If you do not, CruiseControl will run against your production database. Before CruiseControl invokes it's own built-in cruise task it sets the RAILS_ENV to …

Read more

Netbeans for the win!

September 7, 2007

I have been meaning to write an article about netbeans + ruby for awhile, and anyone who knows me has probably heard me talk about it - it's great, it's fast, and it actually just works. However, somebody else saved me the trouble, infrid over at http://lifeonrails.org wrote an epic post about it, …

Read more

RSpec/Rails view specs and helpers

August 21, 2007

I ran into a situation today where I had to mock out a helper method in a view spec. After a bit of poking around came across Jake Scruggs blog where he has a post titled, appropriately enough, Mocking/Stubbing partials and helper methods in RSpec view tests.

For the lazy, it's just:

@controller.tem…

Read more

RSpec on Rails rake task for Recent Specs

June 5, 2007

As our number of specs grow I started to miss the test:recent functionality, so I created a simple little rake task to make it work with RSpec. Drop this in lib/tasks, I called it spec_recent.rake.

require 'spec/rake/spectask'
# Grab recently touched specs
def recent_specs(touched_since)
  recent_sp…

Read more

Pluginizing ActionWebService to work on Edge rails

June 4, 2007

I recently updated a project at work to Edge rails to take advantage of ActiveResource - as a result, ActionWebService went away. We've known for a long time AWS was on it's way out, but I was hoping a plugin version would be created prior to it's removal - which in all fairness may still be the cas…

Read more

Enforcing spec coverage with CruiseControl, RCov, and RSpec

June 1, 2007

Now that Alex has gotten CruiseControl.rb setup setup at work, I wanted to use it to enforce good test coverage - and I wanted the output to look good doing it. Turns out this isn't that hard, but requires a few things:

Read more

Changing rake :default to use RSpec

May 29, 2007

I dug around a little before digging into the Rake RDoc (which is great!), but I didn't find anything on the intertubes about this so I figured I'd post here in case somebody else is looking.

Hijacking the default Rails rake tasks is actually pretty easy, but if you just try to redefine it by adding…

Read more

CodeRay helper for Rails

May 9, 2007

While I'm using Markdown for formatting blog entries, I wanted to have some decent syntax highlighting support as well. After looking around I decided to use CodeRay. It's fast, customizable, has nice output, and is easy to extend. All I had to do to make it work with Rails was to create a helper. I…

Read more

crop_resized in RMagick

December 22, 2005

One thing ImageMagick (and thus RMagick) seemed to be missing was to be able to give a desired width and height to an image, and have it resized to exactly that width and height – without distortion. If you use resize, it will give you the correct sized image, but it will be distorted unless the asp…

Read more

Displaying all 16 posts

About

I'm a programmer and shutterbug living on the West Coast of Canada.

Blog Archive

Recently Heard

A Liberal Educationby New Model ArmyPlayed on 2008/07/16 at 02:35PM
The Two Sides of Monsieur Valentineby SpoonPlayed on 2008/07/16 at 02:32PM
You Weren't Thereby New Model ArmyPlayed on 2008/07/16 at 02:28PM
Powered by Viviti