Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 2.06 KB

README.md

File metadata and controls

46 lines (34 loc) · 2.06 KB

Integration Exercise: Mail Servers

Jester

written by: Brent Vatne

Description and usage

Jester is a mail friendly mail daemon that saves a bunch of great stories and jokes and is willing to tell them to anyone who asks. He exists in the ethereal realm of email, and does not know how to interface with any other protocol. Once you tell him which email to watch and how he can get access to it in config/mail_options.rb, wake him up with bin/entertain. You should make a copy of mails_options.rb.example and remove the .example extension and use that as a base for your configuration - just fill in the blanks.

Now you can e-mail the address you told him to watch, and use the following commands:

Have him remember a story for you

In the subject line of your e-mail put: a funny story "the time I went helicopter fishing" and use the body of the email to tell him the story. He will remember it and tell it to other people looking to brighten up their day.

Of course, some people were born without a funny bone, and have no desire to read anything funny. Jester thinks that's hilarious, but also feels a duty to entertain, so he likes to remember any other type of story too. For example, maybe you heard an interesting fact and that you think Jester and his friends might like to hear. In the subject line of your email put : an interesting story "why the sky is blue"

Ask Jester to brighten up your day

Great, he can remember jokes that I tell him. What use is a Jester that you tell jokes to, but that doesn't tell any to you? Ask Jester for a story by specifying in the subject tell me something funny or perhaps tell me something interesting. I'm not judging you, Jester might be.

Extend Jester

It's easy to teach him new tricks, just create a request class in the requests directory, which implements the following interface:

handle - returns nil if the message subject is not handled by this request, or an instance of itself if it is handled.

execute - performs required actions to carry out the request, returns a Jester::Request::Response object