cellect-client 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cellect-client.gemspec +2 -2
- data/lib/cellect/client/connection.rb +5 -5
- data/lib/cellect/version.rb +1 -1
- data/spec/client/connection_spec.rb +2 -2
- data/spec/support/cellect_helper.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd7ccc9dadde4698cc1ece04f0dabfe0473a7637
|
4
|
+
data.tar.gz: d095442be297fe31ae2508fccb21d388c84e8117
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 693737c2f07639a1c923bcaf0d4234df7d695b39cad2f68e9709e777241b7e42fde5b5c3c60adbbc0acba60937ad92860a589d04015ac1b7c73338df7acc1588
|
7
|
+
data.tar.gz: 72905c65b04ebd994af1a7016de1e2d5bde8cbd6efdecfef8b58090b98d6db8d99107f00ed02c153cad5041d113586bdc288401211e8d634c112a39493e23e07
|
data/cellect-client.gemspec
CHANGED
@@ -28,8 +28,8 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency 'rack-test'
|
29
29
|
spec.add_development_dependency 'pry'
|
30
30
|
|
31
|
-
spec.add_runtime_dependency 'celluloid', '0.16.0
|
32
|
-
spec.add_runtime_dependency 'celluloid-io', '0.16.0
|
31
|
+
spec.add_runtime_dependency 'celluloid', '0.16.0'
|
32
|
+
spec.add_runtime_dependency 'celluloid-io', '0.16.0'
|
33
33
|
spec.add_runtime_dependency 'http', '~> 0.6'
|
34
34
|
spec.add_runtime_dependency 'zk', '~> 1.9'
|
35
35
|
spec.add_runtime_dependency 'multi_json', '~> 1.10.1'
|
@@ -16,23 +16,23 @@ module Cellect
|
|
16
16
|
broadcast :delete, "/workflows/#{ id }"
|
17
17
|
end
|
18
18
|
|
19
|
-
def add_subject(id, workflow_id
|
19
|
+
def add_subject(id, workflow_id:, group_id: nil, priority: nil)
|
20
20
|
broadcast :put, "/workflows/#{ workflow_id }/add", querystring(subject_id: id, group_id: group_id, priority: priority)
|
21
21
|
end
|
22
22
|
|
23
|
-
def remove_subject(id, workflow_id
|
23
|
+
def remove_subject(id, workflow_id:, group_id: nil)
|
24
24
|
broadcast :put, "/workflows/#{ workflow_id }/remove", querystring(subject_id: id, group_id: group_id)
|
25
25
|
end
|
26
26
|
|
27
|
-
def load_user(user_id
|
27
|
+
def load_user(user_id:, host:, workflow_id:)
|
28
28
|
send_http host, :post, "/workflows/#{ workflow_id }/users/#{ user_id }/load"
|
29
29
|
end
|
30
30
|
|
31
|
-
def add_seen(subject_id
|
31
|
+
def add_seen(subject_id:, user_id:, host:, workflow_id:)
|
32
32
|
send_http host, :put, "/workflows/#{ workflow_id }/users/#{ user_id }/add_seen", querystring(subject_id: subject_id)
|
33
33
|
end
|
34
34
|
|
35
|
-
def get_subjects(user_id
|
35
|
+
def get_subjects(user_id:, host:, workflow_id:, limit: nil, group_id: nil)
|
36
36
|
response = send_http host, :get, "/workflows/#{ workflow_id }", querystring(user_id: user_id, group_id: group_id, limit: limit)
|
37
37
|
ensure_valid_response response
|
38
38
|
MultiJson.load response.body
|
data/lib/cellect/version.rb
CHANGED
@@ -8,11 +8,11 @@ module Cellect::Client
|
|
8
8
|
allow(Cellect::Client.node_set).to receive(:nodes).and_return 'a' => '1', 'b' => '2'
|
9
9
|
end
|
10
10
|
|
11
|
-
def should_send(action
|
11
|
+
def should_send(action:, url:, to:)
|
12
12
|
expect(HTTP).to receive(:send).with(action, "http://#{ to }/#{ url }", socket_class: Celluloid::IO::TCPSocket).and_return(HTTP::Response.new(200, nil, nil, "{ \"this response\": \"intentionally blank\" }"))
|
13
13
|
end
|
14
14
|
|
15
|
-
def should_broadcast(action
|
15
|
+
def should_broadcast(action:, url:)
|
16
16
|
[1, 2].each{ |i| should_send action: action, url: url, to: i }
|
17
17
|
end
|
18
18
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cellect-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Parrish
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,28 +100,28 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - '='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.16.0
|
103
|
+
version: 0.16.0
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.16.0
|
110
|
+
version: 0.16.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: celluloid-io
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - '='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.16.0
|
117
|
+
version: 0.16.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - '='
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.16.0
|
124
|
+
version: 0.16.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: http
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|