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
df2c0c65
Commit
df2c0c65
authored
Oct 02, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2501 from CocoaPods/feature/outdated
[Outdated] Refine pod outdated to show what pod update would do
parents
a80e75dd
09f86af3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
CHANGELOG.md
CHANGELOG.md
+7
-0
outdated.rb
lib/cocoapods/command/outdated.rb
+20
-4
outdated_spec.rb
spec/functional/command/outdated_spec.rb
+4
-0
No files found.
CHANGELOG.md
View file @
df2c0c65
...
...
@@ -4,6 +4,13 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
## Master
##### Enhancements
*
Make the output of
`pod outdated`
show what running
`pod update`
will do.
Takes into account the sources specified in the
`Podfile`
.
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#2470
](
https://github.com/CocoaPods/CocoaPods/issues/2470
)
##### Bug Fixes
*
Improved sanitizing of configuration names to avoid generating invalid
...
...
lib/cocoapods/command/outdated.rb
View file @
df2c0c65
...
...
@@ -27,8 +27,9 @@ module Pod
UI
.
puts
'No updates are available.'
.
yellow
else
UI
.
section
'The following updates are available:'
do
updates
.
each
do
|
(
name
,
from_version
,
to_version
)
|
UI
.
puts
"-
#{
name
}
#{
from_version
}
->
#{
to_version
}
"
updates
.
each
do
|
(
name
,
from_version
,
matching_version
,
to_version
)
|
UI
.
puts
"-
#{
name
}
#{
from_version
}
->
#{
matching_version
}
"
\
"(latest version
#{
to_version
}
)"
end
end
end
...
...
@@ -64,7 +65,10 @@ module Pod
pod_name
=
spec
.
root
.
name
lockfile_version
=
lockfile
.
version
(
pod_name
)
if
source_version
>
lockfile_version
[
pod_name
,
lockfile_version
,
source_version
]
matching_spec
=
unlocked_pods
.
find
{
|
s
|
s
.
name
==
pod_name
}
matching_version
=
matching_spec
?
matching_spec
.
version
:
"(unused)"
[
pod_name
,
lockfile_version
,
matching_version
,
source_version
]
else
nil
end
...
...
@@ -72,6 +76,18 @@ module Pod
end
end
def
unlocked_pods
@unlocked_pods
||=
begin
pods
=
[]
UI
.
titled_section
(
'Analyzing dependencies'
)
do
pods
=
Installer
::
Analyzer
.
new
(
config
.
sandbox
,
config
.
podfile
).
analyze
(
false
).
specs_by_target
.
values
.
flatten
.
uniq
end
pods
end
end
def
deprecated_pods
@deprecated_pods
||=
begin
spec_sets
.
map
(
&
:specification
).
select
do
|
spec
|
...
...
@@ -82,7 +98,7 @@ module Pod
def
spec_sets
@spec_sets
||=
begin
aggregate
=
Source
::
Aggregate
.
new
(
analyzer
.
sources
.
map
(
&
:name
)
)
aggregate
=
Source
::
Aggregate
.
new
(
analyzer
.
sources
)
installed_pods
.
map
do
|
pod_name
|
aggregate
.
search
(
Dependency
.
new
(
pod_name
))
end
.
compact
.
uniq
...
...
spec/functional/command/outdated_spec.rb
View file @
df2c0c65
...
...
@@ -4,6 +4,10 @@ module Pod
describe
Command
::
Outdated
do
extend
SpecHelper
::
TemporaryRepos
before
do
Command
::
Outdated
.
any_instance
.
stubs
(
:unlocked_pods
).
returns
([])
end
it
'tells the user that no Podfile was found in the project dir'
do
exception
=
lambda
{
run_command
(
'outdated'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the project directory."
...
...
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