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