Class: Nanoc::Int::Checksummer::PathnameUpdateBehavior Private

Inherits:
UpdateBehavior
  • Object
show all
Defined in:
lib/nanoc/base/checksummer.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Class Method Details

.update(obj, digest) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



178
179
180
181
182
183
184
185
186
# File 'lib/nanoc/base/checksummer.rb', line 178

def self.update(obj, digest)
  filename = obj.to_s
  if File.exist?(filename)
    stat = File.stat(filename)
    digest.update(stat.size.to_s + '-' + stat.mtime.to_i.to_s)
  else
    digest.update('???')
  end
end