Skip to content

Instantly share code, notes, and snippets.

@syahrasi
Created January 2, 2014 06:34
Show Gist options
  • Save syahrasi/8215725 to your computer and use it in GitHub Desktop.
Save syahrasi/8215725 to your computer and use it in GitHub Desktop.
Rack-livereload with Sinatra
require "rubygems"
require "bundler"
Bundler.require
require 'rack-livereload'
use Rack::LiveReload
require "./app"
run Sinatra::Application
// run 'guard' after this
group :development, :test do
gem "guard-livereload"
gem "rack-livereload"
end
guard 'livereload' do
watch(%r{^app\.rb})
watch(%r{views/.+\.(erb|haml|slim)$})
watch(%r{public/.+\.(css|js|html)})
end
// to generate this file, run: guard init livereload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment