# Ruby

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

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

---

## [Reading font metrics](https://www.ruby-forum.com/t/reading-font-metrics/67134)

<div class="topic-metadata">

**Author:** [@RaySSbiesS\_Smundo](https://www.ruby-forum.com/u/RaySSbiesS_Smundo)\
**Replies:** 3\
**Last updated:** [September 6, 2006, 9:34am UTC](https://www.ruby-forum.com/t/reading-font-metrics/67134 "2006-09-06T09:34:41Z")

</div>

Hi, I’m looking for a way to read Truetype & PS Type 1 font metrics so that I can generate a list of installed fonts by name in a Ruby script. I have been searching the Internet for some tips on how-to with no luck so…

---

## [Do not feed the trolls or reply to spam](https://www.ruby-forum.com/t/do-not-feed-the-trolls-or-reply-to-spam/67696)

<div class="topic-metadata">

**Author:** [@Hal\_F](https://www.ruby-forum.com/u/Hal_F)\
**Replies:** 1\
**Last updated:** [September 6, 2006, 9:19am UTC](https://www.ruby-forum.com/t/do-not-feed-the-trolls-or-reply-to-spam/67696 "2006-09-06T09:19:25Z")

</div>

It’s counterproductive and only wastes more bandwidth. The proper response to spam is silence. Hal

---

## [Where to find the ruby library](https://www.ruby-forum.com/t/where-to-find-the-ruby-library/67710)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [September 6, 2006, 9:11am UTC](https://www.ruby-forum.com/t/where-to-find-the-ruby-library/67710 "2006-09-06T09:11:25Z")

</div>

There are some library scripts accompanies with the ruby installation, but regarding the plenty library resource of ohter script language such as perl and python, those are not enough. Can any one tell me where I can …

---

## [Timeunits-0.0.0](https://www.ruby-forum.com/t/timeunits-0-0-0/67669)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 8\
**Last updated:** [September 6, 2006, 8:03am UTC](https://www.ruby-forum.com/t/timeunits-0-0-0/67669 "2006-09-06T08:03:19Z")

</div>

we’ve all written bits of it before, here it is for that don’t want to: NAME timeunits.rb URIS http://rubyforge.org/projects/codeforpeople/ http://codeforpeople.org/lib/ruby/ SYNOPSIS adds methods to Numeric and T…

---

## [One line infinite for loop in Ruby?](https://www.ruby-forum.com/t/one-line-infinite-for-loop-in-ruby/67697)

<div class="topic-metadata">

**Author:** [@anildigital](https://www.ruby-forum.com/u/anildigital)\
**Replies:** 11\
**Last updated:** [September 6, 2006, 7:35am UTC](https://www.ruby-forum.com/t/one-line-infinite-for-loop-in-ruby/67697 "2006-09-06T07:35:18Z")

</div>

Hi all, How to write one line infinte for loop in Ruby? I don’t want loop{}. Regards, Anil W.

---

## [Stubbing Time.now with Mocha](https://www.ruby-forum.com/t/stubbing-time-now-with-mocha/67661)

<div class="topic-metadata">

**Author:** [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Replies:** 3\
**Last updated:** [September 6, 2006, 7:07am UTC](https://www.ruby-forum.com/t/stubbing-time-now-with-mocha/67661 "2006-09-06T07:07:16Z")

</div>

Mocha seems a great way to stub Time.now for testing expiration dates, etc. with rspec. I can get it to stub a single time easily: Time.stubs(:now).returns(Time.at(1)) but what I’d really like to do is do that multi…

---

## [Sitedir is not included in $LOAD\_PATH](https://www.ruby-forum.com/t/sitedir-is-not-included-in-load-path/67578)

<div class="topic-metadata">

**Author:** [@Vee\_S](https://www.ruby-forum.com/u/Vee_S)\
**Replies:** 2\
**Last updated:** [September 6, 2006, 6:39am UTC](https://www.ruby-forum.com/t/sitedir-is-not-included-in-load-path/67578 "2006-09-06T06:39:14Z")

</div>

sitedir is not included in $LOAD\_PATH (Ruby 1.8.5 on NetBSD 3.0.1) I didn’t use pkgsrc for installing Ruby interpreter. ============= RUBY 1.8.5 ================ irb(main):001:0\> $LOAD\_PATH =\> \[“/1.8”, “/1.8/i386-ne…

---

## [Kconv::toeuc](https://www.ruby-forum.com/t/kconv-toeuc/67699)

<div class="topic-metadata">

**Author:** [@OHARA\_Shigeki](https://www.ruby-forum.com/u/OHARA_Shigeki)\
**Replies:** 1\
**Last updated:** [September 6, 2006, 5:23am UTC](https://www.ruby-forum.com/t/kconv-toeuc/67699 "2006-09-06T05:23:09Z")

</div>

e$BBg86$G$9!#e(B Kconv::toeuc e$B$G$9$,!"e(B NKF e$B$Ne(B MIME e$B%G%3!\<%I$7$J$$%\*%W%7%g%se(B (-m0) e$B$,$D$$$F$7$^$C$F$$$k$h$&$G$9!#e(B e$B$\*$=$i$/!“e(B 2006-06-19 e$B$Ne(B revert e$B$GO3$l$,$”$C$?$N$G$O$J$$$+$H;W$…

---

## [Clearest Exposition of A very Important technical subject of](https://www.ruby-forum.com/t/clearest-exposition-of-a-very-important-technical-subject-of/67692)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [September 6, 2006, 5:21am UTC](https://www.ruby-forum.com/t/clearest-exposition-of-a-very-important-technical-subject-of/67692 "2006-09-06T05:21:09Z")

</div>

We give you the top links and material on the subject. THIS IS REAL SMOKING GUN !!! EVIDENCE: 911 was CONTROLLED DEMOLITION to make muslims 2nd class We have now video evidence that 911 was an INSIDE JOB like the USS …

---

## [Re: representing a span of time](https://www.ruby-forum.com/t/re-representing-a-span-of-time/67677)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 4\
**Last updated:** [September 6, 2006, 1:59am UTC](https://www.ruby-forum.com/t/re-representing-a-span-of-time/67677 "2006-09-06T01:59:01Z")

</div>

x = 64299600.0 Brad Are these values seconds since epoch? If so: irb(main):002:0\> Time.at(1157489583.2798 - 64299600.0) =\> Sun Aug 22 09:53:03 MDT 2004 Regards, Dan This communication is the property of Qwest a…

---

## [Problem with FlexMock::TestCase#flexstub in 0.4.0](https://www.ruby-forum.com/t/problem-with-flexmock-testcase-flexstub-in-0-4-0/67682)

<div class="topic-metadata">

**Author:** [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Replies:** 1\
**Last updated:** [September 6, 2006, 1:46am UTC](https://www.ruby-forum.com/t/problem-with-flexmock-testcase-flexstub-in-0-4-0/67682 "2006-09-06T01:46:50Z")

</div>

Jim, I’m really glad to see the stubbing capabilities added to FlexMock. However, I’m having a problem with the flexstub method. I have several domain classes (ActiveRecord) in my application, and I am working on fun…

---

## [Rails and HTTP Authentication](https://www.ruby-forum.com/t/rails-and-http-authentication/67637)

<div class="topic-metadata">

**Author:** [@MaggotChild](https://www.ruby-forum.com/u/MaggotChild)\
**Replies:** 2\
**Last updated:** [September 6, 2006, 1:12am UTC](https://www.ruby-forum.com/t/rails-and-http-authentication/67637 "2006-09-06T01:12:48Z")

</div>

Hi, I would like to restrict access the the basic CRUD ops via htaccess. Requests for /item/list, /item/add etc would prompt the user for their password. I was thinking I would create a new directory, apply the htacce…

---

## [Ie.contains\_text method](https://www.ruby-forum.com/t/ie-contains-text-method/67681)

<div class="topic-metadata">

**Author:** [@Ban\_Hoang](https://www.ruby-forum.com/u/Ban_Hoang)\
**Replies:** 0\
**Last updated:** [September 6, 2006, 12:54am UTC](https://www.ruby-forum.com/t/ie-contains-text-method/67681 "2006-09-06T00:54:47Z")

</div>

Hi, I am just wondering why the ie.contains\_text method works in the IE web developing by PHP code. I try ie.contains\_text with the IE developed by javascript. It did check the text in the IE. With IE develop by PHP …

---

## [Re: Joel Spolsky on languages for web programming](https://www.ruby-forum.com/t/re-joel-spolsky-on-languages-for-web-programming/67667)

<div class="topic-metadata">

**Author:** [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Replies:** 1\
**Last updated:** [September 6, 2006, 12:44am UTC](https://www.ruby-forum.com/t/re-joel-spolsky-on-languages-for-web-programming/67667 "2006-09-06T00:44:46Z")

</div>

I think he makes an important point that choice of technology is rarely a proximate cause of project failure. ( EJB & Corba being the two largest risk I can recall.) One point he doesn’t make is the difference OPM a…

---

## [Lost Gem Scripts](https://www.ruby-forum.com/t/lost-gem-scripts/67662)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [September 5, 2006, 11:36pm UTC](https://www.ruby-forum.com/t/lost-gem-scripts/67662 "2006-09-05T23:36:40Z")

</div>

A variety of inhouse gem scripts have been lost. The gems are installed and running fine. Is there a way to recreate the gem script from the gem? I see the specification command for displaying the YAML information.…

---

## [Modifying the first value with #inject](https://www.ruby-forum.com/t/modifying-the-first-value-with-inject/67634)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 2\
**Last updated:** [September 5, 2006, 11:26pm UTC](https://www.ruby-forum.com/t/modifying-the-first-value-with-inject/67634 "2006-09-05T23:26:38Z")

</div>

Is there an idiom for doing something to the first value as part of an inject? Or do I need to .map{}.inject{}? class Array def sum inject(0){ |total, entry| total + entry.to\_f } end def product inject(1){ |total,…

---

## [Similar resources for Lisp/Scheme](https://www.ruby-forum.com/t/similar-resources-for-lisp-scheme/67531)

<div class="topic-metadata">

**Author:** [@cpeterson](https://www.ruby-forum.com/u/cpeterson)\
**Replies:** 11\
**Last updated:** [September 5, 2006, 11:10pm UTC](https://www.ruby-forum.com/t/similar-resources-for-lisp-scheme/67531 "2006-09-05T23:10:36Z")

</div>

I know this is terribly off-topic, but . . . What resources can youse guys recommend for Common Lisp and/or Scheme? In particular, I’m looking for community-related websites, mailing lists, and generally accepted Good…

---

## [Fwd: Ruby quiz n.93](https://www.ruby-forum.com/t/fwd-ruby-quiz-n-93/229099)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [September 5, 2006, 10:48pm UTC](https://www.ruby-forum.com/t/fwd-ruby-quiz-n-93/229099 "2006-09-05T22:48:32Z")

</div>

Begin forwarded message:

---

## [Best way to do helpers for a constructor](https://www.ruby-forum.com/t/best-way-to-do-helpers-for-a-constructor/67598)

<div class="topic-metadata">

**Author:** [@jasonmorrison](https://www.ruby-forum.com/u/jasonmorrison)\
**Replies:** 1\
**Last updated:** [September 5, 2006, 9:38pm UTC](https://www.ruby-forum.com/t/best-way-to-do-helpers-for-a-constructor/67598 "2006-09-05T21:38:26Z")

</div>

What is the best practice for creating helper methods for a constructor? In Java (not that I know that much about Java), my instinct would be to make helper methods for a constructor be private class methods, since t…

---

## [Feedback \[incr Widget\]](https://www.ruby-forum.com/t/feedback-incr-widget/67647)

<div class="topic-metadata">

**Author:** [@Morton\_G](https://www.ruby-forum.com/u/Morton_G)\
**Replies:** 0\
**Last updated:** [September 5, 2006, 9:36pm UTC](https://www.ruby-forum.com/t/feedback-incr-widget/67647 "2006-09-05T21:36:25Z")

</div>

Puts up a window containing a progress bar and a button. Clicking on the button, hides the button and starts showing progress in the progress bar. When the progress bar has filled, the button returns and the whole thi…

---

## [Calendar \[incr Widget\]](https://www.ruby-forum.com/t/calendar-incr-widget/67644)

<div class="topic-metadata">

**Author:** [@Morton\_G](https://www.ruby-forum.com/u/Morton_G)\
**Replies:** 0\
**Last updated:** [September 5, 2006, 9:26pm UTC](https://www.ruby-forum.com/t/calendar-incr-widget/67644 "2006-09-05T21:26:25Z")

</div>

Makes a nice little calendar window. It opnens showing November, 2006. Clicking on any date results in the date being printed to stdout. #! /usr/bin/ruby -w # Author: Morton G. # # Date: August 31, 2006 # # Instant Ca…

---

## [My experience with RubyCocoa](https://www.ruby-forum.com/t/my-experience-with-rubycocoa/65182)

<div class="topic-metadata">

**Author:** [@maraby](https://www.ruby-forum.com/u/maraby)\
**Replies:** 14\
**Last updated:** [September 5, 2006, 9:22pm UTC](https://www.ruby-forum.com/t/my-experience-with-rubycocoa/65182 "2006-09-05T21:22:25Z")

</div>

So, I just installed RubyCocoa on my OS X machine here at work. Just thought I’d relay some keys to getting things to work: The easiest way to install RubyCocoa (on 10.4) is to use DarwinPorts. The automatic install…

---

## [Howto ? :: multi notes for same product in rails](https://www.ruby-forum.com/t/howto-multi-notes-for-same-product-in-rails/67604)

<div class="topic-metadata">

**Author:** [@Henrik\_Ekenberg](https://www.ruby-forum.com/u/Henrik_Ekenberg)\
**Replies:** 1\
**Last updated:** [September 5, 2006, 9:18pm UTC](https://www.ruby-forum.com/t/howto-multi-notes-for-same-product-in-rails/67604 "2006-09-05T21:18:22Z")

</div>

Hi, I want to create multi notes for one item. How can I do so in Rails. Steps I want. 1- create a new item 2- write in the edit screen name,desc,… 3- Add some notes to this item ( from 1 to 20 notes) 4- Save the n…

---

## [Phoenix Ruby Users Group September Meeting](https://www.ruby-forum.com/t/phoenix-ruby-users-group-september-meeting/67638)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 0\
**Last updated:** [September 5, 2006, 9:04pm UTC](https://www.ruby-forum.com/t/phoenix-ruby-users-group-september-meeting/67638 "2006-09-05T21:04:20Z")

</div>

The Phoenix Ruby U. Group will hold its September meeting on Monday, September 11, 2006, at 6:15pm. The meeting will be held at facilities graciously provided by Cyclone Commerce. Please see the group wiki at: http:…

---

## [Help compiling Ruby Java Bridge on OS X?](https://www.ruby-forum.com/t/help-compiling-ruby-java-bridge-on-os-x/67380)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [September 5, 2006, 7:54pm UTC](https://www.ruby-forum.com/t/help-compiling-ruby-java-bridge-on-os-x/67380 "2006-09-05T19:54:14Z")

</div>

Hi all, I’m stuck so I thought’d I ping out to see if anyone else has done this. Of course, asking for help is the best to be sure I find the answer myself in 10 minutes. :slight\_smile: I’m on the latest version of O…

---

## [Watir questions welcome here?](https://www.ruby-forum.com/t/watir-questions-welcome-here/67619)

<div class="topic-metadata">

**Author:** [@Richard\_Lewis\_Hagga](https://www.ruby-forum.com/u/Richard_Lewis_Hagga)\
**Replies:** 3\
**Last updated:** [September 5, 2006, 7:38pm UTC](https://www.ruby-forum.com/t/watir-questions-welcome-here/67619 "2006-09-05T19:38:12Z")

</div>

Since Watir is built on Ruby and it appears that Watir is sadly lacking in newsgroup resources, is this an appropriate forum for watir questions?

---

## [Calling VB DLL from ruby code](https://www.ruby-forum.com/t/calling-vb-dll-from-ruby-code/67613)

<div class="topic-metadata">

**Author:** [@medha](https://www.ruby-forum.com/u/medha)\
**Replies:** 1\
**Last updated:** [September 5, 2006, 6:34pm UTC](https://www.ruby-forum.com/t/calling-vb-dll-from-ruby-code/67613 "2006-09-05T18:34:03Z")

</div>

I am facing a problem while calling a VB DLL (for which I do not have a source code, just know the function signatures which DLL exposes) from a ruby code. DLL Function signature is as follows: Public Declare Functio…

---

## [Highlight (ActionView::Helpers::TextHelper)](https://www.ruby-forum.com/t/highlight-actionview-texthelper/67572)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [September 5, 2006, 6:32pm UTC](https://www.ruby-forum.com/t/highlight-actionview-texthelper/67572 "2006-09-05T18:32:03Z")

</div>

I’m using that helper function with a search form to highlight the typed phrase in the content BUT when my content is HTML, I’ll get replacement where I don’t want to. For instance : @page.content = “ My text contain…

---

## [Can I see method source code?](https://www.ruby-forum.com/t/can-i-see-method-source-code/67211)

<div class="topic-metadata">

**Author:** [@femto\_gary](https://www.ruby-forum.com/u/femto_gary)\
**Replies:** 11\
**Last updated:** [September 5, 2006, 5:51pm UTC](https://www.ruby-forum.com/t/can-i-see-method-source-code/67211 "2006-09-05T17:51:31Z")

</div>

hello all, Can I see method source code, like in javascript, when you generate a function, you can call to\_string on it to see its source code. It’s especailly useful when you examine other’s code or dynamic generati…

---

## [Duck typing alows true polymorfisim](https://www.ruby-forum.com/t/duck-typing-alows-true-polymorfisim/66510)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 11\
**Last updated:** [September 5, 2006, 5:51pm UTC](https://www.ruby-forum.com/t/duck-typing-alows-true-polymorfisim/66510 "2006-09-05T17:51:06Z")

</div>

lets say you want a generic numerical algorithom like sum Ruby def sum lst lst.inject(0){|total,current| total\*current} end Java // i dont know if there is a numeric super class for numbers class Sum{ public stati…

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

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