Make rdoc script

This commit is contained in:
Dmitry Ilyin 2013-08-12 18:38:18 +04:00
parent 51a8a3db3c
commit b0b953dc05
2 changed files with 31 additions and 0 deletions

1
.gitignore vendored
View File

@ -23,3 +23,4 @@ Vagrantfile
metadata.json
Gemfile.lock
/rdoc

30
make-rdoc.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
ruby -v | grep -q 'ruby 1.8'
if [ $? -gt 0 ]; then
echo "Error: you are not using ruby 1.8.*!"
exit 1
fi
file="${0}"
dir=`dirname "${file}"`
cd "${dir}" || exit 1
if [ -d 'rdoc' ]; then
rm -rf 'rdoc'
fi
puppet doc --mode "rdoc" --outputdir 'rdoc' --charset "utf-8" --modulepath='deployment/puppet/' --manifestdir='deployment/puppet/nailgun/examples/'
if [ $? -gt 0 ]; then
exit 1
fi
if [ "`uname`" = 'Darwin' ]; then
open 'rdoc/index.html'
elif [ "`uname`" = 'Linux' ]; then
xdg-open 'rdoc/index.html'
else
exit 1
fi