Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 193
- Log:
First stage commit of Typo 4.1, modified for the ROOL site.
Includes all local modifications but a final pass needs to be
made to delete any files left over from earlier Typo versions
that shouldn't be here anymore. See the 'tags' section of the
repository for a clean Typo 4.1 tree.Note that symlinks to shared files in the RISC OS Open theme
directory have been deliberately included this time around; I
decided that on balance it was better to leave them in as
placeholders, since unlike symlinks in app/views/shared, the
Typo theme structure is not a standard Rails concept.
- Author:
- rool
- Date:
- Wed Apr 04 18:51:02 +0100 2007
- Size:
- 1060 Bytes
1 | class BlogSweeper < ActionController::Caching::Sweeper |
2 | observe Article, Category, Feedback, Page, Blog, Sidebar, User |
3 | |
4 | def after_save(record) |
5 | logger.info "Expiring #{record}, with controller: #{controller}" |
6 | expire_for(record) |
7 | end |
8 | |
9 | def after_destroy(record) |
10 | expire_for(record, true) |
11 | end |
12 | |
13 | def expire_for(record, destroying = false) |
14 | case record |
15 | when Page |
16 | sweep_pages(record) |
17 | when Content |
18 | if record.invalidates_cache?(destroying) |
19 | sweep_all |
20 | end |
21 | when Sidebar, Category |
22 | sweep_articles |
23 | sweep_pages(record) |
24 | when Blog, User |
25 | sweep_all |
26 | end |
27 | end |
28 | |
29 | def sweep_all |
30 | PageCache.sweep_all |
31 | expire_fragment(/.*/) |
32 | end |
33 | |
34 | def sweep_articles |
35 | PageCache.sweep('/articles/%') |
36 | expire_fragment(%r{.*/articles/.*}) |
37 | end |
38 | |
39 | def sweep_pages(record) |
40 | PageCache.sweep("/pages/#{record.name rescue ''}.html") |
41 | expire_fragment(/.*\/pages\/.*/) |
42 | expire_fragment(/.*\/view_page.*/) |
43 | end |
44 | |
45 | def logger |
46 | @logger ||= RAILS_DEFAULT_LOGGER || Logger.new(STDERR) |
47 | end |
48 | end |