9249-9907 subjects 9619-11610

inspecting objects
9371 [aseltine@su ] Is there any way to limit the recursion depth of inspect? I have a tree
9443 [gotoken@ma h] No, there isn't.

attr_accessor in base class
9373 [bombadil@wa ] I have a rpoblem with object orientation. Intention is to define
9374 [gotoken@ma h] attr_reader is a private method of Class but you are using it in a
9404 [sent@qu li y] I'm not sure quite what you're aiming for.
9419 [bombadil@wa ] That doesn't seem a solution. Problem is accessing values of Configuration

fileExists function?
9377 [ChrisM@SN LL] I'm looking for a fileExists function and coming up short at the moment.
+ 9378 [ljlane@de ia] File#exist?
| 9387 [ChrisM@SN LL] Hmm. The Ruby book doesn't document this function here -- I just now found
| 9388 [Dave@Pr gm t] Class File mixes in FileTest, so you get access that way. It's
| 9390 [ChrisM@SN LL] Alrighty - I see the list of mixins.
+ 9397 [dsafari@pa a] Perhaps this is what you want?

Rubicon has moved to ruby-lang.org
9383 [Dave@Pr gm t] I'm pleased to announce that Rubicon now has a permanent home in the

9389 [lrryklly@mi ] # subscribe

What does it take?
9391 [bradclark1@m] I have tried to unsubscribe four times from this list and it has had no
9446 [mitch@ve ux ] Indeed, what does it take? I tried to unsubscribe this morning without luck
9450 [aleksi.nieme] This kind of activity seem to be so common these days that may I suggest two
+ 9451 [mitch@ve ux ] I don't have a problem unsubscribing in any way you guys have it setup, I'm
+ 9453 [decoux@mo lo] Guy Decoux
| + 9455 [mitch@ve ux ] Yes, I figured it was like that *but* this is what I get when I send
| + 9456 [decoux@mo lo] Try with the command "# status"
+ 9457 [matz@ze ab t] There's no confirmation for unsubscription.  I have no idea why they
  9458 [mitch@ve ux ] With any command I send to the ctl address, be it status, # status,
  9493 [matz@ze ab t] At least your address <mitch@venux.net> have never been in the list.
  9517 [mitch@ve ux ] Ahhh.. I sent the subscribe from this client, I thought it would have

