mem_cache_fragment_store 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,8 @@
1
+ = 1.0.1
2
+
3
+ * Use full class path to find logger.
4
+
1
5
  = 1.0.0
2
6
 
3
- Birthday!
7
+ * Birthday!
4
8
 
data/Rakefile CHANGED
@@ -2,18 +2,28 @@
2
2
 
3
3
  require 'hoe'
4
4
 
5
+ require './lib/mem_cache_fragment_store'
6
+
5
7
  DEV_DOC_PATH = 'Libraries/mem_cache_fragment_store'
6
8
 
7
- SPEC = Hoe.new 'mem_cache_fragment_store', '1.0.0' do |p|
9
+ ACFM = ActionController::Caching::Fragments::MemCacheFragmentStore
10
+
11
+ SPEC = Hoe.new 'mem_cache_fragment_store', ACFM::VERSION do |p|
8
12
  p.summary = 'A better Rails fragment store than MemCacheStore'
9
- p.description = 'MemCacheFragementStore correctly handles errors and reuses the CACHE object rather than creating a new client.'
10
- p.author = 'Bob Cottrell'
11
- p.email = 'eric@robotcoop.com'
13
+ p.description = 'MemCacheFragmentStore correctly handles errors and reuses the CACHE object rather than creating new clients.'
14
+ p.spec_extras[:authors] = ['Eric Hodel', 'Bob Cottrell']
15
+ p.email = 'drbrain@segment7.net'
12
16
  p.url = "http://dev.robotcoop.com/#{DEV_DOC_PATH}"
13
17
  p.rubyforge_name = 'rctools'
14
18
 
19
+ p.changes = File.read('History.txt').scan(/\A(=.*?)^=/m).first.first
20
+
15
21
  p.extra_deps << ['memcache-client', '>= 1.1.0']
22
+ p.extra_deps << ['actionpack', '>= 1.12.5']
16
23
  end
17
24
 
18
- require '../tasks'
25
+ begin
26
+ require '../tasks'
27
+ rescue LoadError
28
+ end
19
29
 
@@ -1,13 +1,7 @@
1
+ require 'rubygems'
1
2
  require 'action_controller/caching'
2
3
  require 'memcache'
3
4
 
4
- ##
5
- # MemCache-base fragment cache storage class.
6
- #
7
- # This builds upon the top-level MemCache class provided by the library file
8
- # memcache.rb. Fragment cache data is marshalled and stored in a memcached
9
- # cache.
10
-
11
5
  class ActionController::Caching::Fragments::UnthreadedMemCacheFragmentStore
12
6
 
13
7
  attr_accessor :data
@@ -21,39 +15,56 @@ class ActionController::Caching::Fragments::UnthreadedMemCacheFragmentStore
21
15
  def read(name, options = nil)
22
16
  @data.get "fragment:#{name}"
23
17
  rescue MemCache::MemCacheError => err
24
- Base.logger.error "MemCacheFragmentStore Error: #{err.message}" if
25
- Base.logger
26
- return nil
18
+ handle_error err
27
19
  end
28
20
 
29
21
  def write(name, value, options = nil)
30
22
  @data.set "fragment:#{name}", value, @ttl
31
23
  rescue MemCache::MemCacheError => err
32
- return unless Base.logger
33
- Base.logger.error "MemCacheFragmentStore Error: #{err.message}"
24
+ handle_error err
34
25
  end
35
26
 
36
27
  def delete(name, options = nil)
37
28
  @data.delete "fragment:#{name}"
38
29
  rescue MemCache::MemCacheError => err
39
- return unless Base.logger
40
- Base.logger.error "MemCacheFragmentStore Error: #{err.message}"
30
+ handle_error err
41
31
  end
42
32
 
43
33
  def delete_matched(matcher, options = nil)
44
- return unless Base.logger
45
- Base.logger.error "MemCacheFragmentStore#delete_matched is not supported"
34
+ return nil unless ActionController::Base.logger
35
+ ActionController::Base.logger.error "MemCacheFragmentStore#delete_matched is not supported"
36
+ end
37
+
38
+ private
39
+
40
+ def handle_error(err)
41
+ return nil unless ActionController::Base.logger
42
+ ActionController::Base.logger.error "MemCacheFragmentStore Error: #{err.message}"
46
43
  end
47
44
 
48
45
  end
49
46
 
47
+ ##
48
+ # MemCache-based fragment cache storage class.
49
+ #
50
+ # This builds upon the top-level MemCache class provided by the library file
51
+ # memcache.rb. Fragment cache data is marshalled and stored in a memcached
52
+ # cache.
53
+
50
54
  class ActionController::Caching::Fragments::MemCacheFragmentStore <
51
55
  ActionController::Caching::Fragments::UnthreadedMemCacheFragmentStore
56
+
57
+ ##
58
+ # The version of MemCacheFragmentStore you are using.
59
+
60
+ VERSION = '1.0.1'
61
+
52
62
  def initialize(cache, ttl = 0)
53
63
  super
54
64
  return unless ActionController::Base.allow_concurrency
55
65
  @mutex = Mutex.new
56
- MemCacheFragmentStore.send :include, ThreadSafety
66
+ self.send :include, ThreadSafety
57
67
  end
68
+
58
69
  end
59
70
 
metadata CHANGED
@@ -1,18 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.99
2
+ rubygems_version: 0.9.0.7
3
3
  specification_version: 1
4
4
  name: mem_cache_fragment_store
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.0
7
- date: 2006-09-29 00:00:00 -07:00
6
+ version: 1.0.1
7
+ date: 2006-12-06 00:00:00 -08:00
8
8
  summary: A better Rails fragment store than MemCacheStore
9
9
  require_paths:
10
10
  - lib
11
- - test
12
- email: eric@robotcoop.com
11
+ email: drbrain@segment7.net
13
12
  homepage: http://dev.robotcoop.com/Libraries/mem_cache_fragment_store
14
13
  rubyforge_project: rctools
15
- description: MemCacheFragementStore correctly handles errors and reuses the CACHE object rather than creating a new client.
14
+ description: MemCacheFragmentStore correctly handles errors and reuses the CACHE object rather than creating new clients.
16
15
  autorequire:
17
16
  default_executable:
18
17
  bindir: bin
@@ -28,6 +27,7 @@ signing_key:
28
27
  cert_chain:
29
28
  post_install_message:
30
29
  authors:
30
+ - Eric Hodel
31
31
  - Bob Cottrell
32
32
  files:
33
33
  - History.txt
@@ -54,9 +54,9 @@ dependencies:
54
54
  version_requirement:
55
55
  version_requirements: !ruby/object:Gem::Version::Requirement
56
56
  requirements:
57
- - - ">"
57
+ - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 0.0.0
59
+ version: 1.1.5
60
60
  version:
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: memcache-client
@@ -67,3 +67,12 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.1.0
69
69
  version:
70
+ - !ruby/object:Gem::Dependency
71
+ name: actionpack
72
+ version_requirement:
73
+ version_requirements: !ruby/object:Gem::Version::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: 1.12.5
78
+ version: