Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LOCATOR = "locator_#{File.basename(Dir.getwd)}"
- puts "Run this script inside a directory with all the files you want to include."
- puts "Enter the URL for download:"
- url = gets.chomp
- files = Dir.entries(".") - [".", "..", File.basename($0), LOCATOR]
- trash = []
- files.each do |f| if f.end_with?("R.png") and f2=files.find{|ff| ff==f.chomp("R.png")+"L.png"}
- trash << f2
- f.chomp!("R.png")
- end
- end
- files.delete_if {|f| trash.include?(f)}
- files.collect! {|f| f.chomp(".png")}
- f = File.new(LOCATOR, "w")
- f.puts url
- f.puts files
- f.close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement