Panasonic Youth rob sanheim writes about software, business, ruby, music, stuff and things



Posts from July 2008

Git Clone vs cp -R –> WTF?

I knew git was fast, and I even knew it was faster than a lot of plain linux local file operations. Still, this still blew me away:

rsanheim@ares:~/src/personal/oss $ du -hd 0 insoshi/
 26M    insoshi/
rsanheim@ares:~/src/personal/oss $ time git clone insoshi/ /tmp/insoshi
Initialize /tmp/insoshi/.git
Initialized empty Git repository in /private/tmp/insoshi/.git/
Checking out files: 100% (2193/2193), done.
real    0m3.826s
user    [...]


Posted
23 July 2008 @ 1am

Tagged
Rails, Ruby

Quick: Find the Bug or Gotcha with named_scope

Think fast! Where's the bug?

named_scope :active, :conditions => ["activated_at <= ?", DateTime.now.utc.to_s(:db)]

Looks fine, right? Maybe you've hit this already, and you see it immediately.
The symptoms are that the DateTime.now always seems to be a bit off - maybe you just restarted your server and its a only a few minutes off.
The [...]


Notes on testing Bj (Background Job)

Some thoughts and random notes on testing Bj within a Rails integration test (or spec).

You have to turn transactions off for the scope of the test, or suffer very confusing issues, since Bj itself wraps the job submittal within a transaction. The way I did this was just overriding the use_transactional_fixtures method in the [...]


CapGun and LogBuddy updated to 0.0.5

Some long overdue releases of cap_gun and log_buddy - both have been updated to version 0.0.5. Both are now available as gems on github.com/relevance as well as from rubyforge.
CapGun gives you super simple deployment notifications from Capistrano. LogBuddy gives you a log helper through all objects, and can also log the name of [...]