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
70eaf299
Commit
70eaf299
authored
Sep 21, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Outdated] Refine pod outdated to show what pod update would do
parent
a80e75dd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
outdated.rb
lib/cocoapods/command/outdated.rb
+23
-3
outdated_spec.rb
spec/functional/command/outdated_spec.rb
+4
-0
No files found.
lib/cocoapods/command/outdated.rb
View file @
70eaf299
...
@@ -27,8 +27,9 @@ module Pod
...
@@ -27,8 +27,9 @@ module Pod
UI
.
puts
'No updates are available.'
.
yellow
UI
.
puts
'No updates are available.'
.
yellow
else
else
UI
.
section
'The following updates are available:'
do
UI
.
section
'The following updates are available:'
do
updates
.
each
do
|
(
name
,
from_version
,
to_version
)
|
updates
.
each
do
|
(
name
,
from_version
,
matching_version
,
to_version
)
|
UI
.
puts
"-
#{
name
}
#{
from_version
}
->
#{
to_version
}
"
UI
.
puts
"-
#{
name
}
#{
from_version
}
->
#{
matching_version
}
"
\
"(last version
#{
to_version
}
)"
end
end
end
end
end
end
...
@@ -64,7 +65,10 @@ module Pod
...
@@ -64,7 +65,10 @@ module Pod
pod_name
=
spec
.
root
.
name
pod_name
=
spec
.
root
.
name
lockfile_version
=
lockfile
.
version
(
pod_name
)
lockfile_version
=
lockfile
.
version
(
pod_name
)
if
source_version
>
lockfile_version
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
else
nil
nil
end
end
...
@@ -72,6 +76,22 @@ module Pod
...
@@ -72,6 +76,22 @@ module Pod
end
end
end
end
def
unlocked_pods
@unlocked_pods
||=
begin
sources
=
if
config
.
podfile
.
sources
.
empty?
SourcesManager
.
master
else
SourcesManager
.
sources
(
config
.
podfile
.
sources
)
end
Resolver
.
new
(
config
.
sandbox
,
config
.
podfile
,
[],
sources
).
resolve
.
values
.
flatten
end
end
def
deprecated_pods
def
deprecated_pods
@deprecated_pods
||=
begin
@deprecated_pods
||=
begin
spec_sets
.
map
(
&
:specification
).
select
do
|
spec
|
spec_sets
.
map
(
&
:specification
).
select
do
|
spec
|
...
...
spec/functional/command/outdated_spec.rb
View file @
70eaf299
...
@@ -4,6 +4,10 @@ module Pod
...
@@ -4,6 +4,10 @@ module Pod
describe
Command
::
Outdated
do
describe
Command
::
Outdated
do
extend
SpecHelper
::
TemporaryRepos
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
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
=
lambda
{
run_command
(
'outdated'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the project directory."
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