Permalink
Browse files

add MIT license; add `IGNORE_NAMES` for no bind methods list.

  • Loading branch information...
1 parent 6996ac8 commit 73bedc244fe386c9aae465fec5e7068b8d09317d @fengmk2 fengmk2 committed May 28, 2012
Showing with 55 additions and 5 deletions.
  1. +22 −0 LICENSE
  2. +26 −0 Readme.md
  3. +7 −5 lib/mongoskin/db.js
View
22 LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2011 - 2012 kissjs.org
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -568,3 +568,29 @@ All these methods will return the SkinCursor itself.
[Back to index](#index)
+
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2011 - 2012 kissjs.org
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -195,11 +195,13 @@ var bindSkin = function(name, method) {
};
//bind method of mongodb.Db to SkinDb
+var IGNORE_NAMES = [
+ 'bind', 'open', 'collection', 'admin',
+ 'state'
+];
for (var name in Db.prototype) {
- if(!name || name[0] == '_' || name == 'state') continue;
- var method = Db.prototype[name];
- if (name !== 'bind' && name !== 'open' && name !== 'collection' && name !== 'admin') {
- bindSkin(name, method);
+ if (!name || name[0] === '_' || IGNORE_NAMES.indexOf(name) >= 0) {
+ continue;
}
+ bindSkin(name, Db.prototype[name]);
}
-

0 comments on commit 73bedc2

Please sign in to comment.