redis-set 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/redis_set.rb +7 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38c7747969cffe4f84c06b7c4c249e1db96b60b2
4
- data.tar.gz: cc72aef22abc64c4a4ed886eef069865451131a3
3
+ metadata.gz: 45e696c793b4e362dcac1b1256ca2581f2346230
4
+ data.tar.gz: aca48ae696bba8947b94f612431a1f5aa20e96e2
5
5
  SHA512:
6
- metadata.gz: 4b38c5833ea9b105ae3a516154319389708db9b3f6e2103d7215736673f686bbba823ed25fd8064be7bf4062e295f158c07a34b436d5febf59469801c61d94e6
7
- data.tar.gz: 53c98de243c00205a442a6e7ca987e15219260eda9bc9c8820e7ad22fedfc408a9159bee0f82a0c638b63a50b82be10722612a31e9c34c9ecc7ef25c4117ba18
6
+ metadata.gz: d66c98309c636ee604bf8e288a7e2c85f6bde73f76bfd0ab1a27de1fbe57a358b1bcde336bfee7baeda03c75ed01ea02c02a3cbdc7fc7757f4c1bc54c2483175
7
+ data.tar.gz: c8a7375bd5a71de527013e606f688e97ecfd2237b0ee3a6ccb6ba6685fd931123d12871ff08bd6b99748468b141806c545c7dd2494274b36494b204aff69c9ee
@@ -3,12 +3,12 @@ require "redis"
3
3
  class RedisSet
4
4
  attr_reader :name
5
5
 
6
- VERSION = "0.0.3"
6
+ VERSION = "0.0.4"
7
7
 
8
8
  class InvalidNameException < StandardError; end;
9
9
  class InvalidRedisConfigException < StandardError; end;
10
10
 
11
- def initialize(name, redis_or_options = {})
11
+ def initialize(name, redis_or_options = {}, more_options = {})
12
12
  name = name.to_s if name.kind_of? Symbol
13
13
 
14
14
  raise InvalidNameException.new unless name.kind_of?(String) && name.size > 0
@@ -26,6 +26,10 @@ class RedisSet
26
26
  else
27
27
  raise InvalidRedisConfigException.new
28
28
  end
29
+
30
+ if more_options.kind_of?(Hash) && more_options[:expire]
31
+ @redis.expire more_options[:expire]
32
+ end
29
33
  end
30
34
 
31
35
  def add *values
@@ -102,7 +106,7 @@ class RedisSet
102
106
  alias flush clear
103
107
 
104
108
  def expire seconds
105
- with{|redis| redis.expire name, seconds}
109
+ with{|redis| redis.expire name, seconds.to_i}
106
110
  end
107
111
 
108
112
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-set
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Misha Conway