Permalink
Browse files

Merge pull request #783 from kbok/master

Do not flatten the zip files downloaded via http
  • Loading branch information...
2 parents 0be241d + 1599c29 commit 16d018e6ee8954986f4da894586b884649b85fee @alloy alloy committed Feb 7, 2013
Showing with 10 additions and 8 deletions.
  1. +8 −6 lib/cocoapods/downloader/http.rb
  2. +2 −2 spec/functional/downloader_spec.rb
@@ -74,12 +74,14 @@ def extract_with_type(full_filename, type=:zip)
raise UnsupportedFileTypeError.new "Unsupported file type: #{type}"
end
- # If the archive only contained a folder, move its contents to the target (#727)
- contents = target_path.children
- contents.delete(full_filename)
- entry = contents.first
- if contents.count == 1 && entry.directory?
- FileUtils.move(entry.children, target_path)
+ # If the archive is a tarball and it only contained a folder, move its contents to the target (#727)
+ if [:tgz, :tar, :tbz].include? type
+ contents = target_path.children
+ contents.delete(full_filename)
+ entry = contents.first
+ if contents.count == 1 && entry.directory?
+ FileUtils.move(entry.children, target_path)
+ end
end
end
@@ -74,8 +74,8 @@ module Pod
downloader = Downloader.for_pod(@pod)
VCR.use_cassette('tarballs', :record => :new_episodes) { downloader.download }
- (@pod.root + 'GADSearchRequest.h').should.exist
- (@pod.root + 'GADSearchRequest.h').read.strip.should =~ /Google Search Ads iOS SDK/
+ (@pod.root + 'GoogleAdMobSearchAdsSDK/GADSearchRequest.h').should.exist
+ (@pod.root + 'GoogleAdMobSearchAdsSDK/GADSearchRequest.h').read.strip.should =~ /Google Search Ads iOS SDK/
end
it "raises if it fails to download" do

0 comments on commit 16d018e

Please sign in to comment.