o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1356390636.468655: @value"\`{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-24T16:10:29-07:00;FI" length;Fi€^I" digest;F"%413467997062f8e9050afed6419aa952I" source;FI"€^(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.console = window.console; Teabag.messages = []; Teabag.execute = function() { if (this.defer) { this.defer = false; return; } return new Teabag.Runner(); }; Teabag.log = function() { var _ref; this.messages.push(arguments[0]); return (_ref = this.console).log.apply(_ref, arguments); }; Teabag.getMessages = function() { var messages; messages = this.messages; this.messages = []; return messages; }; 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.getReporter = function() { if (this.params["reporter"]) { return Teabag.Reporters[this.params["reporter"]]; } else { if (window.navigator.userAgent.match(/PhantomJS/)) { return Teabag.Reporters.Console; } else { return Teabag.Reporters.HTML; } } }; Runner.prototype.setup = function() {}; return Runner; })(); }).call(this); (function() { 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.innerHTML = 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); }; }, __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.Spec(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.Spec(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.Suite(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); (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(); this.suites = {}; } Console.prototype.reportRunnerStarting = function(runner) { return this.log({ type: "runner", total: runner.total || runner.specs().length, start: JSON.parse(JSON.stringify(this.start)) }); }; Console.prototype.reportSuites = function() { var index, suite, _i, _len, _ref, _results; _ref = this.spec.getParents(); _results = []; for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) { suite = _ref[index]; if (this.suites[suite.fullDescription]) { continue; } this.suites[suite.fullDescription] = true; _results.push(this.log({ type: "suite", label: suite.description, level: index })); } return _results; }; Console.prototype.reportSpecResults = function(spec) { var result; this.spec = new Teabag.Spec(spec); result = this.spec.result(); this.reportSuites(); switch (result.status) { case "pending": return this.trackPending(); case "failed": return this.trackFailure(); default: return this.log({ type: "spec", suite: this.spec.suiteName, label: this.spec.description, status: result.status, skipped: result.skipped }); } }; Console.prototype.trackPending = function() { var result; result = this.spec.result(); return this.log({ type: "spec", suite: this.spec.suiteName, label: this.spec.description, status: result.status, skipped: result.skipped }); }; 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, label: this.spec.description, status: result.status, skipped: result.skipped, link: this.spec.link, message: error.message, trace: error.stack || error.message || "Stack Trace Unavailable" })); } return _results; }; Console.prototype.reportRunnerResults = function() { this.log({ type: "result", elapsed: ((new Teabag.Date().getTime() - this.start.getTime()) / 1000).toFixed(5) }); return Teabag.finished = true; }; Console.prototype.log = function(obj) { if (obj == null) { obj = {}; } obj["_teabag"] = true; return Teabag.log(JSON.stringify(obj)); }; return Console; })(); }).call(this); ;FI"required_assets_digest;F"%27dd24d90dd8a5ee769dd8c64df77b98I" _version;F"%6776f581a4329e299531e1d52aa59832