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
29e01725
Commit
29e01725
authored
Jan 28, 2016
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SpecsState] Track pods in a Set
parent
30d814c1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
17 deletions
+19
-17
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+1
-1
sandbox_analyzer.rb
lib/cocoapods/installer/analyzer/sandbox_analyzer.rb
+1
-1
specs_state.rb
lib/cocoapods/installer/analyzer/specs_state.rb
+10
-8
sandbox_analyzer_spec.rb
spec/unit/installer/analyzer/sandbox_analyzer_spec.rb
+2
-2
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+4
-4
installer_spec.rb
spec/unit/installer_spec.rb
+1
-1
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
29e01725
...
@@ -202,7 +202,7 @@ module Pod
...
@@ -202,7 +202,7 @@ module Pod
pods_state
pods_state
else
else
state
=
SpecsState
.
new
state
=
SpecsState
.
new
state
.
added
.
concat
(
podfile
.
dependencies
.
map
(
&
:name
).
uniq
)
state
.
added
.
merge
(
podfile
.
dependencies
.
map
(
&
:root_name
)
)
state
state
end
end
end
end
...
...
lib/cocoapods/installer/analyzer/sandbox_analyzer.rb
View file @
29e01725
...
@@ -78,7 +78,7 @@ module Pod
...
@@ -78,7 +78,7 @@ module Pod
state
.
add_name
(
name
,
pod_state
(
name
))
state
.
add_name
(
name
,
pod_state
(
name
))
end
end
else
else
state
.
added
.
concat
(
resolved_pods
)
state
.
added
.
merge
(
resolved_pods
)
end
end
state
state
end
end
...
...
lib/cocoapods/installer/analyzer/specs_state.rb
View file @
29e01725
require
'set'
module
Pod
module
Pod
class
Installer
class
Installer
class
Analyzer
class
Analyzer
...
@@ -17,10 +19,10 @@ module Pod
...
@@ -17,10 +19,10 @@ module Pod
# (`:added`, `:removed`, `:changed` or `:unchanged`).
# (`:added`, `:removed`, `:changed` or `:unchanged`).
#
#
def
initialize
(
pods_by_state
=
nil
)
def
initialize
(
pods_by_state
=
nil
)
@added
=
[]
@added
=
Set
.
new
@deleted
=
[]
@deleted
=
Set
.
new
@changed
=
[]
@changed
=
Set
.
new
@unchanged
=
[]
@unchanged
=
Set
.
new
if
pods_by_state
if
pods_by_state
{
{
...
@@ -36,19 +38,19 @@ module Pod
...
@@ -36,19 +38,19 @@ module Pod
end
end
end
end
# @return [
Array
<String>] the names of the pods that were added.
# @return [
Set
<String>] the names of the pods that were added.
#
#
attr_accessor
:added
attr_accessor
:added
# @return [
Array
<String>] the names of the pods that were changed.
# @return [
Set
<String>] the names of the pods that were changed.
#
#
attr_accessor
:changed
attr_accessor
:changed
# @return [
Array
<String>] the names of the pods that were deleted.
# @return [
Set
<String>] the names of the pods that were deleted.
#
#
attr_accessor
:deleted
attr_accessor
:deleted
# @return [
Array
<String>] the names of the pods that were unchanged.
# @return [
Set
<String>] the names of the pods that were unchanged.
#
#
attr_accessor
:unchanged
attr_accessor
:unchanged
...
...
spec/unit/installer/analyzer/sandbox_analyzer_spec.rb
View file @
29e01725
...
@@ -22,12 +22,12 @@ module Pod
...
@@ -22,12 +22,12 @@ module Pod
@analyzer
.
stubs
(
:sandbox_checksum
).
returns
(
@spec
.
checksum
)
@analyzer
.
stubs
(
:sandbox_checksum
).
returns
(
@spec
.
checksum
)
state
=
@analyzer
.
analyze
state
=
@analyzer
.
analyze
state
.
class
.
should
==
Installer
::
Analyzer
::
SpecsState
state
.
class
.
should
==
Installer
::
Analyzer
::
SpecsState
state
.
unchanged
.
should
==
[
'BananaLib'
]
state
.
unchanged
.
should
==
Set
.
new
(
%w(BananaLib)
)
end
end
it
'marks all the pods as added if no sandbox manifest is available'
do
it
'marks all the pods as added if no sandbox manifest is available'
do
@sandbox
.
stubs
(
:manifest
)
@sandbox
.
stubs
(
:manifest
)
@analyzer
.
analyze
.
added
.
should
==
[
'BananaLib'
]
@analyzer
.
analyze
.
added
.
should
==
Set
.
new
(
%w(BananaLib)
)
end
end
end
end
...
...
spec/unit/installer/analyzer_spec.rb
View file @
29e01725
...
@@ -52,10 +52,10 @@ module Pod
...
@@ -52,10 +52,10 @@ module Pod
it
'computes the state of the Podfile respect to the Lockfile'
do
it
'computes the state of the Podfile respect to the Lockfile'
do
state
=
@analyzer
.
analyze
.
podfile_state
state
=
@analyzer
.
analyze
.
podfile_state
state
.
added
.
should
==
%w(AFNetworking libextobjc libextobjc
)
state
.
added
.
should
==
Set
.
new
(
%w(AFNetworking libextobjc libextobjc)
)
state
.
changed
.
should
==
%w(
)
state
.
changed
.
should
==
Set
.
new
(
%w()
)
state
.
unchanged
.
should
==
%w(JSONKit SVPullToRefresh
)
state
.
unchanged
.
should
==
Set
.
new
(
%w(JSONKit SVPullToRefresh)
)
state
.
deleted
.
should
==
%w(NUI
)
state
.
deleted
.
should
==
Set
.
new
(
%w(NUI)
)
end
end
#--------------------------------------#
#--------------------------------------#
...
...
spec/unit/installer_spec.rb
View file @
29e01725
...
@@ -396,7 +396,7 @@ module Pod
...
@@ -396,7 +396,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'
]
@installer
.
analysis_result
.
sandbox_state
.
added
.
should
==
Set
.
new
(
%w(JSONKit)
)
end
end
it
'stores the targets created by the analyzer'
do
it
'stores the targets created by the analyzer'
do
...
...
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