Sha256: 2e816e17307e440f52c34de01c93d813fe7523c190a954568c17e87c9a8005a3

Contents?: true

Size: 1003 Bytes

Versions: 3

Compression:

Stored size: 1003 Bytes

Contents

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, 'rdoc')

  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')) +
        Dir.glob(File.join(project_root, 'lib', '**', '*.rb')) +
        [File.join(project_root, 'README.rdoc')]

      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_destination if File.exist?(doc_destination)
  end
end

desc 'Build Yard documentation'
task :yard do
  YARD::Rake::YardocTask.new do |t|
    t.files = ['lib/**/*.rb', 'bin/**/*.rb']
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
robot-controller-2.0.0 lib/tasks/doc.rake
robot-controller-2.0.beta2 lib/tasks/doc.rake
robot-controller-2.0.beta1 lib/tasks/doc.rake