Skip to content

Commit

Permalink
When rdoc/markdown isn't created generate and remove aren't exe…
Browse files Browse the repository at this point in the history
…cuted.
  • Loading branch information
mterada1228 committed Aug 7, 2024
1 parent d205aa2 commit 4a36e62
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions lib/rubygems_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'

##
Expand Down Expand Up @@ -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

0 comments on commit 4a36e62

Please sign in to comment.