code/superant.com.rwdtinkerbackwindow/listzips.rb in rwdschedule-0.94 vs code/superant.com.rwdtinkerbackwindow/listzips.rb in rwdschedule-0.95

- old
+ new

@@ -1,16 +1,31 @@ # this code is to list the zipped applets that can be installed -def listzipfilestoinstall - if File.exist?($zipslocation) - fileList = Dir.new($zipslocation).entries.sort.delete_if { |x| ! (x =~ /zip$/) } - @zipslistresult = fileList.rwd_method("fillziptoinstallname") - end -end + def fillziptoinstallname(inffile) applet = inffile.gsub(/\.zip$/, "") @a_installapplet = applet end + - + +def listzipfilestoinstall + startlangdir = File.join($progdir, $zipslocation ) + #get a list of the files and subdirectories on the starting directory only + + + a = Array.new(Dir["#{startlangdir}/*"].entries.sort) + + #loop through and get the files names + a.each do |x| + # only zip files + if x =~ /\.zip/ + # puts "#{x}" #adds the file to the array to display on the screen + $zipsarraylocal = $zipsarraylocal | ["#{x}"] + end + + end + + @zipslistresult = $zipsarraylocal.rwd_method("fillziptoinstallname") + end \ No newline at end of file