Extend list of files to watch to regen docs

Now updating these files will regenerate the docs:

* NEWS.md
* .yardopts
* docs/
* .rb, .js, .css, and .erb files inside of doc_config/
This commit is contained in:
Elliot Winkler 2015-10-08 20:30:11 -06:00
parent 6f8b7e15fe
commit e224e1dd88
1 changed files with 10 additions and 17 deletions

View File

@ -39,29 +39,22 @@ module Shoulda
project_directory = File.expand_path(File.dirname(__FILE__) + "/..")
regenerate_docs = -> (base, relative) {
regenerate_docs = proc do
print 'Regenerating docs... '
system('bundle exec yard doc &>/dev/null')
puts 'done!'
}
if system('bundle exec yard doc &>/dev/null')
puts 'done!'
else
print "\nCould not regenerate docs!!"
end
end
regenerate_docs.call
puts 'Waiting for documentation files to change...'
FSSM.monitor do
path project_directory do
glob 'README.md'
create(&regenerate_docs)
update(&regenerate_docs)
end
path File.join(project_directory, 'doc_config/yard') do
glob '**/*.rb'
create(&regenerate_docs)
update(&regenerate_docs)
end
path File.join(project_directory, 'lib') do
glob '**/*.rb'
glob '{README.md,NEWS.md,.yardopts,docs/**/*.md,doc_config/yard/**/*.{rb,js,css,erb},lib/**/*.rb}'
create(&regenerate_docs)
update(&regenerate_docs)
end