Presto
a Classy Web Framework aimed at Speed and Simplicity

Fast Human and server time are equally precious

Presto offers a full set of utilities needed to Quickly build Speedy web applications

Tidy Presto keeps everything clean and organized

It adds only 3 methods to controllers: http, view and ctrl

Modular Do not Repeat Yourself

Any module containing Presto controllers can be mounted into any Presto app

Configurable Control everything with ease

Presto offers fine-grained control over applications, slices, controllers and actions

In terms of use, Presto is a standard web framework

In terms of uniqueness, Presto featuring Speed and Cleanness

Presto supports 3 authorization types:

  • Basic
  • Digest
  • HTML

Basic Auth:

http.auth do |user, pass|
    user == 'admin' &&
        pass == 'someScrtPswd'
end

More...

By default, any action has halt, forward and redirect capabilities enabled, as well as read/write access to session and cookies.

To create more restrictive actions, use http.confine method inside a hook:

http.before do
    http.confine
end

More...

Cache module will store the response returned by action and will return it on next requests without executing action.

To enable cache, simply call http.cache with a block:

http.cache { true }

If given block returns :update [Symbol], cache for current action will be updated.

If given block returns :purge [Symbol], cache for current controller will be updated.

More...

Templates compilation is a time consuming operation. Even worse, it is blocking app while templates are read from file system.

A proper solution would be to compile templates only once, then render them constantly on each request.

To enable compiler, simply do:

view.compile do
    true # or :update or :purge
end

More...

Presto uses inline testing, meant you can write logic and tests using same ink on same paper.

# defining action
def index
    'ok'
end
# testing action
ctrl.spec 'Ok Test' do
    Should 'return ok' do
        response = get
        is(response.body) == 'ok'
    end
end

More...

As simple as:

class Cms
  include Presto
  http.map

  http.rewrite /(.*)\.php$/i do |name|
    "page/#{ name }.html"
  end
end

Rewrite rules can be set at both slice and controller levels.
More...
back to top