# Ruby

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

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

---

## [A more elegant way to do this?](https://www.ruby-forum.com/t/a-more-elegant-way-to-do-this/60211)

<div class="topic-metadata">

**Author:** [@Tim\_U](https://www.ruby-forum.com/u/Tim_U)\
**Replies:** 4\
**Last updated:** [May 12, 2006, 3:45pm UTC](https://www.ruby-forum.com/t/a-more-elegant-way-to-do-this/60211 "2006-05-12T15:45:43Z")

</div>

Can anybody suggest a more elegant and rubyish way to do this? I am reading a YAML file and then trying to iterate over arrays and hashes that may or may not be there. unless conf\[‘hosts’\]\[hostname\]\[‘groups’\].nil? co…

---

## [Two small questions](https://www.ruby-forum.com/t/two-small-questions/60321)

<div class="topic-metadata">

**Author:** [@Valen](https://www.ruby-forum.com/u/Valen)\
**Replies:** 3\
**Last updated:** [May 12, 2006, 3:36pm UTC](https://www.ruby-forum.com/t/two-small-questions/60321 "2006-05-12T15:36:13Z")

</div>

I play Ruby without rails: \<% @connection = Mysql.new(‘localhost’, ‘root’, ‘’, ‘carpart’)%\> \<%= query = 'Select \* from store where part=“Stuff on shelf” ’ %\> \<% list = @connection.query(query) %\> and it works, but …

---

## [Install ruby on apache debian GNU/Linux 3.1(Sarge)](https://www.ruby-forum.com/t/install-ruby-on-apache-debian-gnu-linux-3-1-sarge/60349)

<div class="topic-metadata">

**Author:** [@joeffrey](https://www.ruby-forum.com/u/joeffrey)\
**Replies:** 0\
**Last updated:** [May 12, 2006, 2:55pm UTC](https://www.ruby-forum.com/t/install-ruby-on-apache-debian-gnu-linux-3-1-sarge/60349 "2006-05-12T14:55:32Z")

</div>

hi ppl, how can i install ruby on apache debian GNU/Linux 3.1(Sarge)what do i need to add or edit on the apache2.conf i’m just learning the language now. i already downloaded the following apache2, ruby, postgresql-c…

---

## [Generic XML importer/exporter for ruby](https://www.ruby-forum.com/t/generic-xml-importer-exporter-for-ruby/60346)

<div class="topic-metadata">

**Author:** [@Pedro\_CSSSSrte-Real](https://www.ruby-forum.com/u/Pedro_CSSSSrte-Real)\
**Replies:** 0\
**Last updated:** [May 12, 2006, 1:31pm UTC](https://www.ruby-forum.com/t/generic-xml-importer-exporter-for-ruby/60346 "2006-05-12T13:31:35Z")

</div>

I’ve written a generic importer/exporter between XML and ruby objects. What this means is that to generate an importer/exporter for this format: some value some other value…

---

## [Re: final/closed classes in Ruby (was: Sharp knives and glue](https://www.ruby-forum.com/t/re-final-closed-classes-in-ruby-was-sharp-knives-and-glue/94718)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 2\
**Last updated:** [May 12, 2006, 1:19pm UTC](https://www.ruby-forum.com/t/re-final-closed-classes-in-ruby-was-sharp-knives-and-glue/94718 "2006-05-12T13:19:21Z")

</div>

\-----Original Message----- From: Tanner B. \[mailto:removed\_email\_address@domain.invalid\] Sent: Thursday, May 11, 2006 3:50 PM To: ruby-talk ML Subject: Re: final/closed classes in Ruby (was: Sharp knives and glue) …

---

## [ANN: ruby2c 1.0.0 beta 5 released](https://www.ruby-forum.com/t/ann-ruby2c-1-0-0-beta-5-released/60342)

<div class="topic-metadata">

**Author:** [@aguynamedryan](https://www.ruby-forum.com/u/aguynamedryan)\
**Replies:** 0\
**Last updated:** [May 12, 2006, 11:51am UTC](https://www.ruby-forum.com/t/ann-ruby2c-1-0-0-beta-5-released/60342 "2006-05-12T11:51:25Z")

</div>

After almost a year, I’m pleased to announce that another beta of ruby2c is available. The project stagnated for a bit, but is coming back in force! We’ve solidified this release by gemifying it, splitting up our tail…

---

## [Twisted for Ruby?](https://www.ruby-forum.com/t/twisted-for-ruby/60013)

<div class="topic-metadata">

**Author:** [@blackhedd](https://www.ruby-forum.com/u/blackhedd)\
**Replies:** 12\
**Last updated:** [May 12, 2006, 9:31am UTC](https://www.ruby-forum.com/t/twisted-for-ruby/60013 "2006-05-12T09:31:09Z")

</div>

All: On another thread ("Considering Ruby for a Network Application), Giles Bowkett made reference to the “Twisted” application framework available to Python programmers, and that got me thinking. How many of you are …

---

## [FTGL Seg Faults on Win32](https://www.ruby-forum.com/t/ftgl-seg-faults-on-win32/60228)

<div class="topic-metadata">

**Author:** [@xavier](https://www.ruby-forum.com/u/xavier)\
**Replies:** 5\
**Last updated:** [May 12, 2006, 8:41am UTC](https://www.ruby-forum.com/t/ftgl-seg-faults-on-win32/60228 "2006-05-12T08:41:57Z")

</div>

Hi, I’m trying to use FLGT ruby on Windows XP, but am running into a segmentation fault at ftgl\_test.rb:38 (The first call through to the FTGL library) I am installing as follows: Ruby O. Click installer for window…

---

## [\[ANN\] New Ruby Garden Wiki Trial Run](https://www.ruby-forum.com/t/ann-new-ruby-garden-wiki-trial-run/60096)

<div class="topic-metadata">

**Author:** [@jimweirich](https://www.ruby-forum.com/u/jimweirich)\
**Replies:** 5\
**Last updated:** [May 12, 2006, 8:06am UTC](https://www.ruby-forum.com/t/ann-new-ruby-garden-wiki-trial-run/60096 "2006-05-12T08:06:59Z")

</div>

== Spam by the Numbers Anyone who visits the “RubyGarden wiki”:http://www.rubygarden.org/ruby regularly has probably run into wiki spam. You know what I mean, defaced pages with hundreds of links to questionable web…

---

## [A major ruby annoyance!](https://www.ruby-forum.com/t/a-major-ruby-annoyance/59816)

<div class="topic-metadata">

**Author:** [@Talha\_O](https://www.ruby-forum.com/u/Talha_O)\
**Replies:** 47\
**Last updated:** [May 12, 2006, 5:52am UTC](https://www.ruby-forum.com/t/a-major-ruby-annoyance/59816 "2006-05-12T05:52:51Z")

</div>

I am a newbie in Ruby. I have read several books including pickaxe and wrote several thousands lines of code. So far, as an ex perl user, I have found the major annoyance with ruby is the lack of declaration of varia…

---

## [Sharp knives and glue](https://www.ruby-forum.com/t/sharp-knives-and-glue/59393)

<div class="topic-metadata">

**Author:** [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Replies:** 91\
**Last updated:** [May 12, 2006, 5:19am UTC](https://www.ruby-forum.com/t/sharp-knives-and-glue/59393 "2006-05-12T05:19:23Z")

</div>

I have a friend that works in PHP all day and enjoys the language quite a lot. I have been recommending that he try Ruby, but he is bent on moving to Java because some of the people he works with are not good progr…

---

## [Ascii Character to Decimal Base 10 value](https://www.ruby-forum.com/t/ascii-character-to-decimal-base-10-value/60319)

<div class="topic-metadata">

**Author:** [@doug3](https://www.ruby-forum.com/u/doug3)\
**Replies:** 5\
**Last updated:** [May 12, 2006, 2:41am UTC](https://www.ruby-forum.com/t/ascii-character-to-decimal-base-10-value/60319 "2006-05-12T02:41:07Z")

</div>

Greetings all, I would like to know how one might convert a letter such as “H” to its corresponding ascii decimal value. On the flip side, how might I take the decimal value and convert it back to the alpha-numeric …

---

## [Mongrel 0.3.13 Pre-Release -- Out of Hibernation](https://www.ruby-forum.com/t/mongrel-0-3-13-pre-release-out-of-hibernation/60292)

<div class="topic-metadata">

**Author:** [@Zed\_S](https://www.ruby-forum.com/u/Zed_S)\
**Replies:** 4\
**Last updated:** [May 12, 2006, 2:01am UTC](https://www.ruby-forum.com/t/mongrel-0-3-13-pre-release-out-of-hibernation/60292 "2006-05-12T02:01:27Z")

</div>

Hello Mongrel Fans, After about a Month of busy work, bad computers, moving half my house across the country, and other dramas, I’m finally pushing out the next release of Mongrel. This pre-release has lots of little…

---

## [Final/closed classes in Ruby (was: Sharp knives and glue)](https://www.ruby-forum.com/t/final-closed-classes-in-ruby-was-sharp-knives-and-glue/60302)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 2\
**Last updated:** [May 12, 2006, 1:18am UTC](https://www.ruby-forum.com/t/final-closed-classes-in-ruby-was-sharp-knives-and-glue/60302 "2006-05-12T01:18:59Z")

</div>

The ‘Sharp knives and glue’ thread inspired this. It’s probably been done before but here’s my implementation of a final and/or closed class: Make a class unsubclassable class Class def final(klass) class \<\< klass …

---

## [Nested IF statements](https://www.ruby-forum.com/t/nested-if-statements/94719)

<div class="topic-metadata">

**Author:** [@angelo](https://www.ruby-forum.com/u/angelo)\
**Replies:** 0\
**Last updated:** [May 12, 2006, 12:05am UTC](https://www.ruby-forum.com/t/nested-if-statements/94719 "2006-05-12T00:05:40Z")

</div>

I’m very new to Ruby and am desperately trying to figure out what seems to be a fairly simple script. Is there something special I need to know in regards to IF statements with Ruby that may differ from most other la…

---

## [Re: final/closed classes in Ruby (was: Sharp knives and glue](https://www.ruby-forum.com/t/re-final-closed-classes-in-ruby-was-sharp-knives-and-glue/94717)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 1\
**Last updated:** [May 11, 2006, 11:50pm UTC](https://www.ruby-forum.com/t/re-final-closed-classes-in-ruby-was-sharp-knives-and-glue/94717 "2006-05-11T23:50:11Z")

</div>

\-----Original Message----- From: Gregory S. \[mailto:removed\_email\_address@domain.invalid\] Sent: Thursday, May 11, 2006 3:39 PM To: ruby-talk ML Subject: Re: final/closed classes in Ruby (was: Sharp knives and glue) …

---

## [Re: Sharp knives and glue](https://www.ruby-forum.com/t/re-sharp-knives-and-glue/60301)

<div class="topic-metadata">

**Author:** [@DebaunS\_Steve\_SSemi](https://www.ruby-forum.com/u/DebaunS_Steve_SSemi)\
**Replies:** 0\
**Last updated:** [May 11, 2006, 11:28pm UTC](https://www.ruby-forum.com/t/re-sharp-knives-and-glue/60301 "2006-05-11T23:28:08Z")

</div>

Having not experienced large-scale development farms firsthand, wouldn’t this just be a matter of proper unit tests? ‘its not my code, my unit tests work fine’. sd

---

## [Asserts in aggregate objects called by a Test::Unit::TestCas](https://www.ruby-forum.com/t/asserts-in-aggregate-objects-called-by-a-test-testcas/60160)

<div class="topic-metadata">

**Author:** [@Andrew\_Tanner](https://www.ruby-forum.com/u/Andrew_Tanner)\
**Replies:** 4\
**Last updated:** [May 11, 2006, 11:22pm UTC](https://www.ruby-forum.com/t/asserts-in-aggregate-objects-called-by-a-test-testcas/60160 "2006-05-11T23:22:06Z")

</div>

Howdy Rubyists, I’m building a framework for automating tests so I’ve been sinking my teeth into Test::Unit pretty heavily. Right now I’m trying to automagically do a bunch of asserts in a sub object called by a Test…

---

## [(no subject)](https://www.ruby-forum.com/t/no-subject/94709)

<div class="topic-metadata">

**Author:** [@runxc](https://www.ruby-forum.com/u/runxc)\
**Replies:** 0\
**Last updated:** [May 11, 2006, 9:47pm UTC](https://www.ruby-forum.com/t/no-subject/94709 "2006-05-11T21:47:42Z")

</div>

matome 30

---

## [Ruby 2.0: Symbol uniqueness?](https://www.ruby-forum.com/t/ruby-2-0-symbol-uniqueness/59712)

<div class="topic-metadata">

**Author:** [@MenTaLguY](https://www.ruby-forum.com/u/MenTaLguY)\
**Replies:** 3\
**Last updated:** [May 11, 2006, 8:43pm UTC](https://www.ruby-forum.com/t/ruby-2-0-symbol-uniqueness/59712 "2006-05-11T20:43:56Z")

</div>

I just learned yesterday that different string values can intern to the same symbols; for example: p “!”.intern == “!@”.intern # =\> true p “-(unary)”.intern == “-@”.intern # =\> true There aren’t many such cases, but …

---

## [\[BUG\] run with -rprofile -rtest/unit](https://www.ruby-forum.com/t/bug-run-with-rprofile-rtest-unit/60267)

<div class="topic-metadata">

**Author:** [@Takaaki\_T](https://www.ruby-forum.com/u/Takaaki_T)\
**Replies:** 1\
**Last updated:** [May 11, 2006, 8:15pm UTC](https://www.ruby-forum.com/t/bug-run-with-rprofile-rtest-unit/60267 "2006-05-11T20:15:34Z")

</div>

ruby-1.9/cygwin e$B$G\<!$NDL$j0\[\>o=\*N;$7$^$9!#e(B e$B$7$+$7\<j85$Ne(Blinuxe$B\>e$G$O!":#$N$H$3$m:F8=$7$^$;$s$G$7$?!#e(B ~$ ruby-1.9 -rprofile -rtest/unit -e ‘’ /usr/local/lib/ruby/1.9/optparse.rb:852: \[BUG\] Segmentation …

---

## [Bracket Packing (#78) (2 solutions)](https://www.ruby-forum.com/t/bracket-packing-78-2-solutions/59863)

<div class="topic-metadata">

**Author:** [@Eric\_I](https://www.ruby-forum.com/u/Eric_I)\
**Replies:** 3\
**Last updated:** [May 11, 2006, 7:25pm UTC](https://www.ruby-forum.com/t/bracket-packing-78-2-solutions/59863 "2006-05-11T19:25:22Z")

</div>

Here is my solution to the first option of the quiz, which is simply to detect if there is a problem. It makes use of the allowed assumption that only one packaging character would be omitted in incorrect input. So …

---

## [Module#add\_tracer](https://www.ruby-forum.com/t/module-add-tracer/60191)

<div class="topic-metadata">

**Author:** [@victor123789](https://www.ruby-forum.com/u/victor123789)\
**Replies:** 7\
**Last updated:** [May 11, 2006, 7:09pm UTC](https://www.ruby-forum.com/t/module-add-tracer/60191 "2006-05-11T19:09:45Z")

</div>

Hi all. Problem Sometimes profiling of large library gives me results like: % cumulative self self total time seconds seconds calls ms/call ms/call name … 10.60 2.20 0.38 …

---

## [Re: Creating a method like Array(object)](https://www.ruby-forum.com/t/re-creating-a-method-like-array-object/60260)

<div class="topic-metadata">

**Author:** [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Replies:** 1\
**Last updated:** [May 11, 2006, 6:32pm UTC](https://www.ruby-forum.com/t/re-creating-a-method-like-array-object/60260 "2006-05-11T18:32:56Z")

</div>

What you can do, though, use \[\] instead of (). class YourClass class \<\< self def p args end end end Then at least YourClass\[1, 2, 3\] would be available for you. Gennady.

---

## [Set\_trace\_func dumps core (2)](https://www.ruby-forum.com/t/set-trace-func-dumps-core-2/60261)

<div class="topic-metadata">

**Author:** [@URABE\_Shyouhei](https://www.ruby-forum.com/u/URABE_Shyouhei)\
**Replies:** 0\
**Last updated:** [May 11, 2006, 5:57pm UTC](https://www.ruby-forum.com/t/set-trace-func-dumps-core-2/60261 "2006-05-11T17:57:59Z")

</div>

e$B0J2\<$N$h$&$K$9$k$He(Bcoree$B$rEG$-$^$9!#e(B % cat segv.rb class Binding def eval str, \*a Kernel.eval str, self, \*a end end class Foo def m1 callcc do |\*| x = lambda do |e, f, l, m, b, c| set\_trace\_func nil …

---

## [Writable attributes - how does this work?](https://www.ruby-forum.com/t/writable-attributes-how-does-this-work/60227)

<div class="topic-metadata">

**Author:** [@Krekna\_M](https://www.ruby-forum.com/u/Krekna_M)\
**Replies:** 7\
**Last updated:** [May 11, 2006, 5:54pm UTC](https://www.ruby-forum.com/t/writable-attributes-how-does-this-work/60227 "2006-05-11T17:54:30Z")

</div>

Hi! How does this actually work? from the Pick Axe book: irb\> 1\> class Song 2 \> def duration=(new\_duration) 3\> @duration = new\_duration 4\> end 5\> end 6\> 7\> song = Song.new(“Bicylops”, “Fleck”, 260) 8\> …

---

## [Fowler's "EvaluatingRuby" article](https://www.ruby-forum.com/t/fowlers-evaluatingruby-article/60233)

<div class="topic-metadata">

**Author:** [@Bil\_K](https://www.ruby-forum.com/u/Bil_K)\
**Replies:** 2\
**Last updated:** [May 11, 2006, 5:23pm UTC](https://www.ruby-forum.com/t/fowlers-evaluatingruby-article/60233 "2006-05-11T17:23:44Z")

</div>

---

## [Each with arguments](https://www.ruby-forum.com/t/each-with-arguments/60249)

<div class="topic-metadata">

**Author:** [@cmcfab](https://www.ruby-forum.com/u/cmcfab)\
**Replies:** 7\
**Last updated:** [May 11, 2006, 5:20pm UTC](https://www.ruby-forum.com/t/each-with-arguments/60249 "2006-05-11T17:20:27Z")

</div>

I’ve found myself writing the following code to address needs I have processing formatted text files, but is this possible some other and I am going through foolish gyrations here… Here is the code: class Array alia…

---

## [\[slightly OT\]: ebay4R](https://www.ruby-forum.com/t/slightly-ot-ebay4r/60251)

<div class="topic-metadata">

**Author:** [@Chris\_T](https://www.ruby-forum.com/u/Chris_T)\
**Replies:** 0\
**Last updated:** [May 11, 2006, 4:58pm UTC](https://www.ruby-forum.com/t/slightly-ot-ebay4r/60251 "2006-05-11T16:58:06Z")

</div>

Anybody successfully using ebay4R. Having a bit of prob getting past the Hello World test. Keep getting: NoMethodError: /usr/lib/ruby/1.8/net/http.rb:565:in connect': You have a nil object when you didn't expect it! Th…

---

## [Plz help with binding](https://www.ruby-forum.com/t/plz-help-with-binding/60215)

<div class="topic-metadata">

**Author:** [@rf-vsv](https://www.ruby-forum.com/u/rf-vsv)\
**Replies:** 12\
**Last updated:** [May 11, 2006, 4:35pm UTC](https://www.ruby-forum.com/t/plz-help-with-binding/60215 "2006-05-11T16:35:20Z")

</div>

Ruby guru, please help: I’m creating variable-less storage, wich works fine: def arr\_fn() ; arr=\[\] ; lambda{ arr } ; end fa = arr\_fn ; fa\[\] \<\< 10 fb = arr\_fn ; fb\[\] \<\< 20 p fa\[\] #=\> \[10\] p fb\[\] #=\> \[20\] note that…

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

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