• Stars
    star
    146
  • Rank 252,769 (Top 5 %)
  • Language
    Ruby
  • License
    MIT License
  • Created almost 16 years ago
  • Updated about 12 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rubigen based generator for new sinatra projects

sinatra-gen¶ ↑

github.com/quirkey/sinatra-gen

DESCRIPTION:¶ ↑

sinatra-gen generates a common file structure and basic app files for a web app utilizing the sinatra framework. For more information on sinatra, check out sinatrarb.com

SYNOPSIS:¶ ↑

sinatra-gen has a bunch of different options (based looseley on merb-gen) to try to not lock the user into any specific frameworks/dev practices.

Run:

sinatra-gen [appname] [options] [paths]

e.g.

sinatra-gen mysinatrapp --vendor --init --test=shoulda --views=haml get:/ post:/:id

! Note: As of version 0.4.0 by default the sinatra app is placed in lib/appname.rb and is a subclass of Sinatra::Application. If you want ‘classic’ style apps (no class/module) use the –tiny option.

Actions¶ ↑

For even faster app development you specify actions to include in your app when generating. Actions are written out as

http_method:path

And are separated by spaces. For example:

get:/ post:/:id put:/update/*

Will be added you your app as:

get '/' do
end

post '/:id' do
end

put '/update/*' do
end

It will also generate test skeletons in the test framework of your choosing.

Middleware¶ ↑

You can specify middleware to include by passing the filename(s) or class name(s), seperated by commas.

sinatra-gen myapp --middleware=rack/flash,Rack::Cache

Will place both the ‘require’ and ‘use’ statements in your app.

require 'rack/flash'
require 'rack/cache'

#...

use Rack::Flash
use Rack::Cache

Options ¶ ↑

(can also be obtained by running sinatra-gen with no arguments):

   -v, --version                    Show the sinatra-gen version number and quit.
   -d, --vendor                     Extract the latest sinatra to vendor/sinatra
       --tiny                       Only create the minimal files.
       --init                       Initialize a git repository
       --heroku                     Create a Heroku app (also runs 'git init').
Optionally, specify the path to the heroku bin
       --cap                        Adds config directory with basic capistrano deploy.rb
       --scripts                    Install the rubigen scripts (script/generate, script/destroy)
       --test=test_framework        Specify your testing framework (bacon (default)/rspec/spec/shoulda/test)
       --views=view_framework       Specify your view framework (haml (default)/erb/builder)
       --middleware=rack-middleware Specify Rack Middleware to be required and included (comma delimited)
       --vegas, --bin=[bin_name]    Create an executable bin using Vegas. Pass an optional bin_name

General Options:

-h, --help                       Show this help message and quit.
-p, --pretend                    Run but do not make any changes.
-f, --force                      Overwrite files that already exist.
-s, --skip                       Skip files that already exist.
-q, --quiet                      Suppress normal output.
-t, --backtrace                  Debugging: show backtrace on errors.
-c, --svn                        Modify files with subversion. (Note: svn must be in path)
-g, --git                        Modify files with git. (Note: git must be in path)

The –tiny option will create no directories. Just an app.rb, a Rakefile, and a config.ru (Rackup file)

ACKNOWLEDGEMENTS:¶ ↑

Big props to the Sinatra developers (github.com/bmizerany/sinatra/). Also, thanks to Dr. Nic (github.com/drnic) for the Rubigen and Newgem libraries

REQUIREMENTS:¶ ↑

To use the –vendor option, git must be installed. To use the –bin/vegas option Vegas is required (sudo gem install vegas). To use the –heroku option, a Heroku account and the heroku gem is required (sudo gem install heroku).

To run the app without using the vendor option, the sinatra gem must be installed.

INSTALL:¶ ↑

sudo gem install sinatra-gen

You can also install directly from github:

sudo gem install quirkey-sinatra-gen -s http://gems.github.com

More Repositories

1

sammy

Sammy is a tiny javascript framework built on top of jQuery, It's RESTful Evented Javascript.
JavaScript
2,990
star
2

resque-status

resque-status is an extension to the resque queue system that provides simple trackable jobs.
Ruby
519
star
3

magick

go (golang) wrapper around imagemagick
Go
209
star
4

vegas

Vegas aims to solve the simple problem of creating executable versions of Sinatra/Rack apps.
Ruby
184
star
5

swinger

Swinger is a couchapp for creating and showing presentations. Think Keynote, stored in CouchDB, run via Javascript and Sammy.js.
JavaScript
175
star
6

soca

Sammy On Couch App
JavaScript
156
star
7

jim

jim is your friendly javascript library manager
JavaScript
94
star
8

static_model

ActiveRecord like functionalities for reading from YAML with a simple class implementation
Ruby
61
star
9

resque-metrics

Metrics for your Resque jobs and workers
Ruby
55
star
10

the_json_store

Code for the Sammy Tutorial series
JavaScript
53
star
11

gembox

A sinatra based interface for browsing and admiring your gems
JavaScript
50
star
12

node-logger

A simple logging library that combines the simple APIs of Ruby's logger.rb and browser-js console.log()
JavaScript
47
star
13

stackprof-remote

A Middleware and CLI for fetching and interacting with [StackProf](https://github.com/tmm1/stackprof) dumps.
Ruby
41
star
14

redisk

An interface to Redis that mimic's Ruby's IO classes
Ruby
34
star
15

qadmin

A RESTful resource module and generator
Ruby
28
star
16

restful_query

ActiveRecord extension for querying data in a restful way
Ruby
25
star
17

action

simple soca (couchapp) for managing tasks
JavaScript
21
star
18

basecamphp

PHP Wrapper for the 37 Signals Basecamp API
PHP
21
star
19

sammyjs-org

Sammyjs.org
JavaScript
20
star
20

sinatra-sammy

A Sinatra extension that turns a Sinatra app into a one page app using the teamwork of Sammy.
Ruby
17
star
21

columnlog

a work in progress
Ruby
17
star
22

minitest-display

Patches MiniTest to allow for an easily configurable output. For Ruby 1.9 :D
Ruby
15
star
23

sammy-pushstate

Simple example soca/sammy/couchapp using the Sammy HTML5 History support
JavaScript
12
star
24

downlow

Downloading files on the DL
Ruby
11
star
25

qadmin-demo

A demo Rails app showcasing the Qadmin gem
Ruby
11
star
26

objspace_viewer

WIP Sinatra/AR app to view/analyze heapdumps from Ruby's ObjectSpace.dump_all
Ruby
11
star
27

quirkey.github.com

My github home
JavaScript
10
star
28

is_porterable

A rails plugin for easily adding import/exportability from/to CSV
Ruby
8
star
29

jqunit-spec

Its like BDD for your JS
JavaScript
7
star
30

portfolio

Sinatra app that powers my portfolio
JavaScript
7
star
31

remix-stash

A new way to deal with memcached
Ruby
6
star
32

imanip

Super-quick image resizing using the ImageMagick command line tools
Ruby
6
star
33

sequel-web

Browse (almost) any SQL database with a web browser using the power of Sequel + Sinatra
JavaScript
5
star
34

jekyll_layouts

Layout files for jekyll, specifically for code.quirkey.com
4
star
35

oneforty

An entirely client-side twitter using sammy.js
JavaScript
4
star
36

halpers

General helpers for different projects
Ruby
4
star
37

quirkey_com

Source for quirkey.com
JavaScript
3
star
38

format_benchmark

Some simple benchmarks for a talk about serialization formats in Ruby
Ruby
3
star
39

lighthouse_stats

Some scripts to generate some SCRUMish stats from Lighthouse
Ruby
3
star
40

rails-boot-reporting

A hack to output times of different tasks in the rails (2) boot process
Ruby
3
star
41

ey-cloud-recipes

A starter repo for custom chef recipes on EY's cloud platform
Ruby
2
star
42

rapture.js

Demo soca/sammy app using pushState and storage for jsbbq
JavaScript
2
star
43

qcontent

Mixins and Modules for extending ActiveRecord content models
Ruby
2
star
44

purse

Simple secure password/data storage via Ruby and Git (In development)
Ruby
2
star
45

flashdance

Get your Rails flash[] out of your controllers and into a YAML
Ruby
2
star
46

quirkey_theme

My wordpress theme
JavaScript
2
star
47

sammy-presentations

Presentations about Sammy
1
star
48

redis-reqrep

Ruby
1
star