From e930431d16ad6292a364cbc9bc6a4ee99de5d397 Mon Sep 17 00:00:00 2001 From: Daniel Khamsing Date: Wed, 27 Jul 2016 14:51:37 -0700 Subject: [PATCH] [script] history --- .github/osia_get_history.rb | 24 +++++++++++ .github/osia_history_missing.rb | 12 ++++++ .github/osia_update_history.rb | 74 +++++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 .github/osia_get_history.rb create mode 100644 .github/osia_history_missing.rb create mode 100644 .github/osia_update_history.rb diff --git a/.github/osia_get_history.rb b/.github/osia_get_history.rb new file mode 100644 index 00000000..4e519814 --- /dev/null +++ b/.github/osia_get_history.rb @@ -0,0 +1,24 @@ +require_relative 'osia_helper' + +HISTORY = 'git_history' + +j = get_json +apps = j['projects'] + +h = {} +apps.each_with_index do |a, i| + t = a['title'] + puts "#{i + 1}/#{apps.count}. checking #{t}" + command = "git log --all --grep='#{t}'" + + begin + r = `#{command}` + rescue e + r = e + end + + h[t] = r +end + +File.open(HISTORY, 'w') { |f| f.write JSON.pretty_generate h } +puts "wrote #{HISTORY} ✨" diff --git a/.github/osia_history_missing.rb b/.github/osia_history_missing.rb new file mode 100644 index 00000000..2c9be042 --- /dev/null +++ b/.github/osia_history_missing.rb @@ -0,0 +1,12 @@ +require_relative 'osia_helper' + +j = get_json +apps = j['projects'] + +i = 0 +apps.each do |a| + if a['date_added'].nil? + puts "#{i + 1}. History missing for #{a['title']}" + i = i + 1 + end +end diff --git a/.github/osia_update_history.rb b/.github/osia_update_history.rb new file mode 100644 index 00000000..00e9dca2 --- /dev/null +++ b/.github/osia_update_history.rb @@ -0,0 +1,74 @@ +require_relative 'osia_helper' + +require 'awesome_print' +require 'colored' + +HISTORY = 'git_history' + +def get_author(a) + a = a.gsub 'Author:', '' + + u = + if a.include? 'users.noreply.github.com>' + m = /<.*?@/.match a + '@' + m[0].sub('@','') + else + m = /.*