# Ruby

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

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

---

## [Testing Thread and sleep](https://www.ruby-forum.com/t/testing-thread-and-sleep/103228)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 5\
**Last updated:** [May 3, 2007, 10:01pm UTC](https://www.ruby-forum.com/t/testing-thread-and-sleep/103228 "2007-05-03T22:01:06Z")

</div>

Greetings All: I’m writing a script that calls an external program using popen. The program has the potential to run forever, but I what to kill it if it has not found a solution in 10 seconds. I have therefore set …

---

## [Array to Hash](https://www.ruby-forum.com/t/array-to-hash/103277)

<div class="topic-metadata">

**Author:** [@Josselin](https://www.ruby-forum.com/u/Josselin)\
**Replies:** 13\
**Last updated:** [May 3, 2007, 9:51pm UTC](https://www.ruby-forum.com/t/array-to-hash/103277 "2007-05-03T21:51:05Z")

</div>

is it possible to convert easily an Array like this one : \[ nil, “b”, nil, nil, nil , “f”, “g”, nil, nil, “j”\] to an Hash like this one { 1 =\> “b”, 5 =\> “f”, 6 =\> “g”, 9 =\> “j” } where the key is the position of a …

---

## [Array slicing](https://www.ruby-forum.com/t/array-slicing/103256)

<div class="topic-metadata">

**Author:** [@Josselin](https://www.ruby-forum.com/u/Josselin)\
**Replies:** 11\
**Last updated:** [May 3, 2007, 9:40pm UTC](https://www.ruby-forum.com/t/array-slicing/103256 "2007-05-03T21:40:04Z")

</div>

given an array anArray = \[\[“a”, 1, 1\], \[“b”, 1, 2\], \[“c”, 1, 5\], \[“z”, 1, 1\], \[“e”, 1, 5\], \[“f”, 1, 6\], \[“g”, 1, 1\], \[“h”, 1, 3\], \[“i”, 1, 1\], \[“j”, 1, 2\], \[“k”, 1, 1\], \[“y”, 1, 6\], \[“m”, 1, 1\], \[“u”, 1, 2\], \[“v”, 1, …

---

## [Search and replace text in files](https://www.ruby-forum.com/t/search-and-replace-text-in-files/103282)

<div class="topic-metadata">

**Author:** [@philswenson](https://www.ruby-forum.com/u/philswenson)\
**Replies:** 3\
**Last updated:** [May 3, 2007, 9:36pm UTC](https://www.ruby-forum.com/t/search-and-replace-text-in-files/103282 "2007-05-03T21:36:02Z")

</div>

I need to search a file for text “InstallDir=” + newline character and replace it with something like: InstallDir=C:\\mws71 + newline My own experimentation with this had problems with writing the back- slashes to the…

---

## [Ruby and SIGVTALRM](https://www.ruby-forum.com/t/ruby-and-sigvtalrm/103189)

<div class="topic-metadata">

**Author:** [@joshmh](https://www.ruby-forum.com/u/joshmh)\
**Replies:** 1\
**Last updated:** [May 3, 2007, 7:41pm UTC](https://www.ruby-forum.com/t/ruby-and-sigvtalrm/103189 "2007-05-03T19:41:50Z")

</div>

Hi, Why would SIGVTALRM ever cause IO#sysread to throw EINTR? I’m having a problem where a Net::HTTP connection is repeatedly dying because its IO#sysread call is being interrupted and raising EINTR. I have attache…

---

## [Creating a local mirror of rubyforge?](https://www.ruby-forum.com/t/creating-a-local-mirror-of-rubyforge/103275)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [May 3, 2007, 6:30pm UTC](https://www.ruby-forum.com/t/creating-a-local-mirror-of-rubyforge/103275 "2007-05-03T18:30:03Z")

</div>

I’ve been told that we cannot open our internal developer machine firewall to get access to plugins and gems from rubyforge. I was told that it would be better to do a local mirror behind our firewall that does a nig…

---

## [Rubyforge SCM browser not updating](https://www.ruby-forum.com/t/rubyforge-scm-browser-not-updating/103220)

<div class="topic-metadata">

**Author:** [@Clifford\_H](https://www.ruby-forum.com/u/Clifford_H)\
**Replies:** 2\
**Last updated:** [May 3, 2007, 5:16pm UTC](https://www.ruby-forum.com/t/rubyforge-scm-browser-not-updating/103220 "2007-05-03T17:16:52Z")

</div>

The RubyForge SCM pages on viewvc.rubyforge.mmmultiworks.com haven’t updated their view of my ActiveFacts project (at http://viewvc.rubyforge.mmmultiworks.com/cgi/viewvc.cgi/?root=activefacts) in more than 24 hours, d…

---

## [Array.which\_long? ( I coded an extension for Array )](https://www.ruby-forum.com/t/array-which-long-i-coded-an-extension-for-array/93223)

<div class="topic-metadata">

**Author:** [@cfc](https://www.ruby-forum.com/u/cfc)\
**Replies:** 30\
**Last updated:** [May 3, 2007, 4:28pm UTC](https://www.ruby-forum.com/t/array-which-long-i-coded-an-extension-for-array/93223 "2007-05-03T16:28:43Z")

</div>

Hi, I’m CFC I’m new at here. Nice to meet you:) I just coded an extension for Array. It will return the longest element of an array. Source: class Array def which\_long? # Version 1.0 # Coded by CFC \< zusocfc @ g…

---

## [Command-line option parsing](https://www.ruby-forum.com/t/command-line-option-parsing/51207)

<div class="topic-metadata">

**Author:** [@Eric\_JSRoode](https://www.ruby-forum.com/u/Eric_JSRoode)\
**Replies:** 17\
**Last updated:** [May 3, 2007, 2:13pm UTC](https://www.ruby-forum.com/t/command-line-option-parsing/51207 "2007-05-03T14:13:10Z")

</div>

Greetings, I'm new to ruby (from Perl). I notice there are several command-line options parsing modules. The two that stuck out were GetoptLong and OptionsParser. GetoptLong suffers from being “the same old Getop…

---

## [It doesn't produce any output!](https://www.ruby-forum.com/t/it-doesnt-produce-any-output/103164)

<div class="topic-metadata">

**Author:** [@yusufcelik](https://www.ruby-forum.com/u/yusufcelik)\
**Replies:** 4\
**Last updated:** [May 3, 2007, 2:02pm UTC](https://www.ruby-forum.com/t/it-doesnt-produce-any-output/103164 "2007-05-03T14:02:07Z")

</div>

Hi, I wonder if something is wrong with the following code. Because, it doesn’t produce any output. BTW, I am new to Ruby. Regards yc include ObjectSpace a=b=c=“A” define\_finalizer(a, proc {|id| puts “Finalizer …

---

## [Fwd: Ruby Quiz solution](https://www.ruby-forum.com/t/fwd-ruby-quiz-solution/174972)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [May 3, 2007, 1:55pm UTC](https://www.ruby-forum.com/t/fwd-ruby-quiz-solution/174972 "2007-05-03T13:55:06Z")

</div>

Begin forwarded message:

---

## [Gem update hangs (yaml slow on big dataset)](https://www.ruby-forum.com/t/gem-update-hangs-yaml-slow-on-big-dataset/103251)

<div class="topic-metadata">

**Author:** [@arjackson](https://www.ruby-forum.com/u/arjackson)\
**Replies:** 0\
**Last updated:** [May 3, 2007, 12:01pm UTC](https://www.ruby-forum.com/t/gem-update-hangs-yaml-slow-on-big-dataset/103251 "2007-05-03T12:01:35Z")

</div>

Hi all, I am having a heck of a time trying to get gems working on a ubuntu system. I get exactly what is described at http://rubygems.org/read/chapter/19#page96 I have a problem with RubyGems. It doesn’t matter wha…

---

## [Shell script with arguments within perl script](https://www.ruby-forum.com/t/shell-script-with-arguments-within-perl-script/103205)

<div class="topic-metadata">

**Author:** [@jay](https://www.ruby-forum.com/u/jay)\
**Replies:** 8\
**Last updated:** [May 3, 2007, 10:48am UTC](https://www.ruby-forum.com/t/shell-script-with-arguments-within-perl-script/103205 "2007-05-03T10:48:26Z")

</div>

Hi! I wanted to run the system command with in Perl script to execute shell script with argument. I need to know the correct syntax for the arguments. Ex.) #/opt/bin/perl system(“shellscript.sh” , ); I am getting …

---

## [Threads, dRuby](https://www.ruby-forum.com/t/threads-druby/103217)

<div class="topic-metadata">

**Author:** [@ddancer](https://www.ruby-forum.com/u/ddancer)\
**Replies:** 1\
**Last updated:** [May 3, 2007, 7:20am UTC](https://www.ruby-forum.com/t/threads-druby/103217 "2007-05-03T07:20:54Z")

</div>

Not sure where to start, so I’ll just jump in… I have a dRuby server which runs a thread for each request. The request fires off some processing that includes working with FireRuby and libxml, libxsl. Here’s the weir…

---

## [Making executable =P](https://www.ruby-forum.com/t/making-executable-p/103212)

<div class="topic-metadata">

**Author:** [@raelz](https://www.ruby-forum.com/u/raelz)\
**Replies:** 3\
**Last updated:** [May 3, 2007, 6:59am UTC](https://www.ruby-forum.com/t/making-executable-p/103212 "2007-05-03T06:59:53Z")

</div>

Ehm… noob question though I did not really understood the ruby2exe thingy, i tried things like C:\\Myhacks\\EXE\\rb2exe-0.2\>rb2exe.exe ut.rb C:\\Myhacks\\EXE\\rb2exe-0.2\>rb2exe.exe ut.rb w C:\\Myhacks\\EXE\\rb2exe-0.2\>rb2exe.…

---

## [\[ANN\] Ruby-VPI 16.0.0](https://www.ruby-forum.com/t/ann-ruby-vpi-16-0-0/103233)

<div class="topic-metadata">

**Author:** [@snk](https://www.ruby-forum.com/u/snk)\
**Replies:** 0\
**Last updated:** [May 3, 2007, 6:55am UTC](https://www.ruby-forum.com/t/ann-ruby-vpi-16-0-0/103233 "2007-05-03T06:55:46Z")

</div>

Ruby-VPI is a Ruby interface to IEEE 1364-2005 Verilog VPI and a platform for unit testing, rapid prototyping, and systems integration of Verilog modules through Ruby. It lets you create complex Verilog test benches e…

---

## [\#122 Credit Card Validator (solution)](https://www.ruby-forum.com/t/122-credit-card-validator-solution/103229)

<div class="topic-metadata">

**Author:** [@illusoft](https://www.ruby-forum.com/u/illusoft)\
**Replies:** 0\
**Last updated:** [May 3, 2007, 5:03am UTC](https://www.ruby-forum.com/t/122-credit-card-validator-solution/103229 "2007-05-03T05:03:45Z")

</div>

It’s a hack job, nothing terribly pretty or well abstracted, but it certainly hits the 80% mark. num = ARGV.join def luhn(number) double = true luhn = 0 number.scan(/./) do |digit| n = digit.to\_i \* (double ? 2 : …

---

## [Compiling Ruby C extension on windows problem](https://www.ruby-forum.com/t/compiling-ruby-c-extension-on-windows-problem/103209)

<div class="topic-metadata">

**Author:** [@harryspier](https://www.ruby-forum.com/u/harryspier)\
**Replies:** 1\
**Last updated:** [May 3, 2007, 12:42am UTC](https://www.ruby-forum.com/t/compiling-ruby-c-extension-on-windows-problem/103209 "2007-05-03T00:42:32Z")

</div>

Dear list members, I am using a Windows-XP box with Ruby 1.8.6 installed with the one-click-installer. I am trying to get a simple example of a C extension to Ruby to compile on Windows. I’m trying to get recipe 22.…

---

## [\- Madison Rails meeting May 8th - Amazon Web Services](https://www.ruby-forum.com/t/madison-rails-meeting-may-8th-amazon-web-services/103206)

<div class="topic-metadata">

**Author:** [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Replies:** 0\
**Last updated:** [May 2, 2007, 11:00pm UTC](https://www.ruby-forum.com/t/madison-rails-meeting-may-8th-amazon-web-services/103206 "2007-05-02T23:00:22Z")

</div>

Join the Madison Ruby on Rails group on May 9th at 6 pm for a presentation by Mike Culver, a Web Services Evangelist from Amazon. The full details of the event are here: http://madisonrails.com/wiki/pages/Amazon+Web+S…

---

## [How to save and display a newlinefeed with rails?](https://www.ruby-forum.com/t/how-to-save-and-display-a-newlinefeed-with-rails/103148)

<div class="topic-metadata">

**Author:** [@anansi](https://www.ruby-forum.com/u/anansi)\
**Replies:** 3\
**Last updated:** [May 2, 2007, 10:52pm UTC](https://www.ruby-forum.com/t/how-to-save-and-display-a-newlinefeed-with-rails/103148 "2007-05-02T22:52:20Z")

</div>

Hi, in my little rails application I’ve made a little database (create.sql) like this: drop table if exists entries; create table entries ( id int not null auto\_increment, headline varch…

---

## [JRuby T-Shirts for Contributors](https://www.ruby-forum.com/t/jruby-t-shirts-for-contributors/103198)

<div class="topic-metadata">

**Author:** [@headius](https://www.ruby-forum.com/u/headius)\
**Replies:** 2\
**Last updated:** [May 2, 2007, 9:55pm UTC](https://www.ruby-forum.com/t/jruby-t-shirts-for-contributors/103198 "2007-05-02T21:55:11Z")

</div>

Hey, I’ve managed to get around 100 JRuby shirts printed up for giveaway at JavaOne and RailsConf. I wouldn’t imagine a lot of you will be at JavaOne, but RailsConf is another matter. But there’s a catch: they’re for …

---

## [MySQL gem problem on OS X](https://www.ruby-forum.com/t/mysql-gem-problem-on-os-x/103171)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 5\
**Last updated:** [May 2, 2007, 9:45pm UTC](https://www.ruby-forum.com/t/mysql-gem-problem-on-os-x/103171 "2007-05-02T21:45:11Z")

</div>

Help. On OS X 10.4.9 When trying to run a simple file starting with: require ‘rubygems’ require ‘mysql’ … I get this: /usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in gem\_original\_require': no s…

---

## [File & split](https://www.ruby-forum.com/t/file-split/103105)

<div class="topic-metadata">

**Author:** [@kula](https://www.ruby-forum.com/u/kula)\
**Replies:** 9\
**Last updated:** [May 2, 2007, 9:17pm UTC](https://www.ruby-forum.com/t/file-split/103105 "2007-05-02T21:17:30Z")

</div>

hi everyone, I’m very, very fresh in ruby so I’m looking for help with a small problem. I’ve got a log file from wget and I have to evaluate average download speed when downloading is still going, so I’m trying to do…

---

## [Qt4-ruby-mswin32 progress](https://www.ruby-forum.com/t/qt4-ruby-mswin32-progress/103097)

<div class="topic-metadata">

**Author:** [@Shea\_M](https://www.ruby-forum.com/u/Shea_M)\
**Replies:** 1\
**Last updated:** [May 2, 2007, 9:15pm UTC](https://www.ruby-forum.com/t/qt4-ruby-mswin32-progress/103097 "2007-05-02T21:15:08Z")

</div>

Has there been any progress on a gem for qt4-ruby on windows with msvc++? Even an unofficial binary would be great. ~S

---

## [Re: Checking Credit Cards (#122)](https://www.ruby-forum.com/t/re-checking-credit-cards-122/103194)

<div class="topic-metadata">

**Author:** [@chaserx](https://www.ruby-forum.com/u/chaserx)\
**Replies:** 0\
**Last updated:** [May 2, 2007, 8:38pm UTC](https://www.ruby-forum.com/t/re-checking-credit-cards-122/103194 "2007-05-02T20:38:04Z")

</div>

This is my first time submitting a solution to the quiz. I’ll attach my .rb file and copy / paste my solution below. It’s ugly, but it works. Thanks, Chase Southard #!/usr/bin/env ruby Created by Chase Southard on…

---

## [Fwd: Please Forward: Ruby Quiz Submission](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/169539)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [May 2, 2007, 8:25pm UTC](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/169539 "2007-05-02T20:25:01Z")

</div>

Begin forwarded message:

---

## [Help with rather simple method](https://www.ruby-forum.com/t/help-with-rather-simple-method/103174)

<div class="topic-metadata">

**Author:** [@Deniz\_D](https://www.ruby-forum.com/u/Deniz_D)\
**Replies:** 3\
**Last updated:** [May 2, 2007, 7:36pm UTC](https://www.ruby-forum.com/t/help-with-rather-simple-method/103174 "2007-05-02T19:36:56Z")

</div>

Hello. I’m trying to come up with the “best”, most Ruby-ish way to write a method such as this one: This method replaces randomly selected characters in ‘string’ with new randomly selected characters of \[A-Za-z0-9\]. H…

---

## [\[SOLUTION\] Checking Credit Cards (#122)](https://www.ruby-forum.com/t/solution-checking-credit-cards-122/93235)

<div class="topic-metadata">

**Author:** [@bradeck](https://www.ruby-forum.com/u/bradeck)\
**Replies:** 4\
**Last updated:** [May 2, 2007, 7:27pm UTC](https://www.ruby-forum.com/t/solution-checking-credit-cards-122/93235 "2007-05-02T19:27:56Z")

</div>

Let’s try this again. List ate my post. Maybe it’s the S/MIME sig? OK, this is the first Quiz contribution I have made (publicly). I think it is a good balance between terse and readable. JEG2, the luhn\_valid? check …

---

## [Replacing parts of newlines](https://www.ruby-forum.com/t/replacing-parts-of-newlines/103173)

<div class="topic-metadata">

**Author:** [@mschwab](https://www.ruby-forum.com/u/mschwab)\
**Replies:** 1\
**Last updated:** [May 2, 2007, 6:41pm UTC](https://www.ruby-forum.com/t/replacing-parts-of-newlines/103173 "2007-05-02T18:41:50Z")

</div>

I’m writing a script to convert text into a csv file to import into MS Excel (under Windows), and Excel allows multiline text within a cell, but the newlines (\\x0D\\x0A) have to be replaced with only a \\x0A for Excel t…

---

## [Irbsh](https://www.ruby-forum.com/t/irbsh/103169)

<div class="topic-metadata">

**Author:** [@rpheath](https://www.ruby-forum.com/u/rpheath)\
**Replies:** 0\
**Last updated:** [May 2, 2007, 5:35pm UTC](https://www.ruby-forum.com/t/irbsh/103169 "2007-05-02T17:35:43Z")

</div>

Hi, Can anyone out there say they’ve successfully used irbsh \[1\] on Emacs 22? It came up briefly in discussion \[2\] last fall… TIA, Ryan H. \[1\] http://www.rubyist.net/~rubikitch/computer/irbsh/index.en.html \[2\] ht…

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

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