Module: Downlow
- Defined in:
- lib/downlow.rb,
lib/downlow/fetcher.rb,
lib/downlow/extractor.rb,
lib/downlow/fetchers/git.rb,
lib/downlow/fetchers/http.rb,
lib/downlow/extractors/dir.rb,
lib/downlow/extractors/zip.rb,
lib/downlow/fetchers/local.rb,
lib/downlow/fetchers/github.rb,
lib/downlow/extractors/tar_gz.rb
Defined Under Namespace
Classes: Dir, Extractor, Fetcher, Git, Github, Http, Local, TarGz, Zip
Constant Summary
collapse
- VERSION =
'0.1.4'
Class Method Summary
collapse
Class Method Details
31
32
33
|
# File 'lib/downlow.rb', line 31
def self.(*args)
Downlow::Extractor.(*args)
end
|
.fetch(*args) ⇒ Object
27
28
29
|
# File 'lib/downlow.rb', line 27
def self.fetch(*args)
Downlow::Fetcher.fetch(*args)
end
|
.get(url, *args) ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/downlow.rb', line 6
def self.get(url, *args)
options = {}
first = args.shift
if first.is_a?(Hash)
options = first
elsif first.to_s != ''
options[:destination] = first
end
options = args.inject(options) {|o, arg| o = o.merge(arg) } if !args.empty?
fetch_options = options.dup
fetch_options.delete(:destination)
path = fetch(url, fetch_options)
final_path = (path, options)
FileUtils.rm_r(path) final_path
end
|