Rails: May 2007 Archives

We just poked around to get IS deployed on an apache/fcgi setup. Two things go wrong in the usual configuration.

  1. apache is running the process but HOME wasn't set so we had to set INLINEDIR.
  2. INLINEDIR was initally set to /home/limespot but apache can't write to that dir.
  3. In order to fix that, we set INLINEDIR to /home/limespot/inline and made that dir owned by apache:apache.
  4. Oddly, we got another error after that, as ld wasn't found. I think the error message was wrong. cc shouldn't be runnable if ld isn't runnable. We fixed that by setting up a minimal PATH.

In all, here were our conf tweaks:

  DefaultInitEnv INLINEDIR /home/limespot/inline
  DefaultInitEnv PATH      /usr/local/bin:/usr/bin:/bin

and our shell tweaks:

  % rm -rf ~limespot/.ruby_inline
  % mkdir ~limespot/inline
  % chown apache:apache !$

EDIT: on second thought, the INLINEDIR should go in config/environments/production.rb, probably the PATH too, but I don't understand why that one occured yet.

ADDED 2007-08-28: INLINEDIR in production.rb is the way to go for mongrel setups.

FozWorks: Validating Fixtures: Something I helped write with Jeremy for democracy now. I'll probably ship it soon... somewhere.

ImageScience is a clean and happy Ruby library that generates thumbnails -- and kicks the living crap out of RMagick. Oh, and it doesn't leak memory like a sieve. :) For more information including build steps, see http://seattlerb.rubyforge.org/

Changes:

1.1.3 / 2007-05-30

I just finished diagnosing a problem with two users who were both seeing the following stack trace when firing up autotest:

