Skip to content

Commit

Permalink
Updated diagnostics wiretap with ability to use regex for testing mat…
Browse files Browse the repository at this point in the history
…ches
  • Loading branch information
ifandelse committed Apr 26, 2012
1 parent ccb4706 commit 3441008
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 14 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion build-all.sh
Expand Up @@ -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
5 changes: 4 additions & 1 deletion example/amd/js/libs/postal/postal.diagnostics.js
Expand Up @@ -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++;
}
Expand Down
2 changes: 1 addition & 1 deletion example/amd/js/libs/postal/postal.diagnostics.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion example/node/client/js/lib/postal.diagnostics.js
Expand Up @@ -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++;
}
Expand Down
5 changes: 4 additions & 1 deletion example/node/messaging/postal.diagnostics.js
Expand Up @@ -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++;
}
Expand Down
5 changes: 4 additions & 1 deletion example/standard/js/postal.diagnostics.js
Expand Up @@ -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++;
}
Expand Down
2 changes: 1 addition & 1 deletion example/standard/js/postal.diagnostics.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion lib/amd/postal.diagnostics.js
Expand Up @@ -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++;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/amd/postal.diagnostics.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/node/diags/package.json
@@ -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",
Expand Down
5 changes: 4 additions & 1 deletion lib/node/diags/postal.diagnostics.js
Expand Up @@ -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++;
}
Expand Down
5 changes: 4 additions & 1 deletion lib/standard/postal.diagnostics.js
Expand Up @@ -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++;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/standard/postal.diagnostics.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/diags/postal.diagnostics.js
Expand Up @@ -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++;
}
Expand Down

0 comments on commit 3441008

Please sign in to comment.