From f7cbbc707413f7e1c71ac1839b0c8834550451e6 Mon Sep 17 00:00:00 2001 From: aycabta Date: Sun, 20 Jan 2019 13:18:22 +0900 Subject: [ruby/rdoc] ClassModule#add_comment should receive RDoc::Comment https://github.com/ruby/rdoc/commit/3fb03bf399 --- lib/rdoc/class_module.rb | 2 +- lib/rdoc/comment.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/rdoc') diff --git a/lib/rdoc/class_module.rb b/lib/rdoc/class_module.rb index fdd56e236b..7609080fbf 100644 --- a/lib/rdoc/class_module.rb +++ b/lib/rdoc/class_module.rb @@ -210,7 +210,7 @@ class RDoc::ClassModule < RDoc::Context normalize_comment comment end - comment = "#{@comment}\n---\n#{comment}" unless @comment.empty? + comment = "#{@comment.to_s}\n---\n#{comment.to_s}" unless @comment.empty? super comment end diff --git a/lib/rdoc/comment.rb b/lib/rdoc/comment.rb index 134f6440a0..0f643c45b9 100644 --- a/lib/rdoc/comment.rb +++ b/lib/rdoc/comment.rb @@ -33,6 +33,11 @@ class RDoc::Comment attr_reader :text + ## + # Alias for text + + alias to_s text + ## # Overrides the content returned by #parse. Use when there is no #text # source for this comment -- cgit v1.2.3