Class: Ridley::Chef::Digester

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

Overview

Author:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.checksum_for_file(*args) ⇒ Object


13
14
15
# File 'lib/ridley/chef/digester.rb', line 13

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

.instanceObject


9
10
11
# File 'lib/ridley/chef/digester.rb', line 9

def instance
  @instance ||= new
end

.md5_checksum_for_file(*args) ⇒ Object


17
18
19
# File 'lib/ridley/chef/digester.rb', line 17

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

Instance Method Details

#checksum_for_file(file) ⇒ Object


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

def checksum_for_file(file)
  generate_checksum(file)
end

#generate_checksum(file) ⇒ Object


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

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

#generate_md5_checksum(io) ⇒ Object


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

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

#generate_md5_checksum_for_file(file) ⇒ Object


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

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

#validate_checksum(*args) ⇒ Object


22
23
24
# File 'lib/ridley/chef/digester.rb', line 22

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