Module: Octokit::Client::Stats

Included in:
Octokit::Client
Defined in:
lib/octokit/client/stats.rb

Overview

Methods for the Repository Statistics API

Instance Method Summary collapse

Instance Method Details

#code_frequency_stats(repo, options = {}) ⇒ Array<Sawyer::Resource>

Get the number of additions and deletions per week

Examples:

Get code frequency stats for octokit

@client.code_frequency_stats('octokit/octokit.rb')

See Also:


47
48
49
# File 'lib/octokit/client/stats.rb', line 47

def code_frequency_stats(repo, options = {})
  get_stats(repo, "code_frequency", options)
end

#commit_activity_stats(repo, options = {}) ⇒ Array<Sawyer::Resource>

Get the last year of commit activity data

Examples:

Get commit activity for octokit

@client.commit_activity_stats('octokit/octokit.rb')

See Also:


33
34
35
# File 'lib/octokit/client/stats.rb', line 33

def commit_activity_stats(repo, options = {})
  get_stats(repo, "commit_activity", options)
end

#contributors_stats(repo, options = {}) ⇒ Array<Sawyer::Resource> Also known as: contributor_stats

Get contributors list with additions, deletions, and commit counts

Examples:

Get contributor stats for octokit

@client.contributors_stats('octokit/octokit.rb')

See Also:


18
19
20
# File 'lib/octokit/client/stats.rb', line 18

def contributors_stats(repo, options = {})
  get_stats(repo, "contributors", options)
end

#participation_stats(repo, options = {}) ⇒ Sawyer::Resource

Get the weekly commit count for the repo owner and everyone else

Examples:

Get weekly commit counts for octokit

@client.participation_stats("octokit/octokit.rb")

See Also:


63
64
65
# File 'lib/octokit/client/stats.rb', line 63

def participation_stats(repo, options = {})
  get_stats(repo, "participation", options)
end

#punch_card_stats(repo, options = {}) ⇒ Array<Array> Also known as: punch_card

Get the number of commits per hour in each day

Examples:

Get octokit punch card

@octokit.punch_card_stats

See Also:


77
78
79
# File 'lib/octokit/client/stats.rb', line 77

def punch_card_stats(repo, options = {})
  get_stats(repo, "punch_card", options)
end