Created
November 17, 2011 15:33
-
-
Save jch/1373423 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/tasks/export.rake | |
require 'pathname' | |
def export(path) | |
path = Pathname.new('export' + path) # prefix a folder to export to to | |
path.dirname.mkpath # creates any intermediate folders | |
`curl http://localhost:3000/#{path} > #{path.to_s}` | |
end | |
desc "Export pages" | |
task :export => :environment do | |
include Rails.application.routes.url_helpers | |
# name the specific routes you'd like exported | |
export welcome_path | |
export root_path | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment