Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
badosu committed Apr 23, 2015
0 parents commit dd506b9
Show file tree
Hide file tree
Showing 34 changed files with 25,585 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env-sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SECRET=abad1dea # < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;
RACK_ENV=development # staging|production
DATABASE_URL=sqlite:/ # DATABASE_URL=postgres://[user]:[password]@[host]:[port]/yogurt_development
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public/assets
tags
.env
43 changes: 43 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
source 'https://rubygems.org'

ruby '2.2.1'

gem 'roda'
gem 'unicorn'

gem 'tilt'
gem 'yuicompressor'

gem 'sequel'

gem 'rake'
gem 'rack-unreloader'

gem 'pry', group: :development
gem 'better_errors', group: :development
gem 'binding_of_caller', group: :development

# Roda: Routing Tree Web Framework Toolkit
# => https://github.com/jeremyyogurt/roda
#
# Unicorn: Rack HTTP server for fast clients and Unix
# => http://unicorn.bogomips.org/
#
#
# Tilt: Generic interface to multiple Ruby template engines
# => http://github.com/rtomayko/tilt
#
# YuiCompressor: A YUI JavaScript and CSS compressor for Ruby and JRuby
# => https://github.com/mjackson/yuicompressor
#
#
# Sequel: The Database Toolkit for Ruby
# => http://sequel.jeremyyogurt.net
#
#
# Rake: A make-like build utility for Ruby
# => http://docs.seattlerb.org/rake
#
# Rack::Unreloader: Rack Application that reloads application files if
# changed, unloading constants first
# => https://github.com/jeremyyogurt/rack-unreloader
47 changes: 47 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
GEM
remote: https://rubygems.org/
specs:
better_errors (2.1.1)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
rack (>= 0.9.0)
binding_of_caller (0.7.3.pre1)
debug_inspector (>= 0.0.1)
coderay (1.1.0)
debug_inspector (0.0.2)
erubis (2.7.0)
kgio (2.9.3)
method_source (0.8.2)
pry (0.10.1)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rack (1.6.0)
rack-unreloader (1.3.0)
raindrops (0.13.0)
rake (10.4.2)
roda (2.2.0)
rack
sequel (4.21.0)
slop (3.6.0)
tilt (2.0.1)
unicorn (4.8.3)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
yuicompressor (1.3.3)

PLATFORMS
ruby

DEPENDENCIES
better_errors
binding_of_caller
pry
rack-unreloader
rake
roda
sequel
tilt
unicorn
yuicompressor
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: unicorn -p $PORT -c unicorn.conf
81 changes: 81 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
Yogurt
======

A working CRUD using Roda and Sequel, intended as a bootstrap for
applications that want to leverage a minimal ruby stack.

Just clone the repo, remove `.git` and start your application with a
minimal, but with sensible (in my opinion) defaults, ruby web application.

### Disclaimer

This application uses the latest MRI without concern for
retrocompatibility or cross-implementation support.

It uses Sqlite as default adapter but it's very easy to change, see
[.env-sample](https://github.com/badosu/Yogurt/blob/master/.env-sample) and
[opening_databases.rdoc](http://sequel.jeremyevans.net/rdoc/files/doc/opening_databases_rdoc.html).

It uses Twitter Bootstrap, so it's not exactly minimal on the front-end
but it is useful to illustrate how to bundle your assets.

Some people may feel like there's too much stuff on this bootstrap, others
that there's too few. Some people might think a bootstrap should include
a Rails like *flash* helper or authentication, others that asset bundling
should be not included.

Fortunately Roda makes it really easy to strip off or include middlewares
and plugins, see:

- [list of Roda plugins](http://roda.jeremyevans.net/rdoc/classes/Roda/RodaPlugins.html)
- [list of Rack middlewares](https://github.com/rack/rack/wiki/List-of-Middleware)
- [Rack standard middlewares](http://www.rubydoc.info/github/rack/rack/Rack)
- [rack-contrib](https://github.com/rack/rack-contrib)

Hopefully you'll find what you need there.

Install
-------

### BS

BS is a script that loads the `.env` file and uses it to configure
environment variables, see `$EDITOR bin/bs`.

Vendored from: https://github.com/educabilia/bs.

### Gems

Install bundler: `gem install bundler`.

Run `bundle install` inside the project's directory.

#### GST

You can also avoid using bundler altogether and use a smaller tool,
[gst](https://github.com/tonchis/gst).

Just make sure to append this to your `.env` file:

GEM_HOME=$(pwd)/.gs
GEM_PATH=$(pwd)/.gs
PATH=$(pwd)/.gs/bin:$PATH

And run `bin/bs` when you need to run any operation that requires the bundle.

With the latest MRI and bundler updates I've not used it anymore, but it
may be useful for the hardcore minimal users.

Configure
---------

Run `cp .env{-sample,} && $EDITOR .env` to setup and configure the
application locally.

Run
---

Run `bin/bs bundle exec unicorn -c unicorn.conf` to run the application
locally (without `bundle exec` if you're using gst).

Visit `/communities`.
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace :assets do
desc "Precompile the assets"
task :precompile do
require './yorgut'
Yorgut.compile_assets
end
end
Loading

0 comments on commit dd506b9

Please sign in to comment.