Content-type: application/rss+xml; charset=UTF-8
<%require 'wit'

require 'time'
require 'rss/maker'

w = Wit.new
rss = RSS::Maker.make('2.0') do |maker|
basename = "http://#{ENV['SERVER_NAME']}#{File.dirname(ENV['REQUEST_URI'])}"

	maker.channel.link = "#{basename}commits.rhtml/#{w.group[:url]}/#{w.name[:url]}/?branch=#{w.branch[:url]}"
	maker.channel.title = w.title[:plain]
	maker.channel.description = "#{w.title[:plain]} - #{w.name[:plain]} tree (#{w.branch[:plain]} branch)"

	w.commits(15) do |fmt, time, author, summary, titlesub, commitmsg, head|
		item = maker.items.new_item

		item.author = author[:plain]
		item.link = "#{basename}/diff.rhtml/#{w.group[:url]}/#{w.name[:url]}/?branch=#{w.branch[:url]}&head=#{head[:url]}"
		item.title = summary[:plain]
		item.date = time[:plain]
		item.description = commitmsg[:html]
	end
end%>
<%=rss%>
