From 00b40492b42cb4608cb0c790570366362ee59994 Mon Sep 17 00:00:00 2001 From: hartator Date: Tue, 9 Feb 2016 10:29:27 -0600 Subject: [PATCH] Replace special characters by encoded version on windows #21 #22 --- lib/wayback_machine_downloader.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/wayback_machine_downloader.rb b/lib/wayback_machine_downloader.rb index 98e01a4..c466c49 100644 --- a/lib/wayback_machine_downloader.rb +++ b/lib/wayback_machine_downloader.rb @@ -102,6 +102,9 @@ class WaybackMachineDownloader dir_path = backup_path + file_path_elements[0..-2].join('/') file_path = backup_path + file_path_elements[0..-1].join('/') end + if Gem.win_platform? + file_path = file_path.gsub(/[:*?<>\\|]/) {|s| '%' + s.ord.to_s(16) } + end unless File.exists? file_path begin structure_dir_path dir_path