Permalink
Browse files

blog: Don't filter out non-latest release notes

This causes too many people to ask me why it's broken.
  • Loading branch information...
1 parent db008f7 commit fb5c7f03a040a4eb3684f0a9cff3141d959ea735 @isaacs isaacs committed Nov 23, 2012
@@ -172,22 +172,8 @@ function buildFeeds(data) {
categories[cat] = paginate(categories[cat], cat);
}
- // filter non-latest release notices out of main feeds.
- // still show the first stable release of the family, since
- // it usually is an important milestone with benchmarks and stuff.
- var main = posts.filter(function(post) {
- if (post.version && post.family) {
- var ver = semver.parse(post.version)
- if (+ver[2] % 2 === 0 && +ver[3] === 0) {
- // 0.x.0, where x is event
- return true;
- }
- if (post.version && post.family && post !== releases[post.family][0]) {
- return false;
- }
- }
- return true;
- });
+ // show all posts in main feed.
+ var main = posts;
// add previous/next based on main feed.
main.forEach(function (post, i, posts) {
@@ -0,0 +1,27 @@
+Copyright (c) Isaac Z. Schlueter ("Author")
+All rights reserved.
+
+The BSD License
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,41 @@
+var test = require('tap').test
+var fs = require('../graceful-fs.js')
+
+test('open an existing file works', function (t) {
+ var start = fs._curOpen
+ var fd = fs.openSync(__filename, 'r')
+ t.equal(fs._curOpen, start + 1)
+ fs.closeSync(fd)
+ t.equal(fs._curOpen, start)
+ fs.open(__filename, 'r', function (er, fd) {
+ if (er) throw er
+ t.equal(fs._curOpen, start + 1)
+ fs.close(fd, function (er) {
+ if (er) throw er
+ t.equal(fs._curOpen, start)
+ t.end()
+ })
+ })
+})
+
+test('open a non-existing file throws', function (t) {
+ var start = fs._curOpen
+ var er
+ try {
+ var fd = fs.openSync('this file does not exist', 'r')
+ } catch (x) {
+ er = x
+ }
+ t.ok(er, 'should throw')
+ t.notOk(fd, 'should not get an fd')
+ t.equal(er.code, 'ENOENT')
+ t.equal(fs._curOpen, start)
+
+ fs.open('neither does this file', 'r', function (er, fd) {
+ t.ok(er, 'should throw')
+ t.notOk(fd, 'should not get an fd')
+ t.equal(er.code, 'ENOENT')
+ t.equal(fs._curOpen, start)
+ t.end()
+ })
+})
@@ -0,0 +1,27 @@
+Copyright (c) Isaac Z. Schlueter ("Author")
+All rights reserved.
+
+The BSD License
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,53 @@
+# sigmund
+
+Quick and dirty signatures for Objects.
+
+This is like a much faster `deepEquals` comparison, which returns a
+string key suitable for caches and the like.
+
+## Usage
+
+```javascript
+function doSomething (someObj) {
+ var key = sigmund(someObj, maxDepth) // max depth defaults to 10
+ var cached = cache.get(key)
+ if (cached) return cached)
+
+ var result = expensiveCalculation(someObj)
+ cache.set(key, result)
+ return result
+}
+```
+
+The resulting key will be as unique and reproducible as calling
+`JSON.stringify` or `util.inspect` on the object, but is much faster.
+In order to achieve this speed, some differences are glossed over.
+For example, the object `{0:'foo'}` will be treated identically to the
+array `['foo']`.
+
+Also, just as there is no way to summon the soul from the scribblings
+of a cocain-addled psychoanalyst, there is no way to revive the object
+from the signature string that sigmund gives you. In fact, it's
+barely even readable.
+
+As with `sys.inspect` and `JSON.stringify`, larger objects will
+produce larger signature strings.
+
+Because sigmund is a bit less strict than the more thorough
+alternatives, the strings will be shorter, and also there is a
+slightly higher chance for collisions. For example, these objects
+have the same signature:
+
+ var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}
+ var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}
+
+Like a good Freudian, sigmund is most effective when you already have
+some understanding of what you're looking for. It can help you help
+yourself, but you must be willing to do some work as well.
+
+Cycles are handled, and cyclical objects are silently omitted (though
+the key is included in the signature output.)
+
+The second argument is the maximum depth, which defaults to 10,
+because that is the maximum object traversal depth covered by most
+insurance carriers.
Oops, something went wrong.

0 comments on commit fb5c7f0

Please sign in to comment.