1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00

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

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