From cda431f5388e8359532998c7fbf5fa615ce6d45e Mon Sep 17 00:00:00 2001 From: toshimaru Date: Mon, 20 Nov 2023 08:47:52 +0900 Subject: [ruby/rdoc] fix: fix `NoMethodError` when `token_stream` is nil The change in #1055 might be a breaking change. So, just simply wrap `token_stream` with `Array` https://github.com/ruby/rdoc/commit/d8c19d7fa1 Co-authored-by: Jonathan Hefner --- lib/rdoc/token_stream.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/rdoc/token_stream.rb b/lib/rdoc/token_stream.rb index 1ff4b0d09e..ea8d9417cc 100644 --- a/lib/rdoc/token_stream.rb +++ b/lib/rdoc/token_stream.rb @@ -105,14 +105,14 @@ module RDoc::TokenStream # Current token stream def token_stream - @token_stream || [] + @token_stream end ## # Returns a string representation of the token stream def tokens_to_s - token_stream.compact.map { |token| token[:text] }.join '' + Array(token_stream).compact.map { |token| token[:text] }.join '' end end -- cgit v1.2.3