ocra 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +14 -0
- data/README.txt +117 -45
- data/Rakefile +10 -0
- data/bin/ocra +35 -21
- data/lib/ocra.rb +1 -1
- data/share/ocra/edicon.exe +0 -0
- data/share/ocra/stub.exe +0 -0
- data/share/ocra/stubw.exe +0 -0
- data/test/test_ocra.rb +41 -1
- metadata +46 -12
data/History.txt
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
=== 1.1.4
|
2
|
+
|
3
|
+
* The tempdir marker is now pretty-printed as "<tempdir>" in the
|
4
|
+
output.
|
5
|
+
|
6
|
+
* Fixed various issues with path and filenames being handled case
|
7
|
+
sensitive.
|
8
|
+
|
9
|
+
* Now uses config settings for Ruby executable names (should now also
|
10
|
+
work with ruby installations built with --program-suffix).
|
11
|
+
|
12
|
+
* Supported invoking ocra with an absolute path to the script. Will
|
13
|
+
assume that the script is in the root of the source hierachy.
|
14
|
+
|
1
15
|
=== 1.1.3
|
2
16
|
|
3
17
|
* Use Win32API (provided with Ruby) instead of win32-api (gem).
|
data/README.txt
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
= ocra
|
2
2
|
|
3
|
+
* http://ocra.rubyforge.org/
|
3
4
|
* http://rubyforge.org/projects/ocra/
|
4
5
|
* http://github.com/larsch/ocra/
|
5
6
|
|
@@ -15,8 +16,7 @@ any additionally needed ruby libraries or DLL.
|
|
15
16
|
* LZMA Compression (optional, default on)
|
16
17
|
* Windows support only
|
17
18
|
* Ruby 1.9 support
|
18
|
-
* Both console
|
19
|
-
pop up with .rbw files).
|
19
|
+
* Both windowed/console mode supported
|
20
20
|
|
21
21
|
If you experience problems with OCRA or have found a bug, please use
|
22
22
|
the tracker on the RubyForge project page
|
@@ -29,44 +29,68 @@ in the forums there aswell.
|
|
29
29
|
|
30
30
|
== SYNOPSIS:
|
31
31
|
|
32
|
-
ocra [option]
|
32
|
+
ocra [option] script.rb
|
33
|
+
|
34
|
+
* Will package "script.rb", the Ruby interpreter and all dependencies
|
35
|
+
(gems and DLLs) into an executable named "script.exe".
|
36
|
+
|
37
|
+
=== Compilation:
|
33
38
|
|
34
39
|
* OCRA will load your script (using Kernel#load) and build the
|
35
40
|
executable when it exits.
|
36
41
|
|
37
42
|
* Your program should 'require' all necessary files when invoked without
|
38
|
-
arguments, so
|
43
|
+
arguments, so OCRA can detect all dependencies.
|
44
|
+
|
45
|
+
* DLLs are detected automatically but only those located in your Ruby
|
46
|
+
installation are included.
|
47
|
+
|
48
|
+
* .rb files will become console applications. .rbw files will become
|
49
|
+
windowed application (without a console window popping
|
50
|
+
up). Alternatively, use the <tt>--console</tt> or <tt>--windows</tt>
|
51
|
+
options.
|
52
|
+
|
53
|
+
=== Running your application:
|
54
|
+
|
55
|
+
* The 'current working directory' is not changed by OCRA when running
|
56
|
+
your application. You must change to the installation or temporary
|
57
|
+
directory yourself. See also below.
|
58
|
+
|
59
|
+
* When the application is running, the OCRA_EXECUTABLE environment
|
60
|
+
variable points to the .exe (with full path).
|
39
61
|
|
40
|
-
*
|
41
|
-
|
62
|
+
* The temporary location of the script can be obtained by inspected
|
63
|
+
the $0 variable.
|
42
64
|
|
43
|
-
* OCRA does not set up the include path. Use
|
44
|
-
File.dirname(
|
45
|
-
'require' additional source files
|
46
|
-
|
65
|
+
* OCRA does not set up the include path. Use <tt>$:.unshift
|
66
|
+
File.dirname($0)</tt> at the start of your script if you need to
|
67
|
+
'require' additional source files from the same directory as your
|
68
|
+
main script.
|
47
69
|
|
48
|
-
|
49
|
-
your Ruby installation are included. Automatic detection can be
|
50
|
-
disabled using --no-autodll. DLLs can be manually added using the
|
51
|
-
--dll option.
|
70
|
+
=== Pitfalls:
|
52
71
|
|
53
|
-
*
|
54
|
-
|
72
|
+
* Avoid modifying load paths at run time. Specify load paths using -I
|
73
|
+
or RUBYLIB if you must, but don't expect OCRA to preserve them for
|
74
|
+
runtime. OCRA may pack sources into other directories than you
|
75
|
+
expect.
|
76
|
+
|
77
|
+
* If you use .rbw files or the <tt>--windows</tt> option, then check
|
78
|
+
that your application works with rubyw.exe before trying with OCRA.
|
79
|
+
|
80
|
+
* Avoid absolute paths in your code and when invoking OCRA.
|
55
81
|
|
56
|
-
* When the script is running, the OCRA_EXECUTABLE environment variable
|
57
|
-
points to the .exe (with full path).
|
58
82
|
|
59
83
|
== REQUIREMENTS:
|
60
84
|
|
61
85
|
* Windows
|
62
86
|
* Working Ruby installation
|
63
|
-
* MinGW Installation (
|
87
|
+
* MinGW Installation (when working with the source code only)
|
64
88
|
|
65
89
|
== INSTALL:
|
66
90
|
|
67
91
|
=== Gem
|
68
92
|
|
69
|
-
|
93
|
+
gem install ocra
|
70
94
|
|
71
95
|
Can also be downloaded from http://rubyforge.org/frs/?group_id=8185
|
72
96
|
|
@@ -77,10 +101,20 @@ nothing but a working Ruby installation on Windows.
|
|
77
101
|
|
78
102
|
== TECHNICAL DETAILS
|
79
103
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
104
|
+
OCRA first runs the target script in order to detect any files that
|
105
|
+
are loaded and used at runtime (Using Kernel#require and Kernel#load).
|
106
|
+
|
107
|
+
OCRA embeds everything needed to run a Ruby script into a single
|
108
|
+
executable file. The file contains the .exe stub which is compiled
|
109
|
+
from C-code, and a custom opcode format containing instructions to
|
110
|
+
create directories, save files, set environment variables and run
|
111
|
+
programs. The OCRA script generates this executable and the
|
112
|
+
instructions to be run when it is launched.
|
113
|
+
|
114
|
+
When executed, the OCRA stub extracts the Ruby interpreter and your
|
115
|
+
scripts into a temporary directory. The directory will contains the
|
116
|
+
same directory layout as your Ruby installlation. The source files for
|
117
|
+
your application will be put in the 'src' subdirectory.
|
84
118
|
|
85
119
|
=== Libraries
|
86
120
|
|
@@ -88,12 +122,18 @@ Rubygems will be automatically included in the OCRA executable.
|
|
88
122
|
|
89
123
|
Libraries found in non-standard path (for example, if you invoke OCRA
|
90
124
|
with "ruby -I some/path") will be placed into the site dir
|
91
|
-
(lib/ruby/site_ruby). Avoid changing
|
92
|
-
to include paths outside your source
|
125
|
+
(lib/ruby/site_ruby). Avoid changing <tt>$LOAD_PATH</tt> or
|
126
|
+
<tt>$:</tt> from your script to include paths outside your source
|
127
|
+
tree, since OCRA may place the files elsewhere when extracted into the
|
128
|
+
temporary directory.
|
93
129
|
|
94
|
-
Autoloaded libraries will be attempted loaded when
|
95
|
-
executable. Modules that doesn't exist will be ignore
|
96
|
-
will be logged).
|
130
|
+
Autoloaded libraries (Kernel#autoload) will be attempted loaded when
|
131
|
+
building the executable. Modules that doesn't exist will be ignore
|
132
|
+
(but a warning will be logged).
|
133
|
+
|
134
|
+
Conditionally loaded code will not be loaded and included in the
|
135
|
+
executable unless the code is actually run when OCRA invokes your
|
136
|
+
script.
|
97
137
|
|
98
138
|
=== Environment variables
|
99
139
|
|
@@ -107,7 +147,9 @@ on your build PC, OCRA ensures that it is also set on PC's running the
|
|
107
147
|
executables.
|
108
148
|
|
109
149
|
OCRA executables set OCRA_EXECUTABLE to the full path of the
|
110
|
-
executable,
|
150
|
+
executable, for example
|
151
|
+
|
152
|
+
ENV["OCRA_EXECUTABLE"] # => C:\Program Files\MyApp\MyApp.exe
|
111
153
|
|
112
154
|
=== Working directory
|
113
155
|
|
@@ -115,37 +157,37 @@ You should not assume that the current working directory when invoking
|
|
115
157
|
an executable built with .exe is the location of the source script. It
|
116
158
|
can be the directory where the executable is placed (when invoked
|
117
159
|
through the Windows Explorer), the users' current working directory
|
118
|
-
(when invoking from the Command Prompt), or even C
|
160
|
+
(when invoking from the Command Prompt), or even <tt>C:\\WINDOWS\\SYSTEM32</tt>
|
119
161
|
when the executable is invoked through a file association. You can
|
120
162
|
optionally change the directory yourself:
|
121
163
|
|
122
|
-
Dir.chdir File.dirname(
|
164
|
+
Dir.chdir File.dirname($0)
|
123
165
|
|
124
166
|
If you wish to maintain the user's working directory, but need to
|
125
167
|
'require' additional Ruby scripts from the source directory, you can
|
126
168
|
add the following line to your script:
|
127
169
|
|
128
|
-
$LOAD_PATH.unshift File.dirname(
|
170
|
+
$LOAD_PATH.unshift File.dirname($0)
|
129
171
|
|
130
|
-
===
|
172
|
+
=== Load path mangling
|
131
173
|
|
132
|
-
Adding paths to
|
133
|
-
relative load paths depends on the working
|
134
|
-
where the script is located (See
|
135
|
-
library files in directories below the
|
136
|
-
source script you can use this idiom:
|
174
|
+
Adding paths to <tt>$LOAD_PATH</tt> or <tt>$:</tt> at runtime is not
|
175
|
+
recommended. Adding relative load paths depends on the working
|
176
|
+
directory being the same as where the script is located (See
|
177
|
+
above). If you have additional library files in directories below the
|
178
|
+
directory containing your source script you can use this idiom:
|
137
179
|
|
138
|
-
$LOAD_PATH.unshift File.join(File.dirname(
|
180
|
+
$LOAD_PATH.unshift File.join(File.dirname($0), 'path/to/script')
|
139
181
|
|
140
182
|
=== Detecting OCRA
|
141
183
|
|
142
184
|
You can detect whether OCRA is currently building your script by
|
143
|
-
looking for the '
|
185
|
+
looking for the 'Ocra' constant. If it is defined, OCRA is currenly
|
144
186
|
building the executable from your script. For example, you can use
|
145
187
|
this to avoid opening a GUI window when compiling executables:
|
146
188
|
|
147
189
|
app = MyApp.new
|
148
|
-
if not defined?(
|
190
|
+
if not defined?(Ocra)
|
149
191
|
app.main_loop
|
150
192
|
end
|
151
193
|
|
@@ -155,7 +197,7 @@ You can add additional files to the OCRA executable (for example
|
|
155
197
|
images) by appending them to the command line. They should be placed
|
156
198
|
in the source directory with your main script (or a subdirectory).
|
157
199
|
|
158
|
-
ocra
|
200
|
+
ocra mainscript.rb someimage.jpeg docs/document.txt
|
159
201
|
|
160
202
|
This will create the following layout in the temporary directory when
|
161
203
|
your program is executed:
|
@@ -165,7 +207,37 @@ your program is executed:
|
|
165
207
|
src/docs/document.txt
|
166
208
|
|
167
209
|
Paths on the command line can include ** globs to include a hierachy
|
168
|
-
of files, for example
|
210
|
+
of files, for example
|
211
|
+
|
212
|
+
ocra script.rb assets/**/*.png
|
213
|
+
|
214
|
+
=== Window/Console
|
215
|
+
|
216
|
+
Ruby on Windows provides two executables: ruby.exe is a console mode
|
217
|
+
application and rubyw.exe is a windowed application which does not
|
218
|
+
bring up a console window when launched using the Windows Explorer.
|
219
|
+
By default, or if the <tt>--console</tt> option is used, OCRA will use
|
220
|
+
the console runtime (rubyw.exe). OCRA will automatically select the
|
221
|
+
windowed runtime when your script has the ".rbw" extension, or if you
|
222
|
+
specify the <tt>--windows</tt> command line option.
|
223
|
+
|
224
|
+
If your application works in console mode but not in windowed mode,
|
225
|
+
first check if your script works without OCRA using rubyw.exe. A
|
226
|
+
script that prints to standard output (using puts, print etc.) will
|
227
|
+
eventually cause an exception when run with rubyw.exe (when the IO
|
228
|
+
buffers run full).
|
229
|
+
|
230
|
+
You can also try wrapping your script in an exception handler that
|
231
|
+
logs any errors to a file:
|
232
|
+
|
233
|
+
begin
|
234
|
+
# your script here
|
235
|
+
rescue Exception => e
|
236
|
+
File.open("except.log") do |f|
|
237
|
+
f.puts e.inspect
|
238
|
+
f.puts e.backtrace
|
239
|
+
end
|
240
|
+
end
|
169
241
|
|
170
242
|
== CREDITS:
|
171
243
|
|
@@ -181,7 +253,7 @@ http://ruby.morphball.net/vit-ruby-ico_en.html)
|
|
181
253
|
|
182
254
|
(The MIT License)
|
183
255
|
|
184
|
-
Copyright (c) 2009 Lars Christensen
|
256
|
+
Copyright (c) 2009-2010 Lars Christensen
|
185
257
|
|
186
258
|
Permission is hereby granted, free of charge, to any person obtaining
|
187
259
|
a copy of this software and associated documentation files (the
|
data/Rakefile
CHANGED
@@ -5,6 +5,7 @@ require 'hoe'
|
|
5
5
|
|
6
6
|
Hoe.spec 'ocra' do
|
7
7
|
developer "Lars Christensen", "larsch@belunktum.dk"
|
8
|
+
self.readme_file = 'README.rdoc'
|
8
9
|
end
|
9
10
|
|
10
11
|
task :build_stub do
|
@@ -16,6 +17,10 @@ end
|
|
16
17
|
|
17
18
|
file 'share/ocra/stub.exe' => :build_stub
|
18
19
|
|
20
|
+
file 'README.txt' => 'README.rdoc' do
|
21
|
+
cp 'README.rdoc', 'README.txt'
|
22
|
+
end
|
23
|
+
|
19
24
|
task :test => :build_stub
|
20
25
|
|
21
26
|
task :standalone => [ 'bin/ocrasa.rb' ]
|
@@ -122,4 +127,9 @@ task :list_all_rubies do
|
|
122
127
|
end
|
123
128
|
end
|
124
129
|
|
130
|
+
task :release_docs => :redocs do
|
131
|
+
sh "pscp -r doc/* ocra.rubyforge.org:/var/www/gforge-projects/ocra"
|
132
|
+
end
|
133
|
+
|
134
|
+
|
125
135
|
# vim: syntax=Ruby
|
data/bin/ocra
CHANGED
@@ -10,12 +10,14 @@ module Ocra
|
|
10
10
|
OP_DECOMPRESS_LZMA = 4
|
11
11
|
OP_SETENV = 5
|
12
12
|
|
13
|
-
VERSION = "1.1.
|
13
|
+
VERSION = "1.1.4"
|
14
14
|
|
15
15
|
IGNORE_MODULES = /^enumerator.so$/
|
16
16
|
|
17
17
|
PATH_SEPARATOR = /[\/\\]/
|
18
18
|
|
19
|
+
TEMPDIR_MARKER = "\xFF"
|
20
|
+
|
19
21
|
class << self
|
20
22
|
attr_accessor :lzma_mode
|
21
23
|
attr_accessor :extra_dlls
|
@@ -240,7 +242,7 @@ EOF
|
|
240
242
|
targetpath = "src/" + fullpath[src_prefix.size+1..-1]
|
241
243
|
libs << [ fullpath, targetpath ]
|
242
244
|
if not @added_load_paths.include?(path) and not load_path.include?(path)
|
243
|
-
load_path << File.join(
|
245
|
+
load_path << File.join(TEMPDIR_MARKER, File.dirname(targetpath))
|
244
246
|
end
|
245
247
|
elsif defined?(Gem) and gemhome = Gem.path.find { |pth| subpath?(fullpath, pth) }
|
246
248
|
targetpath = File.join("gemhome", relative_path(gemhome, fullpath))
|
@@ -256,7 +258,7 @@ EOF
|
|
256
258
|
# Detect additional DLLs
|
257
259
|
dlls = Ocra.autodll ? LibraryDetector.detect_dlls : []
|
258
260
|
|
259
|
-
executable = Ocra.files[0].sub(/(\.rbw?)?$/, '.exe')
|
261
|
+
executable = File.basename(Ocra.files[0].sub(/(\.rbw?)?$/, '.exe'))
|
260
262
|
|
261
263
|
windowed = (Ocra.files[0] =~ /\.rbw$/ || Ocra.force_windows) && !Ocra.force_console
|
262
264
|
|
@@ -264,23 +266,30 @@ EOF
|
|
264
266
|
OcraBuilder.new(executable, windowed) do |sb|
|
265
267
|
# Add explicitly mentioned files
|
266
268
|
Ocra.files.each do |file|
|
269
|
+
file = File.expand_path(file)
|
270
|
+
|
271
|
+
if subpath?(file, exec_prefix)
|
272
|
+
target = relative_path(exec_prefix, file)
|
273
|
+
elsif subpath?(file, src_prefix)
|
274
|
+
target = File.join('src', relative_path(src_prefix, file))
|
275
|
+
else
|
276
|
+
target = File.join('src', File.basename(file))
|
277
|
+
end
|
278
|
+
|
279
|
+
target.tr!('/','\\')
|
280
|
+
|
267
281
|
if File.directory?(file)
|
268
|
-
sb.ensuremkdir(
|
282
|
+
sb.ensuremkdir(target)
|
269
283
|
else
|
270
|
-
if subpath?(file, exec_prefix)
|
271
|
-
target = file[exec_prefix.size+1..-1]
|
272
|
-
else
|
273
|
-
target = File.join('src', file).tr('/','\\')
|
274
|
-
end
|
275
284
|
sb.createfile(file, target)
|
276
285
|
end
|
277
286
|
end
|
278
287
|
|
279
288
|
# Add the ruby executable and DLL
|
280
289
|
if windowed
|
281
|
-
rubyexe = "rubyw.exe"
|
290
|
+
rubyexe = (RbConfig::CONFIG['rubyw_install_name'] || "rubyw") + ".exe"
|
282
291
|
else
|
283
|
-
rubyexe = "ruby.exe"
|
292
|
+
rubyexe = (RbConfig::CONFIG['ruby_install_name'] || "ruby") + ".exe"
|
284
293
|
end
|
285
294
|
sb.createfile(File.join(bindir, rubyexe), "bin\\" + rubyexe)
|
286
295
|
if libruby_so
|
@@ -323,14 +332,14 @@ EOF
|
|
323
332
|
# Set environment variable
|
324
333
|
sb.setenv('RUBYOPT', ENV['RUBYOPT'] || '')
|
325
334
|
sb.setenv('RUBYLIB', load_path.uniq.join(';'))
|
326
|
-
sb.setenv('GEM_PATH', "
|
335
|
+
sb.setenv('GEM_PATH', "#{TEMPDIR_MARKER}\\gemhome")
|
327
336
|
|
328
337
|
# Launch the script
|
329
|
-
sb.createprocess("bin\\" + rubyexe, "#{rubyexe} \"\xff\\src\\" + Ocra.files[0] + "\"")
|
338
|
+
sb.createprocess(TEMPDIR_MARKER + "\\bin\\" + rubyexe, "#{rubyexe} \"\xff\\src\\" + File.basename(Ocra.files[0]) + "\"")
|
330
339
|
|
331
340
|
puts "=== Compressing" unless Ocra.quiet or not Ocra.lzma_mode
|
332
341
|
end
|
333
|
-
puts "=== Finished
|
342
|
+
puts "=== Finished building #{executable} (#{File.size(executable)} bytes)" unless Ocra.quiet
|
334
343
|
end
|
335
344
|
|
336
345
|
module LibraryDetector
|
@@ -384,7 +393,7 @@ EOF
|
|
384
393
|
end
|
385
394
|
|
386
395
|
if Ocra.icon_filename
|
387
|
-
system
|
396
|
+
system Ocra.ediconpath, path, Ocra.icon_filename
|
388
397
|
end
|
389
398
|
|
390
399
|
opcode_offset = File.size(path)
|
@@ -420,13 +429,13 @@ EOF
|
|
420
429
|
end
|
421
430
|
end
|
422
431
|
def mkdir(path)
|
423
|
-
@paths[path] = true
|
424
|
-
puts "m #{path}" unless Ocra.quiet
|
432
|
+
@paths[path.downcase] = true
|
433
|
+
puts "m #{showtempdir path}" unless Ocra.quiet
|
425
434
|
@of << [OP_CREATE_DIRECTORY, path].pack("VZ*")
|
426
435
|
end
|
427
436
|
def ensuremkdir(tgt)
|
428
437
|
return if tgt == "."
|
429
|
-
if not @paths[tgt]
|
438
|
+
if not @paths[tgt.downcase]
|
430
439
|
ensuremkdir(File.dirname(tgt))
|
431
440
|
mkdir(tgt)
|
432
441
|
end
|
@@ -434,20 +443,25 @@ EOF
|
|
434
443
|
def createfile(src, tgt)
|
435
444
|
ensuremkdir(File.dirname(tgt))
|
436
445
|
str = File.open(src, "rb") { |file| file.read }
|
437
|
-
puts "a #{tgt}" unless Ocra.quiet
|
446
|
+
puts "a #{showtempdir tgt}" unless Ocra.quiet
|
438
447
|
@of << [OP_CREATE_FILE, tgt, str.size, str].pack("VZ*VA*")
|
439
448
|
end
|
440
449
|
def createprocess(image, cmdline)
|
441
|
-
puts "l #{image} #{cmdline}" unless Ocra.quiet
|
450
|
+
puts "l #{showtempdir image} #{showtempdir cmdline}" unless Ocra.quiet
|
442
451
|
@of << [OP_CREATE_PROCESS, image, cmdline].pack("VZ*Z*")
|
443
452
|
end
|
444
453
|
def setenv(name, value)
|
445
|
-
puts "e #{name} #{value}" unless Ocra.quiet
|
454
|
+
puts "e #{name} #{showtempdir value}" unless Ocra.quiet
|
446
455
|
@of << [OP_SETENV, name, value].pack("VZ*Z*")
|
447
456
|
end
|
448
457
|
def close
|
449
458
|
@of.close
|
450
459
|
end
|
460
|
+
|
461
|
+
def showtempdir(x)
|
462
|
+
x.gsub(TEMPDIR_MARKER, "<tempdir>")
|
463
|
+
end
|
464
|
+
|
451
465
|
end # class OcraBuilder
|
452
466
|
|
453
467
|
end # module Ocra
|
data/lib/ocra.rb
CHANGED
data/share/ocra/edicon.exe
CHANGED
Binary file
|
data/share/ocra/stub.exe
CHANGED
Binary file
|
data/share/ocra/stubw.exe
CHANGED
Binary file
|
data/test/test_ocra.rb
CHANGED
@@ -319,7 +319,7 @@ class TestOcra < Test::Unit::TestCase
|
|
319
319
|
|
320
320
|
# Test that ocra.rb accepts --version and outputs the version number.
|
321
321
|
def test_version
|
322
|
-
assert_match(/^Ocra \d+(\.\d)+$/, `ruby #{ocra} --version`)
|
322
|
+
assert_match(/^Ocra \d+(\.\d)+$/, `ruby \"#{ocra}\" --version`)
|
323
323
|
end
|
324
324
|
|
325
325
|
# Test that ocra.rb accepts --icon.
|
@@ -402,4 +402,44 @@ class TestOcra < Test::Unit::TestCase
|
|
402
402
|
end
|
403
403
|
end
|
404
404
|
end
|
405
|
+
|
406
|
+
def test_abspath
|
407
|
+
with_fixture "helloworld" do
|
408
|
+
assert system("ruby", ocra, File.expand_path("helloworld.rb"), *DefaultArgs)
|
409
|
+
assert File.exist?("helloworld.exe")
|
410
|
+
assert system("helloworld.exe")
|
411
|
+
end
|
412
|
+
end
|
413
|
+
|
414
|
+
def test_abspath_outside
|
415
|
+
with_fixture "helloworld" do
|
416
|
+
mkdir "build"
|
417
|
+
cd "build" do
|
418
|
+
assert system("ruby", ocra, File.expand_path("../helloworld.rb"), *DefaultArgs)
|
419
|
+
assert File.exist?("helloworld.exe")
|
420
|
+
assert system("helloworld.exe")
|
421
|
+
end
|
422
|
+
end
|
423
|
+
end
|
424
|
+
|
425
|
+
def test_relpath
|
426
|
+
with_fixture "helloworld" do
|
427
|
+
assert system("ruby", ocra, "./helloworld.rb", *DefaultArgs)
|
428
|
+
assert File.exist?("helloworld.exe")
|
429
|
+
assert system("helloworld.exe")
|
430
|
+
end
|
431
|
+
end
|
432
|
+
|
433
|
+
def test_relpath_outside
|
434
|
+
with_fixture "helloworld" do
|
435
|
+
mkdir "build"
|
436
|
+
cd "build" do
|
437
|
+
assert system("ruby", ocra, "../helloworld.rb", *DefaultArgs)
|
438
|
+
assert File.exist?("helloworld.exe")
|
439
|
+
assert system("helloworld.exe")
|
440
|
+
end
|
441
|
+
end
|
442
|
+
end
|
443
|
+
|
444
|
+
|
405
445
|
end
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ocra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 1
|
9
|
+
- 4
|
10
|
+
version: 1.1.4
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Lars Christensen
|
@@ -9,19 +15,41 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
18
|
+
date: 2010-08-04 00:00:00 +02:00
|
13
19
|
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
22
|
+
name: rubyforge
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 0
|
33
|
+
- 4
|
34
|
+
version: 2.0.4
|
17
35
|
type: :development
|
18
|
-
|
19
|
-
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: hoe
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
20
42
|
requirements:
|
21
43
|
- - ">="
|
22
44
|
- !ruby/object:Gem::Version
|
23
|
-
|
24
|
-
|
45
|
+
hash: 21
|
46
|
+
segments:
|
47
|
+
- 2
|
48
|
+
- 6
|
49
|
+
- 1
|
50
|
+
version: 2.6.1
|
51
|
+
type: :development
|
52
|
+
version_requirements: *id002
|
25
53
|
description: |-
|
26
54
|
OCRA (One-Click Ruby Application) builds Windows executables from Ruby
|
27
55
|
source code. The executable is a self-extracting, self-running
|
@@ -50,31 +78,37 @@ files:
|
|
50
78
|
- test/test_ocra.rb
|
51
79
|
- lib/ocra.rb
|
52
80
|
has_rdoc: true
|
53
|
-
homepage: http://rubyforge.org/
|
81
|
+
homepage: http://ocra.rubyforge.org/
|
54
82
|
licenses: []
|
55
83
|
|
56
84
|
post_install_message:
|
57
85
|
rdoc_options:
|
58
86
|
- --main
|
59
|
-
- README.
|
87
|
+
- README.rdoc
|
60
88
|
require_paths:
|
61
89
|
- lib
|
62
90
|
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
63
92
|
requirements:
|
64
93
|
- - ">="
|
65
94
|
- !ruby/object:Gem::Version
|
95
|
+
hash: 3
|
96
|
+
segments:
|
97
|
+
- 0
|
66
98
|
version: "0"
|
67
|
-
version:
|
68
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
69
101
|
requirements:
|
70
102
|
- - ">="
|
71
103
|
- !ruby/object:Gem::Version
|
104
|
+
hash: 3
|
105
|
+
segments:
|
106
|
+
- 0
|
72
107
|
version: "0"
|
73
|
-
version:
|
74
108
|
requirements: []
|
75
109
|
|
76
110
|
rubyforge_project: ocra
|
77
|
-
rubygems_version: 1.3.
|
111
|
+
rubygems_version: 1.3.7
|
78
112
|
signing_key:
|
79
113
|
specification_version: 3
|
80
114
|
summary: OCRA (One-Click Ruby Application) builds Windows executables from Ruby
|
81
115
|
source code
|