Class: Chef::Digester

Inherits:
Object show all
Defined in:
lib/chef/digester.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.checksum_for_file(*args) ⇒ Object



30
31
32
# File 'lib/chef/digester.rb', line 30

def self.checksum_for_file(*args)
  instance.checksum_for_file(*args)
end

.generate_md5_checksum_for_file(*args) ⇒ Object



46
47
48
# File 'lib/chef/digester.rb', line 46

def self.generate_md5_checksum_for_file(*args)
  instance.generate_md5_checksum_for_file(*args)
end

.instanceObject



26
27
28
# File 'lib/chef/digester.rb', line 26

def self.instance
  @instance ||= new
end

Instance Method Details

#checksum_for_file(file) ⇒ Object



38
39
40
# File 'lib/chef/digester.rb', line 38

def checksum_for_file(file)
  generate_checksum(file)
end

#generate_checksum(file) ⇒ Object



42
43
44
# File 'lib/chef/digester.rb', line 42

def generate_checksum(file)
  checksum_file(file, Digest::SHA256.new)
end

#generate_md5_checksum(io) ⇒ Object



54
55
56
# File 'lib/chef/digester.rb', line 54

def generate_md5_checksum(io)
  checksum_io(io, Digest::MD5.new)
end

#generate_md5_checksum_for_file(file) ⇒ Object



50
51
52
# File 'lib/chef/digester.rb', line 50

def generate_md5_checksum_for_file(file)
  checksum_file(file, Digest::MD5.new)
end

#validate_checksum(*args) ⇒ Object



34
35
36
# File 'lib/chef/digester.rb', line 34

def validate_checksum(*args)
  self.class.validate_checksum(*args)
end