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
cc2fc7e1
Commit
cc2fc7e1
authored
Apr 15, 2014
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ExternalSources::PathSource] Fix relative path detection
Closes
https://github.com/CocoaPods/CocoaPods/issues/2050
parent
583d5448
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
path_source.rb
lib/cocoapods/external_sources/path_source.rb
+1
-1
sandbox.rb
lib/cocoapods/sandbox.rb
+2
-2
path_source_spec.rb
spec/unit/external_sources/path_source_spec.rb
+21
-0
No files found.
lib/cocoapods/external_sources/path_source.rb
View file @
cc2fc7e1
...
@@ -19,7 +19,7 @@ module Pod
...
@@ -19,7 +19,7 @@ module Pod
"`
#{
declared_path
}
`"
"`
#{
declared_path
}
`"
end
end
store_podspec
(
sandbox
,
podspec
)
store_podspec
(
sandbox
,
podspec
)
is_absolute
=
absolute?
(
podspec
)
is_absolute
=
absolute?
(
declared_path
)
sandbox
.
store_local_path
(
name
,
podspec
.
dirname
,
is_absolute
)
sandbox
.
store_local_path
(
name
,
podspec
.
dirname
,
is_absolute
)
end
end
end
end
...
...
lib/cocoapods/sandbox.rb
View file @
cc2fc7e1
...
@@ -159,7 +159,7 @@ module Pod
...
@@ -159,7 +159,7 @@ module Pod
root
+
root_name
root
+
root_name
end
end
end
end
# Returns true if the path as originally specified was absolute.
# Returns true if the path as originally specified was absolute.
#
#
# @param [String] name
# @param [String] name
...
@@ -169,7 +169,7 @@ module Pod
...
@@ -169,7 +169,7 @@ module Pod
def
local_path_was_absolute?
(
name
)
def
local_path_was_absolute?
(
name
)
@pods_with_absolute_path
.
include?
name
@pods_with_absolute_path
.
include?
name
end
end
# @return [Pathname] the directory where to store the documentation.
# @return [Pathname] the directory where to store the documentation.
#
#
def
documentation_dir
def
documentation_dir
...
...
spec/unit/external_sources/path_source_spec.rb
View file @
cc2fc7e1
...
@@ -42,6 +42,22 @@ module Pod
...
@@ -42,6 +42,22 @@ module Pod
should
.
raise
Informative
do
should
.
raise
Informative
do
@subject
.
fetch
(
config
.
sandbox
)
@subject
.
fetch
(
config
.
sandbox
)
end
.
message
.
should
.
match
/No podspec found for `Reachability` in `
#{
temporary_directory
}
`/
end
.
message
.
should
.
match
/No podspec found for `Reachability` in `
#{
temporary_directory
}
`/
it
"marks a pod as relative"
do
@subject
.
stubs
(
:params
).
returns
(
:path
=>
'./Reachability'
)
Pathname
.
any_instance
.
stubs
(
:exist?
).
returns
(
true
)
config
.
sandbox
.
stubs
(
:store_podspec
)
@subject
.
fetch
(
config
.
sandbox
)
config
.
sandbox
.
local_path_was_absolute?
(
'Reachability'
).
should
.
be
.
false
end
it
"marks a pod as absolute"
do
@subject
.
stubs
(
:params
).
returns
(
:path
=>
'/path/Reachability'
)
Pathname
.
any_instance
.
stubs
(
:exist?
).
returns
(
true
)
config
.
sandbox
.
stubs
(
:store_podspec
)
@subject
.
fetch
(
config
.
sandbox
)
config
.
sandbox
.
local_path_was_absolute?
(
'Reachability'
).
should
.
be
.
true
end
end
end
describe
"#podspec_path"
do
describe
"#podspec_path"
do
...
@@ -79,6 +95,11 @@ module Pod
...
@@ -79,6 +95,11 @@ module Pod
result
.
should
.
be
.
false
result
.
should
.
be
.
false
end
end
it
"consider relative paths not explicitly set from the current dir"
do
result
=
@subject
.
send
(
:absolute?
,
'./ThirdPartyCode/UrbanAirship'
)
result
.
should
.
be
.
false
end
it
'returns that a path is absolute'
do
it
'returns that a path is absolute'
do
result
=
@subject
.
send
(
:absolute?
,
'/path/to/UrbanAirship'
)
result
=
@subject
.
send
(
:absolute?
,
'/path/to/UrbanAirship'
)
result
.
should
.
be
.
true
result
.
should
.
be
.
true
...
...
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