From 234f49e583221ac3c171cafbfe4819ce2f745af8 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 6 May 2011 17:07:44 -0400 Subject: [PATCH] ok, use coffee-script and external compiler, the html thing doesn't work --- README.md | 5 ++--- bin/jasmine-headless-webkit | 10 ++++------ jasmine-headless-webkit.gemspec | 2 +- lib/autotest/jasmine_mixin.rb | 10 +++++++--- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e06eb61..314f26f 100644 --- a/README.md +++ b/README.md @@ -44,9 +44,8 @@ These options can also be placed into a `.jasmine-headless-webkit` file in your ### CoffeeScript Support -`jasmine-headless-webkit` brings in the `coffee-script-source` gem and allows you to run CoffeeScript -files without needing compilation. It uses [the `} when '.coffee' - %{} + %{} when '.css' %{} end diff --git a/jasmine-headless-webkit.gemspec b/jasmine-headless-webkit.gemspec index 47020bd..da6959c 100644 --- a/jasmine-headless-webkit.gemspec +++ b/jasmine-headless-webkit.gemspec @@ -21,5 +21,5 @@ Gem::Specification.new do |s| s.require_paths = ["lib"] s.add_dependency 'jasmine' - s.add_dependency 'coffee-script-source' + s.add_dependency 'coffee-script' end diff --git a/lib/autotest/jasmine_mixin.rb b/lib/autotest/jasmine_mixin.rb index 64f8fb8..71e73b5 100644 --- a/lib/autotest/jasmine_mixin.rb +++ b/lib/autotest/jasmine_mixin.rb @@ -1,7 +1,7 @@ module JasmineMixin JASMINE_PROGRAM = File.expand_path('../../../bin/jasmine-headless-webkit', __FILE__) - JAVASCRIPT_EXTENSIONS = %w{js} + JAVASCRIPT_EXTENSIONS = %w{js coffee} def self.included(klass) klass::ALL_HOOKS << [ :run_jasmine, :ran_jasmine ] @@ -81,12 +81,16 @@ module JasmineMixin end def setup_jasmine_project_mappings - add_mapping(%r{spec/javascripts/.*_spec\.js}) { |filename, _| + add_mapping(%r{spec/javascripts/.*_spec\.(js|coffee)}) { |filename, _| filename } add_mapping(%r{public/javascripts/(.*)\.js}) { |_, m| - [ "spec/javascripts/#{m[1]}_spec.js" ] + files_matching(%{spec/javascripts/#{m[1]}_spec\..*$}) + } + + add_mapping(%r{app/coffeescripts/(.*)\.coffee}) { |_, m| + files_matching(%{spec/javascripts/#{m[1]}_spec\..*$}) } end