Class: Ridley::Chef::Digester

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

Overview

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.checksum_for_file(*args) ⇒ Object



11
12
13
# File 'lib/ridley/chef/digester.rb', line 11

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

.instanceObject



7
8
9
# File 'lib/ridley/chef/digester.rb', line 7

def instance
  @instance ||= new
end

.md5_checksum_for_file(*args) ⇒ Object



15
16
17
# File 'lib/ridley/chef/digester.rb', line 15

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

Instance Method Details

#checksum_for_file(file) ⇒ Object



24
25
26
# File 'lib/ridley/chef/digester.rb', line 24

def checksum_for_file(file)
  generate_checksum(file)
end

#generate_checksum(file) ⇒ Object



28
29
30
# File 'lib/ridley/chef/digester.rb', line 28

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

#generate_md5_checksum(io) ⇒ Object



36
37
38
# File 'lib/ridley/chef/digester.rb', line 36

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

#generate_md5_checksum_for_file(file) ⇒ Object



32
33
34
# File 'lib/ridley/chef/digester.rb', line 32

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

#validate_checksum(*args) ⇒ Object



20
21
22
# File 'lib/ridley/chef/digester.rb', line 20

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