Update Rakefile a bit. Added more rake tasks to run specs.

This commit is contained in:
Davis W. Frank 2011-03-08 18:38:46 -08:00
parent 70aed2d900
commit fc994108db

View File

@ -17,7 +17,6 @@ def version_hash
@version ||= JSON.parse(File.new("src/version.json").read);
end
task :default => 'jasmine:dist'
def substitute_jasmine_version(filename)
contents = File.read(filename)
@ -26,6 +25,23 @@ def substitute_jasmine_version(filename)
File.open(filename, 'w') { |f| f.write(contents) }
end
task :default => :spec
desc "Run spec suite: Browser, Node, JSHint"
task :spec => ["spec:node", "spec:browser", "jasmine:hint"]
namespace :spec do
desc 'Run specs in Node.js'
task :node do
system("node spec/node_suite.js")
end
desc "Run specs in the default browser (MacOS only)"
task :browser do
system("open spec/runner.html")
end
end
namespace :jasmine do
desc 'Prepares for distribution'
@ -51,9 +67,6 @@ namespace :jasmine do
sources = jasmine_sources
version = version_hash
old_jasmine_files = Dir.glob('lib/jasmine*.js')
old_jasmine_files.each { |file| File.delete(file) }
File.open("lib/jasmine.js", 'w') do |jasmine|
sources.each do |source_filename|
jasmine.puts(File.read(source_filename))
@ -150,6 +163,4 @@ jasmine.version_= {
exec "cd #{temp_dir} && zip -r #{zip_file_name} . -x .[a-zA-Z0-9]*"
end
end
task :jasmine => ['jasmine:dist']
end