backticks 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/backticks/command.rb +1 -1
- data/lib/backticks/runner.rb +13 -4
- data/lib/backticks/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: fe01107e6bf69a8df63762bfdb771c2658f64e03
|
4
|
+
data.tar.gz: c26c6bdcb341c5145ba610edf22488b913d18a97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07dadedca71fce766853a20cd3f72403d114d8449db7e136b2505999af49276f3f8622f784eacf95d18ed9699328bf85ddd585f6c743673a89ae258cfb4231a6
|
7
|
+
data.tar.gz: efda384e3f5389eb617a7617cd05d13acfcf1750cb8c35d6da9765d2d65d811f877d975ef04d80616b39a7e0173fdf3ae9a86ef7d80751dcf4d99b053b5e12f0
|
data/lib/backticks/command.rb
CHANGED
@@ -118,7 +118,7 @@ module Backticks
|
|
118
118
|
# @return [String,nil] fresh bytes from stdout/stderr, or nil if no output
|
119
119
|
def capture(limit=nil)
|
120
120
|
streams = [@stdout, @stderr]
|
121
|
-
streams << STDIN if interactive?
|
121
|
+
streams << STDIN if STDIN.tty? && interactive?
|
122
122
|
|
123
123
|
ready, _, _ = IO.select(streams, [], [], limit)
|
124
124
|
|
data/lib/backticks/runner.rb
CHANGED
@@ -1,4 +1,9 @@
|
|
1
|
-
|
1
|
+
begin
|
2
|
+
require 'pty'
|
3
|
+
rescue LoadError
|
4
|
+
# for Windows support, tolerate a missing PTY module
|
5
|
+
end
|
6
|
+
|
2
7
|
require 'open3'
|
3
8
|
|
4
9
|
module Backticks
|
@@ -104,17 +109,21 @@ module Backticks
|
|
104
109
|
# remaining elements are parameters and flags
|
105
110
|
# @return [Command] the running command
|
106
111
|
def run_without_sugar(argv)
|
107
|
-
|
112
|
+
nopty = !defined?(PTY)
|
113
|
+
|
114
|
+
stdin_r, stdin = if nopty || (buffered.include?(:stdin) && !interactive)
|
108
115
|
IO.pipe
|
109
116
|
else
|
110
117
|
PTY.open
|
111
118
|
end
|
112
|
-
|
119
|
+
|
120
|
+
stdout, stdout_w = if nopty || (buffered.include?(:stdout) && !interactive)
|
113
121
|
IO.pipe
|
114
122
|
else
|
115
123
|
PTY.open
|
116
124
|
end
|
117
|
-
|
125
|
+
|
126
|
+
stderr, stderr_w = if nopty || buffered.include?(:stderr)
|
118
127
|
IO.pipe
|
119
128
|
else
|
120
129
|
PTY.open
|
data/lib/backticks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backticks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Spataro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|