Class: Rake::Delphi::HashesTask
- Defined in:
- lib/rake/common/hashtask.rb
Instance Method Summary collapse
- #calc_hashes(files, alg) ⇒ Object
-
#initialize(task, files, alg) ⇒ HashesTask
constructor
A new instance of HashesTask.
- #to_hash ⇒ Object
Methods inherited from BasicTask
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_hash ⇒ Object
38 39 40 |
# File 'lib/rake/common/hashtask.rb', line 38 def to_hash @hashes end |