Contenu connexe Similaire à Warbler at RubyConf 2010 Similaire à Warbler at RubyConf 2010 (20) Warbler at RubyConf 201022. INSTALL gem install warbler
Getting Started
You don’t even have to have JRuby installed at this point.
26. Gem::Specification.new do |s|
s.name = %q{rake}
s.version = "0.8.7"
s.default_executable = %q{rake}
s.files = [ ... ]
s.require_paths = ["lib"]
# s.add_dependency 'lib', ["= VERS"]
end
31. require 'warbler'
jar = Warbler::Jar.new
jar.files["directory"] = nil # directory entry
jar.files["inline.txt"] = StringIO.new("in memory")
jar.files["path/a.txt"] = "a.txt" # disk file
jar.create("sample.jar")
32. $ unzip -l sample.jar
Archive: sample.jar
Length Date Time Name
-------- ---- ---- ----
0 11-11-10 13:17 directory/
9 11-11-10 13:17 inline.txt
0 11-11-10 13:17 path/
0 11-11-10 13:17 path/a.txt
-------- -------
9 4 files