Skip to content

Instantly share code, notes, and snippets.

@kazjote
Created February 18, 2010 15:54
Show Gist options
  • Save kazjote/307756 to your computer and use it in GitHub Desktop.
Save kazjote/307756 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# Simple script which can be used with couchapp to automatically
# push applications to couchdb on files update on systems supporting inotify.
#
# First install rubygems in your system, then:
#
# $ sudo gem install rb-inotify
# $ cd couchapp_project
# $ ./couchapp_updater
#
require 'rubygems'
require 'rb-inotify'
notifier = INotify::Notifier.new
notifier.watch(".", :close_write, :recursive) do |event|
`couchapp push`
end
notifier.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment