real_time_rails 0.0.3 → 0.0.4
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.
data/README.md
CHANGED
@@ -37,3 +37,9 @@ then in your view that you want a real time update. At this point partial paths
|
|
37
37
|
`render_real_time partial: '/test/test', locals: {chats: @chats}`
|
38
38
|
|
39
39
|
I still have a lot of debugging stuff in the view and javascript wrapper so ignore those for now.
|
40
|
+
|
41
|
+
|
42
|
+
History
|
43
|
+
----------
|
44
|
+
|
45
|
+
0.0.4 Adding RealTimeRails server executable.
|
@@ -1,3 +1,4 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
1
2
|
# to start the server just run "ruby websocket_server.rb"
|
2
3
|
|
3
4
|
require 'em-websocket'
|
@@ -5,11 +6,11 @@ require 'json'
|
|
5
6
|
require 'yaml'
|
6
7
|
|
7
8
|
class RTChannel < EM::Channel
|
8
|
-
|
9
|
+
|
9
10
|
attr_accessor :id,
|
10
11
|
:models,
|
11
12
|
:subscribers
|
12
|
-
|
13
|
+
|
13
14
|
def self.create(id, models)
|
14
15
|
sid = self.new
|
15
16
|
sid.id=id
|
@@ -17,16 +18,16 @@ class RTChannel < EM::Channel
|
|
17
18
|
sid.subscribers=[]
|
18
19
|
return sid
|
19
20
|
end
|
20
|
-
|
21
|
+
|
21
22
|
def join(subscriber)
|
22
23
|
@subscribers << subscriber
|
23
24
|
end
|
24
|
-
|
25
|
+
|
25
26
|
def leave(subscriber, subscription_id)
|
26
27
|
@subscribers.delete(subscriber)
|
27
28
|
self.unsubscribe(subscription_id)
|
28
29
|
end
|
29
|
-
|
30
|
+
|
30
31
|
end
|
31
32
|
|
32
33
|
EventMachine.run {
|
data/real_time_rails.gemspec
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path('../lib/', __FILE__)
|
3
|
+
$:.unshift lib unless $:.include?(lib)
|
4
|
+
|
5
|
+
require 'real_time_rails/version'
|
6
|
+
|
1
7
|
Gem::Specification.new do |s|
|
2
8
|
s.name = "real_time_rails"
|
3
|
-
s.version =
|
9
|
+
s.version = RealTimeRails::VERSION
|
4
10
|
s.platform = Gem::Platform::RUBY
|
5
11
|
s.authors = ["Kelly Mahan"]
|
6
12
|
s.email = 'kmahan@kmahan.com'
|
@@ -14,7 +20,7 @@ Gem::Specification.new do |s|
|
|
14
20
|
|
15
21
|
s.files = `git ls-files`.split("\n")
|
16
22
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
-
s.executables =
|
23
|
+
s.executables = ["real_time_rails"]
|
18
24
|
s.require_path = 'lib'
|
19
25
|
|
20
26
|
|
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.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Kelly Mahan
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-07-27 00:00:00 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -37,8 +37,8 @@ dependencies:
|
|
37
37
|
version_requirements: *id002
|
38
38
|
description: A gem to enable seamless websocket integration with rails.
|
39
39
|
email: kmahan@kmahan.com
|
40
|
-
executables:
|
41
|
-
|
40
|
+
executables:
|
41
|
+
- real_time_rails
|
42
42
|
extensions: []
|
43
43
|
|
44
44
|
extra_rdoc_files: []
|
@@ -48,13 +48,13 @@ files:
|
|
48
48
|
- Gemfile
|
49
49
|
- README.md
|
50
50
|
- Rakefile
|
51
|
+
- bin/real_time_rails
|
51
52
|
- lib/real_time_rails.rb
|
52
53
|
- lib/real_time_rails/ar.rb
|
53
54
|
- lib/real_time_rails/real_time_helper.rb
|
54
55
|
- lib/real_time_rails/render_real_time_controller.rb
|
55
56
|
- lib/real_time_rails/rt_helper.rb
|
56
57
|
- lib/real_time_rails/version.rb
|
57
|
-
- lib/websocket_server/websocket_server.rb
|
58
58
|
- real_time_rails.gemspec
|
59
59
|
has_rdoc: true
|
60
60
|
homepage: http://github.com/kellymahan/RealTimeRails
|