私は a_script.rb に以下を持っています:
if ARGV.empty?
puts "string_without_spaces 'string with spaces'"
else
p ARGV
end
私が実行すると:
ruby a_script.rb `ruby a_script.rb`
次の出力が得られます。
["string_without_spaces", "'string", "with", "spaces'"]
しかし、代わりに、次の出力が必要です。
["string_without_spaces", "string with spaces"]
必要な出力を得るためにスクリプトを変更するにはどうすればよいですか?