This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release 0.1.9 -- force rubygems to use the correct version of RDoc
- Loading branch information
Showing
3 changed files
with
32 additions
and
5 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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
unless defined?(Hanna) or defined?(RDoc) | ||
require 'rubygems/doc_manager' | ||
require 'rubygems/requirement' | ||
require 'hanna/rdoc_version' | ||
|
||
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 | ||
requirement = Gem::Requirement.create Hanna::RDOC_VERSION_REQUIREMENT | ||
|
||
begin | ||
gem 'rdoc', requirement.to_s | ||
rescue Gem::LoadError | ||
# ignore | ||
end | ||
|
||
# call the original method | ||
load_rdoc_without_version_constraint | ||
|
||
unless requirement.satisfied_by? rdoc_version | ||
raise Gem::DocumentError, "ERROR: RDoc version #{requirement} not installed" | ||
end | ||
end | ||
end | ||
end |