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
9d9e4a53
Commit
9d9e4a53
authored
Feb 27, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FileReferencesInstaller] Fix crash on #header_mappings
parent
748ea86f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
19 deletions
+15
-19
file_references_installer.rb
lib/cocoapods/installer/file_references_installer.rb
+5
-5
file_references_installer_spec.rb
spec/unit/installer/file_references_installer_spec.rb
+10
-14
No files found.
lib/cocoapods/installer/file_references_installer.rb
View file @
9d9e4a53
...
@@ -113,12 +113,11 @@ module Pod
...
@@ -113,12 +113,11 @@ module Pod
sandbox
.
build_headers
.
add_search_path
(
headers_sandbox
)
sandbox
.
build_headers
.
add_search_path
(
headers_sandbox
)
sandbox
.
public_headers
.
add_search_path
(
headers_sandbox
)
sandbox
.
public_headers
.
add_search_path
(
headers_sandbox
)
consumer
=
file_accessor
.
spec_consumer
header_mappings
(
headers_sandbox
,
file_accessor
,
file_accessor
.
headers
).
each
do
|
namespaced_path
,
files
|
header_mappings
(
headers_sandbox
,
consumer
,
file_accessor
.
headers
).
each
do
|
namespaced_path
,
files
|
sandbox
.
build_headers
.
add_files
(
namespaced_path
,
files
)
sandbox
.
build_headers
.
add_files
(
namespaced_path
,
files
)
end
end
header_mappings
(
headers_sandbox
,
consume
r
,
file_accessor
.
public_headers
).
each
do
|
namespaced_path
,
files
|
header_mappings
(
headers_sandbox
,
file_accesso
r
,
file_accessor
.
public_headers
).
each
do
|
namespaced_path
,
files
|
sandbox
.
public_headers
.
add_files
(
namespaced_path
,
files
)
sandbox
.
public_headers
.
add_files
(
namespaced_path
,
files
)
end
end
end
end
...
@@ -154,7 +153,8 @@ module Pod
...
@@ -154,7 +153,8 @@ module Pod
# headers folders as the keys and the absolute paths of the
# headers folders as the keys and the absolute paths of the
# header files as the values.
# header files as the values.
#
#
def
header_mappings
(
headers_sandbox
,
consumer
,
headers
)
def
header_mappings
(
headers_sandbox
,
file_accessor
,
headers
)
consumer
=
file_accessor
.
spec_consumer
dir
=
headers_sandbox
dir
=
headers_sandbox
dir
=
dir
+
consumer
.
header_dir
if
consumer
.
header_dir
dir
=
dir
+
consumer
.
header_dir
if
consumer
.
header_dir
...
@@ -162,7 +162,7 @@ module Pod
...
@@ -162,7 +162,7 @@ module Pod
headers
.
each
do
|
header
|
headers
.
each
do
|
header
|
sub_dir
=
dir
sub_dir
=
dir
if
consumer
.
header_mappings_dir
if
consumer
.
header_mappings_dir
header_mappings_dir
=
Pathname
.
new
(
consumer
.
header_mappings_dir
)
header_mappings_dir
=
file_accessor
.
path_list
.
root
+
consumer
.
header_mappings_dir
relative_path
=
header
.
relative_path_from
(
header_mappings_dir
)
relative_path
=
header
.
relative_path_from
(
header_mappings_dir
)
sub_dir
=
sub_dir
+
relative_path
.
dirname
sub_dir
=
sub_dir
+
relative_path
.
dirname
end
end
...
...
spec/unit/installer/file_references_installer_spec.rb
View file @
9d9e4a53
...
@@ -91,9 +91,8 @@ module Pod
...
@@ -91,9 +91,8 @@ module Pod
it
"returns the header mappings"
do
it
"returns the header mappings"
do
headers_sandbox
=
Pathname
.
new
(
'BananaLib'
)
headers_sandbox
=
Pathname
.
new
(
'BananaLib'
)
consumer
=
@file_accessor
.
spec_consumer
headers
=
[
Pathname
.
new
(
'BananaLib/Banana.h'
)]
headers
=
[
Pathname
.
new
(
'BananaLib/Banana.h'
)]
mappings
=
@installer
.
send
(
:header_mappings
,
headers_sandbox
,
consume
r
,
headers
)
mappings
=
@installer
.
send
(
:header_mappings
,
headers_sandbox
,
@file_accesso
r
,
headers
)
mappings
.
should
==
{
mappings
.
should
==
{
headers_sandbox
=>
[
Pathname
.
new
(
'BananaLib/Banana.h'
)]
headers_sandbox
=>
[
Pathname
.
new
(
'BananaLib/Banana.h'
)]
}
}
...
@@ -101,10 +100,9 @@ module Pod
...
@@ -101,10 +100,9 @@ module Pod
it
"takes into account the header dir specified in the spec"
do
it
"takes into account the header dir specified in the spec"
do
headers_sandbox
=
Pathname
.
new
(
'BananaLib'
)
headers_sandbox
=
Pathname
.
new
(
'BananaLib'
)
consumer
=
@file_accessor
.
spec_consumer
headers
=
[
Pathname
.
new
(
'BananaLib/Banana.h'
)]
headers
=
[
Pathname
.
new
(
'BananaLib/Banana.h'
)]
consumer
.
stubs
(
:header_dir
).
returns
(
'Sub_dir'
)
@file_accessor
.
spec_
consumer
.
stubs
(
:header_dir
).
returns
(
'Sub_dir'
)
mappings
=
@installer
.
send
(
:header_mappings
,
headers_sandbox
,
consume
r
,
headers
)
mappings
=
@installer
.
send
(
:header_mappings
,
headers_sandbox
,
@file_accesso
r
,
headers
)
mappings
.
should
==
{
mappings
.
should
==
{
(
headers_sandbox
+
'Sub_dir'
)
=>
[
Pathname
.
new
(
'BananaLib/Banana.h'
)]
(
headers_sandbox
+
'Sub_dir'
)
=>
[
Pathname
.
new
(
'BananaLib/Banana.h'
)]
}
}
...
@@ -112,16 +110,14 @@ module Pod
...
@@ -112,16 +110,14 @@ module Pod
it
"takes into account the header mappings dir specified in the spec"
do
it
"takes into account the header mappings dir specified in the spec"
do
headers_sandbox
=
Pathname
.
new
(
'BananaLib'
)
headers_sandbox
=
Pathname
.
new
(
'BananaLib'
)
consumer
=
@file_accessor
.
spec_consumer
header_1
=
@file_accessor
.
root
+
'BananaLib/sub_dir/dir_1/banana_1.h'
headers
=
[
header_2
=
@file_accessor
.
root
+
'BananaLib/sub_dir/dir_2/banana_2.h'
Pathname
.
new
(
'BananaLib/sub_dir/dir_1/banana_1.h'
),
headers
=
[
header_1
,
header_2
]
Pathname
.
new
(
'BananaLib/sub_dir/dir_2/banana_2.h'
),
@file_accessor
.
spec_consumer
.
stubs
(
:header_mappings_dir
).
returns
(
'BananaLib/sub_dir'
)
]
mappings
=
@installer
.
send
(
:header_mappings
,
headers_sandbox
,
@file_accessor
,
headers
)
consumer
.
stubs
(
:header_mappings_dir
).
returns
(
'BananaLib/sub_dir'
)
mappings
=
@installer
.
send
(
:header_mappings
,
headers_sandbox
,
consumer
,
headers
)
mappings
.
should
==
{
mappings
.
should
==
{
(
headers_sandbox
+
'dir_1'
)
=>
[
Pathname
.
new
(
'BananaLib/sub_dir/dir_1/banana_1.h'
)
],
(
headers_sandbox
+
'dir_1'
)
=>
[
header_1
],
(
headers_sandbox
+
'dir_2'
)
=>
[
Pathname
.
new
(
'BananaLib/sub_dir/dir_2/banana_2.h'
)
],
(
headers_sandbox
+
'dir_2'
)
=>
[
header_2
],
}
}
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