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
f85fd191
Commit
f85fd191
authored
Jan 25, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Analyzer] Reduce code duplication in #scope_suffix_for_distinctor
parent
7c68caba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
15 deletions
+11
-15
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+11
-15
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
f85fd191
...
...
@@ -363,23 +363,19 @@ module Pod
result
=
targets_by_distinctors
.
map
{
|
d
,
_
|
[
d
,
platform_name_proc
.
call
(
d
[
1
])]
}
else
common_specs
=
all_spec_variants
.
reduce
(
all_spec_variants
.
first
,
&
:&
)
if
all_spec_variants
.
uniq
.
count
==
all_spec_variants
.
count
result
=
targets_by_distinctors
.
map
do
|
distinctor
,
_
|
specs
,
=
*
distinctor
specs
-=
common_specs
subspec_names
=
specs
.
map
{
|
spec
|
spec
.
name
.
split
(
'/'
)[
1
..-
1
].
join
(
'_'
)
}
# => Subspecs names without common subspecs
[
distinctor
,
subspec_names
.
empty?
?
nil
:
subspec_names
.
join
(
'-'
)]
end
else
result
=
targets_by_distinctors
.
map
do
|
distinctor
,
_
|
specs
,
platform
=
*
distinctor
specs
-=
common_specs
subspec_names
=
specs
.
map
{
|
spec
|
spec
.
name
.
split
(
'/'
)[
1
..-
1
].
join
(
'_'
)
}
result
=
targets_by_distinctors
.
map
do
|
distinctor
,
_
|
specs
,
=
*
distinctor
specs
-=
common_specs
subspec_names
=
specs
.
map
{
|
spec
|
spec
.
name
.
split
(
'/'
)[
1
..-
1
].
join
(
'_'
)
}
# => Subspecs names without common subspecs
[
distinctor
,
subspec_names
.
empty?
?
nil
:
subspec_names
.
join
(
'-'
)]
end
if
all_spec_variants
.
count
>
all_spec_variants
.
uniq
.
count
result
.
map!
do
|
distinctor
,
suffix
|
_
,
platform
=
*
distinctor
platform_name
=
platform_name_proc
.
call
(
platform
)
name_parts
=
[
platform_name
]
+
subspec_names
# => Platform name (+ SDK version) + subspecs names without common subspecs
[
distinctor
,
name_parts
.
join
(
'-'
)]
[
distinctor
,
[
platform_name
,
suffix
].
compact
.
join
(
'-'
)]
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