colossus 0.4.0 → 0.5.0

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: efbea8ccf67c6c353bc7feef23a99bac4f69a11b
4
- data.tar.gz: c9993ff631b8b966462089779756dd7c33e7d351
3
+ metadata.gz: 52b3f1a89293f737131d8e42ce08efd70c017ed3
4
+ data.tar.gz: 5a518a4a5b55b4bfa1d767fd61856eb76569e846
5
5
  SHA512:
6
- metadata.gz: 2ccf1110ca084c3db3c579cbb2985e29aeb78b5e68625533a074352a30e27029c360a6c6b608594fc89e9267e50573884cdf1884f22301d8f386da55804e9279
7
- data.tar.gz: 1e623db0f64d163eb97d89605e064b3af8dbdde239b07e14ffa7e3f2a019b96e75e774712529e2cdb4fbd11f8c95021859dc78be7173fd47126e0c887ec5372c
6
+ metadata.gz: 3607a0fd65690fd85e26dc17d14b6ec048e0e0fa58f67d728d1c1ac33e3fa7076f41ff90a1348437e0383cccb2ca671263f76d0fb27dbfa2171ddebade938646
7
+ data.tar.gz: 46f6905bf49524fbd87c7680e7db010a28e84fd52b1208a1745f30bd2c2646f98ccdfd688435c3f8df56f498880c182953f062de3f84afb8d468252826f790a7
@@ -1,4 +1,4 @@
1
1
  # The Version
2
2
  class Colossus
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
4
4
  end
@@ -14,7 +14,7 @@ class Colossus
14
14
  user_ids = Array(optional_user_ids) if optional_user_ids
15
15
  unique_token = generate_unique_token
16
16
  EM.synchrony do
17
- EM::Synchrony.add_timer(time_out) { raise "Presence request timed out" }
17
+ EM::Synchrony.add_timer(time_out) { raise 'Presence request timed out' }
18
18
  EM::Synchrony.sync(faye_client.subscribe("/presences/response/#{unique_token}") { |message| return message['statuses'] })
19
19
  EM::Synchrony.sync(faye_client.publish("/presences/request/#{unique_token}", user_ids))
20
20
  end
@@ -24,7 +24,7 @@ class Colossus
24
24
  user_ids = Array(optional_user_ids) if optional_user_ids
25
25
  # Custom Content-Type to indicate to the server
26
26
  # this is a simple http request
27
- conn = Faraday.new(url, headers: {'Content-Type' => 'application/vnd.http.json'}) do |conf|
27
+ conn = Faraday.new(url, headers: {'Content-Type' => 'application/vnd.http.json'}) do |conf|
28
28
  conf.adapter Faraday.default_adapter
29
29
  conf.response :raise_error
30
30
  end
@@ -40,6 +40,7 @@ class Colossus
40
40
  def push_message(user_ids, message)
41
41
  user_ids = Array(user_ids)
42
42
  EM.synchrony do
43
+ EM::Synchrony.add_timer(time_out) { raise 'Push message timed out' }
43
44
  user_ids.each do |user_id|
44
45
  EM::Synchrony.sync(faye_client.publish("/users/#{user_id}", message))
45
46
  end
@@ -50,7 +51,7 @@ class Colossus
50
51
  private
51
52
 
52
53
  def faye_client
53
- faye_client = ::Faye::Client.new(url)
54
+ faye_client = ::Faye::Client.new(url)
54
55
  faye_client.add_extension(FayeExtension.new(writer_token))
55
56
  faye_client
56
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colossus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - antoinelyset