Anobik

DESCRIPTION:

Anobik is a simple rack middleware ruby microframework

FEATURES/PROBLEMS:

Anobik is a Rack based microframework that provides an easy way to map URL patterns to classes. URL patterns can be literal strings or regular expressions. when URLs are processed:

	* the beginning and end are anchored (^ $)
	* an optional end slash is added (/?)
	* the i option is added for case-insensitive searches
	* respective class method is called depending on the request method (GET/POST etc.)

Anobik does not provide any database handling mechanism yet. You can ofcourse use any opensource database access layer with it - it’s pretty flexible. Anobik is suitable for small micro-sites where you would love to use your favorite programming language but Rails is a bit heavy for that.

Anobik acts as a Rack middleware app and that means you can use it with a number of webservers including Thin, LiteSpeed, Phusion Passangeretc. And the best part is, you can also use it with Rails, Sinatra or any other Rack based frameworks.

Anobik is truely feather-weight. It has < 250 LOC! It does not have many features but it can get you started early. More docs and more changes are coming soon, stay tuuneed!

SYNOPSIS:

  • configs/routes.rb

class Routes
  URLS = {
    "/" => "index",
    "/page/(\\d+)" => "page",
  }
end
  • resources/index.rb

class Index < Anobik::Resource
  def get
    @hello = "Hello"
    render 'index', {:world => 'world'}
  end
end
  • faces/index.erb

<%= [@hello, @world].join(' ') %>
  • command

$ ruby -rubygems server
OR
$ rackup config.ru
  • url

GET /index/1

REQUIREMENTS:

Ruby 1.9 and Rack are the pre-requisites

INSTALL:

gem sources -a http://gems.github.com
sudo gem install anupom-anobik

LICENSE:

(The MIT License)

Copyright © 2009 syamantics.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.