# Ruby

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

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

---

## [Enumerable#find\_index vs. Array#index](https://www.ruby-forum.com/t/enumerable-find-index-vs-array-index/134414)

<div class="topic-metadata">

**Author:** [@Akinori\_MUSHA](https://www.ruby-forum.com/u/Akinori_MUSHA)\
**Replies:** 6\
**Last updated:** [April 11, 2008, 12:24pm UTC](https://www.ruby-forum.com/t/enumerable-find-index-vs-array-index/134414 "2008-04-11T12:24:03Z")

</div>

ã€€\[ruby-talk:178495\] ãŒç™ºç«¯ã§ Enumerable#find\_index ã¨ã„ã†ã®ãŒ ä»¥å‰è¿½åŠ ã•ã‚Œã¾ã—ãŸãŒã€æ©Ÿèƒ½çš„ã«ã¯ Array#index ã®ã‚µãƒ–ã‚»ãƒƒãƒˆã§ã™ã€‚ (index ã¯ãƒ–ãƒ­ãƒƒã‚¯è©•ä¾¡ã€æŒ‡å®šå€¤ã¨ã®æ¯”è¼ƒã‚’ä…

---

## [Ruby HTTP GET Headers](https://www.ruby-forum.com/t/ruby-http-get-headers/134413)

<div class="topic-metadata">

**Author:** [@ben](https://www.ruby-forum.com/u/ben)\
**Replies:** 2\
**Last updated:** [April 11, 2008, 12:04pm UTC](https://www.ruby-forum.com/t/ruby-http-get-headers/134413 "2008-04-11T12:04:09Z")

</div>

I’ve looked here: http://snippets.dzone.com/posts/show/788 and I’m not really understanding it. I am creating a client for a website, and I want to set the User-Agent field of the header I am sending. Is there a simpl…

---

## [Patch for \[ruby-core:15551\]](https://www.ruby-forum.com/t/patch-for-ruby-core-15551/134270)

<div class="topic-metadata">

**Author:** [@wanabe](https://www.ruby-forum.com/u/wanabe)\
**Replies:** 2\
**Last updated:** [April 11, 2008, 10:22am UTC](https://www.ruby-forum.com/t/patch-for-ruby-core-15551/134270 "2008-04-11T10:22:11Z")

</div>

e$B%o%J%Y$H?=$7$^$9!#e(B \[ruby-core:15551\]e$B$KBP$9$k%Q%C%A$r=q$-$^$7$?!#e(B Proc#curry e$B$G:n$i$l$?e(B Proc e$B%\*%V%8%’%/%H$K%V%m%C%/$rEO$;$k$h$&$K$7$^$7$?!#e(B proc\_call() e$BCf$Ne(B BUILTIN\_TYPE(proc-\>block.iseq)…

---

## [Require\_relative](https://www.ruby-forum.com/t/require-relative/134485)

<div class="topic-metadata">

**Author:** [@Yukihiro\_M](https://www.ruby-forum.com/u/Yukihiro_M)\
**Replies:** 1\
**Last updated:** [April 11, 2008, 10:03am UTC](https://www.ruby-forum.com/t/require-relative/134485 "2008-04-11T10:03:54Z")

</div>

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B \[ruby-core:16287\]e$B$Ge(BDavid Flanagane$B$+$iMh$F$$$k\<ALd$G$9$,!"$;$Ce(B e$B$D$+$l$^$7$?!#e(B e$B\<g$Ke(Bakre$B$5$s$X!#e(B require\_relativee$B$OAH$9~$$K$9$k$D$b$j$,$"$j$^$9$+!)e(B …

---

## [Need to call the script from the excel sheet](https://www.ruby-forum.com/t/need-to-call-the-script-from-the-excel-sheet/134481)

<div class="topic-metadata">

**Author:** [@pranjal\_jain](https://www.ruby-forum.com/u/pranjal_jain)\
**Replies:** 0\
**Last updated:** [April 11, 2008, 8:07am UTC](https://www.ruby-forum.com/t/need-to-call-the-script-from-the-excel-sheet/134481 "2008-04-11T08:07:05Z")

</div>

HI All I had written a script & I want to run that script via Excel Sheet (i.e)i stored the name of the script in Excel sheet & when i double click on the name in the excel sheet, it should run the script. Can it b…

---

## [Intro a new ror website](https://www.ruby-forum.com/t/intro-a-new-ror-website/134468)

<div class="topic-metadata">

**Author:** [@qiyu15555](https://www.ruby-forum.com/u/qiyu15555)\
**Replies:** 0\
**Last updated:** [April 11, 2008, 5:38am UTC](https://www.ruby-forum.com/t/intro-a-new-ror-website/134468 "2008-04-11T05:38:41Z")

</div>

http://www.rorchina.net

---

## [Dog pile!](https://www.ruby-forum.com/t/dog-pile/134465)

<div class="topic-metadata">

**Author:** [@Bil\_K](https://www.ruby-forum.com/u/Bil_K)\
**Replies:** 1\
**Last updated:** [April 11, 2008, 3:27am UTC](https://www.ruby-forum.com/t/dog-pile/134465 "2008-04-11T03:27:48Z")

</div>

http://tinyurl.com/6a5qmr

---

## [Stack Level Too Deep?](https://www.ruby-forum.com/t/stack-level-too-deep/134456)

<div class="topic-metadata">

**Author:** [@lazukars](https://www.ruby-forum.com/u/lazukars)\
**Replies:** 7\
**Last updated:** [April 11, 2008, 2:45am UTC](https://www.ruby-forum.com/t/stack-level-too-deep/134456 "2008-04-11T02:45:17Z")

</div>

I have a User class that handles users as structs and adds them to a hash within the class. Anyways, I was making a Remove functions for it. Here’s my code: class User \< Struct.new(:username, :password) class \<\<s…

---

## [How to find the hwnd](https://www.ruby-forum.com/t/how-to-find-the-hwnd/134264)

<div class="topic-metadata">

**Author:** [@pranjal\_jain](https://www.ruby-forum.com/u/pranjal_jain)\
**Replies:** 1\
**Last updated:** [April 11, 2008, 2:37am UTC](https://www.ruby-forum.com/t/how-to-find-the-hwnd/134264 "2008-04-11T02:37:32Z")

</div>

Hi All I am trying to get the hwnd of the code. this code is of the pop up window. When I click on this link a new window opens up. I want to calculate the hwnd of the new pop up window so that I can perform opera…

---

## [Revert back to rubygems 0.9 from 1.0.1](https://www.ruby-forum.com/t/revert-back-to-rubygems-0-9-from-1-0-1/134191)

<div class="topic-metadata">

**Author:** [@dkmd\_nielsen](https://www.ruby-forum.com/u/dkmd_nielsen)\
**Replies:** 5\
**Last updated:** [April 11, 2008, 12:03am UTC](https://www.ruby-forum.com/t/revert-back-to-rubygems-0-9-from-1-0-1/134191 "2008-04-11T00:03:44Z")

</div>

My debugger is having a problem with rubygems v1.0.1. I would like to revert back to rubygems 0.9, if that is possible. What steps are necessary to back out v1.0.1 and re-install 0.9.x? Thanks for your time, dvn

---

## [Gem build documentation for new gems?](https://www.ruby-forum.com/t/gem-build-documentation-for-new-gems/125831)

<div class="topic-metadata">

**Author:** [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Replies:** 11\
**Last updated:** [April 10, 2008, 11:59pm UTC](https://www.ruby-forum.com/t/gem-build-documentation-for-new-gems/125831 "2008-04-10T23:59:04Z")

</div>

Dr Brain? Anyone? Formerly happy-path gem specs are now issuing warnings for me: WARNING: no rubyforge\_project specified WARNING: deprecated autorequire specified Google results for “gem build documentation” start …

---

## [\[ANN\] TMail 1.2.3 - Security Update](https://www.ruby-forum.com/t/ann-tmail-1-2-3-security-update/134447)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 0\
**Last updated:** [April 10, 2008, 9:57pm UTC](https://www.ruby-forum.com/t/ann-tmail-1-2-3-security-update/134447 "2008-04-10T21:57:54Z")

</div>

\[ANN\] TMail 1.2.3 - Security Update - 11 Apr 2008 IMPORTANT NOTE: This is a recommended upgrade for all TMail users of TMail version 1.0.0 or above (which includes all Rails 2.x users - see below) Information: TMail…

---

## [Is it possible to stop SPAM?](https://www.ruby-forum.com/t/is-it-possible-to-stop-spam/134041)

<div class="topic-metadata">

**Author:** [@evtuhovich](https://www.ruby-forum.com/u/evtuhovich)\
**Replies:** 12\
**Last updated:** [April 10, 2008, 9:05pm UTC](https://www.ruby-forum.com/t/is-it-possible-to-stop-spam/134041 "2008-04-10T21:05:38Z")

</div>

Hello! Last month i get too much spam-messages in this list. Now it is difficult to read it. Is there any way to stop spam in this list?

---

## [C rand() in Ruby](https://www.ruby-forum.com/t/c-rand-in-ruby/134423)

<div class="topic-metadata">

**Author:** [@cpeterson](https://www.ruby-forum.com/u/cpeterson)\
**Replies:** 5\
**Last updated:** [April 10, 2008, 9:00pm UTC](https://www.ruby-forum.com/t/c-rand-in-ruby/134423 "2008-04-10T21:00:52Z")

</div>

Is there some simple way to make use of C’s rand() from within Ruby? The daughter of someone I know is writing some toy scripts to compare PRNG results for a science fair project . . .

---

## [Once again I'm wasting my time with CentOS: gem install won't work](https://www.ruby-forum.com/t/once-again-im-wasting-my-time-with-centos-gem-install-wont-work/134330)

<div class="topic-metadata">

**Author:** [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Replies:** 4\
**Last updated:** [April 10, 2008, 8:24pm UTC](https://www.ruby-forum.com/t/once-again-im-wasting-my-time-with-centos-gem-install-wont-work/134330 "2008-04-10T20:24:23Z")

</div>

\[root@free rubygems-1.1.0\]# vi README \[root@free rubygems-1.1.0\]# ruby setup.rb ./lib/rubygems/custom\_require.rb:27:in gem\_original\_require': no such file to load -- rdoc/rdoc (LoadError) from ./lib/rubygems/custom\_req…

---

## [Http://tryruby.hobix.com/ not working](https://www.ruby-forum.com/t/http-tryruby-hobix-com-not-working/134319)

<div class="topic-metadata">

**Author:** [@rbermejo](https://www.ruby-forum.com/u/rbermejo)\
**Replies:** 1\
**Last updated:** [April 10, 2008, 6:17pm UTC](https://www.ruby-forum.com/t/http-tryruby-hobix-com-not-working/134319 "2008-04-10T18:17:54Z")

</div>

Do you know guys what’s going on with why\_'s tryruby page /? I am getting a blank page. Thanks -r

---

## [To select random number from select list](https://www.ruby-forum.com/t/to-select-random-number-from-select-list/134378)

<div class="topic-metadata">

**Author:** [@pranjal\_jain](https://www.ruby-forum.com/u/pranjal_jain)\
**Replies:** 3\
**Last updated:** [April 10, 2008, 6:12pm UTC](https://www.ruby-forum.com/t/to-select-random-number-from-select-list/134378 "2008-04-10T18:12:36Z")

</div>

HI I am having a list. I want to select a number in random from that list? which command I can use it for doing this? For example : $ie.row(:class =\>“bgTableAltColors”,:index =\>“4”).cell(:class,“padTableRightBorde…

---

## [Time needed to append an array element](https://www.ruby-forum.com/t/time-needed-to-append-an-array-element/134406)

<div class="topic-metadata">

**Author:** [@mercan01](https://www.ruby-forum.com/u/mercan01)\
**Replies:** 1\
**Last updated:** [April 10, 2008, 5:51pm UTC](https://www.ruby-forum.com/t/time-needed-to-append-an-array-element/134406 "2008-04-10T17:51:24Z")

</div>

How does the time to append an element to an array depend on the size of the array? Is it practical to build up a large array one element at a time? Note that for a naive implementation that copies the array for each …

---

## [Capitalizing words](https://www.ruby-forum.com/t/capitalizing-words/134202)

<div class="topic-metadata">

**Author:** [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Replies:** 16\
**Last updated:** [April 10, 2008, 5:24pm UTC](https://www.ruby-forum.com/t/capitalizing-words/134202 "2008-04-10T17:24:51Z")

</div>

Hi, I need to capitalize the words in a string I find in XML files. The string that’s in (.\*) below is what I need to change. I just want to capitalize the first letter of each word in the string. I’m trying this, in…

---

## [Ruby 1.8.7 - in progress](https://www.ruby-forum.com/t/ruby-1-8-7-in-progress/134374)

<div class="topic-metadata">

**Author:** [@Akinori\_MUSHA](https://www.ruby-forum.com/u/Akinori_MUSHA)\
**Replies:** 2\
**Last updated:** [April 10, 2008, 4:58pm UTC](https://www.ruby-forum.com/t/ruby-1-8-7-in-progress/134374 "2008-04-10T16:58:57Z")

</div>

ã€€Ruby 1.8.7 ã§ã™ãŒã€å½“åˆã®è¨ˆç”»ã‹ã‚‰ä¸€é€±é–“é…ã‚Œã®ä»Šé€±æœ«ã€ preview1 ã‚’ å‡ºãã†ã¨æ€ã£ã¦ã„ã¾ã™ã€‚ ã€€ãƒãƒƒã‚¯ãƒãƒ¼ãƒˆã®é€²æ—ã§ã™ãŒã€ enumerator ã®çµ„ã¿è¾¼ã¿åŒ–ãŒå®Œäº†ã—ã€ä»Šã¯ …

---

## [User Agent String](https://www.ruby-forum.com/t/user-agent-string/133431)

<div class="topic-metadata">

**Author:** [@tma](https://www.ruby-forum.com/u/tma)\
**Replies:** 5\
**Last updated:** [April 10, 2008, 4:56pm UTC](https://www.ruby-forum.com/t/user-agent-string/133431 "2008-04-10T16:56:05Z")

</div>

Hey guys, I want my Ruby script to make a request to a server but I don’t want it to use just the basic User Agent String. How would I go about giving my script a User Agent string to use?

---

## [Regexp.union - set option all patterns case insensitive](https://www.ruby-forum.com/t/regexp-union-set-option-all-patterns-case-insensitive/132191)

<div class="topic-metadata">

**Author:** [@jh100000](https://www.ruby-forum.com/u/jh100000)\
**Replies:** 2\
**Last updated:** [April 10, 2008, 4:05pm UTC](https://www.ruby-forum.com/t/regexp-union-set-option-all-patterns-case-insensitive/132191 "2008-04-10T16:05:40Z")

</div>

I want to pull a list of terms and use them to scan documents to determine if any of those words are present. Let’s say fruits = \[“apples”,“oranges”,“grapes”\]. I do Regexp.union(\*fruits). This returns /apples|oranges…

---

## [Problem with text\_field\_with\_auto\_complete Part 2](https://www.ruby-forum.com/t/problem-with-text-field-with-auto-complete-part-2/134347)

<div class="topic-metadata">

**Author:** [@pimeamark](https://www.ruby-forum.com/u/pimeamark)\
**Replies:** 2\
**Last updated:** [April 10, 2008, 3:53pm UTC](https://www.ruby-forum.com/t/problem-with-text-field-with-auto-complete-part-2/134347 "2008-04-10T15:53:29Z")

</div>

Ok so I got the text field to populate a list of what I needed but I have a problem. When I select an item in Firefox, there’s 4 spaces that appear before it in the text field. In safari, nothing appears in the field …

---

## [Problem in exiting from a file and continue with next file](https://www.ruby-forum.com/t/problem-in-exiting-from-a-file-and-continue-with-next-file/134390)

<div class="topic-metadata">

**Author:** [@karthikeyan](https://www.ruby-forum.com/u/karthikeyan)\
**Replies:** 2\
**Last updated:** [April 10, 2008, 3:47pm UTC](https://www.ruby-forum.com/t/problem-in-exiting-from-a-file-and-continue-with-next-file/134390 "2008-04-10T15:47:17Z")

</div>

Hi, I am writing automated test scripts using ruby. I have written two files. test\_one.rb test\_two.rb I have written some methods both the files. When one of the methods of test\_one.rb is running, If a condition fa…

---

## [Guardian of Middle-earth (#159)](https://www.ruby-forum.com/t/guardian-of-middle-earth-159/133890)

<div class="topic-metadata">

**Author:** [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Replies:** 8\
**Last updated:** [April 10, 2008, 3:16pm UTC](https://www.ruby-forum.com/t/guardian-of-middle-earth-159/133890 "2008-04-10T15:16:29Z")

</div>

Well, I finally finished the move and caught up on sleep, and I’m now back and ready to start quizzing again. Keep in mind that the last quiz presented (i.e. Food Database) was removed for a rethink, so this week is a…

---

## [Ruby multiline regex problem](https://www.ruby-forum.com/t/ruby-multiline-regex-problem/134188)

<div class="topic-metadata">

**Author:** [@ransom](https://www.ruby-forum.com/u/ransom)\
**Replies:** 5\
**Last updated:** [April 10, 2008, 2:33pm UTC](https://www.ruby-forum.com/t/ruby-multiline-regex-problem/134188 "2008-04-10T14:33:52Z")

</div>

Code: “ testPit something here Best” Pattern: \<td.?\>.?\</td\\s\*\> I’m trying to match this whole block and use it for further parsing. This started from an example in Brian Merick’s book “Everyday Scripting…” that had…

---

## [Global array of hashes](https://www.ruby-forum.com/t/global-array-of-hashes/134391)

<div class="topic-metadata">

**Author:** [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Replies:** 5\
**Last updated:** [April 10, 2008, 2:25pm UTC](https://www.ruby-forum.com/t/global-array-of-hashes/134391 "2008-04-10T14:25:36Z")

</div>

I’m doing this: $globvar=Array.new() $globvar\[0\]=“mygenericvalue” localvar=$globvar localvar\[0\]=“mylocalvalue” puts $globvar And the result for $globvar is “mylocalvalue” How can I assign to localvar only the valu…

---

## [Problem ActiveRecord+ActionWebService](https://www.ruby-forum.com/t/problem-activerecord-actionwebservice/134393)

<div class="topic-metadata">

**Author:** [@varunkumargoel](https://www.ruby-forum.com/u/varunkumargoel)\
**Replies:** 0\
**Last updated:** [April 10, 2008, 2:18pm UTC](https://www.ruby-forum.com/t/problem-activerecord-actionwebservice/134393 "2008-04-10T14:18:51Z")

</div>

Hi All, I am creating one webservice in ror.I have one function called sum(int1,int2) and it’s working fine to show output.Now i wanna save the value of int1 and int2 into database through my webservices. But i am ge…

---

## [First public release of RubyJS (0.7.0)](https://www.ruby-forum.com/t/first-public-release-of-rubyjs-0-7-0/134388)

<div class="topic-metadata">

**Author:** [@michaeln](https://www.ruby-forum.com/u/michaeln)\
**Replies:** 0\
**Last updated:** [April 10, 2008, 1:34pm UTC](https://www.ruby-forum.com/t/first-public-release-of-rubyjs-0-7-0/134388 "2008-04-10T13:34:37Z")

</div>

Hi, I’m pleased to announce the first public release of RubyJS (a Ruby to Javascript compiler) and the availability of RubyJS as a RubyGem: gem install rubyjs rubyjs -h Usage: rubyjs\_gen \[options\] \[file, \[file, ...…

---

## [Get oldest File from Directory?](https://www.ruby-forum.com/t/get-oldest-file-from-directory/134386)

<div class="topic-metadata">

**Author:** [@sealedsun](https://www.ruby-forum.com/u/sealedsun)\
**Replies:** 2\
**Last updated:** [April 10, 2008, 1:32pm UTC](https://www.ruby-forum.com/t/get-oldest-file-from-directory/134386 "2008-04-10T13:32:06Z")

</div>

Hey! What is the easiest way to retrieve the oldest (oldest modification date) file from a directory? thx ck

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

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