colorful rat Ratfactor.com > Dave's Repos

reporat

A static website generator for Git repos written in Ruby.
git clone http://ratfactor.com/repos/reporat/reporat.git

reporat/time.rb

Download raw file: time.rb

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)."