Project

flatspace

0.0
No commit activity in last 3 years
No release in over 3 years
These helpers make it easy to make apps with Sinatra or other Rack based frameworks
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0

Runtime

~> 1.4
 Project Readme

Flatspace ruby web app helpers

Request helpers for flat space ruby apps running Sinatra.

Installation

gem install flatspace

or add to your Gemfile.

Usage

# Include as helper in your Sinatra app
helpers Flatspace::Helpers::Request

# Login redirect unless session[:u] is set
login

# Password is valid?
password_valid?

# HTTP Basic auth authentication
protect!

# Check HTTP Basic authorization
authorized?

# Colorize input green or red
green('text')
red('text')

# Errors, use for request errors
e
e[:id]
e.any?

# Params
p
p[:i]
p[:i] = 'val'

# Flash
f
f[:i]
f[:i] = 'val'

# Session
s
s[:u]
s[:u] = 'val'

# Halt, stop and return
h(val)

# Go, redirect to path
go(path)

# Go with flash[:info]
go(path, :i => 'message')

# Go with flash[:error]
go(path, :e => 'error')

# Show erb view and use flash.now
now(:view)
now(:view, :i => 'message')
now(:view, :f => 'error')

Created and maintained by Fugroup Ltd. We are the creators of CrowdfundHQ.

@authors: Vidar