# Ruby

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

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

---

## [Is there a better way to write { yield }](https://www.ruby-forum.com/t/is-there-a-better-way-to-write-yield/138200)

<div class="topic-metadata">

**Author:** [@stephanwehner](https://www.ruby-forum.com/u/stephanwehner)\
**Replies:** 2\
**Last updated:** [May 21, 2008, 5:29am UTC](https://www.ruby-forum.com/t/is-there-a-better-way-to-write-yield/138200 "2008-05-21T05:29:45Z")

</div>

Is there a better way to write something like def meth(a,b,c) : : other\_meth(d) { yield } : : end That { yield } has some redundancy. Thanks Stephan

---

## [13 lines of confusion](https://www.ruby-forum.com/t/13-lines-of-confusion/138212)

<div class="topic-metadata">

**Author:** [@Michael\_TSRichter](https://www.ruby-forum.com/u/Michael_TSRichter)\
**Replies:** 3\
**Last updated:** [May 21, 2008, 5:15am UTC](https://www.ruby-forum.com/t/13-lines-of-confusion/138212 "2008-05-21T05:15:42Z")

</div>

I can’t for the life of me figure out why the following code makes Ruby puke when I try to execute it: module Rlang module Error class RlangException \< Exception ; end end module Utility …

---

## [1 \<\< 2.71](https://www.ruby-forum.com/t/1-2-71/138158)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 2\
**Last updated:** [May 21, 2008, 4:59am UTC](https://www.ruby-forum.com/t/1-2-71/138158 "2008-05-21T04:59:20Z")

</div>

1 e$B$re(B 2.71 bit e$B$\[$I:8%7%U%H$9$k$He(B 4 e$B$K$J$k$h$&$G$9$,!"$3$l$Oe(B e$B0U?^$5$l$?7k2L$G$7$g$&$+!#e(B % ./ruby -ve ‘p 1 \<\< 2.71’ ruby 1.9.0 (2008-05-20 revision 16494) \[i686-linux\] 4

---

## [Using a @@class\_variable into a Module](https://www.ruby-forum.com/t/using-a-class-variable-into-a-module/138005)

<div class="topic-metadata">

**Author:** [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Replies:** 2\
**Last updated:** [May 21, 2008, 4:44am UTC](https://www.ruby-forum.com/t/using-a-class-variable-into-a-module/138005 "2008-05-21T04:44:43Z")

</div>

Hi, I want to declare a @@class\_variable in class A. Class A includes a Module M and I want some methods in M using the @@class\_variable but I get some problem: module M def kk #puts (eval %{ #{send(‘class’).class\_…

---

## [Benchmark result of reverse\_complement](https://www.ruby-forum.com/t/benchmark-result-of-reverse-complement/137999)

<div class="topic-metadata">

**Author:** [@SASADA\_Koichi](https://www.ruby-forum.com/u/SASADA_Koichi)\
**Replies:** 4\
**Last updated:** [May 21, 2008, 4:05am UTC](https://www.ruby-forum.com/t/benchmark-result-of-reverse-complement/137999 "2008-05-21T04:05:28Z")

</div>

e$B!!$5$5$@$G$9!%e(B e$B!!%Y%s%A%^!\<%/$r$H$C$F$$$F!$$A$g$C$H5$$K$J$C$?7k2L$,$"$C$?$N$GJs9p$7e(B e$B$^$9!%e(B e$B!!e(Btrunk/benchmark/bm\_so\_reverse\_complement.rb e$B$H$$$&%F%9%H$G$9$,!$\<Be(B e$B$Ke(B ruby 1.8.5 e$B$h…

---

## [This Week in Ruby (May 20, 2008)](https://www.ruby-forum.com/t/this-week-in-ruby-may-20-2008/138198)

<div class="topic-metadata">

**Author:** [@visitor1981](https://www.ruby-forum.com/u/visitor1981)\
**Replies:** 0\
**Last updated:** [May 21, 2008, 12:41am UTC](https://www.ruby-forum.com/t/this-week-in-ruby-may-20-2008/138198 "2008-05-21T00:41:06Z")

</div>

Hi all, here you can find the 8th edition of “This Week in Ruby”: Cheers, Antonio

---

## [Code Review: events](https://www.ruby-forum.com/t/code-review-events/138196)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 0\
**Last updated:** [May 21, 2008, 12:27am UTC](https://www.ruby-forum.com/t/code-review-events/138196 "2008-05-21T00:27:02Z")

</div>

tfpt review /shelveset:events;REDMOND\\tomat Reviewed F2F with John. Implements Module#method\_added, method\_removed, method\_undefined. Pulls non-built-in libraries out of built-ins. Fixes bug #20206: ResolveSourceUnit…

---

## [Ruby and XSLT](https://www.ruby-forum.com/t/ruby-and-xslt/78863)

<div class="topic-metadata">

**Author:** [@Derek\_Mahar](https://www.ruby-forum.com/u/Derek_Mahar)\
**Replies:** 8\
**Last updated:** [May 21, 2008, 12:18am UTC](https://www.ruby-forum.com/t/ruby-and-xslt/78863 "2008-05-21T00:18:07Z")

</div>

What Ruby libraries are available to parse and process XSLT? How does each of these libraries compare to Apache Xalan for Java? Derek

---

## [Is it possible for rubyzip to return zipped data instead of writing it to the disk?](https://www.ruby-forum.com/t/is-it-possible-for-rubyzip-to-return-zipped-data-instead-of-writing-it-to-the-disk/138189)

<div class="topic-metadata">

**Author:** [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Replies:** 2\
**Last updated:** [May 21, 2008, 12:12am UTC](https://www.ruby-forum.com/t/is-it-possible-for-rubyzip-to-return-zipped-data-instead-of-writing-it-to-the-disk/138189 "2008-05-21T00:12:23Z")

</div>

Hi, I got simple Rails app and I’d like to compress xml data and send it to the browser. I’m trying to use rubyzip for it, but i.e. the following usage: Zip::ZipFile.open(“file.zip”, Zip::ZipFile::CREATE) do |zip| z…

---

## [VALUE rb\_enc\_associate(VALUE obj, rb\_encoding \*enc)](https://www.ruby-forum.com/t/value-rb-enc-associate-value-obj-rb-encoding-enc/138180)

<div class="topic-metadata">

**Author:** [@NARUSES\_Yui](https://www.ruby-forum.com/u/NARUSES_Yui)\
**Replies:** 1\
**Last updated:** [May 21, 2008, 12:11am UTC](https://www.ruby-forum.com/t/value-rb-enc-associate-value-obj-rb-encoding-enc/138180 "2008-05-21T00:11:13Z")

</div>

e$B@.@%$G$9!#e(B e$B8=:\_e(B rb\_enc\_associate() e$B$O!"e(B void rb\_enc\_associate(VALUE obj, rb\_encoding \*enc) e$B$H$$$&Dj5A$K$J$C$F$$$^$9!#e(B e$B$3$l$@$H!"e(Bobject e$B$r:n$C$F$=$l$Ke(B encoding e$B$rE,MQ$5$;!"e(B e…

---

## [Arbitrary IO object](https://www.ruby-forum.com/t/arbitrary-io-object/138164)

<div class="topic-metadata">

**Author:** [@danielb](https://www.ruby-forum.com/u/danielb)\
**Replies:** 5\
**Last updated:** [May 20, 2008, 11:35pm UTC](https://www.ruby-forum.com/t/arbitrary-io-object/138164 "2008-05-20T23:35:59Z")

</div>

Hi, How would I go about using IO.new such that it would automatically grab the next available file descriptor? I don’t know the fileno in advance and I can’t use StringIO. What are my options? Thanks, Dan

---

## [Time timezone bug on Ubuntu](https://www.ruby-forum.com/t/time-timezone-bug-on-ubuntu/138177)

<div class="topic-metadata">

**Author:** [@jonbaer](https://www.ruby-forum.com/u/jonbaer)\
**Replies:** 2\
**Last updated:** [May 20, 2008, 11:11pm UTC](https://www.ruby-forum.com/t/time-timezone-bug-on-ubuntu/138177 "2008-05-20T23:11:16Z")

</div>

My apologies for most likely posting this in the wrong place, but after spending 15 minutes, I honestly couldn’t figure out proper procedure for posting a bug. The following code produces different results in cruby an…

---

## [Comparison of Array with Array failed](https://www.ruby-forum.com/t/comparison-of-array-with-array-failed/138131)

<div class="topic-metadata">

**Author:** [@c-note](https://www.ruby-forum.com/u/c-note)\
**Replies:** 1\
**Last updated:** [May 20, 2008, 9:58pm UTC](https://www.ruby-forum.com/t/comparison-of-array-with-array-failed/138131 "2008-05-20T21:58:46Z")

</div>

Hi all, i got this error when the field serial is empty. Showing app/views/find/index.rhtml where line #44 raised: comparison of Array with Array failed Extracted source (around line #44): 41: \<% equipements = E…

---

## [Help me debug my stack trace](https://www.ruby-forum.com/t/help-me-debug-my-stack-trace/138071)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 5\
**Last updated:** [May 20, 2008, 9:51pm UTC](https://www.ruby-forum.com/t/help-me-debug-my-stack-trace/138071 "2008-05-20T21:51:53Z")

</div>

So currently ruby is hung using 100% CPU on my machine. Some questions: does anybody else have this happen to them? does anybody else have a chunk of code that reliably causes ruby to leak memory? Anyway here are so…

---

## [Method as first class member](https://www.ruby-forum.com/t/method-as-first-class-member/138058)

<div class="topic-metadata">

**Author:** [@guoliang](https://www.ruby-forum.com/u/guoliang)\
**Replies:** 7\
**Last updated:** [May 20, 2008, 9:26pm UTC](https://www.ruby-forum.com/t/method-as-first-class-member/138058 "2008-05-20T21:26:17Z")

</div>

Hi, I don’t consider myself a ruby guru but have been a ruby user for a few years. Since ruby 1.9 is out but its feature set is not finalized, guess it’s ok to voice my opinions on what may be interesting to a joe use…

---

## [Debugging a TCPSocket.open timeout](https://www.ruby-forum.com/t/debugging-a-tcpsocket-open-timeout/138169)

<div class="topic-metadata">

**Author:** [@student](https://www.ruby-forum.com/u/student)\
**Replies:** 4\
**Last updated:** [May 20, 2008, 9:17pm UTC](https://www.ruby-forum.com/t/debugging-a-tcpsocket-open-timeout/138169 "2008-05-20T21:17:24Z")

</div>

I’m trying to do an IMAP connection. My first target is gmail: Net::IMAP.new(“imap.gmail.com”, 143) goes walkabout on line 886: TCPSocket.open(“imap.gmail.com”, 143) AT&T swears they are not port blocking. My syste…

---

## [Slide Show (S9) Gem Now Supports Syntax Highlighting and Headers for Gradients, Title, etc](https://www.ruby-forum.com/t/slide-show-s9-gem-now-supports-syntax-highlighting-and-headers-for-gradients-title-etc/137973)

<div class="topic-metadata">

**Author:** [@gerald\_b](https://www.ruby-forum.com/u/gerald_b)\
**Replies:** 1\
**Last updated:** [May 20, 2008, 8:22pm UTC](https://www.ruby-forum.com/t/slide-show-s9-gem-now-supports-syntax-highlighting-and-headers-for-gradients-title-etc/137973 "2008-05-20T20:22:25Z")

</div>

Hello, I’ve published an update to Slide Show (S9) - a Ruby gem that lets you create slide shows and author slides in plain text using a wiki-style markup language that’s easy-to-write and easy-to-read. What’s new? T…

---

## [How is this split method working?](https://www.ruby-forum.com/t/how-is-this-split-method-working/138081)

<div class="topic-metadata">

**Author:** [@dorelal](https://www.ruby-forum.com/u/dorelal)\
**Replies:** 7\
**Last updated:** [May 20, 2008, 8:07pm UTC](https://www.ruby-forum.com/t/how-is-this-split-method-working/138081 "2008-05-20T20:07:23Z")

</div>

length = 20 text = ’ This forum is connected to a mailing list that is read by thousands of people.’ text.split\[0…length\] I looked at the split api but can’t understand how the above code is working.

---

## [Extension of zlib](https://www.ruby-forum.com/t/extension-of-zlib/138152)

<div class="topic-metadata">

**Author:** [@robkuz](https://www.ruby-forum.com/u/robkuz)\
**Replies:** 2\
**Last updated:** [May 20, 2008, 7:27pm UTC](https://www.ruby-forum.com/t/extension-of-zlib/138152 "2008-05-20T19:27:35Z")

</div>

Hi, does anybody else think this (or something similar) would be a useful extension to zlib? file zliba.rb: require ‘zlib’ Conveniently process a number of files that may be a mixture of gzip compressed and uncompre…

---

## [How to serialize hash to a file?](https://www.ruby-forum.com/t/how-to-serialize-hash-to-a-file/138098)

<div class="topic-metadata">

**Author:** [@hurcan\_solter](https://www.ruby-forum.com/u/hurcan_solter)\
**Replies:** 4\
**Last updated:** [May 20, 2008, 6:04pm UTC](https://www.ruby-forum.com/t/how-to-serialize-hash-to-a-file/138098 "2008-05-20T18:04:28Z")

</div>

i have an xml file that goes like; at some point i need the look up the data type for different attributes. I can get the data type using a Xpath query in the form using REXML node = $fom\_file.elements\["//attribu…

---

## [foxGUIb 1.0.0](https://www.ruby-forum.com/t/foxguib-1-0-0/138047)

<div class="topic-metadata">

**Author:** [@Meinrad\_R](https://www.ruby-forum.com/u/Meinrad_R)\
**Replies:** 2\
**Last updated:** [May 20, 2008, 5:33pm UTC](https://www.ruby-forum.com/t/foxguib-1-0-0/138047 "2008-05-20T17:33:36Z")

</div>

Dear fellow (fx)rubyists, I finally found the time to release another version of foxGUIb. It includes a handfull of minor bug fixes that have happened in the past 2 years since the last release. Hope you appreciate i…

---

## [At InfoQ: Interview about FXRuby, plus an exclusive chapter from the FXRuby Book](https://www.ruby-forum.com/t/at-infoq-interview-about-fxruby-plus-an-exclusive-chapter-from-the-fxruby-book/138146)

<div class="topic-metadata">

**Author:** [@Lyle\_J](https://www.ruby-forum.com/u/Lyle_J)\
**Replies:** 0\
**Last updated:** [May 20, 2008, 4:33pm UTC](https://www.ruby-forum.com/t/at-infoq-interview-about-fxruby-plus-an-exclusive-chapter-from-the-fxruby-book/138146 "2008-05-20T16:33:31Z")

</div>

InfoQ has just published Werner Schuster’s interview with me, in which we discuss the FOX toolkit and FXRuby’s implementation: http://www.infoq.com/articles/johnson-fxruby-book-excerpt The article also includes an exc…

---

## [\[ANN\] image\_voodoo 0.2 released](https://www.ruby-forum.com/t/ann-image-voodoo-0-2-released/138145)

<div class="topic-metadata">

**Author:** [@Thomas\_E\_Enebo](https://www.ruby-forum.com/u/Thomas_E_Enebo)\
**Replies:** 0\
**Last updated:** [May 20, 2008, 4:26pm UTC](https://www.ruby-forum.com/t/ann-image-voodoo-0-2-released/138145 "2008-05-20T16:26:15Z")

</div>

JRuby-extras sub-project image\_voodoo is now 0.2. Installation: gem install image\_voodoo This release has added several new features: adust\_brightness negative from\_url It also fixed a bug where greyscale would not…

---

## [Displaying data](https://www.ruby-forum.com/t/displaying-data/138134)

<div class="topic-metadata">

**Author:** [@twaters](https://www.ruby-forum.com/u/twaters)\
**Replies:** 4\
**Last updated:** [May 20, 2008, 3:41pm UTC](https://www.ruby-forum.com/t/displaying-data/138134 "2008-05-20T15:41:05Z")

</div>

I am getting data from three hashes and am trying to arrange them in four columns, however after I print out the first hash there is a new line return. How do you remove the new line? Thanks in advance, Tim def for…

---

## [N00b question](https://www.ruby-forum.com/t/n00b-question/138022)

<div class="topic-metadata">

**Author:** [@mileschatterji](https://www.ruby-forum.com/u/mileschatterji)\
**Replies:** 5\
**Last updated:** [May 20, 2008, 3:27pm UTC](https://www.ruby-forum.com/t/n00b-question/138022 "2008-05-20T15:27:15Z")

</div>

somewhat new to ruby, and im trying to write a simple program to print and I would like the program to list the next one as and so on, this is what I have so far, I am just having trouble getting it add +1 to th…

---

## [Thread#priority= does not work](https://www.ruby-forum.com/t/thread-priority-does-not-work/126109)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 2\
**Last updated:** [May 20, 2008, 3:22pm UTC](https://www.ruby-forum.com/t/thread-priority-does-not-work/126109 "2008-05-20T15:22:03Z")

</div>

e$B1sF#$H?=$7$^$9!#e(B Thread#priority= e$B$K$h$kM%@hEY$N@\_Dj$,$G$-$J$$$h$&$G$9!#e(B e$B0J2\<$Oe(B Thread#priority= e$B$N%3%a%s%H$K=q$$$F$"$k%5%s%W%k%3!\<%I$G$9$,!"e(B e$B%3%a%s%H$NDL$j$KF0$-$^$;$s!#e(B $ ./ruby -ve ’ …

---

## [Why is Array#to\_f not defined?](https://www.ruby-forum.com/t/why-is-array-to-f-not-defined/138110)

<div class="topic-metadata">

**Author:** [@Fredrik](https://www.ruby-forum.com/u/Fredrik)\
**Replies:** 6\
**Last updated:** [May 20, 2008, 3:20pm UTC](https://www.ruby-forum.com/t/why-is-array-to-f-not-defined/138110 "2008-05-20T15:20:17Z")

</div>

Ruby (1.8.6) seems to be missing numeric conversion methods for Arrays : class Array def to\_f self.map { |i| i.to\_f } end end (and the same for to\_i) Did somebody forget to include that? :slight\_smile: Surely the…

---

## [Ruby 1.8.7-preview3 has been released](https://www.ruby-forum.com/t/ruby-1-8-7-preview3-has-been-released/137965)

<div class="topic-metadata">

**Author:** [@Akinori\_MUSHA](https://www.ruby-forum.com/u/Akinori_MUSHA)\
**Replies:** 13\
**Last updated:** [May 20, 2008, 3:02pm UTC](https://www.ruby-forum.com/t/ruby-1-8-7-preview3-has-been-released/137965 "2008-05-20T15:02:59Z")

</div>

ã€€Ruby 1.8.7-preview3 ã‚’ãƒªãƒªãƒ¼ã‚¹ã—ã¾ã—ãŸã€‚ ã€€ã‚»ã‚­ãƒ¥ãƒªãƒ†ã‚£è„†å¼±æ€§ã‚„äº’æ›æ€§ã®å•é¡Œã‚’å«ã‚ã€ preview2 ä»¥é™ã«æŒ‡æ‘˜ ã•ã‚ŒãŸå¤šæ•°ã®å•é¡ŒãŒä¿®æ­£ã•ã‚Œã¾ã—ãŸã€‚ä¿®æ­£ã•ã‚ŒãŸ Symbol#t…

---

## [About writing file?](https://www.ruby-forum.com/t/about-writing-file/137434)

<div class="topic-metadata">

**Author:** [@blitzer](https://www.ruby-forum.com/u/blitzer)\
**Replies:** 7\
**Last updated:** [May 20, 2008, 2:19pm UTC](https://www.ruby-forum.com/t/about-writing-file/137434 "2008-05-20T14:19:40Z")

</div>

hi, I have problem about writing file. I use this data = File.new("/options.sav",“w”) and I get file name option.sav in my path but when I open it with notepad. It can modify :’( I don’t want this because options.sav…

---

## [Problems with error output interpretation](https://www.ruby-forum.com/t/problems-with-error-output-interpretation/138002)

<div class="topic-metadata">

**Author:** [@tbcox23](https://www.ruby-forum.com/u/tbcox23)\
**Replies:** 2\
**Last updated:** [May 20, 2008, 1:23pm UTC](https://www.ruby-forum.com/t/problems-with-error-output-interpretation/138002 "2008-05-20T13:23:11Z")

</div>

I hope this is an OK place to post this. I’ve been able to find another more promising place. I’m running an extremely simple program, trying to start using the Hpricot gem. I don’t understand two things with some err…

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

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