diff --git a/Rakefile b/Rakefile index fa84ce62..0a204710 100644 --- a/Rakefile +++ b/Rakefile @@ -112,5 +112,30 @@ task bench: :compile do exit system(*cmd) end +namespace :doc do + task :sass do + require 'sass' + Dir["yard/default/**/*.sass"].each do |sass| + File.open(sass.gsub(/sass$/, 'css'), 'w') do |f| + f.write(Sass::Engine.new(File.read(sass)).render) + end + end + end + + desc "List all undocumented methods and classes." + task :undocumented do + command = 'yard --list --query ' + command << '"object.docstring.blank? && ' + command << '!(object.type == :method && object.is_alias?)"' + sh command + end +end + +desc "Generate documentation" +task(:doc => 'doc:sass') {sh "yard"} + +desc "Generate documentation incrementally" +task(:redoc) {sh "yard -c"} + task default: %w[compile hamlit:test] task test: %w[compile test:all]