h2g_ajaxchat 0.2.0 → 0.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f85b352a4b0b8983a25914a435145f0721e000e16b40c7bdfc815f8160ac8e81
4
- data.tar.gz: 43e914e361c7c26c8ab9c9ecbed796c98adc8dffb9d835ede597afb9a0eaf2fa
3
+ metadata.gz: c4a2cf7b50b820656771890f8cb122798afc244978db1f66b2515adab699494d
4
+ data.tar.gz: 337be4f988d85f925abd286df7a27be25e67493fa1346e7c7d71bbf3f7abf883
5
5
  SHA512:
6
- metadata.gz: 90224175128a2631c1b7f37c159e6afb1302258ecc79842b6601ec3f2e5b4a41f903023b4709474f4cf43b65e75c67f4ad846e6fdd7fc0e7da61e2cadb73f12d
7
- data.tar.gz: 07af2f963551f55c683797c3ba59eefde49a3220ce28c9690a44b475e29242e6f32bca392fae02a3b113044f98b0892cb8ed02d678eb3070b0372fb42f6f5778
6
+ metadata.gz: 73b8f7645dbca15f7f737f034812a157aa8424281a56a244e8848962509bd380802dc778db3a9d68a1ba0db951efeb27e3d54446e0c5960a86ce6fd93cc145f9
7
+ data.tar.gz: bb44bb414122e1eaa926cb5e8e9c0e90c1d419942470f460958adf84545e2743e14601c81cc4a6a8596d6b4586b0bb09898c4dc786da6d633a3db70c5e9afc66
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -5,12 +5,13 @@
5
5
  # description: This gem makes it easier to build an AJAX chat project.
6
6
  # Designed for Rack-rscript.
7
7
 
8
+ require 'erb'
8
9
  require 'simple-config'
9
10
 
10
11
  # This file includes the following classes
11
12
  #
12
13
  # * DummyRequest (used for testing)
13
- # * ChatCore
14
+ # * ChatCore (chat engine)
14
15
  # * DummyRws (used for testing)
15
16
  # * WebPage
16
17
  # * Index < WebPage
@@ -197,12 +198,14 @@ div p span {colour: #dde}
197
198
  end
198
199
 
199
200
  def to_html()
200
-
201
+
202
+ b = binding
203
+
201
204
  @html ||= <<EOF
202
205
  <body onload="refresh()">
203
206
  <div id="wrapper">
204
207
  <div id="menu">
205
- <p class="welcome">Welcome, <b> #{@h[:username]} </b></p>
208
+ <p class="welcome">Welcome, <b> <%= @h[:username] %> </b></p>
206
209
  <p class="logout"><a id="exit" href="logout">Exit Chat</a></p>
207
210
  <div style="clear:both"></div>
208
211
  </div>
@@ -212,6 +215,7 @@ div p span {colour: #dde}
212
215
  </div>
213
216
  EOF
214
217
 
218
+ ERB.new(@html).result(b)
215
219
  end
216
220
 
217
221
  def to_js()
@@ -395,6 +399,7 @@ class AjaxChat
395
399
  def login_post(username)
396
400
 
397
401
  @chat.login @rws.req, username
402
+ @h[:username] = username
398
403
  @rws.redirect 'index'
399
404
 
400
405
  end
@@ -426,7 +431,8 @@ class AjaxChat
426
431
  end
427
432
 
428
433
  end
429
-
434
+
435
+ # user for debugging
430
436
  def messages()
431
437
  @chat.messages
432
438
  end
@@ -438,6 +444,7 @@ class AjaxChat
438
444
 
439
445
  end
440
446
 
447
+ # user for debugging
441
448
  def users()
442
449
  @chat.users
443
450
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: h2g_ajaxchat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file