vanntastic / quartet

Quartet is a sub framework for Sinatra, it gives you automatic get requests, erb view helpers and more...

This URL has Read+Write access

README.markdown

Quartet

Quartet is a sub framework for the Sinatra web framework, you might be asking... what!? Why make a sub framework of another framework? Simple ... because it's easier to work with the constraint of conventions, rather than reinvent the wheel over and over again. Sinatra gives you a ton of freedom when you start a new app in it, I figure it would make more sense if I give it some more structure. I borrow a bit of everything from other frameworks such as rails, overall it's a nice lightweight alternative to using a bulkier frameworks such as rails or merb. This is my first real project with Sinatra, it will become a sandbox for everything that I do in Sinatra, so it is not recommended for production use of anything right now until I test it otherwise.

It's suited for the following situations:

  • brochure websites 5-10 pages and maybe a contact form
  • small service based websites that are meant to serve a simple purpose

REQUIREMENTS

  • sinatra
  • activesupport

FEATURES

  • organized directories; all directories are setup for you automatically:
    • public/css : this is where all your css files go
    • public/images : this is where all your images go
    • public/js : this is where all your js files will go
  • view specific helpers; similar to rails helpers stored inside the helpers directory, they are kind of like controllers, but we don't use models... yet. So I decided the helpers was a more appropriate term.
  • free get requests setup for view files, in order to setup a new get request (action), you can just generate a view file (erb or haml) and Quartet will generate a get block for you.

So instead of:

    get "/about" do
        # stuff you do
    end

You can just generate a view for about and you get the 'about' request and a helper file at helpers/about.rb - erb helpers; these are helpers that you can use to help you write your erb templates - easier to use layouts; layouts in Sinatra were somewhat wierd to use, so I've made it trivial and more flexible, you can simply call:

    layout :layout_name

in any of your view helpers to specify what layout files to use, all layout files are specified with the "_layout" suffix to it to tell Quartet that it is a layout. Most of the time

INSTALLATION

Will write soon...

ERB HELPERS

Will write soon...

GENERATORS

Will write soon...

LICENSE

Will write soon...

THANKS

Will write soon...

TODOS

  • Finish readme
  • Update index (welcome page) file to have a better looking and more practical introduction
  • Create sake generator tasks
  • Add Jquery libraries
  • Add plugin loading mechanism
  • Install sinatra-cache as a plugin? git://github.com/kematzy/sinatra-cache.git
  • Install sinatra-email as a plugin? git://github.com/foca/sinatra-mailer.git
  • Figure out if you want to use a orb library for simple model based actions