require 'rake'
-require 'rake/gempackagetask'
+require 'rubygems/package_task'
task :default => [:buildext]
# we must (and can) skip defining the gem packaging tasks.
if File.exist? SPECFILE
spec = eval(File.read(SPECFILE), nil, SPECFILE)
- Rake::GemPackageTask.new(spec) do |pkg|
+ Gem::PackageTask.new(spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
--- /dev/null
+desc "Generate RDoc"
+task :doc => ['doc:generate']
+
+namespace :doc do
+ project_root = File.expand_path(File.join(File.dirname(__FILE__), '.'))
+ doc_destination = File.join(project_root, 'doc')
+
+ begin
+ require 'yard'
+ require 'yard/rake/yardoc_task'
+
+ YARD::Rake::YardocTask.new(:generate) do |yt|
+ yt.files = Dir.glob(File.join(project_root, 'lib', '**', '*.rb'))
+# +
+# [ File.join(project_root, 'README.md') ]
+ yt.options = ['--output-dir', doc_destination, '--readme', 'README.md']
+ end
+ rescue LoadError
+ desc "Generate YARD Documentation"
+ task :generate do
+ abort "Please install the YARD gem to generate rdoc."
+ end
+ end
+
+ desc "Remove generated documenation"
+ task :clean do
+ rm_r doc_dir if File.exists?(doc_destination)
+ end
+
+end
+