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/tasks/setup.rb
ADDED
@@ -0,0 +1,269 @@
|
|
1
|
+
# $Id$
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rake'
|
5
|
+
require 'rake/clean'
|
6
|
+
require 'fileutils'
|
7
|
+
require 'ostruct'
|
8
|
+
|
9
|
+
class OpenStruct; undef :gem; end
|
10
|
+
|
11
|
+
PROJ = OpenStruct.new(
|
12
|
+
# Project Defaults
|
13
|
+
:name => nil,
|
14
|
+
:summary => nil,
|
15
|
+
:description => nil,
|
16
|
+
:changes => nil,
|
17
|
+
:authors => nil,
|
18
|
+
:email => nil,
|
19
|
+
:url => "\000",
|
20
|
+
:version => ENV['VERSION'] || '0.0.0',
|
21
|
+
:exclude => %w(tmp$ bak$ ~$ CVS .svn/ ^pkg/ .git nbproject),
|
22
|
+
:release_name => ENV['RELEASE'],
|
23
|
+
|
24
|
+
# System Defaults
|
25
|
+
:ruby_opts => %w(-w),
|
26
|
+
:libs => [],
|
27
|
+
:history_file => 'History.txt',
|
28
|
+
:manifest_file => 'Manifest.txt',
|
29
|
+
:readme_file => 'README.txt',
|
30
|
+
|
31
|
+
# Announce
|
32
|
+
:ann => OpenStruct.new(
|
33
|
+
:file => 'announcement.txt',
|
34
|
+
:text => nil,
|
35
|
+
:paragraphs => [],
|
36
|
+
:email => {
|
37
|
+
:from => nil,
|
38
|
+
:to => %w(ruby-talk@ruby-lang.org),
|
39
|
+
:server => 'localhost',
|
40
|
+
:port => 25,
|
41
|
+
:domain => ENV['HOSTNAME'],
|
42
|
+
:acct => nil,
|
43
|
+
:passwd => nil,
|
44
|
+
:authtype => :plain
|
45
|
+
}
|
46
|
+
),
|
47
|
+
|
48
|
+
# Gem Packaging
|
49
|
+
:gem => OpenStruct.new(
|
50
|
+
:dependencies => [],
|
51
|
+
:executables => nil,
|
52
|
+
:extensions => FileList['ext/**/extconf.rb'],
|
53
|
+
:files => nil,
|
54
|
+
:need_tar => true,
|
55
|
+
:need_zip => false,
|
56
|
+
:extras => {}
|
57
|
+
),
|
58
|
+
|
59
|
+
# File Annotations
|
60
|
+
:notes => OpenStruct.new(
|
61
|
+
:exclude => %w(^tasks/setup.rb$),
|
62
|
+
:extensions => %w(.txt .rb .erb) << '',
|
63
|
+
:tags => %w(FIXME OPTIMIZE TODO)
|
64
|
+
),
|
65
|
+
|
66
|
+
# Rcov
|
67
|
+
:rcov => OpenStruct.new(
|
68
|
+
:dir => 'coverage',
|
69
|
+
:opts => %w[--sort coverage -T],
|
70
|
+
:threshold => 90.0,
|
71
|
+
:threshold_exact => false
|
72
|
+
),
|
73
|
+
|
74
|
+
# Rdoc
|
75
|
+
:rdoc => OpenStruct.new(
|
76
|
+
:opts => [],
|
77
|
+
:include => %w(^lib/ ^bin/ ^ext/ .txt$),
|
78
|
+
:exclude => %w(extconf.rb$),
|
79
|
+
:main => nil,
|
80
|
+
:dir => 'doc',
|
81
|
+
:remote_dir => nil
|
82
|
+
),
|
83
|
+
|
84
|
+
# Rubyforge
|
85
|
+
:rubyforge => OpenStruct.new(
|
86
|
+
:name => "\000"
|
87
|
+
),
|
88
|
+
|
89
|
+
# Rspec
|
90
|
+
:spec => OpenStruct.new(
|
91
|
+
:files => FileList['spec/**/*_spec.rb'],
|
92
|
+
:opts => [],
|
93
|
+
:libs => []
|
94
|
+
),
|
95
|
+
|
96
|
+
# Subversion Repository
|
97
|
+
:svn => OpenStruct.new(
|
98
|
+
:root => nil,
|
99
|
+
:path => '',
|
100
|
+
:trunk => 'trunk',
|
101
|
+
:tags => 'tags',
|
102
|
+
:branches => 'branches'
|
103
|
+
),
|
104
|
+
|
105
|
+
# Test::Unit
|
106
|
+
:test => OpenStruct.new(
|
107
|
+
:files => FileList['test/**/test_*.rb'],
|
108
|
+
:file => 'test/all.rb',
|
109
|
+
:opts => []
|
110
|
+
)
|
111
|
+
)
|
112
|
+
|
113
|
+
# Load the other rake files in the tasks folder
|
114
|
+
rakefiles = Dir.glob('tasks/*.rake').sort
|
115
|
+
rakefiles.unshift(rakefiles.delete('tasks/post_load.rake')).compact!
|
116
|
+
# Rake's import conflicts with JRuby's
|
117
|
+
#import(*rakefiles)
|
118
|
+
rakefiles.each {|rakefile| Rake.application.add_import(rakefile)}
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
# Setup the project libraries
|
123
|
+
%w(lib ext).each {|dir| PROJ.libs << dir if test ?d, dir}
|
124
|
+
|
125
|
+
# Setup some constants
|
126
|
+
WIN32 = %r/djgpp|(cyg|ms|bcc)win|mingw/ =~ RUBY_PLATFORM unless defined? WIN32
|
127
|
+
|
128
|
+
DEV_NULL = WIN32 ? 'NUL:' : '/dev/null'
|
129
|
+
|
130
|
+
def quiet( &block )
|
131
|
+
io = [$stdout.dup, $stderr.dup]
|
132
|
+
$stdout.reopen DEV_NULL
|
133
|
+
$stderr.reopen DEV_NULL
|
134
|
+
block.call
|
135
|
+
ensure
|
136
|
+
$stdout, $stderr = io.first, io.last
|
137
|
+
end
|
138
|
+
|
139
|
+
DIFF = if WIN32 then 'diff.exe'
|
140
|
+
else
|
141
|
+
if quiet {system "gdiff", __FILE__, __FILE__} then 'gdiff'
|
142
|
+
else 'diff' end
|
143
|
+
end unless defined? DIFF
|
144
|
+
|
145
|
+
SUDO = if WIN32 then ''
|
146
|
+
else
|
147
|
+
if quiet {system 'which sudo'} then 'sudo'
|
148
|
+
else '' end
|
149
|
+
end
|
150
|
+
|
151
|
+
RCOV = WIN32 ? 'rcov.bat' : 'rcov'
|
152
|
+
RDOC = WIN32 ? 'rdoc.bat' : 'rdoc'
|
153
|
+
GEM = WIN32 ? 'gem.bat' : 'gem'
|
154
|
+
|
155
|
+
%w(rcov spec/rake/spectask rubyforge bones facets/ansicode).each do |lib|
|
156
|
+
begin
|
157
|
+
require lib
|
158
|
+
Object.instance_eval {const_set "HAVE_#{lib.tr('/','_').upcase}", true}
|
159
|
+
rescue LoadError
|
160
|
+
Object.instance_eval {const_set "HAVE_#{lib.tr('/','_').upcase}", false}
|
161
|
+
end
|
162
|
+
end
|
163
|
+
HAVE_SVN = (Dir.entries(Dir.pwd).include?('.svn') and
|
164
|
+
system("svn --version 2>&1 > #{DEV_NULL}"))
|
165
|
+
|
166
|
+
# Reads a file at +path+ and spits out an array of the +paragraphs+
|
167
|
+
# specified.
|
168
|
+
#
|
169
|
+
# changes = paragraphs_of('History.txt', 0..1).join("\n\n")
|
170
|
+
# summary, *description = paragraphs_of('README.txt', 3, 3..8)
|
171
|
+
#
|
172
|
+
def paragraphs_of( path, *paragraphs )
|
173
|
+
title = String === paragraphs.first ? paragraphs.shift : nil
|
174
|
+
ary = File.read(path).delete("\r").split(/\n\n+/)
|
175
|
+
|
176
|
+
result = if title
|
177
|
+
tmp, matching = [], false
|
178
|
+
rgxp = %r/^=+\s*#{Regexp.escape(title)}/i
|
179
|
+
paragraphs << (0..-1) if paragraphs.empty?
|
180
|
+
|
181
|
+
ary.each do |val|
|
182
|
+
if val =~ rgxp
|
183
|
+
break if matching
|
184
|
+
matching = true
|
185
|
+
rgxp = %r/^=+/i
|
186
|
+
elsif matching
|
187
|
+
tmp << val
|
188
|
+
end
|
189
|
+
end
|
190
|
+
tmp
|
191
|
+
else ary end
|
192
|
+
|
193
|
+
result.values_at(*paragraphs)
|
194
|
+
end
|
195
|
+
|
196
|
+
# Adds the given gem _name_ to the current project's dependency list. An
|
197
|
+
# optional gem _version_ can be given. If omitted, the newest gem version
|
198
|
+
# will be used.
|
199
|
+
#
|
200
|
+
def depend_on( name, version = nil )
|
201
|
+
spec = Gem.source_index.find_name(name).last
|
202
|
+
version = spec.version.to_s if version.nil? and !spec.nil?
|
203
|
+
|
204
|
+
PROJ.gem.dependencies << case version
|
205
|
+
when nil; [name]
|
206
|
+
when %r/^\d/; [name, ">= #{version}"]
|
207
|
+
else [name, version] end
|
208
|
+
end
|
209
|
+
|
210
|
+
# Adds the given arguments to the include path if they are not already there
|
211
|
+
#
|
212
|
+
def ensure_in_path( *args )
|
213
|
+
args.each do |path|
|
214
|
+
path = File.expand_path(path)
|
215
|
+
$:.unshift(path) if test(?d, path) and not $:.include?(path)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
# Find a rake task using the task name and remove any description text. This
|
220
|
+
# will prevent the task from being displayed in the list of available tasks.
|
221
|
+
#
|
222
|
+
def remove_desc_for_task( names )
|
223
|
+
Array(names).each do |task_name|
|
224
|
+
task = Rake.application.tasks.find {|t| t.name == task_name}
|
225
|
+
next if task.nil?
|
226
|
+
task.instance_variable_set :@comment, nil
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
# Change working directories to _dir_, call the _block_ of code, and then
|
231
|
+
# change back to the original working directory (the current directory when
|
232
|
+
# this method was called).
|
233
|
+
#
|
234
|
+
def in_directory( dir, &block )
|
235
|
+
curdir = pwd
|
236
|
+
begin
|
237
|
+
cd dir
|
238
|
+
return block.call
|
239
|
+
ensure
|
240
|
+
cd curdir
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
# Scans the current working directory and creates a list of files that are
|
245
|
+
# candidates to be in the manifest.
|
246
|
+
#
|
247
|
+
def manifest_files
|
248
|
+
files = []
|
249
|
+
exclude = Regexp.new(PROJ.exclude.join('|'))
|
250
|
+
Find.find '.' do |path|
|
251
|
+
path.sub! %r/^(\.\/|\/)/o, ''
|
252
|
+
next unless test ?f, path
|
253
|
+
next if path =~ exclude
|
254
|
+
files << path
|
255
|
+
end
|
256
|
+
files.sort!
|
257
|
+
end
|
258
|
+
|
259
|
+
# We need a "valid" method thtat determines if a string is suitable for use
|
260
|
+
# in the gem specification.
|
261
|
+
#
|
262
|
+
class Object
|
263
|
+
def valid?
|
264
|
+
return !(self.empty? or self == "\000") if self.respond_to?(:to_str)
|
265
|
+
return false
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
# EOF
|
data/tasks/spec.rake
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# $Id$
|
2
|
+
|
3
|
+
if HAVE_SPEC_RAKE_SPECTASK
|
4
|
+
require 'spec/rake/verify_rcov'
|
5
|
+
|
6
|
+
namespace :spec do
|
7
|
+
|
8
|
+
desc 'Run all specs with basic output'
|
9
|
+
Spec::Rake::SpecTask.new(:run) do |t|
|
10
|
+
t.ruby_opts = PROJ.ruby_opts
|
11
|
+
t.spec_opts = PROJ.spec.opts
|
12
|
+
t.spec_files = PROJ.spec.files
|
13
|
+
t.libs += PROJ.libs
|
14
|
+
t.libs += PROJ.spec.libs
|
15
|
+
end
|
16
|
+
|
17
|
+
desc 'Run all specs with text output'
|
18
|
+
Spec::Rake::SpecTask.new(:specdoc) do |t|
|
19
|
+
t.ruby_opts = PROJ.ruby_opts
|
20
|
+
t.spec_opts = PROJ.spec.opts + ['--format', 'specdoc']
|
21
|
+
t.spec_files = PROJ.spec.files
|
22
|
+
t.libs += PROJ.libs
|
23
|
+
t.libs += PROJ.spec.libs
|
24
|
+
end
|
25
|
+
|
26
|
+
if HAVE_RCOV
|
27
|
+
desc 'Run all specs with RCov'
|
28
|
+
Spec::Rake::SpecTask.new(:rcov) do |t|
|
29
|
+
t.ruby_opts = PROJ.ruby_opts
|
30
|
+
t.spec_opts = PROJ.spec.opts
|
31
|
+
t.spec_files = PROJ.spec.files
|
32
|
+
t.libs += PROJ.libs
|
33
|
+
t.rcov = true
|
34
|
+
t.rcov_dir = PROJ.rcov.dir
|
35
|
+
t.rcov_opts = PROJ.rcov.opts + ['--exclude', 'spec']
|
36
|
+
end
|
37
|
+
|
38
|
+
RCov::VerifyTask.new(:verify) do |t|
|
39
|
+
t.threshold = PROJ.rcov.threshold
|
40
|
+
t.index_html = File.join(PROJ.rcov.dir, 'index.html')
|
41
|
+
t.require_exact_threshold = PROJ.rcov.threshold_exact
|
42
|
+
end
|
43
|
+
|
44
|
+
task :verify => :rcov
|
45
|
+
remove_desc_for_task %w(spec:clobber_rcov)
|
46
|
+
end
|
47
|
+
|
48
|
+
end # namespace :spec
|
49
|
+
|
50
|
+
task :kill_jvm do
|
51
|
+
require 'java'
|
52
|
+
java.lang.System.exit(0)
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
desc 'Alias to spec:run'
|
57
|
+
task :spec => ['spec:run', :kill_jvm]
|
58
|
+
|
59
|
+
task :clobber => 'spec:clobber_rcov' if HAVE_RCOV
|
60
|
+
|
61
|
+
end # if HAVE_SPEC_RAKE_SPECTASK
|
62
|
+
|
63
|
+
# EOF
|
data/tasks/svn.rake
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# $Id$
|
2
|
+
|
3
|
+
if HAVE_SVN
|
4
|
+
|
5
|
+
unless PROJ.svn.root
|
6
|
+
info = %x/svn info ./
|
7
|
+
m = %r/^Repository Root:\s+(.*)$/.match(info)
|
8
|
+
PROJ.svn.root = (m.nil? ? '' : m[1])
|
9
|
+
end
|
10
|
+
PROJ.svn.root = File.join(PROJ.svn.root, PROJ.svn.path) unless PROJ.svn.path.empty?
|
11
|
+
|
12
|
+
namespace :svn do
|
13
|
+
|
14
|
+
# A prerequisites task that all other tasks depend upon
|
15
|
+
task :prereqs
|
16
|
+
|
17
|
+
desc 'Show tags from the SVN repository'
|
18
|
+
task :show_tags => 'svn:prereqs' do |t|
|
19
|
+
tags = %x/svn list #{File.join(PROJ.svn.root, PROJ.svn.tags)}/
|
20
|
+
tags.gsub!(%r/\/$/, '')
|
21
|
+
tags = tags.split("\n").sort {|a,b| b <=> a}
|
22
|
+
puts tags
|
23
|
+
end
|
24
|
+
|
25
|
+
desc 'Create a new tag in the SVN repository'
|
26
|
+
task :create_tag => 'svn:prereqs' do |t|
|
27
|
+
v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
|
28
|
+
abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version
|
29
|
+
|
30
|
+
svn = PROJ.svn
|
31
|
+
trunk = File.join(svn.root, svn.trunk)
|
32
|
+
tag = "%s-%s" % [PROJ.name, PROJ.version]
|
33
|
+
tag = File.join(svn.root, svn.tags, tag)
|
34
|
+
msg = "Creating tag for #{PROJ.name} version #{PROJ.version}"
|
35
|
+
|
36
|
+
puts "Creating SVN tag '#{tag}'"
|
37
|
+
unless system "svn cp -m '#{msg}' #{trunk} #{tag}"
|
38
|
+
abort "Tag creation failed"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end # namespace :svn
|
43
|
+
|
44
|
+
task 'gem:release' => 'svn:create_tag'
|
45
|
+
|
46
|
+
end # if PROJ.svn.path
|
47
|
+
|
48
|
+
# EOF
|
data/tasks/test.rake
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# $Id$
|
2
|
+
|
3
|
+
require 'rake/testtask'
|
4
|
+
|
5
|
+
namespace :test do
|
6
|
+
|
7
|
+
Rake::TestTask.new(:run) do |t|
|
8
|
+
t.libs = PROJ.libs
|
9
|
+
t.test_files = if test(?f, PROJ.test.file) then [PROJ.test.file]
|
10
|
+
else PROJ.test.files end
|
11
|
+
t.ruby_opts += PROJ.ruby_opts
|
12
|
+
t.ruby_opts += PROJ.test.opts
|
13
|
+
end
|
14
|
+
|
15
|
+
if HAVE_RCOV
|
16
|
+
desc 'Run rcov on the unit tests'
|
17
|
+
task :rcov => :clobber_rcov do
|
18
|
+
opts = PROJ.rcov.opts.dup << '-o' << PROJ.rcov.dir
|
19
|
+
opts = opts.join(' ')
|
20
|
+
files = if test(?f, PROJ.test.file) then [PROJ.test.file]
|
21
|
+
else PROJ.test.files end
|
22
|
+
files = files.join(' ')
|
23
|
+
sh "#{RCOV} #{files} #{opts}"
|
24
|
+
end
|
25
|
+
|
26
|
+
task :clobber_rcov do
|
27
|
+
rm_r 'coverage' rescue nil
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end # namespace :test
|
32
|
+
|
33
|
+
desc 'Alias to test:run'
|
34
|
+
task :test => 'test:run'
|
35
|
+
|
36
|
+
task :clobber => 'test:clobber_rcov' if HAVE_RCOV
|
37
|
+
|
38
|
+
# EOF
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'app_bundler'
|
2
|
+
require 'spec_helpers'
|
3
|
+
|
4
|
+
describe Rawr::AppBundler do
|
5
|
+
include CustomFileMatchers
|
6
|
+
|
7
|
+
it "uses the main java class option" do
|
8
|
+
app_bundler = Rawr::AppBundler.new
|
9
|
+
app_bundler.instance_variable_set(:@main_java_class, "foo")
|
10
|
+
|
11
|
+
result_string = ""
|
12
|
+
File.stub!(:open).and_yield(result_string)
|
13
|
+
|
14
|
+
app_bundler.generate_info_plist
|
15
|
+
|
16
|
+
result_string.should match(/<key>MainClass<\/key>\s*<string>foo<\/string>/m)
|
17
|
+
end
|
18
|
+
|
19
|
+
it "creates the proper directory structure for a .app" do
|
20
|
+
begin
|
21
|
+
Rawr::AppBundler.new.create_clean_deployment_directory_structure("spec-temp", "spec-temp/native_deploy/mac", "spec-temp/native_deploy/mac/RawrSpec.app")
|
22
|
+
|
23
|
+
"spec-temp/native_deploy/mac/RawrSpec.app".should be_existing_file
|
24
|
+
"spec-temp/native_deploy/mac/RawrSpec.app/Contents".should be_existing_file
|
25
|
+
"spec-temp/native_deploy/mac/RawrSpec.app/Contents/MacOS".should be_existing_file
|
26
|
+
"spec-temp/native_deploy/mac/RawrSpec.app/Contents/Resources".should be_existing_file
|
27
|
+
ensure
|
28
|
+
FileUtils.rm_rf "spec-temp"
|
29
|
+
FileUtils.rm_f "Info.plist"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
it "creates an Info.plist file if it didn't exist before in the application root" do
|
34
|
+
begin
|
35
|
+
"Info.plist".should_not be_existing_file
|
36
|
+
|
37
|
+
app_bundler = Rawr::AppBundler.new
|
38
|
+
app_bundler.generate_info_plist
|
39
|
+
|
40
|
+
"Info.plist".should be_existing_file
|
41
|
+
ensure
|
42
|
+
FileUtils.rm_f "Info.plist"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
it "copies the Info.plist file to .app/Contents directory during packaging" do
|
47
|
+
begin
|
48
|
+
FileUtils.mkdir_p "spec-temp/native_deploy/mac/RawrSpec.app/Contents/"
|
49
|
+
File.open("Info.plist", File::CREAT) do |file|
|
50
|
+
file << ""
|
51
|
+
end
|
52
|
+
|
53
|
+
"spec-temp/native_deploy/mac/RawrSpec.app/Contents/Info.plist".should_not be_existing_file
|
54
|
+
|
55
|
+
app_bundler = Rawr::AppBundler.new
|
56
|
+
app_bundler.instance_variable_set(:@mac_app_path, "spec-temp/native_deploy/mac/RawrSpec.app")
|
57
|
+
app_bundler.deploy_info_plist
|
58
|
+
|
59
|
+
"spec-temp/native_deploy/mac/RawrSpec.app/Contents/Info.plist".should be_existing_file
|
60
|
+
ensure
|
61
|
+
FileUtils.rm_rf "spec-temp"
|
62
|
+
FileUtils.rm_f "Info.plist"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helpers'
|
2
|
+
require 'bundler'
|
3
|
+
|
4
|
+
describe Rawr::Bundler do
|
5
|
+
before :each do
|
6
|
+
@bundler = Rawr::Bundler.new
|
7
|
+
end
|
8
|
+
|
9
|
+
it "converts the classpath into a relative classpath" do
|
10
|
+
@bundler.instance_variable_set(:@base_dir, "/root")
|
11
|
+
@bundler.instance_variable_set(:@classpath, ["/root/foo.rb", "/root/bar.rb"])
|
12
|
+
|
13
|
+
@bundler.send(:relative_classpath).should == ["foo.rb", "bar.rb"]
|
14
|
+
end
|
15
|
+
|
16
|
+
it "uses the relative classpath during the deployment copy" do
|
17
|
+
@bundler.should_receive(:relative_classpath).and_return([])
|
18
|
+
|
19
|
+
@bundler.instance_variable_set(:@base_dir, "/root")
|
20
|
+
@bundler.instance_variable_set(:@package_dir, "/root/package")
|
21
|
+
@bundler.instance_variable_set(:@classpath, ["/root/foo.rb", "/root/bar.rb"])
|
22
|
+
@bundler.stub!(:file_utils).and_return(FileUtils::DryRun)
|
23
|
+
|
24
|
+
@bundler.copy_deployment_to "temp_deploy"
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'generator'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
describe Rawr::Generator do
|
5
|
+
include CustomFileMatchers
|
6
|
+
|
7
|
+
before :each do
|
8
|
+
@it = Rawr::Generator
|
9
|
+
end
|
10
|
+
|
11
|
+
it "creates a run config file" do
|
12
|
+
@it.create_run_config_file :package_dir => '.', :ruby_source => 'src', :main_ruby_file => 'main.rb', :native_library_dirs => []
|
13
|
+
|
14
|
+
'run_configuration'.should be_existing_file
|
15
|
+
#TODO: This is an awful test, refactor into CustomFileMatchers for better self-documenting code
|
16
|
+
File.should be_size('run_configuration')
|
17
|
+
FileUtils.rm_rf 'run_configuration'
|
18
|
+
end
|
19
|
+
|
20
|
+
it "creates a manifest file" do
|
21
|
+
FileUtils.mkdir_p 'rawr-spec-temp-test/META-INF'
|
22
|
+
|
23
|
+
@it.create_manifest_file :build_dir => 'rawr-spec-temp-test', :classpath => ['foo', 'bar'], :base_dir => '.', :main_java_file => 'org.rawr.test.Main'
|
24
|
+
|
25
|
+
'rawr-spec-temp-test/META-INF/MANIFEST.MF'.should be_existing_file
|
26
|
+
#TODO: This is an awful test, refactor into CustomFileMatchers for better self-documenting code
|
27
|
+
File.should be_size('rawr-spec-temp-test/META-INF/MANIFEST.MF')
|
28
|
+
FileUtils.rm_rf 'rawr-spec-temp-test'
|
29
|
+
end
|
30
|
+
|
31
|
+
# just see if the file is created, and has some content
|
32
|
+
it "creates a build configuration file" do
|
33
|
+
@it.create_default_config_file('test_configuration.yaml', 'org.rawr.test.Main')
|
34
|
+
|
35
|
+
'test_configuration.yaml'.should be_existing_file
|
36
|
+
#TODO: This is an awful test, refactor into CustomFileMatchers for better self-documenting code
|
37
|
+
File.should be_size('test_configuration.yaml')
|
38
|
+
FileUtils.rm 'test_configuration.yaml'
|
39
|
+
end
|
40
|
+
|
41
|
+
it "creates a Java main file" do
|
42
|
+
@it.create_java_main_file('TestMain.java', 'org.rawr.test', 'Main')
|
43
|
+
|
44
|
+
'TestMain.java'.should be_existing_file
|
45
|
+
#TODO: This is an awful test, refactor into CustomFileMatchers for better self-documenting code
|
46
|
+
File.should be_size('TestMain.java')
|
47
|
+
FileUtils.rm 'TestMain.java'
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'options'
|
2
|
+
|
3
|
+
describe Rawr::Options do
|
4
|
+
it "parses jars: into JarBuilders" do
|
5
|
+
jars_hash = {'jars' => {"test.jar" => {'dir' => 'test', 'glob' => '**/*_test.rb'}}}
|
6
|
+
|
7
|
+
Rawr::Options.instance.load_jars_options(jars_hash)
|
8
|
+
|
9
|
+
Rawr::Options[:jars]['test.jar'].should_not be_nil
|
10
|
+
end
|
11
|
+
|
12
|
+
it "adds jars into the classpath from jars: config node" do
|
13
|
+
jars_hash = {'jars' => {"test.jar" => {'dir' => 'test', 'glob' => '**/*_test.rb'}}}
|
14
|
+
|
15
|
+
Rawr::Options.instance.load_jars_options(jars_hash)
|
16
|
+
|
17
|
+
Rawr::Options[:classpath].should include("test.jar")
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
it "returns information about web_start configuration when that key is present" do
|
22
|
+
web_start_hash = {'web_start' => {'self_sign' => true, 'self_sign_passphrase' => 'password'}}
|
23
|
+
|
24
|
+
Rawr::Options.instance.process_configuration(web_start_hash)
|
25
|
+
|
26
|
+
Rawr::Options.instance[:web_start].should_not be_nil
|
27
|
+
Rawr::Options.instance[:web_start][:self_sign].should be_true
|
28
|
+
Rawr::Options.instance[:web_start][:self_sign_passphrase].should == 'password'
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
it "does not rasise an exception if no JNLP values are present" do
|
33
|
+
lambda { Rawr::Options.instance.process_configuration(Hash.new) }.should_not raise_error(Exception)
|
34
|
+
end
|
35
|
+
|
36
|
+
it "returns information about JNLP values if present" do
|
37
|
+
jnlp_hash = {'jnlp' => {'title' => 'The Foo Bar App',
|
38
|
+
'vendor' => 'HCS',
|
39
|
+
'codebase' => 'http://www.happycamperstudios.com/foo',
|
40
|
+
'homepage_href' => '/bar.html',
|
41
|
+
'description' => 'The description',
|
42
|
+
'offline_allowed' => true,
|
43
|
+
'shortcut_desktop' => true,
|
44
|
+
'menu_submenu' => 'Foo Bar'
|
45
|
+
},
|
46
|
+
'web_start' => {}
|
47
|
+
}
|
48
|
+
Rawr::Options.instance.process_configuration(jnlp_hash)
|
49
|
+
Rawr::Options.instance[:web_start].should_not be_nil
|
50
|
+
Rawr::Options.instance[:jnlp][:title].should == 'The Foo Bar App'
|
51
|
+
Rawr::Options.instance[:jnlp][:vendor].should == 'HCS'
|
52
|
+
Rawr::Options.instance[:jnlp][:codebase].should == 'http://www.happycamperstudios.com/foo'
|
53
|
+
Rawr::Options.instance[:jnlp][:homepage_href].should == '/bar.html'
|
54
|
+
Rawr::Options.instance[:jnlp][:description].should == 'The description'
|
55
|
+
Rawr::Options.instance[:jnlp][:offline_allowed].should == true
|
56
|
+
Rawr::Options.instance[:jnlp][:shortcut_desktop].should == true
|
57
|
+
Rawr::Options.instance[:jnlp][:menu_submenu].should == 'Foo Bar'
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
it "extracts keytool response values from the configuration file if present" do
|
62
|
+
keytool_hash = {'keytool_responses' => {'password' => 'sekrit',
|
63
|
+
'first_and_last_name' => 'Napolean Solo',
|
64
|
+
'organization' => 'U.N.C.L.E.',
|
65
|
+
'locality' => 'NYC',
|
66
|
+
'state_or_province' => 'NY',
|
67
|
+
'country_code' => 'US'
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
keytool_responses = Rawr::Options.instance.load_keytool_responses(keytool_hash)
|
72
|
+
|
73
|
+
keytool_responses[:password].should == 'sekrit'
|
74
|
+
keytool_responses[:first_and_last_name].should == 'Napolean Solo'
|
75
|
+
keytool_responses[:organization].should == 'U.N.C.L.E.'
|
76
|
+
keytool_responses[:locality].should == 'NYC'
|
77
|
+
keytool_responses[:state_or_province].should == 'NY'
|
78
|
+
keytool_responses[:country_code].should == 'US'
|
79
|
+
end
|
80
|
+
|
81
|
+
it "creates a classpath entry without the deploy dir" do
|
82
|
+
options = {}
|
83
|
+
options['classpath_files'] = ['lib/debug/debug1.jar', 'lib/debug/debug2.jar']
|
84
|
+
options['classpath_dirs'] = ['lib/java']
|
85
|
+
options['package_dir'] = 'package/deploy'
|
86
|
+
options['project_name'] = 'RawrSpec'
|
87
|
+
|
88
|
+
Dir.stub!(:glob).and_return(['lib/java/foo1.jar', 'lib/java/foo2.jar'])
|
89
|
+
|
90
|
+
Rawr::Options.instance.load_java_options(options)
|
91
|
+
|
92
|
+
Rawr::Options.instance[:classpath].should include('lib/debug/debug1.jar')
|
93
|
+
Rawr::Options.instance[:classpath].should include('lib/debug/debug2.jar')
|
94
|
+
Rawr::Options.instance[:classpath].should include('lib/java/foo1.jar')
|
95
|
+
Rawr::Options.instance[:classpath].should include('lib/java/foo2.jar')
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'platform'
|
2
|
+
|
3
|
+
describe Platform do
|
4
|
+
before :each do
|
5
|
+
Platform.instance.instance_variable_set(:@using_windows, nil)
|
6
|
+
Platform.instance.instance_variable_set(:@using_linux, nil)
|
7
|
+
Platform.instance.instance_variable_set(:@using_mac, nil)
|
8
|
+
end
|
9
|
+
|
10
|
+
it "detects when running on Windows" do
|
11
|
+
Platform.class_eval("@@operating_system = 'Windows XP'")
|
12
|
+
Platform.instance.should be_using_windows
|
13
|
+
end
|
14
|
+
|
15
|
+
it "detects when running on the Mac" do
|
16
|
+
Platform.class_eval("@@operating_system = 'darwin'")
|
17
|
+
Platform.instance.should be_using_mac
|
18
|
+
end
|
19
|
+
|
20
|
+
it "detects when running on Linux" do
|
21
|
+
Platform.class_eval("@@operating_system = 'linux'")
|
22
|
+
Platform.instance.should be_using_linux
|
23
|
+
end
|
24
|
+
|
25
|
+
it "uses ':' for an argument separator in Windows" do
|
26
|
+
Platform.class_eval("@@operating_system = 'Windows XP'")
|
27
|
+
Platform.instance.argument_delimiter.should == ';'
|
28
|
+
end
|
29
|
+
end
|