summaryrefslogtreecommitdiff
path: root/etc/grafix/languages_over_time.rb
blob: bcebfcc7bf57957836f6f822214430e9ed74e652 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'rubygems'
require 'gruff'

g = Gruff::Line.new
g.title = 'Supported Languages in CodeRay'
g.hide_dots = true

data, labels = [0], {}
repo_creation = Date.parse `svn info -r1`[/Last Changed Date: ([-\d]+)/,1]
index = 1
$stdout.sync = true
for day in repo_creation..Date.today
  if day.mday == 1  # only check on 1st day of the month
    labels[index] = day.year.to_s if day.month == 1
    index += 1
    data << `svn ls lib/coderay/scanners -r{#{day}} | \\
      grep '^[[:alpha:]]\\w\\+.rb' | wc -l`.to_i
    print day, "\r"
  end
end
puts

g.data 'CodeRay', data
g.labels = labels

FILE = 'test/scanners/languages_over_time.png'
g.write FILE
`open #{FILE}`