This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
forked from mislav/hanna
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix hanna rubygems integration, you can install this version of hanna…
…, then just do `gem rdoc --all` to get all hanna'd rdocs!
- Loading branch information
Showing
3 changed files
with
8 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
module Hanna; end | ||
require 'hanna/hanna' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,8 @@ | ||
unless defined?(::Hanna) or defined?(::RDoc) | ||
require 'rubygems/doc_manager' | ||
require 'rubygems/requirement' | ||
# TODO for rubygems 1.3.8, should get Gem.register_plugin(:documtnation, | ||
# 'hanna/rubygems'). | ||
# TODO some way of making this optional. | ||
|
||
# define the Hanna namespace to prevent actions of rubygems_plugin from older versions | ||
module ::Hanna; end | ||
# Could use Gem.pre_install hooks, but that'd not work for `gem rdoc --all`. | ||
|
||
class << Gem::DocManager | ||
alias load_rdoc_without_version_constraint load_rdoc | ||
|
||
# overwrite load_rdoc to load the exact version of RDoc that Hanna works with | ||
def load_rdoc | ||
unless defined? ::Hanna::VERSION | ||
load File.expand_path(File.join(File.dirname(__FILE__), 'hanna', 'version.rb')) | ||
end | ||
|
||
Hanna::require_rdoc(false) # don't terminate if failed | ||
|
||
# call the original method | ||
load_rdoc_without_version_constraint | ||
requirement = Gem::Requirement.create Hanna::RDOC_VERSION_REQUIREMENT | ||
|
||
unless requirement.satisfied_by? rdoc_version | ||
raise Gem::DocumentError, "ERROR: RDoc version #{requirement} not installed" | ||
end | ||
end | ||
end | ||
end | ||
require 'rubygems/doc_manager' | ||
Gem::DocManager.configured_args << '-f' << 'hanna' |