diff --git a/bin/specljs_runner.js b/bin/specljs_runner.js new file mode 100644 index 0000000..c2b7bd0 --- /dev/null +++ b/bin/specljs_runner.js @@ -0,0 +1,20 @@ +#! /usr/bin/env phantomjs + +var fs = require("fs"); +var p = require('webpage').create(); +var sys = require('system'); + +p.onConsoleMessage = function (x) { + fs.write("/dev/stdout", x, "w"); +}; + +p.injectJs(phantom.args[0]); + +var result = p.evaluate(function () { + specljs.run.standard.armed = true; + return specljs.run.standard.run_specs( + cljs.core.keyword("color"), true + ); +}); + +phantom.exit(result); diff --git a/project.clj b/project.clj index 4ed771d..6e9a0e2 100644 --- a/project.clj +++ b/project.clj @@ -3,8 +3,6 @@ :url "http://example.com/FIXME" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} - :source-paths ["src/clj"] - :test-paths ["test/clj"] :dependencies [[org.clojure/clojure "1.5.1"] [http-kit "2.1.8"] [compojure "1.1.5"] @@ -14,18 +12,25 @@ [prismatic/dommy "0.1.1"] [core.async "0.1.0-SNAPSHOT"] [com.novemberain/monger "1.5.0"]] - :profiles {:dev {:dependencies [[midje "1.5.1"]]}} + :profiles {:dev {:dependencies [[speclj "2.5.0"] + [specljs "2.7.4"]]}} :plugins [[lein-cljsbuild "0.3.2"] - [lein-ring "0.8.6"]] - :cljsbuild { - :builds [{ - ; The path to the top-level ClojureScript source directory: - :source-paths ["src/cljs"] - ; The standard ClojureScript compiler options: - ; (See the ClojureScript compiler documentation for details.) - :compiler { - :output-to "public/js/main.js" ; default: target/cljsbuild-main.js - :optimizations :whitespace - :pretty-print true}}]} + [lein-ring "0.8.6"] + [speclj "2.5.0"] + [specljs "2.7.4"]] + :cljsbuild ~(let [run-specs ["phantomjs" + "bin/specljs_runner.js" + "public/js/grub_dev.js"]] + {:builds {:dev {:source-paths ["src/cljs" "spec/cljs"] + :compiler {:output-to "public/js/grub_dev.js" + :optimizations :whitespace + :pretty-print true} + :notify-command run-specs} + :prod {:source-paths ["src/cljs"] + :compiler {:output-to "public/js/grub.js" + :optimizations :simple}} + :test-commands {"test" run-specs}}}) + :source-paths ["src/clj"] + :test-paths ["spec/clj"] :ring {:handler grub.core/app} :main grub.core) diff --git a/public/js/grub.js b/public/js/grub.js new file mode 100644 index 0000000..3225e5b --- /dev/null +++ b/public/js/grub.js @@ -0,0 +1,16522 @@ +var COMPILED = !0, goog = goog || {}; +goog.global = this; +goog.DEBUG = !0; +goog.LOCALE = "en"; +goog.provide = function(a) { + if(!COMPILED) { + if(goog.isProvided_(a)) { + throw Error('Namespace "' + a + '" already declared.'); + } + delete goog.implicitNamespaces_[a]; + for(var b = a;(b = b.substring(0, b.lastIndexOf("."))) && !goog.getObjectByName(b);) { + goog.implicitNamespaces_[b] = !0 + } + } + goog.exportPath_(a) +}; +goog.setTestOnly = function(a) { + if(COMPILED && !goog.DEBUG) { + throw a = a || "", Error("Importing test-only code into non-debug environment" + a ? ": " + a : "."); + } +}; +COMPILED || (goog.isProvided_ = function(a) { + return!goog.implicitNamespaces_[a] && !!goog.getObjectByName(a) +}, goog.implicitNamespaces_ = {}); +goog.exportPath_ = function(a, b, c) { + a = a.split("."); + c = c || goog.global; + !(a[0] in c) && c.execScript && c.execScript("var " + a[0]); + for(var d;a.length && (d = a.shift());) { + !a.length && goog.isDef(b) ? c[d] = b : c = c[d] ? c[d] : c[d] = {} + } +}; +goog.getObjectByName = function(a, b) { + for(var c = a.split("."), d = b || goog.global, e;e = c.shift();) { + if(goog.isDefAndNotNull(d[e])) { + d = d[e] + }else { + return null + } + } + return d +}; +goog.globalize = function(a, b) { + var c = b || goog.global, d; + for(d in a) { + c[d] = a[d] + } +}; +goog.addDependency = function(a, b, c) { + if(!COMPILED) { + for(var d, a = a.replace(/\\/g, "/"), e = goog.dependencies_, f = 0;d = b[f];f++) { + e.nameToPath[d] = a, a in e.pathToNames || (e.pathToNames[a] = {}), e.pathToNames[a][d] = !0 + } + for(d = 0;b = c[d];d++) { + a in e.requires || (e.requires[a] = {}), e.requires[a][b] = !0 + } + } +}; +goog.ENABLE_DEBUG_LOADER = !0; +goog.require = function(a) { + if(!COMPILED && !goog.isProvided_(a)) { + if(goog.ENABLE_DEBUG_LOADER) { + var b = goog.getPathFromDeps_(a); + if(b) { + goog.included_[b] = !0; + goog.writeScripts_(); + return + } + } + a = "goog.require could not find: " + a; + goog.global.console && goog.global.console.error(a); + throw Error(a); + } +}; +goog.basePath = ""; +goog.nullFunction = function() { +}; +goog.identityFunction = function(a) { + return a +}; +goog.abstractMethod = function() { + throw Error("unimplemented abstract method"); +}; +goog.addSingletonGetter = function(a) { + a.getInstance = function() { + if(a.instance_) { + return a.instance_ + } + goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = a); + return a.instance_ = new a + } +}; +goog.instantiatedSingletons_ = []; +!COMPILED && goog.ENABLE_DEBUG_LOADER && (goog.included_ = {}, goog.dependencies_ = {pathToNames:{}, nameToPath:{}, requires:{}, visited:{}, written:{}}, goog.inHtmlDocument_ = function() { + var a = goog.global.document; + return"undefined" != typeof a && "write" in a +}, goog.findBasePath_ = function() { + if(goog.global.CLOSURE_BASE_PATH) { + goog.basePath = goog.global.CLOSURE_BASE_PATH + }else { + if(goog.inHtmlDocument_()) { + for(var a = goog.global.document.getElementsByTagName("script"), b = a.length - 1;0 <= b;--b) { + var c = a[b].src, d = c.lastIndexOf("?"), d = -1 == d ? c.length : d; + if("base.js" == c.substr(d - 7, 7)) { + goog.basePath = c.substr(0, d - 7); + break + } + } + } + } +}, goog.importScript_ = function(a) { + var b = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_; + !goog.dependencies_.written[a] && b(a) && (goog.dependencies_.written[a] = !0) +}, goog.writeScriptTag_ = function(a) { + return goog.inHtmlDocument_() ? (goog.global.document.write('