# Ruby

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

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

---

## [How to do TDD in Ruby?](https://www.ruby-forum.com/t/how-to-do-tdd-in-ruby/80470)

<div class="topic-metadata">

**Author:** [@mekondelta](https://www.ruby-forum.com/u/mekondelta)\
**Replies:** 16\
**Last updated:** [December 29, 2006, 4:48pm UTC](https://www.ruby-forum.com/t/how-to-do-tdd-in-ruby/80470 "2006-12-29T16:48:32Z")

</div>

Hi, I’m new to Ruby but am fairly experience in using TDD with Java and am having some problems in converting my knowledge over. I’m using the Eclipse Ruby plug-in and want so organise my test source and code source…

---

## [Override.rb](https://www.ruby-forum.com/t/override-rb/80515)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 14\
**Last updated:** [December 29, 2006, 3:14pm UTC](https://www.ruby-forum.com/t/override-rb/80515 "2006-12-29T15:14:10Z")

</div>

since the threads split all over the place i figured i’d start yet another. can people break this? harp:~ \> cat a.rb class Module module OverRiding class \<\< self def new Module.new{ @added\_methods = \[\] @parent …

---

## [SWIG n00b: irb trapping when accessing C array?](https://www.ruby-forum.com/t/swig-n00b-irb-trapping-when-accessing-c-array/80558)

<div class="topic-metadata">

**Author:** [@thechak](https://www.ruby-forum.com/u/thechak)\
**Replies:** 1\
**Last updated:** [December 29, 2006, 2:56pm UTC](https://www.ruby-forum.com/t/swig-n00b-irb-trapping-when-accessing-c-array/80558 "2006-12-29T14:56:05Z")

</div>

Hey all – First, let me set up the situation: I have some machine-generated C code that is really nothing more than the declaration and definition of various byte arrays. I’d like to convert it via Ruby and SWIG to …

---

## [Bug or Feature? (proxying methods)](https://www.ruby-forum.com/t/bug-or-feature-proxying-methods/80623)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [December 29, 2006, 1:15pm UTC](https://www.ruby-forum.com/t/bug-or-feature-proxying-methods/80623 "2006-12-29T13:15:45Z")

</div>

I have the following code: class ReturnSelfAfter def initialize(context) @context = context end def method\_missing(sym,\*args,&block) @context.send sym, \*args, &block @context end end class Object def return\_se…

---

## [Case bug when comparing classes...?](https://www.ruby-forum.com/t/case-bug-when-comparing-classes/80621)

<div class="topic-metadata">

**Author:** [@tbobker](https://www.ruby-forum.com/u/tbobker)\
**Replies:** 2\
**Last updated:** [December 29, 2006, 12:11pm UTC](https://www.ruby-forum.com/t/case-bug-when-comparing-classes/80621 "2006-12-29T12:11:34Z")

</div>

Hi, I’m encountering weird behavior I don’t understand when creating a case expression that does comparison using classes. Consider the following: class SomeClass end def case\_test elem case elem.class when Objec…

---

## [Syntax for db count query needed](https://www.ruby-forum.com/t/syntax-for-db-count-query-needed/80538)

<div class="topic-metadata">

**Author:** [@rubyquest](https://www.ruby-forum.com/u/rubyquest)\
**Replies:** 4\
**Last updated:** [December 29, 2006, 10:40am UTC](https://www.ruby-forum.com/t/syntax-for-db-count-query-needed/80538 "2006-12-29T10:40:19Z")

</div>

can any one tell me the controller syntax for db record count? I want to specify this mysql query syntax in controller select count(\*) from tablename where user\_id=7; what is the controller syntax similar to the above…

---

## [Ruby Tidy](https://www.ruby-forum.com/t/ruby-tidy/79812)

<div class="topic-metadata">

**Author:** [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Replies:** 10\
**Last updated:** [December 29, 2006, 10:27am UTC](https://www.ruby-forum.com/t/ruby-tidy/79812 "2006-12-29T10:27:19Z")

</div>

Hi All, I’m trying to get the Ruby Tidy gem installed but I am having problems. I downloaded and installed HTML Tidy from source first, then installed Ruby Tidy from the gem: gem install tidy And it reports that it …

---

## [Re: Ruby extension issue](https://www.ruby-forum.com/t/re-ruby-extension-issue/80586)

<div class="topic-metadata">

**Author:** [@Wim\_Vander\_S](https://www.ruby-forum.com/u/Wim_Vander_S)\
**Replies:** 5\
**Last updated:** [December 29, 2006, 10:15am UTC](https://www.ruby-forum.com/t/re-ruby-extension-issue/80586 "2006-12-29T10:15:17Z")

</div>

I was able to fix the problem by changing my extconf.rb to: require 'mkmf' dir\_config('gamer') have\_library("SDL", "SDL\_Init") have\_header("SDL/SDL.h") pkg\_config("sdl") create\_makefile('gamer') However, I don’t know W…

---

## [RubyGems Beta 0.9.0.8](https://www.ruby-forum.com/t/rubygems-beta-0-9-0-8/80400)

<div class="topic-metadata">

**Author:** [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Replies:** 3\
**Last updated:** [December 29, 2006, 9:21am UTC](https://www.ruby-forum.com/t/rubygems-beta-0-9-0-8/80400 "2006-12-29T09:21:11Z")

</div>

Beta version 0.9.0.8 is now available with: gem update --system --source http://onestepback.org/betagems Merry christmas from the RubyGems project! = Upgrade note While require\_gem was deprecated in 0.9.0, the bin st…

---

## [Rubygems install problems (the old ubygems (LoadError) probl](https://www.ruby-forum.com/t/rubygems-install-problems-the-old-ubygems-loaderror-probl/80596)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 6\
**Last updated:** [December 29, 2006, 5:59am UTC](https://www.ruby-forum.com/t/rubygems-install-problems-the-old-ubygems-loaderror-probl/80596 "2006-12-29T05:59:00Z")

</div>

Hello, I just did a complete re-install of ruby 1.8.5-p12 and rubygems-0.9.0 and I’m getting the old sawhorse error: ruby: no such file to load – ubygems (LoadError) I’ve searched the newsgroup, but nothing seems to…

---

## [Wrap text in rmagick](https://www.ruby-forum.com/t/wrap-text-in-rmagick/80584)

<div class="topic-metadata">

**Author:** [@otown](https://www.ruby-forum.com/u/otown)\
**Replies:** 1\
**Last updated:** [December 29, 2006, 4:00am UTC](https://www.ruby-forum.com/t/wrap-text-in-rmagick/80584 "2006-12-29T04:00:45Z")

</div>

Anyone know how to wrap text with rmagick using the annotate method? I found the Image.read(“caption:my text”) method - but I’d like to be able to use the annotate method… thanks!

---

## [Newbie: Looking for help rounding numbers](https://www.ruby-forum.com/t/newbie-looking-for-help-rounding-numbers/80594)

<div class="topic-metadata">

**Author:** [@jasonb](https://www.ruby-forum.com/u/jasonb)\
**Replies:** 5\
**Last updated:** [December 29, 2006, 3:56am UTC](https://www.ruby-forum.com/t/newbie-looking-for-help-rounding-numbers/80594 "2006-12-29T03:56:44Z")

</div>

I can’t figure out how to round my answer from this short code that I wrote. I was trying to use both ‘format’ and ‘round’ with no luck… Thank you all in advance!!! Code: puts “Fahrenheit to Centigrade Conversion” …

---

## [Dhaka 0.0.5 bugfix](https://www.ruby-forum.com/t/dhaka-0-0-5-bugfix/79445)

<div class="topic-metadata">

**Author:** [@Mushfeq\_K](https://www.ruby-forum.com/u/Mushfeq_K)\
**Replies:** 8\
**Last updated:** [December 29, 2006, 3:30am UTC](https://www.ruby-forum.com/t/dhaka-0-0-5-bugfix/79445 "2006-12-29T03:30:38Z")

</div>

This version of the Dhaka gem fixes two bugs in the handling of grammars that use precedence hints: Production precedences were sometimes not being calculated correctly because of the grammar not being fully loaded a…

---

## [ActionMailer view overwriting ActionController view?](https://www.ruby-forum.com/t/actionmailer-view-overwriting-actioncontroller-view/80600)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [December 29, 2006, 2:18am UTC](https://www.ruby-forum.com/t/actionmailer-view-overwriting-actioncontroller-view/80600 "2006-12-29T02:18:24Z")

</div>

Hi All, I’m having a bizarre problem. I have a page that let’s you share a link from the current page with other users. You can share with other users of the site (by selecting them from your list of friends) or ar…

---

## [Fwd: Ruby 1.8.5-p2 Stable Version download bug-fix confusion](https://www.ruby-forum.com/t/fwd-ruby-1-8-5-p2-stable-version-download-bug-fix-confusion/80595)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 1\
**Last updated:** [December 29, 2006, 1:30am UTC](https://www.ruby-forum.com/t/fwd-ruby-1-8-5-p2-stable-version-download-bug-fix-confusion/80595 "2006-12-29T01:30:12Z")

</div>

The following is a complaint we received about the Ruby home page today. Could some kind core maintainer please explain what’s going on here? I’m happy to fix our link on the site if it is broken, though it does seem …

---

## [Telling gems where to install](https://www.ruby-forum.com/t/telling-gems-where-to-install/80574)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [December 29, 2006, 12:46am UTC](https://www.ruby-forum.com/t/telling-gems-where-to-install/80574 "2006-12-29T00:46:05Z")

</div>

hi - gems is great but it kind of hides the code. id like to download certain gems and customize/build on them. is there a way to tell a gem to install to a particular directory? and if an app is built on a gem, to t…

---

## [Reading .jar files](https://www.ruby-forum.com/t/reading-jar-files/80576)

<div class="topic-metadata">

**Author:** [@markcasio](https://www.ruby-forum.com/u/markcasio)\
**Replies:** 2\
**Last updated:** [December 28, 2006, 11:45pm UTC](https://www.ruby-forum.com/t/reading-jar-files/80576 "2006-12-28T23:45:59Z")

</div>

How can I read the entries in a Java .jar file from Ruby? I tried the standard library Zlib, but that doesn’t work … I think because .jar files use the zip format instead of the gzip format. I tried the rubyzip librar…

---

## [Wrap text with annotate](https://www.ruby-forum.com/t/wrap-text-with-annotate/80580)

<div class="topic-metadata">

**Author:** [@otown](https://www.ruby-forum.com/u/otown)\
**Replies:** 1\
**Last updated:** [December 28, 2006, 11:33pm UTC](https://www.ruby-forum.com/t/wrap-text-with-annotate/80580 "2006-12-28T23:33:56Z")

</div>

Anyone know how to wrap text using the annotate method?

---

## [Last reminder: MountainWest RubyConf Call For Presenters](https://www.ruby-forum.com/t/last-reminder-mountainwest-rubyconf-call-for-presenters/80549)

<div class="topic-metadata">

**Author:** [@pat\_eyler](https://www.ruby-forum.com/u/pat_eyler)\
**Replies:** 10\
**Last updated:** [December 28, 2006, 10:49pm UTC](https://www.ruby-forum.com/t/last-reminder-mountainwest-rubyconf-call-for-presenters/80549 "2006-12-28T22:49:52Z")

</div>

The window for presentation submissions is almost closed. We’ve gotten a number of submissions, but we’re still looking for a few more. If you’ve got something you’d like to talk about, and can come to Salt Lake City…

---

## [Ruby extension issue](https://www.ruby-forum.com/t/ruby-extension-issue/80583)

<div class="topic-metadata">

**Author:** [@Wim\_Vander\_S](https://www.ruby-forum.com/u/Wim_Vander_S)\
**Replies:** 0\
**Last updated:** [December 28, 2006, 10:15pm UTC](https://www.ruby-forum.com/t/ruby-extension-issue/80583 "2006-12-28T22:15:47Z")

</div>

Hi, I am playing around with building ruby extensions in C but I have a problem. I’m trying to make some bindings to SDL, and everything compiles fine, but when I load the extension in IRB, I get the following: irb(…

---

## [London Ruby User Group (LRUG), 8 January 2007 - Pub Quiz](https://www.ruby-forum.com/t/london-ruby-user-group-lrug-8-january-2007-pub-quiz/80582)

<div class="topic-metadata">

**Author:** [@Murray\_S](https://www.ruby-forum.com/u/Murray_S)\
**Replies:** 0\
**Last updated:** [December 28, 2006, 10:15pm UTC](https://www.ruby-forum.com/t/london-ruby-user-group-lrug-8-january-2007-pub-quiz/80582 "2006-12-28T22:15:46Z")

</div>

Hi all, The next London Ruby U. Group (LRUG) meeting is on 8th January, 2007. Instead of the usual presentation based format we’re having a pub quiz instead as an attempt to extend the festive period by a week or so. …

---

## ['gets' OS commands?](https://www.ruby-forum.com/t/gets-os-commands/80570)

<div class="topic-metadata">

**Author:** [@woodyee](https://www.ruby-forum.com/u/woodyee)\
**Replies:** 1\
**Last updated:** [December 28, 2006, 9:47pm UTC](https://www.ruby-forum.com/t/gets-os-commands/80570 "2006-12-28T21:47:43Z")

</div>

Hi! I’m creating a little program for myself: Have user enter a directory in Windows (ex., C:\\ or C:\\Windows, etc) Have the user search the directory for .txt files Have user pick a file to read I’m stuck at #1! Yikes! …

---

## ['gets' OS commands?](https://www.ruby-forum.com/t/gets-os-commands/102630)

<div class="topic-metadata">

**Author:** [@woodyee](https://www.ruby-forum.com/u/woodyee)\
**Replies:** 1\
**Last updated:** [December 28, 2006, 8:01pm UTC](https://www.ruby-forum.com/t/gets-os-commands/102630 "2006-12-28T20:01:25Z")

</div>

Hi! I’m creating a little program for myself: Have user enter a directory in Windows (ex., C:\\ or C:\\Windows, etc) Have the user search the directory for .txt files Have user pick a file to read I’m stuck at #1! Yikes! …

---

## [Range index](https://www.ruby-forum.com/t/range-index/80533)

<div class="topic-metadata">

**Author:** [@Josselin](https://www.ruby-forum.com/u/Josselin)\
**Replies:** 3\
**Last updated:** [December 28, 2006, 7:35pm UTC](https://www.ruby-forum.com/t/range-index/80533 "2006-12-28T19:35:20Z")

</div>

is there any dry way to get the index of an element in a range without converting the range into an array ? (“A”…“Z”).each do | alpha | -\> puts alpha.index (?) or something like that … \<- end

---

## [Missoula Ruby/Rails Group, Januray Ruby Tuesday Gathering](https://www.ruby-forum.com/t/missoula-ruby-rails-group-januray-ruby-tuesday-gathering/80561)

<div class="topic-metadata">

**Author:** [@jonlog](https://www.ruby-forum.com/u/jonlog)\
**Replies:** 0\
**Last updated:** [December 28, 2006, 6:00pm UTC](https://www.ruby-forum.com/t/missoula-ruby-rails-group-januray-ruby-tuesday-gathering/80561 "2006-12-28T18:00:47Z")

</div>

The first Ruby Tuesday gathering for 2007 of the Missoula Ruby & Ruby on Rails Group will be January 2nd. (Note that’s the evening of the first workday after the long weekend. It’ll feel very much like Monday, but it’…

---

## [Problems with fcgi/ruby - "incomplete headers"](https://www.ruby-forum.com/t/problems-with-fcgi-ruby-incomplete-headers/80534)

<div class="topic-metadata">

**Author:** [@Tiago\_Cruz](https://www.ruby-forum.com/u/Tiago_Cruz)\
**Replies:** 2\
**Last updated:** [December 28, 2006, 5:46pm UTC](https://www.ruby-forum.com/t/problems-with-fcgi-ruby-incomplete-headers/80534 "2006-12-28T17:46:41Z")

</div>

Hello guys, I’m newbie on ruby world, and I hope understood this program soon :wink: The error on log is “FastCGI: incomplete headers (0 bytes) received from server” and all the places that I read says this like one p…

---

## [Re: where does song.name come from?](https://www.ruby-forum.com/t/re-where-does-song-name-come-from/80557)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 0\
**Last updated:** [December 28, 2006, 5:40pm UTC](https://www.ruby-forum.com/t/re-where-does-song-name-come-from/80557 "2006-12-28T17:40:39Z")

</div>

From: Li Chen The methods about class Song are everywhere on different pages. Sometimes I get lost. I think it would be nice if somewhere in the book(such as appendix) class Song and all its methods are put together…

---

## [Sorting an NArray](https://www.ruby-forum.com/t/sorting-an-narray/80548)

<div class="topic-metadata">

**Author:** [@mekondelta](https://www.ruby-forum.com/u/mekondelta)\
**Replies:** 1\
**Last updated:** [December 28, 2006, 5:36pm UTC](https://www.ruby-forum.com/t/sorting-an-narray/80548 "2006-12-28T17:36:37Z")

</div>

I have a 2 dimensional array using NArray and wish to sort the values based on the values in column zero or row zero. How can I achieve this using NArray? I can’t even seem to get the basic sort working:- matrix.so…

---

## [Parsing a CSV file having multiple records in RUBY](https://www.ruby-forum.com/t/parsing-a-csv-file-having-multiple-records-in-ruby/80409)

<div class="topic-metadata">

**Author:** [@mundrakrishna](https://www.ruby-forum.com/u/mundrakrishna)\
**Replies:** 2\
**Last updated:** [December 28, 2006, 4:38pm UTC](https://www.ruby-forum.com/t/parsing-a-csv-file-having-multiple-records-in-ruby/80409 "2006-12-28T16:38:36Z")

</div>

Hi everyone, Can anyone help me in parsing a CSV file,with comma seperated multiple records (multiple columns and multiple rows)… Can anyone solve my problem,Its urgent

---

## [Strip is not stripping trailing whitespace](https://www.ruby-forum.com/t/strip-is-not-stripping-trailing-whitespace/80524)

<div class="topic-metadata">

**Author:** [@taylorstrait](https://www.ruby-forum.com/u/taylorstrait)\
**Replies:** 13\
**Last updated:** [December 28, 2006, 4:24pm UTC](https://www.ruby-forum.com/t/strip-is-not-stripping-trailing-whitespace/80524 "2006-12-28T16:24:14Z")

</div>

I have files with city names which have one or two trailing whitespaces: Adelanto \<- Agoura Hills \<- Alameda \<- Albany \<- Alhambra \<- Aliso Viejo \<- My method just iterates and strips! def trim(state) diskf…

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

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