Permalink
Browse files

rework exception management for JRuby compatibility

  • Loading branch information...
1 parent bd15eef commit 6f874014bfb34a7e04106dd9b16318ddad3c5a4d @alexch alexch committed Jul 8, 2012
Showing with 9 additions and 6 deletions.
  1. +9 −6 lib/rubygems/dependency_installer.rb
@@ -387,14 +387,17 @@ def install dep_or_name, version = Gem::Requirement.default
end
def in_background what
+ fork_happened = false
if @build_docs_in_background and Process.respond_to?(:fork)
- say "#{what} in a background process."
- Process.fork do
- yield
+ begin
+ Process.fork do
+ yield
+ end
+ fork_happened = true
+ say "#{what} in a background process."
+ rescue NotImplementedError
end
- else
- yield
end
+ yield unless fork_happened
end
-
end

0 comments on commit 6f87401

Please sign in to comment.