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
1905f1b3
Commit
1905f1b3
authored
Oct 29, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a shortcut to define multiple attribute accessors at once.
parent
971586ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
17 deletions
+11
-17
project.rb
lib/cocoapods/xcode/project.rb
+11
-17
No files found.
lib/cocoapods/xcode/project.rb
View file @
1905f1b3
...
@@ -12,6 +12,10 @@ module Pod
...
@@ -12,6 +12,10 @@ module Pod
define_method
(
"
#{
name
}
="
)
{
|
value
|
@attributes
[
attribute_name
]
=
value
}
define_method
(
"
#{
name
}
="
)
{
|
value
|
@attributes
[
attribute_name
]
=
value
}
end
end
def
self
.
attributes
(
*
names
)
names
.
each
{
|
name
|
attribute
(
name
)
}
end
def
self
.
has_many
(
plural_attr_name
,
options
)
def
self
.
has_many
(
plural_attr_name
,
options
)
klass
=
options
[
:class
]
klass
=
options
[
:class
]
singular_attr_name
=
plural_attr_name
.
to_s
[
0
..-
2
]
# strip off 's'
singular_attr_name
=
plural_attr_name
.
to_s
[
0
..-
2
]
# strip off 's'
...
@@ -43,8 +47,7 @@ module Pod
...
@@ -43,8 +47,7 @@ module Pod
end
end
attr_reader
:uuid
,
:attributes
attr_reader
:uuid
,
:attributes
attribute
:isa
attributes
:isa
,
:name
attribute
:name
def
initialize
(
project
,
uuid
,
attributes
)
def
initialize
(
project
,
uuid
,
attributes
)
@project
,
@uuid
,
@attributes
=
project
,
uuid
||
generate_uuid
,
attributes
@project
,
@uuid
,
@attributes
=
project
,
uuid
||
generate_uuid
,
attributes
...
@@ -78,8 +81,7 @@ module Pod
...
@@ -78,8 +81,7 @@ module Pod
end
end
class
PBXGroup
<
PBXObject
class
PBXGroup
<
PBXObject
attribute
:sourceTree
attributes
:sourceTree
,
:children
attribute
:children
def
initialize
(
project
,
uuid
,
attributes
)
def
initialize
(
project
,
uuid
,
attributes
)
super
super
...
@@ -122,8 +124,7 @@ module Pod
...
@@ -122,8 +124,7 @@ module Pod
end
end
class
PBXFileReference
<
PBXObject
class
PBXFileReference
<
PBXObject
attribute
:path
attributes
:path
,
:sourceTree
attribute
:sourceTree
def
initialize
(
project
,
uuid
,
attributes
)
def
initialize
(
project
,
uuid
,
attributes
)
is_new
=
uuid
.
nil?
is_new
=
uuid
.
nil?
...
@@ -145,8 +146,7 @@ module Pod
...
@@ -145,8 +146,7 @@ module Pod
end
end
class
PBXBuildFile
<
PBXObject
class
PBXBuildFile
<
PBXObject
attribute
:fileRef
attributes
:fileRef
,
:settings
attribute
:settings
# Takes a PBXFileReference instance and assigns its uuid to the fileRef attribute.
# Takes a PBXFileReference instance and assigns its uuid to the fileRef attribute.
def
file
=
(
file
)
def
file
=
(
file
)
...
@@ -162,8 +162,7 @@ module Pod
...
@@ -162,8 +162,7 @@ module Pod
class
PBXBuildPhase
<
PBXObject
class
PBXBuildPhase
<
PBXObject
has_many
:files
,
:class
=>
PBXBuildFile
has_many
:files
,
:class
=>
PBXBuildFile
attribute
:buildActionMask
attributes
:buildActionMask
,
:runOnlyForDeploymentPostprocessing
attribute
:runOnlyForDeploymentPostprocessing
def
initialize
(
*
)
def
initialize
(
*
)
super
super
...
@@ -175,8 +174,7 @@ module Pod
...
@@ -175,8 +174,7 @@ module Pod
end
end
class
PBXCopyFilesBuildPhase
<
PBXBuildPhase
class
PBXCopyFilesBuildPhase
<
PBXBuildPhase
attribute
:dstPath
attributes
:dstPath
,
:dstSubfolderSpec
attribute
:dstSubfolderSpec
def
initialize
(
*
)
def
initialize
(
*
)
super
super
...
@@ -191,11 +189,7 @@ module Pod
...
@@ -191,11 +189,7 @@ module Pod
end
end
class
PBXNativeTarget
<
PBXObject
class
PBXNativeTarget
<
PBXObject
attribute
:productName
attributes
:productName
,
:productReference
,
:productType
,
:buildRules
,
:dependencies
attribute
:productReference
attribute
:productType
attribute
:buildRules
attribute
:dependencies
has_many
:buildPhases
,
:class
=>
PBXBuildPhase
has_many
:buildPhases
,
:class
=>
PBXBuildPhase
has_one
:buildConfigurationList
has_one
:buildConfigurationList
...
...
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