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
a4108542
Commit
a4108542
authored
Nov 23, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delegate a few more Subspec attributes to the top level spec.
parent
fc91353f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
17 deletions
+21
-17
specification.rb
lib/cocoapods/specification.rb
+16
-17
specification_spec.rb
spec/unit/specification_spec.rb
+5
-0
No files found.
lib/cocoapods/specification.rb
View file @
a4108542
...
...
@@ -53,10 +53,13 @@ module Pod
def
summary
=
(
summary
)
@summary
=
summary
@description
||=
summary
end
attr_reader
:summary
def
description
@description
||
summary
end
def
part_of
=
(
*
name_and_version_requirements
)
self
.
part_of_dependency
=
*
name_and_version_requirements
@part_of
.
only_part_of_other_pod
=
true
...
...
@@ -111,7 +114,7 @@ module Pod
attr_writer
:compiler_flags
def
compiler_flags
flags
=
"
#{
@compiler_flags
}
"
flags
<<
'-fobjc-arc'
if
@
requires_arc
flags
<<
'-fobjc-arc'
if
requires_arc
flags
end
...
...
@@ -127,8 +130,6 @@ module Pod
end
attr_reader
:dependencies
# Subspec related
def
subspec
(
name
,
&
block
)
subspec
=
Subspec
.
new
(
self
,
name
,
&
block
)
@subspecs
<<
subspec
...
...
@@ -136,6 +137,13 @@ module Pod
end
attr_reader
:subspecs
# Not attributes
# TODO when we move to use a 'ResolveContext' this should happen there.
attr_accessor
:defined_in_set
include
Config
::
Mixin
def
subspec_by_name
(
name
)
# Remove this spec's name from the beginning of the name we’re looking for
# and take the first component from the remainder, which is the spec we need
...
...
@@ -149,19 +157,6 @@ module Pod
remainder
.
empty?
?
subspec
:
subspec
.
subspec_by_name
(
name
)
end
# These are attributes which are also on a Podfile
# TODO remove this, we no longer allow to install specs as Podfile
attr_accessor
:generate_bridge_support
alias_method
:generate_bridge_support?
,
:generate_bridge_support
# Not attributes
# TODO when we move to use a 'ResolveContext' this should happen there.
attr_accessor
:defined_in_set
include
Config
::
Mixin
def
==
(
other
)
object_id
==
other
.
object_id
||
(
self
.
class
===
other
&&
...
...
@@ -428,6 +423,10 @@ module Pod
def
defined_in_set
top_level_parent
.
defined_in_set
end
def
requires_arc
top_level_parent
.
requires_arc
end
end
end
...
...
spec/unit/specification_spec.rb
View file @
a4108542
...
...
@@ -288,6 +288,7 @@ describe "A Pod::Specification subspec" do
s
.
version
=
'1.2.3'
s
.
summary
=
'A spec with subspecs'
s
.
source
=
{
:git
=>
'/some/url'
}
s
.
requires_arc
=
true
s
.
subspec
'FirstSubSpec'
do
|
fss
|
fss
.
subspec
'SecondSubSpec'
do
|
sss
|
...
...
@@ -315,8 +316,12 @@ describe "A Pod::Specification subspec" do
it
"automatically forwards undefined attributes to the top level parent"
do
@spec
.
subspecs
.
first
.
summary
.
should
==
@spec
.
summary
@spec
.
subspecs
.
first
.
source
.
should
==
@spec
.
source
@spec
.
subspecs
.
first
.
requires_arc
.
should
==
true
@spec
.
subspecs
.
first
.
compiler_flags
.
should
==
' -fobjc-arc'
@spec
.
subspecs
.
first
.
subspecs
.
first
.
summary
.
should
==
@spec
.
summary
@spec
.
subspecs
.
first
.
subspecs
.
first
.
source
.
should
==
@spec
.
source
@spec
.
subspecs
.
first
.
subspecs
.
first
.
requires_arc
.
should
==
true
@spec
.
subspecs
.
first
.
subspecs
.
first
.
compiler_flags
.
should
==
' -fobjc-arc'
end
it
"returns subspecs by name"
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