Sha256: 6e22795c09eadaa19f2fee9977b9a0cf1ac20c5e9b8eef65c563589573fe3e09

Contents?: true

Size: 796 Bytes

Versions: 146

Compression:

Stored size: 796 Bytes

Contents

# Source: Mix of https://github.com/fastlane/fastlane/pull/7202/files,
# https://github.com/fastlane/fastlane/pull/11384#issuecomment-356084518 and
# https://github.com/DragonBox/u3d/blob/59e471ad78ac00cb629f479dbe386c5ad2dc5075/lib/u3d_core/command_runner.rb#L88-L96
module FastlaneCore
  class FastlanePty
    def self.spawn(command, &block)
      require 'pty'
      PTY.spawn(command) do |command_stdout, command_stdin, pid|
        block.call(command_stdout, command_stdin, pid)
      end
    rescue LoadError
      require 'open3'
      Open3.popen2e(command) do |command_stdin, command_stdout, p| # note the inversion
        yield(command_stdout, command_stdin, p.value.pid)

        command_stdin.close
        command_stdout.close
        p.value.exitstatus
      end
    end
  end
end

Version data entries

146 entries across 146 versions & 1 rubygems

Version Path
fastlane-2.85.0.beta.20180306050019 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.85.0.beta.20180305050037 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.85.0.beta.20180304050031 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.85.0.beta.20180303050048 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.85.0.beta.20180302050035 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.84.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.84.0.beta.20180301050048 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.84.0.beta.20180228050122 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.84.0.beta.20180227050054 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.83.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.83.0.beta.20180226050016 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.83.0.beta.20180225050035 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.83.0.beta.20180224050047 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.82.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.82.0.beta.20180223010003 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.82.0.beta.20180222010003 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.82.0.beta.20180221010003 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.82.0.beta.20180220010002 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.82.0.beta.20180219010003 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.82.0.beta.20180218010003 fastlane_core/lib/fastlane_core/fastlane_pty.rb