cellect-server 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -2
- data/lib/cellect/server/grouped_workflow.rb +10 -2
- data/lib/cellect/version.rb +1 -1
- data/spec/cellect/server/grouped_workflow_spec.rb +6 -0
- 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: 3f415bb15f193271a60d1b90e562844f4221e1bf
|
4
|
+
data.tar.gz: 84b53909f3af473976825fe4ed9104f19f1ccb5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 611b8c5b12e11f55cfc640a01c6372cf4d448e35d96733c83494333369135304aafebd13979f74b1cce116c68f9dac0115ed242a6e328d9b0c672c7d453f7fd5
|
7
|
+
data.tar.gz: a66dbc7c5a19b497915521fa9d745f3c45418b3e044aa51098d369c499583d5b2e496613b27dfe30910c23e8071dc6d44f8f670e9762e9d0fe2fce81ef973ea8
|
data/.travis.yml
CHANGED
@@ -2,9 +2,8 @@ language: ruby
|
|
2
2
|
cache: bundler
|
3
3
|
|
4
4
|
before_install:
|
5
|
-
- sudo add-apt-repository ppa:boost-latest/ppa -y
|
6
5
|
- sudo apt-get update -q
|
7
|
-
- sudo apt-get install -y autoconf automake
|
6
|
+
- sudo apt-get install -y autoconf automake libboost1.55-dev libffi-dev
|
8
7
|
- gem update bundler
|
9
8
|
|
10
9
|
rvm:
|
@@ -12,9 +12,17 @@ module Cellect
|
|
12
12
|
subjects
|
13
13
|
end
|
14
14
|
|
15
|
-
# Returns a group by id
|
15
|
+
# Returns a group by id
|
16
|
+
# if the group_id is supplied it will select or setup this group
|
17
|
+
# when no group_id is supplied, it attempts to select a random group
|
18
|
+
# finally if no loaded groupes it falls back to creating a new empty group
|
16
19
|
def group(group_id = nil)
|
17
|
-
|
20
|
+
group = if group_id
|
21
|
+
fetch_or_setup_group(group_id)
|
22
|
+
else
|
23
|
+
subjects.values.sample
|
24
|
+
end
|
25
|
+
group || fetch_or_setup_group(group_id)
|
18
26
|
end
|
19
27
|
|
20
28
|
# Get unseen subjects from a group for a user
|
data/lib/cellect/version.rb
CHANGED
@@ -94,6 +94,12 @@ module Cellect::Server
|
|
94
94
|
expect(workflow.group(1)).to receive(:subtract).with user.seen, 3
|
95
95
|
workflow.sample user_id: 123, group_id: 1, limit: 3
|
96
96
|
end
|
97
|
+
|
98
|
+
it 'should should select from an empty set if the group is not loaded' do
|
99
|
+
workflow.groups[0] = set_klass.new
|
100
|
+
expect(workflow.group(0)).not_to receive(:sample)
|
101
|
+
workflow.sample group_id: 1, limit: 3
|
102
|
+
end
|
97
103
|
end
|
98
104
|
|
99
105
|
describe "#add" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cellect-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Parrish
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -326,7 +326,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
326
326
|
version: '0'
|
327
327
|
requirements: []
|
328
328
|
rubyforge_project:
|
329
|
-
rubygems_version: 2.
|
329
|
+
rubygems_version: 2.6.14
|
330
330
|
signing_key:
|
331
331
|
specification_version: 4
|
332
332
|
summary: ''
|