# Ruby

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

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

---

## [Converting a string to a class](https://www.ruby-forum.com/t/converting-a-string-to-a-class/54096)

<div class="topic-metadata">

**Author:** [@Anthony\_DeRobertis](https://www.ruby-forum.com/u/Anthony_DeRobertis)\
**Replies:** 9\
**Last updated:** [February 23, 2006, 5:15pm UTC](https://www.ruby-forum.com/t/converting-a-string-to-a-class/54096 "2006-02-23T17:15:04Z")

</div>

Take the following snippet: module SomeModule class SomeClass SomeConstant = 3.1415 end end var = “SomeModule::SomeClass” print(var::SomeConstant) This raises TypeError. So far, the only way I’ve found to do this…

---

## [Reading rompt protocols](https://www.ruby-forum.com/t/reading-rompt-protocols/54120)

<div class="topic-metadata">

**Author:** [@Mihai\_Vlad](https://www.ruby-forum.com/u/Mihai_Vlad)\
**Replies:** 0\
**Last updated:** [February 23, 2006, 5:12pm UTC](https://www.ruby-forum.com/t/reading-rompt-protocols/54120 "2006-02-23T17:12:00Z")

</div>

I’m trying to implement a function that reads from a socket ( TCP/IP based protocol with prompt ). Server sends: Welcoming you\\r\\n Please login\\r\\n I need this function to be a wrapper for gets (readline), that w…

---

## [Re: system() help](https://www.ruby-forum.com/t/re-system-help/71578)

<div class="topic-metadata">

**Author:** [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Replies:** 1\
**Last updated:** [February 23, 2006, 4:23pm UTC](https://www.ruby-forum.com/t/re-system-help/71578 "2006-02-23T16:23:19Z")

</div>

\-----Original Message----- From: Gennady B. Sent: Tuesday, February 21, 2006 12:45 To: ruby-talk ML Subject: Re: system() help system() does not do anyting with stdout or stdin, and it returns true or false depend…

---

## [FILE test](https://www.ruby-forum.com/t/file-test/71294)

<div class="topic-metadata">

**Author:** [@raving\_ruby\_rider](https://www.ruby-forum.com/u/raving_ruby_rider)\
**Replies:** 7\
**Last updated:** [February 23, 2006, 4:20pm UTC](https://www.ruby-forum.com/t/file-test/71294 "2006-02-23T16:20:16Z")

</div>

I noticed that a lot of scripts apply the following coding pattern: if FILE == $0 … end I know what is does but what kind of problems does it solve? thx, used-to-be-a-Smalltalker

---

## [Metakoans.rb (#67)](https://www.ruby-forum.com/t/metakoans-rb-67/72315)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [February 23, 2006, 2:55pm UTC](https://www.ruby-forum.com/t/metakoans-rb-67/72315 "2006-02-23T14:55:17Z")

</div>

This was a wildly popular quiz with solutions all over the board. I will do my best to hit the highlights below… Where to Define Probably the first question that needs answering when meta-programming is, where do …

---

## [Compiling c program using rb\_eval\_string()](https://www.ruby-forum.com/t/compiling-c-program-using-rb-eval-string/72281)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 5\
**Last updated:** [February 23, 2006, 2:34pm UTC](https://www.ruby-forum.com/t/compiling-c-program-using-rb-eval-string/72281 "2006-02-23T14:34:05Z")

</div>

I tried to call rb\_eval\_string(), so I wrote simple C code. #include “/home/xopht/lib/1.8/i686-linux/ruby.h” int main() { rb\_eval\_string( “puts” ); return 0; } I compiled it and get bellow result. \[xopht@odin rub…

---

## [YARV benchmarking](https://www.ruby-forum.com/t/yarv-benchmarking/72131)

<div class="topic-metadata">

**Author:** [@ESSaynatkari](https://www.ruby-forum.com/u/ESSaynatkari)\
**Replies:** 1\
**Last updated:** [February 23, 2006, 2:21pm UTC](https://www.ruby-forum.com/t/yarv-benchmarking/72131 "2006-02-23T14:21:55Z")

</div>

With YARV 0.4 out, I ran the benchmark suite and got some interesting results. These are of course non-real-world results (those typically vary between 2-4 times faster) but I would be interested in seeing architechtu…

---

## [Pluginfactory.rb - my door to insanity](https://www.ruby-forum.com/t/pluginfactory-rb-my-door-to-insanity/71807)

<div class="topic-metadata">

**Author:** [@merc](https://www.ruby-forum.com/u/merc)\
**Replies:** 2\
**Last updated:** [February 23, 2006, 1:03pm UTC](https://www.ruby-forum.com/t/pluginfactory-rb-my-door-to-insanity/71807 "2006-02-23T13:03:17Z")

</div>

Hello, As a matter of principle, I am studying the pluginfactory plugin (http://raa.ruby-lang.org/project/pluginfactory/). At first, I thought the author was insane (in a good way!). I am going bananas, trying to und…

---

## [Re: setting nil to zero](https://www.ruby-forum.com/t/re-setting-nil-to-zero/72278)

<div class="topic-metadata">

**Author:** [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Replies:** 0\
**Last updated:** [February 23, 2006, 12:27pm UTC](https://www.ruby-forum.com/t/re-setting-nil-to-zero/72278 "2006-02-23T12:27:06Z")

</div>

Robert K. \[mailto:removed\_email\_address@domain.invalid\] wrote: #Why so complicated? Why not just #class NilClass def +(n) n end #end why can i not see the simple light? :slight\_smile: #Note, I recommend to use the…

---

## [Re: setting nil to zero](https://www.ruby-forum.com/t/re-setting-nil-to-zero/72276)

<div class="topic-metadata">

**Author:** [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Replies:** 1\
**Last updated:** [February 23, 2006, 11:53am UTC](https://www.ruby-forum.com/t/re-setting-nil-to-zero/72276 "2006-02-23T11:53:58Z")

</div>

Robert K. \[mailto:removed\_email\_address@domain.invalid\] : #f\[w\] = (f\[w\] || 0) + 1 clear rubyish solution, Robert. thanks again for generous help. i am still hoping for the plain f\[w\] += 1 though :slight\_smile: for t…

---

## [ebXML 4 Ruby?](https://www.ruby-forum.com/t/ebxml-4-ruby/72277)

<div class="topic-metadata">

**Author:** [@giacecco](https://www.ruby-forum.com/u/giacecco)\
**Replies:** 0\
**Last updated:** [February 23, 2006, 11:26am UTC](https://www.ruby-forum.com/t/ebxml-4-ruby/72277 "2006-02-23T11:26:37Z")

</div>

Does anybody know about anyone working on an ebXML library for Ruby? I know about the precious soap4r by Hiroshi N. (http://dev.ctor.org/soap4r , the web site is down this moment) which is part of the default Ruby lib…

---

## [Setting nil to zero](https://www.ruby-forum.com/t/setting-nil-to-zero/72172)

<div class="topic-metadata">

**Author:** [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Replies:** 5\
**Last updated:** [February 23, 2006, 10:49am UTC](https://www.ruby-forum.com/t/setting-nil-to-zero/72172 "2006-02-23T10:49:48Z")

</div>

Hi, is there a setting to set nil to zero? something like $NIL=0, then set it back again to $NIL=nil… reason is i have quite a number of codes like ff s.each do |w| f\[w\] = 0 unless f\[w\] #i want to kill this lne sinc…

---

## [Is it safe to undef the socket rb\_w32\_\*() wrapper functions](https://www.ruby-forum.com/t/is-it-safe-to-undef-the-socket-rb-w32-wrapper-functions/54107)

<div class="topic-metadata">

**Author:** [@Jacob\_Repp](https://www.ruby-forum.com/u/Jacob_Repp)\
**Replies:** 0\
**Last updated:** [February 23, 2006, 8:55am UTC](https://www.ruby-forum.com/t/is-it-safe-to-undef-the-socket-rb-w32-wrapper-functions/54107 "2006-02-23T08:55:59Z")

</div>

I’ve undef’d the macros (bind, setsockopt, etc) in my C file but I’m wondering if I’m safe in doing so. I see the redirect functions do a few things that are probably important for the ruby core on win32 (please corre…

---

## [Re: lazy.rb 0.9.5 -- transparent futures!](https://www.ruby-forum.com/t/re-lazy-rb-0-9-5-transparent-futures/72126)

<div class="topic-metadata">

**Author:** [@dasch](https://www.ruby-forum.com/u/dasch)\
**Replies:** 7\
**Last updated:** [February 23, 2006, 6:58am UTC](https://www.ruby-forum.com/t/re-lazy-rb-0-9-5-transparent-futures/72126 "2006-02-23T06:58:13Z")

</div>

You can just do table\_name = “CUSTOMERS” x = promise { table\_name } puts x =\> “CUSTOMERS” though you have to then make sure that you leave that table\_name variable alone. table\_name = “CUSTOMERS” x = promise { ta…

---

## [Re: setting nil to zero](https://www.ruby-forum.com/t/re-setting-nil-to-zero/72173)

<div class="topic-metadata">

**Author:** [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Replies:** 0\
**Last updated:** [February 23, 2006, 4:48am UTC](https://www.ruby-forum.com/t/re-setting-nil-to-zero/72173 "2006-02-23T04:48:05Z")

</div>

Logan C. \[mailto:removed\_email\_address@domain.invalid\] : f\[w\] = f\[w\].to\_i + 1 i felt like being the dumbest guy on earth . this one works for both arrays and hashes. thank you for the uber cool tip, ruby hacker logan…

---

## [Dynamic code generation and linking](https://www.ruby-forum.com/t/dynamic-code-generation-and-linking/72060)

<div class="topic-metadata">

**Author:** [@Benjohn\_B](https://www.ruby-forum.com/u/Benjohn_B)\
**Replies:** 5\
**Last updated:** [February 23, 2006, 3:44am UTC](https://www.ruby-forum.com/t/dynamic-code-generation-and-linking/72060 "2006-02-23T03:44:40Z")

</div>

I’m very interested in being able to dynamically generate, compile, and link in c code (and potentially other languages, including assembly - but c is my primary interest), from within Ruby. When I say “link in”, I me…

---

## [Trouble with rexml](https://www.ruby-forum.com/t/trouble-with-rexml/71770)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 4\
**Last updated:** [February 23, 2006, 2:29am UTC](https://www.ruby-forum.com/t/trouble-with-rexml/71770 "2006-02-23T02:29:15Z")

</div>

I read XML file using REXML. The XML file contains Korean charactors. If I print the file using REXML::Document.write $stdout, everything is okay.( means Korean is printed out narmaly ) But, if I try again using REXM…

---

## [Memo to self](https://www.ruby-forum.com/t/memo-to-self/70688)

<div class="topic-metadata">

**Author:** [@amin1426](https://www.ruby-forum.com/u/amin1426)\
**Replies:** 3\
**Last updated:** [February 23, 2006, 2:20am UTC](https://www.ruby-forum.com/t/memo-to-self/70688 "2006-02-23T02:20:13Z")

</div>

Never under estimate what you can achieve with IO.read( “filename”).scan(%r{}mx) do |match| end Especial as you can control how greedy the regex is with .\*? I just deleted a lot of code and replaced it with one line. …

---

## [Cross Compiling Ruby external modules for the Nokia 770](https://www.ruby-forum.com/t/cross-compiling-ruby-external-modules-for-the-nokia-770/72128)

<div class="topic-metadata">

**Author:** [@Kenosis](https://www.ruby-forum.com/u/Kenosis)\
**Replies:** 0\
**Last updated:** [February 23, 2006, 1:13am UTC](https://www.ruby-forum.com/t/cross-compiling-ruby-external-modules-for-the-nokia-770/72128 "2006-02-23T01:13:56Z")

</div>

Greetings, I’ve had several request to update my Ruby “release” for the Nokia 770 to include gems. Gems, as I understand it, requires a few external components to be compiled into Ruby, e.g., openssl, stringio, etc.;…

---

## ['why ruby?' presentations](https://www.ruby-forum.com/t/why-ruby-presentations/54088)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 4\
**Last updated:** [February 23, 2006, 12:52am UTC](https://www.ruby-forum.com/t/why-ruby-presentations/54088 "2006-02-23T00:52:48Z")

</div>

i know they crop up from time to time on the list… if anyone out there has or knows of any good ones i’d like to browse them. we’re pushing ruby and the de-facto language behind a huge project so we’ll need all the…

---

## [Don't let this happen to Ruby, pleeeeease?](https://www.ruby-forum.com/t/dont-let-this-happen-to-ruby-pleeeeease/69422)

<div class="topic-metadata">

**Author:** [@Glenn\_S](https://www.ruby-forum.com/u/Glenn_S)\
**Replies:** 25\
**Last updated:** [February 22, 2006, 10:32pm UTC](https://www.ruby-forum.com/t/dont-let-this-happen-to-ruby-pleeeeease/69422 "2006-02-22T22:32:43Z")

</div>

This is quite a good article I just read via a link on artima (I think). http://www.pyrasun.com/mike/mt/archives/2005/01/09/20.57.06/ I was just thinking as I read it that it has some parallels with how I see “the ru…

---

## [Re: Ruby Dinner in St. Louis \*\* back to Friday \*\*](https://www.ruby-forum.com/t/re-ruby-dinner-in-st-louis-back-to-friday/54094)

<div class="topic-metadata">

**Author:** [@curthibbs](https://www.ruby-forum.com/u/curthibbs)\
**Replies:** 0\
**Last updated:** [February 22, 2006, 10:32pm UTC](https://www.ruby-forum.com/t/re-ruby-dinner-in-st-louis-back-to-friday/54094 "2006-02-22T22:32:43Z")

</div>

I promise… this is the last you’ll here from me. There is a an even more serious conflict for Saturday, so we’re moving back to Friday. Curt :frowning:

---

## [Ruby Dinner in St. Louis \*\* change to Saturday \*\*](https://www.ruby-forum.com/t/ruby-dinner-in-st-louis-change-to-saturday/72055)

<div class="topic-metadata">

**Author:** [@curthibbs](https://www.ruby-forum.com/u/curthibbs)\
**Replies:** 0\
**Last updated:** [February 22, 2006, 10:14pm UTC](https://www.ruby-forum.com/t/ruby-dinner-in-st-louis-change-to-saturday/72055 "2006-02-22T22:14:31Z")

</div>

I can’t believe I scheduled this during the NFJS Keynote & dinner – arrrrg! Now its going to be on Saturday, March 4th at 6:30pm. Curt

---

## [New to OOP and Abstract Session Pattern](https://www.ruby-forum.com/t/new-to-oop-and-abstract-session-pattern/71808)

<div class="topic-metadata">

**Author:** [@merc](https://www.ruby-forum.com/u/merc)\
**Replies:** 4\
**Last updated:** [February 22, 2006, 9:34pm UTC](https://www.ruby-forum.com/t/new-to-oop-and-abstract-session-pattern/71808 "2006-02-22T21:34:53Z")

</div>

Hello people, As some of you know, I would like to start “thinking” in objects. So, I am trying to study some patterns. I’ve actually ordered a book (suggested in this list!). However… well, you know :slight\_smile: I…

---

## [Re: metakoans.rb (#67)](https://www.ruby-forum.com/t/re-metakoans-rb-67/72017)

<div class="topic-metadata">

**Author:** [@davidtl](https://www.ruby-forum.com/u/davidtl)\
**Replies:** 0\
**Last updated:** [February 22, 2006, 9:10pm UTC](https://www.ruby-forum.com/t/re-metakoans-rb-67/72017 "2006-02-22T21:10:33Z")

</div>

Just coded to pass all koans. The program only accepts “one” attribute. (it only accepts the first one, others will be ignore) There are no koan to say what kind of behavior for multi-attribute with hash table and bl…

---

## [A regexp for an include? method](https://www.ruby-forum.com/t/a-regexp-for-an-include-method/71804)

<div class="topic-metadata">

**Author:** [@BoucherS\_Eric](https://www.ruby-forum.com/u/BoucherS_Eric)\
**Replies:** 5\
**Last updated:** [February 22, 2006, 8:49pm UTC](https://www.ruby-forum.com/t/a-regexp-for-an-include-method/71804 "2006-02-22T20:49:01Z")

</div>

Hi, I want to see if a certain pattern is inside an array. I tried: myArray.flatten.include?(/myPattern/) but it always return false. Why? Is it because the “include?” doesn’t takes regular expressions? Here’s anot…

---

## [Writers needed for The Ruby Bookshelf project](https://www.ruby-forum.com/t/writers-needed-for-the-ruby-bookshelf-project/72012)

<div class="topic-metadata">

**Author:** [@Julian\_ISKamil](https://www.ruby-forum.com/u/Julian_ISKamil)\
**Replies:** 0\
**Last updated:** [February 22, 2006, 8:30pm UTC](https://www.ruby-forum.com/t/writers-needed-for-the-ruby-bookshelf-project/72012 "2006-02-22T20:30:37Z")

</div>

I’d like to get help in converting existing open-licensed Ruby language related contents into Pandora format to be published at: http://books.rubyveil.com/ See this as an example: http://books.rubyveil.com/books/Ruby…

---

## [Ruby Dinner in St. Louis, Missouri](https://www.ruby-forum.com/t/ruby-dinner-in-st-louis-missouri/72011)

<div class="topic-metadata">

**Author:** [@curthibbs](https://www.ruby-forum.com/u/curthibbs)\
**Replies:** 0\
**Last updated:** [February 22, 2006, 8:18pm UTC](https://www.ruby-forum.com/t/ruby-dinner-in-st-louis-missouri/72011 "2006-02-22T20:18:30Z")

</div>

We are going to have a dinner gathering of Rubyists in St. Louis during the No Fluff Just Stuff conference. This will celebrate the 1 year anniversary of the St. Louis Ruby U. Group and give us a chance to meet fello…

---

## [Mongrel 0.3.6 -- Win32 Service/Rails Real Good](https://www.ruby-forum.com/t/mongrel-0-3-6-win32-service-rails-real-good/71977)

<div class="topic-metadata">

**Author:** [@Zed\_S](https://www.ruby-forum.com/u/Zed_S)\
**Replies:** 0\
**Last updated:** [February 22, 2006, 7:57pm UTC](https://www.ruby-forum.com/t/mongrel-0-3-6-win32-service-rails-real-good/71977 "2006-02-22T19:57:12Z")

</div>

Hello Folks, This release of Mongrel should make the win32 folks go crazy. Thanks to Luis L. it supports a full service system for installing any Rails app as a service. This lets you start your rails apps from eit…

---

## [Telnet question](https://www.ruby-forum.com/t/telnet-question/69940)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [February 22, 2006, 7:54pm UTC](https://www.ruby-forum.com/t/telnet-question/69940 "2006-02-22T19:54:09Z")

</div>

I’ll ask the questions first, and then show the code and examples below: waitfor is timing the script out. Is it because it isn’t recognizing that password input is complete? or is it because the device doesn’t issue…

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

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