diff -ur allinoneruby-0.1.tar.gz/allinoneruby/ev/dependencies.rb allinoneruby-0.1.1.tar.gz/allinoneruby/ev/dependencies.rb --- allinoneruby-0.1.tar.gz/allinoneruby/ev/dependencies.rb 2004-07-30 18:00:17.000000000 +0200 +++ allinoneruby-0.1.1.tar.gz/allinoneruby/ev/dependencies.rb 2004-08-04 23:58:20.000000000 +0200 @@ -1,4 +1,4 @@ -def dlls(file, notthedefaults=true) +def dlls(file, path=File.dirname(file)) # Only the dependencies in the same directory as the executable. @@ -17,7 +17,7 @@ strings.delete_if{|s| s !~ /\.dll$/i} strings.each do |lib| - lib = File.expand_path(lib, File.dirname(file)) + lib = File.expand_path(lib, path) if not lib.nil? and File.file?(lib) and not res.include?(lib) todo << lib diff -ur allinoneruby-0.1.tar.gz/allinoneruby/ev/ftools.rb allinoneruby-0.1.1.tar.gz/allinoneruby/ev/ftools.rb --- allinoneruby-0.1.tar.gz/allinoneruby/ev/ftools.rb 2004-07-30 18:00:17.000000000 +0200 +++ allinoneruby-0.1.1.tar.gz/allinoneruby/ev/ftools.rb 2004-08-04 23:58:20.000000000 +0200 @@ -4,23 +4,15 @@ def self.mkdirrec(dir) pdir = File.dirname(dir) - if not pdir.empty? and not FileTest.directory?(pdir) - mkdirrec (pdir) + if not pdir.empty? and not File.directory?(pdir) + Dir.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) + if File.directory?(from) pdir = Dir.pwd todir = File.expand_path(to) @@ -28,33 +20,61 @@ Dir.chdir(from) Dir.new(".").each do |e| - copy(e, todir+"/"+e) if not [".", ".."].include?(e) + Dir.copy(e, todir+"/"+e) if not [".", ".."].include?(e) end Dir.chdir(pdir) + else + todir = File.dirname(File.expand_path(to)) + + mkdirrec(todir) + + File.copy(from, to) end end def self.move(from, to) - copy(from, to) - rm_rf(from) + Dir.copy(from, to) + Dir.rm_rf(from) end def self.rm_rf(entry) - if FileTest.file?(entry) + if File.ftype(entry) == "directory" + pdir = Dir.pwd + + Dir.chdir(entry) + Dir.new(".").each do |e| + Dir.rm_rf(e) if not [".", ".."].include?(e) + end + Dir.chdir(pdir) + + Dir.delete(entry) + else File.delete(entry) end + end + + def self.find(entry=nil, mask=nil) + entry = @dir if entry.nil? + + entry.gsub!(/[\/\\]*$/, "") unless entry.nil? + + res = [] - if FileTest.directory?(entry) + if File.directory?(entry) pdir = Dir.pwd + res += ["%s/" % entry] if mask.nil? or entry =~ mask + Dir.chdir(entry) Dir.new(".").each do |e| - rm_rf(e) if not [".", ".."].include?(e) + res += Dir.find(e, mask).collect{|e| entry+"/"+e} unless [".", ".."].include?(e) end Dir.chdir(pdir) - - Dir.rmdir(entry) + else + res += [entry] if mask.nil? or entry =~ mask end + + res end end @@ -112,4 +132,30 @@ def self.touch(file) File.open(file, "a"){|f|} end + + def self.which(file) + res = nil + + if windows? + file = file.gsub(/\.exe$/i, "") + ".exe" + sep = ";" + else + sep = ":" + end + + catch :stop do + ENV["PATH"].split(/#{sep}/).reverse.each do |d| + if File.directory?(d) + Dir.new(d).each do |e| + if e.downcase == file.downcase + res = File.expand_path(e, d) + throw :stop + end + end + end + end + end + + res + end end diff -ur allinoneruby-0.1.tar.gz/allinoneruby/ev/oldandnewlocation.rb allinoneruby-0.1.1.tar.gz/allinoneruby/ev/oldandnewlocation.rb --- allinoneruby-0.1.tar.gz/allinoneruby/ev/oldandnewlocation.rb 2004-07-30 18:00:17.000000000 +0200 +++ allinoneruby-0.1.1.tar.gz/allinoneruby/ev/oldandnewlocation.rb 2004-08-04 23:58:20.000000000 +0200 @@ -1,5 +1,5 @@ -ENV["OLDDIR"] = Dir.pwd if not ENV.include?("OLDDIR") -ENV["NEWDIR"] = Dir.pwd if not ENV.include?("NEWDIR") +ENV["OLDDIR"] = Dir.pwd unless ENV.include?("OLDDIR") +ENV["NEWDIR"] = File.dirname($0) unless ENV.include?("NEWDIR") begin oldlocation @@ -15,7 +15,7 @@ res = yield Dir.chdir(pdir) else - res = File.expand_path(file, dir) if not file.nil? + res = File.expand_path(file, dir) unless file.nil? end res @@ -36,7 +36,7 @@ res = yield Dir.chdir(pdir) else - res = File.expand_path(file, dir) if not file.nil? + res = File.expand_path(file, dir) unless file.nil? end res diff -ur allinoneruby-0.1.tar.gz/allinoneruby/init.rb allinoneruby-0.1.1.tar.gz/allinoneruby/init.rb --- allinoneruby-0.1.tar.gz/allinoneruby/init.rb 2004-07-30 17:05:27.000000000 +0200 +++ allinoneruby-0.1.1.tar.gz/allinoneruby/init.rb 2004-07-31 02:10:58.000000000 +0200 @@ -55,6 +55,14 @@ puts "Copying #{s1}/ ..." Dir.copy(s1, s2) +Dir.find(libdir2, /\.so$/).collect{|file| dlls(file, bindir1)}.flatten.sort.uniq.each do |s1| + file = File.basename(s1) + s2 = File.expand_path(file, bindir2) + + puts "Copying #{s1} ..." + File.copy(s1, s2) +end + puts "Creating #{exefile} ..." File.open("allinoneruby.eee", "w") do |f| @@ -73,5 +81,8 @@ system(backslashes("./eee allinoneruby.eee #{exefile} #{eeeexe}")) oldlocation do - File.copy(newlocation(exefile), exefile) + from = newlocation(exefile) + to = oldlocation(exefile) + + File.copy(from, to) unless from == to end Binary files allinoneruby-0.1.tar.gz/allinoneruby/eee.exe and allinoneruby-0.1.1.tar.gz/allinoneruby/eee.exe differ Binary files allinoneruby-0.1.tar.gz/allinoneruby/eeew.exe and allinoneruby-0.1.1.tar.gz/allinoneruby/eeew.exe differ