[#6548] 1.8.4 p1, warning roundup — Daniel Berger <Daniel.Berger@...>
Hi all,
[#6552] Socket Documentation — zdennis <zdennis@...>
Attached is a patch against the latest socket.c in the ruby_1_8 branch. It covers all Socket
On 11/3/05, zdennis <zdennis@mktec.com> wrote:
Gavin Sinclair wrote:
zdennis wrote:
On 11/9/05, Zach Dennis <zdennis@mktec.com> wrote:
Hi.
[#6558] Method of feeding input to regexp matching — Nikolai Weibull <mailing-lists.ruby-core@...>
I would very much like to be able to provide a Regexp object input from
[#6572] Stack trace consumes information. patch... — Hugh Sasse <hgs@...>
I have just had output like this from rails:
[#6588] Object#clone missing documentation — Eero Saynatkari <ruby-ml@...>
It appears that Object#clone, unlike Object#dup, retains
Hi,
I've attached a documentation patch which tries to address this shortcoming.
Kev Jackson wrote:
[#6602] Re: Unpack Endian Bug — "Berger, Daniel" <Daniel.Berger@...>
> -----Original Message-----
Berger, Daniel wrote:
[#6604] Sandboxing without $SAFE — why the lucky stiff <ruby-core@...>
I've been playing with Ruby sandboxing alot over the past several
[#6619] Wildness: Purpose of NOEX_PUBLIC Flag in rb_add_method? — "Charles E. Thornton" <ruby-core@...>
Several Different references to 'noex'
Charles E. Thornton wrote:
[#6625] Array::fill causes segfaults after many calls — noreply@...
Bugs item #2824, was opened at 2005-11-14 23:11
Hi,
[#6629] Strange error messages using DRb/TupleSpace — Eric Hodel <drbrain@...7.net>
Using
[#6636] alarming changes — "Ara.T.Howard" <ara.t.howard@...>
[#6639] Tuple Class — TRANS <transfire@...>
If I put together a good Tuple class for Ruby could it go into core? I
[#6650] REXML Update Please — zdennis <zdennis@...>
I submitted this as an RCR, but I didn't know that RCR's aren't for the stdlib. Matz commented on
Hi,
Yukihiro Matsumoto wrote:
[#6660] Ruby on Neko ? — Nicolas Cannasse <ncannasse@...>
Hi folks,
Nicolas Cannasse wrote:
Florian Growrote:
Nicolas Cannasse <ncannasse@motion-twin.com> writes:
On Sun, 20 Nov 2005, Christian Neukirchen wrote:
[#6672] testing for hardlink with "test(?-, ...)" flawed on Windows — noreply@...
Bugs item #2858, was opened at 2005-11-20 16:35
Hi,
--- nobuyoshi nakada <nobuyoshi.nakada@ge.com> wrote:
[#6684] semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...>
Hi all,
On Tue, Nov 22, 2005 at 08:22:59AM +0900, Stefan Kaes wrote:
Mauricio Fern疣dez wrote:
On Nov 21, 2005, at 4:37 PM, Stefan Kaes wrote:
Eric Hodel wrote:
Hi,
Yukihiro Matsumoto wrote:
mathew wrote:
Stefan Kaes wrote:
On Tuesday 22 November 2005 12:31, Steven Jenkins wrote:
Hi --
>>>>> "m" == mathew <meta@pobox.com> writes:
Hi,
Yukihiro Matsumoto wrote:
Hi,
Yukihiro Matsumoto wrote:
Hi,
Yukihiro Matsumoto wrote:
On Nov 21, 2005, at 9:37 PM, Stefan Kaes wrote:
Eric Hodel wrote:
URABE Shyouhei wrote:
On Tue, 22 Nov 2005, Stefan Kaes wrote:
Ara.T.Howard wrote:
Hi --
David A. Black wrote:
Hi --
David A. Black wrote:
Hi --
David A. Black wrote:
Hi -
On Tuesday 22 November 2005 15:37, David A. Black wrote:
Hi --
On Tue, 22 Nov 2005, Stefan Kaes wrote:
Mathieu Bouchard wrote:
[#6721] String#index does not work correctly on SuSE10.0 x86_64 — "Kanis, Lars" <Kanis@...>
Hi folks,
[#6798] ruby 1.8.4 preview2 — Yukihiro Matsumoto <matz@...>
Hi,
On Nov 30, 2005, at 8:03 AM, Yukihiro Matsumoto wrote:
>>>>> "E" == Eric Hodel <drbrain@segment7.net> writes:
On Dec 4, 2005, at 4:07 AM, ts wrote:
>>>>> "E" == Eric Hodel <drbrain@segment7.net> writes:
On 11/30/05, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
Hi,
Yukihiro Matsumoto wrote:
Hi.
[PATCH] ri displaying lists in columns
Hi List,
While ri is a really nice quick reference, I found it hard to read the
long lists of comma-separated method names. So I patched it to format
these lists in columns. Now, instead of this:
-------------------------------------------------------------- Class: IO
(no description...)
------------------------------------------------------------------------
Includes:
---------
Enumerable(all?, any?, collect, count, detect, each_cons,
each_slice, each_with_index, entries, enum_cons, enum_slice,
enum_with_index, find, find_all, grep, include?, inject, map, max,
max_by, member?, min, min_by, partition, reject, select, sort,
sort_by, to_a, to_set, zip), File::Constants()
Constants:
----------
SEEK_SET: INT2FIX(SEEK_SET)
SEEK_CUR: INT2FIX(SEEK_CUR)
SEEK_END: INT2FIX(SEEK_END)
Class methods:
--------------
for_fd, foreach, new, new, open, pipe, popen, read, readlines,
select, sysopen
Instance methods:
-----------------
<<, binmode, close, close_read, close_write, closed?, each,
each_byte, each_line, eof, eof?, fcntl, fileno, flush, fsync, getc,
gets, inspect, ioctl, isatty, lineno, lineno=, pid, pos, pos=,
print, printf, putc, puts, read, readchar, readline, readlines,
readpartial, reopen, rewind, seek, stat, sync, sync=, sysread,
sysseek, syswrite, tell, to_i, to_io, tty?, ungetc, write
...you get this:
-------------------------------------------------------------- Class: IO
(no description...)
------------------------------------------------------------------------
Includes:
---------
File::Constants:
(no instance methods)
Enumerable:
all? each_with_index find_all max_by select
any? entries grep member? sort
collect enum_cons include? min sort_by
count enum_slice inject min_by to_a
detect enum_with_index map partition to_set
each_cons find max reject zip
each_slice
Constants:
----------
SEEK_SET: INT2FIX(SEEK_SET)
SEEK_CUR: INT2FIX(SEEK_CUR)
SEEK_END: INT2FIX(SEEK_END)
Class methods:
--------------
for_fd new open pipe popen read readlines select sysopen
foreach new
Instance methods:
-----------------
<< eof inspect print readpartial sysseek
binmode eof? ioctl printf reopen syswrite
close fcntl isatty putc rewind tell
close_read fileno lineno puts seek to_i
close_write flush lineno= read stat to_io
closed? fsync pid readchar sync tty?
each getc pos readline sync= ungetc
each_byte gets pos= readlines sysread write
each_line
What do you think? Patch follows.
Cheers,
George.
diff -Naur ruby/lib/rdoc/ri/ri_display.rb ruby.mod/lib/rdoc/ri/ri_display.rb
--- ruby/lib/rdoc/ri/ri_display.rb 2004-03-25 06:17:13.000000000 +1100
+++ ruby.mod/lib/rdoc/ri/ri_display.rb 2005-11-27 20:07:39.000000000 +1100
@@ -88,7 +88,7 @@
display_flow(klass.comment)
@formatter.draw_line
-
+
unless klass.includes.empty?
@formatter.blankline
@formatter.display_heading("Includes:", 2, "")
@@ -96,15 +96,14 @@
klass.includes.each do |inc|
inc_desc = ri_reader.find_class_by_name(inc.name)
if inc_desc
- str = inc.name + "("
- str << inc_desc.instance_methods.map{|m| m.name}.join(", ")
- str << ")"
- incs << str
+ methods = inc_desc.instance_methods.map{|m| m.name}
+ methods = ['(no instance methods)'] if methods.empty?
+ @formatter.wrap("#{inc.name}:")
+ @formatter.wrap_list(methods.sort, @formatter.indent*2)
else
- incs << inc.name
+ @formatter.wrap(inc.name)
end
- end
- @formatter.wrap(incs.sort.join(', '))
+ end
end
unless klass.constants.empty?
@@ -122,19 +121,19 @@
unless klass.class_methods.empty?
@formatter.blankline
@formatter.display_heading("Class methods:", 2, "")
- @formatter.wrap(klass.class_methods.map{|m| m.name}.sort.join(', '))
+ @formatter.wrap_list(klass.class_methods.map{|m| m.name}.sort)
end
unless klass.instance_methods.empty?
@formatter.blankline
@formatter.display_heading("Instance methods:", 2, "")
- @formatter.wrap(klass.instance_methods.map{|m| m.name}.sort.join(', '))
+ @formatter.wrap_list(klass.instance_methods.map{|m| m.name}.sort)
end
unless klass.attributes.empty?
@formatter.blankline
- @formatter.wrap("Attributes:", "")
- @formatter.wrap(klass.attributes.map{|a| a.name}.sort.join(', '))
+ @formatter.display_heading("Attributes:", 2, "")
+ @formatter.wrap_list(klass.attributes.map{|a| a.name}.sort)
end
end
end
@@ -147,7 +146,7 @@
page do
puts "More than one method matched your request. You can refine"
puts "your search by asking for information on one of:\n\n"
- @formatter.wrap(methods.map {|m| m.full_name} .join(", "))
+ @formatter.wrap_list(methods.map {|m| m.full_name}.sort)
end
end
@@ -157,7 +156,7 @@
page do
puts "More than one class or module matched your request. You can refine"
puts "your search by asking for information on one of:\n\n"
- @formatter.wrap(namespaces.map {|m| m.full_name}.join(", "))
+ @formatter.wrap_list(namespaces.map {|m| m.full_name}.sort)
end
end
@@ -170,7 +169,7 @@
page do
@formatter.draw_line("Known classes and modules")
@formatter.blankline
- @formatter.wrap(classes.sort.join(", "))
+ @formatter.wrap_list(classes.sort)
end
end
end
diff -Naur ruby/lib/rdoc/ri/ri_formatter.rb ruby.mod/lib/rdoc/ri/ri_formatter.rb
--- ruby/lib/rdoc/ri/ri_formatter.rb 2004-12-31 16:12:37.000000000 +1100
+++ ruby.mod/lib/rdoc/ri/ri_formatter.rb 2005-11-27 20:07:26.000000000 +1100
@@ -47,6 +47,64 @@
end
######################################################################
+
+ def wrap_list(list, prefix=@indent, linelen=@width)
+ return if list.empty?
+
+ cols = wrap_list_cols(list, linelen - prefix.length)
+ widths = cols.map do |col|
+ col.map{|s| s.length}.max
+ end
+
+ cols[0].each_index do |rowno|
+ items = (0...cols.length).map do |colno|
+ cols[colno][rowno].to_s.ljust(widths[colno])
+ end
+ puts "#{prefix}#{items.join(' ')}"
+ end
+ end
+
+ def wrap_list_cols(list, width)
+ num_cols = 1
+ while num_cols < list.length &&
+ wrap_list_fit?(list, width, num_cols+1)
+ num_cols += 1
+ end
+ ranges = wrap_list_ranges(list.length, num_cols)
+ ranges.map{|r| list[r]}
+ end
+ protected :wrap_list_cols
+
+ def wrap_list_ranges(num_items, num_cols)
+ ranges = []
+ q, r = num_items.divmod(num_cols)
+ k = 0
+ num_cols.times do |i|
+ len = i < r ? q+1 : q
+ ranges << (k...k+len)
+ k += len
+ end
+ return ranges
+ end
+ private :wrap_list_ranges
+
+ def wrap_list_fit?(list, linelen, num_cols)
+ ranges = wrap_list_ranges(list.length, num_cols)
+
+ widths = ranges.map do |range|
+ list[range].map{|s| s.length}.max
+ end
+ pad = 2*(num_cols - 1)
+
+ if widths.inject(0){|sum,w| sum+w} + pad > linelen
+ return false
+ else
+ return true
+ end
+ end
+ private :wrap_list_fit?
+
+ ######################################################################
def blankline
puts
@@ -560,6 +618,19 @@
puts("</pre>")
end
+ def wrap_list(list, prefix=@indent, linelen=@width)
+ cols = wrap_list_cols(list, linelen - prefix.length)
+ puts "<table>"
+ cols[0].each_index do |rowno|
+ print " <tr>"
+ cols.each_index do |colno|
+ print "<td>#{cols[colno][rowno]}</td>"
+ end
+ puts "</tr>"
+ end
+ puts "</table>"
+ end
+
private
ATTR_MAP = {