Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #19 from Postmedia/pantry

Unstable v0.5.0 with Pantry v0.3.x support (cache storage plugins)
  • Loading branch information...
commit a30bb88d51a98128f17a90643d8f303932abbad8 2 parents c9e4b1d + 496cd3f
Edward de Groot authored
View
6 History.md
@@ -1,3 +1,9 @@
+0.5.2 / 2012-03-21
+==================
+
+ * Unstable experimental release (uses unstable pantry v0.3.x)
+ * Exposes pantry for additional configuration and use of optional storage engines
+
0.4.2 / 2012-03-21
==================
View
21 README.md
@@ -143,6 +143,27 @@ New in v0.3.0, view helpers are now loaded automagically from the ./helpers fold
For example, if you create a file called ./helpers/handy.coffee (like we did in examples), timbits will automatically include all the exported functions from handy.coffee under the helper 'handy'. See the 'with-help' view for the plain timbit as an example.
+### Advanced caching via pantry
+
+As of [Pantry](https://github.com/Postmedia/pantry) v0.3.0, you are now able to configure alternate storage caches. As of Timbits v0.5.0 one can now control the pantry configuration properties as well as substitute the default MemoryStorage caching via the exported timbits.pantry property.
+
+ var RedisStorage, server, timbits;
+
+ timbits = require('../src/timbits');
+
+ RedisStorage = require('pantry/lib/pantry-redis');
+
+ timbits.pantry.storage = new RedisStorage(null, null, null, 'DEBUG');
+
+ timbits.pantry.configure({
+ verbosity: 'DEBUG'
+ });
+
+ server = timbits.serve({
+ home: __dirname
+ });
+
+
## Road Map
We have a number of items in the pipeline which we believe will provide a lot of power to this platform, such as:
View
10 examples/server-redis.coffee
@@ -0,0 +1,10 @@
+# Module dependencies.
+timbits = require '../src/timbits'
+
+# use redis for caching
+RedisStorage = require 'pantry/lib/pantry-redis'
+timbits.pantry.storage = new RedisStorage(null, null, null, 'DEBUG')
+timbits.pantry.configure {verbosity: 'DEBUG'}
+
+# start serving timbits
+server = timbits.serve {home: __dirname}
View
2  examples/server.coffee
@@ -2,4 +2,4 @@
timbits = require '../src/timbits'
# start serving timbits
-server = timbits.serve {home: __dirname}
+server = timbits.serve {home: __dirname}
View
4 package.json
@@ -1,7 +1,7 @@
{
"name": "timbits",
"description": "Widget framework based on Express and CoffeeScript",
- "version": "0.4.2",
+ "version": "0.5.0",
"homepage": "https://github.com/Postmedia/timbits",
"author": "Edward de Groot <edegroot@postmedia.com> (http://mred9.wordpress.com)",
"contributors": [
@@ -18,7 +18,7 @@
"connect-less": ">= 0.2.3",
"express": ">= 2.5.6",
"jsonp-filter": ">= 0.0.2",
- "pantry": ">= 0.2.0 < 0.3.0",
+ "pantry": ">= 0.3.0",
"request": ">= 2.9.1",
"optimist": ">= 0.2.6",
"run": ">= 0.2.3"
View
7 src/timbits.coffee
@@ -8,7 +8,7 @@ Log = require 'coloured-log'
assets = require 'connect-assets'
connectESI = require 'connect-esi'
express = require 'express'
-pantry = require 'pantry'
+@pantry = pantry = require 'pantry'
request = require 'request'
jsonp = require 'jsonp-filter'
less = require 'connect-less'
@@ -31,10 +31,11 @@ log = new Log()
@serve = (options) ->
config[key] = value for key, value of options
@server = express.createServer()
-
+
+ # init log
log = new Log(if @server.settings.env is 'development' then Log.DEBUG else Log.INFO)
- # support coffekup
+ # support coffeekup
@server.register '.coffee', ck
# configure server (still needs some thought)
Please sign in to comment.
Something went wrong with that request. Please try again.