Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/local/ruby
- # -*- encoding: utf-8 -*-
- require 'rubygems'
- require 'sinatra'
- require 'haml'
- require './saynothing.rb'
- before do
- @letter = ("a".."z").to_a.sample
- end
- def wow
- @isay = "wow"
- end
- def yay
- @isay = "yay"
- end
- def hit_it
- case @letter
- when "w"
- wow
- when "y"
- yay
- else
- saynothing
- end
- haml :index
- end
- get "/" do
- hit_it
- end
- __END__
- @@ index
- %html
- %body
- %div= "i say #{@isay}!"
Add Comment
Please, Sign In to add comment