Sha256: 6c4b6a4ccbefd1c88ed2fce0107e8dab6e577cb793e0619bf5cf8f10a4903880
Contents?: true
Size: 1.85 KB
Versions: 14
Compression:
Stored size: 1.85 KB
Contents
#!/usr/bin/env ruby # frozen_string_literal: true require 'date' require 'optparse' require 'pry' require_relative '../lib/github_repo_statistics/version' require_relative '../lib/github_repo_statistics/release_merge_report' options = {} OptionParser.new do |opts| opts.banner = 'Usage: github_repo_statistics [options]' opts.on('--duration-in-days STRING', 'Number of days to aggregate the changes for [default: 90]') do |duration_in_days| options[:duration_in_days] = duration_in_days.to_i end opts.on('--default-branch STRING', 'The default branch to pull and run metrics for [default: master]') do |default_branch| options[:default_branch] = default_branch end opts.on('--github-token STRING', 'GitHub API token [default: ""]') do |github_token| options[:github_token] = github_token end opts.on('--github-repo STRING', 'GitHub repository name and owner (e.g. octokit/octokit) [default: ""]') do |github_repo| options[:github_repo] = github_repo end opts.on('-v', '--version', 'Display the version of the gem') do puts "github_repo_statistics version #{GithubRepoStatistics::VERSION}" exit end opts.on('-h', '--help', 'Display this help message') do puts opts puts <<~EXAMPLES Examples: review_report --github-token ghp_bKasj29ndkfdksf3rjt2ngi43j --github-repo octokit/octokit EXAMPLES exit end end.parse! DEFAULT_BRANCH = options[:default_branch] || 'master' raise 'Please provide GitHub token using --github-token flag' if options[:github_token].nil? raise 'Please provide GitHub repo name using --github-repo flag' if options[:github_repo].nil? raise 'Please provide default GitHub branch using --default-branch flag' if DEFAULT_BRANCH.nil? ReleaseMergeReport.new(token: options[:github_token], repo: options[:github_repo], branch_prefix: "release/").report
Version data entries
14 entries across 14 versions & 1 rubygems