Skip to content

Instantly share code, notes, and snippets.

@jinpark
Forked from Eunoia/static_site.rake
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jinpark/774d7d931daecd3f561b to your computer and use it in GitHub Desktop.
Save jinpark/774d7d931daecd3f561b to your computer and use it in GitHub Desktop.
namespace :static do
desc 'Generate static site in ./out/ directory'
task :generate do
Dir.mkdir 'out' unless File.exist? 'out'
Dir.chdir 'out' do
`wget -mnH http://localhost:3000/`
end
`rsync -ruv --exclude=.svn/ public/ out/`
end
desc 'Run tiny HTTP server from ./out/ directory'
task :server do
Dir.chdir 'out' do
puts 'Started HTTP server at http://localhost:8000/. Press CTRL+C to exit.'
`python -m SimpleHTTPServer`
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment