Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace open4 library by open3 #825

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.7', '3.0', '3.1', '3.2', 'head']
ruby-version: ['2.7', '3.0', '3.1', '3.2', 'head', 'jruby']
timeout-minutes: 5

steps:
Expand Down
2 changes: 1 addition & 1 deletion excon.gemspec
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |s|
s.add_development_dependency('activesupport')
s.add_development_dependency('delorean')
s.add_development_dependency('eventmachine', '>= 1.0.4')
s.add_development_dependency('open4')
s.add_development_dependency('open3')
s.add_development_dependency('rake')
s.add_development_dependency('shindo')
s.add_development_dependency('sinatra')
Expand Down
9 changes: 3 additions & 6 deletions lib/excon/test/server.rb
@@ -1,4 +1,4 @@
require 'open4'
require 'open3'
require 'excon'
require 'excon/test/plugin/server/webrick'
require 'excon/test/plugin/server/unicorn'
Expand Down Expand Up @@ -39,11 +39,8 @@ def initialize(args)
end

def open_process(*args)
if RUBY_PLATFORM == 'java'
@pid, @write, @read, @error = IO.popen4(*args)
else
@pid, @write, @read, @error = Open4.popen4(*args)
end
@write, @read, @error, wait_thread = Open3.popen3(*args)
@pid = wait_thread.pid
@started_at = Time.now
end

Expand Down
9 changes: 3 additions & 6 deletions tests/test_helper.rb
@@ -1,7 +1,7 @@
require 'bundler/setup'
require 'excon'
require 'delorean'
require 'open4'
require 'open3'
require 'webrick'

require './spec/helpers/warning_helpers.rb'
Expand Down Expand Up @@ -316,11 +316,8 @@ def capture_response_block
end

def launch_process(*args)
unless RUBY_PLATFORM == 'java'
pid, w, r, e = Open4.popen4(*args)
else
pid, w, r, e = IO.popen4(*args)
end
w, r, e, wait_thread = Open3.popen3(*args)
pid = wait_thread.pid
return pid, w, r, e
end

Expand Down