Rakefile in haml-2.2.14 vs Rakefile in haml-2.2.15

- old
+ new

@@ -223,28 +223,41 @@ end begin require 'yard' + namespace :yard do + task :sass do + require File.dirname(__FILE__) + '/lib/sass' + Dir[File.dirname(__FILE__) + "/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 + end + YARD::Rake::YardocTask.new do |t| t.files = FileList.new('lib/**/*.rb') do |list| list.exclude('lib/haml/template/*.rb') list.exclude('lib/haml/helpers/action_view_mods.rb') end.to_a t.options << '--use-cache' if Rake.application.top_level_tasks.include?('redoc') t.options += FileList.new('yard/*.rb').to_a.map {|f| ['-e', f]}.flatten files = FileList.new('doc-src/*').to_a.sort_by {|s| s.size} + %w[MIT-LICENSE VERSION] t.options << '--files' << files.join(',') + t.options << '--template-path' << File.dirname(__FILE__) + '/yard' end - Rake::Task['yardoc'].instance_variable_set('@comment', nil) + Rake::Task['yard'].prerequisites.insert(0, 'yard:sass') + Rake::Task['yard'].instance_variable_set('@comment', nil) desc "Generate Documentation" - task :doc => :yardoc - task :redoc => :yardoc + task :doc => :yard + task :redoc => :yard rescue LoadError desc "Generate Documentation" task :doc => :rdoc - task :yardoc => :rdoc + task :yard => :rdoc end task :pages do ensure_git_cleanup do puts "#{'=' * 50} Running rake pages PROJ=#{ENV["PROJ"].inspect}"