Changeset 3030 for lang/ruby/coderepos_stat
- Timestamp:
- 12/11/07 03:34:35 (13 months ago)
- Files:
-
- 1 modified
-
lang/ruby/coderepos_stat/data/index.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/coderepos_stat/data/index.rb
r3014 r3030 6 6 # $Id$ 7 7 # 8 require 'cgi' 9 8 10 stat = {} 9 11 Dir.glob("*/*.yaml").sort.each do |f| 10 12 date = File.dirname(f) 11 13 stat[date] ||= 0 12 stat[date]+= 1 14 stat[date] += 1 15 end 16 17 cgi = CGI.new 18 size = '200x150' 19 if cgi.has_key? 'size' 20 m = /(\d+)x(\d+)/.match(cgi['size']) 21 size = '%sx%s' % [m[1], m[2]] if m and m.size == 3 13 22 end 14 23 15 24 sorted_keys = stat.keys.sort 16 sorted_label = sorted_keys.map{|k| "#{k[ 5..6]}-#{k[8..9]}"}25 sorted_label = sorted_keys.map{|k| "#{k[4..5]}-#{k[6..7]}"} 17 26 sorted_data = sorted_keys.map{|k| stat[k]} 18 max = stat.values.max19 27 20 28 params = Array.new 21 params << "chs= 200x150"29 params << "chs=#{CGI.escape(size)}" 22 30 params << "cht=lc" 23 31 params << "chxt=x,y" 24 params << "chxl=0:|#{sorted_label.join('|')}|1:|| #{max}"32 params << "chxl=0:|#{sorted_label.join('|')}|1:||100" 25 33 params << "chd=t:#{sorted_data.join(',')}" 34 params << "chtt=CodeRepos%20commits/day" 26 35 27 36 puts "Location: http://chart.apis.google.com/chart?#{params.join('&')}" 28 37 puts 29 30
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)