-
Notifications
You must be signed in to change notification settings - Fork 0
/
burndown.rb
40 lines (33 loc) · 989 Bytes
/
burndown.rb
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
29
30
31
32
33
34
35
36
37
38
39
40
require 'yaml'
require 'date'
require 'rubygems'
require 'scruffy'
sprint = YAML::load_file("project/current/plan.yml")
todo = YAML::load_file("project/current/todo.yml")
current_todo = 0
Dir["project/features/*.yml"].each do |file|
story = YAML::load_file(file)
if sprint["Features"].include? story["Titel"]
if todo.has_key? story["Titel"]
current_todo += story["Zeit"]
end
end
end
graphdata=YAML::load_file("project/current/burndown.yml")
graphdata[Date.today]=current_todo
File.open("project/current/burndown.yml", 'w' ) do |out|
YAML::dump(graphdata, out)
end
last=0
chartdata = (sprint["Start"] .. sprint["Ende"]).collect do |day|
if graphdata.has_key? day
last =graphdata[day]
end
last
end
graph = Scruffy::Graph.new
graph.title = "Burn Down Chart"
graph.renderer = Scruffy::Renderers::Standard.new
puts chartdata.inspect
graph.add :line, 'TODO', chartdata
graph.render :to => "project/current/burndown.png", :as => "png", :size => [500,500]