-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5dc74bd
commit 56a40a7
Showing
7 changed files
with
66 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module Pod | ||
|
||
# Allows to access information about the GitHub repos. | ||
# | ||
# This class is stored in Core because it might be used by web services. | ||
# | ||
module GitHub | ||
|
||
# Returns the information about a GitHub repo. | ||
# | ||
# @param [String] The url of the repo. | ||
# | ||
# @return [Hash] The hash containing the data as reported by GtiHub. | ||
# | ||
def self.fetch_github_repo_data(url) | ||
require 'rest' | ||
require 'json' | ||
if repo_id = url[/github.com\/([^\/\.]*\/[^\/\.]*)\.*/, 1] | ||
url = "https://api.github.com/repos/#{repo_id}" | ||
response = REST.get(url) | ||
JSON.parse(response.body) | ||
end | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters