ruby-changes:56782
From: Nobuyoshi <ko1@a...>
Date: Sat, 3 Aug 2019 14:22:17 +0900 (JST)
Subject: [ruby-changes:56782] Nobuyoshi Nakada: 4d75346187 (master): Refine error message
https://git.ruby-lang.org/ruby.git/commit/?id=4d75346187 From 4d75346187557ae59736ca5739bfae312c285e08 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sat, 3 Aug 2019 14:20:36 +0900 Subject: Refine error message Highlight failed command and suggest installing the command. [Bug #16042] diff --git a/tool/pure_parser.rb b/tool/pure_parser.rb index 4d5e86e..9ab6638 100755 --- a/tool/pure_parser.rb +++ b/tool/pure_parser.rb @@ -4,7 +4,12 @@ BEGIN { https://github.com/ruby/ruby/blob/trunk/tool/pure_parser.rb#L4 colorize = Colorize.new file = ARGV.shift - unless /\Abison .* (\d+)\.\d+/ =~ IO.popen(ARGV+%w[--version], &:read) + begin + version = IO.popen(ARGV+%w[--version], &:read) + rescue Errno::ENOENT + abort "Failed to run `#{colorize.fail ARGV.join(' ')}'; You may have to install it." + end + unless /\Abison .* (\d+)\.\d+/ =~ version puts colorize.fail("not bison") exit end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/