Skip to content

Instantly share code, notes, and snippets.

@jackcallister
Created April 23, 2014 10:53
Show Gist options
  • Save jackcallister/11210672 to your computer and use it in GitHub Desktop.
Save jackcallister/11210672 to your computer and use it in GitHub Desktop.
Turn Rails into a SPA generator
namespace :app do
desc "Build static distrubution"
task :build do
puts "Building..."
# Shell out for now...
`bundle exec rake assets:clean`
puts "Compiling"
`bundle exec rake assets:precompile`
puts "Starting web get"
`wget -m localhost:3001 --directory-prefix=dist --no-host-directories`
puts "Copying assets"
`cp -r public/assets dist/assets`
puts "Cleaning"
`bundle exec rake assets:clean`
puts "Done"
end
end
@jackcallister
Copy link
Author

Just load up your ember app into the root controller action and you're good to go. Also install wget http://osxdaily.com/2012/05/22/install-wget-mac-os-x/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment