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
3655f6e5
Commit
3655f6e5
authored
Sep 16, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ xcode config spec
parent
d1ba2e80
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
5 deletions
+43
-5
config.rb
lib/cocoa_pods/xcode/config.rb
+9
-5
config_spec.rb
spec/unit/xcode/config_spec.rb
+34
-0
No files found.
lib/cocoa_pods/xcode/config.rb
View file @
3655f6e5
...
...
@@ -6,6 +6,10 @@ module Pod
merge!
(
xcconfig_hash
)
end
def
to_hash
@attributes
end
def
merge!
(
xcconfig_hash
)
xcconfig_hash
.
each
do
|
key
,
value
|
if
existing_value
=
@attributes
[
key
]
...
...
@@ -17,12 +21,12 @@ module Pod
end
alias_method
:<<
,
:merge!
def
to_s
@attributes
.
map
{
|
key
,
value
|
"
#{
key
}
=
#{
value
}
"
}.
join
(
"
\n
"
)
end
def
create_in
(
pods_root
)
(
pods_root
+
'Pods.xcconfig'
).
open
(
'w'
)
do
|
file
|
@attributes
.
each
do
|
key
,
value
|
file
.
puts
"
#{
key
}
=
#{
value
}
"
end
end
(
pods_root
+
'Pods.xcconfig'
).
open
(
'w'
)
{
|
file
|
file
<<
to_s
}
end
end
end
...
...
spec/unit/xcode/config_spec.rb
0 → 100644
View file @
3655f6e5
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
"Pod::Xcode::Config"
do
extend
SpecHelper
::
TemporaryDirectory
before
do
@config
=
Pod
::
Xcode
::
Config
.
new
(
'OTHER_LD_FLAGS'
=>
'-framework Foundation'
)
end
it
"merges another config hash in place"
do
@config
.
merge!
(
'HEADER_SEARCH_PATHS'
=>
'/some/path'
)
@config
.
to_hash
.
should
==
{
'OTHER_LD_FLAGS'
=>
'-framework Foundation'
,
'HEADER_SEARCH_PATHS'
=>
'/some/path'
}
end
it
"appends a value for the same key when merging"
do
@config
.
merge!
(
'OTHER_LD_FLAGS'
=>
'-l xml2.2.7.3'
)
@config
.
to_hash
.
should
==
{
'OTHER_LD_FLAGS'
=>
'-framework Foundation -l xml2.2.7.3'
}
end
it
"creates the config file"
do
@config
.
merge!
(
'HEADER_SEARCH_PATHS'
=>
'/some/path'
)
@config
.
merge!
(
'OTHER_LD_FLAGS'
=>
'-l xml2.2.7.3'
)
@config
.
create_in
(
temporary_directory
)
(
temporary_directory
+
'Pods.xcconfig'
).
read
.
split
(
"
\n
"
).
sort
.
should
==
[
"OTHER_LD_FLAGS = -framework Foundation -l xml2.2.7.3"
,
"HEADER_SEARCH_PATHS = /some/path"
].
sort
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