313039-313842 subjects 313480-313887

^ [ANN] Ruby/Watchcat 1.0.2 and Ruby/Watchcat-pure 1.1.0
313283 [andre digira] I'm pleased to announce new releases of Ruby/Watchcat. The new

^ assignment operator that treats empty and nil as the same thing
313296 [scooterm hot] ### test1
+ 313300 [tpreal gmail] There is no such operator in Ruby. You have to make an if statement or
+ 313304 [matt tidbits] Would it suffice to subvert Hash in such a way that the value of an
+ 313309 [RichardDummy] On Aug 29, 6:01=A0pm, "scoot...@hotmail.com" <scoot...@hotmail.com>
  313310 [RichardDummy] On Aug 29, 10:21=A0pm, RichardOnRails
  313312 [RichardDummy] On Aug 29, 10:21=A0pm, RichardOnRails
  313314 [fxn hashref.] In my view that's abusing open classes. Ruby has well-defined boolean
  313328 [tpreal gmail] I agree with that. But if it's just one hash object that causes you

^ cycle in Ruby 1.9?
313301 [vze26m98 opt] I've seen a number of references to being able to pass an argument to
313302 [dave pragpro] Ruby 1.9 has changed a lot since Christmas. Here's the same code

^ usfine games store
313316 [rebecca0813 ] Do you know the game for runescape money in a good website for

^ how to use gsub method?
313317 [his2000x gma] sorry!
313320 [m.fellinger ] String#gsub does string substitution, but it cannot replace /a/ with
313322 [his2000x gma] thank you...
313323 [etaern yahoo] require 'net/http'
313335 [his2000x gma] wow, thank you!! vhaerun

^ array#push
313318 [ron.green gm] class Person
+ 313319 [m.fellinger ] You are asking about Array#push, yet not using it. If you would try to
| 313321 [ron.green gm] I get it. Boy, was my stupid light lit or what?
+ 313346 [uzimonkey gm] Why not this?

