# Ruby

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

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

---

## [Need Help With Net::HTTP](https://www.ruby-forum.com/t/need-help-with-net-http/66359)

<div class="topic-metadata">

**Author:** [@infinite](https://www.ruby-forum.com/u/infinite)\
**Replies:** 5\
**Last updated:** [August 25, 2006, 5:57am UTC](https://www.ruby-forum.com/t/need-help-with-net-http/66359 "2006-08-25T05:57:55Z")

</div>

Hello. Im looking for resources about Net::HTTP. Im new to Ruby but ive been learning it to make programs which goes to an online game webpage, logs in with the username and password and logs in. Then when its logged …

---

## [Calculating Odds](https://www.ruby-forum.com/t/calculating-odds/66393)

<div class="topic-metadata">

**Author:** [@curi](https://www.ruby-forum.com/u/curi)\
**Replies:** 0\
**Last updated:** [August 25, 2006, 5:49am UTC](https://www.ruby-forum.com/t/calculating-odds/66393 "2006-08-25T05:49:55Z")

</div>

I used Ruby to calculate which team will win Warcraft 3 matches (which people (not me) actually bet money on). It’s short and simple. Maybe someone will find the code useful to adapt to calculate the odds of something…

---

## [Re: Call for crystalization --was:A use case for an ordered](https://www.ruby-forum.com/t/re-call-for-crystalization-was-a-use-case-for-an-ordered/66288)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [August 25, 2006, 5:35am UTC](https://www.ruby-forum.com/t/re-call-for-crystalization-was-a-use-case-for-an-ordered/66288 "2006-08-25T05:35:54Z")

</div>

Benjohn and all, I think our problem is that our terms are sloppy. I’d written yesterday that I’d mistaken the functionality of Hash for AssociativeArray, and then today I find this: “Hashes (sometimes known as asso…

---

## [RubyConf\*MI open spot](https://www.ruby-forum.com/t/rubyconf-mi-open-spot/66392)

<div class="topic-metadata">

**Author:** [@Charles\_O\_Nutter](https://www.ruby-forum.com/u/Charles_O_Nutter)\
**Replies:** 0\
**Last updated:** [August 25, 2006, 4:55am UTC](https://www.ruby-forum.com/t/rubyconf-mi-open-spot/66392 "2006-08-25T04:55:50Z")

</div>

I’m not sure if RubyConf\*MI is sold out or not, but my registration is available to anyone if it’s needed. I hoped to go, but I can’t justify making the trip alone and my current automobile is not prepared for a ten-h…

---

## [Observing changes in object state](https://www.ruby-forum.com/t/observing-changes-in-object-state/66241)

<div class="topic-metadata">

**Author:** [@fangheuschrecke](https://www.ruby-forum.com/u/fangheuschrecke)\
**Replies:** 4\
**Last updated:** [August 25, 2006, 3:33am UTC](https://www.ruby-forum.com/t/observing-changes-in-object-state/66241 "2006-08-25T03:33:40Z")

</div>

Hi all, I was playing around with the observer library and thought I’d reimplement somthing I had done in Java a while back. It uses the observer pattern but automatically adds interceptors to every attribute setter …

---

## [Determinig if 3 characters in a row are the same?](https://www.ruby-forum.com/t/determinig-if-3-characters-in-a-row-are-the-same/66381)

<div class="topic-metadata">

**Author:** [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Replies:** 7\
**Last updated:** [August 25, 2006, 3:15am UTC](https://www.ruby-forum.com/t/determinig-if-3-characters-in-a-row-are-the-same/66381 "2006-08-25T03:15:39Z")

</div>

Sorry for the noob question, but is there a fast and efficient way to determine if there are 3 of the same charater in a row in a string? I’m sure this could be done in regex but I am not a black belt in regex. thanks…

---

## [Alternative to String#to\_i?](https://www.ruby-forum.com/t/alternative-to-string-to-i/66360)

<div class="topic-metadata">

**Author:** [@Jeremy\_Lizt](https://www.ruby-forum.com/u/Jeremy_Lizt)\
**Replies:** 13\
**Last updated:** [August 25, 2006, 2:31am UTC](https://www.ruby-forum.com/t/alternative-to-string-to-i/66360 "2006-08-25T02:31:36Z")

</div>

Is there an alternative method to String#to\_i that will return nil instead of zero for invalid numerical strings?

---

## [Ruport 0.4.23 / RuportDay2006 Details](https://www.ruby-forum.com/t/ruport-0-4-23-ruportday2006-details/64668)

<div class="topic-metadata">

**Author:** [@naething](https://www.ruby-forum.com/u/naething)\
**Replies:** 2\
**Last updated:** [August 24, 2006, 11:45pm UTC](https://www.ruby-forum.com/t/ruport-0-4-23-ruportday2006-details/64668 "2006-08-24T23:45:21Z")

</div>

== RuportDay 2006 == Since I’ve already announced this a few times, I’ll keep this short and sweet :wink: If you plan to be around on sunday to watch, to ‘maybe’ participate, or to definitly participate, be sure to a…

---

## [Hash again](https://www.ruby-forum.com/t/hash-again/66303)

<div class="topic-metadata">

**Author:** [@flatekmonkey](https://www.ruby-forum.com/u/flatekmonkey)\
**Replies:** 1\
**Last updated:** [August 24, 2006, 11:23pm UTC](https://www.ruby-forum.com/t/hash-again/66303 "2006-08-24T23:23:19Z")

</div>

Following suit with the main trend, talking Hashes :wink: I was just thinking about the potential impact on syntax Right now {:a =\> 1, :a =\> 2} returns {:a =\> 2} in my irb is this defined right now? And how ought…

---

## [YAML or CSV?](https://www.ruby-forum.com/t/yaml-or-csv/66188)

<div class="topic-metadata">

**Author:** [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Replies:** 14\
**Last updated:** [August 24, 2006, 11:05pm UTC](https://www.ruby-forum.com/t/yaml-or-csv/66188 "2006-08-24T23:05:56Z")

</div>

Hi, I have spreadsheet-like data, a table of data really, that I need to be able to access on a row-by-row, column-by-column, even cell-by-cell basis. I need to look at incoming filenames in a directory and match tho…

---

## [How to search Ruby files in Windows](https://www.ruby-forum.com/t/how-to-search-ruby-files-in-windows/65978)

<div class="topic-metadata">

**Author:** [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Replies:** 9\
**Last updated:** [August 24, 2006, 11:05pm UTC](https://www.ruby-forum.com/t/how-to-search-ruby-files-in-windows/65978 "2006-08-24T23:05:17Z")

</div>

Sometimes you want to find some particular code snippet and all you know is that it is in some file in a given directory. For example, if you are reading the Pickaxe book and you want to actually run some example code…

---

## [Bad for Ruby in RUBY](https://www.ruby-forum.com/t/bad-for-ruby-in-ruby/66290)

<div class="topic-metadata">

**Author:** [@bitsmith](https://www.ruby-forum.com/u/bitsmith)\
**Replies:** 7\
**Last updated:** [August 24, 2006, 10:49pm UTC](https://www.ruby-forum.com/t/bad-for-ruby-in-ruby/66290 "2006-08-24T22:49:15Z")

</div>

…in the topic today Ruby in Ruby…talk about a hacking game using Ruby… DANGER\* while a laud the game engine effort…BUT…to us business types trying to integrate this beautiful language swimming against NIH (not invent…

---

## [Import txt file to mysql with ruby & load data local?](https://www.ruby-forum.com/t/import-txt-file-to-mysql-with-ruby-load-data-local/66340)

<div class="topic-metadata">

**Author:** [@mtubbs](https://www.ruby-forum.com/u/mtubbs)\
**Replies:** 1\
**Last updated:** [August 24, 2006, 10:37pm UTC](https://www.ruby-forum.com/t/import-txt-file-to-mysql-with-ruby-load-data-local/66340 "2006-08-24T22:37:14Z")

</div>

I’m trying to run this sql from within a ruby program LOAD DATA LOCAL INFILE ‘C:\\test.txt’ INTO TABLE links FIELDS TERMINATED BY ‘;’ ENCLOSED BY ‘"’ ESCAPED BY ‘\\’ LINES TERMINATED BY ‘\\r\\n’ will this even work with …

---

## [QAPrototype (#91)](https://www.ruby-forum.com/t/qaprototype-91/66343)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [August 24, 2006, 8:30pm UTC](https://www.ruby-forum.com/t/qaprototype-91/66343 "2006-08-24T20:30:50Z")

</div>

While this quiz is based on the fun idea of an interactive Ruby conversation, the answers reinforced my belief that it holds practical value in prototyping Ruby objects. Here’s a sample run of me playing with one of…

---

## [OrderedHash - How to get it to work](https://www.ruby-forum.com/t/orderedhash-how-to-get-it-to-work/66213)

<div class="topic-metadata">

**Author:** [@paul](https://www.ruby-forum.com/u/paul)\
**Replies:** 11\
**Last updated:** [August 24, 2006, 8:26pm UTC](https://www.ruby-forum.com/t/orderedhash-how-to-get-it-to-work/66213 "2006-08-24T20:26:49Z")

</div>

First a bit of a rant. I CAN’T BELIEVE RUBY HASN’T IMPLEMENTED THIS!!! Ok… I feel better now. I am used to a verrry rich set of collection classes in Smalltalk. I know there has been a lot of discussion on this lately…

---

## [PDF::Writer#x](https://www.ruby-forum.com/t/pdf-writer-x/66326)

<div class="topic-metadata">

**Author:** [@dbf](https://www.ruby-forum.com/u/dbf)\
**Replies:** 1\
**Last updated:** [August 24, 2006, 8:26pm UTC](https://www.ruby-forum.com/t/pdf-writer-x/66326 "2006-08-24T20:26:49Z")

</div>

Is there a way to get the current x position like you can get the current y position in PDF::Writer? pdf = PDF::Writer.new pdf.y =\> 756.0 pdf.x NoMethodError: undefined method \`x’ for #PDF::Writer:0x8433f78 Thanks…

---

## [Ruby search](https://www.ruby-forum.com/t/ruby-search/66311)

<div class="topic-metadata">

**Author:** [@henrys](https://www.ruby-forum.com/u/henrys)\
**Replies:** 2\
**Last updated:** [August 24, 2006, 8:22pm UTC](https://www.ruby-forum.com/t/ruby-search/66311 "2006-08-24T20:22:48Z")

</div>

I want to manage the way how Ruby searches modules to load. I found, that the $: variable is in charge, but it is read-only. Then I found that RUBYLIB can be used to add directories. As I have c:/PJ/lib and c:/PJ/test…

---

## [Postgres-pr driver](https://www.ruby-forum.com/t/postgres-pr-driver/66337)

<div class="topic-metadata">

**Author:** [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Replies:** 0\
**Last updated:** [August 24, 2006, 8:02pm UTC](https://www.ruby-forum.com/t/postgres-pr-driver/66337 "2006-08-24T20:02:45Z")

</div>

HI I am looking for some examples with the postgres-pr gem. especially parametric queries. could someone point it out. I am not a database person and dont know how to proceed without examples. the description in the …

---

## [Continuation called across trap](https://www.ruby-forum.com/t/continuation-called-across-trap/66335)

<div class="topic-metadata">

**Author:** [@Young\_H](https://www.ruby-forum.com/u/Young_H)\
**Replies:** 0\
**Last updated:** [August 24, 2006, 7:58pm UTC](https://www.ruby-forum.com/t/continuation-called-across-trap/66335 "2006-08-24T19:58:44Z")

</div>

Does anyone know what the rather mysterious error “continuation called across trap” means? It’s triggered when I use SyncEnumerator in a multithreaded script. I don’t believe I’m doing anything obviously wrong with …

---

## [Re: How do I strip off the extra double quote or white space](https://www.ruby-forum.com/t/re-how-do-i-strip-off-the-extra-double-quote-or-white-space/66320)

<div class="topic-metadata">

**Author:** [@Ban\_Hoang](https://www.ruby-forum.com/u/Ban_Hoang)\
**Replies:** 0\
**Last updated:** [August 24, 2006, 7:40pm UTC](https://www.ruby-forum.com/t/re-how-do-i-strip-off-the-extra-double-quote-or-white-space/66320 "2006-08-24T19:40:41Z")

</div>

This is what I got for the second array when comparing: It was not recognize separate element to put the double quote for each… Failure: test\_\_02\_DropDown\_list\_verified(TC\_pulldownBoxVerified) \[Assert\_equal\_From\_Fil…

---

## [Re: How do I strip off the extra double quote or white space](https://www.ruby-forum.com/t/re-how-do-i-strip-off-the-extra-double-quote-or-white-space/66314)

<div class="topic-metadata">

**Author:** [@Ban\_Hoang](https://www.ruby-forum.com/u/Ban_Hoang)\
**Replies:** 0\
**Last updated:** [August 24, 2006, 7:08pm UTC](https://www.ruby-forum.com/t/re-how-do-i-strip-off-the-extra-double-quote-or-white-space/66314 "2006-08-24T19:08:37Z")

</div>

Hi Ben, You are exactly correct: "it’s adding it as a single element instead of two, as you want." It is my main problem: if the second line array\[1\] has 7 elements, it’s still adding as a single element? How do I fi…

---

## [Re: How do I strip off the extra double quote or white space](https://www.ruby-forum.com/t/re-how-do-i-strip-off-the-extra-double-quote-or-white-space/66200)

<div class="topic-metadata">

**Author:** [@Ban\_Hoang](https://www.ruby-forum.com/u/Ban_Hoang)\
**Replies:** 1\
**Last updated:** [August 24, 2006, 6:02pm UTC](https://www.ruby-forum.com/t/re-how-do-i-strip-off-the-extra-double-quote-or-white-space/66200 "2006-08-24T18:02:25Z")

</div>

Thanks for your help, Ben! I am confused on your assert\_equal method: assert\_equal a.gsub(/\[’"\]/, ‘’), b.gsub(/\[’"\]/, ‘’) Is /\[’"\]/ will strip out the quotes when comparing? My assert\_equal method: assert\_equal(arr\[…

---

## [Ruby-Lang Redesign Feedback](https://www.ruby-forum.com/t/ruby-lang-redesign-feedback/66277)

<div class="topic-metadata">

**Author:** [@John\_WSLong](https://www.ruby-forum.com/u/John_WSLong)\
**Replies:** 3\
**Last updated:** [August 24, 2006, 5:50pm UTC](https://www.ruby-forum.com/t/ruby-lang-redesign-feedback/66277 "2006-08-24T17:50:24Z")

</div>

At about 4 this afternoon we are going to commence discussion of the Ruby-Lang redesign on the vit-discuss mailing-list: http://rubyforge.org/mailman/listinfo/vit-discuss This won’t be a nit-picking session, but we ar…

---

## [Which Frontend Technology for an Online Game of Risk? SVG Ma](https://www.ruby-forum.com/t/which-frontend-technology-for-an-online-game-of-risk-svg-ma/65803)

<div class="topic-metadata">

**Author:** [@Mariano\_K](https://www.ruby-forum.com/u/Mariano_K)\
**Replies:** 9\
**Last updated:** [August 24, 2006, 5:12pm UTC](https://www.ruby-forum.com/t/which-frontend-technology-for-an-online-game-of-risk-svg-ma/65803 "2006-08-24T17:12:17Z")

</div>

Hi, I am currently thinking about implementing a Risk, the boardgame, clone. It should work in a browser and I wonder what would be the best approach to implement the frontend? I guess I could go for image maps, whic…

---

## [Re: META: Ruby Talk Noise/Signal](https://www.ruby-forum.com/t/re-meta-ruby-talk-noise-signal/66268)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [August 24, 2006, 4:14pm UTC](https://www.ruby-forum.com/t/re-meta-ruby-talk-noise-signal/66268 "2006-08-24T16:14:07Z")

</div>

An Addendum Hello, I just noticed a second bracketed prepending \[PROPOSAL\] and realised that I was on about were nouns and the bracketed stuff are adjectives, or possibly verbs. \[ANN\] and \[PROPOSAL\] seem like adject…

---

## ["Do you want to close this Window?" Popup woes](https://www.ruby-forum.com/t/do-you-want-to-close-this-window-popup-woes/66187)

<div class="topic-metadata">

**Author:** [@vanight](https://www.ruby-forum.com/u/vanight)\
**Replies:** 2\
**Last updated:** [August 24, 2006, 4:03pm UTC](https://www.ruby-forum.com/t/do-you-want-to-close-this-window-popup-woes/66187 "2006-08-24T16:03:47Z")

</div>

Hello, I am new at this and using a co-worker app to record test scripts in Ruby. Its called Watir. The script I have logs into a test account for online banking. It then hits the logoff URL which sends you to a page …

---

## [(RE)XML question](https://www.ruby-forum.com/t/re-xml-question/66043)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 7\
**Last updated:** [August 24, 2006, 3:36pm UTC](https://www.ruby-forum.com/t/re-xml-question/66043 "2006-08-24T15:36:30Z")

</div>

Question for you all. I want to treat HTML like XML (which is no big deal). But I want to find certain “special” tags (not real HTML) and replace them with my own text. It’s macro-type stuff. Basically I want to outp…

---

## [How do I strip off the extra double quote or white space in](https://www.ruby-forum.com/t/how-do-i-strip-off-the-extra-double-quote-or-white-space-in/66162)

<div class="topic-metadata">

**Author:** [@Ban\_Hoang](https://www.ruby-forum.com/u/Ban_Hoang)\
**Replies:** 7\
**Last updated:** [August 24, 2006, 1:13pm UTC](https://www.ruby-forum.com/t/how-do-i-strip-off-the-extra-double-quote-or-white-space-in/66162 "2006-08-24T13:13:47Z")

</div>

Hi, I try to read in an external file to array and compare them to the drop down list in our application. I got into the problem when comparing, the extra double quotes make the assertion result failed. Can anyone hel…

---

## [Reopening a module vs. Module.include](https://www.ruby-forum.com/t/reopening-a-module-vs-module-include/66244)

<div class="topic-metadata">

**Author:** [@markh](https://www.ruby-forum.com/u/markh)\
**Replies:** 1\
**Last updated:** [August 24, 2006, 12:11pm UTC](https://www.ruby-forum.com/t/reopening-a-module-vs-module-include/66244 "2006-08-24T12:11:41Z")

</div>

I am attempting to create a plugin, with some methods in my own module. These would then be included to various pieces of active record. This works fine when including them in classes, but when including them in a mo…

---

## [Using a module at the toplevel doesn't work](https://www.ruby-forum.com/t/using-a-module-at-the-toplevel-doesnt-work/65320)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 30\
**Last updated:** [August 24, 2006, 10:45am UTC](https://www.ruby-forum.com/t/using-a-module-at-the-toplevel-doesnt-work/65320 "2006-08-24T10:45:33Z")

</div>

Why? Becuase the module uses #define\_method, and #define\_method isn’t defined in main. Which brings me to two questions: How do I get around this problem? Please save me from having to delgate the whole module! W…

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

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