-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathRakefile
56 lines (46 loc) · 1.53 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
require 'rubygems'
require 'haml'
require 'yaml'
desc "Creates the html documentation"
task :doc do
template = File.read('template/index.haml')
engine = Haml::Engine.new(template)
input = YAML.load_file("template/functions.yaml")
out = engine.render(Object.new, input)
File.open("docs/index.html", "w") { |file| file.write(out) }
end
namespace :rock do
version = "0.4-0"
rocks_home = "/Users/mirven/Projects"
desc "Uploads the current copy of the code to my rockserver"
task :default => [:rockspec, :package, :release] do
end
task :rockspec do
`sed s/\\$version/#{version}/ < template/underscore.lua.rockspec > out/underscore.lua-#{version}.rockspec`
end
task :package do
`git archive --format=zip --prefix underscore.lua-#{version}/ master >out/underscore.lua-#{version}.zip`
end
task :release do
puts `cp out/underscore.lua-#{version}.rockspec #{rocks_home}/luarocks`
puts `cp out/underscore.lua-#{version}.zip #{rocks_home}/luarocks`
Dir.chdir rocks_home do
puts `luarocks-admin make_manifest luarocks`
puts `s3sync -r luarocks/ marcusirven:rocks --public-read`
end
`git tag -a -m "tagging version #{version}" #{version}`
`git push origin --tags`
end
end
desc "Updates http://mirven.github.com/underscore.lua"
task :pages => :doc do
`cp -r docs docs.tmp`
`git checkout gh-pages`
`cp -r docs.tmp/* .`
`rm -rf docs.tmp`
`git add css`
`git add *.html`
`git commit -m "update pages"`
`git push origin gh-pages`
`git checkout master`
end