# Ruby

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

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

---

## [Best way to test if a directory is empty](https://www.ruby-forum.com/t/best-way-to-test-if-a-directory-is-empty/119689)

<div class="topic-metadata">

**Author:** [@dracos](https://www.ruby-forum.com/u/dracos)\
**Replies:** 3\
**Last updated:** [November 9, 2007, 11:57am UTC](https://www.ruby-forum.com/t/best-way-to-test-if-a-directory-is-empty/119689 "2007-11-09T11:57:54Z")

</div>

I see this question was asked a while back (http://www.ruby-forum.com/topic/84762), but I’m having trouble implementing any of the solutions. I have tried: if Dir\[“#{RAILS\_ROOT}/documents/”\].empty? if catch(‘empty’){…

---

## [How to delete Array](https://www.ruby-forum.com/t/how-to-delete-array/119579)

<div class="topic-metadata">

**Author:** [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Replies:** 4\
**Last updated:** [November 9, 2007, 11:48am UTC](https://www.ruby-forum.com/t/how-to-delete-array/119579 "2007-11-09T11:48:25Z")

</div>

This will be possible in Rubinius, but it requires savaging the source code. Is there a way to do it in normal Ruby? Is source code savagery required? – Giles B. Blog: http://gilesbowkett.blogspot.com Portfolio: ht…

---

## [Webrick memory consumption](https://www.ruby-forum.com/t/webrick-memory-consumption/119696)

<div class="topic-metadata">

**Author:** [@mcampbell](https://www.ruby-forum.com/u/mcampbell)\
**Replies:** 0\
**Last updated:** [November 9, 2007, 9:54am UTC](https://www.ruby-forum.com/t/webrick-memory-consumption/119696 "2007-11-09T09:54:50Z")

</div>

Hi, I’am developing a small web interface (html files, forms, servlets) for my ham radio software using webrick. Later, I want to deploy this web interface on a Linux based router (OpenWrt) with only 32 MB RAM. Now…

---

## [That top-level 'self'](https://www.ruby-forum.com/t/that-top-level-self/119690)

<div class="topic-metadata">

**Author:** [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Replies:** 2\
**Last updated:** [November 9, 2007, 8:33am UTC](https://www.ruby-forum.com/t/that-top-level-self/119690 "2007-11-09T08:33:30Z")

</div>

The ruby top-level ‘self’ seems like a strange beast. It is an instance of Object. But definitions of methods, modules, classes, and constants magically go into the Object class. (So say the reflection methods.) (I…

---

## [Standard, pretty, and flexible meta-methods?](https://www.ruby-forum.com/t/standard-pretty-and-flexible-meta-methods/119642)

<div class="topic-metadata">

**Author:** [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Replies:** 9\
**Last updated:** [November 9, 2007, 7:32am UTC](https://www.ruby-forum.com/t/standard-pretty-and-flexible-meta-methods/119642 "2007-11-09T07:32:28Z")

</div>

The following code makes the meta-method “def\_foo” available to any class that inherits from Definer: class Definer def Definer.def\_foo def foo 17 end end end A TEST: class User \< Definer def\_foo end puts Use…

---

## [User.roles -- How do you list the role names of the user?](https://www.ruby-forum.com/t/user-roles-how-do-you-list-the-role-names-of-the-user/119686)

<div class="topic-metadata">

**Author:** [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Replies:** 6\
**Last updated:** [November 9, 2007, 7:27am UTC](https://www.ruby-forum.com/t/user-roles-how-do-you-list-the-role-names-of-the-user/119686 "2007-11-09T07:27:39Z")

</div>

Hello, I want to list out the role names that belong to a user. I have user.roles as the table, so I’m interested in the “name” column on that roles table. If I want to separate the names using a comma \[ e.g. using .…

---

## [Ruport-util 0.9.0](https://www.ruby-forum.com/t/ruport-util-0-9-0/119688)

<div class="topic-metadata">

**Author:** [@naething](https://www.ruby-forum.com/u/naething)\
**Replies:** 1\
**Last updated:** [November 9, 2007, 7:23am UTC](https://www.ruby-forum.com/t/ruport-util-0-9-0/119688 "2007-11-09T07:23:55Z")

</div>

This release is a rewrite of ruport-util’s graphing support, primarily resulting from hacking at RubyConf == Significant Changes == XML/SWF was removed Amline was added (amcharts.com) Gruff support was added for PNG/…

---

## [Best practises for exception handling](https://www.ruby-forum.com/t/best-practises-for-exception-handling/119656)

<div class="topic-metadata">

**Author:** [@alexd](https://www.ruby-forum.com/u/alexd)\
**Replies:** 5\
**Last updated:** [November 9, 2007, 5:29am UTC](https://www.ruby-forum.com/t/best-practises-for-exception-handling/119656 "2007-11-09T05:29:59Z")

</div>

I’m write a wrapper for a web service and am wondering about the best way to handle exceptions. The main method in the wrapper sends either a HEAD or GET request to a web server using Net::HTTP. Should I catch any ex…

---

## [Each\_with\_index yields mutable array](https://www.ruby-forum.com/t/each-with-index-yields-mutable-array/119377)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 2\
**Last updated:** [November 9, 2007, 4:48am UTC](https://www.ruby-forum.com/t/each-with-index-yields-mutable-array/119377 "2007-11-09T04:48:31Z")

</div>

e$B1sF#$H?=$7$^$9!#e(B 1.9 e$B$Ge(B Enumearble#each\_with\_index e$B$,e(B yield e$B$7$F$/$kG\[Ns$,JQ992DG=$G$9!#e(B e$BL5BL$KJXMx$+$b$7$l$J$$$N$G$9$,!";EMM$G$7$g$&$+!#e(B $ ./ruby -e ‘%w(a b c).each\_with\_index {|r| p r;…

---

## [Ruby Changes in Leopard](https://www.ruby-forum.com/t/ruby-changes-in-leopard/118339)

<div class="topic-metadata">

**Author:** [@Laurent\_S](https://www.ruby-forum.com/u/Laurent_S)\
**Replies:** 42\
**Last updated:** [November 9, 2007, 2:23am UTC](https://www.ruby-forum.com/t/ruby-changes-in-leopard/118339 "2007-11-09T02:23:24Z")

</div>

Hi, Leopard, Mac OS X 10.5, will very soon be available to everyone! Many of you have been wondering about the changes that will impact the Ruby environment. We preventively compiled a list of all changes, and you ca…

---

## [Find with null gives exception](https://www.ruby-forum.com/t/find-with-null-gives-exception/119672)

<div class="topic-metadata">

**Author:** [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Replies:** 1\
**Last updated:** [November 9, 2007, 2:15am UTC](https://www.ruby-forum.com/t/find-with-null-gives-exception/119672 "2007-11-09T02:15:48Z")

</div>

this one gives me a exception. what is the syntax if i use the find and wnat to return records with certail column null in it. Rawdata.find(:all, :conditions=\>{:processed\_indicator =\> NULL })

---

## [RubyInline 3.6.5 Released](https://www.ruby-forum.com/t/rubyinline-3-6-5-released/119671)

<div class="topic-metadata">

**Author:** [@aguynamedryan](https://www.ruby-forum.com/u/aguynamedryan)\
**Replies:** 0\
**Last updated:** [November 9, 2007, 1:58am UTC](https://www.ruby-forum.com/t/rubyinline-3-6-5-released/119671 "2007-11-09T01:58:51Z")

</div>

RubyInline version 3.6.5 has been released! http://rubyforge.org/projects/rubyinline/ http://www.zenspider.com/ZSS/Products/RubyInline/ Ruby Inline is an analog to Perl’s Inline::C. Out of the box, it allows you to e…

---

## [Accessing Array](https://www.ruby-forum.com/t/accessing-array/119658)

<div class="topic-metadata">

**Author:** [@ernsttanaka](https://www.ruby-forum.com/u/ernsttanaka)\
**Replies:** 2\
**Last updated:** [November 9, 2007, 1:55am UTC](https://www.ruby-forum.com/t/accessing-array/119658 "2007-11-09T01:55:12Z")

</div>

record =\> \[#\<Quote:0xb189218 @attributes={“underlying”=\>"$ADVN", “price”=\>“1579.00”, “date”=\>“2007-11-08 17:01:13”, “id”=\>“3362”, “impvolatility”=\>nil, “volume”=\>nil}\>, #\<Quote:0xb1877ec @attributes={“underlying”=\>"$…

---

## [Miniunit 1.1.0 Released](https://www.ruby-forum.com/t/miniunit-1-1-0-released/119664)

<div class="topic-metadata">

**Author:** [@aguynamedryan](https://www.ruby-forum.com/u/aguynamedryan)\
**Replies:** 3\
**Last updated:** [November 9, 2007, 1:19am UTC](https://www.ruby-forum.com/t/miniunit-1-1-0-released/119664 "2007-11-09T01:19:44Z")

</div>

miniunit version 1.1.0 has been released! http://rubyforge.org/projects/bfts miniunit is a completely minimial drop-in replacement for ruby’s test/unit. This is meant to be clean and easy to use both as a regular te…

---

## [TMail 1.1.1 Released](https://www.ruby-forum.com/t/tmail-1-1-1-released/119670)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 0\
**Last updated:** [November 9, 2007, 1:17am UTC](https://www.ruby-forum.com/t/tmail-1-1-1-released/119670 "2007-11-09T01:17:59Z")

</div>

TMail 1.1.1 has now been released TMail is the Ruby Mail handler used in the Ruby on Rails and Nitro web frame works as well as many others (including, now the Ruby T. mail gateway!). TMail is now a gem. You can inst…

---

## [\[ANN\] CruiseControl.rb 1.2.1](https://www.ruby-forum.com/t/ann-cruisecontrol-rb-1-2-1/119274)

<div class="topic-metadata">

**Author:** [@alexeyv](https://www.ruby-forum.com/u/alexeyv)\
**Replies:** 6\
**Last updated:** [November 9, 2007, 12:11am UTC](https://www.ruby-forum.com/t/ann-cruisecontrol-rb-1-2-1/119274 "2007-11-09T00:11:21Z")

</div>

CruiseControl.rb 1.2.1 is out. CruiseControl.rb is a continuous integration tool. Its basic purpose in life is to alert members of a software project when one of them checks something into source control that breaks t…

---

## [Editing Text (#145)](https://www.ruby-forum.com/t/editing-text-145/118391)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 36\
**Last updated:** [November 8, 2007, 10:56pm UTC](https://www.ruby-forum.com/t/editing-text-145/118391 "2007-11-08T22:56:23Z")

</div>

The three rules of Ruby Q.: Please do not post any solutions or spoiler discussion for this quiz until 48 hours have passed from the time on this message. Support Ruby Q. by submitting ideas as often as you can: …

---

## [Windows: Scheduled Ruby script won't run](https://www.ruby-forum.com/t/windows-scheduled-ruby-script-wont-run/119531)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 12\
**Last updated:** [November 8, 2007, 10:34pm UTC](https://www.ruby-forum.com/t/windows-scheduled-ruby-script-wont-run/119531 "2007-11-08T22:34:50Z")

</div>

Hello all, I have looked on the web for an answer to my issue with little success so I am trying here. I have a ruby script that I am scheduling at computer startup on Windows. And apparently it never starts. If it s…

---

## [Problem with zipfile.read -\> array (line by line)](https://www.ruby-forum.com/t/problem-with-zipfile-read-array-line-by-line/119626)

<div class="topic-metadata">

**Author:** [@caefer](https://www.ruby-forum.com/u/caefer)\
**Replies:** 2\
**Last updated:** [November 8, 2007, 9:35pm UTC](https://www.ruby-forum.com/t/problem-with-zipfile-read-array-line-by-line/119626 "2007-11-08T21:35:36Z")

</div>

Hi, have anybody a hint how i could extract information only for the first column in a zipped csv. The hole csv-file is in the array instead line by line as i’m expected, so i get only the first character. #match\_…

---

## [Dynamic syntax check](https://www.ruby-forum.com/t/dynamic-syntax-check/119583)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 6\
**Last updated:** [November 8, 2007, 9:05pm UTC](https://www.ruby-forum.com/t/dynamic-syntax-check/119583 "2007-11-08T21:05:41Z")

</div>

Is there any way to check the Ruby syntax on a file or string of Ruby code besides doing something like ruby -v xyz.rb? Is there a gem that would help me here? Thanks in advance, Adrian M.

---

## [Development now resumed on PDF::Writer](https://www.ruby-forum.com/t/development-now-resumed-on-pdf-writer/196512)

<div class="topic-metadata">

**Author:** [@naething](https://www.ruby-forum.com/u/naething)\
**Replies:** 0\
**Last updated:** [November 8, 2007, 8:44pm UTC](https://www.ruby-forum.com/t/development-now-resumed-on-pdf-writer/196512 "2007-11-08T20:44:01Z")

</div>

Hi Folks, At RubyConf 2007, some discussion came up yet again about PDF::Writer and how it’s unfortunate that such an important library has been inactive for so long. I am pleased to announce that we are going to p…

---

## [Faking the refering page with Mechanize](https://www.ruby-forum.com/t/faking-the-refering-page-with-mechanize/119323)

<div class="topic-metadata">

**Author:** [@ehudros](https://www.ruby-forum.com/u/ehudros)\
**Replies:** 12\
**Last updated:** [November 8, 2007, 8:39pm UTC](https://www.ruby-forum.com/t/faking-the-refering-page-with-mechanize/119323 "2007-11-08T20:39:54Z")

</div>

Hi, I am trying to access a certain web page from my server, but I want the referring page to be a different one. It seems the the get method accepts both a url and a “ref” parameter that is is supposed to be the ref…

---

## [Getting the names of classes defined in a ruby script](https://www.ruby-forum.com/t/getting-the-names-of-classes-defined-in-a-ruby-script/119580)

<div class="topic-metadata">

**Author:** [@thilinamb](https://www.ruby-forum.com/u/thilinamb)\
**Replies:** 4\
**Last updated:** [November 8, 2007, 7:49pm UTC](https://www.ruby-forum.com/t/getting-the-names-of-classes-defined-in-a-ruby-script/119580 "2007-11-08T19:49:13Z")

</div>

I want to get the names of the classes defined in a Ruby script. Is there any possible way of doing this ? thanks! regs, buddhika

---

## [Alternate to case; generating a list of sub-classes](https://www.ruby-forum.com/t/alternate-to-case-generating-a-list-of-sub-classes/119568)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 10\
**Last updated:** [November 8, 2007, 7:17pm UTC](https://www.ruby-forum.com/t/alternate-to-case-generating-a-list-of-sub-classes/119568 "2007-11-08T19:17:55Z")

</div>

The below uses pseudo-random number generation to populate an array with various monsters, all inherit from Creature. Can a list of classes which inherit from Creature be generated automagically? There must be a bet…

---

## [Editing Text (#145)](https://www.ruby-forum.com/t/editing-text-145/119614)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 1\
**Last updated:** [November 8, 2007, 6:59pm UTC](https://www.ruby-forum.com/t/editing-text-145/119614 "2007-11-08T18:59:12Z")

</div>

Implementing an efficient data structure for this problem can be tricky. A couple of the solutions turned out to have a higher complexity than it first appeared. That doesn’t mean they aren’t valuable to examine tho…

---

## [Net::HTTP and the need for all-capital http header names](https://www.ruby-forum.com/t/net-http-and-the-need-for-all-capital-http-header-names/93002)

<div class="topic-metadata">

**Author:** [@Christian\_Folini](https://www.ruby-forum.com/u/Christian_Folini)\
**Replies:** 1\
**Last updated:** [November 8, 2007, 5:22pm UTC](https://www.ruby-forum.com/t/net-http-and-the-need-for-all-capital-http-header-names/93002 "2007-11-08T17:22:05Z")

</div>

Hi there Net:HTTP will downcase http headers like FOO-BAR to Foo-Bar upon initialization and upon writing to the socket. While this behaviour is consistent with most user agents and servers it is the wrong approach f…

---

## [Test::Unit Equivalent of JUnit @AfterClass](https://www.ruby-forum.com/t/test-unit-equivalent-of-junit-afterclass/119587)

<div class="topic-metadata">

**Author:** [@patrickjoyce](https://www.ruby-forum.com/u/patrickjoyce)\
**Replies:** 3\
**Last updated:** [November 8, 2007, 4:53pm UTC](https://www.ruby-forum.com/t/test-unit-equivalent-of-junit-afterclass/119587 "2007-11-08T16:53:20Z")

</div>

Hey, Does anyone know a way to do the equivalent of @AfterClass in Test::Unit? I need to execute some code once after ALL the test\_\* methods in a Test::Unit::TestCase have run (teardown runs after EACH method). The …

---

## [Define\_method](https://www.ruby-forum.com/t/define-method/119460)

<div class="topic-metadata">

**Author:** [@Malcolm\_L](https://www.ruby-forum.com/u/Malcolm_L)\
**Replies:** 5\
**Last updated:** [November 8, 2007, 4:37pm UTC](https://www.ruby-forum.com/t/define-method/119460 "2007-11-08T16:37:29Z")

</div>

Hi Guys, I am trying to use define\_method like: class TestClass def initialize define\_method(“hello”) { || puts “Hello” } end end x = TestClass.new x.hello I am always getting: NoMethodError: undefined method \`…

---

## [Buffer to string](https://www.ruby-forum.com/t/buffer-to-string/119607)

<div class="topic-metadata">

**Author:** [@Jari\_W](https://www.ruby-forum.com/u/Jari_W)\
**Replies:** 9\
**Last updated:** [November 8, 2007, 3:58pm UTC](https://www.ruby-forum.com/t/buffer-to-string/119607 "2007-11-08T15:58:47Z")

</div>

I have a buffer (stored in a String class) with a NULL-terminated C-style string inside, what’s the most efficient approach to get that text string up to the NULL? Best regards, Jari W.

---

## [Create a framework](https://www.ruby-forum.com/t/create-a-framework/119599)

<div class="topic-metadata">

**Author:** [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Replies:** 1\
**Last updated:** [November 8, 2007, 3:03pm UTC](https://www.ruby-forum.com/t/create-a-framework/119599 "2007-11-08T15:03:15Z")

</div>

Hi, I’ve developed a few classes and I want to use them in another applications as a library or framework. Is there any manual or documentation about how to create a framework? Thank you.

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

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