Sha256: f24afed86f8a5d9080040a17af76c81b45946e593f1658eb58905054719d4494

Contents?: true

Size: 1.61 KB

Versions: 2

Compression:

Stored size: 1.61 KB

Contents

Sinatra Twitter Bootstrap (css+js+helpers)
=================

What?
--------

A set of helpers that brings beauty of Twitter Bootstrap CSS to your Sinatra
applications. This gem bundle all CSS and Javascript files needed for this.

Why?
--------

I want to make my small Sinatra apps looks nice with minimal effort. Currently
I need to download all CSS and Javascript, add them to public folder and include
them in HAML templates. That is just too much work!

How?
--------

Is simple. Add this line to your Gemfile:

    gem 'sinatra-twitter-bootstrap'

Then in your Sinatra application/class you can do:

    class TestApp < Sinatra::Base
      register Sinatra::Twitter::Bootstrap::Assets
    end

(TODO: make this a bit shorter)

Now, surprise surprise! Your application will automatically generate routes for
bootstrap CSS and JS files. It will also setup HTTP caching and ETags, so it
will not be too much overheat for your app.

Since I'm old and lazy, I create small helpers you can use in your HAML views:

    %html
      %head
        = bootstrap_assets
      %body
        - container :fluid do
          - row do
            - span3 do
              = yield
            - span5 :offset => 4 do
              %p hello world


The full example could be found in 'examples' directory.


License
--------

This code is licensed under Apache Software License (ASLv2)
http://www.apache.org/licenses/LICENSE-2.0.txt

Twitter Bootstrap is licenced under Apache Software License (ASL)
http://www.apache.org/licenses/LICENSE-2.0.txt

JQuery is licenced under MIT license.
HTML5 Shiv is licenced under MIT/GPL2 (https://github.com/aFarkas/html5shiv)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sinatra-twitter-bootstrap-2.3.1.1 README.md
sinatra-twitter-bootstrap-2.3.1 README.md