Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adamwiggins/scanty-redis
The blog that's almost nothing - now on Redis
https://github.com/adamwiggins/scanty-redis
Last synced: 3 months ago
JSON representation
The blog that's almost nothing - now on Redis
- Host: GitHub
- URL: https://github.com/adamwiggins/scanty-redis
- Owner: adamwiggins
- Created: 2009-07-07T08:34:26.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2010-06-11T00:29:22.000Z (over 14 years ago)
- Last Synced: 2024-04-15T12:19:10.877Z (7 months ago)
- Language: Ruby
- Homepage: http://adam.blog.heroku.com/past/2009/7/13/scanty_on_redis/
- Size: 339 KB
- Stars: 31
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
Awesome Lists containing this project
- awesome-sinatra - scanty-redis - Scanty using redis. (Blogging)
README
= Scanty, a really small blog, using the Redis database
== Overview
Scanty is blogging software. Software for my blog, to be exact:
http://adam.blog.heroku.comIt is not a blogging engine, but it's small and easy to modify, so it could be
the starting point for your blog, too.This fork modifies lib/post.rb to use Redis, a featureful key-value database,
instead of SQL.== Dependencies
$ gem install sinatra
Redis-rb, Maruku, and Syntax are all vendored.
Get Redis from: http://code.google.com/p/redis/downloads/list
Unarchive the tarball and run make inside the directory. When finished you can
type ./redis-server to run it on the default port on localhost.== Setup
Edit main.rb and change the Blog config struct at the top to your liking, or
set the appropriate environmant variables. To run the server:$ ruby main.rb
Then: http://localhost:4567
== Database
Scanty Redis will connect to Redis on localhost on the default port if you
don't specify another location. To use something else, set REDIS_URL in your
environment when running the app, i.e.:$ REDIS_URL='redis://:[email protected]:9000/3' ruby main.rb
This would connect to host 1.2.3.4 on port 9000, uses database number 3 (Redis
databases are numbered, not named), using password "secret" (which is defined
in the config file optionally passed to Redis when you start the server).
Redis has no usernames so there in othing before the colon.Redis creates databases automatically as needed, but if you want to introspect
or clear the database, you can use the console and the DB constant:$ irb -r main.rb
irb(main):001:0> DB.keys('*')
=> ["Post:chrono", "Post:slug:first_post"]
irb(main):002:0> DB.flush_db
=> "OK"
irb(main):003:0> DB.keys('*')
=> []== See also
* Scanty on SQL: http://github.com/adamwiggins/scanty
* Scanty on CouchDB: http://github.com/jtulloch/scanty== Meta
Created by Adam Wiggins
Released under the MIT License: http://www.opensource.org/licenses/mit-license.php
http://github.com/adamwiggins/scanty
http://adam.blog.heroku.com