o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1355102769.8113: @value"(C{I" class:EFI"ProcessedAsset;FI"logical_path;FI"teabag/reporters/base.js;FI" pathname;FI"Y/Users/jejacks0n/Projects/teabag/app/assets/javascripts/teabag/reporters/base.coffee;FI"content_type;FI"application/javascript;FI" mtime;FI"2012-12-09T18:26:08-07:00;FI" length;Fiû?I" digest;F"%d1eaaf89617db1b14be19e4f3e77e6aaI" source;FI"û?(function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; Teabag.View = (function() { function View() { this.build(); } View.prototype.build = function(className) { return this.el = this.createEl("li", className); }; View.prototype.appendTo = function(el) { return el.appendChild(this.el); }; View.prototype.append = function(el) { return this.el.appendChild(el); }; View.prototype.createEl = function(type, className) { var el; if (className == null) { className = ""; } el = document.createElement(type); el.className = className; return el; }; View.prototype.findEl = function(id) { var _base; this.elements || (this.elements = []); return (_base = this.elements)[id] || (_base[id] = document.getElementById("teabag-" + id)); }; View.prototype.setText = function(id, value) { var el; el = this.findEl(id); return el.innerText = value; }; View.prototype.setHtml = function(id, value, add) { var el; if (add == null) { add = false; } el = this.findEl(id); if (add) { return el.innerHTML += value; } else { return el.innerHTML = value; } }; View.prototype.setClass = function(id, value) { var el; el = this.findEl(id); return el.className = value; }; return View; })(); Teabag.Reporters.Console = (function() { function Console() { this.reportRunnerResults = __bind(this.reportRunnerResults, this); this.fails = []; this.total = 0; this.start = Date.now(); } Console.prototype.reportSpecResults = function(spec) { var result, status; result = this.resultForSpec(spec); if (result.passed) { status = "pass"; } else if (result.skipped) { status = "skipped"; } else { this.trackFailure(spec); status = "fail"; } this.total += 1; return this.log({ type: "spec", status: status, description: result.description }); }; Console.prototype.reportRunnerResults = function() { this.log({ type: "results", total: this.total, failures: this.fails, elapsed: ((Date.now() - this.start) / 1000).toFixed(5) }); return Teabag.finished = true; }; Console.prototype.resultForSpec = function(spec) { var results; results = spec.results(); return { skipped: results.skipped, passed: results.passed(), description: spec.description }; }; Console.prototype.trackFailure = function(spec) { var item, _i, _len, _ref, _results; _ref = spec.results().getItems(); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { item = _ref[_i]; _results.push(this.fails.push({ spec: spec.getFullName(), description: item.toString(), link: this.paramsFor(spec.getFullName()), trace: item.trace.stack || item.trace.toString() })); } return _results; }; Console.prototype.paramsFor = function(description) { return "?grep=" + (encodeURIComponent(description)); }; Console.prototype.setFilter = function() {}; Console.prototype.log = function(obj) { if (obj == null) { obj = {}; } obj["_teabag"] = true; return console.log(JSON.stringify(obj)); }; return Console; })(); Teabag.Reporters.HTML = (function(_super) { __extends(HTML, _super); function HTML() { this.toggleConfig = __bind(this.toggleConfig, this); this.reportRunnerResults = __bind(this.reportRunnerResults, this); this.start = Date.now(); this.config = { "use-catch": true, "build-full-report": false }; this.total = { exist: 0, run: 0, passes: 0, failures: 0, skipped: 0 }; this.views = { specs: {}, suites: {} }; this.elements = {}; this.filter = false; this.readConfig(); HTML.__super__.constructor.apply(this, arguments); } HTML.prototype.build = function() { var ratio; this.el = this.findEl("report-all"); this.setText("env-info", this.envInfo()); this.findEl("toggles").onclick = this.toggleConfig; this.showConfiguration(); try { ratio = window.devicePixelRatio || 1; this.ctx = this.findEl("progress-canvas").getContext("2d"); return this.ctx.scale(ratio, ratio); } catch (e) { } }; HTML.prototype.reportRunnerStarting = function(runner) { this.total.exist = runner.total || runner.specs().length; if (this.total.exist) { return this.setText("stats-duration", "..."); } }; HTML.prototype.reportSpecStarting = function(spec) { if (this.config["build-full-report"]) { this.reportView = new Teabag.Reporters.HTML.SpecView(spec, this); } return this.specStart = Date.now(); }; HTML.prototype.reportSpecResults = function(spec) { this.total.run += 1; this.updatePercent(); return this.updateStatus(spec); }; HTML.prototype.updateStatus = function(spec) { var elapsed, result, _ref, _ref1; result = this.resultForSpec(spec); if (result.skipped) { this.setText("stats-skipped", this.total.skipped += 1); return; } elapsed = Date.now() - this.specStart; if (result.passed) { this.setText("stats-passes", this.total.passes += 1); return (_ref = this.reportView) != null ? _ref.updateState("passed", elapsed) : void 0; } else { this.setText("stats-failures", this.total.failures += 1); if ((_ref1 = this.reportView) != null) { _ref1.updateState("failed", elapsed); } if (!this.config["build-full-report"]) { new Teabag.Reporters.HTML.FailureView(spec).appendTo(this.findEl("report-failures")); } return this.setStatus("failed"); } }; HTML.prototype.resultForSpec = function(spec) { var result; result = spec.results(); return { skipped: result.skipped, passed: result.passed() }; }; HTML.prototype.reportRunnerResults = function() { if (!this.total.run) { return; } this.setText("stats-duration", "" + (((Date.now() - this.start) / 1000).toFixed(3)) + "s"); if (!this.total.failures) { this.setStatus("passed"); } if (this.total.run < this.total.exist) { this.total.skipped = this.total.exist - this.total.run; this.total.run = this.total.exist; } this.setText("stats-skipped", this.total.skipped); return this.updatePercent(); }; HTML.prototype.showConfiguration = function() { var key, value, _ref, _results; _ref = this.config; _results = []; for (key in _ref) { value = _ref[key]; _results.push(this.setClass(key, value ? "active" : "")); } return _results; }; HTML.prototype.updatePercent = function() { var half, percent, size; percent = this.total.exist ? Math.ceil((this.total.run * 100) / this.total.exist) : 0; this.setHtml("progress-percent", "" + percent + "%"); if (!this.ctx) { return; } size = 80; half = size / 2; this.ctx.strokeStyle = "#fff"; this.ctx.lineWidth = 1.5; this.ctx.clearRect(0, 0, size, size); this.ctx.beginPath(); this.ctx.arc(half, half, half - 1, 0, Math.PI * 2 * (percent / 100), false); return this.ctx.stroke(); }; HTML.prototype.setStatus = function(status) { return document.body.className = "teabag-" + status; }; HTML.prototype.setFilter = function(filter) { if (!filter) { return; } this.setClass("filtered", "teabag-filtered"); return this.setHtml("filtered", "" + filter, true); }; HTML.prototype.readConfig = function() { var config; if (config = this.cookie("teabag")) { return this.config = JSON.parse(config); } }; HTML.prototype.toggleConfig = function(e) { var button, name; button = e.target; if (button.tagName.toLowerCase() !== "button") { return; } name = button.getAttribute("id").replace(/^teabag-/, ""); this.config[name] = !this.config[name]; this.cookie("teabag", JSON.stringify(this.config)); if (name === "use-catch" || name === "build-full-report") { window.location.href = window.location.href; return; } this.readConfig(); return this.showConfiguration(); }; HTML.prototype.cookie = function(name, value) { var date, match; if (value == null) { value = void 0; } if (value === void 0) { name = name.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1"); match = document.cookie.match(new RegExp("(?:^|;)\\s?" + name + "=(.*?)(?:;|$)", "i")); return match && unescape(match[1]).split(' ')[0]; } else { document.cookie = "" + name + "=null"; date = new Date(); date.setDate(date.getDate() + 365); return document.cookie = "" + name + "=" + (escape(value)) + " expires=" + (date.toUTCString()) + ";"; } }; return HTML; })(Teabag.View); Teabag.Reporters.HTML.FailureView = (function(_super) { __extends(FailureView, _super); function FailureView(spec) { this.spec = spec; FailureView.__super__.constructor.apply(this, arguments); } FailureView.prototype.build = function() { var html; FailureView.__super__.build.call(this, "spec"); html = "

" + (this.fullName()) + "

"; return this.el.innerHTML = html + this.buildErrors(); }; FailureView.prototype.buildErrors = function() { var error, html, _i, _len, _ref, _results; html = ""; _ref = this.errors(); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { error = _ref[_i]; _results.push(html += "
" + (error.stack || error.message || "Stack trace unavailable") + "
"); } return _results; }; FailureView.prototype.fullName = function() { return this.spec.getFullName(); }; FailureView.prototype.errors = function() { var item, _i, _len, _ref, _results; _ref = this.spec.results().getItems(); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { item = _ref[_i]; _results.push(item.trace); } return _results; }; return FailureView; })(Teabag.View); Teabag.Reporters.HTML.SpecView = (function(_super) { var viewId; __extends(SpecView, _super); viewId = 0; function SpecView(spec, reporter) { this.spec = spec; this.reporter = reporter; this.views = this.reporter.views; viewId += 1; this.spec.viewId = viewId; this.views.specs[this.spec.viewId] = this; SpecView.__super__.constructor.apply(this, arguments); } SpecView.prototype.build = function() { SpecView.__super__.build.call(this, "spec"); this.el.innerHTML = "" + (this.description()) + ""; this.parentView = this.buildParent(); return this.parentView.append(this.el); }; SpecView.prototype.buildParent = function() { var parent, view; parent = this.parent(); if (parent.viewId) { return this.views.suites[parent.viewId]; } else { view = new Teabag.Reporters.HTML.SuiteView(parent, this.reporter); return this.views.suites[view.suite.viewId] = view; } }; SpecView.prototype.buildErrors = function() { var div, error, html, _i, _len, _ref; div = this.createEl("div"); html = ""; _ref = this.errors(); for (_i = 0, _len = _ref.length; _i < _len; _i++) { error = _ref[_i]; html += "" + (error.stack || error.message || "Stack trace unavailable"); } div.innerHTML = html; return this.append(div); }; SpecView.prototype.updateState = function(state, elapsed) { var classes, _base; classes = ["state-" + state]; if (elapsed > Teabag.slow) { classes.push("slow"); } if (state !== "failed") { this.el.innerHTML += "" + elapsed + "ms"; } this.el.className = classes.join(" "); if (!this.passed()) { this.buildErrors(); } return typeof (_base = this.parentView).updateState === "function" ? _base.updateState(state) : void 0; }; SpecView.prototype.parent = function() { return this.spec.suite; }; SpecView.prototype.link = function() { return "?grep=" + (encodeURIComponent(this.fullName())); }; SpecView.prototype.description = function() { return this.spec.description; }; SpecView.prototype.fullName = function() { return this.spec.getFullName(); }; SpecView.prototype.passed = function() { return this.spec.results().passed(); }; SpecView.prototype.errors = function() { var item, _i, _len, _ref, _results; _ref = this.spec.results().getItems(); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { item = _ref[_i]; _results.push(item.trace); } return _results; }; return SpecView; })(Teabag.View); Teabag.Reporters.HTML.SuiteView = (function(_super) { var viewId; __extends(SuiteView, _super); viewId = 0; function SuiteView(suite, reporter) { this.suite = suite; this.reporter = reporter; this.views = this.reporter.views; viewId += 1; this.suite.viewId = viewId; this.views.suites[this.suite.viewId] = this; SuiteView.__super__.constructor.apply(this, arguments); } SuiteView.prototype.build = function() { SuiteView.__super__.build.call(this, "suite"); this.el.innerHTML = "

" + (this.description()) + "

"; this.parentView = this.buildParent(); return this.parentView.append(this.el); }; SuiteView.prototype.buildParent = function() { var parent, view; parent = this.parent(); if (!parent) { return this.reporter; } if (parent.viewId) { return this.views.suites[parent.viewId]; } else { view = new Teabag.Reporters.HTML.SuiteView(parent, this.reporter); return this.views.suites[view.suite.viewId] = view; } }; SuiteView.prototype.append = function(el) { if (!this.ol) { SuiteView.__super__.append.call(this, this.ol = this.createEl("ol")); } return this.ol.appendChild(el); }; SuiteView.prototype.updateState = function(state) { var _base; if (this.state === "failed") { return; } this.el.className = "" + (this.el.className.replace(/\s?state-\w+/, "")) + " state-" + state; if (typeof (_base = this.parentView).updateState === "function") { _base.updateState(state); } return this.state = state; }; SuiteView.prototype.parent = function() { return this.suite.parentSuite; }; SuiteView.prototype.link = function() { return "?grep=" + (encodeURIComponent(this.fullName())); }; SuiteView.prototype.description = function() { return this.suite.description; }; SuiteView.prototype.fullName = function() { return this.suite.getFullName(); }; return SuiteView; })(Teabag.View); }).call(this); ;TI"dependency_digest;F"%0d4000664cf6c01468f1a0c7baf80861I"required_paths;F[I"Y/Users/jejacks0n/Projects/teabag/app/assets/javascripts/teabag/reporters/base.coffee;FI"dependency_paths;F[{I" path;FI"Y/Users/jejacks0n/Projects/teabag/app/assets/javascripts/teabag/reporters/base.coffee;FI" mtime;FI"2012-12-09T18:26:08-07:00;FI" digest;F"%dd6e44c66c60badda8023301aa95e307I" _version;F"%6776f581a4329e299531e1d52aa59832