arql 0.1.25 → 0.1.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/exe/arql +2 -0
- data/exe/arql_setsid_wrapper +5 -0
- data/lib/arql/ssh_proxy.rb +1 -0
- data/lib/arql/ssh_proxy_patch.rb +88 -0
- data/lib/arql/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ed88946e69a6690211fae5d85975ee9674f67cf865cbd8cc472f91cb053f5e6
|
4
|
+
data.tar.gz: 44d68d0a13e023c5c69402f92a07fe356fd234a73ba3664becfc17c916c95815
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25a93383de5e12ec51a1b7986aeec653b0d7c54c75863deff606487ac4a07ee0baec5b52d56f9562900d91e74f14e964ee0d52662b45a02236cc9cb5ca2c9aa6
|
7
|
+
data.tar.gz: 5fafcbe5ed60878e8614cacff2147eb0d29c58e39a30e4ca85e8c2d6d74d7ee2b70fabee880f275a3ae8194df5aa6d3c857396b3930ecb36d1f84087f348f1cd
|
data/Gemfile.lock
CHANGED
data/exe/arql
CHANGED
data/lib/arql/ssh_proxy.rb
CHANGED
@@ -0,0 +1,88 @@
|
|
1
|
+
require 'net/ssh/proxy/command'
|
2
|
+
|
3
|
+
module Net
|
4
|
+
module SSH
|
5
|
+
module Proxy
|
6
|
+
class Command
|
7
|
+
|
8
|
+
# Return a new socket connected to the given host and port via the
|
9
|
+
# proxy that was requested when the socket factory was instantiated.
|
10
|
+
def open(host, port, connection_options = nil)
|
11
|
+
command_line = @command_line_template.gsub(/%(.)/) {
|
12
|
+
case $1
|
13
|
+
when 'h'
|
14
|
+
host
|
15
|
+
when 'p'
|
16
|
+
port.to_s
|
17
|
+
when 'r'
|
18
|
+
remote_user = connection_options && connection_options[:remote_user]
|
19
|
+
if remote_user
|
20
|
+
remote_user
|
21
|
+
else
|
22
|
+
raise ArgumentError, "remote user name not available"
|
23
|
+
end
|
24
|
+
when '%'
|
25
|
+
'%'
|
26
|
+
else
|
27
|
+
raise ArgumentError, "unknown key: #{$1}"
|
28
|
+
end
|
29
|
+
}
|
30
|
+
command_line = '%s %s' % [ArqlSetsidWrrapper, command_line]
|
31
|
+
begin
|
32
|
+
io = IO.popen(command_line, "r+")
|
33
|
+
begin
|
34
|
+
if result = IO.select([io], nil, [io], @timeout)
|
35
|
+
if result.last.any? || io.eof?
|
36
|
+
raise "command failed"
|
37
|
+
end
|
38
|
+
else
|
39
|
+
raise "command timed out"
|
40
|
+
end
|
41
|
+
rescue StandardError
|
42
|
+
close_on_error(io)
|
43
|
+
raise
|
44
|
+
end
|
45
|
+
rescue StandardError => e
|
46
|
+
raise ConnectError, "#{e}: #{command_line}"
|
47
|
+
end
|
48
|
+
@command_line = command_line
|
49
|
+
if Gem.win_platform?
|
50
|
+
# read_nonblock and write_nonblock are not available on Windows
|
51
|
+
# pipe. Use sysread and syswrite as a replacement works.
|
52
|
+
def io.send(data, flag)
|
53
|
+
syswrite(data)
|
54
|
+
end
|
55
|
+
|
56
|
+
def io.recv(size)
|
57
|
+
sysread(size)
|
58
|
+
end
|
59
|
+
else
|
60
|
+
def io.send(data, flag)
|
61
|
+
begin
|
62
|
+
result = write_nonblock(data)
|
63
|
+
rescue IO::WaitWritable, Errno::EINTR
|
64
|
+
IO.select(nil, [self])
|
65
|
+
retry
|
66
|
+
end
|
67
|
+
result
|
68
|
+
end
|
69
|
+
|
70
|
+
def io.recv(size)
|
71
|
+
begin
|
72
|
+
result = read_nonblock(size)
|
73
|
+
rescue IO::WaitReadable, Errno::EINTR
|
74
|
+
timeout_in_seconds = 20
|
75
|
+
if IO.select([self], nil, [self], timeout_in_seconds) == nil
|
76
|
+
raise "Unexpected spurious read wakeup"
|
77
|
+
end
|
78
|
+
retry
|
79
|
+
end
|
80
|
+
result
|
81
|
+
end
|
82
|
+
end
|
83
|
+
io
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
data/lib/arql/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liu Xiang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mysql2
|
@@ -169,6 +169,7 @@ email:
|
|
169
169
|
- liuxiang921@gmail.com
|
170
170
|
executables:
|
171
171
|
- arql
|
172
|
+
- arql_setsid_wrapper
|
172
173
|
extensions: []
|
173
174
|
extra_rdoc_files: []
|
174
175
|
files:
|
@@ -183,6 +184,7 @@ files:
|
|
183
184
|
- bin/console
|
184
185
|
- bin/setup
|
185
186
|
- exe/arql
|
187
|
+
- exe/arql_setsid_wrapper
|
186
188
|
- lib/arql.rb
|
187
189
|
- lib/arql/app.rb
|
188
190
|
- lib/arql/cli.rb
|
@@ -205,6 +207,7 @@ files:
|
|
205
207
|
- lib/arql/multi_io.rb
|
206
208
|
- lib/arql/repl.rb
|
207
209
|
- lib/arql/ssh_proxy.rb
|
210
|
+
- lib/arql/ssh_proxy_patch.rb
|
208
211
|
- lib/arql/version.rb
|
209
212
|
homepage: https://github.com/lululau/arql
|
210
213
|
licenses:
|