1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

pure_parser.rb: get rid of an error at localed messages

This commit is contained in:
Nobuyoshi Nakada 2020-05-20 10:52:32 +09:00
parent 67d259c5dc
commit 2480ef904c
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -1,11 +1,14 @@
#!/usr/bin/ruby -pi.bak
BEGIN {
# pathological setting
ENV['LANG'] = ENV['LC_MESSAGES'] = ENV['LC_ALL'] = 'C'
require_relative 'lib/colorize'
colorize = Colorize.new
file = ARGV.shift
begin
version = IO.popen(ARGV+%w[--version], &:read)
version = IO.popen(ARGV+%w[--version], "rb", &:read)
rescue Errno::ENOENT
abort "Failed to run `#{colorize.fail ARGV.join(' ')}'; You may have to install it."
end