cellect-client 0.1.1 → 0.1.2.pre.jruby

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 129fe6dfd81a2dc3803eff22382bf4b4459f9dfa
4
- data.tar.gz: 549e03b1ef6b3b13547572e6ddb954428ac6e5d7
3
+ metadata.gz: eea093d17be3eebba1d2b29b3a5c9d9ff33e038e
4
+ data.tar.gz: c87b7b0da90ecd9a5accffdd2e00d1d72938fd5e
5
5
  SHA512:
6
- metadata.gz: ed7f7ec09ce3ad76e90ec80b6f4ed0e5faedb88586fb25d991a0135f7270944fad5d93eeda6695c1e8559666e7620d8f178cac834c275d3de635925d75a932f2
7
- data.tar.gz: bc3a249560c1ed274e85540a7bd228d4b9f52593aac0630a629b0d8b26833f5ae41c66232798740cb5e4b08cdb2d5a3b0f1025dfa97e852959a12d1e5ed5abb5
6
+ metadata.gz: 9e9e50dc964123b980addcb75466ec540991f20088ea17dc79ebcbab6ee6db871e6fe6c5bf3351e3eb4075655707df439f6eeab6ac9897d1ab03eca1724d180b
7
+ data.tar.gz: 0057919d2051be938038745d26e6e5503c65aeca1b57db6c341e5416101398edeb8f516d498323a16c44b3a0ec2e29277789419eef578b0179aa3c2c68ea6eac
@@ -16,23 +16,23 @@ module Cellect
16
16
  broadcast :delete, "/workflows/#{ id }"
17
17
  end
18
18
 
19
- def add_subject(id, workflow_id:, group_id: nil, priority: nil)
19
+ def add_subject(id, workflow_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:, group_id: nil)
23
+ def remove_subject(id, workflow_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:, host:, workflow_id:)
27
+ def load_user(user_id: user_id, host: host, workflow_id: 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:, user_id:, host:, workflow_id:)
31
+ def add_seen(subject_id: subject_id, user_id: user_id, host: host, workflow_id: 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:, host:, workflow_id:, limit: nil, group_id: nil)
35
+ def get_subjects(user_id: user_id, host: host, workflow_id: workflow_id, limit: limit, group_id: group_id)
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
@@ -22,6 +22,10 @@ module Cellect
22
22
  node_set.nodes.values.sample
23
23
  end
24
24
 
25
+ def self.host_exists?(ip)
26
+ node_set.nodes.values.include? ip
27
+ end
28
+
25
29
  if defined?(::Rails)
26
30
  require 'cellect/client/railtie'
27
31
  else
@@ -1,3 +1,3 @@
1
1
  module Cellect
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2-jruby'
3
3
  end
@@ -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:, url:, to:)
11
+ def should_send(action: action, url: url, to: 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:, url:)
15
+ def should_broadcast(action: action, url: 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.1.1
4
+ version: 0.1.2.pre.jruby
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Parrish
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-16 00:00:00.000000000 Z
11
+ date: 2015-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -226,9 +226,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
226
226
  version: '0'
227
227
  required_rubygems_version: !ruby/object:Gem::Requirement
228
228
  requirements:
229
- - - ">="
229
+ - - ">"
230
230
  - !ruby/object:Gem::Version
231
- version: '0'
231
+ version: 1.3.1
232
232
  requirements: []
233
233
  rubyforge_project:
234
234
  rubygems_version: 2.4.2