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
...
@@ -82,7 +82,6 @@ module Pod
#
#
def
add_pod_group
(
pod_name
,
path
,
development
=
false
,
absolute
=
false
)
def
add_pod_group
(
pod_name
,
path
,
development
=
false
,
absolute
=
false
)
raise
"[BUG]"
if
pod_group
(
pod_name
)
raise
"[BUG]"
if
pod_group
(
pod_name
)
parent_group
=
development
?
development_pods
:
pods
parent_group
=
development
?
development_pods
:
pods
source_tree
=
absolute
?
:
absolute
:
:group
source_tree
=
absolute
?
:
absolute
:
:group
group
=
parent_group
.
new_group
(
pod_name
,
path
,
source_tree
)
group
=
parent_group
.
new_group
(
pod_name
,
path
,
source_tree
)
...
@@ -105,7 +104,7 @@ module Pod
...
@@ -105,7 +104,7 @@ module Pod
# @return [PBXGroup] The group.
# @return [PBXGroup] The group.
#
#
def
pod_group
(
pod_name
)
def
pod_group
(
pod_name
)
pod_groups
.
find
{
|
group
|
group
.
name
==
pod_name
}
pod_groups
.
find
{
|
group
|
group
.
display_
name
==
pod_name
}
end
end
# @return [Hash] The names of the specification subgroups by key.
# @return [Hash] The names of the specification subgroups by key.
...
@@ -191,14 +190,21 @@ module Pod
...
@@ -191,14 +190,21 @@ module Pod
# @param [#to_s] podfile_path
# @param [#to_s] podfile_path
# The path of the Podfile.
# The path of the Podfile.
#
#
# @return [
PBXFileReference
] The new file reference.
# @return [
void
] The new file reference.
#
#
def
add_podfile
(
podfile_path
)
def
set_podfile
(
podfile_path
)
podfile_ref
=
new_file
(
podfile_path
,
:project
)
if
podfile_path
podfile_ref
.
name
=
'Podfile'
if
podfile
podfile_ref
.
xc_language_specification_identifier
=
'xcode.lang.ruby'
podfile_ref
=
podfile
podfile_ref
.
last_known_file_type
=
'text'
podfile_ref
.
set_path
(
podfile_path
)
podfile_ref
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
end
# @return [PBXFileReference] The file reference of the Podfile.
# @return [PBXFileReference] The file reference of the Podfile.
...
@@ -218,8 +224,8 @@ module Pod
...
@@ -218,8 +224,8 @@ module Pod
# @param [String] name
# @param [String] name
# The name of the group.
# The name of the group.
#
#
# @param [String] parent
# @param [String
, Nil
] parent
# The parent group. If nil resolves to the maingroup.
# The parent group. If nil resolves to the main
group.
#
#
# @return [PBXGroup] The group.
# @return [PBXGroup] The group.
#
#
...
...
spec/unit/project_spec.rb
View file @
602d23f6
...
@@ -209,16 +209,27 @@ module Pod
...
@@ -209,16 +209,27 @@ module Pod
#----------------------------------------#
#----------------------------------------#
it
"adds the Podfile configured as a Ruby file"
do
describe
"#set_podfile"
do
@sut
.
add_podfile
(
config
.
sandbox
.
root
+
'../Podfile'
)
f
=
@sut
[
'Podfile'
]
it
"adds the Podfile configured as a Ruby file"
do
f
.
source_tree
.
should
==
'SOURCE_ROOT'
@sut
.
set_podfile
(
config
.
sandbox
.
root
+
'../Podfile'
)
f
.
xc_language_specification_identifier
.
should
==
'xcode.lang.ruby'
f
=
@sut
[
'Podfile'
]
f
.
path
.
should
==
'../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
end
#----------------------------------------#
it
"returns the file reference of the Podfile"
do
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
)
@sut
.
podfile
.
should
.
equal
(
ref
)
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