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
64a1b0c7
Commit
64a1b0c7
authored
Apr 18, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Installer] Call the specification hooks per each target definition
Closes #985
parent
6289a796
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
installer.rb
lib/cocoapods/installer.rb
+2
-2
installer_spec.rb
spec/unit/installer_spec.rb
+21
-0
No files found.
lib/cocoapods/installer.rb
View file @
64a1b0c7
...
@@ -389,7 +389,7 @@ module Pod
...
@@ -389,7 +389,7 @@ module Pod
executed
=
false
executed
=
false
libraries_using_spec
(
spec
).
each
do
|
lib
|
libraries_using_spec
(
spec
).
each
do
|
lib
|
lib_representation
=
library_rep
(
lib
)
lib_representation
=
library_rep
(
lib
)
executed
|
|
=
run_spec_pre_install_hook
(
spec
,
lib_representation
)
executed
|=
run_spec_pre_install_hook
(
spec
,
lib_representation
)
end
end
UI
.
message
"-
#{
spec
.
name
}
"
if
executed
UI
.
message
"-
#{
spec
.
name
}
"
if
executed
end
end
...
@@ -448,7 +448,7 @@ module Pod
...
@@ -448,7 +448,7 @@ module Pod
executed
=
false
executed
=
false
libraries_using_spec
(
spec
).
each
do
|
lib
|
libraries_using_spec
(
spec
).
each
do
|
lib
|
lib_representation
=
library_rep
(
lib
)
lib_representation
=
library_rep
(
lib
)
executed
|
|
=
run_spec_post_install_hook
(
spec
,
lib_representation
)
executed
|=
run_spec_post_install_hook
(
spec
,
lib_representation
)
end
end
UI
.
message
"-
#{
spec
.
name
}
"
if
executed
UI
.
message
"-
#{
spec
.
name
}
"
if
executed
end
end
...
...
spec/unit/installer_spec.rb
View file @
64a1b0c7
...
@@ -372,6 +372,27 @@ module Pod
...
@@ -372,6 +372,27 @@ module Pod
@installer
.
send
(
:run_pre_install_hooks
)
@installer
.
send
(
:run_pre_install_hooks
)
end
end
it
"calls the hooks in the specs for each target"
do
library_ios
=
Library
.
new
(
nil
)
library_osx
=
Library
.
new
(
nil
)
library_ios
.
platform
=
Platform
.
new
(
:ios
,
'6.0'
)
library_osx
.
platform
=
Platform
.
new
(
:osx
,
'10.8'
)
library_ios
.
specs
=
[
@spec
]
library_osx
.
specs
=
[
@spec
]
library_ios
.
stubs
(
:name
).
returns
(
'label'
)
library_osx
.
stubs
(
:name
).
returns
(
'label'
)
@installer
.
stubs
(
:libraries
).
returns
([
library_ios
,
library_osx
])
@installer
.
stubs
(
:installer_rep
).
returns
(
stub
())
@installer
.
stubs
(
:library_rep
).
returns
(
stub
())
@spec
.
expects
(
:pre_install!
).
twice
@spec
.
expects
(
:post_install!
).
twice
@installer
.
send
(
:run_pre_install_hooks
)
@installer
.
send
(
:run_post_install_hooks
)
end
it
"run_post_install_hooks"
do
it
"run_post_install_hooks"
do
installer_rep
=
stub
()
installer_rep
=
stub
()
target_installer_data
=
stub
()
target_installer_data
=
stub
()
...
...
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