Created
September 18, 2011 20:24
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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