Skip to content

Instantly share code, notes, and snippets.

@hannahherbig
Created September 18, 2011 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hannahherbig/1225514 to your computer and use it in GitHub Desktop.
Save hannahherbig/1225514 to your computer and use it in GitHub Desktop.
Put this in any folder that you want to be reloaded automatically if one of the files change, or if a new one is added, then require it.
require 'fssm' # gem install fssm
Thread.abort_on_exception = true
Thread.new do
FSSM.monitor(File.expand_path('.', File.dirname(__FILE__)), '**/*') do
block = proc do |b, r|
fn = File.join(b, r)
load fn
puts "reloaded #{fn}"
end
update &block
create &block
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment