From 6d65809fd66503896faaa9a1022e9dfe60aac56f 2014-11-15 16:48:35
From: Jonathan Frederic <jdfreder@calpoly.edu>
Date: 2014-11-15 16:48:35
Subject: [PATCH] Add rsvp to setupbase

---

diff --git a/IPython/html/tests/util.js b/IPython/html/tests/util.js
index 9caf2da..1dc3f1b 100644
--- a/IPython/html/tests/util.js
+++ b/IPython/html/tests/util.js
@@ -32,7 +32,14 @@ casper.open_new_notebook = function () {
                 for (var i = 0; i < arguments.length; i++) {
                     var value = arguments[i];
                     if (value instanceof Object) {
-                        pretty_arguments.push(JSON.stringify(value, null, '  '));
+                        var name = value.name || 'Object';
+                        // Print a JSON string representation of the object.
+                        // If we don't do this, [Object object] gets printed
+                        // by casper, which is useless.  The long regular
+                        // expression reduces the verbosity of the JSON.
+                        pretty_arguments.push(name + ' {' + JSON.stringify(value, null, '  ')
+                            .replace(/(\s+)?({)?(\s+)?(}(\s+)?,?)?(\s+)?(\s+)?\n/g, '\n')
+                            .replace(/\n(\s+)?\n/g, '\n'));
                     } else {
                         pretty_arguments.push(value);
                     }
diff --git a/setupbase.py b/setupbase.py
index 3dbc6b5..6d24584 100644
--- a/setupbase.py
+++ b/setupbase.py
@@ -159,6 +159,7 @@ def find_package_data():
         pjoin(components, "jquery-ui", "themes", "smoothness", "images", "*"),
         pjoin(components, "marked", "lib", "marked.js"),
         pjoin(components, "requirejs", "require.js"),
+        pjoin(components, "rsvp", "rsvp.js"),
         pjoin(components, "underscore", "underscore-min.js"),
         pjoin(components, "moment", "moment.js"),
         pjoin(components, "moment", "min", "moment.min.js"),