diff -ur tar2rubyscript-0.3.1.tar.gz/tar2rubyscript/LICENSE tar2rubyscript-0.3.2.tar.gz/tar2rubyscript/LICENSE --- tar2rubyscript-0.3.1.tar.gz/tar2rubyscript/LICENSE 2003-10-10 19:40:47.000000000 +0200 +++ tar2rubyscript-0.3.2.tar.gz/tar2rubyscript/LICENSE 2003-10-10 14:06:46.000000000 +0200 @@ -0,0 +1,15 @@ +# Copyright Erik Veenstra <tar2rubyscript@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 tar2rubyscript-0.3.1.tar.gz/tar2rubyscript/README tar2rubyscript-0.3.2.tar.gz/tar2rubyscript/README --- tar2rubyscript-0.3.1.tar.gz/tar2rubyscript/README 2003-09-21 18:01:58.000000000 +0200 +++ tar2rubyscript-0.3.2.tar.gz/tar2rubyscript/README 2003-10-10 18:09:04.000000000 +0200 @@ -1,3 +1,11 @@ -Usage: ruby tar2rubyscript.rb tarrubyscript.rb application.tar application.rb [licence.txt] +Usage: ruby tar2rubyscript.rb application.tar [application.rb [licence.txt]] + or + ruby tar2rubyscript.rb application/ [application.rb [licence.txt]] + +The second variant needs the external program ´tar´ for creating the +archive internally. The first one doesn´t. + +If "application.rb" is not provided, it will be determined from +"application.tar" or "application/". For more information, see http://www.erikveen.dds.nl/tar2rubyscript/ . diff -ur tar2rubyscript-0.3.1.tar.gz/tar2rubyscript/tar2rubyscript.rb tar2rubyscript-0.3.2.tar.gz/tar2rubyscript/tar2rubyscript.rb --- tar2rubyscript-0.3.1.tar.gz/tar2rubyscript/tar2rubyscript.rb 2003-10-04 20:16:33.000000000 +0200 +++ tar2rubyscript-0.3.2.tar.gz/tar2rubyscript/tar2rubyscript.rb 2003-10-10 19:40:46.000000000 +0200 @@ -1,12 +1,14 @@ scriptfile = "tarrubyscript.rb" tarfile = ARGV.shift -outfile = ARGV.shift +rbfile = ARGV.shift licensefile = ARGV.shift -if outfile.nil? - puts "Usage: ruby tar2rubyscript.rb application.tar application.rb [license.txt]" +tarfile.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 " ruby tar2rubyscript.rb application/ [application.rb [license.txt]]" puts "" puts "The second option needs the external program ´tar´ for creating" puts "the archive internally." @@ -14,8 +16,16 @@ exit 1 end -raise "#{tarfile} doesn´t exist." if not FileTest.exist?(tarfile) -raise "#{licensefile} doesn´t exist." if (not licensefile.nil? and not FileTest.file?(licensefile)) +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 @@ -26,12 +36,10 @@ File.open(tarfile, "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} end -tardir = tarfile.gsub(/[\/\\]$/, "") - -if FileTest.directory?(tardir) +if FileTest.directory?(tarfile) orgdir = Dir.pwd - Dir.chdir(tardir) + Dir.chdir(tarfile) if FileTest.file?("tar2rubyscript.bat") puts "\".\\tar2rubyscript.bat\"" @@ -45,7 +53,7 @@ Dir.chdir("..") - IO.popen("tar ch #{tardir.sub(/.*[\/\\]/, "")}", "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} + IO.popen("tar ch #{tarfile.sub(/.*[\/\\]/, "")}", "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} Dir.chdir(orgdir) end @@ -56,7 +64,9 @@ script = "# License, not of this script, but of the application it contains:\n\n" + lic + "\n" + script end -File.open(outfile, "wb") do |f| +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" diff -ur tar2rubyscript-0.3.1.tar.gz/tar2rubyscript/tarrubyscript.rb tar2rubyscript-0.3.2.tar.gz/tar2rubyscript/tarrubyscript.rb --- tar2rubyscript-0.3.1.tar.gz/tar2rubyscript/tarrubyscript.rb 2003-10-04 20:16:33.000000000 +0200 +++ tar2rubyscript-0.3.2.tar.gz/tar2rubyscript/tarrubyscript.rb 2003-10-10 19:40:46.000000000 +0200 @@ -1,20 +1,20 @@ # License of this script, not of the application it contains: # Copyright Erik Veenstra <tar2rubyscript@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 +# Boston, MA 02111-1307 USA. # License of this script, not of the application it contains: