https://github.com/integralist/passage
Ruby/Sinatra Project Template
https://github.com/integralist/passage
Last synced: 4 months ago
JSON representation
Ruby/Sinatra Project Template
- Host: GitHub
- URL: https://github.com/integralist/passage
- Owner: Integralist
- Created: 2012-06-09T19:11:23.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2012-08-25T11:17:59.000Z (almost 14 years ago)
- Last Synced: 2025-04-15T07:18:22.352Z (about 1 year ago)
- Language: JavaScript
- Size: 1000 KB
- Stars: 4
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#Passage
Live example: [http://furious-wind-9309.herokuapp.com/](http://furious-wind-9309.herokuapp.com/)
Hosting: [Heroku](http://www.heroku.com/)
##Description
Since learning Ruby (along with the Sinatra framework) I wanted to set-up a template project that I could refer to whenever starting up a new web based Ruby project.
The name "Passage" is an associated word related to "routing" (which in principle is what the Sinatra framework is most notorious for).
For an introduction to Ruby then [read my blog post here](https://github.com/Integralist/Blog-Posts/blob/master/Introduction-to-Ruby.md)
For more information on building a site using Ruby and Sinatra then [read my blog post here](https://github.com/Integralist/Blog-Posts/blob/master/Build%20a%20site%20with%20Ruby%20and%20Sinatra.md)
##Features
* Object-Oriented CSS
(no framework provided - any CSS I've written will be object-oriented with additional assistance from the [Sass](http://sass-lang.com/) CSS pre-processor)
* Modular JavaScript
(via AMD and [RequireJs](http://requirejs.org/))
* Built to be modular
(via use of ERB templates)
* Can load content from Markdown files
* Performance conscientious
* Mobile First approach
* Useful utilities pre-packaged
(well, only one `Rack::Utils`'s `escape` method - but you have facility to add more)
##Requirements
* Bundler (`gem install bundler`)
* Sinatra (`gem install sinatra`)
* Thin (`gem install thin`)
* Red Carpet (`gem install redcarpet`)
* Shotgun (`gem install shotgun` - for testing purposes: it reloads server on every request)
##TODO
* Look to make loading of Markdown files more 'dynamic'
* Look at automatically building an XML site map
##Heroku Hosting
* Set-up account ([heroku.com](http://www.heroku.com/))
* Install toolbelt ([toolbelt.heroku.com](http://toolbelt.heroku.com/))
* Open your Command Line Interface (e.g. Terminal on Mac OS) and enter:
* `heroku login` (follow instructions)
* If you need add additional SSH keys then use: `heroku keys:add`
* `heroku create --stack cedar` (you can also do: `heroku create yourappname --stack cedar`)
* Create a `config.ru` file and add the following content:
```ruby
require 'app' # app being the name of your main file that initializes your web application
run Sinatra::Application
```
* Create a `Gemfile` (no file extension) and add the content:
```
source 'http://rubygems.org'
gem 'sinatra', '1.3.2'
gem 'thin', '1.3.1'
gem 'redcarpet', '2.1.1'
```
Open Command Line Interface and enter:
* `bundle install`
* Create a `Procfile` (no file extension) and add the content:
`web: bundle exec ruby app.rb -p $PORT`
e.g.
`touch Procfile`
`echo web: bundle exec ruby app.rb -p $PORT > Procfile`
* Commit your files using Git ([for help with Git read this](https://github.com/Integralist/Blog-Posts/blob/master/How-to-use-Git-and-GitHub.md))
* If you haven't created a `remote` yet then do so now: `git remote add heroku git@heroku.com:xxxxx.git`
* `git push heroku master`
* `heroku open` will open your default browser to the relevant URL