Commits

Kenneth Jørgensen committed 140e54b

Initial commit

Comments (0)

Files changed (9)

+syntax: regexp
+
+node_modules/
+\.idea/(?!codeStyleSettings\.xml)
+build/
+^npm-debug\.log$

.idea/codeStyleSettings.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectCodeStyleSettingsManager">
+    <option name="PER_PROJECT_SETTINGS">
+      <value>
+        <option name="OTHER_INDENT_OPTIONS">
+          <value>
+            <option name="INDENT_SIZE" value="4" />
+            <option name="CONTINUATION_INDENT_SIZE" value="4" />
+            <option name="TAB_SIZE" value="4" />
+            <option name="USE_TAB_CHARACTER" value="true" />
+            <option name="SMART_TABS" value="false" />
+            <option name="LABEL_INDENT_SIZE" value="0" />
+            <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+            <option name="USE_RELATIVE_INDENTS" value="false" />
+          </value>
+        </option>
+        <XML>
+          <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
+        </XML>
+        <codeStyleSettings language="CSS">
+          <indentOptions>
+            <option name="CONTINUATION_INDENT_SIZE" value="4" />
+            <option name="USE_TAB_CHARACTER" value="true" />
+          </indentOptions>
+        </codeStyleSettings>
+        <codeStyleSettings language="CoffeeScript">
+          <indentOptions>
+            <option name="INDENT_SIZE" value="4" />
+            <option name="CONTINUATION_INDENT_SIZE" value="4" />
+            <option name="TAB_SIZE" value="4" />
+            <option name="USE_TAB_CHARACTER" value="true" />
+          </indentOptions>
+        </codeStyleSettings>
+        <codeStyleSettings language="Gherkin">
+          <indentOptions>
+            <option name="CONTINUATION_INDENT_SIZE" value="4" />
+            <option name="USE_TAB_CHARACTER" value="true" />
+          </indentOptions>
+        </codeStyleSettings>
+        <codeStyleSettings language="HTML">
+          <indentOptions>
+            <option name="CONTINUATION_INDENT_SIZE" value="4" />
+            <option name="USE_TAB_CHARACTER" value="true" />
+          </indentOptions>
+        </codeStyleSettings>
+        <codeStyleSettings language="Jade">
+          <indentOptions>
+            <option name="USE_TAB_CHARACTER" value="true" />
+          </indentOptions>
+        </codeStyleSettings>
+        <codeStyleSettings language="JavaScript">
+          <indentOptions>
+            <option name="USE_TAB_CHARACTER" value="true" />
+          </indentOptions>
+        </codeStyleSettings>
+        <codeStyleSettings language="LESS">
+          <indentOptions>
+            <option name="INDENT_SIZE" value="4" />
+            <option name="CONTINUATION_INDENT_SIZE" value="4" />
+            <option name="USE_TAB_CHARACTER" value="true" />
+          </indentOptions>
+        </codeStyleSettings>
+        <codeStyleSettings language="PHP">
+          <indentOptions>
+            <option name="USE_TAB_CHARACTER" value="true" />
+          </indentOptions>
+        </codeStyleSettings>
+        <codeStyleSettings language="SASS">
+          <indentOptions>
+            <option name="INDENT_SIZE" value="4" />
+            <option name="CONTINUATION_INDENT_SIZE" value="4" />
+            <option name="USE_TAB_CHARACTER" value="true" />
+          </indentOptions>
+        </codeStyleSettings>
+        <codeStyleSettings language="SQL">
+          <indentOptions>
+            <option name="INDENT_SIZE" value="4" />
+            <option name="CONTINUATION_INDENT_SIZE" value="4" />
+            <option name="USE_TAB_CHARACTER" value="true" />
+          </indentOptions>
+        </codeStyleSettings>
+        <codeStyleSettings language="yaml">
+          <indentOptions>
+            <option name="INDENT_SIZE" value="4" />
+          </indentOptions>
+        </codeStyleSettings>
+      </value>
+    </option>
+    <option name="USE_PER_PROJECT_SETTINGS" value="true" />
+  </component>
+</project>
+
+build
+node_modules
+.idea
+.npmignore
+.hgignore
+# Changelog
+
+## 0.0.1 (dev)
+* Initial version.
+module.exports = (grunt) ->
+	grunt.initConfig
+		pkg: "<json:package.json>"
+
+		coffee:
+			task:
+				files:
+					"tasks/jessie.js": "src/jessie.coffee"
+
+	grunt.loadNpmTasks "grunt-contrib-coffee"
+
+	grunt.registerTask "jessie", "Runs Jasmine specs through Jessie.", ->
+		done = @async()
+		command = "./node_modules/jessie/bin/jessie build/spec"
+		exec command, (err, stdout, stderr) ->
+			console.log stdout
+			if err
+				grunt.warn err
+				done false
+			else
+				done true
+
+	grunt.registerTask "default", ["coffee"]
+Copyright (c) 2013 Kenneth Jorgensen
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+{
+	"fullname": "Jessie Grunt task",
+	"name": "grunt-jessie",
+	"version": "0.0.1-dev",
+	"description": "Grunt task for running Jasmine tests via Jessie.",
+	"keywords": ["jasmine", "jessie", "grunt", "gruntplugin"],
+	"homepage": "https://bitbucket.org/kennethjor/grunt-jessie",
+	"bugs": "https://bitbucket.org/kennethjor/grunt-jessie/issues",
+	"author": "Kenneth Jorgensen <kennethjor@gmail.com> (http://kennethjorgensen.com/)",
+	"repository": {
+		"type": "hg",
+		"url": "ssh://hg@bitbucket.org/kennethjor/grunt-jessie"
+	},
+	"dependencies": {
+		"jessie":                   ">= 0.4.2"
+	},
+	"devDependencies": {
+		"grunt":                    ">= 0.4.1",
+		"grunt-contrib-coffee":     ">= 0.7.0"
+	},
+	"peerDependencies": {
+		"grunt": ">= 0.4.0"
+	},
+	"engines": {
+		"node": ">= 0.8.0"
+	},
+	"scripts": {
+		"prepublish": "grunt"
+	},
+	"main": "Gruntfile.js",
+	"licenses": [
+		{
+			"type": "MIT",
+			"url": "https://bitbucket.org/kennethjor/grunt-jessie/raw/default/LICENSE"
+		}
+	]
+}

