diff --git a/lib/rubygems_plugin.rb b/lib/rubygems_plugin.rb index eb4c712af9..b934c9b9b7 100644 --- a/lib/rubygems_plugin.rb +++ b/lib/rubygems_plugin.rb @@ -3,7 +3,12 @@ require 'rubygems/user_interaction' require 'fileutils' -require_relative './rdoc/markdown' # For JRuby +# raise 'STOP' + +# require_relative './rdoc/markdown' # For JRuby + +# pp $LOADED_FEATURES + require_relative './rdoc' ## @@ -265,5 +270,11 @@ def setup end -Gem.done_installing(&RDoc::RubyGemsHook.method(:generate)) -Gem.pre_uninstall(&RDoc::RubyGemsHook.method(:remove)) +# When RDoc isn't set up `generate` and `remove` aren't registerd to RubyGemsHook. +begin + require_relative 'rdoc/markdown' +rescue LoadError +else + Gem.done_installing(&RDoc::RubyGemsHook.method(:generate)) + Gem.pre_uninstall(&RDoc::RubyGemsHook.method(:remove)) +end