mock_redis 0.15.2 → 0.15.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/lib/mock_redis/set_methods.rb +9 -3
- data/lib/mock_redis/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9b8fbf2e49de0035f66b1a031ec57f0fcb7c345
|
4
|
+
data.tar.gz: bcfb198f89ff3d10d337ccb671a3c22ced9b2b0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d51552e4d5fe5da840df548d3ffaff4f3134c8674a34ca125a22a0a2682a85cdff92d2462a2f3d061e955563c8eb8a48cabafda9df5b4c6e60305f7879e9d9f1
|
7
|
+
data.tar.gz: 0e11ba27a49115af5b3fd847f87522f7a11a08d04413a23a7594877a3a5f53aed24766018ae4f6e5c6efdd83e1198390eaea1fb54f10755026759850d5c2b3ad
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -7,22 +7,28 @@ class MockRedis
|
|
7
7
|
include UtilityMethods
|
8
8
|
|
9
9
|
def sadd(key, members)
|
10
|
+
members_class = members.class
|
10
11
|
members = [members].flatten.map(&:to_s)
|
11
12
|
assert_has_args(members, 'sadd')
|
12
13
|
|
13
14
|
with_set_at(key) do |s|
|
15
|
+
size_before = s.size
|
14
16
|
if members.size > 1
|
15
|
-
size_before = s.size
|
16
17
|
members.reverse_each { |m| s << m }
|
17
18
|
s.size - size_before
|
18
19
|
else
|
19
|
-
!!s.add?(members.first)
|
20
|
+
added = !!s.add?(members.first)
|
21
|
+
if members_class == Array
|
22
|
+
s.size - size_before
|
23
|
+
else
|
24
|
+
added
|
25
|
+
end
|
20
26
|
end
|
21
27
|
end
|
22
28
|
end
|
23
29
|
|
24
30
|
def scard(key)
|
25
|
-
with_set_at(key
|
31
|
+
with_set_at(key, &:length)
|
26
32
|
end
|
27
33
|
|
28
34
|
def sdiff(*keys)
|
data/lib/mock_redis/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mock_redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brigade Engineering
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-09-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|