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
141b8c18
Commit
141b8c18
authored
Dec 29, 2015
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[HooksManager] Remove deprecated support for not specifying a plugin_name
parent
b0d51847
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
hooks_manager.rb
lib/cocoapods/hooks_manager.rb
+3
-11
No files found.
lib/cocoapods/hooks_manager.rb
View file @
141b8c18
...
@@ -44,11 +44,9 @@ module Pod
...
@@ -44,11 +44,9 @@ module Pod
#
#
def
initialize
(
name
,
plugin_name
,
block
)
def
initialize
(
name
,
plugin_name
,
block
)
raise
ArgumentError
,
'Missing name'
unless
name
raise
ArgumentError
,
'Missing name'
unless
name
raise
ArgumentError
,
'Missing plugin_name'
unless
name
raise
ArgumentError
,
'Missing block'
unless
block
raise
ArgumentError
,
'Missing block'
unless
block
UI
.
warn
'[Hooks] The use of hooks without specifying a `plugin_name` '
\
"has been deprecated (from file `
#{
block
.
binding
.
eval
(
'File.expand_path __FILE__'
)
}
`)."
unless
plugin_name
@name
=
name
@name
=
name
@plugin_name
=
plugin_name
@plugin_name
=
plugin_name
@block
=
block
@block
=
block
...
@@ -72,13 +70,7 @@ module Pod
...
@@ -72,13 +70,7 @@ module Pod
# @param [Proc] block
# @param [Proc] block
# The block.
# The block.
#
#
def
register
(
plugin_name
,
hook_name
=
nil
,
&
block
)
def
register
(
plugin_name
,
hook_name
,
&
block
)
# TODO: Backwards compatibility with nameless plugins from CP 0.34
if
hook_name
.
nil?
hook_name
=
plugin_name
plugin_name
=
nil
end
@registrations
||=
{}
@registrations
||=
{}
@registrations
[
hook_name
]
||=
[]
@registrations
[
hook_name
]
||=
[]
@registrations
[
hook_name
]
<<
Hook
.
new
(
hook_name
,
plugin_name
,
block
)
@registrations
[
hook_name
]
<<
Hook
.
new
(
hook_name
,
plugin_name
,
block
)
...
@@ -108,7 +100,7 @@ module Pod
...
@@ -108,7 +100,7 @@ module Pod
UI
.
message
"- Running
#{
name
.
to_s
.
tr
(
'_'
,
' '
)
}
hooks"
do
UI
.
message
"- Running
#{
name
.
to_s
.
tr
(
'_'
,
' '
)
}
hooks"
do
hooks
.
each
do
|
hook
|
hooks
.
each
do
|
hook
|
next
if
whitelisted_plugins
&&
!
whitelisted_plugins
.
key?
(
hook
.
plugin_name
)
next
if
whitelisted_plugins
&&
!
whitelisted_plugins
.
key?
(
hook
.
plugin_name
)
UI
.
message
"-
#{
hook
.
plugin_name
||
'unknown plugin'
}
from "
\
UI
.
message
"-
#{
hook
.
plugin_name
}
from "
\
"`
#{
hook
.
block
.
source_location
.
first
}
`"
do
"`
#{
hook
.
block
.
source_location
.
first
}
`"
do
block
=
hook
.
block
block
=
hook
.
block
if
block
.
arity
>
1
if
block
.
arity
>
1
...
...
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