-
-
Notifications
You must be signed in to change notification settings - Fork 94
/
generate-humans
executable file
·51 lines (44 loc) · 1.32 KB
/
generate-humans
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env ruby
FORMAT = <<~OUTPUT
________
< ONRUBY >
--------
\\ ^__^
\\ (oo)\_______
(__)\ )\\/\\
||----w |
|| ||
/* MAINTAINER */
Peter Schröder (Señor Developer)
Site: https://github.com/phoet
Location: Hamburg, Germany
/* COMMITTERS */
%{commiters}
OUTPUT
FALLBACKS = {
'phoet' => 'Peter Schröder',
'Peter Schröder' => 'Peter Schröder',
'ralph' => 'Ralph von der Heyden',
'rubiii' => 'Daniel Harrington',
'titanoboa' => 'Kerstin Puschke',
'weidenfreak' => 'Meike Wiemann',
'Marco' => 'Marco Schaden',
'Enrique García Cota' => 'Enrique García',
'Benny' => 'Benny Klotz',
'Christoph' => 'Christoph Geschwind',
'Maxim' => 'Maxim Küpper',
'Bascht' => 'Sebastian Schulze',
'rocky-jaiswal' => 'Rocky Jaiswal',
'kikito' => 'Enrique García',
}.freeze
IGNORES = [
/depfu/,
/dependabot/
].freeze
commiters = `git log --format='%aN' | sort -u`
commiters = commiters.split("\n")
commiters = commiters.reject { |c| IGNORES.any? { |pattern| c =~ pattern } }
commiters = commiters.map { |c| " #{FALLBACKS[c] || c}" }.uniq.sort.join("\n\n")
output = format(FORMAT, commiters:)
path = File.expand_path('../public/humans.txt', File.dirname(__FILE__))
File.open(path, 'w') { |file| file.write(output) }