-
Notifications
You must be signed in to change notification settings - Fork 3
/
rss.rhtml
25 lines (20 loc) · 853 Bytes
/
rss.rhtml
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
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%>