end
end
+cfg = Configuration.new()
+
# Warn about nonsensical options.
-if options[:continue] and not Configuration::DOWNLOAD_METHOD == :wget
- log.warn('The --continue flag does nothing unless DOWNLOAD_METHOD is :wget.')
+if options[:continue] and not cfg.download_method == 'wget'
+ log.warn("The --continue flag does nothing unless download_method is wget.")
end
# Note that GetoptLong steals its arguments from ARGV, so we don't need
Kernel.exit(ExitCodes::EXIT_NO_URL)
end
+
# Factory method.
site = Website.create(ARGV[0])
# The Downloader class is a factory; it should decide
# which subclass we get.
-downloader = Downloader.create(Configuration::DOWNLOAD_METHOD)
+puts "download_method: #{cfg.download_method}"
+downloader = Downloader.create(cfg.download_method)
# Attempt to download the file, and rescue and report
# any (predictable) exceptions. The wget downloader will