lib/buildbox/command.rb in buildbox-0.4.2 vs lib/buildbox/command.rb in buildbox-0.5
- old
+ new
@@ -1,11 +1,15 @@
require 'childprocess'
-require 'pty'
# Inspiration from:
# https://github.com/mitchellh/vagrant/blob/master/lib/vagrant/util/subprocess.rb
+begin
+ require 'pty' # PTY isn't available on Windows
+rescue LoadError
+end
+
module Buildbox
class Command
# The chunk size for reading from subprocess IO.
READ_CHUNK_SIZE = 4096
@@ -66,10 +70,10 @@
process.start
# Make sure the stdin does not buffer
process.io.stdin.sync = true
- @logger.debug("Process #{arguments} started with PID: #{process.pid} and Group ID: #{Process.getpgid(process.pid)}")
+ @logger.debug("Process #{arguments} started with PID: #{process.pid}")
if RUBY_PLATFORM != "java"
# On Java, we have to close after. See down the method...
# Otherwise, we close the writer right here, since we're
# not on the writing side.