commendo 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f16a2f22f2afbdf32e7242ee821fca56ba8c690
4
- data.tar.gz: c77c52106e8df36b855f41eb2c6bbd0d0f82bbbe
3
+ metadata.gz: e46e056067c3c4af5ab6315d8145b811286a465c
4
+ data.tar.gz: 5392a1bbe9b1dbeb10f10f3a136d01d2a5b6f53d
5
5
  SHA512:
6
- metadata.gz: 86cd12a3d567df7dc14bc77767d4297fca094fa4d0987bd8eb6674103c77455afc383a2933a2fa947e75b2ede3b07dd244379bf1b8ce5530b6d0e662c9830868
7
- data.tar.gz: e327b49f232971ecb94c1e8bbec2e1ebf06673cdc596e2bc1a8722238fbc0316d24d84582d30a39769224288119e764cd473252c73184ee4d1b4fe190b62aea1
6
+ metadata.gz: 38ff1874cd0fea432da1e3cc0303c674bef437c689cb4bf47e7f43d1072aaf6569dbc53727fdfffd9e7479f18912a86e49fd1c6f9350ac09c5a5d2acfa53aa7d
7
+ data.tar.gz: a1c512f261e1b2b1cb704a5b6ba41b1d172b9191b17c04a031e54366e664f1485ecf1e71c2a6993b7cfa49b35ffd383c571e464703fb1eccdcfb088bad3c2c19
@@ -1,3 +1,6 @@
1
+ # 0.0.7 / 2014-04-01
2
+ * [BUGFIX] Cope with sets of empty tags being set in TagSet
3
+
1
4
  # 0.0.6 / 2014-04-01
2
5
  * [FEATURE] Weighted groups now accept array of resources and return combined similarity scores
3
6
 
@@ -13,7 +13,7 @@ module Commendo
13
13
  end
14
14
 
15
15
  def add(resource, *tags)
16
- redis.sadd(resource_key(resource), tags)
16
+ redis.sadd(resource_key(resource), tags) unless tags.empty?
17
17
  end
18
18
 
19
19
  def set(resource, *tags)
@@ -1,3 +1,3 @@
1
1
  module Commendo
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -31,6 +31,19 @@ module Commendo
31
31
  assert_equal ['qip', 'qux'], ts.get(1)
32
32
  end
33
33
 
34
+ def test_sets_tags_when_empty
35
+ redis = Redis.new(db: 15)
36
+ redis.flushdb
37
+ ts = TagSet.new(redis, 'TagSetTest')
38
+ ts.set(1, 'foo', 'bar', 'baz')
39
+ ts.set(2, 'qux', 'qip')
40
+ assert_equal ['bar', 'baz', 'foo'], ts.get(1)
41
+ assert_equal ['qip', 'qux'], ts.get(2)
42
+ ts.set(1, *[])
43
+ assert_equal [], ts.get(1)
44
+ assert_equal ['qip', 'qux'], ts.get(2)
45
+ end
46
+
34
47
  def test_deletes_tags_for_resource
35
48
  redis = Redis.new(db: 15)
36
49
  redis.flushdb
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commendo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Styles