Skip to content

Commit

Permalink
Extend list of files to watch to regen docs
Browse files Browse the repository at this point in the history
Now updating these files will regenerate the docs:

* NEWS.md
* .yardopts
* docs/
* .rb, .js, .css, and .erb files inside of doc_config/
  • Loading branch information
mcmire committed Oct 9, 2015
1 parent 6f8b7e1 commit e224e1d
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions tasks/documentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,22 @@ def self.create

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
Expand Down

0 comments on commit e224e1d

Please sign in to comment.