254974-262926 subjects 255414-262525

^ long string assignment
255143 [duzuike gmai] $str = <<<aa
+ 255144 [stefano.croc] str = <<EOS
| 255145 [duzuike gmai] Thank you very much. it works.
+ 255147 [shortcutter ] str = <<aa
  255185 [rick.denatal] or even just
  + 255186 [rick.denatal] Oops, I meant either
  + 255189 [gavin refine] msg = "FULL OF INTERPOLATION GOODNESS"
    255214 [rick.denatal] Thanks, I corrected my initial typo without too much thought.

^ Re: Unroller
255150 [sonoflilit g] Wow, thanks for bringing such a cool tool to my attention.
255163 [shortcutter ] Maybe there is a way to switch off these warnings.  Is there a list of

^ Re: ruby/smalltalk: method_missing/doesNotUnderstand
255155 [rick.denatal] Actually overriding doeNotUnderstand: in Smalltalk is rather common
255629 [ryand-ruby z] seconded.

^ [ANN]  Monday, June 11, Phoenix Ruby User Group Meeting
255157 [james.britt ] See http://www.rubyaz.org/groups/prug/ for details, including maps and

^ possible bug in oniguruma, not 64-bit clean?
255168 [crowell07 li] I have a ruby script that uses some oniguruma features. It works on
255198 [jan.svitok g] I suggest to file a bug in either Ruby Tracker [1] or Oniguruma Tracker [2].
+ 255224 [crowell07 li] Hmm...I guess the problem is that I don't have any easy way to help
+ 255227 [crowell07 li] When I run the script "bug" in this tarball on my
  255231 [djberg96 gma] On Jun 11, 3:43 pm, Ben Crowell
  255237 [crowell07 li] It's not there, because the ruby interpreter has changed my

^ Code refactoring advice
255180 [onebitcipher] I have some code written that basically looks like below.  I want to
255212 [rick.denatal] Not that this makes it any more object oriented, but why use a lambda?
255221 [onebitcipher] Thank you very much Rick.  That was exactly the kind of advice I was looking
255232 [jan.svitok g] You can wrap this in a class (depending on what do you need to do with
255478 [onebitcipher] Thanks again!  I have the pickaxe2, and the "ruby way" book however I

^ a matter of style
255181 [bas van-gils] All,
+ 255188 [pi pihost.us] to
| + 255295 [perrin apoth] Your suggestions are pretty much canonical Ruby style, at first glance at
| + 255299 [dblack wobbl] Almost.  puts adds "\n" unless it's already there.  So these are
|   + 255338 [Rob AgileCon] Jim Weirich tends to be an advocate of that convention:  use do-end
|   + 255347 [robert.dober] Right but do you remember when I stupidly changed your code from
|   | 255377 [dblack wobbl] $ ruby -e 'puts
|   | 255382 [robert.dober] I love that guy... ;)
|   | 255426 [bas van-gils] I agree that the discussion is important. It's a good thing that Ruby supports
|   + 255394 [perrin apoth] It reads a little like OCaml to me -- which is pretty strange, in the
|     + 255395 [james graypr] assert_not_nil @enum.find do
|     | + 255400 [perrin apoth] Parentheses sound perfectly reasonable to me.
|     | + 255447 [ymendel pobo] I think Chad's point stands.  It seems whatever is encapsulated in the
|     |   + 255449 [james graypr] As long as your custom method doesn't take a block...
|     |   + 255517 [perrin apoth] Actually, I think you assumed more meaning in what I said than I
|     + 255434 [robert.dober] In my DSL I use at work I will write stuff like
|       255442 [dblack wobbl] It's not a contest -- not even a debate.  Ultimately people should do
|       255477 [robert.dober] 100% agree
|       255516 [dblack wobbl] It usually implies an outcome: someone "wins".
+ 255194 [robert.dober] Do not forget to unblock the Ten of Diamonds in your 4 Spades ;)
  255259 [bas van-gils] Robert (and also Anthony), thanks for your comments!
  255297 [perrin apoth] I believe it's a combination of efficiency and readability.  The

^ Constants and metaclasses
255184 [ruby-talk lo] Is there a way to define a constant in a metaclass and then have it used
+ 255187 [vjoel path.b] class Object
| 255196 [ruby-talk lo] Yes that works, but I'm specifically looking for something that does not
| 255203 [vjoel path.b] Oops, sorry.
| 255220 [ruby-talk lo] I didn't know that const_missing existed, that might be just enough to
+ 255200 [dblack wobbl] I don't think so (and I hope not, as it would be kind of strange :-)

