teamspeak-ruby 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/lib/teamspeak-ruby.rb +14 -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: c7bdb1d9c2c0aed0a9a7788f142b07e75686f7be
|
4
|
+
data.tar.gz: 211b7826733d30e1328bfcdace29f35cb7e7237e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c337f9dbb0273d0ab18ef37d7bf867cfc4236911e8528a6f47cd47ce3d3888c5c7f424d63d26b120b85ba96386bb382e04e2ca01571b1e73c5a25ec1691a740e
|
7
|
+
data.tar.gz: 32d5ee08c7532c74b3878cd211dae8b366a7c02ea1c27dbda95e5d2fafd5e59e7171b2db188653a82ebef82a403b96e74a981b958ab932685e25ca21b6ff2ff1
|
data/lib/teamspeak-ruby.rb
CHANGED
@@ -44,13 +44,26 @@ class Teamspeak
|
|
44
44
|
|
45
45
|
while true
|
46
46
|
response += @sock.gets
|
47
|
+
|
48
|
+
puts response
|
47
49
|
|
48
50
|
if response.index('msg=')
|
49
51
|
break
|
50
52
|
end
|
51
53
|
end
|
52
54
|
|
53
|
-
return
|
55
|
+
# Array of commands that are expected to return as an array.
|
56
|
+
# Not sure - clientgetids
|
57
|
+
should_be_array = ['bindinglist', 'serverlist', 'servergrouplist', 'servergroupclientlist',
|
58
|
+
'servergroupsbyclientid', 'servergroupclientlist', 'logview', 'channellist',
|
59
|
+
'channelfind', 'channelgrouplist', 'channelgrouppermlist', 'channelpermlist', 'clientlist',
|
60
|
+
'clientfind', 'clientdblist', 'clientdbfind', 'channelclientpermlist', 'permissionlist',
|
61
|
+
'permoverview', 'privilegekeylist', 'messagelist', 'complainlist', 'banlist', 'ftlist',
|
62
|
+
'custominfo']
|
63
|
+
|
64
|
+
parsed_response = parse_response(response)
|
65
|
+
|
66
|
+
return should_be_array.include?(cmd) ? parsed_response : parsed_response.first
|
54
67
|
end
|
55
68
|
|
56
69
|
def parse_response(response)
|
@@ -89,7 +102,6 @@ class Teamspeak
|
|
89
102
|
return param
|
90
103
|
end
|
91
104
|
|
92
|
-
|
93
105
|
def encode_param(param)
|
94
106
|
param = param.gsub('\\', '\\\\')
|
95
107
|
param = param.gsub('/', '\\/')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teamspeak-ruby
|
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
|
- Justin Harrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: justin@pyrohail.com
|