silver 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/silver/cache.rb +9 -2
- data/silver.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
data/lib/silver/cache.rb
CHANGED
@@ -123,13 +123,20 @@ module Silver
|
|
123
123
|
#
|
124
124
|
# length is the number of entries to reduce the redis to
|
125
125
|
|
126
|
-
def cull(length,unique_key=nil)
|
126
|
+
def cull(length,unique_key=nil,return_results=false)
|
127
127
|
|
128
128
|
if unique_key
|
129
129
|
cull_dupes_by(unique_key)
|
130
130
|
end
|
131
131
|
@r.ltrim(@key,0,length-1)
|
132
|
-
|
132
|
+
if return_results
|
133
|
+
final_results = @r.lrange(@key,0,-1).map{|q| JSON.parse(q)}
|
134
|
+
final_results = final_results.map do |result|
|
135
|
+
result.to_bare
|
136
|
+
end
|
137
|
+
else
|
138
|
+
nil
|
139
|
+
end
|
133
140
|
end
|
134
141
|
|
135
142
|
private
|
data/silver.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: silver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 4
|
10
|
+
version: 0.2.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Erik Hin-tone
|