From cc09ce8efe26a6dda2dc932b8939d2cc1e95ee8c Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Fri, 24 Mar 2017 21:12:56 +0900 Subject: [PATCH] The version table was broken (GitHub-flavored markdown changed?) --- README.md | 3 +-- src/README.md.gen.rb | 13 ++++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7c35356f..0cabba7f 100644 --- a/README.md +++ b/README.md @@ -242,8 +242,7 @@ I used the following Ubuntu deb packages to test this program. 61 |Groovy |groovy |2.4.7-2 62 |Haskell |ghc |7.10.3-9ubuntu1 63 |Haxe |haxe |1:3.2.1+dfsg-1build3 -64 |Icon |icont |9.4.3-4.2ubuntu1 - | |iconx |9.4.3-4.2ubuntu1 +64 |Icon |icont, iconx |9.4.3-4.2ubuntu1 65 |INTERCAL |intercal |30:0.30-1 66 |Jasmin |jasmin-sable |2.5.0-1 67 |Java |openjdk-8-jdk |8u121-b13-0ubuntu1.16.10.2 diff --git a/src/README.md.gen.rb b/src/README.md.gen.rb index 262cf339..dbc92431 100644 --- a/src/README.md.gen.rb +++ b/src/README.md.gen.rb @@ -16,10 +16,17 @@ end rows = [["\\#", "language", "ubuntu package", "version"]] -rows += RunSteps.flat_map.with_index do |s, idx| - (s.apt.is_a?(Array) ? s.apt : [s.apt]).map.with_index do |apt, i| - [i == 0 ? (idx + 1).to_s : "", i == 0 ? s.name : "", apt || "*N/A*", pkg_versions[apt] || '-'] +rows += RunSteps.map.with_index do |s, idx| + if s.apt.is_a?(Array) + apt = s.apt.join(", ") + ver = pkg_versions.values_at(*s.apt) + raise if ver.uniq.size > 1 + ver = ver.first + else + apt = s.apt || "*N/A*" + ver = pkg_versions[apt] end + [(idx + 1).to_s, s.name, apt, ver || "-"] end ws = rows.transpose.map {|row| row.map {|s| s.size }.max + 1 }