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.90.0.beta.20180409050033 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.90.0.beta.20180408050113 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.90.0.beta.20180407050037 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.90.0.beta.20180406050006 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.90.0.beta.20180405050125 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.90.0.beta.20180404050031 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.90.0.beta.20180403050108 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.89.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.89.0.beta.20180402050042 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.89.0.beta.20180401050120 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.89.0.beta.20180331050023 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.89.0.beta.20180330050046 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.89.0.beta.20180329050050 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.89.0.beta.20180328050040 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.88.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.88.0.beta.20180327050037 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.88.0.beta.20180325050025 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.88.0.beta.20180324050059 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.87.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.87.0.beta.20180323050014 fastlane_core/lib/fastlane_core/fastlane_pty.rb