Permalink
Browse files

Don't immediately load all of YARD when RubyGems requires the plugin.

  • Loading branch information...
1 parent 1e244ee commit 2f14541e7aa0fb58f3195312d257fd04fce94592 @lsegal committed Jun 14, 2009
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/rubygems_plugin.rb
View
@@ -1,6 +1,5 @@
require 'rubygems/specification'
require 'rubygems/doc_manager'
-require File.dirname(__FILE__) + '/yard' unless defined?(YARD)
class Gem::Specification
# has_rdoc should not be ignored!
@@ -23,6 +22,10 @@ def has_rdoc?
end
class Gem::DocManager
+ def self.load_yardoc
+ require File.dirname(__FILE__) + '/yard'
+ end
+
def run_yardoc(*args)
args << @spec.rdoc_options
args << '--quiet'
@@ -58,6 +61,7 @@ def setup_rdoc
FileUtils.mkdir_p @doc_dir unless File.exist?(@doc_dir)
self.class.load_rdoc if @spec.has_rdoc?
+ self.class.load_yardoc if @spec.has_yardoc?
end
def install_yardoc

0 comments on commit 2f14541

Please sign in to comment.