Permalink
Browse files

Merge branch 'feature/prepare-dev' into develop

  • Loading branch information...
2 parents 6ed6230 + f23f948 commit 88255cb291fa1a393e780e2d6ef09369f28c2def @demiazz committed Jan 27, 2012
View
@@ -0,0 +1 @@
+.rvmrc
View
106 Cakefile
@@ -0,0 +1,106 @@
+fs = require 'fs'
+util = require 'util'
+exec = require('child_process').exec
+http = require 'http'
+url = require 'url'
+
+#-------------------------------------------------------------------------------
+#--- Helpers
+
+build = (config) ->
+ if config.scriptsOrder.length > 0
+ files = ""
+ for file in config.scriptsOrder
+ files += " #{file}"
+ command = "coffee --join #{config.outputFile} --compile #{files}"
+ if config.compress
+ command += " && uglifyjs --overwrite #{config.outputFile}"
+ exec command, (error, stdout, stderr) ->
+ if error?
+ console.error("#{config.outputFile} don't builted.")
+ console.error(stdout)
+ console.error(stderr)
+ else
+ console.info("#{config.outputFile} builted successful.")
+ return
+ return
+
+runServer = (config) ->
+
+ server = http.createServer((request, response) ->
+
+ # parse url
+ url_path = url.parse(request.url).path
+
+ try
+ # for main page
+ if url_path == "/"
+ response.writeHead 200, "Content-Type": "text/html"
+ return response.end fs.readFileSync(config.index)
+ # for other files
+ else
+ response.writeHead 200
+ return response.end fs.readFileSync(".#{url_path}")
+ # 404 for error, when try find a file
+ catch error
+ response.writeHead 404
+ return response.end ""
+ ).listen(config.port, config.host)
+
+ console.log("Server running on #{config.host}:#{config.port}")
+
+ return
+
+#-------------------------------------------------------------------------------
+#--- Buildr configs
+
+lib =
+ scriptsOrder: [
+ "lib/reporter.coffee"
+ ]
+ outputFile: "./jasmine-wkreporter.js"
+ compress: false
+
+spec =
+ scriptsOrder: [
+ "spec/reporter.spec.coffee"
+ ]
+ outputFile: "./jasmine-wkreporter.spec.js"
+ compress: false
+
+release =
+ scriptsOrder: [
+ "lib/reporter.coffee"
+ ]
+ outputFile: "./jasmine-wkreporter.min.js"
+ compress: true
+
+server =
+ host: "localhost"
+ port: 3000
+ index: "./specRunner.html"
+
+#-------------------------------------------------------------------------------
+#--- Tasks
+
+task 'build:lib', 'Build lib for testing', () ->
+ build lib
+ return
+
+task 'build:spec', 'Build spec for testing', () ->
+ build spec
+ return
+
+task 'build:release', 'Build lib for release', () ->
+ build release
+ return
+
+task 'build:all', 'Build lib and spec for testing, and lib for release', () ->
+ invoke 'build:lib'
+ invoke 'build:spec'
+ invoke 'build:release'
+ return
+
+task 'server', 'Running development server for Jasmine Runner', () ->
+ runServer server
+ return
View
@@ -0,0 +1,5 @@
+source 'http://rubygems.org'
+
+gem "guard"
+gem 'guard-shell'
+gem 'guard-livereload'
View
@@ -0,0 +1,28 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ addressable (2.2.6)
+ em-websocket (0.3.6)
+ addressable (>= 2.1.1)
+ eventmachine (>= 0.12.9)
+ eventmachine (0.12.10)
+ ffi (1.0.11)
+ guard (1.0.0)
+ ffi (>= 0.5.0)
+ thor (~> 0.14.6)
+ guard-livereload (0.4.0)
+ em-websocket (>= 0.2.0)
+ guard (>= 0.10.0)
+ multi_json (~> 1.0.3)
+ guard-shell (0.2.0)
+ guard (>= 0.2.0)
+ multi_json (1.0.4)
+ thor (0.14.6)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ guard
+ guard-livereload
+ guard-shell
View
@@ -0,0 +1,16 @@
+guard 'shell' do
+ # Cakefile
+ watch(/^Cakefile$/) { |m| `cake build:all` }
+ # Library
+ watch(/^lib\/.*/) { |m| `cake build:lib`}
+ # Specs
+ watch(/^spec\/.*/) { |m| `cake build:spec` }
+end
+
+reload_url = 'http://localhost:3000'
+
+guard 'livereload' do
+ watch(/^jasmine-wkreporter.js$/) { |m| reload_url }
+ watch(/^jasmine-wkreporter.spec.js$/) { |m| reload_url }
+ watch(/^vendor\/.*/) { |m| reload_url }
+end
View
@@ -0,0 +1,5 @@
+(function() {
+
+
+
+}).call(this);
View
No changes.
No changes.
View
@@ -0,0 +1,57 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title>Jasmine WebKit Reporter</title>
+
+ <link rel="shortcut icon" type="image/png" href="/vendor/img/favicon.png">
+
+ <!-- Jasmine CSS -->
+ <link rel="stylesheet" type="text/css" href="/vendor/css/jasmine.css">
+ <!-- Jasmine BDD Framework -->
+ <script type="text/javascript" src="/vendor/js/jasmine.js"></script>
+ <script type="text/javascript" src="/vendor/js/jasmine-html.js"></script>
+ <!-- Jasmine Sinon -->
+ <script type="text/javascript" src="/vendor/js/sinon.js"></script>
+ <script type="text/javascript" src="/vendor/js/jasmine-sinon.js"></script>
+
+ <!-- Source -->
+ <script type="text/javascript" src="/jasmine-wkreporter.js"></script>
+
+ <!-- Specs -->
+ <script type="text/javascript" src="/jasmine-wkreporter.spec.js"></script>
+
+ <script type="text/javascript">
+ (function() {
+ var jasmineEnv = jasmine.getEnv();
+ jasmineEnv.updateInterval = 1000;
+
+ var trivialReporter = new jasmine.TrivialReporter();
+
+ jasmineEnv.addReporter(trivialReporter);
+
+ jasmineEnv.specFilter = function(spec) {
+ return trivialReporter.specFilter(spec);
+ };
+
+ var currentWindowOnload = window.onload;
+
+ document.onready = function() {
+ if (currentWindowOnload) {
+ currentWindowOnload();
+ }
+ execJasmine();
+ };
+
+ function execJasmine() {
+ jasmineEnv.execute();
+ }
+
+ })();
+ </script>
+
+</head>
+
+<body>
+</body>
+</html>
View
@@ -0,0 +1,166 @@
+body {
+ font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
+}
+
+
+.jasmine_reporter a:visited, .jasmine_reporter a {
+ color: #303;
+}
+
+.jasmine_reporter a:hover, .jasmine_reporter a:active {
+ color: blue;
+}
+
+.run_spec {
+ float:right;
+ padding-right: 5px;
+ font-size: .8em;
+ text-decoration: none;
+}
+
+.jasmine_reporter {
+ margin: 0 5px;
+}
+
+.banner {
+ color: #303;
+ background-color: #fef;
+ padding: 5px;
+}
+
+.logo {
+ float: left;
+ font-size: 1.1em;
+ padding-left: 5px;
+}
+
+.logo .version {
+ font-size: .6em;
+ padding-left: 1em;
+}
+
+.runner.running {
+ background-color: yellow;
+}
+
+
+.options {
+ text-align: right;
+ font-size: .8em;
+}
+
+
+
+
+.suite {
+ border: 1px outset gray;
+ margin: 5px 0;
+ padding-left: 1em;
+}
+
+.suite .suite {
+ margin: 5px;
+}
+
+.suite.passed {
+ background-color: #dfd;
+}
+
+.suite.failed {
+ background-color: #fdd;
+}
+
+.spec {
+ margin: 5px;
+ padding-left: 1em;
+ clear: both;
+}
+
+.spec.failed, .spec.passed, .spec.skipped {
+ padding-bottom: 5px;
+ border: 1px solid gray;
+}
+
+.spec.failed {
+ background-color: #fbb;
+ border-color: red;
+}
+
+.spec.passed {
+ background-color: #bfb;
+ border-color: green;
+}
+
+.spec.skipped {
+ background-color: #bbb;
+}
+
+.messages {
+ border-left: 1px dashed gray;
+ padding-left: 1em;
+ padding-right: 1em;
+}
+
+.passed {
+ background-color: #cfc;
+ display: none;
+}
+
+.failed {
+ background-color: #fbb;
+}
+
+.skipped {
+ color: #777;
+ background-color: #eee;
+ display: none;
+}
+
+
+/*.resultMessage {*/
+ /*white-space: pre;*/
+/*}*/
+
+.resultMessage span.result {
+ display: block;
+ line-height: 2em;
+ color: black;
+}
+
+.resultMessage .mismatch {
+ color: black;
+}
+
+.stackTrace {
+ white-space: pre;
+ font-size: .8em;
+ margin-left: 10px;
+ max-height: 5em;
+ overflow: auto;
+ border: 1px inset red;
+ padding: 1em;
+ background: #eef;
+}
+
+.finished-at {
+ padding-left: 1em;
+ font-size: .6em;
+}
+
+.show-passed .passed,
+.show-skipped .skipped {
+ display: block;
+}
+
+
+#jasmine_content {
+ position:fixed;
+ right: 100%;
+}
+
+.runner {
+ border: 1px solid gray;
+ display: block;
+ margin: 5px 0;
+ padding: 2px 0 2px 10px;
+}
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit 88255cb

Please sign in to comment.