Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created February 1, 2012 23:14
Show Gist options
  • Select an option

  • Save practicingruby/1720071 to your computer and use it in GitHub Desktop.

Select an option

Save practicingruby/1720071 to your computer and use it in GitHub Desktop.
require_relative "../lib/postal_service"
app = PostalService::Application.new do
match :genre, '\S+'
match :title, '.*'
subject(:match, "a {genre} story '{title}'") do
respond :subject => "No one would consider '#{params[:title]}' to be #{params[:genre]}"
end
default do
respond :subject => "FAIL"
end
end
PostalService::Server.run(:config => eval(File.read("config.rb")),
:apps => [app])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment