ruby-changes:61737
From: Akinori <ko1@a...>
Date: Tue, 16 Jun 2020 23:26:29 +0900 (JST)
Subject: [ruby-changes:61737] b877928ca5 (master): Fix the ArgumentError message in shellsplit
https://git.ruby-lang.org/ruby.git/commit/?id=b877928ca5 From b877928ca562ce1769d821769d3e417ed973b156 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA <knu@i...> Date: Tue, 16 Jun 2020 23:23:13 +0900 Subject: Fix the ArgumentError message in shellsplit Change "double quote" to just "quote" because the message is about any type of quotes. diff --git a/lib/shellwords.rb b/lib/shellwords.rb index 0bc34fa..4368a53 100644 --- a/lib/shellwords.rb +++ b/lib/shellwords.rb @@ -28,7 +28,7 @@ https://github.com/ruby/ruby/blob/trunk/lib/shellwords.rb#L28 # cause an ArgumentError. # # argv = "they all ran after the farmer's wife".shellsplit -# #=> ArgumentError: Unmatched double quote: ... +# #=> ArgumentError: Unmatched quote: ... # # Shellwords also provides methods that do the opposite. # Shellwords.escape, or its alias, String#shellescape, escapes @@ -90,7 +90,7 @@ module Shellwords https://github.com/ruby/ruby/blob/trunk/lib/shellwords.rb#L90 field = String.new line.scan(/\G\s*(?>([^\s\\\'\"]+)|'([^\']*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\s|\z)?/m) do |word, sq, dq, esc, garbage, sep| - raise ArgumentError, "Unmatched double quote: #{line.inspect}" if garbage + raise ArgumentError, "Unmatched quote: #{line.inspect}" if garbage # 2.2.3 Double-Quotes: # # The <backslash> shall retain its special meaning as an -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/