^ Show elements of array separated
313324 [jonas.esp go] Why when is showed an array  into a variable , it is showed with all
+ 313326 [rasputnik he] puts "#{foo.join(',')}"
| 313327 [m.fellinger ] puts arr.join(', ')
+ 313330 [shortcutter ] irb(main):001:0> foo = %w{a b c}
| 313334 [jonas.esp go] irb(main):001:0> foo =3D ['a', 'b', 'c']
| 313336 [shortcutter ] irb(main):004:0> s = ""
| 313345 [uzimonkey gm] irb(main):006:0> [].inject{|a,b| "#{a}, #{b}" } or ""
| 313362 [dblack rubyp] [].inject {...}.to_s
| 313373 [uzimonkey gm] Using inject you could do something to each element (capitalize, for
+ 313331 [tpreal gmail] puts foo.inspect
+ 313352 [dandiebolt y] foo = ['a', 'b', 'c']

^ require question
313329 [etaern yahoo] I'm trying to write a simple source filter . For that purpose I created

^ is RDT from rubypeople.org really dead?
313337 [ruby i-mail.] I installed RDT from rubypeople.org but it seems to have some bugs and it does not help me much.

^ using assert outside of test unit
313338 [adamtemporar] unit test but in say your class methods etc.
+ 313340 [tpreal gmail] Those asserts are instance methods of Test::Unit::TestCase so you cannot
+ 313341 [robert.dober] 508/8 > ruby -rtest/unit/assertions -e 'include

^ Net::FTP
313342 [ard gpdnet.c] I have setup an ftp script to fetch all files from a directory on my ftp
313343 [uzimonkey gm] Define "really silly filename".  Show a dir of the directory, then show
313344 [ard gpdnet.c] This is what the log returns
313347 [uzimonkey gm] Those aren't "really silly filenames," those are the lines returned by
313350 [ard gpdnet.c] OK, I have added that split line in here,
313380 [ard gpdnet.c] Fixed it!

^ Another Date Class
313348 [damientheoz ] I need to develop new date class in ruby rather then built in date class
313349 [bill.walton ] This looks an awful lot like homework.
313357 [TimHunter nc] Yes. Somebody going by the name "Michael Citra" posted the same question

^ How can I invoke super class's method
313351 [youhaodeyi g] My class include a Module and overwrite a method of the Module. In this
313354 [tpreal gmail] Just the word super().
313365 [dblack rubyp] Keep in mind, though, that the semantics of super (which is a keyword,
313392 [youhaodeyi g] Got it thanks.

^ Simple, simple socket question
313353 [w.dresh gmai] I am very sorry if this has already been asked and answered; I have,
313355 [eah.yhld gma] Change your singel quotes to double quotes.
313506 [monojohnny g] This works on my system (Just brings back 128 bytes HTTP header). (Note
313583 [B.Candler po] www.google.com\n, so you only need one more to give the blank line.
313619 [monojohnny g] \r\n - yup I remember that being necessary now in other programs - I
313622 [monojohnny g] //That's one too many \n's now//

^ How to match words that rhyme?
313358 [reddvinylene] How do I match words that rhyme, like end rhymes, last syllable
+ 313360 [mguterl gmai] HTH,
+ 313364 [AEtzold gmx.] Dear Redd,
| 313366 [AEtzold gmx.] or even metaphone (http://raa.ruby-lang.org/project/metaphone/)
+ 313370 [uzimonkey gm] English is extremely inconsistent.  Good doesn't rhyme with food which
  313458 [erik hollens] Maybe I'm missing something subtle, but isn't this what soundex is for?
  313481 [AEtzold gmx.] .. which is why I had proposed it in a previous post.
  313514 [erik hollens] Missed that, sorry.
  313515 [erik hollens] BTW, this would make a great Ruby Quiz. :)
  313520 [wieczo.yo go] Hehe, I thought so too :)
  313767 [lloyd 2live4] should give you a place to start.   (Please do not be TOO brutal in
  313771 [AEtzold gmx.] Another solution, which could help the problem of non-phonetic writing in English is to use

^ [ANN] Ribs 0.0.1
313359 [ola.bini gma] I am extremely pleased to announce the first release of Ribs.
313396 [emmanuel.sur] class Artist

^ Another really subtle bug.
313374 [patrickli_20] I seem to be running into a lot of subtle bugs lately. This one is
313376 [rogerpack200] double check line endings maybe they're messed?
313382 [patrickli_20] Yup that was the problem. I moved the file over from a Linux system, and

^ Another Chris Pine Tutorial Question
313377 [sleepingindi] Let's write a program which asks us to type in as many words as we
+ 313381 [cdemyanovich] Have you already been introduced to String#<=> [
+ 313385 [uzimonkey gm] There's not really any point to limiting yourself.  Whatever you come up
+ 313409 [shortcutter ] The trick I assume Chris is targeting at is to insert words at the=20
| 313430 [graham.ashto] That's a good idea. Or I suppose you could implement your own sorting
+ 313467 [timrandg gma] words =3D []
  313470 [timrandg gma] words = []

^ instance_eval/class_eval including/extending modules
313379 [ei04065 gmai] module SomeModule
313401 [dblack rubyp] I'm not sure what you mean by "ghost class". I think that might be an
313428 [ei04065 gmai] David, thanks for your reply.
313432 [dblack rubyp] I don't think there's any special case for private methods. They get
313433 [ei04065 gmai] Thanks once again for the fast reply,
313434 [dblack rubyp] Yes, that's the rule, and it's followed for all objects. It sounds
313435 [ei04065 gmai] Really fast this time. ;)
313451 [patrickli_20] I must say that I also find the difference between
+ 313453 [dave pragpro] Ruby has two separate concepts: self, the current object, and 'the
| 313457 [patrickli_20] Ahhh... now it comes together. Thank you so much.
| 313460 [dave pragpro] No evaluation takes place. The module is already "compiled", and Ruby
| 313463 [patrickli_20] Now that I have a firmer grasp on Ruby's object system, is it possible
| 313478 [dblack rubyp] It's not right to say that these things are inconsistent. They're all
+ 313456 [botp delmont] RnJvbTogUGF0cmljayBMaSBbbWFpbHRvOnBhdHJpY2tsaV8yMDAxQGhvdG1haWwuY29tXSANCiMg

^ Bug #496 (DRb slow)
313384 [jcmoore pres] Since I don't have access to Ruby-core, I'll just post a couple

^ Simple conditional causing hanging?
313386 [w.dresh gmai] if ( @thisLine.class != 'NilClass' )
+ 313389 [ryand-ruby z] This code is a complete mess. Simplify Simplify Simplify.
| 313394 [w.dresh gmai] Yeah, I know.  This is not what my program actually does.. I changed the
| + 313398 [ryand-ruby z] As I said before... There is NOTHING in the code given that would
| + 313402 [dblack rubyp] But Class#to_s doesn't cause hanging, unless you've redefined it
| + 313416 [sepp2k googl] If you change the line to that, your else case never executes. So how much do
+ 313391 [uzimonkey gm] You want @thisLine.nil?.  Alternatively, you could use @thisLine == nil,
  313393 [ryand-ruby z] NilClass === @thisLine
  313418 [uzimonkey gm] Ah, I'd actually wondered about that.

^ Wanted: Script to convert to/from UTF-8/UTF-16/UTF-32
313387 [siegfried he] Does someone have a little ruby script that will read a file in
+ 313400 [david_v_wrig] you could just convert everything to it's html entity form
+ 313424 [anibalrojas ] Siegfried,

^ Re: Where the Required Things Are (#175)
313390 [erik hollens] [68] erikh@islay ~% ruby quiz.rb date
313439 [erik hollens] #!/usr/bin/env ruby
313440 [erik hollens] It also doesn't catch absolute paths, which I completely forgot about.
313461 [matthew.moss] module Kernel

^ Re: capturing stdout during unit tests
313397 [chris.sepic ] require 'test/zentest_assertions'

^ Difference between dir/**/* and dir/*?
313399 [bjohnson con] dir/**/*
+ 313412 [Rob AgileCon] ...
+ 313414 [sepp2k googl] dir/* gives you all (non-hidden) files in the directory dir.
| 313425 [bjohnson con] Thanks for your help, what about its sub-sub directories? Is dir/**/*
| + 313426 [sepp2k googl] Yes.
| + 313484 [shortcutter ] Ruby documentation is often said to be bad - but not *that* bad that
+ 313637 [dvdplm gmail] This does a deep fetch: all files in all subdirectories of "dir"

^ Re: Please don't flame me...why is there no "++" in Ruby aga
313405 [apeiros gmx.] Many good answers already. I'd like to point out yet another reason why.

^ simple, array question!
313410 [his2000x gma] i don't understand array declaration..
+ 313411 [stefano.croc] In ruby you don't have to declare a variable (actually, you can't), you just
| + 313415 [his2000x gma] thank you crocco.
| | 313419 [uzimonkey gm] Ruby arrays are not like C arrays.  They don't have a fixed size, they
| | 313421 [his2000x gma] wow. thank to understand too well...
| + 313535 [shortcutter ] Some additonal note: the [] is an Array constructor.  It's a special
|   313594 [his2000x gma] thank you. robert
+ 313823 [lloyd 2live4] To get a specific size of array, you specify the number of items.

^ Re: [QUIZ][SOLUTION] Where the Required Things Are (#175)
313423 [jens.wille u] here's my solution (first submission ever ;-).

^ Measuring Memory Usage
313436 [programdrago] I'm trying to figure out how to check memory usage while my program is
313438 [lister pikkl] top
313445 [znmeb cesmai] Well, it ain't exactly that simple. First of all, "top" runs only on
313446 [znmeb cesmai] M. Edward (Ed) Borasky
313450 [programdrago] Sorry, I should have specified that I'm using Windows XP SP2 :\
+ 313452 [botp delmont] RnJvbTogQXppbXV0aERyYWdvbiBbbWFpbHRvOnByb2dyYW1kcmFnb25AbGl2ZS5jb21dIA0KIyBT
+ 313466 [znmeb cesmai] Well ... on Windows, there's a well-defined API to pull performance data

^ Changing intendation ruby/emacs-mode?
313441 [circularfunc] emacs indents 2 chars only by defualt in ruby-mode.
+ 313442 [fophillips f] (setq-default tab-width 4)
+ 313443 [matz ruby-la] (setq-default ruby-indent-level 4)
+ 313472 [fireinice gm] (add-hook 'ruby-mode-hook
  + 313565 [Rob AgileCon] ...
  + 313591 [oudeis nodom] I think you mean:                ruby-indent-level

^ How to load a program into interpreter?
313444 [circularfunc] When using emacs-mode for Ruby when I do C-c C-l it asks for a file to

^ Oniguruma in 1.8.x?
313447 [kenneth.m.mc] I seem to recall reading that Oniguruma had been backported to CRuby
313449 [tim.pease gm] You must manually install oniguruma and then install the oniguruma gem
313465 [charles.nutt] Or use Rubinius or JRuby, which include Oniguruma out of the box (in

^ Request for Block local methods, and Proc syntax
313454 [patrickli_20] So after using Ruby for a little over two months, I've made the complete
+ 313519 [shortcutter ] This does not really make sense.  block.instance_eval evaluates the
| 313553 [patrickli_20] The reason instance_eval shouldn't be used in that way is because it
| 313641 [shortcutter ] That's true.  I have to admit that I can't remember having seen this
+ 313647 [jballanc gma] Well, it's not exactly what you're looking for, but Ruby 1.9 has
| 313686 [patrickli_20] Thanks for your input guys.
| 313731 [shortcutter ] You're welcome!
| 313828 [patrickli_20] So I thought about your code snippet a bit more Robert, and it's almost
| + 313834 [shortcutter ] Well, but it works remarkably well, doesn't it?
| | 313839 [patrickli_20] Mmm, that throws a wrench in things... well if I figure out how to do
| + 313840 [dblack rubyp] I personally dislike the "stealth" instance_eval, since it does indeed
| + 313841 [ara.t.howard] require 'rubygems'
+ 313858 [ara.t.howard] a @ http://codeforpeople.com/
+ 313991 [matz ruby-la] In that case, if myLocalMethod can only be visible from myMethod, can
  314047 [patrickli_20] Thanks for the reply Matz,
  314049 [matz ruby-la] You can switch the context (the receiver) using instance_eval.  Do we
  314050 [patrickli_20] I think we need a way to preserve the scope elegantly, so that methods
  314052 [dblack rubyp] It sounds like you want some kind of bifurcation of self, so that
  314060 [patrickli_20] Mmm, I'm really not sure how it can be accomplished. I agree, yielding
  314071 [dblack rubyp] drawer = engine.draw_frame

^ beginner's problem with sqlite3
313455 [his2000x gma] I know that it needs rubygems sqlite3 to run

^ Getting tk to work on OS X?
313459 [kenneth.m.mc] I installed the latest ActiveState version of Tcl, then downloaded,
313462 [kenneth.m.mc] Never mind, thanks to http://www.tkdocs.com/tutorial/install.html I

^ Problems inserting PDF (Blob) to Mysql DB
313464 [rodrigo.berm] I need to insert a PDF file as a Blob to a Mysql DB.
313494 [monojohnny g] Are you able to try the SQL directly against your MySQL db for a test ?

^ How can I set the ruby loadpath?
313468 [youhaodeyi g] How can I set the ruby loadpath outside of the source code? for example,
+ 313471 [reitinge in.] -Idirectory     specify $LOAD_PATH directory (may be used more than
+ 313473 [tpreal gmail] On Windows you can set RUBYLIB env variable.

^ How to make a string upcase?
313474 [youhaodeyi g] name=@value.upcase
+ 313475 [ei04065 gmai] Can you post the surrounding code also? Otherwise it will difficult to
+ 313476 [jgabrielygal] irb(main):001:0> @value = "test"
+ 313483 [tpreal gmail] If your variable's name is uppercase then it's a constant. This can
+ 313487 [sepp2k googl] Not for that code you didn't.
  313492 [youhaodeyi g] oh, it is upcase.

^ Looking for a regular pattern
313477 [youhaodeyi g] Which pattern represents any characters including space, \t \n?
+ 313479 [ei04065 gmai] "Please read before posting
+ 313486 [wieczo.yo go] It's \s
| 313489 [sepp2k googl] I think he actually wants /./m as he said "any character" and not "any
| 313490 [youhaodeyi g] I think this is better [.\s]
| 313493 [sepp2k googl] No, it's not.
| 313496 [youhaodeyi g] Why? It should match any character.
| + 313499 [peter semant] From the docs, http://www.ruby-doc.org/docs/UsersGuide/rg/regexp.html
| | 313503 [dblack rubyp] Yes, but [.\s] is a character class, consisting of any character other
| | + 313549 [james graypr] => nil
| | | 313562 [dblack rubyp] Whoops. Yes, absolutely -- oldest pitfall in the book and I stepped
| | + 313563 [dblack rubyp] In case you didn't see James Gray's correction, let me inform you what
| + 313501 [sepp2k googl] Yes, but so does just . when you specify the m modifier. So why make it [.\s]
| | + 313502 [dblack rubyp] It depends whether you want to use . without including \n somewhere
| | | 313505 [sepp2k googl] Good point.
| | + 313504 [shortcutter ] One reason would be that you need option /m which is effective for the
| + 313509 [patrick.he g] Generally, "." matches characters including what "\s" matches.
|   + 313510 [dblack rubyp] No, by default . does not match \n. You can make it do so with the /m
|   | 313512 [patrick.he g] Yes, thank you for reminding me. :)
|   + 313511 [patrick.he g] Additionally, you can use pattern "(.|\n)" if you want to match all
|     + 313513 [dblack rubyp] Ruby regexes don't really have a single vs. multiple line mode
|     + 313551 [james graypr] #!/usr/bin/env ruby -wKU
+ 313498 [tpreal gmail] The pattern that matches any character is