Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 82 lines (62 sloc) 1.308 kB
fba6b3d @defunkt rakefile
defunkt authored
1 require 'rake/testtask'
4b85e86 @ernie Allow Rakefile to run with newer versions of Rake.
ernie authored
2 require 'rdoc/task'
fba6b3d @defunkt rakefile
defunkt authored
3
3c73c33 @defunkt Rakefile tweaks
defunkt authored
4 #
5 # Helpers
6 #
7
6b6cc76 @defunkt cleaner Rakefile
defunkt authored
8 def command?(command)
116c4ed @josh silence stderr too
josh authored
9 system("type #{command} &> /dev/null")
6b6cc76 @defunkt cleaner Rakefile
defunkt authored
10 end
fba6b3d @defunkt rakefile
defunkt authored
11
3c73c33 @defunkt Rakefile tweaks
defunkt authored
12
6b6cc76 @defunkt cleaner Rakefile
defunkt authored
13 #
14 # Tests
15 #
e13aa25 @defunkt rake gem
defunkt authored
16
6b6cc76 @defunkt cleaner Rakefile
defunkt authored
17 task :default => :test
fba6b3d @defunkt rakefile
defunkt authored
18
4e695ad @locks Removes turn and switches test/unit for minitest
locks authored
19 Rake::TestTask.new do |t|
20 t.libs << 'lib'
21 t.pattern = 'test/**/*_test.rb'
22 t.verbose = false
dc4bde5 @defunkt rakefile tweaks, manpage tasks
defunkt authored
23 end
24
3c73c33 @defunkt Rakefile tweaks
defunkt authored
25
6b6cc76 @defunkt cleaner Rakefile
defunkt authored
26 #
27 # Ron
28 #
29
054f192 @defunkt ronn
defunkt authored
30 if command? :ronn
6b6cc76 @defunkt cleaner Rakefile
defunkt authored
31 desc "Show the manual"
32 task :man => "man:build" do
33 exec "man man/mustache.1"
34 end
35
36 desc "Build the manual"
37 task "man:build" do
054f192 @defunkt ronn
defunkt authored
38 sh "ronn -br5 --organization=DEFUNKT --manual='Mustache Manual' man/*.ron"
6b6cc76 @defunkt cleaner Rakefile
defunkt authored
39 end
dc4bde5 @defunkt rakefile tweaks, manpage tasks
defunkt authored
40 end
dcef832 @defunkt add `rake gem` task
defunkt authored
41
cbf554f @defunkt kicker support via `rake kicker`
defunkt authored
42
6b6cc76 @defunkt cleaner Rakefile
defunkt authored
43 #
44 # Gems
45 #
46
159df32 @defunkt generated manual
defunkt authored
47 desc "Push a new version to Gemcutter and publish docs."
48 task :publish do
49 require File.dirname(__FILE__) + '/lib/mustache/version'
50
51 system "git tag v#{Mustache::Version}"
627ede8 @defunkt simplify
defunkt authored
52 sh "gem build mustache.gemspec"
53 sh "gem push mustache-#{Mustache::Version}.gem"
159df32 @defunkt generated manual
defunkt authored
54 sh "git push origin master --tags"
55 sh "git clean -fd"
56 exec "rake pages"
cb36d62 @defunkt jeweler support (requires edge + bugfix for #version=)
defunkt authored
57 end
58
6b6cc76 @defunkt cleaner Rakefile
defunkt authored
59 #
60 # Documentation
61 #
62
ba52535 @defunkt publish manpages to gh-pages
defunkt authored
63 desc "Publish to GitHub Pages"
a408147 @defunkt build:man => man:build
defunkt authored
64 task :pages => [ "man:build" ] do
ba52535 @defunkt publish manpages to gh-pages
defunkt authored
65 Dir['man/*.html'].each do |f|
66 cp f, File.basename(f).sub('.html', '.newhtml')
67 end
68
84ee9c9 @defunkt dummy commits
defunkt authored
69 `git commit -am 'generated manual'`
56952b7 @defunkt tweak `rake pages` command
defunkt authored
70 `git checkout site`
ba52535 @defunkt publish manpages to gh-pages
defunkt authored
71
72 Dir['*.newhtml'].each do |f|
73 mv f, f.sub('.newhtml', '.html')
74 end
75
76 `git add .`
77 `git commit -m updated`
56952b7 @defunkt tweak `rake pages` command
defunkt authored
78 `git push site site:master`
ba52535 @defunkt publish manpages to gh-pages
defunkt authored
79 `git checkout master`
80 puts :done
81 end
Something went wrong with that request. Please try again.