[#8123] Unit/Regression tests for Ruby builtin classes and modules — Wayne Kelly <w.kelly@...>
[#8129] segmentation fault while evaluating printf:Kernel — <noreply@...>
Bugs item #4949, was opened at 2006-07-05 18:03
[#8131] thread mystery — ara.t.howard@...
[#8132] rdoc, C extensions, stop and start — "Daniel Berger" <Daniel.Berger@...>
Hi,
[#8136] Confused exception handling in Continuation Context — "Robert Dober" <robert.dober@...>
Hi all
Robert Dober schrieb:
On 7/6/06, Pit Capitain <pit@capitain.de> wrote:
Hi,
[#8142] thread/sync.rb memory corruption — ara.t.howard@...
Could someone please confirm this can be reproduced on 1.8.5 pre1?
On Thu, 6 Jul 2006, URABE Shyouhei wrote:
[#8167] bug in printf — <noreply@...>
Bugs item #4970, was opened at 2006-07-07 14:18
Hi,
On 7/25/06, nobu@ruby-lang.org <nobu@ruby-lang.org> wrote:
Hi,
[#8169] next in ensure body (Ruby 1.8.x) — "Dominik Bathon" <dbatml@...>
Hi,
[#8180] Called method not removed after remove_method — <noreply@...>
Bugs item #4998, was opened at 2006-07-09 13:20
[#8194] rss patch -- mostly doc, plus English adjustments. — Hugh Sasse <hgs@...>
This is a patch set against the stable snapshot.
Hi,
[#8196] SONY VIAOLAPTOP-------------$750USD,NOKIA N93-------------------$250USD — <noreply@...>
Bugs item #5032, was opened at 2006-07-12 18:41
I think this is more of an enhancement...
> Subject: Re: [ ruby-Bugs-5032 ] SONY
[#8201] Please implement expect.rb for Windows Ruby — <noreply@...>
Bugs item #5036, was opened at 2006-07-12 14:44
Hi,
Yukihiro Matsumoto wrote:
Hi,
[#8203] Re: [PATCH] --fqname option to test/unit/autorunner.rb — "Berger, Daniel" <Daniel.Berger@...>
> -----Original Message-----
Thanks again for getting back to me. Perhaps my original focus on the
[#8222] Rdoc patch for lib/prettyprint.rb — Hugh Sasse <hgs@...>
This is a first pass at converting the RDTool docs for lib/prettyprint.rb
[#8223] Unexpected pointer behavior with unpack — "Justin Bailey" <jgbailey@...>
I have had the opportunity to work [1] a lot with Ruby's ability to create
[#8229] open-uri fails under multithreading — <noreply@...>
Bugs item #5067, was opened at 2006-07-14 19:11
[#8243] tuplespace - make comments visible to rdoc. — Hugh Sasse <hgs@...>
comments in rdoc conventionally don't start with two # marks and don't
On Jul 17, 2006, at 10:09 AM, Hugh Sasse wrote:
That 'doesn't add anything' is meant to the last paragraph, as i understood it.
On Tue, 18 Jul 2006, Jan Svitok wrote:
[#8248] One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...>
I just posted this to ruby-talk. But I would also like to discuss this
Dear Curt,
On 7/20/06, Kaspar Schiess <eule@space.ch> wrote:
I was wondering if the toolchain could be built around rake?
The One-Click Ruby Installer's build process is, in fact, controlled via
From my experience using both tool chains on Windows (for the ruby-prof
Tim, I'm going to top reply since your post was so long. I'm interested in
> Tim, I'm going to top reply since your post was so long. I'm interested in
On 7/19/06, Charlie Savage <cfis@savagexi.com> wrote:
Curt Hibbs wrote:
On 7/19/06, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:
Hello,
[#8262] Instability around popen due to missing rb_thread_atfork — <noreply@...>
Patches item #5111, was opened at 2006-07-18 22:36
Hi,
On 19 Jul 2006, at 8:25, <nobu@ruby-lang.org> <nobu@ruby-lang.org>
[#8271] my sandboxing extension!! — why the lucky stiff <ruby-core@...>
I have (what feels like) very exciting news. I finally sat down to code up my
On Wed, Jul 19, 2006 at 06:40:34PM +0900, why the lucky stiff wrote:
On Wed, Jul 19, 2006 at 08:00:15PM +0900, Mauricio Fernandez wrote:
On Wed, Jul 19, 2006 at 11:18:27PM +0900, why the lucky stiff wrote:
Okay, it turns out that, in order for this to work, I also need the following
Hi,
On Thu, Jul 20, 2006 at 03:11:34PM +0900, Yukihiro Matsumoto wrote:
Hi,
On 7/20/06, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
[#8273] Regular-Expressions Problem/Bug — Reto Schuettel <reto-ruby-core@...>
Hi
On Wed, 19 Jul 2006, Reto Schuettel wrote:
Hi
>>>>> "R" == Reto Schuettel <reto-ruby-core@schuettel.ch> writes:
[#8299] Interest in NTLM/Negotiate patch for net/http? — "Justin Bailey" <jgbailey@...>
My workplace recently installed Microsoft's ISA server, which proxies all
On Jul 19, 2006, at 5:01 PM, Justin Bailey wrote:
[#8331] (Fwd) Re: Patch to Ruby in 2005 — "John Fletcher" <J.P.Fletcher@...>
Hi
Hi,
On Fri, 21 Jul 2006, nobu@ruby-lang.org wrote:
[#8379] rdoc grows to large size. — Hugh Sasse <hgs@...>
While working on that .document patch I noticed that rdoc grew to
On Jul 24, 2006, at 6:09 AM, Hugh Sasse wrote:
[#8394] Re: rdoc grows to large size. — "Berger, Daniel" <Daniel.Berger@...>
> -----Original Message-----
[#8423] doc patch: readbytes.rb — Hugh Sasse <hgs@...>
A patch against the stable snapshot.
[#8427] RDoc picking up comments from function prototypes — Tilman Sauerbeck <tilman@...>
Hi,
Tilman Sauerbeck [2006-07-29 02:39]:
On Aug 9, 2006, at 9:52 AM, Tilman Sauerbeck wrote:
[#8430] Re: doc patch: weakref. — "Berger, Daniel" <Daniel.Berger@...>
> -----Original Message-----
Hi,
Yukihiro Matsumoto wrote:
On Sat, Jul 29, 2006 at 07:37:24PM +0900, Daniel Berger wrote:
On Sun, 30 Jul 2006, Mauricio Fernandez wrote:
On Jul 31, 2006, at 3:20 AM, Hugh Sasse wrote:
On Tue, 1 Aug 2006, Eric Hodel wrote:
On Aug 1, 2006, at 2:13 AM, Hugh Sasse wrote:
[#8441] Inconsistency in scoping during module_eval? — "Charles O Nutter" <headius@...>
I have the following code:
Hi,
Why does this:
Hi,
So to clarify...
I don't want to take this thread off-course, but what I meant was
On Mon, 31 Jul 2006, Matt Todd wrote:
On 7/30/06, Mathieu Bouchard <matju@artengine.ca> wrote:
Awesome. Thank you very much for your responses. Curious. I knew a
On 7/31/06, Matt Todd <chiology@gmail.com> wrote:
[#8447] #if should be #ifdef in ruby.h — <noreply@...>
Bugs item #5243, was opened at 2006-07-30 16:31
noreply@rubyforge.org wrote:
[#8466] Multi-Line Date Formate Patch — James Edward Gray II <james@...>
It was pointed out to me that the following code is surprising:
On Jul 31, 2006, at 8:26 AM, James Edward Gray II wrote:
Hi,
Rdoc patch for lib/prettyprint.rb
This is a first pass at converting the RDTool docs for lib/prettyprint.rb
into rdoc format. I've left the rdtool docs in place so people can still
use them, see what I started out with, etc. Again, this is against the
-rw-r--r-- 1 hgs staff 4467539 Jul 13 13:08 stable-snapshot.tar.gz
as last time.
HTH
Hugh
--- lib/prettyprint.rb.orig 2004-03-27 01:46:05.000000000 +0000
+++ lib/prettyprint.rb 2006-07-14 14:54:31.532577000 +0100
@@ -60,7 +60,7 @@
== methods
--- text(obj[, width])
- adds ((|obj|)) as a text of ((|width|)) columns in width.
+ adds ((|obj|)) as a text of ((|width|)y columns in width.
If ((|width|)) is not specified, (({((|obj|)).length})) is used.
@@ -125,7 +125,45 @@
Tanaka Akira <akr@m17n.org>
=end
+# The class implements pretty printing algorithm.
+# It finds line breaks and nice indentations for grouped structure.
+#
+# By default, the class assumes that primitive elements are strings and
+# each byte in the strings have single column in width.
+# But it can be used for other situations
+# by giving suitable arguments for some methods:
+# newline object and space generation block for PrettyPrint.new,
+# optional width argument for PrettyPrint#text,
+# PrettyPrint#breakable, etc.
+# There are several candidates to use them:
+# text formatting using proportional fonts,
+# multibyte characters which has columns different to number of bytes,
+# non-string formatting, etc.
+#
+# == Bugs
+# * Box based formatting? Other (better) model/algorithm?
+#
+# == References
+# Christian Lindig, Strictly Pretty, March 2000,
+# <URL:http://www.st.cs.uni-sb.de/~lindig/papers/#pretty>
+#
+# Philip Wadler, A prettier printer, March 1998,
+# <URL:http://homepages.inf.ed.ac.uk/wadler/topics/language-design.html#prettier>
+#
+# == AUTHOR
+# Tanaka Akira <akr@m17n.org>
+#
class PrettyPrint
+
+ # This is a convenience method which is same as follows:
+ #
+ # begin
+ # q = PrettyPrint.new(output, maxwidth, newline, &genspace)
+ # ...
+ # q.flush
+ # output
+ # end
+ #
def PrettyPrint.format(output='', maxwidth=79, newline="\n", genspace=lambda {|n| ' ' * n})
q = PrettyPrint.new(output, maxwidth, newline, &genspace)
yield q
@@ -133,12 +171,40 @@
output
end
+ # This is similar to (({PrettyPrint.format})) but the result has no breaks.
+ #
+ # +maxwidth+, +newline+ and +genspace+ are ignored.
+ # The invocation of +breakable+ in the block doesn't break a line and
+ # treated as just an invocation of +text+.
+ #
def PrettyPrint.singleline_format(output='', maxwidth=nil, newline=nil, genspace=nil)
q = SingleLine.new(output)
yield q
output
end
+ # creates a buffer for pretty printing.
+ #
+ # +output+ is an output target.
+ # If it is not specified, '' is assumed.
+ # It should have a << method which accepts
+ # the first argument +obj+ of PrettyPrint#text,
+ # the first argument +sep+ of PrettyPrint#breakable,
+ # the first argument +newline+ of PrettyPrint.new,
+ # and
+ # the result of a given block for PrettyPrint.new.
+ #
+ # +maxwidth+ specifies maximum line length.
+ # If it is not specified, 79 is assumed.
+ # However actual outputs may overflow +maxwidth+ if
+ # long non-breakable texts are provided.
+ #
+ # +newline+ is used for line breaks.
+ # "\n" is used if it is not specified.
+ #
+ # The block is used to generate spaces.
+ # {|width| ' ' * width} is used if it is not given.
+ #
def initialize(output='', maxwidth=79, newline="\n", &genspace)
@output = output
@maxwidth = maxwidth
@@ -161,6 +227,22 @@
@group_stack.last
end
+ # first? is obsoleted at 1.8.2.
+ #
+ # first? is a predicate to test the call is a first call to first? with
+ # current group.
+ # It is useful to format comma separated values as:
+ #
+ # q.group(1, '[', ']') {
+ # xxx.each {|yyy|
+ # unless q.first?
+ # q.text ','
+ # q.breakable
+ # end
+ # ... pretty printing yyy ...
+ # }
+ # }
+ #
def first?
warn "PrettyPrint#first? is obsoleted at 1.8.2."
current_group.first?
@@ -182,6 +264,10 @@
end
end
+ # This adds +obj+ as a text of +width+ columns in width.
+ #
+ # If +width+ is not specified, obj.length is used.
+ #
def text(obj, width=obj.length)
if @buffer.empty?
@output << obj
@@ -202,6 +288,16 @@
group { breakable sep, width }
end
+ # This tells "you can break a line here if necessary", and a
+ # +width+\-column text +sep+ is inserted if a line is not
+ # broken at the point.
+ #
+ # If +sep+ is not specified, " " is used.
+ #
+ # If +width+ is not specified, +sep.length+ is used.
+ # You will have to specify this when +sep+ is a multibyte
+ # character, for example.
+ #
def breakable(sep=' ', width=sep.length)
group = @group_stack.last
if group.break?
@@ -217,6 +313,17 @@
end
end
+ # groups line break hints added in the block.
+ # The line break hints are all to be breaked or not.
+ #
+ # If indent is specified, the method call is regarded as nested by
+ # nest(indent) { ... }.
+ #
+ # If open_obj is specified, text open_obj, open_width is called
+ # at first.
+ # If close_obj is specified, text close_obj, close_width is
+ # called at last.
+ #
def group(indent=0, open_obj='', close_obj='', open_width=open_obj.length, close_width=close_obj.length)
text open_obj, open_width
group_sub {
@@ -241,6 +348,9 @@
end
end
+ # increases left margin after newline with +indent+ for line breaks added
+ # in the block.
+ #
def nest(indent)
@indent += indent
begin
@@ -250,6 +360,7 @@
end
end
+ # outputs buffered data.
def flush
@buffer.each {|data|
@output_width = data.output(@output, @output_width)