real_time_rails 0.0.6 → 0.0.73
Sign up to get free protection for your applications and to get access to all the features.
data/lib/real_time_rails/ar.rb
CHANGED
@@ -12,11 +12,11 @@ module RealTimeRails
|
|
12
12
|
|
13
13
|
def send_rtr_update
|
14
14
|
# TODO figure out why i have to make 2 connections to send 2 messages instead of just one connection.
|
15
|
-
mySock = TCPSocket::new(
|
15
|
+
mySock = TCPSocket::new("#{RealTimeRails.config["update_host"]}", "#{RealTimeRails.config["update_port"]}")
|
16
16
|
mySock.puts("{\"command\":\"update1\",\"model\":\"#{self.class.name}\",\"id\":\"#{self.id}\"}")
|
17
17
|
mySock.close
|
18
18
|
|
19
|
-
mySock = TCPSocket::new(
|
19
|
+
mySock = TCPSocket::new("#{RealTimeRails.config["update_host"]}", "#{RealTimeRails.config["update_port"]}")
|
20
20
|
mySock.puts("{\"command\":\"updateall\",\"model\":\"#{self.class.name}\"}")
|
21
21
|
mySock.close
|
22
22
|
end
|
@@ -24,11 +24,11 @@ module RealTimeRails
|
|
24
24
|
|
25
25
|
def send_rtr_destroy
|
26
26
|
# TODO figure out why i have to make 2 connections to send 2 messages instead of just one connection.
|
27
|
-
mySock = TCPSocket::new(
|
27
|
+
mySock = TCPSocket::new("#{RealTimeRails.config["update_host"]}", "#{RealTimeRails.config["update_port"]}")
|
28
28
|
mySock.puts("{\"command\":\"delete1\",\"model\":\"#{self.class.name}\",\"id\":\"#{self.id}\"}")
|
29
29
|
mySock.close
|
30
30
|
|
31
|
-
mySock = TCPSocket::new(
|
31
|
+
mySock = TCPSocket::new("#{RealTimeRails.config["update_host"]}", "#{RealTimeRails.config["update_port"]}")
|
32
32
|
mySock.puts("{\"command\":\"updateall\",\"model\":\"#{self.class.name}\"}")
|
33
33
|
mySock.close
|
34
34
|
end
|
@@ -85,7 +85,7 @@ module RealTimeRails
|
|
85
85
|
def js_start_websocket
|
86
86
|
"
|
87
87
|
var Socket = \"MozWebSocket\" in window ? MozWebSocket : WebSocket;
|
88
|
-
ws_#{@id} = new Socket('ws
|
88
|
+
ws_#{@id} = new Socket('ws://#{RealTimeRails.config["websocket_host"]}:#{RealTimeRails.config["websocket_port"]}');
|
89
89
|
ws_#{@id}.onmessage = function(evt) {
|
90
90
|
if(evt.data=='update'){real_time_update_#{@id}()};
|
91
91
|
if(evt.data=='delete'){real_time_delete_#{@id}()};
|
data/lib/real_time_rails.rb
CHANGED
@@ -3,6 +3,7 @@ require 'real_time_rails/real_time_helper.rb'
|
|
3
3
|
require 'real_time_rails/render_real_time_controller.rb'
|
4
4
|
require 'real_time_rails/ar.rb'
|
5
5
|
require 'real_time_rails/rt_helper.rb'
|
6
|
+
require 'real_time_rails/config.rb'
|
6
7
|
|
7
8
|
if defined?(ActionView::Base)
|
8
9
|
ActionView::Base.send :include, RealTimeRails::RealTimeHelper
|
data/realtimerails.yml
ADDED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: real_time_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.73
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Kelly Mahan
|
@@ -51,11 +51,13 @@ files:
|
|
51
51
|
- bin/real_time_rails
|
52
52
|
- lib/real_time_rails.rb
|
53
53
|
- lib/real_time_rails/ar.rb
|
54
|
+
- lib/real_time_rails/config.rb
|
54
55
|
- lib/real_time_rails/real_time_helper.rb
|
55
56
|
- lib/real_time_rails/render_real_time_controller.rb
|
56
57
|
- lib/real_time_rails/rt_helper.rb
|
57
58
|
- lib/real_time_rails/version.rb
|
58
59
|
- real_time_rails.gemspec
|
60
|
+
- realtimerails.yml
|
59
61
|
has_rdoc: true
|
60
62
|
homepage: http://github.com/kellymahan/RealTimeRails
|
61
63
|
licenses: []
|