Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Preliminary JS refactoring

  • Loading branch information...
commit 69f6a3d3a8e50b756002ddf3bc5083b285a2576d 1 parent 0cfe86d
@rf- authored
View
65 lib/pry-notebook/files/index.html
@@ -1,48 +1,23 @@
<!doctype html>
<html>
-<head>
- <meta charset="utf-8">
- <title>Pry Notebook</title>
- <style>
- .content {
- width: 800px;
- margin: 0 auto;
- background: #EEEEEE;
- padding: 1em;
- }
- </style>
-
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.3/underscore-min.js"></script>
-
- <script>
- $(function () {
- var klass = ("MozWebSocket" in window) ? MozWebSocket : WebSocket,
- socket = new klass('ws://' + window.location.host);
-
- socket.onmessage = function (msg) {
- var data = JSON.parse(msg.data),
- div = $('<div/>');
-
- div.addClass("pry-" + data.type);
- div.text(data.value);
- $('.output').append(div);
- }
-
- $('input').on('keyup', function (e) {
- if (e.keyCode == 13) {
- $.post('/', $(this).val());
- $(this).val('');
- }
- });
- });
- </script>
-</head>
-<body>
- <div class="content">
- <h1>Pry Notebook</h1>
- <div class="output"></div>
- <input type="text"></input>
- </div>
-</body>
+ <head>
+ <meta charset="utf-8">
+ <title>Pry Notebook</title>
+ <link rel="stylesheet" type="text/css" href="/pry-notebook.css">
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.3/underscore-min.js"></script>
+ <script src="/notebook.js"></script>
+ <script src="/main.js"></script>
+ </head>
+ <body>
+ <div class="content">
+ <div class="header">
+ <h1>Pry Notebook</h1>
+ </div>
+ <div class="output"></div>
+ <div class="footer">
+ <input type="text"></input>
+ </div>
+ </div>
+ </body>
</html>
View
1  lib/pry-notebook/files/jasmine.js
@@ -0,0 +1 @@
+(function(){var e=function(){(function(e){var t=document.createElement("style");t.type="text/css",t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),document.getElementsByTagName("body")[0].appendChild(t)})('body{background-color:#eee;padding:0;margin:5px;overflow-y:scroll}#HTMLReporter{font-size:11px;font-family:Monaco,"Lucida Console",monospace;line-height:14px;color:#333}#HTMLReporter a{text-decoration:none}#HTMLReporter a:hover{text-decoration:underline}#HTMLReporter p,#HTMLReporter h1,#HTMLReporter h2,#HTMLReporter h3,#HTMLReporter h4,#HTMLReporter h5,#HTMLReporter h6{margin:0;line-height:14px}#HTMLReporter .banner,#HTMLReporter .symbolSummary,#HTMLReporter .summary,#HTMLReporter .resultMessage,#HTMLReporter .specDetail .description,#HTMLReporter .alert .bar,#HTMLReporter .stackTrace{padding-left:9px;padding-right:9px}#HTMLReporter #jasmine_content{position:fixed;right:100%}#HTMLReporter .version{color:#aaa}#HTMLReporter .banner{margin-top:14px}#HTMLReporter .duration{color:#aaa;float:right}#HTMLReporter .symbolSummary{overflow:hidden;*zoom:1;margin:14px 0}#HTMLReporter .symbolSummary li{display:block;float:left;height:7px;width:14px;margin-bottom:7px;font-size:16px}#HTMLReporter .symbolSummary li.passed{font-size:14px}#HTMLReporter .symbolSummary li.passed:before{color:#5e7d00;content:"\\02022"} #HTMLReporter .symbolSummary li.failed{line-height:9px}#HTMLReporter .symbolSummary li.failed:before{color:#b03911;content:"x";font-weight:bold;margin-left:-1px}#HTMLReporter .symbolSummary li.skipped{font-size:14px}#HTMLReporter .symbolSummary li.skipped:before{color:#bababa;content:"\\02022"} #HTMLReporter .symbolSummary li.pending{line-height:11px}#HTMLReporter .symbolSummary li.pending:before{color:#aaa;content:"-"}#HTMLReporter .bar{line-height:28px;font-size:14px;display:block;color:#eee}#HTMLReporter .runningAlert{background-color:#666}#HTMLReporter .skippedAlert{background-color:#aaa}#HTMLReporter .skippedAlert:first-child{background-color:#333}#HTMLReporter .skippedAlert:hover{text-decoration:none;color:white;text-decoration:underline}#HTMLReporter .passingAlert{background-color:#a6b779}#HTMLReporter .passingAlert:first-child{background-color:#5e7d00}#HTMLReporter .failingAlert{background-color:#cf867e}#HTMLReporter .failingAlert:first-child{background-color:#b03911}#HTMLReporter .results{margin-top:14px}#HTMLReporter #details{display:none}#HTMLReporter .resultsMenu,#HTMLReporter .resultsMenu a{background-color:#fff;color:#333}#HTMLReporter.showDetails .summaryMenuItem{font-weight:normal;text-decoration:inherit}#HTMLReporter.showDetails .summaryMenuItem:hover{text-decoration:underline}#HTMLReporter.showDetails .detailsMenuItem{font-weight:bold;text-decoration:underline}#HTMLReporter.showDetails .summary{display:none}#HTMLReporter.showDetails #details{display:block}#HTMLReporter .summaryMenuItem{font-weight:bold;text-decoration:underline}#HTMLReporter .summary{margin-top:14px}#HTMLReporter .summary .suite .suite,#HTMLReporter .summary .specSummary{margin-left:14px}#HTMLReporter .summary .specSummary.passed a{color:#5e7d00}#HTMLReporter .summary .specSummary.failed a{color:#b03911}#HTMLReporter .description+.suite{margin-top:0}#HTMLReporter .suite{margin-top:14px}#HTMLReporter .suite a{color:#333}#HTMLReporter #details .specDetail{margin-bottom:28px}#HTMLReporter #details .specDetail .description{display:block;color:white;background-color:#b03911}#HTMLReporter .resultMessage{padding-top:14px;color:#333}#HTMLReporter .resultMessage span.result{display:block}#HTMLReporter .stackTrace{margin:5px 0 0 0;max-height:224px;overflow:auto;line-height:18px;color:#666;border:1px solid #ddd;background:white;white-space:pre}#TrivialReporter{padding:8px 13px;position:absolute;top:0;bottom:0;left:0;right:0;overflow-y:scroll;background-color:white;font-family:"Helvetica Neue Light","Lucida Grande","Calibri","Arial",sans-serif}#TrivialReporter a:visited,#TrivialReporter a{color:#303}#TrivialReporter a:hover,#TrivialReporter a:active{color:blue}#TrivialReporter .run_spec{float:right;padding-right:5px;font-size:.8em;text-decoration:none}#TrivialReporter .banner{color:#303;background-color:#fef;padding:5px}#TrivialReporter .logo{float:left;font-size:1.1em;padding-left:5px}#TrivialReporter .logo .version{font-size:.6em;padding-left:1em}#TrivialReporter .runner.running{background-color:yellow}#TrivialReporter .options{text-align:right;font-size:.8em}#TrivialReporter .suite{border:1px outset gray;margin:5px 0;padding-left:1em}#TrivialReporter .suite .suite{margin:5px}#TrivialReporter .suite.passed{background-color:#dfd}#TrivialReporter .suite.failed{background-color:#fdd}#TrivialReporter .spec{margin:5px;padding-left:1em;clear:both}#TrivialReporter .spec.failed,#TrivialReporter .spec.passed,#TrivialReporter .spec.skipped{padding-bottom:5px;border:1px solid gray}#TrivialReporter .spec.failed{background-color:#fbb;border-color:red}#TrivialReporter .spec.passed{background-color:#bfb;border-color:green}#TrivialReporter .spec.skipped{background-color:#bbb}#TrivialReporter .messages{border-left:1px dashed gray;padding-left:1em;padding-right:1em}#TrivialReporter .passed{background-color:#cfc;display:none}#TrivialReporter .failed{background-color:#fbb}#TrivialReporter .skipped{color:#777;background-color:#eee;display:none}#TrivialReporter .resultMessage span.result{display:block;line-height:2em;color:black}#TrivialReporter .resultMessage .mismatch{color:black}#TrivialReporter .stackTrace{white-space:pre;font-size:.8em;margin-left:10px;max-height:5em;overflow:auto;border:1px inset red;padding:1em;background:#eef}#TrivialReporter .finished-at{padding-left:1em;font-size:.6em}#TrivialReporter.show-passed .passed,#TrivialReporter.show-skipped .skipped{display:block}#TrivialReporter #jasmine_content{position:fixed;right:100%}#TrivialReporter .runner{border:1px solid gray;display:block;margin:5px 0;padding:2px 0 2px 10px}'),setTimeout(function(){var e=jasmine.getEnv();e.updateInterval=1e3;var t=new jasmine.HtmlReporter;e.addReporter(t),e.specFilter=function(e){return t.specFilter(e)},e.execute()},1)};document.addEventListener?document.addEventListener("DOMContentLoaded",e,!1):document.attachEvent("DOMContentLoaded",e)})();var isCommonJS=typeof window=="undefined",jasmine={};isCommonJS&&(exports.jasmine=jasmine),jasmine.unimplementedMethod_=function(){throw new Error("unimplemented method")},jasmine.undefined=jasmine.___undefined___,jasmine.VERBOSE=!1,jasmine.DEFAULT_UPDATE_INTERVAL=250,jasmine.DEFAULT_TIMEOUT_INTERVAL=5e3,jasmine.getGlobal=function(){function e(){return this}return e()},jasmine.bindOriginal_=function(e,t){var n=e[t];return n.apply?function(){return n.apply(e,arguments)}:jasmine.getGlobal()[t]},jasmine.setTimeout=jasmine.bindOriginal_(jasmine.getGlobal(),"setTimeout"),jasmine.clearTimeout=jasmine.bindOriginal_(jasmine.getGlobal(),"clearTimeout"),jasmine.setInterval=jasmine.bindOriginal_(jasmine.getGlobal(),"setInterval"),jasmine.clearInterval=jasmine.bindOriginal_(jasmine.getGlobal(),"clearInterval"),jasmine.MessageResult=function(e){this.type="log",this.values=e,this.trace=new Error},jasmine.MessageResult.prototype.toString=function(){var e="";for(var t=0;t<this.values.length;t++)t>0&&(e+=" "),jasmine.isString_(this.values[t])?e+=this.values[t]:e+=jasmine.pp(this.values[t]);return e},jasmine.ExpectationResult=function(e){this.type="expect",this.matcherName=e.matcherName,this.passed_=e.passed,this.expected=e.expected,this.actual=e.actual,this.message=this.passed_?"Passed.":e.message;var t=e.trace||new Error(this.message);this.trace=this.passed_?"":t},jasmine.ExpectationResult.prototype.toString=function(){return this.message},jasmine.ExpectationResult.prototype.passed=function(){return this.passed_},jasmine.getEnv=function(){var e=jasmine.currentEnv_=jasmine.currentEnv_||new jasmine.Env;return e},jasmine.isArray_=function(e){return jasmine.isA_("Array",e)},jasmine.isString_=function(e){return jasmine.isA_("String",e)},jasmine.isNumber_=function(e){return jasmine.isA_("Number",e)},jasmine.isA_=function(e,t){return Object.prototype.toString.apply(t)==="[object "+e+"]"},jasmine.pp=function(e){var t=new jasmine.StringPrettyPrinter;return t.format(e),t.string},jasmine.isDomNode=function(e){return e.nodeType>0},jasmine.any=function(e){return new jasmine.Matchers.Any(e)},jasmine.objectContaining=function(e){return new jasmine.Matchers.ObjectContaining(e)},jasmine.Spy=function(e){this.identity=e||"unknown",this.isSpy=!0,this.plan=function(){},this.mostRecentCall={},this.argsForCall=[],this.calls=[]},jasmine.Spy.prototype.andCallThrough=function(){return this.plan=this.originalValue,this},jasmine.Spy.prototype.andReturn=function(e){return this.plan=function(){return e},this},jasmine.Spy.prototype.andThrow=function(e){return this.plan=function(){throw e},this},jasmine.Spy.prototype.andCallFake=function(e){return this.plan=e,this},jasmine.Spy.prototype.reset=function(){this.wasCalled=!1,this.callCount=0,this.argsForCall=[],this.calls=[],this.mostRecentCall={}},jasmine.createSpy=function(e){var t=function(){t.wasCalled=!0,t.callCount++;var e=jasmine.util.argsToArray(arguments);return t.mostRecentCall.object=this,t.mostRecentCall.args=e,t.argsForCall.push(e),t.calls.push({object:this,args:e}),t.plan.apply(this,arguments)},n=new jasmine.Spy(e);for(var r in n)t[r]=n[r];return t.reset(),t},jasmine.isSpy=function(e){return e&&e.isSpy},jasmine.createSpyObj=function(e,t){if(!jasmine.isArray_(t)||t.length===0)throw new Error("createSpyObj requires a non-empty array of method names to create spies for");var n={};for(var r=0;r<t.length;r++)n[t[r]]=jasmine.createSpy(e+"."+t[r]);return n},jasmine.log=function(){var e=jasmine.getEnv().currentSpec;e.log.apply(e,arguments)};var spyOn=function(e,t){return jasmine.getEnv().currentSpec.spyOn(e,t)};isCommonJS&&(exports.spyOn=spyOn);var it=function(e,t){return jasmine.getEnv().it(e,t)};isCommonJS&&(exports.it=it);var xit=function(e,t){return jasmine.getEnv().xit(e,t)};isCommonJS&&(exports.xit=xit);var expect=function(e){return jasmine.getEnv().currentSpec.expect(e)};isCommonJS&&(exports.expect=expect);var runs=function(e){jasmine.getEnv().currentSpec.runs(e)};isCommonJS&&(exports.runs=runs);var waits=function(e){jasmine.getEnv().currentSpec.waits(e)};isCommonJS&&(exports.waits=waits);var waitsFor=function(e,t,n){jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec,arguments)};isCommonJS&&(exports.waitsFor=waitsFor);var beforeEach=function(e){jasmine.getEnv().beforeEach(e)};isCommonJS&&(exports.beforeEach=beforeEach);var afterEach=function(e){jasmine.getEnv().afterEach(e)};isCommonJS&&(exports.afterEach=afterEach);var describe=function(e,t){return jasmine.getEnv().describe(e,t)};isCommonJS&&(exports.describe=describe);var xdescribe=function(e,t){return jasmine.getEnv().xdescribe(e,t)};isCommonJS&&(exports.xdescribe=xdescribe),jasmine.XmlHttpRequest=typeof XMLHttpRequest=="undefined"?function(){function e(e){try{return e()}catch(t){}return null}var t=e(function(){return new ActiveXObject("Msxml2.XMLHTTP.6.0")})||e(function(){return new ActiveXObject("Msxml2.XMLHTTP.3.0")})||e(function(){return new ActiveXObject("Msxml2.XMLHTTP")})||e(function(){return new ActiveXObject("Microsoft.XMLHTTP")});if(!t)throw new Error("This browser does not support XMLHttpRequest.");return t}:XMLHttpRequest,jasmine.util={},jasmine.util.inherit=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n},jasmine.util.formatException=function(e){var t;e.line?t=e.line:e.lineNumber&&(t=e.lineNumber);var n;e.sourceURL?n=e.sourceURL:e.fileName&&(n=e.fileName);var r=e.name&&e.message?e.name+": "+e.message:e.toString();return n&&t&&(r+=" in "+n+" (line "+t+")"),r},jasmine.util.htmlEscape=function(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):e},jasmine.util.argsToArray=function(e){var t=[];for(var n=0;n<e.length;n++)t.push(e[n]);return t},jasmine.util.extend=function(e,t){for(var n in t)e[n]=t[n];return e},jasmine.Env=function(){this.currentSpec=null,this.currentSuite=null,this.currentRunner_=new jasmine.Runner(this),this.reporter=new jasmine.MultiReporter,this.updateInterval=jasmine.DEFAULT_UPDATE_INTERVAL,this.defaultTimeoutInterval=jasmine.DEFAULT_TIMEOUT_INTERVAL,this.lastUpdate=0,this.specFilter=function(){return!0},this.nextSpecId_=0,this.nextSuiteId_=0,this.equalityTesters_=[],this.matchersClass=function(){jasmine.Matchers.apply(this,arguments)},jasmine.util.inherit(this.matchersClass,jasmine.Matchers),jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype,this.matchersClass)},jasmine.Env.prototype.setTimeout=jasmine.setTimeout,jasmine.Env.prototype.clearTimeout=jasmine.clearTimeout,jasmine.Env.prototype.setInterval=jasmine.setInterval,jasmine.Env.prototype.clearInterval=jasmine.clearInterval,jasmine.Env.prototype.version=function(){if(jasmine.version_)return jasmine.version_;throw new Error("Version not set")},jasmine.Env.prototype.versionString=function(){if(!jasmine.version_)return"version unknown";var e=this.version(),t=e.major+"."+e.minor+"."+e.build;return e.release_candidate&&(t+=".rc"+e.release_candidate),t+=" revision "+e.revision,t},jasmine.Env.prototype.nextSpecId=function(){return this.nextSpecId_++},jasmine.Env.prototype.nextSuiteId=function(){return this.nextSuiteId_++},jasmine.Env.prototype.addReporter=function(e){this.reporter.addReporter(e)},jasmine.Env.prototype.execute=function(){this.currentRunner_.execute()},jasmine.Env.prototype.describe=function(e,t){var n=new jasmine.Suite(this,e,t,this.currentSuite),r=this.currentSuite;r?r.add(n):this.currentRunner_.add(n),this.currentSuite=n;var i=null;try{t.call(n)}catch(s){i=s}return i&&this.it("encountered a declaration exception",function(){throw i}),this.currentSuite=r,n},jasmine.Env.prototype.beforeEach=function(e){this.currentSuite?this.currentSuite.beforeEach(e):this.currentRunner_.beforeEach(e)},jasmine.Env.prototype.currentRunner=function(){return this.currentRunner_},jasmine.Env.prototype.afterEach=function(e){this.currentSuite?this.currentSuite.afterEach(e):this.currentRunner_.afterEach(e)},jasmine.Env.prototype.xdescribe=function(e,t){return{execute:function(){}}},jasmine.Env.prototype.it=function(e,t){var n=new jasmine.Spec(this,this.currentSuite,e);return this.currentSuite.add(n),this.currentSpec=n,t&&n.runs(t),n},jasmine.Env.prototype.xit=function(e,t){return{id:this.nextSpecId(),runs:function(){}}},jasmine.Env.prototype.compareObjects_=function(e,t,n,r){if(e.__Jasmine_been_here_before__===t&&t.__Jasmine_been_here_before__===e)return!0;e.__Jasmine_been_here_before__=t,t.__Jasmine_been_here_before__=e;var i=function(e,t){return e!==null&&e[t]!==jasmine.undefined};for(var s in t)!i(e,s)&&i(t,s)&&n.push("expected has key '"+s+"', but missing from actual.");for(s in e)!i(t,s)&&i(e,s)&&n.push("expected missing key '"+s+"', but present in actual.");for(s in t){if(s=="__Jasmine_been_here_before__")continue;this.equals_(e[s],t[s],n,r)||r.push("'"+s+"' was '"+(t[s]?jasmine.util.htmlEscape(t[s].toString()):t[s])+"' in expected, but was '"+(e[s]?jasmine.util.htmlEscape(e[s].toString()):e[s])+"' in actual.")}return jasmine.isArray_(e)&&jasmine.isArray_(t)&&e.length!=t.length&&r.push("arrays were not the same length"),delete e.__Jasmine_been_here_before__,delete t.__Jasmine_been_here_before__,n.length===0&&r.length===0},jasmine.Env.prototype.equals_=function(e,t,n,r){n=n||[],r=r||[];for(var i=0;i<this.equalityTesters_.length;i++){var s=this.equalityTesters_[i],o=s(e,t,this,n,r);if(o!==jasmine.undefined)return o}return e===t?!0:e===jasmine.undefined||e===null||t===jasmine.undefined||t===null?e==jasmine.undefined&&t==jasmine.undefined:jasmine.isDomNode(e)&&jasmine.isDomNode(t)?e===t:e instanceof Date&&t instanceof Date?e.getTime()==t.getTime():e.jasmineMatches?e.jasmineMatches(t):t.jasmineMatches?t.jasmineMatches(e):e instanceof jasmine.Matchers.ObjectContaining?e.matches(t):t instanceof jasmine.Matchers.ObjectContaining?t.matches(e):jasmine.isString_(e)&&jasmine.isString_(t)?e==t:jasmine.isNumber_(e)&&jasmine.isNumber_(t)?e==t:typeof e=="object"&&typeof t=="object"?this.compareObjects_(e,t,n,r):e===t},jasmine.Env.prototype.contains_=function(e,t){if(jasmine.isArray_(e)){for(var n=0;n<e.length;n++)if(this.equals_(e[n],t))return!0;return!1}return e.indexOf(t)>=0},jasmine.Env.prototype.addEqualityTester=function(e){this.equalityTesters_.push(e)},jasmine.Reporter=function(){},jasmine.Reporter.prototype.reportRunnerStarting=function(e){},jasmine.Reporter.prototype.reportRunnerResults=function(e){},jasmine.Reporter.prototype.reportSuiteResults=function(e){},jasmine.Reporter.prototype.reportSpecStarting=function(e){},jasmine.Reporter.prototype.reportSpecResults=function(e){},jasmine.Reporter.prototype.log=function(e){},jasmine.Block=function(e,t,n){this.env=e,this.func=t,this.spec=n},jasmine.Block.prototype.execute=function(e){try{this.func.apply(this.spec)}catch(t){this.spec.fail(t)}e()},jasmine.JsApiReporter=function(){this.started=!1,this.finished=!1,this.suites_=[],this.results_={}},jasmine.JsApiReporter.prototype.reportRunnerStarting=function(e){this.started=!0;var t=e.topLevelSuites();for(var n=0;n<t.length;n++){var r=t[n];this.suites_.push(this.summarize_(r))}},jasmine.JsApiReporter.prototype.suites=function(){return this.suites_},jasmine.JsApiReporter.prototype.summarize_=function(e){var t=e instanceof jasmine.Suite,n={id:e.id,name:e.description,type:t?"suite":"spec",children:[]};if(t){var r=e.children();for(var i=0;i<r.length;i++)n.children.push(this.summarize_(r[i]))}return n},jasmine.JsApiReporter.prototype.results=function(){return this.results_},jasmine.JsApiReporter.prototype.resultsForSpec=function(e){return this.results_[e]},jasmine.JsApiReporter.prototype.reportRunnerResults=function(e){this.finished=!0},jasmine.JsApiReporter.prototype.reportSuiteResults=function(e){},jasmine.JsApiReporter.prototype.reportSpecResults=function(e){this.results_[e.id]={messages:e.results().getItems(),result:e.results().failedCount>0?"failed":"passed"}},jasmine.JsApiReporter.prototype.log=function(e){},jasmine.JsApiReporter.prototype.resultsForSpecs=function(e){var t={};for(var n=0;n<e.length;n++){var r=e[n];t[r]=this.summarizeResult_(this.results_[r])}return t},jasmine.JsApiReporter.prototype.summarizeResult_=function(e){var t=[],n=e.messages.length;for(var r=0;r<n;r++){var i=e.messages[r];t.push({text:i.type=="log"?i.toString():jasmine.undefined,passed:i.passed?i.passed():!0,type:i.type,message:i.message,trace:{stack:i.passed&&!i.passed()?i.trace.stack:jasmine.undefined}})}return{result:e.result,messages:t}},jasmine.Matchers=function(e,t,n,r){this.env=e,this.actual=t,this.spec=n,this.isNot=r||!1,this.reportWasCalled_=!1},jasmine.Matchers.pp=function(e){throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!")},jasmine.Matchers.prototype.report=function(e,t,n){throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs")},jasmine.Matchers.wrapInto_=function(e,t){for(var n in e){if(n=="report")continue;var r=e[n];t.prototype[n]=jasmine.Matchers.matcherFn_(n,r)}},jasmine.Matchers.matcherFn_=function(e,t){return function(){var n=jasmine.util.argsToArray(arguments),r=t.apply(this,arguments);this.isNot&&(r=!r);if(this.reportWasCalled_)return r;var i;if(!r)if(this.message)i=this.message.apply(this,arguments),jasmine.isArray_(i)&&(i=i[this.isNot?1:0]);else{var s=e.replace(/[A-Z]/g,function(e){return" "+e.toLowerCase()});i="Expected "+jasmine.pp(this.actual)+(this.isNot?" not ":" ")+s;if(n.length>0)for(var o=0;o<n.length;o++)o>0&&(i+=","),i+=" "+jasmine.pp(n[o]);i+="."}var u=new jasmine.ExpectationResult({matcherName:e,passed:r,expected:n.length>1?n:n[0],actual:this.actual,message:i});return this.spec.addMatcherResult(u),jasmine.undefined}},jasmine.Matchers.prototype.toBe=function(e){return this.actual===e},jasmine.Matchers.prototype.toNotBe=function(e){return this.actual!==e},jasmine.Matchers.prototype.toEqual=function(e){return this.env.equals_(this.actual,e)},jasmine.Matchers.prototype.toNotEqual=function(e){return!this.env.equals_(this.actual,e)},jasmine.Matchers.prototype.toMatch=function(e){return(new RegExp(e)).test(this.actual)},jasmine.Matchers.prototype.toNotMatch=function(e){return!(new RegExp(e)).test(this.actual)},jasmine.Matchers.prototype.toBeDefined=function(){return this.actual!==jasmine.undefined},jasmine.Matchers.prototype.toBeUndefined=function(){return this.actual===jasmine.undefined},jasmine.Matchers.prototype.toBeNull=function(){return this.actual===null},jasmine.Matchers.prototype.toBeTruthy=function(){return!!this.actual},jasmine.Matchers.prototype.toBeFalsy=function(){return!this.actual},jasmine.Matchers.prototype.toHaveBeenCalled=function(){if(arguments.length>0)throw new Error("toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith");if(!jasmine.isSpy(this.actual))throw new Error("Expected a spy, but got "+jasmine.pp(this.actual)+".");return this.message=function(){return["Expected spy "+this.actual.identity+" to have been called.","Expected spy "+this.actual.identity+" not to have been called."]},this.actual.wasCalled},jasmine.Matchers.prototype.wasCalled=jasmine.Matchers.prototype.toHaveBeenCalled,jasmine.Matchers.prototype.wasNotCalled=function(){if(arguments.length>0)throw new Error("wasNotCalled does not take arguments");if(!jasmine.isSpy(this.actual))throw new Error("Expected a spy, but got "+jasmine.pp(this.actual)+".");return this.message=function(){return["Expected spy "+this.actual.identity+" to not have been called.","Expected spy "+this.actual.identity+" to have been called."]},!this.actual.wasCalled},jasmine.Matchers.prototype.toHaveBeenCalledWith=function(){var e=jasmine.util.argsToArray(arguments);if(!jasmine.isSpy(this.actual))throw new Error("Expected a spy, but got "+jasmine.pp(this.actual)+".");return this.message=function(){return this.actual.callCount===0?["Expected spy "+this.actual.identity+" to have been called with "+jasmine.pp(e)+" but it was never called.","Expected spy "+this.actual.identity+" not to have been called with "+jasmine.pp(e)+" but it was."]:["Expected spy "+this.actual.identity+" to have been called with "+jasmine.pp(e)+" but was called with "+jasmine.pp(this.actual.argsForCall),"Expected spy "+this.actual.identity+" not to have been called with "+jasmine.pp(e)+" but was called with "+jasmine.pp(this.actual.argsForCall)]},this.env.contains_(this.actual.argsForCall,e)},jasmine.Matchers.prototype.wasCalledWith=jasmine.Matchers.prototype.toHaveBeenCalledWith,jasmine.Matchers.prototype.wasNotCalledWith=function(){var e=jasmine.util.argsToArray(arguments);if(!jasmine.isSpy(this.actual))throw new Error("Expected a spy, but got "+jasmine.pp(this.actual)+".");return this.message=function(){return["Expected spy not to have been called with "+jasmine.pp(e)+" but it was","Expected spy to have been called with "+jasmine.pp(e)+" but it was"]},!this.env.contains_(this.actual.argsForCall,e)},jasmine.Matchers.prototype.toContain=function(e){return this.env.contains_(this.actual,e)},jasmine.Matchers.prototype.toNotContain=function(e){return!this.env.contains_(this.actual,e)},jasmine.Matchers.prototype.toBeLessThan=function(e){return this.actual<e},jasmine.Matchers.prototype.toBeGreaterThan=function(e){return this.actual>e},jasmine.Matchers.prototype.toBeCloseTo=function(e,t){t!==0&&(t=t||2);var n=Math.pow(10,t),r=Math.round(this.actual*n);return e=Math.round(e*n),e==r},jasmine.Matchers.prototype.toThrow=function(e){var t=!1,n;if(typeof this.actual!="function")throw new Error("Actual is not a function");try{this.actual()}catch(r){n=r}n&&(t=e===jasmine.undefined||this.env.equals_(n.message||n,e.message||e));var i=this.isNot?"not ":"";return this.message=function(){return n&&(e===jasmine.undefined||!this.env.equals_(n.message||n,e.message||e))?["Expected function "+i+"to throw",e?e.message||e:"an exception",", but it threw",n.message||n].join(" "):"Expected function to throw an exception."},t},jasmine.Matchers.Any=function(e){this.expectedClass=e},jasmine.Matchers.Any.prototype.jasmineMatches=function(e){return this.expectedClass==String?typeof e=="string"||e instanceof String:this.expectedClass==Number?typeof e=="number"||e instanceof Number:this.expectedClass==Function?typeof e=="function"||e instanceof Function:this.expectedClass==Object?typeof e=="object":e instanceof this.expectedClass},jasmine.Matchers.Any.prototype.jasmineToString=function(){return"<jasmine.any("+this.expectedClass+")>"},jasmine.Matchers.ObjectContaining=function(e){this.sample=e},jasmine.Matchers.ObjectContaining.prototype.jasmineMatches=function(e,t,n){t=t||[],n=n||[];var r=jasmine.getEnv(),i=function(e,t){return e!=null&&e[t]!==jasmine.undefined};for(var s in this.sample)!i(e,s)&&i(this.sample,s)?t.push("expected has key '"+s+"', but missing from actual."):r.equals_(this.sample[s],e[s],t,n)||n.push("'"+s+"' was '"+(e[s]?jasmine.util.htmlEscape(e[s].toString()):e[s])+"' in expected, but was '"+(this.sample[s]?jasmine.util.htmlEscape(this.sample[s].toString()):this.sample[s])+"' in actual.");return t.length===0&&n.length===0},jasmine.Matchers.ObjectContaining.prototype.jasmineToString=function(){return"<jasmine.objectContaining("+jasmine.pp(this.sample)+")>"},jasmine.FakeTimer=function(){this.reset();var e=this;e.setTimeout=function(t,n){return e.timeoutsMade++,e.scheduleFunction(e.timeoutsMade,t,n,!1),e.timeoutsMade},e.setInterval=function(t,n){return e.timeoutsMade++,e.scheduleFunction(e.timeoutsMade,t,n,!0),e.timeoutsMade},e.clearTimeout=function(t){e.scheduledFunctions[t]=jasmine.undefined},e.clearInterval=function(t){e.scheduledFunctions[t]=jasmine.undefined}},jasmine.FakeTimer.prototype.reset=function(){this.timeoutsMade=0,this.scheduledFunctions={},this.nowMillis=0},jasmine.FakeTimer.prototype.tick=function(e){var t=this.nowMillis,n=t+e;this.runFunctionsWithinRange(t,n),this.nowMillis=n},jasmine.FakeTimer.prototype.runFunctionsWithinRange=function(e,t){var n,r=[];for(var i in this.scheduledFunctions)n=this.scheduledFunctions[i],n!=jasmine.undefined&&n.runAtMillis>=e&&n.runAtMillis<=t&&(r.push(n),this.scheduledFunctions[i]=jasmine.undefined);if(r.length>0){r.sort(function(e,t){return e.runAtMillis-t.runAtMillis});for(var s=0;s<r.length;++s)try{var o=r[s];this.nowMillis=o.runAtMillis,o.funcToCall(),o.recurring&&this.scheduleFunction(o.timeoutKey,o.funcToCall,o.millis,!0)}catch(u){}this.runFunctionsWithinRange(e,t)}},jasmine.FakeTimer.prototype.scheduleFunction=function(e,t,n,r){this.scheduledFunctions[e]={runAtMillis:this.nowMillis+n,funcToCall:t,recurring:r,timeoutKey:e,millis:n}},jasmine.Clock={defaultFakeTimer:new jasmine.FakeTimer,reset:function(){jasmine.Clock.assertInstalled(),jasmine.Clock.defaultFakeTimer.reset()},tick:function(e){jasmine.Clock.assertInstalled(),jasmine.Clock.defaultFakeTimer.tick(e)},runFunctionsWithinRange:function(e,t){jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(e,t)},scheduleFunction:function(e,t,n,r){jasmine.Clock.defaultFakeTimer.scheduleFunction(e,t,n,r)},useMock:function(){if(!jasmine.Clock.isInstalled()){var e=jasmine.getEnv().currentSpec;e.after(jasmine.Clock.uninstallMock),jasmine.Clock.installMock()}},installMock:function(){jasmine.Clock.installed=jasmine.Clock.defaultFakeTimer},uninstallMock:function(){jasmine.Clock.assertInstalled(),jasmine.Clock.installed=jasmine.Clock.real},real:{setTimeout:jasmine.getGlobal().setTimeout,clearTimeout:jasmine.getGlobal().clearTimeout,setInterval:jasmine.getGlobal().setInterval,clearInterval:jasmine.getGlobal().clearInterval},assertInstalled:function(){if(!jasmine.Clock.isInstalled())throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()")},isInstalled:function(){return jasmine.Clock.installed==jasmine.Clock.defaultFakeTimer},installed:null},jasmine.Clock.installed=jasmine.Clock.real,jasmine.getGlobal().setTimeout=function(e,t){return jasmine.Clock.installed.setTimeout.apply?jasmine.Clock.installed.setTimeout.apply(this,arguments):jasmine.Clock.installed.setTimeout(e,t)},jasmine.getGlobal().setInterval=function(e,t){return jasmine.Clock.installed.setInterval.apply?jasmine.Clock.installed.setInterval.apply(this,arguments):jasmine.Clock.installed.setInterval(e,t)},jasmine.getGlobal().clearTimeout=function(e){return jasmine.Clock.installed.clearTimeout.apply?jasmine.Clock.installed.clearTimeout.apply(this,arguments):jasmine.Clock.installed.clearTimeout(e)},jasmine.getGlobal().clearInterval=function(e){return jasmine.Clock.installed.clearTimeout.apply?jasmine.Clock.installed.clearInterval.apply(this,arguments):jasmine.Clock.installed.clearInterval(e)},jasmine.MultiReporter=function(){this.subReporters_=[]},jasmine.util.inherit(jasmine.MultiReporter,jasmine.Reporter),jasmine.MultiReporter.prototype.addReporter=function(e){this.subReporters_.push(e)},function(){var e=["reportRunnerStarting","reportRunnerResults","reportSuiteResults","reportSpecStarting","reportSpecResults","log"];for(var t=0;t<e.length;t++){var n=e[t];jasmine.MultiReporter.prototype[n]=function(e){return function(){for(var t=0;t<this.subReporters_.length;t++){var n=this.subReporters_[t];n[e]&&n[e].apply(n,arguments)}}}(n)}}(),jasmine.NestedResults=function(){this.totalCount=0,this.passedCount=0,this.failedCount=0,this.skipped=!1,this.items_=[]},jasmine.NestedResults.prototype.rollupCounts=function(e){this.totalCount+=e.totalCount,this.passedCount+=e.passedCount,this.failedCount+=e.failedCount},jasmine.NestedResults.prototype.log=function(e){this.items_.push(new jasmine.MessageResult(e))},jasmine.NestedResults.prototype.getItems=function(){return this.items_},jasmine.NestedResults.prototype.addResult=function(e){e.type!="log"&&(e.items_?this.rollupCounts(e):(this.totalCount++,e.passed()?this.passedCount++:this.failedCount++)),this.items_.push(e)},jasmine.NestedResults.prototype.passed=function(){return this.passedCount===this.totalCount},jasmine.PrettyPrinter=function(){this.ppNestLevel_=0},jasmine.PrettyPrinter.prototype.format=function(e){if(this.ppNestLevel_>40)throw new Error("jasmine.PrettyPrinter: format() nested too deeply!");this.ppNestLevel_++;try{e===jasmine.undefined?this.emitScalar("undefined"):e===null?this.emitScalar("null"):e===jasmine.getGlobal()?this.emitScalar("<global>"):e.jasmineToString?this.emitScalar(e.jasmineToString()):typeof e=="string"?this.emitString(e):jasmine.isSpy(e)?this.emitScalar("spy on "+e.identity):e instanceof RegExp?this.emitScalar(e.toString()):typeof e=="function"?this.emitScalar("Function"):typeof e.nodeType=="number"?this.emitScalar("HTMLNode"):e instanceof Date?this.emitScalar("Date("+e+")"):e.__Jasmine_been_here_before__?this.emitScalar("<circular reference: "+(jasmine.isArray_(e)?"Array":"Object")+">"):jasmine.isArray_(e)||typeof e=="object"?(e.__Jasmine_been_here_before__=!0,jasmine.isArray_(e)?this.emitArray(e):this.emitObject(e),delete e.__Jasmine_been_here_before__):this.emitScalar(e.toString())}finally{this.ppNestLevel_--}},jasmine.PrettyPrinter.prototype.iterateObject=function(e,t){for(var n in e){if(n=="__Jasmine_been_here_before__")continue;t(n,e.__lookupGetter__?e.__lookupGetter__(n)!==jasmine.undefined&&e.__lookupGetter__(n)!==null:!1)}},jasmine.PrettyPrinter.prototype.emitArray=jasmine.unimplementedMethod_,jasmine.PrettyPrinter.prototype.emitObject=jasmine.unimplementedMethod_,jasmine.PrettyPrinter.prototype.emitScalar=jasmine.unimplementedMethod_,jasmine.PrettyPrinter.prototype.emitString=jasmine.unimplementedMethod_,jasmine.StringPrettyPrinter=function(){jasmine.PrettyPrinter.call(this),this.string=""},jasmine.util.inherit(jasmine.StringPrettyPrinter,jasmine.PrettyPrinter),jasmine.StringPrettyPrinter.prototype.emitScalar=function(e){this.append(e)},jasmine.StringPrettyPrinter.prototype.emitString=function(e){this.append("'"+e+"'")},jasmine.StringPrettyPrinter.prototype.emitArray=function(e){this.append("[ ");for(var t=0;t<e.length;t++)t>0&&this.append(", "),this.format(e[t]);this.append(" ]")},jasmine.StringPrettyPrinter.prototype.emitObject=function(e){var t=this;this.append("{ ");var n=!0;this.iterateObject(e,function(r,i){n?n=!1:t.append(", "),t.append(r),t.append(" : "),i?t.append("<getter>"):t.format(e[r])}),this.append(" }")},jasmine.StringPrettyPrinter.prototype.append=function(e){this.string+=e},jasmine.Queue=function(e){this.env=e,this.blocks=[],this.running=!1,this.index=0,this.offset=0,this.abort=!1},jasmine.Queue.prototype.addBefore=function(e){this.blocks.unshift(e)},jasmine.Queue.prototype.add=function(e){this.blocks.push(e)},jasmine.Queue.prototype.insertNext=function(e){this.blocks.splice(this.index+this.offset+1,0,e),this.offset++},jasmine.Queue.prototype.start=function(e){this.running=!0,this.onComplete=e,this.next_()},jasmine.Queue.prototype.isRunning=function(){return this.running},jasmine.Queue.LOOP_DONT_RECURSE=!0,jasmine.Queue.prototype.next_=function(){var e=this,t=!0;while(t){t=!1;if(e.index<e.blocks.length&&!this.abort){var n=!0,r=!1,i=function(){if(jasmine.Queue.LOOP_DONT_RECURSE&&n){r=!0;return}e.blocks[e.index].abort&&(e.abort=!0),e.offset=0,e.index++;var i=(new Date).getTime();e.env.updateInterval&&i-e.env.lastUpdate>e.env.updateInterval?(e.env.lastUpdate=i,e.env.setTimeout(function(){e.next_()},0)):jasmine.Queue.LOOP_DONT_RECURSE&&r?t=!0:e.next_()};e.blocks[e.index].execute(i),n=!1,r&&i()}else e.running=!1,e.onComplete&&e.onComplete()}},jasmine.Queue.prototype.results=function(){var e=new jasmine.NestedResults;for(var t=0;t<this.blocks.length;t++)this.blocks[t].results&&e.addResult(this.blocks[t].results());return e},jasmine.Runner=function(e){var t=this;t.env=e,t.queue=new jasmine.Queue(e),t.before_=[],t.after_=[],t.suites_=[]},jasmine.Runner.prototype.execute=function(){var e=this;e.env.reporter.reportRunnerStarting&&e.env.reporter.reportRunnerStarting(this),e.queue.start(function(){e.finishCallback()})},jasmine.Runner.prototype.beforeEach=function(e){e.typeName="beforeEach",this.before_.splice(0,0,e)},jasmine.Runner.prototype.afterEach=function(e){e.typeName="afterEach",this.after_.splice(0,0,e)},jasmine.Runner.prototype.finishCallback=function(){this.env.reporter.reportRunnerResults(this)},jasmine.Runner.prototype.addSuite=function(e){this.suites_.push(e)},jasmine.Runner.prototype.add=function(e){e instanceof jasmine.Suite&&this.addSuite(e),this.queue.add(e)},jasmine.Runner.prototype.specs=function(){var e=this.suites(),t=[];for(var n=0;n<e.length;n++)t=t.concat(e[n].specs());return t},jasmine.Runner.prototype.suites=function(){return this.suites_},jasmine.Runner.prototype.topLevelSuites=function(){var e=[];for(var t=0;t<this.suites_.length;t++)this.suites_[t].parentSuite||e.push(this.suites_[t]);return e},jasmine.Runner.prototype.results=function(){return this.queue.results()},jasmine.Spec=function(e,t,n){if(!e)throw new Error("jasmine.Env() required");if(!t)throw new Error("jasmine.Suite() required");var r=this;r.id=e.nextSpecId?e.nextSpecId():null,r.env=e,r.suite=t,r.description=n,r.queue=new jasmine.Queue(e),r.afterCallbacks=[],r.spies_=[],r.results_=new jasmine.NestedResults,r.results_.description=n,r.matchersClass=null},jasmine.Spec.prototype.getFullName=function(){return this.suite.getFullName()+" "+this.description+"."},jasmine.Spec.prototype.results=function(){return this.results_},jasmine.Spec.prototype.log=function(){return this.results_.log(arguments)},jasmine.Spec.prototype.runs=function(e){var t=new jasmine.Block(this.env,e,this);return this.addToQueue(t),this},jasmine.Spec.prototype.addToQueue=function(e){this.queue.isRunning()?this.queue.insertNext(e):this.queue.add(e)},jasmine.Spec.prototype.addMatcherResult=function(e){this.results_.addResult(e)},jasmine.Spec.prototype.expect=function(e){var t=new(this.getMatchersClass_())(this.env,e,this);return t.not=new(this.getMatchersClass_())(this.env,e,this,!0),t},jasmine.Spec.prototype.waits=function(e){var t=new jasmine.WaitsBlock(this.env,e,this);return this.addToQueue(t),this},jasmine.Spec.prototype.waitsFor=function(e,t,n){var r=null,i=null,s=null;for(var o=0;o<arguments.length;o++){var u=arguments[o];switch(typeof u){case"function":r=u;break;case"string":i=u;break;case"number":s=u}}var a=new jasmine.WaitsForBlock(this.env,s,r,i,this);return this.addToQueue(a),this},jasmine.Spec.prototype.fail=function(e){var t=new jasmine.ExpectationResult({passed:!1,message:e?jasmine.util.formatException(e):"Exception",trace:{stack:e.stack}});this.results_.addResult(t)},jasmine.Spec.prototype.getMatchersClass_=function(){return this.matchersClass||this.env.matchersClass},jasmine.Spec.prototype.addMatchers=function(e){var t=this.getMatchersClass_(),n=function(){t.apply(this,arguments)};jasmine.util.inherit(n,t),jasmine.Matchers.wrapInto_(e,n),this.matchersClass=n},jasmine.Spec.prototype.finishCallback=function(){this.env.reporter.reportSpecResults(this)},jasmine.Spec.prototype.finish=function(e){this.removeAllSpies(),this.finishCallback(),e&&e()},jasmine.Spec.prototype.after=function(e){this.queue.isRunning()?this.queue.add(new jasmine.Block(this.env,e,this)):this.afterCallbacks.unshift(e)},jasmine.Spec.prototype.execute=function(e){var t=this;if(!t.env.specFilter(t)){t.results_.skipped=!0,t.finish(e);return}this.env.reporter.reportSpecStarting(this),t.env.currentSpec=t,t.addBeforesAndAftersToQueue(),t.queue.start(function(){t.finish(e)})},jasmine.Spec.prototype.addBeforesAndAftersToQueue=function(){var e=this.env.currentRunner(),t;for(var n=this.suite;n;n=n.parentSuite)for(t=0;t<n.before_.length;t++)this.queue.addBefore(new jasmine.Block(this.env,n.before_[t],this));for(t=0;t<e.before_.length;t++)this.queue.addBefore(new jasmine.Block(this.env,e.before_[t],this));for(t=0;t<this.afterCallbacks.length;t++)this.queue.add(new jasmine.Block(this.env,this.afterCallbacks[t],this));for(n=this.suite;n;n=n.parentSuite)for(t=0;t<n.after_.length;t++)this.queue.add(new jasmine.Block(this.env,n.after_[t],this));for(t=0;t<e.after_.length;t++)this.queue.add(new jasmine.Block(this.env,e.after_[t],this))},jasmine.Spec.prototype.explodes=function(){throw"explodes function should not have been called"},jasmine.Spec.prototype.spyOn=function(e,t,n){if(e==jasmine.undefined)throw"spyOn could not find an object to spy upon for "+t+"()";if(!n&&e[t]===jasmine.undefined)throw t+"() method does not exist";if(!n&&e[t]&&e[t].isSpy)throw new Error(t+" has already been spied upon");var r=jasmine.createSpy(t);return this.spies_.push(r),r.baseObj=e,r.methodName=t,r.originalValue=e[t],e[t]=r,r},jasmine.Spec.prototype.removeAllSpies=function(){for(var e=0;e<this.spies_.length;e++){var t=this.spies_[e];t.baseObj[t.methodName]=t.originalValue}this.spies_=[]},jasmine.Suite=function(e,t,n,r){var i=this;i.id=e.nextSuiteId?e.nextSuiteId():null,i.description=t,i.queue=new jasmine.Queue(e),i.parentSuite=r,i.env=e,i.before_=[],i.after_=[],i.children_=[],i.suites_=[],i.specs_=[]},jasmine.Suite.prototype.getFullName=function(){var e=this.description;for(var t=this.parentSuite;t;t=t.parentSuite)e=t.description+" "+e;return e},jasmine.Suite.prototype.finish=function(e){this.env.reporter.reportSuiteResults(this),this.finished=!0,typeof e=="function"&&e()},jasmine.Suite.prototype.beforeEach=function(e){e.typeName="beforeEach",this.before_.unshift(e)},jasmine.Suite.prototype.afterEach=function(e){e.typeName="afterEach",this.after_.unshift(e)},jasmine.Suite.prototype.results=function(){return this.queue.results()},jasmine.Suite.prototype.add=function(e){this.children_.push(e),e instanceof jasmine.Suite?(this.suites_.push(e),this.env.currentRunner().addSuite(e)):this.specs_.push(e),this.queue.add(e)},jasmine.Suite.prototype.specs=function(){return this.specs_},jasmine.Suite.prototype.suites=function(){return this.suites_},jasmine.Suite.prototype.children=function(){return this.children_},jasmine.Suite.prototype.execute=function(e){var t=this;this.queue.start(function(){t.finish(e)})},jasmine.WaitsBlock=function(e,t,n){this.timeout=t,jasmine.Block.call(this,e,null,n)},jasmine.util.inherit(jasmine.WaitsBlock,jasmine.Block),jasmine.WaitsBlock.prototype.execute=function(e){jasmine.VERBOSE&&this.env.reporter.log(">> Jasmine waiting for "+this.timeout+" ms..."),this.env.setTimeout(function(){e()},this.timeout)},jasmine.WaitsForBlock=function(e,t,n,r,i){this.timeout=t||e.defaultTimeoutInterval,this.latchFunction=n,this.message=r,this.totalTimeSpentWaitingForLatch=0,jasmine.Block.call(this,e,null,i)},jasmine.util.inherit(jasmine.WaitsForBlock,jasmine.Block),jasmine.WaitsForBlock.TIMEOUT_INCREMENT=10,jasmine.WaitsForBlock.prototype.execute=function(e){jasmine.VERBOSE&&this.env.reporter.log(">> Jasmine waiting for "+(this.message||"something to happen"));var t;try{t=this.latchFunction.apply(this.spec)}catch(n){this.spec.fail(n),e();return}if(t)e();else if(this.totalTimeSpentWaitingForLatch>=this.timeout){var r="timed out after "+this.timeout+" msec waiting for "+(this.message||"something to happen");this.spec.fail({name:"timeout",message:r}),this.abort=!0,e()}else{this.totalTimeSpentWaitingForLatch+=jasmine.WaitsForBlock.TIMEOUT_INCREMENT;var i=this;this.env.setTimeout(function(){i.execute(e)},jasmine.WaitsForBlock.TIMEOUT_INCREMENT)}},jasmine.version_={major:1,minor:2,build:0,revision:1337005947},jasmine.HtmlReporterHelpers={},jasmine.HtmlReporterHelpers.createDom=function(e,t,n){var r=document.createElement(e);for(var i=2;i<arguments.length;i++){var s=arguments[i];typeof s=="string"?r.appendChild(document.createTextNode(s)):s&&r.appendChild(s)}for(var o in t)o=="className"?r[o]=t[o]:r.setAttribute(o,t[o]);return r},jasmine.HtmlReporterHelpers.getSpecStatus=function(e){var t=e.results(),n=t.passed()?"passed":"failed";return t.skipped&&(n="skipped"),n},jasmine.HtmlReporterHelpers.appendToSummary=function(e,t){var n=this.dom.summary,r=typeof e.parentSuite=="undefined"?"suite":"parentSuite",i=e[r];i&&(typeof this.views.suites[i.id]=="undefined"&&(this.views.suites[i.id]=new jasmine.HtmlReporter.SuiteView(i,this.dom,this.views)),n=this.views.suites[i.id].element),n.appendChild(t)},jasmine.HtmlReporterHelpers.addHelpers=function(e){for(var t in jasmine.HtmlReporterHelpers)e.prototype[t]=jasmine.HtmlReporterHelpers[t]},jasmine.HtmlReporter=function(e){function s(){var e;return function(){if(e)return;var r=[],i=n.location.search.substring(1).split("&");for(var s=0;s<i.length;s++){var o=i[s].split("=");r[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}e=r.spec}(),e}function o(e){i.reporter=t.createDom("div",{id:"HTMLReporter",className:"jasmine_reporter"},i.banner=t.createDom("div",{className:"banner"},t.createDom("span",{className:"title"},"Jasmine "),t.createDom("span",{className:"version"},e)),i.symbolSummary=t.createDom("ul",{className:"symbolSummary"}),i.alert=t.createDom("div",{className:"alert"}),i.results=t.createDom("div",{className:"results"},i.summary=t.createDom("div",{className:"summary"}),i.details=t.createDom("div",{id:"details"})))}var t=this,n=e||window.document,r,i={};return t.logRunningSpecs=!1,t.reportRunnerStarting=function(e){var s=e.specs()||[];if(s.length==0)return;o(e.env.versionString()),n.body.appendChild(i.reporter),r=new jasmine.HtmlReporter.ReporterView(i),r.addSpecs(s,t.specFilter)},t.reportRunnerResults=function(e){r&&r.complete()},t.reportSuiteResults=function(e){r.suiteComplete(e)},t.reportSpecStarting=function(e){t.logRunningSpecs&&t.log(">> Jasmine Running "+e.suite.description+" "+e.description+"...")},t.reportSpecResults=function(e){r.specComplete(e)},t.log=function(){var e=jasmine.getGlobal().console;e&&e.log&&(e.log.apply?e.log.apply(e,arguments):e.log(arguments))},t.specFilter=function(e){return s()?e.getFullName().indexOf(s())===0:!0},t},jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter),jasmine.HtmlReporter.ReporterView=function(e){function t(){e.reporter.className.search(/showDetails/)===-1&&(e.reporter.className+=" showDetails")}function n(e){return typeof e=="undefined"}function r(e){return!n(e)}function i(e){var t=e+" spec";return e>1&&(t+="s"),t}return this.startedAt=new Date,this.runningSpecCount=0,this.completeSpecCount=0,this.passedCount=0,this.failedCount=0,this.skippedCount=0,this.createResultsMenu=function(){this.resultsMenu=this.createDom("span",{className:"resultsMenu bar"},this.summaryMenuItem=this.createDom("a",{className:"summaryMenuItem",href:"#"},"0 specs")," | ",this.detailsMenuItem=this.createDom("a",{className:"detailsMenuItem",href:"#"},"0 failing")),this.summaryMenuItem.onclick=function(){e.reporter.className=e.reporter.className.replace(/ showDetails/g,"")},this.detailsMenuItem.onclick=function(){t()}},this.addSpecs=function(t,n){this.totalSpecCount=t.length,this.views={specs:{},suites:{}};for(var r=0;r<t.length;r++){var i=t[r];this.views.specs[i.id]=new jasmine.HtmlReporter.SpecView(i,e,this.views),n(i)&&this.runningSpecCount++}},this.specComplete=function(t){this.completeSpecCount++,n(this.views.specs[t.id])&&(this.views.specs[t.id]=new jasmine.HtmlReporter.SpecView(t,e));var r=this.views.specs[t.id];switch(r.status()){case"passed":this.passedCount++;break;case"failed":this.failedCount++;break;case"skipped":this.skippedCount++}r.refresh(),this.refresh()},this.suiteComplete=function(e){var t=this.views.suites[e.id];if(n(t))return;t.refresh()},this.refresh=function(){n(this.resultsMenu)&&this.createResultsMenu(),n(this.runningAlert)&&(this.runningAlert=this.createDom("a",{href:"?",className:"runningAlert bar"}),e.alert.appendChild(this.runningAlert)),this.runningAlert.innerHTML="Running "+this.completeSpecCount+" of "+i(this.totalSpecCount),n(this.skippedAlert)&&(this.skippedAlert=this.createDom("a",{href:"?",className:"skippedAlert bar"})),this.skippedAlert.innerHTML="Skipping "+this.skippedCount+" of "+i(this.totalSpecCount)+" - run all",this.skippedCount===1&&r(e.alert)&&e.alert.appendChild(this.skippedAlert),n(this.passedAlert)&&(this.passedAlert=this.createDom("span",{href:"?",className:"passingAlert bar"})),this.passedAlert.innerHTML="Passing "+i(this.passedCount),n(this.failedAlert)&&(this.failedAlert=this.createDom("span",{href:"?",className:"failingAlert bar"})),this.failedAlert.innerHTML="Failing "+i(this.failedCount),this.failedCount===1&&r(e.alert)&&(e.alert.appendChild(this.failedAlert),e.alert.appendChild(this.resultsMenu)),this.summaryMenuItem.innerHTML=""+i(this.runningSpecCount),this.detailsMenuItem.innerHTML=""+this.failedCount+" failing"},this.complete=function(){e.alert.removeChild(this.runningAlert),this.skippedAlert.innerHTML="Ran "+this.runningSpecCount+" of "+i(this.totalSpecCount)+" - run all",this.failedCount===0?e.alert.appendChild(this.createDom("span",{className:"passingAlert bar"},"Passing "+i(this.passedCount))):t(),e.banner.appendChild(this.createDom("span",{className:"duration"},"finished in "+((new Date).getTime()-this.startedAt.getTime())/1e3+"s"))},this},jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView),jasmine.HtmlReporter.SpecView=function(e,t,n){this.spec=e,this.dom=t,this.views=n,this.symbol=this.createDom("li",{className:"pending"}),this.dom.symbolSummary.appendChild(this.symbol),this.summary=this.createDom("div",{className:"specSummary"},this.createDom("a",{className:"description",href:"?spec="+encodeURIComponent(this.spec.getFullName()),title:this.spec.getFullName()},this.spec.description)),this.detail=this.createDom("div",{className:"specDetail"},this.createDom("a",{className:"description",href:"?spec="+encodeURIComponent(this.spec.getFullName()),title:this.spec.getFullName()},this.spec.getFullName()))},jasmine.HtmlReporter.SpecView.prototype.status=function(){return this.getSpecStatus(this.spec)},jasmine.HtmlReporter.SpecView.prototype.refresh=function(){this.symbol.className=this.status();switch(this.status()){case"skipped":break;case"passed":this.appendSummaryToSuiteDiv();break;case"failed":this.appendSummaryToSuiteDiv(),this.appendFailureDetail()}},jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv=function(){this.summary.className+=" "+this.status(),this.appendToSummary(this.spec,this.summary)},jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail=function(){this.detail.className+=" "+this.status();var e=this.spec.results().getItems(),t=this.createDom("div",{className:"messages"});for(var n=0;n<e.length;n++){var r=e[n];r.type=="log"?t.appendChild(this.createDom("div",{className:"resultMessage log"},r.toString())):r.type=="expect"&&r.passed&&!r.passed()&&(t.appendChild(this.createDom("div",{className:"resultMessage fail"},r.message)),r.trace.stack&&t.appendChild(this.createDom("div",{className:"stackTrace"},r.trace.stack)))}t.childNodes.length>0&&(this.detail.appendChild(t),this.dom.details.appendChild(this.detail))},jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView),jasmine.HtmlReporter.SuiteView=function(e,t,n){this.suite=e,this.dom=t,this.views=n,this.element=this.createDom("div",{className:"suite"},this.createDom("a",{className:"description",href:"?spec="+encodeURIComponent(this.suite.getFullName())},this.suite.description)),this.appendToSummary(this.suite,this.element)},jasmine.HtmlReporter.SuiteView.prototype.status=function(){return this.getSpecStatus(this.suite)},jasmine.HtmlReporter.SuiteView.prototype.refresh=function(){this.element.className+=" "+this.status()},jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView),jasmine.TrivialReporter=function(e){this.document=e||document,this.suiteDivs={},this.logRunningSpecs=!1},jasmine.TrivialReporter.prototype.createDom=function(e,t,n){var r=document.createElement(e);for(var i=2;i<arguments.length;i++){var s=arguments[i];typeof s=="string"?r.appendChild(document.createTextNode(s)):s&&r.appendChild(s)}for(var o in t)o=="className"?r[o]=t[o]:r.setAttribute(o,t[o]);return r},jasmine.TrivialReporter.prototype.reportRunnerStarting=function(e){var t,n;this.outerDiv=this.createDom("div",{id:"TrivialReporter",className:"jasmine_reporter"},this.createDom("div",{className:"banner"},this.createDom("div",{className:"logo"},this.createDom("span",{className:"title"},"Jasmine"),this.createDom("span",{className:"version"},e.env.versionString())),this.createDom("div",{className:"options"},"Show ",t=this.createDom("input",{id:"__jasmine_TrivialReporter_showPassed__",type:"checkbox"}),this.createDom("label",{"for":"__jasmine_TrivialReporter_showPassed__"}," passed "),n=this.createDom("input",{id:"__jasmine_TrivialReporter_showSkipped__",type:"checkbox"}),this.createDom("label",{"for":"__jasmine_TrivialReporter_showSkipped__"}," skipped"))),this.runnerDiv=this.createDom("div",{className:"runner running"},this.createDom("a",{className:"run_spec",href:"?"},"run all"),this.runnerMessageSpan=this.createDom("span",{},"Running..."),this.finishedAtSpan=this.createDom("span",{className:"finished-at"},""))),this.document.body.appendChild(this.outerDiv);var r=e.suites();for(var i=0;i<r.length;i++){var s=r[i],o=this.createDom("div",{className:"suite"},this.createDom("a",{className:"run_spec",href:"?spec="+encodeURIComponent(s.getFullName())},"run"),this.createDom("a",{className:"description",href:"?spec="+encodeURIComponent(s.getFullName())},s.description));this.suiteDivs[s.id]=o;var u=this.outerDiv;s.parentSuite&&(u=this.suiteDivs[s.parentSuite.id]),u.appendChild(o)}this.startedAt=new Date;var a=this;t.onclick=function(e){t.checked?a.outerDiv.className+=" show-passed":a.outerDiv.className=a.outerDiv.className.replace(/ show-passed/,"")},n.onclick=function(e){n.checked?a.outerDiv.className+=" show-skipped":a.outerDiv.className=a.outerDiv.className.replace(/ show-skipped/,"")}},jasmine.TrivialReporter.prototype.reportRunnerResults=function(e){var t=e.results(),n=t.failedCount>0?"runner failed":"runner passed";this.runnerDiv.setAttribute("class",n),this.runnerDiv.setAttribute("className",n);var r=e.specs(),i=0;for(var s=0;s<r.length;s++)this.specFilter(r[s])&&i++;var o=""+i+" spec"+(i==1?"":"s")+", "+t.failedCount+" failure"+(t.failedCount==1?"":"s");o+=" in "+((new Date).getTime()-this.startedAt.getTime())/1e3+"s",this.runnerMessageSpan.replaceChild(this.createDom("a",{className:"description",href:"?"},o),this.runnerMessageSpan.firstChild),this.finishedAtSpan.appendChild(document.createTextNode("Finished at "+(new Date).toString()))},jasmine.TrivialReporter.prototype.reportSuiteResults=function(e){var t=e.results(),n=t.passed()?"passed":"failed";t.totalCount===0&&(n="skipped"),this.suiteDivs[e.id].className+=" "+n},jasmine.TrivialReporter.prototype.reportSpecStarting=function(e){this.logRunningSpecs&&this.log(">> Jasmine Running "+e.suite.description+" "+e.description+"...")},jasmine.TrivialReporter.prototype.reportSpecResults=function(e){var t=e.results(),n=t.passed()?"passed":"failed";t.skipped&&(n="skipped");var r=this.createDom("div",{className:"spec "+n},this.createDom("a",{className:"run_spec",href:"?spec="+encodeURIComponent(e.getFullName())},"run"),this.createDom("a",{className:"description",href:"?spec="+encodeURIComponent(e.getFullName()),title:e.getFullName()},e.description)),i=t.getItems(),s=this.createDom("div",{className:"messages"});for(var o=0;o<i.length;o++){var u=i[o];u.type=="log"?s.appendChild(this.createDom("div",{className:"resultMessage log"},u.toString())):u.type=="expect"&&u.passed&&!u.passed()&&(s.appendChild(this.createDom("div",{className:"resultMessage fail"},u.message)),u.trace.stack&&s.appendChild(this.createDom("div",{className:"stackTrace"},u.trace.stack)))}s.childNodes.length>0&&r.appendChild(s),this.suiteDivs[e.suite.id].appendChild(r)},jasmine.TrivialReporter.prototype.log=function(){var e=jasmine.getGlobal().console;e&&e.log&&(e.log.apply?e.log.apply(e,arguments):e.log(arguments))},jasmine.TrivialReporter.prototype.getLocation=function(){return this.document.location},jasmine.TrivialReporter.prototype.specFilter=function(e){var t={},n=this.getLocation().search.substring(1).split("&");for(var r=0;r<n.length;r++){var i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t.spec?e.getFullName().indexOf(t.spec)===0:!0}
View
7 lib/pry-notebook/files/main.js
@@ -0,0 +1,7 @@
+$(function () {
+ var nb = new Notebook({ input: ".input input", output: ".output" });
+
+ Notebook.openSocket(function (msg) {
+ nb.handleMessage(JSON.parse(msg.data));
+ });
+});
View
24 lib/pry-notebook/files/notebook.js
@@ -0,0 +1,24 @@
+function Notebook(options) {
+ this.bindKeyup();
+};
+
+Notebook.openSocket = function(callback) {
+ var klass = ("MozWebSocket" in window) ? MozWebSocket : WebSocket,
+ socket = new klass('ws://' + window.location.host);
+
+ socket.onmessage = callback;
+};
+
+Notebook.prototype.handleMessage = function(data) {
+ var div = $('<div/>').addClass("pry-" + data.type).text(data.value);
+ $('.output').append(div);
+};
+
+Notebook.prototype.bindKeyup = function () {
+ $('input').on('keyup', function (e) {
+ if (e.keyCode == 13) {
+ $.post('/', $(this).val());
+ $(this).val('');
+ }
+ });
+};
View
19 lib/pry-notebook/files/pry-notebook.css
@@ -0,0 +1,19 @@
+.content {
+ width: 800px;
+ margin: 0 auto;
+ background: #EEEEEE;
+ padding: 16px;
+}
+
+.output, input {
+ font-family: Monaco, Consolas, monospace;
+ font-size: 16px;
+}
+
+input {
+ border: none;
+ width: 800px;
+ position: relative;
+ left: -8px;
+ padding: 2px 8px;
+}
View
15 lib/pry-notebook/files/test.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Pry Notebook</title>
+ <link rel="stylesheet" type="text/css" href="/pry-notebook.css">
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.3/underscore-min.js"></script>
+ <script src="/notebook.js"></script>
+ <script src="/jasmine.js"></script>
+ <script src="/test.js"></script>
+ </head>
+ <body>
+ </body>
+</html>
View
5 lib/pry-notebook/files/test.js
@@ -0,0 +1,5 @@
+describe("This shit", function() {
+ it("is bananas", function() {
+ expect(true).toBe(true);
+ });
+});
Please sign in to comment.
Something went wrong with that request. Please try again.