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.101.1 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.101.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.100.1 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.100.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.99.1 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.99.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.98.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.97.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.96.1 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.96.0 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.96.0.beta.20180521050117 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.96.0.beta.20180520050019 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.96.0.beta.20180519050103 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.96.0.beta.20180518050116 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.96.0.beta.20180517050058 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.96.0.beta.20180516050022 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.96.0.beta.20180515050025 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.96.0.beta.20180514050029 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.96.0.beta.20180513050015 fastlane_core/lib/fastlane_core/fastlane_pty.rb
fastlane-2.96.0.beta.20180512050121 fastlane_core/lib/fastlane_core/fastlane_pty.rb