diff -ur rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/eee.pas
--- rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/eee.pas 2003-10-19 19:55:58.000000000 +0200
+++ rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/eee.pas 2003-10-20 00:18:17.000000000 +0200
@@ -18,9 +18,9 @@
var
- tempdir : string;
- workdir : string;
- me : string;
+ tempdir : string[255];
+ workdir : string[255];
+ me : string[255];
infile : file of byte;
outfile : file of byte;
eeefile : Text;
@@ -32,16 +32,16 @@
t : tail;
teller : longint;
i : longint;
- dir : string;
- parms : string;
+ dir : string[255];
+ parms : string[255];
-procedure recursivedelete(var path: string);
+procedure recursivedelete(var path: string[255]);
var
f : file;
sr : searchrec;
- dir : string;
+ dir : string[255];
begin
diff -ur rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb
--- rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2003-10-19 01:32:37.000000000 +0200
+++ rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2003-10-20 00:34:38.000000000 +0200
@@ -1,18 +1,38 @@
def oldlocation(file="")
+ if ENV.include?("OLDDIR")
+ dir = ENV["OLDDIR"]
+ else
+ dir = "."
+ end
+
if block_given?
- res = yield
+ pdir = Dir.pwd
+
+ Dir.chdir(dir)
+ res = yield
+ Dir.chdir(pdir)
else
- res = File.expand_path(file, ".") if not file.nil?
+ res = File.expand_path(file, dir) if not file.nil?
end
res
end
def newlocation(file="")
+ if ENV.include?("NEWDIR")
+ dir = ENV["NEWDIR"]
+ else
+ dir = "."
+ end
+
if block_given?
- res = yield
+ pdir = Dir.pwd
+
+ Dir.chdir(dir)
+ res = yield
+ Dir.chdir(pdir)
else
- res = File.expand_path(file, ".") if not file.nil?
+ res = File.expand_path(file, dir) if not file.nil?
end
res
diff -ur rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/init.rb
--- rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/init.rb 2003-10-19 01:32:37.000000000 +0200
+++ rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/init.rb 2003-10-20 00:27:49.000000000 +0200
@@ -55,13 +55,6 @@
f.puts "c %tempdir%\\ruby -I %tempdir%\\rubyrequired %tempdir%\\app.rb %parms%"
end
- if FileTest.file?("c:\\gnu\\root\\bin\\win32\\fpc.exe")
- puts "Creating eee.exe..."
-
- system("c:\\gnu\\root\\bin\\win32\\fpc.exe -gl -S2 eee")
- system("copy eee.exe s:\\ > nul:")
- end
-
puts "Creating #{app}.exe..."
system("eee.exe app.eee #{olddir}\\#{app}.exe")
diff -ur rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/tar2rubyscript.rb rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/tar2rubyscript.rb
--- rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/tar2rubyscript.rb 2003-10-19 01:32:37.000000000 +0200
+++ rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/tar2rubyscript.rb 2003-10-20 00:34:39.000000000 +0200
@@ -1,86 +0,0 @@
-scriptfile = ARGV.shift
-tarfile = ARGV.shift
-rbfile = ARGV.shift
-licensefile = ARGV.shift
-
-tarfile.dup.gsub!(/[\/\\]$/, "")
-
-if tarfile.nil?
- puts "Usage: ruby tar2rubyscript.rb application.tar [application.rb [license.txt]]"
- puts " or"
- puts " ruby tar2rubyscript.rb application/ [application.rb [license.txt]]"
- puts ""
- puts "The second option needs the external program ´tar´ for creating"
- puts "the archive internally."
-
- exit 1
-end
-
-if not FileTest.exist?(tarfile)
- puts "#{tarfile} doesn´t exist."
- exit
-end
-
-if not licensefile.nil? and not FileTest.file?(licensefile)
- puts "#{licensefile} doesn´t exist."
- exit
-end
-
-script = nil
-archive = nil
-
-File.open(scriptfile) {|f| script = f.read}
-
-if FileTest.file?(tarfile)
- File.open(tarfile, "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")}
-end
-
-if FileTest.directory?(tarfile)
- orgdir = Dir.pwd
-
- Dir.chdir(tarfile)
-
- if FileTest.file?("tar2rubyscript.bat")
- puts "\".\\tar2rubyscript.bat\""
- system(".\\tar2rubyscript.bat")
- end
-
- if FileTest.file?("tar2rubyscript.sh")
- puts "\". ./tar2rubyscript.sh\""
- system("sh -c \". ./tar2rubyscript.sh\"")
- end
-
- Dir.chdir("..")
-
- begin
- tar = "tar"
- IO.popen("#{tar} ch #{tarfile.sub(/.*[\/\\]/, "")}", "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")}
- rescue
- tar = newlocation("tar.exe")
- IO.popen("#{tar} ch #{tarfile.sub(/.*[\/\\]/, "")}", "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")}
- end
-
- Dir.chdir(orgdir)
-end
-
-if not licensefile.nil?
- lic = nil ; File.open(licensefile) {|f| lic = f.readlines}
-
- lic.collect! do |line|
- line.gsub!(/[\r\n]/, "")
- line = "# #{line}" unless line =~ /^[ \t]*#/
- line
- end
-
- script = "# License, not of this script, but of the application it contains:\n#\n" + lic.join("\n") + "\n\n" + script
-end
-
-rbfile = tarfile.gsub(/\.tar$/, "") + ".rb" if (rbfile.nil? or File.basename(rbfile) == "-")
-
-File.open(rbfile, "wb") do |f|
- f.write script
- f.write "\n"
- f.write "\n"
- f.write archive
- f.write "\n"
-end
diff -ur rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/tarrubyscript.rb rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/tarrubyscript.rb
--- rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/tarrubyscript.rb 2003-10-19 01:32:37.000000000 +0200
+++ rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/tarrubyscript.rb 2003-10-20 00:34:39.000000000 +0200
@@ -1,305 +0,0 @@
-# Tar2RubyScript constants
-
-JustExtract = ARGV.include?("--tar2rubyscript-justextract")
-
-ARGV.concat []
-
-ARGV.delete_if do |arg|
- arg =~ /^--tar2rubyscript-/
-end
-
-# Tar constants
-
-BLOCKSIZE = 512
-
-NAMELEN = 100
-MODELEN = 8
-UIDLEN = 8
-GIDLEN = 8
-CHKSUMLEN = 8
-SIZELEN = 12
-MAGICLEN = 8
-MODTIMELEN = 12
-UNAMELEN = 32
-GNAMELEN = 32
-DEVLEN = 8
-TMAGIC = ´ustar´
-GNU_TMAGIC = ´ustar ´
-
-LF_OLDFILE = ´\0´
-LF_FILE = ´0´
-LF_LINK = ´1´
-LF_SYMLINK = ´2´
-LF_CHAR = ´3´
-LF_BLOCK = ´4´
-LF_DIR = ´5´
-LF_FIFO = ´6´
-LF_CONTIG = ´7´
-
-class Reader
- def initialize(filehandle)
- @fp = filehandle
- end
-
- def extract
- each do |entry|
- entry.extract
- end
- end
-
- def each
- @fp.rewind
-
- while entry = next_entry
- yield(entry)
- end
- end
-
- def next_entry
- buf = @fp.read(BLOCKSIZE)
-
- if buf.length < BLOCKSIZE or buf == "\000" * BLOCKSIZE
- entry = nil
- else
- entry = Entry.new(buf, @fp)
- end
-
- entry
- end
-end
-
-class Entry
- attr_reader(:header, :data)
-
- def initialize(header, fp)
- @header = Header.new(header)
-
- if @header.file?
- padding = (BLOCKSIZE - (@header.size % BLOCKSIZE)) % BLOCKSIZE
-
- @data = fp.read(@header.size) if @header.size > 0
- dummy = fp.read(padding) if padding > 0
- end
- end
-
- def extract
- if not @header.name.empty?
- if @header.dir?
- begin
- Dir.mkdir(@header.name, @header.mode)
- rescue SystemCallError => e
- puts "Couldn´t create dir #{@header.name}: " + e.message
- end
- else
- if @header.file?
- begin
- File.open(@header.name, "wb") do |fp|
- fp.write(@data)
- fp.chmod(@header.mode)
- end
- rescue => e
- puts "Couldn´t create file #{@header.name}: " + e.message
- end
- else
- puts "Couldn´t handle entry #{@header.name}"
- end
- end
-
- #File.chown(@header.uid, @header.gid, @header.name)
- #File.utime(Time.now, @header.mtime, @header.name)
- end
- end
-end
-
-class Header
- attr_reader(:name, :uid, :gid, :size, :mtime, :uname, :gname, :mode)
-
- def initialize(header)
- fields = header.unpack(´A100 A8 A8 A8 A12 A12 A8 A1 A100 A8 A32 A32 A8 A8´)
- types = [´str´, ´oct´, ´oct´, ´oct´, ´oct´, ´time´, ´oct´, ´str´, ´str´, ´str´, ´str´, ´str´, ´oct´, ´oct´]
-
- begin
- converted = []
- while field = fields.shift
- type = types.shift
-
- case type
- when ´str´ then converted.push(field)
- when ´oct´ then converted.push(field.oct)
- when ´time´ then converted.push(Time::at(field.oct))
- end
- end
-
- @name, @mode, @uid, @gid, @size, @mtime, @chksum, @linkflag, @linkname, @magic, @uname, @gname, @devmajor, @devminor = converted
-
- @name.gsub!(/^\.\//, "")
-
- @raw = header
- rescue ArgumentError => e
- raise "Couldn´t determine a real value for a field (#{field})"
- end
-
- raise "Magic header value ´#{@magic}´ is invalid." if @magic != TMAGIC and @magic != GNU_TMAGIC
-
- @linkflag = LF_FILE if @linkflag == LF_OLDFILE or @linkflag == LF_CONTIG
- @linkflag = LF_DIR if @name[-1] == ´/´ and @linkflag == LF_FILE
- @linkname = @linkname[1,-1] if @linkname[0] == ´/´
- @size = 0 if @size < 0
- @name = @linkname + ´/´ + @name if @linkname.size > 0
- end
-
- def file?
- @linkflag == LF_FILE
- end
-
- def dir?
- @linkflag == LF_DIR
- end
-end
-
-class TempSpace
- def initialize
- @archive = File.new($0, "rb").read.gsub(/\r/, "").split(/\n\n/)[-1].split("\n").collect{|s| s[2..-1]}.join("\n").unpack("m").shift
- @olddir = Dir.pwd
- temp = ENV["TEMP"]
- temp = "/tmp" if temp.nil?
- @tempdir = "#{temp}/tar2rubyscript.d.#{Process.pid}"
- @tempfile = "#{temp}/tar2rubyscript.f.#{Process.pid}"
-
- @newdir=@tempdir
- end
-
- def eval
- Dir.mkdir(@tempdir) if not FileTest.exists?(@tempdir)
-
- newlocation do
-
- # Create the temp environment.
-
- File.open(@tempfile, "wb") {|f| f.write @archive}
- File.open(@tempfile, "rb") {|f| Reader.new(f).extract}
-
- # Eventually look for a subdirectory.
-
- entries = Dir.entries(".")
- entries.delete(".")
- entries.delete("..")
-
- if entries.length == 1
- entry = entries.shift.dup
- if FileTest.directory?(entry)
- @newdir = "#{@tempdir}/#{entry}"
- end
- end
- end
-
- # Remember all File objects.
-
- @ioobjects = []
- ObjectSpace::each_object(File) do |obj|
- @ioobjects << obj
- end
-
- at_exit do
-
- # Close all File objects, opened in init.rb .
-
- ObjectSpace::each_object(File) do |obj|
- obj.close if (not obj.closed? and not @ioobjects.include?(obj))
- end
-
- # Remove the temp environment.
-
- Dir.chdir(@olddir)
-
- recursivedelete(@tempfile)
- recursivedelete(@tempdir)
- end
-
- # Execute init.rb .
-
- newlocation do
- File.open("init.rb") do |f|
- instance_eval(f.read)
- end
- end
- end
-
- def recursivedelete(entry)
- if FileTest.file?(entry)
- File.delete(entry)
- end
-
- if FileTest.directory?(entry)
- pdir = Dir.pwd
-
- Dir.chdir(entry)
- Dir.new(".").each do |e|
- recursivedelete(e) if not [".", ".."].include?(e)
- end
- Dir.chdir(pdir)
-
- Dir.rmdir(entry)
- end
- end
-
- def oldlocation(file="")
- if block_given?
- pdir = Dir.pwd
-
- Dir.chdir(@olddir)
- res = yield
- Dir.chdir(pdir)
- else
- res = File.expand_path(file, @olddir) if not file.nil?
- end
-
- res
- end
-
- def newlocation(file="")
- if block_given?
- pdir = Dir.pwd
-
- Dir.chdir(@newdir)
- res = yield
- Dir.chdir(pdir)
- else
- res = File.expand_path(file, @newdir) if not file.nil?
- end
-
- res
- end
-end
-
-class Extract
- def initialize
- @archive = File.new($0, "rb").read.gsub(/\r/, "").split(/\n\n/)[-1].split("\n").collect{|s| s[2..-1]}.join("\n").unpack("m").shift
- temp = ENV["TEMP"]
- temp = "/tmp" if temp.nil?
- @tempfile = "#{temp}/tar2rubyscript.f.#{Process.pid}"
- end
-
- def extract
- begin
-
- # Create the temp environment.
-
- File.open(@tempfile, "wb") {|f| f.write @archive}
- File.open(@tempfile, "rb") {|f| Reader.new(f).extract}
-
- ensure
-
- # Remove the temp environment.
-
- File.delete(@tempfile)
-
- end
- end
-end
-
-if JustExtract
- Extract.new.extract
-else
- TempSpace.new.eval
-end
Binary files rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/eee.exe differ