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.94.0.beta.20180424050050 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.93.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.93.0.beta.20180423050019 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.93.0.beta.20180422050034 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.93.0.beta.20180421050012 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.93.0.beta.20180420050021 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.93.0.beta.20180419050008 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.93.0.beta.20180418050020 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.92.1 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.93.0.beta.20180417050013 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.92.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.92.0.beta.20180416050023 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.92.0.beta.20180415050019 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.92.0.beta.20180414050023 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.91.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.91.0.beta.20180413050017 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.90.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.90.0.beta.20180412050111 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.90.0.beta.20180411050056 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.90.0.beta.20180410050128 fastlane_core/lib/fastlane_core/fastlane_pty.rb