Skip to content

Instantly share code, notes, and snippets.

@paneq
Created April 15, 2011 10:56
Show Gist options
  • Save paneq/921513 to your computer and use it in GitHub Desktop.
Save paneq/921513 to your computer and use it in GitHub Desktop.
watchr script to observe changes in Rails.root/app/ directory and store the info about last change time in hidden Rails.root/.watchr file. # This file: touch.watchr is in Rails.root/scripts/
require 'fileutils'
rails_root = File.expand_path('../..', __FILE__)
watchr_file = File.join(rails_root, '.watchr')
watch( 'app/(.*)\.rb' ) {|md| FileUtils.touch(watchr_file) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment