lib/guard/listener.rb
def file_modified?(path, last_event)
      ctime = File.ctime(path).to_i
      mtime = File.mtime(path).to_i
      if [mtime, ctime].max == last_event.to_i
        file_content_modified?(path, sha1_checksum(path))
      elsif mtime > last_event.to_i
        set_sha1_checksums_hash(path, sha1_checksum(path))
        true
      else
        false
      end
    rescue
      false
    end
# Test if the file content has changed.
#
# Depending on the filesystem, mtime/ctime is probably only precise to the second, so round
# both values down to the second for the comparison.
#
# ctime is used only on == comparison to always catches Rails 3.1 Assets pipelined on Mac OSX
#
# @param [String] path the file path
# @param [Time] last_event the time of the last event
# @return [Boolean] Whether the file content has changed or not.
#
Test if the file content has changed.
Depending on the filesystem, mtime/ctime is probably only precise to the second, so round
both values down to the second for the comparison.

ctime is used only on == comparison to always catches Rails 3.1 Assets pipelined on Mac OSX
Test if the file content has changed . Depending on the filesystem mtime / ctime is probably only precise to the second so round both values down to the second for the comparison . ctime is used only on == comparison to always catches Rails 3 . 1 Assets pipelined on Mac OSX
def file_modified?(path, last_event)
      ctime = File.ctime(path).to_i
      mtime = File.mtime(path).to_i
      if [mtime, ctime].max == last_event.to_i
        file_content_modified?(path, sha1_checksum(path))
      elsif mtime > last_event.to_i
        set_sha1_checksums_hash(path, sha1_checksum(path))
        true
      else
        false
      end
    rescue
      false
    end
def file_modified? ( path , last_event ) ctime = File . ctime ( path ) . to_i mtime = File . mtime ( path ) . to_i if [ mtime , ctime ] . max == last_event . to_i file_content_modified? ( path , sha1_checksum ( path ) ) elsif mtime > last_event . to_i set_sha1_checksums_hash ( path , sha1_checksum ( path ) ) true else false end rescue false end
Test if the file content has changed.
Test if the file content has changed .
Whether the file content has changed or not.
Whether the file content has changed or not .
Boolean
path
last_event
last_event the time of the last event
last_event the time of the last event