Do Vector and Matrix Classes Exist for Ruby?
9392 [jim@fr ez .o] The title pretty much says it all.
9393 [gotoken@ma h] require "matrix"
9394 [schneik@us i] (http://www.ruby-lang.org/en/raa-list.rhtml?name=NArray)
9395 [schneik@us i] # In message "[ruby-talk:9392] Do Vector and Matrix Classes Exist for
9396 [Dave@Pr gm t] We ran out of space to put everything, so we discussed with Matz what
9421 [schneik@us i] Reference.
9440 [Dave@Pr gm t] That's where we printed the meaning of life, but they made us take it

Spiffy timing method anyone?
9398 [jim@fr ez .o] I noticed that the Time class supports microsecionds. I am interested in
9399 [Dave@Pr gm t] Goto-san's 'benchmark' library is your friend.

9400 [dasimpson@nl] ...

Examples of textbuf in action
9409 [Dave@Pr gm t] Does anyone have any sample code that uses, or documentation for,
9414 [aamine@dp u-] Sorry, manuals are not available now.

RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby!  (Revised 2000-12-28)
9410 [schneiker@ju] RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby!  (Revised 2000-12-28)

The Ruby Way
9411 [schneiker@ju] As a member of the "Big 8" newsgroups, "The Ruby Way" (of posting) is to

Ruby User Survey (2nd announcement)
9412 [schneiker@ju] If you are new to Ruby (or haven't previously taken the Ruby User

Gathering Ruby version
9415 [wys@he bl ng] is there a way to get the Ruby  version (or even better the build string)
+ 9416 [decoux@mo lo] pigeon% ruby -e 'p RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM'
+ 9420 [bombadil@wa ] What about RUBY_VERSION constant ;)

Re: Speed of Python vs. Perl
9418 [schneik@us i] If someone is looking for something interesting to do, this might give you

ANNOUNCE: PyXPCOM - Python bindings for Mozilla XPCOM technology
9422 [schneik@us i] Conrad Schneiker
9431 [ben_tilly@ho] As a long-time member of the Perl community I have to
9471 [schneik@us i] # As a long-time member of the Perl community I have to

Ruby CVS repositories are ready now
9427 [knu@iD em ns] It is my pleasure to announce that the CVS repositories for Ruby are
+ 9430 [elderburn@mi] Your English is very good.  Everything is clearly understood, but there appears
| 9432 [knu@iD em ns] Ah, thanks for pointing out!  That's what I meant!
+ 9502 [green@Fr eB ] Hmm, you know, seeing all this organization coming about... I can't put my
  9519 [knu@iD em ns] Hehe, I (shamelessly) borrowed many ideas from FreeBSD's committers'

Can ruby replace php? The URL please.
9428 [jilanik@ti .] The URL please?
9429 [avi@be a4 co] ...

Re: 101 Misconceptions About Dynamic...
9434 [MICHAEL.W.WI] Langua

Passing cmd-line args through .rb shortcut on Win?
9437 [ChrisM@SN LL] .rb files are associated to ruby.exe - that works fine. If I set up a
9445 [Dave@Pr gm t] It's a bug in the file association which is fixed in the 1.6.2
9449 [Dave@Pr gm t] Sorry, I think that might be HKEY_CLASSES_ROOT (I'm not a Windows user)
9452 [ChrisM@SN LL] Now it seems my arguments are being passed to ruby.exe, not myruby.rb -- can
9461 [Dave@Pr gm t] I just checked this on my NT box. My key
9463 [ChrisM@SN LL] Thanks!

array.each_index_but_last ?
9439 [hgs@dm .a .u] What is the idiomatic Ruby way to go through all the elements of an array,
+ 9444 [dblack@ca dl] (0...my_array.size - 1) .each do |i| ... end
+ 9447 [gotoken@ma h] my_array[0..-2].each{....}
+ 9448 [hipster@xs a] exactly where Haskell list-lingo (head, tail, init, last) comes in
| + 9459 [hgs@dm .a .u] Yes, these are useful -- I think Lisp and Prolog have some of these
| + 9539 [druid@pr me ] I'm trying to learn both Hakell and ruby at the same time, and I
+ 9504 [r2d2@ma .a c] If you want to do things like this a lot you could create iterators for

reading an entire file as a string
9460 [raja@cs in i] [This is something i've been wanting to ask for a while.]
9462 [decoux@mo lo] and you have an array with only 1 element, which contains the entire
9464 [raja@cs in i] IO.readlines ("path", nil)[0]
9465 [Dave@Pr gm t] I'd vote for this in 1.6.3/1.7. I've found myself wanting it too.
9468 [matz@ze ab t] OK.  But unlike readlines and each, read is not fundamentally for
+ 9469 [Dave@Pr gm t] I'd vote for 'a'.
| + 9470 [hgs@dm .a .u] Well, while we are talking about this sort of thing, what about adding
| + 9476 [jimm@fn rd i] One of the things that helped me get up to speed quickly in Ruby were all
| + 9481 [elderburn@mi] Why not 'a' _and 'b' (or does that make it 'c'?)
| | 9482 [Dave@Pr gm t] 'a' is a superset of 'b'. THe *args thing means that it calls f.read
| + 9483 [matz@ze ab t] How about IO::read(path[,size[,offset]]), where offset is the optional
|   9484 [Dave@Pr gm t] Sounds good. Will File#read change too?
|   9492 [matz@ze ab t] I think it won't.  there cannot be "initial offset" for each
|   + 9512 [Dave@Pr gm t] Personally, I think it's go for consistency here. If you treated the
|   + 9514 [decoux@mo lo] ??? I don't understand
|     + 9515 [Dave@Pr gm t] class ErrMsg
|     + 9516 [decoux@mo lo] Why you don't use #seek for this very special case ?
|       9518 [Dave@Pr gm t] I'm not particularly advocating modifying just OP#read. Instead, I was
|       + 9538 [matz@ze ab t] Hmm, let me summarize,
|       | + 9547 [hipster@xs a] (c)
|       | + 9548 [   xm@w3 .r ] /skipped/
|       | + 9623 [gnhurst@hu s] (c) looks fine.
|       + 9546 [decoux@mo lo] (c) is OK, for me
+ 9472 [raja@cs in i] All the time i've had a need for this has been as in option (b).
| 9474 [schneik@us i] #
| 9475 [hipster@xs a] Which is basically foldl or foldr depending on the implementation. But
+ 9526 [matju@ca .o ] File.open(path) {|f| f.read(*args) }
  9527 [Dave@Pr gm t] Except because of scope you have to write
  + 9528 [matju@ca .o ] Sorry, I tried both of the following and I cannot find a difference in
  | 9532 [matz@ze ab t] Thechenically they are same, but appearance makes difference.
  | + 9540 [   xm@w3 .r ] What of presented methods are better ... _and_ why ?
  | | 9542 [matz@ze ab t] I think it's mostly up to preference.  I prefer 3, because it tells me
  | + 9543 [ale@cr ms n.] I'm sorry, I'm not following the idea of sameness here.
  |   + 9544 [matz@ze ab t] Ah, you fooled by my stupidity. ;-)
  |   + 9553 [matju@ca .o ] This was simply a stupid error in my original mail. It is assumed that
  + 9529 [matz@ze ab t] In fact,
  | 9530 [Dave@Pr gm t] if (rb_block_given_p()) {
  + 9531 [steve@de f. ] buff = File.new("filename").read(nil)

Newbie question: call-by-reference
9466 [casaldaliga@] list and found nothing, so it must be too obvious.
9467 [matz@ze ab t] How about wrapping the value by an array?
+ 9487 [sent@qu li y] Or you could wrap it in a class. More work, for
+ 9525 [matju@ca .o ] Zero-Dimensional Arrays. Fun For The Whole Family.

Ruby implementation of basic auth http client
9473 [bootpe@my de] Has anyone already implemented a Ruby HTTP client
9478 [erne@po er a] require 'net/http'

ruby-mode for Emacs crashing
9490 [volkmann2@ho] I'm using ruby-mode.el with GNU Emacs 20.7.1.
9511 [jimm@er s. o] Not sure what your problem is. Here is the relevant Ruby section from my

9494 [Bostjan.Jerk] Is there a way to start a subprocess and return from it ?
9495 [   xm@w3 .r ] Yeah ... learn UNIX. It's fork-exec stuff.
9496 [Bostjan.Jerk] Yeah and what if I want to run it on M$ ?
9497 [   xm@w3 .r ] Hmmm ... ruby threads are platform-independent.
9498 [   xm@w3 .r ] Also ... final thoughts - ruby may block thread execution while performing
+ 9501 [decoux@mo lo] pigeon% cat b.rb
| 9506 [   xm@w3 .r ] This is because initialize waits for array of args ... and [1, 2] makes
| 9507 [Bostjan.Jerk] Found the way to do it.
+ 9505 [elderburn@mi] If I am writing something for myself only? var = [] amd var = {}.  If I am

http read
9508 [Bostjan.Jerk] I want to write a small script to read html data from http server.
9509 [   xm@w3 .r ] You should send a request to server to get something.
9510 [   xm@w3 .r ] require 'socket'
9513 [Bostjan.Jerk] OK, thanks. Works like magic.

Enhancing the functionality of an object
9520 [steve@de f. ] I have a OOP programming problem.
9524 [jstern@fo ha] You can keep index variables that indicate the valid range
9537 [sent@qu li y] It depends on what you need. If you really need

Larry Wall INterview
9521 [ianm74@my de] ActiveState announced that they will add Perl scripting to Zope?
9522 [mitch@ve ux ] Since that Ruby article appeared in DDJ nearly everyone I've talked with has
10583 [gstrock@pa b] Larry Wall's interview is how I found out
+ 10584 [jim@fr ez .o] Wow. Sounds exactly like myself.
| 10590 [andy@to ls e] Resistance IS futile :-)
+ 10618 [lists.ruby-t] I'm quickly passing obnoxious, or so I suspect.  I've been planting
  + 10634 [john_van_v@y] I'm a big perl person and have been trying to organize in NY.
  | 10640 [schneik@us i] # I'm a big perl person and have been trying to organize in NY.
  | 10648 [john_van_v@y] ksh -> expect -> ssh -> remote machines,
  + 12704 [djberg96@ho ] I joke with my boss that I'm going to write all of my production scripts
    + 12723 [hdstich@co m] on the german Ruby mailing list was sometime ago a
    | 12828 [ale@cr ms n.] That's an attitude I like! :)
    + 12724 [decoux@mo lo] Look at
      + 12726 [hdstich@co m] hmm, but the description says
      + 12727 [decoux@mo lo] Look for this "Database Independent API for Ruby" ...  "dbi.rb"

Problem with mod_ruby + mysql.
9523 [markv@pi ar ] I've got a configuration problem of some sort when trying to use the mysql
9783 [knos@fr e. r] does mysql support work in command line+?

Strange Hash behavior
9533 [agnottok@ho ] class C
+ 9534 [avi@be a4 co] But it will also use some method to test equality... I don't remember
+ 9535 [kosako@so ne] Hash use "eql?" method for key equality.
+ 9536 [matz@ze ab t] Hash checks equality of keys by `hash' and `eql?'.
  9550 [agnottok@ho ] Ok, thanks. But for me its a violation of "Principle of Least Surprise".
  9551 [aleksi.nieme] It's pretty common for Hash to require these two things. With the method
  9552 [decoux@mo lo] Because you are not in a case of perfect hashing, i.e. 2 differents
  9633 [ben_tilly@ho] The above explanation makes more sense if you understand
  9642 [decoux@mo lo] ruby version
  9645 [ale@cr ms n.] Thanks Ben and Guy, for the extra information.
  9646 [decoux@mo lo] This is not the hash function used in st_lookup, this is just the hash

Tk-related developments in the Python world (Tkinter 3000)
9541 [schneik@us i] Ruby-izing this.

Passing parameters to InterBase Transactions
9545 [jilanik@ti .] I am using Ruby with InterBase and it works really fine; now I am trying

deamon with auth
9549 [mips@cy er p] I did the choice of ruby for a project i'm on which is based on a deamon where you log in to access it's features.
9596 [decoux@mo lo] It's hard to reply to such a question, may be you can be more specific ?

how 2 use __END__ and DATA
9554 [rubinubi@cy ] I want to read data from my program file rather than from an external
+ 9555 [Dave@Pr gm t] puts "hello world"
| 9556 [decoux@mo lo] puts DATA.readlines
+ 9557 [hgs@dm .a .u] If you rewind DATA you will get the lines before __END__ as well! :-)

ANN: Some survey results
9558 [Dave@Pr gm t] The first 80 survey results are available at

Re: Learning Ruby
9560 [sol123@ms .c] ...
9561 [hgs@dm .a .u] but there is no IDE yet.
9562 [matz@ze ab t] Emacs?
10043 [harryo@zi wo] Sounds like an excellent way to balance things out.  You get the

Which GUI toolkit to use?
9563 [djevink@xs a] I'm new to Ruby and which to start some pilot GUI with it I don't read
9564 [hgs@dm .a .u] I don't do much with GUI's yet, but it seems to be Tk...
9574 [jens@ir -n t] I prefer Ruby/Qt ... it's still in an early state

DATA and ARGV don't seem to work under winruby
9565 [rubinubi@cy ] I guess that the subject says it all. I couldn't get the __END__ DATA

9566 [ruby_david@h] Response.Redirect "another_url.htm"
9615 [thomas@st om] As a side note: relative paths in Redirects (Location:) are not

ANN: Windows InstallShield 1.6.2 Available
9567 [andy@to ls e] I'm pleased to announce that the Windows InstallShield version of

9568 [sbalu@ny .n ] Is there any way glade-xml be xlated to ruby-gtk ?
9573 [avi@be a4 co] I've previously done a libglade wrapper for java, and it was pretty
9575 [Dave@Pr gm t] Never having used it, can I ask a stupid question?? Glade seems bound
+ 9576 [jens@ir -n t] Qt has it's own GUI Builder: Qt Designer
| 9577 [Dave@Pr gm t] But wouldn't it be nice to have one representation that could be used
| 9578 [joe@vp p. et] Yes it would!  sort of like a DBI for gui toolkits.
| 9579 [schneik@us i] Can I ask an indirectly self-referential meta-rhetorical presumptive
| 9580 [jens@ir -n t] yes... it would. I'm not an expert, but I think
+ 9585 [avi@be a4 co] The glade file format is extremely bound to Gtk; not only in terms of

GTK problems under Windows
9583 [sent@qu li y] I'm porting my game from Ruby/GTK/Linux to
9600 [ntalbott@ro ] Hmmm.... that code executes fine for me, although nothing gets printed when

3 + 2.im works!  why?
9584 [rpg@xs al .n] true
9587 [Dave@Pr gm t] This is all the magic of Numeric#coerce.

rescue / ensure
9589 [berndlor@t- ] I don't understand what the ensure-clause is for.
+ 9592 [green@Fr eB ] f = File.open ...
+ 9593 [ale@cr ms n.] I suggest you to do some testing where you try to exercise it a bit,

Re: Redirection (was "")
9595 [neumann@s- i] require "cgi"

Problems with quotes in Win9x spawns
9611 [ xx@he e. om] From DOS command line under Win98
9631 [phasis@ch nn] You can define your own system in Windows regardless of build versions

Non-blocking I/O?
9617 [schuerig@ac ] I'm trying to watch some (log)files for changes. For this purpose,
+ 9628 [kjana@os xa ] You intended `tail -f'?
| + 9640 [schuerig@ac ] Close :-)
| + 9641 [decoux@mo lo] #sysread use internally read(2). Just catch IO::EOFError
|   9658 [schuerig@ac ] Works, thanks. But I must admit, that I don't like using exceptions for
+ 9663 [matju@ca .o ] Do not use Non-blocking I/O. This is not a concept that is useful here.
  9669 [schuerig@ac ] Apparently it works on Linux. Whatever "it" is exactly. That is, I can't
  9670 [christians@s] This is very likely outside the interest of the discussion, but Linux's
  9673 [schuerig@ac ] Sigh.
  9681 [ben_tilly@ho] Reference please?  This conflicts with my understanding
  9689 [christians@s] Our server cluster is CPU limited (we have a 96Gb switch). Profiling showed
  9690 [louie@Tr ns ] One of the problems with select() is that the kernel keeps no state