class Sinatra::SinareyReloader::Watcher
Attributes
elements[R]
mtime[R]
path[R]
Public Class Methods
new(path)
click to toggle source
# File lib/sinatra/sinarey_reloader.rb, line 49 def initialize(path) @path, @elements = path, [] update end
Public Instance Methods
ignore()
click to toggle source
# File lib/sinatra/sinarey_reloader.rb, line 66 def ignore @ignore = true end
ignore?()
click to toggle source
# File lib/sinatra/sinarey_reloader.rb, line 70 def ignore? !!@ignore end
inline_templates?()
click to toggle source
# File lib/sinatra/sinarey_reloader.rb, line 62 def inline_templates? elements.any? { |element| element.type == :inline_templates } end
removed?()
click to toggle source
# File lib/sinatra/sinarey_reloader.rb, line 74 def removed? !File.exist?(path) end
update()
click to toggle source
# File lib/sinatra/sinarey_reloader.rb, line 58 def update @mtime = File.mtime(path) end
updated?()
click to toggle source
# File lib/sinatra/sinarey_reloader.rb, line 54 def updated? !ignore? && !removed? && mtime != File.mtime(path) end