Skip to content

Instantly share code, notes, and snippets.

@manveru
Created January 25, 2011 15:47
Show Gist options
  • Save manveru/795096 to your computer and use it in GitHub Desktop.
Save manveru/795096 to your computer and use it in GitHub Desktop.
Generate static pages in Ramaze
require 'ramaze'
class Main < Ramaze::Controller
def index
make_static
end
private
def make_static
unless action.options[:make_static]
action.options[:make_static] = true
File.open "public/#{action.name}.html", 'w+' do |io|
io.write action.call
end
end
end
end
Ramaze.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment