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 = "