Sha256: fef8c2800c285003dbdc19012f05e5290277bafc5417ff6b1e38ba189a76f888

Contents?: true

Size: 429 Bytes

Versions: 11

Compression:

Stored size: 429 Bytes

Contents

# encoding: utf-8

module Nanoc::PathnameExtensions

  # Calculates the checksum for the file referenced to by this pathname. Any
  # change to the file contents will result in a different checksum.
  #
  # @return [String] The checksum for this file
  #
  # @api private
  def checksum
    stat = File.stat(self.to_s)
    stat.size.to_s + '-' + stat.mtime.to_s
  end

end

class Pathname
  include Nanoc::PathnameExtensions
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nanoc-3.6.7 lib/nanoc/base/core_ext/pathname.rb
nanoc-3.6.6 lib/nanoc/base/core_ext/pathname.rb
nanoc-3.6.5 lib/nanoc/base/core_ext/pathname.rb
nanoc-3.6.4 lib/nanoc/base/core_ext/pathname.rb
nanoc-3.6.3 lib/nanoc/base/core_ext/pathname.rb
nanoc-3.6.2 lib/nanoc/base/core_ext/pathname.rb
nanoc-3.6.1 lib/nanoc/base/core_ext/pathname.rb
nanoc-3.6.0 lib/nanoc/base/core_ext/pathname.rb
nanoc-3.5.0 lib/nanoc/base/core_ext/pathname.rb
nanoc-3.5.0b2 lib/nanoc/base/core_ext/pathname.rb
nanoc-3.5.0b1 lib/nanoc/base/core_ext/pathname.rb