From 0b6da24a5e24ff9ce8e153d2f073c2363e94b28e Mon Sep 17 00:00:00 2001 From: drbrain Date: Sat, 14 May 2011 00:39:16 +0000 Subject: * lib/rdoc.rb: Updated to RDoc 3.6 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/context.rb | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'lib/rdoc/context.rb') diff --git a/lib/rdoc/context.rb b/lib/rdoc/context.rb index 3f2856db05..0d7fc41529 100644 --- a/lib/rdoc/context.rb +++ b/lib/rdoc/context.rb @@ -480,7 +480,7 @@ class RDoc::Context < RDoc::CodeObject # Adds included module +include+ which should be an RDoc::Include def add_include(include) - add_to @includes, include + add_to @includes, include unless @includes.map { |i| i.full_name }.include?( include.full_name ) end ## @@ -950,10 +950,14 @@ class RDoc::Context < RDoc::CodeObject ## # Yields AnyMethod and Attr entries matching the list of names in +methods+. - def methods_matching(methods, singleton = false) + def methods_matching(methods, singleton = false, &block) (@method_list + @attributes).each do |m| yield m if methods.include?(m.name) and m.singleton == singleton end + + each_ancestor do |parent| + parent.methods_matching(methods, singleton, &block) + end end ## @@ -1021,11 +1025,19 @@ class RDoc::Context < RDoc::CodeObject remove_invisible_in @attributes, min_visibility end + ## + # Only called when min_visibility == :public or :private + def remove_invisible_in(array, min_visibility) # :nodoc: if min_visibility == :public - array.reject! { |e| e.visibility != :public } + array.reject! { |e| + e.visibility != :public and not e.force_documentation + } else - array.reject! { |e| e.visibility == :private } + array.reject! { |e| + e.visibility == :private and + not e.force_documentation + } end end -- cgit v1.2.3