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
1a8478a2
Commit
1a8478a2
authored
May 24, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Downloader] Deprecated #clean.
parent
d10959c9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1 addition
and
93 deletions
+1
-93
dependency.rb
lib/cocoapods/dependency.rb
+0
-1
downloader.rb
lib/cocoapods/downloader.rb
+0
-4
git.rb
lib/cocoapods/downloader/git.rb
+0
-12
http.rb
lib/cocoapods/downloader/http.rb
+0
-4
mercurial.rb
lib/cocoapods/downloader/mercurial.rb
+0
-4
subversion.rb
lib/cocoapods/downloader/subversion.rb
+0
-4
downloader_spec.rb
spec/functional/downloader_spec.rb
+1
-64
No files found.
lib/cocoapods/dependency.rb
View file @
1a8478a2
...
@@ -153,7 +153,6 @@ module Pod
...
@@ -153,7 +153,6 @@ module Pod
puts
" * Pre-downloading: '
#{
name
}
'"
unless
config
.
silent?
puts
" * Pre-downloading: '
#{
name
}
'"
unless
config
.
silent?
Downloader
.
for_target
(
sandbox
.
root
+
name
,
@params
).
tap
do
|
downloader
|
Downloader
.
for_target
(
sandbox
.
root
+
name
,
@params
).
tap
do
|
downloader
|
downloader
.
download
downloader
.
download
downloader
.
clean
if
config
.
clean?
end
end
end
end
...
...
lib/cocoapods/downloader.rb
View file @
1a8478a2
...
@@ -22,10 +22,6 @@ module Pod
...
@@ -22,10 +22,6 @@ module Pod
@target_path
.
mkpath
@target_path
.
mkpath
end
end
def
clean
# implement in sub-classes
end
private
private
def
self
.
for_target
(
target_path
,
options
)
def
self
.
for_target
(
target_path
,
options
)
...
...
lib/cocoapods/downloader/git.rb
View file @
1a8478a2
...
@@ -112,10 +112,6 @@ module Pod
...
@@ -112,10 +112,6 @@ module Pod
git
"checkout -b activated-pod-commit
#{
options
[
:commit
]
}
"
git
"checkout -b activated-pod-commit
#{
options
[
:commit
]
}
"
end
end
end
end
def
clean
(
target_path
+
'.git'
).
rmtree
end
end
end
class
GitHub
<
Git
class
GitHub
<
Git
...
@@ -131,14 +127,6 @@ module Pod
...
@@ -131,14 +127,6 @@ module Pod
download_only?
?
download_and_extract_tarball
(
options
[:
commit
])
:
super
download_only?
?
download_and_extract_tarball
(
options
[:
commit
])
:
super
end
end
def
clean
if
download_only?
FileUtils
.
rm_f
(
tmp_path
)
else
super
end
end
def
tarball_url_for
(
id
)
def
tarball_url_for
(
id
)
original_url
,
username
,
reponame
=
*
(
url
.
match
(
/[:\/]([\w\-]+)\/([\w\-]+)\.git/
).
to_a
)
original_url
,
username
,
reponame
=
*
(
url
.
match
(
/[:\/]([\w\-]+)\/([\w\-]+)\.git/
).
to_a
)
"https://github.com/
#{
username
}
/
#{
reponame
}
/tarball/
#{
id
}
"
"https://github.com/
#{
username
}
/
#{
reponame
}
/tarball/
#{
id
}
"
...
...
lib/cocoapods/downloader/http.rb
View file @
1a8478a2
...
@@ -25,10 +25,6 @@ module Pod
...
@@ -25,10 +25,6 @@ module Pod
options
[
:type
]
||
type_with_url
(
url
)
options
[
:type
]
||
type_with_url
(
url
)
end
end
def
clean
FileUtils
.
rm
@download_path
end
private
private
def
type_with_url
(
url
)
def
type_with_url
(
url
)
if
url
=~
/.zip$/
if
url
=~
/.zip$/
...
...
lib/cocoapods/downloader/mercurial.rb
View file @
1a8478a2
...
@@ -18,10 +18,6 @@ module Pod
...
@@ -18,10 +18,6 @@ module Pod
def
download_revision
def
download_revision
hg
"clone '
#{
url
}
' --rev '
#{
options
[
:revision
]
}
' '
#{
target_path
}
'"
hg
"clone '
#{
url
}
' --rev '
#{
options
[
:revision
]
}
' '
#{
target_path
}
'"
end
end
def
clean
(
target_path
+
'.hg'
).
rmtree
end
end
end
end
end
end
end
...
...
lib/cocoapods/downloader/subversion.rb
View file @
1a8478a2
...
@@ -18,10 +18,6 @@ module Pod
...
@@ -18,10 +18,6 @@ module Pod
def
download_revision
def
download_revision
svn
"checkout '
#{
url
}
' -r '
#{
options
[
:revision
]
}
' '
#{
target_path
}
'"
svn
"checkout '
#{
url
}
' -r '
#{
options
[
:revision
]
}
' '
#{
target_path
}
'"
end
end
def
clean
target_path
.
glob
(
'**/.svn'
).
each
(
&
:rmtree
)
end
end
end
end
end
end
end
spec/functional/downloader_spec.rb
View file @
1a8478a2
...
@@ -27,16 +27,6 @@ describe "Pod::Downloader" do
...
@@ -27,16 +27,6 @@ describe "Pod::Downloader" do
(
@pod
.
root
+
'README'
).
read
.
strip
.
should
==
'v1.0'
(
@pod
.
root
+
'README'
).
read
.
strip
.
should
==
'v1.0'
end
end
it
"removes the .git directory when cleaning"
do
@pod
.
top_specification
.
stubs
(
:source
).
returns
(
:git
=>
fixture
(
'banana-lib'
)
)
downloader
=
Pod
::
Downloader
.
for_pod
(
@pod
)
downloader
.
download
downloader
.
clean
(
@pod
.
root
+
'.git'
).
should
.
not
.
exist
end
it
"prepares the cache if it does not exits"
do
it
"prepares the cache if it does not exits"
do
@pod
.
top_specification
.
stubs
(
:source
).
returns
(
@pod
.
top_specification
.
stubs
(
:source
).
returns
(
:git
=>
fixture
(
'banana-lib'
),
:commit
=>
'fd56054'
:git
=>
fixture
(
'banana-lib'
),
:commit
=>
'fd56054'
...
@@ -153,7 +143,7 @@ describe "Pod::Downloader" do
...
@@ -153,7 +143,7 @@ describe "Pod::Downloader" do
end
end
end
end
describe
"for G
bth
ub repositories, with :download_only set to true"
do
describe
"for G
itH
ub repositories, with :download_only set to true"
do
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryDirectory
it
"downloads HEAD with no other options specified"
do
it
"downloads HEAD with no other options specified"
do
...
@@ -191,29 +181,6 @@ describe "Pod::Downloader" do
...
@@ -191,29 +181,6 @@ describe "Pod::Downloader" do
# deliberately keep this assertion as loose as possible for now
# deliberately keep this assertion as loose as possible for now
(
@pod
.
root
+
'README.md'
).
readlines
[
0
].
should
=~
/PusherTouch/
(
@pod
.
root
+
'README.md'
).
readlines
[
0
].
should
=~
/PusherTouch/
end
end
it
'deletes the downloaded tarball after unpacking it'
do
@pod
.
top_specification
.
stubs
(
:source
).
returns
(
:git
=>
"git://github.com/lukeredpath/libPusher.git"
,
:download_only
=>
true
)
downloader
=
Pod
::
Downloader
.
for_pod
(
@pod
)
VCR
.
use_cassette
(
'tarballs'
,
:record
=>
:new_episodes
)
{
downloader
.
download
}
downloader
.
clean
(
@pod
.
root
+
'tarball.tar.gz'
).
should
.
not
.
exist
end
it
"removes the .git directory when cleaning"
do
@pod
.
top_specification
.
stubs
(
:source
).
returns
(
:git
=>
"git://github.com/lukeredpath/libPusher.git"
,
:download_only
=>
false
)
downloader
=
Pod
::
Downloader
.
for_pod
(
@pod
)
downloader
.
download
downloader
.
clean
(
@pod
.
root
+
'.git'
).
should
.
not
.
exist
end
end
end
describe
"for Mercurial"
do
describe
"for Mercurial"
do
...
@@ -225,16 +192,6 @@ describe "Pod::Downloader" do
...
@@ -225,16 +192,6 @@ describe "Pod::Downloader" do
downloader
.
download
downloader
.
download
(
@pod
.
root
+
'README'
).
read
.
strip
.
should
==
'first commit'
(
@pod
.
root
+
'README'
).
read
.
strip
.
should
==
'first commit'
end
end
it
"removes the .hg directory when cleaning"
do
@pod
.
top_specification
.
stubs
(
:source
).
returns
(
:hg
=>
fixture
(
'mercurial-repo'
)
)
downloader
=
Pod
::
Downloader
.
for_pod
(
@pod
)
downloader
.
download
downloader
.
clean
(
@pod
.
root
+
'.hg'
).
should
.
not
.
exist
end
end
end
describe
"for Subversion"
do
describe
"for Subversion"
do
...
@@ -255,16 +212,6 @@ describe "Pod::Downloader" do
...
@@ -255,16 +212,6 @@ describe "Pod::Downloader" do
downloader
.
download
downloader
.
download
(
@pod
.
root
+
'README'
).
read
.
strip
.
should
==
'tag 1'
(
@pod
.
root
+
'README'
).
read
.
strip
.
should
==
'tag 1'
end
end
it
"removes the .svn directories when cleaning"
do
@pod
.
top_specification
.
stubs
(
:source
).
returns
(
:svn
=>
"file://
#{
fixture
(
'subversion-repo'
)
}
/trunk"
)
downloader
=
Pod
::
Downloader
.
for_pod
(
@pod
)
downloader
.
download
downloader
.
clean
(
@pod
.
root
+
'.svn'
).
should
.
not
.
exist
end
end
end
describe
"for Http"
do
describe
"for Http"
do
...
@@ -280,15 +227,5 @@ describe "Pod::Downloader" do
...
@@ -280,15 +227,5 @@ describe "Pod::Downloader" do
(
@pod
.
root
+
'GoogleAdMobSearchAdsSDK/GADSearchRequest.h'
).
should
.
exist
(
@pod
.
root
+
'GoogleAdMobSearchAdsSDK/GADSearchRequest.h'
).
should
.
exist
(
@pod
.
root
+
'GoogleAdMobSearchAdsSDK/GADSearchRequest.h'
).
read
.
strip
.
should
=~
/Google Search Ads iOS SDK/
(
@pod
.
root
+
'GoogleAdMobSearchAdsSDK/GADSearchRequest.h'
).
read
.
strip
.
should
=~
/Google Search Ads iOS SDK/
end
end
it
"removes the .zip when cleaning"
do
@pod
.
top_specification
.
stubs
(
:source
).
returns
(
:http
=>
'http://dl.google.com/googleadmobadssdk/googleadmobsearchadssdkios.zip'
)
downloader
=
Pod
::
Downloader
.
for_pod
(
@pod
)
downloader
.
download
downloader
.
clean
(
@pod
.
root
+
'file.zip'
).
should
.
not
.
exist
end
end
end
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