background preloader

Seecycle

Facebook Twitter

Guides and Tutorials - n² wiki. Rail Spikes: Stress-free Incoming E-Mail Processing with Rails. When you need to build a Rails application that accepts e-mail, the framework only goes so far. ActionMailer::Base gives you a nice API for handling the message once you get it, but you need a way to trigger that. Agile Web Development with Rails suggests something like this procmail rule: RUBY=/Users/dave/ruby1.8/bin/ruby TICKET_APP_DIR=/Users/dave/Work/BS2/titles/RAILS/Book/code/e1/mailer HANDLER='IncomingTicketHandler.receive(STDIN.read)' :0 c * ^Subject:. *Bug Report.* | cd $TICKET_APP_DIR && $RUBY script/runner $HANDLER So does Rails Recipes. But there are a couple problems with this approach: You need a mail server on your Rails box. The last one is the biggie. While most of the space on the Rails wiki is devoted to the procmail-style approach, there are a few tidbits about using POP3 or IMAP to do the fetching, and this comment: Fetching the mailbox via IMAP is by far the best way of getting messages into Ruby.

That settled it for us: e-mail checking daemon it is. . Mikel's mail at master - GitHub. Marshal. The marshaling library converts collections of Ruby objects into a byte stream, allowing them to be stored outside the currently active script. This data may subsequently be read and the original objects reconstituted. Marshaled data has major and minor version numbers stored along with the object information. In normal use, marshaling can only load data written with the same major version number and an equal or lower minor version number.

If Ruby’s “verbose” flag is set (normally using -d, -v, -w, or –verbose) the major and minor numbers must match exactly. Marshal versioning is independent of Ruby’s version numbers. You can extract the version by reading the first two bytes of marshaled data. str = Marshal.dump("thing") RUBY_VERSION str[0].ord str[1].ord Some objects cannot be dumped: if the objects to be dumped include bindings, procedure or method objects, instances of class IO, or singleton objects, a TypeError will be raised. Security considerations¶ ↑ marshal_dump and marshal_load¶ ↑ Kniblet Tutorial Part 1 - n² wiki. Search.