Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/voxxit/sinatra-skeleton
Skeleton Sinatra app, complete with Datamapper and a CoffeeScript/SASS asset pipeline using Sprockets
https://github.com/voxxit/sinatra-skeleton
Last synced: about 2 months ago
JSON representation
Skeleton Sinatra app, complete with Datamapper and a CoffeeScript/SASS asset pipeline using Sprockets
- Host: GitHub
- URL: https://github.com/voxxit/sinatra-skeleton
- Owner: voxxit
- Created: 2012-08-02T15:21:44.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2022-05-27T17:42:07.000Z (over 2 years ago)
- Last Synced: 2023-04-12T22:49:54.472Z (over 1 year ago)
- Language: Ruby
- Size: 13.7 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Sinatra Skeleton
================This is the basic setup for a barebones Sinatra app to get you started. The first things I
usually want to do are set up the app structure and ORM -- in most cases, [DataMapper](http://datamapper.org/).
Then, of course, who wants to write plain-ol' Javascript anymore? I also like to set up
[Sprockets](https://github.com/sstephenson/sprockets), which is the same asset solution used
in Rails.Grabbing the source
-------------------To get started, you can [download the latest](https://github.com/voxxit/sinatra-skeleton/zipball/master) source
and just include it in your existing or new repo.Running the app
---------------This Sinatra app uses thin for a web server, so all you have to do is:
$ bundle && rackup
This will install all required gems in your Gemfile, then start the server on port 9292.Using assets
------------Set up your JS and CSS files (as CoffeeScript and SASS files, respectively) in the `assets/` folder. Then,
you can link to them in the following manner:/assets/javascripts/application.js.coffee -> /assets/application.js
/assets/stylesheets/application.css.scss -> /assets/application.cssIn production, this is:
/assets/javascripts/application.js.coffee -> /assets/application.min.js
/assets/stylesheets/application.css.scss -> /assets/application.min.cssNOTE: Currently assets are not minified in production.
Precompiling assets
-------------------Assets will automatically precompile when you push to Heroku. However, if you want to do this manually in your development environment, use:
$ bundle exec rake assets:precompile
NOTE: Currently assets are not minified by this script.
Pushing to Heroku
-----------------I don't include a deployment strategy here. For most people, they'll either be using Heroku, or
will want to roll their own deployment. Here's how you can easily push to Heroku.$ heroku create
$ git push heroku master
$ heroku open
Congrats! You've got a fully working Heroku app!