Class: MxxRu::Externals::Impl::CurlDownloder

Inherits:
Object
  • Object
show all
Includes:
OptionsHolder
Defined in:
lib/mxx_ru/externals.rb

Overview

module OptionsHolder

Class Method Summary collapse

Instance Method Summary collapse

Methods included from OptionsHolder

#option

Constructor Details

#initialize(options) ⇒ CurlDownloder

Returns a new instance of CurlDownloder.



134
135
136
# File 'lib/mxx_ru/externals.rb', line 134

def initialize(options)
  @options = options
end

Class Method Details

.check_presenceObject



126
127
128
# File 'lib/mxx_ru/externals.rb', line 126

def CurlDownloder.check_presence
  MxxRu::Helpers.external_tool_version_probe('curl --version', /^curl\s(\S+)\s/)
end

.downloader_idObject



130
131
132
# File 'lib/mxx_ru/externals.rb', line 130

def CurlDownloder.downloader_id
  :curl
end

Instance Method Details

#make_download_sh_args(uri, result_name) ⇒ Object



138
139
140
# File 'lib/mxx_ru/externals.rb', line 138

def make_download_sh_args(uri, result_name)
  push_options_to(['curl', '-L']).push('-o', result_name, uri)
end