Metrics doesn't catch GitHub repositories with a dot in the name
kylef opened this issue · 3 comments
kylef commented
Regex over at https://github.com/CocoaPods/metrics.cocoapods.org/blob/master/lib/metrics/github.rb#L94 seems invalid, you can find an example of a pod that causes this: http://metrics.cocoapods.org/api/v1/pods/URITemplate
matches = url.match(%r{[:/](?<user>[^/]+)/(?<repo>[^/\.]+)(\.git)?\z})
kylef commented
Here's a test case showing this behaviour
describe 'with a dot in the repository name' do
before do
@github = Metrics::Github.new
@github.initialize_client('https://github.com/kylef/URITemplate.swift.git')
end
it 'has the right user' do
@github.user.should == 'kylef'
end
it 'has the right repo' do
@github.repo.should == 'URITemplate.swift'
end
end
floere commented
Nice work! Looking forward to your pull request :)