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
f6df6216
Commit
f6df6216
authored
Sep 06, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Installer] Minor clean-up
parent
d08b7f95
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
25 deletions
+18
-25
installer.rb
lib/cocoapods/installer.rb
+7
-13
installer_spec.rb
spec/unit/installer_spec.rb
+11
-12
No files found.
lib/cocoapods/installer.rb
View file @
f6df6216
...
@@ -80,14 +80,14 @@ module Pod
...
@@ -80,14 +80,14 @@ module Pod
# @return [void]
# @return [void]
#
#
def
install!
def
install!
resolv
e_dependencies
analyz
e_dependencies
download_
dependenci
es
download_
sourc
es
generate_pods_project
generate_pods_project
write_lockfiles
write_lockfiles
integrate_user_project
if
config
.
integrate_targets?
integrate_user_project
if
config
.
integrate_targets?
end
end
def
resolv
e_dependencies
def
analyz
e_dependencies
UI
.
section
"Analyzing dependencies"
do
UI
.
section
"Analyzing dependencies"
do
analyze
analyze
prepare_for_legacy_compatibility
prepare_for_legacy_compatibility
...
@@ -95,7 +95,7 @@ module Pod
...
@@ -95,7 +95,7 @@ module Pod
end
end
end
end
def
download_
dependenci
es
def
download_
sourc
es
UI
.
section
"Downloading dependencies"
do
UI
.
section
"Downloading dependencies"
do
create_file_accessors
create_file_accessors
install_pod_sources
install_pod_sources
...
@@ -193,9 +193,9 @@ module Pod
...
@@ -193,9 +193,9 @@ module Pod
pod_target
.
build_headers
.
implode!
pod_target
.
build_headers
.
implode!
end
end
unless
sandbox
_
state
.
deleted
.
empty?
unless
sandbox
.
state
.
deleted
.
empty?
title_options
=
{
:verbose_prefix
=>
"-> "
.
red
}
title_options
=
{
:verbose_prefix
=>
"-> "
.
red
}
sandbox
_
state
.
deleted
.
each
do
|
pod_name
|
sandbox
.
state
.
deleted
.
each
do
|
pod_name
|
UI
.
titled_section
(
"Removing
#{
pod_name
}
"
.
red
,
title_options
)
do
UI
.
titled_section
(
"Removing
#{
pod_name
}
"
.
red
,
title_options
)
do
sandbox
.
clean_pod
(
pod_name
)
sandbox
.
clean_pod
(
pod_name
)
end
end
...
@@ -227,7 +227,7 @@ module Pod
...
@@ -227,7 +227,7 @@ module Pod
#
#
def
install_pod_sources
def
install_pod_sources
@installed_specs
=
[]
@installed_specs
=
[]
pods_to_install
=
sandbox
_state
.
added
|
sandbox_
state
.
changed
pods_to_install
=
sandbox
.
state
.
added
|
sandbox
.
state
.
changed
title_options
=
{
:verbose_prefix
=>
"-> "
.
green
}
title_options
=
{
:verbose_prefix
=>
"-> "
.
green
}
root_specs
.
sort_by
(
&
:name
).
each
do
|
spec
|
root_specs
.
sort_by
(
&
:name
).
each
do
|
spec
|
if
pods_to_install
.
include?
(
spec
.
name
)
if
pods_to_install
.
include?
(
spec
.
name
)
...
@@ -570,12 +570,6 @@ module Pod
...
@@ -570,12 +570,6 @@ module Pod
analysis_result
.
specifications
.
map
{
|
spec
|
spec
.
root
}.
uniq
analysis_result
.
specifications
.
map
{
|
spec
|
spec
.
root
}.
uniq
end
end
# @return [SpecsState] The state of the sandbox returned by the analyzer.
#
def
sandbox_state
analysis_result
.
sandbox_state
end
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
end
end
...
...
spec/unit/installer_spec.rb
View file @
f6df6216
...
@@ -38,15 +38,15 @@ module Pod
...
@@ -38,15 +38,15 @@ module Pod
describe
"In general"
do
describe
"In general"
do
before
do
before
do
@installer
.
stubs
(
:
resolv
e_dependencies
)
@installer
.
stubs
(
:
analyz
e_dependencies
)
@installer
.
stubs
(
:download_
dependenci
es
)
@installer
.
stubs
(
:download_
sourc
es
)
@installer
.
stubs
(
:generate_pods_project
)
@installer
.
stubs
(
:generate_pods_project
)
@installer
.
stubs
(
:write_lockfiles
)
@installer
.
stubs
(
:write_lockfiles
)
@installer
.
stubs
(
:integrate_user_project
)
@installer
.
stubs
(
:integrate_user_project
)
end
end
it
"in runs the pre-install hooks before cleaning the Pod sources"
do
it
"in runs the pre-install hooks before cleaning the Pod sources"
do
@installer
.
unstub
(
:download_
dependenci
es
)
@installer
.
unstub
(
:download_
sourc
es
)
@installer
.
stubs
(
:create_file_accessors
)
@installer
.
stubs
(
:create_file_accessors
)
@installer
.
stubs
(
:install_pod_sources
)
@installer
.
stubs
(
:install_pod_sources
)
@installer
.
stubs
(
:link_headers
)
@installer
.
stubs
(
:link_headers
)
...
@@ -75,7 +75,7 @@ module Pod
...
@@ -75,7 +75,7 @@ module Pod
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
describe
"#
resolv
e_dependencies"
do
describe
"#
analyz
e_dependencies"
do
describe
"#analyze"
do
describe
"#analyze"
do
...
@@ -87,7 +87,7 @@ module Pod
...
@@ -87,7 +87,7 @@ module Pod
it
"analyzes the Podfile, the Lockfile and the Sandbox"
do
it
"analyzes the Podfile, the Lockfile and the Sandbox"
do
@installer
.
send
(
:analyze
)
@installer
.
send
(
:analyze
)
@installer
.
analysis_result
.
sandbox_
state
.
added
.
should
==
[
"JSONKit"
]
config
.
sandbox
.
state
.
added
.
should
==
[
"JSONKit"
]
end
end
it
"stores the targets created by the analyzer"
do
it
"stores the targets created by the analyzer"
do
...
@@ -113,7 +113,7 @@ module Pod
...
@@ -113,7 +113,7 @@ module Pod
before
do
before
do
@analysis_result
=
Installer
::
Analyzer
::
AnalysisResult
.
new
@analysis_result
=
Installer
::
Analyzer
::
AnalysisResult
.
new
@analysis_result
.
specifications
=
[]
@analysis_result
.
specifications
=
[]
@analysis_result
.
sandbox_
state
=
Installer
::
Analyzer
::
SpecsState
.
new
()
config
.
sandbox
.
state
=
Installer
::
Analyzer
::
SpecsState
.
new
()
@pod_targets
=
[
PodTarget
.
new
([],
nil
,
config
.
sandbox
)]
@pod_targets
=
[
PodTarget
.
new
([],
nil
,
config
.
sandbox
)]
@installer
.
stubs
(
:analysis_result
).
returns
(
@analysis_result
)
@installer
.
stubs
(
:analysis_result
).
returns
(
@analysis_result
)
@installer
.
stubs
(
:pod_targets
).
returns
(
@pod_targets
)
@installer
.
stubs
(
:pod_targets
).
returns
(
@pod_targets
)
...
@@ -128,7 +128,7 @@ module Pod
...
@@ -128,7 +128,7 @@ module Pod
end
end
it
"deletes the sources of the removed Pods"
do
it
"deletes the sources of the removed Pods"
do
@analysis_result
.
sandbox_
state
.
add_name
(
'Deleted-Pod'
,
:deleted
)
config
.
sandbox
.
state
.
add_name
(
'Deleted-Pod'
,
:deleted
)
config
.
sandbox
.
expects
(
:clean_pod
).
with
(
'Deleted-Pod'
)
config
.
sandbox
.
expects
(
:clean_pod
).
with
(
'Deleted-Pod'
)
@installer
.
send
(
:clean_sandbox
)
@installer
.
send
(
:clean_sandbox
)
end
end
...
@@ -139,7 +139,7 @@ module Pod
...
@@ -139,7 +139,7 @@ module Pod
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
describe
"#download_
dependenci
es"
do
describe
"#download_
sourc
es"
do
describe
"#install_pod_sources"
do
describe
"#install_pod_sources"
do
...
@@ -148,10 +148,9 @@ module Pod
...
@@ -148,10 +148,9 @@ module Pod
spec_2
=
Spec
.
new
spec_2
=
Spec
.
new
spec_2
.
name
=
'RestKit'
spec_2
.
name
=
'RestKit'
@installer
.
stubs
(
:root_specs
).
returns
([
spec
,
spec_2
])
@installer
.
stubs
(
:root_specs
).
returns
([
spec
,
spec_2
])
sandbox_state
=
Installer
::
Analyzer
::
SpecsState
.
new
config
.
sandbox
.
state
=
Installer
::
Analyzer
::
SpecsState
.
new
sandbox_state
.
added
<<
'BananaLib'
config
.
sandbox
.
state
.
added
<<
'BananaLib'
sandbox_state
.
changed
<<
'RestKit'
config
.
sandbox
.
state
.
changed
<<
'RestKit'
@installer
.
stubs
(
:sandbox_state
).
returns
(
sandbox_state
)
@installer
.
expects
(
:install_source_of_pod
).
with
(
'BananaLib'
)
@installer
.
expects
(
:install_source_of_pod
).
with
(
'BananaLib'
)
@installer
.
expects
(
:install_source_of_pod
).
with
(
'RestKit'
)
@installer
.
expects
(
:install_source_of_pod
).
with
(
'RestKit'
)
@installer
.
send
(
:install_pod_sources
)
@installer
.
send
(
:install_pod_sources
)
...
...
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