Class: Rake::Delphi::HashesTask

Inherits:
BasicTask show all
Defined in:
lib/rake/common/hashtask.rb

Instance Method Summary collapse

Methods inherited from BasicTask

#trace?

Constructor Details

#initialize(task, files, alg) ⇒ HashesTask

Returns a new instance of HashesTask.



25
26
27
28
29
# File 'lib/rake/common/hashtask.rb', line 25

def initialize(task, files, alg)
    super(task)
    @hashes = {}
    calc_hashes(files, alg)
end

Instance Method Details

#calc_hashes(files, alg) ⇒ Object



31
32
33
34
35
36
# File 'lib/rake/common/hashtask.rb', line 31

def calc_hashes(files, alg)
    files = [files] unless files.kind_of?(Array)
    files.each do |f|
        @hashes[f] = { alg.upcase => HashTask.new(f, alg).digest }
    end
end

#to_hashObject



38
39
40
# File 'lib/rake/common/hashtask.rb', line 38

def to_hash
    @hashes
end