diff -ur rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/eee.pas
--- rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/eee.pas 2003-11-07 23:38:31.000000000 +0100
+++ rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/eee.pas 2004-01-30 15:16:09.000000000 +0100
@@ -62,7 +62,7 @@
else begin
{$I-}
- assign(f, sr.name);
+ assign(f, sr.name);
erase(f);
if (ioresult <> 0) then begin
writeln(´Couldn´´t delete file ´ + sr.name);
@@ -97,7 +97,8 @@
assign(eeefile, paramstr(1));
reset(eeefile);
- assign(infile, paramstr(0));
+ if (paramcount > 2) then assign(infile, paramstr(3))
+ else assign(infile, paramstr(0));
reset(infile, 1);
blockread(infile, b, sizeof(b), t.length);
blockwrite(outfile, b, t.length);
@@ -120,15 +121,12 @@
assign(infile, h.tekst);
reset(infile, 1);
-
h.length := filesize(infile);
-
blockread(infile, b, sizeof(b), h.length);
+ close(infile);
blockwrite(outfile, h, sizeof(h));
blockwrite(outfile, b, h.length);
-
- close(infile);
end;
if (klasse = ´c´) then begin
@@ -207,11 +205,12 @@
// writeln(h.klasse, ´ ´, h.tekst);
if (h.klasse = ´f´) then begin
- blockread(infile, b, h.length);
-
assign(outfile, workdir + ´\´ + h.tekst);
rewrite(outfile, 1);
+
+ blockread(infile, b, h.length);
blockwrite(outfile, b, h.length);
+
close(outfile);
end;
@@ -248,7 +247,7 @@
tempdir := getenv(´TEMP´);
- me := ´Dit is mijn herkennigsstring voor het herkennen van pakin of pakuit mode.´;
+ me := ´EEE: Dit is mijn herkennigsstring voor het herkennen van pakin of pakuit mode.´;
parms := ´´;
for teller := 1 to paramcount do begin
diff -ur rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/ev/ftools.rb
--- rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/ev/ftools.rb 2004-01-30 16:38:20.000000000 +0100
+++ rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/ev/ftools.rb 2004-01-30 16:38:19.000000000 +0100
@@ -0,0 +1,21 @@
+require "ftools"
+
+class File
+ def self.rm_rf(entry)
+ if FileTest.file?(entry)
+ File.delete(entry)
+ end
+
+ if FileTest.directory?(entry)
+ pdir = Dir.pwd
+
+ Dir.chdir(entry)
+ Dir.new(".").each do |e|
+ rm_rf(e) if not [".", ".."].include?(e)
+ end
+ Dir.chdir(pdir)
+
+ Dir.rmdir(entry)
+ end
+ end
+end
diff -ur rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/init.rb
--- rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/init.rb 2003-11-07 21:57:49.000000000 +0100
+++ rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/init.rb 2004-01-30 14:49:35.000000000 +0100
@@ -1,6 +1,13 @@
require "ev/oldandnewlocation"
+require "ev/ftools"
require "rbconfig"
+module RubyScript2Exe
+
+def self.execute(command)
+ system(command.gsub(/^\.\//, "").gsub(/\//, "\\\\"))
+end
+
script = ARGV.shift
rubyw = false
@@ -15,11 +22,11 @@
arg =~ /^--rubyscript2exe-/
end
-Config::CONFIG["bindir"].gsub!(/\//, "\\")
-Config::CONFIG["LIBRUBY_SO"].gsub!(/\//, "\\")
+bindir = Config::CONFIG["bindir"]
+libruby_so = Config::CONFIG["LIBRUBY_SO"]
-olddir = oldlocation.gsub!(/\//, "\\")
-newdir = newlocation.gsub!(/\//, "\\")
+olddir = oldlocation
+newdir = newlocation
if not script.nil?
script = "#{script}.rb" if not script =~ /\.rbw?$/
@@ -29,44 +36,42 @@
oldlocation do
tar = FileTest.file?("tar.exe")
- system("copy #{newdir}\\tar.exe . > nul:") if not tar
+ File.copy("#{newdir}/tar.exe", "tar.exe") if not tar
- system("#{Config::CONFIG["bindir"]}\\ruby -r #{newdir}\\require2tar.rb #{script} #{ARGV.collect{|a| "´" + a + "´"}.join(" ")}")
+ execute("#{bindir}/ruby -r #{newdir}/require2tar.rb #{script} #{ARGV.collect{|a| "´" + a + "´"}.join(" ")}")
- system("del tar.exe > nul:") if not tar
+ File.delete("tar.exe") if not tar
end
puts "Gathering files..."
- system("copy #{Config::CONFIG["bindir"]}\\#{rubyexe} . > nul:")
- system("copy #{Config::CONFIG["bindir"]}\\#{Config::CONFIG["LIBRUBY_SO"]} . > nul:")
- system("move #{olddir}\\rubyrequired.tar . > nul:")
- system("copy #{olddir}\\#{script} app.rb > nul:")
+ File.copy("#{bindir}/#{rubyexe}", rubyexe)
+ File.copy("#{bindir}/#{libruby_so}", libruby_so)
+ File.move("#{olddir}/rubyrequired.tar", "rubyrequired.tar")
+ File.copy("#{olddir}/#{script}", "app.rb")
puts "Packing..."
- system("#{Config::CONFIG["bindir"]}\\ruby tar2rubyscript.rb rubyrequired.tar")
+ execute("#{bindir}/ruby tar2rubyscript.rb rubyrequired.tar")
+
+ puts "Creating #{app}.exe ..."
File.open("app.eee", "w") do |f|
f.puts "f #{rubyexe}"
- f.puts "f #{Config::CONFIG["LIBRUBY_SO"]}"
+ f.puts "f #{libruby_so}"
f.puts "f rubyrequired.rb"
f.puts "f app.rb"
f.puts "t #{rubyexe} rubyrequired.rb --tar2rubyscript-justextract"
- f.puts "c %tempdir%\\#{rubyexe} -I %tempdir%\\rubyrequired %tempdir%\\app.rb %parms%"
+ f.puts "c %tempdir%/#{rubyexe} -I %tempdir%/rubyrequired %tempdir%/app.rb %parms%"
end
- puts "Creating #{app}.exe..."
-
if rubyw
- system("eeew.exe app.eee #{olddir}\\#{app}.exe")
+ execute("./eee app.eee #{olddir}/#{app}.exe eeew.exe");
else
- system("eee.exe app.eee #{olddir}\\#{app}.exe")
+ execute("./eee app.eee #{olddir}/#{app}.exe eee.exe");
end
end
-# def copy ???
-# def move ???
-# def del ???
+end
diff -ur rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/require2tar.rb rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/require2tar.rb
--- rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/require2tar.rb 2003-11-08 20:06:19.000000000 +0100
+++ rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/require2tar.rb 2004-01-30 16:38:19.000000000 +0100
@@ -5,23 +5,22 @@
arg =~ /^--require2tar-/
end
-at_exit do
- include Require
+Require2TarDir = Dir.pwd
- createtar
+at_exit do
+ Dir.chdir Require2TarDir
+ Require.createtar
end
module Require
-
- def createtar
- temp = ENV["TEMP"]
- temp = "/tmp" if temp.nil?
+ def self.createtar
+ temp = (ENV["TEMP"] or "/tmp")
tmpdir = File.expand_path("rubyrequired2tar.#{Process.pid}", temp)
tardir = "rubyrequired"
tarfile = "rubyrequired.tar"
todir = File.expand_path(tardir, tmpdir)
- mkdirs("#{todir}/")
+ File.makedirs(tmpdir)
$".delete_if{|req| not req =~ /^ev\//} if JustEV
@@ -39,18 +38,19 @@
#puts "Found #{fromfile} ."
- copy(fromfile, tofile)
+ File.makedirs(File.dirname(tofile))
+ File.copy(fromfile, tofile)
end
end
end
if not found
- puts "Can´t find #{req} ."
+ puts "Can´t find #{req} ." if not req =~ /^ev\//
end
end
if not JustCopy
- copy("tar.exe", File.expand_path("tar.exe", tmpdir)) if FileTest.file?("tar.exe")
+ File.copy("tar.exe", File.expand_path("tar.exe", tmpdir)) if FileTest.file?("tar.exe")
pdir = Dir.pwd
s = "tar chf #{File.expand_path(tarfile)} #{tardir}"
@@ -61,35 +61,12 @@
Dir.chdir(pdir)
end
- recursivedelete(tmpdir)
- end
-
- def copy(fromfile, tofile)
- mkdirs(tofile)
-
- if not FileTest.file?(tofile)
- File.open(tofile, "wb") do |f|
- f.write(File.new(fromfile, "rb").read)
- end
- end
- end
-
- def mkdirs(file)
- dir, file = file.gsub(/[\/\\]/, "/").split(/\//, 2)
-
- if not file.nil?
- dir = "#{dir}/"
-
- Dir.mkdir(dir) if not FileTest.directory?(dir)
-
- pdir = Dir.pwd
- Dir.chdir(dir)
- mkdirs(file)
- Dir.chdir(pdir)
- end
+ File.rm_rf(tmpdir)
end
+end
- def recursivedelete(entry)
+class File
+ def self.rm_rf(entry)
if FileTest.file?(entry)
File.delete(entry)
end
@@ -99,12 +76,11 @@
Dir.chdir(entry)
Dir.new(".").each do |e|
- recursivedelete(e) if not [".", ".."].include?(e)
+ rm_rf(e) if not [".", ".."].include?(e)
end
Dir.chdir(pdir)
Dir.rmdir(entry)
end
end
-
end
Binary files rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/eee.exe differ
Binary files rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/eeew.exe differ