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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/teamspeak-ruby.rb +14 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28d3864896f236e3c1d7029cd8265a98295706df
4
- data.tar.gz: 1ac9fb2fa269f00d99174bbe9f16936eea80b699
3
+ metadata.gz: c7bdb1d9c2c0aed0a9a7788f142b07e75686f7be
4
+ data.tar.gz: 211b7826733d30e1328bfcdace29f35cb7e7237e
5
5
  SHA512:
6
- metadata.gz: e888a7486b2a742a38de9f0de9760eb504551f9a0b66995160be90cf46201122728cf2dc05f61439ac042c33f6888b469da29eca31dca7eba3cfd0e83c7b979e
7
- data.tar.gz: b0de5b2b5434a00ce30cd91968a49e1c263de7b81b56f2d65ea2044dd70b8be948eb23b9bcac93b708a35c7f565cb6baf1a1a27a1816ff5265ef593d9ce1213c
6
+ metadata.gz: c337f9dbb0273d0ab18ef37d7bf867cfc4236911e8528a6f47cd47ce3d3888c5c7f424d63d26b120b85ba96386bb382e04e2ca01571b1e73c5a25ec1691a740e
7
+ data.tar.gz: 32d5ee08c7532c74b3878cd211dae8b366a7c02ea1c27dbda95e5d2fafd5e59e7171b2db188653a82ebef82a403b96e74a981b958ab932685e25ca21b6ff2ff1
@@ -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 parse_response(response)
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.2
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-10 00:00:00.000000000 Z
11
+ date: 2014-03-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: justin@pyrohail.com