September Wrap-Up: Open Source Work!

The month of September has flown by, and I’ve had my hands covered with Ruby work of late. In the process, I’ve needed to tweak some great projects like Starling, Webistrano and xmpp4r-simple. These projects are definitely maturing, and it’s been great to get under the hood to see how they tick, and see where I can help nudge them in the direction I hope to see them move.

Drop me a line and let me know what you’re up to. Better yet, shoot me your github.com profile link, so I can follow you. You can keep track of me on my GitHub profile as well.

Happy Coding!

Extracting CAS configuration into YAML, like database.yml

If you’ve done any enterprise work with Rails, and your shop is using CAS for authentication, chances are you’ve seen rubycas-client. Chances are you’ve also loved how easy it was to get working. There’s usually only one hitch — you’ve got to change the config based on which environment you’re deploying into.

Here’s the standard advice you get from the RDoc:

# in your config/environment.rb
CASClient::Frameworks::Rails::Filter.configure(
  :cas_base_url => https://cas.example.foo/,
  :proxy_retrieval_url => https://cas-proxy-callback.example.foo/cas_proxy_callback/retrieve_pgt,
  :proxy_callback_url => https://cas-proxy-callback.example.foo/cas_proxy_callback/receive_pgt,
  :logger => cas_logger
)

But with a tiny change, you can give your CAS setup all the flexibility and auto-magical environmental savvy of database.yml. Goodbye last minute edits for a production deployment. Check this out:

# in your config/environment.rb
cas_options = YAML::load_file(RAILS_ROOT+/config/cas.yml)
CASClient::Frameworks::Rails::Filter.configure(cas_options[RAILS_ENV])

Now make a simple YAML file, cas.yml:

# config/cas.yml
development:
    :cas_base_url: https://cas.qaexample.tld/cas/
    :validate_url: https://cas.qaexample.tld/cas/validate
    :logout_url: https://cas.qaexample.tld/cas/logout

test:
    :cas_base_url: https://cas.qaexample.tld/cas/
    :validate_url: https://cas.qaexample.tld/cas/validate
    :logout_url: https://cas.qaexample.tld/cas/logout

production:
    :cas_base_url: https://cas.example.tld/cas/
    :validate_url: https://cas.example.tld/cas/validate
    :logout_url: https://cas.example.tld/cas/logout

It’s worth noting that the colons in front of the YAML keys indicate that those keys are Ruby symbols, not strings. All the rubycas-client docs use symbols in their examples, so I’d follow their lead if I were you.

Got an opinion about using CAS with Rails? Leave a comment and let us hear it!

Thanks for Mongrel, Zed — don’t let the door hit you…

I’m not sad to see the writer of Mongrel leave. Not one bit. I’m not sure what Dave Thomas was reading earlier today, but I don’t have anything positive to say about it.

I like Mongrel. I’ve read Zed Shaw’s article rant on programmers and statistics, and I liked it quite a bit — though I prefer his Ruby/Odeum vs. Lucene Analysis Part 2 since it lays out a more clear example of his opinion about how to properly use statistics to analyze software (amazing — Zed can make a set of useful points without using the F-word!!).

But as an outsider to whatever caused his Rails rant, he just doesn’t come off as credible when he makes silly pointless wildly exaggerated claims about his skills and situation and then begs dares challenges asks anyone disagreeing with him (except Humility) to start an all out fist fight.

I wouldn’t hire him. And I don’t think many people would if he behaves on the job anything like he does on his blog. I’m sure he thinks that’s too bad for me. And I’m glad that we’re both happy with the result. Consequently, I think we’re both quite fine with his decision to leave the Ruby/Rails community for good.

In the end, it just doesn’t matter. He’s only sorta known compared to the heavy hitters (when I said Zed Shaw, a number of people said “Who?” and then I had to tell them “the guy that wrote Mongrel” — evidence of the error of his delusions perceptions of his own fame). We’ll mourn his natural-self-selection out of the Ruby ecosystem, remember Darwin’s theories of natural selection, and then dry our tears and watch smarter, happier, funnier people blossom in the space he used to fill.

So Zed, I don’t hate you. I simply know we’ll be just fine ignoring you. And please don’t let the door hit you on the way out.