Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
e71b2188
Commit
e71b2188
authored
Jan 13, 2013
by
Eloy Durán
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update previous patch to match code-style.
E.g. Use Pathname API.
parent
fef5dada
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
13 deletions
+10
-13
http.rb
lib/cocoapods/downloader/http.rb
+6
-7
http_spec.rb
spec/unit/http_spec.rb
+4
-6
No files found.
lib/cocoapods/downloader/http.rb
View file @
e71b2188
...
...
@@ -73,14 +73,13 @@ module Pod
else
raise
UnsupportedFileTypeError
.
new
"Unsupported file type:
#{
type
}
"
end
# If the archive only contained a folder, move its contents to the target (#727)
contents
=
Dir
[
target_path
.
to_s
+
"/*"
]
contents
.
delete
(
full_filename
.
to_s
)
if
contents
.
count
==
1
&&
File
.
directory?
(
contents
[
0
])
then
Dir
[
contents
[
0
]
+
"/*"
].
each
do
|
thing
|
FileUtils
.
move
thing
,
target_path
end
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
...
...
spec/unit/http_spec.rb
View file @
e71b2188
...
...
@@ -84,7 +84,7 @@ describe Pod::Downloader::Http do
downloader
.
download
rescue
nil
end
it
'should move unpacked contents to parent dir when archive contains only a folder (#727)'
do
downloader
=
Pod
::
Downloader
.
for_pod
(
stub_pod_with_source
(
:http
=>
'http://www.openssl.org/source/openssl-1.0.0a.tar.gz'
...
...
@@ -92,15 +92,13 @@ describe Pod::Downloader::Http do
downloader
.
download
# Archive contains one folder, which contains 49 items. The archive is 1, and the
# parent folder that we moved stuff out of is 1.
Dir
[
downloader
.
target_path
.
to_s
+
"/*"
]
.
count
.
should
==
49
+
1
+
1
Dir
.
glob
(
downloader
.
target_path
+
'*'
)
.
count
.
should
==
49
+
1
+
1
downloader
=
Pod
::
Downloader
.
for_pod
(
stub_pod_with_source
(
:http
=>
'https://testflightapp.com/media/sdk-downloads/TestFlightSDK1.0.zip'
))
downloader
.
download
# Archive contains 4 files, and the archive is 1
Dir
[
downloader
.
target_path
.
to_s
+
"/*"
].
count
.
should
==
4
+
1
Dir
.
glob
(
downloader
.
target_path
+
'*'
).
count
.
should
==
4
+
1
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment