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
602d23f6
Commit
602d23f6
authored
Sep 06, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Project] Clean-up
parent
bbcbb05c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
18 deletions
+35
-18
project.rb
lib/cocoapods/project.rb
+17
-11
project_spec.rb
spec/unit/project_spec.rb
+18
-7
No files found.
lib/cocoapods/project.rb
View file @
602d23f6
...
...
@@ -82,7 +82,6 @@ module Pod
#
def
add_pod_group
(
pod_name
,
path
,
development
=
false
,
absolute
=
false
)
raise
"[BUG]"
if
pod_group
(
pod_name
)
parent_group
=
development
?
development_pods
:
pods
source_tree
=
absolute
?
:
absolute
:
:group
group
=
parent_group
.
new_group
(
pod_name
,
path
,
source_tree
)
...
...
@@ -105,7 +104,7 @@ module Pod
# @return [PBXGroup] The group.
#
def
pod_group
(
pod_name
)
pod_groups
.
find
{
|
group
|
group
.
name
==
pod_name
}
pod_groups
.
find
{
|
group
|
group
.
display_
name
==
pod_name
}
end
# @return [Hash] The names of the specification subgroups by key.
...
...
@@ -191,14 +190,21 @@ module Pod
# @param [#to_s] podfile_path
# The path of the Podfile.
#
# @return [
PBXFileReference
] The new file reference.
# @return [
void
] The new file reference.
#
def
add_podfile
(
podfile_path
)
podfile_ref
=
new_file
(
podfile_path
,
:project
)
podfile_ref
.
name
=
'Podfile'
podfile_ref
.
xc_language_specification_identifier
=
'xcode.lang.ruby'
podfile_ref
.
last_known_file_type
=
'text'
podfile_ref
def
set_podfile
(
podfile_path
)
if
podfile_path
if
podfile
podfile_ref
=
podfile
podfile_ref
.
set_path
(
podfile_path
)
else
podfile_ref
=
new_file
(
podfile_path
,
:project
)
end
podfile_ref
.
name
=
'Podfile'
podfile_ref
.
xc_language_specification_identifier
=
'xcode.lang.ruby'
podfile_ref
.
last_known_file_type
=
'text'
podfile_ref
end
end
# @return [PBXFileReference] The file reference of the Podfile.
...
...
@@ -218,8 +224,8 @@ module Pod
# @param [String] name
# The name of the group.
#
# @param [String] parent
# The parent group. If nil resolves to the maingroup.
# @param [String
, Nil
] parent
# The parent group. If nil resolves to the main
group.
#
# @return [PBXGroup] The group.
#
...
...
spec/unit/project_spec.rb
View file @
602d23f6
...
...
@@ -209,16 +209,27 @@ module Pod
#----------------------------------------#
it
"adds the Podfile configured as a Ruby file"
do
@sut
.
add_podfile
(
config
.
sandbox
.
root
+
'../Podfile'
)
f
=
@sut
[
'Podfile'
]
f
.
source_tree
.
should
==
'SOURCE_ROOT'
f
.
xc_language_specification_identifier
.
should
==
'xcode.lang.ruby'
f
.
path
.
should
==
'../Podfile'
describe
"#set_podfile"
do
it
"adds the Podfile configured as a Ruby file"
do
@sut
.
set_podfile
(
config
.
sandbox
.
root
+
'../Podfile'
)
f
=
@sut
[
'Podfile'
]
f
.
source_tree
.
should
==
'SOURCE_ROOT'
f
.
xc_language_specification_identifier
.
should
==
'xcode.lang.ruby'
f
.
path
.
should
==
'../Podfile'
end
it
"updates the Podfile if it already exists"
do
ref
=
@sut
.
set_podfile
(
config
.
sandbox
.
root
+
'../Podfile'
)
@sut
.
set_podfile
(
config
.
sandbox
.
root
+
'../Dir/Podfile'
)
ref
.
path
.
should
==
'../Dir/Podfile'
end
end
#----------------------------------------#
it
"returns the file reference of the Podfile"
do
ref
=
@sut
.
add
_podfile
(
config
.
sandbox
.
root
+
'../Podfile'
)
ref
=
@sut
.
set
_podfile
(
config
.
sandbox
.
root
+
'../Podfile'
)
@sut
.
podfile
.
should
.
equal
(
ref
)
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