.../rubygems.rb:325:in `latest_partials':
    undefined method `[]' for nil:NilClass (NoMethodError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:322:in `each'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:322:in `latest_partials'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:292:in `latest_load_paths'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:291:in `each'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:291:in `latest_load_paths'
from /usr/local/lib/ruby/gems/1.8/gems/ZenTest-3.6.0/lib/autotest.rb:109:in `
autodiscover'
from /usr/local/lib/ruby/gems/1.8/gems/ZenTest-3.6.0/bin/autotest:36
from /usr/local/bin/autotest:18:in `load'
from /usr/local/bin/autotest:18

It apparently turns out (ironically), that rspec 0.8 or so installed a bogus gem named "web_spec" with no version or anything and was choking the latest_load_paths method I was using in rubygems. This gem wasn't removed when you removed rspec so it might still be floating around in your system. If so, please remove it.

cd `gem env gem path`/gems
sudo rm -rf web_spec*
cd ../specs
sudo rm -rf web_spec*

autotest 3.6.0 and rspec

| | Comments (1)

According to David Chalimsky, when you upgrade to autotest 3.6.0 with rspec 1.0.3+, you'll need to run the following in your rails project:

  script/generate rspec

For non-rails projects, it should run fine out of the box.

ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails.

ZenTest scans your target and unit-test code and writes your missing code based on simple naming rules, enabling XP at a much quicker pace. ZenTest only works with Ruby and Test::Unit.

unit_diff is a command-line filter to diff expected results from actual results and allow you to quickly see exactly what is wrong.

autotest is a continous testing facility meant to be used during development. As soon as you save a file, autotest will run the corresponding dependent tests.

multiruby runs anything you want on multiple versions of ruby. Great for compatibility checking!

Test::Rails helps you build industrial-strength Rails code.

Changes:

3.6.0 / 2007-05-25

  • 4 major enhancements:
    • New auto-discovery mechanism to make rspec and friends work independently!
    • Moved and restructured camping and rails as plugins.
    • Removed rspec - now packaged with rspec and/or as plugin.
    • Changed the way FTM tests are named. Allows multiple matricies.
  • 3 minor enhancements:
    • Added :OK special result value to FTM.
    • Hugh Sasse is awesome. Rdoc happiness.
    • Parameterized emacs client command.
  • 3 bug fixes:

    • Dup load path because I'm dum.
    • Fixed a lame syntax error in emacs.rb.
    • autotest now builds command separator with '&' on windoze. ARGH! Why is this the first I've heard of this?!?
  • http://www.zenspider.com/ZSS/Products/ZenTest/

  • http://rubyforge.org/projects/zentest/
  • ryand-ruby@zenspider.com

Dr Nic posts his video of my functional test matrix presentation at rejectconf. YAY!

brasten says: "RejectConf was worth the RailsConf fee".

Title says it all. Love you too! *kiss*

(Via Planet Ruby on Rails.)


FreeGeek Freak Girl
Originally uploaded by Obi Juan Kenobi.

Really... How can you go wrong?

rejectconf wrapup

| | Comments (0)

WOW. That was simply fuckin' awesome!

Obie has already uploaded some photos, you should too and tag em "rejectconf"

We had an awesome time. Lots of beer, softdrinks, food, etc. Lots of yelling and fun. And lots of really awesome stuff being presented. Seeing rubinius' irb with sexp and bytecode dump was mindblowing. Dr. Nic's magic models was splendedly awesome. I hadn't realized it did nearly all what it did and will have to pick it up soon. There was a lot more than that. But to top it all off,

We donated $710.11 to FREE GEEK!!!

So awesome! Thanks guys!!!

Heckle is a mutation tester. It modifies your code and runs your tests to make sure they fail. The idea is that if code can be changed and your tests don't notice, either that code isn't being covered or it doesn't do anything.

sudo gem install heckle

Changes:

1.4.0 / 2007-05-18

  • 2 major enhancements:
    • Method calls are now heckled (by removal).
    • Assignments are now heckled (by value changing).
  • 3 minor enhancements:
    • Added --focus to feel the Eye of Sauron (specify unit tests to run).
    • Specify nodes to be included/excluded in heckle with -n/-x.
    • Test only assignments with --assignments

  • Who: The first 125 people.
  • What: see above
  • Where: FREE GEEK - 1731 SE 10th Ave
  • When: Saturday 8PM - whenever
  • Why: If you have to ask, you're not invited. :P

The general format is this: The Gong Show. Anyone can talk about pretty much anything they want (non-commercial please). If you're razzed off the stage, suck it up and get off the stage. Talks are sorted by estimated talk time, shortest first. That way we can see the most candy possible.

Seattle.rb is now at 22 projects and all but 5 have 2007 release dates! And 2 of those 5 have stuff nearing release. Not all of those projects are mine by any means, but still. It makes more sense now why I've been feeling a tad overwhelmed. I'm on 19 groups on rubyforge now, all but 5 of them being mine or me being a principal instead of on the side.

With that in mind, it felt really good when I took everything in my multiple email inboxen older than march and nuked em. I'm really sorry if that was one of yours but I just can't handle the amount I had and I'd rather start over. I'm not exactly doing that, since I didn't just nuke everything, but it is a hefty load removed (down to 65 email). My goal for the month is to catch up on what I have left and try to keep it at a maintainable level for the rest of the year. Between the rubyforge bug dbs, a skinnier inbox, and loving omnifocus, I'm hoping to have things under control shortly.

Best change description for this week:

FEEL THE EYE OF SAURON!!! MUAHAHAHAHA!!!

... heckle, now with EyeOfSauron™

The awesome people at FREE GEEK (http://freegeek.org/) have given in to my whining, begging and pleading to let us host at their lovely establishment. The event will go down Saturday evening/night. More specific details to follow...

Oh... One more thing. These guys rule and live off of donations. Take that as a not so subtle suggestion.

I've been wanting to do something like this for a little while... Namely, I was getting tired of cryptic little codes for everything. Here and there I don't mind, but for every action I'd rather the nominal case fade into the background. So, like :na, I added :OK, which has the added benefit of rendering green instead of blue in emacs (because it is uppercase, I think ruby-mode thinks it is a const).

Before:

  matrix :pages,     :c_rw, :c_W,  :c_R,  :o_rw, :g_c,  :a_rw, :a_W, :a_R
  action :delete,    :del,  :del,  :del,  :del,  :e_NF, :del,  :del,  :del
  action :edit,      :edit, :edit, :edit, :edit, :e_NF, :edit, :edit, :edit
  action :publish,   :pub,  :pub,  :pub,  :pub,  :e_NF, :pub,  :pub,  :pub
  action :unpublish, :unpb, :unpb, :unpb, :unpb, :e_NF, :unpb, :unpb, :unpb
  action :update,    :updt, :updt, :updt, :updt, :e_NF, :updt, :updt, :updt
  action :view,      :view, :view, :view, :view, :e_NF, :view, :view, :view

After:

  matrix :pages,     :c_rw, :c_W, :c_R, :o_rw, :g_c,  :a_rw, :a_W,  :a_R
  action :delete,    :OK,   :OK,  :OK,  :OK,   :OK,   :OK,   :e_NF, :OK
  action :edit,      :OK,   :OK,  :OK,  :OK,   :OK,   :OK,   :e_NF, :OK
  action :publish,   :OK,   :OK,  :OK,  :OK,   :OK,   :OK,   :e_NF, :OK
  action :unpublish, :OK,   :OK,  :OK,  :OK,   :OK,   :OK,   :e_NF, :OK
  action :update,    :OK,   :OK,  :OK,  :OK,   :OK,   :OK,   :e_NF, :OK
  action :view,      :OK,   :OK,  :OK,  :OK,   :OK,   :OK,   :e_NF, :OK

See how nice all those error cases pop out at you now? I love that. Now I can gloss over the green OKs and question everything else (n/a's and errors alike). It'll help me question my requirements even more.

:OK dispatches to a validator with the same name as the action, so now they're more readable.

Before:

def matrix_test_unpub(...)
  # ...
end

After:

def matrix_test_unpublish(...)
  # ...
end

At last year's RubyConf, Ryan Davis (zenspider) and Jacob Harris organised a RejectConf late one night. Apparently it was a great event that included the famous "Rubyists vs Pythonists" one-man stage show. With many more proposals rejected for RailsConf2007, there's even more need for a RejectConf.

So, presenting...

Ryan Davis, Professional Artist

Who?

Conference proposal get rejected? Got something wicked to show off that didn't exist when the Call For Proposals were cut off last year? Then you.

How?

You've got 5 minutes to demonstrate just how wrong the Conference Organisers were for not giving you the full 50 minutes, and to entertain the rest of us. Mostly I want to be entertained.

Where?

No idea yet. Maybe outside on the street. Perhaps in the kitchen at the venue. Hopefully we can muscle a room when we get there.

When?

Friday or Saturday night, after the BoF sessions for that night. The more mysterious and unorganised the better chance we have of organising it.

What do I do?

Join the RejectConf mailing list

What to bring?

BYO food, drink, props, costumes and face paint.

Beer?

Yes.

Do I bring a gift for zenspider?

zenspider always accepts free gifts. Large items of furniture are frowned upon.

Who's organising this?

Ryan Davis. And you? Join the mailing list.

P.S. I completely stole all this from Dr Nic who's a dood.
P.P.S. He forced me to say that. Nearly broke my arm!

Absolutely fantastic:

The Poka-Yoke principle and how to write better software

Basic Tenents of Poka-Yoke Testing:

  • Unit Tests have to be as fast as lightning
  • Quick and slow tests should be separated
  • Tests must be reliable
  • Tests must be repeatable

This is the gist of what I try to teach coming on to any new project. Beautifully written. I'll have to steal some of the language simply because it gets the point across so well.

About this Archive

This page is a archive of entries in the Rails category from May 2007.

Rails: April 2007 is the previous archive.

Rails: June 2007 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.1