lib/appengine-tools/gem_bundler.rb in appengine-tools-0.0.12 vs lib/appengine-tools/gem_bundler.rb in appengine-tools-0.0.13
- old
+ new
@@ -79,23 +79,25 @@
# cleanup old extension jars
if File.exists? app.bundled_jars
YAML.load_file(app.bundled_jars).each do |jar|
FileUtils.rm File.join(app.webinf_lib, jar), :force => true
end
- else
- stale = 'jruby-rack-0.9.6.jar'
- FileUtils.rm File.join(app.webinf_lib, stale), :force => true
end
+ # cleanup stale jars
+ %w(appengine-jruby-0.0.7.pre.jar appengine-jruby-0.0.7.jar
+ appengine-jruby-0.0.8.pre.jar jruby-rack-0.9.6.jar).each do |j|
+ FileUtils.rm File.join(app.webinf_lib, j), :force => true
+ end
jars = []
puts "=> Packaging gems"
gem_files = Dir["#{bundler_dir}/#{target_pair}/dirs/**/**"] +
Dir["#{bundler_dir}/#{target_pair}/gems/**/**"] +
Dir["#{bundler_dir}/#{target_pair}/environment.rb"] +
Dir["#{bundler_dir}/environment.rb"]
Zip::ZipFile.open(app.gems_jar, 'w') do |jar|
gem_files.reject {|f| f == app.gems_jar}.each do |file|
if file[-4..-1].eql? '.jar'
- puts "Installing #{File.basename(file)}"
+ puts "=> Installing #{File.basename(file)}"
FileUtils.cp file, app.webinf_lib
jars << File.basename(file)
else
jar.add(file.sub("#{app.gems_dir}/",''), file)
end