lib/octokit/client/stats.rb in octokit-2.7.2 vs lib/octokit/client/stats.rb in octokit-3.0.0.pre

- old
+ new

@@ -8,11 +8,11 @@ # Get contributors list with additions, deletions, and commit counts # # @param repo [String, Hash, Repository] A GitHub repository # @return [Array<Sawyer::Resource>] Array of contributor stats - # @see http://developer.github.com/v3/repos/statistics/#get-contributors-list-with-additions-deletions-and-commit-counts + # @see http://developer.github.com/v3/repos/statistics/#contributors # @example Get contributor stats for octokit # @client.contributors_stats('octokit/octokit.rb') def contributors_stats(repo, options = {}) get_stats(repo, "contributors", options) end @@ -33,11 +33,11 @@ # Get the number of additions and deletions per week # # @param repo [String, Hash, Repository] A GitHub repository # @return [Array<Sawyer::Resource>] Weekly aggregate of the number of additions # and deletions pushed to a repository. - # @see http://developer.github.com/v3/repos/statistics/#get-the-number-of-additions-and-deletions-per-week + # @see http://developer.github.com/v3/repos/statistics/#code-frequency # @example Get code frequency stats for octokit # @client.code_frequency_stats('octokit/octokit.rb') def code_frequency_stats(repo, options = {}) get_stats(repo, "code_frequency", options) end @@ -47,11 +47,11 @@ # @param repo [String, Hash, Repository] A GitHub repository # @return [Sawyer::Resource] Total commit counts for the owner and total commit # counts in all. all is everyone combined, including the owner in the last # 52 weeks. If you’d like to get the commit counts for non-owners, you can # subtract all from owner. - # @see http://developer.github.com/v3/repos/statistics/#get-the-weekly-commit-count-for-the-repo-owner-and-everyone-else + # @see http://developer.github.com/v3/repos/statistics/#participation # @example Get weekly commit counts for octokit # @client.participation_stats("octokit/octokit.rb") def participation_stats(repo, options = {}) get_stats(repo, "participation", options) end @@ -59,11 +59,11 @@ # Get the number of commits per hour in each day # # @param repo [String, Hash, Repository] A GitHub repository # @return [Array<Array>] Arrays containing the day number, hour number, and # number of commits - # @see http://developer.github.com/v3/repos/statistics/#get-the-number-of-commits-per-hour-in-each-day + # @see http://developer.github.com/v3/repos/statistics/#punch-card # @example Get octokit punch card # @octokit.punch_card_stats def punch_card_stats(repo, options = {}) get_stats(repo, "punch_card", options) end @@ -75,10 +75,10 @@ # # @param repo [String, Hash, Repository] A GitHub repository # @param metric [String] The metrics you are looking for # @return [Array<Sawyer::Resource>] Magical unicorn stats def get_stats(repo, metric, options = {}) - data = get("repos/#{Repository.new repo}/stats/#{metric}", options) + data = get("repos/#{Repository.new(repo)}/stats/#{metric}", options) last_response.status == 202 ? nil : data end end end