X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fwhatever-dl.git;a=blobdiff_plain;f=bin%2Fwhatever-dl;h=b3ed1ca5dc52a541e1654fee97babc7b1bc55498;hp=b9ea02ca79eeab9e4690db8b49792b40d78ac48d;hb=1ea5d78f268bece1396c0bfd65ce34cf1638eb7e;hpb=25d9a75fe096553aeea68ffe0ef79b7e5acc144d diff --git a/bin/whatever-dl b/bin/whatever-dl index b9ea02c..b3ed1ca 100755 --- a/bin/whatever-dl +++ b/bin/whatever-dl @@ -59,8 +59,8 @@ opts.each do |opt, arg| end # 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 @@ -73,6 +73,9 @@ if (ARGV.length < 1) then Kernel.exit(ExitCodes::EXIT_NO_URL) end + +cfg = Configuration.new() + # Factory method. site = Website.create(ARGV[0]) @@ -92,7 +95,8 @@ end # 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