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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99c34a6663b44673cd2652f3aae287b9d7b018e2
4
- data.tar.gz: 3b27006eb2ecc2762af1c9f2f1d4ed26a1e60cd3
3
+ metadata.gz: fe01107e6bf69a8df63762bfdb771c2658f64e03
4
+ data.tar.gz: c26c6bdcb341c5145ba610edf22488b913d18a97
5
5
  SHA512:
6
- metadata.gz: 4748e947baf5ea75de33b393f24f460faa6a3f8cef2eac96bdfd150ebaae695d87fef57bdb02cdfeca5dd220cf0cb4cecf7d061d9bfe0cef49c64b928fcbc888
7
- data.tar.gz: e9b2088b99789d1ac86d5324348960ac8d31d69f7a26cbdc373e421543a4edd18ff55bf69490d43b1fabe90d782c940067956b6c9b9dd802e706cd3c1d596c2f
6
+ metadata.gz: 07dadedca71fce766853a20cd3f72403d114d8449db7e136b2505999af49276f3f8622f784eacf95d18ed9699328bf85ddd585f6c743673a89ae258cfb4231a6
7
+ data.tar.gz: efda384e3f5389eb617a7617cd05d13acfcf1750cb8c35d6da9765d2d65d811f877d975ef04d80616b39a7e0173fdf3ae9a86ef7d80751dcf4d99b053b5e12f0
@@ -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
 
@@ -1,4 +1,9 @@
1
- require 'pty'
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
- stdin_r, stdin = if buffered.include?(:stdin) && !interactive
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
- stdout, stdout_w = if buffered.include?(:stdout) && !interactive
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
- stderr, stderr_w = if buffered.include?(:stderr)
125
+
126
+ stderr, stderr_w = if nopty || buffered.include?(:stderr)
118
127
  IO.pipe
119
128
  else
120
129
  PTY.open
@@ -1,3 +1,3 @@
1
1
  module Backticks
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
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.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: 2016-09-14 00:00:00.000000000 Z
11
+ date: 2017-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler