# Ruby

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

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

---

## [Limiting how long a method is permiited to run](https://www.ruby-forum.com/t/limiting-how-long-a-method-is-permiited-to-run/49522)

<div class="topic-metadata">

**Author:** [@brian](https://www.ruby-forum.com/u/brian)\
**Replies:** 5\
**Last updated:** [December 5, 2005, 7:24pm UTC](https://www.ruby-forum.com/t/limiting-how-long-a-method-is-permiited-to-run/49522 "2005-12-05T19:24:19Z")

</div>

Hello all, Is there a means of limiting how long a method is permiited to run? I want to be able to mark a method with a number and have the method throw, say, a TooMuchTimeException if the running time exceeds this …

---

## [Gem install error](https://www.ruby-forum.com/t/gem-install-error/49516)

<div class="topic-metadata">

**Author:** [@transfire](https://www.ruby-forum.com/u/transfire)\
**Replies:** 7\
**Last updated:** [December 5, 2005, 6:55pm UTC](https://www.ruby-forum.com/t/gem-install-error/49516 "2005-12-05T18:55:49Z")

</div>

trans@ubixie:/usr/local/lib/site\_ruby/1.8$ sudo gem install calibre-basicobject Password: Attempting local installation of ‘calibre-basicobject’ Local gem file not found: calibre-basicobject\*.gem Attempting remote i…

---

## [Ruby ferret question -\> how to get list of values for a give](https://www.ruby-forum.com/t/ruby-ferret-question-how-to-get-list-of-values-for-a-give/49483)

<div class="topic-metadata">

**Author:** [@didier.prophete](https://www.ruby-forum.com/u/didier.prophete)\
**Replies:** 2\
**Last updated:** [December 5, 2005, 6:14pm UTC](https://www.ruby-forum.com/t/ruby-ferret-question-how-to-get-list-of-values-for-a-give/49483 "2005-12-05T18:14:46Z")

</div>

hi all, So I have a ferret question. Suppose I have a bunch of documents I indexed using ferret. For the sake of simplicity, all my documents have basically 1 relevant field: “city”, which I set up during indexing. S…

---

## [Programming Newbie: Ruby or Java?](https://www.ruby-forum.com/t/programming-newbie-ruby-or-java/49024)

<div class="topic-metadata">

**Author:** [@dabhar1959](https://www.ruby-forum.com/u/dabhar1959)\
**Replies:** 59\
**Last updated:** [December 5, 2005, 6:03pm UTC](https://www.ruby-forum.com/t/programming-newbie-ruby-or-java/49024 "2005-12-05T18:03:11Z")

</div>

Thanks for looking! I’m brand new to programming and had just decided to learn Java as a first language, then stumbled accross Ruby, which seems far simpler to learn, but doesn’t seem to have as many resources/books e…

---

## [FireRuby 0.4.1](https://www.ruby-forum.com/t/fireruby-0-4-1/95294)

<div class="topic-metadata">

**Author:** [@paw220470](https://www.ruby-forum.com/u/paw220470)\
**Replies:** 0\
**Last updated:** [December 5, 2005, 6:02pm UTC](https://www.ruby-forum.com/t/fireruby-0-4-1/95294 "2005-12-05T18:02:03Z")

</div>

FireRuby 0.4.1 FireRuby is an extension for the Ruby language that provides an OO interface over the Firebird open source RDBMS C API. This is a maintenance release. Work on getting the library working on a 64 bit …

---

## [Oppinions on map vs collect](https://www.ruby-forum.com/t/oppinions-on-map-vs-collect/49501)

<div class="topic-metadata">

**Author:** [@pfharlock](https://www.ruby-forum.com/u/pfharlock)\
**Replies:** 7\
**Last updated:** [December 5, 2005, 5:25pm UTC](https://www.ruby-forum.com/t/oppinions-on-map-vs-collect/49501 "2005-12-05T17:25:18Z")

</div>

I’ve been using collect in all my programs up till now, and I recently discovered that the map function is equivalent. My question is, (and I know that it really doesn’t matter), which is more correct to use if you’r…

---

## [Gem install rails hangs](https://www.ruby-forum.com/t/gem-install-rails-hangs/49433)

<div class="topic-metadata">

**Author:** [@bauer.mail](https://www.ruby-forum.com/u/bauer.mail)\
**Replies:** 4\
**Last updated:** [December 5, 2005, 5:25pm UTC](https://www.ruby-forum.com/t/gem-install-rails-hangs/49433 "2005-12-05T17:25:17Z")

</div>

Doesnt looks rails-specific, any gem will hang after I get the followin message: “Updating Gem source index for: http://gems.rubyforge.org”. The problem is identical to the one described here: http://groups.google.com…

---

## [Can I set a module context for a block?](https://www.ruby-forum.com/t/can-i-set-a-module-context-for-a-block/49511)

<div class="topic-metadata">

**Author:** [@drjflam](https://www.ruby-forum.com/u/drjflam)\
**Replies:** 4\
**Last updated:** [December 5, 2005, 5:08pm UTC](https://www.ruby-forum.com/t/can-i-set-a-module-context-for-a-block/49511 "2005-12-05T17:08:22Z")

</div>

I’d really like to be able to inject the ‘include Bob’ statement in the create method of Bob: module Bob def method\_missing(name, \*params) puts “missing: #{name}” end def self.create(name) yield if block\_given? p…

---

## [Ruby on AIX 5.3](https://www.ruby-forum.com/t/ruby-on-aix-5-3/49352)

<div class="topic-metadata">

**Author:** [@tachoknight](https://www.ruby-forum.com/u/tachoknight)\
**Replies:** 2\
**Last updated:** [December 5, 2005, 4:39pm UTC](https://www.ruby-forum.com/t/ruby-on-aix-5-3/49352 "2005-12-05T16:39:52Z")

</div>

Hi all- I was wondering if anyone has gotten Ruby 1.8.3 to build/run on AIX. I’m using GCC (xlC is not available) and all seems to be okay until: gcc -g -O2 -I. -I. -c struct.c gcc -g -O2 -I. -I. -c time.c gcc…

---

## [RCRchive back up](https://www.ruby-forum.com/t/rcrchive-back-up/52308)

<div class="topic-metadata">

**Author:** [@dblack](https://www.ruby-forum.com/u/dblack)\
**Replies:** 0\
**Last updated:** [December 5, 2005, 4:15pm UTC](https://www.ruby-forum.com/t/rcrchive-back-up/52308 "2005-12-05T16:15:16Z")

</div>

Hi – I’m slowly piecing things together post-crash – luckily very little is totally lost, though I’m struggling with incompatible BerkeleyDB stuff etc… Anyway, the upshot is RCRchive is back online. If you have prob…

---

## [Ruby debuger on Windows](https://www.ruby-forum.com/t/ruby-debuger-on-windows/49499)

<div class="topic-metadata">

**Author:** [@theHaPK](https://www.ruby-forum.com/u/theHaPK)\
**Replies:** 2\
**Last updated:** [December 5, 2005, 2:40pm UTC](https://www.ruby-forum.com/t/ruby-debuger-on-windows/49499 "2005-12-05T14:40:45Z")

</div>

Can somebody point out, why on Windows ruby -r debug my\_ruby\_script.rb start in “ubygems.rb” and not in “my\_ruby\_script.rb”. With “start” I mean, that I expected to see the first line of my file as the current statem…

---

## [Record-separator is a regular expression](https://www.ruby-forum.com/t/record-separator-is-a-regular-expression/49071)

<div class="topic-metadata">

**Author:** [@w\_a\_x\_man](https://www.ruby-forum.com/u/w_a_x_man)\
**Replies:** 8\
**Last updated:** [December 5, 2005, 2:24pm UTC](https://www.ruby-forum.com/t/record-separator-is-a-regular-expression/49071 "2005-12-05T14:24:24Z")

</div>

=begin Unlike Gawk and Mawk, Ruby won’t accept a regular expression as a record-separator. Let’s fix that. The substring matched by the record-separator is automatically removed from the record, but it can be obtaine…

---

## [Re: Weird Numbers (#57) Solution](https://www.ruby-forum.com/t/re-weird-numbers-57-solution/49504)

<div class="topic-metadata">

**Author:** [@simon.kroeger.ext](https://www.ruby-forum.com/u/simon.kroeger.ext)\
**Replies:** 0\
**Last updated:** [December 5, 2005, 2:03pm UTC](https://www.ruby-forum.com/t/re-weird-numbers-57-solution/49504 "2005-12-05T14:03:55Z")

</div>

Hi, I aimed for a fast yet elegant solution: (Its way faster than my first try, way slower than my fastest, but the one I liked the most) require ‘set’ class Fixnum def weird? divisors = (1…1+self/2).select{|i| (…

---

## [Automatic trace utility](https://www.ruby-forum.com/t/automatic-trace-utility/49455)

<div class="topic-metadata">

**Author:** [@kyku](https://www.ruby-forum.com/u/kyku)\
**Replies:** 3\
**Last updated:** [December 5, 2005, 12:46pm UTC](https://www.ruby-forum.com/t/automatic-trace-utility/49455 "2005-12-05T12:46:24Z")

</div>

Hi All, Recently I’m writing lots of recursive functions that I’d like to test by examining their backtraces. I wonder if something like the following is possible: def foo (x, y, z) trace if $DEBUG … end foo(1,2,3…

---

## [Strange crash (interpreter bug?)](https://www.ruby-forum.com/t/strange-crash-interpreter-bug/49437)

<div class="topic-metadata">

**Author:** [@sylvain.joyeux](https://www.ruby-forum.com/u/sylvain.joyeux)\
**Replies:** 4\
**Last updated:** [December 5, 2005, 12:22pm UTC](https://www.ruby-forum.com/t/strange-crash-interpreter-bug/49437 "2005-12-05T12:22:05Z")

</div>

I was trying to fix the busy\_handler of the sqlite3. (version 1.1.0 makes the interpreter crash) Rewriting busy\_handler in lib/sqlite3/native/driver.rb from def busy\_handler( db, data=nil, &block ) if block cb …

---

## [Weird Numbers (#57) Solution](https://www.ruby-forum.com/t/weird-numbers-57-solution/49434)

<div class="topic-metadata">

**Author:** [@hcatlin](https://www.ruby-forum.com/u/hcatlin)\
**Replies:** 38\
**Last updated:** [December 5, 2005, 11:57am UTC](https://www.ruby-forum.com/t/weird-numbers-57-solution/49434 "2005-12-05T11:57:33Z")

</div>

Here is my solution. Its not the most beautiful thing in the world, but its effective. def weirdo\_exhaustive(from, max) puts “none found” and return 0 if max \< 70 (from…max).each do |num| if num % 2 == 0 list, sum…

---

## [Ruby Tk and DRb](https://www.ruby-forum.com/t/ruby-tk-and-drb/49491)

<div class="topic-metadata">

**Author:** [@alex789](https://www.ruby-forum.com/u/alex789)\
**Replies:** 0\
**Last updated:** [December 5, 2005, 11:05am UTC](https://www.ruby-forum.com/t/ruby-tk-and-drb/49491 "2005-12-05T11:05:04Z")

</div>

Hello @ all! I wrote a little test code using RubyTk and DRb. But somehow I get strange errors: (druby://localhost:9000) /usr/lib/ruby/1.8/tk.rb:2020:in \_\_invoke': can't invoke "wm" command: application has been destr…

---

## [WANTED: Ruby Developer](https://www.ruby-forum.com/t/wanted-ruby-developer/95207)

<div class="topic-metadata">

**Author:** [@stevej](https://www.ruby-forum.com/u/stevej)\
**Replies:** 0\
**Last updated:** [December 5, 2005, 10:59am UTC](https://www.ruby-forum.com/t/wanted-ruby-developer/95207 "2005-12-05T10:59:16Z")

</div>

Hi All, Are you interested in using your Ruby/Rails knowledge to create a killer application and just maybe make some money out of it, too? Noumenaut Studios is looking for a volunteer Ruby developer to help us devel…

---

## [Deleting object inn array, if](https://www.ruby-forum.com/t/deleting-object-inn-array-if/49462)

<div class="topic-metadata">

**Author:** [@henrik.ormasen](https://www.ruby-forum.com/u/henrik.ormasen)\
**Replies:** 6\
**Last updated:** [December 5, 2005, 3:06am UTC](https://www.ruby-forum.com/t/deleting-object-inn-array-if/49462 "2005-12-05T03:06:20Z")

</div>

I have an array witch contains the id of living objects. I want to delete objects from the array, if the objects contains an variable == “other\_var”. I was thinking of something like the following thing: FAKE\_DATABAS…

---

## [Is there a way to get or list all available classes?](https://www.ruby-forum.com/t/is-there-a-way-to-get-or-list-all-available-classes/51357)

<div class="topic-metadata">

**Author:** [@uval](https://www.ruby-forum.com/u/uval)\
**Replies:** 6\
**Last updated:** [December 5, 2005, 1:48am UTC](https://www.ruby-forum.com/t/is-there-a-way-to-get-or-list-all-available-classes/51357 "2005-12-05T01:48:53Z")

</div>

Hello, topic says it all for example irb knows many classes like Dir, File, Process, Thread … can I somehow list them, maybe the are kept in some array … if it’s possible, can additional classes provided through req…

---

## [Fuzzy Searching a Database](https://www.ruby-forum.com/t/fuzzy-searching-a-database/49446)

<div class="topic-metadata">

**Author:** [@tomrossi7](https://www.ruby-forum.com/u/tomrossi7)\
**Replies:** 8\
**Last updated:** [December 5, 2005, 12:29am UTC](https://www.ruby-forum.com/t/fuzzy-searching-a-database/49446 "2005-12-05T00:29:21Z")

</div>

How would you recommend implementing something like a fuzzy search with Ruby and a SQL database. For example, I want to search a field in a table for anything that is similar to “Frank Smithe”. I would want an array…

---

## [PrettyPrint Array?](https://www.ruby-forum.com/t/prettyprint-array/51998)

<div class="topic-metadata">

**Author:** [@christer](https://www.ruby-forum.com/u/christer)\
**Replies:** 3\
**Last updated:** [December 5, 2005, 12:04am UTC](https://www.ruby-forum.com/t/prettyprint-array/51998 "2005-12-05T00:04:13Z")

</div>

I’m trying to make my own simple assert, but have problem displaying arrays. assert “123”, \[1,2,\[3\]\].to\_s Is there a method or function x, fullfilling these requirements assert “\[1,2,\[3\]\]”, \[1,2,\[3\]\].x assert “\[1,2,…

---

## [HTML Scraping Using WWW::Mechanize](https://www.ruby-forum.com/t/html-scraping-using-www-mechanize/60814)

<div class="topic-metadata">

**Author:** [@james\_b](https://www.ruby-forum.com/u/james_b)\
**Replies:** 3\
**Last updated:** [December 4, 2005, 8:44pm UTC](https://www.ruby-forum.com/t/html-scraping-using-www-mechanize/60814 "2005-12-04T20:44:19Z")

</div>

Recent discussion here on HTML parsing and using Michael N.'s outstanding Mechanize library prompted me to straighten up some code and write up an explanation of how I parse CafePress pages to build the rubystuff.com …

---

## [WWW::Mechanize speed](https://www.ruby-forum.com/t/www-mechanize-speed/49452)

<div class="topic-metadata">

**Author:** [@narf968](https://www.ruby-forum.com/u/narf968)\
**Replies:** 1\
**Last updated:** [December 4, 2005, 8:40pm UTC](https://www.ruby-forum.com/t/www-mechanize-speed/49452 "2005-12-04T20:40:15Z")

</div>

I found the Ruby version of the following script is half as fast as the Perl version. Here’s a typical result on my computer: $ time ./mech.pl ; time ./mech.rb real 0m6.182s user 0m0.284s sys 0m0.030s re…

---

## [When to use : before variables?](https://www.ruby-forum.com/t/when-to-use-before-variables/49442)

<div class="topic-metadata">

**Author:** [@daniel](https://www.ruby-forum.com/u/daniel)\
**Replies:** 3\
**Last updated:** [December 4, 2005, 8:03pm UTC](https://www.ruby-forum.com/t/when-to-use-before-variables/49442 "2005-12-04T20:03:37Z")

</div>

Hi out there, after looking at rails and the pickaxe book (not totally red yet, just used as a reference) I still wondering when to use just a construct :a =\> something What does it stands for and when to use it? Ple…

---

## [How to use Net::SSH for piping?](https://www.ruby-forum.com/t/how-to-use-net-ssh-for-piping/49436)

<div class="topic-metadata">

**Author:** [@ilmari.heikkinen](https://www.ruby-forum.com/u/ilmari.heikkinen)\
**Replies:** 1\
**Last updated:** [December 4, 2005, 5:48pm UTC](https://www.ruby-forum.com/t/how-to-use-net-ssh-for-piping/49436 "2005-12-04T17:48:25Z")

</div>

Hi, I’ve got a bit of a problem here. Here’s the setup, I’m proxying a remote command through a unix socket: Started an SSH session to a remote host using Net::SSH Created an UNIXServer and now am accepting connection…

---

## [Re: Weird Numbers (#57)](https://www.ruby-forum.com/t/re-weird-numbers-57/49318)

<div class="topic-metadata">

**Author:** [@simon.kroeger.ext](https://www.ruby-forum.com/u/simon.kroeger.ext)\
**Replies:** 11\
**Last updated:** [December 4, 2005, 5:40pm UTC](https://www.ruby-forum.com/t/re-weird-numbers-57/49318 "2005-12-04T17:40:14Z")

</div>

If I got I right, 70 would be such a number. (I hope this is no spoiler) divisors = \[1, 2, 5, 7, 10, 14, 35\] sum = 74 no combination of the divisors adds up to 70 cheers Simon

---

## [Fwd:](https://www.ruby-forum.com/t/fwd/95079)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [December 4, 2005, 4:18pm UTC](https://www.ruby-forum.com/t/fwd/95079 "2005-12-04T16:18:28Z")

</div>

Begin forwarded message:

---

## [Can ruby record sound and play it directly from webpage?](https://www.ruby-forum.com/t/can-ruby-record-sound-and-play-it-directly-from-webpage/49432)

<div class="topic-metadata">

**Author:** [@sddlzz](https://www.ruby-forum.com/u/sddlzz)\
**Replies:** 2\
**Last updated:** [December 4, 2005, 3:57pm UTC](https://www.ruby-forum.com/t/can-ruby-record-sound-and-play-it-directly-from-webpage/49432 "2005-12-04T15:57:57Z")

</div>

Can ruby record sound and play it directly from webpage? I dont know how ruby can do it? Any one can tell me ruby can do it?

---

## [Shell program](https://www.ruby-forum.com/t/shell-program/95060)

<div class="topic-metadata">

**Author:** [@sky.yin](https://www.ruby-forum.com/u/sky.yin)\
**Replies:** 2\
**Last updated:** [December 4, 2005, 2:07pm UTC](https://www.ruby-forum.com/t/shell-program/95060 "2005-12-04T14:07:38Z")

</div>

Hi, rubyists I’m using system() to execute a shell program under Windows. I wonder how I can get the result of the external program as a string, since the system() returns either true or false. I also try to use the D…

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

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