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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59e8e56c2b0f2b5b3562909b1d5a52c4dcf93f14
4
- data.tar.gz: 533733dbc57ffd91c685b43a129ac82eb3ddbe0b
3
+ metadata.gz: 0686ec66c5c96ca812b85f2719f62bc067fca136
4
+ data.tar.gz: 0ae26b3979e9e43e1b2e76a275ee363ef79c697b
5
5
  SHA512:
6
- metadata.gz: 8eb29dd2561bd88efa27fae20c8a3fea5b549be21d212125e26b9242ad9a9f250972a1f39c0ec1a2025ed2280a09b3f5cf19ee0e690f09c0ad06fa825e5c1721
7
- data.tar.gz: e7e29c0a64056d62c124d3fdd1bfd79c5c5219d3fe313d2dac51d87c026d7c349907e86d9d7bf696cf54fbda867c6f4d85b408dca7306414b2fe87d7e3794f02
6
+ metadata.gz: 737017bb8f09d5347d71518329f394967c980ead4e17a0e0696f07b4e81026006bc1d10b704a0b3b28bddc5ee28b0f2e0ee7724468aca7851a97a44de53c01ea
7
+ data.tar.gz: 4416c1f5a80f34061fba62db276e44919726cd9768e944bcafe186329f94b89e6f9e4bb2420fddef2b5a2ac7d232141e183769551821e62da101a828353d5f27
data/README.md CHANGED
@@ -47,6 +47,7 @@ chat.stop_server()
47
47
  }
48
48
  end
49
49
 
50
+ puts "Running..........."
50
51
  wait = gets
51
52
  ```
52
53
 
@@ -1,3 +1,3 @@
1
1
  module WebSocketChatServer
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -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 == 0
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
- ws.close
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.2
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-06 00:00:00.000000000 Z
11
+ date: 2015-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: em-websocket