Class: File::Stat

Inherits:
Object show all
Defined in:
lib/amp/support/support.rb

Instance Method Summary collapse

Instance Method Details

#===(other) ⇒ Boolean

Used for comparing two files (approximately). This was our guide: docs.python.org/library/os.html#os.stat

Parameters:

  • other (File::Stat)

    the other stats to compare

Returns:

  • (Boolean)

    whether they are similar enough or not



137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/amp/support/support.rb', line 137

def ===(other)
  self.mode  == other.mode  &&
  self.ino   == other.ino   &&
  self.dev   == other.dev   &&
  self.nlink == other.nlink &&
  self.uid   == other.uid   &&
  self.gid   == other.gid   &&
  self.size  == other.size  &&
  self.atime == other.atime &&
  self.mtime == other.atime &&
  self.ctime == other.ctime
end