rake jasmine:build no longer builds docs; use default for that.

This commit is contained in:
Christian Williams 2009-11-26 10:41:10 -05:00
parent 4ebc3b5964
commit 2cb5bf146c
2 changed files with 24 additions and 12 deletions

View File

@ -3,6 +3,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), "spec/jasmine_helper.
def jasmine_sources def jasmine_sources
sources = ["src/base.js", "src/util.js", "src/Env.js", "src/Reporter.js", "src/Block.js"] sources = ["src/base.js", "src/util.js", "src/Env.js", "src/Reporter.js", "src/Block.js"]
sources += Dir.glob('src/*.js').reject{|f| f == 'src/base.js' || sources.include?(f)}.sort sources += Dir.glob('src/*.js').reject{|f| f == 'src/base.js' || sources.include?(f)}.sort
sources
end end
def jasmine_filename(version) def jasmine_filename(version)
@ -26,19 +27,32 @@ def start_jasmine_server(jasmine_includes = nil)
:jasmine_files => jasmine_includes) :jasmine_files => jasmine_includes)
end end
task :default => 'jasmine:dist'
namespace :jasmine do namespace :jasmine do
desc 'Prepares for distribution'
task :dist => ['jasmine:build', 'jasmine:doc']
desc 'Builds lib/jasmine from source' desc 'Builds lib/jasmine from source'
task :build => 'jasmine:doc' do task :build do
puts 'Building Jasmine from source' puts 'Building Jasmine from source'
require 'json' require 'json'
sources = jasmine_sources sources = jasmine_sources
version = version_hash version = version_hash
old_jasmine_files = Dir.glob('lib/jasmine*.js') old_jasmine_files = Dir.glob('lib/jasmine*.js')
old_jasmine_files.each do |file| old_jasmine_files.each do |file|
File.delete(file) File.delete(file)
end end
jasmine = File.new("lib/#{jasmine_filename version}", 'w') jasmine = File.new("lib/#{jasmine_filename version}", 'w')
jasmine.puts(File.read(sources.shift))
sources.each do |source_filename|
jasmine.puts(File.read(source_filename))
end
jasmine.puts %{ jasmine.puts %{
jasmine.version_= { jasmine.version_= {
"major": #{version['major']}, "major": #{version['major']},
@ -47,9 +61,7 @@ jasmine.version_= {
"revision": #{Time.now.to_i} "revision": #{Time.now.to_i}
}; };
} }
sources.each do |source_filename|
jasmine.puts(File.read(source_filename))
end
jasmine.close jasmine.close
end end

View File

@ -539,13 +539,6 @@ jasmine.include = function(url, opt_global) {
return eval(xhr.responseText); return eval(xhr.responseText);
} }
}; };
jasmine.version_= {
"major": 0,
"minor": 10,
"build": 0,
"revision": 1259249316
};
/** /**
* @namespace * @namespace
*/ */
@ -2235,3 +2228,10 @@ window.clearInterval = function(timeoutKey) {
} }
}; };
jasmine.version_= {
"major": 0,
"minor": 10,
"build": 0,
"revision": 1259250030
};