Sha256: 9abce2eb8529bf01b58c7d5c9b9b3c8b77f037ff671ce633c211e3b63d415b15

Contents?: true

Size: 892 Bytes

Versions: 6

Compression:

Stored size: 892 Bytes

Contents

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

module LgPodPlugin

  class HTTPDownloader

    private
    attr_reader :checkout_options
    public
    REQUIRED_ATTRS ||= %i[http name path].freeze
    attr_accessor(*REQUIRED_ATTRS)
    def initialize(checkout_options = {})
      self.name = checkout_options[:name]
      self.path = checkout_options[:path]
      self.http = checkout_options[:http]
      @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["filename"] = (new_filename ? new_filename : filename)
      download_params["url"] = http
      download_params
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lg_pod_plugin-1.2.2 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.2.1 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.2.0.1 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.2.0.0 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.8.2 lib/lg_pod_plugin/git/http_download.rb
lg_pod_plugin-1.1.8.1 lib/lg_pod_plugin/git/http_download.rb