SHARE
TWEET

LD25 server.rb

a guest Dec 12th, 2012 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env ruby
  2.  
  3. require 'rake'
  4. require 'sinatra'
  5.  
  6. rake = Rake::Application.new
  7. Rake.application = rake
  8. rake.init
  9. rake.load_rakefile
  10.  
  11. get '/favicon.ico' do
  12.   not_found
  13. end
  14.  
  15. get '/*' do |filename|
  16.   filename = 'index.html' if filename == ''
  17.   task = Rake::Task[filename]
  18.   task.reenable
  19.   task.invoke
  20.   send_file filename
  21. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top