Staticify

Staticify is a tool for creating static sites in Ruby.

There are lots of tools out there already for creating static sites, eg:

Jekyll

http://jekyllrb.com

StaticMatic

http://staticmatic.rubyforge.org

webgen

http://webgen.rubyforge.org

Webby

http://webby.rubyforge.org

The problem with these tools, in my opinion, is that they make you code your sites in a certain way.

What if you want to code your blog in Rails or Sinatra or something?

Staticify is intended to solve this problem for you. If you want to code your static site in any Rack-based web framework, go right ahead!

You can use Staticify to statically cache responses to your app.

Installation

$ gem sources -a http://gems.github.com
$ sudo gem install remi-staticify

Usage

Simple script for staticifying your Rack applications

staticify == %{ For staticifying your Rack applications }

Usage:
  echo 'paths' | staticify      # print this usage information
  echo 'paths' | staticify .    # staticify Rack app in current directory

Note:
  staticify expects to get the paths to hit via STDIN

Options:
  -d, --dir some/directory   # directory to save files to
  -a, --app "MyApp.new"      # ruby to eval to get Rack app
  -r, --require file[.rb]    # ruby file(s) to require

Notes

Checks for config.ru / Rails by default, otherwise you can:

$ staticify -r myapp.rb --app 'lambda {|env| [200, {}, "hi!"] }' info
$ staticify -r myapp.rb,another-file.rb --app 'Sinatra::Application' get '/'
$ staticify -r myapp --app 'MyApp.new' '/'