# Ruby

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

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

---

## [Ruby on Rails - Multiple Controllers in a page?](https://www.ruby-forum.com/t/ruby-on-rails-multiple-controllers-in-a-page/75394)

<div class="topic-metadata">

**Author:** [@Kev](https://www.ruby-forum.com/u/Kev)\
**Replies:** 6\
**Last updated:** [November 12, 2006, 3:29am UTC](https://www.ruby-forum.com/t/ruby-on-rails-multiple-controllers-in-a-page/75394 "2006-11-12T03:29:09Z")

</div>

Hi all, I am building a site, and I wish to populate the navigation dynamically from a MySQL db table, and the page content from a different table. The idea being I can have the navigation on every page, and use diff…

---

## [TkEntry validation?](https://www.ruby-forum.com/t/tkentry-validation/75641)

<div class="topic-metadata">

**Author:** [@Matt\_Maycock](https://www.ruby-forum.com/u/Matt_Maycock)\
**Replies:** 4\
**Last updated:** [November 12, 2006, 2:31am UTC](https://www.ruby-forum.com/t/tkentry-validation/75641 "2006-11-12T02:31:03Z")

</div>

Hi. I wrote the following to make some of my input validation from TkEntry’s a bit easier. I thought some others might be interested (still has some parts that could use work) Usage: num = TkEntry.new(…) num.filter…

---

## [Parsing html table cells](https://www.ruby-forum.com/t/parsing-html-table-cells/75608)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [November 12, 2006, 1:30am UTC](https://www.ruby-forum.com/t/parsing-html-table-cells/75608 "2006-11-12T01:30:59Z")

</div>

I am trying to parse an html page that has strings that looks like this 4 47 1 19 to get the numbers inside the table cells. I would to end up with a simple string that looks like this (for this row) 4 47 1 19 The …

---

## [Java scripting language poll](https://www.ruby-forum.com/t/java-scripting-language-poll/75562)

<div class="topic-metadata">

**Author:** [@pat\_eyler](https://www.ruby-forum.com/u/pat_eyler)\
**Replies:** 3\
**Last updated:** [November 11, 2006, 10:00pm UTC](https://www.ruby-forum.com/t/java-scripting-language-poll/75562 "2006-11-11T22:00:38Z")

</div>

Since I’m a glutton for punishment, I thought I’d go ahead and post this here as well. If you’re a user/fan of JRuby feel free to go vote it up\> http://www.manageability.org/polls/favorite\_java\_scripting\_language If…

---

## [Print message if user does nothing for x seconds?](https://www.ruby-forum.com/t/print-message-if-user-does-nothing-for-x-seconds/75640)

<div class="topic-metadata">

**Author:** [@nbits](https://www.ruby-forum.com/u/nbits)\
**Replies:** 8\
**Last updated:** [November 11, 2006, 9:48pm UTC](https://www.ruby-forum.com/t/print-message-if-user-does-nothing-for-x-seconds/75640 "2006-11-11T21:48:36Z")

</div>

Hi all, Only just started using ruby so this may be really simple to do, but here goes: I’m trying to write a program that asks a user to enter their sex using “gets” but if the user doesn’t type anything for about 5…

---

## [Re: Loading, CGI and some aother questions](https://www.ruby-forum.com/t/re-loading-cgi-and-some-aother-questions/75642)

<div class="topic-metadata">

**Author:** [@Gambler\_Gluck](https://www.ruby-forum.com/u/Gambler_Gluck)\
**Replies:** 2\
**Last updated:** [November 11, 2006, 9:26pm UTC](https://www.ruby-forum.com/t/re-loading-cgi-and-some-aother-questions/75642 "2006-11-11T21:26:33Z")

</div>

Well, configs are mine anyway, so I’m not afraid of injection from those files. But how do I “source” a file? Kernel#load and Kernel#require return boolean and do not seem to affect local scope. Could you please provi…

---

## [Best way to get epoch seconds from mysql datetime value](https://www.ruby-forum.com/t/best-way-to-get-epoch-seconds-from-mysql-datetime-value/75625)

<div class="topic-metadata">

**Author:** [@shawn\_bright](https://www.ruby-forum.com/u/shawn_bright)\
**Replies:** 6\
**Last updated:** [November 11, 2006, 7:22pm UTC](https://www.ruby-forum.com/t/best-way-to-get-epoch-seconds-from-mysql-datetime-value/75625 "2006-11-11T19:22:13Z")

</div>

Hey there all, if i have a mysql datetime value that looks like this: some\_time = ‘2006-05-11 05:14:14’ and i want to get seconds since the unix epoch, how would i go about that ? thanks

---

## [Pattern-matching for method arguments in Ruby](https://www.ruby-forum.com/t/pattern-matching-for-method-arguments-in-ruby/75630)

<div class="topic-metadata">

**Author:** [@Victor\_SZverokSS\_Sh](https://www.ruby-forum.com/u/Victor_SZverokSS_Sh)\
**Replies:** 0\
**Last updated:** [November 11, 2006, 6:28pm UTC](https://www.ruby-forum.com/t/pattern-matching-for-method-arguments-in-ruby/75630 "2006-11-11T18:28:06Z")

</div>

Hi all. I think, pattern-matching for function argument is a rather good idea. I know, it it someway embodied into Multiple Dispatch Library\[1\], but it has some major drawbacks: it is not Ruby: #normal method: de…

---

## [Loading, CGI and some aother questions](https://www.ruby-forum.com/t/loading-cgi-and-some-aother-questions/75618)

<div class="topic-metadata">

**Author:** [@Gambler\_Gluck](https://www.ruby-forum.com/u/Gambler_Gluck)\
**Replies:** 2\
**Last updated:** [November 11, 2006, 6:00pm UTC](https://www.ruby-forum.com/t/loading-cgi-and-some-aother-questions/75618 "2006-11-11T18:00:04Z")

</div>

Hello. I’m learning Ruby right now, and I have couple of questions about it. What is the best way to store configs for ruby programs? Is there a way to include an rb file with data structure so that it is assigned t…

---

## [Rails vs. Asp.Net politics](https://www.ruby-forum.com/t/rails-vs-asp-net-politics/75502)

<div class="topic-metadata">

**Author:** [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Replies:** 27\
**Last updated:** [November 11, 2006, 5:09pm UTC](https://www.ruby-forum.com/t/rails-vs-asp-net-politics/75502 "2006-11-11T17:09:40Z")

</div>

I have the deciding vote in a new (rather large) web app we need to develop. I am experienced in Rails, but the other 2 guys on the team know only C# and very basic Ruby. About 25% of the app could benefit from existi…

---

## [Can't compile with readline](https://www.ruby-forum.com/t/cant-compile-with-readline/75601)

<div class="topic-metadata">

**Author:** [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Replies:** 4\
**Last updated:** [November 11, 2006, 4:55pm UTC](https://www.ruby-forum.com/t/cant-compile-with-readline/75601 "2006-11-11T16:55:37Z")

</div>

Hi, I’m trying to compile Ruby 1.8.5 on Debian Sarge with readline. After compilation I try irb and I get: irb(main):001:0\> require “readline” LoadError: no such file to load – readline from (irb):1:in \`require’ fr…

---

## [Can i shorten up this function?](https://www.ruby-forum.com/t/can-i-shorten-up-this-function/75594)

<div class="topic-metadata">

**Author:** [@nephish](https://www.ruby-forum.com/u/nephish)\
**Replies:** 7\
**Last updated:** [November 11, 2006, 4:11pm UTC](https://www.ruby-forum.com/t/can-i-shorten-up-this-function/75594 "2006-11-11T16:11:33Z")

</div>

hey there, i have a function that checks to see if a string is in a comma separated list it looks like this def get\_in\_list(status) my\_list = ‘x,j,m,jrn,fnk,foo,other’ my\_list\_array = my\_list.split(’,’) if my\_list\_…

---

## [Ruby and threads: a VTK example](https://www.ruby-forum.com/t/ruby-and-threads-a-vtk-example/75404)

<div class="topic-metadata">

**Author:** [@buendia](https://www.ruby-forum.com/u/buendia)\
**Replies:** 8\
**Last updated:** [November 11, 2006, 3:11pm UTC](https://www.ruby-forum.com/t/ruby-and-threads-a-vtk-example/75404 "2006-11-11T15:11:26Z")

</div>

Hi, There is a ruby wrapper available for vtk which works, more or less, fine. For those who are not familiar with vtk, it is avisualisation library written in c++ and the output is a native window showing some inter…

---

## [Gcc: Internal error when gem is building native extensions](https://www.ruby-forum.com/t/gcc-internal-error-when-gem-is-building-native-extensions/75607)

<div class="topic-metadata">

**Author:** [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Replies:** 1\
**Last updated:** [November 11, 2006, 2:15pm UTC](https://www.ruby-forum.com/t/gcc-internal-error-when-gem-is-building-native-extensions/75607 "2006-11-11T14:15:19Z")

</div>

I’m trying to update my installed gems. Here’s what happens: -----sof----- $ sudo gem update -y Updating installed gems… Bulk updating Gem source index for: http://gems.rubyforge.org Attempting remote update of html…

---

## [Ruby-Lang.org in Korean, Polish and Spanish](https://www.ruby-forum.com/t/ruby-lang-org-in-korean-polish-and-spanish/75501)

<div class="topic-metadata">

**Author:** [@mmaher](https://www.ruby-forum.com/u/mmaher)\
**Replies:** 5\
**Last updated:** [November 11, 2006, 1:21pm UTC](https://www.ruby-forum.com/t/ruby-lang-org-in-korean-polish-and-spanish/75501 "2006-11-11T13:21:09Z")

</div>

The official Ruby language website is now available in English, Japanese, Korean, Polish and Spanish. There are more translation initiatives going on, and soon we will have Brazilian Portuguese, Chinese, Czech, French…

---

## [Export AOL adress book](https://www.ruby-forum.com/t/export-aol-adress-book/75602)

<div class="topic-metadata">

**Author:** [@Haofei](https://www.ruby-forum.com/u/Haofei)\
**Replies:** 0\
**Last updated:** [November 11, 2006, 12:05pm UTC](https://www.ruby-forum.com/t/export-aol-adress-book/75602 "2006-11-11T12:05:02Z")

</div>

I try to use WWW::Mechanize to get the data, but lots javascript are used in the pages. Can mechanize handle this kind of situation? Or there is other way to do this, thanks :slight\_smile:

---

## [Trying to get pack to work with the \* template character](https://www.ruby-forum.com/t/trying-to-get-pack-to-work-with-the-template-character/75465)

<div class="topic-metadata">

**Author:** [@jh100000](https://www.ruby-forum.com/u/jh100000)\
**Replies:** 3\
**Last updated:** [November 11, 2006, 11:37am UTC](https://www.ruby-forum.com/t/trying-to-get-pack-to-work-with-the-template-character/75465 "2006-11-11T11:37:00Z")

</div>

Ok, here’s a snippet of my code. @image\_array = Array.new @image = File.open(“test.JPG”, “rb”) do |image| image.each\_byte{|ch| @image\_array \<\< ch.to\_s} end @temp = @image\_array.pack(“m\*”) when I display the value o…

---

## [Singleton Methods](https://www.ruby-forum.com/t/singleton-methods/75591)

<div class="topic-metadata">

**Author:** [@sur\_max](https://www.ruby-forum.com/u/sur_max)\
**Replies:** 3\
**Last updated:** [November 11, 2006, 11:00am UTC](https://www.ruby-forum.com/t/singleton-methods/75591 "2006-11-11T11:00:57Z")

</div>

Could anyone explain what exactly we meant by a Singleton Method ? See if i am thinking it right… class A end a = A.new a.instance\_eval \<\<-EOS def wishing\_hello puts “HELLO !!” end EOS so, here wishing\_hello w…

---

## [Linux Cairo, webcam displaying images](https://www.ruby-forum.com/t/linux-cairo-webcam-displaying-images/75567)

<div class="topic-metadata">

**Author:** [@miked](https://www.ruby-forum.com/u/miked)\
**Replies:** 5\
**Last updated:** [November 11, 2006, 8:50am UTC](https://www.ruby-forum.com/t/linux-cairo-webcam-displaying-images/75567 "2006-11-11T08:50:46Z")

</div>

G’day Can anyone please advise me on how to constantly display the output from a webcam using Ruby & Cairo? I can operate the webcam, write images to disk etc and I can display a Gdk::Pixbuf okay. It’s just the upda…

---

## [MS SQL direct access](https://www.ruby-forum.com/t/ms-sql-direct-access/75587)

<div class="topic-metadata">

**Author:** [@johnf](https://www.ruby-forum.com/u/johnf)\
**Replies:** 2\
**Last updated:** [November 11, 2006, 6:46am UTC](https://www.ruby-forum.com/t/ms-sql-direct-access/75587 "2006-11-11T06:46:37Z")

</div>

Just wondering if Ruby can access MS SQL2000 direct - not using ODBC. John

---

## [\[ANN\] Ruby on Rails Training in Atlanta](https://www.ruby-forum.com/t/ann-ruby-on-rails-training-in-atlanta/75556)

<div class="topic-metadata">

**Author:** [@Obie\_F](https://www.ruby-forum.com/u/Obie_F)\
**Replies:** 1\
**Last updated:** [November 11, 2006, 4:56am UTC](https://www.ruby-forum.com/t/ann-ruby-on-rails-training-in-atlanta/75556 "2006-11-11T04:56:25Z")

</div>

In case anyone is interested, I’ll be teaching a 4-day Ruby on Rails TDD “bootcamp” in Atlanta on December 11th through the 14th. The curriculum is really great, prepared by my former ThoughtWorks colleague Dave Hoove…

---

## [Win32/process question](https://www.ruby-forum.com/t/win32-process-question/75479)

<div class="topic-metadata">

**Author:** [@J-Van](https://www.ruby-forum.com/u/J-Van)\
**Replies:** 8\
**Last updated:** [November 11, 2006, 2:30am UTC](https://www.ruby-forum.com/t/win32-process-question/75479 "2006-11-11T02:30:09Z")

</div>

On Windows XP, Ruby 1.8.5: start notepad irb(main):003:0\> info = Process.create :app\_name =\> “notepad” =\> # notepad running irb(main):004:0\> Process.kill 0, info.process\_id =\> \[3536\] kill notepad irb(main):005:0\> Pr…

---

## [Beginner question: testing for either condition?](https://www.ruby-forum.com/t/beginner-question-testing-for-either-condition/75580)

<div class="topic-metadata">

**Author:** [@taylorstrait](https://www.ruby-forum.com/u/taylorstrait)\
**Replies:** 4\
**Last updated:** [November 11, 2006, 2:26am UTC](https://www.ruby-forum.com/t/beginner-question-testing-for-either-condition/75580 "2006-11-11T02:26:06Z")

</div>

I want to check two conditions. If EITHER of them are true I want to proceed. Unfortunately what I have is returning true no matter what: if (@unit.custodian\_id == session\[:person\_id\]) or (session\[:person\_role\] == ‘…

---

## [Questions about Class#remove\_class implementation](https://www.ruby-forum.com/t/questions-about-class-remove-class-implementation/75569)

<div class="topic-metadata">

**Author:** [@fxn](https://www.ruby-forum.com/u/fxn)\
**Replies:** 0\
**Last updated:** [November 11, 2006, 1:53am UTC](https://www.ruby-forum.com/t/questions-about-class-remove-class-implementation/75569 "2006-11-11T01:53:59Z")

</div>

I am reading Rails’s Class#remove\_class: def remove\_class(\*klasses) klasses.flatten.each do |klass| # Skip this class if there is nothing bound to this name next unless defined?(klass.name) basename = klass.to\_s.…

---

## [Debian packages for qt4-qtruby](https://www.ruby-forum.com/t/debian-packages-for-qt4-qtruby/75564)

<div class="topic-metadata">

**Author:** [@gnuvince](https://www.ruby-forum.com/u/gnuvince)\
**Replies:** 0\
**Last updated:** [November 11, 2006, 12:33am UTC](https://www.ruby-forum.com/t/debian-packages-for-qt4-qtruby/75564 "2006-11-11T00:33:54Z")

</div>

Hello all ! I’ve made debian packages for the qt4-qtruby bindings. They are currently waiting in the NEW queue at debian, so I thought I would provide them on my own web page in the while. In short, adding the follow…

---

## [FastRI 0.1.1 (fast+smart ri docs searching): configurable se](https://www.ruby-forum.com/t/fastri-0-1-1-fast-smart-ri-docs-searching-configurable-se/75500)

<div class="topic-metadata">

**Author:** [@tulkas](https://www.ruby-forum.com/u/tulkas)\
**Replies:** 3\
**Last updated:** [November 11, 2006, 12:19am UTC](https://www.ruby-forum.com/t/fastri-0-1-1-fast-smart-ri-docs-searching-configurable-se/75500 "2006-11-11T00:19:53Z")

</div>

FastRI is an alternative to the ri command-line tool. It is much faster, and also allows you to offer RI lookup services over DRb. FastRI is smarter than ri, and can find classes anywhere in the hierarchy without spe…

---

## [Re: method\_missing behaves differently when a method is call](https://www.ruby-forum.com/t/re-method-missing-behaves-differently-when-a-method-is-call/75560)

<div class="topic-metadata">

**Author:** [@kuma](https://www.ruby-forum.com/u/kuma)\
**Replies:** 0\
**Last updated:** [November 10, 2006, 11:35pm UTC](https://www.ruby-forum.com/t/re-method-missing-behaves-differently-when-a-method-is-call/75560 "2006-11-10T23:35:45Z")

</div>

Thanks Jacob. I should have thought of that; it’s just like Java reflection.

---

## [Method\_missing behaves differently when a method is called v](https://www.ruby-forum.com/t/method-missing-behaves-differently-when-a-method-is-called-v/75554)

<div class="topic-metadata">

**Author:** [@kuma](https://www.ruby-forum.com/u/kuma)\
**Replies:** 1\
**Last updated:** [November 10, 2006, 11:17pm UTC](https://www.ruby-forum.com/t/method-missing-behaves-differently-when-a-method-is-called-v/75554 "2006-11-10T23:17:43Z")

</div>

For certain methods, it seems to behave differently if called via reflection. Consider the following example: class Foo def method\_missing(method, \*args, &block) “#{method} called” end end f = Foo.new f.bar(‘a’) …

---

## [Thread death callback to be called after fork](https://www.ruby-forum.com/t/thread-death-callback-to-be-called-after-fork/75523)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [November 10, 2006, 10:47pm UTC](https://www.ruby-forum.com/t/thread-death-callback-to-be-called-after-fork/75523 "2006-11-10T22:47:40Z")

</div>

forking kills threads, if it didn’t, this would hang: harp:~ \> cat a.rb t = Thread.new{ sleep } fork{ t.join; exit } and Process.wait harp:~ \> ruby a.rb but, of course, it does not now, say you need to know when a …

---

## [Undefined method \`mails' for #\<Net::POPMail 1\> (NoMethodErro](https://www.ruby-forum.com/t/undefined-method-mails-for-net-popmail-1-nomethoderro/75540)

<div class="topic-metadata">

**Author:** [@friofool](https://www.ruby-forum.com/u/friofool)\
**Replies:** 1\
**Last updated:** [November 10, 2006, 10:40pm UTC](https://www.ruby-forum.com/t/undefined-method-mails-for-net-popmail-1-nomethoderro/75540 "2006-11-10T22:40:41Z")

</div>

Hello, I’m trying to do a method to get mail via pop3 server. I created the following script but i receive this message during executio : testmail.rb:12: undefined method \`mails’ for #\<Net::POPMail 1\> (NoMethodError…

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

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