Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update readme and changelog for pages events. log invalid properties …

…on the no metadata pages test.
  • Loading branch information...
commit 5138aba580a8c9f0e997db1495d12bea27f28918 1 parent a47507b
projectmoon authored
Showing with 20 additions and 6 deletions.
  1. +1 −0  CHANGELOG.md
  2. +17 −5 README.md
  3. +2 −1  test/pages.js
View
1  CHANGELOG.md
@@ -15,6 +15,7 @@
* `reed.removeAll` method is now atomic (Redis MULTI).
* Method blocking is now much more efficient by using a queue instead of what
amounted to fancy spinlock.
+* `add`, `update`, and `remove` events for reed pages.
0.9.8
=====
View
22 README.md
@@ -171,11 +171,11 @@ Reed exposes the following functions:
* `list(callback)`: Retrieves all post IDs, sorted by last modified date. The
callback receives `error` if there was an error, and `titles`, which is a
list of post IDs.
-* `remove(id, callback)`: Removes a blog post. The callback receives `error`, if
- an error occurred.
-* `removeAll(callback)`: Removes all blog posts. The callback is called after
- all posts have been deleted, and receives `error` if there was an error during
- deletion. **This deletion is not transactional!**
+* `remove(id, callback)`: Removes a blog post from reed and the filesystem.
+ The callback receives `error`, if an error occurred.
+* `removeAll(callback)`: Removes all blog posts from reed and the filesystem.
+ The callback is called after all posts have been deleted, and receives `error`
+ if there was an error during deletion.
**Note**: `get`, `list`, `index`, `remove`, and `removeAll` asynchronously
block until reed is in a ready state. This means they can be called before
@@ -234,6 +234,18 @@ The pages API is contained within the `pages` namespace:
Redis and the filesystem.
* `pages.close()`: Closes the pages portion of reed.
+Reed pages exposes the following events:
+
+* `error`: Fired when there is an error in certain internal procedures. Usually,
+ inspecting the error object of callbacks is sufficient.
+* `ready`: Fired when reed has loaded.
+* `add`: Fired when a page is added.
+* `update`: Fired when a page is updated.
+* `remove`: Fired when a page is removed (from the filesystem, through an
+ API call, etc). The callback receives the full path of the file that was
+ removed.
+
+
Contributors
============
These people have contributed to the development of reed in some way or another:
View
3  test/pages.js
@@ -69,6 +69,7 @@ vows.describe('Pages System').addBatch({
var valid = true;
for (var prop in metadata) {
if (prop !== 'lastModified' && prop !== 'id' && prop !== 'markdown') {
+ console.log('invalid property:', prop);
valid = false;
break;
}
@@ -118,7 +119,7 @@ vows.describe('Pages System').addBatch({
assert.isFalse(fs.existsSync(dir + 'newpage.md'));
},
- 'check removed from reed': {
+ 'then check if removed from reed': {
topic: function() {
reed.pages.get('newpage', this.callback);
},
Please sign in to comment.
Something went wrong with that request. Please try again.