File tree 5 files changed +58
-1
lines changed
5 files changed +58
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ gem 'sqlite3'
9
9
gem 'devise'
10
10
gem 'devise_bushido_authenticatable'
11
11
gem 'bushido'
12
+ gem 'thin'
13
+ gem 'faye'
12
14
13
15
# Gems used only for assets and not required
14
16
# in production environments by default.
Original file line number Diff line number Diff line change 47
47
activesupport (3.2.2 )
48
48
i18n (~> 0.6 )
49
49
multi_json (~> 1.0 )
50
+ addressable (2.2.7 )
50
51
arel (3.0.2 )
51
52
bcrypt-ruby (3.0.1 )
52
53
builder (3.0.0 )
71
72
coffee-script-source
72
73
execjs
73
74
coffee-script-source (1.2.0 )
75
+ cookiejar (0.3.0 )
76
+ daemons (1.1.8 )
74
77
devise (1.5.3 )
75
78
bcrypt-ruby (~> 3.0 )
76
79
orm_adapter (~> 0.0.3 )
79
82
devise (= 1.5.3 )
80
83
rubycas-client (>= 2.2.1 )
81
84
diff-lcs (1.1.3 )
85
+ em-http-request (1.0.1 )
86
+ addressable (>= 2.2.3 )
87
+ cookiejar
88
+ em-socksify
89
+ eventmachine (>= 1.0.0.beta.4 )
90
+ http_parser.rb (>= 0.5.3 )
91
+ em-socksify (0.1.0 )
92
+ eventmachine
82
93
erubis (2.7.0 )
94
+ eventmachine (1.0.0.beta.4 )
83
95
execjs (1.3.0 )
84
96
multi_json (~> 1.0 )
85
97
factory_girl (2.6.1 )
86
98
activesupport (>= 2.3.9 )
87
99
factory_girl_rails (1.7.0 )
88
100
factory_girl (~> 2.6.0 )
89
101
railties (>= 3.0.0 )
102
+ faye (0.8.0 )
103
+ cookiejar (>= 0.3.0 )
104
+ em-http-request (>= 0.3.0 )
105
+ eventmachine (>= 0.12.0 )
106
+ faye-websocket (>= 0.4.0 )
107
+ rack (>= 1.0.0 )
108
+ yajl-ruby (>= 1.0.0 )
109
+ faye-websocket (0.4.1 )
110
+ eventmachine (>= 0.12.0 )
90
111
ffi (1.0.11 )
91
112
highline (1.6.11 )
92
113
hike (1.2.1 )
114
+ http_parser.rb (0.5.3 )
93
115
i18n (0.6.0 )
94
116
jasmine-core (1.2.0.rc1 )
95
117
journey (1.0.3 )
168
190
sqlite3 (1.3.5 )
169
191
therubyracer (0.9.10 )
170
192
libv8 (~> 3.3.10 )
193
+ thin (1.3.1 )
194
+ daemons (>= 1.0.9 )
195
+ eventmachine (>= 0.12.6 )
196
+ rack (>= 1.0.0 )
171
197
thor (0.14.6 )
172
198
tilt (1.3.3 )
173
199
treetop (1.4.10 )
181
207
rack (>= 1.0 )
182
208
xpath (0.1.4 )
183
209
nokogiri (~> 1.3 )
210
+ yajl-ruby (1.1.0 )
184
211
185
212
PLATFORMS
186
213
ruby
@@ -193,6 +220,7 @@ DEPENDENCIES
193
220
devise_bushido_authenticatable
194
221
ember-rails !
195
222
factory_girl_rails
223
+ faye
196
224
jasmine !
197
225
jquery-rails
198
226
rails (= 3.2.2 )
@@ -201,4 +229,5 @@ DEPENDENCIES
201
229
shoulda-matchers
202
230
sqlite3
203
231
therubyracer
232
+ thin
204
233
uglifier (>= 1.0.3 )
Original file line number Diff line number Diff line change 4
4
< title > Kandan</ title >
5
5
<%= stylesheet_link_tag "application" , :media => "all" %>
6
6
<%= javascript_include_tag "application" %>
7
+ <%= javascript_include_tag "#{ ENV [ 'FAYEJS' ] } .js" %>
7
8
<%= csrf_meta_tags %>
8
9
</ head >
9
10
< body >
Original file line number Diff line number Diff line change 1
1
# This file is used by Rack-based servers to start the application.
2
2
3
3
require ::File . expand_path ( '../config/environment' , __FILE__ )
4
- run Kandan ::Application
4
+ require 'faye'
5
+
6
+ faye_server = Faye ::RackAdapter . new ( :mount => "/faye" , :timeout => 5 )
7
+
8
+ # TODO send pull request to faye to get this fixed
9
+ # by adding a rack_prefix option
10
+ # which should then make the faye server object available
11
+ # via the get_client() method on the server
12
+
13
+ FAYE_CLIENT = faye_server . get_client
14
+
15
+ faye_server . bind ( :subscribe ) do |client_id |
16
+ puts "SUBSCRIBE #{ client_id } "
17
+ end
18
+
19
+ faye_server . bind ( :disconnect ) do |client_id |
20
+ puts "DISCONNECT #{ client_id } "
21
+ end
22
+
23
+ run Rack ::URLMap . new ( {
24
+ "/remote" => faye_server ,
25
+ "/" => Kandan ::Application
26
+ } )
27
+
28
+ # run Kandan::Application
Original file line number Diff line number Diff line change
1
+ ENV [ 'FAYEJS' ] ||= "/remote/faye"
You can’t perform that action at this time.
0 commit comments