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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZWZkNGY4Y2M4ZjI3YzEwY2NlMzgyNDlkNTBmMjc0ODY1NjUwZDhhMw==
4
+ ZDA3ZWZiYjJkZWZjMWRmMTRkN2YwOGI1YzU3ZmRhNjc1MGRhZjcyZQ==
5
5
  data.tar.gz: !binary |-
6
- ZmExZDRhNDYwNWU3NjI2N2U4OTgyMGE4MTE2Yzg4NjNhNWQ5MDhmOQ==
6
+ ZDc3ZmExMjMxYjNkYjMxZTAwYWY0ODA2YTYxMTE3NDA5ZWJkNDUyZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NjI1ZjUyNGEyNzY0NTUxODljNmJhNTBiODcyNzIzNjllYjM5NjdmNmM4MGM5
10
- MjRjNjQ1NDVmMTBmZGE4NGE1NGMyMDBkZmY1ZTlhY2ZlYWY1MDg2NmNjNGJi
11
- ZGE0NDM5ODc5MWFhZWZlYzg2ZmRiNGRmMjVkZWI4ODZhMDM2YjM=
9
+ NWY3ZjBkY2UxNGNlMTllMWVhNzYxNmMzNTI0MWJkZDRjMzQwZGY0ZDc3MmEx
10
+ Mzk3YWMyY2M3ZDM4ZDg2Yjk5M2JlNjMwNWEwMWUwYTI0ZTBmMTY0NGIxMWMz
11
+ NGEyYWMxODI5ZWFiYmJmOGMwNzJlMzkzZTQ0MzVlMTI3YzViZjc=
12
12
  data.tar.gz: !binary |-
13
- ZDEwYzc3NWRkYWVlYjk2NzFkMjI4MDcxMjVmZGViYTJhZDk5MDdmODkwMjQ5
14
- NWVjNjg4MjE1MDRmMjE5ZmUzMjRkNTM5NDlkMDE0YmE5MTY3YjMxNjIwNTc2
15
- OTJhZDI2YWZiYmM0M2JmNDU0YWQ1ODQyYThhNTRjODhjMmY2Yzc=
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 self.class.downstream_invalidations && (self.class.downstream_invalidations.size > 0)
124
- puts "Invalidating downstream: #{self.class.downstream_invalidations.inspect}" if Debug.verbose?
125
- self.class.downstream_invalidations.each do |col|
126
- if has_collection?(col) && (colctn = get_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 self.class.upstream_invalidations && (self.class.upstream_invalidations.size > 0)
136
- puts "Invalidating upstream: #{self.class.upstream_invalidations.inspect}" if Debug.verbose?
139
+ return unless invalidations(:up).size > 0
140
+ puts "Invalidating upstream: #{invalidations(:up).inspect}" if Debug.verbose?
137
141
  backreferences.each do |obj|
138
- next unless self.class.upstream_invalidations.include?(obj.class.name.split("::").last.to_sym) #|| self.class.invalidate_everything_upstream?
139
- obj.invalidated_by_other(self,invalidation_chain + [self.hkey]) if obj.respond_to?(:invalidated_by_other)
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
- unless chain.include?(self.hkey)
167
- 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?
168
- @invalidation_chain = chain
169
- [:invalidated_by,"invalidated_by_#{obj.class.name.underscore}".to_sym].each do |meth_sym|
170
- send(meth_sym,obj,chain) if respond_to?(meth_sym)
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)
@@ -1,5 +1,5 @@
1
1
  module Seabright
2
2
  class RedisObject
3
- VERSION = "1.2.4"
3
+ VERSION = "1.2.5"
4
4
  end
5
5
  end
data/redis_object.gemspec CHANGED
@@ -23,5 +23,5 @@ Gem::Specification.new do |s|
23
23
  s.add_dependency "redis", ">= 3.0.4"
24
24
  s.add_dependency "yajl-ruby", ">= 1.1.0"
25
25
  s.add_dependency "activesupport", ">= 3.2.13"
26
- s.add_dependency "psych", "= 1.3.4"
26
+ s.add_dependency "psych", ">= 1.3.4"
27
27
  end
@@ -40,7 +40,7 @@ module ViewCachingSpec
40
40
 
41
41
  class Baby < RedisObject
42
42
 
43
- invalidate_upstream :TypedObject
43
+ invalidate_upstream TypedObject
44
44
 
45
45
  end
46
46
 
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
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-06-25 00:00:00.000000000 Z
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: ''