web_socket_chat_server 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/web_socket_chat_server/version.rb +1 -1
- data/lib/web_socket_chat_server.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0686ec66c5c96ca812b85f2719f62bc067fca136
|
4
|
+
data.tar.gz: 0ae26b3979e9e43e1b2e76a275ee363ef79c697b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 737017bb8f09d5347d71518329f394967c980ead4e17a0e0696f07b4e81026006bc1d10b704a0b3b28bddc5ee28b0f2e0ee7724468aca7851a97a44de53c01ea
|
7
|
+
data.tar.gz: 4416c1f5a80f34061fba62db276e44919726cd9768e944bcafe186329f94b89e6f9e4bb2420fddef2b5a2ac7d232141e183769551821e62da101a828353d5f27
|
data/README.md
CHANGED
@@ -38,7 +38,7 @@ class ChatServer
|
|
38
38
|
raise ArgumentError, "The :port parameter is required" unless args.has_key?(:port)
|
39
39
|
raise ArgumentError, "The port value is not valid" unless valid_port?( args[:port])
|
40
40
|
@max_connections = args[:max_connections].to_s.to_i
|
41
|
-
@max_connections = 100 if @max_connections
|
41
|
+
@max_connections = 100 if @max_connections <= 1
|
42
42
|
@host = args[:host]
|
43
43
|
@port = args[:port]
|
44
44
|
@server_started = false
|
@@ -220,7 +220,9 @@ end
|
|
220
220
|
when "ban_user"
|
221
221
|
break if data == ""
|
222
222
|
unless user_admin?(user)
|
223
|
-
|
223
|
+
response = create_response_json("ban_user", false, "Only an admin can ban a user.")
|
224
|
+
yield response if block_given?
|
225
|
+
ws.send(response)
|
224
226
|
break
|
225
227
|
end
|
226
228
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_socket_chat_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jone Samra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: em-websocket
|