Class: Pathname

Inherits:
Object
  • Object
show all
Defined in:
lib/gorge/pathname.rb

Instance Method Summary collapse

Instance Method Details

#file_crc32String

Returns the CRC32 checksum (in hexadecimal format) of the contents of the file indicated by the Pathname.

Returns:



9
10
11
# File 'lib/gorge/pathname.rb', line 9

def file_crc32
  Digest::CRC32.file(self).hexdigest
end

#file_md5String

Returns the MD5 hash (in hexadecimal format) of the contents of the file indicated by the Pathname.

Returns:



17
18
19
# File 'lib/gorge/pathname.rb', line 17

def file_md5
  Digest::MD5.file(self).hexdigest
end

#file_sha1String

Returns the SHA1 hash (in hexadecimal format) of the contents of the file indicated by the Pathname.

Returns:



25
26
27
# File 'lib/gorge/pathname.rb', line 25

def file_sha1
  Digest::SHA1.file(self).hexdigest
end

#file_sha256String

Returns the SHA256 hash (in hexadecimal format) of the contents of the file indicated by the Pathname.

Returns:



33
34
35
# File 'lib/gorge/pathname.rb', line 33

def file_sha256
  Digest::SHA256.file(self).hexdigest
end