Class | Downloader
In: | lib/facets/more/downloader.rb
Parent: | Object

# Downloader

Tool module for downloading files and extracting archive files. Currently this is console-based but in the future will have SOC for any interface.

### Methods

add_mirror add_mirrors compute_checksum download extract fetch interface interface= mirrors monitored_download new prioritize_urls

### Attributes

destination | [RW] |
region | [RW] |

### Public Class methods

new( destination, mirrors=nil, region=nil, &config )

### Public Instance methods

add_mirror( url, region=nil )
add_mirrors( mirrors )
compute_checksum( local_path )

compute_checksum

download( url, filepath, checksum='', est_size=nil )

currently can only download a single compressed file does not handle downloading an uncompressed directory tree (should it? doubt it)

currently this displays progress to STDOUT; either their should be a way to activate/deactivate or preferably use ducktype singletons (more on that later, see google://_whytheluckystiff if interested) of course I prefer chain messaging but matz said no :(

extract( local_path )

extract

fetch( file, checksum=0, est_size=0, force=false )

fetch

interface()

delegate to an interface (under development)

interface=(iface)
mirrors()
monitored_download( urls, filepath, checksum, est_size=0, force=false )

regional_urls - array of arrays of [ url, region, md5, expected_size ] local_region - region of the user‘s system to_dir - where to store downloaded file (full path) force - download even if file already exists locally

prioritize_urls( urls )

In the future we may test each connection for fastest download

[Validate]