diff -ur allinoneruby-none.tar.gz/allinoneruby/LICENSE allinoneruby-0.1.tar.gz/allinoneruby/LICENSE --- allinoneruby-none.tar.gz/allinoneruby/LICENSE 2004-07-30 18:00:18.000000000 +0200 +++ allinoneruby-0.1.tar.gz/allinoneruby/LICENSE 2004-07-27 16:32:13.000000000 +0200 @@ -0,0 +1,15 @@ +# Copyright Erik Veenstra <allinoneruby@erikveen.dds.nl> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License, +# version 2, as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307 USA. diff -ur allinoneruby-none.tar.gz/allinoneruby/README allinoneruby-0.1.tar.gz/allinoneruby/README --- allinoneruby-none.tar.gz/allinoneruby/README 2004-07-30 18:00:18.000000000 +0200 +++ allinoneruby-0.1.tar.gz/allinoneruby/README 2004-07-26 23:13:29.000000000 +0200 @@ -0,0 +1,8 @@ +The best way to use AllInOneRuby is the RB, not this TAR.GZ. +The latter is just for playing with the internals. Both are +available on the site. + + Usage: ruby init.rb [-d|-w|--ruby|--rubyw] + +For more information, see +http://www.erikveen.dds.nl/allinoneruby/ . diff -ur allinoneruby-none.tar.gz/allinoneruby/ev/dependencies.rb allinoneruby-0.1.tar.gz/allinoneruby/ev/dependencies.rb --- allinoneruby-none.tar.gz/allinoneruby/ev/dependencies.rb 2004-07-30 18:00:18.000000000 +0200 +++ allinoneruby-0.1.tar.gz/allinoneruby/ev/dependencies.rb 2004-07-30 18:00:17.000000000 +0200 @@ -0,0 +1,32 @@ +def dlls(file, notthedefaults=true) + + # Only the dependencies in the same directory as the executable. + + todo = [] + res = [] + + todo << File.expand_path(file) + + while todo.length > 0 + todo2 = todo + todo = [] + + todo2.each do |file| + File.open(file, "rb") do |f| + strings = f.read.scan(/[\w\-\.]+/) # Hack ??? + strings.delete_if{|s| s !~ /\.dll$/i} + + strings.each do |lib| + lib = File.expand_path(lib, File.dirname(file)) + + if not lib.nil? and File.file?(lib) and not res.include?(lib) + todo << lib + res << lib + end + end + end + end + end + + res +end diff -ur allinoneruby-none.tar.gz/allinoneruby/ev/ftools.rb allinoneruby-0.1.tar.gz/allinoneruby/ev/ftools.rb --- allinoneruby-none.tar.gz/allinoneruby/ev/ftools.rb 2004-07-30 18:00:18.000000000 +0200 +++ allinoneruby-0.1.tar.gz/allinoneruby/ev/ftools.rb 2004-07-30 18:00:17.000000000 +0200 @@ -0,0 +1,115 @@ +require "ftools" + +class Dir + def self.mkdirrec(dir) + pdir = File.dirname(dir) + + if not pdir.empty? and not FileTest.directory?(pdir) + mkdirrec (pdir) + end + + Dir.mkdir(dir) rescue nil + end + + def self.copy(from, to) + if FileTest.file?(from) + todir = File.dirname(File.expand_path(to)) + + mkdirrec(todir) + + File.copy(from, to) + end + + if FileTest.directory?(from) + pdir = Dir.pwd + todir = File.expand_path(to) + + mkdirrec(todir) + + Dir.chdir(from) + Dir.new(".").each do |e| + copy(e, todir+"/"+e) if not [".", ".."].include?(e) + end + Dir.chdir(pdir) + end + end + + def self.move(from, to) + copy(from, to) + rm_rf(from) + end + + 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 + +class File + def self.rollbackup(file, mode=nil) + backupfile = file + ".RB.BACKUP" + controlfile = file + ".RB.CONTROL" + + File.touch(file) unless File.file?(file) + + # Rollback + + if File.file?(backupfile) and File.file?(controlfile) + $stdout.puts "Restoring #{file}..." + + File.copy(backupfile, file) # Rollback from phase 3 + end + + # Reset + + File.delete(backupfile) if File.file?(backupfile) # Reset from phase 2 or 3 + File.delete(controlfile) if File.file?(controlfile) # Reset from phase 3 or 4 + + # Backup + + File.copy(file, backupfile) # Enter phase 2 + File.touch(controlfile) # Enter phase 3 + + # The real thing + + if block_given? + if mode.nil? + yield + else + File.open(file, mode) do |f| + yield(f) + end + end + end + + # Cleanup + + File.delete(backupfile) # Enter phase 4 + File.delete(controlfile) # Enter phase 5 + + # Return, like File.open + + if block_given? + return nil + else + return File.open(file, (mode or "r")) + end + end + + def self.touch(file) + File.open(file, "a"){|f|} + end +end diff -ur allinoneruby-none.tar.gz/allinoneruby/ev/oldandnewlocation.rb allinoneruby-0.1.tar.gz/allinoneruby/ev/oldandnewlocation.rb --- allinoneruby-none.tar.gz/allinoneruby/ev/oldandnewlocation.rb 2004-07-30 18:00:18.000000000 +0200 +++ allinoneruby-0.1.tar.gz/allinoneruby/ev/oldandnewlocation.rb 2004-07-30 18:00:17.000000000 +0200 @@ -0,0 +1,44 @@ +ENV["OLDDIR"] = Dir.pwd if not ENV.include?("OLDDIR") +ENV["NEWDIR"] = Dir.pwd if not ENV.include?("NEWDIR") + +begin + oldlocation +rescue NameError + def oldlocation(file="") + dir = ENV["OLDDIR"] + res = nil + + if block_given? + pdir = Dir.pwd + + Dir.chdir(dir) + res = yield + Dir.chdir(pdir) + else + res = File.expand_path(file, dir) if not file.nil? + end + + res + end +end + +begin + newlocation +rescue NameError + def newlocation(file="") + dir = ENV["NEWDIR"] + res = nil + + if block_given? + pdir = Dir.pwd + + Dir.chdir(dir) + res = yield + Dir.chdir(pdir) + else + res = File.expand_path(file, dir) if not file.nil? + end + + res + end +end diff -ur allinoneruby-none.tar.gz/allinoneruby/init.rb allinoneruby-0.1.tar.gz/allinoneruby/init.rb --- allinoneruby-none.tar.gz/allinoneruby/init.rb 2004-07-30 18:00:18.000000000 +0200 +++ allinoneruby-0.1.tar.gz/allinoneruby/init.rb 2004-07-30 17:05:27.000000000 +0200 @@ -0,0 +1,77 @@ +require "ev/oldandnewlocation" +require "ev/dependencies" +require "ev/ftools" +require "rbconfig" + +exit if ARGV.include?("--exit") + +def backslashes(s) + s = s.gsub(/^\.\//, "").gsub(/\//, "\\\\") if windows? + s +end + +def windows? + not (target_os.downcase =~ /32/).nil? # Hack ??? +end + +def target_os + Config::CONFIG["target_os"] or "" +end + +rubyw = false +rubyw = false if (ARGV.include?("-d") or ARGV.include?("--ruby")) +rubyw = true if (ARGV.include?("-w") or ARGV.include?("--rubyw")) + +ARGV.delete_if{|s| s =~ /^-/} + +bindir1 = Config::CONFIG["bindir"] +libdir1 = Config::CONFIG["libdir"] +bindir2 = "bin/" +libdir2 = "lib/" +exefile = (ARGV.shift or "allinoneruby.exe") +rubylibdir1 = Config::CONFIG["rubylibdir"] + +raise "#{bindir2} already exists." if File.directory?(bindir2) +raise "#{libdir2} already exists." if File.directory?(libdir2) + +Dir.mkdir(bindir2) +Dir.mkdir(libdir2) + +rubyexe = "#{bindir1}/ruby.exe" +rubywexe = "#{bindir1}/rubyw.exe" + +([rubyexe, rubywexe] + dlls(rubyexe)).each do |s1| + file = File.basename(s1) + s2 = File.expand_path(file, bindir2) + + puts "Copying #{s1} ..." + File.copy(s1, s2) +end + +file = rubylibdir1[libdir1.length..-1].gsub(/^[\/\\]*/, "") +s1 = rubylibdir1 +s2 = File.expand_path(file, libdir2) + +puts "Copying #{s1}/ ..." +Dir.copy(s1, s2) + +puts "Creating #{exefile} ..." + +File.open("allinoneruby.eee", "w") do |f| + f.puts "r bin" + f.puts "r lib" + + rubyexe = "ruby.exe" + rubyexe = "rubyw.exe" if rubyw + + f.puts "c %tempdir%/#{bindir2}/#{rubyexe} %quotedparms%" +end + +eeeexe = "eee.exe" +eeeexe = "eeew.exe" if rubyw + +system(backslashes("./eee allinoneruby.eee #{exefile} #{eeeexe}")) + +oldlocation do + File.copy(newlocation(exefile), exefile) +end Binary files allinoneruby-none.tar.gz/allinoneruby/eee.exe and allinoneruby-0.1.tar.gz/allinoneruby/eee.exe differ Binary files allinoneruby-none.tar.gz/allinoneruby/eeew.exe and allinoneruby-0.1.tar.gz/allinoneruby/eeew.exe differ