Itch Scratching the ActionMailer API
Location: Ballroom I Level: Novice
ActionMailer has been the long neglected sibling of the Rails Framework, with it’s monkey patches and TMail hacks backed right in, it was in long need of a rewrite.
But rewriting ActionMailer required a new Mail handler, something that could just “DO” the mail part.
I started patching TMail in 2006, I found holes and fixed them, shortly after I was made the maintainer of TMail. I released several versions and upgraded ActionMailer to suit, but ActionMailer never became a product I would like to use myself.
Needing a solution, I wrote Mail. Using RSpec, this library is totally BDD’d from the ground up, and I will cover that in the talk, how it was developed and how developing a gem, in real life, against existing RFCs, with full spec coverage, can impact the end result.
Once I finished Mail I went to work replacing TMail out from ActionMailer. This went well, and then in December, 2010, I was asked by DHH to implement a new API to ActionMailer,
I took on the job and José Valim and I remote pair programmed, (between Poland and Sydney). In two weeks working only in the evenings, we stripped ActionMailer, deprecating (but keeping) the old interface and installing a brand new sleek ActionMailer API, one that now just acts as a bridge between AbstractController and Mail.
I go over in the talk how this deprecation was done, and how it can be done anywhere if you think the thought through. I will also go over how in doing this ActionMailer rewrite, I found parts of Mail that needed upgrading and how the existing spec suite made it possible.
Finally, I will briefly discuss the difficulties I ran into in getting Mail and ActionMailer running on Ruby 1.8.7 and 1.9.1 and 1.9-current.
I will be open for questions as well on the new API and future direction of it.
From Sydney Australia, Mikel works as an IT Consultant, Developer and founder of RubyX.com an Rails development and support company in Sydney Australia.
Mikel’s talk this year will be drawing from the 40+ production Rails apps he and his company developed and maintained in the last 12 months.
Mikel is on the core commit team of the Rails framework, wrote the Mail gem and was a major part of the rewrite of ActionMailer.
He spends his days running the RubyX team providing green field application development, custom gem development as well as support, code review and mentoring on existing Rails applications. He gets his hands dirty in Rails code all the time and loves his work.