commendo 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/commendo/tag_set.rb +1 -1
- data/lib/commendo/version.rb +1 -1
- data/test/tag_set_test.rb +24 -24
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4346b4b053e4b910efdd819476fae6e18db6b45
|
4
|
+
data.tar.gz: faeee86f961b6e576888accd047b6adfe4dcd54e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad4356a6a14f35713ab2eee837b69e78e6ed7995c4131968ce8356df45630fc290817a670a2aa29135f02ff9a9a18928437b3a5263c551065912c5689ebb280d
|
7
|
+
data.tar.gz: b4db90f586213d1174810081d1e18335572f97c51ca351ffd11f3ea395562b9674781375e2c62d8cc16c0926932dc8479a273e556f38b669acf4f2866250cf9a
|
data/CHANGELOG.md
CHANGED
data/lib/commendo/tag_set.rb
CHANGED
data/lib/commendo/version.rb
CHANGED
data/test/tag_set_test.rb
CHANGED
@@ -18,9 +18,9 @@ module Commendo
|
|
18
18
|
def test_adds_tags_for_resource
|
19
19
|
assert_equal [], @ts.get(1)
|
20
20
|
@ts.add(1, 'foo', 'bar', 'baz')
|
21
|
-
assert_equal
|
21
|
+
assert_equal %w(bar baz foo), @ts.get(1)
|
22
22
|
@ts.add(1, 'qux', 'qip')
|
23
|
-
assert_equal
|
23
|
+
assert_equal %w(bar baz foo qip qux), @ts.get(1)
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_empty?
|
@@ -35,36 +35,36 @@ module Commendo
|
|
35
35
|
def test_sets_tags_for_resource
|
36
36
|
assert_equal [], @ts.get(1)
|
37
37
|
@ts.set(1, 'foo', 'bar', 'baz')
|
38
|
-
assert_equal
|
38
|
+
assert_equal %w(bar baz foo), @ts.get(1)
|
39
39
|
@ts.set(1, 'qux', 'qip')
|
40
|
-
assert_equal
|
40
|
+
assert_equal %w(qip qux), @ts.get(1)
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_sets_tags_when_empty
|
44
44
|
@ts.set(1, 'foo', 'bar', 'baz')
|
45
45
|
@ts.set(2, 'qux', 'qip')
|
46
|
-
assert_equal
|
47
|
-
assert_equal
|
46
|
+
assert_equal %w(bar baz foo), @ts.get(1)
|
47
|
+
assert_equal %w(qip qux), @ts.get(2)
|
48
48
|
@ts.set(1, *[])
|
49
49
|
assert_equal [], @ts.get(1)
|
50
|
-
assert_equal
|
50
|
+
assert_equal %w(qip qux), @ts.get(2)
|
51
51
|
end
|
52
52
|
|
53
53
|
def test_deletes_all_tags_for_resource
|
54
54
|
@ts.set(1, 'foo', 'bar', 'baz')
|
55
55
|
@ts.set(2, 'qux', 'qip')
|
56
|
-
assert_equal
|
57
|
-
assert_equal
|
56
|
+
assert_equal %w(bar baz foo), @ts.get(1)
|
57
|
+
assert_equal %w(qip qux), @ts.get(2)
|
58
58
|
@ts.delete(1)
|
59
59
|
assert_equal [], @ts.get(1)
|
60
|
-
assert_equal
|
60
|
+
assert_equal %w(qip qux), @ts.get(2)
|
61
61
|
end
|
62
62
|
|
63
63
|
def test_deletes_given_tags_for_resource
|
64
64
|
assert_equal [], @ts.get(1)
|
65
65
|
@ts.set(1, 'foo', 'bar', 'baz', 'qux', 'qip')
|
66
66
|
@ts.delete(1, 'qux', 'qip')
|
67
|
-
assert_equal
|
67
|
+
assert_equal %w(bar baz foo), @ts.get(1)
|
68
68
|
end
|
69
69
|
|
70
70
|
def test_matches_tags
|
@@ -72,15 +72,15 @@ module Commendo
|
|
72
72
|
@ts.set(2, 'qux', 'qip')
|
73
73
|
|
74
74
|
assert @ts.matches(1, ['foo'])
|
75
|
-
assert @ts.matches(1,
|
76
|
-
assert @ts.matches(1,
|
75
|
+
assert @ts.matches(1, %w(bar baz))
|
76
|
+
assert @ts.matches(1, %w(bar baz foo))
|
77
77
|
refute @ts.matches(1, ['qux'])
|
78
78
|
refute @ts.matches(1, ['qip'])
|
79
79
|
|
80
80
|
refute @ts.matches(2, ['foo'])
|
81
|
-
refute @ts.matches(2,
|
82
|
-
refute @ts.matches(2,
|
83
|
-
assert @ts.matches(2,
|
81
|
+
refute @ts.matches(2, %w(bar baz))
|
82
|
+
refute @ts.matches(2, %w(bar baz foo))
|
83
|
+
assert @ts.matches(2, %w(qux qip))
|
84
84
|
assert @ts.matches(2, ['qux'])
|
85
85
|
assert @ts.matches(2, ['qip'])
|
86
86
|
end
|
@@ -91,16 +91,16 @@ module Commendo
|
|
91
91
|
|
92
92
|
refute @ts.matches(1, nil, ['foo'])
|
93
93
|
refute @ts.matches(1, [], ['foo'])
|
94
|
-
refute @ts.matches(1, [],
|
95
|
-
refute @ts.matches(1, [],
|
94
|
+
refute @ts.matches(1, [], %w(bar baz))
|
95
|
+
refute @ts.matches(1, [], %w(bar baz foo))
|
96
96
|
assert @ts.matches(1, [], ['qux'])
|
97
97
|
assert @ts.matches(1, [], ['qip'])
|
98
98
|
|
99
99
|
assert @ts.matches(2, nil, ['foo'])
|
100
100
|
assert @ts.matches(2, [], ['foo'])
|
101
|
-
assert @ts.matches(2, [],
|
102
|
-
assert @ts.matches(2, [],
|
103
|
-
refute @ts.matches(2, [],
|
101
|
+
assert @ts.matches(2, [], %w(bar baz))
|
102
|
+
assert @ts.matches(2, [], %w(bar baz foo))
|
103
|
+
refute @ts.matches(2, [], %w(qux qip))
|
104
104
|
refute @ts.matches(2, [], ['qux'])
|
105
105
|
refute @ts.matches(2, [], ['qip'])
|
106
106
|
end
|
@@ -117,9 +117,9 @@ module Commendo
|
|
117
117
|
assert @ts.matches(1, ['foo'], ['qux'])
|
118
118
|
|
119
119
|
assert @ts.matches(2, ['qip'], ['foo'])
|
120
|
-
assert @ts.matches(2, ['qux'],
|
121
|
-
assert @ts.matches(2, ['qip'],
|
122
|
-
refute @ts.matches(2, ['qip'],
|
120
|
+
assert @ts.matches(2, ['qux'], %w(bar baz))
|
121
|
+
assert @ts.matches(2, ['qip'], %w(bar baz foo))
|
122
|
+
refute @ts.matches(2, ['qip'], %w(qux qip))
|
123
123
|
refute @ts.matches(2, ['qip'], ['qux'])
|
124
124
|
refute @ts.matches(2, ['qux'], ['qip'])
|
125
125
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commendo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Styles
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
version: '0'
|
165
165
|
requirements: []
|
166
166
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.
|
167
|
+
rubygems_version: 2.5.0
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
170
|
summary: A Jaccard-similarity recommender using Redis sets
|