[#4522] Undefined Errno::EPROTO and the like raises NameError — "Florian Frank" <flori@...>
Hi,
[#4533] giving acces readline to rl_line_buffer — "Cs. Henk" <csaba-ml@...>
Hi!
[#4548] Ruby 1.8.2 array of hash entries functions incorrectly — noreply@...
Bugs item #1613, was opened at 2005-03-09 19:49
[#4561] rb_reg_quote weirdness — Nikolai Weibull <mailing-lists.ruby-core@...>
(Two weirdnesses in one day.)
Hi,
[#4567] Immutable Ropes — Nikolai Weibull <mailing-lists.ruby-core@...>
Note how I didn't write "Immutable Strings" in the subject.
[#4575] Allowing "?" in struct members — "Berger, Daniel" <Daniel.Berger@...>
Hi all,
[#4587] 0**0==1? — Bertram Scharpf <lists@...>
Hi,
[#4595] New block syntax — Daniel Amelang <daniel.amelang@...>
I'm really sorry if this isn't the place to talk about this. I've
Daniel Amelang wrote:
Hi --
On Monday 21 March 2005 16:17, David A. Black wrote:
Hi --
Hey David, I think that we've had some misunderstandings due to
Hi --
On Wednesday 30 March 2005 20:55, David A. Black wrote:
On Sunday 20 March 2005 21:31, Daniel Amelang wrote:
[#4601] Re: New block syntax — "Berger, Daniel" <Daniel.Berger@...>
> -----Original Message-----
[#4611] want_object? - possible? — "Berger, Daniel" <Daniel.Berger@...>
Hi all,
[#4619] Re: want_object? - possible? — Daniel Berger <djberg96@...>
--- nobu.nokada@softhome.net wrote:
Hi --
On 3/24/05, David A. Black <dblack@wobblini.net> wrote:
Hi --
On 4/14/05, David A. Black <dblack@wobblini.net> wrote:
On 14 Apr 2005, at 22:20, Mark Hubbart wrote:
On 4/15/05, Eric Hodel <drbrain@segment7.net> wrote:
[#4622] tempfile.rb — Tilman Sauerbeck <tilman@...>
Hi,
[#4648] about REXML::Encoding — speakillof <speakillof@...>
Hi.
On Thursday 31 March 2005 09:44, speakillof wrote:
Hi.
I've tested, applied, and committed your Encoding patch, Nobu.
Hi,
Re: implementing #to_pp, and pp.rb doc diffs (Re: Requesting addition to IRB (configurable standard output))
Quoting akr@m17n.org, on Sun, Mar 06, 2005 at 11:58:34AM +0900:
> In article <20050226025441.GA17581@ensemble.local>,
> Sam Roberts <sroberts@uniserve.com> writes:
>
> > Even after converting the docs to rdoc format, I see no simpler way.
>
> Thank you for the rdocification. It is merged.
Great, thanks.
> I'm not sure that to_pp is a name good enough for Kernel.
I agree. That code came from my .irbrc file, I wanted something short. I think
the functionality is useful, and it was not so obvious to me how to implement
it.
Maybe use a different name? Or maybe just document how to do this with sample
code?
Sam
Index: pp.rb
===================================================================
RCS file: /src/ruby/lib/pp.rb,v
retrieving revision 1.27.2.13
diff -u -r1.27.2.13 pp.rb
--- pp.rb 6 Mar 2005 02:57:53 -0000 1.27.2.13
+++ pp.rb 8 Mar 2005 02:22:06 -0000
@@ -274,6 +274,17 @@
#
# However, doing this requires that every class that #inspect is called on
# implement #pretty_print, or a RuntimeError will be raised.
+ #
+ # If you just want a simple way to get the string representation for an Object
+ # in the same format #pp prints it, it is possible to do something like:
+ # module Kernel
+ # def pp_str
+ # s = PP.pp(self, '')
+ # s.chomp!
+ # s
+ # end
+ # end
+ # This can be useful when it is put in your ~/.irbrc file, for example.
def pretty_print_inspect
if /\(PP::ObjectMixin\)#/ =~ method(:pretty_print).inspect
raise "pretty_print is not overridden."