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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/silver/cache.rb +9 -2
  3. data/silver.gemspec +1 -1
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
@@ -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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{silver}
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Erik Hin-tone"]
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: 17
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
9
+ - 4
10
+ version: 0.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Erik Hin-tone