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
129cd59f
Commit
129cd59f
authored
Apr 14, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warn for deprecated specs on install
parent
72e592d4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
CHANGELOG.md
CHANGELOG.md
+4
-0
installer.rb
lib/cocoapods/installer.rb
+27
-0
installer_spec.rb
spec/unit/installer_spec.rb
+10
-0
No files found.
CHANGELOG.md
View file @
129cd59f
...
...
@@ -128,6 +128,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
*
Warn when including deprecated pods
[
Samuel E. Giddins
](
https://github.com/segiddins
)
[
#2003
](
https://github.com/CocoaPods/CocoaPods/issues/2003
)
## 0.31.1
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.31.1...0.31.0
)
•
[
CocoaPods-Core
](
https://github.com/CocoaPods/Core/compare/0.31.1...0.31.0
)
...
...
lib/cocoapods/installer.rb
View file @
129cd59f
...
...
@@ -90,6 +90,7 @@ module Pod
download_dependencies
generate_pods_project
integrate_user_project
if
config
.
integrate_targets?
perform_post_install_actions
end
def
resolve_dependencies
...
...
@@ -286,6 +287,32 @@ module Pod
end
end
# Performs any post-installation actions
#
# @return [void]
#
def
perform_post_install_actions
warn_for_deprecations
end
# Prints a warning for any pods that are deprecated
#
# @return [void]
#
def
warn_for_deprecations
deprecated_pods
=
root_specs
.
select
do
|
spec
|
spec
.
deprecated
||
spec
.
deprecated_in_favor_of
end
deprecated_pods
.
each
do
|
spec
|
if
spec
.
deprecated_in_favor_of
UI
.
warn
"
#{
spec
.
name
}
has been deprecated in "
\
"favor of
#{
spec
.
deprecated_in_favor_of
}
"
else
UI
.
warn
"
#{
spec
.
name
}
has been deprecated"
end
end
end
# Creates the Pods project from scratch if it doesn't exists.
#
# @return [void]
...
...
spec/unit/installer_spec.rb
View file @
129cd59f
...
...
@@ -52,6 +52,7 @@ module Pod
@installer
.
stubs
(
:download_dependencies
)
@installer
.
stubs
(
:generate_pods_project
)
@installer
.
stubs
(
:integrate_user_project
)
@installer
.
stubs
(
:perform_post_install_actions
)
end
it
"in runs the pre-install hooks before cleaning the Pod sources"
do
...
...
@@ -97,6 +98,15 @@ module Pod
@installer
.
install!
end
it
'prints a list of deprecated pods'
do
spec
=
Spec
.
new
spec
.
name
=
'RestKit'
spec
.
deprecated_in_favor_of
=
'AFNetworking'
@installer
.
stubs
(
:root_specs
).
returns
([
spec
])
@installer
.
send
(
:warn_for_deprecations
)
UI
.
warnings
.
should
.
include
'deprecated in favor of AFNetworking'
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