-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate_names.sf
38 lines (35 loc) · 1.02 KB
/
update_names.sf
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
#!/usr/bin/sidef
# Change the names of the interpreters inside the generated reports.
var replaces = Hash(
'Elixir' => 'Elixir 1.5.1',
'Julia' => 'Julia 0.6.0',
'OCaml' => 'OCaml 4.05.0',
'Groovy' => 'Groovy 2.4.12',
'LuaJIT' => 'LuaJIT 2.0.5',
'PyPy' => 'PyPy 5.8.0',
'Crystal' => 'Crystal 0.23.1',
'Scala' => 'Scala 2.12.3',
'PHP' => 'PHP 7.1.9',
'Python 2' => 'Python 2.7.14',
'Python 3' => 'Python 3.6.2',
'JRuby' => 'JRuby 9.1.12',
'mRuby' => 'mRuby 1.3.0',
'AWK (mawk)', 'Mawk 1.3.4',
'Perl6 MoarVM' => 'Rakudo 2017.09',
'Ruby' => 'Ruby 2.4.2',
'Lua' => 'Lua 5.3.4',
'Perl' => 'Perl 5.26.1',
'AWK (gawk)' => 'Gawk 4.1.4',
'Clojure' => 'Clojure 1.8.0',
'Tcl' => 'Tcl 8.6.7',
'Pike' => 'Pike 8.0.438',
)
glob("Reports/Interpreted/*").each { |file|
file ~~ /\.csv\z/ || next
File(file).edit { |line|
replaces.each_kv { |key, value|
line.sub!(Regex('^"?\K' + key.escape + '(?="?,)', 'i'), value)
}
line
}
}