Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 7
- Log:
Initial import of RForum 0.2 sources from a downloaded Tarball.
RForum is a Ruby On Rails based forum and mail gateway service.
- Author:
- adh
- Date:
- Sat Jul 22 18:43:13 +0100 2006
- Size:
- 1294 Bytes
- Properties:
- Property svn:executable is set
1 | #!/usr/bin/env ruby |
2 | |
3 | require 'rubygems' |
4 | require 'gruff' |
5 | require File.dirname(__FILE__) + '/../config/environment' |
6 | |
7 | def posts(filename, days=6) |
8 | data = {} |
9 | for method in ['web', 'mail'] |
10 | data[method] = [] |
11 | days.downto(0) do |n| |
12 | data[method] << Post.count(['post_method = ? AND created_at BETWEEN ? AND ?', method, (n + 1).days.ago, n.days.ago]) |
13 | end |
14 | end |
15 | |
16 | total = Post.count |
17 | |
18 | g = Gruff::Line.new(480) |
19 | g.title = "Posts (total: #{total})" |
20 | |
21 | g.data("Posts from Forum per day", data['web']) |
22 | g.data("Posts from Mailing List per day", data['mail']) |
23 | |
24 | g.labels = {0 => "#{days} days ago", days => Time.now.strftime('%d.%m.%Y')} |
25 | |
26 | g.write(filename) |
27 | end |
28 | |
29 | def registrations(filename, days=6) |
30 | data = [] |
31 | days.downto(0) do |n| |
32 | data << User.count(['created_at BETWEEN ? AND ?', (n + 1).days.ago, n.days.ago]) |
33 | end |
34 | |
35 | total = User.count |
36 | |
37 | g = Gruff::Line.new(480) |
38 | g.title = "User Accounts (total: #{total})" |
39 | |
40 | g.data("User Accounts created per day", data) |
41 | |
42 | g.labels = {0 => "#{days} days ago", days => Time.now.strftime('%d.%m.%Y')} |
43 | g.write(filename) |
44 | end |
45 | |
46 | |
47 | IMG_ROOT = RAILS_ROOT + '/public/images/stats/' |
48 | posts(IMG_ROOT + 'posts.png', 10) |
49 | registrations(IMG_ROOT + 'registrations.png', 14) |