CocoaPods/metrics.cocoapods.org

Metrics doesn't catch GitHub repositories with a dot in the name

kylef opened this issue · 3 comments

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})

https://github.com/kylef/URITemplate.swift

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

Nice work! Looking forward to your pull request :)

Fixed by 2412f31

@floere feel free to commit that test if it actually works.