forked from foundation/foundation-sites
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rb
28 lines (23 loc) · 1.33 KB
/
build.rb
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
# Creates a zip file of the Foundation template and the compessed assets
`rm -rf public marketing/files/foundation-download.zip`
`jammit`
`mkdir public/src public/src/javascripts public/src/stylesheets`
`cp -R humans.txt images index.html robots.txt public/src`
`cp public/assets/foundation.js public/src/javascripts`
`cp stylesheets/ie.css public/src/stylesheets/ie.css`
`cp stylesheets/app.css public/src/stylesheets/app.css`
`cp javascripts/app.js public/src/javascripts/app.js`
File.open('public/src/stylesheets/foundation.css', "w") do |file|
%w{stylesheets/globals.css stylesheets/typography.css stylesheets/grid.css stylesheets/ui.css stylesheets/forms.css stylesheets/orbit.css stylesheets/reveal.css stylesheets/mobile.css}.each do |stylesheet|
file.puts File.read(stylesheet)
end
end
file_name = 'public/src/index.html'
text = File.read(file_name)
text.gsub!(/<!-- Combine and Compress These CSS Files -->.+<!-- End Combine and Compress These CSS Files -->/m, "<link rel=\"stylesheet\" href=\"stylesheets/foundation.css\">")
text.gsub!(/<!-- Combine and Compress These JS Files -->.+<!-- End Combine and Compress These JS Files -->/m, "<script src=\"javascripts/foundation.js\"></script>")
File.open(file_name, "w") do |file|
file.puts text
end
`cd public/src && zip -r ../../marketing/files/foundation-download.zip *`
`rm -rf public`