lib/java/packaging.rb in buildr-1.2.4 vs lib/java/packaging.rb in buildr-1.2.5

- old
+ new

@@ -36,41 +36,23 @@ def initialize_with_manifest(*args) #:nodoc: initialize_without_manifest *args @manifest = false @meta_inf = [] - meta_inf_path = path("META-INF") prepare do @prerequisites << manifest if String === manifest || Rake::Task === manifest - [meta_inf].flatten.map { |file| file.to_s }.uniq.each { |file| meta_inf_path.include file } + [meta_inf].flatten.map { |file| file.to_s }.uniq.each { |file| path("META-INF").include file } end enhance do if manifest # Tempfiles gets deleted on garbage collection, so we're going to hold on to it # through instance variable not closure variable. Tempfile.open "MANIFEST.MF" do |@manifest_tmp| lines = String === manifest || Rake::Task === manifest ? manifest_lines_from(File.read(manifest.to_s)) : manifest_lines_from(manifest) @manifest_tmp.write((MANIFEST_HEADER + lines).join("\n")) -=begin - @manifest_tmp.write MANIFEST_HEADER - case manifest - when Hash - @manifest_tmp.write(manifest.map { |pair| pair.map{ |s| s.to_s }.join(": ") }.sort.join("\n") << "\n") - when Array - @manifest_tmp.write(manifest.reject { |section| section.empty? }.map { |section| - section.map { |pair| pair.join(": ") }.sort.join("\n").concat("\n") - }.join("\n") << "\n") - when Proc, Method - @manifest_tmp.write manifest.call - when String, Rake::Task - @manifest_tmp.write File.read(manifest.to_s) - else - fail "Invalid manifest, expecting Hash, Array, file name/task or proc/method." - end -=end - meta_inf_path.include @manifest_tmp.path, :as=>"MANIFEST.MF" + path("META-INF").include @manifest_tmp.path, :as=>"MANIFEST.MF" end end end end