Permalink
Browse files

Closes gh-10: rdoc gem should not be required to run thor -T or thor …

…specs without warnings.

Signed-off-by: Hedge Hog <hedge.hogs.hiatus@gmail.com>
  • Loading branch information...
1 parent 649a50e commit dad6da62af59bf777a20a0889851f326523b14e6 Hedge Hog committed with josevalim Jan 2, 2010
Showing with 13 additions and 8 deletions.
  1. +13 −8 Thorfile
View
@@ -4,7 +4,10 @@ require File.join(File.dirname(__FILE__), "lib", "thor", "version")
require 'rubygems'
require 'thor/rake_compat'
require 'spec/rake/spectask'
-require 'rdoc/task'
+begin
+ require 'rdoc/task'
+rescue LoadError
+end
GEM_NAME = 'thor'
EXTRA_RDOC_FILES = ["README.rdoc", "LICENSE", "CHANGELOG.rdoc", "VERSION", "Thorfile"]
@@ -26,13 +29,15 @@ class Default < Thor
t.rcov_dir = "rcov"
end
- RDoc::Task.new do |rdoc|
- rdoc.main = "README.rdoc"
- rdoc.rdoc_dir = "rdoc"
- rdoc.title = GEM_NAME
- rdoc.rdoc_files.include(*EXTRA_RDOC_FILES)
- rdoc.rdoc_files.include('lib/**/*.rb')
- rdoc.options << '--line-numbers' << '--inline-source'
+ if defined?(RDoc)
+ RDoc::Task.new do |rdoc|
+ rdoc.main = "README.rdoc"
+ rdoc.rdoc_dir = "rdoc"
+ rdoc.title = GEM_NAME
+ rdoc.rdoc_files.include(*EXTRA_RDOC_FILES)
+ rdoc.rdoc_files.include('lib/**/*.rb')
+ rdoc.options << '--line-numbers' << '--inline-source'
+ end
end
begin

0 comments on commit dad6da6

Please sign in to comment.