Created
February 5, 2012 19:53
-
-
Save guilherme/1747696 to your computer and use it in GitHub Desktop.
bookmailer test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# application.rb | |
to(:tag, "put") do | |
subject = request.subject | |
title,url = subject.split(' ').map { |x| x.strip } | |
note = request.body | |
params = { :title => title, :url => url, :note => note } | |
bookmarks.add_bookmark(params) | |
respond :subject => "Bookmark saved #{title}" | |
end | |
default do | |
p request.from | |
p request.subject | |
p request.to | |
p request.body.to_s | |
respond :subject => "FAIL" | |
end | |
# debug | |
["[email protected]"] | |
"mendicant http://mendicantuniversity.org" | |
["[email protected]"] | |
"good place to learn." | |
# The response: FAIL | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment