jo / couch-daemon

High-level os daemon API for CouchDB.
14 stars 2 forks source link

Add possibility to whitelist/blacklist based on regexp as well #11

Closed ejeklint closed 10 years ago

ejeklint commented 10 years ago

Consider this a suggestion. It's something I will use in current project where we will have thousands of dbs; our naming scheme makes it easy to use a regexp to select which dbs to get changes for.

jo commented 10 years ago

This is damn useful, and very much appreciated, thanks!

Please make sure the tests pass by running

npm test

Also, could you write a test for this in test/dbs-test.js which uses whitelist_regexp and blacklist_regexp?

ejeklint commented 10 years ago

Sure, I'll add test. But not before the WWDC keynote. I'll be back. :smile:

jo commented 10 years ago

Thanks 1000!

jo commented 10 years ago

See https://travis-ci.org/jo/couch-daemon/jobs/26586108#L292

ejeklint commented 10 years ago

Oops... I forgot to whitelist all dbs when there's no whilelist setting at all. :blush:

ejeklint commented 10 years ago

There, even added a small README update. Should be done for your review now.

jo commented 10 years ago

Code looks good.

I think we can extend the whitelist and blacklist option handling to accept regexps. We can simply check for the presence of leading and trailing slashes, because a database name cannot start with a slash. I will merge this and open another ticket for this discussion.

Thanks again a lot for this PR!

PS: Next time it would be nice if you could squash the commits into a single one. If you need help with squashing commits I am happy to help.

jo commented 10 years ago

13

ejeklint commented 10 years ago

"Squash commits"... well one learns new things everyday! I'll do that next time.