aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-01-20 13:18:22 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-07-26 17:20:27 +0800
commitf7cbbc707413f7e1c71ac1839b0c8834550451e6 (patch)
tree65d32de07b000d57070fc717486c196c36c4367b /lib/rdoc
parent95aa60f6cde1ab7bc5cfe33c95c4fd2d2154cd52 (diff)
downloadruby-f7cbbc707413f7e1c71ac1839b0c8834550451e6.tar.gz
[ruby/rdoc] ClassModule#add_comment should receive RDoc::Comment
https://github.com/ruby/rdoc/commit/3fb03bf399
Diffstat (limited to 'lib/rdoc')
-rw-r--r--lib/rdoc/class_module.rb2
-rw-r--r--lib/rdoc/comment.rb5
2 files changed, 6 insertions, 1 deletions
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
@@ -34,6 +34,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