I have a question regarding Chef and the Lambda method to evaluate variables rather at run time than compile time. Check the snip below:
md5 = lambda { Digest::MD5.file("#{some_file}").hexdigest }
pp "md5: #{md5}"
This results in:
md5: #<Proc:0x000000000c153b08
But I do want to have the variable itself. What is the exact syntax to .call the lambda and get the actual variable? I am pulling my hair out for days.
Any help highly appreciated!
Several options to
calla proc or lambda:Each of the above can also accept arguments. This could be used for example to pass the filename: (
->is a lambda proc literal)