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
b241c56f
Commit
b241c56f
authored
May 19, 2014
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Specification] Remove Ruby hooks
https://github.com/CocoaPods/CocoaPods/issues/2151\#issuecomment-43493702
parent
96b9bad9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
82 deletions
+2
-82
Gemfile.lock
Gemfile.lock
+1
-1
installer.rb
lib/cocoapods/installer.rb
+0
-62
cocoapods-integration-specs
spec/cocoapods-integration-specs
+1
-1
integration.rb
spec/integration.rb
+0
-7
installer_spec.rb
spec/unit/installer_spec.rb
+0
-11
No files found.
Gemfile.lock
View file @
b241c56f
...
...
@@ -7,7 +7,7 @@ GIT
GIT
remote: https://github.com/CocoaPods/Core.git
revision:
d7ffa0b6464370ee20805c7c53ed36509ad072bb
revision:
15a071e1be2cf9ba0f56ab3fe1dc8ac14f6bd9ec
branch: master
specs:
cocoapods-core (0.32.1)
...
...
lib/cocoapods/installer.rb
View file @
b241c56f
...
...
@@ -495,42 +495,11 @@ module Pod
#
def
run_pre_install_hooks
UI
.
message
"- Running pre install hooks"
do
analysis_result
.
specifications
.
each
do
|
spec
|
executed
=
false
libraries_using_spec
(
spec
).
each
do
|
lib
|
lib_representation
=
library_rep
(
lib
)
executed
||=
run_spec_pre_install_hook
(
spec
,
lib_representation
)
end
UI
.
message
"-
#{
spec
.
name
}
"
if
executed
end
executed
=
run_podfile_pre_install_hook
UI
.
message
"- Podfile"
if
executed
end
end
# Runs the pre install hook of the given specification with the given
# library representation.
#
# @param [Specification] spec
# The spec for which the pre install hook should be run.
#
# @param [Hooks::LibraryRepresentation] lib_representation
# The library representation to be passed as an argument to the
# hook.
#
# @raise Raises an informative if the hooks raises.
#
# @return [Bool] Whether the hook was run.
#
def
run_spec_pre_install_hook
(
spec
,
lib_representation
)
spec
.
pre_install!
(
pod_rep
(
spec
.
root
.
name
),
lib_representation
)
rescue
=>
e
raise
Informative
,
"An error occurred while processing the pre-install "
\
"hook of
#{
spec
}
."
\
"
\n\n
#{
e
.
message
}
\n\n
#{
e
.
backtrace
*
"
\n
"
}
"
end
# Runs the pre install hook of the Podfile
#
# @raise Raises an informative if the hooks raises.
...
...
@@ -554,42 +523,11 @@ module Pod
#
def
run_post_install_hooks
UI
.
message
"- Running post install hooks"
do
analysis_result
.
specifications
.
each
do
|
spec
|
executed
=
false
libraries_using_spec
(
spec
).
each
do
|
lib
|
lib_representation
=
library_rep
(
lib
)
executed
||=
run_spec_post_install_hook
(
spec
,
lib_representation
)
end
UI
.
message
"-
#{
spec
.
name
}
"
if
executed
end
executed
=
run_podfile_post_install_hook
UI
.
message
"- Podfile"
if
executed
end
end
# Runs the post install hook of the given specification with the given
# library representation.
#
# @param [Specification] spec
# The spec for which the post install hook should be run.
#
# @param [Hooks::LibraryRepresentation] lib_representation
# The library representation to be passed as an argument to the
# hook.
#
# @raise Raises an informative if the hooks raises.
#
# @return [Bool] Whether the hook was run.
#
def
run_spec_post_install_hook
(
spec
,
lib_representation
)
spec
.
post_install!
(
lib_representation
)
rescue
=>
e
raise
Informative
,
"An error occurred while processing the post-install "
\
"hook of
#{
spec
}
."
\
"
\n\n
#{
e
.
message
}
\n\n
#{
e
.
backtrace
*
"
\n
"
}
"
end
# Runs the post install hook of the Podfile
#
# @raise Raises an informative if the hooks raises.
...
...
cocoapods-integration-specs
@
801c5e9b
Subproject commit
367aaee9111972a40d0569155f40cf6bb63e4634
Subproject commit
801c5e9bb1d9f2ca11ebba09013c7c8a4329d780
spec/integration.rb
View file @
b241c56f
...
...
@@ -360,13 +360,6 @@ describe "Integration" do
describe
"Runs the Podfile callbacks"
do
check
"install --no-repo-update"
,
"install_podfile_callbacks"
end
# @todo add tests for all the hooks API
#
describe
"Runs the specification callbacks"
do
check
"install --no-repo-update"
,
"install_spec_callbacks"
end
end
#--------------------------------------#
...
...
spec/unit/installer_spec.rb
View file @
b241c56f
...
...
@@ -491,9 +491,6 @@ module Pod
library_rep
=
stub
()
@installer
.
expects
(
:installer_rep
).
returns
(
installer_rep
)
@installer
.
expects
(
:pod_rep
).
with
(
'JSONKit'
).
returns
(
pod_rep
)
@installer
.
expects
(
:library_rep
).
with
(
@aggregate_target
).
returns
(
library_rep
)
@spec
.
expects
(
:pre_install!
)
@installer
.
podfile
.
expects
(
:pre_install!
).
with
(
installer_rep
)
@installer
.
send
(
:run_pre_install_hooks
)
end
...
...
@@ -503,8 +500,6 @@ module Pod
target_installer_data
=
stub
()
@installer
.
expects
(
:installer_rep
).
returns
(
installer_rep
)
@installer
.
expects
(
:library_rep
).
with
(
@aggregate_target
).
returns
(
target_installer_data
)
@spec
.
expects
(
:post_install!
)
@installer
.
podfile
.
expects
(
:post_install!
).
with
(
installer_rep
)
@installer
.
send
(
:run_post_install_hooks
)
end
...
...
@@ -520,11 +515,7 @@ module Pod
@installer
.
stubs
(
:pod_targets
).
returns
([
pod_target_ios
,
pod_target_osx
])
@installer
.
stubs
(
:installer_rep
).
returns
(
stub
())
@installer
.
stubs
(
:library_rep
).
with
(
@aggregate_target
).
returns
(
target_installer_data
).
twice
@installer
.
podfile
.
expects
(
:pre_install!
)
@spec
.
expects
(
:post_install!
).
with
(
target_installer_data
).
once
@installer
.
send
(
:run_pre_install_hooks
)
@installer
.
send
(
:run_post_install_hooks
)
end
...
...
@@ -561,9 +552,7 @@ module Pod
libs
=
@installer
.
send
(
:libraries_using_spec
,
@spec
)
libs
.
map
(
&
:name
).
should
==
[
'Pods'
]
end
end
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