Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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