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
41b56a5d
Unverified
Commit
41b56a5d
authored
May 30, 2018
by
D. Koutsogiorgas
Committed by
GitHub
May 30, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7794 from dnkoutso/fix_uri_parsing_ssh_git
Fix source validation for local URLs and SSH repos
parents
161ac76b
4cd3ef63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
pod_source_installer.rb
lib/cocoapods/installer/pod_source_installer.rb
+3
-1
pod_source_installer_spec.rb
spec/unit/installer/pod_source_installer_spec.rb
+24
-0
No files found.
lib/cocoapods/installer/pod_source_installer.rb
View file @
41b56a5d
...
@@ -123,7 +123,9 @@ module Pod
...
@@ -123,7 +123,9 @@ module Pod
source
=
if
!
root_spec
.
source
[
:http
].
nil?
source
=
if
!
root_spec
.
source
[
:http
].
nil?
URI
(
root_spec
.
source
[
:http
].
to_s
)
URI
(
root_spec
.
source
[
:http
].
to_s
)
elsif
!
root_spec
.
source
[
:git
].
nil?
elsif
!
root_spec
.
source
[
:git
].
nil?
URI
(
root_spec
.
source
[
:git
].
to_s
)
git_source
=
root_spec
.
source
[
:git
].
to_s
return
unless
git_source
=~
/^
#{
URI
.
regexp
}
$/
URI
(
git_source
)
end
end
if
UNENCRYPTED_PROTOCOLS
.
include?
(
source
.
scheme
)
if
UNENCRYPTED_PROTOCOLS
.
include?
(
source
.
scheme
)
UI
.
warn
"'
#{
root_spec
.
name
}
' uses the unencrypted '
#{
source
.
scheme
}
' protocol to transfer the Pod. "
\
UI
.
warn
"'
#{
root_spec
.
name
}
' uses the unencrypted '
#{
source
.
scheme
}
' protocol to transfer the Pod. "
\
...
...
spec/unit/installer/pod_source_installer_spec.rb
View file @
41b56a5d
...
@@ -62,6 +62,30 @@ module Pod
...
@@ -62,6 +62,30 @@ module Pod
UI
.
warnings
.
should
.
include
'uses the unencrypted \'git\' protocol'
UI
.
warnings
.
should
.
include
'uses the unencrypted \'git\' protocol'
end
end
it
'does not warn for local repositories with spaces'
do
@spec
.
source
=
{
:git
=>
'/Users/kylef/Projects X'
,
:tag
=>
'1.0'
}
dummy_response
=
Pod
::
Downloader
::
Response
.
new
Downloader
.
stubs
(
:download
).
returns
(
dummy_response
)
@installer
.
install!
UI
.
warnings
.
length
.
should
.
equal
(
0
)
end
it
'does not warn for SSH repositories'
do
@spec
.
source
=
{
:git
=>
'git@bitbucket.org:kylef/test.git'
,
:tag
=>
'1.0'
}
dummy_response
=
Pod
::
Downloader
::
Response
.
new
Downloader
.
stubs
(
:download
).
returns
(
dummy_response
)
@installer
.
install!
UI
.
warnings
.
length
.
should
.
equal
(
0
)
end
it
'does not warn for SSH repositories on Github'
do
@spec
.
source
=
{
:git
=>
'git@github.com:kylef/test.git'
,
:tag
=>
'1.0'
}
dummy_response
=
Pod
::
Downloader
::
Response
.
new
Downloader
.
stubs
(
:download
).
returns
(
dummy_response
)
@installer
.
install!
UI
.
warnings
.
length
.
should
.
equal
(
0
)
end
#--------------------------------------#
#--------------------------------------#
describe
'Prepare command'
do
describe
'Prepare command'
do
...
...
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