From cef8c2100a102a9a9f2ccaeb7b5ddbb5b903454b Mon Sep 17 00:00:00 2001 From: John Bintz Date: Mon, 23 May 2011 18:37:19 -0400 Subject: [PATCH] initial commit --- .gitignore | 4 +++ Gemfile | 4 +++ Rakefile | 2 ++ guard-jasmine-headless-webkit.gemspec | 21 +++++++++++++++ lib/guard/jasmine-headless-webkit.rb | 27 +++++++++++++++++++ .../templates/Guardfile | 0 lib/guard/jasmine-headless-webkit/version.rb | 5 ++++ 7 files changed, 63 insertions(+) create mode 100644 .gitignore create mode 100644 Gemfile create mode 100644 Rakefile create mode 100644 guard-jasmine-headless-webkit.gemspec create mode 100644 lib/guard/jasmine-headless-webkit.rb create mode 100644 lib/guard/jasmine-headless-webkit/templates/Guardfile create mode 100644 lib/guard/jasmine-headless-webkit/version.rb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4040c6c --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.gem +.bundle +Gemfile.lock +pkg/* diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..07c9411 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source "http://rubygems.org" + +# Specify your gem's dependencies in guard-jasmine-headless-webkit.gemspec +gemspec diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..14cfe0b --- /dev/null +++ b/Rakefile @@ -0,0 +1,2 @@ +require 'bundler' +Bundler::GemHelper.install_tasks diff --git a/guard-jasmine-headless-webkit.gemspec b/guard-jasmine-headless-webkit.gemspec new file mode 100644 index 0000000..3a714da --- /dev/null +++ b/guard-jasmine-headless-webkit.gemspec @@ -0,0 +1,21 @@ +# -*- encoding: utf-8 -*- +$:.push File.expand_path("../lib", __FILE__) +require "guard/jasmine-headless-webkit/version" + +Gem::Specification.new do |s| + s.name = "guard-jasmine-headless-webkit" + s.version = Guard::JasmineHeadlessWebkit::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["John Bintz"] + s.email = ["john@coswellproductions.com"] + s.homepage = "" + s.summary = %q{Run jasmine-headless-webkit using guard} + s.description = %q{Run jasmine-headless-webkit using guard} + + s.rubyforge_project = "guard-jasmine-headless-webkit" + + s.files = `git ls-files`.split("\n") + s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") + s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } + s.require_paths = ["lib"] +end diff --git a/lib/guard/jasmine-headless-webkit.rb b/lib/guard/jasmine-headless-webkit.rb new file mode 100644 index 0000000..8ceab19 --- /dev/null +++ b/lib/guard/jasmine-headless-webkit.rb @@ -0,0 +1,27 @@ +require 'guard' +require 'guard/guard' + +module Guard + class JasmineHeadlessWebkit < Guard + def start + UI.info "Guard::JasmineHeadlessWebkit is running." + end + + def run_all + system %{jasmine-headless-webkit} + end + + def run_on_change(paths) + system %{jasmine-headless-webkit #{paths.join(" ")}} + + run_all if $?.exitstatus != 1 + end + end + + class DSL + def matching_js_file(path) + Dir[path + '*.{js,coffee}'].sort { |left, right| File.mtime(right) <=> File.mtime(left) }.first + end + end +end + diff --git a/lib/guard/jasmine-headless-webkit/templates/Guardfile b/lib/guard/jasmine-headless-webkit/templates/Guardfile new file mode 100644 index 0000000..e69de29 diff --git a/lib/guard/jasmine-headless-webkit/version.rb b/lib/guard/jasmine-headless-webkit/version.rb new file mode 100644 index 0000000..7673388 --- /dev/null +++ b/lib/guard/jasmine-headless-webkit/version.rb @@ -0,0 +1,5 @@ +module Guard + module JasmineHeadlessWebkit + VERSION = "0.0.1" + end +end