Project

trilby

0.0
No commit activity in last 3 years
No release in over 3 years
Because its on top of sinatra
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Trilby , because is sits on top of Sinatra.

This allows a user to write sinatra routes with a smart DSL like so

    # get route, class, method_name
    get "/example/one", ExampleController, :example_one

Routes should not contain trailing slashes; they are added optionally by default.

It also allows a controller to have access to methods that the rest of the application does not. Typically with Sinatra, if you need to call a method, you have to add it to the helper class, which become dirty very quickly.

    def controller_specific_logic()
        if sinatra.request.referer =~ /black.lagoon/
            return "the black lagoon"
        else
            return "a mysterious place..."
        end

    end

    def example_one
        "It came from " + controller_specific_logic
    end

TODO

  • before filters (?)
  • check if method exists
  • rake routes
  • context for routes