Mange / roadie

Making HTML emails comfortable for the Ruby rockstars

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Roadie without Rails?

jjb opened this issue · comments

Have you considered supporting using roadie outside of Rails (but still using actionmailer)?

Know of anyone who has a recipe for this?

I'm trying to put something together now, I'll let you know what I come up with.

Sounds nice. I did consider it, but recently I've tried to tie myself even tighter to Rails to avoid false positive tests.

I'm actually surprised someone was using ActionMailer without Rails, but now that I know it happens, I might move back to that direction again.


To make this work, you/I need to focus on these points:

  • Remove any left instances of Rails inside the Roadie classes. Most invocations should go through the Roadie module, which should ease refactoring
  • Make tests stop using Rails; use the decoupled helpers instead
  • Create some Rails integration tests to test Rails compatibility
    • Best way would be to create a Rails app in a directory and run tests inside that one instead, right?

Then, to actually use it:

  • Make sure to use the FilesystemProvider instead of the AssetProvider
    • should be default unless defined?(Rails)
  • Manually include Roadie::ActionMailerExtensions in ActionMailer::Base, or your own subclasses of it

FWIW -- i ended up trying https://github.com/fphilipe/premailer-rails3, which worked quite well. The project actually operates on ActionMailer and no other parts of rails. they use hooks on ActionMailer, and they don't use a railties.

Okay, glad it worked out for you. :-)

I'll keep this issue open as a reminder to look into how hard this would be to accomplish, if you don't mind.

Just found Roadie today and love it. In the same vein as this issue, I'm wondering if there's a possibility that sprockets could be removed as a dependency? I noticed it's only used for the specs, but our rails 3.0 app doesn't use it.

@tiegz Please open up another issue for that since it's not related to this one.

Roadie 3 works without Rails and Sprockets. It's slated for prerelease soon.

Version 3.0.0 was just released. It's not completely decoupled from Rails!