<commit_before>require "github_bus_factor/version"
require 'rubygems'
require 'commander/import'
require 'octokit'
require 'security'
require 'terminal-table'
require 'faraday-http-cache'
require 'action_view'
require 'active_support/core_ext/numeric/time'
include ActionView::Helpers::DateHelper



module GitHubBusFactor
	KEYCHAIN_SERVICE = 'github_bus_factor'
	API_CALL_RETRY_COUNT = 3


	program :version, '0.1.4'
	program :description, 'More than just stars'
	default_command :fetch

	# There must be a better way to deal with GitHub caching… 
	def GitHubBusFactor.helper(count, block)
		return unless count > 0
		return if !block.call(count).nil?
		puts "Waiting for GitHub cache. Will retry in 3 seconds…"
		sleep(3)
		helper(count - 1, block)
	end


	command :about do |c|
		c.syntax = 'github_bus_factor about'
		c.summary = 'Explains every line of the report.'
		c.action do |args, options|
			table = Terminal::Table.new do |t|
				t.style = {:padding_left => 1, :padding_right => 2}
				t.title = 'GitHub Score'
				t.headings = ['', 'Description']<commit_msg>Code style<commit_after>require 'github_bus_factor/version'
require 'rubygems'
require 'commander/import'
require 'octokit'
require 'security'
require 'terminal-table'
require 'faraday-http-cache'
require 'action_view'
require 'active_support/core_ext/numeric/time'
include ActionView::Helpers::DateHelper


module GitHubBusFactor
	KEYCHAIN_SERVICE = 'github_bus_factor'
	API_CALL_RETRY_COUNT = 3


	program :version, '0.1.4'
	program :description, 'More than just stars'
	default_command :fetch

	# There must be a better way to deal with GitHub caching… 
	def GitHubBusFactor.helper(count, block)
		return unless count > 0
		return if !block.call(count).nil?
		puts "Waiting for GitHub cache. Will retry in 3 seconds…"
		sleep(3)
		helper(count - 1, block)
	end


	command :about do |c|
		c.syntax = 'github_bus_factor about'
		c.summary = 'Explains every line of the report.'
		c.action do |args, options|
			table = Terminal::Table.new do |t|
				t.style = {:padding_left => 1, :padding_right => 2}
				t.title = 'GitHub Score'
				t.headings = ['', 'Description']
{'fraction_non_alphanumeric': 0.10934579439252337, 'fraction_numerical': 0.009345794392523364, 'mean_word_length': 4.619422572178478, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3915848', 'n_tokens_mistral': 787, 'n_tokens_neox': 701, 'n_words': 210}