Sha256: 811cf39640869925138ff81db4469db858d7b8ab102b990d59511b615a27eec7

Contents?: true

Size: 1.11 KB

Versions: 21

Compression:

Stored size: 1.11 KB

Contents

require 'uri'
require_relative 'git_download'
require_relative '../utils/l_util'
require_relative '../config/podspec'

module LgPodPlugin

  class HTTPDownloader

    private
    attr_reader :checkout_options
    public
    REQUIRED_ATTRS ||= %i[http name path lg_spec].freeze
    attr_accessor(*REQUIRED_ATTRS)
    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

    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

  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
lg_pod_plugin-1.1.7.4 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.7.3 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.6.7 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.6.6 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.6.5 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.6.4 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.6.3 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.6.2 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.6.0 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.5.9 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.5.7 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.5.6 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.5.5 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.5.4 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.5.3 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.5.2 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.5.1 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.4.4 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.4.3 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.4.2 lib/lg_pod_plugin/git/http_download.rb