Skip to content

Commit 8fdbc9e

Browse files
committed
Add ruby script to converting manifest.xml to csv for tutorial party spreadsheets
1 parent b4fe3fb commit 8fdbc9e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

manifest_to_csv.rb

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env ruby
2+
3+
require 'rexml/document'
4+
5+
xmlInput = File.read("manifest.xml")
6+
7+
doc, categories = REXML::Document.new(xmlInput), []
8+
9+
# parse list of categories
10+
doc.elements.each("content/categories/category") do |e|
11+
c = {:ref => e.attributes["ref"], :title => e.attributes["title"], :tutorials => []}
12+
e.elements.each("tutorials/tutorial") do |t|
13+
c[:tutorials] << t.text
14+
end
15+
categories << c
16+
end
17+
18+
# print csv for each category
19+
rows_per_tutorial = 3
20+
categories.each do |c|
21+
puts c[:title]
22+
puts "Tutorial name\tAssigned to\tIssues\tSolution\tApproved?\t\OS / Build type"
23+
c[:tutorials].each do |t|
24+
rows_per_tutorial.times do
25+
puts "=HYPERLINK(\"http://gazebosim.org/tutorials?tut=#{t}&cat=#{c[:ref]}\",\"#{t}\")"
26+
end
27+
end
28+
end

0 commit comments

Comments
 (0)