Rudimentary rails support

This commit is contained in:
ragaskar 2009-11-25 19:47:05 -08:00
parent 3891b8afe4
commit 7b1de037f8
2 changed files with 17 additions and 12 deletions

View File

@ -33,6 +33,11 @@ if ARGV[0] == 'init'
File.copy(expand(cwd, 'templates/example_spec.js'), dest_spec_javascripts) File.copy(expand(cwd, 'templates/example_spec.js'), dest_spec_javascripts)
rails_tasks_dir = expand(dest_root, 'lib', 'tasks')
if File.exist?(rails_tasks_dir)
File.makedirs('lib/tasks/jasmine')
File.copy(rakefile_path, File.join(rails_tasks_dir, 'jasmine/jasmine.rake'))
else
if File.exist?(expand(dest_root, 'Rakefile')) if File.exist?(expand(dest_root, 'Rakefile'))
existing_rakefile = expand(dest_root, 'Rakefile') existing_rakefile = expand(dest_root, 'Rakefile')
load existing_rakefile load existing_rakefile
@ -44,5 +49,6 @@ if ARGV[0] == 'init'
else else
File.copy(rakefile_path, dest_root) File.copy(rakefile_path, dest_root)
end end
end
end end

View File

@ -10,7 +10,6 @@ namespace :jasmine do
require 'spec/rake/spectask' require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:ci) do |t| Spec::Rake::SpecTask.new(:ci) do |t|
t.spec_opts = ["--color", "--format", "specdoc"] t.spec_opts = ["--color", "--format", "specdoc"]
t.ruby_opts = ["MY_ROOT=foo"]
t.verbose = true t.verbose = true
t.spec_files = [JasmineHelper.meta_spec_path] t.spec_files = [JasmineHelper.meta_spec_path]
end end
@ -19,7 +18,7 @@ namespace :jasmine do
puts " http://localhost:8888/run.html" puts " http://localhost:8888/run.html"
Jasmine::SimpleServer.start(8888, Jasmine::SimpleServer.start(8888,
File.expand_path(File.join(File.dirname(__FILE__))), File.expand_path(Dir.pwd),
lambda { JasmineHelper.specs }, lambda { JasmineHelper.specs },
{ :spec_helpers => JasmineHelper.files + JasmineHelper.spec_helpers, { :spec_helpers => JasmineHelper.files + JasmineHelper.spec_helpers,
:stylesheets => JasmineHelper.stylesheets :stylesheets => JasmineHelper.stylesheets