Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 15
- Log:
Attempt to update Typo to a Typo SVN HEAD release from around the
time the prototype installation was set up on the RISC OS Open Limited
web site. Timestamps place this at 04-Jul so a revision from 05-Jul or
earlier was pulled and copied over the 2.6.0 tarball stable code.
- Author:
- adh
- Date:
- Sat Jul 22 23:27:35 +0100 2006
- Size:
- 718 Bytes
1 | class SimpleCache < Hash |
2 | |
3 | class Item |
4 | attr_reader :expiry, :value |
5 | def initialize(expiry, value) |
6 | @expiry, @value = expiry, value |
7 | end |
8 | end |
9 | |
10 | def initialize(ttl) |
11 | @ttl = ttl |
12 | logger.info(" SimpleCache: will store items for #{ttl}s") |
13 | end |
14 | |
15 | def [](key) |
16 | item = super(key) |
17 | if item.nil? or item.expiry <= Time.now |
18 | logger.info(" SimpleCache: miss on #{key}") |
19 | nil |
20 | else |
21 | logger.debug(" SimpleCache: hit on #{key}") |
22 | item.value |
23 | end |
24 | end |
25 | |
26 | def []=(key, value) |
27 | logger.info(" SimpleCache: store on #{key}") |
28 | super(key, Item.new(@ttl.from_now, value)) |
29 | value |
30 | end |
31 | |
32 | |
33 | def logger |
34 | @logger ||= RAILS_DEFAULT_LOGGER || Logger.new(STDOUT) |
35 | end |
36 | |
37 | end |