43313-46070

43147-43642 subjects 43530-44138

Getting CGI arguments as scalars
43313 [pmak@an me l] cgi = CGI.new
+ 43323 [dblack@ca dl] Interesting -- I don't think I've ever seen it written with the comma
+ 43433 [transami@tr ] you can also modify the CGI class to return a scalar if the parameters
  43434 [airboss@no e] Chances are you're going to know in advance if your form (or whatever)
  43457 [transami@tr ] well, it dosen't really end up working that way. i never use kind_of? or

vim settings
43315 [lists@de on ] In an attempt to do bracket matching in Ruby, I added let loaded_matchit =
43317 [ned@bi e- om] Did you install my ftplugin/ruby.vim yet?
43654 [kgergely@ml ] Azt irtad, hogy

cgi.rb:490:in `+': failed to convert Fixnum into String
43318 [pmak@an me l] cgi.header({'Status' => 401, ...});
43391 [wakou@ru y- ] snip

Where's the 'rubydoc' command?
43320 [pmak@an me l] In Perl, I can just type e.g. "perldoc CGI" to get the documentation
43322 [Dave@Pr gm t] For standard classes and libraries there's 'ri' (available on the

is this the way it should work? newbie problem...
43324 [mwohlwend@we] that seems not to work: (it' ported from perl to ruby:-)
+ 43325 [pmak@an me l] if --x == 0
| 43326 [dblack@ca dl] Which is none :-)
+ 43327 [hal9000@hy e] The problem is that Ruby has no auto(inc|dec)rement
+ 43328 [austin@ha os] Ruby doesn't have ++ or --. For incrementing, the succ method is the
+ 43330 [mwohlwend@we] o.k., o.k.,

Question: ruby vs. ksh
43332 [DDouthitt@cu] ...
+ 43334 [pmak@an me l] If you're doing something that involves a lot of shell commands and
| 43335 [DDouthitt@cu] ...
| 43340 [tim@ve et .a] can also be used for chgrp(1) operations.
+ 43337 [tim@ve et .a] [ HTML-bloat snipped ]
| + 43339 [pmak@an me l] mkdir foo
| | + 43342 [huber@al m. ] tmp = ""
| | + 43355 [tim@ve et .a] *smack!*  Of course!  I apologize.  I didn't think it through.
| + 43343 [piman@sa re ] Try
+ 43357 [list@NO PA c] require 'ftools'
  43379 [DDouthitt@cu] ...
  + 43380 [DDouthitt@cu] ...
  + 43408 [list@NO PA c] This pops out every now and then in different contexts: recursive
    43409 [hal9000@hy e] If that is the case, it should be possible to steal the
    43422 [DDouthitt@cu] ...
    43478 [ser@ge ma e-] Why not use 'find'?

RE: Gvim interface to the ruby debugger?
43333 [jeff.gray@in] Since this thread made the Ruby Weekly News wrap-up, I feel obliged to
43338 [ned@bi e- om] Sure! It still needs to be done...
43414 [jeff.gray@in] Well, I was just planning on lurking until I'd figured things out a

Reusing sockets
43336 [joe@vp p. et] Question on sockets:  Can you reuse them?
+ 43344 [joe@vp p. et] "Generally, stream sockets may success-fully connect() only once;
+ 43348 [matz@ru y- a] Don't close.  You loose the underlying socket connection (the file

Problems with Net::POP
43346 [austin@ha os] I am having problems with ruby 1.6.6 and Net::POP.
43349 [eban@os ri .] You should call POP3#finish, or call POP3.start with block.

short cuts?
43350 [tspivey8@te ] attr_reader :a,:b,:c
+ 43351 [shirai@p1 p.] attr_accessor :a,:b,:c
+ 43352 [hal9000@hy e] attr_accessor :a, :b, :c
+ 43353 [Dave@Pr gm t] attr_accessor :a,:b,:c

Documentation
43354 [guillermo.fe] 1- xemacs: I've tried to install ruby-mode.el, and I have searched
43382 [Dave@Pr gm t] If your problem is that font-lock isn't working, then you need to add
43435 [guillermo.fe] Thank you fo rthe answer.
+ 43438 [Dave@Pr gm t] (autoload 'ruby-mode "ruby-mode"
+ 43549 [jean_hugues_] I have had a hard time using ruby-mode.el, but that was my first

(0..3) == (0...4) returning false?
43358 [list@NO PA c] Is there a reason for two ranges holding the same extension but
+ 43359 [matz@ru y- a] Although they have same range, they are still different.
| + 43366 [W.L.Kleb@la ] This seem to go against Ruby's principal of least surprise, please
| + 43372 [list@NO PA c] In what?
|   43374 [aamine@mx ed] (0..3) === 3.2    # false
|   + 43385 [raja@cs in i] best,
|   + 43405 [hal9000@hy e] Ahhh. Very interesting. I would not have thought
|   + 43407 [list@NO PA c] (0..3)   0 <= x <= 3
|     + 43423 [harryo@zi .c] That explains why they're considered different, but can someone explain what
|     | 43427 [martine@cs w] 3.2 is the number 3.2, three and two tenths, three point two.
|     + 43446 [juergen.kati] There is a pitfall you must be aware of.
|       43448 [matz@ru y- a] I'm working on it in 1.7, but still no firm decision.
|       + 43450 [dblack@ca dl] aRange === n iff aRange.to_a.include?(n)
|       | + 43451 [dblack@ca dl] Hmmm...  maybe not.  I forgot about Range#include?, which already
|       | + 43460 [austin@ha os] I think that your test would result, however, in (0..3) == (0...4)
|       |   43483 [matz@ru y- a] I defined Range#step in 1.7.2, but it's not working right yet.
|       + 43454 [tsiivola@cc ] You want wishlists? I have wishlists :-)
|         43464 [dblack@ca dl] I believe the step is defined more generally as anObject.succ, which
+ 43469 [alwagner@tc ] I think you are right in your surprise.  The confusion comes when one group
  + 43484 [matz@ru y- a] That's the point.  My guess is a Range should work as both, depending
  | 43575 [tobiasreif@p] What about a class Continuum and a class Sequence?
  | 43596 [cjh_nospam@m] Though you suggested that naming isn't important, I'd like to suggest
  | + 43668 [tobiasreif@p] ... or simply Array.new (4..15)
  | | 43900 [cjh_nospam@m] Perhaps, but Array.new(0..2**100) could be a bad idea.
  | + 43987 [tobiasreif@p] nope; I said
  + 43547 [tms2@ma l. t] If I understand the pickaxe book correctly, Ranges must be made of
    43568 [alwagner@tc ] I think you are absolutely right.  The succ test is appropriate.

package protected methods
43360 [matthias_vei] is there a possibility to gain a visibility like java's
+ 43363 [camin@ci .r ] irb(main):001:0> class Aclass
+ 43388 [jlj@cf rc co] A timely question ;) I'm looking for something like this too. There are
  + 43392 [Dave@Pr gm t] Even better would be "friend on steroids", so I could say
  + 44522 [domelia@ro e] I'm hoping that something like Java's package protected construct

Ruby 1.7 for Windows?
43373 [caelumse@ya ] How do I get Ruby 1.7 for Windows? I can only find 1.6.6.
+ 43375 [andy@to ls e] My fault!  I had hoped to get that out last month but got
| + 43378 [caelumse@ya ] Great!
| + 43389 [jlj@cf rc co] Are you jumping to Ruby 1.7.x for the next Windows installer or going with
| | 43424 [bobx@li ux a] Inquiring minds want to know!
| | 43432 [andy@to ls e] Both.
| | + 43466 [jlj@cf rc co] static RB_ZLIB_NORETURN(void raise_zlib_error(int, const char *));
| | + 43548 [chr_news@gm ] try the following link
| |   43555 [andy@to ls e] Thanks, I'll give that a try.
| + 44481 [ADATE@kc rr ] Yes ...interested !
|   44490 [guaracybm@ig] []'s
|   44491 [ADATE@kc rr ] I meant  " .. (I am) interested in alpha testing 1.7".
|   44597 [bobx@li ux a] It will be on the same site. I believe he is on the road and 1.7 will be
+ 43390 [jlj@cf rc co] If you want Ruby 1.7 for Windows, the quickest option might be to download

Working i586-mswin32 versions of dbm.dll / gdbm.dll ?
43377 [mattbee@so p] Can anybody save me a lot of messing about and email me these two DLLs from

[OT-OpenSource-Newbie] Building Ruby into VIM
43384 [STUCKNER@MU ] ...
43387 [ned@bi e- om] ./configure --enable-rubyinterp
43393 [STUCKNER@MU ] Ok that worked great. But (even more off-topic), this builds the executable
+ 43395 [james@ru yx ] Have you tried running
| 43399 [STUCKNER@MU ] Thanks that worked fine.
+ 43398 [ned@bi e- om] What that means, probably, is that configure couldn't find the header
| 43400 [STUCKNER@MU ] vim -g was all I needed.
+ 43410 [brailsmt@ya ] Did you run "make install" as root?  I have built vim many times and I
  43574 [tobiasreif@p] ... and must be on the system path to be callable without a path.

grep regex to ruby regex...
43402 [todd@du kl n] I'm just about to finish up my first ruby program, but I'm
+ 43404 [dossy@pa op ] $ cat <<-EOT >foo.rb
+ 43406 [matz@ru y- a] File.foreach(filename) do |line|
| 43418 [pabs@pa lo r] ruby -lne 'print unless /\s*#/ or !/\S/' filename
| + 43420 [pabs@pa lo r] [snipped]
| + 43426 [chris@da kr ] Except matz wins because the oringal poster wants it as part of a
+ 43411 [nobu.nokada@] ruby -pe '$_ = "" if /^[[:space:]]*(?:#|$)/'
+ 43421 [ser@ge ma e-] ruby -nle 'print unless /^\s*(#.*|)$/' filename

Juergen Katins and the German translation
43412 [hal9000@hy e] I'm speaking only for myself, not for Dave
+ 43425 [mark.firesto] For what it's worth (not a lot) I second your opinion.
+ 43445 [detering@is ] Yes, indeed.
  43468 [Dave@Pr gm t] FWIW, I'm personally not looking for an apology.

Segmentation Fault - Ruby Garbage Collection
43416 [avenger@wp .] During load testing of our Ruby program, we have been getting
43439 [matz@ru y- a] Do you mean you don't get the problem with 1.7.2?
43465 [avenger@wp .] The problem did originally occur with 1.7.2.  Then we tried downgrading to
45602 [billtj@gl e.] Has there been any conclusion to this problem yet?  I am experiencing
+ 45603 [decoux@mo lo] Yes,
+ 45604 [camin@ci .r ] you are looking for GC.disable perhaps ?
  45757 [billtj@gl e.] After I searched the comp.lang.ruby discussions further, I also found
  45785 [matz@ru y- a] Show me the code, at least your mark function.
  45830 [billtj@gl e.] Dear Mr. Matz,
  + 45831 [decoux@mo lo] Use rb_global_variable() see README.EXT
  + 45839 [matz@ru y- a] rb_global_variable(VALUE*) is your friend.
    45882 [billtj@z. lu] Dear Mr. Matz,
    45927 [matz@ru y- a] I could read your mind.  So I prepared you
    45985 [billtj@y. lu] Dear Mr. Matz,
    45991 [matz@ru y- a] The future Ruby (Rite) will *not* have compatible C API, but I plan to
    46002 [billtj@y. lu] Dear Mr. Matz,
    46017 [matz@ru y- a] 5 words (20 bytes on int32 platforms) for each objects.
    46051 [billtj@z. lu] Dear Mr. Matz,
    46054 [cjs@cy ic ne] You might consider reusing objects, rather than creating and destroying
    46070 [billtj@z. lu] Thanks for the pointer.  I have checked the Flyweight pattern, but

Treatment of class variables in inherited classes
43428 [jeff.gray@in] This question probably has more to do with the fundamentals of OOP than Ruby
43430 [dblack@ca dl] Don't you get an "uninitialized class variable" error at that point
43436 [jeff.gray@in] Actually, the code runs without error on our site installation
43437 [dblack@ca dl] Hmmm...  I only get the error on 1.6.7... but anyway, I don't think

Ruby developer wanted at Intel
43440 [ptkwt@sh ll ] Yes it's true: Intel has Ruby inside...
43442 [joe@vp p. et] Hopefully they won't throw the developer in jail ;-)
43443 [tim@ve et .a] I was wondering how pervasive this little story was in other programming

Running Curl inside Ruby using Command Expansion
43441 [tech7622000@] I am using the following command inside ruby
43459 [ned@bi e- om] What's the failure? Does it get any better when you pass full
43604 [tech7622000@] Sorry,
43613 [transami@tr ] your using curl? how do you like it? what's it like?
43867 [pdm@ad so co] Its Ok,

Make fails with missing header file (OS X)
43449 [brucehobbs@e] [localhost:~/Temporary/FTP downloads/ruby-1.6.7] bhobbs% make
+ 43453 [urban@oo s. ] I got that too, when trying to compile Ruby 1.7.2 on my
| 43470 [martine@cs w] ./configure --help
+ 43471 [gehlker@fa t] Ah, the famous "'dlfcn.h' not found". This ought to be a FAQ.
| 43491 [brucehobbs@e] Shouldn't configure have addressed this? Perhaps if I were running a version of autoconf newer than 2.13?
| 43529 [gehlker@fa t] Well, most folks don't bother to rebuild configure from configure.in so the
| 43533 [brucehobbs@e] I only tried autoconf after I encountered the missing file. And, autoconf 2.13 did not work with Ruby 1.6.7, at least not for me.
+ 43472 [jlj@cf rc co] Ruby uses a newer version of autoconf than the one you've got installed on

gtk-ruby doc  (tutor)
43452 [kgergely@ml ] I've succesfully set up and used gtk (under linux) and just curious,
44181 [yashi@ya hi ] I think the reason is that Ruby uses #foo as a getter and #foo= as a

hash *needs* rehashing?
43467 [list@NO PA c] I'm using hashes intensively in an archive module.  Often h['foo']
43473 [decoux@mo lo] Do you change $= ?
43525 [list@NO PA c] Yes, it's exactly that, thank you!

[ANN] Sys::ProcTable 0.1.0
43475 [djberge@qw s] I am happy to announce the release of Sys::ProcTable 0.1.0 into the

packages
43486 [lists@de on ] I've browsed around somewhat but have been unable to find a repository
+ 43487 [decoux@mo lo] See the link "add new entry"
| + 43516 [lists@de on ] Thanks, I had seen this link. It seemed to me upon glance that it's not a
| + 43520 [ser@ge ma e-] There's also a burgeoning project called 'rpkg', which is a distribution
+ 43528 [list@NO PA c] Have a look at http://www.allruby.com/rpkg.  You can also browse the
  43539 [rich@in oe h] Regards,

OT: IANAL
43488 [vjoel@PA H. ] Just for laughs, I had to post that IANAL (I Am Not A Lawyer, I

Regular Expression problems
43490 [caelumse@ya ] I got a problem with regular expressions in Ruby. The closest I have
+ 43492 [caelumse@ya ] Perhaps I should have mentioned that I'm a Ruby-newbie. So I am would
+ 43504 [nobu.nokada@] re = /<name: ([a-zA-Z_]+)>\n(.*?)(<name:.*|\z)/m
  + 43521 [caelumse@ya ] Thanks!
  | 43527 [lists@de on ] For a good book on regular expressions, check out Jeffrey Friedells book
  + 43718 [dblack@ca dl] re = /<name: ([a-zA-Z_]+)>\n(.*?)(?=<name:|\z)/m

Mixin class methods
43495 [meier@me st ] I have another question regarding Mixins. How can I mix in class
43498 [STUCKNER@MU ] module A
43501 [pbrannan@at ] Be forewarned that class variables used in A are A's class variables,

Class.forName("Array")
43496 [sylvia_v_cha] Is it possible to create an object of the class
+ 43499 [vjoel@PA H. ] How about Class.new(Hash)? This creates an anonymous subclass of Hash.
+ 43505 [james@ru yx ] There was code for this posted on ruby-talk not too long ago, by Dave
+ 43506 [nobu.nokada@] eval('Hash').new
+ 43519 [list@NO PA c] irb(main):001:0> name = 'Hash'

set_trace_func
43509 [smoof-ra@el ] Where can I find documentation on this function?  It doesn't appear to
+ 43510 [Dave@Pr gm t] ...
+ 43511 [lyle@us rs s] ...
  43526 [smoof-ra@el ] Thanks.

Block with Regexp#match
43512 [g_ogata@ih g] Since Regexp#match so far does not use a block, why not extend it to
43515 [dblack@ca dl] '<aaa><bbb><ccc>'.scan(/<(.*?)>/)

String#split with nil first argument
43513 [g_ogata@op u] When calling String#split with no arguments, it defaults to using $;,
43517 [dblack@ca dl] ...only if $; is non-nil (because you can't split on nil)
43578 [g_ogata@op u] The issue comes up when you use the second argument (the limit).
43589 [matz@ru y- a] Indeed.  We will see split accepts nil as a first argument in the next

Work From Home - Unique Service to Buisness                        9085wgXU4-171qgdv3694ykYm5-292x-29 (fwd)
43514 [lists@de on ] I received this shortly after signing up to this mailinglist. Has anyone

ruby and 8192 bytes
43518 [todd@du kl n] The following code produces a 8192 byte file on machine2,
43522 [nobu.nokada@] Put $defout.flush (or $defout.close) before "system" commands.
43524 [todd@du kl n] thank you...that completes my first program! Now I'll go read about
threads.html
top