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
3c674bbc
Commit
3c674bbc
authored
Oct 10, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Resolver] Extract LazySpecification code into resolver/lazy_specification.rb
parent
e9667506
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
41 deletions
+44
-41
resolver.rb
lib/cocoapods/resolver.rb
+3
-41
lazy_specification.rb
lib/cocoapods/resolver/lazy_specification.rb
+41
-0
No files found.
lib/cocoapods/resolver.rb
View file @
3c674bbc
module
Pod
class
Specification
::
Set
class
LazySpecification
<
BasicObject
attr_reader
:name
,
:version
,
:source
def
initialize
(
name
,
version
,
source
)
@name
=
name
@version
=
version
@source
=
source
end
def
method_missing
(
method
,
*
args
,
&
block
)
specification
.
send
(
method
,
*
args
,
&
block
)
end
def
subspec_by_name
(
name
=
nil
)
if
!
name
||
name
==
self
.
name
self
else
specification
.
subspec_by_name
(
name
)
end
end
def
specification
@specification
||=
source
.
specification
(
name
,
version
)
end
end
def
all_specifications
@all_specifications
||=
versions_by_source
.
map
do
|
source
,
versions
|
versions
.
map
{
|
version
|
LazySpecification
.
new
(
name
,
version
,
source
)
}
end
.
flatten
end
end
class
Specification
::
Set
::
External
def
all_specifications
[
specification
]
end
end
require
'resolver'
require
'cocoapods/resolver/lazy_specification'
module
Pod
# The resolver is responsible of generating a list of specifications grouped
# by target for a given Podfile.
#
class
Resolver
require
'resolver'
include
::
Resolver
::
UI
include
::
Resolver
::
SpecificationProvider
...
...
lib/cocoapods/resolver/lazy_specification.rb
0 → 100644
View file @
3c674bbc
module
Pod
class
Specification
::
Set
class
LazySpecification
<
BasicObject
attr_reader
:name
,
:version
,
:source
def
initialize
(
name
,
version
,
source
)
@name
=
name
@version
=
version
@source
=
source
end
def
method_missing
(
method
,
*
args
,
&
block
)
specification
.
send
(
method
,
*
args
,
&
block
)
end
def
subspec_by_name
(
name
=
nil
)
if
!
name
||
name
==
self
.
name
self
else
specification
.
subspec_by_name
(
name
)
end
end
def
specification
@specification
||=
source
.
specification
(
name
,
version
)
end
end
class
External
def
all_specifications
[
specification
]
end
end
def
all_specifications
@all_specifications
||=
versions_by_source
.
map
do
|
source
,
versions
|
versions
.
map
{
|
version
|
LazySpecification
.
new
(
name
,
version
,
source
)
}
end
.
flatten
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