Guest User

Untitled

a guest
Feb 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. require 'rubygems'
  2. require 'sinatra'
  3.  
  4. $cheats_list = (`cheat sheets`).split("\n")
  5.  
  6. # Sinatra::Application.default_options.merge!(
  7. # :run => true,
  8. # :env => :production,
  9. # :raise_errors => true
  10. # )
  11.  
  12.  
  13. get "/" do
  14. cheats_size = $cheats_list.size
  15. @cheats = (`cheat #{$cheats_list[rand(cheats_size)]}`).split("\n")
  16. erb :index
  17. end
  18.  
  19.  
  20. use Rack::Auth::Basic do |username, password|
  21. username == 'admin' && password == 'secret'
  22. end
Add Comment
Please, Sign In to add comment