mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Add a YARD Rake task.
This commit is contained in:
parent
5fd5a2696d
commit
4261c22eb2
2 changed files with 26 additions and 18 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
|
/.yardoc
|
||||||
/coverage
|
/coverage
|
||||||
/rdoc
|
/doc
|
||||||
/pkg
|
/pkg
|
||||||
/test/rails
|
/test/rails
|
||||||
|
|
41
Rakefile
41
Rakefile
|
@ -81,25 +81,32 @@ end
|
||||||
|
|
||||||
# ----- Documentation -----
|
# ----- Documentation -----
|
||||||
|
|
||||||
begin
|
task :rdoc do
|
||||||
require 'hanna/rdoctask'
|
puts '=' * 100, <<END, '=' * 100
|
||||||
rescue LoadError
|
Haml uses the YARD documentation system (http://github.com/lsegal/yard).
|
||||||
require 'rake/rdoctask'
|
Install the yard gem and then run "rake doc".
|
||||||
|
END
|
||||||
end
|
end
|
||||||
|
|
||||||
Rake::RDocTask.new do |rdoc|
|
begin
|
||||||
rdoc.title = 'Haml/Sass'
|
require '/home/nex3/code/yard/lib/yard'
|
||||||
rdoc.options << '--line-numbers' << '--inline-source'
|
|
||||||
rdoc.rdoc_files.include(*FileList.new('*') do |list|
|
YARD::Rake::YardocTask.new do |t|
|
||||||
list.exclude(/(^|[^.a-z])[a-z]+/)
|
files = FileList.new
|
||||||
list.exclude('TODO')
|
files.include(*FileList.new('*') do |list|
|
||||||
end.to_a)
|
list.exclude(/(^|[^.a-z])[a-z]+/)
|
||||||
rdoc.rdoc_files.include('lib/**/*.rb')
|
end)
|
||||||
rdoc.rdoc_files.exclude('TODO')
|
files.include('lib/**/*.rb')
|
||||||
rdoc.rdoc_files.exclude('lib/haml/buffer.rb')
|
files.exclude('TODO')
|
||||||
rdoc.rdoc_files.exclude('lib/sass/tree/*')
|
t.files = files.to_a
|
||||||
rdoc.rdoc_dir = 'rdoc'
|
|
||||||
rdoc.main = 'README.rdoc'
|
t.options << '-r' << 'README.rdoc'
|
||||||
|
end
|
||||||
|
|
||||||
|
task :doc => :yardoc
|
||||||
|
rescue LoadError
|
||||||
|
task :doc => :rdoc
|
||||||
|
task :yardoc => :rdoc
|
||||||
end
|
end
|
||||||
|
|
||||||
# ----- Coverage -----
|
# ----- Coverage -----
|
||||||
|
|
Loading…
Add table
Reference in a new issue