This repository has been archived by the owner on May 6, 2019. It is now read-only.
forked from mustache/mustache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
112 lines (93 loc) · 2.82 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
require 'rake/testtask'
require 'rake/rdoctask'
task :default => :test
desc "Build a gem."
task :gem => [ :gemspec, :build ]
Rake::TestTask.new do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end
desc "Build the manual"
task :build_man do
sh "ron -br5 --organization=DEFUNKT --manual='Mustache Manual' man/*.ron"
end
desc "Show the manual"
task :man => :build_man do
exec "man man/mustache.1"
end
desc "Launch Kicker (like autotest)"
task :kicker do
puts "Kicking... (ctrl+c to cancel)"
exec "kicker -e rake test lib examples"
end
begin
require 'jeweler'
$LOAD_PATH.unshift 'lib'
require 'mustache/version'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "mustache"
gemspec.summary =
"Mustache is a framework-agnostic way to render logic-free views."
gemspec.version = Mustache::Version
gemspec.executables = ["mustache"]
gemspec.homepage = "http://github.com/defunkt/mustache"
gemspec.authors = ["Chris Wanstrath"]
gemspec.email = "chris@ozmm.org"
gemspec.description = <<description
Inspired by ctemplate, Mustache is a framework-agnostic way to render
logic-free views.
As ctemplates says, "It emphasizes separating logic from presentation:
it is impossible to embed application logic in this template
language.
Think of Mustache as a replacement for your views. Instead of views
consisting of ERB or HAML with random helpers and arbitrary logic,
your views are broken into two parts: a Ruby class and an HTML
template.
description
end
rescue LoadError
warn "Jewler not available."
warn "Install it with: gem i jewler"
end
# begin
# require 'sdoc_helpers'
# rescue LoadError
# warn "sdoc support not enabled. Please gem install sdoc-helpers."
# end
desc "Push a new version to Gemcutter"
task :publish => [ :test, :gemspec, :build ] do
system "git tag v#{Mustache::Version}"
system "git push origin v#{Mustache::Version}"
system "git push origin master"
system "gem push pkg/mustache-#{Mustache::Version}.gem"
system "git clean -fd"
exec "rake pages"
end
desc "Publish to GitHub Pages"
task :pages => [ :build_man ] do
Dir['man/*.html'].each do |f|
cp f, File.basename(f).sub('.html', '.newhtml')
end
`git commit -am 'generated manual'`
`git checkout gh-pages`
Dir['*.newhtml'].each do |f|
mv f, f.sub('.newhtml', '.html')
end
`git add .`
`git commit -m updated`
`git push origin gh-pages`
`git checkout master`
puts :done
end
desc "Install the edge gem"
task :install_edge => [ :dev_version, :gemspec, :build ] do
exec "gem install pkg/mustache-#{Mustache::Version}.gem"
end
# Sets the current Mustache version to the current dev version
task :dev_version do
$LOAD_PATH.unshift 'lib/mustache'
require 'mustache/version'
version = Mustache::Version + '.' + Time.now.to_i.to_s
Mustache.const_set(:Version, version)
end