From 1ef8c14c4884e65bcc3a1da2223949c80ac99cac Mon Sep 17 00:00:00 2001 From: adampweb Date: Sun, 11 May 2025 10:57:36 +0200 Subject: [PATCH 1/3] Removed unused variable from `if` condition --- lib/wayback_machine_downloader.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wayback_machine_downloader.rb b/lib/wayback_machine_downloader.rb index beba6c5..b0e7a72 100644 --- a/lib/wayback_machine_downloader.rb +++ b/lib/wayback_machine_downloader.rb @@ -567,7 +567,7 @@ class WaybackMachineDownloader "#{file_url} -> #{file_path} (#{@processed_file_count + 1}/#{@total_to_download})" rescue StandardError => e msg = "Failed: #{file_url} # #{e} (#{@processed_file_count + 1}/#{@total_to_download})" - if not @all and File.exist?(file_path) and File.size(file_path) == 0 + if File.exist?(file_path) and File.size(file_path) == 0 File.delete(file_path) msg += "\n#{file_path} was empty and was removed." end From 2c789b7df67af2b68c9a62f2a4363b1e91e30988 Mon Sep 17 00:00:00 2001 From: adampweb Date: Sun, 11 May 2025 11:27:08 +0200 Subject: [PATCH 2/3] Restructure Docker Compose config --- docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index c2092b0..3ab4dd6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,10 +6,10 @@ services: image: wayback_machine_downloader:latest container_name: wayback_machine_downloader environment: - - DEVELOPMENT=${DEVELOPMENT:-production} + - ENVIRONMENT=${DEVELOPMENT:-production} - OPTIONS=${OPTIONS:-""} - TARGET_URL=${TARGET_URL} volumes: - .:/build:rw - - ./websites:/build/websites:rw - command: --directory /build/websites ${OPTIONS} ${TARGET_URL} \ No newline at end of file + - ./websites:/websites:rw + command: /build/bin/wayback_machine_downloader ${TARGET_URL} ${OPTIONS} \ No newline at end of file From 77998372cb6f4252433564afb08f132d7d7bd344 Mon Sep 17 00:00:00 2001 From: adampweb Date: Sun, 11 May 2025 20:05:00 +0200 Subject: [PATCH 3/3] Docker: If you load any component of the app before (or during) the Docker build process, it may cause failures --- wayback_machine_downloader.gemspec | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/wayback_machine_downloader.gemspec b/wayback_machine_downloader.gemspec index 29186fe..2f156ca 100644 --- a/wayback_machine_downloader.gemspec +++ b/wayback_machine_downloader.gemspec @@ -1,8 +1,6 @@ -require './lib/wayback_machine_downloader' - Gem::Specification.new do |s| s.name = "wayback_machine_downloader_straw" - s.version = WaybackMachineDownloader::VERSION + s.version = "2.3.5" s.executables << "wayback_machine_downloader" s.summary = "Download an entire website from the Wayback Machine." s.description = "Download complete websites from the Internet Archive's Wayback Machine. While the Wayback Machine (archive.org) excellently preserves web history, it lacks a built-in export functionality; this gem does just that, allowing you to download entire archived websites. (This is a significant rewrite of the original wayback_machine_downloader gem by hartator, with enhanced features and performance improvements.)" @@ -11,7 +9,7 @@ Gem::Specification.new do |s| s.files = ["lib/wayback_machine_downloader.rb", "lib/wayback_machine_downloader/tidy_bytes.rb", "lib/wayback_machine_downloader/to_regex.rb", "lib/wayback_machine_downloader/archive_api.rb"] s.homepage = "https://github.com/StrawberryMaster/wayback-machine-downloader" s.license = "MIT" - s.required_ruby_version = ">= 1.9.2" + s.required_ruby_version = ">= 3.4.3" s.add_runtime_dependency "concurrent-ruby", "~> 1.3", ">= 1.3.4" s.add_development_dependency "rake", "~> 12.2" s.add_development_dependency "minitest", "~> 5.2"