Skip to content

Commit

Permalink
update rdoc task to no longer depend on deprecated rake/rdoctask
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkerbot committed Jul 12, 2011
1 parent 7d70659 commit 5a38977
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Rakefile
@@ -1,5 +1,4 @@
require 'rake'
require 'rake/rdoctask'
require 'bundler'
Bundler::GemHelper.install_tasks

Expand Down Expand Up @@ -59,13 +58,16 @@ end
#

desc 'Generate documentation.'
Rake::RDocTask.new(:rdoc) do |rdoc|
spec = gemspec
task :rdoc do
spec = gemspec
files = spec.files.select {|file| File.extname(file) == '.rb' }
files += spec.extra_rdoc_files
options = spec.rdoc_options.join(' ')

rdoc.rdoc_dir = 'rdoc'
rdoc.options.concat spec.rdoc_options
rdoc.rdoc_files.include( spec.extra_rdoc_files )
rdoc.rdoc_files.include( spec.files.select {|file| file =~ /^lib.*\.rb$/} )
Dir.chdir File.expand_path('..', __FILE__) do
FileUtils.rm_r('rdoc') if File.exists?('rdoc')
sh "rdoc -o rdoc #{options} '#{files.join("' '")}'"
end
end

#
Expand Down

0 comments on commit 5a38977

Please sign in to comment.