Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* ---------------------------------------------------------------------------- | ||
* "THE BEER-WARE LICENSE" (Revision 42): | ||
* elcuervo wrote this file. As long as you retain this notice you | ||
* can do whatever you want with this stuff. If we meet some day, and you think | ||
* this stuff is worth it, you can buy me a beer in return Bruno Aguirre | ||
* ---------------------------------------------------------------------------- | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Cuba/Sugar | ||
========== | ||
|
||
_n_. bundled sugar for [cuba](https://github.com/soveran/cuba) | ||
|
||
![Cuba Sugar Cane Cutter In Field](http://maynardswitzer.com/library/Cuba/2002CubaSugarCaneCutterInField.A.jpg) | ||
|
||
Description | ||
----------- | ||
|
||
It's like contrib stuff but with a cooler name. | ||
Provides helpers and utilities to use with cuba. | ||
|
||
Usage | ||
----- | ||
|
||
Like any other cuba app, but provides: | ||
|
||
### as | ||
|
||
require "cuba" | ||
require "cuba/sugar" | ||
|
||
Cuba.use Rack::Session::Cookie | ||
|
||
Cuba.define do | ||
on post do | ||
on "users" do | ||
# create user | ||
as 201, {"Content-Location" => "http://somewhere.com/users/705"} do | ||
"user #{user.id} created" | ||
end | ||
end | ||
end | ||
end | ||
|
||
Installation | ||
------------ | ||
|
||
$ gem install cuba-sugar |