tsquery 1.0.2 → 1.0.3
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 +4 -4
- data/lib/tsquery.rb +4 -3
- data/test/tsquery_test.rb +11 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5c90804d25f46c07c860b7a4174145404d5ceb9
|
4
|
+
data.tar.gz: 3bcfad44b41d77eb56f73b2e7012ff7039af520d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9220f0ef1a3dadc6ed6023271a1edf102e9c7e56b18b022d9dc1ad78c850c5ab4d4971b34f10fcea2d7ada6b3018eafdc52ebf50707c6765017cf4d168b8092
|
7
|
+
data.tar.gz: 2b04fb596a86989a87827439c0462f5d486cabd55d95af193bb4d2855f784a6283d65e37b998c395e45820e06ca00597cabbd09473dd15d7dd7a8fbd859f54b1
|
data/lib/tsquery.rb
CHANGED
@@ -32,7 +32,7 @@ class Tsquery
|
|
32
32
|
'Timeout' => 3,
|
33
33
|
'Match' => /error id=\d+/
|
34
34
|
))
|
35
|
-
when /info$/, 'whoami', 'version'
|
35
|
+
when /info$/, 'whoami', 'version', 'clientgetdbidfromuid'
|
36
36
|
parse_info(@telnet.cmd(
|
37
37
|
'String' => full_command,
|
38
38
|
'Timeout' => 3,
|
@@ -140,15 +140,16 @@ private
|
|
140
140
|
def deserialize_arguments(string)
|
141
141
|
string.split.each_with_object({}) do |string, hash|
|
142
142
|
key, value = string.split('=')
|
143
|
-
value = value.gsub(INVERTED_ESCAPE_PATTERNS_REGEXP, INVERTED_ESCAPE_PATTERNS)
|
144
143
|
|
145
144
|
hash[key] = case value
|
145
|
+
when nil
|
146
|
+
nil
|
146
147
|
when /^\d+$/
|
147
148
|
value.to_i
|
148
149
|
when /^\d+\.\d+$/
|
149
150
|
value.to_f
|
150
151
|
else
|
151
|
-
value
|
152
|
+
value = value.gsub(INVERTED_ESCAPE_PATTERNS_REGEXP, INVERTED_ESCAPE_PATTERNS)
|
152
153
|
end
|
153
154
|
end
|
154
155
|
end
|
data/test/tsquery_test.rb
CHANGED
@@ -114,6 +114,17 @@ class TsqueryTest < Minitest::Test
|
|
114
114
|
end
|
115
115
|
|
116
116
|
|
117
|
+
def test_execute_command_which_returns_a_list_including_only_a_key
|
118
|
+
@telnet.expect :cmd, <<-RESPONSE.gsub(/^\s*/, ''), ['String' => 'serverinfo', 'Timeout' => 3, 'Match' => /error id=\d+/]
|
119
|
+
virtualserver_ip virtualserver_weblist_enabled=1 virtualserver_ask_for_privilegekey=0
|
120
|
+
error id=0 msg=ok
|
121
|
+
RESPONSE
|
122
|
+
|
123
|
+
assert_kind_of Hash, serverinfo = @tsquery.serverinfo
|
124
|
+
assert_nil serverinfo.fetch('virtualserver_ip')
|
125
|
+
end
|
126
|
+
|
127
|
+
|
117
128
|
def test_login
|
118
129
|
@telnet.expect :cmd, 'error id=0 msg=ok', ['String' => 'login serveradmin password', 'Timeout' => 3, 'Match' => /^error id=\d+/]
|
119
130
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tsquery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Uher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
87
|
rubyforge_project:
|
88
|
-
rubygems_version: 2.4.
|
88
|
+
rubygems_version: 2.4.5.1
|
89
89
|
signing_key:
|
90
90
|
specification_version: 4
|
91
91
|
summary: Automate your TeamSpeak3 server with Ruby!
|
@@ -93,4 +93,3 @@ test_files:
|
|
93
93
|
- test/lazy_tsquery_test.rb
|
94
94
|
- test/retrying_tsquery_test.rb
|
95
95
|
- test/tsquery_test.rb
|
96
|
-
has_rdoc:
|