Skip to content

Instantly share code, notes, and snippets.

@isao
Last active December 15, 2015 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isao/5314079 to your computer and use it in GitHub Desktop.
Save isao/5314079 to your computer and use it in GitHub Desktop.
patch to dump resource store data to files
diff --git a/lib/app/autoload/store.server.js b/lib/app/autoload/store.server.js
index 8b01307..ac0e948 100644
--- a/lib/app/autoload/store.server.js
+++ b/lib/app/autoload/store.server.js
@@ -407,8 +407,24 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
this.resolveResourceVersions();
Y.log('Store fully preloaded', 'info', NAME);
+
+ this.dumpRs();
},
+ dumpRs: function() {
+ var fsws = require('fs').writeFileSync,
+ inspect = require('util').inspect;
+
+ function insp(js) {
+ return inspect(js, false, 99, false);
+ }
+
+ fsws('/tmp/getResourceVersions.js', insp(this.getResourceVersions({})), 'utf8');
+ fsws('/tmp/getResources-client.js', insp(this.getResources('client', {}, {})), 'utf8');
+ fsws('/tmp/getResources-server.js', insp(this.getResources('server', {}, {})), 'utf8');
+ fsws('/tmp/this._appRVs.js', insp(this._appRVs), 'utf8');
+ fsws('/tmp/this._mojitRVs.js', insp(this._mojitRVs), 'utf8');
+ },
/**
* Returns a list of resource versions that match the filter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment