inline coffeescript support via coffee-script-source

This commit is contained in:
John Bintz 2011-05-06 14:24:46 -04:00
parent 4b92891cc7
commit 8d02988381

View File

@ -8,7 +8,13 @@ require 'fileutils'
require 'getoptlong' require 'getoptlong'
require 'rubygems' require 'rubygems'
gem 'jasmine'
gem 'coffee-script-source'
require 'jasmine' require 'jasmine'
require 'coffee_script/source'
require 'jasmine/cli' require 'jasmine/cli'
include Jasmine::CLI include Jasmine::CLI
@ -48,6 +54,7 @@ puts "Running Jasmine specs..."
files = [ files = [
'file://' + File.join(Jasmine.root, 'lib/jasmine.js'), 'file://' + File.join(Jasmine.root, 'lib/jasmine.js'),
'file://' + File.join(Jasmine.root, 'lib/jasmine-html.js'), 'file://' + File.join(Jasmine.root, 'lib/jasmine-html.js'),
'file://' + CoffeeScript::Source.bundled_path,
] ]
files += [ [ 'src_files', 'src_dir' ], [ 'stylesheets', 'src_dir' ], [ 'helpers', 'spec_dir' ], [ 'spec_files', 'spec_dir' ] ].collect do |searches, root| files += [ [ 'src_files', 'src_dir' ], [ 'stylesheets', 'src_dir' ], [ 'helpers', 'spec_dir' ], [ 'spec_files', 'spec_dir' ] ].collect do |searches, root|
@ -67,6 +74,8 @@ files = files.flatten.compact.collect { |file|
case File.extname(file) case File.extname(file)
when '.js' when '.js'
%{<script type="text/javascript" src="#{file}"></script>} %{<script type="text/javascript" src="#{file}"></script>}
when '.coffee'
%{<script type="text/coffeescript" src="#{file}"></script>}
when '.css' when '.css'
%{<link rel="stylesheet" href="#{file}" type="text/css" />} %{<link rel="stylesheet" href="#{file}" type="text/css" />}
end end