o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1355473100.266187: @value"f{I" class:EFI"BundledAsset;FI"logical_path;FI"teabag/base/teabag.js;FI" pathname;FI"V/Users/jejacks0n/Projects/teabag/app/assets/javascripts/teabag/base/teabag.coffee;FI"content_type;FI"application/javascript;FI" mtime;FI"2012-12-14T00:32:53-07:00;FI" length;Fi+dI" digest;F"%a63100157b7b8fddd230ea8d0720691cI" source;FI"+d(function() { this.Teabag = (function() { function Teabag() {} Teabag.defer = false; Teabag.slow = 75; Teabag.fixturePath = null; Teabag.finished = false; Teabag.Reporters = {}; Teabag.Date = Date; Teabag.location = window.location; Teabag.execute = function() { if (this.defer) { this.defer = false; return; } return new Teabag.Runner(); }; return Teabag; })(); }).call(this); (function() { Teabag.Runner = (function() { Runner.run = false; function Runner() { if (this.constructor.run) { return; } this.constructor.run = true; this.fixturePath = Teabag.fixturePath; this.params = this.getParams(); this.setup(); } Runner.prototype.getParams = function() { var name, param, params, value, _i, _len, _ref, _ref1; params = {}; _ref = Teabag.location.search.substring(1).split("&"); for (_i = 0, _len = _ref.length; _i < _len; _i++) { param = _ref[_i]; _ref1 = param.split("="), name = _ref1[0], value = _ref1[1]; params[decodeURIComponent(name)] = decodeURIComponent(value); } return params; }; Runner.prototype.setup = function() {}; return Runner; })(); }).call(this); (function() { Teabag.Reporters.NormalizedSpec = (function() { function NormalizedSpec(spec) { var _base, _base1; this.spec = spec; this.fullDescription = (typeof (_base = this.spec).getFullName === "function" ? _base.getFullName() : void 0) || this.spec.fullTitle(); this.description || (this.description = this.spec.description || this.spec.title); this.link = "?grep=" + (encodeURIComponent(this.fullDescription)); this.parent = this.spec.suite || this.spec.parent; this.suiteName = (typeof (_base1 = this.parent).getFullName === "function" ? _base1.getFullName() : void 0) || this.parent.fullTitle(); this.viewId = this.spec.viewId; this.pending = this.spec.pending; } NormalizedSpec.prototype.errors = function() { var item, _i, _len, _ref, _results; if (this.spec.err) { return [this.spec.err]; } if (!this.spec.results) { return []; } _ref = this.spec.results().getItems(); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { item = _ref[_i]; if (item.passed()) { continue; } _results.push({ message: item.message, stack: item.trace.stack }); } return _results; }; NormalizedSpec.prototype.result = function() { var results, skipped, status; status = "failed"; if (this.spec.results) { results = this.spec.results(); if (results.passed()) { status = "passed"; } skipped = results.skipped; } else { if (this.spec.state === "passed" || this.spec.state === "skipped") { status = "passed"; } skipped = this.spec.state === "skipped"; } if (this.spec.pending) { status = "pending"; } return { status: status, skipped: skipped }; }; return NormalizedSpec; })(); Teabag.Reporters.NormalizedSuite = (function() { function NormalizedSuite(suite) { var _base; this.suite = suite; this.fullDescription = (typeof (_base = this.suite).getFullName === "function" ? _base.getFullName() : void 0) || this.suite.fullTitle(); this.description = this.suite.description || this.suite.title; this.link = "?grep=" + (encodeURIComponent(this.fullDescription)); this.parent = this.getParent(); this.viewId = this.suite.viewId; } NormalizedSuite.prototype.getParent = function() { if (this.suite.parent) { if (this.suite.parent.root) { return null; } else { return this.suite.parent; } } else { return this.suite.parentSuite; } }; return NormalizedSuite; })(); Teabag.Reporters.BaseView = (function() { function BaseView() { this.elements = {}; this.build(); } BaseView.prototype.build = function(className) { return this.el = this.createEl("li", className); }; BaseView.prototype.appendTo = function(el) { return el.appendChild(this.el); }; BaseView.prototype.append = function(el) { return this.el.appendChild(el); }; BaseView.prototype.createEl = function(type, className) { var el; if (className == null) { className = ""; } el = document.createElement(type); el.className = className; return el; }; BaseView.prototype.findEl = function(id) { var _base; this.elements || (this.elements = {}); return (_base = this.elements)[id] || (_base[id] = document.getElementById("teabag-" + id)); }; BaseView.prototype.setText = function(id, value) { var el; el = this.findEl(id); return el.innerText = value; }; BaseView.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; } }; BaseView.prototype.setClass = function(id, value) { var el; el = this.findEl(id); return el.className = value; }; BaseView.prototype.htmlSafe = function(str) { var el; el = document.createElement("div"); el.appendChild(document.createTextNode(str)); return el.innerHTML; }; return BaseView; })(); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; Teabag.Reporters.Console = (function() { function Console() { this.reportRunnerResults = __bind(this.reportRunnerResults, this); this.start = new Teabag.Date().getTime(); } Console.prototype.reportSpecResults = function(spec) { var result; this.spec = new Teabag.Reporters.NormalizedSpec(spec); result = this.spec.result(); switch (result.status) { case "pending": return this.trackPending(); case "failed": return this.trackFailure(); default: return this.log({ type: "spec", suite: this.spec.suiteName, spec: this.spec.description, status: result.status, skipped: result.skipped, full_description: this.spec.fullDescription }); } }; Console.prototype.trackPending = function() { var result; result = this.spec.result(); return this.log({ type: "spec", suite: this.spec.suiteName, spec: this.spec.description, status: result.status, skipped: result.skipped, full_description: this.spec.fullDescription }); }; Console.prototype.trackFailure = function() { var error, result, _i, _len, _ref, _results; result = this.spec.result(); _ref = this.spec.errors(); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { error = _ref[_i]; _results.push(this.log({ type: "spec", suite: this.spec.suiteName, spec: this.spec.description, status: result.status, skipped: result.skipped, full_description: this.spec.fullDescription, link: this.spec.link, message: error.message, trace: error.stack || error.message || "Stack Trace Unavailable" })); } return _results; }; Console.prototype.reportRunnerResults = function() { this.log({ type: "results", elapsed: ((new Teabag.Date().getTime() - this.start) / 1000).toFixed(5) }); return Teabag.finished = true; }; Console.prototype.log = function(obj) { if (obj == null) { obj = {}; } obj["_teabag"] = true; return console.log(JSON.stringify(obj)); }; return Console; })(); }).call(this); (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.Reporters.HTML = (function(_super) { __extends(HTML, _super); function HTML() { this.toggleConfig = __bind(this.toggleConfig, this); this.reportRunnerResults = __bind(this.reportRunnerResults, this); this.start = new Teabag.Date().getTime(); this.config = { "use-catch": true, "build-full-report": false, "display-progress": true }; this.total = { exist: 0, run: 0, passes: 0, failures: 0, skipped: 0 }; this.views = { specs: {}, suites: {} }; this.filter = false; this.readConfig(); HTML.__super__.constructor.apply(this, arguments); } HTML.prototype.build = function() { this.buildLayout(); this.el = this.findEl("report-all"); this.setText("env-info", this.envInfo()); this.setText("version", Teabag.version); this.findEl("toggles").onclick = this.toggleConfig; this.showConfiguration(); return this.buildProgress(); }; HTML.prototype.buildLayout = function() { var el; el = this.createEl("div"); document.body.appendChild(el); return el.innerHTML = "
\n
\n

Teabag

\n \n
\n
\n \n
\n\n
\n
\n \n \n \n
\n
\n \n
\n
\n\n
\n\n
\n
    \n
      \n
      "; }; HTML.prototype.buildProgress = function() { this.progress = Teabag.Reporters.HTML.ProgressView.create(this.config["display-progress"]); return this.progress.appendTo(this.findEl("progress")); }; 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) { spec = new Teabag.Reporters.NormalizedSpec(spec); if (this.config["build-full-report"]) { this.reportView = new Teabag.Reporters.HTML.SpecView(spec, this); } return this.specStart = new Teabag.Date().getTime(); }; HTML.prototype.reportSpecResults = function(spec) { this.total.run += 1; this.updateProgress(); return this.updateStatus(spec); }; HTML.prototype.reportRunnerResults = function() { if (!this.total.run) { return; } this.setText("stats-duration", this.elapsedTime()); if (!this.total.failures) { this.setStatus("passed"); } this.setText("stats-passes", this.total.passes); this.setText("stats-failures", this.total.failures); 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.updateProgress(); }; HTML.prototype.elapsedTime = function() { return "" + (((new Teabag.Date().getTime() - this.start) / 1000).toFixed(3)) + "s"; }; HTML.prototype.updateStat = function(name, value) { if (!this.config["display-progress"]) { return; } return this.setText("stats-" + name, value); }; HTML.prototype.updateStatus = function(spec) { var elapsed, result, _ref, _ref1; spec = new Teabag.Reporters.NormalizedSpec(spec); result = spec.result(); if (result.skipped || result.status === "pending") { this.updateStat("skipped", this.total.skipped += 1); return; } elapsed = new Teabag.Date().getTime() - this.specStart; if (result.status === "passed") { this.updateStat("passes", this.total.passes += 1); return (_ref = this.reportView) != null ? _ref.updateState("passed", elapsed) : void 0; } else { this.updateStat("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.updateProgress = function() { return this.progress.update(this.total.exist, this.total.run); }; 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.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 = 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", this.config); return this.refresh(); }; HTML.prototype.refresh = function() { return window.location.href = window.location.href; }; 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 && JSON.parse(unescape(match[1]).split(" ")[0]); } else { date = new Teabag.Date(); date.setDate(date.getDate() + 365); return document.cookie = "" + name + "=" + (escape(JSON.stringify(value))) + "; path=/; expires=" + (date.toUTCString()) + ";"; } }; return HTML; })(Teabag.Reporters.BaseView); }).call(this); (function() { var __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.Reporters.HTML.ProgressView = (function(_super) { __extends(ProgressView, _super); function ProgressView() { return ProgressView.__super__.constructor.apply(this, arguments); } ProgressView.create = function(displayProgress) { if (displayProgress == null) { displayProgress = true; } if (!displayProgress) { return new Teabag.Reporters.HTML.ProgressView(); } if (Teabag.Reporters.HTML.RadialProgressView.supported) { return new Teabag.Reporters.HTML.RadialProgressView(); } else { return Teabag.Reporters.HTML.SimpleProgressView(); } }; ProgressView.prototype.build = function() { return this.el = this.createEl("div", "teabag-indicator modeset-logo"); }; ProgressView.prototype.update = function() {}; return ProgressView; })(Teabag.Reporters.BaseView); Teabag.Reporters.HTML.SimpleProgressView = (function(_super) { __extends(SimpleProgressView, _super); function SimpleProgressView() { return SimpleProgressView.__super__.constructor.apply(this, arguments); } SimpleProgressView.prototype.build = function() { this.el = this.createEl("div", "simple-progress"); return this.el.innerHTML = "0%\n"; }; SimpleProgressView.prototype.update = function(total, run) { var percent; percent = total ? Math.ceil((run * 100) / total) : 0; return this.setHtml("progress-percent", "" + percent + "%"); }; return SimpleProgressView; })(Teabag.Reporters.HTML.ProgressView); Teabag.Reporters.HTML.RadialProgressView = (function(_super) { __extends(RadialProgressView, _super); function RadialProgressView() { return RadialProgressView.__super__.constructor.apply(this, arguments); } RadialProgressView.supported = !!document.createElement("canvas").getContext; RadialProgressView.prototype.build = function() { this.el = this.createEl("div", "teabag-indicator radial-progress"); return this.el.innerHTML = "\n0%"; }; RadialProgressView.prototype.appendTo = function() { var canvas; RadialProgressView.__super__.appendTo.apply(this, arguments); this.size = 80; try { canvas = this.findEl("progress-canvas"); canvas.width = canvas.height = canvas.style.width = canvas.style.height = this.size; this.ctx = canvas.getContext("2d"); this.ctx.strokeStyle = "#fff"; return this.ctx.lineWidth = 1.5; } catch (e) { } }; RadialProgressView.prototype.update = function(total, run) { var half, percent; percent = total ? Math.ceil((run * 100) / total) : 0; this.setHtml("progress-percent", "" + percent + "%"); if (!this.ctx) { return; } half = this.size / 2; this.ctx.clearRect(0, 0, this.size, this.size); this.ctx.beginPath(); this.ctx.arc(half, half, half - 1, 0, Math.PI * 2 * (percent / 100), false); return this.ctx.stroke(); }; return RadialProgressView; })(Teabag.Reporters.HTML.ProgressView); }).call(this); (function() { var __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.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; this.spec.viewId = viewId += 1; this.views.specs[this.spec.viewId] = this; SpecView.__super__.constructor.apply(this, arguments); } SpecView.prototype.build = function() { var classes; classes = ["spec"]; if (this.spec.pending) { classes.push("state-pending"); } SpecView.__super__.build.call(this, classes.join(" ")); this.el.innerHTML = "" + this.spec.description + ""; this.parentView = this.buildParent(); return this.parentView.append(this.el); }; SpecView.prototype.buildParent = function() { var parent, view; parent = this.spec.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.spec.errors(); for (_i = 0, _len = _ref.length; _i < _len; _i++) { error = _ref[_i]; html += "" + (this.htmlSafe(error.stack || error.message || "Stack trace unavailable")); } div.innerHTML = html; return this.append(div); }; SpecView.prototype.updateState = function(state, elapsed) { var classes, result, _base; result = this.spec.result(); classes = ["state-" + state]; if (elapsed > Teabag.slow) { classes.push("slow"); } if (state !== "failed") { this.el.innerHTML += "" + elapsed + "ms"; } this.el.className = classes.join(" "); if (result.status !== "passed") { this.buildErrors(); } return typeof (_base = this.parentView).updateState === "function" ? _base.updateState(state) : void 0; }; return SpecView; })(Teabag.Reporters.BaseView); }).call(this); (function() { var __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.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 error, html, _i, _len, _ref; FailureView.__super__.build.call(this, "spec"); html = "

      " + this.spec.fullDescription + "

      "; _ref = this.spec.errors(); for (_i = 0, _len = _ref.length; _i < _len; _i++) { error = _ref[_i]; html += "
      " + (this.htmlSafe(error.stack || error.message || "Stack trace unavailable")) + "
      "; } return this.el.innerHTML = html; }; return FailureView; })(Teabag.Reporters.BaseView); }).call(this); (function() { var __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.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; this.suite.viewId = viewId += 1; this.views.suites[this.suite.viewId] = this; this.suite = new Teabag.Reporters.NormalizedSuite(suite); SuiteView.__super__.constructor.apply(this, arguments); } SuiteView.prototype.build = function() { SuiteView.__super__.build.call(this, "suite"); this.el.innerHTML = "

      " + this.suite.description + "

      "; this.parentView = this.buildParent(); return this.parentView.append(this.el); }; SuiteView.prototype.buildParent = function() { var parent, view; parent = this.suite.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; }; return SuiteView; })(Teabag.Reporters.BaseView); }).call(this); ;FI"required_assets_digest;F"%6072d19cf4d91f37330da10fe44232a8I" _version;F"%6776f581a4329e299531e1d52aa59832