Skip to content

Commit

Permalink
Merge pull request #1 from guyyosan/guyyosan-patch-1
Browse files Browse the repository at this point in the history
type from url query
  • Loading branch information
guyyosan authored Jun 2, 2020
2 parents 171340f + 15b68ab commit 09ecdc8
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/cocoapods-downloader/remote_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,29 @@ def should_flatten?

def type_with_url(url)
case URI.parse(url).path
when /\.zip$/
:zip
when /\.(tgz|tar\.gz)$/
:tgz
when /\.tar$/
:tar
when /\.(tbz|tar\.bz2)$/
:tbz
when /\.(txz|tar\.xz)$/
:txz
when /\.dmg$/
:dmg
else
type_with_url_query(url)
end
end

def type_with_url_query(url)
query = URI.parse(url).query
puts(query)
query_params = URI::decode_www_form(query).to_h
puts(query_params)
case query_params['file_path']
when /\.zip$/
:zip
when /\.(tgz|tar\.gz)$/
Expand Down

0 comments on commit 09ecdc8

Please sign in to comment.