wayback_machine_downloader 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/wayback_machine_downloader.rb +11 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f682206e0c4fa7c804c01beabfa00a61cebfda1
|
4
|
+
data.tar.gz: 553c0bc837abaec902b0f5e4a731488bda3ab4fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a357ea88233031802fc4c30816863ae1f3e17fd97fffdc3a20bc28050ea55862ce954b21ef90a2cbe0c57cff783e6f8314f2ea453341a24cd3565ce176aa5596
|
7
|
+
data.tar.gz: cfad14a0f27728ba9005f90c613ddf962e3ca0deb3578d76786386dbb56c40f0c3fd2dcdf429fcdbb6571e57cd2855951128bba19d59c2b5889da61a0caf4296
|
@@ -4,7 +4,7 @@ require_relative 'wayback_machine_downloader/tidy_bytes'
|
|
4
4
|
|
5
5
|
class WaybackMachineDownloader
|
6
6
|
|
7
|
-
VERSION = "0.1.
|
7
|
+
VERSION = "0.1.17"
|
8
8
|
|
9
9
|
attr_accessor :base_url, :timestamp
|
10
10
|
|
@@ -59,7 +59,7 @@ class WaybackMachineDownloader
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def download_files
|
62
|
-
puts "
|
62
|
+
puts "Downloading #{@base_url} to #{backup_path} from Wayback Machine..."
|
63
63
|
puts
|
64
64
|
file_list_curated = get_file_list_curated
|
65
65
|
count = 0
|
@@ -109,8 +109,15 @@ class WaybackMachineDownloader
|
|
109
109
|
begin
|
110
110
|
FileUtils::mkdir_p dir_path unless File.exists? dir_path
|
111
111
|
rescue Errno::EEXIST => e
|
112
|
-
|
113
|
-
|
112
|
+
error_to_string = e.to_s
|
113
|
+
puts "# #{error_to_string}"
|
114
|
+
if error_to_string.include? "File exists @ dir_s_mkdir - "
|
115
|
+
file_already_existing = error_to_string.split("File exists @ dir_s_mkdir - ")[-1]
|
116
|
+
elsif error_to_string.include? "File exists - "
|
117
|
+
file_already_existing = error_to_string.split("File exists - ")[-1]
|
118
|
+
else
|
119
|
+
raise "Unhandled directory restructure error # #{error_to_string}"
|
120
|
+
end
|
114
121
|
file_already_existing_temporary = file_already_existing + '.temp'
|
115
122
|
file_already_existing_permanent = file_already_existing + '/index.html'
|
116
123
|
FileUtils::mv file_already_existing, file_already_existing_temporary
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wayback_machine_downloader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hartator
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry-rescue
|