Skip to content

Instantly share code, notes, and snippets.

@markiz
Created February 22, 2012 11:29
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 markiz/1884326 to your computer and use it in GitHub Desktop.
Save markiz/1884326 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'listen'
require 'fileutils'
FileUtils.rm_rf("./output")
FileUtils.mkdir_p("output")
listener = Listen.to('.').filter(/\.js$/).ignore('output').change do |*args|
puts "Called back with: #{args.inspect}"
exit!
end
Thread.new { listener.start }
sleep(0.5)
File.open('output/output.js', 'w') {|f| f.puts "Hello, world!" }
sleep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment