Class: LgPodPlugin::HTTPDownloader

Inherits:
Object
  • Object
show all
Defined in:
lib/lg_pod_plugin/git/http_download.rb

Instance Method Summary collapse

Constructor Details

#initialize(checkout_options = {}) ⇒ HTTPDownloader

Returns a new instance of HTTPDownloader.



15
16
17
18
19
20
21
# File 'lib/lg_pod_plugin/git/http_download.rb', line 15

def initialize(checkout_options = {})
  self.name = checkout_options[:name]
  self.path = checkout_options[:path]
  self.http = checkout_options[:http]
  self.lg_spec = checkout_options[:spec]
  @checkout_options = checkout_options
end

Instance Method Details

#downloadObject



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/lg_pod_plugin/git/http_download.rb', line 23

def download
  download_params = Hash.new
  new_filename = self.http.split("/").last ||= "lg_temp_pod.tar"
  download_params["path"] = self.path.to_path
  download_params["name"] = self.name
  download_params["type"] = "http"
  download_params["download_urls"] = [{ "filename" => (new_filename ? new_filename : filename), "url" => http }]
  if self.lg_spec
    download_params["podspec"] = self.lg_spec
    download_params["source_files"] = self.lg_spec.source_files.keys
  end
  download_params
end