class Sinatra::Reloader::Watcher::List
Collection of file Watcher
that can be associated with a Sinatra
application. That way, we can know which files belong to a given application and which files have been modified. It also provides a mechanism to inform a Watcher
of the elements defined in the file being watched and if its changes should be ignored.
Public Class Methods
Source
# File lib/sinatra/reloader.rb, line 128 def self.for(app) @app_list_map[app] end
Returns the List
for the application app
.
Public Instance Methods
Source
Source
# File lib/sinatra/reloader.rb, line 167 def updated watchers.find_all(&:updated?) end
Returns an array with all the watchers in the List
that have been updated.
Source
Source
# File lib/sinatra/reloader.rb, line 155 def watcher_for(path) @path_watcher_map[File.expand_path(path)] end
Adds a Watcher
for the file located at path
to the List
, if it isn’t already there.
Also aliased as: watch_file
Source
# File lib/sinatra/reloader.rb, line 161 def watchers @path_watcher_map.values end
Returns an array with all the watchers in the List
.