src/jessie.coffee

+exec = require("child_process").exec
+spawn = require("child_process").spawn
+
+JESSIE_BIN = "#{__dirname}/../node_modules/jessie/bin/jessie"
+
+# Jessie task.
+module.exports = (grunt) ->
+	# Task defition.
+	grunt.registerMultiTask "jessie", "Runs Jasmine specs with Jessie", ->
+		done = @async()
+
+		# Options.
+		options = @options()
+		grunt.verbose.writeflags options, "Options"
+
+		# Build file list.
+		files = []
+		@files.forEach (file) ->
+			files.push file.src
+
+		# Execute Jessie.
+		jessie = spawn JESSIE_BIN, files,
+			stdio: "inherit"
+
+		jessie.on "error", (err) =>
+			grunt.log.error "Error occured while executing Jessie"
+			grunt.log.error err
+			done false
+
+		jessie.on "exit", (code, signal) =>
+			unless code is 0 then done false
+			done true
+
+#		command = "#{JESSIE_BIN} #{files.join(" ")}"
+#		exec command, (err, stdout, stderr) ->
+#			console.log stdout
+#			if err
+#				grunt.warn err
+#				done false
+#			else
+#				done true
+(function() {
+  var JESSIE_BIN, exec, spawn;
+
+  exec = require("child_process").exec;
+
+  spawn = require("child_process").spawn;
+
+  JESSIE_BIN = "" + __dirname + "/../node_modules/jessie/bin/jessie";
+
+  module.exports = function(grunt) {
+    return grunt.registerMultiTask("jessie", "Runs Jasmine specs with Jessie", function() {
+      var done, files, jessie, options,
+        _this = this;
+      done = this.async();
+      options = this.options();
+      grunt.verbose.writeflags(options, "Options");
+      files = [];
+      this.files.forEach(function(file) {
+        return files.push(file.src);
+      });
+      jessie = spawn(JESSIE_BIN, files, {
+        stdio: "inherit"
+      });
+      jessie.on("error", function(err) {
+        grunt.log.error("Error occured while executing Jessie");
+        grunt.log.error(err);
+        return done(false);
+      });
+      return jessie.on("exit", function(code, signal) {
+        if (code !== 0) {
+          done(false);
+        }
+        return done(true);
+      });
+    });
+  };
+
+}).call(this);