o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1355470693.976021: @value"d {I" class:EFI"ProcessedAsset;FI"logical_path;FI"phantomjs/runner.js;FI" pathname;FI"H/Users/jejacks0n/Projects/teabag/lib/teabag/phantomjs/runner.coffee;FI"content_type;FI"application/javascript;FI" mtime;FI"2012-12-14T00:11:21-07:00;FI" length;Fio I" digest;F"%b168e3abb25b028eb298f12d3755a186I" source;FI"o (function() { var system, webpage, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; system = require("system"); webpage = require("webpage"); this.Runner = (function() { function Runner() { this.waitForResults = __bind(this.waitForResults, this); this.url = system.args[1]; this.timeout = parseInt(system.args[2] || 180) * 1000; } Runner.prototype.run = function() { this.initPage(); return this.loadPage(); }; Runner.prototype.initPage = function() { return this.page = webpage.create(); }; Runner.prototype.loadPage = function() { var method, name, _ref, _results; this.page.open(this.url); _ref = this.pageCallbacks(); _results = []; for (name in _ref) { method = _ref[name]; _results.push(this.page[name] = method); } return _results; }; Runner.prototype.waitForResults = function() { var finished; if ((Date.now() - this.start) >= this.timeout) { this.fail("Timed out"); } finished = this.page.evaluate(function() { return window.Teabag && window.Teabag.finished; }); if (finished) { return this.finish(); } else { return setTimeout(this.waitForResults, 200); } }; Runner.prototype.fail = function(msg, errno) { if (msg == null) { msg = null; } if (errno == null) { errno = 1; } if (msg) { console.log("Error: " + msg); } console.log(JSON.stringify({ _teabag: true, type: "exception" })); return phantom.exit(errno); }; Runner.prototype.finish = function() { console.log(" "); return phantom.exit(0); }; Runner.prototype.pageCallbacks = function() { var _this = this; return { onError: function(msg, trace) { return console.log(JSON.stringify({ _teabag: true, type: "error", msg: msg, trace: trace })); }, onConsoleMessage: function(msg) { return console.log(msg); }, onLoadFinished: function(status) { var defined; _this.start = Date.now(); defined = _this.page.evaluate(function() { return window.Teabag; }); if (!(status === "success" && defined)) { _this.fail("Failed to load: " + _this.url); return; } return _this.waitForResults(); } }; }; return Runner; })(); new Runner().run(); }).call(this); ;TI"dependency_digest;F"%26d22f1a62aa951f14cfdd2325f9376bI"required_paths;F[I"H/Users/jejacks0n/Projects/teabag/lib/teabag/phantomjs/runner.coffee;FI"dependency_paths;F[{I" path;FI"H/Users/jejacks0n/Projects/teabag/lib/teabag/phantomjs/runner.coffee;FI" mtime;FI"2012-12-14T00:11:21-07:00;FI" digest;F"%325dc7ee2d6f15f4dfbb56743294a2f9I" _version;F"%6776f581a4329e299531e1d52aa59832