Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 83 lines (55 sloc) 3.009 kb
8b93688 @peterhellberg Pivoting from asset management to Sinatra app generation.
peterhellberg authored
1 ![Hazel](http://c7.github.com/hazel/images/hazel_small.png)
2
3 A simple Sinatra app generator, heavily based on [snfn](https://github.com/zachpendleton/snfn).
4
4f111de @peterhellberg Added demo gif
peterhellberg authored
5 ![Using Hazel](http://c7.github.com/hazel/images/using_hazel.gif)
6
8b93688 @peterhellberg Pivoting from asset management to Sinatra app generation.
peterhellberg authored
7 ## Installation
8
9 gem install hazel
10
11 ## Configuration
12
13 * `-d` Database. Options are "postgres," "mysql," "sqlite", and "mongo."
14 Default is "sqlite."
15 * `--redis` Include Redis configuration options.
2b01910 @peterhellberg New configuration option --rvm-gemset
peterhellberg authored
16 * `--rvm-gemset` Create a new RVM Gemset under the current Ruby
8b93688 @peterhellberg Pivoting from asset management to Sinatra app generation.
peterhellberg authored
17 * `--no-database` Don't include any database config options.
271c6a7 @peterhellberg Added the --no-git-repo argument
peterhellberg authored
18 * `--no-bundle-install` Don’t run bundle install after generating the app
19 * `--no-git-repo` Don’t initialize a Git repository
8b93688 @peterhellberg Pivoting from asset management to Sinatra app generation.
peterhellberg authored
20
21 ## Example
22
23 Standard app, using sqlite.
24
25 hazel my_app
26
27 App using MySQL and Redis.
28
29 hazel my_app -d mysql --redis
30
31 App using MongoDB and Redis, but don’t run bundle install.
32
33 hazel my_app -d mongo --redis --no-bundle-install
34
aaa7e71 @peterhellberg New example command, and fixed typo.
peterhellberg authored
35 App using Redis, a RVM Gemset, but no database or Git repo
36
37 hazel my_app --redis --rvm-gemset --no-database --no-git-repo
38
8b93688 @peterhellberg Pivoting from asset management to Sinatra app generation.
peterhellberg authored
39 ## Architecture
40
41 The template autoloads files in config/initializers and
42 /lib. Database configuration options are stored in `config/db.yml`
43 and are loaded via `config/initializers/database.rb`.
44
45 ## DB Setup
46
47 [Sequel](http://sequel.rubyforge.org) is used as an ORM for
48 relational databases, and migrations are stored in db/migrate.
aaa7e71 @peterhellberg New example command, and fixed typo.
peterhellberg authored
49 Migrations can be run using the rake command `rake db:migrate`.
8b93688 @peterhellberg Pivoting from asset management to Sinatra app generation.
peterhellberg authored
50
51 [mongodb_model](https://github.com/alexeypetrushin/mongodb_model)
52 is used for Mongo apps, with the config options
53 stored in the same files as relational databases (`config/db.yml`
54 and `config/initializers/database.rb`).
55
56 ### More information
57
58 * [Sequel Migrations](http://sequel.rubyforge.org/rdoc/files/doc/migration_rdoc.html)
59 * [Sequel Models](http://sequel.rubyforge.org/rdoc/classes/Sequel/Model.html)
60
61 ## License
62
63 Copyright (c) 2012 Peter Hellberg
64
65 Permission is hereby granted, free of charge, to any person obtaining
66 a copy of this software and associated documentation files (the
67 "Software"), to deal in the Software without restriction, including
68 without limitation the rights to use, copy, modify, merge, publish,
69 distribute, sublicense, and/or sell copies of the Software, and to
70 permit persons to whom the Software is furnished to do so, subject to
71 the following conditions:
72
73 The above copyright notice and this permission notice shall be
74 included in all copies or substantial portions of the Software.
75
76 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
77 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
78 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
79 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
80 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
81 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
82 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.