^ [PreAnn] Labrador v0.0.1 or broken @ key
255199 [robert.dober] I eventually decided to submit some code to Rubyforge, just waiting

^ Ruby way to update a file in place
255202 [chen_li3 yah] I just wonder what is the Ruby way to update a file in place. Do I need
+ 255205 [djberg96 gma] That's the usual way. The other way is to use mmap.
| 255219 [chen_li3 yah] Where can I find some information about mmap?
| 255223 [agorilla gma] Google is your friend...
| 255228 [barjunk attg] Although it may be wrong, I recently used lockfile and temporary files
+ 255207 [vjoel path.b] You can open with the "r+" file mode, and use seek/rewind to move to a
+ 255208 [robert.dober] No not necessarily, that depends how you can access the file, you can
+ 255209 [lparravi gma] ================================
+ 255243 [lrlebron gma] I've used the rio library for this before. http://rio.rubyforge.org/.
  255257 [barjunk attg] That's a nice library...I didn't notice any thing about locking the
  + 255357 [lrlebron gma] I used it to clean up some code that was converted from vb6 to vb.net
  + 255358 [lrlebron gma] Here's an example of using rio

^ (none)
255235 [ara.t.howard] much ruby under the hood.

^ Possible to unset at_exit?
255247 [tjacobs-sndr] Is it possible to unset an at_exit proc? Currently, I'm calling exit! in
255255 [nobu ruby-la] Currently, no.

^ Fwd: Please Forward: Ruby Quiz Submission
255248 [james graypr] ...

^ [ANN] Lone Star Rubyconf 2007 - Registration Now Open!
255249 [jim freeze.o] We are happy to announce that registration for

^ Restricting Objects in Ruby Shell
255250 [sunrayson gm] Is there a way in which the ruby IRB interface can be restricted. I would
255254 [jeremymcanal] Look at _why the lucky stiff's sandbox.  With some work it could what

