Permalink
Browse files

Make it possible to run the rdoc task without RSpec.

Don't fail to load the Rakefile if rspec is not present, instead print an
error message and skip further along.
  • Loading branch information...
1 parent 8d36779 commit f59cf41e8dc59a2521a66f34db7eeb7bd186a7ea @Flameeyes Flameeyes committed Jun 19, 2010
Showing with 15 additions and 11 deletions.
  1. +15 −11 Rakefile
View
@@ -20,19 +20,23 @@ rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end
-require 'spec/rake/spectask'
-Spec::Rake::SpecTask.new(:spec) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.spec_files = FileList['spec/**/*_spec.rb']
-end
+begin
+ require 'spec/rake/spectask'
+ Spec::Rake::SpecTask.new(:spec) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.spec_files = FileList['spec/**/*_spec.rb']
+ end
-Spec::Rake::SpecTask.new(:rcov) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.pattern = 'spec/**/*_spec.rb'
- spec.rcov = true
-end
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.rcov = true
+ end
-task :default => :spec
+ task :default => :spec
+rescue LoadError
+ puts "RSpec (or a dependency) not available. Install it with: gem install rspec"
+end
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|

0 comments on commit f59cf41

Please sign in to comment.