<commit_before>#!/usr/bin/env ruby
#
# Copyright (C) 2017 KuoE0 <<EMAIL>>
#
# Distributed under terms of the MIT license.

require 'json'

def run_system_cmd(cmd)
	puts cmd
	system(cmd)
end

def run_brew_tap(tap_list)
	for tap in tap_list
		cmd = "brew tap #{tap}"
		run_system_cmd(cmd)
	end
	run_system_cmd("brew update")
end

def run_brew_install(pkg_name, pkg_args)
	cmd_list = ['brew', 'install', pkg_name]
	if !pkg_args.nil?
		cmd_list.push(*pkg_args)
	end
	cmd = cmd_list.join(' ')
	run_system_cmd(cmd)
end

def run_brew_cask_install(pkg_name, pkg_args)
	cmd_list = ['brew', 'cask', 'install', pkg_name]
	if !pkg_args.nil?
		cmd_list.push(*pkg_args)
	end
	cmd = cmd_list.join(' ')
	run_system_cmd(cmd)
end

run_system_cmd("brew update")

tap_list = ["caskroom/cask", "caskroom/versions", "caskroom/fonts"]
run_brew_tap(tap_list)

message_list = Hash.new<commit_msg>use reinstall to ignore previously install for dependency<commit_after>#!/usr/bin/env ruby
#
# Copyright (C) 2017 KuoE0 <<EMAIL>>
#
# Distributed under terms of the MIT license.

require 'json'

def run_system_cmd(cmd)
	puts cmd
	system(cmd)
end

def run_brew_tap(tap_list)
	for tap in tap_list
		cmd = "brew tap #{tap}"
		run_system_cmd(cmd)
	end
	run_system_cmd("brew update")
end

def run_brew_install(pkg_name, pkg_args)
	# use `reinstall` to ignore previously install for dependency
	cmd_list = ['brew', 'reinstall', pkg_name]
	if !pkg_args.nil?
		cmd_list.push(*pkg_args)
	end
	cmd = cmd_list.join(' ')
	run_system_cmd(cmd)
end

def run_brew_cask_install(pkg_name, pkg_args)
	cmd_list = ['brew', 'cask', 'install', pkg_name]
	if !pkg_args.nil?
		cmd_list.push(*pkg_args)
	end
	cmd = cmd_list.join(' ')
	run_system_cmd(cmd)
end

run_system_cmd("brew update")

tap_list = ["caskroom/cask", "caskroom/versions", "caskroom/fonts"]
run_brew_tap(tap_list)

message_list = Hash.new
{'fraction_non_alphanumeric': 0.12911939492166397, 'fraction_numerical': 0.005402485143165856, 'mean_word_length': 5.475524475524476, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '771401', 'n_tokens_mistral': 788, 'n_tokens_neox': 743, 'n_words': 168}