Module: CodeReviewLeaderboard

Extended by:
CodeReviewLeaderboard
Included in:
CodeReviewLeaderboard
Defined in:
lib/adapters/github.rb,
lib/code_review_leaderboard.rb,
lib/code_review_leaderboard/pulls.rb,
lib/code_review_leaderboard/config.rb,
lib/code_review_leaderboard/reviews.rb,
lib/code_review_leaderboard/spinner.rb,
lib/code_review_leaderboard/version.rb,
lib/code_review_leaderboard/formatter.rb,
lib/code_review_leaderboard/repository.rb,
lib/code_review_leaderboard/organization.rb,
lib/code_review_leaderboard/argument_parser.rb

Defined Under Namespace

Modules: Adapters, ArgumentParser, Config, Spinner Classes: Formatter, Organization, Pulls, Repository, Reviews

Constant Summary collapse

ConfigurationError =
Class.new(StandardError)
VERSION =
"0.1.1"

Instance Method Summary collapse

Instance Method Details

#initialize!Object

Raises:



16
17
18
19
20
21
# File 'lib/code_review_leaderboard.rb', line 16

def initialize!
  Config.initialize!

  raise ConfigurationError, "Access token is required" if Config.access_token.nil?
  raise ConfigurationError, "Repository or owner is required" if Config.repositories.empty? && Config.organization.blank?
end

#startObject



23
24
25
26
27
28
29
30
# File 'lib/code_review_leaderboard.rb', line 23

def start
  puts "Found #{repositories.size} repositories" if Config.organization.present? && Config.log_level == :debug
  puts "Found #{pulls.size} pull requests."
  puts "Found #{reviews.size} reviews."
  puts

  puts Formatter.new(reviews).to_table
end