1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00
middleman--middleman/lib/middleman/core_extensions/file_watcher.rb
2011-11-08 14:57:55 -08:00

21 lines
No EOL
440 B
Ruby

module Middleman::CoreExtensions::FileWatcher
class << self
def registered(app)
app.define_hook :file_changed
app.define_hook :file_deleted
app.send :include, InstanceMethods
end
alias :included :registered
end
module InstanceMethods
def file_did_change(path)
run_hook :file_changed, path
end
def file_did_delete(path)
run_hook :file_deleted, path
end
end
end