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
87778d87
Commit
87778d87
authored
May 09, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small clean up.
parent
ea9b1810
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
specification.rb
lib/cocoapods/specification.rb
+17
-17
No files found.
lib/cocoapods/specification.rb
View file @
87778d87
...
...
@@ -52,7 +52,7 @@ module Pod
end
def
part_of
=
(
value
)
puts
"[!] `part_of
_dependency
' is deprecated in
#{
name
}
"
puts
"[!] `part_of' is deprecated in
#{
name
}
"
end
# Normal attributes
...
...
@@ -69,6 +69,7 @@ module Pod
attr_writer
:summary
#TODO: handle inheritance
def
available_platforms
@platform
.
nil?
?
@define_for_platforms
.
map
{
|
platform
|
Platform
.
new
(
platform
,
@deployment_target
[
platform
])
}
:
[
platform
]
end
...
...
@@ -80,25 +81,25 @@ module Pod
# Attributes **without** multiple platform support
# Creates a top level attribute reader.
def
self
.
top_attr_reader
(
attr
,
block
=
nil
)
def
self
.
top_attr_reader
(
attr
,
read_lambda
=
nil
)
define_method
(
attr
)
do
ivar
=
instance_variable_get
(
"@
#{
attr
}
"
)
@parent
?
top_level_parent
.
send
(
attr
)
:
(
block
?
block
.
call
(
self
,
ivar
)
:
ivar
)
@parent
?
top_level_parent
.
send
(
attr
)
:
(
read_lambda
?
read_lambda
.
call
(
self
,
ivar
)
:
ivar
)
end
end
# Creates a top level attribute writer. A lambda can be passed to initialize the value.
def
self
.
top_attr_writer
(
attr
,
block
=
nil
)
def
self
.
top_attr_writer
(
attr
,
init_lambda
=
nil
)
raise
Informative
"Can't set
#{
attr
}
for subspecs"
if
@parent
define_method
(
"
#{
attr
}
="
)
do
|
value
|
instance_variable_set
(
"@
#{
attr
}
"
,
block
?
block
.
call
(
value
)
:
value
);
instance_variable_set
(
"@
#{
attr
}
"
,
init_lambda
?
init_lambda
.
call
(
value
)
:
value
);
end
end
# Creates a top level attribute accessor. A lambda can be passed to initialize the value in the attribute writer.
def
self
.
top_attr_accessor
(
attr
,
block
=
nil
)
def
self
.
top_attr_accessor
(
attr
,
writer_labmda
=
nil
)
top_attr_reader
attr
top_attr_writer
attr
,
block
top_attr_writer
attr
,
writer_labmda
end
top_attr_accessor
:homepage
...
...
@@ -134,12 +135,6 @@ module Pod
authors
||
list
.
first
end
# # TODO: move logic to compiler_flags
# def requires_arc=(requires_arc)
# self.compiler_flags = '-fobjc-arc' if requires_arc
# @requires_arc = requires_arc
# end
### Attributes **with** multiple platform support
class
PlatformProxy
...
...
@@ -195,20 +190,24 @@ module Pod
end
pltf_chained_attr_reader
:source_files
platform_attr_writer
:source_files
,
lambda
{
|
value
,
current
|
pattern_list
(
value
)
}
platform_attr_writer
:source_files
,
lambda
{
|
value
,
current
|
pattern_list
(
value
)
}
pltf_chained_attr_reader
:resources
platform_attr_writer
:resources
,
lambda
{
|
value
,
current
|
pattern_list
(
value
)
}
platform_attr_writer
:resources
,
lambda
{
|
value
,
current
|
pattern_list
(
value
)
}
alias_method
:resource
=
,
:resources
=
# frameworks are chained by the xcofing attr_reader
platform_attr_reader
:frameworks
platform_attr_writer
:frameworks
,
lambda
{
|
value
,
current
|
current
<<
value
}
platform_attr_writer
:frameworks
,
lambda
{
|
value
,
current
|
current
<<
value
}
alias_method
:framework
=
,
:frameworks
=
# libraries are chained by the xcofing attr_reader
platform_attr_reader
:libraries
platform_attr_writer
:libraries
,
lambda
{
|
value
,
current
|
current
<<
value
}
platform_attr_writer
:libraries
,
lambda
{
|
value
,
current
|
current
<<
value
}
alias_method
:library
=
,
:libraries
=
def
xcconfig
...
...
@@ -263,6 +262,7 @@ module Pod
result
end
# TODO: make top level?
def
deployment_target
=
(
version
)
raise
Informative
,
"The deployment target must be defined per platform like s.ios.deployment_target = '5.0'"
unless
@define_for_platforms
.
count
==
1
@deployment_target
[
@define_for_platforms
.
first
]
=
version
...
...
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