Skip to content

Instantly share code, notes, and snippets.

@brandon-beacher
Created August 5, 2011 20:24
Show Gist options
  • Save brandon-beacher/1128432 to your computer and use it in GitHub Desktop.
Save brandon-beacher/1128432 to your computer and use it in GitHub Desktop.
def update_monitoring_state_for_paths(checked_paths, unchecked_paths) #ckdake
change_found = false
flatten_paths do |child, flattened_path|
if checked_paths.include?(flattened_path) && child.unmonitored?
puts "im not monitored and i should be!"
child.start_monitoring
change_found = true
end
if unchecked_paths.include?(flattened_path) && child.monitored?
puts "im monitored and i should not be!"
child.stop_monitoring
change_found = true
end
end
change_found
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment