class Rucola::FSEvents::FSEvent

Attributes

fsevents_object[R]
id[R]
path[R]

Public Class Methods

new(fsevents_object, id, path) click to toggle source
# File lib/fssm/backends/rubycocoa/fsevents.rb, line 10
def initialize(fsevents_object, id, path)
  @fsevents_object, @id, @path = fsevents_object, id, path
end

Public Instance Methods

files() click to toggle source

Returns an array of the files/dirs in the path that the event occurred in. The files are sorted by the modification time, the first entry is the last modified file.

# File lib/fssm/backends/rubycocoa/fsevents.rb, line 16
def files
  Dir.glob("#{File.expand_path(path)}/*").sort_by { |f| File.mtime(f) }.reverse
end
last_modified_file() click to toggle source

Returns the last modified file in the path that the event occurred in.

# File lib/fssm/backends/rubycocoa/fsevents.rb, line 21
def last_modified_file
  files.first
end