realtime 0.0.1 → 0.0.4

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: 9761455dd3d83567ee9fb1522ac53dbd6d6434cd
4
- data.tar.gz: efe0161d15e2ea8662bedddb1121e55f4da43fbe
3
+ metadata.gz: ddeb54e047fe444ad96f0ca4307e47878bbf69b9
4
+ data.tar.gz: a14d656cdbd3080033ae3b5f7a0f8f5c0c6f156b
5
5
  SHA512:
6
- metadata.gz: f3ec2ec5304734b1810efa90075b5debcaaa9c9c1a5c2c73281287303a9fdc672e743715709d2b7959a9bebe95d14ced65db54260d53742eaea52546f8df47a0
7
- data.tar.gz: 05f0bf622d25c0289ad1d82c2d9672205e5388f4b8639291992739ad0818881e740cedc8be90926ff4458aef3cfb694ef6f38cb53cb6b3662c37759981cbb660
6
+ metadata.gz: 58d72dfb869afb8f373c029bdf5c675e33fa924d02695bdc32eba48045e53e5bf0aebefd25d916530ca685bad06c7d777c13264d17d62126207c10d913034a8d
7
+ data.tar.gz: dfc0462a33d0138649da1e12014861d78f6e99236c1687acab31ac73d349ec9adf16282585ccc76f64ed7aeb0841b58d2acc7709d8f51b5f147c3bc795693f5d
@@ -13,9 +13,7 @@
13
13
  if (typeof io != 'undefined' && io != null) {
14
14
  window.realtime.token = '<%= realtime_token %>';
15
15
  window.realtime.userId = '<%= realtime_user_id %>';
16
- document.cookie = "_rtUserId=" + '<%= realtime_user_id %>' + ";domain=." + '<%= realtime_domain %>' + ";path=/"
17
- document.cookie = "_rtToken=" + '<%= realtime_token %>' + ";domain=." + '<%= realtime_domain %>' + ";path=/"
18
- window.realtime.socketIo = io.connect('<%= realtime_server_url %>');
16
+ window.realtime.socketIo = io.connect('<%= realtime_server_url %>/?_rtUserId=<%= @realtime_user_id %>&_rtToken=<%= @realtime_token %>');
19
17
  }
20
18
 
21
19
  if (window.realtime.socketIo) {
@@ -13,8 +13,7 @@ module Realtime
13
13
  end
14
14
 
15
15
  def do_realtime_token
16
- cookies["_rtToken"] = Digest::MD5.hexdigest("#{session[:session_id]}:#{realtime_user_id}")
17
- @realtime_token = cookies["_rtToken"]
16
+ @realtime_token = Digest::MD5.hexdigest("#{session[:session_id]}:#{realtime_user_id}")
18
17
  return @realtime_token
19
18
  end
20
19
 
@@ -39,6 +38,8 @@ module Realtime
39
38
  session_data = {
40
39
  "user_id" => realtime_user_id,
41
40
  }
41
+
42
+ # todo: merge additional session data passed in
42
43
 
43
44
  stored_session_data = JSON.generate(session_data)
44
45
 
@@ -50,6 +51,8 @@ module Realtime
50
51
 
51
52
  # expire this realtime session after one day.
52
53
  RedisWrapper.redis.expire("rtSession-" + realtime_user_id.to_s, 86400)
54
+
55
+
53
56
  end
54
57
 
55
58
  end
@@ -1,3 +1,3 @@
1
1
  module Realtime
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: realtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Atlas