forked from mustache/mustache.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
42 lines (34 loc) · 1.06 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
39
40
41
42
require 'net/http'
task :default => :test
task :test do
# nothing
end
namespace :build do
desc "Build JavaScript"
task :coffee do
sh "coffee --compile --bare *.coffee"
end
desc "Update man pages"
task :man do
uri = URI("https://raw.github.com")
Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |http|
[1, 5].each do |page|
resp = http.get("/defunkt/mustache/master/man/mustache.#{page}.html")
open("mustache.#{page}.html", "w") do |file|
header = <<-EOS.gsub(/^ */, '')
<!DOCTYPE html>
<!--
Hello contributor! This page is automatically generated from the Mustache
man pages. Rather than sending a pull request to change this file, you
should update the source:
https://github.com/defunkt/mustache/blob/master/man/mustache.#{page}.ron
-->
EOS
file << resp.body.sub(/^<!DOCTYPE html>\n/, header)
end
end
end
end
end
desc "Build the whole site"
task :build => [ "build:coffee", "build:man" ]