^ self in method name
255251 [iskaldur gma] Is there any difference between using self in a method name, and not
+ 255252 [mick hollins] class Foo
+ 255253 [jeremymcanal] The first one creates a class method as opposed to the second one that
+ 255296 [dblack wobbl] def some_object.some_method
+ 255302 [lists bertra] class Foo
| 255305 [peter peterc] Yes, except in the second you're actually opening up the virtual class
+ 255355 [erikveen gma] public class Foo {

^ how to make a[2][2][3]=4 work?
255258 [gpygood 126.] a=Hash.new{|h,k|
+ 255260 [gpygood 126.] I know this can work,but I think it is suck
| + 255261 [daniels pron] build_hash = proc {|h,k|h[k] = Hash.new &build_hash }
| + 255266 [sylvain.joye] def recursive_hash
| + 255313 [martin snowp] In addition to what's already been posted, there's this, which doesn't
|   255352 [gavin refine] Thanks for this - I didn't know about the default_proc method. Quite
+ 255319 [jenda cpan.o] Sure. Use Perl.
| + 255326 [martindemell] That's okay, it happens to the best of us.
| + 261007 [fsormok inbo] What's the ruby-way of such things?
|   261800 [ruby thomasz] In my personal opinion, multilevel hashes aren't clean and elegant in
+ 261037 [w_a_x_man ya] a = {}

^ extracting numbers from a string
255262 [mattjonespho] I have filenames from various digital cameras:  DSC_1234.jpg,
+ 255267 [dzwell gmail] str = "DSC_1234.jpg"
+ 255268 [_mwryder wor] a = "DSC_1234.jpg"
+ 255271 [come.news fr] If you just want to extract one number from a string, you could write
| 255300 [shortcutter ] Or even simpler
| 255836 [mattjonespho] A big thanks to everybody and all the creative solutions!
+ 255274 [bas van-gils] irb(main):001:0> s="DSC_1234.jpg"
+ 255339 [Rob AgileCon] Last November (2006), there was a series of postings to the Columbus

^ How to get properties of a JSP page using IRB
255264 [sourabh.vjai] page. i successfully automated a html page but when i am following same
255270 [alex blackke] I think we're going to need an example here...  A JSP page should be

^ [ANN] rabal 0.0.1 Released
255278 [jeremy hineg] rabal version 0.0.1 has been released.

^ Solved - it was my fault (was: Net::FTP : How to check whether chdir succeeded?)
255281 [ronald.fisch] For me too. Sorry, my fault. I should have first stripped down my

^ add element at end of array
255283 [daniel.liebi] i'm pretty new to Ruby. I searched 'Programming Ruby' and the online
+ 255284 [stefano.croc] a << 'foo'
+ 255285 [alex blackke] a << 'foo'
+ 255286 [farrel.lifso] a << 'foo'
+ 255287 [grzechg op_u] a = [1,2,3,4]
+ 255288 [mbj seonic.n] a << 'foo'
+ 255298 [alin.popa gm] a = [1,2,3]

^ Generate a grid of cells, and give characteristics
255289 [tillaart36 h] some PHP knowledge but I'm definitely no pro in programming...
255303 [list.push gm] If you want to use one array like in your example, you can fill it
255306 [tillaart36 h] Hey man, thanks for replying...okay so I already learned something...
255315 [list.push gm] How much time do you have for your project?
255317 [tillaart36 h] Well I don't really have a deadline but I'm hoping to go as fast as I
255336 [list.push gm] Is this a Ruby project?
255436 [tillaart36 h] Okay...I followed through the link you gave me...and i found another
255492 [caduceass gm] What's your motivation?  To just get it done and working (I'm a little
255592 [tillaart36 h] Thanks Todd, I will try your code after commenting on your help and
255606 [caduceass gm] I'd be interested in seeing that document.  Email me directly off the
255633 [tillaart36 h] Well it is a project about land use so I'll mail it to you...
255691 [tillaart36 h] Is there anyone else who has ideas on this or is my explanation not

^ Benchmark segfault [Was: Array#inject to create a hash versus Hash[*array.collect{}.flatten] ]
255290 [hramrach cen] ruby -w test.rb
255304 [shortcutter ] -e:1: [BUG] Segmentation fault
255334 [flori nixe.p] The reason for this problem is, that the stack is used to pass A LOT of
255337 [shortcutter ] That was what I was guessing.  However, I haven't enough insight to
+ 255341 [ mfp acm.org] $ ruby -e 'Hash[*Array.new(ARGV.shift.to_i) ]' 2091000
+ 255348 [flori nixe.p] Yes, the implementation of this is in eval.c's rb_call0, after that the
  255418 [nobu ruby-la] Actually, the definition of TMP_ALLOC.  Try replacing #ifdef

^ sending mails
255292 [email2nilez ] Can anyone give me the step-by-step procedure for sending mails in rails

^ assigning hash to attributes
255310 [daniel.liebi] as i mentioned before, i'm pretty new to ruby. So i'm trying to optimize
+ 255311 [stefano.croc] def assign_params params
+ 255312 [farrel.lifso] def assign_parmas(params)
| 255314 [daniel.liebi] Thank you both!
| + 255325 [daniel.liebi] with instance_variable_set the variable remains it's type (which is
| | 255361 [shortcutter ] Eval does not accidentally rhyme on evil.  There are serious security
| + 255327 [stefano.croc] require 'benchmark'
+ 255324 [martin snowp] Well, your initial attempt made all my internal security alarms go
  255331 [daniel.liebi] basically i'll agree.

^ [ADV] Registration for the Ruby Hoedown is now open!
255323 [jeremymcanal] We opened up registration for The Ruby Hoedown 2007 yesterday (to give

^ Newbie: help on site design?
255332 [Fjordur inva] I'm learning RoR, been throught various tutorials on scaffolding, done
255335 [chris.lowis ] Ruby on Rails questions are often better received in the Ruby on Rails
255349 [dangerwillro] Also consider the Rails Cookbook and the Ruby Cookbook.

^ rdoc and ri under MacOSX - how to?
255342 [buccinoo mac] I'm a Ruby newbie under MacOSX 10.4.9. Ruby is working very well but
255364 [ryand-ruby z] That is the location of the install, not the source tree you

^ Fastthread on x86_64?
255345 [alex blackke] $ ruby -v
255346 [alex blackke] Never mind...  apt-get install build-essential was the vital step.

^ question about initialize
255359 [mikejaystein] Why is the constructor method named initialize? Why not name it new to be
255362 [  z wzph.com] Typically, :new is a class method, which calls the instantiated
255363 [gavin refine] I had this same question when I first started out. The answer I came
255392 [mikejaystein] Thanks! That link makes it much clearer.

^ File.exists? ignores file extension on windows?
255365 [lbayes patte] I just wanted to check in with an issue I ran into last night.
+ 255371 [djberg96 gma] I cannot duplicate this with Ruby 1.8.5 (one click) or 1.8.6 (VC++ 8)
| 255396 [dteitsort ho] I similarly cannot duplicate the problem with Ruby 1.8.6 (one click) on
+ 255398 [dteitsort ho] Are you really sure 'fcsh' did not exist before the touch?  There is
| 255416 [lbayes patte] As it turns out, I'm running ruby 1.8.5 and consistently reproduce the
+ 255421 [nobu ruby-la] You use cygwin.
+ 255427 [_mwryder wor] The problem is in Cygwin I believe.  If you enter touch test.exe into
  255433 [ronald.fisch] (Scroll to the paragraph "The .exe extension").
  255482 [lbayes patte] Thanks for the responses!

^ using active support without rails
255366 [nephish gmai] a few weeks ago, i asked about how i may use active record in ruby scripts,

^ Stuck in a Redirect Loop While Crawling
255368 [whiteqt gmai] I am writing a crawler in Ruby to crawl websites. One of the sites I
255370 [donald.ball ] Presumably this is from LiveHTTPHeaders? I note that the Referer header
255372 [whiteqt gmai] On Jun 12, 1:03 pm, "Ball, Donald A Jr (Library)"

^ FileUtils.ln cross platform?
255369 [transfire gm] What happens when you use FileUtils.ln on a Windows system. Does it
255388 [djberg96 gma] With 1.8.5 FileUtils.ln simply copied the file. Without digging into
255404 [transfire gm] Excellent. Glad I don;t have to mess with it. Thanks Dan!
255471 [djberg96 gma] I don't have Vista yet. I'm waiting until Leopard is released, at
255544 [transfire gm] Yup. You are right.

^ Quick sed replacemnt
255373 [yitzhakbg gm] I need a quicky which I can't do in sed and I did it very clumsily.
+ 255374 [Reid.Thompso] sed 's/organizationsController/OrganizationsController/' file > newfile
| 255376 [yitzhakbg gm] Sorry, You didn't understand. The class name can be anything. Whatever
| + 255378 [gavin refine] class String
| + 255379 [yitzhakbg gm] Thank you, but you still didn't get it. organizationscontroller is
| + 255380 [peter peterc] perl -pi -e 's/^class ([a-z])/"class ".uc($1)/ge' filename.rb
| | 255381 [peter peterc] I remembered the nicer way to do it :)
| + 255383 [fwmailinglis] charset="us-ascii"
|   + 255389 [yitzhakbg gm] Hey, that's what I was looking for! I'll try it and get back to you.
|   + 255393 [yitzhakbg gm] Very nice. Thanks indeed!
+ 255375 [Reid.Thompso] perl -pi -e 's/organizationsController/OrganizationsController/' file
+ 255402 [lists bertra] ruby -pe 'gsub(/organizationsController/){|x|x.capitalize}'
| 255428 [lists bertra] __Sorry__! String#capitalize will destroy the camel case
+ 255432 [shortcutter ] # A skeletal controller

^ Ruby Beginner Books
255386 [sayakyi gmai] Dear all,
+ 255387 [agorilla gma] There was a recent thread about this.
+ 255390 [mattscilipot] I recommend http://hacketyhack.net/.
+ 255399 [perrin apoth] By far, my best experience with a relatively novice-oriented Ruby book
+ 255406 [peter peterc] I wouldn't be doing my job right if I weren't to recommend, simply..
  255407 [perrin apoth] "Everyday Scripting with Ruby" doesn't seem to assume any previous
  255409 [peter peterc] No, I have not, although I've read a few reviews and got the impression it's
  + 255410 [dangerwillro] Ruby is definitely the best way to do OOP conceptually, because
  + 255413 [perrin apoth] Until someone writes a book specifically about OOP that doesn't assume
    255652 [sayakyi gmai] Dear all,
    255663 [perrin apoth] It sounds like Chris Pine's book will be an excellent fit, then.

^ Extending Symbol with #to_str effects Struct.new
255403 [transfire gm] Not arguing either way a s to whether this makes sense or not (it's
255405 [cdcarter gma] This is because if Struct gets a String or a "string like object
+ 255411 [transfire gm] Okay. Thanks. I get the error now. Though, I don't really get how this
| 255417 [matz ruby-la] matz.
+ 255422 [nobu ruby-la] You may know, it can be disabled by passing nil as the first

^ getting ri working on FreeBSD
255408 [perrin apoth] I seem to have run into a small problem on FreeBSD.  Hopefully, someone
+ 255430 [perrin apoth] # tar jxvf /usr/ports/distfiles/ruby/ruby-1.8.6.tar.bz2
| 255475 [barjunk attg] Chad,
| + 255524 [perrin apoth] Enter "rdoc --help" or "rdoc -h" at the command line to get information
| + 255529 [rzezeski gma] You can run rdoc -h for a list of the commands.
|   255535 [perrin apoth] I wish I'd known that before I ran the command with -R.
|   256116 [barjunk attg] rdoc --ri -Y -U ruby-1.8.6
+ 255919 [drbrain segm] cd /usr/ports/lang/ruby