Commit bdebd670 authored by Fabio Pelosin's avatar Fabio Pelosin

[#177] Fix for GitHub repos missing final .git in the source

parent 735d6bbc
...@@ -39,10 +39,9 @@ module Pod ...@@ -39,10 +39,9 @@ module Pod
url = source[:git] || source[:hg] || source[:svn] || source[:local] url = source[:git] || source[:hg] || source[:svn] || source[:local]
puts " - Source: #{url}" if url puts " - Source: #{url}" if url
if url =~ /github.com/ if url =~ /github.com/
original_url, username, reponame = *(url.match(/[:\/](\w+)\/(\w+).git/).to_a) original_url, username, reponame = *(url.match(/[:\/](\w+)\/(\w+)(.git)?/).to_a)
if original_url if original_url
repo_info = `curl -s -m 2 http://github.com/api/v2/json/repos/show/#{username}/#{reponame}` repo_info = `curl -s -m 2 http://github.com/api/v2/json/repos/show/#{username}/#{reponame}`
puts repo_info
watchers = repo_info.match(/\"watchers\"\W*:\W*([0-9]+)/).to_a[1] watchers = repo_info.match(/\"watchers\"\W*:\W*([0-9]+)/).to_a[1]
forks = repo_info.match(/\"forks\"\W*:\W*([0-9]+)/).to_a[1] forks = repo_info.match(/\"forks\"\W*:\W*([0-9]+)/).to_a[1]
puts " - Watchers: " + watchers if watchers puts " - Watchers: " + watchers if watchers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment