Sha256: b153bf8349bab6d1f5a30e46818fbdf0a58398822b1bfa9d74c9992e4170a857

Contents?: true

Size: 973 Bytes

Versions: 52

Compression:

Stored size: 973 Bytes

Contents

# frozen_string_literal: true

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.md')] +
                 [File.join(project_root, 'LICENSE')]

      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

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
dor-services-9.6.2 lib/tasks/rdoc.rake
dor-services-9.6.1 lib/tasks/rdoc.rake
dor-services-9.6.0 lib/tasks/rdoc.rake
dor-services-9.5.0 lib/tasks/rdoc.rake
dor-services-9.4.0 lib/tasks/rdoc.rake
dor-services-9.3.0 lib/tasks/rdoc.rake
dor-services-9.2.1 lib/tasks/rdoc.rake
dor-services-9.2.0 lib/tasks/rdoc.rake
dor-services-9.1.0 lib/tasks/rdoc.rake
dor-services-9.0.0 lib/tasks/rdoc.rake
dor-services-8.6.0 lib/tasks/rdoc.rake
dor-services-8.5.0 lib/tasks/rdoc.rake
dor-services-8.4.0 lib/tasks/rdoc.rake
dor-services-8.3.0 lib/tasks/rdoc.rake
dor-services-8.2.0 lib/tasks/rdoc.rake
dor-services-8.1.1 lib/tasks/rdoc.rake
dor-services-8.1.0 lib/tasks/rdoc.rake
dor-services-8.0.0 lib/tasks/rdoc.rake
dor-services-7.2.4 lib/tasks/rdoc.rake
dor-services-7.2.3 lib/tasks/rdoc.rake