daemon_percentages.rb and Ruby Autovivification

Both Jim Weirich and Ben Summers were kind enough to email me about my Daemon Logging Percentages and Playing with Ruby Idioms post. They sent me an explanation on how to do the hash assignment in a way I find much nicer, so with no more delays I present - Option 4:

  tally = Hash.new(0)
  tally[daemon] += 1

It really is that simple - and I still missed it by a mile. I’ve updated the script to use this and I wanted to say thank you for the pointer, so thank you both.