# Ruby

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

[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:** 1415

---

## [Issue with rake and model names that conflict with FileUtil](https://www.ruby-forum.com/t/issue-with-rake-and-model-names-that-conflict-with-fileutil/109359)

<div class="topic-metadata">

**Author:** [@jack](https://www.ruby-forum.com/u/jack)\
**Replies:** 1\
**Last updated:** [July 14, 2007, 1:31am UTC](https://www.ruby-forum.com/t/issue-with-rake-and-model-names-that-conflict-with-fileutil/109359 "2007-07-14T01:31:03Z")

</div>

Hi all, I don’t believe this has been discussed here, and its something I’ve run into recently. Its a known issue, but I’m wondering if anyone has some thoughts on fixing it. Some background information can be found h…

---

## [Class variable](https://www.ruby-forum.com/t/class-variable/109343)

<div class="topic-metadata">

**Author:** [@pshussain](https://www.ruby-forum.com/u/pshussain)\
**Replies:** 2\
**Last updated:** [July 13, 2007, 10:18pm UTC](https://www.ruby-forum.com/t/class-variable/109343 "2007-07-13T22:18:45Z")

</div>

Hai I have one question that Can i use class variable in Rails view? Tell me Bye Visit My Website

---

## [Using TABs vs. spaces II. (the Philosophy flamewar reloaded](https://www.ruby-forum.com/t/using-tabs-vs-spaces-ii-the-philosophy-flamewar-reloaded/109237)

<div class="topic-metadata">

**Author:** [@Jan\_MoliSSSS](https://www.ruby-forum.com/u/Jan_MoliSSSS)\
**Replies:** 11\
**Last updated:** [July 13, 2007, 8:15pm UTC](https://www.ruby-forum.com/t/using-tabs-vs-spaces-ii-the-philosophy-flamewar-reloaded/109237 "2007-07-13T20:15:23Z")

</div>

Hello, I read somewhere that good-style Ruby code is indented by 2 spaces. I’d like to tell you my problem: I’m not disabled, but I have problems with reading code if the indentation is only at 2 spaces. I must inde…

---

## [1.8 floating point exception: 0 \*\* 2](https://www.ruby-forum.com/t/1-8-floating-point-exception-0-2/109364)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [July 13, 2007, 7:39pm UTC](https://www.ruby-forum.com/t/1-8-floating-point-exception-0-2/109364 "2007-07-13T19:39:16Z")

</div>

e$B0J2\<$N$h$&$K!"e(B0 \*\* 2 e$B$Ge(B floating point exception e$B$,5/$-$^$9!#e(B % ./ruby -ve ‘0 \*\* 2’ ruby 1.8.6 (2007-07-14 patchlevel 5000) \[i686-linux\] -e:1: warning: useless use of \*\* in void context zsh: floati…

---

## [Undocumented argument on Object#methods](https://www.ruby-forum.com/t/undocumented-argument-on-object-methods/109318)

<div class="topic-metadata">

**Author:** [@apeiros](https://www.ruby-forum.com/u/apeiros)\
**Replies:** 4\
**Last updated:** [July 13, 2007, 7:24pm UTC](https://www.ruby-forum.com/t/undocumented-argument-on-object-methods/109318 "2007-07-13T19:24:15Z")

</div>

Due to a discussion in irc.freenode.org#ruby I stumbled over an undocumented argument to Object#method. My suggested fix to the documentation is below, or was it left out intentionally? Regards Stefan in object.c: …

---

## [65538 \*\* 2](https://www.ruby-forum.com/t/65538-2/109360)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [July 13, 2007, 7:13pm UTC](https://www.ruby-forum.com/t/65538-2/109360 "2007-07-13T19:13:11Z")

</div>

e$B0J2\<$N$h$&$K!"e(B65538 \*\* 2 e$B$,e(B 262148 e$B$K$J$j$^$9!#e(B % ./ruby -ve ‘p(65538 \*\* 2)’ ruby 1.9.0 (2007-07-14 patchlevel 0) \[i686-linux\] 262148

---

## [Couple of questions from a new user](https://www.ruby-forum.com/t/couple-of-questions-from-a-new-user/109356)

<div class="topic-metadata">

**Author:** [@benemson](https://www.ruby-forum.com/u/benemson)\
**Replies:** 1\
**Last updated:** [July 13, 2007, 7:00pm UTC](https://www.ruby-forum.com/t/couple-of-questions-from-a-new-user/109356 "2007-07-13T19:00:09Z")

</div>

Hi, ive been using Ruby for a few months at work. Mainly for fairly simple scripting (type of thing you used to do in perl). My first question is about initialize method, for overriding new (I believe). If it is in …

---

## [Watir weirdness](https://www.ruby-forum.com/t/watir-weirdness/109357)

<div class="topic-metadata">

**Author:** [@kyle\_s](https://www.ruby-forum.com/u/kyle_s)\
**Replies:** 0\
**Last updated:** [July 13, 2007, 6:26pm UTC](https://www.ruby-forum.com/t/watir-weirdness/109357 "2007-07-13T18:26:03Z")

</div>

I’m using watir-1.5.1.1192 on windows XP with IE7 for a number of tests here, and well, things are just getting funky. With some objects, watir occasionally will not finding them. If I go in with irb, I can find them…

---

## [ERb with nested loops-- NG!](https://www.ruby-forum.com/t/erb-with-nested-loops-ng/109285)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 2\
**Last updated:** [July 13, 2007, 6:14pm UTC](https://www.ruby-forum.com/t/erb-with-nested-loops-ng/109285 "2007-07-13T18:14:01Z")

</div>

How do you do nested loops in ERb? Is it possible? Every time I attempt it, ERb barfs. Oh, and how can you require a .rb file and use its methods in ERb files? Does the require line need to be in the erb.cgi file? J…

---

## [How to timeout a system call](https://www.ruby-forum.com/t/how-to-timeout-a-system-call/108339)

<div class="topic-metadata">

**Author:** [@jordi](https://www.ruby-forum.com/u/jordi)\
**Replies:** 2\
**Last updated:** [July 13, 2007, 5:40pm UTC](https://www.ruby-forum.com/t/how-to-timeout-a-system-call/108339 "2007-07-13T17:40:15Z")

</div>

Hi, I would like to stop a system call after a timeout, but doing so with the Timeout library does not kill the process, and the process keeps running. I think the problem is the system call does a Process.fork and n…

---

## [Problem with example from pickax book](https://www.ruby-forum.com/t/problem-with-example-from-pickax-book/109346)

<div class="topic-metadata">

**Author:** [@benemson](https://www.ruby-forum.com/u/benemson)\
**Replies:** 3\
**Last updated:** [July 13, 2007, 5:31pm UTC](https://www.ruby-forum.com/t/problem-with-example-from-pickax-book/109346 "2007-07-13T17:31:54Z")

</div>

Working through the Pickax Ruby programing book and cant get the following example ‘compile’:- irb(main):040:0\* class SongList irb(main):041:1\> MAX\_TIME = 560 # 5 minutes irb(main):042:1\> irb(main):043:1 def Son…

---

## [Class methods and modules](https://www.ruby-forum.com/t/class-methods-and-modules/109338)

<div class="topic-metadata">

**Author:** [@jotape](https://www.ruby-forum.com/u/jotape)\
**Replies:** 3\
**Last updated:** [July 13, 2007, 5:17pm UTC](https://www.ruby-forum.com/t/class-methods-and-modules/109338 "2007-07-13T17:17:11Z")

</div>

Hello I wan’t to design a Module that defines some methods that I wan’t as class methods in the classes that includes them. Is it possible? Thanks

---

## [Help with passing a callback method](https://www.ruby-forum.com/t/help-with-passing-a-callback-method/109311)

<div class="topic-metadata">

**Author:** [@micke](https://www.ruby-forum.com/u/micke)\
**Replies:** 4\
**Last updated:** [July 13, 2007, 4:38pm UTC](https://www.ruby-forum.com/t/help-with-passing-a-callback-method/109311 "2007-07-13T16:38:46Z")

</div>

Hi! I am trying to do the following. I can’t get it to work, don’t know if it even is possible but it would be nice. If it is not possible to do it the way I try here is there any other good approach? My reason to us…

---

## [How to colorize text in windows console?](https://www.ruby-forum.com/t/how-to-colorize-text-in-windows-console/109306)

<div class="topic-metadata">

**Author:** [@sirtyman](https://www.ruby-forum.com/u/sirtyman)\
**Replies:** 3\
**Last updated:** [July 13, 2007, 4:37pm UTC](https://www.ruby-forum.com/t/how-to-colorize-text-in-windows-console/109306 "2007-07-13T16:37:46Z")

</div>

Hi, Is any way to highlight text in windows cmd? I have a script which throws its output on cmd and it would be convenient to me if the text will be colorized.

---

## [Want to convert html table to image file, how?](https://www.ruby-forum.com/t/want-to-convert-html-table-to-image-file-how/109296)

<div class="topic-metadata">

**Author:** [@glenn\_nz](https://www.ruby-forum.com/u/glenn_nz)\
**Replies:** 1\
**Last updated:** [July 13, 2007, 3:49pm UTC](https://www.ruby-forum.com/t/want-to-convert-html-table-to-image-file-how/109296 "2007-07-13T15:49:37Z")

</div>

Hi all, This is my first time on this list so I hope I’m not breaking any ettiquette rule by posting here. I have been using ruby and rails for about 3 months now and enjoying it quite alot. I am working on a projec…

---

## [Convert ASCII to byte an vice versa](https://www.ruby-forum.com/t/convert-ascii-to-byte-an-vice-versa/109334)

<div class="topic-metadata">

**Author:** [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Replies:** 4\
**Last updated:** [July 13, 2007, 3:24pm UTC](https://www.ruby-forum.com/t/convert-ascii-to-byte-an-vice-versa/109334 "2007-07-13T15:24:33Z")

</div>

Hi all, I have a small script as follows. I wonder how I can change 65 66 67 back to ABC. Thanks, Li C:\\Documents and Settings\\chen73\>irb irb(main):001:0\> str=“ABC” =\> “ABC” irb(main):002:0\> str.each\_byte{|b|puts…

---

## [Loop over an array that changes the elements](https://www.ruby-forum.com/t/loop-over-an-array-that-changes-the-elements/109323)

<div class="topic-metadata">

**Author:** [@bernd](https://www.ruby-forum.com/u/bernd)\
**Replies:** 7\
**Last updated:** [July 13, 2007, 3:18pm UTC](https://www.ruby-forum.com/t/loop-over-an-array-that-changes-the-elements/109323 "2007-07-13T15:18:32Z")

</div>

Hi, I have a rather simple question. I have an array and want to change the elements of the array in a loop. For example in Java, you would write: int\[\] numbers = {1, 2, 3} for(int i = 0; i \< numbers.length; i++) { …

---

## [24 \*\* 7](https://www.ruby-forum.com/t/24-7/109332)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [July 13, 2007, 3:03pm UTC](https://www.ruby-forum.com/t/24-7/109332 "2007-07-13T15:03:29Z")

</div>

ruby 1.8 e$B$G0J2\<$N$h$&$K!"e(B24 \*\* 7 e$B$,e(B 291504128 e$B$K$J$j$^$9!#e(B % ./ruby -ve ‘p 24 \*\* 7’ ruby 1.8.6 (2007-07-13 patchlevel 5000) \[i686-linux\] 291504128 ruby 1.9, bc, python e$B$G$O0J2\<$N$h$&$Ke(B 458647…

---

## [0.round](https://www.ruby-forum.com/t/0-round/109329)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [July 13, 2007, 2:42pm UTC](https://www.ruby-forum.com/t/0-round/109329 "2007-07-13T14:42:24Z")

</div>

e$B0J2\<$N$h$&$Ke(B 0.round e$B$,e(B false e$B$K$J$j$^$9!#e(B % ./ruby -ve ‘p 0.round’ ruby 1.9.0 (2007-07-13 patchlevel 0) \[i686-linux\] false

---

## [Unit testing exception types and messages](https://www.ruby-forum.com/t/unit-testing-exception-types-and-messages/109309)

<div class="topic-metadata">

**Author:** [@daz](https://www.ruby-forum.com/u/daz)\
**Replies:** 2\
**Last updated:** [July 13, 2007, 2:38pm UTC](https://www.ruby-forum.com/t/unit-testing-exception-types-and-messages/109309 "2007-07-13T14:38:23Z")

</div>

Testing that an exception of the given type is raised is easy with assert\_raise: assert\_raise(SomeExceptoin) {raise SomeExceptoin, “some message”} but if I want to also test the exception message how do I do this? My…

---

## [(-0x40000000)/(-1)](https://www.ruby-forum.com/t/0x40000000-1/109312)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [July 13, 2007, 11:33am UTC](https://www.ruby-forum.com/t/0x40000000-1/109312 "2007-07-13T11:33:49Z")

</div>

(-0x40000000)/(-1) e$B$,e(B -1073741824 e$B$K$J$j$^$9!#e(B % ./ruby -ve ‘p((-0x40000000)/(-1))’ ruby 1.9.0 (2007-07-13 patchlevel 0) \[i686-linux\] -1073741824

---

## [Regexp Question - Merb::Router](https://www.ruby-forum.com/t/regexp-question-merb-router/109302)

<div class="topic-metadata">

**Author:** [@liquid](https://www.ruby-forum.com/u/liquid)\
**Replies:** 6\
**Last updated:** [July 13, 2007, 10:34am UTC](https://www.ruby-forum.com/t/regexp-question-merb-router/109302 "2007-07-13T10:34:38Z")

</div>

Hi, I’m looking through the Merb::Routing code and I’ve found a regexp that I can’t figure out how it works. Merb::Router::SECTION\_REGEXP #=\> /(?::(\[a-z\*\_\]+))/ It takes a route definition string, like “/products/:m…

---

## [XML file processing using REXML (beginner's question)](https://www.ruby-forum.com/t/xml-file-processing-using-rexml-beginners-question/109228)

<div class="topic-metadata">

**Author:** [@ronaldfischer](https://www.ruby-forum.com/u/ronaldfischer)\
**Replies:** 3\
**Last updated:** [July 13, 2007, 9:48am UTC](https://www.ruby-forum.com/t/xml-file-processing-using-rexml-beginners-question/109228 "2007-07-13T09:48:26Z")

</div>

Hello! I try to understand REXML using the tutorial in http://www.germane-software.com/software/rexml/docs/tutorial.html However, I have problems applying the path expressions to my application. Consider for example…

---

## [Getting Gem Version from Within a Gem](https://www.ruby-forum.com/t/getting-gem-version-from-within-a-gem/108979)

<div class="topic-metadata">

**Author:** [@frew](https://www.ruby-forum.com/u/frew)\
**Replies:** 16\
**Last updated:** [July 13, 2007, 9:34am UTC](https://www.ruby-forum.com/t/getting-gem-version-from-within-a-gem/108979 "2007-07-13T09:34:23Z")

</div>

Does anyone know if there is a way that I can have my program output what version it is and get the version from the Gem that it is installed from? Thanks! -fREW

---

## [Optparse. many-characters option with single dash](https://www.ruby-forum.com/t/optparse-many-characters-option-with-single-dash/109246)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [July 13, 2007, 8:13am UTC](https://www.ruby-forum.com/t/optparse-many-characters-option-with-single-dash/109246 "2007-07-13T08:13:13Z")

</div>

I looked at getoptlong and optparse and I don’t think any of them allow multiple characters with a single dash (-nodisplay, -nosplash, etc). But I’m no expert so I might have overlooked it. Before I try to code this m…

---

## [Re: I need serious help!](https://www.ruby-forum.com/t/re-i-need-serious-help/109293)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [July 13, 2007, 5:39am UTC](https://www.ruby-forum.com/t/re-i-need-serious-help/109293 "2007-07-13T05:39:20Z")

</div>

Im posting from a cellphone, sorry bout that.

---

## [Re: I need serious help!](https://www.ruby-forum.com/t/re-i-need-serious-help/109290)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [July 13, 2007, 5:27am UTC](https://www.ruby-forum.com/t/re-i-need-serious-help/109290 "2007-07-13T05:27:33Z")

</div>

Hmm, i found a bunch of perl books, ruby, python etc.

---

## [Re: I need serious help!](https://www.ruby-forum.com/t/re-i-need-serious-help/109287)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [July 13, 2007, 5:21am UTC](https://www.ruby-forum.com/t/re-i-need-serious-help/109287 "2007-07-13T05:21:26Z")

</div>

Why’s guide has an example of a text based game, i don’t know if that’d be any help. For me, alot of these guides i know i had issues with (especially why’s guide) because in alot of parts i had no idea the direction …

---

## [Re: I need serious help!](https://www.ruby-forum.com/t/re-i-need-serious-help/109286)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [July 13, 2007, 5:17am UTC](https://www.ruby-forum.com/t/re-i-need-serious-help/109286 "2007-07-13T05:17:20Z")

</div>

Searching www.g2p.org Could be your best friend with ebooks and tutorials as well

---

## [Returning part of a hash](https://www.ruby-forum.com/t/returning-part-of-a-hash/109148)

<div class="topic-metadata">

**Author:** [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Replies:** 19\
**Last updated:** [July 13, 2007, 5:15am UTC](https://www.ruby-forum.com/t/returning-part-of-a-hash/109148 "2007-07-13T05:15:01Z")

</div>

I have hash that has about 20 keys. I’d like to create a new variable with just three of those keys. Example: hash = { “key1” =\> “value1”, “key2” =\> “value2”, … “key20” =\> “value20” } And a function like: newhas…

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

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