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
b2e7ff6d
Commit
b2e7ff6d
authored
Oct 17, 2014
by
Kurry Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes crash when using file URLs
https://github.com/CocoaPods/CocoaPods/issues/2683
parent
8576267d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
CHANGELOG.md
CHANGELOG.md
+3
-0
sources_manager.rb
lib/cocoapods/sources_manager.rb
+12
-2
sources_manager_spec.rb
spec/unit/sources_manager_spec.rb
+12
-0
No files found.
CHANGELOG.md
View file @
b2e7ff6d
...
...
@@ -28,6 +28,9 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[
#2627
](
https://github.com/CocoaPods/CocoaPods/issues/2627
)
[
#2665
](
https://github.com/CocoaPods/CocoaPods/issues/2665
)
*
Fixes a crash when using file URLs as a source.
[
Kurry Tran
](
https://github.com/kurry
)
[
#2683
](
https://github.com/CocoaPods/CocoaPods/issues/2683
)
## 0.34.2
...
...
lib/cocoapods/sources_manager.rb
View file @
b2e7ff6d
...
...
@@ -410,6 +410,11 @@ module Pod
# name_for_url('https://sourceforge.org/Artsy/Specs.git')
# # sourceforge-artsy-specs
#
# @example A file URL
#
# name_for_url('file:///Artsy/Specs.git')
# # artsy-specs
#
# @param [#to_s] url
# The URL of the source.
#
...
...
@@ -417,8 +422,13 @@ module Pod
#
def
name_for_url
(
url
)
base_from_host_and_path
=
lambda
do
|
host
,
path
|
base
=
host
.
split
(
'.'
)[
-
2
]
||
host
base
+=
'-'
+
path
.
gsub
(
/.git$/
,
''
).
gsub
(
/^\//
,
''
).
if
host
.
nil?
base
=
''
else
base
=
host
.
split
(
'.'
)[
-
2
]
||
host
base
+=
'-'
end
base
+=
path
.
gsub
(
/.git$/
,
''
).
gsub
(
/^\//
,
''
).
split
(
'/'
).
join
(
'-'
)
end
...
...
spec/unit/sources_manager_spec.rb
View file @
b2e7ff6d
...
...
@@ -138,6 +138,18 @@ module Pod
SourcesManager
.
send
(
:name_for_url
,
url
).
should
==
'companyalias-pod-specs'
end
it
'supports file URLs'
do
url
=
'file:///Users/kurrytran/pod-specs'
SourcesManager
.
send
(
:name_for_url
,
url
).
should
==
'users-kurrytran-pod-specs'
end
it
'uses the repo name if no parent directory'
do
url
=
'file:///pod-specs'
SourcesManager
.
send
(
:name_for_url
,
url
).
should
==
'pod-specs'
end
it
'supports ssh URLs with no user component'
do
url
=
'ssh://company.com/pods/specs.git'
...
...
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