Trellis 0.0.1 on GitHub

Posted by Brian Sam-Bodden Sat, 29 Aug 2009 15:37:00 GMT

The experimental code base for the Trellis framework is now on GitHUb at

http://github.com/bsbodden/trellis

git://github.com/bsbodden/trellis.git

It is rough around the edges but it embodies the general principles of what I want in a Ruby Component-based Web Framework. It is by no means production ready.

Pivotal Tracker

http://www.pivotaltracker.com/projects/24696

RubyForge Page

http://rubyforge.org/projects/trellis/

Install

gem install trellis

HelloWorld 

The simple Hello World example consists of one Application and one Page. The Application defines its home page as the symbol :hello which is resolved to the Home page class. The Home page provides its markup via the template class method which takes a block of Markaby. Finally the application is launched by instantiating the Application object and using the start method (runs on port 3000 by default)

require 'rubygems'
require 'trellis'

module Hello
  class HelloWorld < Trellis::Application
    home :home
  end

  class Home < Trellis::Page
    template do html { body { h1 "Hello World!" }} end
  end
end

Hello::HelloWorld.new.start if __FILE__ == $PROGRAM_NAME

Tags ,

Comments are disabled