redis-set 0.0.5 → 0.0.6

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 +11 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 27783585289e3045d2f84d624f859f361e6d3044
4
- data.tar.gz: 0c8932b0e84ef25cbb4a42545895885c46e60791
3
+ metadata.gz: 0efb160f34bf9451eb7605c59bb3bf3c41c903f2
4
+ data.tar.gz: a60bbfe301fe51c71bdda362643fa04f906830d4
5
5
  SHA512:
6
- metadata.gz: 8e9cd9627438cecdba8b53374e5db2d706c1a55b44cfc81ac1fbad056eb7aa68312937166ba178893e083d466bca3d7a7fcfe01f22670e65b906d0353c5b0302
7
- data.tar.gz: 2b19fbf7725200b75361a5a01bb4614f8202a11eea9434a21734288724352748ed96bca2fa7e4b6dd6fc427ae3bd53325e811e16af06e7e34345d9b8d61c46f8
6
+ metadata.gz: ac5ac7eb78d8dc9173e0a7bad164d9c7f639af82c5d57a30a652a0fdf565614c47fc47e623a51e7f4cd7200a58056b7da6f59e620188c6d59c3fba82fc045cc0
7
+ data.tar.gz: 890b3325f802ad823122718f1803bf1f17e82957eab2e95c57bc64faed37123457d4cb7ac6639fcb0545fa9357630aa5b2c974d45219d142174e72f5131dc271
@@ -3,7 +3,7 @@ require "redis"
3
3
  class RedisSet
4
4
  attr_reader :name
5
5
 
6
- VERSION = "0.0.5"
6
+ VERSION = "0.0.6"
7
7
 
8
8
  class InvalidNameException < StandardError; end;
9
9
  class InvalidRedisConfigException < StandardError; end;
@@ -70,15 +70,18 @@ class RedisSet
70
70
 
71
71
  def intersection *sets
72
72
  sets = [sets].flatten
73
- sets = sets.map do |s|
74
- if s.kind_of?(self.class)
75
- s.name
76
- else
77
- s
73
+ if sets.size >= 1
74
+ sets = sets.map do |s|
75
+ if s.kind_of?(self.class)
76
+ s.name
77
+ else
78
+ s
79
+ end
78
80
  end
79
- end
81
+ sets << name
80
82
 
81
- with{|redis| redis.sinter *sets }
83
+ with{|redis| redis.sinter *sets }
84
+ end
82
85
  end
83
86
 
84
87
  def scan cursor = 0, amount = 10, match = "*"
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.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Misha Conway