# Ruby

**URL:** https://www.ruby-forum.com/c/ruby/7.md?page=1767

[Latest](https://www.ruby-forum.com/latest.md) · [Categories](https://www.ruby-forum.com/categories.md) · [Tags](https://www.ruby-forum.com/tags.md)

**Page:** 1768

---

## [Surprise? ARGVundefined after processing ARGF](https://www.ruby-forum.com/t/surprise-argvundefined-after-processing-argf/64109)

<div class="topic-metadata">

**Author:** [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Replies:** 2\
**Last updated:** [June 23, 2006, 10:22pm UTC](https://www.ruby-forum.com/t/surprise-argvundefined-after-processing-argf/64109 "2006-06-23T22:22:32Z")

</div>

I found this behavior surprising. Is it intentional (and therefore something I need to understand better), or is it a bug: print\_usage if ARGV\[0\] == nil puts ARGV\[0\] # =\> filename # Parse the document @doc = Doc…

---

## [Parsing files](https://www.ruby-forum.com/t/parsing-files/96046)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 1\
**Last updated:** [June 23, 2006, 10:16pm UTC](https://www.ruby-forum.com/t/parsing-files/96046 "2006-06-23T22:16:09Z")

</div>

One thing I find myself doing over and over is parsing some type of text file and making something sensible out of it. As yet, I haven’t found a good solution (I’m probably missing some gems or modules someone has alr…

---

## [Queston: array.push](https://www.ruby-forum.com/t/queston-array-push/96044)

<div class="topic-metadata">

**Author:** [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Replies:** 5\
**Last updated:** [June 23, 2006, 9:16pm UTC](https://www.ruby-forum.com/t/queston-array-push/96044 "2006-06-23T21:16:39Z")

</div>

Well, I can’t believe that I’m back already with another question. Don’t fret, only a few more chapters in this book to go :slight\_smile: My task is to loop through a “gets” and end the program by just doing an empty,…

---

## [Object browser](https://www.ruby-forum.com/t/object-browser/96035)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 5\
**Last updated:** [June 23, 2006, 7:32pm UTC](https://www.ruby-forum.com/t/object-browser/96035 "2006-06-23T19:32:49Z")

</div>

Is there a graphical, hierarchical object browser available for Ruby? Preferably stand-alone, or something I could plug into Textmate. Thanks! Regards, JJ “America goes not abroad in search of monsters to destroy.”…

---

## [Warning message about "initialized constant"](https://www.ruby-forum.com/t/warning-message-about-initialized-constant/64258)

<div class="topic-metadata">

**Author:** [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Replies:** 5\
**Last updated:** [June 23, 2006, 6:47pm UTC](https://www.ruby-forum.com/t/warning-message-about-initialized-constant/64258 "2006-06-23T18:47:38Z")

</div>

This is part of a script I use that simply ftps a bunch of files over to a UNIX server at my company. It does work, but, I keep getting a warning message from RUBY about “rb:20:warning: already initialized constant BW…

---

## [Just joined - messages in duplicate](https://www.ruby-forum.com/t/just-joined-messages-in-duplicate/64277)

<div class="topic-metadata">

**Author:** [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Replies:** 3\
**Last updated:** [June 23, 2006, 6:37pm UTC](https://www.ruby-forum.com/t/just-joined-messages-in-duplicate/64277 "2006-06-23T18:37:03Z")

</div>

I’m noticing my messages are coming to me in duplicates. Something wrong or is that normal ? Stuart

---

## [Newbie question](https://www.ruby-forum.com/t/newbie-question/96041)

<div class="topic-metadata">

**Author:** [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Replies:** 2\
**Last updated:** [June 23, 2006, 6:27pm UTC](https://www.ruby-forum.com/t/newbie-question/96041 "2006-06-23T18:27:05Z")

</div>

Sorry because this is probably lame but I’ve been trying to think this one through for a few hours and after a few iterations can’t figure out the answer. It’s an exercise in the book “Learn to Program” (Pragmatic) A…

---

## [Global Exception Rescue](https://www.ruby-forum.com/t/global-exception-rescue/96038)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 9\
**Last updated:** [June 23, 2006, 5:32pm UTC](https://www.ruby-forum.com/t/global-exception-rescue/96038 "2006-06-23T17:32:07Z")

</div>

I need to run a script in a special environment. I need to change how STDIN works, for example, to fetch responses from GUI. That’s easily done and can be made to work via a simple: ruby -r my\_special\_env script\_to\_…

---

## [Turning an Array into a Hash based on an attribute value](https://www.ruby-forum.com/t/turning-an-array-into-a-hash-based-on-an-attribute-value/64179)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 7\
**Last updated:** [June 23, 2006, 4:47pm UTC](https://www.ruby-forum.com/t/turning-an-array-into-a-hash-based-on-an-attribute-value/64179 "2006-06-23T16:47:49Z")

</div>

A guy I work with has some some work on an ActiveRecord class that basically reads static lookup data, and contains (among other things) an “identifier” attribute. Given an array of all these objects he wanted to acc…

---

## [Class#name=](https://www.ruby-forum.com/t/class-name/96027)

<div class="topic-metadata">

**Author:** [@joshmh](https://www.ruby-forum.com/u/joshmh)\
**Replies:** 13\
**Last updated:** [June 23, 2006, 4:31pm UTC](https://www.ruby-forum.com/t/class-name/96027 "2006-06-23T16:31:49Z")

</div>

Is there any reason that Class#name= shouldn’t exist? It would be useful for giving a descriptive name to anonymous classes. Josh

---

## [GC problem (?) in 1.8](https://www.ruby-forum.com/t/gc-problem-in-1-8/63967)

<div class="topic-metadata">

**Author:** [@URABE\_Shyouhei](https://www.ruby-forum.com/u/URABE_Shyouhei)\
**Replies:** 5\
**Last updated:** [June 23, 2006, 4:15pm UTC](https://www.ruby-forum.com/t/gc-problem-in-1-8/63967 "2006-06-23T16:15:30Z")

</div>

å?é?¨ã§ã?ã?? æ?°æ?¥å?ã?ã??å?é?¨ã®autobuildã§1.8ã?ã?¿ã?¤ã? ã?¢ã?¦ã??ã?ã¦ã?ã??ã®ã«ã?æ°?ä»?ãã®æ?¹ã??ã? ã??ã??ã??ã¨æ?ã?ã¾ã?ã?? ç¾è±¡ã¨ã?ã¦ã¯å®?å?¨ã«ç?¡åå¿?ã«ãªã??ç?¶æ³ãªã?ã?ã?gdbã§æ…

---

## [IO.read$B$H%P%$%J%j%b!\<%I(B](https://www.ruby-forum.com/t/io-read-b-h-p-j-j-b-i-b/63224)

<div class="topic-metadata">

**Author:** [@U.Nakamura](https://www.ruby-forum.com/u/U.Nakamura)\
**Replies:** 9\
**Last updated:** [June 23, 2006, 3:50pm UTC](https://www.ruby-forum.com/t/io-read-b-h-p-j-j-b-i-b/63224 "2006-06-23T15:50:54Z")

</div>

e$B$3$s$K$A$O!"$J$+$\`$ie(B(e$B$&e(B)e$B$G$9!#e(B \[ruby-talk:196933\]e$B$G$^$?$7$F$be(BIO.reade$B$H%P%$%J%j%b!\<%I$NLdBj$,e(B e$B=P$F$k$=$&$J$N$G$9$,!"\<B:\]8=\>u$OITJX$J$N$G$J$s$H$+$7$?$$$H$3e(B e$B$m$G$9!#e(B e$B$H$$$&$o…

---

## [QR Barcode Library](https://www.ruby-forum.com/t/qr-barcode-library/64178)

<div class="topic-metadata">

**Author:** [@nola](https://www.ruby-forum.com/u/nola)\
**Replies:** 2\
**Last updated:** [June 23, 2006, 3:49pm UTC](https://www.ruby-forum.com/t/qr-barcode-library/64178 "2006-06-23T15:49:58Z")

</div>

Hi, I’m interested in a library that will parse and read QR barcodes. I’ve searched and haven’t found much (in english!) and since this is a barcode that’s used more in Japan, I thought there might be a chance there i…

---

## [\`DRb::DRbMessage#recv\_request': uninitialized constant DRb::](https://www.ruby-forum.com/t/drb-drbmessage-recv-request-uninitialized-constant-drb/64218)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 2\
**Last updated:** [June 23, 2006, 3:35pm UTC](https://www.ruby-forum.com/t/drb-drbmessage-recv-request-uninitialized-constant-drb/64218 "2006-06-23T15:35:43Z")

</div>

\[ruby-dev:28802\] e$B$N%Q%C%A$,$"$?$k$H!"\<!$O$3$&$G$9!#e(B % ./ruby -v test/runner.rb -v test/drb/test\_drb.rb ruby 1.9.0 (2006-06-23) \[i686-linux\] Loaded suite test\_drb.rb Started test\_01(TestDRbAry): (druby://localh…

---

## [Accessing the raw/un-html-ized CGI parameters](https://www.ruby-forum.com/t/accessing-the-raw-un-html-ized-cgi-parameters/64140)

<div class="topic-metadata">

**Author:** [@Alexandru\_ESUngur](https://www.ruby-forum.com/u/Alexandru_ESUngur)\
**Replies:** 3\
**Last updated:** [June 23, 2006, 2:55pm UTC](https://www.ruby-forum.com/t/accessing-the-raw-un-html-ized-cgi-parameters/64140 "2006-06-23T14:55:23Z")

</div>

Hi all, Does anybody know how can I access the raw CGI parameters? For example I enter this in a textarea: qweÅ?lÅ£qwe.com and get this value instead: qwe&#351;l&#355;qwe.com with the language specific characters t…

---

## [Why is "nil" being included in an array?](https://www.ruby-forum.com/t/why-is-nil-being-included-in-an-array/64174)

<div class="topic-metadata">

**Author:** [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Replies:** 4\
**Last updated:** [June 23, 2006, 2:50pm UTC](https://www.ruby-forum.com/t/why-is-nil-being-included-in-an-array/64174 "2006-06-23T14:50:35Z")

</div>

I’m trying to simply lower-case all of the files in a directory. It doesn’t work because RUBY complains about not being able to convert “nil” to a string. Why in the world is it even including “nil” in my array? file…

---

## [Randomly select an element from an array](https://www.ruby-forum.com/t/randomly-select-an-element-from-an-array/64185)

<div class="topic-metadata">

**Author:** [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Replies:** 5\
**Last updated:** [June 23, 2006, 12:08pm UTC](https://www.ruby-forum.com/t/randomly-select-an-element-from-an-array/64185 "2006-06-23T12:08:42Z")

</div>

I have an array: \[1,2,3,4,5\] How do I randomly select an element from the array?

---

## [Convert String to BinaryString](https://www.ruby-forum.com/t/convert-string-to-binarystring/64067)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 4\
**Last updated:** [June 23, 2006, 11:30am UTC](https://www.ruby-forum.com/t/convert-string-to-binarystring/64067 "2006-06-23T11:30:44Z")

</div>

Hi guys, Once I already asked how to create a hex string in â??little-endianâ? order in Ruby. In this case the most appropriate way is to use function sprintf() or “%”. But those function return aString but I need a…

---

## [Setting directory ruby is compiled to (BCC32 & Ruby 1.8.4)](https://www.ruby-forum.com/t/setting-directory-ruby-is-compiled-to-bcc32-ruby-1-8-4/63398)

<div class="topic-metadata">

**Author:** [@krisleech](https://www.ruby-forum.com/u/krisleech)\
**Replies:** 6\
**Last updated:** [June 23, 2006, 11:04am UTC](https://www.ruby-forum.com/t/setting-directory-ruby-is-compiled-to-bcc32-ruby-1-8-4/63398 "2006-06-23T11:04:56Z")

</div>

I have Ruby compiling fine using Borlands (free) C compiler for Windows. The only problem is I can’t set where ruby is compiled to, it just installs it to the current directory (c:\\ruby\\src\\ruby-1.8.4\\bcc32). Normally…

---

## [Quick singleton question](https://www.ruby-forum.com/t/quick-singleton-question/96030)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [June 23, 2006, 8:04am UTC](https://www.ruby-forum.com/t/quick-singleton-question/96030 "2006-06-23T08:04:42Z")

</div>

Hi, In a structure I’m building, I need to be able to add children (of the same class) to an object, and have the child object know who its parent is. So I can do obj.instance\_variable\_set(:@parent,parentobj), but t…

---

## [AOP style logging - is this possible in ruby?](https://www.ruby-forum.com/t/aop-style-logging-is-this-possible-in-ruby/64217)

<div class="topic-metadata">

**Author:** [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Replies:** 1\
**Last updated:** [June 23, 2006, 5:46am UTC](https://www.ruby-forum.com/t/aop-style-logging-is-this-possible-in-ruby/64217 "2006-06-23T05:46:18Z")

</div>

In Java, with AOP magic and bytecode manipulation under the covers, you could do something like this: (psuedocode, in real java it would be xml or annotations) For methods that are: public, name matches foo\*, members …

---

## [How to install Ruby Postgres Gem with a remote server](https://www.ruby-forum.com/t/how-to-install-ruby-postgres-gem-with-a-remote-server/64027)

<div class="topic-metadata">

**Author:** [@sombrero](https://www.ruby-forum.com/u/sombrero)\
**Replies:** 14\
**Last updated:** [June 23, 2006, 5:16am UTC](https://www.ruby-forum.com/t/how-to-install-ruby-postgres-gem-with-a-remote-server/64027 "2006-06-23T05:16:02Z")

</div>

Hi everyone, I have a slight problem. I have two machines. One is an app server and the second is the database server running postgres. How do you install the ruby postgres api on the app server to talk to the postgre…

---

## [Multidimensional ".index"?](https://www.ruby-forum.com/t/multidimensional-index/64216)

<div class="topic-metadata">

**Author:** [@Meino\_Christian\_C](https://www.ruby-forum.com/u/Meino_Christian_C)\
**Replies:** 2\
**Last updated:** [June 23, 2006, 4:37am UTC](https://www.ruby-forum.com/t/multidimensional-index/64216 "2006-06-23T04:37:12Z")

</div>

Hi, a=\[1,2,3,4\] a.index(3) -\> 2 Is there any way to do such things: a=\[\[1,2,3,4\],\[5,6,7,8\],\[9,10,11,12\]\] a.index(6) -\> \[1,1\] may be for n-dimensional arrays, too ? Thank you very much for any helpful reply in ad…

---

## [Drb test failures](https://www.ruby-forum.com/t/drb-test-failures/64123)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 3\
**Last updated:** [June 23, 2006, 3:40am UTC](https://www.ruby-forum.com/t/drb-test-failures/64123 "2006-06-23T03:40:42Z")

</div>

e$B$5$F!“e(B"abc”\[3\] e$B$,JRIU$$$Fe(B test\_IOReader\_s\_create\_binmode(TestCSV) e$B$Ge(B timeout e$B$9$k$N$,e(B e$BD\>$C$?7k2L!"\<!$K=P$F$-$?LdBj$Oe(B drb e$B$G$9!#e(B http://www.rubyist.net/~akr/chkbuild/debian-sarge/rub…

---

## [Gets, etc (was RE: Newbie Questions)](https://www.ruby-forum.com/t/gets-etc-was-re-newbie-questions/64210)

<div class="topic-metadata">

**Author:** [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Replies:** 1\
**Last updated:** [June 23, 2006, 3:34am UTC](https://www.ruby-forum.com/t/gets-etc-was-re-newbie-questions/64210 "2006-06-23T03:34:35Z")

</div>

fr Azalar: Makes sense now that i’ve seen what is happening behind the scenes. I come from a Java background but didn’t think to test if it was adding carriage returns to the end of the string. that is a faq but you may…

---

## [Using pack/unpack to go from string to address and back to s](https://www.ruby-forum.com/t/using-pack-unpack-to-go-from-string-to-address-and-back-to-s/64040)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 3\
**Last updated:** [June 23, 2006, 3:07am UTC](https://www.ruby-forum.com/t/using-pack-unpack-to-go-from-string-to-address-and-back-to-s/64040 "2006-06-23T03:07:00Z")

</div>

Hi all, Is there a way, given a pointer address, to get back to the original object? I’m thinking specifically of strings here. irb(main):006:0\> str = “hello” =\> “hello” irb(main):007:0\> addr = \[str\].pack(‘p\*’).unp…

---

## [Gtk Dialog window hangs around](https://www.ruby-forum.com/t/gtk-dialog-window-hangs-around/64198)

<div class="topic-metadata">

**Author:** [@Farrel\_L](https://www.ruby-forum.com/u/Farrel_L)\
**Replies:** 1\
**Last updated:** [June 23, 2006, 12:46am UTC](https://www.ruby-forum.com/t/gtk-dialog-window-hangs-around/64198 "2006-06-23T00:46:25Z")

</div>

Hi Folks, I’m doing a project that makes quite a bit of use of Gtk::Dialogs. They are not called from within a parent window, just from within a normal Ruby app like so: self.check(options) Gtk.init self.build(…

---

## [Ruby-prof-0.4.0](https://www.ruby-forum.com/t/ruby-prof-0-4-0/64078)

<div class="topic-metadata">

**Author:** [@charlieuk](https://www.ruby-forum.com/u/charlieuk)\
**Replies:** 5\
**Last updated:** [June 23, 2006, 12:09am UTC](https://www.ruby-forum.com/t/ruby-prof-0-4-0/64078 "2006-06-23T00:09:33Z")

</div>

Shugo and I are happy to announce the release of ruby-prof 0.4.0, which is chock full of new features: Addition of call graph profiles similar to GProf Improved speed - overhead is now as low as 15% for some code,…

---

## [Mechaniza/REXML extract\_from\_table](https://www.ruby-forum.com/t/mechaniza-rexml-extract-from-table/64127)

<div class="topic-metadata">

**Author:** [@Horacio\_S](https://www.ruby-forum.com/u/Horacio_S)\
**Replies:** 1\
**Last updated:** [June 22, 2006, 11:50pm UTC](https://www.ruby-forum.com/t/mechaniza-rexml-extract-from-table/64127 "2006-06-22T23:50:33Z")

</div>

Has anyone been successfull using the extract\_from\_table method of REXML::Node class?? This methods is an extension added by Mechanize to REXML as I can see in the source code but I am unable to use it because it co…

---

## [Ruby/Tk key bindings](https://www.ruby-forum.com/t/ruby-tk-key-bindings/64151)

<div class="topic-metadata">

**Author:** [@customsgod](https://www.ruby-forum.com/u/customsgod)\
**Replies:** 1\
**Last updated:** [June 22, 2006, 10:41pm UTC](https://www.ruby-forum.com/t/ruby-tk-key-bindings/64151 "2006-06-22T22:41:44Z")

</div>

I’ve been trying to make a key-binding to the Backspace key and I am having some trouble. I’ve tried many different combo’s and names. I have also searched for archaic names for the key and haven’t had any luck. If an…

[Previous page](https://www.ruby-forum.com/c/ruby/7.md?page=1766)

[Next page](https://www.ruby-forum.com/c/ruby/7.md?page=1768)
