1 #!/usr/bin/env ruby
2
3 total = 0
4
5 File.readlines('devlog.txt').each do |line|
6 if m = line.match(/(\d+) min/)
7 total += m[1].to_i
8 end
9 end
10
11 h = (total/60.0).round(1)
12
13 puts "I've been at this for #{total} minutes (about #{h} hours)."