jasmine/Rakefile

26 lines
828 B
Ruby
Raw Normal View History

desc 'Builds lib/jasmine from source'
task :build do
2009-08-21 05:16:14 +00:00
require 'json'
2009-08-21 05:16:14 +00:00
version = JSON.parse(File.new("src/version.json").read);
sources = ["src/util.js", "src/Env.js", "src/Reporter.js", "src/Block.js"]
2009-08-21 05:16:14 +00:00
sources += Dir.glob('src/*.js').reject{|f| f == 'src/base.js' || sources.include?(f)}.sort
old_jasmine_files = Dir.glob('lib/jasmine*.js')
old_jasmine_files.each do |file|
File.delete(file)
end
jasmine = File.new("lib/jasmine-#{version['major']}.#{version['minor']}.#{version['build']}.js", 'w')
jasmine.puts(File.read('src/base.js'))
jasmine.puts %{
jasmine.version_= {
"major": #{version['major']},
"minor": #{version['minor']},
"build": #{version['build']},
"revision": #{version['revision']}
};
}
sources.each do |source_filename|
jasmine.puts(File.read(source_filename))
end
end