Project

serveable

0.0
No commit activity in last 3 years
No release in over 3 years
Provides a module that allow you to easily incorporate a simple 'server -> site -> page' model on top of rack.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Serveable

Serveable simplifies creating a Rack mountable site. It contains a Site module and an Item module. These can be mixed into classes that expose the correct interface to turn them into easy Rack-fodder.

See example/simple.rb for a basic implementation.

That interface you speak of...

A Site must implement the following:

  • #each(&block), which enumerates Item type objects.

An Item must implement the following:

  • #contents, that returns the contents;
  • #url, that returns the full url to serve at.