Permalink
Browse files

Updated diagnostics wiretap with ability to use regex for testing mat…

…ches
  • Loading branch information...
1 parent ccb4706 commit 3441008c1fb3d29cb03a2c059d19fb7e8f96bb8b @ifandelse ifandelse committed Apr 26, 2012
View
BIN .DS_Store
Binary file not shown.
View
@@ -22,5 +22,5 @@ cp ./lib/standard/postal.* ./example/standard/js
cp ./lib/amd/postal.* ./example/amd/js/libs/postal
cp ./lib/amd/postal.js ./example/node/client/js/lib
cp ./lib/amd/postal.diagnostics.js ./example/node/client/js/lib
-cp ./lib/node/postal.diagnostics.js ./example/node/messaging
+cp ./lib/node/diags/postal.diagnostics.js ./example/node/messaging
cp ./lib/node/postal.js ./example/node/messaging
@@ -8,7 +8,10 @@ define( [ "postal", "underscore" ], function ( postal, _, undefined ) {
_.each( filter, function ( item, key ) {
if ( env[key] ) {
possible++;
- if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
+ if ( _.isRegExp( item ) && item.test( env[key] ) ) {
+ match++;
+ }
+ else if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
if ( applyFilter( item, env[key] ) ) {
match++;
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -8,7 +8,10 @@ define( [ "postal", "underscore" ], function ( postal, _, undefined ) {
_.each( filter, function ( item, key ) {
if ( env[key] ) {
possible++;
- if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
+ if ( _.isRegExp( item ) && item.test( env[key] ) ) {
+ match++;
+ }
+ else if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
if ( applyFilter( item, env[key] ) ) {
match++;
}
@@ -5,7 +5,10 @@ module.exports = function ( _, postal ) {
_.each( filter, function ( item, key ) {
if ( env[key] ) {
possible++;
- if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
+ if ( _.isRegExp( item ) && item.test( env[key] ) ) {
+ match++;
+ }
+ else if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
if ( applyFilter( item, env[key] ) ) {
match++;
}
@@ -8,7 +8,10 @@
_.each( filter, function ( item, key ) {
if ( env[key] ) {
possible++;
- if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
+ if ( _.isRegExp( item ) && item.test( env[key] ) ) {
+ match++;
+ }
+ else if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
if ( applyFilter( item, env[key] ) ) {
match++;
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -8,7 +8,10 @@ define( [ "postal", "underscore" ], function ( postal, _, undefined ) {
_.each( filter, function ( item, key ) {
if ( env[key] ) {
possible++;
- if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
+ if ( _.isRegExp( item ) && item.test( env[key] ) ) {
+ match++;
+ }
+ else if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
if ( applyFilter( item, env[key] ) ) {
match++;
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,7 +1,7 @@
{
"name" : "postal.diagnostics",
"description" : "Wiretap add-on for postal.js allowing configurable console.logging output of messages being published through postal's message bus.",
- "version" : "0.6.0",
+ "version" : "0.6.1",
"homepage" : "http://github.com/ifandelse/postal.js",
"repository" : {
"type" : "git",
@@ -5,7 +5,10 @@ module.exports = function ( _, postal ) {
_.each( filter, function ( item, key ) {
if ( env[key] ) {
possible++;
- if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
+ if ( _.isRegExp( item ) && item.test( env[key] ) ) {
+ match++;
+ }
+ else if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
if ( applyFilter( item, env[key] ) ) {
match++;
}
@@ -8,7 +8,10 @@
_.each( filter, function ( item, key ) {
if ( env[key] ) {
possible++;
- if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
+ if ( _.isRegExp( item ) && item.test( env[key] ) ) {
+ match++;
+ }
+ else if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
if ( applyFilter( item, env[key] ) ) {
match++;
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -4,7 +4,10 @@ var filters = [],
_.each( filter, function ( item, key ) {
if ( env[key] ) {
possible++;
- if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
+ if ( _.isRegExp( item ) && item.test( env[key] ) ) {
+ match++;
+ }
+ else if ( _.isObject( env[key] ) && !_.isArray( env[key] ) ) {
if ( applyFilter( item, env[key] ) ) {
match++;
}

0 comments on commit 3441008

Please sign in to comment.