08.16.07

Posted in Rails at 5:03 pm by jasonb

I download a prerelease of the latest Engines earlier in the summer with piston. My tests were failing in strange and magical ways. I spent quite a bit of time trying different things, then finally resorted to a fresh Rails app that I slowly populated with relevant files. Quickly I discovered the problem was my Engines plugin. I really thought I had the full release, but clearly not.

I was really relieved when I retargeted piston at the actual release version of Engines and updated. A single file change and I was back in business.

jasonb@faith:~/src$ piston switch http://svn.rails-engines.org/plugins/engines \
  vendor/plugins/engines/
Processing 'vendor/plugins/engines/'...
  Fetching remote repository's latest revision and UUID
  Restoring remote repository to known state at r600
  Updating remote repository to http://svn.rails-engines.org/plugins/engines@611
  Processing adds/deletes
  Removing temporary files / folders
  Updating Piston properties
  Updated to r611 (4 changes)

As it happened, the problem was:

+++ vendor/plugins/engines/lib/engines/testing.rb
@@ -2,7 +2,6 @@
 # for more details.
 
 require 'test/unit'
+require 'test_help'

Sigh. It does help to import the correct branch of the code, yes?

Because I used piston, it was stupid easy to retarget the correct version of Engines, then update and see what it was I screwed up. Further, any local changes I made — I had none for this plugin — would be preserved and subject to the usual Subversion conflict resolution process (such as it is).

It’s best not to modify plugins lest you find yourself maintaining even more code, but if you must, at least your changes won’t be clobbered. And you don’t have to run diff between plugin checkouts to try to deduce which of your changes are about to get lost.

Leave a Comment

I'll protect you: the Atlantean, cyclopean, precious, and strong Wordpress Spam-be-gone plugin?