[#4479] Requesting addition to IRB (configurable standard output) — Sascha Ebach <se@...>

Hello,

13 messages 2005/02/24
[#4482] Re: Requesting addition to IRB (configurable standard output) — Sam Roberts <sroberts@...> 2005/02/25

Quoting se@digitale-wertschoepfung.de, on Fri, Feb 25, 2005 at 01:22:34AM +0900:

[#4483] Re: Requesting addition to IRB (configurable standard output) — Eric Hodel <drbrain@...7.net> 2005/02/25

On 24 Feb 2005, at 19:51, Sam Roberts wrote:

[#4488] Re: Requesting addition to IRB (configurable standard output) — Sam Roberts <sroberts@...> 2005/02/26

Quoting drbrain@segment7.net, on Sat, Feb 26, 2005 at 02:43:31AM +0900:

[#4489] Re: Requesting addition to IRB (configurable standard output) — Eric Hodel <drbrain@...7.net> 2005/02/26

On 25 Feb 2005, at 16:03, Sam Roberts wrote:

[PATCH] RDoc - show protected methods by default

From: Tilman Sauerbeck <tilman@...>
Date: 2005-02-10 18:00:01 UTC
List: ruby-core #4412
Hi,
atm, RDoc will only show/document protected methods if the "-all" switch
is set.

IMHO it makes sense to include protected methods by default, too, since
these belong to the visible API as well :)

See the attached patch.

-- 
Regards,
Tilman

Attachments (1)

rdoc-show_protected_by_default.diff (1.86 KB, text/x-diff)
diff -aur ruby-1.8.2.orig/lib/rdoc/generators/html_generator.rb ruby-1.8.2/lib/rdoc/generators/html_generator.rb
--- ruby-1.8.2.orig/lib/rdoc/generators/html_generator.rb	2004-11-20 16:02:56.000000000 +0100
+++ ruby-1.8.2/lib/rdoc/generators/html_generator.rb	2005-02-10 18:54:13.437547072 +0100
@@ -314,7 +314,7 @@
     def collect_methods
       list = @context.method_list
       unless @options.show_all
-        list = list.find_all {|m| m.visibility == :public || m.force_documentation }
+        list = list.find_all {|m| m.visibility == :public || m.visibility == :protected || m.force_documentation }
       end
       @methods = list.collect {|m| HtmlMethod.new(m, self, @options) }
     end
@@ -681,13 +681,13 @@
       res = []
       atts.each do |att|
         next unless att.section == section
-        if att.visibility == :public || @options.show_all
+        if att.visibility == :public || att.visibility == :protected || @options.show_all
           entry = {
             "name"   => CGI.escapeHTML(att.name), 
             "rw"     => att.rw, 
             "a_desc" => markup(att.comment, true)
           }
-          unless att.visibility == :public
+          unless att.visibility == :public || att.visibility == :protected
             entry["rw"] << "-"
           end
           res << entry
diff -aur ruby-1.8.2.orig/lib/rdoc/generators/ri_generator.rb ruby-1.8.2/lib/rdoc/generators/ri_generator.rb
--- ruby-1.8.2.orig/lib/rdoc/generators/ri_generator.rb	2004-01-02 07:01:12.000000000 +0100
+++ ruby-1.8.2/lib/rdoc/generators/ri_generator.rb	2005-02-10 18:51:35.631537232 +0100
@@ -172,7 +172,7 @@
       list = cls.method_list
       unless @options.show_all
         list = list.find_all do |m|
-          m.visibility == :public || m.force_documentation 
+          m.visibility == :public || m.visibility == :protected || m.force_documentation
         end
       end
 

In This Thread

Prev Next