Guest User

Untitled

a guest
Oct 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #! /usr/bin/local/ruby
  2. # -*- encoding: utf-8 -*-
  3.  
  4. require 'rubygems'
  5. require 'sinatra'
  6. require 'haml'
  7. require './saynothing.rb'
  8.  
  9. before do
  10. @letter = ("a".."z").to_a.sample
  11. end
  12.  
  13. def wow
  14. @isay = "wow"
  15. end
  16.  
  17. def yay
  18. @isay = "yay"
  19. end
  20.  
  21. def hit_it
  22. case @letter
  23. when "w"
  24. wow
  25. when "y"
  26. yay
  27. else
  28. saynothing
  29. end
  30. haml :index
  31. end
  32.  
  33. get "/" do
  34. hit_it
  35. end
  36.  
  37. __END__
  38.  
  39. @@ index
  40. %html
  41. %body
  42. %div= "i say #{@isay}!"
Add Comment
Please, Sign In to add comment