Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 1159 Bytes
1 | require 'uri' |
2 | require 'rack/cache/metastore' |
3 | require 'rack/cache/entitystore' |
4 | |
5 | module Rack::Cache |
6 | |
7 | # Maintains a collection of MetaStore and EntityStore instances keyed by |
8 | # URI. A single instance of this class can be used across a single process |
9 | # to ensure that only a single instance of a backing store is created per |
10 | # unique storage URI. |
11 | class Storage |
12 | def initialize |
13 | @metastores = {} |
14 | @entitystores = {} |
15 | end |
16 | |
17 | def resolve_metastore_uri(uri) |
18 | @metastores[uri.to_s] ||= create_store(MetaStore, uri) |
19 | end |
20 | |
21 | def resolve_entitystore_uri(uri) |
22 | @entitystores[uri.to_s] ||= create_store(EntityStore, uri) |
23 | end |
24 | |
25 | def clear |
26 | @metastores.clear |
27 | @entitystores.clear |
28 | nil |
29 | end |
30 | |
31 | private |
32 | def create_store(type, uri) |
33 | uri = URI.parse(uri) unless uri.respond_to?(:scheme) |
34 | if type.const_defined?(uri.scheme.upcase) |
35 | klass = type.const_get(uri.scheme.upcase) |
36 | klass.resolve(uri) |
37 | else |
38 | fail "Unknown storage provider: #{uri.to_s}" |
39 | end |
40 | end |
41 | |
42 | public |
43 | @@singleton_instance = new |
44 | def self.instance |
45 | @@singleton_instance |
46 | end |
47 | end |
48 | |
49 | end |