1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Keep Object#fork private

This commit is contained in:
Étienne Barrié 2019-09-30 17:01:50 -04:00
parent a273da7619
commit f223c795e8
2 changed files with 7 additions and 1 deletions

View file

@ -18,6 +18,11 @@ module ActiveSupport
end
end
module CoreExtPrivate
include CoreExt
private :fork
end
@pid = Process.pid
@callbacks = []
@ -30,7 +35,7 @@ module ActiveSupport
end
def hook!
::Object.prepend(CoreExt)
::Object.prepend(CoreExtPrivate)
::Kernel.singleton_class.prepend(CoreExt)
::Process.singleton_class.prepend(CoreExt)
end

View file

@ -12,6 +12,7 @@ class ForkTrackerTest < ActiveSupport::TestCase
write.write "forked"
end
assert_not respond_to?(:fork)
pid = fork do
read.close
write.close