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
28e3ec47
Commit
28e3ec47
authored
Sep 18, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #522 from btaylor/master
Support extracting .tar.bz2 files
parents
5fdc01c1
85a9df78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
http.rb
lib/cocoapods/downloader/http.rb
+6
-0
http_spec.rb
spec/unit/http_spec.rb
+13
-0
No files found.
lib/cocoapods/downloader/http.rb
View file @
28e3ec47
...
@@ -33,6 +33,8 @@ module Pod
...
@@ -33,6 +33,8 @@ module Pod
:tgz
:tgz
elsif
url
=~
/.tar$/
elsif
url
=~
/.tar$/
:tar
:tar
elsif
url
=~
/.(tbz|tar\.bz2)$/
:tbz
else
else
nil
nil
end
end
...
@@ -46,6 +48,8 @@ module Pod
...
@@ -46,6 +48,8 @@ module Pod
"file.tgz"
"file.tgz"
when
:tar
when
:tar
"file.tar"
"file.tar"
when
:tbz
"file.tbz"
else
else
raise
UnsupportedFileTypeError
.
new
"Unsupported file type:
#{
type
}
"
raise
UnsupportedFileTypeError
.
new
"Unsupported file type:
#{
type
}
"
end
end
...
@@ -63,6 +67,8 @@ module Pod
...
@@ -63,6 +67,8 @@ module Pod
tar!
"xfz '
#{
full_filename
}
' -C '
#{
target_path
}
'"
tar!
"xfz '
#{
full_filename
}
' -C '
#{
target_path
}
'"
when
:tar
when
:tar
tar!
"xf '
#{
full_filename
}
' -C '
#{
target_path
}
'"
tar!
"xf '
#{
full_filename
}
' -C '
#{
target_path
}
'"
when
:tbz
tar!
"xfj '
#{
full_filename
}
' -C '
#{
target_path
}
'"
else
else
raise
UnsupportedFileTypeError
.
new
"Unsupported file type:
#{
type
}
"
raise
UnsupportedFileTypeError
.
new
"Unsupported file type:
#{
type
}
"
end
end
...
...
spec/unit/http_spec.rb
View file @
28e3ec47
...
@@ -32,6 +32,12 @@ describe Pod::Downloader::Http do
...
@@ -32,6 +32,12 @@ describe Pod::Downloader::Http do
downloader
.
should
.
be
.
instance_of
Pod
::
Downloader
::
Http
downloader
.
should
.
be
.
instance_of
Pod
::
Downloader
::
Http
downloader
.
type
.
should
==
:tgz
downloader
.
type
.
should
==
:tgz
downloader
=
Pod
::
Downloader
.
for_pod
(
stub_pod_with_source
(
:http
=>
'http://www.kernel.org/pub/linux/kernel/v1.0/linux-1.0.tar.bz2'
))
downloader
.
should
.
be
.
instance_of
Pod
::
Downloader
::
Http
downloader
.
type
.
should
==
:tbz
downloader
=
Pod
::
Downloader
.
for_pod
(
stub_pod_with_source
(
downloader
=
Pod
::
Downloader
.
for_pod
(
stub_pod_with_source
(
:http
=>
'https://testflightapp.com/media/sdk-downloads/TestFlightSDK1.0'
,
:http
=>
'https://testflightapp.com/media/sdk-downloads/TestFlightSDK1.0'
,
:type
=>
:zip
:type
=>
:zip
...
@@ -54,6 +60,13 @@ describe Pod::Downloader::Http do
...
@@ -54,6 +60,13 @@ describe Pod::Downloader::Http do
downloader
.
expects
(
:download_file
).
with
(
anything
())
downloader
.
expects
(
:download_file
).
with
(
anything
())
downloader
.
expects
(
:extract_with_type
).
with
(
anything
(),
:tgz
).
at_least_once
downloader
.
expects
(
:extract_with_type
).
with
(
anything
(),
:tgz
).
at_least_once
downloader
.
download
downloader
.
download
downloader
=
Pod
::
Downloader
.
for_pod
(
stub_pod_with_source
(
:http
=>
'http://www.kernel.org/pub/linux/kernel/v1.0/linux-1.0.tar.bz2'
))
downloader
.
expects
(
:download_file
).
with
(
anything
())
downloader
.
expects
(
:extract_with_type
).
with
(
anything
(),
:tbz
).
at_least_once
downloader
.
download
end
end
it
'should raise error when unsupported filetype is pass'
do
it
'should raise error when unsupported filetype is pass'
do
...
...
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