# Ruby

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

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

---

## [Inits.c confused me](https://www.ruby-forum.com/t/inits-c-confused-me/148911)

<div class="topic-metadata">

**Author:** [@limux](https://www.ruby-forum.com/u/limux)\
**Replies:** 7\
**Last updated:** [September 22, 2008, 4:28am UTC](https://www.ruby-forum.com/t/inits-c-confused-me/148911 "2008-09-22T04:28:12Z")

</div>

i am reading the ruby source, but the follow inits.c confused me. please give some advices, thanks! what’s meaning of the “Init\_Array \_((void));”? is it a funtion declare or a macro? /\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*…

---

## [Iterating through a string](https://www.ruby-forum.com/t/iterating-through-a-string/149157)

<div class="topic-metadata">

**Author:** [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Replies:** 9\
**Last updated:** [September 22, 2008, 3:52am UTC](https://www.ruby-forum.com/t/iterating-through-a-string/149157 "2008-09-22T03:52:34Z")

</div>

If I try the following… “I love guitar playing”.split {|s| s.capitalize}.join(" ") I would expect it to capitalize the first letter of each word but it doesn’t seem to work. Any hints on what I’m doing incorrectly?

---

## [Instance variable acting like class variable?](https://www.ruby-forum.com/t/instance-variable-acting-like-class-variable/149152)

<div class="topic-metadata">

**Author:** [@cobra050](https://www.ruby-forum.com/u/cobra050)\
**Replies:** 4\
**Last updated:** [September 22, 2008, 12:08am UTC](https://www.ruby-forum.com/t/instance-variable-acting-like-class-variable/149152 "2008-09-22T00:08:33Z")

</div>

I’ve written a Node class that I’m using to write a few programs for in a course. class Node A node represents a spot on the grid. It knows its location and parent node, the total cost so far, and the directions take …

---

## [Regular Expression '\\Z?'](https://www.ruby-forum.com/t/regular-expression-z/149142)

<div class="topic-metadata">

**Author:** [@Hirotsugu\_A](https://www.ruby-forum.com/u/Hirotsugu_A)\
**Replies:** 1\
**Last updated:** [September 22, 2008, 12:03am UTC](https://www.ruby-forum.com/t/regular-expression-z/149142 "2008-09-22T00:03:16Z")

</div>

Apparently this pattern works in MRI 1.8.6, but not in MRI trunk or JRuby 1.1.4. Should JRuby behave like MRI 1.8.6? $ cat regex.rb puts “a” =~ /(.)\\Z?/ $ ruby -v regex.rb ruby 1.8.6 (2008-03-03 patchlevel 114) \[un…

---

## [Iterating methods on multiple parameters](https://www.ruby-forum.com/t/iterating-methods-on-multiple-parameters/149107)

<div class="topic-metadata">

**Author:** [@leveille](https://www.ruby-forum.com/u/leveille)\
**Replies:** 8\
**Last updated:** [September 21, 2008, 10:36pm UTC](https://www.ruby-forum.com/t/iterating-methods-on-multiple-parameters/149107 "2008-09-21T22:36:38Z")

</div>

I’m thinking there must be a great Ruby-way to do the same thing to many different variables. Here is a boiled down version of what I have: @yn = Unit.new("#{@yn} feet") @yc = Unit.new("#{yc} feet") @v = Un…

---

## [Explaination of a bit of code](https://www.ruby-forum.com/t/explaination-of-a-bit-of-code/149122)

<div class="topic-metadata">

**Author:** [@paradise](https://www.ruby-forum.com/u/paradise)\
**Replies:** 6\
**Last updated:** [September 21, 2008, 10:01pm UTC](https://www.ruby-forum.com/t/explaination-of-a-bit-of-code/149122 "2008-09-21T22:01:48Z")

</div>

Hey, another question. This is kinda putting several concepts together that i understand but the code is throwing me for some reason: class Periods def each yield “Classical” yield “Jazz” yield “Rock” end end p…

---

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

<div class="topic-metadata">

**Author:** [@caiwangqin](https://www.ruby-forum.com/u/caiwangqin)\
**Replies:** 3\
**Last updated:** [September 21, 2008, 8:59pm UTC](https://www.ruby-forum.com/t/comparison-of-array-with-array-failed/229165 "2008-09-21T20:59:41Z")

</div>

I am passing this hash to a method to sort it, which works in irb but in rails I can’t get past it report = { :cals =\> @total\_cals, :fat =\> @dv\_fat, :sfat =\> @dv\_sfat, :carbs =\> @dv\_carbs, :chol =\> @dv\_chol, :sod…

---

## [Help with MacRuby and NSError\*\* args](https://www.ruby-forum.com/t/help-with-macruby-and-nserror-args/149140)

<div class="topic-metadata">

**Author:** [@has](https://www.ruby-forum.com/u/has)\
**Replies:** 0\
**Last updated:** [September 21, 2008, 3:19pm UTC](https://www.ruby-forum.com/t/help-with-macruby-and-nserror-args/149140 "2008-09-21T15:19:22Z")

</div>

Hi all, Wondering how to get an NSError instance back from an ObjC method, in this case -\[QTMovie initWithFile:error:\], in MacRuby: #!/usr/local/bin/macruby framework 'QTKit' movie = QTMovie.alloc.initWithFile('/Use…

---

## [Question about multi-demension hash initialization](https://www.ruby-forum.com/t/question-about-multi-demension-hash-initialization/149051)

<div class="topic-metadata">

**Author:** [@rubina](https://www.ruby-forum.com/u/rubina)\
**Replies:** 4\
**Last updated:** [September 21, 2008, 1:05pm UTC](https://www.ruby-forum.com/t/question-about-multi-demension-hash-initialization/149051 "2008-09-21T13:05:39Z")

</div>

Team, Is there a quick (perhaps one liner) way to initialize the following hashes into just one hash? def xwing(ia) p ia puts " " p @xwing r1 = {“1” =\> 0, “2” =\> 0, “3” =\> 0, “4” =\> 0, “5” =\> 0, “6” =\> 0, “7” =\> …

---

## [Practical JRUby on Rails book](https://www.ruby-forum.com/t/practical-jruby-on-rails-book/149136)

<div class="topic-metadata">

**Author:** [@eipipuz](https://www.ruby-forum.com/u/eipipuz)\
**Replies:** 1\
**Last updated:** [September 21, 2008, 12:46pm UTC](https://www.ruby-forum.com/t/practical-jruby-on-rails-book/149136 "2008-09-21T12:46:54Z")

</div>

Hello guys, I’ve seen in Amazon this book Practical JRuby and Rails and I was wondering what version of jruby and what version of rails covers. I could not find it in the web. Does anybody know the book? Thanks, GA …

---

## [\[Ruby 1.9 - Bug #407\] (Open) String#\<\<](https://www.ruby-forum.com/t/ruby-1-9-bug-407-open-string/145202)

<div class="topic-metadata">

**Author:** [@Shyouhei\_U](https://www.ruby-forum.com/u/Shyouhei_U)\
**Replies:** 12\
**Last updated:** [September 21, 2008, 10:08am UTC](https://www.ruby-forum.com/t/ruby-1-9-bug-407-open-string/145202 "2008-09-21T10:08:43Z")

</div>

e$B%A%1%C%He(B #407 e$B$,Js9p$5$l$^$7$?!#e(B (by Shyouhei U.) Bug #407: String#\<\< http://redmine.ruby-lang.org/issues/show/407 e$B5/I\<\<Te(B: Shyouhei U. e$B%9%F!\<%?%9e(B: Open e$BM%@hEYe(B: Normal e$BC4Ev\<Te(B: Yu…

---

## [Terminator 0.4.4](https://www.ruby-forum.com/t/terminator-0-4-4/149128)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 0\
**Last updated:** [September 21, 2008, 3:50am UTC](https://www.ruby-forum.com/t/terminator-0-4-4/149128 "2008-09-21T03:50:59Z")

</div>

NAME Terminator SYNOPSIS An external timeout mechanism based on processes and signals. Safe for system calls. Safe for minors. but not very safe for misbehaving, downtrodden zombied out processes. CHANGES Majo…

---

## [Mechanize 0.8.0 Released](https://www.ruby-forum.com/t/mechanize-0-8-0-released/149124)

<div class="topic-metadata">

**Author:** [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Replies:** 0\
**Last updated:** [September 21, 2008, 1:29am UTC](https://www.ruby-forum.com/t/mechanize-0-8-0-released/149124 "2008-09-21T01:29:27Z")

</div>

mechanize version 0.8.0 has been released! http://mechanize.rubyforge.org/ http://github.com/tenderlove/mechanize/tree/master The Mechanize library is used for automating interaction with websites. Mechanize automati…

---

## [Complex/image](https://www.ruby-forum.com/t/complex-image/148830)

<div class="topic-metadata">

**Author:** [@Tadayoshi\_F](https://www.ruby-forum.com/u/Tadayoshi_F)\
**Replies:** 15\
**Last updated:** [September 21, 2008, 12:18am UTC](https://www.ruby-forum.com/t/complex-image/148830 "2008-09-21T00:18:40Z")

</div>

\[ruby-math:00543\] e$B$rFI$s$G!“e(Bimage e$B$O$d$a$Fe(B imag e$B$KJQ99$7$?$i$I$&$+!”$De(B e$B$$$G$Ke(B imaginary e$B$NJLL\>$rF3F~$7$?$i$I$&$+!"$H9M$($F$$$^$9!#\<g4Q$G$O!"5ue(B e$BIt$r;X$9$N$K$Oe(B imag e$B$,B?$/$F!"5)$K…

---

## [Why one array continues to grow after repeated call](https://www.ruby-forum.com/t/why-one-array-continues-to-grow-after-repeated-call/148940)

<div class="topic-metadata">

**Author:** [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Replies:** 20\
**Last updated:** [September 20, 2008, 11:51pm UTC](https://www.ruby-forum.com/t/why-one-array-continues-to-grow-after-repeated-call/148940 "2008-09-20T23:51:37Z")

</div>

Hi all, I write a script for studying purpose: create a new array(b1) based on an existing one (a1). I expect that once an array is set up it should be fixed regardless how many times it is called. But I find array b…

---

## [How to detect blocking?](https://www.ruby-forum.com/t/how-to-detect-blocking/148272)

<div class="topic-metadata">

**Author:** [@dgm](https://www.ruby-forum.com/u/dgm)\
**Replies:** 15\
**Last updated:** [September 20, 2008, 8:46pm UTC](https://www.ruby-forum.com/t/how-to-detect-blocking/148272 "2008-09-20T20:46:54Z")

</div>

I’ve been (barely, occasionally) writing an Actor system for Ruby. It was actually pretty easy, when I was doing one thread per actor, but that has some serious drawbacks – among them that threads can’t be garbage co…

---

## [Question about Mixins and calling a method](https://www.ruby-forum.com/t/question-about-mixins-and-calling-a-method/149112)

<div class="topic-metadata">

**Author:** [@caof2005](https://www.ruby-forum.com/u/caof2005)\
**Replies:** 2\
**Last updated:** [September 20, 2008, 8:32pm UTC](https://www.ruby-forum.com/t/question-about-mixins-and-calling-a-method/149112 "2008-09-20T20:32:59Z")

</div>

Hi folks. I tried to reproduce a Mixin example that is include in the Pick Axe book, here’s the code: module Observable def observers @observer\_list ||= \[\] end def add\_observer( obj ) ----??? observers \<\< obj en…

---

## [How to fill out textarea in html form](https://www.ruby-forum.com/t/how-to-fill-out-textarea-in-html-form/149113)

<div class="topic-metadata">

**Author:** [@terrytie](https://www.ruby-forum.com/u/terrytie)\
**Replies:** 0\
**Last updated:** [September 20, 2008, 7:45pm UTC](https://www.ruby-forum.com/t/how-to-fill-out-textarea-in-html-form/149113 "2008-09-20T19:45:01Z")

</div>

Hi, So sorry for this naive question … I’m new to ruby as of several days ago. I’m porting some CGI code from perl and I’m trying to use the Ruby CGI objects to do everything. In one of my forms I’ve got a cgi.textar…

---

## [Cannot access gems](https://www.ruby-forum.com/t/cannot-access-gems/148958)

<div class="topic-metadata">

**Author:** [@tbcox23](https://www.ruby-forum.com/u/tbcox23)\
**Replies:** 5\
**Last updated:** [September 20, 2008, 6:35pm UTC](https://www.ruby-forum.com/t/cannot-access-gems/148958 "2008-09-20T18:35:48Z")

</div>

I seem to have run right into my ignorance again. Working on Kubuntu Linux 8.04.1, I’ve a fresh compile of ruby 1.8.6. Irb runs. I have installed rubygems from the adept package manager - the install produced no error…

---

## [Ncurses Panel userptr issues](https://www.ruby-forum.com/t/ncurses-panel-userptr-issues/149109)

<div class="topic-metadata">

**Author:** [@sentinel](https://www.ruby-forum.com/u/sentinel)\
**Replies:** 0\
**Last updated:** [September 20, 2008, 6:33pm UTC](https://www.ruby-forum.com/t/ncurses-panel-userptr-issues/149109 "2008-09-20T18:33:57Z")

</div>

I am having issues with the userptr in Ncurses Panel. The C program I converted from runs fine on my system. (http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/panels.html - the one that takes tabs to travel through 3 p…

---

## [Question about REXML](https://www.ruby-forum.com/t/question-about-rexml/149055)

<div class="topic-metadata">

**Author:** [@brad](https://www.ruby-forum.com/u/brad)\
**Replies:** 2\
**Last updated:** [September 20, 2008, 5:19pm UTC](https://www.ruby-forum.com/t/question-about-rexml/149055 "2008-09-20T17:19:33Z")

</div>

I’m trying to follow this tutorial: http://www.germane-software.com/software/rexml/docs/tutorial.html When I use the IRB and do: require “rexml/document” include REXML doc = Document.new File.new(“mydoc.xml”) I get…

---

## [Need exceptions in JRuby available in Java code that called it](https://www.ruby-forum.com/t/need-exceptions-in-jruby-available-in-java-code-that-called-it/148779)

<div class="topic-metadata">

**Author:** [@nabblee](https://www.ruby-forum.com/u/nabblee)\
**Replies:** 6\
**Last updated:** [September 20, 2008, 5:03pm UTC](https://www.ruby-forum.com/t/need-exceptions-in-jruby-available-in-java-code-that-called-it/148779 "2008-09-20T17:03:42Z")

</div>

I’ve implemented a DSL in JRuby that I’m making available from a Java method. My Java code has to run in Java 5 (cannot run in Java 6), so I started out using BSF. However, my JRuby exceptions were not making it up …

---

## [Dl taint fixes in Ruby 1.8.7-p72 broke Ruby/Tidy](https://www.ruby-forum.com/t/dl-taint-fixes-in-ruby-1-8-7-p72-broke-ruby-tidy/149106)

<div class="topic-metadata">

**Author:** [@kmeaw](https://www.ruby-forum.com/u/kmeaw)\
**Replies:** 0\
**Last updated:** [September 20, 2008, 4:06pm UTC](https://www.ruby-forum.com/t/dl-taint-fixes-in-ruby-1-8-7-p72-broke-ruby-tidy/149106 "2008-09-20T16:06:18Z")

</div>

Greetings, Since Ruby 1.8.7-p72, I get the following error when using Ruby/Tidy: SecurityError: Insecure operation - call Backtrace: (eval):5:in call' (eval):5:in tidySetErrorBuffer’ /usr/lib/ruby/1.8/tidy/tidylib.r…

---

## [SuperClass and Modules](https://www.ruby-forum.com/t/superclass-and-modules/148804)

<div class="topic-metadata">

**Author:** [@shyl\_ruby](https://www.ruby-forum.com/u/shyl_ruby)\
**Replies:** 5\
**Last updated:** [September 20, 2008, 11:16am UTC](https://www.ruby-forum.com/t/superclass-and-modules/148804 "2008-09-20T11:16:46Z")

</div>

Hi, I am very much new to Ruby Ruby Consider Modules as super classes \[Internally\]. My confusion is that there can be many modules either included or extended to a Ruby class where as only one Parent class is allowed…

---

## [\[ANN\] 1.9 rubyspec$BI|5"(B](https://www.ruby-forum.com/t/ann-1-9-rubyspec-bi-5-b/149084)

<div class="topic-metadata">

**Author:** [@Yugui\_SYuki\_S.S](https://www.ruby-forum.com/u/Yugui_SYuki_S.S)\
**Replies:** 0\
**Last updated:** [September 20, 2008, 4:06am UTC](https://www.ruby-forum.com/t/ann-1-9-rubyspec-bi-5-b/149084 "2008-09-20T04:06:51Z")

</div>

Yuguie$B$G$9!#e(B RubySpece$BK\\2H$,e(BRuby 1.9e$B$Ne(Bspece$B$r;}$C$F$$$J$+$C$?$N$G!“0l;~E\*$Ke(Bcommon.mke$B$re(B e$B=$@5$7$F!”;d$NFH\<+e(Bfork (GitHub - yugui/rubyspec: RSpec-style specification for the Ruby programmi…

---

## [Temporarily removing Precision module](https://www.ruby-forum.com/t/temporarily-removing-precision-module/148844)

<div class="topic-metadata">

**Author:** [@Yugui](https://www.ruby-forum.com/u/Yugui)\
**Replies:** 3\
**Last updated:** [September 20, 2008, 4:02am UTC](https://www.ruby-forum.com/t/temporarily-removing-precision-module/148844 "2008-09-20T04:02:09Z")

</div>

Yuguie$B$G$9!#e(B Precisione$B%b%8%e!\<%k$N:o=|$rDs0F$7$^$9!#$3$N%b%8%e!\<%k$O$b$&\>/$78!F$$NI,MW$,$"$j!"8=\>u$N;EMM$N$^$^e(B1.9e$B7OE}$N8eJ}8\_49@-0\];}$KG{$i$l$k$3$H$OK\>$^$7$/$J$$$+$i$G$9!#e(B e$B$^$:Bh0l$K!“e(BPrecisione$…

---

## [Exposing Rails as Java Class](https://www.ruby-forum.com/t/exposing-rails-as-java-class/148615)

<div class="topic-metadata">

**Author:** [@ADADAD](https://www.ruby-forum.com/u/ADADAD)\
**Replies:** 6\
**Last updated:** [September 20, 2008, 2:32am UTC](https://www.ruby-forum.com/t/exposing-rails-as-java-class/148615 "2008-09-20T02:32:28Z")

</div>

hello, we are looking to integrate with Adobe LiveCycle Dataservices which is basically a java application wrapped up in a WAR. Their application ideally will call java classes directly instead of through a REST ser…

---

## [Is net/imap completed?](https://www.ruby-forum.com/t/is-net-imap-completed/148572)

<div class="topic-metadata">

**Author:** [@Magicloud\_M](https://www.ruby-forum.com/u/Magicloud_M)\
**Replies:** 1\
**Last updated:** [September 20, 2008, 2:16am UTC](https://www.ruby-forum.com/t/is-net-imap-completed/148572 "2008-09-20T02:16:06Z")

</div>

I wanted to use ruby to receive my office mail. Well I could not. Because net/imap reported “unexpected token: RPAR”. I checked out on google, and I found out that many people had this problem, and it is because of ne…

---

## [Extending Erubis](https://www.ruby-forum.com/t/extending-erubis/149080)

<div class="topic-metadata">

**Author:** [@axyd80](https://www.ruby-forum.com/u/axyd80)\
**Replies:** 0\
**Last updated:** [September 20, 2008, 2:11am UTC](https://www.ruby-forum.com/t/extending-erubis/149080 "2008-09-20T02:11:38Z")

</div>

Hello! I’m developing Web-framework, and have problem, my templates looks like: … Name \<%= @name.to\_html session %\> Completed \<%= @completed.to\_html session %\> ... The problem is - I tired …

---

## [Overwriting hash key](https://www.ruby-forum.com/t/overwriting-hash-key/149074)

<div class="topic-metadata">

**Author:** [@jim](https://www.ruby-forum.com/u/jim)\
**Replies:** 2\
**Last updated:** [September 20, 2008, 1:26am UTC](https://www.ruby-forum.com/t/overwriting-hash-key/149074 "2008-09-20T01:26:41Z")

</div>

How can get Ruby to tell me when I’m overwriting an existing key in my hash? For example, h = { “key1” =\> \[6, 44, 12\], “key2” =\> \[8, 1\], . . } The hash could get big enough where I accidentally add a new entry, …

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

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