voltos 0.3.0.rc10 → 0.3.0.rc11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/voltos +45 -23
- data/lib/voltos/version.rb +1 -1
- 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: 95927f2e70936a2a34eba426842f51affd050a7e
|
4
|
+
data.tar.gz: b13eb1e0e9e464dcb1938e2f2a9de3eac6a10438
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 154886e9b986bde9d457da7eb0f2929779796a98b9a11c1520c84c68806fedde3d84d5d3e7deb77880fca3dad8757398960bbe7813473b2445f96cc687152bcf
|
7
|
+
data.tar.gz: acebddbec308e50d4f11b0b44a25d20a87133a1dacb396bee50a5ef905a5284c8a64950e9e65e5436db231bcb1c4992edd5928f488e74cce00ffa6e59d5bc37d
|
data/exe/voltos
CHANGED
@@ -1,36 +1,58 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'pty'
|
3
|
+
require 'open3'
|
3
4
|
require 'readline'
|
4
5
|
STDOUT.sync = true
|
5
6
|
bin = "#{Gem.bin_path('voltos', 'voltos')}-cli"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
if STDIN.tty?
|
8
|
+
status = PTY.spawn(bin, *ARGV) do |stdout, stdin, pid|
|
9
|
+
stdout.sync = true
|
10
|
+
Thread.new do
|
11
|
+
loop do
|
12
|
+
STDOUT.print stdout.getc
|
13
|
+
end
|
11
14
|
end
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
Thread.new do
|
16
|
+
loop do
|
17
|
+
input = Readline.readline("", true)
|
18
|
+
if input.nil?
|
19
|
+
stdout.flush
|
20
|
+
stdout.close
|
21
|
+
stdin.close
|
22
|
+
end
|
23
|
+
stdin.puts input.strip
|
24
|
+
end
|
25
|
+
end
|
26
|
+
begin
|
27
|
+
Process::waitpid(pid) rescue nil
|
28
|
+
while out = stdout.getc do
|
29
|
+
STDOUT.print out
|
20
30
|
end
|
21
|
-
|
31
|
+
rescue SystemExit, Interrupt
|
32
|
+
Process.kill('INT', pid)
|
33
|
+
retry
|
34
|
+
rescue EOFError
|
35
|
+
puts "Ctrl-D"
|
36
|
+
rescue IOError
|
22
37
|
end
|
23
38
|
end
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
39
|
+
else
|
40
|
+
Open3.popen3(bin, *ARGV) do |stdin, stdout, stderr, thread|
|
41
|
+
errThread = Thread.new do
|
42
|
+
while !stderr.eof? do
|
43
|
+
putc stderr.readchar
|
44
|
+
end
|
45
|
+
end
|
46
|
+
outThread = Thread.new do
|
47
|
+
while !stdout.eof? do
|
48
|
+
putc stdout.readchar
|
49
|
+
end
|
28
50
|
end
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
51
|
+
Process::waitpid(thread.pid) rescue nil
|
52
|
+
errThread.join
|
53
|
+
outThread.join
|
54
|
+
process = thread.value
|
55
|
+
status = process.exitstatus.to_i if !process.nil?
|
34
56
|
end
|
35
57
|
end
|
36
58
|
exit(status.to_i)
|
data/lib/voltos/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voltos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.0.
|
4
|
+
version: 0.3.0.rc11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel May
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|