mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
21 lines
No EOL
440 B
Ruby
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 |