redis_object 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/redis_object/ext/view_caching.rb +20 -14
- data/lib/redis_object/version.rb +1 -1
- data/redis_object.gemspec +1 -1
- data/spec/view_caching_spec.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDA3ZWZiYjJkZWZjMWRmMTRkN2YwOGI1YzU3ZmRhNjc1MGRhZjcyZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDc3ZmExMjMxYjNkYjMxZTAwYWY0ODA2YTYxMTE3NDA5ZWJkNDUyZQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWY3ZjBkY2UxNGNlMTllMWVhNzYxNmMzNTI0MWJkZDRjMzQwZGY0ZDc3MmEx
|
10
|
+
Mzk3YWMyY2M3ZDM4ZDg2Yjk5M2JlNjMwNWEwMWUwYTI0ZTBmMTY0NGIxMWMz
|
11
|
+
NGEyYWMxODI5ZWFiYmJmOGMwNzJlMzkzZTQ0MzVlMTI3YzViZjc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzRmMmI4MzQ2NGFkMGQyOGZhOThhMTJlZGU0ZTEyMjM0MjFmNzE5OGY0NDYz
|
14
|
+
OGY1MzJmYjI4NzM4NmZjZmQzYjk2NjQ2ODAwMWM0MmI2NWQ3NzU3NjEyNmYw
|
15
|
+
ZWYwOTFjYTAzMDA2N2U5MmZiYWQzOWMyZjQ1OWEzMzY0NDIxODg=
|
@@ -119,11 +119,15 @@ module Seabright
|
|
119
119
|
invalidate_cached_views(*self.class.cached_views.map {|name,opts| name })
|
120
120
|
end
|
121
121
|
|
122
|
+
def invalidations(stream)
|
123
|
+
self.class.send("#{stream}stream_invalidations".to_sym)
|
124
|
+
end
|
125
|
+
|
122
126
|
def invalidate_downstream!
|
123
|
-
return unless
|
124
|
-
puts "Invalidating downstream: #{
|
125
|
-
|
126
|
-
if has_collection?(col)
|
127
|
+
return unless invalidations(:down).size > 0
|
128
|
+
puts "Invalidating downstream: #{invalidations(:down).inspect}" if Debug.verbose?
|
129
|
+
invalidations(:down).each do |col|
|
130
|
+
if has_collection?(col) and (colctn = get_collection(col))
|
127
131
|
colctn.each do |obj|
|
128
132
|
obj.invalidated_by_other(self,invalidation_chain + [self.hkey])
|
129
133
|
end
|
@@ -132,11 +136,12 @@ module Seabright
|
|
132
136
|
end
|
133
137
|
|
134
138
|
def invalidate_upstream!
|
135
|
-
return unless
|
136
|
-
puts "Invalidating upstream: #{
|
139
|
+
return unless invalidations(:up).size > 0
|
140
|
+
puts "Invalidating upstream: #{invalidations(:up).inspect}" if Debug.verbose?
|
137
141
|
backreferences.each do |obj|
|
138
|
-
|
139
|
-
|
142
|
+
if invalidations(:up).include?(obj.class) and obj.respond_to?(:invalidated_by_other)
|
143
|
+
obj.invalidated_by_other(self,invalidation_chain + [self.hkey])
|
144
|
+
end
|
140
145
|
end
|
141
146
|
end
|
142
147
|
|
@@ -163,14 +168,15 @@ module Seabright
|
|
163
168
|
end
|
164
169
|
|
165
170
|
def invalidated_by_other(obj,chain)
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
+
return if chain.include?(self.hkey)
|
172
|
+
puts "#{self.class.name}:#{self.id}'s view caches were invalidated by upstream object: #{obj.class.name}:#{obj.id} (chain:#{chain.inspect})" if Debug.verbose?
|
173
|
+
@invalidation_chain = chain
|
174
|
+
[:invalidated_by,"invalidated_by_#{obj.class.name.underscore}".to_sym].each do |meth_sym|
|
175
|
+
if respond_to?(meth_sym)
|
176
|
+
send(meth_sym,obj,chain)
|
171
177
|
end
|
172
|
-
invalidate_up_and_down!
|
173
178
|
end
|
179
|
+
invalidate_up_and_down!
|
174
180
|
end
|
175
181
|
|
176
182
|
def invalidated_by(obj,chain)
|
data/lib/redis_object/version.rb
CHANGED
data/redis_object.gemspec
CHANGED
data/spec/view_caching_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Bragg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: utf8_utils
|
@@ -70,14 +70,14 @@ dependencies:
|
|
70
70
|
name: psych
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - '
|
73
|
+
- - ! '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 1.3.4
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - '
|
80
|
+
- - ! '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.3.4
|
83
83
|
description: ''
|