Skip to content

Commit

Permalink
Merge branch 'master' into use_github_actions
Browse files Browse the repository at this point in the history
  • Loading branch information
enkessler committed Jun 4, 2021
2 parents b77a958 + c8145d8 commit 19ecd8b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
14 changes: 1 addition & 13 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,4 @@ gemspec
# Used for local development/testing only
gem 'rake'

if RUBY_VERSION =~ /^1\./
gem 'tins', '< 1.7' # The 'tins' gem requires Ruby 2.x on/after this version
gem 'json', '< 2.0' # The 'json' gem drops pre-Ruby 2.x support on/after this version
gem 'term-ansicolor', '< 1.4' # The 'term-ansicolor' gem requires Ruby 2.x on/after this version

# ffi gem for Windows requires Ruby 2.x on/after this version
gem 'ffi', '< 1.9.15' if ENV['CHILDPROCESS_POSIX_SPAWN'] == 'true' || Gem.win_platform?
elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2')
# Ruby 2.0/2.1 support only ffi before 1.10
gem 'ffi', '~> 1.9.0' if ENV['CHILDPROCESS_POSIX_SPAWN'] == 'true' || Gem.win_platform?
else
gem 'ffi' if ENV['CHILDPROCESS_POSIX_SPAWN'] == 'true' || Gem.win_platform?
end
gem 'ffi' if ENV['CHILDPROCESS_POSIX_SPAWN'] == 'true' || Gem.win_platform?
2 changes: 1 addition & 1 deletion childprocess.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.authors = ["Jari Bakken", "Eric Kessler", "Shane da Silva"]
s.email = ["[email protected]", "[email protected]"]
s.homepage = "http://github.com/enkessler/childprocess"
s.homepage = "https://github.com/enkessler/childprocess"
s.summary = %q{A simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.}
s.description = %q{This gem aims at being a simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.}

Expand Down
11 changes: 11 additions & 0 deletions lib/childprocess/unix/platform/arm64-macosx.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module ChildProcess::Unix::Platform
SIZEOF = {
:posix_spawn_file_actions_t => 8,
:posix_spawnattr_t => 8,
:sigset_t => 4
}
POSIX_SPAWN_RESETIDS = 1
POSIX_SPAWN_SETPGROUP = 2
POSIX_SPAWN_SETSIGDEF = 4
POSIX_SPAWN_SETSIGMASK = 8
end
2 changes: 1 addition & 1 deletion spec/childprocess_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@

Tempfile.open('grandparent_out') do |gp_file|
# Create a parent and detached child process that will spit out their PID. Make sure that the child process lasts longer than the parent.
p_process = ruby("require 'childprocess' ; c_process = ChildProcess.build('ruby', '-e', 'puts \\\"Child PID: \#{Process.pid}\\\" ; sleep 5') ; c_process.io.inherit! ; c_process.detach = true ; c_process.start ; puts \"Child PID: \#{c_process.pid}\" ; puts \"Parent PID: \#{Process.pid}\"")
p_process = ruby("$: << 'lib'; require 'childprocess' ; c_process = ChildProcess.build('ruby', '-e', 'puts \\\"Child PID: \#{Process.pid}\\\" ; sleep 5') ; c_process.io.inherit! ; c_process.detach = true ; c_process.start ; puts \"Child PID: \#{c_process.pid}\" ; puts \"Parent PID: \#{Process.pid}\"")
p_process.io.stdout = p_process.io.stderr = gp_file

# Let the parent process die
Expand Down
2 changes: 1 addition & 1 deletion spec/io_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@

stdin.close
process.poll_for_exit(exit_timeout)
ensure
ensure
out_receiver.close
out.close
end
Expand Down

0 comments on commit 19ecd8b

Please sign in to comment.