0.0
No commit activity in last 3 years
No release in over 3 years
Simple request handler scoping for sinatra
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 2000.0.0
= 0.4.0

Runtime

>= 0.9.4
 Project Readme

Sinatra Scopes

Simple scoping for your request handlers. From example_app.rb:

scope :project, '/projects/*' do |project_id|
  @project = Project[project_id]
end

project.get '/users/*' do |user_id|
  @user = User[user_id]
  "#{@project}, #{@user}"
end

Scopes don't have to specify a path pattern:

scope(:authorized) { auth }

authorized.get '/sekret/*' do |page|
  page
end

Similar Implementations

dcparker - cilantro/lib/cilantro/controller.rb