Skip to content

Commit

Permalink
Documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jan 7, 2016
1 parent e7ea587 commit e52dede
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/build/files/monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ def directories
def remove!
monitor.delete(self)
end


# Inform the handle that it might have been modified.
def changed!
@on_changed.call(@state) if @state.update!
# If @state.update! did not find any changes, don't invoke the callback:
if @state.update!
@on_changed.call(@state)
end
end
end

Expand Down Expand Up @@ -75,6 +79,7 @@ def update(directories, *args)
@directories[directory].each do |handle|
@logger.debug{"Handle changed: #{handle.inspect}"}

# Changes here may not actually require an update to the handle:
handle.changed!(*args)
end
end
Expand Down

0 comments on commit e52dede

Please sign in to comment.