/
Rakefile
39 lines (37 loc) · 1.28 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
namespace :live do
desc "check all the links. Checks GITHUB_USER or your user"
task :check_links do
linkchecker_bin = `which linkchecker`.strip
unless $? == 0
raise "linkchecker utility required. See: http://superb-east.dl.sourceforge.net/sourceforge/linkchecker/LinkChecker-5.0.2.tar.gz"
end
github_user = ENV['GITHUB_USER'] || `/usr/bin/github info | grep "You are" | awk {'print $3'}`.strip
sh "#{linkchecker_bin} -o text -F text --anchors --no-warnings http://#{github_user}.github.com/poolparty/" rescue nil
end
end
namespace :publish do
desc "prepare everything for publishing"
task :prepare do
%w{POOLPARTY_SRC POOLPARTY_WEB}.each {|env| raise "#{env} required." unless ENV[env]}
cmds =<<-EOCMD
pushd $POOLPARTY_SRC &&
git checkout master &&
rake rerdoc &&
rsync -av $POOLPARTY_SRC/rdoc $POOLPARTY_WEB/site/ &&
rm -rf rdoc/* &&
git checkout gh-pages &&
pushd $POOLPARTY_WEB &&
# find $POOLPARTY_WEB/site -type f -name '*.html' -exec rm {} ";" &&
staticmatic build . &&
rsync -av $POOLPARTY_WEB/site/ $POOLPARTY_SRC &&
git add site &&
git commit -m "updated site on #{Time.now} via rake"
pushd $POOLPARTY_SRC &&
# add everything not in the gitignores
popd &&
popd
EOCMD
# cmds.split(/\n/).each{|cmd| puts sh(cmd, :verbose => true)}
sh cmds
end
end