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
864e0afa
Commit
864e0afa
authored
Mar 20, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get completely rid of :head version support
parent
e5afc825
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
30 deletions
+8
-30
outdated.rb
lib/cocoapods/command/outdated.rb
+1
-1
downloader.rb
lib/cocoapods/downloader.rb
+5
-18
request.rb
lib/cocoapods/downloader/request.rb
+1
-10
cache_spec.rb
spec/unit/downloader/cache_spec.rb
+1
-1
No files found.
lib/cocoapods/command/outdated.rb
View file @
864e0afa
...
@@ -8,7 +8,7 @@ module Pod
...
@@ -8,7 +8,7 @@ module Pod
self
.
description
=
<<-
DESC
self
.
description
=
<<-
DESC
Shows the outdated pods in the current Podfile.lock, but only those from
Shows the outdated pods in the current Podfile.lock, but only those from
spec repos, not those from local/external sources
or `:head` versions
.
spec repos, not those from local/external sources.
DESC
DESC
# Run the command
# Run the command
...
...
lib/cocoapods/downloader.rb
View file @
864e0afa
...
@@ -67,7 +67,7 @@ module Pod
...
@@ -67,7 +67,7 @@ module Pod
#
#
def
self
.
download_request
(
request
,
target
)
def
self
.
download_request
(
request
,
target
)
result
=
Response
.
new
result
=
Response
.
new
result
.
checkout_options
=
download_source
(
request
.
name
,
target
,
request
.
params
,
request
.
head?
)
result
.
checkout_options
=
download_source
(
target
,
request
.
params
)
result
.
location
=
target
result
.
location
=
target
if
request
.
released_pod?
if
request
.
released_pod?
...
@@ -88,35 +88,22 @@ module Pod
...
@@ -88,35 +88,22 @@ module Pod
private
private
# Downloads a pod with the given `name` and `params` to `target`.
# Downloads a pod with the given `params` to `target`.
#
# @param [String] name
#
#
# @param [Pathname] target
# @param [Pathname] target
#
#
# @param [Hash<Symbol,String>] params
# @param [Hash<Symbol,String>] params
#
#
# @param [Boolean] head
#
# @return [Hash] The checkout options required to re-download this exact
# @return [Hash] The checkout options required to re-download this exact
# same source.
# same source.
#
#
def
self
.
download_source
(
name
,
target
,
params
,
head
)
def
self
.
download_source
(
target
,
params
)
FileUtils
.
rm_rf
(
target
)
FileUtils
.
rm_rf
(
target
)
downloader
=
Downloader
.
for_target
(
target
,
params
)
downloader
=
Downloader
.
for_target
(
target
,
params
)
if
head
downloader
.
download
unless
downloader
.
head_supported?
raise
Informative
,
"The pod '
#{
name
}
' does not "
\
"support the :head option, as it uses a
#{
downloader
.
name
}
"
\
'source. Remove that option to use this pod.'
end
downloader
.
download_head
else
downloader
.
download
end
target
.
mkpath
target
.
mkpath
if
downloader
.
options_specific?
&&
!
head
if
downloader
.
options_specific?
params
params
else
else
downloader
.
checkout_options
downloader
.
checkout_options
...
...
lib/cocoapods/downloader/request.rb
View file @
864e0afa
...
@@ -23,11 +23,6 @@ module Pod
...
@@ -23,11 +23,6 @@ module Pod
#
#
attr_reader
:params
attr_reader
:params
# @return [Boolean] Whether the download request is for a head download.
#
attr_reader
:head
alias_method
:head?
,
:head
# Initialize a new instance
# Initialize a new instance
#
#
# @param [Specification,Nil] spec
# @param [Specification,Nil] spec
...
@@ -42,15 +37,11 @@ module Pod
...
@@ -42,15 +37,11 @@ module Pod
# @param [Hash<Symbol,String>,Nil] params
# @param [Hash<Symbol,String>,Nil] params
# see {#params}
# see {#params}
#
#
# @param [Boolean] head
def
initialize
(
spec:
nil
,
released:
false
,
name:
nil
,
params:
false
)
# see {#head}
#
def
initialize
(
spec:
nil
,
released:
false
,
name:
nil
,
params:
false
,
head:
false
)
@released_pod
=
released
@released_pod
=
released
@spec
=
spec
@spec
=
spec
@params
=
spec
?
(
spec
.
source
&&
spec
.
source
.
dup
)
:
params
@params
=
spec
?
(
spec
.
source
&&
spec
.
source
.
dup
)
:
params
@name
=
spec
?
spec
.
name
:
name
@name
=
spec
?
spec
.
name
:
name
@head
=
head
validate!
validate!
end
end
...
...
spec/unit/downloader/cache_spec.rb
View file @
864e0afa
...
@@ -11,7 +11,7 @@ module Pod
...
@@ -11,7 +11,7 @@ module Pod
@stub_download
=
lambda
do
|&
blk
|
@stub_download
=
lambda
do
|&
blk
|
original_download_source
=
Downloader
.
method
(
:download_source
)
original_download_source
=
Downloader
.
method
(
:download_source
)
Downloader
.
define_singleton_method
(
:download_source
)
do
|
_name
,
target
,
_params
,
_head
|
Downloader
.
define_singleton_method
(
:download_source
)
do
|
target
,
_params
|
FileUtils
.
mkdir_p
target
FileUtils
.
mkdir_p
target
Dir
.
chdir
(
target
)
do
Dir
.
chdir
(
target
)
do
result
=
blk
.
call
result
=
blk
.
call
...
...
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