SHARE
TWEET

HW Resource Utility

KoBeWi Oct 25th, 2016 3 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. LOCATOR = "locator_#{File.basename(Dir.getwd)}"
  2.  
  3. puts "Run this script inside a directory with all the files you want to include."
  4. puts "Enter the URL for download:"
  5.  
  6. url = gets.chomp
  7.  
  8. files = Dir.entries(".") - [".", "..", File.basename($0), LOCATOR]
  9.  
  10. trash = []
  11. files.each do |f| if f.end_with?("R.png") and f2=files.find{|ff| ff==f.chomp("R.png")+"L.png"}
  12.     trash << f2
  13.     f.chomp!("R.png")
  14.   end
  15. end
  16. files.delete_if {|f| trash.include?(f)}
  17.  
  18. files.collect! {|f| f.chomp(".png")}
  19.  
  20. f = File.new(LOCATOR, "w")
  21. f.puts url
  22. f.puts files
  23.  
  24. f.close
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top