Sha256: bacb10848aa45698ca13433645641828aa90e338335b919448c306b6e17f0efe
Contents?: true
Size: 596 Bytes
Versions: 11
Compression:
Stored size: 596 Bytes
Contents
require 'digest/md5' module Trackman module Assets module Components module Hashable def data @data ||= read_file(path) end def file_hash @file_hash ||= (data.nil? ? "" : Digest::MD5.hexdigest(data)) end protected def read_file(file_path) begin file = File.open(file_path) return file.read rescue return nil ensure file.close unless file.nil? end end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems