https://github.com/feedreader/pluto.live.starter
planet starter example site - sinatra web app in ruby using the pluto gem
https://github.com/feedreader/pluto.live.starter
Last synced: 5 months ago
JSON representation
planet starter example site - sinatra web app in ruby using the pluto gem
- Host: GitHub
- URL: https://github.com/feedreader/pluto.live.starter
- Owner: feedreader
- Created: 2013-10-19T19:47:46.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2020-05-19T07:46:14.000Z (over 5 years ago)
- Last Synced: 2025-07-10T12:09:48.387Z (7 months ago)
- Language: HTML
- Homepage:
- Size: 18.6 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pluto.live.starter
Example planet starter site - a Sinatra web app in Ruby
using the [pluto gem](https://github.com/feedreader/pluto).
```ruby
class Planet < Sinatra::Base
##########
# Models
include Pluto::Models # e.g. Feed, Item, Site, etc.
############################################
# Controllers / Routing / Request Handlers
get '/' do
erb :index
end
end
```
(Source: [`planet.rb`](planet.rb))
Sample template snippet:
```html
<%= site.title %>
<% site.items.latest.limit(24).each do |item| %>
<%= link_to item.feed.title, item.feed.url %>
<%= link_to item.title, item.url %>
<%= item.summary %>
<% end %>
```
(Source: [`views/index.erb`](views/index.erb))
## Live Demos
See the [Planet Ruby](http://plutopluto.herokuapp.com)
running on Heroku.
## Setup
### Setup on your local machine
Clone the pluto.live.starter git repo:
$ git clone git://github.com/feedreader/pluto.live.starter.git
Get all your Ruby libraries (gems) installed using the bundler tool:
$ cd pluto.live.starter
$ bundle install --without production
Note, use the `--without production` option for local development
unless you want to install the PostgreSQL (pg) database libraries
and services (required for production on the Heroku hosting service.)
Setup the database and planet feed subscriptions:
$ rake setup PLANET=ruby
Update your planet feeds:
$ rake update
Showtime! Startup the web server:
$ rackup
That's it.
### Setup on Heroku
Clone the pluto.live.starter git repo:
$ git clone git://github.com/feedreader/pluto.live.starter.git
Create app on Heroku e.g.
$ cd pluto.live.starter
$ heroku create
Upload via
$ git push heroku master
Add the PostgreSQL addon
$ heroku addons:add heroku-postgresql:dev
Establish primary database (that is, set DATABASE_URL). Find your POSTGRESQL_URL:
$ heroku config | grep HEROKU_POSTGRESQL
And promote HEROKU_POSTGRESQL__URL to DATABASE_URL:
$ heroku pg:promote HEROKU_POSTGRESQL__URL
Create database andd add planet feed subscriptions on first upload via
$ heroku run rake setup PLANET=ruby
Update feeds
$ heroku run rake update
Showtime! That's it.
Bonus:
Add a scheduler job to update feeds via `rake update` hourly, daily, etc.
## License

The `pluto` scripts are dedicated to the public domain.
Use it as you please with no restrictions whatsoever.
## Questions? Comments?
Send them along to the [wwwmake Forum/Mailing List](http://groups.google.com/group/wwwmake).
Thanks!