-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcool.rb
More file actions
27 lines (25 loc) · 751 Bytes
/
cool.rb
File metadata and controls
27 lines (25 loc) · 751 Bytes
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
command = `which pandoc`.empty? ? 'rdiscount' : 'pandoc'
@body = `#{command} README.md`
test_mode = false
if ARGV.length == 1 || ARGV[0] == '-t'
test_mode = true
end
if __FILE__ == $0
unless test_mode
# assume current branch is master
if false # TODO: If gh-pages isn't exist
system "git branch gh-pages origin/gh-pages"
end
system "git push"
system "git checkout gh-pages"
system "git merge master"
end
system "erb -r #{__FILE__} -T - -P index.erb > index.html"
system "ruby a.rb > feed.rss"
unless test_mode
system "git add index.html feed.rss"
system "git commit -m 'Automatically updated index.html and feed.rss'"
system "git push origin gh-pages"
system "git checkout master"
end
end