Neurogami-roir 1.3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +22 -0
- data/Manifest.txt +250 -0
- data/README.md +12 -0
- data/Rakefile +63 -0
- data/bin/roir +176 -0
- data/data/GenericJavaApp.icns +0 -0
- data/data/JavaApplicationStub +0 -0
- data/data/Rawr logo 1 large.png +0 -0
- data/data/Rawr logo 2 large.png +0 -0
- data/data/Rawr logo2.png +0 -0
- data/data/website/_notes/dwsync.xml +1 -0
- data/data/website/css/1.css +254 -0
- data/data/website/css/_notes/dwsync.xml +1 -0
- data/data/website/images/_notes/dwsync.xml +1 -0
- data/data/website/images/body_bg.jpg +0 -0
- data/data/website/images/bullet.gif +0 -0
- data/data/website/images/content.jpg +0 -0
- data/data/website/images/content_h2.gif +0 -0
- data/data/website/images/details.gif +0 -0
- data/data/website/images/details.jpg +0 -0
- data/data/website/images/header_bg.jpg +0 -0
- data/data/website/images/nav_a_hover.gif +0 -0
- data/data/website/images/rawr_logo.png +0 -0
- data/data/website/index.html +164 -0
- data/lib/app_bundler.rb +138 -0
- data/lib/bundler.rb +36 -0
- data/lib/command.rb +68 -0
- data/lib/exe_bundler.rb +106 -0
- data/lib/generator.rb +127 -0
- data/lib/jar_builder.rb +57 -0
- data/lib/jruby_batch_compiler.rb +127 -0
- data/lib/jruby_release.rb +104 -0
- data/lib/launch4j/LICENSE.txt +30 -0
- data/lib/launch4j/bin-linux/COPYING +340 -0
- data/lib/launch4j/bin-linux/ld +0 -0
- data/lib/launch4j/bin-linux/windres +0 -0
- data/lib/launch4j/bin-mac/COPYING +340 -0
- data/lib/launch4j/bin-mac/ld +0 -0
- data/lib/launch4j/bin-mac/readme.txt +1 -0
- data/lib/launch4j/bin-mac/windres +0 -0
- data/lib/launch4j/bin-win/COPYING +340 -0
- data/lib/launch4j/bin-win/ld.exe +0 -0
- data/lib/launch4j/bin-win/windres.exe +0 -0
- data/lib/launch4j/build.xml +62 -0
- data/lib/launch4j/demo/ConsoleApp/ConsoleApp.jar +0 -0
- data/lib/launch4j/demo/ConsoleApp/build.xml +57 -0
- data/lib/launch4j/demo/ConsoleApp/l4j/ConsoleApp.ico +0 -0
- data/lib/launch4j/demo/ConsoleApp/lib/readme.txt +8 -0
- data/lib/launch4j/demo/ConsoleApp/readme.txt +1 -0
- data/lib/launch4j/demo/ConsoleApp/src/net/sf/launch4j/example/ConsoleApp.java +72 -0
- data/lib/launch4j/demo/LICENSE.txt +30 -0
- data/lib/launch4j/demo/SimpleApp/SimpleApp.jar +0 -0
- data/lib/launch4j/demo/SimpleApp/build.xml +52 -0
- data/lib/launch4j/demo/SimpleApp/l4j/SimpleApp.ico +0 -0
- data/lib/launch4j/demo/SimpleApp/l4j/SimpleApp.xml +18 -0
- data/lib/launch4j/demo/SimpleApp/l4j/splash.bmp +0 -0
- data/lib/launch4j/demo/SimpleApp/lib/readme.txt +8 -0
- data/lib/launch4j/demo/SimpleApp/readme.txt +1 -0
- data/lib/launch4j/demo/SimpleApp/src/net/sf/launch4j/example/SimpleApp.java +104 -0
- data/lib/launch4j/demo/readme.txt +3 -0
- data/lib/launch4j/head/LICENSE.txt +23 -0
- data/lib/launch4j/head/consolehead.o +0 -0
- data/lib/launch4j/head/guihead.o +0 -0
- data/lib/launch4j/head/head.o +0 -0
- data/lib/launch4j/head_src/LICENSE.txt +23 -0
- data/lib/launch4j/head_src/consolehead/Makefile.win +33 -0
- data/lib/launch4j/head_src/consolehead/consolehead.c +65 -0
- data/lib/launch4j/head_src/consolehead/consolehead.dev +108 -0
- data/lib/launch4j/head_src/guihead/Makefile.win +33 -0
- data/lib/launch4j/head_src/guihead/guihead.c +185 -0
- data/lib/launch4j/head_src/guihead/guihead.dev +109 -0
- data/lib/launch4j/head_src/guihead/guihead.h +43 -0
- data/lib/launch4j/head_src/head.c +807 -0
- data/lib/launch4j/head_src/head.h +113 -0
- data/lib/launch4j/head_src/resource.h +71 -0
- data/lib/launch4j/launch4j +8 -0
- data/lib/launch4j/launch4j.jar +0 -0
- data/lib/launch4j/launch4j.jfpr +0 -0
- data/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt +31 -0
- data/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt +31 -0
- data/lib/launch4j/lib/Nuvola.Icon.Theme.LICENSE.txt +504 -0
- data/lib/launch4j/lib/XStream.LICENSE.txt +27 -0
- data/lib/launch4j/lib/commons-beanutils.jar +0 -0
- data/lib/launch4j/lib/commons-logging.jar +0 -0
- data/lib/launch4j/lib/commons.LICENSE.txt +50 -0
- data/lib/launch4j/lib/forms.jar +0 -0
- data/lib/launch4j/lib/formsrt.jar +0 -0
- data/lib/launch4j/lib/foxtrot.LICENSE.txt +25 -0
- data/lib/launch4j/lib/foxtrot.jar +0 -0
- data/lib/launch4j/lib/looks.jar +0 -0
- data/lib/launch4j/lib/xstream.jar +0 -0
- data/lib/launch4j/manifest/uac.exe.manifest +12 -0
- data/lib/launch4j/manifest/xp-themes.exe.manifest +14 -0
- data/lib/launch4j/src/images/asterix-o.gif +0 -0
- data/lib/launch4j/src/images/asterix.gif +0 -0
- data/lib/launch4j/src/images/build.png +0 -0
- data/lib/launch4j/src/images/button_ok.png +0 -0
- data/lib/launch4j/src/images/cancel16.png +0 -0
- data/lib/launch4j/src/images/down16.png +0 -0
- data/lib/launch4j/src/images/edit_add16.png +0 -0
- data/lib/launch4j/src/images/info.png +0 -0
- data/lib/launch4j/src/images/new.png +0 -0
- data/lib/launch4j/src/images/new16.png +0 -0
- data/lib/launch4j/src/images/ok16.png +0 -0
- data/lib/launch4j/src/images/open.png +0 -0
- data/lib/launch4j/src/images/open16.png +0 -0
- data/lib/launch4j/src/images/run.png +0 -0
- data/lib/launch4j/src/images/save.png +0 -0
- data/lib/launch4j/src/images/up16.png +0 -0
- data/lib/launch4j/src/launch4j.properties +2 -0
- data/lib/launch4j/src/net/sf/launch4j/Builder.java +207 -0
- data/lib/launch4j/src/net/sf/launch4j/BuilderException.java +52 -0
- data/lib/launch4j/src/net/sf/launch4j/ExecException.java +66 -0
- data/lib/launch4j/src/net/sf/launch4j/FileChooserFilter.java +76 -0
- data/lib/launch4j/src/net/sf/launch4j/Log.java +105 -0
- data/lib/launch4j/src/net/sf/launch4j/Main.java +99 -0
- data/lib/launch4j/src/net/sf/launch4j/Messages.java +78 -0
- data/lib/launch4j/src/net/sf/launch4j/OptionParser.java +71 -0
- data/lib/launch4j/src/net/sf/launch4j/RcBuilder.java +340 -0
- data/lib/launch4j/src/net/sf/launch4j/Util.java +197 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/AntClassPath.java +61 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/AntConfig.java +129 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/AntJre.java +69 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/Launch4jTask.java +162 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/Messages.java +55 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/StringWrapper.java +67 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/messages.properties +35 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/messages_es.properties +35 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/Binding.java +62 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/BindingException.java +52 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/Bindings.java +317 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/IValidatable.java +44 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/InvariantViolationException.java +67 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JComboBoxBinding.java +119 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JListBinding.java +118 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JRadioButtonBinding.java +146 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JTextAreaBinding.java +123 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JTextComponentBinding.java +108 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JToggleButtonBinding.java +108 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/Messages.java +78 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/OptComponentBinding.java +119 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/OptJTextAreaBinding.java +141 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/Validator.java +259 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/messages.properties +52 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/messages_es.properties +51 -0
- data/lib/launch4j/src/net/sf/launch4j/config/ClassPath.java +87 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Config.java +396 -0
- data/lib/launch4j/src/net/sf/launch4j/config/ConfigPersister.java +249 -0
- data/lib/launch4j/src/net/sf/launch4j/config/ConfigPersisterException.java +51 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Jre.java +235 -0
- data/lib/launch4j/src/net/sf/launch4j/config/LdDefaults.java +62 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Messages.java +78 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Msg.java +111 -0
- data/lib/launch4j/src/net/sf/launch4j/config/SingleInstance.java +74 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Splash.java +103 -0
- data/lib/launch4j/src/net/sf/launch4j/config/VersionInfo.java +168 -0
- data/lib/launch4j/src/net/sf/launch4j/config/messages.properties +93 -0
- data/lib/launch4j/src/net/sf/launch4j/config/messages_es.properties +75 -0
- data/lib/launch4j/src/net/sf/launch4j/form/BasicForm.java +283 -0
- data/lib/launch4j/src/net/sf/launch4j/form/BasicForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/ClassPathForm.java +193 -0
- data/lib/launch4j/src/net/sf/launch4j/form/ClassPathForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/ConfigForm.java +132 -0
- data/lib/launch4j/src/net/sf/launch4j/form/ConfigForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/EnvironmentVarsForm.java +127 -0
- data/lib/launch4j/src/net/sf/launch4j/form/EnvironmentVarsForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/HeaderForm.java +171 -0
- data/lib/launch4j/src/net/sf/launch4j/form/HeaderForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/JreForm.java +266 -0
- data/lib/launch4j/src/net/sf/launch4j/form/JreForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/Messages.java +55 -0
- data/lib/launch4j/src/net/sf/launch4j/form/MessagesForm.java +183 -0
- data/lib/launch4j/src/net/sf/launch4j/form/MessagesForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/SingleInstanceForm.java +141 -0
- data/lib/launch4j/src/net/sf/launch4j/form/SingleInstanceForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/SplashForm.java +166 -0
- data/lib/launch4j/src/net/sf/launch4j/form/SplashForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/VersionInfoForm.java +232 -0
- data/lib/launch4j/src/net/sf/launch4j/form/VersionInfoForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/messages.properties +146 -0
- data/lib/launch4j/src/net/sf/launch4j/form/messages_es.properties +118 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/AbstractAcceptListener.java +75 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/BasicFormImpl.java +101 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/BrowseActionListener.java +79 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/ClassPathFormImpl.java +222 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/ConfigFormImpl.java +100 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/EnvironmentVarsFormImpl.java +50 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/FileChooser.java +65 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/GlassPane.java +67 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/HeaderFormImpl.java +102 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/JreFormImpl.java +166 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/MainFrame.java +358 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/Messages.java +55 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/MessagesFormImpl.java +58 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/SingleInstanceFormImpl.java +54 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/SplashFormImpl.java +61 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/VersionInfoFormImpl.java +63 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/messages.properties +74 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/messages_es.properties +56 -0
- data/lib/launch4j/src/net/sf/launch4j/messages.properties +45 -0
- data/lib/launch4j/src/net/sf/launch4j/messages_es.properties +45 -0
- data/lib/launch4j/w32api/MinGW.LICENSE.txt +25 -0
- data/lib/launch4j/w32api/crt2.o +0 -0
- data/lib/launch4j/w32api/libadvapi32.a +0 -0
- data/lib/launch4j/w32api/libgcc.a +0 -0
- data/lib/launch4j/w32api/libkernel32.a +0 -0
- data/lib/launch4j/w32api/libmingw32.a +0 -0
- data/lib/launch4j/w32api/libmsvcrt.a +0 -0
- data/lib/launch4j/w32api/libshell32.a +0 -0
- data/lib/launch4j/w32api/libuser32.a +0 -0
- data/lib/launch4j/web/bullet.gif +0 -0
- data/lib/launch4j/web/changelog.html +356 -0
- data/lib/launch4j/web/docs.html +585 -0
- data/lib/launch4j/web/index.html +128 -0
- data/lib/launch4j/web/launch4j-use.gif +0 -0
- data/lib/launch4j/web/launch4j.gif +0 -0
- data/lib/launch4j/web/links.html +73 -0
- data/lib/launch4j/web/style.css +159 -0
- data/lib/options.rb +101 -0
- data/lib/platform.rb +28 -0
- data/lib/rawr.rb +178 -0
- data/lib/rawr_bundle.rb +26 -0
- data/lib/rawr_version.rb +3 -0
- data/lib/web_bundler.rb +114 -0
- data/lib/zip/ioextras.rb +155 -0
- data/lib/zip/stdrubyext.rb +111 -0
- data/lib/zip/tempfile_bugfixed.rb +195 -0
- data/lib/zip/zip.rb +1848 -0
- data/lib/zip/zipfilesystem.rb +609 -0
- data/lib/zip/ziprequire.rb +90 -0
- data/tasks/ann.rake +81 -0
- data/tasks/bones.rake +21 -0
- data/tasks/gem.rake +121 -0
- data/tasks/manifest.rake +49 -0
- data/tasks/notes.rake +28 -0
- data/tasks/post_load.rake +39 -0
- data/tasks/rdoc.rake +51 -0
- data/tasks/rubyforge.rake +57 -0
- data/tasks/setup.rb +269 -0
- data/tasks/spec.rake +63 -0
- data/tasks/svn.rake +48 -0
- data/tasks/test.rake +38 -0
- data/test/unit/app_bundler_spec.rb +65 -0
- data/test/unit/bundler_spec.rb +27 -0
- data/test/unit/generator_spec.rb +49 -0
- data/test/unit/jar_builder_spec.rb +5 -0
- data/test/unit/options_spec.rb +97 -0
- data/test/unit/platform_spec.rb +29 -0
- data/test/unit/spec_helpers.rb +22 -0
- data/test/unit/web_bundler_spec.rb +83 -0
- metadata +501 -0
data/lib/rawr_bundle.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
include FileUtils
|
4
|
+
|
5
|
+
namespace :"rawr:bundle" do
|
6
|
+
|
7
|
+
desc "Bundles the jar from rawr:jar into a native Mac OS X application (.app)"
|
8
|
+
task :app => [:"rawr:jar"] do
|
9
|
+
require 'app_bundler'
|
10
|
+
Rawr::AppBundler.new.deploy Rawr::Options.instance
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "Bundles the jar from rawr:jar into a native Windows application (.exe)"
|
14
|
+
task :exe => [:"rawr:jar"] do
|
15
|
+
require 'exe_bundler'
|
16
|
+
Rawr::ExeBundler.new.deploy Rawr::Options.instance
|
17
|
+
end
|
18
|
+
|
19
|
+
desc "Bundles the jar from rawr:jar into a Java Web Start application (.jnlp)"
|
20
|
+
task :web => [:"rawr:jar"] do
|
21
|
+
require 'web_bundler'
|
22
|
+
Rawr::WebBundler.new.deploy Rawr::Options.instance
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
|
data/lib/rawr_version.rb
ADDED
data/lib/web_bundler.rb
ADDED
@@ -0,0 +1,114 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
|
3
|
+
module Rawr
|
4
|
+
class WebBundler < Bundler
|
5
|
+
def self_sign_pass_phrase(options)
|
6
|
+
return nil unless options[:web_start]
|
7
|
+
return nil unless options[:web_start][:self_sign]
|
8
|
+
options[:web_start][:self_sign_passphrase]
|
9
|
+
end
|
10
|
+
|
11
|
+
def web_path
|
12
|
+
"#{@output_dir}/native_deploy/web"
|
13
|
+
end
|
14
|
+
|
15
|
+
def populate_jnlp_string_template(template_values)
|
16
|
+
<<-JNLP
|
17
|
+
<?xml version='1.0' encoding='UTF-8' ?>
|
18
|
+
<jnlp spec='1.0+' codebase='#{template_values[:codebase]}' href='#{template_values[:project_name]}.jnlp'>
|
19
|
+
<information>
|
20
|
+
<title>#{template_values[:project_name]}</title>
|
21
|
+
<vendor>#{template_values[:vendor]}</vendor>
|
22
|
+
<homepage href='#{template_values[:homepage_href]}' />
|
23
|
+
<description>#{template_values[:description]}</description>
|
24
|
+
</information>
|
25
|
+
|
26
|
+
<offline-allowed/>
|
27
|
+
|
28
|
+
<security>
|
29
|
+
<all-permissions/>
|
30
|
+
</security>
|
31
|
+
|
32
|
+
<resources>
|
33
|
+
<j2se version='1.6'/>
|
34
|
+
<j2se version='1.5'/>
|
35
|
+
<jar href='#{template_values[:project_name]}.jar'/>
|
36
|
+
#{template_values[:classpath_jnlp_jars]}
|
37
|
+
</resources>
|
38
|
+
|
39
|
+
<application-desc main-class='#{template_values[:main_java_file]}' />
|
40
|
+
</jnlp>
|
41
|
+
JNLP
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
def template_values(options)
|
46
|
+
values = {}
|
47
|
+
values[:project_name] = @project_name
|
48
|
+
values[:codebase] = options[:jnlp][:codebase]
|
49
|
+
values[:vendor] = options[:jnlp][:vendor]
|
50
|
+
values[:homepage_href] = options[:jnlp][:homepage_href]
|
51
|
+
values[:classpath_jnlp_jars] = classpath_jnlp_jars
|
52
|
+
values[:main_java_file] = options[:main_java_file]
|
53
|
+
values[:description] = options[:jnlp][:description]
|
54
|
+
values
|
55
|
+
end
|
56
|
+
|
57
|
+
def in_root_dir?(file)
|
58
|
+
file !~ /\//
|
59
|
+
end
|
60
|
+
|
61
|
+
def copy_deployment_to(destination_path)
|
62
|
+
file_utils.mkdir_p destination_path
|
63
|
+
relative_base_dir = @package_dir.sub("#{add_trailing_slash(@base_dir)}", '')
|
64
|
+
(relative_files_without_repo + relative_classpath).flatten.uniq.each do |file|
|
65
|
+
new_dir = "#{add_trailing_slash(destination_path)}#{File.dirname(file).sub(relative_base_dir, '')}"
|
66
|
+
file_utils.mkdir_p(new_dir)
|
67
|
+
file_utils.copy(file, "#{add_trailing_slash(destination_path)}#{file.sub(relative_base_dir, '')}") unless File.directory?(file) || in_root_dir?(file)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def deploy(options)
|
72
|
+
@project_name = options[:project_name]
|
73
|
+
@output_dir = options[:output_dir]
|
74
|
+
@classpath = options[:classpath]
|
75
|
+
@package_dir = options[:package_dir]
|
76
|
+
@base_dir = add_trailing_slash(options[:base_dir])
|
77
|
+
@main_java_file = options[:main_java_file]
|
78
|
+
@project_jar =
|
79
|
+
|
80
|
+
file_utils.mkdir_p web_path
|
81
|
+
|
82
|
+
web_start_config_file = "#{@project_name}.jnlp"
|
83
|
+
|
84
|
+
unless File.exists? web_start_config_file
|
85
|
+
File.open(web_start_config_file, 'w') do |file|
|
86
|
+
# WARNING: all-permissions needed for security with JRuby!!!!
|
87
|
+
file << populate_jnlp_string_template(template_values(options))
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
copy_deployment_to web_path
|
92
|
+
file_utils.cp web_start_config_file, web_path, :verbose => true
|
93
|
+
storepass = self_sign_pass_phrase(options) ? " -storepass #{self_sign_pass_phrase(options)} " : ''
|
94
|
+
sh "jarsigner -keystore sample-keys #{storepass} #{web_path}/#{@project_name}.jar myself"
|
95
|
+
puts "done signing project jar"
|
96
|
+
@classpath.each {|jar| sh "jarsigner -keystore sample-keys #{storepass} #{to_web_path(jar).strip} myself" }
|
97
|
+
end
|
98
|
+
|
99
|
+
|
100
|
+
def classpath_jnlp_jars
|
101
|
+
@classpath.map {|jar| "<jar href='#{jar}'/>"}.join("\n")
|
102
|
+
end
|
103
|
+
|
104
|
+
|
105
|
+
def to_web_path(path)
|
106
|
+
base_dir = add_trailing_slash(@base_dir)
|
107
|
+
package_dir = add_trailing_slash(@package_dir)
|
108
|
+
relative_package_dir = package_dir.sub(base_dir, '')
|
109
|
+
path.sub!(base_dir, '')
|
110
|
+
path.sub!(relative_package_dir , '')
|
111
|
+
"#{web_path}/#{path}"
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
data/lib/zip/ioextras.rb
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
module IOExtras #:nodoc:
|
2
|
+
|
3
|
+
CHUNK_SIZE = 32768
|
4
|
+
|
5
|
+
RANGE_ALL = 0..-1
|
6
|
+
|
7
|
+
def self.copy_stream(ostream, istream)
|
8
|
+
s = ''
|
9
|
+
ostream.write(istream.read(CHUNK_SIZE, s)) until istream.eof?
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
# Implements kind_of? in order to pretend to be an IO object
|
14
|
+
module FakeIO
|
15
|
+
def kind_of?(object)
|
16
|
+
object == IO || super
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# Implements many of the convenience methods of IO
|
21
|
+
# such as gets, getc, readline and readlines
|
22
|
+
# depends on: input_finished?, produce_input and read
|
23
|
+
module AbstractInputStream
|
24
|
+
include Enumerable
|
25
|
+
include FakeIO
|
26
|
+
|
27
|
+
def initialize
|
28
|
+
super
|
29
|
+
@lineno = 0
|
30
|
+
@outputBuffer = ""
|
31
|
+
end
|
32
|
+
|
33
|
+
attr_accessor :lineno
|
34
|
+
|
35
|
+
def read(numberOfBytes = nil, buf = nil)
|
36
|
+
tbuf = nil
|
37
|
+
|
38
|
+
if @outputBuffer.length > 0
|
39
|
+
if numberOfBytes <= @outputBuffer.length
|
40
|
+
tbuf = @outputBuffer.slice!(0, numberOfBytes)
|
41
|
+
else
|
42
|
+
numberOfBytes -= @outputBuffer.length if (numberOfBytes)
|
43
|
+
rbuf = sysread(numberOfBytes, buf)
|
44
|
+
tbuf = @outputBuffer
|
45
|
+
tbuf << rbuf if (rbuf)
|
46
|
+
@outputBuffer = ""
|
47
|
+
end
|
48
|
+
else
|
49
|
+
tbuf = sysread(numberOfBytes, buf)
|
50
|
+
end
|
51
|
+
|
52
|
+
return nil unless (tbuf)
|
53
|
+
|
54
|
+
if buf
|
55
|
+
buf.replace(tbuf)
|
56
|
+
else
|
57
|
+
buf = tbuf
|
58
|
+
end
|
59
|
+
|
60
|
+
buf
|
61
|
+
end
|
62
|
+
|
63
|
+
def readlines(aSepString = $/)
|
64
|
+
retVal = []
|
65
|
+
each_line(aSepString) { |line| retVal << line }
|
66
|
+
return retVal
|
67
|
+
end
|
68
|
+
|
69
|
+
def gets(aSepString=$/)
|
70
|
+
@lineno = @lineno.next
|
71
|
+
return read if aSepString == nil
|
72
|
+
aSepString="#{$/}#{$/}" if aSepString == ""
|
73
|
+
|
74
|
+
bufferIndex=0
|
75
|
+
while ((matchIndex = @outputBuffer.index(aSepString, bufferIndex)) == nil)
|
76
|
+
bufferIndex=@outputBuffer.length
|
77
|
+
if input_finished?
|
78
|
+
return @outputBuffer.empty? ? nil : flush
|
79
|
+
end
|
80
|
+
@outputBuffer << produce_input
|
81
|
+
end
|
82
|
+
sepIndex=matchIndex + aSepString.length
|
83
|
+
return @outputBuffer.slice!(0...sepIndex)
|
84
|
+
end
|
85
|
+
|
86
|
+
def flush
|
87
|
+
retVal=@outputBuffer
|
88
|
+
@outputBuffer=""
|
89
|
+
return retVal
|
90
|
+
end
|
91
|
+
|
92
|
+
def readline(aSepString = $/)
|
93
|
+
retVal = gets(aSepString)
|
94
|
+
raise EOFError if retVal == nil
|
95
|
+
return retVal
|
96
|
+
end
|
97
|
+
|
98
|
+
def each_line(aSepString = $/)
|
99
|
+
while true
|
100
|
+
yield readline(aSepString)
|
101
|
+
end
|
102
|
+
rescue EOFError
|
103
|
+
end
|
104
|
+
|
105
|
+
alias_method :each, :each_line
|
106
|
+
end
|
107
|
+
|
108
|
+
|
109
|
+
# Implements many of the output convenience methods of IO.
|
110
|
+
# relies on <<
|
111
|
+
module AbstractOutputStream
|
112
|
+
include FakeIO
|
113
|
+
|
114
|
+
def write(data)
|
115
|
+
self << data
|
116
|
+
data.to_s.length
|
117
|
+
end
|
118
|
+
|
119
|
+
|
120
|
+
def print(*params)
|
121
|
+
self << params.to_s << $\.to_s
|
122
|
+
end
|
123
|
+
|
124
|
+
def printf(aFormatString, *params)
|
125
|
+
self << sprintf(aFormatString, *params)
|
126
|
+
end
|
127
|
+
|
128
|
+
def putc(anObject)
|
129
|
+
self << case anObject
|
130
|
+
when Fixnum then anObject.chr
|
131
|
+
when String then anObject
|
132
|
+
else raise TypeError, "putc: Only Fixnum and String supported"
|
133
|
+
end
|
134
|
+
anObject
|
135
|
+
end
|
136
|
+
|
137
|
+
def puts(*params)
|
138
|
+
params << "\n" if params.empty?
|
139
|
+
params.flatten.each {
|
140
|
+
|element|
|
141
|
+
val = element.to_s
|
142
|
+
self << val
|
143
|
+
self << "\n" unless val[-1,1] == "\n"
|
144
|
+
}
|
145
|
+
end
|
146
|
+
|
147
|
+
end
|
148
|
+
|
149
|
+
end # IOExtras namespace module
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
# Copyright (C) 2002-2004 Thomas Sondergaard
|
154
|
+
# rubyzip is free software; you can redistribute it and/or
|
155
|
+
# modify it under the terms of the ruby license.
|
@@ -0,0 +1,111 @@
|
|
1
|
+
unless Enumerable.method_defined?(:inject)
|
2
|
+
module Enumerable #:nodoc:all
|
3
|
+
def inject(n = 0)
|
4
|
+
each { |value| n = yield(n, value) }
|
5
|
+
n
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
module Enumerable #:nodoc:all
|
11
|
+
# returns a new array of all the return values not equal to nil
|
12
|
+
# This implementation could be faster
|
13
|
+
def select_map(&aProc)
|
14
|
+
map(&aProc).reject { |e| e.nil? }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
unless Object.method_defined?(:object_id)
|
19
|
+
class Object #:nodoc:all
|
20
|
+
# Using object_id which is the new thing, so we need
|
21
|
+
# to make that work in versions prior to 1.8.0
|
22
|
+
alias object_id id
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
unless File.respond_to?(:read)
|
27
|
+
class File # :nodoc:all
|
28
|
+
# singleton method read does not exist in 1.6.x
|
29
|
+
def self.read(fileName)
|
30
|
+
open(fileName) { |f| f.read }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
class String #:nodoc:all
|
36
|
+
def starts_with(aString)
|
37
|
+
rindex(aString, 0) == 0
|
38
|
+
end
|
39
|
+
|
40
|
+
def ends_with(aString)
|
41
|
+
index(aString, -aString.size)
|
42
|
+
end
|
43
|
+
|
44
|
+
def ensure_end(aString)
|
45
|
+
ends_with(aString) ? self : self + aString
|
46
|
+
end
|
47
|
+
|
48
|
+
def lchop
|
49
|
+
slice(1, length)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class Time #:nodoc:all
|
54
|
+
|
55
|
+
#MS-DOS File Date and Time format as used in Interrupt 21H Function 57H:
|
56
|
+
#
|
57
|
+
# Register CX, the Time:
|
58
|
+
# Bits 0-4 2 second increments (0-29)
|
59
|
+
# Bits 5-10 minutes (0-59)
|
60
|
+
# bits 11-15 hours (0-24)
|
61
|
+
#
|
62
|
+
# Register DX, the Date:
|
63
|
+
# Bits 0-4 day (1-31)
|
64
|
+
# bits 5-8 month (1-12)
|
65
|
+
# bits 9-15 year (four digit year minus 1980)
|
66
|
+
|
67
|
+
|
68
|
+
def to_binary_dos_time
|
69
|
+
(sec/2) +
|
70
|
+
(min << 5) +
|
71
|
+
(hour << 11)
|
72
|
+
end
|
73
|
+
|
74
|
+
def to_binary_dos_date
|
75
|
+
(day) +
|
76
|
+
(month << 5) +
|
77
|
+
((year - 1980) << 9)
|
78
|
+
end
|
79
|
+
|
80
|
+
# Dos time is only stored with two seconds accuracy
|
81
|
+
def dos_equals(other)
|
82
|
+
to_i/2 == other.to_i/2
|
83
|
+
end
|
84
|
+
|
85
|
+
def self.parse_binary_dos_format(binaryDosDate, binaryDosTime)
|
86
|
+
second = 2 * ( 0b11111 & binaryDosTime)
|
87
|
+
minute = ( 0b11111100000 & binaryDosTime) >> 5
|
88
|
+
hour = (0b1111100000000000 & binaryDosTime) >> 11
|
89
|
+
day = ( 0b11111 & binaryDosDate)
|
90
|
+
month = ( 0b111100000 & binaryDosDate) >> 5
|
91
|
+
year = ((0b1111111000000000 & binaryDosDate) >> 9) + 1980
|
92
|
+
begin
|
93
|
+
return Time.local(year, month, day, hour, minute, second)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
class Module #:nodoc:all
|
99
|
+
def forward_message(forwarder, *messagesToForward)
|
100
|
+
methodDefs = messagesToForward.map {
|
101
|
+
|msg|
|
102
|
+
"def #{msg}; #{forwarder}(:#{msg}); end"
|
103
|
+
}
|
104
|
+
module_eval(methodDefs.join("\n"))
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
|
109
|
+
# Copyright (C) 2002, 2003 Thomas Sondergaard
|
110
|
+
# rubyzip is free software; you can redistribute it and/or
|
111
|
+
# modify it under the terms of the ruby license.
|
@@ -0,0 +1,195 @@
|
|
1
|
+
#
|
2
|
+
# tempfile - manipulates temporary files
|
3
|
+
#
|
4
|
+
# $Id: tempfile_bugfixed.rb,v 1.2 2005/02/19 20:30:33 thomas Exp $
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'delegate'
|
8
|
+
require 'tmpdir'
|
9
|
+
|
10
|
+
module BugFix #:nodoc:all
|
11
|
+
|
12
|
+
# A class for managing temporary files. This library is written to be
|
13
|
+
# thread safe.
|
14
|
+
class Tempfile < DelegateClass(File)
|
15
|
+
MAX_TRY = 10
|
16
|
+
@@cleanlist = []
|
17
|
+
|
18
|
+
# Creates a temporary file of mode 0600 in the temporary directory
|
19
|
+
# whose name is basename.pid.n and opens with mode "w+". A Tempfile
|
20
|
+
# object works just like a File object.
|
21
|
+
#
|
22
|
+
# If tmpdir is omitted, the temporary directory is determined by
|
23
|
+
# Dir::tmpdir provided by 'tmpdir.rb'.
|
24
|
+
# When $SAFE > 0 and the given tmpdir is tainted, it uses
|
25
|
+
# /tmp. (Note that ENV values are tainted by default)
|
26
|
+
def initialize(basename, tmpdir=Dir::tmpdir)
|
27
|
+
if $SAFE > 0 and tmpdir.tainted?
|
28
|
+
tmpdir = '/tmp'
|
29
|
+
end
|
30
|
+
|
31
|
+
lock = nil
|
32
|
+
n = failure = 0
|
33
|
+
|
34
|
+
begin
|
35
|
+
Thread.critical = true
|
36
|
+
|
37
|
+
begin
|
38
|
+
tmpname = sprintf('%s/%s%d.%d', tmpdir, basename, $$, n)
|
39
|
+
lock = tmpname + '.lock'
|
40
|
+
n += 1
|
41
|
+
end while @@cleanlist.include?(tmpname) or
|
42
|
+
File.exist?(lock) or File.exist?(tmpname)
|
43
|
+
|
44
|
+
Dir.mkdir(lock)
|
45
|
+
rescue
|
46
|
+
failure += 1
|
47
|
+
retry if failure < MAX_TRY
|
48
|
+
raise "cannot generate tempfile `%s'" % tmpname
|
49
|
+
ensure
|
50
|
+
Thread.critical = false
|
51
|
+
end
|
52
|
+
|
53
|
+
@data = [tmpname]
|
54
|
+
@clean_proc = Tempfile.callback(@data)
|
55
|
+
ObjectSpace.define_finalizer(self, @clean_proc)
|
56
|
+
|
57
|
+
@tmpfile = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL, 0600)
|
58
|
+
@tmpname = tmpname
|
59
|
+
@@cleanlist << @tmpname
|
60
|
+
@data[1] = @tmpfile
|
61
|
+
@data[2] = @@cleanlist
|
62
|
+
|
63
|
+
super(@tmpfile)
|
64
|
+
|
65
|
+
# Now we have all the File/IO methods defined, you must not
|
66
|
+
# carelessly put bare puts(), etc. after this.
|
67
|
+
|
68
|
+
Dir.rmdir(lock)
|
69
|
+
end
|
70
|
+
|
71
|
+
# Opens or reopens the file with mode "r+".
|
72
|
+
def open
|
73
|
+
@tmpfile.close if @tmpfile
|
74
|
+
@tmpfile = File.open(@tmpname, 'r+')
|
75
|
+
@data[1] = @tmpfile
|
76
|
+
__setobj__(@tmpfile)
|
77
|
+
end
|
78
|
+
|
79
|
+
def _close # :nodoc:
|
80
|
+
@tmpfile.close if @tmpfile
|
81
|
+
@data[1] = @tmpfile = nil
|
82
|
+
end
|
83
|
+
protected :_close
|
84
|
+
|
85
|
+
# Closes the file. If the optional flag is true, unlinks the file
|
86
|
+
# after closing.
|
87
|
+
#
|
88
|
+
# If you don't explicitly unlink the temporary file, the removal
|
89
|
+
# will be delayed until the object is finalized.
|
90
|
+
def close(unlink_now=false)
|
91
|
+
if unlink_now
|
92
|
+
close!
|
93
|
+
else
|
94
|
+
_close
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# Closes and unlinks the file.
|
99
|
+
def close!
|
100
|
+
_close
|
101
|
+
@clean_proc.call
|
102
|
+
ObjectSpace.undefine_finalizer(self)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Unlinks the file. On UNIX-like systems, it is often a good idea
|
106
|
+
# to unlink a temporary file immediately after creating and opening
|
107
|
+
# it, because it leaves other programs zero chance to access the
|
108
|
+
# file.
|
109
|
+
def unlink
|
110
|
+
# keep this order for thread safeness
|
111
|
+
File.unlink(@tmpname) if File.exist?(@tmpname)
|
112
|
+
@@cleanlist.delete(@tmpname) if @@cleanlist
|
113
|
+
end
|
114
|
+
alias delete unlink
|
115
|
+
|
116
|
+
if RUBY_VERSION > '1.8.0'
|
117
|
+
def __setobj__(obj)
|
118
|
+
@_dc_obj = obj
|
119
|
+
end
|
120
|
+
else
|
121
|
+
def __setobj__(obj)
|
122
|
+
@obj = obj
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
# Returns the full path name of the temporary file.
|
127
|
+
def path
|
128
|
+
@tmpname
|
129
|
+
end
|
130
|
+
|
131
|
+
# Returns the size of the temporary file. As a side effect, the IO
|
132
|
+
# buffer is flushed before determining the size.
|
133
|
+
def size
|
134
|
+
if @tmpfile
|
135
|
+
@tmpfile.flush
|
136
|
+
@tmpfile.stat.size
|
137
|
+
else
|
138
|
+
0
|
139
|
+
end
|
140
|
+
end
|
141
|
+
alias length size
|
142
|
+
|
143
|
+
class << self
|
144
|
+
def callback(data) # :nodoc:
|
145
|
+
pid = $$
|
146
|
+
lambda{
|
147
|
+
if pid == $$
|
148
|
+
path, tmpfile, cleanlist = *data
|
149
|
+
|
150
|
+
print "removing ", path, "..." if $DEBUG
|
151
|
+
|
152
|
+
tmpfile.close if tmpfile
|
153
|
+
|
154
|
+
# keep this order for thread safeness
|
155
|
+
File.unlink(path) if File.exist?(path)
|
156
|
+
cleanlist.delete(path) if cleanlist
|
157
|
+
|
158
|
+
print "done\n" if $DEBUG
|
159
|
+
end
|
160
|
+
}
|
161
|
+
end
|
162
|
+
|
163
|
+
# If no block is given, this is a synonym for new().
|
164
|
+
#
|
165
|
+
# If a block is given, it will be passed tempfile as an argument,
|
166
|
+
# and the tempfile will automatically be closed when the block
|
167
|
+
# terminates. In this case, open() returns nil.
|
168
|
+
def open(*args)
|
169
|
+
tempfile = new(*args)
|
170
|
+
|
171
|
+
if block_given?
|
172
|
+
begin
|
173
|
+
yield(tempfile)
|
174
|
+
ensure
|
175
|
+
tempfile.close
|
176
|
+
end
|
177
|
+
|
178
|
+
nil
|
179
|
+
else
|
180
|
+
tempfile
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
end # module BugFix
|
187
|
+
if __FILE__ == $0
|
188
|
+
# $DEBUG = true
|
189
|
+
f = Tempfile.new("foo")
|
190
|
+
f.print("foo\n")
|
191
|
+
f.close
|
192
|
+
f.open
|
193
|
+
p f.gets # => "foo\n"
|
194
|
+
f.close!
|
195
|
+
end
|