Skip to content

Commit 6e1dfba

Browse files
committed
fix non-trailing /specs removal and add a test
1 parent c6d5dcf commit 6e1dfba

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/cocoapods-core/source/manager.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def name_for_url(url)
434434
end
435435

436436
path = path.gsub(/.git$/, '').gsub(%r{^/}, '').split('/')
437-
path.delete('specs')
437+
path.pop if path.last == 'specs'
438438

439439
(base + path).join('-')
440440
end

spec/source/manager_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ module Pod
220220
should == 'sourceforge-artsy'
221221
end
222222

223+
it 'does not remove /specs path component if it is not the last one' do
224+
url = 'https://sourceforge.org.au/Specs/Path/Repo.git'
225+
@sources_manager.send(:name_for_url, url).should == 'sourceforge-specs-path-repo'
226+
end
227+
223228
it 'can understand arbitrary URI schemes' do
224229
url = 'banana://website.org/Artsy/Specs.git'
225230
@sources_manager.send(:name_for_url, url).

0 commit comments

Comments
 (0)