Object
The Jar trait sets up the archive layout for an executable jar project, and adds the JRuby jar files and a JarMain class to the archive.
# File lib/warbler/traits/jar.rb, line 31 def after_configure config.init_contents << StringIO.new("require 'rubygems'\n") end
# File lib/warbler/traits/jar.rb, line 23 def before_configure config.gem_path = '/' config.pathmaps = default_pathmaps config.java_libs = default_jar_files config.manifest_file = 'MANIFEST.MF' if File.exist?('MANIFEST.MF') config.init_contents << "#{config.warbler_templates}/jar.erb" end
# File lib/warbler/traits/jar.rb, line 53 def default_jar_files require 'jruby-jars' FileList[JRubyJars.core_jar_path, JRubyJars.stdlib_jar_path] end
# File lib/warbler/traits/jar.rb, line 43 def default_pathmaps p = OpenStruct.new p.java_libs = ["META-INF/lib/%f"] p.java_classes = ["%p"] p.application = ["#{config.jar_name}/%p"] p.gemspecs = ["specifications/%f"] p.gems = ["gems/%p"] p end
# File lib/warbler/traits/jar.rb, line 35 def update_archive(jar) unless config.manifest_file manifest = Warbler::Jar::DEFAULT_MANIFEST.chomp + "Main-Class: JarMain\n" jar.files['META-INF/MANIFEST.MF'] = StringIO.new(manifest) end jar.files['JarMain.class'] = jar.entry_in_jar(WARBLER_JAR, "JarMain.class") end
Generated with the Darkfish Rdoc Generator 2.